diff --git a/5.4.1/reference/html/Guardfile b/5.4.1/reference/html/Guardfile new file mode 100644 index 0000000000..bdd4d72981 --- /dev/null +++ b/5.4.1/reference/html/Guardfile @@ -0,0 +1,20 @@ +require 'asciidoctor' +require 'erb' + +guard 'shell' do + watch(/.*\.adoc$/) {|m| + Asciidoctor.render_file('index.adoc', \ + :in_place => true, \ + :safe => Asciidoctor::SafeMode::UNSAFE, \ + :attributes=> { \ + 'source-highlighter' => 'prettify', \ + 'icons' => 'font', \ + 'linkcss'=> 'true', \ + 'copycss' => 'true', \ + 'doctype' => 'book'}) + } +end + +guard 'livereload' do + watch(%r{^.+\.(css|js|html)$}) +end diff --git a/5.4.1/reference/html/alloydb.html b/5.4.1/reference/html/alloydb.html new file mode 100644 index 0000000000..e68804cb52 --- /dev/null +++ b/5.4.1/reference/html/alloydb.html @@ -0,0 +1,356 @@ + + + + + + + +AlloyDB + + + + + + +
+
+
+ +
+
+

AlloyDB

+
+
+

Spring Framework on Google Cloud adds integrations with +Spring JDBC, so you can run your PostgreSQL databases in Google AlloyDB using Spring JDBC.

+
+
+

The AlloyDB support is provided by Spring Framework on Google Cloud in the form of a Spring Boot AlloyDB starter for PostgreSQL. +The role of the starters is to read configuration from properties and assume default settings so that user experience connecting to PostgreSQL is as simple as possible.

+
+
+

JDBC Support

+
+

Maven and Gradle coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-alloydb</artifactId>
+</dependency>
+
+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-alloydb")
+}
+
+
+
+

Prerequisites

+
+

In order to use the Spring Boot Starters for Google AlloyDB, the Google AlloyDB API must be enabled in your Google Cloud project.

+
+
+

To do that, go to the API library page of the Google Cloud Console, search for "AlloyDB API" and enable the option that is called "AlloyDB API" .

+
+
+
+

Spring Boot Starter for Google AlloyDB

+
+

The Spring Boot Starters for Google AlloyDB provide an autoconfigured DataSource object. +Coupled with Spring JDBC, it provides a +JdbcTemplate object bean that allows for operations such as querying and modifying a database.

+
+
+
+
public List<Map<String, Object>> listUsers() {
+    return jdbcTemplate.queryForList("SELECT * FROM user;");
+}
+
+
+
+
+

You can rely on +Spring Boot data source autoconfiguration to configure a DataSource bean. +In other words, properties like the username, spring.datasource.username, and password, spring.datasource.password can be used. +There is also some configuration specific to Google AlloyDB (see "AlloyDB Configuration Properties" section below).

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.datasource.username

Database username

No

postgres

spring.datasource.password

Database password

No

null

spring.datasource.driver-class-name

JDBC driver to use.

No

org.postgresql.Driver

+
+ + + + + +
+ + +If you provide your own spring.datasource.url, it will be ignored, unless you disable AlloyDB autoconfiguration with spring.cloud.gcp.alloydb.enabled=false. +
+
+
+
DataSource creation flow
+
+

Spring Boot starter for Google AlloyDB registers an AlloyDbEnvironmentPostProcessor that provides a correctly formatted spring.datasource.url property to the environment based on the properties mentioned above. +It also provides defaults for spring.datasource.username and spring.datasource.driver-class-name, which can be overridden. +The starter also configures credentials for the JDBC connection based on the AlloyDB properties below.

+
+
+

The user properties and the properties provided by the AlloyDbEnvironmentPostProcessor are then used by Spring Boot to create the DataSource. +You can select the type of connection pool (e.g., Tomcat, HikariCP, etc.) by adding their dependency to the classpath.

+
+
+

Using the created DataSource in conjunction with Spring JDBC provides you with a fully configured and operational JdbcTemplate object that you can use to interact with your AlloyDB database. +You can connect to your database with as little as a database and instance names.

+
+
+
+
+
+

AlloyDB IAM database authentication

+
+

Currently, AlloyDB supports IAM database authentication. +It allows you to connect to the database using an IAM account, rather than a predefined database username and password. +You will need to do the following to enable it:

+
+
+
    +
  1. +

    In your AlloyDB instance settings, turn on the alloydb.iam_authentication flag.

    +
  2. +
  3. +

    Add the IAM user or service account to the list of cluster users.

    +
  4. +
  5. +

    In the application settings, set spring.cloud.gcp.alloydb.enable-iam-auth to true. Note that this will also set the database protocol sslmode to disabled, as it’s required for IAM authentication to work. +However, it doesn’t compromise the security of the communication because the connection is always encrypted.

    +
  6. +
  7. +

    Set spring.datasource.username to the IAM user or service account created in step 2. Note that IAM user or service account still needs to be granted permissions before modifying or querying the database.

    +
  8. +
+
+
+
+

AlloyDB Configuration Properties

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.cloud.gcp.alloydb.enabled

Enables or disables AlloyDB auto configuration

No

true

spring.cloud.gcp.alloydb.database-name

The name of the database to connect to.

Yes

spring.cloud.gcp.alloydb.instance-connection-uri

The Google AlloyDB instance connection URI.

Yes

For example, projects/PROJECT_ID/locations/REGION_ID/clusters/CLUSTER_ID/instances/INSTANCE_ID.

spring.cloud.gcp.alloydb.ip-type

Specifies a preferred IP type for connecting to a AlloyDB instance. (PUBLIC, PRIVATE, PSC)

No

PRIVATE

spring.cloud.gcp.alloydb.enable-iam-auth

Specifies whether to enable IAM database authentication.

No

False

spring.cloud.gcp.alloydb.admin-service-endpoint

An alternate AlloyDB API endpoint.

No

spring.cloud.gcp.alloydb.quota-project

The project ID for quota and billing.

No

spring.cloud.gcp.alloydb.target-principal

The service account to impersonate when connecting to the database and database admin API.

No

spring.cloud.gcp.alloydb.delegates

A comma-separated list of service accounts delegates.

No

spring.cloud.gcp.alloydb.named-connector

The name of the named connector.

No

+
+ + + + + +
+ + +You need to run your application from a VM within the created VPC to connect to AlloyDB using its private IP. +To connect using Public IP, enable the AlloyDB instance’s for external connections +following these instructions and +add spring.cloud.gcp.alloydb.ip-type=PUBLIC to your application.properties. +
+
+
+
+

Troubleshooting tips

+
+

Connection issues

+
+

If you’re not able to connect to a database and see an endless loop of Connecting to AlloyDB instance […​] on IP […​], it’s likely that exceptions are being thrown and logged at a level lower than your logger’s level. +This may be the case with HikariCP, if your logger is set to INFO or higher level.

+
+
+

To see what’s going on in the background, you should add a logback.xml file to your application resources folder, that looks like this:

+
+
+
+
<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <include resource="org/springframework/boot/logging/logback/base.xml"/>
+  <logger name="com.zaxxer.hikari.pool" level="DEBUG"/>
+</configuration>
+
+
+
+
+

PostgreSQL: java.net.SocketException: already connected issue

+
+

We found this exception to be common if your Maven project’s parent is spring-boot version 1.5.x, or in any other circumstance that would cause the version of the org.postgresql:postgresql dependency to be an older one (e.g., 9.4.1212.jre7).

+
+
+

To fix this, re-declare the dependency in its correct version. +For example, in Maven:

+
+
+
+
<dependency>
+  <groupId>org.postgresql</groupId>
+  <artifactId>postgresql</artifactId>
+  <version>42.7.3</version>
+</dependency>
+
+
+
+
+
+

Samples

+
+

Available sample applications and codelabs:

+
+ +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/appendix.html b/5.4.1/reference/html/appendix.html new file mode 100644 index 0000000000..f88c0d45ef --- /dev/null +++ b/5.4.1/reference/html/appendix.html @@ -0,0 +1,808 @@ + + + + + + + +Common application properties + + + + + + +
+
+
+ +
+
+

Appendix A: Common application properties

+
+
+

Various properties can be specified inside your application.properties file, inside your application.yml file, or as command line switches. +This appendix provides a list of common Spring Framework on Google Cloud properties and references to the underlying classes that consume them.

+
+
+ + + + + +
+ + +Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. +Also, you can define your own properties. +
+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefaultDescription

spring.cloud.gcp.bigquery.credentials.encoded-key

spring.cloud.gcp.bigquery.credentials.location

spring.cloud.gcp.bigquery.credentials.scopes

spring.cloud.gcp.bigquery.dataset-name

Name of the BigQuery dataset to use.

spring.cloud.gcp.bigquery.enabled

true

Auto-configure Google Cloud BigQuery components.

spring.cloud.gcp.bigquery.project-id

Overrides the Google Cloud project ID specified in the Core module to use for BigQuery.

spring.cloud.gcp.config.credentials.encoded-key

spring.cloud.gcp.config.credentials.location

spring.cloud.gcp.config.credentials.scopes

spring.cloud.gcp.config.enabled

true

Auto-configure Google Cloud Runtime components.

spring.cloud.gcp.config.name

Name of the application.

spring.cloud.gcp.config.profile

Comma-delimited string of profiles under which the app is running. Gets its default value from the {@code spring.profiles.active} property, falling back on the {@code spring.profiles.default} property.

spring.cloud.gcp.config.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.config.timeout-millis

60000

Timeout for Google Runtime Configuration API calls.

spring.cloud.gcp.core.enabled

true

Auto-configure Google Cloud Core components.

spring.cloud.gcp.credentials.encoded-key

spring.cloud.gcp.credentials.location

spring.cloud.gcp.credentials.scopes

spring.cloud.gcp.datastore.credentials.encoded-key

spring.cloud.gcp.datastore.credentials.location

spring.cloud.gcp.datastore.credentials.scopes

spring.cloud.gcp.datastore.emulator.consistency

0.9

Consistency to use creating the Datastore server instance. Default: {@code 0.9}

spring.cloud.gcp.datastore.emulator.enabled

false

If enabled the Datastore client will connect to an local datastore emulator.

spring.cloud.gcp.datastore.emulator.port

8081

Is the datastore emulator port. Default: {@code 8081}

spring.cloud.gcp.datastore.enabled

true

Auto-configure Google Cloud Datastore components.

spring.cloud.gcp.datastore.host

The host and port of a Datastore emulator as the following example: localhost:8081.

spring.cloud.gcp.datastore.namespace

spring.cloud.gcp.datastore.project-id

spring.cloud.gcp.firestore.credentials.encoded-key

spring.cloud.gcp.firestore.credentials.location

spring.cloud.gcp.firestore.credentials.scopes

spring.cloud.gcp.firestore.emulator.enabled

false

Enables autoconfiguration to use the Firestore emulator.

spring.cloud.gcp.firestore.enabled

true

Auto-configure Google Cloud Firestore components.

spring.cloud.gcp.firestore.host-port

firestore.googleapis.com:443

The host and port of the Firestore emulator service; can be overridden to specify an emulator.

spring.cloud.gcp.firestore.project-id

spring.cloud.gcp.logging.enabled

true

Auto-configure Google Cloud Stackdriver logging for Spring MVC.

spring.cloud.gcp.metrics.credentials.encoded-key

spring.cloud.gcp.metrics.credentials.location

spring.cloud.gcp.metrics.credentials.scopes

spring.cloud.gcp.metrics.enabled

true

Auto-configure Google Cloud Monitoring for Micrometer.

spring.cloud.gcp.metrics.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.project-id

Google Cloud project ID where services are running.

spring.cloud.gcp.pubsub.binder.enabled

true

Auto-configure Google Cloud Pub/Sub Stream Binder components.

spring.cloud.gcp.pubsub.credentials.encoded-key

spring.cloud.gcp.pubsub.credentials.location

spring.cloud.gcp.pubsub.credentials.scopes

spring.cloud.gcp.pubsub.emulator-host

The host and port of the local running emulator. If provided, this will setup the client to connect against a running pub/sub emulator.

spring.cloud.gcp.pubsub.enabled

true

Auto-configure Google Cloud Pub/Sub components.

spring.cloud.gcp.pubsub.keep-alive-interval-minutes

5

How often to ping the server to keep the channel alive.

spring.cloud.gcp.pubsub.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.pubsub.publisher.batching.delay-threshold-seconds

The delay threshold to use for batching. After this amount of time has elapsed (counting from the first element added), the elements will be wrapped up in a batch and sent.

spring.cloud.gcp.pubsub.publisher.batching.element-count-threshold

The element count threshold to use for batching.

spring.cloud.gcp.pubsub.publisher.batching.enabled

Enables batching if true.

spring.cloud.gcp.pubsub.publisher.batching.flow-control.limit-exceeded-behavior

The behavior when the specified limits are exceeded.

spring.cloud.gcp.pubsub.publisher.batching.flow-control.max-outstanding-element-count

Maximum number of outstanding elements to keep in memory before enforcing flow control.

spring.cloud.gcp.pubsub.publisher.batching.flow-control.max-outstanding-request-bytes

Maximum number of outstanding bytes to keep in memory before enforcing flow control.

spring.cloud.gcp.pubsub.publisher.batching.request-byte-threshold

The request byte threshold to use for batching.

spring.cloud.gcp.pubsub.publisher.executor-threads

4

Number of threads used by every publisher.

spring.cloud.gcp.pubsub.publisher.retry.initial-retry-delay-seconds

InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this value adjusted according to the RetryDelayMultiplier.

spring.cloud.gcp.pubsub.publisher.retry.initial-rpc-timeout-seconds

InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier.

spring.cloud.gcp.pubsub.publisher.retry.jittered

Jitter determines if the delay time should be randomized.

spring.cloud.gcp.pubsub.publisher.retry.max-attempts

MaxAttempts defines the maximum number of attempts to perform. If this value is greater than 0, and the number of attempts reaches this limit, the logic will give up retrying even if the total retry time is still lower than TotalTimeout.

spring.cloud.gcp.pubsub.publisher.retry.max-retry-delay-seconds

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier can’t increase the retry delay higher than this amount.

spring.cloud.gcp.pubsub.publisher.retry.max-rpc-timeout-seconds

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier can’t increase the RPC timeout higher than this amount.

spring.cloud.gcp.pubsub.publisher.retry.retry-delay-multiplier

RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.

spring.cloud.gcp.pubsub.publisher.retry.rpc-timeout-multiplier

RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

spring.cloud.gcp.pubsub.publisher.retry.total-timeout-seconds

TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries can be attempted.

spring.cloud.gcp.pubsub.reactive.enabled

true

Auto-configure Google Cloud Pub/Sub Reactive components.

spring.cloud.gcp.pubsub.subscriber.executor-threads

4

Number of threads used by every subscriber.

spring.cloud.gcp.pubsub.subscriber.flow-control.limit-exceeded-behavior

The behavior when the specified limits are exceeded.

spring.cloud.gcp.pubsub.subscriber.flow-control.max-outstanding-element-count

Maximum number of outstanding elements to keep in memory before enforcing flow control.

spring.cloud.gcp.pubsub.subscriber.flow-control.max-outstanding-request-bytes

Maximum number of outstanding bytes to keep in memory before enforcing flow control.

spring.cloud.gcp.pubsub.subscriber.max-ack-extension-period

0

The optional max ack extension period in seconds for the subscriber factory.

spring.cloud.gcp.pubsub.subscriber.max-acknowledgement-threads

4

Number of threads used for batch acknowledgement.

spring.cloud.gcp.pubsub.subscriber.parallel-pull-count

The optional parallel pull count setting for the subscriber factory.

spring.cloud.gcp.pubsub.subscriber.pull-endpoint

The optional pull endpoint setting for the subscriber factory.

spring.cloud.gcp.pubsub.subscriber.retry.initial-retry-delay-seconds

InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this value adjusted according to the RetryDelayMultiplier.

spring.cloud.gcp.pubsub.subscriber.retry.initial-rpc-timeout-seconds

InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier.

spring.cloud.gcp.pubsub.subscriber.retry.jittered

Jitter determines if the delay time should be randomized.

spring.cloud.gcp.pubsub.subscriber.retry.max-attempts

MaxAttempts defines the maximum number of attempts to perform. If this value is greater than 0, and the number of attempts reaches this limit, the logic will give up retrying even if the total retry time is still lower than TotalTimeout.

spring.cloud.gcp.pubsub.subscriber.retry.max-retry-delay-seconds

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier can’t increase the retry delay higher than this amount.

spring.cloud.gcp.pubsub.subscriber.retry.max-rpc-timeout-seconds

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier can’t increase the RPC timeout higher than this amount.

spring.cloud.gcp.pubsub.subscriber.retry.retry-delay-multiplier

RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.

spring.cloud.gcp.pubsub.subscriber.retry.rpc-timeout-multiplier

RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

spring.cloud.gcp.pubsub.subscriber.retry.total-timeout-seconds

TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries can be attempted.

spring.cloud.gcp.secretmanager.credentials.encoded-key

spring.cloud.gcp.secretmanager.credentials.location

spring.cloud.gcp.secretmanager.credentials.scopes

spring.cloud.gcp.secretmanager.enabled

true

Auto-configure Google Cloud Secret Manager support components.

spring.cloud.gcp.secretmanager.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.security.firebase.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.security.firebase.public-keys-endpoint

www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com

Link to Google’s public endpoint containing Firebase public keys.

spring.cloud.gcp.security.iap.algorithm

ES256

Encryption algorithm used to sign the JWK token.

spring.cloud.gcp.security.iap.audience

Non-dynamic audience string to validate.

spring.cloud.gcp.security.iap.enabled

true

Auto-configure Google Cloud IAP identity extraction components.

spring.cloud.gcp.security.iap.header

x-goog-iap-jwt-assertion

Header from which to extract the JWK key.

spring.cloud.gcp.security.iap.issuer

cloud.google.com/iap

JWK issuer to verify.

spring.cloud.gcp.security.iap.registry

www.gstatic.com/iap/verify/public_key-jwk

Link to JWK public key registry.

spring.cloud.gcp.spanner.create-interleaved-table-ddl-on-delete-cascade

true

spring.cloud.gcp.spanner.credentials.encoded-key

spring.cloud.gcp.spanner.credentials.location

spring.cloud.gcp.spanner.credentials.scopes

spring.cloud.gcp.spanner.database

spring.cloud.gcp.spanner.emulator-host

localhost:9010

spring.cloud.gcp.spanner.emulator.enabled

false

Enables auto-configuration to use the Spanner emulator.

spring.cloud.gcp.spanner.enabled

true

Auto-configure Google Cloud Spanner components.

spring.cloud.gcp.spanner.fail-if-pool-exhausted

false

spring.cloud.gcp.spanner.instance-id

spring.cloud.gcp.spanner.keep-alive-interval-minutes

-1

spring.cloud.gcp.spanner.max-idle-sessions

-1

spring.cloud.gcp.spanner.max-sessions

-1

spring.cloud.gcp.spanner.min-sessions

-1

spring.cloud.gcp.spanner.num-rpc-channels

-1

spring.cloud.gcp.spanner.prefetch-chunks

-1

spring.cloud.gcp.spanner.project-id

spring.cloud.gcp.spanner.write-sessions-fraction

-1

spring.cloud.gcp.sql.credentials

Overrides the Google Cloud OAuth2 credentials specified in the Core module.

spring.cloud.gcp.sql.database-name

Name of the database in the Cloud SQL instance.

spring.cloud.gcp.sql.enabled

true

Auto-configure Google Cloud SQL support components.

spring.cloud.gcp.sql.instance-connection-name

Cloud SQL instance connection name. [GCP_PROJECT_ID]:[INSTANCE_REGION]:[INSTANCE_NAME].

spring.cloud.gcp.sql.ip-types

A comma delimited list of preferred IP types for connecting to the Cloud SQL instance.

spring.cloud.gcp.storage.auto-create-files

spring.cloud.gcp.storage.credentials.encoded-key

spring.cloud.gcp.storage.credentials.location

spring.cloud.gcp.storage.credentials.scopes

spring.cloud.gcp.storage.enabled

true

Auto-configure Google Cloud Storage components.

spring.cloud.gcp.trace.authority

HTTP/2 authority the channel claims to be connecting to.

spring.cloud.gcp.trace.compression

Compression to use for the call.

spring.cloud.gcp.trace.credentials.encoded-key

spring.cloud.gcp.trace.credentials.location

spring.cloud.gcp.trace.credentials.scopes

spring.cloud.gcp.trace.deadline-ms

Call deadline.

spring.cloud.gcp.trace.enabled

true

Auto-configure Google Cloud Stackdriver tracing components.

spring.cloud.gcp.trace.max-inbound-size

Maximum size for an inbound message.

spring.cloud.gcp.trace.max-outbound-size

Maximum size for an outbound message.

spring.cloud.gcp.trace.message-timeout

1

Timeout in seconds before pending spans will be sent in batches to Google Cloud Stackdriver Trace.

spring.cloud.gcp.trace.num-executor-threads

4

Number of threads to be used by the Trace executor.

spring.cloud.gcp.trace.project-id

Overrides the Google Cloud project ID specified in the Core module.

spring.cloud.gcp.trace.wait-for-ready

Waits for the channel to be ready in case of a transient failure. Defaults to failing fast in that case.

spring.cloud.gcp.vision.credentials.encoded-key

spring.cloud.gcp.vision.credentials.location

spring.cloud.gcp.vision.credentials.scopes

spring.cloud.gcp.vision.enabled

true

Auto-configure Google Cloud Vision components.

spring.cloud.gcp.vision.executor-threads-count

1

Number of threads used to poll for the completion of Document OCR operations.

spring.cloud.gcp.vision.json-output-batch-size

20

Number of document pages to include in each JSON output file.

+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/bigquery.html b/5.4.1/reference/html/bigquery.html new file mode 100644 index 0000000000..fb3a05068b --- /dev/null +++ b/5.4.1/reference/html/bigquery.html @@ -0,0 +1,374 @@ + + + + + + + +BigQuery + + + + + + +
+
+
+ +
+
+

BigQuery

+
+
+

Google Cloud BigQuery is a fully managed, petabyte scale, low cost analytics data warehouse.

+
+
+

Spring Framework on Google Cloud provides:

+
+
+
    +
  • +

    A convenience starter which provides autoconfiguration for the BigQuery client objects with credentials needed to interface with BigQuery.

    +
  • +
  • +

    A Spring Integration message handler for loading data into BigQuery tables in your Spring integration pipelines.

    +
  • +
+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-bigquery</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-bigquery")
+}
+
+
+
+

Configuration

+
+

The following application properties may be configured with Spring Framework on Google Cloud BigQuery libraries.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.bigquery.datasetName

The BigQuery dataset that the BigQueryTemplate and BigQueryFileMessageHandler is scoped to.

Yes

spring.cloud.gcp.bigquery.enabled

Enables or disables Spring Framework on Google Cloud BigQuery autoconfiguration.

No

true

spring.cloud.gcp.bigquery.project-id

Google Cloud project ID of the project using BigQuery APIs, if different from the one in the Spring Framework on Google Cloud Core Module.

No

Project ID is typically inferred from gcloud configuration.

spring.cloud.gcp.bigquery.credentials.location

Credentials file location for authenticating with the Google Cloud BigQuery APIs, if different from the ones in the Spring Framework on Google Cloud Core Module

No

Inferred from Application Default Credentials, typically set by gcloud.

spring.cloud.gcp.bigquery.jsonWriterBatchSize

Batch size which will be used by BigQueryJsonDataWriter while using BigQuery Storage Write API. Note too large or too low values might impact performance.

No

1000

spring.cloud.gcp.bigquery.threadPoolSize

The size of thread pool of ThreadPoolTaskScheduler which is used by BigQueryTemplate

No

4

+
+

BigQuery Client Object

+
+

The GcpBigQueryAutoConfiguration class configures an instance of BigQuery for you by inferring your credentials and Project ID from the machine’s environment.

+
+
+

Example usage:

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQuery bigquery;
+
+public void runQuery() throws InterruptedException {
+  String query = "SELECT column FROM table;";
+  QueryJobConfiguration queryConfig =
+      QueryJobConfiguration.newBuilder(query).build();
+
+  // Run the query using the BigQuery object
+  for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) {
+    for (FieldValue val : row) {
+      System.out.println(val);
+    }
+  }
+}
+
+
+
+
+

This object is used to interface with all BigQuery services. +For more information, see the BigQuery Client Library usage examples.

+
+
+
+

BigQueryTemplate

+
+

The BigQueryTemplate class is a wrapper over the BigQuery client object and makes it easier to load data into BigQuery tables. +A BigQueryTemplate is scoped to a single dataset. +The autoconfigured BigQueryTemplate instance will use the dataset provided through the property spring.cloud.gcp.bigquery.datasetName.

+
+
+

Below is a code snippet of how to load a CSV data InputStream to a BigQuery table.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+public void loadData(InputStream dataInputStream, String tableName) {
+  CompletableFuture<Job> bigQueryJobFuture =
+      bigQueryTemplate.writeDataToTable(
+          tableName,
+          dataFile.getInputStream(),
+          FormatOptions.csv());
+
+  // After the future is complete, the data is successfully loaded.
+  Job job = bigQueryJobFuture.get();
+}
+
+
+
+
+

Below is a code snippet of how to load a newline-delimited JSON data InputStream to a BigQuery table. This implementation uses the BigQuery Storage Write API. +Here is a sample newline-delimited JSON file which can be used for testing this functionality.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+  /**
+   * This method loads the InputStream of the newline-delimited JSON records to be written in the given table.
+   * @param tableName name of the table where the data is expected to be written
+   * @param jsonInputStream InputStream of the newline-delimited JSON records to be written in the given table
+   */
+  public void loadJsonStream(String tableName, InputStream jsonInputStream)
+      throws ExecutionException, InterruptedException {
+    CompletableFuture<WriteApiResponse> writeApFuture =
+        bigQueryTemplate.writeJsonStream(tableName, jsonInputStream);
+    WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
+    if (!apiRes.isSuccessful()){
+      List<StorageError> errors = apiRes.getErrors();
+      // TODO(developer): process the List of StorageError
+    }
+    // else the write process has been successful
+  }
+
+
+
+
+

Below is a code snippet of how to create table and then load a newline-delimited JSON data InputStream to a BigQuery table. This implementation uses the BigQuery Storage Write API. +Here is a sample newline-delimited JSON file which can be used for testing this functionality.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+  /**
+   * This method created a table with the given name and schema and then loads the InputStream of the newline-delimited JSON records in it.
+   * @param tableName name of the table where the data is expected to be written
+   * @param jsonInputStream InputStream of the newline-delimited JSON records to be written in the given table
+   * @param tableSchema Schema of the table which is required to be created
+   */
+  public void createTableAndloadJsonStream(String tableName, InputStream jsonInputStream, Schema tableSchema)
+      throws ExecutionException, InterruptedException {
+    CompletableFuture<WriteApiResponse> writeApFuture =
+        bigQueryTemplate.writeJsonStream(tableName, jsonInputStream, tableSchema);//using the overloaded method which created the table when tableSchema is passed
+    WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
+    if (!apiRes.isSuccessful()){
+      List<StorageError> errors = apiRes.getErrors();
+      // TODO(developer): process the List of StorageError
+    }
+    // else the write process has been successful
+  }
+
+
+
+
+
+
+

Spring Integration

+
+

Spring Framework on Google Cloud BigQuery also provides a Spring Integration message handler BigQueryFileMessageHandler. +This is useful for incorporating BigQuery data loading operations in a Spring Integration pipeline.

+
+
+

Below is an example configuring a ServiceActivator bean using the BigQueryFileMessageHandler.

+
+
+
+
@Bean
+public DirectChannel bigQueryWriteDataChannel() {
+  return new DirectChannel();
+}
+
+@Bean
+public DirectChannel bigQueryJobReplyChannel() {
+  return new DirectChannel();
+}
+
+@Bean
+@ServiceActivator(inputChannel = "bigQueryWriteDataChannel")
+public MessageHandler messageSender(BigQueryTemplate bigQueryTemplate) {
+  BigQueryFileMessageHandler messageHandler = new BigQueryFileMessageHandler(bigQueryTemplate);
+  messageHandler.setFormatOptions(FormatOptions.csv());
+  messageHandler.setOutputChannel(bigQueryJobReplyChannel());
+  return messageHandler;
+}
+
+
+
+
+

BigQuery Message Handling

+
+

The BigQueryFileMessageHandler accepts the following message payload types for loading into BigQuery: java.io.File, byte[], org.springframework.core.io.Resource, and java.io.InputStream. +The message payload will be streamed and written to the BigQuery table you specify.

+
+
+

By default, the BigQueryFileMessageHandler is configured to read the headers of the messages it receives to determine how to load the data. +The headers are specified by the class BigQuerySpringMessageHeaders and summarized below.

+
+ ++++ + + + + + + + + + + + + + + +

Header

Description

BigQuerySpringMessageHeaders.TABLE_NAME

Specifies the BigQuery table within your dataset to write to.

BigQuerySpringMessageHeaders.FORMAT_OPTIONS

Describes the data format of your data to load (i.e. CSV, JSON, etc.).

+
+

Alternatively, you may omit these headers and explicitly set the table name or format options by calling setTableName(…​) and setFormatOptions(…​).

+
+
+
+

BigQuery Message Reply

+
+

After the BigQueryFileMessageHandler processes a message to load data to your BigQuery table, it will respond with a Job on the reply channel. +The Job object provides metadata and information about the load file operation.

+
+
+

By default, the BigQueryFileMessageHandler is run in asynchronous mode, with setSync(false), and it will reply with a CompletableFuture<Job> on the reply channel. +The future is tied to the status of the data loading job and will complete when the job completes.

+
+
+

If the handler is run in synchronous mode with setSync(true), then the handler will block on the completion of the loading job and block until it is complete.

+
+
+ + + + + +
+ + +If you decide to use Spring Integration Gateways and you wish to receive CompletableFuture<Job> as a reply object in the Gateway, you will have to call .setAsyncExecutor(null) on your GatewayProxyFactoryBean. +This is needed to indicate that you wish to reply on the built-in async support rather than rely on async handling of the gateway. +
+
+
+
+
+

Sample

+
+

A BigQuery sample application is available.

+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/cloudfoundry.html b/5.4.1/reference/html/cloudfoundry.html new file mode 100644 index 0000000000..951f87e926 --- /dev/null +++ b/5.4.1/reference/html/cloudfoundry.html @@ -0,0 +1,173 @@ + + + + + + + +Cloud Foundry + + + + + + +
+
+
+ +
+
+

Cloud Foundry

+
+
+

Spring Framework on Google Cloud provides support for Cloud Foundry’s GCP Service Broker. +Our Pub/Sub, Cloud Spanner, Storage, Cloud Trace and Cloud SQL MySQL and PostgreSQL starters are Cloud Foundry aware and retrieve properties like project ID, credentials, etc., that are used in auto configuration from the Cloud Foundry environment.

+
+
+

In order to take advantage of the Cloud Foundry support make sure the following dependency is added:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-cloudfoundry</artifactId>
+</dependency>
+
+
+
+

In cases like Pub/Sub’s topic and subscription, or Storage’s bucket name, where those parameters are not used in auto configuration, you can fetch them using the VCAP mapping provided by Spring Boot. +For example, to retrieve the provisioned Pub/Sub topic, you can use the vcap.services.mypubsub.credentials.topic_name property from the application environment.

+
+
+ + + + + +
+ + +If the same service is bound to the same application more than once, the auto configuration will not be able to choose among bindings and will not be activated for that service. +This includes both MySQL and PostgreSQL bindings to the same app. +
+
+
+ + + + + +
+ + +In order for the Cloud SQL integration to work in Cloud Foundry, auto-reconfiguration must be disabled. +You can do so using the cf set-env <APP> JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}' command. +Otherwise, Cloud Foundry will produce a DataSource with an invalid JDBC URL (i.e., jdbc:mysql://null/null). +
+
+
+

User-Provided Services

+
+

User-provided services enable developers to use services that are not available in the marketplace with their apps running on Cloud Foundry. +For example, you may want to use a user-provided service that points to a shared Google Service (like Cloud Spanner) used across your organization.

+
+
+

In order for Spring Framework on Google Cloud to detect your user-provided service as a Google Cloud Service, you must add an instance tag indicating the Google Cloud Service it uses. +The tag should simply be the Cloud Foundry name for the Google Service.

+
+
+

For example, if you create a user-provided service using Cloud Spanner, you might run:

+
+
+
+
$ cf create-user-provided-service user-spanner-service -t "google-spanner" ...
+
+
+
+

This allows Spring Framework on Google Cloud to retrieve the correct service properties from Cloud Foundry and use them in the auto configuration for your application.

+
+
+

A mapping of Google service names to Cloud Foundry names are provided below:

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Google Cloud Service

Cloud Foundry Name (add this as a tag)

Google Cloud Pub/Sub

google-pubsub

Google Cloud Storage

google-storage

Google Cloud Spanner

google-spanner

Datastore

google-datastore

Firestore

google-firestore

BigQuery

google-bigquery

Cloud Trace

google-stackdriver-trace

Cloud Sql (MySQL)

google-cloudsql-mysql

Cloud Sql (PostgreSQL)

google-cloudsql-postgres

+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/config.html b/5.4.1/reference/html/config.html new file mode 100644 index 0000000000..da7a9e7f13 --- /dev/null +++ b/5.4.1/reference/html/config.html @@ -0,0 +1,314 @@ + + + + + + + +Cloud Runtime Configuration API + + + + + + +
+
+
+ +
+
+

Cloud Runtime Configuration API

+
+
+ + + + + +
+ + +The Google Cloud Runtime Configuration service is in Beta status, and is only available in snapshot and milestone versions of the project. It’s also not available in the Spring Framework on Google Cloud BOM, unlike other modules. +
+
+
+

Spring Framework on Google Cloud makes it possible to use the Google Runtime Configuration API as a Spring Cloud Config server to remotely store your application configuration data.

+
+
+

The Spring Framework on Google Cloud Config support is provided via its own Spring Boot starter. +It enables the use of the Google Runtime Configuration API as a source for Spring Boot configuration properties.

+
+
+

Maven coordinates:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-config</artifactId>
+    <version>5.4.1</version>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    compile group: 'org.springframework.cloud',
+    name: 'spring-cloud-gcp-starter-config',
+    version: '5.4.1'
+}
+
+
+
+

Configuration

+
+

The following parameters are configurable in Spring Framework on Google Cloud Config:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.config.enabled

Enables the Config client

No

false

spring.cloud.gcp.config.name

Name of your application

No

Value of the spring.application.name property. +If none, application

spring.cloud.gcp.config.profile

Active profile

No

Value of the spring.profiles.active property. +If more than a single profile, last one is chosen

spring.cloud.gcp.config.timeout-millis

Timeout in milliseconds for connecting to the Google Runtime Configuration API

No

60000

spring.cloud.gcp.config.project-id

Google Cloud project ID where the Google Runtime Configuration API is hosted

No

spring.cloud.gcp.config.credentials.location

OAuth2 credentials for authenticating with the Google Runtime Configuration API

No

spring.cloud.gcp.config.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Runtime Configuration API

No

spring.cloud.gcp.config.credentials.scopes

OAuth2 scope for Spring Framework on Google Cloud Config credentials

No

https://www.googleapis.com/auth/cloudruntimeconfig

+
+ + + + + +
+ + +These properties should be specified in a bootstrap.yml/bootstrap.properties file, rather than the usual applications.yml/application.properties. +
+
+
+ + + + + +
+ + +Core properties, as described in Spring Framework on Google Cloud Core Module, do not apply to Spring Framework on Google Cloud Config. +
+
+
+
+

Quick start

+
+
    +
  1. +

    Create a configuration in the Google Runtime Configuration API that is called ${spring.application.name}_${spring.profiles.active}. +In other words, if spring.application.name is myapp and spring.profiles.active is prod, the configuration should be called myapp_prod.

    +
    +

    In order to do that, you should have the Google Cloud SDK installed, own a Google Cloud Project and run the following command:

    +
    +
    +
    +
    gcloud init # if this is your first Google Cloud SDK run.
    +gcloud beta runtime-config configs create myapp_prod
    +gcloud beta runtime-config configs variables set myapp.queue-size 25 --config-name myapp_prod
    +
    +
    +
  2. +
  3. +

    Configure your bootstrap.properties file with your application’s configuration data:

    +
    +
    +
    spring.application.name=myapp
    +spring.profiles.active=prod
    +
    +
    +
  4. +
  5. +

    Add the @ConfigurationProperties annotation to a Spring-managed bean:

    +
    +
    +
    @Component
    +@ConfigurationProperties("myapp")
    +public class SampleConfig {
    +
    +  private int queueSize;
    +
    +  public int getQueueSize() {
    +    return this.queueSize;
    +  }
    +
    +  public void setQueueSize(int queueSize) {
    +    this.queueSize = queueSize;
    +  }
    +}
    +
    +
    +
  6. +
+
+
+

When your Spring application starts, the queueSize field value will be set to 25 for the above SampleConfig bean.

+
+
+
+

Refreshing the configuration at runtime

+
+

Spring Cloud provides support to have configuration parameters be reloadable with the POST request to /actuator/refresh endpoint.

+
+
+
    +
  1. +

    Add the Spring Boot Actuator dependency:

    +
    +

    Maven coordinates:

    +
    +
    +
    +
    <dependency>
    +    <groupId>org.springframework.boot</groupId>
    +    <artifactId>spring-boot-starter-actuator</artifactId>
    +</dependency>
    +
    +
    +
    +

    Gradle coordinates:

    +
    +
    +
    +
    dependencies {
    +    implementation("org.springframework.boot:spring-boot-starter-actuator")
    +}
    +
    +
    +
  2. +
  3. +

    Add @RefreshScope to your Spring configuration class to have parameters be reloadable at runtime.

    +
  4. +
  5. +

    Add management.endpoints.web.exposure.include=refresh to your application.properties to allow unrestricted access to /actuator/refresh.

    +
  6. +
  7. +

    Update a property with gcloud:

    +
    +
    +
    $ gcloud beta runtime-config configs variables set \
    +  myapp.queue_size 200 \
    +  --config-name myapp_prod
    +
    +
    +
  8. +
  9. +

    Send a POST request to the refresh endpoint:

    +
    +
    +
    $ curl -XPOST https://myapp.host.com/actuator/refresh
    +
    +
    +
  10. +
+
+
+
+

Sample

+
+

A sample application and a codelab are available.

+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/configuration.html b/5.4.1/reference/html/configuration.html new file mode 100644 index 0000000000..b74586180c --- /dev/null +++ b/5.4.1/reference/html/configuration.html @@ -0,0 +1,53 @@ + + + + + + + +Configuration properties + + + + + + +
+
+
+ +
+
+

Configuration properties

+
+
+

To see the list of all Google Cloud related configuration properties please check the Appendix page.

+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/core.html b/5.4.1/reference/html/core.html new file mode 100644 index 0000000000..8a3623af5e --- /dev/null +++ b/5.4.1/reference/html/core.html @@ -0,0 +1,366 @@ + + + + + + + +Spring Framework on Google Cloud Core + + + + + + +
+
+
+ +
+
+

Spring Framework on Google Cloud Core

+
+
+

Each Spring Framework on Google Cloud module uses GcpProjectIdProvider and CredentialsProvider to get the Google Cloud project ID and access credentials.

+
+
+

Spring Framework on Google Cloud provides a Spring Boot starter to auto-configure the core components.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter")
+}
+
+
+
+

Configuration

+
+

The following options may be configured with Spring Cloud core.

+
+ ++++++ + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.core.enabled

Enables or disables Google Cloud core auto configuration

No

true

+
+
+

Project ID

+
+

GcpProjectIdProvider is a functional interface that returns a Google Cloud project ID string.

+
+
+
+
public interface GcpProjectIdProvider {
+	String getProjectId();
+}
+
+
+
+
+

The Spring Framework on Google Cloud starter auto-configures a GcpProjectIdProvider. +If a spring.cloud.gcp.project-id property is specified, the provided GcpProjectIdProvider returns that property value.

+
+
+
+
spring.cloud.gcp.project-id=my-gcp-project-id
+
+
+
+
+

Otherwise, the project ID is discovered based on an +ordered list of rules:

+
+
+
    +
  1. +

    The project ID specified by the GOOGLE_CLOUD_PROJECT environment variable

    +
  2. +
  3. +

    The Google App Engine project ID

    +
  4. +
  5. +

    The project ID specified in the JSON credentials file pointed by the GOOGLE_APPLICATION_CREDENTIALS environment variable

    +
  6. +
  7. +

    The Google Cloud SDK project ID

    +
  8. +
  9. +

    The Google Compute Engine project ID, from the Google Compute Engine Metadata Server

    +
  10. +
+
+
+
+

Credentials

+
+

CredentialsProvider is a functional interface that returns the credentials to authenticate and authorize calls to Google Cloud Client Libraries.

+
+
+
+
public interface CredentialsProvider {
+  Credentials getCredentials() throws IOException;
+}
+
+
+
+
+

The Spring Framework on Google Cloud starter auto-configures a CredentialsProvider. +It uses the spring.cloud.gcp.credentials.location property to locate the OAuth2 private key of a Google service account. +Keep in mind this property is a Spring Resource, so the credentials file can be obtained from a number of different locations such as the file system, classpath, URL, etc. +The next example specifies the credentials location property in the file system.

+
+
+
+
spring.cloud.gcp.credentials.location=file:/usr/local/key.json
+
+
+
+

Alternatively, you can set the credentials by directly specifying the spring.cloud.gcp.credentials.encoded-key property. +The value should be the base64-encoded account private key in JSON format.

+
+
+

If that credentials aren’t specified through properties, the starter tries to discover credentials from a number of places:

+
+
+
    +
  1. +

    Credentials file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable

    +
  2. +
  3. +

    Credentials provided by the Google Cloud SDK gcloud auth application-default login command

    +
  4. +
  5. +

    Google App Engine built-in credentials

    +
  6. +
  7. +

    Google Cloud Shell built-in credentials

    +
  8. +
  9. +

    Google Compute Engine built-in credentials

    +
  10. +
+
+
+

If your app is running on Google App Engine or Google Compute Engine, in most cases, you should omit the spring.cloud.gcp.credentials.location property and, instead, let the Spring Framework on Google Cloud Starter get the correct credentials for those environments. +On App Engine Standard, the App Identity service account credentials are used, on App Engine Flexible, the Flexible service account credential are used and on Google Compute Engine, the Compute Engine Default Service Account is used.

+
+
+

Scopes

+
+

By default, the credentials provided by the Spring Framework on Google Cloud Starter contain scopes for every service supported by Spring Framework on Google Cloud.

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Service

Scope

Spanner

https://www.googleapis.com/auth/spanner.admin, https://www.googleapis.com/auth/spanner.data

Datastore

https://www.googleapis.com/auth/datastore

Pub/Sub

https://www.googleapis.com/auth/pubsub

Storage (Read Only)

https://www.googleapis.com/auth/devstorage.read_only

Storage (Read/Write)

https://www.googleapis.com/auth/devstorage.read_write

Runtime Config

https://www.googleapis.com/auth/cloudruntimeconfig

Trace (Append)

https://www.googleapis.com/auth/trace.append

Cloud Platform

https://www.googleapis.com/auth/cloud-platform

Vision

https://www.googleapis.com/auth/cloud-vision

+
+

The Spring Framework on Google Cloud starter allows you to configure a custom scope list for the provided credentials. +To do that, specify a comma-delimited list of Google OAuth2 scopes in the spring.cloud.gcp.credentials.scopes property.

+
+
+

spring.cloud.gcp.credentials.scopes is a comma-delimited list of Google OAuth2 scopes for Google Cloud services that the credentials returned by the provided CredentialsProvider support.

+
+
+
+
spring.cloud.gcp.credentials.scopes=https://www.googleapis.com/auth/pubsub,https://www.googleapis.com/auth/sqlservice.admin
+
+
+
+

You can also use DEFAULT_SCOPES placeholder as a scope to represent the starters default scopes, and append the additional scopes you need to add.

+
+
+
+
spring.cloud.gcp.credentials.scopes=DEFAULT_SCOPES,https://www.googleapis.com/auth/cloud-vision
+
+
+
+
+
+

Environment

+
+

GcpEnvironmentProvider is a functional interface, auto-configured by the Spring Framework on Google Cloud starter, that returns a GcpEnvironment enum. +The provider can help determine programmatically in which Google Cloud environment (App Engine Flexible, App Engine Standard, Kubernetes Engine or Compute Engine) the application is deployed.

+
+
+
+
public interface GcpEnvironmentProvider {
+	GcpEnvironment getCurrentEnvironment();
+}
+
+
+
+
+
+

Customizing bean scope

+
+

Spring Framework on Google Cloud starters autoconfigure all necessary beans in the default singleton scope. +If you need a particular bean or set of beans to be recreated dynamically (for example, to rotate credentials), there are two options:

+
+
+
    +
  1. +

    Annotate custom beans of the necessary types with @RefreshScope. +This makes the most sense if your application is already redefining those beans.

    +
  2. +
  3. +

    Override the scope for autoconfigured beans by listing them in the Spring Cloud property spring.cloud.refresh.extra-refreshable.

    +
    +

    For example, the beans involved in Cloud Pub/Sub subscription could be marked as refreshable as follows:

    +
    +
  4. +
+
+
+
+
spring.cloud.refresh.extra-refreshable=com.google.cloud.spring.pubsub.support.SubscriberFactory,\
+  com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate
+
+
+
+ + + + + +
+ + +
+

SmartLifecycle beans, such as Spring Integration adapters, do not currently support @RefreshScope. +If your application refreshes any beans used by such SmartLifecycle objects, it may also have to restart the beans manually when RefreshScopeRefreshedEvent is detected, such as in the Cloud Pub/Sub example below:

+
+
+
+
@Autowired
+private PubSubInboundChannelAdapter pubSubAdapter;
+
+@EventListener(RefreshScopeRefreshedEvent.class)
+public void onRefreshScope(RefreshScopeRefreshedEvent event) {
+  this.pubSubAdapter.stop();
+  this.pubSubAdapter.start();
+}
+
+
+
+
+
+
+
+

Spring Initializr

+
+

This starter is available from Spring Initializr through the GCP Support entry.

+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/css/font-awesome.css b/5.4.1/reference/html/css/font-awesome.css new file mode 100755 index 0000000000..ee906a8196 --- /dev/null +++ b/5.4.1/reference/html/css/font-awesome.css @@ -0,0 +1,2337 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome-webfont.eot?v=4.7.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.fa-pull-left { + float: left; +} +.fa-pull-right { + float: right; +} +.fa.fa-pull-left { + margin-right: .3em; +} +.fa.fa-pull-right { + margin-left: .3em; +} +/* Deprecated as of 4.4.0 */ +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook-f:before, +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-feed:before, +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before, +.fa-gratipay:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper-pp:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-resistance:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-y-combinator-square:before, +.fa-yc-square:before, +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} +.fa-buysellads:before { + content: "\f20d"; +} +.fa-connectdevelop:before { + content: "\f20e"; +} +.fa-dashcube:before { + content: "\f210"; +} +.fa-forumbee:before { + content: "\f211"; +} +.fa-leanpub:before { + content: "\f212"; +} +.fa-sellsy:before { + content: "\f213"; +} +.fa-shirtsinbulk:before { + content: "\f214"; +} +.fa-simplybuilt:before { + content: "\f215"; +} +.fa-skyatlas:before { + content: "\f216"; +} +.fa-cart-plus:before { + content: "\f217"; +} +.fa-cart-arrow-down:before { + content: "\f218"; +} +.fa-diamond:before { + content: "\f219"; +} +.fa-ship:before { + content: "\f21a"; +} +.fa-user-secret:before { + content: "\f21b"; +} +.fa-motorcycle:before { + content: "\f21c"; +} +.fa-street-view:before { + content: "\f21d"; +} +.fa-heartbeat:before { + content: "\f21e"; +} +.fa-venus:before { + content: "\f221"; +} +.fa-mars:before { + content: "\f222"; +} +.fa-mercury:before { + content: "\f223"; +} +.fa-intersex:before, +.fa-transgender:before { + content: "\f224"; +} +.fa-transgender-alt:before { + content: "\f225"; +} +.fa-venus-double:before { + content: "\f226"; +} +.fa-mars-double:before { + content: "\f227"; +} +.fa-venus-mars:before { + content: "\f228"; +} +.fa-mars-stroke:before { + content: "\f229"; +} +.fa-mars-stroke-v:before { + content: "\f22a"; +} +.fa-mars-stroke-h:before { + content: "\f22b"; +} +.fa-neuter:before { + content: "\f22c"; +} +.fa-genderless:before { + content: "\f22d"; +} +.fa-facebook-official:before { + content: "\f230"; +} +.fa-pinterest-p:before { + content: "\f231"; +} +.fa-whatsapp:before { + content: "\f232"; +} +.fa-server:before { + content: "\f233"; +} +.fa-user-plus:before { + content: "\f234"; +} +.fa-user-times:before { + content: "\f235"; +} +.fa-hotel:before, +.fa-bed:before { + content: "\f236"; +} +.fa-viacoin:before { + content: "\f237"; +} +.fa-train:before { + content: "\f238"; +} +.fa-subway:before { + content: "\f239"; +} +.fa-medium:before { + content: "\f23a"; +} +.fa-yc:before, +.fa-y-combinator:before { + content: "\f23b"; +} +.fa-optin-monster:before { + content: "\f23c"; +} +.fa-opencart:before { + content: "\f23d"; +} +.fa-expeditedssl:before { + content: "\f23e"; +} +.fa-battery-4:before, +.fa-battery:before, +.fa-battery-full:before { + content: "\f240"; +} +.fa-battery-3:before, +.fa-battery-three-quarters:before { + content: "\f241"; +} +.fa-battery-2:before, +.fa-battery-half:before { + content: "\f242"; +} +.fa-battery-1:before, +.fa-battery-quarter:before { + content: "\f243"; +} +.fa-battery-0:before, +.fa-battery-empty:before { + content: "\f244"; +} +.fa-mouse-pointer:before { + content: "\f245"; +} +.fa-i-cursor:before { + content: "\f246"; +} +.fa-object-group:before { + content: "\f247"; +} +.fa-object-ungroup:before { + content: "\f248"; +} +.fa-sticky-note:before { + content: "\f249"; +} +.fa-sticky-note-o:before { + content: "\f24a"; +} +.fa-cc-jcb:before { + content: "\f24b"; +} +.fa-cc-diners-club:before { + content: "\f24c"; +} +.fa-clone:before { + content: "\f24d"; +} +.fa-balance-scale:before { + content: "\f24e"; +} +.fa-hourglass-o:before { + content: "\f250"; +} +.fa-hourglass-1:before, +.fa-hourglass-start:before { + content: "\f251"; +} +.fa-hourglass-2:before, +.fa-hourglass-half:before { + content: "\f252"; +} +.fa-hourglass-3:before, +.fa-hourglass-end:before { + content: "\f253"; +} +.fa-hourglass:before { + content: "\f254"; +} +.fa-hand-grab-o:before, +.fa-hand-rock-o:before { + content: "\f255"; +} +.fa-hand-stop-o:before, +.fa-hand-paper-o:before { + content: "\f256"; +} +.fa-hand-scissors-o:before { + content: "\f257"; +} +.fa-hand-lizard-o:before { + content: "\f258"; +} +.fa-hand-spock-o:before { + content: "\f259"; +} +.fa-hand-pointer-o:before { + content: "\f25a"; +} +.fa-hand-peace-o:before { + content: "\f25b"; +} +.fa-trademark:before { + content: "\f25c"; +} +.fa-registered:before { + content: "\f25d"; +} +.fa-creative-commons:before { + content: "\f25e"; +} +.fa-gg:before { + content: "\f260"; +} +.fa-gg-circle:before { + content: "\f261"; +} +.fa-tripadvisor:before { + content: "\f262"; +} +.fa-odnoklassniki:before { + content: "\f263"; +} +.fa-odnoklassniki-square:before { + content: "\f264"; +} +.fa-get-pocket:before { + content: "\f265"; +} +.fa-wikipedia-w:before { + content: "\f266"; +} +.fa-safari:before { + content: "\f267"; +} +.fa-chrome:before { + content: "\f268"; +} +.fa-firefox:before { + content: "\f269"; +} +.fa-opera:before { + content: "\f26a"; +} +.fa-internet-explorer:before { + content: "\f26b"; +} +.fa-tv:before, +.fa-television:before { + content: "\f26c"; +} +.fa-contao:before { + content: "\f26d"; +} +.fa-500px:before { + content: "\f26e"; +} +.fa-amazon:before { + content: "\f270"; +} +.fa-calendar-plus-o:before { + content: "\f271"; +} +.fa-calendar-minus-o:before { + content: "\f272"; +} +.fa-calendar-times-o:before { + content: "\f273"; +} +.fa-calendar-check-o:before { + content: "\f274"; +} +.fa-industry:before { + content: "\f275"; +} +.fa-map-pin:before { + content: "\f276"; +} +.fa-map-signs:before { + content: "\f277"; +} +.fa-map-o:before { + content: "\f278"; +} +.fa-map:before { + content: "\f279"; +} +.fa-commenting:before { + content: "\f27a"; +} +.fa-commenting-o:before { + content: "\f27b"; +} +.fa-houzz:before { + content: "\f27c"; +} +.fa-vimeo:before { + content: "\f27d"; +} +.fa-black-tie:before { + content: "\f27e"; +} +.fa-fonticons:before { + content: "\f280"; +} +.fa-reddit-alien:before { + content: "\f281"; +} +.fa-edge:before { + content: "\f282"; +} +.fa-credit-card-alt:before { + content: "\f283"; +} +.fa-codiepie:before { + content: "\f284"; +} +.fa-modx:before { + content: "\f285"; +} +.fa-fort-awesome:before { + content: "\f286"; +} +.fa-usb:before { + content: "\f287"; +} +.fa-product-hunt:before { + content: "\f288"; +} +.fa-mixcloud:before { + content: "\f289"; +} +.fa-scribd:before { + content: "\f28a"; +} +.fa-pause-circle:before { + content: "\f28b"; +} +.fa-pause-circle-o:before { + content: "\f28c"; +} +.fa-stop-circle:before { + content: "\f28d"; +} +.fa-stop-circle-o:before { + content: "\f28e"; +} +.fa-shopping-bag:before { + content: "\f290"; +} +.fa-shopping-basket:before { + content: "\f291"; +} +.fa-hashtag:before { + content: "\f292"; +} +.fa-bluetooth:before { + content: "\f293"; +} +.fa-bluetooth-b:before { + content: "\f294"; +} +.fa-percent:before { + content: "\f295"; +} +.fa-gitlab:before { + content: "\f296"; +} +.fa-wpbeginner:before { + content: "\f297"; +} +.fa-wpforms:before { + content: "\f298"; +} +.fa-envira:before { + content: "\f299"; +} +.fa-universal-access:before { + content: "\f29a"; +} +.fa-wheelchair-alt:before { + content: "\f29b"; +} +.fa-question-circle-o:before { + content: "\f29c"; +} +.fa-blind:before { + content: "\f29d"; +} +.fa-audio-description:before { + content: "\f29e"; +} +.fa-volume-control-phone:before { + content: "\f2a0"; +} +.fa-braille:before { + content: "\f2a1"; +} +.fa-assistive-listening-systems:before { + content: "\f2a2"; +} +.fa-asl-interpreting:before, +.fa-american-sign-language-interpreting:before { + content: "\f2a3"; +} +.fa-deafness:before, +.fa-hard-of-hearing:before, +.fa-deaf:before { + content: "\f2a4"; +} +.fa-glide:before { + content: "\f2a5"; +} +.fa-glide-g:before { + content: "\f2a6"; +} +.fa-signing:before, +.fa-sign-language:before { + content: "\f2a7"; +} +.fa-low-vision:before { + content: "\f2a8"; +} +.fa-viadeo:before { + content: "\f2a9"; +} +.fa-viadeo-square:before { + content: "\f2aa"; +} +.fa-snapchat:before { + content: "\f2ab"; +} +.fa-snapchat-ghost:before { + content: "\f2ac"; +} +.fa-snapchat-square:before { + content: "\f2ad"; +} +.fa-pied-piper:before { + content: "\f2ae"; +} +.fa-first-order:before { + content: "\f2b0"; +} +.fa-yoast:before { + content: "\f2b1"; +} +.fa-themeisle:before { + content: "\f2b2"; +} +.fa-google-plus-circle:before, +.fa-google-plus-official:before { + content: "\f2b3"; +} +.fa-fa:before, +.fa-font-awesome:before { + content: "\f2b4"; +} +.fa-handshake-o:before { + content: "\f2b5"; +} +.fa-envelope-open:before { + content: "\f2b6"; +} +.fa-envelope-open-o:before { + content: "\f2b7"; +} +.fa-linode:before { + content: "\f2b8"; +} +.fa-address-book:before { + content: "\f2b9"; +} +.fa-address-book-o:before { + content: "\f2ba"; +} +.fa-vcard:before, +.fa-address-card:before { + content: "\f2bb"; +} +.fa-vcard-o:before, +.fa-address-card-o:before { + content: "\f2bc"; +} +.fa-user-circle:before { + content: "\f2bd"; +} +.fa-user-circle-o:before { + content: "\f2be"; +} +.fa-user-o:before { + content: "\f2c0"; +} +.fa-id-badge:before { + content: "\f2c1"; +} +.fa-drivers-license:before, +.fa-id-card:before { + content: "\f2c2"; +} +.fa-drivers-license-o:before, +.fa-id-card-o:before { + content: "\f2c3"; +} +.fa-quora:before { + content: "\f2c4"; +} +.fa-free-code-camp:before { + content: "\f2c5"; +} +.fa-telegram:before { + content: "\f2c6"; +} +.fa-thermometer-4:before, +.fa-thermometer:before, +.fa-thermometer-full:before { + content: "\f2c7"; +} +.fa-thermometer-3:before, +.fa-thermometer-three-quarters:before { + content: "\f2c8"; +} +.fa-thermometer-2:before, +.fa-thermometer-half:before { + content: "\f2c9"; +} +.fa-thermometer-1:before, +.fa-thermometer-quarter:before { + content: "\f2ca"; +} +.fa-thermometer-0:before, +.fa-thermometer-empty:before { + content: "\f2cb"; +} +.fa-shower:before { + content: "\f2cc"; +} +.fa-bathtub:before, +.fa-s15:before, +.fa-bath:before { + content: "\f2cd"; +} +.fa-podcast:before { + content: "\f2ce"; +} +.fa-window-maximize:before { + content: "\f2d0"; +} +.fa-window-minimize:before { + content: "\f2d1"; +} +.fa-window-restore:before { + content: "\f2d2"; +} +.fa-times-rectangle:before, +.fa-window-close:before { + content: "\f2d3"; +} +.fa-times-rectangle-o:before, +.fa-window-close-o:before { + content: "\f2d4"; +} +.fa-bandcamp:before { + content: "\f2d5"; +} +.fa-grav:before { + content: "\f2d6"; +} +.fa-etsy:before { + content: "\f2d7"; +} +.fa-imdb:before { + content: "\f2d8"; +} +.fa-ravelry:before { + content: "\f2d9"; +} +.fa-eercast:before { + content: "\f2da"; +} +.fa-microchip:before { + content: "\f2db"; +} +.fa-snowflake-o:before { + content: "\f2dc"; +} +.fa-superpowers:before { + content: "\f2dd"; +} +.fa-wpexplorer:before { + content: "\f2de"; +} +.fa-meetup:before { + content: "\f2e0"; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} diff --git a/5.4.1/reference/html/css/site.css b/5.4.1/reference/html/css/site.css new file mode 100755 index 0000000000..1e660829dd --- /dev/null +++ b/5.4.1/reference/html/css/site.css @@ -0,0 +1,7 @@ +/* + +Source Available at https://github.com/spring-io/asciidoctor-spring-backend */ + + +:root{--html-font-size:1em;--pixel-to-rem:16 * 1rem;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-weight:400;--monospace-font-family:"SFMono-Regular","Consolas","Liberation Mono","Menlo",monospace;--body-background-color:#fff;--panel-background-color:#f6f8fa;--panel-group-background-color:#e1e8e8;--panel-border-color:#eaedf0;--color-accent-1:#ebf2f2;--color-accent-2:#d7e7e7;--color-accent-3:#6db33f;--body-font-color:#191e1e;--body-font-light-color:#273030;--body-font-dark-color:#141818;--link-font-color:#1565c0;--hover-link-font-color:#104d92;--scrollbar-thumb-color:silver;--mark-background-color:#39ff14;--selected-background-color:#191e1e;--layout-banner-logo-offset:18px;--layout-banner-logo-height:50px;--layout-max-width:1400px;--layout-banner-height:80px;--layout-border-color:var(--color-accent-1);--layout-switchtheme-invert-filter:invert();--layout-switchtheme-background-color:var(--body-background-color);--layout-switchtheme-button-color:var(--body-background-color);--layout-switchtheme-button-hover-color:var(--color-accent-1);--asciidoctor-doc-embellishment-margin-width:250px;--asciidoctor-doc-background-embellishment-height:147px;--asciidoctor-details-background:var(--color-accent-1);--asciidoctor-details-font-color:var(--body-font-light-color);--asciidoctor-author-separator-color:var(--color-accent-3);--asciidoctor-panel-background:var(--panel-background-color);--asciidoctor-panel-border-color:var(--panel-border-color);--asciidoctor-font-color:var(--body-font-color);--asciidoctor-heading-font-color:var(--body-font-dark-color);--asciidoctor-heading-font-weight:600;--asciidoctor-alt-heading-font-weight:600;--asciidoctor-section-divider-color:var(--color-accent-1);--asciidoctor-link-font-color:var(--link-font-color);--asciidoctor-hover-link-font-color:var(--hover-link-font-color);--asciidoctor-unresolved-link-font-color:#d32f2f;--asciidoctor-code-font-color:var(--asciidoctor-font-color);--asciidoctor-code-link-font-color:var(--link-font-color);--asciidoctor-code-background:rgba(27,31,35,.05);--asciidoctor-code-data-lang-color:#999;--asciidoctor-table-border-color:var(--asciidoctor-panel-border-color);--asciidoctor-table-header-footer-background:var(--color-accent-1);--asciidoctor-table-stripe-background:var(--color-accent-1);--asciidoctor-table-footer-background:linear-gradient(to bottom,var(--color-accent-1) 0%,var(--body-background-color) 100%);--asciidoctor-admonition-background:var(--color-accent-1);--asciidoctor-admonition-pre-background:var(--color-accent-2);--asciidoctor-admonition-label-font-weight:500;--asciidoctor-admonition-font-color:#f0f0f0;--asciidoctor-admonition-caution-background:#561164;--asciidoctor-admonition-important-background:#960000;--asciidoctor-admonition-note-background:#015785;--asciidoctor-admonition-tip-background:#3e6b1f;--asciidoctor-admonition-warning-background:#bd7400;--asciidoctor-abstract-background:var(--asciidoctor-panel-background);--asciidoctor-abstract-border-color:var(--asciidoctor-panel-border-color);--asciidoctor-quote-background:var(--color-accent-1);--asciidoctor-quote-border-color:var(--color-accent-3);--asciidoctor-quote-attribution-font-color:var(--color-accent-3);--asciidoctor-caption-font-color:var(--body-font-light-color);--asciidoctor-caption-font-weight:400;--asciidoctor-example-background:var(--asciidoctor-panel-background);--asciidoctor-example-border-color:var(--asciidoctor-panel-border-color);--asciidoctor-sidebar-background:var(--color-accent-1);--asciidoctor-pre-background:var(--asciidoctor-panel-background);--asciidoctor-pre-border-color:var(--asciidoctor-panel-border-color);--asciidoctor-callout-background:var(--body-font-dark-color);--asciidoctor-callout-font-color:var(--body-background-color);--asciidoctor-footer-font-color:#b6b6b6;--highlight-background-color:var(--asciidoctor-pre-background);--highlight-font-color:#24292e;--highlight-keyword-font-color:#d73a49;--highlight-comment-font-color:#6a737d;--highlight-string-font-color:#032f62;--highlight-meta-font-color:#6a737d;--highlight-constant-font-color:#032f62;--highlight-variable-font-color:#005cc5;--highlight-tag-font-color:#22863a;--highlight-tag-attribute-font-color:#6f42c1;--highlight-type-font-color:#6f42c1;--highlight-link-font-color:var(--link-font-color);--highlight-addition-font-color:#22863a;--highlight-deletion-font-color:#24292e;--highlight-regex-font-color:#032f62;--tabs-border-color:var(--selected-background-color);--tabs-background-color:var(--body-background-color);--tabs-font-color:var(--body-font-color);--tabs-selected-background-color:var(--selected-background-color);--tabs-selected-font-color:var(--body-background-color);--tabs-hover-font-color:var(--hover-link-font-color);--tabs-hover-background:var(--color-accent-1);--tabs-group-background-color:var(--panel-group-background-color);--toc-width:24rem;--toc-display:block;--toc-font-color:var(--body-font-color);--toc-hover-background-color:var(--color-accent-1);--toc-active-background-color:var(--selected-background-color);--toc-active-font-color:var(--body-background-color);--toc-back-to-index-filter:none;--toc-bar-display:none;--toc-bar-height:0;--toc-bar-button-filter:none;--codetools-button-filter:none;--codetools-button-active-filter:invert();--codetools-background-color:var(--body-background-color);--codetools-border-color:rgba(0,0,0,.3);--codetools-hover-background-color:var(--color-accent-1);--codetools-divider-color:var(--codetools-border-color);--codetools-popup-background-color:var(--selected-background-color);--codetools-popup-font-color:var(--body-background-color)}@media screen and (max-width:1024px){:root{--toc-width:16rem;--asciidoctor-doc-embellishment-margin-width:140px}}@media screen and (max-width:800px){:root{--layout-banner-height:51px;--layout-banner-logo-height:30px;--layout-banner-logo-offset:10px;--layout-border-color:var(--body-background-color);--toc-bar-display:block;--toc-bar-height:24px;--toc-width:0;--toc-display:none;--asciidoctor-doc-embellishment-margin-width:0}}html.dark-theme{--font-weight:300;--body-background-color:#1b1f23;--panel-background-color:#262a2d;--panel-group-background-color:#303741;--panel-border-color:#2c3135;--color-accent-1:#272c33;--color-accent-1-invert:#d8d3cc;--color-accent-2:#2d333a;--color-accent-3:#6db33f;--body-font-color:#bbbcbe;--body-font-light-color:#abacaf;--body-font-dark-color:#cecfd1;--link-font-color:#086dc3;--hover-link-font-color:#107ddd;--scrollbar-thumb-color:#5f5f5f;--mark-background-color:#2eca12;--selected-background-color:#8d8d8d;--layout-switchtheme-invert-filter:none;--layout-switchtheme-background-color:var(--selected-background-color);--asciidoctor-code-background:rgba(177,209,241,.15);--asciidoctor-code-data-lang-color:#6e6e6e;--asciidoctor-admonition-font-color:#f0f0f0;--asciidoctor-admonition-caution-background:#603668;--asciidoctor-admonition-important-background:#924040;--asciidoctor-admonition-note-background:#355463;--asciidoctor-admonition-tip-background:#4d6340;--asciidoctor-admonition-warning-background:#967745;--asciidoctor-footer-font-color:#5e5e5e;--highlight-background-color:var(--asciidoctor-pre-background);--highlight-font-color:#f6f8fa;--highlight-keyword-font-color:#ea4a5a;--highlight-comment-font-color:#959da5;--highlight-string-font-color:#79b8ff;--highlight-meta-font-color:#959da5;--highlight-constant-font-color:#79b8ff;--highlight-variable-font-color:#c8e1ff;--highlight-tag-font-color:#7bcc72;--highlight-tag-attribute-font-color:#b392f0;--highlight-type-font-color:#b392f0;--highlight-link-font-color:#1565c0;--highlight-addition-font-color:#7bcc72;--highlight-deletion-font-color:#f6f8fa;--highlight-regex-font-color:#79b8ff;--toc-back-to-index-filter:invert();--toc-bar-button-filter:invert();--codetools-button-filter:invert();--codetools-button-active-filter:none;--codetools-hover-background-color:var(--color-accent-1-invert);--codetools-border-color:hsla(0,0%,100%,.274);--codetools-divider-color:rgba(44,44,44,.274)}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}body{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none}html{font-size:var(--html-font-size);height:100%;min-width:340px;scroll-behavior:smooth}body{background-color:var(--body-background-color);color:var(--body-font-color);font-family:var(--font-family);font-weight:var(--font-weight);margin:0;overflow-wrap:anywhere;overscroll-behavior:none}a{text-decoration:none}a:hover{text-decoration:underline}a:active{background-color:none}code,kbd,pre{font-family:var(--monospace-font-family)}@supports (scrollbar-width:thin){body *{scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}}table{word-wrap:normal;border-collapse:collapse}mark{background:var(--mark-background-color)}#banner-container{border-bottom:1px solid var(--layout-border-color);height:var(--layout-banner-height);overflow:hidden}#banner{background:no-repeat top var(--layout-banner-logo-offset) left var(--layout-banner-logo-offset) /auto var(--layout-banner-logo-height);background-image:url(../img/banner-logo.svg);height:100%}#doc{overflow:auto}.contained{margin:0 auto;max-width:var(--layout-max-width)}#switch-theme label,div#switch-theme{display:none}html.js div#switch-theme{display:block;float:right;margin:8px 6px 0 0}#switch-theme input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:no-repeat url(../img/octicons-16.svg#view-sun) 90% 50%/16px 16px,no-repeat url(../img/octicons-16.svg#view-moon) 10% 50%/16px 16px;background-color:var(--layout-switchtheme-background-color);height:22px;outline:none;position:relative;width:40px}#switch-theme input,#switch-theme input:before{border-radius:25px;filter:var(--layout-switchtheme-invert-filter)}#switch-theme input:before{background-color:var(--layout-switchtheme-button-color);content:"";height:18px;left:2px;position:absolute;top:2px;transition:transform .2s;width:18px}#switch-theme:hover input:before{background-color:var(--layout-switchtheme-button-hover-color)}#switch-theme input:checked:before{transform:translateX(18px)}.doc{color:var(--asciidoctor-font-color);-webkit-hyphens:none;hyphens:none;letter-spacing:-.0027777778rem;line-height:1.6;margin:0}.doc #content,.doc #footer{margin:0 2rem}.doc #header>:not(#toc){margin-left:2rem;margin-right:2rem}.doc #content{padding-bottom:4rem}#doc{background:no-repeat 100% 0/305px 147px;background-image:url(../img/doc-background.svg)}.doc #header{margin-right:var(--asciidoctor-doc-embellishment-margin-width)}.doc #header .details{background:var(--asciidoctor-details-background);color:var(--asciidoctor-details-font-color);font-size:.8em;font-weight:600;padding:1rem 1.5rem}.doc #header div.details{display:flex;flex-wrap:wrap}#header .details br{display:none}.doc #header .details span.author:not(:last-of-type):after{color:var(--asciidoctor-author-separator-color);content:"\2022";font-weight:400;margin:.4em}.doc #header .details span.last-author:after{display:none}.doc #header .details #revnumber{flex-basis:100%;font-weight:200;margin-top:.5rem;text-transform:capitalize}.doc #preamble+.sect1,.doc .sect1+.sect1{margin-top:2rem}.doc .sect1+.sect1{border-top:1px solid var(--asciidoctor-section-divider-color)}.doc h1{font-size:2.3em}.doc h2{font-size:2em}.doc h3{font-size:1.7em}.doc h4{font-size:1.6em}.doc h5{font-size:1.4em}.doc h6{font-size:1.3em}.doc h1,.doc h2,.doc h3,.doc h4,.doc h5,.doc h6{color:var(--asciidoctor-heading-font-color);font-weight:var(--asciidoctor-heading-font-weight);-webkit-hyphens:none;hyphens:none;line-height:1.3;margin:1.3rem 0 0;padding-top:1.8rem}.doc h1.sect0{background:var(--asciidoctor-abstract-background);font-size:1.8em;margin:1.5rem -1rem 0;padding:.5rem 1rem}.doc h1:first-child{margin:1.3rem 0}.doc h2:not(.discrete){margin-left:-1rem;margin-right:-1rem;padding:1.8rem 1rem .1rem}.doc h3:not(.discrete){font-weight:var(--asciidoctor-alt-heading-font-weight)}.doc h1 .anchor,.doc h2 .anchor,.doc h3 .anchor,.doc h4 .anchor,.doc h5 .anchor,.doc h6 .anchor{font-weight:400;margin-left:-2ex;padding-left:.5ex;position:absolute;text-decoration:none;visibility:hidden;width:2.25ex}.doc h1 .anchor:before,.doc h2 .anchor:before,.doc h3 .anchor:before,.doc h4 .anchor:before,.doc h5 .anchor:before,.doc h6 .anchor:before{content:"\0023"}.doc h1:hover .anchor,.doc h2:hover .anchor,.doc h3:hover .anchor,.doc h4:hover .anchor,.doc h5:hover .anchor,.doc h6:hover .anchor{visibility:visible}.doc dl,.doc p{margin:0}.doc a.bare{-webkit-hyphens:none;hyphens:none}.doc a{color:var(--asciidoctor-link-font-color)}.doc a:hover{color:var(--asciidoctor-hover-link-font-color)}.doc a.unresolved{color:var(--asciidoctor-unresolved-link-font-color)}.doc .admonitionblock code,.doc p code,.doc thead code{background:var(--asciidoctor-code-background);border-radius:.25em;color:var(--asciidoctor-code-font-color);font-size:.95em;padding:.125em .25em}.doc .admonitionblock a code,.doc p a code,.doc thead a code{color:var(--asciidoctor-code-link-font-color)}.doc code,.doc pre{-webkit-hyphens:none;hyphens:none}.doc pre{font-size:calc(14/var(--pixel-to-rem));line-height:1.3;margin:0}.doc .listingblock pre:not(.highlight),.doc .literalblock pre,.doc pre.highlight code{background:var(--asciidoctor-pre-background);border-radius:4px;box-shadow:inset 0 0 1.75px var(--asciidoctor-pre-border-color);display:block;overflow-x:auto;padding:.95rem}.doc pre.highlight code[data-lang]:before{color:var(--asciidoctor-code-data-lang-color);content:attr(data-lang);display:block;font-size:.65em;line-height:1;position:absolute;right:.3rem;text-transform:uppercase;top:.3rem}.doc pre.highlight{position:relative}.doc table pre.highlight code[data-lang]:before{display:none}.doc blockquote{margin:0}.doc .paragraph.lead>p{font-size:calc(18/var(--pixel-to-rem))}.doc .dlist,.doc .exampleblock,.doc .hdlist,.doc .imageblock,.doc .listingblock,.doc .literalblock,.doc .olist,.doc .paragraph,.doc .partintro,.doc .quoteblock,.doc .sidebarblock,.doc .ulist,.doc .verseblock,.doc details,.doc hr{margin:1rem 0 0}.doc table.tableblock{display:block;overflow-x:auto;width:100%}.doc table.tableblock td{min-width:6rem}.doc table.tableblock{font-size:calc(15/var(--pixel-to-rem));margin:1.5rem 0 0}.doc table.tableblock+*{margin-top:2rem}.doc td.tableblock>.content>:first-child{margin-top:0}.doc table.tableblock td,.doc table.tableblock th{padding:.5rem}.doc table.tableblock thead th{border-bottom:2.5px solid var(--asciidoctor-table-border-color)}.doc table.tableblock td,.doc table.tableblock>:not(thead) th{border-bottom:1px solid var(--asciidoctor-table-border-color);border-top:1px solid var(--asciidoctor-table-border-color)}.doc table.stripes-all>tbody>tr,.doc table.stripes-even>tbody>tr:nth-of-type(2n),.doc table.stripes-hover>tbody>tr:hover,.doc table.stripes-odd>tbody>tr:nth-of-type(odd){background:var(--asciidoctor-table-stripe-background)}.doc table.tableblock>tfoot{background:var(--asciidoctor-table-footer-background)}.doc .listingblock.wrap pre,.doc .tableblock code,.doc .tableblock pre{white-space:pre-wrap}.doc td:first-child .listingblock.wrap pre,.doc td:first-child .tableblock code,.doc td:first-child .tableblock pre{white-space:nowrap}.doc .admonitionblock{margin:2.5rem 0}.doc .admonitionblock p,.doc .admonitionblock td.content{font-size:calc(16/var(--pixel-to-rem))}.doc .admonitionblock td.content>.title+*,.doc .admonitionblock td.content>:not(.title):first-child{margin-top:0}.doc .admonitionblock pre{border:none;font-size:calc(14/var(--pixel-to-rem))}.doc .admonitionblock>table{position:relative;table-layout:fixed;width:100%}.doc .admonitionblock td.content{word-wrap:anywhere;background:var(--asciidoctor-admonition-background);padding:1rem 1rem .75rem;width:100%}.doc .admonitionblock td.icon{border-radius:.45rem;font-size:calc(16/var(--pixel-to-rem));left:0;line-height:1;padding:.25em .075em;position:absolute;top:0;transform:translate(-.5rem,-50%)}.doc .admonitionblock .icon i{align-items:center;background-position:.5em 0;background-repeat:no-repeat;display:inline-flex;filter:invert(100%);height:16px;padding-left:2em;vertical-align:initial;width:auto}.doc .admonitionblock .icon i:after{border-left:1px solid hsla(0,0%,100%,.3);color:var(--asciidoctor-admonition-font-color);content:attr(title);filter:invert(100%);font-style:normal;font-weight:var(--asciidoctor-admonition-label-font-weight);-webkit-hyphens:none;hyphens:none;margin:-.05em;padding:0 .5em;text-transform:capitalize}i.fa{background-size:16px 16px}i.fa.icon-caution{background-image:url(../img/octicons-16.svg#view-flame)}i.fa.icon-important{background-image:url(../img/octicons-16.svg#view-stop)}i.fa.icon-note{background-image:url(../img/octicons-16.svg#view-info)}i.fa.icon-tip{background-image:url(../img/octicons-16.svg#view-light-bulb)}i.fa.icon-warning{background-image:url(../img/octicons-16.svg#view-alert)}.doc .admonitionblock.caution td.icon{background:var(--asciidoctor-admonition-caution-background)}.doc .admonitionblock.important td.icon{background:var(--asciidoctor-admonition-important-background)}.doc .admonitionblock.note .icon{background:var(--asciidoctor-admonition-note-background)}.doc .admonitionblock.tip .icon{background:var(--asciidoctor-admonition-tip-background)}.doc .admonitionblock.warning .icon{background-color:var(--asciidoctor-admonition-warning-background)}.doc .imageblock{align-items:center;display:flex;flex-direction:column}.doc .image>img,.doc .imageblock img{display:inline-block;height:auto;max-width:100%;vertical-align:middle}.doc .image:not(.left):not(.right)>img{margin-top:-.2em}.doc #preamble .abstract blockquote{background:var(--asciidoctor-abstract-background);border-left:5px solid var(--asciidoctor-abstract-border-color);font-size:calc(16/var(--pixel-to-rem));padding:.75em 1em}.doc .quoteblock,.doc .verseblock{background:var(--asciidoctor-quote-background);border-left:5px solid var(--asciidoctor-quote-border-color)}.doc .quoteblock{padding:.25rem 2rem 1.25rem}.doc .quoteblock .attribution{color:var(--asciidoctor-quote-attribution-font-color);font-size:calc(15/var(--pixel-to-rem));margin-top:.75rem}.doc .quoteblock blockquote{margin-top:1rem}.doc .quoteblock .paragraph{font-style:italic}.doc .quoteblock cite{padding-left:1em}.doc .verseblock{font-size:1.15em;padding:1rem 2rem}.doc .verseblock pre{font-family:inherit;font-size:inherit}.doc ol,.doc ul{margin:0;padding:0 0 0 2rem}.doc ol.none,.doc ol.unnumbered,.doc ol.unstyled,.doc ul.checklist,.doc ul.no-bullet,.doc ul.none,.doc ul.unstyled{list-style-type:none}.doc ol.unnumbered,.doc ul.no-bullet{padding-left:1.25rem}.doc ol.unstyled,.doc ul.unstyled{padding-left:0}.doc ul.circle,.doc ul.disc,.doc ul.square{list-style-type:square}.doc ol.arabic{list-style-type:decimal}.doc ol.decimal{list-style-type:decimal-leading-zero}.doc ol.loweralpha{list-style-type:lower-alpha}.doc ol.upperalpha{list-style-type:upper-alpha}.doc ol.lowerroman{list-style-type:lower-roman}.doc ol.upperroman{list-style-type:upper-roman}.doc ol.lowergreek{list-style-type:lower-greek}.doc ul.checklist{padding-left:.5rem}.doc ul.checklist p>i.fa-check-square-o:first-child,.doc ul.checklist p>i.fa-square-o:first-child{display:inline-flex;justify-content:center;width:1.25rem}.doc ul.checklist i.fa-check-square-o:before{content:"\2713"}.doc ul.checklist i.fa-square-o:before{content:"\274f"}.doc .dlist .dlist,.doc .dlist .olist,.doc .dlist .ulist,.doc .olist .dlist,.doc .olist .olist,.doc .olist .ulist,.doc .ulist .dlist,.doc .ulist .olist,.doc .ulist .ulist{margin-top:.5rem}.doc .olist li,.doc .ulist li{margin-bottom:.3rem}.doc .admonitionblock .listingblock,.doc .olist .listingblock,.doc .ulist .listingblock{padding:0}.doc .admonitionblock .title,.doc .exampleblock .title,.doc .imageblock .title,.doc .listingblock .title,.doc .literalblock .title,.doc .openblock .title,.doc .tableblock caption{color:var(--asciidoctor-caption-font-color);font-size:calc(14/var(--pixel-to-rem));font-style:italic;font-weight:var(--asciidoctor-caption-font-weight);-webkit-hyphens:none;hyphens:none;letter-spacing:.01em;padding-bottom:.075rem;text-align:left}.doc .imageblock .title{margin-top:.5rem;padding-bottom:0}.doc .exampleblock>.content{background:var(--asciidoctor-example-background);border:1px solid var(--asciidoctor-example-border-color);border-radius:4px;padding:.75rem}.doc .exampleblock>.content>:first-child{margin-top:0}.doc .sidebarblock{background:var(--asciidoctor-sidebar-background);padding:2.2rem}.doc .sidebarblock>.content>.title{font-size:calc(23/var(--pixel-to-rem));font-weight:var(--asciidoctor-alt-heading-font-weight);line-height:1.3;margin-bottom:1.2rem}.doc .sidebarblock>.content>:not(.title):first-child{margin-top:0}.doc b.button{white-space:nowrap}.doc b.button:before{content:"[";padding-right:.25em}.doc b.button:after{content:"]";padding-left:.25em}.doc .menuseq,.doc .path{-webkit-hyphens:none;hyphens:none}.doc .menuseq i.caret:before{content:"\203a";font-size:1.1em;font-weight:var(--asciidoctor-body-font-weight-bold);line-height:.90909}.doc kbd{background:var(--asciidoctor-kbd-background);border:1px solid var(--asciidoctor-kbd-border-color);border-radius:.25em;box-shadow:0 1px 0 var(--asciidoctor-kbd-border-color),0 0 0 .1em var(--body-background) inset;display:inline-block;font-size:calc(12/var(--pixel-to-rem));padding:.25em .5em;vertical-align:text-bottom;white-space:nowrap}.doc .keyseq,.doc kbd{line-height:1}.doc .keyseq{font-size:calc(16/var(--pixel-to-rem))}.doc .keyseq kbd{margin:0 .125em}.doc .keyseq kbd:first-child{margin-left:0}.doc .keyseq kbd:last-child{margin-right:0}.doc i.fa{font-style:normal;-webkit-hyphens:none;hyphens:none}.doc .language-console .hljs-meta{-webkit-user-select:none;-moz-user-select:none;user-select:none}.doc .dlist dt{font-style:italic}.doc .dlist dd{margin:0 0 .25rem 1.5rem}.doc .dlist dd:last-of-type{margin-bottom:0}.doc td.hdlist1,.doc td.hdlist2{padding:.5rem 0 0;vertical-align:top}.doc tr:first-child>.hdlist1,.doc tr:first-child>.hdlist2{padding-top:0}.doc td.hdlist1{font-weight:var(--body-font-weight-bold);padding-right:.25rem}.doc td.hdlist2{padding-left:.25rem}.doc .colist{font-size:calc(16/var(--pixel-to-rem));margin:.25rem 0 -.25rem}.doc .colist>table>tbody>tr>:first-child,.doc .colist>table>tr>:first-child{padding:.25em .5rem 0;vertical-align:top}.doc .colist>table>tbody>tr>:last-child,.doc .colist>table>tr>:last-child{padding:.25rem 0}.doc .conum[data-value]{background:var(--asciidoctor-callout-background);border-radius:100%;color:var(--asciidoctor-callout-font-color);display:inline-block;font-family:var(--monospace-font-family);font-size:calc(12.5/var(--pixel-to-rem));font-style:normal;height:1.25em;letter-spacing:-.25ex;line-height:1.2;text-align:center;text-indent:-.25ex;width:1.25em}.doc .conum[data-value]:after{content:attr(data-value)}.doc .conum[data-value]+b{display:none}.doc hr{border:solid var(--asciidoctor-section-divider-color);border-width:2px 0 0;height:0}.doc :not(pre).nowrap{white-space:nowrap}.doc .nobreak{word-wrap:normal;-webkit-hyphens:none;hyphens:none}.doc .right{float:right}.doc .left{float:left}.doc .stretch{width:100%}.doc .underline{text-decoration:underline}.doc .line-through{text-decoration:line-through}.doc .halign-left{text-align:left}.doc .halign-right{text-align:right}.doc .halign-center{text-align:center}.doc .valign-top{vertical-align:top}.doc .valign-bottom{vertical-align:bottom}.doc .valign-middle{vertical-align:middle}#footer #footer-text{border-top:1px solid var(--asciidoctor-section-divider-color);color:var(--asciidoctor-footer-font-color);font-size:calc(14/var(--pixel-to-rem));padding:2rem 0}html.dark-theme #doc{background:no-repeat 100% 0/305px 147px;background-image:url(../img/doc-background-dark.svg)}@media screen and (max-width:1024px){#doc{background:no-repeat 100% 0/203px 95px;background-image:url(../img/doc-background.svg)}html.dark-theme #doc{background:no-repeat 100% 0/203px 95px;background-image:url(../img/doc-background-dark.svg)}}@media screen and (max-width:800px){#doc,html.dark-theme #doc{background:none}}.hljs{background:var(--highlight-background-color);color:var(--highlight-font-color);display:block;overflow-x:auto;padding:.5em}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:var(--highlight-keyword-font-color)}.hljs-comment,.hljs-quote{color:var(--highlight-comment-font-color)}.hljs-doctag,.hljs-string{color:var(--highlight-string-font-color)}.hljs-meta{color:var(--highlight-meta-font-color)}.hljs-built_in,.hljs-builtin-name,.hljs-literal,.hljs-number,.hljs-symbol{color:var(--highlight-constant-font-color)}.hljs-template-variable,.hljs-variable{color:var(--highlight-variable-font-color)}.hljs-attribute,.hljs-name,.hljs-tag{color:var(--highlight-tag-font-color)}.hljs-tag .hljs-attr{color:var(--highlight-tag-attribute-font-color)}.hljs-class .hljs-title,.hljs-type{color:var(--highlight-type-font-color)}.hljs-regexp{color:var(--highlight-regex-font-color)}.hljs-link{color:var(--highlight-link-font-color);text-decoration:underline}.hljs-addition{color:var(--highlight-addition-font-color)}.hljs-deletion{color:var(--highlight-deletion-font-color)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.language-json .hljs-literal,.language-json .hljs-number{color:var(--highlight-variable-font-color)}.language-json .hljs-attr{color:var(--highlight-string-font-color)}.hidden{display:none}.doc .tabs{border-style:none;bottom:0;display:inline-block;font-size:calc(12/var(--pixel-to-rem));font-weight:700;margin-bottom:calc(2/var(--pixel-to-rem));margin-top:.5rem;position:relative}.doc .tab,.doc .tab:not(:first-child){border:1px solid var(--tabs-border-color)}.doc .tab{background-color:var(--tabs-background-color);border-radius:0;color:var(--tabs-font-color);cursor:pointer;display:inline-block;margin-bottom:calc(2/var(--pixel-to-rem));padding:.3rem .6rem;transition:background-color .2s}.doc .tab:hover{background-color:var(--tabs-hover-background);color:var(--tabs-hover-font-color);text-decoration:underline}.doc .tab.selected{background-color:var(--tabs-selected-background-color);border-color:var(--tabs-selected-background-color);color:var(--tabs-selected-font-color)}.doc .tab.selected:hover{color:var(--tabs-selected-font-color);text-decoration:none}.doc div.openblock.tabs-content>.content{background-color:var(--tabs-group-background-color);padding:1rem}body.toc-left #doc{border-left:1px solid var(--layout-border-color);margin-left:var(--toc-width);overflow:auto}#toc{border-right:1px solid var(--layout-border-color);display:var(--toc-display);font-size:.95rem;line-height:1.1;margin-left:calc(var(--toc-width)*-1);padding:1.7rem 1rem 0;position:absolute;top:var(--layout-banner-height);width:var(--toc-width)}#toctitle{display:none}#toc ol,#toc ul{padding:0}#toc ul ol,#toc ul ul{padding-left:.8rem}#toc li{display:block;list-style:none}#toc a{border-radius:4px;color:var(--toc-font-color);display:block;padding:.4rem .6rem;text-decoration:none}#toc a:hover{background-color:var(--toc-hover-background-color)}body.fixed-toc #toc{height:100%;overflow-x:hidden;position:fixed;top:0}#toc li.active>a{background-color:var(--toc-active-background-color);color:var(--toc-active-font-color)}#toc>ol ol,#toc>ul ul{display:none}#toc li.active>ol,#toc li.active>ul,#toc ol.expanded,#toc ul.expanded{display:block}#back-to-index{display:block;margin-bottom:.6rem}#back-to-index a{margin-bottom:.6rem;margin-top:-.9rem;padding-left:1.6rem}#back-to-index a:before{background:no-repeat 50%/16px 16px;background-image:url(../img/octicons-16.svg#view-chevron-left);content:"";display:block;filter:var(--toc-back-to-index-filter);left:1.4rem;min-height:16px;min-width:16px;position:absolute}#tocbar-container{background-color:var(--body-background-color);border-bottom:1px solid var(--panel-border-color);display:var(--toc-bar-display);height:var(--tocbar-height);width:100%;z-index:10000}#tocbar{height:100%;padding-left:6px;width:100%}body.fixed-toc #tocbar-container{position:fixed;top:0}button#toggle-toc{background:no-repeat 50%/16px 16px;background-image:url(../img/octicons-16.svg#view-three-bars);border:none;display:block;filter:var(--toc-bar-button-filter);height:var(--toc-bar-height);outline:none;padding:0;width:var(--toc-bar-height)}body.show-toc button#toggle-toc{background-image:url(../img/octicons-16.svg#view-x)}@media screen and (max-width:800px){body.fixed-toc #toc{top:var(--toc-bar-height)}#toc{background-color:var(--body-background-color);height:100%;left:0;top:calc(var(--layout-banner-height) + var(--toc-bar-height));width:100%;z-index:10000}body.show-toc #toc{display:block}}div.codetools{--button-width:28px;--button-height:24px;--arrow-size:5px;background:var(--codetools-background-color);border:1px solid var(--codetools-border-color);border-radius:2px;bottom:9px;display:flex;opacity:0;padding:0;position:absolute;right:8px;transition:opacity .15s ease-in-out}.doc pre.highlight:hover div.codetools{opacity:1}div.codetools button{background:no-repeat 50%/16px 16px;border:none;filter:var(--codetools-button-filter);height:var(--button-height);outline:none;padding:0;width:var(--button-width)}div.codetools button:not(:last-child){border-right:1px solid var(--codetools-divider-color)}div.codetools button:hover{background-color:var(--codetools-hover-background-color);transition:filter .3s}div.codetools button:active{filter:var(--codetools-button-active-filter);transition:filter none}div.codetools button span.label{display:none}div.codetools button.copy-button{background-image:url(../img/octicons-16.svg#view-clippy)}div.codetools button.unfold-button{background-image:url(../img/octicons-16.svg#view-unfold)}div.codetools button.fold-button{background-image:url(../img/octicons-16.svg#view-fold)}div.codetools span.copied{content:"";display:block;height:var(--button-height);opacity:0;position:relative;transition:opacity .5s;width:var(--button-width);z-index:1000000}div.codetools button:active span.copied{filter:invert();transition:filter none}div.codetools span.copied:before{border:var(--arrow-size) solid var(--codetools-popup-background-color);border-color:transparent transparent var(--codetools-popup-background-color) transparent;bottom:calc(var(--arrow-size)*-1);content:"";left:50%;margin-left:calc(var(--arrow-size)/-2);position:absolute}div.codetools span.copied:after{background-color:var(--codetools-popup-background-color);border-radius:3px;color:var(--codetools-popup-font-color);content:"Copied to clipboard!";font-weight:700;margin-right:calc(var(--button-width)*-1);padding:5px 8px;position:absolute;right:100%;top:calc(var(--button-height) + var(--arrow-size))}div.codetools button.clicked span.copied{opacity:1}span.fold-block{clear:left;float:left;overflow:hidden;padding-right:.75rem;position:relative}code.unfolded span.fold-block.hide-when-folded,code:not(.unfolded) span.fold-block.hide-when-unfolded{max-height:99999px;opacity:1}code.unfolded span.fold-block.hide-when-unfolded,code:not(.unfolded) span.fold-block.hide-when-folded{max-height:0;opacity:0}code.unfolding span.fold-block.hide-when-folded{max-height:600px;opacity:1}code.folding span.fold-block.hide-when-unfolded{max-height:400px;opacity:1}code.folding span.fold-block.hide-when-folded,code.unfolding span.fold-block.hide-when-unfolded{max-height:0;opacity:0}code.unfolding span.fold-block.hide-when-unfolded{transition:max-height .2s cubic-bezier(0,1,0,1),opacity .2s linear}code.folding span.fold-block.hide-when-unfolded,code.unfolding span.fold-block.hide-when-folded{transition:max-height .2s cubic-bezier(1,0,1,0),opacity .2s linear}code.folding span.fold-block.hide-when-folded{transition:max-height .2s cubic-bezier(0,1,0,1),opacity .2s linear} +/*# sourceMappingURL=site.css.map */ diff --git a/5.4.1/reference/html/css/site.css.map b/5.4.1/reference/html/css/site.css.map new file mode 100755 index 0000000000..da9ab6958a --- /dev/null +++ b/5.4.1/reference/html/css/site.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["settings.css","settings-dark.css","generic.css","elements.css","layout.css","asciidoctor.css","highlight.css","tabs.css","toc.css","codetools.css"],"names":[],"mappings":";;;;;AAgBA,MAIE,oBAAqB,CACrB,wBAAyB,CACzB,kJAEmB,CACnB,iBAAkB,CAClB,uFACoB,CACpB,4BAA8B,CAC9B,gCAAiC,CACjC,sCAAuC,CACvC,4BAA6B,CAC7B,wBAAyB,CACzB,wBAAyB,CACzB,wBAAyB,CACzB,yBAA0B,CAC1B,+BAAgC,CAChC,8BAA+B,CAC/B,yBAA0B,CAC1B,+BAAgC,CAChC,8BAA+B,CAC/B,+BAAgC,CAChC,mCAAoC,CAGpC,gCAAiC,CACjC,gCAAiC,CACjC,yBAA0B,CAC1B,2BAA4B,CAC5B,2CAA4C,CAC5C,2CAA4C,CAC5C,kEAAmE,CACnE,8DAA+D,CAC/D,6DAA8D,CAG9D,kDAAmD,CACnD,uDAAwD,CACxD,sDAAuD,CACvD,6DAA8D,CAC9D,0DAA2D,CAC3D,4DAA6D,CAC7D,0DAA2D,CAC3D,+CAAgD,CAChD,4DAA6D,CAC7D,qCAAsC,CACtC,yCAA0C,CAC1C,yDAA0D,CAC1D,oDAAqD,CACrD,gEAAiE,CACjE,gDAAiD,CACjD,2DAA4D,CAC5D,yDAA0D,CAC1D,gDAAqD,CACrD,uCAAwC,CACxC,sEAAuE,CACvE,kEAAmE,CACnE,2DAA4D,CAC5D,2HAIC,CACD,yDAA0D,CAC1D,6DAA8D,CAC9D,8CAA+C,CAC/C,2CAA4C,CAC5C,mDAAoD,CACpD,qDAAsD,CACtD,gDAAiD,CACjD,+CAAgD,CAChD,mDAAoD,CACpD,qEAAsE,CACtE,yEAA0E,CAC1E,oDAAqD,CACrD,sDAAuD,CACvD,gEAAiE,CACjE,6DAA8D,CAC9D,qCAAsC,CACtC,oEAAqE,CACrE,wEAAyE,CACzE,sDAAuD,CACvD,gEAAiE,CACjE,oEAAqE,CACrE,4DAA6D,CAC7D,6DAA8D,CAC9D,uCAAwC,C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CAMV,mCACF,CAEA,uCACE,SACF,CAEA,qBAIE,kCAAwC,CACxC,WAAY,CAFZ,qCAAsC,CADtC,2BAA4B,CAK5B,YAAa,CADb,SAAU,CALV,yBAOF,CAEA,sCACE,qDACF,CAEA,2BACE,wDAAyD,CACzD,qBACF,CAEA,4BACE,4CAA6C,CAC7C,sBACF,CAEA,gCACE,YACF,CAEA,iCACE,wDACF,CAEA,mCACE,wDACF,CAEA,iCACE,sDACF,CAEA,0BAGE,UAAW,CADX,aAAc,CAId,2BAA4B,CAL5B,SAAU,CAGV,iBAAkB,CAIlB,sBAAyB,CAHzB,yBAA0B,CAE1B,eAEF,CAEA,wCACE,eAAgB,CAChB,sBACF,CAEA,iCAME,sEAAuE,CACvE,wFACa,CANb,iCAAoC,CAGpC,UAAW,CAFX,QAAS,CACT,sCAAyC,CAHzC,iBAQF,CAEA,gCAME,wDAAyD,CAGzD,iBAAkB,CAFlB,uCAAwC,CANxC,8BAA+B,CAS/B,eAAiB,CALjB,yCAA4C,CAG5C,eAAgB,CANhB,iBAAkB,CAElB,UAAW,CADX,kDAQF,CAEA,yCACE,SACF,CAEA,gBAGE,UAAW,CADX,UAAW,CAGX,eAAgB,CADhB,oBAAsB,CAHtB,iBAKF,CAEA,sGAEE,kBAAmB,CACnB,SACF,CAEA,sGAEE,YAAe,CACf,SACF,CAEA,gDACE,gBAAiB,CACjB,SACF,CAEA,gDACE,gBAAiB,CACjB,SACF,CAEA,gGAEE,YAAa,CACb,SACF,CAEA,kDACE,kEACF,CAMA,gGACE,kEACF,CAEA,8CACE,kEACF","file":"site.css","sourcesContent":["/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n:root {\n /* NOTE: Don't use relative `url()` values in here. Safari load them properly */\n\n /* General */\n --html-font-size: 1em;\n --pixel-to-rem: 16 * 1rem;\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\n Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\",\n \"Segoe UI Symbol\";\n --font-weight: 400;\n --monospace-font-family: \"SFMono-Regular\", \"Consolas\", \"Liberation Mono\",\n \"Menlo\", monospace;\n --body-background-color: white;\n --panel-background-color: #f6f8fa;\n --panel-group-background-color: #e1e8e8;\n --panel-border-color: #eaedf0;\n --color-accent-1: #ebf2f2;\n --color-accent-2: #d7e7e7;\n --color-accent-3: #6db33f;\n --body-font-color: #191e1e;\n --body-font-light-color: #273030;\n --body-font-dark-color: #141818;\n --link-font-color: #1565c0;\n --hover-link-font-color: #104d92;\n --scrollbar-thumb-color: silver;\n --mark-background-color: #39ff14;\n --selected-background-color: #191e1e;\n\n /* Layout */\n --layout-banner-logo-offset: 18px;\n --layout-banner-logo-height: 50px;\n --layout-max-width: 1400px;\n --layout-banner-height: 80px;\n --layout-border-color: var(--color-accent-1);\n --layout-switchtheme-invert-filter: invert();\n --layout-switchtheme-background-color: var(--body-background-color);\n --layout-switchtheme-button-color: var(--body-background-color);\n --layout-switchtheme-button-hover-color: var(--color-accent-1);\n\n /* Asciidoctor */\n --asciidoctor-doc-embellishment-margin-width: 250px;\n --asciidoctor-doc-background-embellishment-height: 147px;\n --asciidoctor-details-background: var(--color-accent-1);\n --asciidoctor-details-font-color: var(--body-font-light-color);\n --asciidoctor-author-separator-color: var(--color-accent-3);\n --asciidoctor-panel-background: var(--panel-background-color);\n --asciidoctor-panel-border-color: var(--panel-border-color);\n --asciidoctor-font-color: var(--body-font-color);\n --asciidoctor-heading-font-color: var(--body-font-dark-color);\n --asciidoctor-heading-font-weight: 600;\n --asciidoctor-alt-heading-font-weight: 600;\n --asciidoctor-section-divider-color: var(--color-accent-1);\n --asciidoctor-link-font-color: var(--link-font-color);\n --asciidoctor-hover-link-font-color: var(--hover-link-font-color);\n --asciidoctor-unresolved-link-font-color: #d32f2f;\n --asciidoctor-code-font-color: var(--asciidoctor-font-color);\n --asciidoctor-code-link-font-color: var(--link-font-color);\n --asciidoctor-code-background: rgba(27, 31, 35, 0.05);\n --asciidoctor-code-data-lang-color: #999;\n --asciidoctor-table-border-color: var(--asciidoctor-panel-border-color);\n --asciidoctor-table-header-footer-background: var(--color-accent-1);\n --asciidoctor-table-stripe-background: var(--color-accent-1);\n --asciidoctor-table-footer-background: linear-gradient(\n to bottom,\n var(--color-accent-1) 0%,\n var(--body-background-color) 100%\n );\n --asciidoctor-admonition-background: var(--color-accent-1);\n --asciidoctor-admonition-pre-background: var(--color-accent-2);\n --asciidoctor-admonition-label-font-weight: 500;\n --asciidoctor-admonition-font-color: #f0f0f0;\n --asciidoctor-admonition-caution-background: #561164;\n --asciidoctor-admonition-important-background: #960000;\n --asciidoctor-admonition-note-background: #015785;\n --asciidoctor-admonition-tip-background: #3e6b1f;\n --asciidoctor-admonition-warning-background: #bd7400;\n --asciidoctor-abstract-background: var(--asciidoctor-panel-background);\n --asciidoctor-abstract-border-color: var(--asciidoctor-panel-border-color);\n --asciidoctor-quote-background: var(--color-accent-1);\n --asciidoctor-quote-border-color: var(--color-accent-3);\n --asciidoctor-quote-attribution-font-color: var(--color-accent-3);\n --asciidoctor-caption-font-color: var(--body-font-light-color);\n --asciidoctor-caption-font-weight: 400;\n --asciidoctor-example-background: var(--asciidoctor-panel-background);\n --asciidoctor-example-border-color: var(--asciidoctor-panel-border-color);\n --asciidoctor-sidebar-background: var(--color-accent-1);\n --asciidoctor-pre-background: var(--asciidoctor-panel-background);\n --asciidoctor-pre-border-color: var(--asciidoctor-panel-border-color);\n --asciidoctor-callout-background: var(--body-font-dark-color);\n --asciidoctor-callout-font-color: var(--body-background-color);\n --asciidoctor-footer-font-color: #b6b6b6;\n\n /* Highlight JS (colors based on https://github.com/primer/github-syntax-light) */\n --highlight-background-color: var(--asciidoctor-pre-background);\n --highlight-font-color: #24292e;\n --highlight-keyword-font-color: #d73a49;\n --highlight-comment-font-color: #6a737d;\n --highlight-string-font-color: #032f62;\n --highlight-meta-font-color: #6a737d;\n --highlight-constant-font-color: #032f62;\n --highlight-variable-font-color: #005cc5;\n --highlight-tag-font-color: #22863a;\n --highlight-tag-attribute-font-color: #6f42c1;\n --highlight-type-font-color: #6f42c1;\n --highlight-link-font-color: var(--link-font-color);\n --highlight-addition-font-color: #22863a;\n --highlight-deletion-font-color: #24292e;\n --highlight-regex-font-color: #032f62;\n\n /* Tabs */\n --tabs-border-color: var(--selected-background-color);\n --tabs-background-color: var(--body-background-color);\n --tabs-font-color: var(--body-font-color);\n --tabs-selected-background-color: var(--selected-background-color);\n --tabs-selected-font-color: var(--body-background-color);\n --tabs-hover-font-color: var(--hover-link-font-color);\n --tabs-hover-background: var(--color-accent-1);\n --tabs-group-background-color: var(--panel-group-background-color);\n\n /* TOC */\n --toc-width: 24rem;\n --toc-display: block;\n --toc-font-color: var(--body-font-color);\n --toc-hover-background-color: var(--color-accent-1);\n --toc-active-background-color: var(--selected-background-color);\n --toc-active-font-color: var(--body-background-color);\n --toc-back-to-index-filter: none;\n --toc-bar-display: none;\n --toc-bar-height: 0;\n --toc-bar-button-filter: none;\n\n /* Code Tools */\n --codetools-button-filter: none;\n --codetools-button-active-filter: invert();\n --codetools-background-color: var(--body-background-color);\n --codetools-border-color: rgba(0, 0, 0, 0.3);\n --codetools-hover-background-color: var(--color-accent-1);\n --codetools-divider-color: var(--codetools-border-color);\n --codetools-popup-background-color: var(--selected-background-color);\n --codetools-popup-font-color: var(--body-background-color);\n}\n\n/* Responsive Overrides */\n\n@media screen and (max-width: 1024px) {\n :root {\n --toc-width: 16rem;\n --asciidoctor-doc-embellishment-margin-width: 140px;\n }\n}\n\n@media screen and (max-width: 800px) {\n :root {\n --layout-banner-height: 51px;\n --layout-banner-logo-height: 30px;\n --layout-banner-logo-offset: 10px;\n --layout-border-color: var(--body-background-color);\n --toc-bar-display: block;\n --toc-bar-height: 24px;\n --toc-width: 0;\n --toc-display: none;\n --asciidoctor-doc-embellishment-margin-width: 0;\n }\n}\n","html.dark-theme {\n /* General */\n --font-weight: 300;\n --body-background-color: #1b1f23;\n --panel-background-color: #262a2d;\n --panel-group-background-color: #303741;\n --panel-border-color: #2c3135;\n --color-accent-1: #272c33;\n --color-accent-1-invert: #d8d3cc;\n --color-accent-2: #2d333a;\n --color-accent-3: #6db33f;\n --body-font-color: #bbbcbe;\n --body-font-light-color: #abacaf;\n --body-font-dark-color: #cecfd1;\n --link-font-color: #086dc3;\n --hover-link-font-color: #107ddd;\n --scrollbar-thumb-color: #5f5f5f;\n --mark-background-color: #2eca12;\n --selected-background-color: #8d8d8d;\n\n /* Layout */\n --layout-switchtheme-invert-filter: none;\n --layout-switchtheme-background-color: var(--selected-background-color);\n\n /* Asciidoctor */\n --asciidoctor-code-background: rgba(177, 209, 241, 0.15);\n --asciidoctor-code-data-lang-color: #6e6e6e;\n --asciidoctor-admonition-font-color: #f0f0f0;\n --asciidoctor-admonition-caution-background: #603668;\n --asciidoctor-admonition-important-background: #924040;\n --asciidoctor-admonition-note-background: #355463;\n --asciidoctor-admonition-tip-background: #4d6340;\n --asciidoctor-admonition-warning-background: #967745;\n --asciidoctor-footer-font-color: #5e5e5e;\n\n /* Highlight JS (colors based on https://github.com/primer/github-syntax-dark) */\n --highlight-background-color: var(--asciidoctor-pre-background);\n --highlight-font-color: #f6f8fa;\n --highlight-keyword-font-color: #ea4a5a;\n --highlight-comment-font-color: #959da5;\n --highlight-string-font-color: #79b8ff;\n --highlight-meta-font-color: #959da5;\n --highlight-constant-font-color: #79b8ff;\n --highlight-variable-font-color: #c8e1ff;\n --highlight-tag-font-color: #7bcc72;\n --highlight-tag-attribute-font-color: #b392f0;\n --highlight-type-font-color: #b392f0;\n --highlight-link-font-color: #1565c0;\n --highlight-addition-font-color: #7bcc72;\n --highlight-deletion-font-color: #f6f8fa;\n --highlight-regex-font-color: #79b8ff;\n\n /* TOC */\n --toc-back-to-index-filter: invert();\n --toc-bar-button-filter: invert();\n\n /* Code Tools */\n --codetools-button-filter: invert();\n --codetools-button-active-filter: none;\n --codetools-hover-background-color: var(--color-accent-1-invert);\n --codetools-border-color: rgba(255, 255, 255, 0.274);\n --codetools-divider-color: rgba(44, 44, 44, 0.274);\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nhtml {\n box-sizing: border-box;\n}\n\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n}\n\nbody {\n text-size-adjust: none;\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nhtml {\n height: 100%;\n font-size: var(--html-font-size);\n scroll-behavior: smooth;\n min-width: 340px;\n}\n\nbody {\n margin: 0;\n overflow-wrap: anywhere;\n overscroll-behavior: none;\n font-family: var(--font-family);\n font-weight: var(--font-weight);\n color: var(--body-font-color);\n background-color: var(--body-background-color);\n}\n\na {\n text-decoration: none;\n}\n\na:hover {\n text-decoration: underline;\n}\n\na:active {\n background-color: none;\n}\n\ncode,\nkbd,\npre {\n font-family: var(--monospace-font-family);\n}\n\n@supports (scrollbar-width: thin) {\n body * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color) transparent;\n }\n}\n\ntable {\n border-collapse: collapse;\n word-wrap: normal;\n}\n\nmark {\n background: var(--mark-background-color);\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#banner-container {\n height: var(--layout-banner-height);\n overflow: hidden;\n border-bottom: 1px solid var(--layout-border-color);\n}\n\n#banner {\n height: 100%;\n background: no-repeat top var(--layout-banner-logo-offset) left\n var(--layout-banner-logo-offset) / auto var(--layout-banner-logo-height);\n background-image: url(\"../img/banner-logo.svg\");\n}\n\n#doc {\n overflow: auto;\n}\n\n.contained {\n max-width: var(--layout-max-width);\n margin: 0 auto;\n}\n\ndiv#switch-theme,\n#switch-theme label {\n display: none;\n}\n\nhtml.js div#switch-theme {\n display: block;\n float: right;\n margin: 8px 6px 0 0;\n}\n\n#switch-theme input {\n appearance: none;\n position: relative;\n width: 40px;\n height: 22px;\n filter: var(--layout-switchtheme-invert-filter);\n background: no-repeat url(\"../img/octicons-16.svg#view-sun\") 90% 50% / 16px\n 16px,\n no-repeat url(\"../img/octicons-16.svg#view-moon\") 10% 50% / 16px 16px;\n background-color: var(--layout-switchtheme-background-color);\n border-radius: 25px;\n outline: none;\n}\n\n#switch-theme input::before {\n filter: var(--layout-switchtheme-invert-filter);\n content: \"\";\n position: absolute;\n left: 2px;\n top: 2px;\n height: 18px;\n width: 18px;\n border-radius: 25px;\n background-color: var(--layout-switchtheme-button-color);\n transition: transform 200ms;\n}\n\n#switch-theme:hover input::before {\n background-color: var(--layout-switchtheme-button-hover-color);\n}\n\n#switch-theme input:checked::before {\n transform: translateX(18px);\n}\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\n\n/* Asciidoctor styling based on https://gitlab.com/antora/antora-ui-default/-/blob/8751b86b76d6779fbbcf0fccd58fafcf73c49260/src/css/doc.css */\n\n/* Container element styling */\n\n.doc {\n color: var(--asciidoctor-font-color);\n hyphens: none;\n line-height: 1.6;\n letter-spacing: -0.0027777778rem;\n margin: 0;\n}\n\n/* Gutter and margins */\n\n.doc #content,\n.doc #footer {\n margin: 0 2rem;\n}\n\n.doc #header > *:not(#toc) {\n /* Gutter is not applied directly to #header of toc positioning */\n margin-left: 2rem;\n margin-right: 2rem;\n}\n\n.doc #content {\n padding-bottom: 4rem;\n}\n\n/* Doc background embellishment */\n\n#doc {\n background: no-repeat top right / 305px 147px;\n background-image: url(\"../img/doc-background.svg\");\n}\n\n.doc #header {\n margin-right: var(--asciidoctor-doc-embellishment-margin-width);\n}\n\n/* Header Details */\n\n.doc #header .details {\n background: var(--asciidoctor-details-background);\n color: var(--asciidoctor-details-font-color);\n padding: 1rem 1.5rem;\n font-weight: 600;\n font-size: 0.8em;\n}\n\n.doc #header div.details {\n display: flex;\n flex-wrap: wrap;\n}\n\n#header .details br {\n display: none;\n}\n\n.doc #header .details span.author:not(:last-of-type)::after {\n content: \"\\2022\";\n font-weight: 400;\n margin: 0.4em;\n color: var(--asciidoctor-author-separator-color);\n}\n\n.doc #header .details span.last-author::after {\n display: none;\n}\n\n.doc #header .details #revnumber {\n flex-basis: 100%;\n margin-top: 0.5rem;\n text-transform: capitalize;\n font-weight: 200;\n}\n\n/* Section setup */\n\n.doc #preamble + .sect1,\n.doc .sect1 + .sect1 {\n margin-top: 2rem;\n}\n\n.doc .sect1 + .sect1 {\n border-top: 1px solid var(--asciidoctor-section-divider-color);\n}\n\n/* Headings */\n\n.doc h1 {\n font-size: 2.3em;\n}\n\n.doc h2 {\n font-size: 2em;\n}\n\n.doc h3 {\n font-size: 1.7em;\n}\n\n.doc h4 {\n font-size: 1.6em;\n}\n\n.doc h5 {\n font-size: 1.4em;\n}\n\n.doc h6 {\n font-size: 1.3em;\n}\n\n.doc h1,\n.doc h2,\n.doc h3,\n.doc h4,\n.doc h5,\n.doc h6 {\n color: var(--asciidoctor-heading-font-color);\n font-weight: var(--asciidoctor-heading-font-weight);\n hyphens: none;\n line-height: 1.3;\n margin: 1.3rem 0 0;\n padding-top: 1.8rem;\n}\n\n.doc h1.sect0 {\n background: var(--asciidoctor-abstract-background);\n font-size: 1.8em;\n margin: 1.5rem -1rem 0;\n padding: 0.5rem 1rem;\n}\n\n.doc h1:first-child {\n margin: 1.3rem 0;\n}\n\n.doc h2:not(.discrete) {\n margin-left: -1rem;\n margin-right: -1rem;\n padding: 1.8rem 1rem 0.1rem;\n}\n\n.doc h3:not(.discrete) {\n font-weight: var(--asciidoctor-alt-heading-font-weight);\n}\n\n/* Header hover anchors */\n\n.doc h1 .anchor,\n.doc h2 .anchor,\n.doc h3 .anchor,\n.doc h4 .anchor,\n.doc h5 .anchor,\n.doc h6 .anchor {\n position: absolute;\n text-decoration: none;\n width: 2.25ex;\n margin-left: -2ex;\n padding-left: 0.5ex;\n visibility: hidden;\n font-weight: normal;\n}\n\n.doc h1 .anchor::before,\n.doc h2 .anchor::before,\n.doc h3 .anchor::before,\n.doc h4 .anchor::before,\n.doc h5 .anchor::before,\n.doc h6 .anchor::before {\n content: \"\\0023\";\n}\n\n.doc h1:hover .anchor,\n.doc h2:hover .anchor,\n.doc h3:hover .anchor,\n.doc h4:hover .anchor,\n.doc h5:hover .anchor,\n.doc h6:hover .anchor {\n visibility: visible;\n}\n\n.doc p,\n.doc dl {\n margin: 0;\n}\n\n/* General anchors */\n\n.doc a.bare {\n hyphens: none;\n}\n\n.doc a {\n color: var(--asciidoctor-link-font-color);\n}\n\n.doc a:hover {\n color: var(--asciidoctor-hover-link-font-color);\n}\n\n.doc a.unresolved {\n color: var(--asciidoctor-unresolved-link-font-color);\n}\n\n/* Code and Pre */\n\n.doc p code,\n.doc thead code,\n.doc .admonitionblock code {\n color: var(--asciidoctor-code-font-color);\n background: var(--asciidoctor-code-background);\n border-radius: 0.25em;\n font-size: 0.95em;\n padding: 0.125em 0.25em;\n}\n\n.doc p a code,\n.doc thead a code,\n.doc .admonitionblock a code {\n color: var(--asciidoctor-code-link-font-color);\n}\n\n.doc code,\n.doc pre {\n hyphens: none;\n}\n\n.doc pre {\n font-size: calc(14 / var(--pixel-to-rem));\n line-height: 1.3;\n margin: 0;\n}\n\n.doc pre.highlight code,\n.doc .listingblock pre:not(.highlight),\n.doc .literalblock pre {\n background: var(--asciidoctor-pre-background);\n box-shadow: inset 0 0 1.75px var(--asciidoctor-pre-border-color);\n display: block;\n overflow-x: auto;\n padding: 0.95rem;\n border-radius: 4px;\n}\n\n.doc pre.highlight code[data-lang]:before {\n content: attr(data-lang);\n text-transform: uppercase;\n display: block;\n position: absolute;\n top: 0.3rem;\n right: 0.3rem;\n line-height: 1;\n font-size: 0.65em;\n color: var(--asciidoctor-code-data-lang-color);\n}\n\n.doc pre.highlight {\n position: relative;\n}\n\n.doc table pre.highlight code[data-lang]:before {\n display: none;\n}\n\n/* General margin and fonts sizing */\n\n.doc blockquote {\n margin: 0;\n}\n\n.doc .paragraph.lead > p {\n font-size: calc(18 / var(--pixel-to-rem));\n}\n\n.doc .paragraph,\n.doc .dlist,\n.doc .hdlist,\n.doc .olist,\n.doc .ulist,\n.doc .exampleblock,\n.doc .imageblock,\n.doc .listingblock,\n.doc .literalblock,\n.doc .sidebarblock,\n.doc .verseblock,\n.doc .quoteblock,\n.doc .partintro,\n.doc details,\n.doc hr {\n margin: 1rem 0 0;\n}\n\n/* Tables */\n\n.doc table.tableblock {\n display: block;\n width: 100%;\n overflow-x: auto;\n}\n\n.doc table.tableblock td {\n min-width: 6rem;\n}\n\n.doc table.tableblock {\n font-size: calc(15 / var(--pixel-to-rem));\n margin: 1.5rem 0 0;\n}\n\n.doc table.tableblock + * {\n margin-top: 2rem;\n}\n\n.doc td.tableblock > .content > :first-child {\n margin-top: 0;\n}\n\n.doc table.tableblock th,\n.doc table.tableblock td {\n padding: 0.5rem;\n}\n\n.doc table.tableblock thead th {\n border-bottom: 2.5px solid var(--asciidoctor-table-border-color);\n}\n\n.doc table.tableblock td,\n.doc table.tableblock > :not(thead) th {\n border-top: 1px solid var(--asciidoctor-table-border-color);\n border-bottom: 1px solid var(--asciidoctor-table-border-color);\n}\n\n.doc table.stripes-all > tbody > tr,\n.doc table.stripes-odd > tbody > tr:nth-of-type(odd),\n.doc table.stripes-even > tbody > tr:nth-of-type(even),\n.doc table.stripes-hover > tbody > tr:hover {\n background: var(--asciidoctor-table-stripe-background);\n}\n\n.doc table.tableblock > tfoot {\n background: var(--asciidoctor-table-footer-background);\n}\n\n.doc .tableblock pre,\n.doc .tableblock code,\n.doc .listingblock.wrap pre {\n white-space: pre-wrap;\n}\n\n.doc td:nth-child(1) .tableblock pre,\n.doc td:nth-child(1) .tableblock code,\n.doc td:nth-child(1) .listingblock.wrap pre {\n white-space: nowrap;\n}\n\n/* Admonition blocks */\n\n.doc .admonitionblock {\n margin: 2.5rem 0;\n}\n\n.doc .admonitionblock p,\n.doc .admonitionblock td.content {\n font-size: calc(16 / var(--pixel-to-rem));\n}\n\n.doc .admonitionblock td.content > :not(.title):first-child,\n.doc .admonitionblock td.content > .title + * {\n margin-top: 0;\n}\n\n.doc .admonitionblock pre {\n font-size: calc(14 / var(--pixel-to-rem));\n border: none;\n}\n\n.doc .admonitionblock > table {\n table-layout: fixed;\n position: relative;\n width: 100%;\n}\n\n.doc .admonitionblock td.content {\n padding: 1rem 1rem 0.75rem;\n background: var(--asciidoctor-admonition-background);\n width: 100%;\n word-wrap: anywhere;\n}\n\n.doc .admonitionblock td.icon {\n position: absolute;\n top: 0;\n left: 0;\n font-size: calc(16 / var(--pixel-to-rem));\n line-height: 1;\n transform: translate(-0.5rem, -50%);\n border-radius: 0.45rem;\n padding: 0.25em 0.075em;\n}\n\n.doc .admonitionblock .icon i {\n display: inline-flex;\n align-items: center;\n width: auto;\n height: 16px;\n background-repeat: no-repeat;\n background-position: 0.5em 0;\n filter: invert(100%);\n padding-left: 2em;\n vertical-align: initial;\n}\n\n.doc .admonitionblock .icon i::after {\n border-left: 1px solid rgba(255, 255, 255, 0.3);\n content: attr(title);\n text-transform: capitalize;\n filter: invert(100%);\n font-weight: var(--asciidoctor-admonition-label-font-weight);\n color: var(--asciidoctor-admonition-font-color);\n font-style: normal;\n hyphens: none;\n padding: 0 0.5em;\n margin: -0.05em;\n}\n\ni.fa {\n background-size: 16px 16px;\n}\n\ni.fa.icon-caution {\n background-image: url(\"../img/octicons-16.svg#view-flame\");\n}\n\ni.fa.icon-important {\n background-image: url(\"../img/octicons-16.svg#view-stop\");\n}\n\ni.fa.icon-note {\n background-image: url(\"../img/octicons-16.svg#view-info\");\n}\n\ni.fa.icon-tip {\n background-image: url(\"../img/octicons-16.svg#view-light-bulb\");\n}\n\ni.fa.icon-warning {\n background-image: url(\"../img/octicons-16.svg#view-alert\");\n}\n\n.doc .admonitionblock.caution td.icon {\n background: var(--asciidoctor-admonition-caution-background);\n}\n\n.doc .admonitionblock.important td.icon {\n background: var(--asciidoctor-admonition-important-background);\n}\n\n.doc .admonitionblock.note .icon {\n background: var(--asciidoctor-admonition-note-background);\n}\n\n.doc .admonitionblock.tip .icon {\n background: var(--asciidoctor-admonition-tip-background);\n}\n\n.doc .admonitionblock.warning .icon {\n background-color: var(--asciidoctor-admonition-warning-background);\n}\n\n/* Images and image blocks */\n\n.doc .imageblock {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.doc .imageblock img,\n.doc .image > img {\n display: inline-block;\n height: auto;\n max-width: 100%;\n vertical-align: middle;\n}\n\n.doc .image:not(.left):not(.right) > img {\n margin-top: -0.2em;\n}\n\n/* Quote blocks */\n\n.doc #preamble .abstract blockquote {\n background: var(--asciidoctor-abstract-background);\n border-left: 5px solid var(--asciidoctor-abstract-border-color);\n font-size: calc(16 / var(--pixel-to-rem));\n padding: 0.75em 1em;\n}\n\n.doc .quoteblock,\n.doc .verseblock {\n background: var(--asciidoctor-quote-background);\n border-left: 5px solid var(--asciidoctor-quote-border-color);\n}\n\n.doc .quoteblock {\n padding: 0.25rem 2rem 1.25rem;\n}\n\n.doc .quoteblock .attribution {\n color: var(--asciidoctor-quote-attribution-font-color);\n font-size: calc(15 / var(--pixel-to-rem));\n margin-top: 0.75rem;\n}\n\n.doc .quoteblock blockquote {\n margin-top: 1rem;\n}\n\n.doc .quoteblock .paragraph {\n font-style: italic;\n}\n\n.doc .quoteblock cite {\n padding-left: 1em;\n}\n\n/* Verse blocks */\n\n.doc .verseblock {\n font-size: 1.15em;\n padding: 1rem 2rem;\n}\n\n.doc .verseblock pre {\n font-family: inherit;\n font-size: inherit;\n}\n\n/* Lists */\n\n.doc ol,\n.doc ul {\n margin: 0;\n padding: 0 0 0 2rem;\n}\n\n.doc ul.checklist,\n.doc ul.none,\n.doc ol.none,\n.doc ul.no-bullet,\n.doc ol.unnumbered,\n.doc ul.unstyled,\n.doc ol.unstyled {\n list-style-type: none;\n}\n\n.doc ul.no-bullet,\n.doc ol.unnumbered {\n padding-left: 1.25rem;\n}\n\n.doc ul.unstyled,\n.doc ol.unstyled {\n padding-left: 0;\n}\n\n.doc ul.circle {\n list-style-type: square;\n}\n\n.doc ul.disc {\n list-style-type: square;\n}\n\n.doc ul.square {\n list-style-type: square;\n}\n\n.doc ol.arabic {\n list-style-type: decimal;\n}\n\n.doc ol.decimal {\n list-style-type: decimal-leading-zero;\n}\n\n.doc ol.loweralpha {\n list-style-type: lower-alpha;\n}\n\n.doc ol.upperalpha {\n list-style-type: upper-alpha;\n}\n\n.doc ol.lowerroman {\n list-style-type: lower-roman;\n}\n\n.doc ol.upperroman {\n list-style-type: upper-roman;\n}\n\n.doc ol.lowergreek {\n list-style-type: lower-greek;\n}\n\n.doc ul.checklist {\n padding-left: 0.5rem;\n}\n\n.doc ul.checklist p > i.fa-check-square-o:first-child,\n.doc ul.checklist p > i.fa-square-o:first-child {\n display: inline-flex;\n justify-content: center;\n width: 1.25rem;\n}\n\n.doc ul.checklist i.fa-check-square-o::before {\n content: \"\\2713\";\n}\n\n.doc ul.checklist i.fa-square-o::before {\n content: \"\\274f\";\n}\n\n.doc .dlist .dlist,\n.doc .dlist .olist,\n.doc .dlist .ulist,\n.doc .olist .dlist,\n.doc .olist .olist,\n.doc .olist .ulist,\n.doc .ulist .dlist,\n.doc .ulist .olist,\n.doc .ulist .ulist {\n margin-top: 0.5rem;\n}\n\n.doc .olist li,\n.doc .ulist li {\n margin-bottom: 0.3rem;\n}\n\n.doc .ulist .listingblock,\n.doc .olist .listingblock,\n.doc .admonitionblock .listingblock {\n padding: 0;\n}\n\n/* Block Titles */\n\n.doc .admonitionblock .title,\n.doc .exampleblock .title,\n.doc .imageblock .title,\n.doc .literalblock .title,\n.doc .listingblock .title,\n.doc .openblock .title,\n.doc .tableblock caption {\n color: var(--asciidoctor-caption-font-color);\n font-size: calc(14 / var(--pixel-to-rem));\n font-weight: var(--asciidoctor-caption-font-weight);\n font-style: italic;\n hyphens: none;\n letter-spacing: 0.01em;\n padding-bottom: 0.075rem;\n text-align: left;\n}\n\n.doc .imageblock .title {\n margin-top: 0.5rem;\n padding-bottom: 0;\n}\n\n/* Block content */\n\n.doc .exampleblock > .content {\n background: var(--asciidoctor-example-background);\n border: 1px solid var(--asciidoctor-example-border-color);\n border-radius: 4px;\n padding: 0.75rem;\n}\n\n.doc .exampleblock > .content > :first-child {\n margin-top: 0;\n}\n\n/* Sidebars */\n\n.doc .sidebarblock {\n background: var(--asciidoctor-sidebar-background);\n padding: 2.2rem 2.2rem;\n}\n\n.doc .sidebarblock > .content > .title {\n font-size: calc(23 / var(--pixel-to-rem));\n font-weight: var(--asciidoctor-alt-heading-font-weight);\n line-height: 1.3;\n margin-bottom: 1.2rem;\n}\n\n.doc .sidebarblock > .content > :not(.title):first-child {\n margin-top: 0;\n}\n\n/* Buttons (https://docs.asciidoctor.org/asciidoc/latest/macros/ui-macros/#button-macro-syntax) */\n\n.doc b.button {\n white-space: nowrap;\n}\n\n.doc b.button::before {\n content: \"[\";\n padding-right: 0.25em;\n}\n\n.doc b.button::after {\n content: \"]\";\n padding-left: 0.25em;\n}\n\n/* Menu (https://docs.asciidoctor.org/asciidoc/latest/macros/ui-macros/#menu-macro-syntax) */\n\n.doc .menuseq,\n.doc .path {\n hyphens: none;\n}\n\n.doc .menuseq i.caret::before {\n content: \"\\203a\";\n font-size: 1.1em;\n font-weight: var(--asciidoctor-body-font-weight-bold);\n line-height: calc(1 / 1.1);\n}\n\n/* Keyboard (https://docs.asciidoctor.org/asciidoc/latest/macros/keyboard-macro/) */\n\n.doc kbd {\n display: inline-block;\n font-size: calc(12 / var(--pixel-to-rem));\n background: var(--asciidoctor-kbd-background);\n border: 1px solid var(--asciidoctor-kbd-border-color);\n border-radius: 0.25em;\n box-shadow: 0 1px 0 var(--asciidoctor-kbd-border-color),\n 0 0 0 0.1em var(--body-background) inset;\n padding: 0.25em 0.5em;\n vertical-align: text-bottom;\n white-space: nowrap;\n}\n\n.doc kbd,\n.doc .keyseq {\n line-height: 1;\n}\n\n.doc .keyseq {\n font-size: calc(16 / var(--pixel-to-rem));\n}\n\n.doc .keyseq kbd {\n margin: 0 0.125em;\n}\n\n.doc .keyseq kbd:first-child {\n margin-left: 0;\n}\n\n.doc .keyseq kbd:last-child {\n margin-right: 0;\n}\n\n/* Misc */\n\n.doc i.fa {\n hyphens: none;\n font-style: normal;\n}\n\n.doc .language-console .hljs-meta {\n user-select: none;\n}\n\n.doc .dlist dt {\n font-style: italic;\n}\n\n.doc .dlist dd {\n margin: 0 0 0.25rem 1.5rem;\n}\n\n.doc .dlist dd:last-of-type {\n margin-bottom: 0;\n}\n\n.doc td.hdlist1,\n.doc td.hdlist2 {\n padding: 0.5rem 0 0;\n vertical-align: top;\n}\n\n.doc tr:first-child > .hdlist1,\n.doc tr:first-child > .hdlist2 {\n padding-top: 0;\n}\n\n.doc td.hdlist1 {\n font-weight: var(--body-font-weight-bold);\n padding-right: 0.25rem;\n}\n\n.doc td.hdlist2 {\n padding-left: 0.25rem;\n}\n\n.doc .colist {\n font-size: calc(16 / var(--pixel-to-rem));\n margin: 0.25rem 0 -0.25rem;\n}\n\n.doc .colist > table > tr > :first-child,\n.doc .colist > table > tbody > tr > :first-child {\n padding: 0.25em 0.5rem 0;\n vertical-align: top;\n}\n\n.doc .colist > table > tr > :last-child,\n.doc .colist > table > tbody > tr > :last-child {\n padding: 0.25rem 0;\n}\n\n.doc .conum[data-value] {\n /* border: 1px solid currentColor; */\n font-family: var(--monospace-font-family);\n border-radius: 100%;\n display: inline-block;\n font-size: calc(12.5 / var(--pixel-to-rem));\n font-style: normal;\n line-height: 1.2;\n text-align: center;\n width: 1.25em;\n height: 1.25em;\n letter-spacing: -0.25ex;\n text-indent: -0.25ex;\n background: var(--asciidoctor-callout-background);\n color: var(--asciidoctor-callout-font-color);\n}\n\n.doc .conum[data-value]::after {\n content: attr(data-value);\n}\n\n.doc .conum[data-value] + b {\n display: none;\n}\n\n.doc hr {\n border: solid var(--asciidoctor-section-divider-color);\n border-width: 2px 0 0;\n height: 0;\n}\n\n/* Pass-though Classes */\n\n.doc :not(pre).nowrap {\n white-space: nowrap;\n}\n\n.doc .nobreak {\n hyphens: none;\n word-wrap: normal;\n}\n\n.doc .right {\n float: right;\n}\n\n.doc .left {\n float: left;\n}\n\n.doc .stretch {\n width: 100%;\n}\n\n.doc .underline {\n text-decoration: underline;\n}\n\n.doc .line-through {\n text-decoration: line-through;\n}\n\n.doc .halign-left {\n text-align: left;\n}\n\n.doc .halign-right {\n text-align: right;\n}\n\n.doc .halign-center {\n text-align: center;\n}\n\n.doc .valign-top {\n vertical-align: top;\n}\n\n.doc .valign-bottom {\n vertical-align: bottom;\n}\n\n.doc .valign-middle {\n vertical-align: middle;\n}\n\n/* Footer */\n\n#footer #footer-text {\n font-size: calc(14 / var(--pixel-to-rem));\n color: var(--asciidoctor-footer-font-color);\n padding: 2rem 0;\n border-top: 1px solid var(--asciidoctor-section-divider-color);\n}\n\n/* Responsive and Dark Theme Overrides */\n\nhtml.dark-theme #doc {\n background: no-repeat top right / 305px 147px;\n background-image: url(\"../img/doc-background-dark.svg\");\n}\n\n@media screen and (max-width: 1024px) {\n #doc {\n background: no-repeat top right / 203px 95px;\n background-image: url(\"../img/doc-background.svg\");\n }\n html.dark-theme #doc {\n background: no-repeat top right / 203px 95px;\n background-image: url(\"../img/doc-background-dark.svg\");\n }\n}\n\n@media screen and (max-width: 800px) {\n html.dark-theme #doc,\n #doc {\n background: none;\n }\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.hljs {\n display: block;\n overflow-x: auto;\n padding: 0.5em;\n background: var(--highlight-background-color);\n color: var(--highlight-font-color);\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n color: var(--highlight-keyword-font-color);\n}\n\n.hljs-comment,\n.hljs-quote {\n color: var(--highlight-comment-font-color);\n}\n\n.hljs-string,\n.hljs-doctag {\n color: var(--highlight-string-font-color);\n}\n\n.hljs-meta {\n color: var(--highlight-meta-font-color);\n}\n\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-number,\n.hljs-symbol,\n.hljs-literal {\n color: var(--highlight-constant-font-color);\n}\n\n.hljs-variable,\n.hljs-template-variable {\n color: var(--highlight-variable-font-color);\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n color: var(--highlight-tag-font-color);\n}\n\n.hljs-tag .hljs-attr {\n color: var(--highlight-tag-attribute-font-color);\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n color: var(--highlight-type-font-color);\n}\n\n.hljs-regexp {\n color: var(--highlight-regex-font-color);\n}\n\n.hljs-link {\n text-decoration: underline;\n color: var(--highlight-link-font-color);\n}\n\n.hljs-addition {\n color: var(--highlight-addition-font-color);\n}\n\n.hljs-deletion {\n color: var(--highlight-deletion-font-color);\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n\n.language-json .hljs-number,\n.language-json .hljs-literal {\n color: var(--highlight-variable-font-color);\n}\n\n.language-json .hljs-attr {\n color: var(--highlight-string-font-color);\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* Block Switching */\n\n.hidden {\n display: none;\n}\n\n.doc .tabs {\n font-weight: bold;\n font-size: calc(12 / var(--pixel-to-rem));\n border-style: none;\n display: inline-block;\n position: relative;\n bottom: 0;\n margin-top: 0.5rem;\n margin-bottom: calc(2 / var(--pixel-to-rem));\n}\n\n.doc .tab:not(:first-child) {\n border: 1px solid var(--tabs-border-color);\n}\n\n.doc .tab {\n padding: 0.3rem 0.6rem;\n background-color: var(--tabs-background-color);\n color: var(--tabs-font-color);\n display: inline-block;\n cursor: pointer;\n border: 1px solid var(--tabs-border-color);\n margin-bottom: calc(2 / var(--pixel-to-rem));\n border-radius: 0;\n transition: background-color 200ms;\n}\n\n.doc .tab:hover {\n color: var(--tabs-hover-font-color);\n background-color: var(--tabs-hover-background);\n text-decoration: underline;\n}\n\n.doc .tab.selected {\n background-color: var(--tabs-selected-background-color);\n border-color: var(--tabs-selected-background-color);\n color: var(--tabs-selected-font-color);\n}\n\n.doc .tab.selected:hover {\n color: var(--tabs-selected-font-color);\n text-decoration: none;\n}\n\n.doc div.openblock.tabs-content > .content {\n padding: 1rem;\n background-color: var(--tabs-group-background-color);\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nbody.toc-left #doc {\n border-left: 1px solid var(--layout-border-color);\n overflow: auto;\n margin-left: var(--toc-width);\n}\n\n#toc {\n display: var(--toc-display);\n position: absolute;\n top: var(--layout-banner-height);\n width: var(--toc-width);\n margin-left: calc(var(--toc-width) * -1);\n border-right: 1px solid var(--layout-border-color);\n padding: 1.7rem 1rem 0 1rem;\n font-size: 0.95rem;\n line-height: 1.1;\n}\n\n#toctitle {\n display: none;\n}\n\n#toc ul,\n#toc ol {\n padding: 0;\n}\n\n#toc ul ul,\n#toc ul ol {\n padding-left: 0.8rem;\n}\n\n#toc li {\n display: block;\n list-style: none;\n}\n\n#toc a {\n display: block;\n text-decoration: none;\n color: var(--toc-font-color);\n padding: 0.4rem 0.6rem;\n border-radius: 4px;\n}\n\n#toc a:hover {\n background-color: var(--toc-hover-background-color);\n}\n\nbody.fixed-toc #toc {\n position: fixed;\n top: 0;\n overflow-x: hidden;\n height: 100%;\n}\n\n#toc li.active > a {\n background-color: var(--toc-active-background-color);\n color: var(--toc-active-font-color);\n}\n\n#toc > ul ul,\n#toc > ol ol {\n display: none;\n}\n\n#toc li.active > ul,\n#toc li.active > ol,\n#toc ul.expanded,\n#toc ol.expanded {\n display: block;\n}\n\n#back-to-index {\n display: block;\n margin-bottom: 0.6rem;\n}\n\n#back-to-index a {\n padding-left: 1.6rem;\n margin-bottom: 0.6rem;\n margin-top: -0.9rem;\n}\n\n#back-to-index a::before {\n content: \"\";\n filter: var(--toc-back-to-index-filter);\n background: no-repeat center / 16px 16px;\n background-image: url(\"../img/octicons-16.svg#view-chevron-left\");\n display: block;\n position: absolute;\n min-width: 16px;\n min-height: 16px;\n left: 1.4rem;\n}\n\n#tocbar-container {\n display: var(--toc-bar-display);\n width: 100%;\n}\n\n#tocbar-container {\n height: var(--tocbar-height);\n background-color: var(--body-background-color);\n border-bottom: 1px solid var(--panel-border-color);\n z-index: 10000;\n}\n\n#tocbar {\n width: 100%;\n height: 100%;\n padding-left: 6px;\n}\n\nbody.fixed-toc #tocbar-container {\n position: fixed;\n top: 0;\n}\n\nbutton#toggle-toc {\n width: var(--toc-bar-height);\n height: var(--toc-bar-height);\n filter: var(--toc-bar-button-filter);\n background: no-repeat center / 16px 16px;\n background-image: url(\"../img/octicons-16.svg#view-three-bars\");\n border: none;\n outline: none;\n padding: 0;\n display: block;\n}\n\nbody.show-toc button#toggle-toc {\n background-image: url(\"../img/octicons-16.svg#view-x\");\n}\n\n@media screen and (max-width: 800px) {\n body.fixed-toc #toc {\n top: var(--toc-bar-height);\n }\n\n #toc {\n top: calc(var(--layout-banner-height) + var(--toc-bar-height));\n width: 100%;\n height: 100%;\n left: 0;\n background-color: var(--body-background-color);\n z-index: 10000;\n }\n\n body.show-toc #toc {\n display: block;\n }\n}\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ndiv.codetools {\n --button-width: 28px;\n --button-height: 24px;\n --arrow-size: 5px;\n display: flex;\n position: absolute;\n bottom: 9px;\n right: 8px;\n background: var(--codetools-background-color);\n padding: 0;\n border-radius: 2px;\n border: 1px solid var(--codetools-border-color);\n opacity: 0;\n transition: opacity 150ms ease-in-out;\n}\n\n.doc pre.highlight:hover div.codetools {\n opacity: 1;\n}\n\ndiv.codetools button {\n width: var(--button-width);\n height: var(--button-height);\n filter: var(--codetools-button-filter);\n background: no-repeat center / 16px 16px;\n border: none;\n padding: 0;\n outline: none;\n}\n\ndiv.codetools button:not(:last-child) {\n border-right: 1px solid var(--codetools-divider-color);\n}\n\ndiv.codetools button:hover {\n background-color: var(--codetools-hover-background-color);\n transition: filter 300ms;\n}\n\ndiv.codetools button:active {\n filter: var(--codetools-button-active-filter);\n transition: filter none;\n}\n\ndiv.codetools button span.label {\n display: none;\n}\n\ndiv.codetools button.copy-button {\n background-image: url(\"../img/octicons-16.svg#view-clippy\");\n}\n\ndiv.codetools button.unfold-button {\n background-image: url(\"../img/octicons-16.svg#view-unfold\");\n}\n\ndiv.codetools button.fold-button {\n background-image: url(\"../img/octicons-16.svg#view-fold\");\n}\n\ndiv.codetools span.copied {\n opacity: 0;\n display: block;\n content: \"\";\n position: relative;\n width: var(--button-width);\n height: var(--button-height);\n z-index: 1000000;\n transition: opacity 500ms;\n}\n\ndiv.codetools button:active span.copied {\n filter: invert();\n transition: filter none;\n}\n\ndiv.codetools span.copied:before {\n position: absolute;\n bottom: calc(var(--arrow-size) * -1);\n left: 50%;\n margin-left: calc(var(--arrow-size) / -2);\n content: \"\";\n border: var(--arrow-size) solid var(--codetools-popup-background-color);\n border-color: transparent transparent var(--codetools-popup-background-color)\n transparent;\n}\n\ndiv.codetools span.copied:after {\n content: \"Copied to clipboard!\";\n position: absolute;\n top: calc(var(--button-height) + var(--arrow-size));\n right: 100%;\n margin-right: calc(var(--button-width) * -1);\n background-color: var(--codetools-popup-background-color);\n color: var(--codetools-popup-font-color);\n padding: 5px 8px;\n border-radius: 3px;\n font-weight: bold;\n}\n\ndiv.codetools button.clicked span.copied {\n opacity: 1;\n}\n\nspan.fold-block {\n position: relative;\n float: left;\n clear: left;\n padding-right: 0.75rem;\n overflow: hidden;\n}\n\ncode.unfolded span.fold-block.hide-when-folded,\ncode:not(.unfolded) span.fold-block.hide-when-unfolded {\n max-height: 99999px;\n opacity: 1;\n}\n\ncode.unfolded span.fold-block.hide-when-unfolded,\ncode:not(.unfolded) span.fold-block.hide-when-folded {\n max-height: 0px;\n opacity: 0;\n}\n\ncode.unfolding span.fold-block.hide-when-folded {\n max-height: 600px;\n opacity: 1;\n}\n\ncode.folding span.fold-block.hide-when-unfolded {\n max-height: 400px;\n opacity: 1;\n}\n\ncode.unfolding span.fold-block.hide-when-unfolded,\ncode.folding span.fold-block.hide-when-folded {\n max-height: 0;\n opacity: 0;\n}\n\ncode.unfolding span.fold-block.hide-when-unfolded {\n transition: max-height 200ms cubic-bezier(0, 1, 0, 1), opacity 200ms linear;\n}\n\ncode.folding span.fold-block.hide-when-unfolded {\n transition: max-height 200ms cubic-bezier(1, 0, 1, 0), opacity 200ms linear;\n}\n\ncode.unfolding span.fold-block.hide-when-folded {\n transition: max-height 200ms cubic-bezier(1, 0, 1, 0), opacity 200ms linear;\n}\n\ncode.folding span.fold-block.hide-when-folded {\n transition: max-height 200ms cubic-bezier(0, 1, 0, 1), opacity 200ms linear;\n}\n"]} \ No newline at end of file diff --git a/5.4.1/reference/html/datastore.html b/5.4.1/reference/html/datastore.html new file mode 100644 index 0000000000..4bd189b35c --- /dev/null +++ b/5.4.1/reference/html/datastore.html @@ -0,0 +1,2061 @@ + + + + + + + +Spring Data Cloud Datastore + + + + + + +
+
+
+ +
+
+

Spring Data Cloud Datastore

+
+
+ + + + + +
+ + +This integration is fully compatible with Firestore in Datastore Mode, but not with Firestore in Native Mode. +
+
+
+

Spring Data is an abstraction for storing and retrieving POJOs in numerous storage technologies. +Spring Framework on Google Cloud adds Spring Data support for Google Cloud Firestore in Datastore mode.

+
+
+

Maven coordinates for this module only, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-data-datastore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-data-datastore")
+}
+
+
+
+

We provide a Spring Boot Starter for Spring Data Datastore, with which you can use our recommended auto-configuration setup. +To use the starter, see the coordinates below.

+
+
+

Maven:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-data-datastore</artifactId>
+</dependency>
+
+
+
+

Gradle:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-data-datastore")
+}
+
+
+
+

This setup takes care of bringing in the latest compatible version of Cloud Java Cloud Datastore libraries as well.

+
+
+

Configuration

+
+

To setup Spring Data Cloud Datastore, you have to configure the following:

+
+
+
    +
  • +

    Setup the connection details to Google Cloud Datastore.

    +
  • +
+
+
+

Cloud Datastore settings

+
+

You can use the Spring Boot Starter for Spring Data Datastore to autoconfigure Google Cloud Datastore in your Spring application. +It contains all the necessary setup that makes it easy to authenticate with your Google Cloud project. +The following configuration options are available:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.datastore.enabled

Enables the Cloud Datastore client

No

true

spring.cloud.gcp.datastore.project-id

Google Cloud project ID where the Google Cloud Datastore API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.database-id

Google Cloud project can host multiple databases. You can specify which database will be used. If not specified, the database id will be "(default)".

No

spring.cloud.gcp.datastore.credentials.location

OAuth2 credentials for authenticating with the Google Cloud Datastore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Cloud Datastore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.credentials.scopes

OAuth2 scope for Spring Framework on Google CloudDatastore credentials

No

https://www.googleapis.com/auth/datastore

spring.cloud.gcp.datastore.namespace

The Cloud Datastore namespace to use

No

the Default namespace of Cloud Datastore in your Google Cloud project

spring.cloud.gcp.datastore.host

The hostname:port of the datastore service or emulator to connect to. Can be used to connect to a manually started Datastore Emulator. If the autoconfigured emulator is enabled, this property will be ignored and localhost:<emulator_port> will be used.

No

spring.cloud.gcp.datastore.emulator.enabled

To enable the auto configuration to start a local instance of the Datastore Emulator.

No

false

spring.cloud.gcp.datastore.emulator.port

The local port to use for the Datastore Emulator

No

8081

spring.cloud.gcp.datastore.emulator.consistency

The consistency to use for the Datastore Emulator instance

No

0.9

spring.cloud.gcp.datastore.emulator.store-on-disk

Configures whether or not the emulator should persist any data to disk.

No

true

spring.cloud.gcp.datastore.emulator.data-dir

The directory to be used to store/retrieve data/config for an emulator run.

No

The default value is <USER_CONFIG_DIR>/emulators/datastore. See the gcloud documentation for finding your USER_CONFIG_DIR.

+
+
+

Repository settings

+
+

Spring Data Repositories can be configured via the @EnableDatastoreRepositories annotation on your main @Configuration class. +With our Spring Boot Starter for Spring Data Cloud Datastore, @EnableDatastoreRepositories is automatically added. +It is not required to add it to any other class, unless there is a need to override finer grain configuration parameters provided by @EnableDatastoreRepositories.

+
+
+
+

Autoconfiguration

+
+

Our Spring Boot autoconfiguration creates the following beans available in the Spring application context:

+
+
+
    +
  • +

    an instance of DatastoreTemplate

    +
  • +
  • +

    an instance of all user defined repositories extending CrudRepository, PagingAndSortingRepository, and DatastoreRepository (an extension of PagingAndSortingRepository with additional Cloud Datastore features) when repositories are enabled

    +
  • +
  • +

    an instance of Datastore from the Google Cloud Java Client for Datastore, for convenience and lower level API access

    +
  • +
+
+
+
+

Datastore Emulator Autoconfiguration

+
+

This Spring Boot autoconfiguration can also configure and start a local Datastore Emulator server if enabled by property.

+
+
+

It is useful for integration testing, but not for production.

+
+
+

When enabled, the spring.cloud.gcp.datastore.host property will be ignored and the Datastore autoconfiguration itself will be forced to connect to the autoconfigured local emulator instance.

+
+
+

It will create an instance of LocalDatastoreHelper as a bean that stores the DatastoreOptions to get the Datastore client connection to the emulator for convenience and lower level API for local access. +The emulator will be properly stopped after the Spring application context shutdown.

+
+
+
+
+

Object Mapping

+
+

Spring Data Cloud Datastore allows you to map domain POJOs to Cloud Datastore kinds and entities via annotations:

+
+
+
+
@Entity(name = "traders")
+public class Trader {
+
+	@Id
+	@Field(name = "trader_id")
+	String traderId;
+
+	String firstName;
+
+	String lastName;
+
+	@Transient
+	Double temporaryNumber;
+}
+
+
+
+
+

Spring Data Cloud Datastore will ignore any property annotated with @Transient. +These properties will not be written to or read from Cloud Datastore.

+
+
+

Constructors

+
+

Simple constructors are supported on POJOs. +The constructor arguments can be a subset of the persistent properties. +Every constructor argument needs to have the same name and type as a persistent property on the entity and the constructor should set the property from the given argument. +Arguments that are not directly set to properties are not supported.

+
+
+
+
@Entity(name = "traders")
+public class Trader {
+
+	@Id
+	@Field(name = "trader_id")
+	String traderId;
+
+	String firstName;
+
+	String lastName;
+
+	@Transient
+	Double temporaryNumber;
+
+	public Trader(String traderId, String firstName) {
+	    this.traderId = traderId;
+	    this.firstName = firstName;
+	}
+}
+
+
+
+
+
+

Kind

+
+

The @Entity annotation can provide the name of the Cloud Datastore kind that stores instances of the annotated class, one per row.

+
+
+
+

Keys

+
+

@Id identifies the property corresponding to the ID value.

+
+
+

You must annotate one of your POJO’s fields as the ID value, because every entity in Cloud Datastore requires a single ID value:

+
+
+
+
@Entity(name = "trades")
+public class Trade {
+	@Id
+	@Field(name = "trade_id")
+	String tradeId;
+
+	@Field(name = "trader_id")
+	String traderId;
+
+	String action;
+
+	Double price;
+
+	Double shares;
+
+	String symbol;
+}
+
+
+
+
+

Datastore can automatically allocate integer ID values. +If a POJO instance with a Long ID property is written to Cloud Datastore with null as the ID value, then Spring Data Cloud Datastore will obtain a newly allocated ID value from Cloud Datastore and set that in the POJO for saving. +Because primitive long ID properties cannot be null and default to 0, keys will not be allocated.

+
+
+
+

Fields

+
+

All accessible properties on POJOs are automatically recognized as a Cloud Datastore field. +Field naming is generated by the PropertyNameFieldNamingStrategy by default defined on the DatastoreMappingContext bean. +The @Field annotation optionally provides a different field name than that of the property.

+
+
+
+

Supported Types

+
+

Spring Data Cloud Datastore supports the following types for regular fields and elements of collections:

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeStored as

com.google.cloud.Timestamp

com.google.cloud.datastore.TimestampValue

com.google.cloud.datastore.Blob

com.google.cloud.datastore.BlobValue

com.google.cloud.datastore.LatLng

com.google.cloud.datastore.LatLngValue

java.lang.Boolean, boolean

com.google.cloud.datastore.BooleanValue

java.lang.Double, double

com.google.cloud.datastore.DoubleValue

java.lang.Long, long

com.google.cloud.datastore.LongValue

java.lang.Integer, int

com.google.cloud.datastore.LongValue

java.lang.String

com.google.cloud.datastore.StringValue

com.google.cloud.datastore.Entity

com.google.cloud.datastore.EntityValue

com.google.cloud.datastore.Key

com.google.cloud.datastore.KeyValue

byte[]

com.google.cloud.datastore.BlobValue

Java enum values

com.google.cloud.datastore.StringValue

+
+

In addition, all types that can be converted to the ones listed in the table by +org.springframework.core.convert.support.DefaultConversionService are supported.

+
+
+
+

Custom types

+
+

Custom converters can be used extending the type support for user defined types.

+
+
+
    +
  1. +

    Converters need to implement the org.springframework.core.convert.converter.Converter interface in both directions.

    +
  2. +
  3. +

    The user defined type needs to be mapped to one of the basic types supported by Cloud Datastore.

    +
  4. +
  5. +

    An instance of both Converters (read and write) needs to be passed to the DatastoreCustomConversions constructor, which then has to be made available as a @Bean for DatastoreCustomConversions.

    +
  6. +
+
+
+

For example:

+
+
+

We would like to have a field of type Album on our Singer POJO and want it to be stored as a string property:

+
+
+
+
@Entity
+public class Singer {
+
+	@Id
+	String singerId;
+
+	String name;
+
+	Album album;
+}
+
+
+
+
+

Where Album is a simple class:

+
+
+
+
public class Album {
+	String albumName;
+
+	LocalDate date;
+}
+
+
+
+
+

We have to define the two converters:

+
+
+
+
	// Converter to write custom Album type
+	static final Converter<Album, String> ALBUM_STRING_CONVERTER =
+			new Converter<Album, String>() {
+				@Override
+				public String convert(Album album) {
+					return album.getAlbumName() + " " + album.getDate().format(DateTimeFormatter.ISO_DATE);
+				}
+			};
+
+	// Converters to read custom Album type
+	static final Converter<String, Album> STRING_ALBUM_CONVERTER =
+			new Converter<String, Album>() {
+				@Override
+				public Album convert(String s) {
+					String[] parts = s.split(" ");
+					return new Album(parts[0], LocalDate.parse(parts[parts.length - 1], DateTimeFormatter.ISO_DATE));
+				}
+			};
+
+
+
+
+

That will be configured in our @Configuration file:

+
+
+
+
@Configuration
+public class ConverterConfiguration {
+	@Bean
+	public DatastoreCustomConversions datastoreCustomConversions() {
+		return new DatastoreCustomConversions(
+				Arrays.asList(
+						ALBUM_STRING_CONVERTER,
+						STRING_ALBUM_CONVERTER));
+	}
+}
+
+
+
+
+
+

Collections and arrays

+
+

Arrays and collections (types that implement java.util.Collection) of supported types are supported. +They are stored as com.google.cloud.datastore.ListValue. +Elements are converted to Cloud Datastore supported types individually. byte[] is an exception, it is converted to +com.google.cloud.datastore.Blob.

+
+
+
+

Custom Converter for collections

+
+

Users can provide converters from List<?> to the custom collection type. +Only read converter is necessary, the Collection API is used on the write side to convert a collection to the internal list type.

+
+
+

Collection converters need to implement the org.springframework.core.convert.converter.Converter interface.

+
+
+

Example:

+
+
+

Let’s improve the Singer class from the previous example. +Instead of a field of type Album, we would like to have a field of type Set<Album>:

+
+
+
+
@Entity
+public class Singer {
+
+	@Id
+	String singerId;
+
+	String name;
+
+	Set<Album> albums;
+}
+
+
+
+
+

We have to define a read converter only:

+
+
+
+
static final Converter<List<?>, Set<?>> LIST_SET_CONVERTER =
+			new Converter<List<?>, Set<?>>() {
+				@Override
+				public Set<?> convert(List<?> source) {
+					return Collections.unmodifiableSet(new HashSet<>(source));
+				}
+			};
+
+
+
+
+

And add it to the list of custom converters:

+
+
+
+
@Configuration
+public class ConverterConfiguration {
+	@Bean
+	public DatastoreCustomConversions datastoreCustomConversions() {
+		return new DatastoreCustomConversions(
+				Arrays.asList(
+						LIST_SET_CONVERTER,
+						ALBUM_STRING_CONVERTER,
+						STRING_ALBUM_CONVERTER));
+	}
+}
+
+
+
+
+
+

Inheritance Hierarchies

+
+

Java entity types related by inheritance can be stored in the same Kind. +When reading and querying entities using DatastoreRepository or DatastoreTemplate with a superclass as the type parameter, you can receive instances of subclasses if you annotate the superclass and its subclasses with DiscriminatorField and DiscriminatorValue:

+
+
+
+
@Entity(name = "pets")
+@DiscriminatorField(field = "pet_type")
+abstract class Pet {
+	@Id
+	Long id;
+
+	abstract String speak();
+}
+
+@DiscriminatorValue("cat")
+class Cat extends Pet {
+	@Override
+	String speak() {
+		return "meow";
+	}
+}
+
+@DiscriminatorValue("dog")
+class Dog extends Pet {
+	@Override
+	String speak() {
+		return "woof";
+	}
+}
+
+@DiscriminatorValue("pug")
+class Pug extends Dog {
+	@Override
+	String speak() {
+		return "woof woof";
+	}
+}
+
+
+
+
+

Instances of all 3 types are stored in the pets Kind. +Because a single Kind is used, all classes in the hierarchy must share the same ID property and no two instances of any type in the hierarchy can share the same ID value.

+
+
+

Entity rows in Cloud Datastore store their respective types' DiscriminatorValue in a field specified by the root superclass’s DiscriminatorField (pet_type in this case). +Reads and queries using a given type parameter will match each entity with its specific type. +For example, reading a List<Pet> will produce a list containing instances of all 3 types. +However, reading a List<Dog> will produce a list containing only Dog and Pug instances. +You can include the pet_type discrimination field in your Java entities, but its type must be convertible to a collection or array of String. +Any value set in the discrimination field will be overwritten upon write to Cloud Datastore.

+
+
+
+
+

Relationships

+
+

There are three ways to represent relationships between entities that are described in this section:

+
+
+
    +
  • +

    Embedded entities stored directly in the field of the containing entity

    +
  • +
  • +

    @Descendant annotated properties for one-to-many relationships

    +
  • +
  • +

    @Reference annotated properties for general relationships without hierarchy

    +
  • +
  • +

    @LazyReference similar to @Reference, but the entities are lazy-loaded when the property is accessed. +(Note that the keys of the children are retrieved when the parent entity is loaded.)

    +
  • +
+
+
+

Embedded Entities

+
+

Fields whose types are also annotated with @Entity are converted to EntityValue and stored inside the parent entity.

+
+
+

Here is an example of Cloud Datastore entity containing an embedded entity in JSON:

+
+
+
+
{
+  "name" : "Alexander",
+  "age" : 47,
+  "child" : {"name" : "Philip"  }
+}
+
+
+
+

This corresponds to a simple pair of Java entities:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity("parents")
+public class Parent {
+  @Id
+  String name;
+
+  Child child;
+}
+
+@Entity
+public class Child {
+  String name;
+}
+
+
+
+
+

Child entities are not stored in their own kind. +They are stored in their entirety in the child field of the parents kind.

+
+
+

Multiple levels of embedded entities are supported.

+
+
+ + + + + +
+ + +Embedded entities don’t need to have @Id field, it is only required for top level entities. +
+
+
+

Example:

+
+
+

Entities can hold embedded entities that are their own type. +We can store trees in Cloud Datastore using this feature:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Embedded;
+import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity
+public class EmbeddableTreeNode {
+  @Id
+  long value;
+
+  EmbeddableTreeNode left;
+
+  EmbeddableTreeNode right;
+
+  Map<String, Long> longValues;
+
+  Map<String, List<Timestamp>> listTimestamps;
+
+  public EmbeddableTreeNode(long value, EmbeddableTreeNode left, EmbeddableTreeNode right) {
+    this.value = value;
+    this.left = left;
+    this.right = right;
+  }
+}
+
+
+
+
+
Maps
+
+

Maps will be stored as embedded entities where the key values become the field names in the embedded entity. +The value types in these maps can be any regularly supported property type, and the key values will be converted to String using the configured converters.

+
+
+

Also, a collection of entities can be embedded; it will be converted to ListValue on write.

+
+
+

Example:

+
+
+

Instead of a binary tree from the previous example, we would like to store a general tree +(each node can have an arbitrary number of children) in Cloud Datastore. +To do that, we need to create a field of type List<EmbeddableTreeNode>:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Embedded;
+import org.springframework.data.annotation.Id;
+
+public class EmbeddableTreeNode {
+  @Id
+  long value;
+
+  List<EmbeddableTreeNode> children;
+
+  Map<String, EmbeddableTreeNode> siblingNodes;
+
+  Map<String, Set<EmbeddableTreeNode>> subNodeGroups;
+
+  public EmbeddableTreeNode(List<EmbeddableTreeNode> children) {
+    this.children = children;
+  }
+}
+
+
+
+
+

Because Maps are stored as entities, they can further hold embedded entities:

+
+
+
    +
  • +

    Singular embedded objects in the value can be stored in the values of embedded Maps.

    +
  • +
  • +

    Collections of embedded objects in the value can also be stored as the values of embedded Maps.

    +
  • +
  • +

    Maps in the value are further stored as embedded entities with the same rules applied recursively for their values.

    +
  • +
+
+
+
+
+

Ancestor-Descendant Relationships

+
+

Parent-child relationships are supported via the @Descendants annotation.

+
+
+

Unlike embedded children, descendants are fully-formed entities residing in their own kinds. +The parent entity does not have an extra field to hold the descendant entities. +Instead, the relationship is captured in the descendants' keys, which refer to their parent entities:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Descendants;
+import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity("orders")
+public class ShoppingOrder {
+  @Id
+  long id;
+
+  @Descendants
+  List<Item> items;
+}
+
+@Entity("purchased_item")
+public class Item {
+  @Id
+  Key purchasedItemKey;
+
+  String name;
+
+  Timestamp timeAddedToOrder;
+}
+
+
+
+
+

For example, an instance of a GQL key-literal representation for Item would also contain the parent ShoppingOrder ID value:

+
+
+
+
Key(orders, '12345', purchased_item, 'eggs')
+
+
+
+

The GQL key-literal representation for the parent ShoppingOrder would be:

+
+
+
+
Key(orders, '12345')
+
+
+
+

The Cloud Datastore entities exist separately in their own kinds.

+
+
+

The ShoppingOrder:

+
+
+
+
{
+  "id" : 12345
+}
+
+
+
+

The two items inside that order:

+
+
+
+
{
+  "purchasedItemKey" : Key(orders, '12345', purchased_item, 'eggs'),
+  "name" : "eggs",
+  "timeAddedToOrder" : "2014-09-27 12:30:00.45-8:00"
+}
+
+{
+  "purchasedItemKey" : Key(orders, '12345', purchased_item, 'sausage'),
+  "name" : "sausage",
+  "timeAddedToOrder" : "2014-09-28 11:30:00.45-9:00"
+}
+
+
+
+

The parent-child relationship structure of objects is stored in Cloud Datastore using Datastore’s ancestor relationships. +Because the relationships are defined by the Ancestor mechanism, there is no extra column needed in either the parent or child entity to store this relationship. +The relationship link is part of the descendant entity’s key value. +These relationships can be many levels deep.

+
+
+

Properties holding child entities must be collection-like, but they can be any of the supported inter-convertible collection-like types that are supported for regular properties such as List, arrays, Set, etc…​ +Child items must have Key as their ID type because Cloud Datastore stores the ancestor relationship link inside the keys of the children.

+
+
+

Reading or saving an entity automatically causes all subsequent levels of children under that entity to be read or saved, respectively. +If a new child is created and added to a property annotated @Descendants and the key property is left null, then a new key will be allocated for that child. +The ordering of the retrieved children may not be the same as the ordering in the original property that was saved.

+
+
+

Child entities cannot be moved from the property of one parent to that of another unless the child’s key property is set to null or a value that contains the new parent as an ancestor. +Since Cloud Datastore entity keys can have multiple parents, it is possible that a child entity appears in the property of multiple parent entities. +Because entity keys are immutable in Cloud Datastore, to change the key of a child you must delete the existing one and re-save it with the new key.

+
+
+
+

Key Reference Relationships

+
+

General relationships can be stored using the @Reference annotation.

+
+
+
+
import org.springframework.data.annotation.Reference;
+import org.springframework.data.annotation.Id;
+
+@Entity
+public class ShoppingOrder {
+  @Id
+  long id;
+
+  @Reference
+  List<Item> items;
+
+  @Reference
+  Item specialSingleItem;
+}
+
+@Entity
+public class Item {
+  @Id
+  Key purchasedItemKey;
+
+  String name;
+
+  Timestamp timeAddedToOrder;
+}
+
+
+
+
+

@Reference relationships are between fully-formed entities residing in their own kinds. +The relationship between ShoppingOrder and Item entities are stored as a Key field inside ShoppingOrder, which are resolved to the underlying Java entity type by Spring Data Cloud Datastore:

+
+
+
+
{
+  "id" : 12345,
+  "specialSingleItem" : Key(item, "milk"),
+  "items" : [ Key(item, "eggs"), Key(item, "sausage") ]
+}
+
+
+
+

Reference properties can either be singular or collection-like. +These properties correspond to actual columns in the entity and Cloud Datastore Kind that hold the key values of the referenced entities. +The referenced entities are full-fledged entities of other Kinds.

+
+
+

Similar to the @Descendants relationships, reading or writing an entity will recursively read or write all of the referenced entities at all levels. +If referenced entities have null ID values, then they will be saved as new entities and will have ID values allocated by Cloud Datastore. +There are no requirements for relationships between the key of an entity and the keys that entity holds as references. +The order of collection-like reference properties is not preserved when reading back from Cloud Datastore.

+
+
+
+
+

Datastore Operations & Template

+
+

DatastoreOperations and its implementation, DatastoreTemplate, provides the Template pattern familiar to Spring developers.

+
+
+

Using the auto-configuration provided by Spring Boot Starter for Datastore, your Spring application context will contain a fully configured DatastoreTemplate object that you can autowire in your application:

+
+
+
+
@SpringBootApplication
+public class DatastoreTemplateExample {
+
+	@Autowired
+	DatastoreTemplate datastoreTemplate;
+
+	public void doSomething() {
+		this.datastoreTemplate.deleteAll(Trader.class);
+		//...
+		Trader t = new Trader();
+		//...
+		this.datastoreTemplate.save(t);
+		//...
+		List<Trader> traders = datastoreTemplate.findAll(Trader.class);
+		//...
+	}
+}
+
+
+
+
+

The Template API provides convenience methods for:

+
+
+
    +
  • +

    Write operations (saving and deleting)

    +
  • +
  • +

    Read-write transactions

    +
  • +
+
+
+

GQL Query

+
+

In addition to retrieving entities by their IDs, you can also submit queries.

+
+
+
+
  <T> Iterable<T> query(Query<? extends BaseEntity> query, Class<T> entityClass);
+
+  <A, T> Iterable<T> query(Query<A> query, Function<A, T> entityFunc);
+
+  Iterable<Key> queryKeys(Query<Key> query);
+
+
+
+
+

These methods, respectively, allow querying for:

+
+
+
    +
  • +

    entities mapped by a given entity class using all the same mapping and converting features

    +
  • +
  • +

    arbitrary types produced by a given mapping function

    +
  • +
  • +

    only the Cloud Datastore keys of the entities found by the query

    +
  • +
+
+
+
+

Find by ID(s)

+
+

Using DatastoreTemplate you can find entities by id. For example:

+
+
+
+
Trader trader = this.datastoreTemplate.findById("trader1", Trader.class);
+
+List<Trader> traders = this.datastoreTemplate.findAllById(Arrays.asList("trader1", "trader2"), Trader.class);
+
+List<Trader> allTraders = this.datastoreTemplate.findAll(Trader.class);
+
+
+
+
+

Cloud Datastore uses key-based reads with strong consistency, but queries with eventual consistency. +In the example above the first two reads utilize keys, while the third is run by using a query based on the corresponding Kind of Trader.

+
+
+
Indexes
+
+

By default, all fields are indexed. +To disable indexing on a particular field, @Unindexed annotation can be used.

+
+
+

Example:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Unindexed;
+
+public class ExampleItem {
+	long indexedField;
+
+	@Unindexed
+	long unindexedField;
+
+	@Unindexed
+	List<String> unindexedListField;
+}
+
+
+
+
+

When using queries directly or via Query Methods, Cloud Datastore requires composite custom indexes if the select statement is not SELECT * or if there is more than one filtering condition in the WHERE clause.

+
+
+
+
Read with offsets, limits, and sorting
+
+

DatastoreRepository and custom-defined entity repositories implement the Spring Data PagingAndSortingRepository, which supports offsets and limits using page numbers and page sizes. +Paging and sorting options are also supported in DatastoreTemplate by supplying a DatastoreQueryOptions to findAll.

+
+
+
+
Partial read
+
+

This feature is not supported yet.

+
+
+
+
+

Write / Update

+
+

The write methods of DatastoreOperations accept a POJO and writes all of its properties to Datastore. +The required Datastore kind and entity metadata is obtained from the given object’s actual type.

+
+
+

If a POJO was retrieved from Datastore and its ID value was changed and then written or updated, the operation will occur as if against a row with the new ID value. +The entity with the original ID value will not be affected.

+
+
+
+
Trader t = new Trader();
+this.datastoreTemplate.save(t);
+
+
+
+
+

The save method behaves as update-or-insert. +In contrast, the insert method will fail if an entity already exists.

+
+
+
Partial Update
+
+

This feature is not supported yet.

+
+
+
+
+

Transactions

+
+

Read and write transactions are provided by DatastoreOperations via the performTransaction method:

+
+
+
+
@Autowired
+DatastoreOperations myDatastoreOperations;
+
+public String doWorkInsideTransaction() {
+  return myDatastoreOperations.performTransaction(
+    transactionDatastoreOperations -> {
+      // Work with transactionDatastoreOperations here.
+      // It is also a DatastoreOperations object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+

The performTransaction method accepts a Function that is provided an instance of a DatastoreOperations object. +The final returned value and type of the function is determined by the user. +You can use this object just as you would a regular DatastoreOperations with an exception:

+
+
+
    +
  • +

    It cannot perform sub-transactions.

    +
  • +
+
+
+

Because of Cloud Datastore’s consistency guarantees, there are limitations to the operations and relationships among entities used inside transactions.

+
+
+
Declarative Transactions with @Transactional Annotation
+
+

This feature requires a bean of DatastoreTransactionManager, which is provided when using spring-cloud-gcp-starter-data-datastore.

+
+
+

DatastoreTemplate and DatastoreRepository support running methods with the @Transactional annotation as transactions. +If a method annotated with @Transactional calls another method also annotated, then both methods will work within the same transaction. +performTransaction cannot be used in @Transactional annotated methods because Cloud Datastore does not support transactions within transactions.

+
+
+

Other Google Cloud database-related integrations like Spanner and Firestore can introduce PlatformTransactionManager beans, and can interfere with Datastore Transaction Manager. To disambiguate, explicitly specify the name of the transaction manager bean for such @Transactional methods. Example:

+
+
+
+
@Transactional(transactionManager = "datastoreTransactionManager")
+
+
+
+
+
+
+

Read-Write Support for Maps

+
+

You can work with Maps of type Map<String, ?> instead of with entity objects by directly reading and writing them to and from Cloud Datastore.

+
+
+ + + + + +
+ + +This is a different situation than using entity objects that contain Map properties. +
+
+
+

The map keys are used as field names for a Datastore entity and map values are converted to Datastore supported types. +Only simple types are supported (i.e. collections are not supported). +Converters for custom value types can be added (see Custom types section).

+
+
+

Example:

+
+
+
+
Map<String, Long> map = new HashMap<>();
+map.put("field1", 1L);
+map.put("field2", 2L);
+map.put("field3", 3L);
+
+keyForMap = datastoreTemplate.createKey("kindName", "id");
+
+// write a map
+datastoreTemplate.writeMap(keyForMap, map);
+
+// read a map
+Map<String, Long> loadedMap = datastoreTemplate.findByIdAsMap(keyForMap, Long.class);
+
+
+
+
+
+
+

Repositories

+
+

Spring Data Repositories are an abstraction that can reduce boilerplate code.

+
+
+

For example:

+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+}
+
+
+
+
+

Spring Data generates a working implementation of the specified interface, which can be autowired into an application.

+
+
+

The Trader type parameter to DatastoreRepository refers to the underlying domain type. +The second type parameter, String in this case, refers to the type of the key of the domain type.

+
+
+
+
public class MyApplication {
+
+	@Autowired
+	TraderRepository traderRepository;
+
+	public void demo() {
+
+		this.traderRepository.deleteAll();
+		String traderId = "demo_trader";
+		Trader t = new Trader();
+		t.traderId = traderId;
+		this.tradeRepository.save(t);
+
+		Iterable<Trader> allTraders = this.traderRepository.findAll();
+
+		int count = this.traderRepository.count();
+	}
+}
+
+
+
+
+

Repositories allow you to define custom Query Methods (detailed in the following sections) for retrieving, counting, and deleting based on filtering and paging parameters. +Filtering parameters can be of types supported by your configured custom converters.

+
+
+

Query methods by convention

+
+
+
public interface TradeRepository extends DatastoreRepository<Trade, String[]> {
+  List<Trader> findByAction(String action);
+
+  // throws an exception if no results
+  Trader findOneByAction(String action);
+
+  // because of the annotation, returns null if no results
+  @Nullable
+  Trader getByAction(String action);
+
+  Optional<Trader> getOneByAction(String action);
+
+  int countByAction(String action);
+
+  boolean existsByAction(String action);
+
+  List<Trade> findTop3ByActionAndSymbolAndPriceGreaterThanAndPriceLessThanOrEqualOrderBySymbolDesc(
+  			String action, String symbol, double priceFloor, double priceCeiling);
+
+  Page<TestEntity> findByAction(String action, Pageable pageable);
+
+  Slice<TestEntity> findBySymbol(String symbol, Pageable pageable);
+
+  List<TestEntity> findBySymbol(String symbol, Sort sort);
+
+  Stream<TestEntity> findBySymbol(String symbol);
+}
+
+
+
+
+

In the example above the query methods in TradeRepository are generated based on the name of the methods using the Spring Data Query creation naming convention.

+
+
+ + + + + +
+ + +You can refer to nested fields using Spring Data JPA Property Expressions +
+
+
+

Cloud Datastore only supports filter components joined by AND, and the following operations:

+
+
+
    +
  • +

    equals

    +
  • +
  • +

    greater than or equals

    +
  • +
  • +

    greater than

    +
  • +
  • +

    less than or equals

    +
  • +
  • +

    less than

    +
  • +
  • +

    is null

    +
  • +
+
+
+

After writing a custom repository interface specifying just the signatures of these methods, implementations are generated for you and can be used with an auto-wired instance of the repository. +Because of Cloud Datastore’s requirement that explicitly selected fields must all appear in a composite index together, find name-based query methods are run as SELECT *.

+
+
+

Delete queries are also supported. +For example, query methods such as deleteByAction or removeByAction delete entities found by findByAction. +Delete queries are run as separate read and delete operations instead of as a single transaction because Cloud Datastore cannot query in transactions unless ancestors for queries are specified. +As a result, removeBy and deleteBy name-convention query methods cannot be used inside transactions via either performInTransaction or @Transactional annotation.

+
+
+

Delete queries can have the following return types:

+
+
+
    +
  • +

    An integer type that is the number of entities deleted

    +
  • +
  • +

    A collection of entities that were deleted

    +
  • +
  • +

    'void'

    +
  • +
+
+
+

Methods can have org.springframework.data.domain.Pageable parameter to control pagination and sorting, or org.springframework.data.domain.Sort parameter to control sorting only. +See Spring Data documentation for details.

+
+
+

For returning multiple items in a repository method, we support Java collections as well as org.springframework.data.domain.Page and org.springframework.data.domain.Slice. +If a method’s return type is org.springframework.data.domain.Page, the returned object will include current page, total number of results and total number of pages.

+
+
+ + + + + +
+ + +Methods that return Page run an additional query to compute total number of pages. +Methods that return Slice, on the other hand, do not run any additional queries and, therefore, are much more efficient. +
+
+
+
+

Empty result handling in repository methods

+
+

Java java.util.Optional can be used to indicate the potential absence of a return value.

+
+
+

Alternatively, query methods can return the result without a wrapper. +In that case the absence of a query result is indicated by returning null. +Repository methods returning collections are guaranteed never to return null but rather the corresponding empty collection.

+
+
+ + + + + +
+ + +You can enable nullability checks. For more details please see Spring Framework’s nullability docs. +
+
+
+
+

Query by example

+
+

Query by Example is an alternative querying technique. +It enables dynamic query generation based on a user-provided object. See Spring Data Documentation for details.

+
+
+
Unsupported features:
+
+
    +
  1. +

    Currently, only equality queries are supported (no ignore-case matching, regexp matching, etc.).

    +
  2. +
  3. +

    Per-field matchers are not supported.

    +
  4. +
  5. +

    Embedded entities matching is not supported.

    +
  6. +
  7. +

    Projection is not supported.

    +
  8. +
+
+
+

For example, if you want to find all users with the last name "Smith", you would use the following code:

+
+
+
+
userRepository.findAll(
+    Example.of(new User(null, null, "Smith"))
+
+
+
+
+

null fields are not used in the filter by default. If you want to include them, you would use the following code:

+
+
+
+
userRepository.findAll(
+    Example.of(new User(null, null, "Smith"), ExampleMatcher.matching().withIncludeNullValues())
+
+
+
+
+

You can also extend query specification initially defined by an example in FluentQuery’s chaining style:

+
+
+
+
userRepository.findBy(
+    Example.of(new User(null, null, "Smith")), q -> q.sortBy(Sort.by("firstName")).firstValue());
+
+userRepository.findBy(
+    Example.of(new User(null, null, "Smith")), FetchableFluentQuery::stream);
+
+
+
+
+
+

Custom GQL query methods

+
+

Custom GQL queries can be mapped to repository methods in one of two ways:

+
+
+
    +
  • +

    namedQueries properties file

    +
  • +
  • +

    using the @Query annotation

    +
  • +
+
+
+
Query methods with annotation
+
+

Using the @Query annotation:

+
+
+

The names of the tags of the GQL correspond to the @Param annotated names of the method parameters.

+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  List<Trader> tradersByName(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Stream<Trader> tradersStreamByName(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM  test_entities_ci WHERE name = @trader_name")
+  TestEntity getOneTestEntity(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  List<Trader> tradersByNameSort(@Param("trader_name") String traderName, Sort sort);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Slice<Trader> tradersByNameSlice(@Param("trader_name") String traderName, Pageable pageable);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Page<Trader> tradersByNamePage(@Param("trader_name") String traderName, Pageable pageable);
+}
+
+
+
+
+

When the return type is Slice or Pageable, the result set cursor that points to the position just after the page is preserved in the returned Slice or Page object. To take advantage of the cursor to query for the next page or slice, use result.getPageable().next().

+
+
+ + + + + +
+ + +Page requires the total count of entities produced by the query. Therefore, the first query will have to retrieve all of the records just to count them. Instead, we recommend using the Slice return type, because it does not require an additional count query. +
+
+
+
+
 Slice<Trader> slice1 = tradersByNamePage("Dave", PageRequest.of(0, 5));
+ Slice<Trader> slice2 = tradersByNamePage("Dave", slice1.getPageable().next());
+
+
+
+
+ + + + + +
+ + +You cannot use these Query Methods in repositories where the type parameter is a subclass of another class +annotated with DiscriminatorField. +
+
+
+

The following parameter types are supported:

+
+
+
    +
  • +

    com.google.cloud.Timestamp

    +
  • +
  • +

    com.google.cloud.datastore.Blob

    +
  • +
  • +

    com.google.cloud.datastore.Key

    +
  • +
  • +

    com.google.cloud.datastore.Cursor

    +
  • +
  • +

    java.lang.Boolean

    +
  • +
  • +

    java.lang.Double

    +
  • +
  • +

    java.lang.Long

    +
  • +
  • +

    java.lang.String

    +
  • +
  • +

    enum values. +These are queried as String values.

    +
  • +
+
+
+

With the exception of Cursor, array forms of each of the types are also supported.

+
+
+

If you would like to obtain the count of items of a query or if there are any items returned by the query, set the count = true or exists = true properties of the @Query annotation, respectively. +The return type of the query method in these cases should be an integer type or a boolean type.

+
+
+

Cloud Datastore provides provides the SELECT __key__ FROM …​ special column for all kinds that retrieves the Key of each row. +Selecting this special __key__ column is especially useful and efficient for count and exists queries.

+
+
+

You can also query for non-entity types:

+
+
+
+
@Query(value = "SELECT __key__ from test_entities_ci")
+List<Key> getKeys();
+
+@Query(value = "SELECT __key__ from test_entities_ci limit 1")
+Key getKey();
+
+
+
+
+

In order to use @Id annotated fields in custom queries, use __key__ keyword for the field name. The parameter type should be of Key, as in the following example.

+
+
+

Repository method:

+
+
+
+
@Query("select * from  test_entities_ci where size = @size and __key__ = @id")
+LinkedList<TestEntity> findEntities(@Param("size") long size, @Param("id") Key id);
+
+
+
+
+

Generate a key from id value using DatastoreTemplate.createKey method and use it as a parameter for the repository method:

+
+
+
+
this.testEntityRepository.findEntities(1L, datastoreTemplate.createKey(TestEntity.class, 1L))
+
+
+
+
+

SpEL can be used to provide GQL parameters:

+
+
+
+
@Query("SELECT * FROM |com.example.Trade| WHERE trades.action = @act
+  AND price > :#{#priceRadius * -1} AND price < :#{#priceRadius * 2}")
+List<Trade> fetchByActionNamedQuery(@Param("act") String action, @Param("priceRadius") Double r);
+
+
+
+
+

Kind names can be directly written in the GQL annotations. +Kind names can also be resolved from the @Entity annotation on domain classes.

+
+
+

In this case, the query should refer to table names with fully qualified class names surrounded by | characters: |fully.qualified.ClassName|. +This is useful when SpEL expressions appear in the kind name provided to the @Entity annotation. +For example:

+
+
+
+
@Query("SELECT * FROM |com.example.Trade| WHERE trades.action = @act")
+List<Trade> fetchByActionNamedQuery(@Param("act") String action);
+
+
+
+
+
+
Query methods with named queries properties
+
+

You can also specify queries with Cloud Datastore parameter tags and SpEL expressions in properties files.

+
+
+

By default, the namedQueriesLocation attribute on @EnableDatastoreRepositories points to the META-INF/datastore-named-queries.properties file. +You can specify the query for a method in the properties file by providing the GQL as the value for the "interface.method" property:

+
+
+ + + + + +
+ + +You cannot use these Query Methods in repositories where the type parameter is a subclass of another class +annotated with DiscriminatorField. +
+
+
+
+
Trader.fetchByName=SELECT * FROM traders WHERE name = @tag0
+
+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+
+	// This method uses the query from the properties file instead of one generated based on name.
+	List<Trader> fetchByName(@Param("tag0") String traderName);
+
+}
+
+
+
+
+
+
+

Transactions

+
+

These transactions work very similarly to those of DatastoreOperations, but is specific to the repository’s domain type and provides repository functions instead of template functions.

+
+
+

For example, this is a read-write transaction:

+
+
+
+
@Autowired
+DatastoreRepository myRepo;
+
+public String doWorkInsideTransaction() {
+  return myRepo.performTransaction(
+    transactionDatastoreRepo -> {
+      // Work with the single-transaction transactionDatastoreRepo here.
+      // This is a DatastoreRepository object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+
+

Projections

+
+

Spring Data Cloud Datastore supports projections. +You can define projection interfaces based on domain types and add query methods that return them in your repository:

+
+
+
+
public interface TradeProjection {
+
+	String getAction();
+
+	@Value("#{target.symbol + ' ' + target.action}")
+	String getSymbolAndAction();
+}
+
+public interface TradeRepository extends DatastoreRepository<Trade, Key> {
+
+	List<Trade> findByTraderId(String traderId);
+
+	List<TradeProjection> findByAction(String action);
+
+	@Query("SELECT action, symbol FROM trades WHERE action = @action")
+	List<TradeProjection> findByQuery(String action);
+}
+
+
+
+
+

Projections can be provided by name-convention-based query methods as well as by custom GQL queries. +If using custom GQL queries, you can further restrict the fields retrieved from Cloud Datastore to just those required by the projection. +However, custom select statements (those not using SELECT *) require composite indexes containing the selected fields.

+
+
+

Properties of projection types defined using SpEL use the fixed name target for the underlying domain object. +As a result, accessing underlying properties take the form target.<property-name>.

+
+
+
+

REST Repositories

+
+

When running with Spring Boot, repositories can be exposed as REST services by simply adding this dependency to your pom file:

+
+
+
+
<dependency>
+  <groupId>org.springframework.boot</groupId>
+  <artifactId>spring-boot-starter-data-rest</artifactId>
+</dependency>
+
+
+
+

If you prefer to configure parameters (such as path), you can use @RepositoryRestResource annotation:

+
+
+
+
@RepositoryRestResource(collectionResourceRel = "trades", path = "trades")
+public interface TradeRepository extends DatastoreRepository<Trade, String[]> {
+}
+
+
+
+
+

For example, you can retrieve all Trade objects in the repository by using curl http://<server>:<port>/trades, or any specific trade via curl http://<server>:<port>/trades/<trader_id>.

+
+
+

You can also write trades using curl -XPOST -H"Content-Type: application/json" -d@test.json http://<server>:<port>/trades/ where the file test.json holds the JSON representation of a Trade object.

+
+
+

To delete trades, you can use curl -XDELETE http://<server>:<port>/trades/<trader_id>

+
+
+
+
+

Events

+
+

Spring Data Cloud Datastore publishes events extending the Spring Framework’s ApplicationEvent to the context that can be received by ApplicationListener beans you register.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionContents

AfterFindByKeyEvent

Published immediately after read by-key operations are run by DatastoreTemplate

The entities read from Cloud Datastore and the original keys in the request.

AfterQueryEvent

Published immediately after read byquery operations are run by DatastoreTemplate

The entities read from Cloud Datastore and the original query in the request.

BeforeSaveEvent

Published immediately before save operations are run by DatastoreTemplate

The entities to be sent to Cloud Datastore and the original Java objects being saved.

AfterSaveEvent

Published immediately after save operations are run by DatastoreTemplate

The entities sent to Cloud Datastore and the original Java objects being saved.

BeforeDeleteEvent

Published immediately before delete operations are run by DatastoreTemplate

The keys to be sent to Cloud Datastore. The target entities, ID values, or entity type originally specified for the delete operation.

AfterDeleteEvent

Published immediately after delete operations are run by DatastoreTemplate

The keys sent to Cloud Datastore. The target entities, ID values, or entity type originally specified for the delete operation.

+
+
+

Auditing

+
+

Spring Data Cloud Datastore supports the @LastModifiedDate and @LastModifiedBy auditing annotations for properties:

+
+
+
+
@Entity
+public class SimpleEntity {
+    @Id
+    String id;
+
+    @LastModifiedBy
+    String lastUser;
+
+    @LastModifiedDate
+    DateTime lastTouched;
+}
+
+
+
+
+

Upon insert, update, or save, these properties will be set automatically by the framework before Datastore entities are generated and saved to Cloud Datastore.

+
+
+

To take advantage of these features, add the @EnableDatastoreAuditing annotation to your configuration class and provide a bean for an AuditorAware<A> implementation where the type A is the desired property type annotated by @LastModifiedBy:

+
+
+
+
@Configuration
+@EnableDatastoreAuditing
+public class Config {
+
+    @Bean
+    public AuditorAware<String> auditorProvider() {
+        return () -> Optional.of("YOUR_USERNAME_HERE");
+    }
+}
+
+
+
+
+

The AuditorAware interface contains a single method that supplies the value for fields annotated by @LastModifiedBy and can be of any type. +One alternative is to use Spring Security’s User type:

+
+
+
+
class SpringSecurityAuditorAware implements AuditorAware<User> {
+
+  public Optional<User> getCurrentAuditor() {
+
+    return Optional.ofNullable(SecurityContextHolder.getContext())
+			  .map(SecurityContext::getAuthentication)
+			  .filter(Authentication::isAuthenticated)
+			  .map(Authentication::getPrincipal)
+			  .map(User.class::cast);
+  }
+}
+
+
+
+
+

You can also set a custom provider for properties annotated @LastModifiedDate by providing a bean for DateTimeProvider and providing the bean name to @EnableDatastoreAuditing(dateTimeProviderRef = "customDateTimeProviderBean").

+
+
+
+

Partitioning Data by Namespace

+
+

You can partition your data by using more than one namespace. +This is the recommended method for multi-tenancy in Cloud Datastore.

+
+
+
+
    @Bean
+    public DatastoreNamespaceProvider namespaceProvider() {
+        // return custom Supplier of a namespace string.
+    }
+
+
+
+
+

The DatastoreNamespaceProvider is a synonym for Supplier<String>. +By providing a custom implementation of this bean (for example, supplying a thread-local namespace name), you can direct your application to use multiple namespaces. +Every read, write, query, and transaction you perform will utilize the namespace provided by this supplier.

+
+
+

Note that your provided namespace in application.properties will be ignored if you define a namespace provider bean.

+
+
+
+

Spring Boot Actuator Support

+
+

Cloud Datastore Health Indicator

+
+

If you are using Spring Boot Actuator, you can take advantage of the Cloud Datastore health indicator called datastore. +The health indicator will verify whether Cloud Datastore is up and accessible by your application. +To enable it, all you need to do is add the Spring Boot Actuator to your project.

+
+
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-actuator</artifactId>
+</dependency>
+
+
+
+
+
+

Sample

+
+

A Simple Spring Boot Application and more advanced Sample Spring Boot Application are provided to show how to use the Spring Data Cloud Datastore starter and template.

+
+
+
+

Test

+
+

Testcontainers provides a gcloud module which offers DatastoreEmulatorContainer. See more at the docs

+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/firestore.html b/5.4.1/reference/html/firestore.html new file mode 100644 index 0000000000..0d65b8ee0b --- /dev/null +++ b/5.4.1/reference/html/firestore.html @@ -0,0 +1,1059 @@ + + + + + + + +Spring Data Cloud Firestore + + + + + + +
+
+
+ +
+
+

Spring Data Cloud Firestore

+
+
+ + + + + +
+ + +Currently some features are not supported: query by example, projections, and auditing. +
+
+
+

Spring Data is an abstraction for storing and retrieving POJOs in numerous storage technologies. +Spring Framework on Google Cloud adds Spring Data Reactive Repositories support for Google Cloud Firestore in native mode, providing reactive template and repositories support. +To begin using this library, add the spring-cloud-gcp-data-firestore artifact to your project.

+
+
+

Maven coordinates for this module only, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-data-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-data-firestore")
+}
+
+
+
+

We provide a Spring Boot Starter for Spring Data Firestore, with which you can use our recommended auto-configuration setup. To use the starter, see the coordinates below.

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-data-firestore")
+}
+
+
+
+

Configuration

+
+

Properties

+
+

The Spring Boot starter for Google Cloud Firestore provides the following configuration options:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.firestore.enabled

Enables or disables Firestore auto-configuration

No

true

spring.cloud.gcp.firestore.project-id

Google Cloud project ID where the Google Cloud Firestore API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.database-id

Google Cloud project can host multiple databases. You can specify which database will be used. If not specified, the database id will be "(default)".

No

spring.cloud.gcp.firestore.emulator.enabled

Enables the usage of an emulator. If this is set to true, then you should set the spring.cloud.gcp.firestore.host-port to the host:port of your locally running emulator instance

No

false

spring.cloud.gcp.firestore.host-port

The host and port of the Firestore service; can be overridden to specify connecting to an already-running Firestore emulator instance.

No

firestore.googleapis.com:443 (the host/port of official Firestore service)

spring.cloud.gcp.firestore.credentials.location

OAuth2 credentials for authenticating with the Google Cloud Firestore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Cloud Firestore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.credentials.scopes

OAuth2 scope for Spring Framework on Google CloudFirestore credentials

No

https://www.googleapis.com/auth/datastore

+
+
+

Supported types

+
+

You may use the following field types when defining your persistent entities or when binding query parameters:

+
+
+
    +
  • +

    Long

    +
  • +
  • +

    Integer

    +
  • +
  • +

    Double

    +
  • +
  • +

    Float

    +
  • +
  • +

    String

    +
  • +
  • +

    Boolean

    +
  • +
  • +

    Character

    +
  • +
  • +

    Date

    +
  • +
  • +

    Map

    +
  • +
  • +

    List

    +
  • +
  • +

    Enum

    +
  • +
  • +

    com.google.cloud.Timestamp

    +
  • +
  • +

    com.google.cloud.firestore.GeoPoint

    +
  • +
  • +

    com.google.cloud.firestore.Blob

    +
  • +
+
+
+
+

Reactive Repository settings

+
+

Spring Data Repositories can be configured via the @EnableReactiveFirestoreRepositories annotation on your main @Configuration class. +With our Spring Boot Starter for Spring Data Cloud Firestore, @EnableReactiveFirestoreRepositories is automatically added. +It is not required to add it to any other class, unless there is a need to override finer grain configuration parameters provided by @EnableReactiveFirestoreRepositories.

+
+
+
+

Autoconfiguration

+
+

Our Spring Boot autoconfiguration creates the following beans available in the Spring application context:

+
+
+
    +
  • +

    an instance of FirestoreTemplate

    +
  • +
  • +

    instances of all user defined repositories extending FirestoreReactiveRepository (an extension of ReactiveCrudRepository with additional Cloud Firestore features) when repositories are enabled

    +
  • +
  • +

    an instance of Firestore from the Google Cloud Java Client for Firestore, for convenience and lower level API access

    +
  • +
+
+
+
+
+

Object Mapping

+
+

Spring Data Cloud Firestore allows you to map domain POJOs to Cloud Firestore collections and documents via annotations:

+
+
+
+
import com.google.cloud.firestore.annotation.DocumentId;
+import com.google.cloud.spring.data.firestore.Document;
+
+@Document(collectionName = "usersCollection")
+public class User {
+  /** Used to test @PropertyName annotation on a field. */
+  @PropertyName("drink")
+  public String favoriteDrink;
+
+  @DocumentId private String name;
+
+  private Integer age;
+
+  public User() {}
+
+  public String getName() {
+    return this.name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Integer getAge() {
+    return this.age;
+  }
+
+  public void setAge(Integer age) {
+    this.age = age;
+  }
+}
+
+
+
+
+

@Document(collectionName = "usersCollection") annotation configures the collection name for the documents of this type. +This annotation is optional, by default the collection name is derived from the class name.

+
+
+

@DocumentId annotation marks a field to be used as document id. +This annotation is required and the annotated field can only be of String type.

+
+
+ + + + + +
+ + +If the property annotated with @DocumentId is null the document id is generated automatically when the entity is saved. +
+
+
+ + + + + +
+ + +Internally we use Firestore client library object mapping. See the documentation for supported annotations. +
+
+
+

Embedded entities and lists

+
+

Spring Data Cloud Firestore supports embedded properties of custom types and lists. +Given a custom POJO definition, you can have properties of this type or lists of this type in your entities. +They are stored as embedded documents (or arrays, correspondingly) in the Cloud Firestore.

+
+
+

Example:

+
+
+
+
@Document(collectionName = "usersCollection")
+public class User {
+  /** Used to test @PropertyName annotation on a field. */
+  @PropertyName("drink")
+  public String favoriteDrink;
+
+  @DocumentId private String name;
+
+  private Integer age;
+
+  private List<String> pets;
+
+  private List<Address> addresses;
+
+  private Address homeAddress;
+
+  public List<String> getPets() {
+    return this.pets;
+  }
+
+  public void setPets(List<String> pets) {
+    this.pets = pets;
+  }
+
+  public List<Address> getAddresses() {
+    return this.addresses;
+  }
+
+  public void setAddresses(List<Address> addresses) {
+    this.addresses = addresses;
+  }
+
+  public Timestamp getUpdateTime() {
+    return updateTime;
+  }
+
+  public void setUpdateTime(Timestamp updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  @PropertyName("address")
+  public Address getHomeAddress() {
+    return this.homeAddress;
+  }
+
+  @PropertyName("address")
+  public void setHomeAddress(Address homeAddress) {
+    this.homeAddress = homeAddress;
+  }
+  public static class Address {
+    String streetAddress;
+    String country;
+
+    public Address() {}
+  }
+}
+
+
+
+
+
+
+

Reactive Repositories

+
+

Spring Data Repositories is an abstraction that can reduce boilerplate code.

+
+
+

For example:

+
+
+
+
public interface UserRepository extends FirestoreReactiveRepository<User> {
+  Flux<User> findBy(Pageable pageable);
+
+  Flux<User> findByAge(Integer age);
+
+  Flux<User> findByAge(Integer age, Sort sort);
+
+  Flux<User> findByAgeOrderByNameDesc(Integer age);
+
+  Flux<User> findAllByOrderByAge();
+
+  Flux<User> findByAgeNot(Integer age);
+
+  Flux<User> findByNameAndAge(String name, Integer age);
+
+  Flux<User> findByHomeAddressCountry(String country);
+
+  Flux<User> findByFavoriteDrink(String drink);
+
+  Flux<User> findByAgeGreaterThanAndAgeLessThan(Integer age1, Integer age2);
+
+  Flux<User> findByAgeGreaterThan(Integer age);
+
+  Flux<User> findByAgeGreaterThan(Integer age, Sort sort);
+
+  Flux<User> findByAgeGreaterThan(Integer age, Pageable pageable);
+
+  Flux<User> findByAgeIn(List<Integer> ages);
+
+  Flux<User> findByAgeNotIn(List<Integer> ages);
+
+  Flux<User> findByAgeAndPetsContains(Integer age, List<String> pets);
+
+  Flux<User> findByNameAndPetsContains(String name, List<String> pets);
+
+  Flux<User> findByPetsContains(List<String> pets);
+
+  Flux<User> findByPetsContainsAndAgeIn(String pets, List<Integer> ages);
+
+  Mono<Long> countByAgeIsGreaterThan(Integer age);
+}
+
+
+
+
+

Spring Data generates a working implementation of the specified interface, which can be autowired into an application.

+
+
+

The User type parameter to FirestoreReactiveRepository refers to the underlying domain type.

+
+
+ + + + + +
+ + +You can refer to nested fields using Spring Data JPA Property Expressions +
+
+
+
+
public class MyApplication {
+
+  @Autowired UserRepository userRepository;
+
+  void writeReadDeleteTest() {
+    List<User.Address> addresses =
+        Arrays.asList(
+            new User.Address("123 Alice st", "US"), new User.Address("1 Alice ave", "US"));
+    User.Address homeAddress = new User.Address("10 Alice blvd", "UK");
+    User alice = new User("Alice", 29, null, addresses, homeAddress);
+    User bob = new User("Bob", 60);
+
+    this.userRepository.save(alice).block();
+    this.userRepository.save(bob).block();
+
+    assertThat(this.userRepository.count().block()).isEqualTo(2);
+    assertThat(this.userRepository.findAll().map(User::getName).collectList().block())
+        .containsExactlyInAnyOrder("Alice", "Bob");
+
+    User aliceLoaded = this.userRepository.findById("Alice").block();
+    assertThat(aliceLoaded.getAddresses()).isEqualTo(addresses);
+    assertThat(aliceLoaded.getHomeAddress()).isEqualTo(homeAddress);
+
+    // cast to SimpleFirestoreReactiveRepository for method be reachable with Spring Boot 2.4
+    SimpleFirestoreReactiveRepository repository =
+        AopTestUtils.getTargetObject(this.userRepository);
+    StepVerifier.create(
+            repository
+                .deleteAllById(Arrays.asList("Alice", "Bob"))
+                .then(this.userRepository.count()))
+        .expectNext(0L)
+        .verifyComplete();
+  }
+}
+
+
+
+
+

Repositories allow you to define custom Query Methods (detailed in the following sections) for retrieving and counting based on filtering and paging parameters.

+
+
+ + + + + +
+ + +Custom queries with @Query annotation are not supported since there is no query language in Cloud Firestore +
+
+
+
+

Firestore Operations & Template

+
+

FirestoreOperations and its implementation, FirestoreTemplate, provides the Template pattern familiar to Spring developers.

+
+
+

Using the auto-configuration provided by Spring Data Cloud Firestore, your Spring application context will contain a fully configured FirestoreTemplate object that you can autowire in your application:

+
+
+
+
@SpringBootApplication
+public class FirestoreTemplateExample {
+
+	@Autowired
+	FirestoreOperations firestoreOperations;
+
+	public Mono<User> createUsers() {
+		return this.firestoreOperations.save(new User("Alice", 29))
+			.then(this.firestoreOperations.save(new User("Bob", 60)));
+	}
+
+	public Flux<User> findUsers() {
+		return this.firestoreOperations.findAll(User.class);
+	}
+
+	public Mono<Long> removeAllUsers() {
+		return this.firestoreOperations.deleteAll(User.class);
+	}
+}
+
+
+
+
+

The Template API provides support for:

+
+
+ +
+
+
+

Query methods by convention

+
+
+
public class MyApplication {
+  void partTreeRepositoryMethodTest() {
+    User u1 = new User("Cloud", 22, null, null, new Address("1 First st., NYC", "USA"));
+    u1.favoriteDrink = "tea";
+    User u2 =
+        new User(
+            "Squall",
+            17,
+            Arrays.asList("cat", "dog"),
+            null,
+            new Address("2 Second st., London", "UK"));
+    u2.favoriteDrink = "wine";
+    Flux<User> users = Flux.fromArray(new User[] {u1, u2});
+
+    this.userRepository.saveAll(users).blockLast();
+
+    assertThat(this.userRepository.count().block()).isEqualTo(2);
+    assertThat(this.userRepository.findBy(PageRequest.of(0, 10)).collectList().block())
+        .containsExactly(u1, u2);
+    assertThat(this.userRepository.findByAge(22).collectList().block()).containsExactly(u1);
+    assertThat(this.userRepository.findByAgeNot(22).collectList().block()).containsExactly(u2);
+    assertThat(this.userRepository.findByHomeAddressCountry("USA").collectList().block())
+        .containsExactly(u1);
+    assertThat(this.userRepository.findByFavoriteDrink("wine").collectList().block())
+        .containsExactly(u2);
+    assertThat(this.userRepository.findByAgeGreaterThanAndAgeLessThan(20, 30).collectList().block())
+        .containsExactly(u1);
+    assertThat(this.userRepository.findByAgeGreaterThan(10).collectList().block())
+        .containsExactlyInAnyOrder(u1, u2);
+    assertThat(this.userRepository.findByNameAndAge("Cloud", 22).collectList().block())
+        .containsExactly(u1);
+    assertThat(
+            this.userRepository
+                .findByNameAndPetsContains("Squall", Collections.singletonList("cat"))
+                .collectList()
+                .block())
+        .containsExactly(u2);
+  }
+}
+
+
+
+
+

In the example above the query method implementations in UserRepository are generated based on the name of the methods using the Spring Data Query creation naming convention.

+
+
+

Cloud Firestore only supports filter components joined by AND, and the following operations:

+
+
+
    +
  • +

    equals

    +
  • +
  • +

    is not equal

    +
  • +
  • +

    greater than or equals

    +
  • +
  • +

    greater than

    +
  • +
  • +

    less than or equals

    +
  • +
  • +

    less than

    +
  • +
  • +

    is null

    +
  • +
  • +

    contains (accepts a List with up to 10 elements, or a singular value)

    +
  • +
  • +

    in (accepts a List with up to 10 elements)

    +
  • +
  • +

    not in (accepts a List with up to 10 elements)

    +
  • +
+
+
+ + + + + +
+ + +If in operation is used in combination with contains operation, the argument to contains operation has to be a singular value. +
+
+
+

After writing a custom repository interface specifying just the signatures of these methods, implementations are generated for you and can be used with an auto-wired instance of the repository.

+
+
+
+

Transactions

+
+

Read-only and read-write transactions are provided by TransactionalOperator (see this blog post on reactive transactions for details). +In order to use it, you would need to autowire ReactiveFirestoreTransactionManager like this:

+
+
+
+
public class MyApplication {
+  @Autowired ReactiveFirestoreTransactionManager txManager;
+}
+
+
+
+
+

After that you will be able to use it to create an instance of TransactionalOperator. +Note that you can switch between read-only and read-write transactions using TransactionDefinition object:

+
+
+
+
DefaultTransactionDefinition transactionDefinition = new DefaultTransactionDefinition();
+transactionDefinition.setReadOnly(false);
+TransactionalOperator operator =
+    TransactionalOperator.create(this.txManager, transactionDefinition);
+
+
+
+
+

When you have an instance of TransactionalOperator, you can invoke a sequence of Firestore operations in a transaction by using operator::transactional:

+
+
+
+
User alice = new User("Alice", 29);
+User bob = new User("Bob", 60);
+
+this.userRepository
+    .save(alice)
+    .then(this.userRepository.save(bob))
+    .as(operator::transactional)
+    .block();
+
+this.userRepository
+    .findAll()
+    .flatMap(
+        a -> {
+          a.setAge(a.getAge() - 1);
+          return this.userRepository.save(a);
+        })
+    .as(operator::transactional)
+    .collectList()
+    .block();
+
+assertThat(this.userRepository.findAll().map(User::getAge).collectList().block())
+    .containsExactlyInAnyOrder(28, 59);
+
+
+
+
+ + + + + +
+ + +Read operations in a transaction can only happen before write operations. +All write operations are applied atomically. +Read documents are locked until the transaction finishes with a commit or a rollback, which are handled by Spring Data. +If an Exception is thrown within a transaction, the rollback operation is performed. +Otherwise, the commit operation is performed. +
+
+
+

Declarative Transactions with @Transactional Annotation

+
+

This feature requires a bean of SpannerTransactionManager, which is provided when using spring-cloud-gcp-starter-data-firestore.

+
+
+

FirestoreTemplate and FirestoreReactiveRepository support running methods with the @Transactional annotation as transactions. +If a method annotated with @Transactional calls another method also annotated, then both methods will work within the same transaction.

+
+
+

One way to use this feature is illustrated here. You would need to do the following:

+
+
+
    +
  1. +

    Annotate your configuration class with the @EnableTransactionManagement annotation.

    +
  2. +
  3. +

    Create a service class that has methods annotated with @Transactional:

    +
  4. +
+
+
+
+
public class UserService {
+  @Autowired private UserRepository userRepository;
+
+  @Transactional
+  public Mono<Void> updateUsers() {
+    return this.userRepository
+        .findAll()
+        .flatMap(
+            a -> {
+              a.setAge(a.getAge() - 1);
+              return this.userRepository.save(a);
+            })
+        .then();
+  }
+}
+
+
+
+
+
    +
  1. +

    Make a Spring Bean provider that creates an instance of that class:

    +
  2. +
+
+
+
+
@Bean
+public UserService userService() {
+  return new UserService();
+}
+
+
+
+
+

After that, you can autowire your service like so:

+
+
+
+
public class MyApplication {
+  @Autowired UserService userService;
+}
+
+
+
+
+

Now when you call the methods annotated with @Transactional on your service object, a transaction will be automatically started. +If an error occurs during the execution of a method annotated with @Transactional, the transaction will be rolled back. +If no error occurs, the transaction will be committed.

+
+
+
+
+

Subcollections

+
+

A subcollection is a collection associated with a specific entity. +Documents in subcollections can contain subcollections as well, allowing you to further nest data. You can nest data up to 100 levels deep.

+
+
+ + + + + +
+ + +Deleting a document does not delete its subcollections! +
+
+
+

To use subcollections you will need to create a FirestoreReactiveOperations object with a parent entity using FirestoreReactiveOperations.withParent call. +You can use this object to save, query and remove entities associated with this parent. +The parent doesn’t have to exist in Firestore, but should have a non-empty id field.

+
+
+

Autowire FirestoreReactiveOperations:

+
+
+
+
@Autowired
+FirestoreReactiveOperations firestoreTemplate;
+
+
+
+
+

Then you can use this object to create a FirestoreReactiveOperations object with a custom parent:

+
+
+
+
FirestoreReactiveOperations bobTemplate =
+    this.firestoreTemplate.withParent(new User("Bob", 60));
+
+PhoneNumber phoneNumber = new PhoneNumber("111-222-333");
+bobTemplate.save(phoneNumber).block();
+assertThat(bobTemplate.findAll(PhoneNumber.class).collectList().block())
+    .containsExactly(phoneNumber);
+bobTemplate.deleteAll(PhoneNumber.class).block();
+assertThat(bobTemplate.findAll(PhoneNumber.class).collectList().block()).isEmpty();
+
+
+
+
+
+

Update Time and Optimistic Locking

+
+

Firestore stores update time for every document. +If you would like to retrieve it, you can add a field of com.google.cloud.Timestamp type to your entity and annotate it with @UpdateTime annotation.

+
+
+
+
@UpdateTime
+Timestamp updateTime;
+
+
+
+
+
Using update time for optimistic locking
+
+

A field annotated with @UpdateTime can be used for optimistic locking. +To enable that, you need to set version parameter to true:

+
+
+
+
@UpdateTime(version = true)
+Timestamp updateTime;
+
+
+
+
+

When you enable optimistic locking, a precondition will be automatically added to the write request to ensure that the document you are updating was not changed since your last read. +It uses this field’s value as a document version and checks that the version of the document you write is the same as the one you’ve read.

+
+
+

If the field is empty, a precondition would check that the document with the same id does not exist to ensure you don’t overwrite existing documents unintentionally.

+
+
+
+
+

Cloud Firestore Spring Boot Starter

+
+

If you prefer using Firestore client only, Spring Framework on Google Cloud provides a convenience starter which automatically configures authentication settings and client objects needed to begin using Google Cloud Firestore in native mode.

+
+
+

See documentation to learn more about Cloud Firestore.

+
+
+

To begin using this library, add the spring-cloud-gcp-starter-firestore artifact to your project.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-firestore")
+}
+
+
+
+

Using Cloud Firestore

+
+

The starter automatically configures and registers a Firestore bean in the Spring application context. To start using it, simply use the @Autowired annotation.

+
+
+
+
@Autowired
+Firestore firestore;
+
+ void writeDocumentFromObject() throws ExecutionException, InterruptedException {
+   // Add document data with id "joe" using a custom User class
+   User data =
+       new User(
+           "Joe",
+           Arrays.asList(new Phone(12345, PhoneType.CELL), new Phone(54321, PhoneType.WORK)));
+
+   // .get() blocks on response
+   WriteResult writeResult = this.firestore.document("users/joe").set(data).get();
+
+   LOGGER.info("Update time: " + writeResult.getUpdateTime());
+ }
+
+ User readDocumentToObject() throws ExecutionException, InterruptedException {
+   ApiFuture<DocumentSnapshot> documentFuture = this.firestore.document("users/joe").get();
+
+   User user = documentFuture.get().toObject(User.class);
+
+   LOGGER.info("read: " + user);
+
+   return user;
+ }
+
+
+
+
+
+
+

Emulator Usage

+
+

The Google Cloud Firebase SDK provides a local, in-memory emulator for Cloud Firestore, which you can use to develop and test your application.

+
+
+

First follow the Firebase emulator installation steps to install, configure, and run the emulator.

+
+
+ + + + + +
+ + +By default, the emulator is configured to run on port 8080; you will need to ensure that the emulator does not run on the same port as your Spring application. +
+
+
+

Once the Firestore emulator is running, ensure that the following properties are set in your application.properties of your Spring application:

+
+
+
+
spring.cloud.gcp.firestore.emulator.enabled=true
+spring.cloud.gcp.firestore.host-port=${EMULATOR_HOSTPORT}
+
+
+
+

From this point onward, your application will connect to your locally running emulator instance instead of the real Firestore service.

+
+
+
+

Samples

+
+

Spring Framework on Google Cloud provides Firestore sample applications to demonstrate API usage:

+
+ +
+
+

Test

+
+

Testcontainers provides a gcloud module which offers FirestoreEmulatorContainer. See more at the docs

+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/first-page.html b/5.4.1/reference/html/first-page.html new file mode 100644 index 0000000000..b9cd9aa0b3 --- /dev/null +++ b/5.4.1/reference/html/first-page.html @@ -0,0 +1,114 @@ + + + + + + + + +Spring Framework on Google Cloud + + + + + + +
+
+
+ +
+
+
+
+

5.4.1

+
+
+
+
+

1. Introduction

+
+
+

The Spring Framework on Google Cloud project makes the Spring Framework a first-class citizen of Google Cloud .

+
+
+

Spring Framework on Google Cloud lets you leverage the power and simplicity of the Spring Framework to:

+
+
+
    +
  • +

    Publish and subscribe to Google Cloud Pub/Sub topics

    +
  • +
  • +

    Configure Spring JDBC with a few properties to use Google Cloud SQL

    +
  • +
  • +

    Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore

    +
  • +
  • +

    Write and read from Spring Resources backed up by Google Cloud Storage

    +
  • +
  • +

    Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background

    +
  • +
  • +

    Trace the execution of your app with Micrometer and Google Cloud Trace

    +
  • +
  • +

    Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API

    +
  • +
  • +

    Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters

    +
  • +
  • +

    Use Spring Security via Google Cloud IAP

    +
  • +
  • +

    Analyze your images for text, objects, and other content with Google Cloud Vision

    +
  • +
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/fonts/FontAwesome.otf b/5.4.1/reference/html/fonts/FontAwesome.otf new file mode 100755 index 0000000000..401ec0f36e Binary files /dev/null and b/5.4.1/reference/html/fonts/FontAwesome.otf differ diff --git a/5.4.1/reference/html/fonts/fontawesome-webfont.eot b/5.4.1/reference/html/fonts/fontawesome-webfont.eot new file mode 100755 index 0000000000..e9f60ca953 Binary files /dev/null and b/5.4.1/reference/html/fonts/fontawesome-webfont.eot differ diff --git a/5.4.1/reference/html/fonts/fontawesome-webfont.svg b/5.4.1/reference/html/fonts/fontawesome-webfont.svg new file mode 100755 index 0000000000..855c845e53 --- /dev/null +++ b/5.4.1/reference/html/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/5.4.1/reference/html/fonts/fontawesome-webfont.ttf b/5.4.1/reference/html/fonts/fontawesome-webfont.ttf new file mode 100755 index 0000000000..35acda2fa1 Binary files /dev/null and b/5.4.1/reference/html/fonts/fontawesome-webfont.ttf differ diff --git a/5.4.1/reference/html/fonts/fontawesome-webfont.woff b/5.4.1/reference/html/fonts/fontawesome-webfont.woff new file mode 100755 index 0000000000..400014a4b0 Binary files /dev/null and b/5.4.1/reference/html/fonts/fontawesome-webfont.woff differ diff --git a/5.4.1/reference/html/fonts/fontawesome-webfont.woff2 b/5.4.1/reference/html/fonts/fontawesome-webfont.woff2 new file mode 100755 index 0000000000..4d13fc6040 Binary files /dev/null and b/5.4.1/reference/html/fonts/fontawesome-webfont.woff2 differ diff --git a/5.4.1/reference/html/getting-started.html b/5.4.1/reference/html/getting-started.html new file mode 100644 index 0000000000..0502de5d56 --- /dev/null +++ b/5.4.1/reference/html/getting-started.html @@ -0,0 +1,406 @@ + + + + + + + +Getting Started + + + + + + +
+
+
+ +
+
+

Getting Started

+
+
+

This section describes how to get up to speed with Spring Framework on Google Cloud libraries.

+
+
+

Compatibility with Spring Project Versions

+
+

Spring Framework on Google Cloud has dependency and transitive dependencies on Spring Projects. The table below outlines the versions of Spring Cloud, Spring Boot and Spring Framework versions that are compatible with certain Spring Framework on Google Cloud version.

+
+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spring Framework on Google CloudSpring CloudSpring BootSpring FrameworkSupported

5.x

2023.0.x (Leyton)

3.2.x

6.1.x

Yes

4.x

2022.0.x (Kilburn)

3.0.x, 3.1.x

6.x

Yes

3.x

2021.0.x (Jubilee)

2.6.x, 2.7.x

5.3.x

Yes

2.x

2020.0.x (Ilford)

2.4.x, 2.5.x

5.3.x

No

+
+
+

Setting up Dependencies

+
+

All Spring Framework on Google Cloud artifacts are made available through Maven Central. +The following resources are provided to help you setup the libraries for your project:

+
+
+
    +
  • +

    Maven Bill of Materials for dependency management

    +
  • +
  • +

    Starter Dependencies for depending on Spring Framework on Google Cloud modules

    +
  • +
+
+
+

You may also consult our Github project to examine the code or build directly from source.

+
+
+

Bill of Materials

+
+

The Spring Framework on Google Cloud Bill of Materials (BOM) contains the versions of all the dependencies it uses.

+
+
+

If you’re a Maven user, adding the following to your pom.xml file will allow you omit any Spring Framework on Google Cloud dependency version numbers from your configuration. +Instead, the version of the BOM you’re using determines the versions of the used dependencies.

+
+
+
+
<dependencyManagement>
+   <dependencies>
+       <dependency>
+           <groupId>com.google.cloud</groupId>
+           <artifactId>spring-cloud-gcp-dependencies</artifactId>
+           <version>5.4.1</version>
+           <type>pom</type>
+           <scope>import</scope>
+       </dependency>
+   </dependencies>
+</dependencyManagement>
+
+
+
+

Or, if you’re a Gradle user:

+
+
+
+
dependencies {
+    implementation platform("com.google.cloud:spring-cloud-gcp-dependencies:5.4.1")
+}
+
+
+
+

In the following sections, it will be assumed you are using the Spring Framework on Google Cloud BOM and the dependency snippets will not contain versions.

+
+
+
+

Starter Dependencies

+
+

Spring Framework on Google Cloud offers starter dependencies through Maven to easily depend on different modules of the library. +Each starter contains all the dependencies and transitive dependencies needed to begin using their corresponding Spring Framework on Google Cloud module.

+
+
+

For example, if you wish to write a Spring application with Cloud Pub/Sub, you would include the spring-cloud-gcp-starter-pubsub dependency in your project. +You do not need to include the underlying spring-cloud-gcp-pubsub dependency, because the starter dependency includes it.

+
+
+

A summary of these artifacts are provided below.

+
+
+

Aside from these modules, we also provide additional starters with auto-configurations to various Google Client Libraries. +Refer for the full list here.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spring Framework on Google Cloud StarterDescriptionMaven Artifact Name

Core

Automatically configure authentication and Google project settings

com.google.cloud:spring-cloud-gcp-starter

Cloud Spanner

Provides integrations with Google Cloud Spanner

com.google.cloud:spring-cloud-gcp-starter-data-spanner

Cloud Datastore

Provides integrations with Google Cloud Datastore

com.google.cloud:spring-cloud-gcp-starter-data-datastore

Cloud Pub/Sub

Provides integrations with Google Cloud Pub/Sub

com.google.cloud:spring-cloud-gcp-starter-pubsub

Logging

Enables Cloud Logging

com.google.cloud:spring-cloud-gcp-starter-logging

SQL - MySQL

Cloud SQL integrations with MySQL

com.google.cloud:spring-cloud-gcp-starter-sql-mysql

SQL - PostgreSQL

Cloud SQL integrations with PostgreSQL

com.google.cloud:spring-cloud-gcp-starter-sql-postgresql

Storage

Provides integrations with Google Cloud Storage and Spring Resource

com.google.cloud:spring-cloud-gcp-starter-storage

Config

Enables usage of Google Runtime Configuration API as a Spring Cloud Config server

com.google.cloud:spring-cloud-gcp-starter-config

Trace

Enables instrumentation with Google Cloud Trace

com.google.cloud:spring-cloud-gcp-starter-trace

Vision

Provides integrations with Google Cloud Vision

com.google.cloud:spring-cloud-gcp-starter-vision

Security - IAP

Provides a security layer over applications deployed to Google Cloud

com.google.cloud:spring-cloud-gcp-starter-security-iap

Security - Firebase

Provides a security layer over applications deployed to Firebase

com.google.cloud:spring-cloud-gcp-starter-security-firebase

AlloyDB

AlloyDB integrations with PostgreSQL

com.google.cloud:spring-cloud-gcp-starter-alloydb

+
+
+

Spring Initializr

+
+

Spring Initializr is a tool which generates the scaffolding code for a new Spring Boot project. +It handles the work of generating the Maven or Gradle build file so you do not have to manually add the dependencies yourself.

+
+
+

Spring Initializr offers three modules from Spring Framework on Google Cloud that you can use to generate your project.

+
+
+
    +
  • +

    GCP Support: The GCP Support module contains auto-configuration support for every Spring Framework on Google Cloud integration. +Most of the autoconfiguration code is only enabled if the required dependency is added to your project.

    +
  • +
  • +

    GCP Messaging: Google Cloud Pub/Sub integrations work out of the box.

    +
  • +
  • +

    GCP Storage: Google Cloud Storage integrations work out of the box.

    +
  • +
+
+
+
+
+

Learning Spring Framework on Google Cloud

+
+

There are a variety of resources to help you learn how to use Spring Framework on Google Cloud libraries.

+
+
+

Sample Applications

+
+

The easiest way to learn how to use Spring Framework on Google Cloud is to consult the sample applications on Github. +Spring Framework on Google Cloud provides sample applications which demonstrate how to use every integration in the library. +The table below highlights several samples of the most commonly used integrations in Spring Framework on Google Cloud.

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Google Cloud IntegrationSample Application

Cloud Pub/Sub

spring-cloud-gcp-pubsub-sample

Cloud Spanner

spring-cloud-gcp-data-spanner-repository-sample

+

spring-cloud-gcp-data-spanner-template-sample

Datastore

spring-cloud-gcp-data-datastore-sample

Cloud SQL (w/ MySQL)

spring-cloud-gcp-sql-mysql-sample

Cloud Storage

spring-cloud-gcp-storage-resource-sample

Cloud Logging

spring-cloud-gcp-logging-sample

Trace

spring-cloud-gcp-trace-sample

Cloud Vision

spring-cloud-gcp-vision-api-sample

Cloud Security - IAP

spring-cloud-gcp-security-iap-sample

Cloud Security - Firebase

spring-cloud-gcp-security-firebase-sample

AlloyDB

spring-cloud-gcp-alloydb-sample

+
+

Each sample application demonstrates how to use Spring Framework on Google Cloud libraries in context and how to setup the dependencies for the project. +The applications are fully functional and can be deployed to Google Cloud as well. +If you are interested, you may consult guides for deploying an application to AppEngine and to Google Kubernetes Engine.

+
+
+
+

Codelabs

+
+

For a more hands-on approach, there are several guides and codelabs to help you get up to speed. +These guides provide step-by-step instructions for building an application using Spring Framework on Google Cloud.

+
+
+

Some examples include:

+
+ +
+

The full collection of Spring codelabs can be found on the Google Developer Codelabs page.

+
+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/images/GCP on Spring Initializr.png b/5.4.1/reference/html/images/GCP on Spring Initializr.png new file mode 100644 index 0000000000..f2a545c73f Binary files /dev/null and b/5.4.1/reference/html/images/GCP on Spring Initializr.png differ diff --git a/5.4.1/reference/html/images/Stackdrive trace.png b/5.4.1/reference/html/images/Stackdrive trace.png new file mode 100644 index 0000000000..b024ed922f Binary files /dev/null and b/5.4.1/reference/html/images/Stackdrive trace.png differ diff --git a/5.4.1/reference/html/images/spring_cloud_bus_over_pubsub.png b/5.4.1/reference/html/images/spring_cloud_bus_over_pubsub.png new file mode 100644 index 0000000000..1edccb8b0a Binary files /dev/null and b/5.4.1/reference/html/images/spring_cloud_bus_over_pubsub.png differ diff --git a/5.4.1/reference/html/img/banner-logo.svg b/5.4.1/reference/html/img/banner-logo.svg new file mode 100755 index 0000000000..23e7e980c0 --- /dev/null +++ b/5.4.1/reference/html/img/banner-logo.svg @@ -0,0 +1,16 @@ + + + Spring Logos and Graphics + + + + + + + + + + + + + diff --git a/5.4.1/reference/html/img/doc-background-dark.svg b/5.4.1/reference/html/img/doc-background-dark.svg new file mode 100755 index 0000000000..3e7b63c3ee --- /dev/null +++ b/5.4.1/reference/html/img/doc-background-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/5.4.1/reference/html/img/doc-background.svg b/5.4.1/reference/html/img/doc-background.svg new file mode 100755 index 0000000000..301ff34f1f --- /dev/null +++ b/5.4.1/reference/html/img/doc-background.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/5.4.1/reference/html/img/octicons-16.svg b/5.4.1/reference/html/img/octicons-16.svg new file mode 100755 index 0000000000..9e8fe2847c --- /dev/null +++ b/5.4.1/reference/html/img/octicons-16.svg @@ -0,0 +1,109 @@ + + Octicons (24px subset) + Octicons v12.1.0 by GitHub - https://primer.style/octicons/ - License: MIT + + + + @primer/octicons + 12.1.0 + A scalable set of icons handcrafted with <3 by GitHub + image/svg+xml + + + GitHub + + + + + Copyright (c) 2020 GitHub Inc. + + + + https://primer.style/octicons/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/5.4.1/reference/html/index.html b/5.4.1/reference/html/index.html new file mode 100644 index 0000000000..0a4588d930 --- /dev/null +++ b/5.4.1/reference/html/index.html @@ -0,0 +1,12920 @@ + + + + + + + + +Spring Framework on Google Cloud + + + + + + +
+
+
+ +
+
+
+
+

5.4.1

+
+
+
+
+

1. Introduction

+
+
+

The Spring Framework on Google Cloud project makes the Spring Framework a first-class citizen of Google Cloud .

+
+
+

Spring Framework on Google Cloud lets you leverage the power and simplicity of the Spring Framework to:

+
+
+
    +
  • +

    Publish and subscribe to Google Cloud Pub/Sub topics

    +
  • +
  • +

    Configure Spring JDBC with a few properties to use Google Cloud SQL

    +
  • +
  • +

    Map objects, relationships, and collections with Spring Data Cloud Spanner, Spring Data Cloud Datastore and Spring Data Reactive Repositories for Cloud Firestore

    +
  • +
  • +

    Write and read from Spring Resources backed up by Google Cloud Storage

    +
  • +
  • +

    Exchange messages with Spring Integration using Google Cloud Pub/Sub on the background

    +
  • +
  • +

    Trace the execution of your app with Micrometer and Google Cloud Trace

    +
  • +
  • +

    Configure your app with Spring Cloud Config, backed up by the Google Runtime Configuration API

    +
  • +
  • +

    Consume and produce Google Cloud Storage data via Spring Integration GCS Channel Adapters

    +
  • +
  • +

    Use Spring Security via Google Cloud IAP

    +
  • +
  • +

    Analyze your images for text, objects, and other content with Google Cloud Vision

    +
  • +
+
+
+
+
+

2. Getting Started

+
+
+

This section describes how to get up to speed with Spring Framework on Google Cloud libraries.

+
+
+

2.1. Compatibility with Spring Project Versions

+
+

Spring Framework on Google Cloud has dependency and transitive dependencies on Spring Projects. The table below outlines the versions of Spring Cloud, Spring Boot and Spring Framework versions that are compatible with certain Spring Framework on Google Cloud version.

+
+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spring Framework on Google CloudSpring CloudSpring BootSpring FrameworkSupported

5.x

2023.0.x (Leyton)

3.2.x

6.1.x

Yes

4.x

2022.0.x (Kilburn)

3.0.x, 3.1.x

6.x

Yes

3.x

2021.0.x (Jubilee)

2.6.x, 2.7.x

5.3.x

Yes

2.x

2020.0.x (Ilford)

2.4.x, 2.5.x

5.3.x

No

+
+
+

2.2. Setting up Dependencies

+
+

All Spring Framework on Google Cloud artifacts are made available through Maven Central. +The following resources are provided to help you setup the libraries for your project:

+
+
+
    +
  • +

    Maven Bill of Materials for dependency management

    +
  • +
  • +

    Starter Dependencies for depending on Spring Framework on Google Cloud modules

    +
  • +
+
+
+

You may also consult our Github project to examine the code or build directly from source.

+
+
+

2.2.1. Bill of Materials

+
+

The Spring Framework on Google Cloud Bill of Materials (BOM) contains the versions of all the dependencies it uses.

+
+
+

If you’re a Maven user, adding the following to your pom.xml file will allow you omit any Spring Framework on Google Cloud dependency version numbers from your configuration. +Instead, the version of the BOM you’re using determines the versions of the used dependencies.

+
+
+
+
<dependencyManagement>
+   <dependencies>
+       <dependency>
+           <groupId>com.google.cloud</groupId>
+           <artifactId>spring-cloud-gcp-dependencies</artifactId>
+           <version>5.4.1</version>
+           <type>pom</type>
+           <scope>import</scope>
+       </dependency>
+   </dependencies>
+</dependencyManagement>
+
+
+
+

Or, if you’re a Gradle user:

+
+
+
+
dependencies {
+    implementation platform("com.google.cloud:spring-cloud-gcp-dependencies:5.4.1")
+}
+
+
+
+

In the following sections, it will be assumed you are using the Spring Framework on Google Cloud BOM and the dependency snippets will not contain versions.

+
+
+
+

2.2.2. Starter Dependencies

+
+

Spring Framework on Google Cloud offers starter dependencies through Maven to easily depend on different modules of the library. +Each starter contains all the dependencies and transitive dependencies needed to begin using their corresponding Spring Framework on Google Cloud module.

+
+
+

For example, if you wish to write a Spring application with Cloud Pub/Sub, you would include the spring-cloud-gcp-starter-pubsub dependency in your project. +You do not need to include the underlying spring-cloud-gcp-pubsub dependency, because the starter dependency includes it.

+
+
+

A summary of these artifacts are provided below.

+
+
+

Aside from these modules, we also provide additional starters with auto-configurations to various Google Client Libraries. +Refer for the full list here.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spring Framework on Google Cloud StarterDescriptionMaven Artifact Name

Core

Automatically configure authentication and Google project settings

com.google.cloud:spring-cloud-gcp-starter

Cloud Spanner

Provides integrations with Google Cloud Spanner

com.google.cloud:spring-cloud-gcp-starter-data-spanner

Cloud Datastore

Provides integrations with Google Cloud Datastore

com.google.cloud:spring-cloud-gcp-starter-data-datastore

Cloud Pub/Sub

Provides integrations with Google Cloud Pub/Sub

com.google.cloud:spring-cloud-gcp-starter-pubsub

Logging

Enables Cloud Logging

com.google.cloud:spring-cloud-gcp-starter-logging

SQL - MySQL

Cloud SQL integrations with MySQL

com.google.cloud:spring-cloud-gcp-starter-sql-mysql

SQL - PostgreSQL

Cloud SQL integrations with PostgreSQL

com.google.cloud:spring-cloud-gcp-starter-sql-postgresql

Storage

Provides integrations with Google Cloud Storage and Spring Resource

com.google.cloud:spring-cloud-gcp-starter-storage

Config

Enables usage of Google Runtime Configuration API as a Spring Cloud Config server

com.google.cloud:spring-cloud-gcp-starter-config

Trace

Enables instrumentation with Google Cloud Trace

com.google.cloud:spring-cloud-gcp-starter-trace

Vision

Provides integrations with Google Cloud Vision

com.google.cloud:spring-cloud-gcp-starter-vision

Security - IAP

Provides a security layer over applications deployed to Google Cloud

com.google.cloud:spring-cloud-gcp-starter-security-iap

Security - Firebase

Provides a security layer over applications deployed to Firebase

com.google.cloud:spring-cloud-gcp-starter-security-firebase

AlloyDB

AlloyDB integrations with PostgreSQL

com.google.cloud:spring-cloud-gcp-starter-alloydb

+
+
+

2.2.3. Spring Initializr

+
+

Spring Initializr is a tool which generates the scaffolding code for a new Spring Boot project. +It handles the work of generating the Maven or Gradle build file so you do not have to manually add the dependencies yourself.

+
+
+

Spring Initializr offers three modules from Spring Framework on Google Cloud that you can use to generate your project.

+
+
+
    +
  • +

    GCP Support: The GCP Support module contains auto-configuration support for every Spring Framework on Google Cloud integration. +Most of the autoconfiguration code is only enabled if the required dependency is added to your project.

    +
  • +
  • +

    GCP Messaging: Google Cloud Pub/Sub integrations work out of the box.

    +
  • +
  • +

    GCP Storage: Google Cloud Storage integrations work out of the box.

    +
  • +
+
+
+
+
+

2.3. Learning Spring Framework on Google Cloud

+
+

There are a variety of resources to help you learn how to use Spring Framework on Google Cloud libraries.

+
+
+

2.3.1. Sample Applications

+
+

The easiest way to learn how to use Spring Framework on Google Cloud is to consult the sample applications on Github. +Spring Framework on Google Cloud provides sample applications which demonstrate how to use every integration in the library. +The table below highlights several samples of the most commonly used integrations in Spring Framework on Google Cloud.

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Google Cloud IntegrationSample Application

Cloud Pub/Sub

spring-cloud-gcp-pubsub-sample

Cloud Spanner

spring-cloud-gcp-data-spanner-repository-sample

+

spring-cloud-gcp-data-spanner-template-sample

Datastore

spring-cloud-gcp-data-datastore-sample

Cloud SQL (w/ MySQL)

spring-cloud-gcp-sql-mysql-sample

Cloud Storage

spring-cloud-gcp-storage-resource-sample

Cloud Logging

spring-cloud-gcp-logging-sample

Trace

spring-cloud-gcp-trace-sample

Cloud Vision

spring-cloud-gcp-vision-api-sample

Cloud Security - IAP

spring-cloud-gcp-security-iap-sample

Cloud Security - Firebase

spring-cloud-gcp-security-firebase-sample

AlloyDB

spring-cloud-gcp-alloydb-sample

+
+

Each sample application demonstrates how to use Spring Framework on Google Cloud libraries in context and how to setup the dependencies for the project. +The applications are fully functional and can be deployed to Google Cloud as well. +If you are interested, you may consult guides for deploying an application to AppEngine and to Google Kubernetes Engine.

+
+
+
+

2.3.2. Codelabs

+
+

For a more hands-on approach, there are several guides and codelabs to help you get up to speed. +These guides provide step-by-step instructions for building an application using Spring Framework on Google Cloud.

+
+
+

Some examples include:

+
+ +
+

The full collection of Spring codelabs can be found on the Google Developer Codelabs page.

+
+
+
+
+
+
+

3. Spring Framework on Google Cloud Core

+
+
+

Each Spring Framework on Google Cloud module uses GcpProjectIdProvider and CredentialsProvider to get the Google Cloud project ID and access credentials.

+
+
+

Spring Framework on Google Cloud provides a Spring Boot starter to auto-configure the core components.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter")
+}
+
+
+
+

3.1. Configuration

+
+

The following options may be configured with Spring Cloud core.

+
+ ++++++ + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.core.enabled

Enables or disables Google Cloud core auto configuration

No

true

+
+
+

3.2. Project ID

+
+

GcpProjectIdProvider is a functional interface that returns a Google Cloud project ID string.

+
+
+
+
public interface GcpProjectIdProvider {
+    String getProjectId();
+}
+
+
+
+
+

The Spring Framework on Google Cloud starter auto-configures a GcpProjectIdProvider. +If a spring.cloud.gcp.project-id property is specified, the provided GcpProjectIdProvider returns that property value.

+
+
+
+
spring.cloud.gcp.project-id=my-gcp-project-id
+
+
+
+
+

Otherwise, the project ID is discovered based on an +ordered list of rules:

+
+
+
    +
  1. +

    The project ID specified by the GOOGLE_CLOUD_PROJECT environment variable

    +
  2. +
  3. +

    The Google App Engine project ID

    +
  4. +
  5. +

    The project ID specified in the JSON credentials file pointed by the GOOGLE_APPLICATION_CREDENTIALS environment variable

    +
  6. +
  7. +

    The Google Cloud SDK project ID

    +
  8. +
  9. +

    The Google Compute Engine project ID, from the Google Compute Engine Metadata Server

    +
  10. +
+
+
+
+

3.3. Credentials

+
+

CredentialsProvider is a functional interface that returns the credentials to authenticate and authorize calls to Google Cloud Client Libraries.

+
+
+
+
public interface CredentialsProvider {
+  Credentials getCredentials() throws IOException;
+}
+
+
+
+
+

The Spring Framework on Google Cloud starter auto-configures a CredentialsProvider. +It uses the spring.cloud.gcp.credentials.location property to locate the OAuth2 private key of a Google service account. +Keep in mind this property is a Spring Resource, so the credentials file can be obtained from a number of different locations such as the file system, classpath, URL, etc. +The next example specifies the credentials location property in the file system.

+
+
+
+
spring.cloud.gcp.credentials.location=file:/usr/local/key.json
+
+
+
+

Alternatively, you can set the credentials by directly specifying the spring.cloud.gcp.credentials.encoded-key property. +The value should be the base64-encoded account private key in JSON format.

+
+
+

If that credentials aren’t specified through properties, the starter tries to discover credentials from a number of places:

+
+
+
    +
  1. +

    Credentials file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable

    +
  2. +
  3. +

    Credentials provided by the Google Cloud SDK gcloud auth application-default login command

    +
  4. +
  5. +

    Google App Engine built-in credentials

    +
  6. +
  7. +

    Google Cloud Shell built-in credentials

    +
  8. +
  9. +

    Google Compute Engine built-in credentials

    +
  10. +
+
+
+

If your app is running on Google App Engine or Google Compute Engine, in most cases, you should omit the spring.cloud.gcp.credentials.location property and, instead, let the Spring Framework on Google Cloud Starter get the correct credentials for those environments. +On App Engine Standard, the App Identity service account credentials are used, on App Engine Flexible, the Flexible service account credential are used and on Google Compute Engine, the Compute Engine Default Service Account is used.

+
+
+

3.3.1. Scopes

+
+

By default, the credentials provided by the Spring Framework on Google Cloud Starter contain scopes for every service supported by Spring Framework on Google Cloud.

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Service

Scope

Spanner

www.googleapis.com/auth/spanner.admin, www.googleapis.com/auth/spanner.data

Datastore

www.googleapis.com/auth/datastore

Pub/Sub

www.googleapis.com/auth/pubsub

Storage (Read Only)

www.googleapis.com/auth/devstorage.read_only

Storage (Read/Write)

www.googleapis.com/auth/devstorage.read_write

Runtime Config

www.googleapis.com/auth/cloudruntimeconfig

Trace (Append)

www.googleapis.com/auth/trace.append

Cloud Platform

www.googleapis.com/auth/cloud-platform

Vision

www.googleapis.com/auth/cloud-vision

+
+

The Spring Framework on Google Cloud starter allows you to configure a custom scope list for the provided credentials. +To do that, specify a comma-delimited list of Google OAuth2 scopes in the spring.cloud.gcp.credentials.scopes property.

+
+
+

spring.cloud.gcp.credentials.scopes is a comma-delimited list of Google OAuth2 scopes for Google Cloud services that the credentials returned by the provided CredentialsProvider support.

+
+
+
+
spring.cloud.gcp.credentials.scopes=https://www.googleapis.com/auth/pubsub,https://www.googleapis.com/auth/sqlservice.admin
+
+
+
+

You can also use DEFAULT_SCOPES placeholder as a scope to represent the starters default scopes, and append the additional scopes you need to add.

+
+
+
+
spring.cloud.gcp.credentials.scopes=DEFAULT_SCOPES,https://www.googleapis.com/auth/cloud-vision
+
+
+
+
+
+

3.4. Environment

+
+

GcpEnvironmentProvider is a functional interface, auto-configured by the Spring Framework on Google Cloud starter, that returns a GcpEnvironment enum. +The provider can help determine programmatically in which Google Cloud environment (App Engine Flexible, App Engine Standard, Kubernetes Engine or Compute Engine) the application is deployed.

+
+
+
+
public interface GcpEnvironmentProvider {
+    GcpEnvironment getCurrentEnvironment();
+}
+
+
+
+
+
+

3.5. Customizing bean scope

+
+

Spring Framework on Google Cloud starters autoconfigure all necessary beans in the default singleton scope. +If you need a particular bean or set of beans to be recreated dynamically (for example, to rotate credentials), there are two options:

+
+
+
    +
  1. +

    Annotate custom beans of the necessary types with @RefreshScope. +This makes the most sense if your application is already redefining those beans.

    +
  2. +
  3. +

    Override the scope for autoconfigured beans by listing them in the Spring Cloud property spring.cloud.refresh.extra-refreshable.

    +
    +

    For example, the beans involved in Cloud Pub/Sub subscription could be marked as refreshable as follows:

    +
    +
  4. +
+
+
+
+
spring.cloud.refresh.extra-refreshable=com.google.cloud.spring.pubsub.support.SubscriberFactory,\
+  com.google.cloud.spring.pubsub.core.subscriber.PubSubSubscriberTemplate
+
+
+
+ + + + + +
+ + +
+

SmartLifecycle beans, such as Spring Integration adapters, do not currently support @RefreshScope. +If your application refreshes any beans used by such SmartLifecycle objects, it may also have to restart the beans manually when RefreshScopeRefreshedEvent is detected, such as in the Cloud Pub/Sub example below:

+
+
+
+
@Autowired
+private PubSubInboundChannelAdapter pubSubAdapter;
+
+@EventListener(RefreshScopeRefreshedEvent.class)
+public void onRefreshScope(RefreshScopeRefreshedEvent event) {
+  this.pubSubAdapter.stop();
+  this.pubSubAdapter.start();
+}
+
+
+
+
+
+
+
+

3.6. Spring Initializr

+
+

This starter is available from Spring Initializr through the GCP Support entry.

+
+
+
+
+
+

4. Cloud Storage

+
+
+

Google Cloud Storage allows storing any types of files in single or multiple regions. +A Spring Boot starter is provided to auto-configure the various Storage components.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-storage</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-storage")
+}
+
+
+
+

This starter is also available from Spring Initializr through the GCP Storage entry.

+
+
+

4.1. Using Cloud Storage

+
+

The starter automatically configures and registers a Storage bean in the Spring application context. +The Storage bean (Javadoc) can be used to list/create/update/delete buckets (a group of objects with similar permissions and resiliency requirements) and objects.

+
+
+
+
@Autowired
+private Storage storage;
+
+public void createFile() {
+    Bucket bucket = storage.create(BucketInfo.of("my-app-storage-bucket"));
+
+    storage.create(
+        BlobInfo.newBuilder("my-app-storage-bucket", "subdirectory/my-file").build(),
+            "file contents".getBytes()
+    );
+}
+
+
+
+
+
+

4.2. Cloud Storage Objects As Spring Resources

+
+

Spring Resources are an abstraction for a number of low-level resources, such as file system files, classpath files, servlet context-relative files, etc. +Spring Framework on Google Cloud adds a new resource type: a Google Cloud Storage (GCS) object.

+
+
+

The Spring Resource Abstraction for Google Cloud Storage allows GCS objects to be accessed by their GCS URL using the @Value annotation:

+
+
+
+
@Value("gs://[YOUR_GCS_BUCKET]/[GCS_FILE_NAME]")
+private Resource gcsResource;
+
+
+
+
+

…​or the Spring application context

+
+
+
+
SpringApplication.run(...).getResource("gs://[YOUR_GCS_BUCKET]/[GCS_FILE_NAME]");
+
+
+
+
+

This creates a Resource object that can be used to read the object, among other possible operations.

+
+
+

It is also possible to write to a Resource, although a WriteableResource is required.

+
+
+
+
@Value("gs://[YOUR_GCS_BUCKET]/[GCS_FILE_NAME]")
+private Resource gcsResource;
+...
+try (OutputStream os = ((WritableResource) gcsResource).getOutputStream()) {
+  os.write("foo".getBytes());
+}
+
+
+
+
+

To work with the Resource as a Google Cloud Storage resource, cast it to GoogleStorageResource.

+
+
+

If the resource path refers to an object on Google Cloud Storage (as opposed to a bucket), then the getBlob method can be called to obtain a Blob. +This type represents a GCS file, which has associated metadata, such as content-type, that can be set. +The createSignedUrl method can also be used to obtain signed URLs for GCS objects. +However, creating signed URLs requires that the resource was created using service account credentials.

+
+
+ + + + + +
+ + +
+

As of v2.0.2+, the GoogleStorageResource.getURL() method returns the Bucket or Blob 's selfLink value, rather than attempting to convert the URI a URL object that nearly-always threw a MalformedURLException. +This value is notably different from GoogleStorageResource.getURI(), which returns the more commonly used gs://my-bucket/my-object identifier. +Returning a valid URL is necessary to support some features in the Spring ecosystem, such as spring.resources.static-locations.

+
+
+
+
+

The Spring Boot Starter for Google Cloud Storage auto-configures the Storage bean required by the spring-cloud-gcp-storage module, based on the CredentialsProvider provided by the Spring Framework on Google Cloud Starter.

+
+
+

4.2.1. Setting the Content Type

+
+

You can set the content-type of Google Cloud Storage files from their corresponding Resource objects:

+
+
+
+
((GoogleStorageResource)gcsResource).getBlob().toBuilder().setContentType("text/html").build().update();
+
+
+
+
+
+
+

4.3. Configuration

+
+

The Spring Boot Starter for Google Cloud Storage provides the following configuration options:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.storage.enabled

Enables the Google Cloud storage APIs.

No

true

spring.cloud.gcp.storage.auto-create-files

Creates files and buckets on Google Cloud Storage when writes are made to non-existent files

No

true

spring.cloud.gcp.storage.credentials.location

OAuth2 credentials for authenticating with the Google Cloud Storage API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.storage.credentials.encoded-key

Base64-encoded contents of OAuth2 account private key for authenticating with the Google Cloud Storage API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.storage.credentials.scopes

OAuth2 scope for Spring Framework on Google Cloud Storage credentials

No

www.googleapis.com/auth/devstorage.read_write

+
+
+

4.4. Sample

+
+

A sample application and a codelab are available.

+
+
+
+
+
+

5. Cloud SQL

+
+
+

Spring Framework on Google Cloud adds integrations with +Spring JDBC and Spring R2DBC, so you can run your MySQL or PostgreSQL databases in Google Cloud SQL using Spring JDBC and other libraries that depend on it like Spring Data JPA or Spring Data R2DBC.

+
+
+

The Cloud SQL support is provided by Spring Framework on Google Cloud in the form of two Spring Boot starters, one for MySQL and another one for PostgreSQL. +The role of the starters is to read configuration from properties and assume default settings so that user experience connecting to MySQL and PostgreSQL is as simple as possible.

+
+
+

5.1. JDBC Support

+
+

Maven and Gradle coordinates, using Spring Framework on Google Cloud BOM:

+
+
+

To use MySQL:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-sql-mysql</artifactId>
+</dependency>
+
+
+
+
+
dependencies {
+implementation("com.google.cloud:spring-cloud-gcp-starter-sql-mysql")
+}
+
+
+
+

To use PostgreSQL:

+
+
+
+
<dependency>
+<groupId>com.google.cloud</groupId>
+<artifactId>spring-cloud-gcp-starter-sql-postgresql</artifactId>
+</dependency>
+
+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-sql-postgresql")
+}
+
+
+
+

5.1.1. Prerequisites

+
+

In order to use the Spring Boot Starters for Google Cloud SQL, the Google Cloud SQL API must be enabled in your Google Cloud project.

+
+
+

To do that, go to the API library page of the Google Cloud Console, search for "Cloud SQL API" and enable the option that is called "Cloud SQL" .

+
+
+
+

5.1.2. Spring Boot Starter for Google Cloud SQL

+
+

The Spring Boot Starters for Google Cloud SQL provide an autoconfigured DataSource object. +Coupled with Spring JDBC, it provides a +JdbcTemplate object bean that allows for operations such as querying and modifying a database.

+
+
+
+
public List<Map<String, Object>> listUsers() {
+    return jdbcTemplate.queryForList("SELECT * FROM user;");
+}
+
+
+
+
+

You can rely on +Spring Boot data source autoconfiguration to configure a DataSource bean. +In other words, properties like the SQL username, spring.datasource.username, and password, spring.datasource.password can be used. +There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Configuration Properties" section below).

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.datasource.username

Database username

No

MySQL: root; PostgreSQL: postgres

spring.datasource.password

Database password

No

null

spring.datasource.driver-class-name

JDBC driver to use.

No

MySQL: com.mysql.cj.jdbc.Driver; PostgreSQL: org.postgresql.Driver

+
+ + + + + +
+ + +If you provide your own spring.datasource.url, it will be ignored, unless you disable Cloud SQL autoconfiguration with spring.cloud.gcp.sql.enabled=false or spring.cloud.gcp.sql.jdbc.enabled=false. +
+
+
+
DataSource creation flow
+
+

Spring Boot starter for Google Cloud SQL registers a CloudSqlEnvironmentPostProcessor that provides a correctly formatted spring.datasource.url property to the environment based on the properties mentioned above. +It also provides defaults for spring.datasource.username and spring.datasource.driver-class-name, which can be overridden. +The starter also configures credentials for the JDBC connection based on the properties below.

+
+
+

The user properties and the properties provided by the CloudSqlEnvironmentPostProcessor are then used by Spring Boot to create the DataSource. +You can select the type of connection pool (e.g., Tomcat, HikariCP, etc.) by adding their dependency to the classpath.

+
+
+

Using the created DataSource in conjunction with Spring JDBC provides you with a fully configured and operational JdbcTemplate object that you can use to interact with your SQL database. +You can connect to your database with as little as a database and instance names.

+
+
+
+
+
+

5.2. R2DBC Support

+
+

Maven and Gradle coordinates, using Spring Framework on Google Cloud BOM:

+
+
+

To use PostgreSQL:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-sql-postgres-r2dbc</artifactId>
+</dependency>
+
+
+
+

5.2.1. Prerequisites

+
+

In order to use the Spring Boot Starters for Google Cloud SQL, the Google Cloud SQL API must be enabled in your Google Cloud project.

+
+
+

To do that, go to the API library page of the Google Cloud Console, search for "Cloud SQL API" and enable the option that is called "Cloud SQL".

+
+
+
+

5.2.2. Spring Boot Starter for Google Cloud SQL

+
+

The Cloud SQL R2DBC starter provides a customized io.r2dbc.spi.ConnectionFactory bean for connecting to Cloud SQL with the help of the Cloud SQL Socket Factory. +Similar to the JDBC support, you can connect to your database with as little as a database and instance names.

+
+
+

A higher level convenience object +R2dbcEntityTemplate is also provided for operations such as querying and modifying a database.

+
+
+
+
@Autowired R2dbcEntityTemplate template;
+
+public Flux<String> listUsers() {
+  return template.select(User.class).all().map(user -> user.toString());
+}
+
+
+
+
+

Standard R2DBC properties like the SQL username, spring.r2dbc.username, and password, spring.r2dbc.password can be used. +There is also some configuration specific to Google Cloud SQL (see "Cloud SQL Configuration Properties" section below).

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.r2dbc.username

Database username

No

postgres

spring.r2dbc.password

Database password

No

null

+
+ + + + + +
+ + +If you provide your own spring.r2dbc.url, it will be ignored, unless you disable Cloud SQL autoconfiguration for R2DBC with spring.cloud.gcp.sql.enabled=false or spring.cloud.gcp.sql.r2dbc.enabled=false . +
+
+
+
ConnectionFactory creation flow
+
+

Spring Framework on Google Cloud starter for Google Cloud SQL registers a R2dbcCloudSqlEnvironmentPostProcessor that provides a correctly formatted spring.r2dbc.url property to the environment based on the properties mentioned above. +It also provides a default value for spring.r2dbc.username, which can be overridden. +The starter also configures credentials for the R2DBC connection based on the properties below.

+
+
+

The user properties and the properties provided by the R2dbcCloudSqlEnvironmentPostProcessor are then used by Spring Boot to create the ConnectionFactory.

+
+
+

The customized ConnectionFactory is then ready to connect to Cloud SQL. The rest of Spring Data R2DBC objects built on it ( R2dbcEntityTemplate, DatabaseClient) are automatically configured and operational, ready to interact with your SQL database.

+
+
+
+
+
+

5.3. Cloud SQL IAM database authentication

+
+

Currently, Cloud SQL only supports IAM database authentication for PostgreSQL. +It allows you to connect to the database using an IAM account, rather than a predefined database username and password. +You will need to do the following to enable it:

+
+
+
    +
  1. +

    In your database instance settings, turn on the cloudsql.iam_authentication flag.

    +
  2. +
  3. +

    Add the IAM user or service account to the list of database users.

    +
  4. +
  5. +

    In the application settings, set spring.cloud.gcp.sql.enableIamAuth to true. Note that this will also set the database protocol sslmode to disabled, as it’s required for IAM authentication to work. +However, it doesn’t compromise the security of the communication because the connection is always encrypted.

    +
  6. +
  7. +

    Set spring.datasource.username to the IAM user or service account created in step 2. Note that IAM user or service account still needs to be granted permissions before modifying or querying the database.

    +
  8. +
+
+
+
+

5.4. Cloud SQL Configuration Properties

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.cloud.gcp.sql.enabled

Enables or disables Cloud SQL auto configuration

No

true

spring.cloud.gcp.sql.jdbc.enabled

Enables or disables Cloud SQL auto-configuration for JDBC

No

true

spring.cloud.gcp.sql.r2dbc.enabled

Enables or disables Cloud SQL auto-configuration for R2DBC

No

true

spring.cloud.gcp.sql.database-name

Name of the database to connect to.

Yes

spring.cloud.gcp.sql.instance-connection-name

A string containing a Google Cloud SQL instance’s project ID, region and name, each separated by a colon.

Yes

For example, my-project-id:my-region:my-instance-name.

spring.cloud.gcp.sql.ip-types

Allows you to specify a comma delimited list of preferred IP types for connecting to a Cloud SQL instance. Left unconfigured Cloud SQL Socket Factory will default it to PUBLIC,PRIVATE. See Cloud SQL Socket Factory - Specifying IP Types

No

PUBLIC,PRIVATE

spring.cloud.gcp.sql.credentials.location

File system path to the Google OAuth2 credentials private key file. +Used to authenticate and authorize new connections to a Google Cloud SQL instance.

No

Default credentials provided by the Spring Framework on Google Cloud Core Starter

spring.cloud.gcp.sql.credentials.encoded-key

Base64-encoded contents of OAuth2 account private key in JSON format. +Used to authenticate and authorize new connections to a Google Cloud SQL instance.

No

Default credentials provided by the Spring Framework on Google Cloud Core Starter

spring.cloud.gcp.sql.enableIamAuth

Specifies whether to enable IAM database authentication (PostgreSQL only).

No

False

+
+
+

5.5. Troubleshooting tips

+
+

5.5.1. Connection issues

+
+

If you’re not able to connect to a database and see an endless loop of Connecting to Cloud SQL instance […​] on IP […​], it’s likely that exceptions are being thrown and logged at a level lower than your logger’s level. +This may be the case with HikariCP, if your logger is set to INFO or higher level.

+
+
+

To see what’s going on in the background, you should add a logback.xml file to your application resources folder, that looks like this:

+
+
+
+
<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <include resource="org/springframework/boot/logging/logback/base.xml"/>
+  <logger name="com.zaxxer.hikari.pool" level="DEBUG"/>
+</configuration>
+
+
+
+
+

5.5.2. Errors like c.g.cloud.sql.core.SslSocketFactory : Re-throwing cached exception due to attempt to refresh instance information too soon after error

+
+

If you see a lot of errors like this in a loop and can’t connect to your database, this is usually a symptom that something isn’t right with the permissions of your credentials or the Google Cloud SQL API is not enabled. +Verify that the Google Cloud SQL API is enabled in the Cloud Console and that your service account has the necessary IAM roles.

+
+
+

To find out what’s causing the issue, you can enable DEBUG logging level as mentioned above.

+
+
+
+

5.5.3. PostgreSQL: java.net.SocketException: already connected issue

+
+

We found this exception to be common if your Maven project’s parent is spring-boot version 1.5.x, or in any other circumstance that would cause the version of the org.postgresql:postgresql dependency to be an older one (e.g., 9.4.1212.jre7).

+
+
+

To fix this, re-declare the dependency in its correct version. +For example, in Maven:

+
+
+
+
<dependency>
+  <groupId>org.postgresql</groupId>
+  <artifactId>postgresql</artifactId>
+  <version>42.1.1</version>
+</dependency>
+
+
+
+
+ +
+
+
+

6. Cloud Pub/Sub

+
+
+

Spring Framework on Google Cloud provides an abstraction layer to publish to and subscribe from Google Cloud Pub/Sub topics and to create, list or delete Google Cloud Pub/Sub topics and subscriptions.

+
+
+

A Spring Boot starter is provided to autoconfigure the various required Pub/Sub components.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-pubsub")
+}
+
+
+
+

This starter is also available from Spring Initializr through the GCP Messaging entry.

+
+
+

6.1. Configuration

+
+

The Spring Boot starter for Google Cloud Pub/Sub provides the following configuration options.

+
+
+

6.1.1. Spring Framework on Google Cloud Pub/Sub API Configuration

+
+

This section describes options for enabling the integration, specifying the Google Cloud project and credentials, and setting whether the APIs should connect to an emulator for local testing.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.pubsub.enabled

Enables or disables Pub/Sub auto-configuration

No

true

spring.cloud.gcp.pubsub.project-id

Google Cloud project ID where the Google Cloud Pub/Sub API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.pubsub.credentials.location

OAuth2 credentials for authenticating with the +Google Cloud Pub/Sub API, if different from the ones in the +Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.pubsub.emulator-host

The host and port of the local running emulator. +If provided, this will set up the client to connect against a running Google Cloud Pub/Sub Emulator.

No

spring.cloud.gcp.pubsub.credentials.encoded-key

Base64-encoded contents of OAuth2 account private key for authenticating with the +Google Cloud Pub/Sub API, if different from the ones in the +Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.pubsub.credentials.scopes

OAuth2 scope for Spring Framework on Google Cloud +Pub/Sub credentials

No

www.googleapis.com/auth/pubsub

+
+
+

6.1.2. Publisher/Subscriber Configuration

+
+

This section describes configuration options to customize the behavior of the application’s Pub/Sub publishers and subscribers. +Subscriber settings can be either global or subscription-specific.

+
+
+ + + + + +
+ + +A custom configuration (injected through a setter in DefaultSubscriberFactory or a custom bean) will take precedence over autoconfiguration. +Hence, if one wishes to use per-subscription configuration for a Pub/Sub setting, there must not be a custom bean for that setting. +When using autoconfiguration, if both global and per-subscription configurations are provided, then the per-subscription configuration will be used. +However, if a per-subscription configuration is not set then the global or default configuration will be used. +
+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.pubsub.subscriber.parallel-pull-count

The number of pull workers

No

1

spring.cloud.gcp.pubsub.subscriber.max-ack-extension-period

The maximum period a message ack deadline will be extended, in seconds

No

0

spring.cloud.gcp.pubsub.subscriber.min-duration-per-ack-extension

The lower bound for a single mod ack extension period, in seconds

No

0

spring.cloud.gcp.pubsub.subscriber.max-duration-per-ack-extension

The upper bound for a single mod ack extension period, in seconds

No

0

spring.cloud.gcp.pubsub.subscriber.pull-endpoint

The endpoint for pulling messages

No

pubsub.googleapis.com:443

spring.cloud.gcp.pubsub.[subscriber,publisher].executor-threads

Number of threads used by Subscriber instances created by SubscriberFactory

No

4

spring.cloud.gcp.pubsub.[subscriber,publisher.batching].flow-control.max-outstanding-element-count

Maximum number of outstanding elements to keep in memory before enforcing flow control.

No

unlimited

spring.cloud.gcp.pubsub.[subscriber,publisher.batching].flow-control.max-outstanding-request-bytes

Maximum number of outstanding bytes to keep in memory before enforcing flow control.

No

unlimited

spring.cloud.gcp.pubsub.[subscriber,publisher.batching].flow-control.limit-exceeded-behavior

The behavior when the specified limits are exceeded.

No

Block

spring.cloud.gcp.pubsub.publisher.batching.element-count-threshold

The element count threshold to use for batching.

No

1 (batching off)

spring.cloud.gcp.pubsub.publisher.batching.request-byte-threshold

The request byte threshold to use for batching.

No

1 byte (batching off)

spring.cloud.gcp.pubsub.publisher.batching.delay-threshold-seconds

The delay threshold to use for batching. +After this amount of time has elapsed (counting from the first element added), the elements will be wrapped up in a batch and sent.

No

1 ms (batching off)

spring.cloud.gcp.pubsub.publisher.batching.enabled

Enables batching.

No

false

spring.cloud.gcp.pubsub.publisher.enable-message-ordering

Enables message ordering.

No

false

spring.cloud.gcp.pubsub.publisher.endpoint

The publisher endpoint. +Example: "us-east1-pubsub.googleapis.com:443". +This is useful in conjunction with enabling message ordering because sending messages to the same region ensures they are received in order even when multiple publishers are used.

No

pubsub.googleapis.com:443

spring.cloud.gcp.pubsub.publisher.executor-accept-tasks-after-context-close

Sets the underlying ThreadPoolTaskScheduler 's acceptTasksAfterContextClose property. +If true, tasks will be accepted after the ContextClosedEvent at the expense of a longer shutdown phase.

No

false

spring.cloud.gcp.pubsub.publisher.executor-await-termination-millis

Sets the underlying ThreadPoolTaskScheduler 's awaitTerminationMillis property. +Determines the maximum number of milliseconds the scheduler will block on shutdown while waiting for remaining tasks to complete. +This is particularly useful if the remaining tasks need access to other resources that are also managed by the container.

No

0

spring.cloud.gcp.pubsub.publisher.executor-wait-for-tasks-to-complete-on-shutdown

Sets the underlying ThreadPoolTaskScheduler 's waitForTasksToCompleteOnShutdown property. +Determines whether to wait for scheduled tasks to complete on shutdown, not interrupting running tasks and executing all tasks in the queue. +When true, replicates the default behavior before Spring 6.1.x.

No

false

+
+
Subscription-specific Configurations
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.pubsub.subscription.[subscription-name].fully-qualified-name

The fully-qualified subscription name in the projects/[PROJECT]/subscriptions/[SUBSCRIPTION] format. When this property is present, the [subscription-name] key does not have to match any actual resources; it’s used only for logical grouping.

No

1

spring.cloud.gcp.pubsub.subscription.[subscription-name].parallel-pull-count

The number of pull workers.

No

1

spring.cloud.gcp.pubsub.subscription.[subscription-name].max-ack-extension-period

The maximum period a message ack deadline will be extended, in seconds.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].min-duration-per-ack-extension

The lower bound for a single mod ack extension period, in seconds

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].max-duration-per-ack-extension

The upper bound for a single mod ack extension period, in seconds

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].pull-endpoint

The endpoint for pulling messages.

No

pubsub.googleapis.com:443

spring.cloud.gcp.pubsub.subscription.[subscription-name].executor-threads

Number of threads used by Subscriber instances created by SubscriberFactory. Note that configuring per-subscription executor-threads will result in the creation of thread pools for both global/default and per-subscription configurations.

No

4

spring.cloud.gcp.pubsub.subscription.[subscription-name].flow-control.max-outstanding-element-count

Maximum number of outstanding elements to keep in memory before enforcing flow control.

No

unlimited

spring.cloud.gcp.pubsub.subscription.[subscription-name].flow-control.max-outstanding-request-bytes

Maximum number of outstanding bytes to keep in memory before enforcing flow control.

No

unlimited

spring.cloud.gcp.pubsub.subscription.[subscription-name].flow-control.limit-exceeded-behavior

The behavior when the specified limits are exceeded.

No

Block

+
+ + + + + +
+ + +By default, subscription-specific threads are named after fully-qualified subscription name, ex: gcp-pubsub-subscriber-projects/project-id/subscriptions/subscription-name. +This can be customized, by registering a SelectiveSchedulerThreadNameProvider bean. +
+
+
+
+
+

6.1.3. GRPC Connection Settings

+
+

The Pub/Sub API uses the GRPC protocol to send API requests to the Pub/Sub service. +This section describes configuration options for customizing the GRPC behavior.

+
+
+ + + + + +
+ + +The properties that refer to retry control the RPC retries for transient failures during the gRPC call to Cloud Pub/Sub server. +They do not control message redelivery; only message acknowledgement deadline can be used to extend or shorten the amount of time until Pub/Sub attempts redelivery. +
+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.pubsub.keepAliveIntervalMinutes

Determines frequency of keepalive gRPC ping

No

5 minutes

spring.cloud.gcp.pubsub.subscriber.retryableCodes

RPC status codes that should be retried when pulling messages.

No

UNKNOWN,ABORTED,UNAVAILABLE

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.total-timeout-seconds

TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. +The higher the total timeout, the more retries can be attempted.

No

0

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.initial-retry-delay-second

InitialRetryDelay controls the delay before the first retry. +Subsequent retries will use this value adjusted according to the RetryDelayMultiplier.

No

0

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.retry-delay-multiplier

RetryDelayMultiplier controls the change in retry delay. +The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.

No

1

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.max-retry-delay-seconds

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier +can’t increase the retry delay higher than this amount.

No

0

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.max-attempts

MaxAttempts defines the maximum number of attempts to perform. +If this value is greater than 0, and the number of attempts reaches this limit, the logic will give up retrying even if the total retry time is still lower than TotalTimeout.

No

0

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.jittered

Jitter determines if the delay time should be randomized.

No

true

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.initial-rpc-timeout-seconds

InitialRpcTimeout controls the timeout for the initial RPC. +Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier.

No

0

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.rpc-timeout-multiplier

RpcTimeoutMultiplier controls the change in RPC timeout. +The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

No

1

spring.cloud.gcp.pubsub.[subscriber,publisher].retry.max-rpc-timeout-seconds

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier +can’t increase the RPC timeout higher than this amount.

No

0

+
+

Subscription-specific Configuration

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.pubsub.subscription.[subscription-name].retryableCodes

RPC status codes that should be retried when pulling messages.

No

UNKNOWN,ABORTED,UNAVAILABLE

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.total-timeout-seconds

TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries can be attempted.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.initial-retry-delay-second

InitialRetryDelay controls the delay before the first retry. +Subsequent retries will use this value adjusted according to the RetryDelayMultiplier.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.retry-delay-multiplier

RetryDelayMultiplier controls the change in retry delay. +The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.

No

1

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.max-retry-delay-seconds

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier +can’t increase the retry delay higher than this amount.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.max-attempts

MaxAttempts defines the maximum number of attempts to perform. +If this value is greater than 0, and the number of attempts reaches this limit, the logic will give up retrying even if the total retry time is still lower than TotalTimeout.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.jittered

Jitter determines if the delay time should be randomized.

No

true

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.initial-rpc-timeout-seconds

InitialRpcTimeout controls the timeout for the initial RPC. +Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier.

No

0

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.rpc-timeout-multiplier

RpcTimeoutMultiplier controls the change in RPC timeout. +The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

No

1

spring.cloud.gcp.pubsub.subscription.[subscription-name].retry.max-rpc-timeout-seconds

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier +can’t increase the RPC timeout higher than this amount.

No

0

+
+
+

6.1.4. Programmatic Configuration

+
+

To apply publishing customizations not covered by the properties above, you may provide custom beans of type PublisherCustomizer to post-process the Publisher.Builder object right before it is built into a Publisher. +The PublisherCustomizer beans may be annotated with Spring Framework’s @Order annotation to ensure they are applied in a particular sequence.

+
+
+
+
+

6.2. Spring Boot Actuator Support

+
+

6.2.1. Cloud Pub/Sub Health Indicator

+
+

If you are using Spring Boot Actuator, you can take advantage of the Cloud Pub/Sub health indicator called pubsub. +The health indicator will verify whether Cloud Pub/Sub is up and accessible by your application. +To enable it, all you need to do is add the Spring Boot Actuator to your project.

+
+
+

The pubsub indicator will then roll up to the overall application status visible at localhost:8080/actuator/health (use the management.endpoint.health.show-details property to view per-indicator details).

+
+
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-actuator</artifactId>
+</dependency>
+
+
+
+ + + + + +
+ + +If your application already has actuator and Cloud Pub/Sub starters, this health indicator is enabled by default. +To disable the Cloud Pub/Sub indicator, set management.health.pubsub.enabled to false. +
+
+
+

The health indicator validates the connection to Pub/Sub by pulling messages from a Pub/Sub subscription.

+
+
+

If no subscription has been specified via spring.cloud.gcp.pubsub.health.subscription, it will pull messages from a random subscription that is expected not to exist. +It will signal "up" if it is able to connect to Spring Framework on Google Cloud Pub/Sub APIs, i.e. the pull results in a response of NOT_FOUND or PERMISSION_DENIED.

+
+
+

If a custom subscription has been specified, this health indicator will signal "up" if messages are successfully pulled and (optionally) acknowledged, or when a successful pull is performed but no messages are returned from Pub/Sub. +Note that messages pulled from the subscription will not be acknowledged, unless you set the spring.cloud.gcp.pubsub.health.acknowledge-messages option to true. +So, take care not to configure a subscription that has a business impact, or instead leave the custom subscription out completely.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

management.health.pubsub.enabled

Whether to enable the Pub/Sub health indicator

No

true with Spring Boot Actuator, false otherwise

spring.cloud.gcp.pubsub.health.subscription

Subscription to health check against by pulling a message

No

Random non-existent

spring.cloud.gcp.pubsub.health.timeout-millis

Milliseconds to wait for response from Pub/Sub before timing out

No

2000

spring.cloud.gcp.pubsub.health.acknowledge-messages

Whether to acknowledge messages pulled from the optionally specified subscription

No

false

+
+
+

6.2.2. Cloud Pub/Sub Subscription Health Indicator

+
+

If you are using Spring Boot Actuator, you can take advantage of the Cloud Pub/Sub subscription health indicator called pubsub-subscriber. +The subscription health indicator will verify whether Pub/Sub subscriptions are actively processing messages from the subscription’s backlog. +To enable it, you need to add the Spring Boot Actuator to your project and the GCP Monitoring.

+
+
+
+
<dependency>
+  <groupId>org.springframework.boot</groupId>
+  <artifactId>spring-boot-starter-actuator</artifactId>
+</dependency>
+<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>google-cloud-monitoring</artifactId>
+</dependency>
+
+
+
+

Also, you need to set the following properties spring.cloud.gcp.pubsub.health.lagThreshold, spring.cloud.gcp.pubsub.health.backlogThreshold.

+
+
+

The pubsub-subscriber indicator will then roll up to the overall application status visible at localhost:8080/actuator/health (use the management.endpoint.health.show-details property to view per-indicator details).

+
+
+

If you use PubSubInboundChannel to integrate with Pub/Sub, make sure to call .setHealthTrackerRegistry() with the auto-configured HealthTrackerRegistry bean.

+
+
+

The health indicator validates a subscriber’s health by checking the subscription’s message backlog and the last processed message. +A subscription’s backlog is retrieved using Google Cloud’s Monitoring Metrics. The metric used is the num_undelivered_messages for a subscription.

+
+
+

If a message has been recently processed in a reasonable time threshold, then the subscriber is healthy. +If the backlog of messages for a subscription is big but the subscriber consumes messages then subscriber is still healthy. +If there hasn’t been any processing of recent messages but the backlog increases, then the subscriber is unhealthy.

+
+
+ + + + + +
+ + +The health indicator will not behave entirely as expected if Dead Letter Queueing is enabled on the subscription being checked, num_undelivered_messages will drop by itself after DLQ threshold is reached. +
+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

management.health.pubsub-subscriber.enabled

Whether to enable the Pub/Sub Subscription health indicator

No

true with Spring Boot Actuator, false otherwise

spring.cloud.gcp.pubsub.health.lagThreshold

Threshold in seconds over message processing lag

Yes

Provided

spring.cloud.gcp.pubsub.health.backlogThreshold

The threshold number of messages for a subscription backlog

Yes

Provided

spring.cloud.gcp.pubsub.health.lookUpInterval

The optional interval in seconds for subscription backlog lookup

No

1

spring.cloud.gcp.pubsub.health.executorThreads

Number of threads used for Health Check Executors

No

4

+
+
+
+

6.3. Pub/Sub Operations & Template

+
+

PubSubOperations is an abstraction that allows Spring users to use Google Cloud Pub/Sub without depending on any Google Cloud Pub/Sub API semantics. +It provides the common set of operations needed to interact with Google Cloud Pub/Sub. +PubSubTemplate is the default implementation of PubSubOperations and it uses the Google Cloud Java Client for Pub/Sub to interact with Google Cloud Pub/Sub.

+
+
+

6.3.1. Publishing to a topic

+
+

PubSubTemplate provides asynchronous methods to publish messages to a Google Cloud Pub/Sub topic. +The publish() method takes in a topic name to post the message to, a payload of a generic type and, optionally, a map with the message headers. +The topic name could either be a short topic name within the current project, or the fully-qualified name referring to a topic in a different project using the projects/[project_name]/topics/[topic_name] format.

+
+
+

Here is an example of how to publish a message to a Google Cloud Pub/Sub topic:

+
+
+
+
Map<String, String> headers = Collections.singletonMap("key1", "val1");
+pubSubTemplate.publish(topicName, "message", headers).get();
+
+
+
+
+

By default, the SimplePubSubMessageConverter is used to convert payloads of type byte[], ByteString, ByteBuffer, and String to Pub/Sub messages.

+
+
+
Ordering messages
+
+

If you are relying on message converters and would like to provide an ordering key, use the GcpPubSubHeaders.ORDERING_KEY header. +You will also need to make sure to enable message ordering on the publisher via the spring.cloud.gcp.pubsub.publisher.enable-message-ordering property. +Additionally, if you are using multiple publishers, you will want to set the spring.cloud.gcp.pubsub.publisher.endpoint to a regional endpoint such as "us-east1-pubsub.googleapis.com:443" so that messages are sent to the same region and received in order.

+
+
+
+
Map<String, String> headers =
+    Collections.singletonMap(GcpPubSubHeaders.ORDERING_KEY, "key1");
+pubSubTemplate.publish(topicName, "message1", headers).get();
+pubSubTemplate.publish(topicName, "message2", headers).get();
+
+
+
+
+
+
+

6.3.2. Subscribing to a subscription

+
+

Google Cloud Pub/Sub allows many subscriptions to be associated to the same topic. +PubSubTemplate allows you to listen to subscriptions via the subscribe() method. +When listening to a subscription, messages will be pulled from Google Cloud Pub/Sub asynchronously and passed to a user provided message handler. +The subscription name could either be a short subscription name within the current project, or the fully-qualified name referring to a subscription in a different project using the projects/[project_name]/subscriptions/[subscription_name] format.

+
+
+
Example
+
+

Subscribe to a subscription with a message handler:

+
+
+
+
Subscriber subscriber =
+    pubSubTemplate.subscribe(
+        subscriptionName,
+        message -> {
+          logger.info(
+              "Message received from "
+                  + subscriptionName
+                  + " subscription: "
+                  + message.getPubsubMessage().getData().toStringUtf8());
+          message.ack();
+        });
+
+
+
+
+
+
Subscribe methods
+
+

PubSubTemplate provides the following subscribe methods:

+
+ ++++ + + + + + + + + + + +

subscribe(String subscription, Consumer<BasicAcknowledgeablePubsubMessage> messageConsumer)

asynchronously pulls messages and passes them to messageConsumer

subscribeAndConvert(String subscription, + Consumer<ConvertedBasicAcknowledgeablePubsubMessage<T>> messageConsumer, + Class<T> payloadType)

same as pull, but converts message payload to payloadType using the converter configured in the template

+
+ + + + + +
+ + +
+

As of version 1.2, subscribing by itself is not enough to keep an application running. +For a command-line application, a way to keep the application running is to have a user thread(non-daemon thread) started up. A fake scheduled task creates a threadpool with non-daemon threads:

+
+
+
+
@Scheduled (fixedRate = 1, timeUnit = TimeUnit.MINUTES)
+public void fakeScheduledTask() {
+    // do nothing
+}
+
+
+
+
+

Another option is to pull in spring-boot-starter-web or spring-boot-starter-webflux as a dependency which will start an embedded servlet container or reactive server keeping the application running in the background

+
+
+
+
+
+
+

6.3.3. Pulling messages from a subscription

+
+

Google Cloud Pub/Sub supports synchronous pulling of messages from a subscription. +This is different from subscribing to a subscription, in the sense that subscribing is an asynchronous task.

+
+
+
Example
+
+

Pull up to 10 messages:

+
+
+
+
int maxMessages = 10;
+boolean returnImmediately = false;
+List<AcknowledgeablePubsubMessage> messages =
+    pubSubTemplate.pull(subscriptionName, maxMessages, returnImmediately);
+
+// acknowledge the messages
+pubSubTemplate.ack(messages);
+
+messages.forEach(
+    message ->
+        logger.info(message.getPubsubMessage().getData().toStringUtf8()));
+
+
+
+
+
+
Pull methods
+
+

PubsubTemplate provides the following pull methods:

+
+ ++++ + + + + + + + + + + + + + + + + + + +

pull(String subscription, Integer maxMessages, + Boolean returnImmediately)

Pulls a number of messages from a subscription, allowing for the retry settings to be configured. + Any messages received by pull() are not automatically acknowledged. See Acknowledging messages.

+

The maxMessages parameter is the maximum limit of how many messages to pull from a subscription in a single call; this value must be greater than 0. + You may omit this parameter by passing in null; this means there will be no limit on the number of messages pulled (maxMessages will be Integer.MAX_INTEGER).

+

If returnImmediately is true, the system will respond immediately even if it there are no messages available to return in the Pull response. Otherwise, the system may wait (for a bounded amount of time) until at least one message is available, rather than returning no messages.

pullAndAck

Works the same as the pull method and, additionally, acknowledges all received messages.

pullNext

Allows for a single message to be pulled and automatically acknowledged from a subscription.

pullAndConvert

Works the same as the pull method and, additionally, converts the Pub/Sub binary payload to an object of the desired type, using the converter configured in the template.

+
+ + + + + +
+ + +We do not recommend setting returnImmediately to true, as it may result in delayed message delivery. +"Immediately" really means 1 second, and if Pub/Sub cannot retrieve any messages from the backend in that time, it will return 0 messages, despite having messages queue up on the topic. +Therefore, we recommend setting returnImmediately to false, or using subscribe methods from the previous section. +
+
+
+
+
Acknowledging messages
+
+

There are two ways to acknowledge messages.

+
+
+
    +
  1. +

    To acknowledge multiple messages at once, you can use the PubSubTemplate.ack() method. +You can also use the PubSubTemplate.nack() for negatively acknowledging messages. +Using these methods for acknowledging messages in batches is more efficient than acknowledging messages individually, but they require the collection of messages to be from the same project.

    +
  2. +
  3. +

    To acknowledge messages individually you can use the ack() or nack() method on each of them (to acknowledge or negatively acknowledge, correspondingly).

    +
  4. +
+
+
+ + + + + +
+ + +All ack(), nack(), and modifyAckDeadline() methods on messages, as well as PubSubSubscriberTemplate, are implemented asynchronously, returning a CompletableFuture<Void> to enable asynchronous processing. +
+
+
+
+
Dead Letter Topics
+
+

Your application may occasionally receive a message it cannot process. +If you create your Subscription passing the Subscription.Builder argument, you can specify a DeadLetterPolicy that will forward all nack()-ed and non-ack()-ed messages after a configurable amount of redelivery attempts. +See here for more information.

+
+
+
+
public Subscription newSubscription() {
+    // Must use the fully-qualified topic name.
+    String fullDeadLetterTopic = PubSubTopicUtils
+                        .toTopicName(DEAD_LETTER_TOPIC, gcpProjectIdProvider.getProjectId())
+                        .toString();
+    return pubSubAdmin.createSubscription(Subscription.newBuilder()
+            .setName(SUBSCRIPTION_NAME)
+            .setTopic(TOPIC_NAME)
+            .setDeadLetterPolicy(DeadLetterPolicy.newBuilder()
+                    .setDeadLetterTopic(fullDeadLetterTopic)
+                    .setMaxDeliveryAttempts(6)
+                    .build()));
+}
+
+
+
+
+

Dead letter topics are no different from any other topic, though some additional permissions are necessary to ensure the Cloud Pub/Sub service can successfully ack the original message and re-publish on the dead letter topic.

+
+
+
+
Expiration Policy
+
+

By default, subscriptions expire after 31 days without any subscriber activity or subscription property changes. +A null or unset ExpirationPolicy will use the default.

+
+
+

To create a subscription that never expires, provide an ExpirationPolicy without setting the TTL.

+
+
+

See +Expiration Period for more information.

+
+
+
+
public Subscription newSubscription() {
+    return pubSubAdmin.createSubscription(Subscription.newBuilder()
+        .setName(SUBSCRIPTION_NAME)
+        .setTopic(TOPIC_NAME)
+        .setExpirationPolicy(ExpirationPolicy.newBuilder().build())); // Never expire
+}
+
+
+
+
+
+
+

6.3.4. JSON support

+
+

For serialization and deserialization of POJOs using Jackson JSON, configure a PubSubMessageConverter bean, and the Spring Boot starter for Spring Framework on Google Cloud Pub/Sub will automatically wire it into the PubSubTemplate.

+
+
+
+
// Note: The ObjectMapper is used to convert Java POJOs to and from JSON.
+// You will have to configure your own instance if you are unable to depend
+// on the ObjectMapper provided by Spring Boot starters.
+@Bean
+public PubSubMessageConverter pubSubMessageConverter() {
+  return new JacksonPubSubMessageConverter(new ObjectMapper());
+}
+
+
+
+
+ + + + + +
+ + +Alternatively, you can set it directly by calling the setMessageConverter() method on the PubSubTemplate. +Other implementations of the PubSubMessageConverter can also be configured in the same manner. +
+
+
+

Assuming you have the following class defined:

+
+
+
+
static class TestUser {
+
+  String username;
+
+  String password;
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  void setUsername(String username) {
+    this.username = username;
+  }
+
+  public String getPassword() {
+    return this.password;
+  }
+
+  void setPassword(String password) {
+    this.password = password;
+  }
+}
+
+
+
+
+

You can serialize objects to JSON on publish automatically:

+
+
+
+
TestUser user = new TestUser();
+user.setUsername("John");
+user.setPassword("password");
+pubSubTemplate.publish(topicName, user);
+
+
+
+
+

And that’s how you convert messages to object on pull:

+
+
+
+
int maxMessages = 1;
+boolean returnImmediately = false;
+List<ConvertedAcknowledgeablePubsubMessage<TestUser>> messages =
+    pubSubTemplate.pullAndConvert(
+        subscriptionName, maxMessages, returnImmediately, TestUser.class);
+
+ConvertedAcknowledgeablePubsubMessage<TestUser> message = messages.get(0);
+
+// acknowledge the message
+message.ack();
+
+TestUser receivedTestUser = message.getPayload();
+
+
+
+
+

Please refer to our Pub/Sub JSON Payload Sample App as a reference for using this functionality.

+
+
+
+
+

6.4. Reactive Stream Subscriber

+
+

It is also possible to acquire a reactive stream backed by a subscription. +To do so, a Project Reactor dependency (io.projectreactor:reactor-core) must be added to the project. +The combination of the Pub/Sub starter and the Project Reactor dependencies will then make a PubSubReactiveFactory bean available, which can then be used to get a Publisher.

+
+
+
+
@Autowired
+PubSubReactiveFactory reactiveFactory;
+
+// ...
+
+Flux<AcknowledgeablePubsubMessage> flux
+                = reactiveFactory.poll("exampleSubscription", 1000);
+
+
+
+
+

The Flux then represents an infinite stream of Spring Framework on Google Cloud Pub/Sub messages coming in through the specified subscription. +For unlimited demand, the Pub/Sub subscription will be polled regularly, at intervals determined by pollingPeriodMs parameter passed in when creating the Flux. +For bounded demand, the pollingPeriodMs parameter is unused. +Instead, as many messages as possible (up to the requested number) are delivered immediately, with the remaining messages delivered as they become available.

+
+
+

Any exceptions thrown by the underlying message retrieval logic will be passed as an error to the stream. +The error handling operators (Flux#retry(), Flux#onErrorResume() etc.) can be used to recover.

+
+
+

The full range of Project Reactor operations can be applied to the stream. +For example, if you only want to fetch 5 messages, you can use limitRequest operation to turn the infinite stream into a finite one:

+
+
+
+
Flux<AcknowledgeablePubsubMessage> fiveMessageFlux = flux.limitRequest(5);
+
+
+
+
+

Messages flowing through the Flux should be manually acknowledged.

+
+
+
+
flux.doOnNext(AcknowledgeablePubsubMessage::ack);
+
+
+
+
+
+

6.5. Pub/Sub management

+
+

PubSubAdmin is the abstraction provided by Spring Framework on Google Cloud to manage Google Cloud Pub/Sub resources. +It allows for the creation, deletion and listing of topics and subscriptions.

+
+
+ + + + + +
+ + +Generally when referring to topics and subscriptions, you can either use the short canonical name within the current project, or the fully-qualified name referring to a topic or subscription in a different project using the projects/[project_name]/(topics|subscriptions)/<name> format. +
+
+
+

The Spring Boot starter for GCP Pub/Sub autoconfigures a PubSubAdmin object using the GcpProjectIdProvider and the CredentialsProvider autoconfigured by the Spring Boot GCP Core starter.

+
+
+

6.5.1. Creating a topic

+
+

PubSubAdmin implements a method to create topics:

+
+
+
+
public Topic createTopic(String topicName)
+
+
+
+
+

Here is an example of how to create a Google Cloud Pub/Sub topic:

+
+
+
+
public void newTopic() {
+    pubSubAdmin.createTopic("topicName");
+}
+
+
+
+
+
+

6.5.2. Deleting a topic

+
+

PubSubAdmin implements a method to delete topics:

+
+
+
+
public void deleteTopic(String topicName)
+
+
+
+
+

Here is an example of how to delete a Google Cloud Pub/Sub topic:

+
+
+
+
public void deleteTopic() {
+    pubSubAdmin.deleteTopic("topicName");
+}
+
+
+
+
+
+

6.5.3. Listing topics

+
+

PubSubAdmin implements a method to list topics:

+
+
+
+
public List<Topic> listTopics
+
+
+
+
+

Here is an example of how to list every Google Cloud Pub/Sub topic name in a project:

+
+
+
+
List<String> topics =
+    pubSubAdmin.listTopics().stream().map(Topic::getName).toList();
+
+
+
+
+
+

6.5.4. Creating a subscription

+
+

PubSubAdmin implements several methods to create subscriptions to existing topics:

+
+
+
+
public Subscription createSubscription(String subscriptionName, String topicName)
+
+public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline)
+
+public Subscription createSubscription(
+      String subscriptionName, String topicName, String pushEndpoint)
+
+public Subscription createSubscription(String subscriptionName, String topicName, Integer ackDeadline, String pushEndpoint)
+
+public Subscription createSubscription(Subscriber.Builder builder)
+
+
+
+
+

The default value for ackDeadline is 10 seconds. +If pushEndpoint isn’t specified, the subscription uses message pulling, instead. +You can also pass a Subscription.Builder for full control over any options or features available in the client library.

+
+
+

Here is an example of how to create a Google Cloud Pub/Sub subscription:

+
+
+
+
public Subscription newSubscription() {
+    return pubSubAdmin.createSubscription("subscriptionName", "topicName", 15);
+}
+
+
+
+
+
+

6.5.5. Deleting a subscription

+
+

PubSubAdmin implements a method to delete subscriptions:

+
+
+
+
public void deleteSubscription(String subscriptionName)
+
+
+
+
+

Here is an example of how to delete a Google Cloud Pub/Sub subscription:

+
+
+
+
public void deleteSubscription() {
+    pubSubAdmin.deleteSubscription("subscriptionName");
+}
+
+
+
+
+
+

6.5.6. Listing subscriptions

+
+

PubSubAdmin implements a method to list subscriptions:

+
+
+
+
public List<Subscription> listSubscriptions()
+
+
+
+
+

Here is an example of how to list every subscription name in a project:

+
+
+
+
List<String> subscriptions =
+    pubSubAdmin.listSubscriptions().stream()
+        .map(Subscription::getName)
+        .toList();
+
+
+
+
+
+
+

6.6. Sample

+
+

Sample applications for using the template and using a subscription-backed reactive stream are available.

+
+
+
+

6.7. Test

+
+

Testcontainers provides a gcloud module which offers PubSubEmulatorContainer. See more at the docs

+
+
+
+
+
+

7. Spring Integration

+
+
+

Spring Framework on Google Cloud provides Spring Integration adapters that allow your applications to use Enterprise Integration Patterns backed up by Google Cloud services.

+
+
+

7.1. Channel Adapters for Cloud Pub/Sub

+
+

The channel adapters for Google Cloud Pub/Sub connect your Spring MessageChannels to Google Cloud Pub/Sub topics and subscriptions. +This enables messaging between different processes, applications or microservices backed up by Google Cloud Pub/Sub.

+
+
+

The Spring Integration Channel Adapters for Google Cloud Pub/Sub are included in the spring-cloud-gcp-pubsub module and can be autoconfigured by using the spring-cloud-gcp-starter-pubsub module in combination with a Spring Integration dependency.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependencies>
+  <dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
+  </dependency>
+  <dependency>
+    <groupId>org.springframework.integration</groupId>
+    <artifactId>spring-integration-core</artifactId>
+  </dependency>
+</dependencies>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-pubsub")
+    implementation("org.springframework.integration:spring-integration-core")
+}
+
+
+
+

7.1.1. Inbound channel adapter (using Pub/Sub Streaming Pull)

+
+

PubSubInboundChannelAdapter is the inbound channel adapter for Spring Framework on Google Cloud Pub/Sub that listens to a Spring Framework on Google Cloud Pub/Sub subscription for new messages. +It converts new messages to an internal Spring Message and then sends it to the bound output channel.

+
+
+

Google Pub/Sub treats message payloads as byte arrays. +So, by default, the inbound channel adapter will construct the Spring Message with byte[] as the payload. +However, you can change the desired payload type by setting the payloadType property of the PubSubInboundChannelAdapter. +The PubSubInboundChannelAdapter delegates the conversion to the desired payload type to the PubSubMessageConverter configured in the PubSubTemplate.

+
+
+

To use the inbound channel adapter, a PubSubInboundChannelAdapter must be provided and configured on the user application side.

+
+
+ + + + + +
+ + +The subscription name could either be a short subscription name within the current project, or the fully-qualified name referring to a subscription in a different project using the projects/[project_name]/subscriptions/[subscription_name] format. +
+
+
+
+
@Bean
+public MessageChannel pubsubInputChannel() {
+    return new PublishSubscribeChannel();
+}
+
+@Bean
+public PubSubInboundChannelAdapter messageChannelAdapter(
+    @Qualifier("pubsubInputChannel") MessageChannel inputChannel,
+    PubSubTemplate pubsubTemplate) {
+    PubSubInboundChannelAdapter adapter =
+        new PubSubInboundChannelAdapter(pubsubTemplate, "subscriptionName");
+    adapter.setOutputChannel(inputChannel);
+    adapter.setAckMode(AckMode.MANUAL);
+
+    return adapter;
+}
+
+
+
+
+

In the example, we first specify the MessageChannel where the adapter is going to write incoming messages to. +The MessageChannel implementation isn’t important here. +Depending on your use case, you might want to use a MessageChannel other than PublishSubscribeChannel.

+
+
+

Then, we declare a PubSubInboundChannelAdapter bean. +It requires the channel we just created and a SubscriberFactory, which creates Subscriber objects from the Google Cloud Java Client for Pub/Sub. +The Spring Boot starter for Spring Framework on Google Cloud Pub/Sub provides a configured PubSubSubscriberOperations object.

+
+
+

If you want to take advantage of the Cloud Pub/Sub subscription health indicator called pubsub-subscriber, you also need to call adapter.setHealthTrackerRegistry() with the auto-configured HealthTrackerRegistry bean. Refer to Cloud Pub/Sub Subscription Health Indicator for how to enable Spring Boot Actuator.

+
+
+
Acknowledging messages and handling failures
+
+

When working with Cloud Pub/Sub, it is important to understand the concept of ackDeadline — the amount of time Cloud Pub/Sub will wait until attempting redelivery of an outstanding message. +Each subscription has a default ackDeadline applied to all messages sent to it. +Additionally, the Cloud Pub/Sub client library can extend each streamed message’s ackDeadline until the message processing completes, fails or until the maximum extension period elapses.

+
+
+ + + + + +
+ + +In the Pub/Sub client library, default maximum extension period is an hour. However, Spring Framework on Google Cloud disables this auto-extension behavior. +Use the spring.cloud.gcp.pubsub.subscriber.max-ack-extension-period property to re-enable it. +
+
+
+

Acknowledging (acking) a message removes it from Pub/Sub’s known outstanding messages. Nacking a message resets its acknowledgement deadline to 0, forcing immediate redelivery. +This could be useful in a load balanced architecture, where one of the subscribers is having issues but others are available to process messages.

+
+
+

The PubSubInboundChannelAdapter supports three acknowledgement modes: the default AckMode.AUTO (automatic acking on processing success and nacking on exception), as well as two modes for additional manual control: AckMode.AUTO_ACK (automatic acking on success but no action on exception) and AckMode.MANUAL (no automatic actions at all; both acking and nacking have to be done manually).

+
+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Acknowledgement mode behavior
AUTOAUTO_ACKMANUAL

Message processing completes successfully

ack, no redelivery

ack, no redelivery

<no action>*

Message processing fails, but error handler completes successfully**

ack, no redelivery

ack, no redelivery

<no action>*

Message processing fails; no error handler present

nack, immediate redelivery

<no action>*

<no action>*

Message processing fails, and error handler throws an exception

nack, immediate redelivery

<no action>*

<no action>*

+
+

* <no action> means that the message will be neither acked nor nacked. +Cloud Pub/Sub will attempt redelivery according to subscription ackDeadline setting and the max-ack-extension-period client library setting.

+
+
+

** For the adapter, "success" means the Spring Integration flow processed without raising an exception, so successful message processing and the successful completion of an error handler both result in the same behavior (message will be acknowledged). +To trigger default error behavior (nacking in AUTO mode; neither acking nor nacking in AUTO_ACK mode), propagate the error back to the adapter by throwing an exception from the Error Handling flow.

+
+
+
Manual acking/nacking
+
+

The adapter attaches a BasicAcknowledgeablePubsubMessage object to the Message headers. +Users can extract the BasicAcknowledgeablePubsubMessage using the GcpPubSubHeaders.ORIGINAL_MESSAGE key and use it to ack (or nack) a message.

+
+
+
+
@Bean
+@ServiceActivator(inputChannel = "pubsubInputChannel")
+public MessageHandler messageReceiver() {
+    return message -> {
+        LOGGER.info("Message arrived! Payload: " + new String((byte[]) message.getPayload()));
+        BasicAcknowledgeablePubsubMessage originalMessage =
+              message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE, BasicAcknowledgeablePubsubMessage.class);
+        originalMessage.ack();
+    };
+}
+
+
+
+
+
+
Error Handling
+
+

If you want to have more control over message processing in case of an error, you need to associate the PubSubInboundChannelAdapter with a Spring Integration error channel and specify the behavior to be invoked with @ServiceActivator.

+
+
+ + + + + +
+ + +In order to activate the default behavior (nacking in AUTO mode; neither acking nor nacking in AUTO_ACK mode), your error handler has to throw an exception. +Otherwise, the adapter will assume that processing completed successfully and will ack the message. +
+
+
+
+
@Bean
+public MessageChannel pubsubInputChannel() {
+    return new PublishSubscribeChannel();
+}
+
+@Bean
+public PubSubInboundChannelAdapter messageChannelAdapter(
+    @Qualifier("pubsubInputChannel") MessageChannel inputChannel,
+    PubSubTemplate pubsubTemplate) {
+    PubSubInboundChannelAdapter adapter =
+        new PubSubInboundChannelAdapter(pubsubTemplate, "subscriptionName");
+    adapter.setOutputChannel(inputChannel);
+    adapter.setAckMode(AckMode.AUTO_ACK);
+    adapter.setErrorChannelName("pubsubErrors");
+
+    return adapter;
+}
+
+@ServiceActivator(inputChannel =  "pubsubErrors")
+public void pubsubErrorHandler(Message<MessagingException> message) {
+    LOGGER.warn("This message will be automatically acked because error handler completes successfully");
+}
+
+
+
+
+

If you preferred to manually ack or nack the message, you can do it by retrieving the header of the exception payload:

+
+
+
+
@ServiceActivator(inputChannel =  "pubsubErrors")
+public void pubsubErrorHandler(Message<MessagingException> exceptionMessage) {
+
+    BasicAcknowledgeablePubsubMessage originalMessage =
+      (BasicAcknowledgeablePubsubMessage)exceptionMessage.getPayload().getFailedMessage()
+        .getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE);
+
+    originalMessage.nack();
+}
+
+
+
+
+
+
+
+

7.1.2. Pollable Message Source (using Pub/Sub Synchronous Pull)

+
+

While PubSubInboundChannelAdapter, through the underlying Asynchronous Pull Pub/Sub mechanism, provides the best performance for high-volume applications that receive a steady flow of messages, it can create load balancing anomalies due to message caching. +This behavior is most obvious when publishing a large batch of small messages that take a long time to process individually. +It manifests as one subscriber taking up most messages, even if multiple subscribers are available to take on the work. +For a more detailed explanation of this scenario, see Spring Framework on Google Cloud Pub/Sub documentation.

+
+
+

In such a scenario, a PubSubMessageSource can help spread the load between different subscribers more evenly.

+
+
+

As with the Inbound Channel Adapter, the message source has a configurable acknowledgement mode, payload type, and header mapping.

+
+
+

The default behavior is to return from the synchronous pull operation immediately if no messages are present. +This can be overridden by using setBlockOnPull() method to wait for at least one message to arrive.

+
+
+

By default, PubSubMessageSource pulls from the subscription one message at a time. +To pull a batch of messages on each request, use the setMaxFetchSize() method to set the batch size.

+
+
+ + + + + +
+ + +The subscription name could either be a short subscription name within the current project, or the fully-qualified name referring to a subscription in a different project using the projects/[project_name]/subscriptions/[subscription_name] format. +
+
+
+
+
@Bean
+@InboundChannelAdapter(channel = "pubsubInputChannel", poller = @Poller(fixedDelay = "100"))
+public MessageSource<Object> pubsubAdapter(PubSubTemplate pubSubTemplate) {
+    PubSubMessageSource messageSource = new PubSubMessageSource(pubSubTemplate,  "exampleSubscription");
+    messageSource.setAckMode(AckMode.MANUAL);
+    messageSource.setPayloadType(String.class);
+    messageSource.setBlockOnPull(true);
+    messageSource.setMaxFetchSize(100);
+    return messageSource;
+}
+
+
+
+
+

The @InboundChannelAdapter annotation above ensures that the configured MessageSource is polled for messages, which are then available for manipulation with any Spring Integration mechanism on the pubsubInputChannel message channel. +For example, messages can be retrieved in a method annotated with @ServiceActivator, as seen below.

+
+
+

For additional flexibility, PubSubMessageSource attaches an AcknowledgeablePubSubMessage object to the GcpPubSubHeaders.ORIGINAL_MESSAGE message header. +The object can be used for manually (n)acking the message.

+
+
+
+
@ServiceActivator(inputChannel = "pubsubInputChannel")
+public void messageReceiver(String payload,
+        @Header(GcpPubSubHeaders.ORIGINAL_MESSAGE) AcknowledgeablePubsubMessage message)
+            throws InterruptedException {
+    LOGGER.info("Message arrived by Synchronous Pull! Payload: " + payload);
+    message.ack();
+}
+
+
+
+
+ + + + + +
+ + +AcknowledgeablePubSubMessage objects acquired by synchronous pull are aware of their own acknowledgement IDs. +Streaming pull does not expose this information due to limitations of the underlying API, and returns BasicAcknowledgeablePubsubMessage objects that allow acking/nacking individual messages, but not extracting acknowledgement IDs for future processing. +
+
+
+
+

7.1.3. Outbound channel adapter

+
+

PubSubMessageHandler is the outbound channel adapter for Spring Framework on Google Cloud Pub/Sub that listens for new messages on a Spring MessageChannel. +It uses PubSubTemplate to post them to a Spring Framework on Google Cloud Pub/Sub topic.

+
+
+

To construct a Pub/Sub representation of the message, the outbound channel adapter needs to convert the Spring Message payload to a byte array representation expected by Pub/Sub. +It delegates this conversion to the PubSubTemplate. +To customize the conversion, you can specify a PubSubMessageConverter in the PubSubTemplate that should convert the Object payload and headers of the Spring Message to a PubsubMessage.

+
+
+

To use the outbound channel adapter, a PubSubMessageHandler bean must be provided and configured on the user application side.

+
+
+ + + + + +
+ + +The topic name could either be a short topic name within the current project, or the fully-qualified name referring to a topic in a different project using the projects/[project_name]/topics/[topic_name] format. +
+
+
+
+
@Bean
+@ServiceActivator(inputChannel = "pubsubOutputChannel")
+public MessageHandler messageSender(PubSubTemplate pubsubTemplate) {
+    return new PubSubMessageHandler(pubsubTemplate, "topicName");
+}
+
+
+
+
+

The provided PubSubTemplate contains all the necessary configuration to publish messages to a Spring Framework on Google Cloud Pub/Sub topic.

+
+
+

PubSubMessageHandler publishes messages asynchronously by default. +A publish timeout can be configured for synchronous publishing. +If none is provided, the adapter waits indefinitely for a response.

+
+
+

It is possible to set user-defined callbacks for the publish() call in PubSubMessageHandler through the setSuccessCallback() and setFailureCallback() methods (either one or both may be set). +These give access to the Pub/Sub publish message ID in case of success, or the root cause exception in case of error. +Both callbacks include the original message as the second argument.

+
+
+
+
adapter.setSuccessCallback((ackId, message) -> {});
+adapter.setFailureCallback((cause, message) -> {});
+
+
+
+
+

To override the default topic you can use the GcpPubSubHeaders.TOPIC header.

+
+
+
+
@Autowired
+private MessageChannel pubsubOutputChannel;
+
+public void handleMessage(Message<?> msg) throws MessagingException {
+    final Message<?> message = MessageBuilder
+        .withPayload(msg.getPayload())
+        .setHeader(GcpPubSubHeaders.TOPIC, "customTopic").build();
+    pubsubOutputChannel.send(message);
+}
+
+
+
+
+

It is also possible to set an SpEL expression for the topic with the setTopicExpression() or setTopicExpressionString() methods.

+
+
+
+
PubSubMessageHandler adapter = new PubSubMessageHandler(pubSubTemplate, "myDefaultTopic");
+adapter.setTopicExpressionString("headers['sendToTopic']");
+
+
+
+
+
+

7.1.4. Header mapping

+
+

These channel adapters contain header mappers that allow you to map, or filter out, headers from Spring to Google Cloud Pub/Sub messages, and vice-versa. +By default, the inbound channel adapter maps every header on the Google Cloud Pub/Sub messages to the Spring messages produced by the adapter. +The outbound channel adapter maps every header from Spring messages into Google Cloud Pub/Sub ones, except the ones added by Spring and some special headers, like headers with key "id", "timestamp", "gcp_pubsub_acknowledgement", and "gcp_pubsub_ordering_key". +In the process, the outbound mapper also converts the value of the headers into string.

+
+
+

Note that you can provide the GcpPubSubHeaders.ORDERING_KEY ("gcp_pubsub_ordering_key") header, which will be automatically mapped to PubsubMessage.orderingKey property, and excluded from the headers in the published message. +Remember to set spring.cloud.gcp.pubsub.publisher.enable-message-ordering to true, if you are publishing messages with this header.

+
+
+

Each adapter declares a setHeaderMapper() method to let you further customize which headers you want to map from Spring to Google Cloud Pub/Sub, and vice-versa.

+
+
+

For example, to filter out headers "foo", "bar" and all headers starting with the prefix "prefix_", you can use setHeaderMapper() along with the PubSubHeaderMapper implementation provided by this module.

+
+
+
+
PubSubMessageHandler adapter = ...
+...
+PubSubHeaderMapper headerMapper = new PubSubHeaderMapper();
+headerMapper.setOutboundHeaderPatterns("!foo", "!bar", "!prefix_*", "*");
+adapter.setHeaderMapper(headerMapper);
+
+
+
+
+ + + + + +
+ + +The order in which the patterns are declared in PubSubHeaderMapper.setOutboundHeaderPatterns() and PubSubHeaderMapper.setInboundHeaderPatterns() matters. +The first patterns have precedence over the following ones. +
+
+
+

In the previous example, the "*" pattern means every header is mapped. +However, because it comes last in the list, the previous patterns take precedence.

+
+
+ +
+
+

7.2. Channel Adapters for Google Cloud Storage

+
+

The channel adapters for Google Cloud Storage allow you to read and write files to Google Cloud Storage through MessageChannels.

+
+
+

Spring Framework on Google Cloud provides two inbound adapters, GcsInboundFileSynchronizingMessageSource and GcsStreamingMessageSource, and one outbound adapter, GcsMessageHandler.

+
+
+

The Spring Integration Channel Adapters for Google Cloud Storage are included in the spring-cloud-gcp-storage module.

+
+
+

To use the Storage portion of Spring Integration for Spring Framework on Google Cloud, you must also provide the spring-integration-file dependency, since it isn’t pulled transitively.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-storage</artifactId>
+</dependency>
+<dependency>
+    <groupId>org.springframework.integration</groupId>
+    <artifactId>spring-integration-file</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-storage")
+    implementation("org.springframework.integration:spring-integration-file")
+}
+
+
+
+

7.2.1. Inbound channel adapter

+
+

The Google Cloud Storage inbound channel adapter polls a Google Cloud Storage bucket for new files and sends each of them in a Message payload to the MessageChannel specified in the @InboundChannelAdapter annotation. +The files are temporarily stored in a folder in the local file system.

+
+
+

Here is an example of how to configure a Google Cloud Storage inbound channel adapter.

+
+
+
+
@Bean
+@InboundChannelAdapter(channel = "new-file-channel", poller = @Poller(fixedDelay = "5000"))
+public MessageSource<File> synchronizerAdapter(Storage gcs) {
+  GcsInboundFileSynchronizer synchronizer = new GcsInboundFileSynchronizer(gcs);
+  synchronizer.setRemoteDirectory("your-gcs-bucket");
+
+  GcsInboundFileSynchronizingMessageSource synchAdapter =
+          new GcsInboundFileSynchronizingMessageSource(synchronizer);
+  synchAdapter.setLocalDirectory(new File("local-directory"));
+
+  return synchAdapter;
+}
+
+
+
+
+
+

7.2.2. Inbound streaming channel adapter

+
+

The inbound streaming channel adapter is similar to the normal inbound channel adapter, except it does not require files to be stored in the file system.

+
+
+

Here is an example of how to configure a Google Cloud Storage inbound streaming channel adapter.

+
+
+
+
@Bean
+@InboundChannelAdapter(channel = "streaming-channel", poller = @Poller(fixedDelay = "5000"))
+public MessageSource<InputStream> streamingAdapter(Storage gcs) {
+  GcsStreamingMessageSource adapter =
+          new GcsStreamingMessageSource(new GcsRemoteFileTemplate(new GcsSessionFactory(gcs)));
+  adapter.setRemoteDirectory("your-gcs-bucket");
+  return adapter;
+}
+
+
+
+
+

If you would like to process the files in your bucket in a specific order, you may pass in a Comparator<BlobInfo> to the constructor GcsStreamingMessageSource to sort the files being processed.

+
+
+
+

7.2.3. Outbound channel adapter

+
+

The outbound channel adapter allows files to be written to Google Cloud Storage. +When it receives a Message containing a payload of type File, it writes that file to the Google Cloud Storage bucket specified in the adapter.

+
+
+

Here is an example of how to configure a Google Cloud Storage outbound channel adapter.

+
+
+
+
@Bean
+@ServiceActivator(inputChannel = "writeFiles")
+public MessageHandler outboundChannelAdapter(Storage gcs) {
+  GcsMessageHandler outboundChannelAdapter = new GcsMessageHandler(new GcsSessionFactory(gcs));
+  outboundChannelAdapter.setRemoteDirectoryExpression(new ValueExpression<>("your-gcs-bucket"));
+
+  return outboundChannelAdapter;
+}
+
+
+
+
+ +
+
+
+
+

8. Spring Cloud Stream

+
+
+

Spring Framework on Google Cloud provides a Spring Cloud Stream binder to Google Cloud Pub/Sub.

+
+ +
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-pubsub-stream-binder")
+}
+
+
+
+

8.1. Overview

+
+

This binder binds producers to Google Cloud Pub/Sub topics and consumers to subscriptions.

+
+
+ + + + + +
+ + +Partitioning is currently not supported by this binder. +
+
+
+
+

8.2. Configuration

+
+

You can configure the Spring Cloud Stream Binder for Google Cloud Pub/Sub to automatically generate the underlying resources, like the Google Cloud Pub/Sub topics and subscriptions for producers and consumers. +For that, you can use the spring.cloud.stream.gcp.pubsub.bindings.<consumer/produer name>.<consumer|producer>.auto-create-resources property, which is turned ON by default.

+
+
+ + + + + +
+ + +For more info about consumer/producer naming convention, please refer to Functional binding names. +
+
+
+

Starting with version 1.1, these and other binder properties can be configured globally for all the bindings, e.g. spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources.

+
+
+

If you are using Pub/Sub autoconfiguration from the Spring Framework on Google Cloud Pub/Sub Starter, you should refer to the configuration section for other Pub/Sub parameters.

+
+
+ + + + + +
+ + +To use this binder with a running emulator, configure its host and port via spring.cloud.gcp.pubsub.emulator-host. +
+
+
+

8.2.1. Producer/Consumer Shared Configuration

+
+

These properties can be applied to both producers and consumers.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME/PRODUCER_NAME}.[consumer/producer].allowedHeaders

Filters incoming and outgoing messages to contain only the provided comma-delimited headers

No

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME/PRODUCER_NAME}.[consumer/producer].auto-create-resources

When enabled, topic/subscription will be created if they do not exist

No

true

+
+
Header Mapping
+
+

You can filter incoming and outgoing message headers with allowHeaders property. +For example, for a consumer to allow only two headers, provide a comma separated list like this:

+
+
+
application.properties
+
+
spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.allowedHeaders=allowed1,allowed2
+
+
+
+

Where CONSUMER_NAME should be replaced by the method which is consuming/reading messages from Cloud Pub/Sub and allowed1,allowed2 is the comma separated list of headers that the user wants to keep.

+
+
+

A similar style is applicable for producers as well. For example:

+
+
+
application.properties
+
+
spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.allowedHeaders=allowed3,allowed4
+
+
+
+

Where PRODUCER_NAME should be replaced by the method which is producing/sending messages to Cloud Pub/Sub and allowed3,allowed4 is the comma separated list of headers that user wants to map. All other headers will be removed before the message is sent to Cloud Pub/Sub.

+
+
+
+
+

8.2.2. Producer-specific Configuration

+ ++++++ + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.sync

Enables synchronous sending

No

false

+
+
Producer Synchronous Sending Configuration
+
+

By default, this binder will send messages to Cloud Pub/Sub asynchronously. +If synchronous sending is preferred (for example, to allow propagating errors back to the sender), set spring.cloud.stream.gcp.pubsub.default.producer.sync property to true.

+
+
+
+
Producer Destination Configuration
+
+

If automatic resource creation is turned ON and the topic corresponding to the destination name does not exist, it will be created.

+
+
+

For example, for the following configuration, a topic called myEvents would be created.

+
+
+
application.properties
+
+
spring.cloud.stream.bindings.{PRODUCER_NAME}.destination=myEvents
+spring.cloud.stream.gcp.pubsub.bindings.{PRODUCER_NAME}.producer.auto-create-resources=true
+
+
+
+
+
+

8.2.3. Consumer-specific Configuration

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.ack-mode

Controls how messages will be acknowledged when they are successfully received. Options: AUTO, AUTO_ACK, and MANUAL

No

AUTO

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.dead-letter-policy.dead-letter-topic

Duration of no activity after which a subscription will expire. Use 0d to never expire.

No

31d

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.dead-letter-policy.max-delivery-attempts

Duration of no activity after which a subscription will expire. Use 0d to never expire.

No

31d

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.expiration-policy.ttl

Duration of no activity after which a subscription will expire. Use 0d to never expire.

No

31d

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.max-fetch-size

Limits the number of messages received per poll

No

spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscription-name

When provided, uses the given subscription name

No

+
+
Consumer Destination Configuration
+
+

A PubSubInboundChannelAdapter will be configured for your consumer endpoint. +You may adjust the ack mode of the consumer endpoint using the ack-mode property. +The ack mode controls how messages will be acknowledged when they are successfully received. +The three possible options are: AUTO (default), AUTO_ACK, and MANUAL. +These options are described in detail in the Pub/Sub channel adapter documentation.

+
+
+
application.properties
+
+
# How to set the ACK mode of the consumer endpoint.
+spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.ack-mode=AUTO_ACK
+
+
+
+

With automatic resource creation turned ON for a consumer, the library creates a topic and/or a subscription if they do not exist. +The topic name becomes the same as the destination name, and the subscription name follows these rules (in order of precedence):

+
+
+
    +
  • +

    A user-defined, pre-existing subscription (use spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.subscriptionName)

    +
  • +
  • +

    A consumer group using the topic name (use spring.cloud.stream.bindings.events.group to create a subscription named <topicName>.<group>)

    +
  • +
  • +

    If neither of the above are specified, the library creates an anonymous subscription with the name anonymous.<destinationName>.<randomUUID>. +Then when the binder shuts down, the library automatically cleans up all Pub/Sub subscriptions created for anonymous consumer groups.

    +
  • +
+
+
+

For example, with this configuration:

+
+
+
application.properties
+
+
spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents
+spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=false
+
+
+
+

Only an anonymous subscription named anonymous.myEvents.a6d83782-c5a3-4861-ac38-e6e2af15a7be is created and later cleaned up.

+
+
+

In another example, with the following configuration:

+
+
+
application.properties
+
+
spring.cloud.stream.bindings.{CONSUMER_NAME}.destination=myEvents
+spring.cloud.stream.gcp.pubsub.bindings.{CONSUMER_NAME}.consumer.auto-create-resources=true
+
+# specify consumer group, and avoid anonymous consumer group generation
+spring.cloud.stream.bindings.{CONSUMER_NAME}.group=consumerGroup1
+
+
+
+

These resources will be created:

+
+
+
    +
  • +

    A topic named myEvents

    +
  • +
  • +

    A subscription named myEvents.consumerGroup1

    +
  • +
+
+
+
+
+

8.2.4. Endpoint Customization

+
+

You may customize channel routing by defining a ConsumerEndpointCustomizer in your autoconfiguration. This is useful if you want to customize the default configurations provided by the Pub/Sub Spring Cloud Stream Binder.

+
+
+

The example below demonstrates how to use a ConsumerEndpointCustomizer to override the default error channel configured by the binder.

+
+
+
+
@Bean
+public ConsumerEndpointCustomizer<PubSubInboundChannelAdapter> messageChannelAdapter() {
+    return (endpoint, destinationName, group) -> {
+        NamedComponent namedComponent = (NamedComponent) endpoint.getOutputChannel();
+        String channelName = namedComponent.getBeanName();
+        endpoint.setErrorChannelName(channelName + ".errors");
+    };
+}
+
+
+
+
+
+
+

8.3. Binding with Functions

+
+

Since version 3.0, Spring Cloud Stream supports a functional programming model natively. +This means that the only requirement for turning your application into a sink is presence of a java.util.function.Consumer bean in the application context.

+
+
+
+
@Bean
+public Consumer<UserMessage> logUserMessage() {
+  return userMessage -> {
+    // process message
+  }
+};
+
+
+
+

A source application is one where a Supplier bean is present. +It can return an object, in which case Spring Cloud Stream will invoke the supplier repeatedly. +Alternatively, the function can return a reactive stream, which will be used as is.

+
+
+
+
@Bean
+Supplier<Flux<UserMessage>> generateUserMessages() {
+  return () -> /* flux creation logic */;
+}
+
+
+
+

A processor application works similarly to a source application, except it is triggered by presence of a Function bean.

+
+
+
+

8.4. Sample

+
+

Sample applications are available:

+
+ +
+
+
+
+

9. Spring Cloud Bus

+
+
+

Using Cloud Pub/Sub as the Spring Cloud Bus implementation is as simple as importing the spring-cloud-gcp-starter-bus-pubsub starter.

+
+
+

This starter brings in the Spring Cloud Stream binder for Cloud Pub/Sub, which is used to both publish and subscribe to the bus. +If the bus topic (named springCloudBus by default) does not exist, the binder automatically creates it. +The binder also creates anonymous subscriptions for each project using the spring-cloud-gcp-starter-bus-pubsub starter.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-bus-pubsub</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-bus-pubsub")
+}
+
+
+
+
+

9.1. Configuration Management with Spring Cloud Config and Spring Cloud Bus

+
+

Spring Cloud Bus can be used to push configuration changes from a Spring Cloud Config server to the clients listening on the same bus.

+
+
+

To use Spring Framework on Google Cloud Pub/Sub as the bus implementation, both the configuration server and the configuration client need the spring-cloud-gcp-starter-bus-pubsub dependency.

+
+
+

All other configuration is standard to Spring Cloud Config.

+
+
+
+spring cloud bus over pubsub +
+
+
+

Spring Cloud Config Server typically runs on port 8888, and can read configuration from a variety of source control systems such as GitHub, and even from the local filesystem. +When the server is notified that new configuration is available, it fetches the updated configuration and sends a notification (RefreshRemoteApplicationEvent) out via Spring Cloud Bus.

+
+
+

When configuration is stored locally, config server polls the parent directory for changes. +With configuration stored in source control repository, such as GitHub, the config server needs to be notified that a new version of configuration is available. +In a deployed server, this would be done automatically through a GitHub webhook, but in a local testing scenario, the /monitor HTTP endpoint needs to be invoked manually.

+
+
+
+
curl -X POST http://localhost:8888/monitor -H "X-Github-Event: push" -H "Content-Type: application/json" -d '{"commits": [{"modified": ["application.properties"]}]}'
+
+
+
+

By adding the spring-cloud-gcp-starter-bus-pubsub dependency, you instruct Spring Cloud Bus to use Cloud Pub/Sub to broadcast configuration changes. +Spring Cloud Bus will then create a topic named springCloudBus, as well as a subscription for each configuration client.

+
+
+

The configuration server happens to also be a configuration client, subscribing to the configuration changes that it sends out. +Thus, in a scenario with one configuration server and one configuration client, two anonymous subscriptions to the springCloudBus topic are created. +However, a config server disables configuration refresh by default (see ConfigServerBootstrapApplicationListener for more details).

+
+
+

A demo application showing configuration management and distribution over a Cloud Pub/Sub-powered bus is available. +The sample contains two examples of configuration management with Spring Cloud Bus: one monitoring a local file system, and the other retrieving configuration from a GitHub repository.

+
+
+
+
+
+

10. Cloud Trace

+
+
+

Google Cloud provides a managed distributed tracing service called Cloud Trace, and Micrometer can be used with it to easily instrument Spring Boot applications for observability.

+
+
+

Typically, Micrometer captures trace information and forwards traces to service like Zipkin for storage and analysis. +However, on Google Cloud, instead of running and maintaining your own Zipkin instance and storage, you can use Cloud Trace to store traces, view trace details, generate latency distributions graphs, and generate performance regression reports.

+
+
+

This Spring Framework on Google Cloud starter can forward Micrometer traces to Cloud Trace without an intermediary Zipkin server.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-trace</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-trace")
+}
+
+
+
+

You must enable Cloud Trace API from the Google Cloud Console in order to capture traces. +Navigate to the Cloud Trace API for your project and make sure it’s enabled.

+
+
+ + + + + +
+ + +
+

If you are already using a Zipkin server capturing trace information from multiple platform/frameworks, you can also use a Stackdriver Zipkin proxy to forward those traces to Cloud Trace without modifying existing applications.

+
+
+
+
+

10.1. Tracing

+
+

Micrometer uses the Brave tracer to generate traces. +This integration enables Brave to use the StackdriverTracePropagation propagation.

+
+
+

A propagation is responsible for extracting trace context from an entity (e.g., an HTTP servlet request) and injecting trace context into an entity. +A canonical example of the propagation usage is a web server that receives an HTTP request, which triggers other HTTP requests from the server before returning an HTTP response to the original caller.

+
+
+

In the case of StackdriverTracePropagation, first it looks for trace context in the X-B3 headers (X-B3-TraceId, X-B3-SpanId). +If those are not found, StackdriverTracePropagation will fall back on x-cloud-trace-context key (e.g., an HTTP request header).

+
+
+

If you need different propagation behavior (e.g. relying primarily on x-cloud-trace-context in a mixed Spring / non-Spring application environment), Micrometer allows such customization through the CUSTOM propagation type.

+
+
+ + + + + +
+ + +
+

The value of the x-cloud-trace-context key can be formatted in three different ways:

+
+
+
    +
  • +

    x-cloud-trace-context: TRACE_ID

    +
  • +
  • +

    x-cloud-trace-context: TRACE_ID/SPAN_ID

    +
  • +
  • +

    x-cloud-trace-context: TRACE_ID/SPAN_ID;o=TRACE_TRUE

    +
  • +
+
+
+

TRACE_ID is a 32-character hexadecimal value that encodes a 128-bit number.

+
+
+

SPAN_ID is an unsigned long. +Since Cloud Trace doesn’t support span joins, a new span ID is always generated, regardless of the one specified in x-cloud-trace-context.

+
+
+

TRACE_TRUE can either be 0 if the entity should be untraced, or 1 if it should be traced. +This field forces the decision of whether to trace the request; if omitted then the decision is deferred to the sampler.

+
+
+
+
+
+

10.2. Spring Boot Starter for Cloud Trace

+
+

Spring Boot Starter for Cloud Trace uses Micrometer and autoconfigures a StackdriverSender that sends the Micrometer’s trace information to Cloud Trace.

+
+
+

All configurations are optional:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.trace.enabled

Autoconfigure Micrometer to send traces to Cloud Trace.

No

true

spring.cloud.gcp.trace.project-id

Overrides the project ID from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.trace.credentials.location

Overrides the credentials location from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.trace.credentials.encoded-key

Overrides the credentials encoded key from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.trace.credentials.scopes

Overrides the credentials scopes from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.trace.num-executor-threads

Number of threads used by the Trace executor

No

4

spring.cloud.gcp.trace.authority

HTTP/2 authority the channel claims to be connecting to.

No

spring.cloud.gcp.trace.compression

Name of the compression to use in Trace calls

No

spring.cloud.gcp.trace.deadline-ms

Call deadline in milliseconds

No

spring.cloud.gcp.trace.max-inbound-size

Maximum size for inbound messages

No

spring.cloud.gcp.trace.max-outbound-size

Maximum size for outbound messages

No

spring.cloud.gcp.trace.wait-for-ready

Waits for the channel to be ready in case of a transient failure

No

false

spring.cloud.gcp.trace.messageTimeout

Timeout in seconds before pending spans will be sent in batches to Google Cloud Trace. (previously spring.zipkin.messageTimeout)

No

1

spring.cloud.gcp.trace.server-response-timeout-ms

Server response timeout in millis.

No

5000

spring.cloud.gcp.trace.pubsub.enabled

(Experimental) Auto-configure Pub/Sub instrumentation for Trace.

No

false

+
+

You can use core Micrometer properties to control Micrometer’s sampling rate, etc. +Read Spring Boot Tracing documentation for more information on Micrometer configurations.

+
+
+

For example, when you are testing to see the traces are going through, you can set the sampling rate to 100%.

+
+
+
+
management.tracing.sampling.probability=1.0              # Send 100% of the request traces to Cloud Trace.
+
+
+
+

Spring Framework on Google Cloud Trace does override some Micrometer configurations:

+
+
+
    +
  • +

    Always uses 128-bit Trace IDs. +This is required by Cloud Trace.

    +
  • +
  • +

    Does not use Span joins. +Span joins will share the span ID between the client and server Spans. +Cloud Trace requires that every Span ID within a Trace to be unique, so Span joins are not supported.

    +
  • +
+
+
+
+

10.3. Overriding the autoconfiguration

+
+

You can send traces to multiple tracing systems. In order to get this to work, every tracing system needs to have a Reporter<Span> and Sender. +If you want to override the provided beans you need to give them a specific name. +To do this you can use respectively StackdriverTraceAutoConfiguration.REPORTER_BEAN_NAME and StackdriverTraceAutoConfiguration.SENDER_BEAN_NAME.

+
+
+
+

10.4. Customizing spans

+
+

You can add additional tags and annotations to spans by using the brave.SpanCustomizer, which is available in the application context.

+
+
+

Here’s an example that uses WebMvcConfigurer to configure an MVC interceptor that adds two extra tags to all web controller spans.

+
+
+
+
@SpringBootApplication
+public class Application implements WebMvcConfigurer {
+
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+
+    @Autowired
+    private SpanCustomizer spanCustomizer;
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(new HandlerInterceptor() {
+            @Override
+            public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+                spanCustomizer.tag("session-id", request.getSession().getId());
+                spanCustomizer.tag("environment", "QA");
+
+                return true;
+            }
+        });
+    }
+}
+
+
+
+
+

You can then search and filter traces based on these additional tags in the Cloud Trace service.

+
+
+
+

10.5. Integration with Logging

+
+

Integration with Cloud Logging is available through the Cloud Logging Support. +If the Trace integration is used together with the Logging one, the request logs will be associated to the corresponding traces. +The trace logs can be viewed by going to the Google Cloud Console Trace List, selecting a trace and pressing the Logs → View link in the Details section.

+
+
+
+

10.6. Pub/Sub Trace Instrumentation (Experimental)

+
+

You can enable trace instrumentation and propagation for Pub/Sub messages by using the spring.cloud.gcp.trace.pubsub.enabled=true property. +It’s set to false by default, but when set to true, trace spans will be created and propagated to Cloud Trace whenever the application sends or receives messages through PubSubTemplate or any other integration that builds on top of PubSubTemplate, such as the Spring Integration channel adapters, and the Spring Cloud Stream Binder.

+
+
+
+
# Enable Pub/Sub tracing using this property
+spring.cloud.gcp.trace.pubsub.enabled=true
+
+
+
+
+

10.7. Sample

+
+

A sample application and a codelab are available.

+
+
+
+
+
+

11. Cloud Logging

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-logging</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-logging")
+}
+
+
+
+

Cloud Logging is the managed logging service provided by Google Cloud.

+
+
+

This module provides support for associating a web request trace ID with the corresponding log entries. +It does so by retrieving the X-B3-TraceId value from the Mapped Diagnostic Context (MDC), which is set by Micrometer. +If Micrometer isn’t used, the configured TraceIdExtractor extracts the desired header value and sets it as the log entry’s trace ID. +This allows grouping of log messages by request, for example, in the Google Cloud Console Logs viewer.

+
+
+ + + + + +
+ + +Due to the way logging is set up, the Google Cloud project ID and credentials defined in application.properties are ignored. +Instead, you should set the GOOGLE_CLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS environment variables to the project ID and credentials private key location, respectively. +You can do this easily if you’re using the Google Cloud SDK, using the gcloud config set project [YOUR_PROJECT_ID] and gcloud auth application-default login commands, respectively. +
+
+
+

11.1. Web MVC Interceptor

+
+

For use in Web MVC-based applications, TraceIdLoggingWebMvcInterceptor is provided that extracts the request trace ID from an HTTP request using a TraceIdExtractor and stores it in a thread-local, which can then be used in a logging appender to add the trace ID metadata to log messages.

+
+
+ + + + + +
+ + +If Spring Framework on Google Cloud Trace is enabled, the logging module disables itself and delegates log correlation to Micrometer. +
+
+
+

LoggingWebMvcConfigurer configuration class is also provided to help register the TraceIdLoggingWebMvcInterceptor in Spring MVC applications.

+
+
+

Applications hosted on the Google Cloud include trace IDs under the x-cloud-trace-context header, which will be included in log entries. +However, if Micrometer is used the trace ID will be picked up from the MDC.

+
+
+
+

11.2. Logback Support

+
+

Currently, only Logback is supported and there are 2 possibilities to log to Cloud Logging via this library with Logback: via direct API calls and through JSON-formatted console logs.

+
+
+

11.2.1. Log via API

+
+

A Cloud Logging appender is available using com/google/cloud/spring/logging/logback-appender.xml. +This appender builds a Cloud Logging log entry from a JUL or Logback log entry, adds a trace ID to it and sends it to Cloud Logging.

+
+
+

STACKDRIVER_LOG_NAME and STACKDRIVER_LOG_FLUSH_LEVEL environment variables can be used to customize the STACKDRIVER appender.

+
+
+

Your configuration may then look like this:

+
+
+
+
<configuration>
+  <include resource="com/google/cloud/spring/logging/logback-appender.xml" />
+
+  <root level="INFO">
+    <appender-ref ref="STACKDRIVER" />
+  </root>
+</configuration>
+
+
+
+

If you want to have more control over the log output, you can further configure the appender. +The following properties are available (see java-logging-logback project for the full list):

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDefault ValueDescription

log

spring.log

The Cloud Logging Log name. +This can also be set via the STACKDRIVER_LOG_NAME environmental variable.

flushLevel

OFF

If a log entry with this level is encountered, trigger a flush of locally buffered log to Cloud Logging. +This can also be set via the STACKDRIVER_LOG_FLUSH_LEVEL environmental variable.

enhancer

Fully qualified class name for customizing a logging entry; must implement com.google.cloud.logging.LoggingEnhancer.

loggingEventEnhancer

Fully qualified class name for customizing a logging entry given an ILoggingEvent; must implement com.google.cloud.logging.logback.LoggingEventEnhancer.

+
+
+

11.2.2. Asynchronous Logging

+
+

If you would like to send logs asynchronously to Cloud Logging, you can use the AsyncAppender.

+
+
+

Your configuration may then look like this:

+
+
+
+
<configuration>
+  <include resource="com/google/cloud/spring/logging/logback-appender.xml" />
+
+  <appender name="ASYNC_STACKDRIVER" class="ch.qos.logback.classic.AsyncAppender">
+    <appender-ref ref="STACKDRIVER" />
+  </appender>
+
+  <root level="INFO">
+    <appender-ref ref="ASYNC_STACKDRIVER" />
+  </root>
+</configuration>
+
+
+
+
+

11.2.3. Log via Console

+
+

For Logback, a com/google/cloud/spring/logging/logback-json-appender.xml file is made available for import to make it easier to configure the JSON Logback appender.

+
+
+

Your configuration may then look something like this:

+
+
+
+
<configuration>
+  <include resource="com/google/cloud/spring/logging/logback-json-appender.xml" />
+
+  <root level="INFO">
+    <appender-ref ref="CONSOLE_JSON" />
+  </root>
+</configuration>
+
+
+
+

If your application is running on Google Kubernetes Engine, Google Compute Engine or Google App Engine Flexible, your console logging is automatically saved to Google Cloud Logging. +Therefore, you can just include com/google/cloud/spring/logging/logback-json-appender.xml in your logging configuration, which logs JSON entries to the console. +The trace id will be set correctly.

+
+
+

If you want to have more control over the log output, you can further configure the appender. +The following properties are available:

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDefault ValueDescription

projectId

+

If not set, default value is determined in the following order:

+
+
+
    +
  1. +

    SPRING_CLOUD_GCP_LOGGING_PROJECT_ID Environmental Variable.

    +
  2. +
  3. +

    Value of DefaultGcpProjectIdProvider.getProjectId()

    +
  4. +
+
+

This is used to generate fully qualified Cloud Trace ID format: projects/[PROJECT-ID]/traces/[TRACE-ID].

+
+
+

This format is required to correlate trace between Cloud Trace and Cloud Logging.

+
+
+

If projectId is not set and cannot be determined, then it’ll log traceId without the fully qualified format.

+

traceIdMdcField

traceId

The MDC field name for retrieving a trace id

spanIdMdcField

spanId

the MDC field name for retrieving a span id

includeTraceId

true

Should the trace id be included

includeSpanId

true

Should the span id be included

includeLevel

true

Should the severity be included

includeThreadName

true

Should the thread name be included

includeMDC

true

Should all MDC properties be included. +The MDC properties X-B3-TraceId, X-B3-SpanId and X-Span-Export provided by Micrometer will get excluded as they get handled separately

includeLoggerName

true

Should the name of the logger be included

includeFormattedMessage

true

Should the formatted log message be included.

includeExceptionInMessage

true

Should the stacktrace be appended to the formatted log message. +This setting is only evaluated if includeFormattedMessage is true

includeContextName

true

Should the logging context be included

includeMessage

false

Should the log message with blank placeholders be included

includeException

false

Should the stacktrace be included as a own field

serviceContext

none

Define the Stackdriver service context data (service and version). This allows filtering of error reports for service and version in the Google Cloud Error Reporting View.

customJson

none

Defines custom json data. Data will be added to the json output.

loggingEventEnhancer

none

Name of a class implementing JsonLoggingEventEnhancer which modifies the JSON logging output. This tag is repeatable.

+

Examples are provided in the extensions package.

+

- Logstash Enhancer

+
+

This is an example of such an Logback configuration:

+
+
+
+
<configuration >
+  <property name="projectId" value="${projectId:-${GOOGLE_CLOUD_PROJECT}}"/>
+
+  <appender name="CONSOLE_JSON" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+      <layout class="com.google.cloud.spring.logging.StackdriverJsonLayout">
+        <projectId>${projectId}</projectId>
+
+        <!--<traceIdMdcField>traceId</traceIdMdcField>-->
+        <!--<spanIdMdcField>spanId</spanIdMdcField>-->
+        <!--<includeTraceId>true</includeTraceId>-->
+        <!--<includeSpanId>true</includeSpanId>-->
+        <!--<includeLevel>true</includeLevel>-->
+        <!--<includeThreadName>true</includeThreadName>-->
+        <!--<includeMDC>true</includeMDC>-->
+        <!--<includeLoggerName>true</includeLoggerName>-->
+        <!--<includeFormattedMessage>true</includeFormattedMessage>-->
+        <!--<includeExceptionInMessage>true</includeExceptionInMessage>-->
+        <!--<includeContextName>true</includeContextName>-->
+        <!--<includeMessage>false</includeMessage>-->
+        <!--<includeException>false</includeException>-->
+        <!--<serviceContext>
+              <service>service-name</service>
+              <version>service-version</version>
+            </serviceContext>-->
+        <!--<customJson>{"custom-key": "custom-value"}</customJson>-->
+        <!--<loggingEventEnhancer>your.package.YourLoggingEventEnhancer</loggingEventEnhancer> -->
+      </layout>
+    </encoder>
+  </appender>
+</configuration>
+
+
+
+
+
+

11.3. Sample

+
+

A Sample Spring Boot Application is provided to show how to use the Cloud logging starter.

+
+
+
+
+
+

12. Cloud Monitoring

+
+
+

Google Cloud provides a service called Cloud Monitoring, and Micrometer can be used with it to easily instrument Spring Boot applications for observability.

+
+
+

Spring Boot already provides auto-configuration for Cloud Monitoring. +This module enables auto-detection of the project-id and credentials. +Also, it can be customized.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-metrics</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-metrics")
+}
+
+
+
+

You must enable Cloud Monitoring API from the Google Cloud Console in order to capture metrics. +Navigate to the Cloud Monitoring API for your project and make sure it’s enabled.

+
+
+

Spring Boot Starter for Cloud Monitoring uses Micrometer.

+
+
+

12.1. Configuration

+
+

All configurations are optional:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.metrics.enabled

Auto-configure Micrometer to send metrics to Cloud Monitoring.

No

true

spring.cloud.gcp.metrics.project-id

Overrides the project ID from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.metrics.credentials.location

Overrides the credentials location from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.metrics.credentials.encoded-key

Overrides the credentials encoded key from the Spring Framework on Google Cloud Module

No

spring.cloud.gcp.metrics.credentials.scopes

Overrides the credentials scopes from the Spring Framework on Google Cloud Module

No

+
+

You can use core Spring Boot Actuator properties to control reporting frequency, etc. +Read Spring Boot Actuator documentation for more information on Stackdriver Actuator configurations.

+
+
+

12.1.1. Metrics Disambiguation

+
+

By default, the autoconfigured Bean StackdriverMeterRegistry provided by spring-cloud-gcp-starter-metrics does not add any application/pod specific tags to the metrics, +thus google is unable to distinguish between multiple metric sources. +This could lead to the following warning inside your applications logs:

+
+
+
+
2022-08-15 10:26:00.248  WARN 1 --- [trics-publisher] i.m.s.StackdriverMeterRegistry           : failed to send metrics to Stackdriver
+
+
+
+

The actual cause message may vary:

+
+
+
+
One or more TimeSeries could not be written:
+One or more points were written more frequently than the maximum sampling period configured for the metric.: global{} timeSeries[4]: custom.googleapis.com/process/uptime{};
+One or more points were written more frequently than the maximum sampling period configured for the metric.: global{} timeSeries[6]: custom.googleapis.com/system/load/average/1m{};
+One or more points ...
+
+
+
+

or even:

+
+
+
+
Caused by: io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: Header size exceeded max allowed size (10240)
+
+
+
+

(due to the error message being too long)

+
+
+

Google rejects metric updates for entries that it has received before (from another application) for the same interval. +To avoid these conflicts and in order to distinguish between applications/instances you should add a configuration similar to this:

+
+
+
+
management:
+  metrics:
+    tags:
+      app: my-foobar-service
+      instance: ${random.uuid}
+
+
+
+

Instead of the random uuid you could also use the pod id/the hostname or some other instance id. +Read more about custom tags here.

+
+
+
+
+

12.2. Sample

+
+

A sample application is available.

+
+
+
+
+
+

13. Spring Data Cloud Spanner

+
+
+

Spring Data is an abstraction for storing and retrieving POJOs in numerous storage technologies. +Spring Framework on Google Cloud adds Spring Data support for Google Cloud Spanner.

+
+
+

Maven coordinates for this module only, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-data-spanner</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-data-spanner")
+}
+
+
+
+

We provide a Spring Boot Starter for Spring Data Spanner, with which you can leverage our recommended auto-configuration setup. +To use the starter, see the coordinates see below.

+
+
+

Maven:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-data-spanner</artifactId>
+</dependency>
+
+
+
+

Gradle:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-data-spanner")
+}
+
+
+
+

This setup takes care of bringing in the latest compatible version of Cloud Java Cloud Spanner libraries as well.

+
+
+

13.1. Configuration

+
+

To setup Spring Data Cloud Spanner, you have to configure the following:

+
+
+
    +
  • +

    Setup the connection details to Google Cloud Spanner.

    +
  • +
  • +

    Enable Spring Data Repositories (optional).

    +
  • +
+
+
+

13.1.1. Cloud Spanner settings

+
+

You can use the Spring Boot Starter for Spring Data Spanner to autoconfigure Google Cloud Spanner in your Spring application. +It contains all the necessary setup that makes it easy to authenticate with your Google Cloud project. +The following configuration options are available:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.spanner.enabled

Enables the Cloud Spanner client

No

true

spring.cloud.gcp.spanner.instance-id

Cloud Spanner instance to use

Yes

spring.cloud.gcp.spanner.database

Cloud Spanner database to use

Yes

spring.cloud.gcp.spanner.project-id

Google Cloud project ID where the Google Cloud Spanner API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.spanner.credentials.location

OAuth2 credentials for authenticating with the +Google Cloud Spanner API, if different from the ones in the +Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.spanner.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the +Google Cloud Spanner API, if different from the ones in the +Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.spanner.credentials.scopes

OAuth2 scope for Spring Framework on Google +CloudSpanner credentials

No

www.googleapis.com/auth/spanner.data

spring.cloud.gcp.spanner.createInterleavedTableDdlOnDeleteCascade

If true, then schema statements generated by SpannerSchemaUtils for tables with interleaved parent-child relationships will be "ON DELETE CASCADE". +The schema for the tables will be "ON DELETE NO ACTION" if false.

No

true

spring.cloud.gcp.spanner.numRpcChannels

Number of gRPC channels used to connect to Cloud Spanner

No

4 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.prefetchChunks

Number of chunks prefetched by Cloud Spanner for read and query

No

4 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.minSessions

Minimum number of sessions maintained in the session pool

No

0 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.maxSessions

Maximum number of sessions session pool can have

No

400 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.maxIdleSessions

Maximum number of idle sessions session pool will maintain

No

0 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.writeSessionsFraction

Fraction of sessions to be kept prepared for write transactions

No

0.2 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.keepAliveIntervalMinutes

How long to keep idle sessions alive

No

30 - Determined by Cloud Spanner client library

spring.cloud.gcp.spanner.failIfPoolExhausted

If all sessions are in use, fail the request by throwing an exception. Otherwise, by default, block until a session becomes available.

No

false

spring.cloud.gcp.spanner.emulator.enabled

Enables the usage of an emulator. If this is set to true, then you should set the spring.cloud.gcp.spanner.emulator-host to the host:port of your locally running emulator instance.

No

false

spring.cloud.gcp.spanner.emulator-host

The host and port of the Spanner emulator; can be overridden to specify connecting to an already-running Spanner emulator instance.

No

localhost:9010

+
+ + + + + +
+ + +For further customization of the client library SpannerOptions, provide a bean implementing SpannerOptionsCustomizer, with a single method that accepts a SpannerOptions.Builder and modifies it as necessary. +
+
+
+
+

13.1.2. Repository settings

+
+

Spring Data Repositories can be configured via the @EnableSpannerRepositories annotation on your main @Configuration class. +With our Spring Boot Starter for Spring Data Cloud Spanner, @EnableSpannerRepositories is automatically added. +It is not required to add it to any other class, unless there is a need to override finer grain configuration parameters provided by @EnableSpannerRepositories.

+
+
+
+

13.1.3. Autoconfiguration

+
+

Our Spring Boot autoconfiguration creates the following beans available in the Spring application context:

+
+
+
    +
  • +

    an instance of SpannerTemplate

    +
  • +
  • +

    an instance of SpannerDatabaseAdminTemplate for generating table schemas from object hierarchies and creating and deleting tables and databases

    +
  • +
  • +

    an instance of all user-defined repositories extending SpannerRepository, CrudRepository, PagingAndSortingRepository, when repositories are enabled

    +
  • +
  • +

    an instance of DatabaseClient from the Google Cloud Java Client for Spanner, for convenience and lower level API access

    +
  • +
+
+
+
+
+

13.2. Object Mapping

+
+

Spring Data Cloud Spanner allows you to map domain POJOs to Cloud Spanner tables via annotations:

+
+
+
+
@Table(name = "traders")
+public class Trader {
+
+    @PrimaryKey
+    @Column(name = "trader_id")
+    String traderId;
+
+    String firstName;
+
+    String lastName;
+
+    @NotMapped
+    Double temporaryNumber;
+}
+
+
+
+
+

Spring Data Cloud Spanner will ignore any property annotated with @NotMapped. +These properties will not be written to or read from Spanner.

+
+
+

13.2.1. Constructors

+
+

Simple constructors are supported on POJOs. +The constructor arguments can be a subset of the persistent properties. +Every constructor argument needs to have the same name and type as a persistent property on the entity and the constructor should set the property from the given argument. +Arguments that are not directly set to properties are not supported.

+
+
+
+
@Table(name = "traders")
+public class Trader {
+    @PrimaryKey
+    @Column(name = "trader_id")
+    String traderId;
+
+    String firstName;
+
+    String lastName;
+
+    @NotMapped
+    Double temporaryNumber;
+
+    public Trader(String traderId, String firstName) {
+        this.traderId = traderId;
+        this.firstName = firstName;
+    }
+}
+
+
+
+
+
+

13.2.2. Table

+
+

The @Table annotation can provide the name of the Cloud Spanner table that stores instances of the annotated class, one per row. +This annotation is optional, and if not given, the name of the table is inferred from the class name with the first character uncapitalized.

+
+
+
SpEL expressions for table names
+
+

In some cases, you might want the @Table table name to be determined dynamically. +To do that, you can use Spring Expression Language.

+
+
+

For example:

+
+
+
+
@Table(name = "trades_#{tableNameSuffix}")
+public class Trade {
+    // ...
+}
+
+
+
+
+

The table name will be resolved only if the tableNameSuffix value/bean in the Spring application context is defined. +For example, if tableNameSuffix has the value "123", the table name will resolve to trades_123.

+
+
+
+
+

13.2.3. Primary Keys

+
+

For a simple table, you may only have a primary key consisting of a single column. +Even in that case, the @PrimaryKey annotation is required. +@PrimaryKey identifies the one or more ID properties corresponding to the primary key.

+
+
+

Spanner has first class support for composite primary keys of multiple columns. +You have to annotate all of your POJO’s fields that the primary key consists of with @PrimaryKey as below:

+
+
+
+
@Table(name = "trades")
+public class Trade {
+    @PrimaryKey(keyOrder = 2)
+    @Column(name = "trade_id")
+    private String tradeId;
+
+    @PrimaryKey(keyOrder = 1)
+    @Column(name = "trader_id")
+    private String traderId;
+
+    private String action;
+
+    private BigDecimal price;
+
+    private Double shares;
+
+    private String symbol;
+}
+
+
+
+
+

The keyOrder parameter of @PrimaryKey identifies the properties corresponding to the primary key columns in order, starting with 1 and increasing consecutively. +Order is important and must reflect the order defined in the Cloud Spanner schema. +In our example the DDL to create the table and its primary key is as follows:

+
+
+
+
CREATE TABLE trades (
+    trader_id STRING(MAX),
+    trade_id STRING(MAX),
+    action STRING(15),
+    symbol STRING(10),
+    price NUMERIC,
+    shares FLOAT64
+) PRIMARY KEY (trader_id, trade_id)
+
+
+
+

Spanner does not have automatic ID generation. +For most use-cases, sequential IDs should be used with caution to avoid creating data hotspots in the system. +Read Spanner Primary Keys documentation for a better understanding of primary keys and recommended practices.

+
+
+
+

13.2.4. Columns

+
+

All accessible properties on POJOs are automatically recognized as a Cloud Spanner column. +Column naming is generated by the PropertyNameFieldNamingStrategy by default defined on the SpannerMappingContext bean. +The @Column annotation optionally provides a different column name than that of the property and some other settings:

+
+
+
    +
  • +

    name is the optional name of the column

    +
  • +
  • +

    spannerTypeMaxLength specifies for STRING and BYTES columns the maximum length. +This setting is only used when generating DDL schema statements based on domain types.

    +
  • +
  • +

    nullable specifies if the column is created as NOT NULL. +This setting is only used when generating DDL schema statements based on domain types.

    +
  • +
  • +

    spannerType is the Cloud Spanner column type you can optionally specify. +If this is not specified then a compatible column type is inferred from the Java property type.

    +
  • +
  • +

    spannerCommitTimestamp is a boolean specifying if this property corresponds to an auto-populated commit timestamp column. +Any value set in this property will be ignored when writing to Cloud Spanner.

    +
  • +
+
+
+
+

13.2.5. Embedded Objects

+
+

If an object of type B is embedded as a property of A, then the columns of B will be saved in the same Cloud Spanner table as those of A.

+
+
+

If B has primary key columns, those columns will be included in the primary key of A. B can also have embedded properties. +Embedding allows reuse of columns between multiple entities, and can be useful for implementing parent-child situations, because Cloud Spanner requires child tables to include the key columns of their parents.

+
+
+

For example:

+
+
+
+
class X {
+  @PrimaryKey
+  String grandParentId;
+
+  long age;
+}
+
+class A {
+  @PrimaryKey
+  @Embedded
+  X grandParent;
+
+  @PrimaryKey(keyOrder = 2)
+  String parentId;
+
+  String value;
+}
+
+@Table(name = "items")
+class B {
+  @PrimaryKey
+  @Embedded
+  A parent;
+
+  @PrimaryKey(keyOrder = 2)
+  String id;
+
+  @Column(name = "child_value")
+  String value;
+}
+
+
+
+
+

Entities of B can be stored in a table defined as:

+
+
+
+
CREATE TABLE items (
+    grandParentId STRING(MAX),
+    parentId STRING(MAX),
+    id STRING(MAX),
+    value STRING(MAX),
+    child_value STRING(MAX),
+    age INT64
+) PRIMARY KEY (grandParentId, parentId, id)
+
+
+
+

Note that the following restrictions apply when you use embedded objects:

+
+
+
    +
  • +

    Embedded properties' column names must all be unique.

    +
  • +
  • +

    Embedded properties must not be passed through a constructor and the property must be mutable; otherwise you’ll get an error, such as SpannerDataException: Column not found. +Be careful about this restriction when you use Kotlin’s data class to hold an embedded property.

    +
  • +
+
+
+
+

13.2.6. Relationships

+
+

Spring Data Cloud Spanner supports parent-child relationships using the Cloud Spanner parent-child interleaved table mechanism. +Cloud Spanner interleaved tables enforce the one-to-many relationship and provide efficient queries and operations on entities of a single domain parent entity. +These relationships can be up to 7 levels deep. +Cloud Spanner also provides automatic cascading delete or enforces the deletion of child entities before parents.

+
+
+

While one-to-one and many-to-many relationships can be implemented in Cloud Spanner and Spring Data Cloud Spanner using constructs of interleaved parent-child tables, only the parent-child relationship is natively supported.

+
+
+

For example, the following Java entities:

+
+
+
+
@Table(name = "Singers")
+class Singer {
+  @PrimaryKey
+  long SingerId;
+
+  String FirstName;
+
+  String LastName;
+
+  byte[] SingerInfo;
+
+  @Interleaved
+  List<Album> albums;
+}
+
+@Table(name = "Albums")
+class Album {
+  @PrimaryKey
+  long SingerId;
+
+  @PrimaryKey(keyOrder = 2)
+  long AlbumId;
+
+  String AlbumTitle;
+}
+
+
+
+
+

These classes can correspond to an existing pair of interleaved tables. +The @Interleaved annotation may be applied to Collection properties and the inner type is resolved as the child entity type. +The schema needed to create them can also be generated using the SpannerSchemaUtils and run by using the SpannerDatabaseAdminTemplate:

+
+
+
+
@Autowired
+SpannerSchemaUtils schemaUtils;
+
+@Autowired
+SpannerDatabaseAdminTemplate databaseAdmin;
+...
+
+// Get the create statmenets for all tables in the table structure rooted at Singer
+List<String> createStrings = this.schemaUtils.getCreateTableDdlStringsForInterleavedHierarchy(Singer.class);
+
+// Create the tables and also create the database if necessary
+this.databaseAdmin.executeDdlStrings(createStrings, true);
+
+
+
+
+

The createStrings list contains table schema statements using column names and types compatible with the provided Java type and any resolved child relationship types contained within based on the configured custom converters.

+
+
+
+
CREATE TABLE Singers (
+  SingerId   INT64 NOT NULL,
+  FirstName  STRING(1024),
+  LastName   STRING(1024),
+  SingerInfo BYTES(MAX),
+) PRIMARY KEY (SingerId);
+
+CREATE TABLE Albums (
+  SingerId     INT64 NOT NULL,
+  AlbumId      INT64 NOT NULL,
+  AlbumTitle   STRING(MAX),
+) PRIMARY KEY (SingerId, AlbumId),
+  INTERLEAVE IN PARENT Singers ON DELETE CASCADE;
+
+
+
+

The ON DELETE CASCADE clause indicates that Cloud Spanner will delete all Albums of a singer if the Singer is deleted. +The alternative is ON DELETE NO ACTION, where a Singer cannot be deleted until all of its Albums have already been deleted. +When using SpannerSchemaUtils to generate the schema strings, the spring.cloud.gcp.spanner.createInterleavedTableDdlOnDeleteCascade boolean setting determines if these schema are generated as ON DELETE CASCADE for true and ON DELETE NO ACTION for false.

+
+
+

Cloud Spanner restricts these relationships to 7 child layers. +A table may have multiple child tables.

+
+
+

On updating or inserting an object to Cloud Spanner, all of its referenced children objects are also updated or inserted in the same request, respectively. +On read, all of the interleaved child rows are also all read.

+
+
+
Lazy Fetch
+
+

@Interleaved properties are retrieved eagerly by default, but can be fetched lazily for performance in both read and write:

+
+
+
+
@Interleaved(lazy = true)
+List<Album> albums;
+
+
+
+
+

Lazily-fetched interleaved properties are retrieved upon the first interaction with the property. +If a property marked for lazy fetching is never retrieved, then it is also skipped when saving the parent entity.

+
+
+

If used inside a transaction, subsequent operations on lazily-fetched properties use the same transaction context as that of the original parent entity.

+
+
+
+
Declarative Filtering with @Where
+
+

The @Where annotation could be applied to an entity class or to an interleaved property. +This annotation provides an SQL where clause that will be applied at the fetching of interleaved collections or the entity itself.

+
+
+

Let’s say we have an Agreement with a list of Participants which could be assigned to it. +We would like to fetch a list of currently active participants. +For security reasons, all records should remain in the database forever, even if participants become inactive. +That can be easily achieved with the @Where annotation, which is demonstrated by this example:

+
+
+
+
@Table(name = "participants")
+public class Participant {
+  //...
+  boolean active;
+  //...
+}
+
+@Table(name = "agreements")
+public class Agreement {
+  //...
+  @Interleaved
+  @Where("active = true")
+  List<Participant> participants;
+  Person person;
+  //...
+}
+
+
+
+
+
+
+

13.2.7. Supported Types

+
+

Spring Data Cloud Spanner natively supports the following types for regular fields but also utilizes custom converters (detailed in following sections) and dozens of pre-defined Spring Data custom converters to handle other common Java types.

+
+
+

Natively supported types:

+
+
+
    +
  • +

    com.google.cloud.ByteArray

    +
  • +
  • +

    com.google.cloud.Date

    +
  • +
  • +

    com.google.cloud.Timestamp

    +
  • +
  • +

    java.lang.Boolean, boolean

    +
  • +
  • +

    java.lang.Double, double

    +
  • +
  • +

    java.lang.Float, float

    +
  • +
  • +

    java.lang.Long, long

    +
  • +
  • +

    java.lang.Integer, int

    +
  • +
  • +

    java.lang.String

    +
  • +
  • +

    double[]

    +
  • +
  • +

    float[]

    +
  • +
  • +

    long[]

    +
  • +
  • +

    boolean[]

    +
  • +
  • +

    java.util.Date

    +
  • +
  • +

    java.time.Instant

    +
  • +
  • +

    java.sql.Date

    +
  • +
  • +

    java.time.LocalDate

    +
  • +
  • +

    java.time.LocalDateTime

    +
  • +
+
+
+
+

13.2.8. JSON fields

+
+

Spanner supports JSON and ARRAY<JSON> type for columns. Such property needs to be annotated with @Column(spannerType = TypeCode.JSON). JSON columns are mapped to custom POJOs and ARRAY<JSON> columns are mapped to List of custom POJOs. Read, write and query with custom SQL query are supported for JSON annotated fields.

+
+
+ + + + + +
+ + +Spring Boot autoconfigures a Gson bean by default. +This Gson instance is used by default to convert to and from JSON representation. +To customize, use spring.gson.* configuration properties or GsonBuilderCustomizer bean as instructed in Spring Boot documentation here. +Alternatively, you can also provide a customized bean of type Gson in your application. +
+
+
+
+
@Table(name = "traders")
+public class Trader {
+
+    @PrimaryKey
+    @Column(name = "trader_id")
+    String traderId;
+
+    @Column(spannerType = TypeCode.JSON)
+    Details details;
+}
+
+public class Details {
+    String name;
+    String affiliation;
+    Boolean isActive;
+}
+
+
+
+
+
+

13.2.9. Lists

+
+

Spanner supports ARRAY types for columns. +ARRAY columns are mapped to List fields in POJOs.

+
+
+

Example:

+
+
+
+
List<Double> curve;
+
+
+
+
+

The types inside the lists can be any singular property type.

+
+
+
+

13.2.10. Lists of Structs

+
+

Cloud Spanner queries can construct STRUCT values that appear as columns in the result. +Cloud Spanner requires STRUCT values appear in ARRAYs at the root level: SELECT ARRAY(SELECT STRUCT(1 as val1, 2 as val2)) as pair FROM Users.

+
+
+

Spring Data Cloud Spanner will attempt to read the column STRUCT values into a property that is an Iterable of an entity type compatible with the schema of the column STRUCT value.

+
+
+

For the previous array-select example, the following property can be mapped with the constructed ARRAY<STRUCT> column: List<TwoInts> pair; where the TwoInts type is defined:

+
+
+
+
class TwoInts {
+
+  int val1;
+
+  int val2;
+}
+
+
+
+
+
+

13.2.11. Custom types

+
+

Custom converters can be used to extend the type support for user defined types.

+
+
+
    +
  1. +

    Converters need to implement the org.springframework.core.convert.converter.Converter interface in both directions.

    +
  2. +
  3. +

    The user defined type needs to be mapped to one of the basic types supported by Spanner:

    +
    +
      +
    • +

      com.google.cloud.ByteArray

      +
    • +
    • +

      com.google.cloud.Date

      +
    • +
    • +

      com.google.cloud.Timestamp

      +
    • +
    • +

      java.lang.Boolean, boolean

      +
    • +
    • +

      java.lang.Double, double

      +
    • +
    • +

      java.lang.Float, flaot

      +
    • +
    • +

      java.lang.Long, long

      +
    • +
    • +

      java.lang.String

      +
    • +
    • +

      double[]

      +
    • +
    • +

      float[]

      +
    • +
    • +

      long[]

      +
    • +
    • +

      boolean[]

      +
    • +
    • +

      enum types

      +
    • +
    +
    +
  4. +
  5. +

    An instance of both Converters needs to be passed to a ConverterAwareMappingSpannerEntityProcessor, which then has to be made available as a @Bean for SpannerEntityProcessor.

    +
  6. +
+
+
+

For example:

+
+
+

We would like to have a field of type Person on our Trade POJO:

+
+
+
+
@Table(name = "trades")
+public class Trade {
+  //...
+  Person person;
+  //...
+}
+
+
+
+
+

Where Person is a simple class:

+
+
+
+
public class Person {
+
+  public String firstName;
+  public String lastName;
+
+}
+
+
+
+
+

We have to define the two converters:

+
+
+
+
  public class PersonWriteConverter implements Converter<Person, String> {
+
+    @Override
+    public String convert(Person person) {
+      return person.firstName + " " + person.lastName;
+    }
+  }
+
+  public class PersonReadConverter implements Converter<String, Person> {
+
+    @Override
+    public Person convert(String s) {
+      Person person = new Person();
+      person.firstName = s.split(" ")[0];
+      person.lastName = s.split(" ")[1];
+      return person;
+    }
+  }
+
+
+
+
+

That will be configured in our @Configuration file:

+
+
+
+
@Configuration
+public class ConverterConfiguration {
+
+    @Bean
+    public SpannerEntityProcessor spannerEntityProcessor(SpannerMappingContext spannerMappingContext) {
+        return new ConverterAwareMappingSpannerEntityProcessor(spannerMappingContext,
+                Arrays.asList(new PersonWriteConverter()),
+                Arrays.asList(new PersonReadConverter()));
+    }
+}
+
+
+
+
+

Note that ConverterAwareMappingSpannerEntityProcessor takes a list of Converters for write and read operations to support multiple user-defined types. +When there are duplicate Converters for a user-defined class in the list, it chooses the first matching item in the lists. +This means that, for a user-defined class U, write operations use the first Converter<U, …​> from the write Converters and read operations use the first Converter<…​, U> from the read Converters.

+
+
+
+

13.2.12. Custom Converter for Struct Array Columns

+
+

If a Converter<Struct, A> is provided, then properties of type List<A> can be used in your entity types.

+
+
+
+
+

13.3. Spanner Operations & Template

+
+

SpannerOperations and its implementation, SpannerTemplate, provides the Template pattern familiar to Spring developers. +It provides:

+
+
+
    +
  • +

    Resource management

    +
  • +
  • +

    One-stop-shop to Spanner operations with the Spring Data POJO mapping and conversion features

    +
  • +
  • +

    Exception conversion

    +
  • +
+
+
+

Using the autoconfigure provided by our Spring Boot Starter for Spanner, your Spring application context will contain a fully configured SpannerTemplate object that you can easily autowire in your application:

+
+
+
+
@SpringBootApplication
+public class SpannerTemplateExample {
+
+    @Autowired
+    SpannerTemplate spannerTemplate;
+
+    public void doSomething() {
+        this.spannerTemplate.delete(Trade.class, KeySet.all());
+        //...
+        Trade t = new Trade();
+        //...
+        this.spannerTemplate.insert(t);
+        //...
+        List<Trade> tradesByAction = spannerTemplate.findAll(Trade.class);
+        //...
+    }
+}
+
+
+
+
+

The Template API provides convenience methods for:

+
+
+
    +
  • +

    Reads, and by providing SpannerReadOptions and +SpannerQueryOptions

    +
    +
      +
    • +

      Stale read

      +
    • +
    • +

      Read with secondary indices

      +
    • +
    • +

      Read with limits and offsets

      +
    • +
    • +

      Read with sorting

      +
    • +
    +
    +
  • +
  • +

    Queries

    +
  • +
  • +

    DML operations (delete, insert, update, upsert)

    +
  • +
  • +

    Partial reads

    +
    +
      +
    • +

      You can define a set of columns to be read into your entity

      +
    • +
    +
    +
  • +
  • +

    Partial writes

    +
    +
      +
    • +

      Persist only a few properties from your entity

      +
    • +
    +
    +
  • +
  • +

    Read-only transactions

    +
  • +
  • +

    Locking read-write transactions

    +
  • +
+
+
+

13.3.1. SQL Query

+
+

Cloud Spanner has SQL support for running read-only queries. +All the query related methods start with query on SpannerTemplate. +By using SpannerTemplate, you can run SQL queries that map to POJOs:

+
+
+
+
List<Trade> trades = this.spannerTemplate.query(Trade.class, Statement.of("SELECT * FROM trades"));
+
+
+
+
+
+

13.3.2. Read

+
+

Spanner exposes a Read API for reading single row or multiple rows in a table or in a secondary index.

+
+
+

Using SpannerTemplate you can run reads, as the following example shows:

+
+
+
+
List<Trade> trades = this.spannerTemplate.readAll(Trade.class);
+
+
+
+
+

Main benefit of reads over queries is reading multiple rows of a certain pattern of keys is much easier using the features of the KeySet class.

+
+
+
+

13.3.3. Advanced reads

+
+
Stale read
+
+

All reads and queries are strong reads by default. +A strong read is a read at a current time and is guaranteed to see all data that has been committed up until the start of this read. +An exact staleness read is read at a timestamp in the past. +Cloud Spanner allows you to determine how current the data should be when you read data. +With SpannerTemplate you can specify the Timestamp by setting it on SpannerQueryOptions or SpannerReadOptions to the appropriate read or query methods:

+
+
+

Reads:

+
+
+
+
// a read with options:
+SpannerReadOptions spannerReadOptions = new SpannerReadOptions().setTimestamp(myTimestamp);
+List<Trade> trades = this.spannerTemplate.readAll(Trade.class, spannerReadOptions);
+
+
+
+
+

Queries:

+
+
+
+
// a query with options:
+SpannerQueryOptions spannerQueryOptions = new SpannerQueryOptions().setTimestamp(myTimestamp);
+List<Trade> trades = this.spannerTemplate.query(Trade.class, Statement.of("SELECT * FROM trades"), spannerQueryOptions);
+
+
+
+
+

You can also read with bounded staleness by setting .setTimestampBound(TimestampBound.ofMinReadTimestamp(myTimestamp)) on the query and read options objects. +Bounded staleness lets Cloud Spanner choose any point in time later than or equal to the given timestampBound, but it cannot be used inside transactions.

+
+
+
+
Read from a secondary index
+
+

Using a secondary index is available for Reads via the Template API and it is also implicitly available via SQL for Queries.

+
+
+

The following shows how to read rows from a table using a secondary index simply by setting index on SpannerReadOptions:

+
+
+
+
SpannerReadOptions spannerReadOptions = new SpannerReadOptions().setIndex("TradesByTrader");
+List<Trade> trades = this.spannerTemplate.readAll(Trade.class, spannerReadOptions);
+
+
+
+
+
+
Read with offsets and limits
+
+

Limits and offsets are only supported by Queries. +The following will get only the first two rows of the query:

+
+
+
+
SpannerQueryOptions spannerQueryOptions = new SpannerQueryOptions().setLimit(2).setOffset(3);
+List<Trade> trades = this.spannerTemplate.query(Trade.class, Statement.of("SELECT * FROM trades"), spannerQueryOptions);
+
+
+
+
+

Note that the above is equivalent of running SELECT * FROM trades LIMIT 2 OFFSET 3.

+
+
+
+
Sorting
+
+

Reads by keys do not support sorting. +However, queries on the Template API support sorting through standard SQL and also via Spring Data Sort API:

+
+
+
+
List<Trade> trades = this.spannerTemplate.queryAll(Trade.class, Sort.by("action"));
+
+
+
+
+

If the provided sorted field name is that of a property of the domain type, then the column name corresponding to that property will be used in the query. +Otherwise, the given field name is assumed to be the name of the column in the Cloud Spanner table. +Sorting on columns of Cloud Spanner types STRING and BYTES can be done while ignoring case:

+
+
+
+
Sort.by(Order.desc("action").ignoreCase())
+
+
+
+
+
+
Partial read
+
+

Partial read is only possible when using Queries. +In case the rows returned by the query have fewer columns than the entity that it will be mapped to, Spring Data will map the returned columns only. +This setting also applies to nested structs and their corresponding nested POJO properties.

+
+
+
+
List<Trade> trades = this.spannerTemplate.query(Trade.class, Statement.of("SELECT action, symbol FROM trades"),
+    new SpannerQueryOptions().setAllowMissingResultSetColumns(true));
+
+
+
+
+

If the setting is set to false, then an exception will be thrown if there are missing columns in the query result.

+
+
+
+
Summary of options for Query vs Read
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Feature

Query supports it

Read supports it

SQL

yes

no

Partial read

yes

no

Limits

yes

no

Offsets

yes

no

Secondary index

yes

yes

Read using index range

no

yes

Sorting

yes

no

+
+
+
+

13.3.4. Write / Update

+
+

The write methods of SpannerOperations accept a POJO and writes all of its properties to Spanner. +The corresponding Spanner table and entity metadata is obtained from the given object’s actual type.

+
+
+

If a POJO was retrieved from Spanner and its primary key properties values were changed and then written or updated, the operation will occur as if against a row with the new primary key values. +The row with the original primary key values will not be affected.

+
+
+
Insert
+
+

The insert method of SpannerOperations accepts a POJO and writes all of its properties to Spanner, which means the operation will fail if a row with the POJO’s primary key already exists in the table.

+
+
+
+
Trade t = new Trade();
+this.spannerTemplate.insert(t);
+
+
+
+
+
+
Update
+
+

The update method of SpannerOperations accepts a POJO and writes all of its properties to Spanner, which means the operation will fail if the POJO’s primary key does not already exist in the table.

+
+
+
+
// t was retrieved from a previous operation
+this.spannerTemplate.update(t);
+
+
+
+
+
+
Upsert
+
+

The upsert method of SpannerOperations accepts a POJO and writes all of its properties to Spanner using update-or-insert.

+
+
+
+
// t was retrieved from a previous operation or it's new
+this.spannerTemplate.upsert(t);
+
+
+
+
+
+
Partial Update
+
+

The update methods of SpannerOperations operate by default on all properties within the given object, but also accept String[] and Optional<Set<String>> of column names. +If the Optional of set of column names is empty, then all columns are written to Spanner. +However, if the Optional is occupied by an empty set, then no columns will be written.

+
+
+
+
// t was retrieved from a previous operation or it's new
+this.spannerTemplate.update(t, "symbol", "action");
+
+
+
+
+
+
+

13.3.5. DML

+
+

DML statements can be run by using SpannerOperations.executeDmlStatement. +Inserts, updates, and deletions can affect any number of rows and entities.

+
+
+

You can run partitioned DML updates by using the executePartitionedDmlStatement method. +Partitioned DML queries have performance benefits but also have restrictions and cannot be used inside transactions.

+
+
+
+

13.3.6. Transactions

+
+

SpannerOperations provides methods to run java.util.Function objects within a single transaction while making available the read and write methods from SpannerOperations.

+
+
+
Read/Write Transaction
+
+

Read and write transactions are provided by SpannerOperations via the performReadWriteTransaction method:

+
+
+
+
@Autowired
+SpannerOperations mySpannerOperations;
+
+public String doWorkInsideTransaction() {
+  return mySpannerOperations.performReadWriteTransaction(
+    transActionSpannerOperations -> {
+      // Work with transActionSpannerOperations here.
+      // It is also a SpannerOperations object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+

The performReadWriteTransaction method accepts a Function that is provided an instance of a SpannerOperations object. +The final returned value and type of the function is determined by the user. +You can use this object just as you would a regular SpannerOperations with a few exceptions:

+
+
+
    +
  • +

    Its read functionality cannot perform stale reads, because all reads and writes happen at the single point in time of the transaction.

    +
  • +
  • +

    It cannot perform sub-transactions via performReadWriteTransaction or performReadOnlyTransaction.

    +
  • +
+
+
+

As these read-write transactions are locking, it is recommended that you use the performReadOnlyTransaction if your function does not perform any writes.

+
+
+
+
Read-only Transaction
+
+

The performReadOnlyTransaction method is used to perform read-only transactions using a SpannerOperations:

+
+
+
+
@Autowired
+SpannerOperations mySpannerOperations;
+
+public String doWorkInsideTransaction() {
+  return mySpannerOperations.performReadOnlyTransaction(
+    transActionSpannerOperations -> {
+      // Work with transActionSpannerOperations here.
+      // It is also a SpannerOperations object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+

The performReadOnlyTransaction method accepts a Function that is provided an instance of a +SpannerOperations object. +This method also accepts a ReadOptions object, but the only attribute used is the timestamp used to determine the snapshot in time to perform the reads in the transaction. +If the timestamp is not set in the read options the transaction is run against the current state of the database. +The final returned value and type of the function is determined by the user. +You can use this object just as you would a regular SpannerOperations with +a few exceptions:

+
+
+
    +
  • +

    Its read functionality cannot perform stale reads (other than the staleness set on the entire transaction), because all reads happen at the single point in time of the transaction.

    +
  • +
  • +

    It cannot perform sub-transactions via performReadWriteTransaction or performReadOnlyTransaction

    +
  • +
  • +

    It cannot perform any write operations.

    +
  • +
+
+
+

Because read-only transactions are non-locking and can be performed on points in time in the past, these are recommended for functions that do not perform write operations.

+
+
+
+
Declarative Transactions with @Transactional Annotation
+
+

This feature requires a bean of SpannerTransactionManager, which is provided when using spring-cloud-gcp-starter-data-spanner.

+
+
+

SpannerTemplate and SpannerRepository support running methods with the @Transactional annotation as transactions. +If a method annotated with @Transactional calls another method also annotated, then both methods will work within the same transaction. +performReadOnlyTransaction and performReadWriteTransaction cannot be used in @Transactional annotated methods because Cloud Spanner does not support transactions within transactions.

+
+
+

Other Google Cloud database-related integrations like Spanner and Firestore can introduce PlatformTransactionManager beans, and can interfere with Datastore Transaction Manager. To disambiguate, explicitly specify the name of the transaction manager bean for such @Transactional methods. Example:

+
+
+
+
@Transactional(transactionManager = "spannerTransactionManager")
+
+
+
+
+
+
+

13.3.7. DML Statements

+
+

SpannerTemplate supports DML Statements. +DML statements can also be run in transactions by using performReadWriteTransaction or by using the @Transactional annotation.

+
+
+
+
+

13.4. Repositories

+
+

Spring Data Repositories are a powerful abstraction that can save you a lot of boilerplate code.

+
+
+

For example:

+
+
+
+
public interface TraderRepository extends SpannerRepository<Trader, String> {
+}
+
+
+
+
+

Spring Data generates a working implementation of the specified interface, which can be conveniently autowired into an application.

+
+
+

The Trader type parameter to SpannerRepository refers to the underlying domain type. +The second type parameter, String in this case, refers to the type of the key of the domain type.

+
+
+

For POJOs with a composite primary key, this ID type parameter can be any descendant of Object[] compatible with all primary key properties, any descendant of Iterable, or com.google.cloud.spanner.Key. +If the domain POJO type only has a single primary key column, then the primary key property type can be used or the Key type.

+
+
+

For example in case of Trades, that belong to a Trader, TradeRepository would look like this:

+
+
+
+
public interface TradeRepository extends SpannerRepository<Trade, String[]> {
+
+}
+
+
+
+
+
+
public class MyApplication {
+
+    @Autowired
+    SpannerTemplate spannerTemplate;
+
+    @Autowired
+    StudentRepository studentRepository;
+
+    public void demo() {
+
+        this.tradeRepository.deleteAll();
+        String traderId = "demo_trader";
+        Trade t = new Trade();
+        t.symbol = stock;
+        t.action = action;
+        t.traderId = traderId;
+        t.price = new BigDecimal("100.0");
+        t.shares = 12345.6;
+        this.spannerTemplate.insert(t);
+
+        Iterable<Trade> allTrades = this.tradeRepository.findAll();
+
+        int count = this.tradeRepository.countByAction("BUY");
+
+    }
+}
+
+
+
+
+

13.4.1. CRUD Repository

+
+

CrudRepository methods work as expected, with one thing Spanner specific: the save and saveAll methods work as update-or-insert.

+
+
+
+

13.4.2. Paging and Sorting Repository

+
+

You can also use PagingAndSortingRepository with Spanner Spring Data. +The sorting and pageable findAll methods available from this interface operate on the current state of the Spanner database. +As a result, beware that the state of the database (and the results) might change when moving page to page.

+
+
+
+

13.4.3. Spanner Repository

+
+

The SpannerRepository extends the PagingAndSortingRepository, but adds the read-only and the read-write transaction functionality provided by Spanner. +These transactions work very similarly to those of SpannerOperations, but is specific to the repository’s domain type and provides repository functions instead of template functions.

+
+
+

For example, this is a read-only transaction:

+
+
+
+
@Autowired
+SpannerRepository myRepo;
+
+public String doWorkInsideTransaction() {
+  return myRepo.performReadOnlyTransaction(
+    transactionSpannerRepo -> {
+      // Work with the single-transaction transactionSpannerRepo here.
+      // This is a SpannerRepository object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+

When creating custom repositories for your own domain types and query methods, you can extend SpannerRepository to access Cloud Spanner-specific features as well as all features from PagingAndSortingRepository and CrudRepository.

+
+
+
+
+

13.5. Query Methods

+
+

SpannerRepository supports Query Methods. +Described in the following sections, these are methods residing in your custom repository interfaces of which implementations are generated based on their names and annotations. +Query Methods can read, write, and delete entities in Cloud Spanner. +Parameters to these methods can be any Cloud Spanner data type supported directly or via custom configured converters. +Parameters can also be of type Struct or POJOs. +If a POJO is given as a parameter, it will be converted to a Struct with the same type-conversion logic as used to create write mutations. +Comparisons using Struct parameters are limited to what is available with Cloud Spanner.

+
+
+

13.5.1. Query methods by convention

+
+
+
public interface TradeRepository extends SpannerRepository<Trade, String[]> {
+    List<Trade> findByAction(String action);
+
+    int countByAction(String action);
+
+    // Named methods are powerful, but can get unwieldy
+    List<Trade> findTop3DistinctByActionAndSymbolIgnoreCaseOrTraderIdOrderBySymbolDesc(
+            String action, String symbol, String traderId);
+}
+
+
+
+
+

In the example above, the query methods in TradeRepository are generated based on the name of the methods, using the Spring Data Query creation naming convention.

+
+
+

List<Trade> findByAction(String action) would translate to a SELECT * FROM trades WHERE action = ?.

+
+
+

The function List<Trade> findTop3DistinctByActionAndSymbolIgnoreCaseOrTraderIdOrderBySymbolDesc(String action, String symbol, String traderId); will be translated as the equivalent of this SQL query:

+
+
+
+
SELECT DISTINCT * FROM trades
+WHERE ACTION = ? AND LOWER(SYMBOL) = LOWER(?) AND TRADER_ID = ?
+ORDER BY SYMBOL DESC
+LIMIT 3
+
+
+
+

The following filter options are supported:

+
+
+
    +
  • +

    Equality

    +
  • +
  • +

    Greater than or equals

    +
  • +
  • +

    Greater than

    +
  • +
  • +

    Less than or equals

    +
  • +
  • +

    Less than

    +
  • +
  • +

    Is null

    +
  • +
  • +

    Is not null

    +
  • +
  • +

    Is true

    +
  • +
  • +

    Is false

    +
  • +
  • +

    Like a string

    +
  • +
  • +

    Not like a string

    +
  • +
  • +

    Contains a string

    +
  • +
  • +

    Not contains a string

    +
  • +
  • +

    In

    +
  • +
  • +

    Not in

    +
  • +
+
+
+

Note that the phrase SymbolIgnoreCase is translated to LOWER(SYMBOL) = LOWER(?) indicating a non-case-sensitive matching. +The IgnoreCase phrase may only be appended to fields that correspond to columns of type STRING or BYTES. +The Spring Data "AllIgnoreCase" phrase appended at the end of the method name is not supported.

+
+
+

The Like or NotLike naming conventions:

+
+
+
+
List<Trade> findBySymbolLike(String symbolFragment);
+
+
+
+
+

The param symbolFragment can contain wildcard characters for string matching such as _ and %.

+
+
+

The Contains and NotContains naming conventions:

+
+
+
+
List<Trade> findBySymbolContains(String symbolFragment);
+
+
+
+
+

The param symbolFragment is a regular expression that is checked for occurrences.

+
+
+

The In and NotIn keywords must be used with Iterable corresponding parameters.

+
+
+

Delete queries are also supported. +For example, query methods such as deleteByAction or removeByAction delete entities found by findByAction. +The delete operation happens in a single transaction.

+
+
+

Delete queries can have the following return types: +* An integer type that is the number of entities deleted +* A collection of entities that were deleted +* void

+
+
+
+

13.5.2. Custom SQL/DML query methods

+
+

The example above for List<Trade> fetchByActionNamedQuery(String action) does not match the Spring Data Query creation naming convention, so we have to map a parametrized Spanner SQL query to it.

+
+
+

The SQL query for the method can be mapped to repository methods in one of two ways:

+
+
+
    +
  • +

    namedQueries properties file

    +
  • +
  • +

    using the @Query annotation

    +
  • +
+
+
+

The names of the tags of the SQL correspond to the @Param annotated names of the method parameters.

+
+
+

Interleaved properties are loaded eagerly, unless they are annotated with @Interleaved(lazy = true).

+
+
+

Custom SQL query methods can accept a single Sort or Pageable parameter that is applied on top of the specified custom query. +It is the recommended way to control the sort order of the results, which is not guaranteed by the ORDER BY clause in the SQL query. +This is due to the fact that the user-provided query is used as a sub-query, and Cloud Spanner doesn’t preserve order in subquery results.

+
+
+

You might want to use ORDER BY with LIMIT to obtain the top records, according to a specified order. +However, to ensure the correct sort order of the final result set, sort options have to be passed in with a Pageable.

+
+
+
+
    @Query("SELECT * FROM trades")
+    List<Trade> fetchTrades(Pageable pageable);
+
+    @Query("SELECT * FROM trades ORDER BY price DESC LIMIT 1")
+    Trade topTrade(Pageable pageable);
+
+
+
+
+

This can be used:

+
+
+
+
    List<Trade> customSortedTrades = tradeRepository.fetchTrades(PageRequest
+                .of(2, 2, org.springframework.data.domain.Sort.by(Order.asc("id"))));
+
+
+
+
+

The results would be sorted by "id" in ascending order.

+
+
+

Your query method can also return non-entity types:

+
+
+
+
    @Query("SELECT COUNT(1) FROM trades WHERE action = @action")
+    int countByActionQuery(String action);
+
+    @Query("SELECT EXISTS(SELECT COUNT(1) FROM trades WHERE action = @action)")
+    boolean existsByActionQuery(String action);
+
+    @Query("SELECT action FROM trades WHERE action = @action LIMIT 1")
+    String getFirstString(@Param("action") String action);
+
+    @Query("SELECT action FROM trades WHERE action = @action")
+    List<String> getFirstStringList(@Param("action") String action);
+
+
+
+
+

DML statements can also be run by query methods, but the only possible return value is a long representing the number of affected rows. +The dmlStatement boolean setting must be set on @Query to indicate that the query method is run as a DML statement.

+
+
+
+
    @Query(value = "DELETE FROM trades WHERE action = @action", dmlStatement = true)
+    long deleteByActionQuery(String action);
+
+
+
+
+
Query methods with named queries properties
+
+

By default, the namedQueriesLocation attribute on @EnableSpannerRepositories points to the META-INF/spanner-named-queries.properties file. +You can specify the query for a method in the properties file by providing the SQL as the value for the "interface.method" property:

+
+
+
+
Trade.fetchByActionNamedQuery=SELECT * FROM trades WHERE trades.action = @tag0
+
+
+
+
+
public interface TradeRepository extends SpannerRepository<Trade, String[]> {
+    // This method uses the query from the properties file instead of one generated based on name.
+    List<Trade> fetchByActionNamedQuery(@Param("tag0") String action);
+}
+
+
+
+
+
+
Query methods with annotation
+
+

Using the @Query annotation:

+
+
+
+
public interface TradeRepository extends SpannerRepository<Trade, String[]> {
+    @Query("SELECT * FROM trades WHERE trades.action = @tag0")
+    List<Trade> fetchByActionNamedQuery(@Param("tag0") String action);
+}
+
+
+
+
+

Table names can be used directly. +For example, "trades" in the above example. +Alternatively, table names can be resolved from the @Table annotation on domain classes as well. +In this case, the query should refer to table names with fully qualified class names between : +characters: :fully.qualified.ClassName:. +A full example would look like:

+
+
+
+
@Query("SELECT * FROM :com.example.Trade: WHERE trades.action = @tag0")
+List<Trade> fetchByActionNamedQuery(String action);
+
+
+
+
+

This allows table names evaluated with SpEL to be used in custom queries.

+
+
+

SpEL can also be used to provide SQL parameters:

+
+
+
+
@Query("SELECT * FROM :com.example.Trade: WHERE trades.action = @tag0
+  AND price > #{#priceRadius * -1} AND price < #{#priceRadius * 2}")
+List<Trade> fetchByActionNamedQuery(String action, Double priceRadius);
+
+
+
+
+

When using the IN SQL clause, remember to use IN UNNEST(@iterableParam) to specify a single Iterable parameter. +You can also use a fixed number of singular parameters such as IN (@stringParam1, @stringParam2).

+
+
+
+
+

13.5.3. Projections

+
+

Spring Data Spanner supports projections. +You can define projection interfaces based on domain types and add query methods that return them in your repository:

+
+
+
+
public interface TradeProjection {
+
+    String getAction();
+
+    @Value("#{target.symbol + ' ' + target.action}")
+    String getSymbolAndAction();
+}
+
+public interface TradeRepository extends SpannerRepository<Trade, Key> {
+
+    List<Trade> findByTraderId(String traderId);
+
+    List<TradeProjection> findByAction(String action);
+
+    @Query("SELECT action, symbol FROM trades WHERE action = @action")
+    List<TradeProjection> findByQuery(String action);
+}
+
+
+
+
+

Projections can be provided by name-convention-based query methods as well as by custom SQL queries. +If using custom SQL queries, you can further restrict the columns retrieved from Spanner to just those required by the projection to improve performance.

+
+
+

Properties of projection types defined using SpEL use the fixed name target for the underlying domain object. +As a result accessing underlying properties take the form target.<property-name>.

+
+
+
+

13.5.4. Empty result handling in repository methods

+
+

Java java.util.Optional can be used to indicate the potential absence of a return value.

+
+
+

Alternatively, query methods can return the result without a wrapper. +In that case the absence of a query result is indicated by returning null. +Repository methods returning collections are guaranteed never to return null but rather the corresponding empty collection.

+
+
+ + + + + +
+ + +You can enable nullability checks. For more details please see Spring Framework’s nullability docs. +
+
+
+
+

13.5.5. REST Repositories

+
+

When running with Spring Boot, repositories can be exposed as REST services by simply adding this dependency to your pom file:

+
+
+
+
<dependency>
+  <groupId>org.springframework.boot</groupId>
+  <artifactId>spring-boot-starter-data-rest</artifactId>
+</dependency>
+
+
+
+

If you prefer to configure parameters (such as path), you can use @RepositoryRestResource annotation:

+
+
+
+
@RepositoryRestResource(collectionResourceRel = "trades", path = "trades")
+public interface TradeRepository extends SpannerRepository<Trade, Key> {
+}
+
+
+
+
+ + + + + +
+ + +For classes that have composite keys (multiple @PrimaryKey fields), only the Key type is supported for the repository ID type. +
+
+
+

For example, you can retrieve all Trade objects in the repository by using curl http://<server>:<port>/trades, or any specific trade via curl http://<server>:<port>/trades/<trader_id>,<trade_id>.

+
+
+

The separator between your primary key components, id and trader_id in this case, is a comma by default, but can be configured to any string not found in your key values by extending the SpannerKeyIdConverter class:

+
+
+
+
@Component
+class MySpecialIdConverter extends SpannerKeyIdConverter {
+
+    @Override
+    protected String getUrlIdSeparator() {
+        return ":";
+    }
+}
+
+
+
+
+

You can also write trades using curl -XPOST -H"Content-Type: application/json" -d@test.json http://<server>:<port>/trades/ where the file test.json holds the JSON representation of a Trade object.

+
+
+
+
+

13.6. Database and Schema Admin

+
+

Databases and tables inside Spanner instances can be created automatically from SpannerPersistentEntity objects:

+
+
+
+
@Autowired
+private SpannerSchemaUtils spannerSchemaUtils;
+
+@Autowired
+private SpannerDatabaseAdminTemplate spannerDatabaseAdminTemplate;
+
+public void createTable(SpannerPersistentEntity entity) {
+    if(!spannerDatabaseAdminTemplate.tableExists(entity.tableName()){
+
+      // The boolean parameter indicates that the database will be created if it does not exist.
+      spannerDatabaseAdminTemplate.executeDdlStrings(Arrays.asList(
+            spannerSchemaUtils.getCreateTableDDLString(entity.getType())), true);
+    }
+}
+
+
+
+
+

Schemas can be generated for entire object hierarchies with interleaved relationships and composite keys.

+
+
+
+

13.7. Events

+
+

Spring Data Cloud Spanner publishes events extending the Spring Framework’s ApplicationEvent to the context that can be received by ApplicationListener beans you register.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionContents

AfterReadEvent

Published immediately after entities are read by key from Cloud Spanner by SpannerTemplate

The entities loaded. The read options and key-set originally specified for the load operation.

AfterQueryEvent

Published immediately after entities are read by query from Cloud Spanner by SpannerTemplate

The entities loaded. The query options and query statement originally specified for the load operation.

BeforeExecuteDmlEvent

Published immediately before DML statements are executed by SpannerTemplate

The DML statement to execute.

AfterExecuteDmlEvent

Published immediately after DML statements are executed by SpannerTemplate

The DML statement to execute and the number of rows affected by the operation as reported by Cloud Spanner.

BeforeSaveEvent

Published immediately before upsert/update/insert operations are executed by SpannerTemplate

The mutations to be sent to Cloud Spanner, the entities to be saved, and optionally the properties in those entities to save.

AfterSaveEvent

Published immediately after upsert/update/insert operations are executed by SpannerTemplate

The mutations sent to Cloud Spanner, the entities to be saved, and optionally the properties in those entities to save.

BeforeDeleteEvent

Published immediately before delete operations are executed by SpannerTemplate

The mutations to be sent to Cloud Spanner. The target entities, keys, or entity type originally specified for the delete operation.

AfterDeleteEvent

Published immediately after delete operations are executed by SpannerTemplate

The mutations sent to Cloud Spanner. The target entities, keys, or entity type originally specified for the delete operation.

+
+
+

13.8. Auditing

+
+

Spring Data Cloud Spanner supports the @LastModifiedDate and @LastModifiedBy auditing annotations for properties:

+
+
+
+
@Table
+public class SimpleEntity {
+    @PrimaryKey
+    String id;
+
+    @LastModifiedBy
+    String lastUser;
+
+    @LastModifiedDate
+    DateTime lastTouched;
+}
+
+
+
+
+

Upon insert, update, or save, these properties will be set automatically by the framework before mutations are generated and saved to Cloud Spanner.

+
+
+

To take advantage of these features, add the @EnableSpannerAuditing annotation to your configuration class and provide a bean for an AuditorAware<A> implementation where the type A is the desired property type annotated by @LastModifiedBy:

+
+
+
+
@Configuration
+@EnableSpannerAuditing
+public class Config {
+
+    @Bean
+    public AuditorAware<String> auditorProvider() {
+        return () -> Optional.of("YOUR_USERNAME_HERE");
+    }
+}
+
+
+
+
+

The AuditorAware interface contains a single method that supplies the value for fields annotated by @LastModifiedBy and can be of any type. +One alternative is to use Spring Security’s User type:

+
+
+
+
class SpringSecurityAuditorAware implements AuditorAware<User> {
+
+  public Optional<User> getCurrentAuditor() {
+
+    return Optional.ofNullable(SecurityContextHolder.getContext())
+              .map(SecurityContext::getAuthentication)
+              .filter(Authentication::isAuthenticated)
+              .map(Authentication::getPrincipal)
+              .map(User.class::cast);
+  }
+}
+
+
+
+
+

You can also set a custom provider for properties annotated @LastModifiedDate by providing a bean for DateTimeProvider and providing the bean name to @EnableSpannerAuditing(dateTimeProviderRef = "customDateTimeProviderBean").

+
+
+
+

13.9. Multi-Instance Usage

+
+

Your application can be configured to use multiple Cloud Spanner instances or databases by providing a custom bean for DatabaseIdProvider. +The default bean uses the instance ID, database name, and project ID options you configured in application.properties.

+
+
+
+
    @Bean
+    public DatabaseIdProvider databaseIdProvider() {
+        // return custom connection options provider
+    }
+
+
+
+
+

The DatabaseId given by this provider is used as the target database name and instance of each operation Spring Data Cloud Spanner executes. +By providing a custom implementation of this bean (for example, supplying a thread-local DatabaseId), you can direct your application to use multiple instances or databases.

+
+
+

Database administrative operations, such as creating tables using SpannerDatabaseAdminTemplate, will also utilize the provided DatabaseId.

+
+
+

If you would like to configure every aspect of each connection (such as pool size and retry settings), you can supply a bean for Supplier<DatabaseClient>.

+
+
+
+

13.10. Spring Boot Actuator Support

+
+

13.10.1. Cloud Spanner Health Indicator

+
+

If you are using Spring Boot Actuator, you can take advantage of the Cloud Spanner health indicator called spanner. +The health indicator will verify whether Cloud Spanner is up and accessible by your application. +To enable it, all you need to do is add the Spring Boot Actuator to your project.

+
+
+

The spanner indicator will then roll up to the overall application status visible at localhost:8080/actuator/health (use the management.endpoint.health.show-details property to view per-indicator details).

+
+
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-actuator</artifactId>
+</dependency>
+
+
+
+ + + + + +
+ + +If your application already has actuator and Cloud Spanner starters, this health indicator is enabled by default. +To disable the Cloud Spanner indicator, set management.health.spanner.enabled to false. +
+
+
+

The health indicator validates the connection to Spanner by executing a query. +A query to validate can be configured via spring.cloud.gcp.spanner.health.query property.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

management.health.spanner.enabled

Whether to enable the Spanner health indicator

No

true with Spring Boot Actuator, false otherwise

spring.cloud.gcp.spanner.health.query

A query to validate

No

SELECT 1

+
+
+
+

13.11. Cloud Spanner Emulator

+
+

The Cloud SDK provides a local, in-memory emulator for Cloud Spanner, which you can use to develop and test your application. As the emulator stores data only in memory, it will not persist data across runs. It is intended to help you use Cloud Spanner for local development and testing, not for production deployments.

+
+
+

In order to set up and start the emulator, you can follow these steps.

+
+
+

This command can be used to create Cloud Spanner instances:

+
+
+
+
$ gcloud spanner instances create <instance-name> --config=emulator-config --description="<description>" --nodes=1
+
+
+
+

Once the Spanner emulator is running, ensure that the following properties are set in your application.properties of your Spring application:

+
+
+
+
spring.cloud.gcp.spanner.emulator.enabled=true
+
+
+
+

Note that the default emulator hostname and port (i.e., localhost:9010) is used. If you prefer a customized value, ensure the following property is set in your application.properties of your Spring application:

+
+
+
+
spring.cloud.gcp.spanner.emulator-host=ip:port
+
+
+
+ +
+

13.13. Test

+
+

Testcontainers provides a gcloud module which offers SpannerEmulatorContainer. See more at the docs

+
+
+
+
+
+

14. Cloud Spanner Spring Data R2DBC

+
+
+

The Spring Data R2DBC Dialect for Cloud Spanner enables the usage of Spring Data R2DBC with Cloud Spanner.

+
+
+

The goal of the Spring Data project is to create easy and consistent ways of using data access technologies from Spring Framework applications.

+
+
+

14.1. Setup

+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
    <dependency>
+        <groupId>com.google.cloud</groupId>
+        <artifactId>spring-cloud-spanner-spring-data-r2dbc</artifactId>
+    </dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-spanner-spring-data-r2dbc")
+}
+
+
+
+
+

14.2. Overview

+
+

Spring Data R2DBC allows you to use the convenient features of Spring Data in a reactive application. +These features include:

+
+
+
    +
  • +

    Spring configuration support using Java based @Configuration classes.

    +
  • +
  • +

    Annotation based mapping metadata.

    +
  • +
  • +

    Automatic implementation of Repository interfaces.

    +
  • +
  • +

    Support for Reactive Transactions.

    +
  • +
  • +

    Schema and data initialization utilities.

    +
  • +
+
+
+

See the Spring Data R2DBC documentation for more information on how to use Spring Data R2DBC.

+
+
+
+

14.3. Sample Application

+
+

We provide a sample application which demonstrates using the Spring Data R2DBC framework with Cloud Spanner in Spring WebFlux.

+
+
+
+
+
+

15. Spring Data Cloud Datastore

+
+
+ + + + + +
+ + +This integration is fully compatible with Firestore in Datastore Mode, but not with Firestore in Native Mode. +
+
+
+

Spring Data is an abstraction for storing and retrieving POJOs in numerous storage technologies. +Spring Framework on Google Cloud adds Spring Data support for Google Cloud Firestore in Datastore mode.

+
+
+

Maven coordinates for this module only, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-data-datastore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-data-datastore")
+}
+
+
+
+

We provide a Spring Boot Starter for Spring Data Datastore, with which you can use our recommended auto-configuration setup. +To use the starter, see the coordinates below.

+
+
+

Maven:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-data-datastore</artifactId>
+</dependency>
+
+
+
+

Gradle:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-data-datastore")
+}
+
+
+
+

This setup takes care of bringing in the latest compatible version of Cloud Java Cloud Datastore libraries as well.

+
+
+

15.1. Configuration

+
+

To setup Spring Data Cloud Datastore, you have to configure the following:

+
+
+
    +
  • +

    Setup the connection details to Google Cloud Datastore.

    +
  • +
+
+
+

15.1.1. Cloud Datastore settings

+
+

You can use the Spring Boot Starter for Spring Data Datastore to autoconfigure Google Cloud Datastore in your Spring application. +It contains all the necessary setup that makes it easy to authenticate with your Google Cloud project. +The following configuration options are available:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.datastore.enabled

Enables the Cloud Datastore client

No

true

spring.cloud.gcp.datastore.project-id

Google Cloud project ID where the Google Cloud Datastore API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.database-id

Google Cloud project can host multiple databases. You can specify which database will be used. If not specified, the database id will be "(default)".

No

spring.cloud.gcp.datastore.credentials.location

OAuth2 credentials for authenticating with the Google Cloud Datastore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Cloud Datastore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.datastore.credentials.scopes

OAuth2 scope for Spring Framework on Google CloudDatastore credentials

No

www.googleapis.com/auth/datastore

spring.cloud.gcp.datastore.namespace

The Cloud Datastore namespace to use

No

the Default namespace of Cloud Datastore in your Google Cloud project

spring.cloud.gcp.datastore.host

The hostname:port of the datastore service or emulator to connect to. Can be used to connect to a manually started Datastore Emulator. If the autoconfigured emulator is enabled, this property will be ignored and localhost:<emulator_port> will be used.

No

spring.cloud.gcp.datastore.emulator.enabled

To enable the auto configuration to start a local instance of the Datastore Emulator.

No

false

spring.cloud.gcp.datastore.emulator.port

The local port to use for the Datastore Emulator

No

8081

spring.cloud.gcp.datastore.emulator.consistency

The consistency to use for the Datastore Emulator instance

No

0.9

spring.cloud.gcp.datastore.emulator.store-on-disk

Configures whether or not the emulator should persist any data to disk.

No

true

spring.cloud.gcp.datastore.emulator.data-dir

The directory to be used to store/retrieve data/config for an emulator run.

No

The default value is <USER_CONFIG_DIR>/emulators/datastore. See the gcloud documentation for finding your USER_CONFIG_DIR.

+
+
+

15.1.2. Repository settings

+
+

Spring Data Repositories can be configured via the @EnableDatastoreRepositories annotation on your main @Configuration class. +With our Spring Boot Starter for Spring Data Cloud Datastore, @EnableDatastoreRepositories is automatically added. +It is not required to add it to any other class, unless there is a need to override finer grain configuration parameters provided by @EnableDatastoreRepositories.

+
+
+
+

15.1.3. Autoconfiguration

+
+

Our Spring Boot autoconfiguration creates the following beans available in the Spring application context:

+
+
+
    +
  • +

    an instance of DatastoreTemplate

    +
  • +
  • +

    an instance of all user defined repositories extending CrudRepository, PagingAndSortingRepository, and DatastoreRepository (an extension of PagingAndSortingRepository with additional Cloud Datastore features) when repositories are enabled

    +
  • +
  • +

    an instance of Datastore from the Google Cloud Java Client for Datastore, for convenience and lower level API access

    +
  • +
+
+
+
+

15.1.4. Datastore Emulator Autoconfiguration

+
+

This Spring Boot autoconfiguration can also configure and start a local Datastore Emulator server if enabled by property.

+
+
+

It is useful for integration testing, but not for production.

+
+
+

When enabled, the spring.cloud.gcp.datastore.host property will be ignored and the Datastore autoconfiguration itself will be forced to connect to the autoconfigured local emulator instance.

+
+
+

It will create an instance of LocalDatastoreHelper as a bean that stores the DatastoreOptions to get the Datastore client connection to the emulator for convenience and lower level API for local access. +The emulator will be properly stopped after the Spring application context shutdown.

+
+
+
+
+

15.2. Object Mapping

+
+

Spring Data Cloud Datastore allows you to map domain POJOs to Cloud Datastore kinds and entities via annotations:

+
+
+
+
@Entity(name = "traders")
+public class Trader {
+
+    @Id
+    @Field(name = "trader_id")
+    String traderId;
+
+    String firstName;
+
+    String lastName;
+
+    @Transient
+    Double temporaryNumber;
+}
+
+
+
+
+

Spring Data Cloud Datastore will ignore any property annotated with @Transient. +These properties will not be written to or read from Cloud Datastore.

+
+
+

15.2.1. Constructors

+
+

Simple constructors are supported on POJOs. +The constructor arguments can be a subset of the persistent properties. +Every constructor argument needs to have the same name and type as a persistent property on the entity and the constructor should set the property from the given argument. +Arguments that are not directly set to properties are not supported.

+
+
+
+
@Entity(name = "traders")
+public class Trader {
+
+    @Id
+    @Field(name = "trader_id")
+    String traderId;
+
+    String firstName;
+
+    String lastName;
+
+    @Transient
+    Double temporaryNumber;
+
+    public Trader(String traderId, String firstName) {
+        this.traderId = traderId;
+        this.firstName = firstName;
+    }
+}
+
+
+
+
+
+

15.2.2. Kind

+
+

The @Entity annotation can provide the name of the Cloud Datastore kind that stores instances of the annotated class, one per row.

+
+
+
+

15.2.3. Keys

+
+

@Id identifies the property corresponding to the ID value.

+
+
+

You must annotate one of your POJO’s fields as the ID value, because every entity in Cloud Datastore requires a single ID value:

+
+
+
+
@Entity(name = "trades")
+public class Trade {
+    @Id
+    @Field(name = "trade_id")
+    String tradeId;
+
+    @Field(name = "trader_id")
+    String traderId;
+
+    String action;
+
+    Double price;
+
+    Double shares;
+
+    String symbol;
+}
+
+
+
+
+

Datastore can automatically allocate integer ID values. +If a POJO instance with a Long ID property is written to Cloud Datastore with null as the ID value, then Spring Data Cloud Datastore will obtain a newly allocated ID value from Cloud Datastore and set that in the POJO for saving. +Because primitive long ID properties cannot be null and default to 0, keys will not be allocated.

+
+
+
+

15.2.4. Fields

+
+

All accessible properties on POJOs are automatically recognized as a Cloud Datastore field. +Field naming is generated by the PropertyNameFieldNamingStrategy by default defined on the DatastoreMappingContext bean. +The @Field annotation optionally provides a different field name than that of the property.

+
+
+
+

15.2.5. Supported Types

+
+

Spring Data Cloud Datastore supports the following types for regular fields and elements of collections:

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeStored as

com.google.cloud.Timestamp

com.google.cloud.datastore.TimestampValue

com.google.cloud.datastore.Blob

com.google.cloud.datastore.BlobValue

com.google.cloud.datastore.LatLng

com.google.cloud.datastore.LatLngValue

java.lang.Boolean, boolean

com.google.cloud.datastore.BooleanValue

java.lang.Double, double

com.google.cloud.datastore.DoubleValue

java.lang.Long, long

com.google.cloud.datastore.LongValue

java.lang.Integer, int

com.google.cloud.datastore.LongValue

java.lang.String

com.google.cloud.datastore.StringValue

com.google.cloud.datastore.Entity

com.google.cloud.datastore.EntityValue

com.google.cloud.datastore.Key

com.google.cloud.datastore.KeyValue

byte[]

com.google.cloud.datastore.BlobValue

Java enum values

com.google.cloud.datastore.StringValue

+
+

In addition, all types that can be converted to the ones listed in the table by +org.springframework.core.convert.support.DefaultConversionService are supported.

+
+
+
+

15.2.6. Custom types

+
+

Custom converters can be used extending the type support for user defined types.

+
+
+
    +
  1. +

    Converters need to implement the org.springframework.core.convert.converter.Converter interface in both directions.

    +
  2. +
  3. +

    The user defined type needs to be mapped to one of the basic types supported by Cloud Datastore.

    +
  4. +
  5. +

    An instance of both Converters (read and write) needs to be passed to the DatastoreCustomConversions constructor, which then has to be made available as a @Bean for DatastoreCustomConversions.

    +
  6. +
+
+
+

For example:

+
+
+

We would like to have a field of type Album on our Singer POJO and want it to be stored as a string property:

+
+
+
+
@Entity
+public class Singer {
+
+    @Id
+    String singerId;
+
+    String name;
+
+    Album album;
+}
+
+
+
+
+

Where Album is a simple class:

+
+
+
+
public class Album {
+    String albumName;
+
+    LocalDate date;
+}
+
+
+
+
+

We have to define the two converters:

+
+
+
+
    // Converter to write custom Album type
+    static final Converter<Album, String> ALBUM_STRING_CONVERTER =
+            new Converter<Album, String>() {
+                @Override
+                public String convert(Album album) {
+                    return album.getAlbumName() + " " + album.getDate().format(DateTimeFormatter.ISO_DATE);
+                }
+            };
+
+    // Converters to read custom Album type
+    static final Converter<String, Album> STRING_ALBUM_CONVERTER =
+            new Converter<String, Album>() {
+                @Override
+                public Album convert(String s) {
+                    String[] parts = s.split(" ");
+                    return new Album(parts[0], LocalDate.parse(parts[parts.length - 1], DateTimeFormatter.ISO_DATE));
+                }
+            };
+
+
+
+
+

That will be configured in our @Configuration file:

+
+
+
+
@Configuration
+public class ConverterConfiguration {
+    @Bean
+    public DatastoreCustomConversions datastoreCustomConversions() {
+        return new DatastoreCustomConversions(
+                Arrays.asList(
+                        ALBUM_STRING_CONVERTER,
+                        STRING_ALBUM_CONVERTER));
+    }
+}
+
+
+
+
+
+

15.2.7. Collections and arrays

+
+

Arrays and collections (types that implement java.util.Collection) of supported types are supported. +They are stored as com.google.cloud.datastore.ListValue. +Elements are converted to Cloud Datastore supported types individually. byte[] is an exception, it is converted to +com.google.cloud.datastore.Blob.

+
+
+
+

15.2.8. Custom Converter for collections

+
+

Users can provide converters from List<?> to the custom collection type. +Only read converter is necessary, the Collection API is used on the write side to convert a collection to the internal list type.

+
+
+

Collection converters need to implement the org.springframework.core.convert.converter.Converter interface.

+
+
+

Example:

+
+
+

Let’s improve the Singer class from the previous example. +Instead of a field of type Album, we would like to have a field of type Set<Album>:

+
+
+
+
@Entity
+public class Singer {
+
+    @Id
+    String singerId;
+
+    String name;
+
+    Set<Album> albums;
+}
+
+
+
+
+

We have to define a read converter only:

+
+
+
+
static final Converter<List<?>, Set<?>> LIST_SET_CONVERTER =
+            new Converter<List<?>, Set<?>>() {
+                @Override
+                public Set<?> convert(List<?> source) {
+                    return Collections.unmodifiableSet(new HashSet<>(source));
+                }
+            };
+
+
+
+
+

And add it to the list of custom converters:

+
+
+
+
@Configuration
+public class ConverterConfiguration {
+    @Bean
+    public DatastoreCustomConversions datastoreCustomConversions() {
+        return new DatastoreCustomConversions(
+                Arrays.asList(
+                        LIST_SET_CONVERTER,
+                        ALBUM_STRING_CONVERTER,
+                        STRING_ALBUM_CONVERTER));
+    }
+}
+
+
+
+
+
+

15.2.9. Inheritance Hierarchies

+
+

Java entity types related by inheritance can be stored in the same Kind. +When reading and querying entities using DatastoreRepository or DatastoreTemplate with a superclass as the type parameter, you can receive instances of subclasses if you annotate the superclass and its subclasses with DiscriminatorField and DiscriminatorValue:

+
+
+
+
@Entity(name = "pets")
+@DiscriminatorField(field = "pet_type")
+abstract class Pet {
+    @Id
+    Long id;
+
+    abstract String speak();
+}
+
+@DiscriminatorValue("cat")
+class Cat extends Pet {
+    @Override
+    String speak() {
+        return "meow";
+    }
+}
+
+@DiscriminatorValue("dog")
+class Dog extends Pet {
+    @Override
+    String speak() {
+        return "woof";
+    }
+}
+
+@DiscriminatorValue("pug")
+class Pug extends Dog {
+    @Override
+    String speak() {
+        return "woof woof";
+    }
+}
+
+
+
+
+

Instances of all 3 types are stored in the pets Kind. +Because a single Kind is used, all classes in the hierarchy must share the same ID property and no two instances of any type in the hierarchy can share the same ID value.

+
+
+

Entity rows in Cloud Datastore store their respective types' DiscriminatorValue in a field specified by the root superclass’s DiscriminatorField (pet_type in this case). +Reads and queries using a given type parameter will match each entity with its specific type. +For example, reading a List<Pet> will produce a list containing instances of all 3 types. +However, reading a List<Dog> will produce a list containing only Dog and Pug instances. +You can include the pet_type discrimination field in your Java entities, but its type must be convertible to a collection or array of String. +Any value set in the discrimination field will be overwritten upon write to Cloud Datastore.

+
+
+
+
+

15.3. Relationships

+
+

There are three ways to represent relationships between entities that are described in this section:

+
+
+
    +
  • +

    Embedded entities stored directly in the field of the containing entity

    +
  • +
  • +

    @Descendant annotated properties for one-to-many relationships

    +
  • +
  • +

    @Reference annotated properties for general relationships without hierarchy

    +
  • +
  • +

    @LazyReference similar to @Reference, but the entities are lazy-loaded when the property is accessed. +(Note that the keys of the children are retrieved when the parent entity is loaded.)

    +
  • +
+
+
+

15.3.1. Embedded Entities

+
+

Fields whose types are also annotated with @Entity are converted to EntityValue and stored inside the parent entity.

+
+
+

Here is an example of Cloud Datastore entity containing an embedded entity in JSON:

+
+
+
+
{
+  "name" : "Alexander",
+  "age" : 47,
+  "child" : {"name" : "Philip"  }
+}
+
+
+
+

This corresponds to a simple pair of Java entities:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity("parents")
+public class Parent {
+  @Id
+  String name;
+
+  Child child;
+}
+
+@Entity
+public class Child {
+  String name;
+}
+
+
+
+
+

Child entities are not stored in their own kind. +They are stored in their entirety in the child field of the parents kind.

+
+
+

Multiple levels of embedded entities are supported.

+
+
+ + + + + +
+ + +Embedded entities don’t need to have @Id field, it is only required for top level entities. +
+
+
+

Example:

+
+
+

Entities can hold embedded entities that are their own type. +We can store trees in Cloud Datastore using this feature:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Embedded;
+import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity
+public class EmbeddableTreeNode {
+  @Id
+  long value;
+
+  EmbeddableTreeNode left;
+
+  EmbeddableTreeNode right;
+
+  Map<String, Long> longValues;
+
+  Map<String, List<Timestamp>> listTimestamps;
+
+  public EmbeddableTreeNode(long value, EmbeddableTreeNode left, EmbeddableTreeNode right) {
+    this.value = value;
+    this.left = left;
+    this.right = right;
+  }
+}
+
+
+
+
+
Maps
+
+

Maps will be stored as embedded entities where the key values become the field names in the embedded entity. +The value types in these maps can be any regularly supported property type, and the key values will be converted to String using the configured converters.

+
+
+

Also, a collection of entities can be embedded; it will be converted to ListValue on write.

+
+
+

Example:

+
+
+

Instead of a binary tree from the previous example, we would like to store a general tree +(each node can have an arbitrary number of children) in Cloud Datastore. +To do that, we need to create a field of type List<EmbeddableTreeNode>:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Embedded;
+import org.springframework.data.annotation.Id;
+
+public class EmbeddableTreeNode {
+  @Id
+  long value;
+
+  List<EmbeddableTreeNode> children;
+
+  Map<String, EmbeddableTreeNode> siblingNodes;
+
+  Map<String, Set<EmbeddableTreeNode>> subNodeGroups;
+
+  public EmbeddableTreeNode(List<EmbeddableTreeNode> children) {
+    this.children = children;
+  }
+}
+
+
+
+
+

Because Maps are stored as entities, they can further hold embedded entities:

+
+
+
    +
  • +

    Singular embedded objects in the value can be stored in the values of embedded Maps.

    +
  • +
  • +

    Collections of embedded objects in the value can also be stored as the values of embedded Maps.

    +
  • +
  • +

    Maps in the value are further stored as embedded entities with the same rules applied recursively for their values.

    +
  • +
+
+
+
+
+

15.3.2. Ancestor-Descendant Relationships

+
+

Parent-child relationships are supported via the @Descendants annotation.

+
+
+

Unlike embedded children, descendants are fully-formed entities residing in their own kinds. +The parent entity does not have an extra field to hold the descendant entities. +Instead, the relationship is captured in the descendants' keys, which refer to their parent entities:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Descendants;
+import com.google.cloud.spring.data.datastore.core.mapping.Entity;
+import org.springframework.data.annotation.Id;
+
+@Entity("orders")
+public class ShoppingOrder {
+  @Id
+  long id;
+
+  @Descendants
+  List<Item> items;
+}
+
+@Entity("purchased_item")
+public class Item {
+  @Id
+  Key purchasedItemKey;
+
+  String name;
+
+  Timestamp timeAddedToOrder;
+}
+
+
+
+
+

For example, an instance of a GQL key-literal representation for Item would also contain the parent ShoppingOrder ID value:

+
+
+
+
Key(orders, '12345', purchased_item, 'eggs')
+
+
+
+

The GQL key-literal representation for the parent ShoppingOrder would be:

+
+
+
+
Key(orders, '12345')
+
+
+
+

The Cloud Datastore entities exist separately in their own kinds.

+
+
+

The ShoppingOrder:

+
+
+
+
{
+  "id" : 12345
+}
+
+
+
+

The two items inside that order:

+
+
+
+
{
+  "purchasedItemKey" : Key(orders, '12345', purchased_item, 'eggs'),
+  "name" : "eggs",
+  "timeAddedToOrder" : "2014-09-27 12:30:00.45-8:00"
+}
+
+{
+  "purchasedItemKey" : Key(orders, '12345', purchased_item, 'sausage'),
+  "name" : "sausage",
+  "timeAddedToOrder" : "2014-09-28 11:30:00.45-9:00"
+}
+
+
+
+

The parent-child relationship structure of objects is stored in Cloud Datastore using Datastore’s ancestor relationships. +Because the relationships are defined by the Ancestor mechanism, there is no extra column needed in either the parent or child entity to store this relationship. +The relationship link is part of the descendant entity’s key value. +These relationships can be many levels deep.

+
+
+

Properties holding child entities must be collection-like, but they can be any of the supported inter-convertible collection-like types that are supported for regular properties such as List, arrays, Set, etc…​ +Child items must have Key as their ID type because Cloud Datastore stores the ancestor relationship link inside the keys of the children.

+
+
+

Reading or saving an entity automatically causes all subsequent levels of children under that entity to be read or saved, respectively. +If a new child is created and added to a property annotated @Descendants and the key property is left null, then a new key will be allocated for that child. +The ordering of the retrieved children may not be the same as the ordering in the original property that was saved.

+
+
+

Child entities cannot be moved from the property of one parent to that of another unless the child’s key property is set to null or a value that contains the new parent as an ancestor. +Since Cloud Datastore entity keys can have multiple parents, it is possible that a child entity appears in the property of multiple parent entities. +Because entity keys are immutable in Cloud Datastore, to change the key of a child you must delete the existing one and re-save it with the new key.

+
+
+
+

15.3.3. Key Reference Relationships

+
+

General relationships can be stored using the @Reference annotation.

+
+
+
+
import org.springframework.data.annotation.Reference;
+import org.springframework.data.annotation.Id;
+
+@Entity
+public class ShoppingOrder {
+  @Id
+  long id;
+
+  @Reference
+  List<Item> items;
+
+  @Reference
+  Item specialSingleItem;
+}
+
+@Entity
+public class Item {
+  @Id
+  Key purchasedItemKey;
+
+  String name;
+
+  Timestamp timeAddedToOrder;
+}
+
+
+
+
+

@Reference relationships are between fully-formed entities residing in their own kinds. +The relationship between ShoppingOrder and Item entities are stored as a Key field inside ShoppingOrder, which are resolved to the underlying Java entity type by Spring Data Cloud Datastore:

+
+
+
+
{
+  "id" : 12345,
+  "specialSingleItem" : Key(item, "milk"),
+  "items" : [ Key(item, "eggs"), Key(item, "sausage") ]
+}
+
+
+
+

Reference properties can either be singular or collection-like. +These properties correspond to actual columns in the entity and Cloud Datastore Kind that hold the key values of the referenced entities. +The referenced entities are full-fledged entities of other Kinds.

+
+
+

Similar to the @Descendants relationships, reading or writing an entity will recursively read or write all of the referenced entities at all levels. +If referenced entities have null ID values, then they will be saved as new entities and will have ID values allocated by Cloud Datastore. +There are no requirements for relationships between the key of an entity and the keys that entity holds as references. +The order of collection-like reference properties is not preserved when reading back from Cloud Datastore.

+
+
+
+
+

15.4. Datastore Operations & Template

+
+

DatastoreOperations and its implementation, DatastoreTemplate, provides the Template pattern familiar to Spring developers.

+
+
+

Using the auto-configuration provided by Spring Boot Starter for Datastore, your Spring application context will contain a fully configured DatastoreTemplate object that you can autowire in your application:

+
+
+
+
@SpringBootApplication
+public class DatastoreTemplateExample {
+
+    @Autowired
+    DatastoreTemplate datastoreTemplate;
+
+    public void doSomething() {
+        this.datastoreTemplate.deleteAll(Trader.class);
+        //...
+        Trader t = new Trader();
+        //...
+        this.datastoreTemplate.save(t);
+        //...
+        List<Trader> traders = datastoreTemplate.findAll(Trader.class);
+        //...
+    }
+}
+
+
+
+
+

The Template API provides convenience methods for:

+
+
+
    +
  • +

    Write operations (saving and deleting)

    +
  • +
  • +

    Read-write transactions

    +
  • +
+
+
+

15.4.1. GQL Query

+
+

In addition to retrieving entities by their IDs, you can also submit queries.

+
+
+
+
  <T> Iterable<T> query(Query<? extends BaseEntity> query, Class<T> entityClass);
+
+  <A, T> Iterable<T> query(Query<A> query, Function<A, T> entityFunc);
+
+  Iterable<Key> queryKeys(Query<Key> query);
+
+
+
+
+

These methods, respectively, allow querying for:

+
+
+
    +
  • +

    entities mapped by a given entity class using all the same mapping and converting features

    +
  • +
  • +

    arbitrary types produced by a given mapping function

    +
  • +
  • +

    only the Cloud Datastore keys of the entities found by the query

    +
  • +
+
+
+
+

15.4.2. Find by ID(s)

+
+

Using DatastoreTemplate you can find entities by id. For example:

+
+
+
+
Trader trader = this.datastoreTemplate.findById("trader1", Trader.class);
+
+List<Trader> traders = this.datastoreTemplate.findAllById(Arrays.asList("trader1", "trader2"), Trader.class);
+
+List<Trader> allTraders = this.datastoreTemplate.findAll(Trader.class);
+
+
+
+
+

Cloud Datastore uses key-based reads with strong consistency, but queries with eventual consistency. +In the example above the first two reads utilize keys, while the third is run by using a query based on the corresponding Kind of Trader.

+
+
+
Indexes
+
+

By default, all fields are indexed. +To disable indexing on a particular field, @Unindexed annotation can be used.

+
+
+

Example:

+
+
+
+
import com.google.cloud.spring.data.datastore.core.mapping.Unindexed;
+
+public class ExampleItem {
+    long indexedField;
+
+    @Unindexed
+    long unindexedField;
+
+    @Unindexed
+    List<String> unindexedListField;
+}
+
+
+
+
+

When using queries directly or via Query Methods, Cloud Datastore requires composite custom indexes if the select statement is not SELECT * or if there is more than one filtering condition in the WHERE clause.

+
+
+
+
Read with offsets, limits, and sorting
+
+

DatastoreRepository and custom-defined entity repositories implement the Spring Data PagingAndSortingRepository, which supports offsets and limits using page numbers and page sizes. +Paging and sorting options are also supported in DatastoreTemplate by supplying a DatastoreQueryOptions to findAll.

+
+
+
+
Partial read
+
+

This feature is not supported yet.

+
+
+
+
+

15.4.3. Write / Update

+
+

The write methods of DatastoreOperations accept a POJO and writes all of its properties to Datastore. +The required Datastore kind and entity metadata is obtained from the given object’s actual type.

+
+
+

If a POJO was retrieved from Datastore and its ID value was changed and then written or updated, the operation will occur as if against a row with the new ID value. +The entity with the original ID value will not be affected.

+
+
+
+
Trader t = new Trader();
+this.datastoreTemplate.save(t);
+
+
+
+
+

The save method behaves as update-or-insert. +In contrast, the insert method will fail if an entity already exists.

+
+
+
Partial Update
+
+

This feature is not supported yet.

+
+
+
+
+

15.4.4. Transactions

+
+

Read and write transactions are provided by DatastoreOperations via the performTransaction method:

+
+
+
+
@Autowired
+DatastoreOperations myDatastoreOperations;
+
+public String doWorkInsideTransaction() {
+  return myDatastoreOperations.performTransaction(
+    transactionDatastoreOperations -> {
+      // Work with transactionDatastoreOperations here.
+      // It is also a DatastoreOperations object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+

The performTransaction method accepts a Function that is provided an instance of a DatastoreOperations object. +The final returned value and type of the function is determined by the user. +You can use this object just as you would a regular DatastoreOperations with an exception:

+
+
+
    +
  • +

    It cannot perform sub-transactions.

    +
  • +
+
+
+

Because of Cloud Datastore’s consistency guarantees, there are limitations to the operations and relationships among entities used inside transactions.

+
+
+
Declarative Transactions with @Transactional Annotation
+
+

This feature requires a bean of DatastoreTransactionManager, which is provided when using spring-cloud-gcp-starter-data-datastore.

+
+
+

DatastoreTemplate and DatastoreRepository support running methods with the @Transactional annotation as transactions. +If a method annotated with @Transactional calls another method also annotated, then both methods will work within the same transaction. +performTransaction cannot be used in @Transactional annotated methods because Cloud Datastore does not support transactions within transactions.

+
+
+

Other Google Cloud database-related integrations like Spanner and Firestore can introduce PlatformTransactionManager beans, and can interfere with Datastore Transaction Manager. To disambiguate, explicitly specify the name of the transaction manager bean for such @Transactional methods. Example:

+
+
+
+
@Transactional(transactionManager = "datastoreTransactionManager")
+
+
+
+
+
+
+

15.4.5. Read-Write Support for Maps

+
+

You can work with Maps of type Map<String, ?> instead of with entity objects by directly reading and writing them to and from Cloud Datastore.

+
+
+ + + + + +
+ + +This is a different situation than using entity objects that contain Map properties. +
+
+
+

The map keys are used as field names for a Datastore entity and map values are converted to Datastore supported types. +Only simple types are supported (i.e. collections are not supported). +Converters for custom value types can be added (see Custom types section).

+
+
+

Example:

+
+
+
+
Map<String, Long> map = new HashMap<>();
+map.put("field1", 1L);
+map.put("field2", 2L);
+map.put("field3", 3L);
+
+keyForMap = datastoreTemplate.createKey("kindName", "id");
+
+// write a map
+datastoreTemplate.writeMap(keyForMap, map);
+
+// read a map
+Map<String, Long> loadedMap = datastoreTemplate.findByIdAsMap(keyForMap, Long.class);
+
+
+
+
+
+
+

15.5. Repositories

+
+

Spring Data Repositories are an abstraction that can reduce boilerplate code.

+
+
+

For example:

+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+}
+
+
+
+
+

Spring Data generates a working implementation of the specified interface, which can be autowired into an application.

+
+
+

The Trader type parameter to DatastoreRepository refers to the underlying domain type. +The second type parameter, String in this case, refers to the type of the key of the domain type.

+
+
+
+
public class MyApplication {
+
+    @Autowired
+    TraderRepository traderRepository;
+
+    public void demo() {
+
+        this.traderRepository.deleteAll();
+        String traderId = "demo_trader";
+        Trader t = new Trader();
+        t.traderId = traderId;
+        this.tradeRepository.save(t);
+
+        Iterable<Trader> allTraders = this.traderRepository.findAll();
+
+        int count = this.traderRepository.count();
+    }
+}
+
+
+
+
+

Repositories allow you to define custom Query Methods (detailed in the following sections) for retrieving, counting, and deleting based on filtering and paging parameters. +Filtering parameters can be of types supported by your configured custom converters.

+
+
+

15.5.1. Query methods by convention

+
+
+
public interface TradeRepository extends DatastoreRepository<Trade, String[]> {
+  List<Trader> findByAction(String action);
+
+  // throws an exception if no results
+  Trader findOneByAction(String action);
+
+  // because of the annotation, returns null if no results
+  @Nullable
+  Trader getByAction(String action);
+
+  Optional<Trader> getOneByAction(String action);
+
+  int countByAction(String action);
+
+  boolean existsByAction(String action);
+
+  List<Trade> findTop3ByActionAndSymbolAndPriceGreaterThanAndPriceLessThanOrEqualOrderBySymbolDesc(
+            String action, String symbol, double priceFloor, double priceCeiling);
+
+  Page<TestEntity> findByAction(String action, Pageable pageable);
+
+  Slice<TestEntity> findBySymbol(String symbol, Pageable pageable);
+
+  List<TestEntity> findBySymbol(String symbol, Sort sort);
+
+  Stream<TestEntity> findBySymbol(String symbol);
+}
+
+
+
+
+

In the example above the query methods in TradeRepository are generated based on the name of the methods using the Spring Data Query creation naming convention.

+
+
+ + + + + +
+ + +You can refer to nested fields using Spring Data JPA Property Expressions +
+
+
+

Cloud Datastore only supports filter components joined by AND, and the following operations:

+
+
+
    +
  • +

    equals

    +
  • +
  • +

    greater than or equals

    +
  • +
  • +

    greater than

    +
  • +
  • +

    less than or equals

    +
  • +
  • +

    less than

    +
  • +
  • +

    is null

    +
  • +
+
+
+

After writing a custom repository interface specifying just the signatures of these methods, implementations are generated for you and can be used with an auto-wired instance of the repository. +Because of Cloud Datastore’s requirement that explicitly selected fields must all appear in a composite index together, find name-based query methods are run as SELECT *.

+
+
+

Delete queries are also supported. +For example, query methods such as deleteByAction or removeByAction delete entities found by findByAction. +Delete queries are run as separate read and delete operations instead of as a single transaction because Cloud Datastore cannot query in transactions unless ancestors for queries are specified. +As a result, removeBy and deleteBy name-convention query methods cannot be used inside transactions via either performInTransaction or @Transactional annotation.

+
+
+

Delete queries can have the following return types:

+
+
+
    +
  • +

    An integer type that is the number of entities deleted

    +
  • +
  • +

    A collection of entities that were deleted

    +
  • +
  • +

    'void'

    +
  • +
+
+
+

Methods can have org.springframework.data.domain.Pageable parameter to control pagination and sorting, or org.springframework.data.domain.Sort parameter to control sorting only. +See Spring Data documentation for details.

+
+
+

For returning multiple items in a repository method, we support Java collections as well as org.springframework.data.domain.Page and org.springframework.data.domain.Slice. +If a method’s return type is org.springframework.data.domain.Page, the returned object will include current page, total number of results and total number of pages.

+
+
+ + + + + +
+ + +Methods that return Page run an additional query to compute total number of pages. +Methods that return Slice, on the other hand, do not run any additional queries and, therefore, are much more efficient. +
+
+
+
+

15.5.2. Empty result handling in repository methods

+
+

Java java.util.Optional can be used to indicate the potential absence of a return value.

+
+
+

Alternatively, query methods can return the result without a wrapper. +In that case the absence of a query result is indicated by returning null. +Repository methods returning collections are guaranteed never to return null but rather the corresponding empty collection.

+
+
+ + + + + +
+ + +You can enable nullability checks. For more details please see Spring Framework’s nullability docs. +
+
+
+
+

15.5.3. Query by example

+
+

Query by Example is an alternative querying technique. +It enables dynamic query generation based on a user-provided object. See Spring Data Documentation for details.

+
+
+
Unsupported features:
+
+
    +
  1. +

    Currently, only equality queries are supported (no ignore-case matching, regexp matching, etc.).

    +
  2. +
  3. +

    Per-field matchers are not supported.

    +
  4. +
  5. +

    Embedded entities matching is not supported.

    +
  6. +
  7. +

    Projection is not supported.

    +
  8. +
+
+
+

For example, if you want to find all users with the last name "Smith", you would use the following code:

+
+
+
+
userRepository.findAll(
+    Example.of(new User(null, null, "Smith"))
+
+
+
+
+

null fields are not used in the filter by default. If you want to include them, you would use the following code:

+
+
+
+
userRepository.findAll(
+    Example.of(new User(null, null, "Smith"), ExampleMatcher.matching().withIncludeNullValues())
+
+
+
+
+

You can also extend query specification initially defined by an example in FluentQuery’s chaining style:

+
+
+
+
userRepository.findBy(
+    Example.of(new User(null, null, "Smith")), q -> q.sortBy(Sort.by("firstName")).firstValue());
+
+userRepository.findBy(
+    Example.of(new User(null, null, "Smith")), FetchableFluentQuery::stream);
+
+
+
+
+
+

15.5.4. Custom GQL query methods

+
+

Custom GQL queries can be mapped to repository methods in one of two ways:

+
+
+
    +
  • +

    namedQueries properties file

    +
  • +
  • +

    using the @Query annotation

    +
  • +
+
+
+
Query methods with annotation
+
+

Using the @Query annotation:

+
+
+

The names of the tags of the GQL correspond to the @Param annotated names of the method parameters.

+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  List<Trader> tradersByName(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Stream<Trader> tradersStreamByName(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM  test_entities_ci WHERE name = @trader_name")
+  TestEntity getOneTestEntity(@Param("trader_name") String traderName);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  List<Trader> tradersByNameSort(@Param("trader_name") String traderName, Sort sort);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Slice<Trader> tradersByNameSlice(@Param("trader_name") String traderName, Pageable pageable);
+
+  @Query("SELECT * FROM traders WHERE name = @trader_name")
+  Page<Trader> tradersByNamePage(@Param("trader_name") String traderName, Pageable pageable);
+}
+
+
+
+
+

When the return type is Slice or Pageable, the result set cursor that points to the position just after the page is preserved in the returned Slice or Page object. To take advantage of the cursor to query for the next page or slice, use result.getPageable().next().

+
+
+ + + + + +
+ + +Page requires the total count of entities produced by the query. Therefore, the first query will have to retrieve all of the records just to count them. Instead, we recommend using the Slice return type, because it does not require an additional count query. +
+
+
+
+
 Slice<Trader> slice1 = tradersByNamePage("Dave", PageRequest.of(0, 5));
+ Slice<Trader> slice2 = tradersByNamePage("Dave", slice1.getPageable().next());
+
+
+
+
+ + + + + +
+ + +You cannot use these Query Methods in repositories where the type parameter is a subclass of another class +annotated with DiscriminatorField. +
+
+
+

The following parameter types are supported:

+
+
+
    +
  • +

    com.google.cloud.Timestamp

    +
  • +
  • +

    com.google.cloud.datastore.Blob

    +
  • +
  • +

    com.google.cloud.datastore.Key

    +
  • +
  • +

    com.google.cloud.datastore.Cursor

    +
  • +
  • +

    java.lang.Boolean

    +
  • +
  • +

    java.lang.Double

    +
  • +
  • +

    java.lang.Long

    +
  • +
  • +

    java.lang.String

    +
  • +
  • +

    enum values. +These are queried as String values.

    +
  • +
+
+
+

With the exception of Cursor, array forms of each of the types are also supported.

+
+
+

If you would like to obtain the count of items of a query or if there are any items returned by the query, set the count = true or exists = true properties of the @Query annotation, respectively. +The return type of the query method in these cases should be an integer type or a boolean type.

+
+
+

Cloud Datastore provides provides the SELECT __key__ FROM …​ special column for all kinds that retrieves the Key of each row. +Selecting this special __key__ column is especially useful and efficient for count and exists queries.

+
+
+

You can also query for non-entity types:

+
+
+
+
@Query(value = "SELECT __key__ from test_entities_ci")
+List<Key> getKeys();
+
+@Query(value = "SELECT __key__ from test_entities_ci limit 1")
+Key getKey();
+
+
+
+
+

In order to use @Id annotated fields in custom queries, use __key__ keyword for the field name. The parameter type should be of Key, as in the following example.

+
+
+

Repository method:

+
+
+
+
@Query("select * from  test_entities_ci where size = @size and __key__ = @id")
+LinkedList<TestEntity> findEntities(@Param("size") long size, @Param("id") Key id);
+
+
+
+
+

Generate a key from id value using DatastoreTemplate.createKey method and use it as a parameter for the repository method:

+
+
+
+
this.testEntityRepository.findEntities(1L, datastoreTemplate.createKey(TestEntity.class, 1L))
+
+
+
+
+

SpEL can be used to provide GQL parameters:

+
+
+
+
@Query("SELECT * FROM |com.example.Trade| WHERE trades.action = @act
+  AND price > :#{#priceRadius * -1} AND price < :#{#priceRadius * 2}")
+List<Trade> fetchByActionNamedQuery(@Param("act") String action, @Param("priceRadius") Double r);
+
+
+
+
+

Kind names can be directly written in the GQL annotations. +Kind names can also be resolved from the @Entity annotation on domain classes.

+
+
+

In this case, the query should refer to table names with fully qualified class names surrounded by | characters: |fully.qualified.ClassName|. +This is useful when SpEL expressions appear in the kind name provided to the @Entity annotation. +For example:

+
+
+
+
@Query("SELECT * FROM |com.example.Trade| WHERE trades.action = @act")
+List<Trade> fetchByActionNamedQuery(@Param("act") String action);
+
+
+
+
+
+
Query methods with named queries properties
+
+

You can also specify queries with Cloud Datastore parameter tags and SpEL expressions in properties files.

+
+
+

By default, the namedQueriesLocation attribute on @EnableDatastoreRepositories points to the META-INF/datastore-named-queries.properties file. +You can specify the query for a method in the properties file by providing the GQL as the value for the "interface.method" property:

+
+
+ + + + + +
+ + +You cannot use these Query Methods in repositories where the type parameter is a subclass of another class +annotated with DiscriminatorField. +
+
+
+
+
Trader.fetchByName=SELECT * FROM traders WHERE name = @tag0
+
+
+
+
+
public interface TraderRepository extends DatastoreRepository<Trader, String> {
+
+    // This method uses the query from the properties file instead of one generated based on name.
+    List<Trader> fetchByName(@Param("tag0") String traderName);
+
+}
+
+
+
+
+
+
+

15.5.5. Transactions

+
+

These transactions work very similarly to those of DatastoreOperations, but is specific to the repository’s domain type and provides repository functions instead of template functions.

+
+
+

For example, this is a read-write transaction:

+
+
+
+
@Autowired
+DatastoreRepository myRepo;
+
+public String doWorkInsideTransaction() {
+  return myRepo.performTransaction(
+    transactionDatastoreRepo -> {
+      // Work with the single-transaction transactionDatastoreRepo here.
+      // This is a DatastoreRepository object.
+
+      return "transaction completed";
+    }
+  );
+}
+
+
+
+
+
+

15.5.6. Projections

+
+

Spring Data Cloud Datastore supports projections. +You can define projection interfaces based on domain types and add query methods that return them in your repository:

+
+
+
+
public interface TradeProjection {
+
+    String getAction();
+
+    @Value("#{target.symbol + ' ' + target.action}")
+    String getSymbolAndAction();
+}
+
+public interface TradeRepository extends DatastoreRepository<Trade, Key> {
+
+    List<Trade> findByTraderId(String traderId);
+
+    List<TradeProjection> findByAction(String action);
+
+    @Query("SELECT action, symbol FROM trades WHERE action = @action")
+    List<TradeProjection> findByQuery(String action);
+}
+
+
+
+
+

Projections can be provided by name-convention-based query methods as well as by custom GQL queries. +If using custom GQL queries, you can further restrict the fields retrieved from Cloud Datastore to just those required by the projection. +However, custom select statements (those not using SELECT *) require composite indexes containing the selected fields.

+
+
+

Properties of projection types defined using SpEL use the fixed name target for the underlying domain object. +As a result, accessing underlying properties take the form target.<property-name>.

+
+
+
+

15.5.7. REST Repositories

+
+

When running with Spring Boot, repositories can be exposed as REST services by simply adding this dependency to your pom file:

+
+
+
+
<dependency>
+  <groupId>org.springframework.boot</groupId>
+  <artifactId>spring-boot-starter-data-rest</artifactId>
+</dependency>
+
+
+
+

If you prefer to configure parameters (such as path), you can use @RepositoryRestResource annotation:

+
+
+
+
@RepositoryRestResource(collectionResourceRel = "trades", path = "trades")
+public interface TradeRepository extends DatastoreRepository<Trade, String[]> {
+}
+
+
+
+
+

For example, you can retrieve all Trade objects in the repository by using curl http://<server>:<port>/trades, or any specific trade via curl http://<server>:<port>/trades/<trader_id>.

+
+
+

You can also write trades using curl -XPOST -H"Content-Type: application/json" -d@test.json http://<server>:<port>/trades/ where the file test.json holds the JSON representation of a Trade object.

+
+
+

To delete trades, you can use curl -XDELETE http://<server>:<port>/trades/<trader_id>

+
+
+
+
+

15.6. Events

+
+

Spring Data Cloud Datastore publishes events extending the Spring Framework’s ApplicationEvent to the context that can be received by ApplicationListener beans you register.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionContents

AfterFindByKeyEvent

Published immediately after read by-key operations are run by DatastoreTemplate

The entities read from Cloud Datastore and the original keys in the request.

AfterQueryEvent

Published immediately after read byquery operations are run by DatastoreTemplate

The entities read from Cloud Datastore and the original query in the request.

BeforeSaveEvent

Published immediately before save operations are run by DatastoreTemplate

The entities to be sent to Cloud Datastore and the original Java objects being saved.

AfterSaveEvent

Published immediately after save operations are run by DatastoreTemplate

The entities sent to Cloud Datastore and the original Java objects being saved.

BeforeDeleteEvent

Published immediately before delete operations are run by DatastoreTemplate

The keys to be sent to Cloud Datastore. The target entities, ID values, or entity type originally specified for the delete operation.

AfterDeleteEvent

Published immediately after delete operations are run by DatastoreTemplate

The keys sent to Cloud Datastore. The target entities, ID values, or entity type originally specified for the delete operation.

+
+
+

15.7. Auditing

+
+

Spring Data Cloud Datastore supports the @LastModifiedDate and @LastModifiedBy auditing annotations for properties:

+
+
+
+
@Entity
+public class SimpleEntity {
+    @Id
+    String id;
+
+    @LastModifiedBy
+    String lastUser;
+
+    @LastModifiedDate
+    DateTime lastTouched;
+}
+
+
+
+
+

Upon insert, update, or save, these properties will be set automatically by the framework before Datastore entities are generated and saved to Cloud Datastore.

+
+
+

To take advantage of these features, add the @EnableDatastoreAuditing annotation to your configuration class and provide a bean for an AuditorAware<A> implementation where the type A is the desired property type annotated by @LastModifiedBy:

+
+
+
+
@Configuration
+@EnableDatastoreAuditing
+public class Config {
+
+    @Bean
+    public AuditorAware<String> auditorProvider() {
+        return () -> Optional.of("YOUR_USERNAME_HERE");
+    }
+}
+
+
+
+
+

The AuditorAware interface contains a single method that supplies the value for fields annotated by @LastModifiedBy and can be of any type. +One alternative is to use Spring Security’s User type:

+
+
+
+
class SpringSecurityAuditorAware implements AuditorAware<User> {
+
+  public Optional<User> getCurrentAuditor() {
+
+    return Optional.ofNullable(SecurityContextHolder.getContext())
+              .map(SecurityContext::getAuthentication)
+              .filter(Authentication::isAuthenticated)
+              .map(Authentication::getPrincipal)
+              .map(User.class::cast);
+  }
+}
+
+
+
+
+

You can also set a custom provider for properties annotated @LastModifiedDate by providing a bean for DateTimeProvider and providing the bean name to @EnableDatastoreAuditing(dateTimeProviderRef = "customDateTimeProviderBean").

+
+
+
+

15.8. Partitioning Data by Namespace

+
+

You can partition your data by using more than one namespace. +This is the recommended method for multi-tenancy in Cloud Datastore.

+
+
+
+
    @Bean
+    public DatastoreNamespaceProvider namespaceProvider() {
+        // return custom Supplier of a namespace string.
+    }
+
+
+
+
+

The DatastoreNamespaceProvider is a synonym for Supplier<String>. +By providing a custom implementation of this bean (for example, supplying a thread-local namespace name), you can direct your application to use multiple namespaces. +Every read, write, query, and transaction you perform will utilize the namespace provided by this supplier.

+
+
+

Note that your provided namespace in application.properties will be ignored if you define a namespace provider bean.

+
+
+
+

15.9. Spring Boot Actuator Support

+
+

15.9.1. Cloud Datastore Health Indicator

+
+

If you are using Spring Boot Actuator, you can take advantage of the Cloud Datastore health indicator called datastore. +The health indicator will verify whether Cloud Datastore is up and accessible by your application. +To enable it, all you need to do is add the Spring Boot Actuator to your project.

+
+
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-actuator</artifactId>
+</dependency>
+
+
+
+
+
+

15.10. Sample

+
+

A Simple Spring Boot Application and more advanced Sample Spring Boot Application are provided to show how to use the Spring Data Cloud Datastore starter and template.

+
+
+
+

15.11. Test

+
+

Testcontainers provides a gcloud module which offers DatastoreEmulatorContainer. See more at the docs

+
+
+
+
+
+

16. Spring Data Cloud Firestore

+
+
+ + + + + +
+ + +Currently some features are not supported: query by example, projections, and auditing. +
+
+
+

Spring Data is an abstraction for storing and retrieving POJOs in numerous storage technologies. +Spring Framework on Google Cloud adds Spring Data Reactive Repositories support for Google Cloud Firestore in native mode, providing reactive template and repositories support. +To begin using this library, add the spring-cloud-gcp-data-firestore artifact to your project.

+
+
+

Maven coordinates for this module only, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-data-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-data-firestore")
+}
+
+
+
+

We provide a Spring Boot Starter for Spring Data Firestore, with which you can use our recommended auto-configuration setup. To use the starter, see the coordinates below.

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-data-firestore")
+}
+
+
+
+

16.1. Configuration

+
+

16.1.1. Properties

+
+

The Spring Boot starter for Google Cloud Firestore provides the following configuration options:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.firestore.enabled

Enables or disables Firestore auto-configuration

No

true

spring.cloud.gcp.firestore.project-id

Google Cloud project ID where the Google Cloud Firestore API is hosted, if different from the one in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.database-id

Google Cloud project can host multiple databases. You can specify which database will be used. If not specified, the database id will be "(default)".

No

spring.cloud.gcp.firestore.emulator.enabled

Enables the usage of an emulator. If this is set to true, then you should set the spring.cloud.gcp.firestore.host-port to the host:port of your locally running emulator instance

No

false

spring.cloud.gcp.firestore.host-port

The host and port of the Firestore service; can be overridden to specify connecting to an already-running Firestore emulator instance.

No

firestore.googleapis.com:443 (the host/port of official Firestore service)

spring.cloud.gcp.firestore.credentials.location

OAuth2 credentials for authenticating with the Google Cloud Firestore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Cloud Firestore API, if different from the ones in the Spring Framework on Google Cloud Core Module

No

spring.cloud.gcp.firestore.credentials.scopes

OAuth2 scope for Spring Framework on Google CloudFirestore credentials

No

www.googleapis.com/auth/datastore

+
+
+

16.1.2. Supported types

+
+

You may use the following field types when defining your persistent entities or when binding query parameters:

+
+
+
    +
  • +

    Long

    +
  • +
  • +

    Integer

    +
  • +
  • +

    Double

    +
  • +
  • +

    Float

    +
  • +
  • +

    String

    +
  • +
  • +

    Boolean

    +
  • +
  • +

    Character

    +
  • +
  • +

    Date

    +
  • +
  • +

    Map

    +
  • +
  • +

    List

    +
  • +
  • +

    Enum

    +
  • +
  • +

    com.google.cloud.Timestamp

    +
  • +
  • +

    com.google.cloud.firestore.GeoPoint

    +
  • +
  • +

    com.google.cloud.firestore.Blob

    +
  • +
+
+
+
+

16.1.3. Reactive Repository settings

+
+

Spring Data Repositories can be configured via the @EnableReactiveFirestoreRepositories annotation on your main @Configuration class. +With our Spring Boot Starter for Spring Data Cloud Firestore, @EnableReactiveFirestoreRepositories is automatically added. +It is not required to add it to any other class, unless there is a need to override finer grain configuration parameters provided by @EnableReactiveFirestoreRepositories.

+
+
+
+

16.1.4. Autoconfiguration

+
+

Our Spring Boot autoconfiguration creates the following beans available in the Spring application context:

+
+
+
    +
  • +

    an instance of FirestoreTemplate

    +
  • +
  • +

    instances of all user defined repositories extending FirestoreReactiveRepository (an extension of ReactiveCrudRepository with additional Cloud Firestore features) when repositories are enabled

    +
  • +
  • +

    an instance of Firestore from the Google Cloud Java Client for Firestore, for convenience and lower level API access

    +
  • +
+
+
+
+
+

16.2. Object Mapping

+
+

Spring Data Cloud Firestore allows you to map domain POJOs to Cloud Firestore collections and documents via annotations:

+
+
+
+
import com.google.cloud.firestore.annotation.DocumentId;
+import com.google.cloud.spring.data.firestore.Document;
+
+@Document(collectionName = "usersCollection")
+public class User {
+  /** Used to test @PropertyName annotation on a field. */
+  @PropertyName("drink")
+  public String favoriteDrink;
+
+  @DocumentId private String name;
+
+  private Integer age;
+
+  public User() {}
+
+  public String getName() {
+    return this.name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Integer getAge() {
+    return this.age;
+  }
+
+  public void setAge(Integer age) {
+    this.age = age;
+  }
+}
+
+
+
+
+

@Document(collectionName = "usersCollection") annotation configures the collection name for the documents of this type. +This annotation is optional, by default the collection name is derived from the class name.

+
+
+

@DocumentId annotation marks a field to be used as document id. +This annotation is required and the annotated field can only be of String type.

+
+
+ + + + + +
+ + +If the property annotated with @DocumentId is null the document id is generated automatically when the entity is saved. +
+
+
+ + + + + +
+ + +Internally we use Firestore client library object mapping. See the documentation for supported annotations. +
+
+
+

16.2.1. Embedded entities and lists

+
+

Spring Data Cloud Firestore supports embedded properties of custom types and lists. +Given a custom POJO definition, you can have properties of this type or lists of this type in your entities. +They are stored as embedded documents (or arrays, correspondingly) in the Cloud Firestore.

+
+
+

Example:

+
+
+
+
@Document(collectionName = "usersCollection")
+public class User {
+  /** Used to test @PropertyName annotation on a field. */
+  @PropertyName("drink")
+  public String favoriteDrink;
+
+  @DocumentId private String name;
+
+  private Integer age;
+
+  private List<String> pets;
+
+  private List<Address> addresses;
+
+  private Address homeAddress;
+
+  public List<String> getPets() {
+    return this.pets;
+  }
+
+  public void setPets(List<String> pets) {
+    this.pets = pets;
+  }
+
+  public List<Address> getAddresses() {
+    return this.addresses;
+  }
+
+  public void setAddresses(List<Address> addresses) {
+    this.addresses = addresses;
+  }
+
+  public Timestamp getUpdateTime() {
+    return updateTime;
+  }
+
+  public void setUpdateTime(Timestamp updateTime) {
+    this.updateTime = updateTime;
+  }
+
+  @PropertyName("address")
+  public Address getHomeAddress() {
+    return this.homeAddress;
+  }
+
+  @PropertyName("address")
+  public void setHomeAddress(Address homeAddress) {
+    this.homeAddress = homeAddress;
+  }
+  public static class Address {
+    String streetAddress;
+    String country;
+
+    public Address() {}
+  }
+}
+
+
+
+
+
+
+

16.3. Reactive Repositories

+
+

Spring Data Repositories is an abstraction that can reduce boilerplate code.

+
+
+

For example:

+
+
+
+
public interface UserRepository extends FirestoreReactiveRepository<User> {
+  Flux<User> findBy(Pageable pageable);
+
+  Flux<User> findByAge(Integer age);
+
+  Flux<User> findByAge(Integer age, Sort sort);
+
+  Flux<User> findByAgeOrderByNameDesc(Integer age);
+
+  Flux<User> findAllByOrderByAge();
+
+  Flux<User> findByAgeNot(Integer age);
+
+  Flux<User> findByNameAndAge(String name, Integer age);
+
+  Flux<User> findByHomeAddressCountry(String country);
+
+  Flux<User> findByFavoriteDrink(String drink);
+
+  Flux<User> findByAgeGreaterThanAndAgeLessThan(Integer age1, Integer age2);
+
+  Flux<User> findByAgeGreaterThan(Integer age);
+
+  Flux<User> findByAgeGreaterThan(Integer age, Sort sort);
+
+  Flux<User> findByAgeGreaterThan(Integer age, Pageable pageable);
+
+  Flux<User> findByAgeIn(List<Integer> ages);
+
+  Flux<User> findByAgeNotIn(List<Integer> ages);
+
+  Flux<User> findByAgeAndPetsContains(Integer age, List<String> pets);
+
+  Flux<User> findByNameAndPetsContains(String name, List<String> pets);
+
+  Flux<User> findByPetsContains(List<String> pets);
+
+  Flux<User> findByPetsContainsAndAgeIn(String pets, List<Integer> ages);
+
+  Mono<Long> countByAgeIsGreaterThan(Integer age);
+}
+
+
+
+
+

Spring Data generates a working implementation of the specified interface, which can be autowired into an application.

+
+
+

The User type parameter to FirestoreReactiveRepository refers to the underlying domain type.

+
+
+ + + + + +
+ + +You can refer to nested fields using Spring Data JPA Property Expressions +
+
+
+
+
public class MyApplication {
+
+  @Autowired UserRepository userRepository;
+
+  void writeReadDeleteTest() {
+    List<User.Address> addresses =
+        Arrays.asList(
+            new User.Address("123 Alice st", "US"), new User.Address("1 Alice ave", "US"));
+    User.Address homeAddress = new User.Address("10 Alice blvd", "UK");
+    User alice = new User("Alice", 29, null, addresses, homeAddress);
+    User bob = new User("Bob", 60);
+
+    this.userRepository.save(alice).block();
+    this.userRepository.save(bob).block();
+
+    assertThat(this.userRepository.count().block()).isEqualTo(2);
+    assertThat(this.userRepository.findAll().map(User::getName).collectList().block())
+        .containsExactlyInAnyOrder("Alice", "Bob");
+
+    User aliceLoaded = this.userRepository.findById("Alice").block();
+    assertThat(aliceLoaded.getAddresses()).isEqualTo(addresses);
+    assertThat(aliceLoaded.getHomeAddress()).isEqualTo(homeAddress);
+
+    // cast to SimpleFirestoreReactiveRepository for method be reachable with Spring Boot 2.4
+    SimpleFirestoreReactiveRepository repository =
+        AopTestUtils.getTargetObject(this.userRepository);
+    StepVerifier.create(
+            repository
+                .deleteAllById(Arrays.asList("Alice", "Bob"))
+                .then(this.userRepository.count()))
+        .expectNext(0L)
+        .verifyComplete();
+  }
+}
+
+
+
+
+

Repositories allow you to define custom Query Methods (detailed in the following sections) for retrieving and counting based on filtering and paging parameters.

+
+
+ + + + + +
+ + +Custom queries with @Query annotation are not supported since there is no query language in Cloud Firestore +
+
+
+
+

16.4. Firestore Operations & Template

+
+

FirestoreOperations and its implementation, FirestoreTemplate, provides the Template pattern familiar to Spring developers.

+
+
+

Using the auto-configuration provided by Spring Data Cloud Firestore, your Spring application context will contain a fully configured FirestoreTemplate object that you can autowire in your application:

+
+
+
+
@SpringBootApplication
+public class FirestoreTemplateExample {
+
+    @Autowired
+    FirestoreOperations firestoreOperations;
+
+    public Mono<User> createUsers() {
+        return this.firestoreOperations.save(new User("Alice", 29))
+            .then(this.firestoreOperations.save(new User("Bob", 60)));
+    }
+
+    public Flux<User> findUsers() {
+        return this.firestoreOperations.findAll(User.class);
+    }
+
+    public Mono<Long> removeAllUsers() {
+        return this.firestoreOperations.deleteAll(User.class);
+    }
+}
+
+
+
+
+

The Template API provides support for:

+
+
+ +
+
+
+

16.5. Query methods by convention

+
+
+
public class MyApplication {
+  void partTreeRepositoryMethodTest() {
+    User u1 = new User("Cloud", 22, null, null, new Address("1 First st., NYC", "USA"));
+    u1.favoriteDrink = "tea";
+    User u2 =
+        new User(
+            "Squall",
+            17,
+            Arrays.asList("cat", "dog"),
+            null,
+            new Address("2 Second st., London", "UK"));
+    u2.favoriteDrink = "wine";
+    Flux<User> users = Flux.fromArray(new User[] {u1, u2});
+
+    this.userRepository.saveAll(users).blockLast();
+
+    assertThat(this.userRepository.count().block()).isEqualTo(2);
+    assertThat(this.userRepository.findBy(PageRequest.of(0, 10)).collectList().block())
+        .containsExactly(u1, u2);
+    assertThat(this.userRepository.findByAge(22).collectList().block()).containsExactly(u1);
+    assertThat(this.userRepository.findByAgeNot(22).collectList().block()).containsExactly(u2);
+    assertThat(this.userRepository.findByHomeAddressCountry("USA").collectList().block())
+        .containsExactly(u1);
+    assertThat(this.userRepository.findByFavoriteDrink("wine").collectList().block())
+        .containsExactly(u2);
+    assertThat(this.userRepository.findByAgeGreaterThanAndAgeLessThan(20, 30).collectList().block())
+        .containsExactly(u1);
+    assertThat(this.userRepository.findByAgeGreaterThan(10).collectList().block())
+        .containsExactlyInAnyOrder(u1, u2);
+    assertThat(this.userRepository.findByNameAndAge("Cloud", 22).collectList().block())
+        .containsExactly(u1);
+    assertThat(
+            this.userRepository
+                .findByNameAndPetsContains("Squall", Collections.singletonList("cat"))
+                .collectList()
+                .block())
+        .containsExactly(u2);
+  }
+}
+
+
+
+
+

In the example above the query method implementations in UserRepository are generated based on the name of the methods using the Spring Data Query creation naming convention.

+
+
+

Cloud Firestore only supports filter components joined by AND, and the following operations:

+
+
+
    +
  • +

    equals

    +
  • +
  • +

    is not equal

    +
  • +
  • +

    greater than or equals

    +
  • +
  • +

    greater than

    +
  • +
  • +

    less than or equals

    +
  • +
  • +

    less than

    +
  • +
  • +

    is null

    +
  • +
  • +

    contains (accepts a List with up to 10 elements, or a singular value)

    +
  • +
  • +

    in (accepts a List with up to 10 elements)

    +
  • +
  • +

    not in (accepts a List with up to 10 elements)

    +
  • +
+
+
+ + + + + +
+ + +If in operation is used in combination with contains operation, the argument to contains operation has to be a singular value. +
+
+
+

After writing a custom repository interface specifying just the signatures of these methods, implementations are generated for you and can be used with an auto-wired instance of the repository.

+
+
+
+

16.6. Transactions

+
+

Read-only and read-write transactions are provided by TransactionalOperator (see this blog post on reactive transactions for details). +In order to use it, you would need to autowire ReactiveFirestoreTransactionManager like this:

+
+
+
+
public class MyApplication {
+  @Autowired ReactiveFirestoreTransactionManager txManager;
+}
+
+
+
+
+

After that you will be able to use it to create an instance of TransactionalOperator. +Note that you can switch between read-only and read-write transactions using TransactionDefinition object:

+
+
+
+
DefaultTransactionDefinition transactionDefinition = new DefaultTransactionDefinition();
+transactionDefinition.setReadOnly(false);
+TransactionalOperator operator =
+    TransactionalOperator.create(this.txManager, transactionDefinition);
+
+
+
+
+

When you have an instance of TransactionalOperator, you can invoke a sequence of Firestore operations in a transaction by using operator::transactional:

+
+
+
+
User alice = new User("Alice", 29);
+User bob = new User("Bob", 60);
+
+this.userRepository
+    .save(alice)
+    .then(this.userRepository.save(bob))
+    .as(operator::transactional)
+    .block();
+
+this.userRepository
+    .findAll()
+    .flatMap(
+        a -> {
+          a.setAge(a.getAge() - 1);
+          return this.userRepository.save(a);
+        })
+    .as(operator::transactional)
+    .collectList()
+    .block();
+
+assertThat(this.userRepository.findAll().map(User::getAge).collectList().block())
+    .containsExactlyInAnyOrder(28, 59);
+
+
+
+
+ + + + + +
+ + +Read operations in a transaction can only happen before write operations. +All write operations are applied atomically. +Read documents are locked until the transaction finishes with a commit or a rollback, which are handled by Spring Data. +If an Exception is thrown within a transaction, the rollback operation is performed. +Otherwise, the commit operation is performed. +
+
+
+

16.6.1. Declarative Transactions with @Transactional Annotation

+
+

This feature requires a bean of SpannerTransactionManager, which is provided when using spring-cloud-gcp-starter-data-firestore.

+
+
+

FirestoreTemplate and FirestoreReactiveRepository support running methods with the @Transactional annotation as transactions. +If a method annotated with @Transactional calls another method also annotated, then both methods will work within the same transaction.

+
+
+

One way to use this feature is illustrated here. You would need to do the following:

+
+
+
    +
  1. +

    Annotate your configuration class with the @EnableTransactionManagement annotation.

    +
  2. +
  3. +

    Create a service class that has methods annotated with @Transactional:

    +
  4. +
+
+
+
+
public class UserService {
+  @Autowired private UserRepository userRepository;
+
+  @Transactional
+  public Mono<Void> updateUsers() {
+    return this.userRepository
+        .findAll()
+        .flatMap(
+            a -> {
+              a.setAge(a.getAge() - 1);
+              return this.userRepository.save(a);
+            })
+        .then();
+  }
+}
+
+
+
+
+
    +
  1. +

    Make a Spring Bean provider that creates an instance of that class:

    +
  2. +
+
+
+
+
@Bean
+public UserService userService() {
+  return new UserService();
+}
+
+
+
+
+

After that, you can autowire your service like so:

+
+
+
+
public class MyApplication {
+  @Autowired UserService userService;
+}
+
+
+
+
+

Now when you call the methods annotated with @Transactional on your service object, a transaction will be automatically started. +If an error occurs during the execution of a method annotated with @Transactional, the transaction will be rolled back. +If no error occurs, the transaction will be committed.

+
+
+
+
+

16.7. Subcollections

+
+

A subcollection is a collection associated with a specific entity. +Documents in subcollections can contain subcollections as well, allowing you to further nest data. You can nest data up to 100 levels deep.

+
+
+ + + + + +
+ + +Deleting a document does not delete its subcollections! +
+
+
+

To use subcollections you will need to create a FirestoreReactiveOperations object with a parent entity using FirestoreReactiveOperations.withParent call. +You can use this object to save, query and remove entities associated with this parent. +The parent doesn’t have to exist in Firestore, but should have a non-empty id field.

+
+
+

Autowire FirestoreReactiveOperations:

+
+
+
+
@Autowired
+FirestoreReactiveOperations firestoreTemplate;
+
+
+
+
+

Then you can use this object to create a FirestoreReactiveOperations object with a custom parent:

+
+
+
+
FirestoreReactiveOperations bobTemplate =
+    this.firestoreTemplate.withParent(new User("Bob", 60));
+
+PhoneNumber phoneNumber = new PhoneNumber("111-222-333");
+bobTemplate.save(phoneNumber).block();
+assertThat(bobTemplate.findAll(PhoneNumber.class).collectList().block())
+    .containsExactly(phoneNumber);
+bobTemplate.deleteAll(PhoneNumber.class).block();
+assertThat(bobTemplate.findAll(PhoneNumber.class).collectList().block()).isEmpty();
+
+
+
+
+
+

16.8. Update Time and Optimistic Locking

+
+

Firestore stores update time for every document. +If you would like to retrieve it, you can add a field of com.google.cloud.Timestamp type to your entity and annotate it with @UpdateTime annotation.

+
+
+
+
@UpdateTime
+Timestamp updateTime;
+
+
+
+
+
Using update time for optimistic locking
+
+

A field annotated with @UpdateTime can be used for optimistic locking. +To enable that, you need to set version parameter to true:

+
+
+
+
@UpdateTime(version = true)
+Timestamp updateTime;
+
+
+
+
+

When you enable optimistic locking, a precondition will be automatically added to the write request to ensure that the document you are updating was not changed since your last read. +It uses this field’s value as a document version and checks that the version of the document you write is the same as the one you’ve read.

+
+
+

If the field is empty, a precondition would check that the document with the same id does not exist to ensure you don’t overwrite existing documents unintentionally.

+
+
+
+
+

16.9. Cloud Firestore Spring Boot Starter

+
+

If you prefer using Firestore client only, Spring Framework on Google Cloud provides a convenience starter which automatically configures authentication settings and client objects needed to begin using Google Cloud Firestore in native mode.

+
+
+

See documentation to learn more about Cloud Firestore.

+
+
+

To begin using this library, add the spring-cloud-gcp-starter-firestore artifact to your project.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-firestore</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-firestore")
+}
+
+
+
+

16.9.1. Using Cloud Firestore

+
+

The starter automatically configures and registers a Firestore bean in the Spring application context. To start using it, simply use the @Autowired annotation.

+
+
+
+
@Autowired
+Firestore firestore;
+
+ void writeDocumentFromObject() throws ExecutionException, InterruptedException {
+   // Add document data with id "joe" using a custom User class
+   User data =
+       new User(
+           "Joe",
+           Arrays.asList(new Phone(12345, PhoneType.CELL), new Phone(54321, PhoneType.WORK)));
+
+   // .get() blocks on response
+   WriteResult writeResult = this.firestore.document("users/joe").set(data).get();
+
+   LOGGER.info("Update time: " + writeResult.getUpdateTime());
+ }
+
+ User readDocumentToObject() throws ExecutionException, InterruptedException {
+   ApiFuture<DocumentSnapshot> documentFuture = this.firestore.document("users/joe").get();
+
+   User user = documentFuture.get().toObject(User.class);
+
+   LOGGER.info("read: " + user);
+
+   return user;
+ }
+
+
+
+
+
+
+

16.10. Emulator Usage

+
+

The Google Cloud Firebase SDK provides a local, in-memory emulator for Cloud Firestore, which you can use to develop and test your application.

+
+
+

First follow the Firebase emulator installation steps to install, configure, and run the emulator.

+
+
+ + + + + +
+ + +By default, the emulator is configured to run on port 8080; you will need to ensure that the emulator does not run on the same port as your Spring application. +
+
+
+

Once the Firestore emulator is running, ensure that the following properties are set in your application.properties of your Spring application:

+
+
+
+
spring.cloud.gcp.firestore.emulator.enabled=true
+spring.cloud.gcp.firestore.host-port=${EMULATOR_HOSTPORT}
+
+
+
+

From this point onward, your application will connect to your locally running emulator instance instead of the real Firestore service.

+
+
+
+

16.11. Samples

+
+

Spring Framework on Google Cloud provides Firestore sample applications to demonstrate API usage:

+
+ +
+
+

16.12. Test

+
+

Testcontainers provides a gcloud module which offers FirestoreEmulatorContainer. See more at the docs

+
+
+
+
+
+

17. Cloud Memorystore for Redis

+
+
+

Cloud Memorystore for Redis provides a fully managed in-memory data store service. +Cloud Memorystore for Redis is compatible with the Redis protocol, allowing both programmatic access to the data store as well as easy integration with Spring caching.

+
+
+

Cloud Memorystore for Redis documentation can be found here. +Use this documentation to create a Cloud Memorystore for Redis instance for your application.

+
+
+ + + + + +
+ + +
+

Cloud Memorystore instances and your application instances have to be located in the same region.

+
+
+
+
+

17.1. Spring Data Redis

+
+

Because Cloud Memorystore is compatible with Redis, your application can use Spring Data Redis to connect to a Cloud Memorystore instance.

+
+
+

Add the Spring Boot Data Redis starter for a blocking I/O application:

+
+
+
pom.xml
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-data-redis</artifactId>
+</dependency>
+
+
+
+

Or use the reactive starter for a reactive application:

+
+
+
pom.xml
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
+</dependency>
+
+
+
+

Refer to Memorystore guides for instructions to find the address of your Cloud Memorystore instance in the Google Cloud Console, or via the gcloud command.

+
+
+

Configure the host and port of the Cloud Memorystore instance like this:

+
+
+
src/main/resources/application.properties
+
+
spring.data.redis.host: <cloud_memorystore_host> (1)
+spring.data.redis.port: <cloud_memorystore_port> (2)
+
+
+
+ + + + + + + + + +
1Replace <cloud_memorystore_host> with the actual IP address of the Memorystore instance.
2Replace <cloud_memorystore_post> with the actual port of the Memorystore instance.
+
+
+

(Read more about these configuration properties in the Spring Boot documentation.)

+
+
+

17.1.1. Authentication

+
+

If you’ve enabled authentication for the Cloud Memorystore instance, you will need to provide the auth string via the spring.data.redis.password configuration property. +You can find the auth string for your instance following this guide.

+
+
+

Remember to never commit plain-text secrets in your configuration properties file, so use an alternative method to provide this value to the application during startup. +You can for instance load it from Secret Manager, use a Kubernetes secret, or provide it to your application via an environment variable.

+
+
+
+

17.1.2. In-transit encryption

+
+

If you’ve enabled in-transit encryption for the Cloud Memorystore instance, you will need to configure the server CA certificate file via an SSL bundle. +Follow guide in this page to download the certificate server-ca.pem file. +You can include this file in your project as a resource file, e.g. src/main/resources/redis/server-ca.pem.

+
+
+

Configure an SSL bundle to use the server-ca.pem file:

+
+
+
src/main/resources/application.properties
+
+
spring.data.redis.ssl.bundle: cloud-memorystore
+spring.ssl.bundle.pem.cloud-memorystore.truststore.certificate: classpath:redis/server-ca.pem (1)
+
+
+
+ + + + + +
1You can replace this location with a local file path if you don’t want to add this file to your application’s classpath, e.g. file:/path/to/server-ca.pem. +It is also possible to put the contents of the server-ca.pem file here directly.
+
+
+

Spring Boot automatically enables encrypted access, when an SSL bundle is configured.

+
+
+

See the Spring Boot SSL documentation for more information about SSL bundles.

+
+
+
+

17.1.3. Programmatic access

+
+

See connecting to Redis in the Spring Boot documentation for ways to programmatically interact with Cloud Memorystore.

+
+
+
+
+

17.2. Spring Caching

+
+

Optionally, Cloud Memorystore can be used as a (Redis) backend for Spring caching by adding this starter dependency (in addition to the Spring Data Redis starter):

+
+
+
pom.xml
+
+
<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-cache</artifactId>
+</dependency>
+
+
+
+

Add the @EnableCaching annotation on your @SpringBootApplication class, or one of its @Configuration classes to enable caching support.

+
+
+

This lets you use the org.springframework.cache.annotation.Cacheable annotation for methods you’d like to be cached.

+
+
+
+
@Cacheable("cache1")
+public String hello(@PathVariable String name) {
+    ....
+}
+
+
+
+
+

See the Redis cache provider documentation for information about configuring cache names, time-to-live, etc.

+
+
+

If you are interested in a detailed how-to guide, please check Spring Boot Caching using Cloud Memorystore codelab.

+
+
+
+
+
+

18. BigQuery

+
+
+

Google Cloud BigQuery is a fully managed, petabyte scale, low cost analytics data warehouse.

+
+
+

Spring Framework on Google Cloud provides:

+
+
+
    +
  • +

    A convenience starter which provides autoconfiguration for the BigQuery client objects with credentials needed to interface with BigQuery.

    +
  • +
  • +

    A Spring Integration message handler for loading data into BigQuery tables in your Spring integration pipelines.

    +
  • +
+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-bigquery</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-bigquery")
+}
+
+
+
+

18.1. Configuration

+
+

The following application properties may be configured with Spring Framework on Google Cloud BigQuery libraries.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.bigquery.datasetName

The BigQuery dataset that the BigQueryTemplate and BigQueryFileMessageHandler is scoped to.

Yes

spring.cloud.gcp.bigquery.enabled

Enables or disables Spring Framework on Google Cloud BigQuery autoconfiguration.

No

true

spring.cloud.gcp.bigquery.project-id

Google Cloud project ID of the project using BigQuery APIs, if different from the one in the Spring Framework on Google Cloud Core Module.

No

Project ID is typically inferred from gcloud configuration.

spring.cloud.gcp.bigquery.credentials.location

Credentials file location for authenticating with the Google Cloud BigQuery APIs, if different from the ones in the Spring Framework on Google Cloud Core Module

No

Inferred from Application Default Credentials, typically set by gcloud.

spring.cloud.gcp.bigquery.jsonWriterBatchSize

Batch size which will be used by BigQueryJsonDataWriter while using BigQuery Storage Write API. Note too large or too low values might impact performance.

No

1000

spring.cloud.gcp.bigquery.threadPoolSize

The size of thread pool of ThreadPoolTaskScheduler which is used by BigQueryTemplate

No

4

+
+

18.1.1. BigQuery Client Object

+
+

The GcpBigQueryAutoConfiguration class configures an instance of BigQuery for you by inferring your credentials and Project ID from the machine’s environment.

+
+
+

Example usage:

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQuery bigquery;
+
+public void runQuery() throws InterruptedException {
+  String query = "SELECT column FROM table;";
+  QueryJobConfiguration queryConfig =
+      QueryJobConfiguration.newBuilder(query).build();
+
+  // Run the query using the BigQuery object
+  for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) {
+    for (FieldValue val : row) {
+      System.out.println(val);
+    }
+  }
+}
+
+
+
+
+

This object is used to interface with all BigQuery services. +For more information, see the BigQuery Client Library usage examples.

+
+
+
+

18.1.2. BigQueryTemplate

+
+

The BigQueryTemplate class is a wrapper over the BigQuery client object and makes it easier to load data into BigQuery tables. +A BigQueryTemplate is scoped to a single dataset. +The autoconfigured BigQueryTemplate instance will use the dataset provided through the property spring.cloud.gcp.bigquery.datasetName.

+
+
+

Below is a code snippet of how to load a CSV data InputStream to a BigQuery table.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+public void loadData(InputStream dataInputStream, String tableName) {
+  CompletableFuture<Job> bigQueryJobFuture =
+      bigQueryTemplate.writeDataToTable(
+          tableName,
+          dataFile.getInputStream(),
+          FormatOptions.csv());
+
+  // After the future is complete, the data is successfully loaded.
+  Job job = bigQueryJobFuture.get();
+}
+
+
+
+
+

Below is a code snippet of how to load a newline-delimited JSON data InputStream to a BigQuery table. This implementation uses the BigQuery Storage Write API. +Here is a sample newline-delimited JSON file which can be used for testing this functionality.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+  /**
+   * This method loads the InputStream of the newline-delimited JSON records to be written in the given table.
+   * @param tableName name of the table where the data is expected to be written
+   * @param jsonInputStream InputStream of the newline-delimited JSON records to be written in the given table
+   */
+  public void loadJsonStream(String tableName, InputStream jsonInputStream)
+      throws ExecutionException, InterruptedException {
+    CompletableFuture<WriteApiResponse> writeApFuture =
+        bigQueryTemplate.writeJsonStream(tableName, jsonInputStream);
+    WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
+    if (!apiRes.isSuccessful()){
+      List<StorageError> errors = apiRes.getErrors();
+      // TODO(developer): process the List of StorageError
+    }
+    // else the write process has been successful
+  }
+
+
+
+
+

Below is a code snippet of how to create table and then load a newline-delimited JSON data InputStream to a BigQuery table. This implementation uses the BigQuery Storage Write API. +Here is a sample newline-delimited JSON file which can be used for testing this functionality.

+
+
+
+
// BigQuery client object provided by our autoconfiguration.
+@Autowired
+BigQueryTemplate bigQueryTemplate;
+
+  /**
+   * This method created a table with the given name and schema and then loads the InputStream of the newline-delimited JSON records in it.
+   * @param tableName name of the table where the data is expected to be written
+   * @param jsonInputStream InputStream of the newline-delimited JSON records to be written in the given table
+   * @param tableSchema Schema of the table which is required to be created
+   */
+  public void createTableAndloadJsonStream(String tableName, InputStream jsonInputStream, Schema tableSchema)
+      throws ExecutionException, InterruptedException {
+    CompletableFuture<WriteApiResponse> writeApFuture =
+        bigQueryTemplate.writeJsonStream(tableName, jsonInputStream, tableSchema);//using the overloaded method which created the table when tableSchema is passed
+    WriteApiResponse apiRes = writeApFuture.get();//get the WriteApiResponse
+    if (!apiRes.isSuccessful()){
+      List<StorageError> errors = apiRes.getErrors();
+      // TODO(developer): process the List of StorageError
+    }
+    // else the write process has been successful
+  }
+
+
+
+
+
+
+

18.2. Spring Integration

+
+

Spring Framework on Google Cloud BigQuery also provides a Spring Integration message handler BigQueryFileMessageHandler. +This is useful for incorporating BigQuery data loading operations in a Spring Integration pipeline.

+
+
+

Below is an example configuring a ServiceActivator bean using the BigQueryFileMessageHandler.

+
+
+
+
@Bean
+public DirectChannel bigQueryWriteDataChannel() {
+  return new DirectChannel();
+}
+
+@Bean
+public DirectChannel bigQueryJobReplyChannel() {
+  return new DirectChannel();
+}
+
+@Bean
+@ServiceActivator(inputChannel = "bigQueryWriteDataChannel")
+public MessageHandler messageSender(BigQueryTemplate bigQueryTemplate) {
+  BigQueryFileMessageHandler messageHandler = new BigQueryFileMessageHandler(bigQueryTemplate);
+  messageHandler.setFormatOptions(FormatOptions.csv());
+  messageHandler.setOutputChannel(bigQueryJobReplyChannel());
+  return messageHandler;
+}
+
+
+
+
+

18.2.1. BigQuery Message Handling

+
+

The BigQueryFileMessageHandler accepts the following message payload types for loading into BigQuery: java.io.File, byte[], org.springframework.core.io.Resource, and java.io.InputStream. +The message payload will be streamed and written to the BigQuery table you specify.

+
+
+

By default, the BigQueryFileMessageHandler is configured to read the headers of the messages it receives to determine how to load the data. +The headers are specified by the class BigQuerySpringMessageHeaders and summarized below.

+
+ ++++ + + + + + + + + + + + + + + +

Header

Description

BigQuerySpringMessageHeaders.TABLE_NAME

Specifies the BigQuery table within your dataset to write to.

BigQuerySpringMessageHeaders.FORMAT_OPTIONS

Describes the data format of your data to load (i.e. CSV, JSON, etc.).

+
+

Alternatively, you may omit these headers and explicitly set the table name or format options by calling setTableName(…​) and setFormatOptions(…​).

+
+
+
+

18.2.2. BigQuery Message Reply

+
+

After the BigQueryFileMessageHandler processes a message to load data to your BigQuery table, it will respond with a Job on the reply channel. +The Job object provides metadata and information about the load file operation.

+
+
+

By default, the BigQueryFileMessageHandler is run in asynchronous mode, with setSync(false), and it will reply with a CompletableFuture<Job> on the reply channel. +The future is tied to the status of the data loading job and will complete when the job completes.

+
+
+

If the handler is run in synchronous mode with setSync(true), then the handler will block on the completion of the loading job and block until it is complete.

+
+
+ + + + + +
+ + +If you decide to use Spring Integration Gateways and you wish to receive CompletableFuture<Job> as a reply object in the Gateway, you will have to call .setAsyncExecutor(null) on your GatewayProxyFactoryBean. +This is needed to indicate that you wish to reply on the built-in async support rather than rely on async handling of the gateway. +
+
+
+
+
+

18.3. Sample

+
+

A BigQuery sample application is available.

+
+
+
+
+
+

19. Cloud IAP

+
+
+

Cloud Identity-Aware Proxy (IAP) provides a security layer over applications deployed to Google Cloud.

+
+
+

The IAP starter uses Spring Security OAuth 2.0 Resource Server functionality to automatically extract user identity from the proxy-injected x-goog-iap-jwt-assertion HTTP header.

+
+
+

The following claims are validated automatically:

+
+
+
    +
  • +

    Issue time

    +
  • +
  • +

    Expiration time

    +
  • +
  • +

    Issuer

    +
  • +
  • +

    Audience

    +
  • +
+
+
+

The audience ("aud" claim) validation string is automatically determined when the application is running on App Engine Standard or App Engine Flexible. +This functionality relies on Cloud Resource Manager API to retrieve project details, so the following setup is needed:

+
+
+
    +
  • +

    Enable Cloud Resource Manager API in Google Cloud Console.

    +
  • +
  • +

    Make sure your application has resourcemanager.projects.get permission.

    +
  • +
+
+
+

App Engine automatic audience determination can be overridden by using spring.cloud.gcp.security.iap.audience property. It supports multiple allowable audiences by providing a comma-delimited list.

+
+
+

For Compute Engine or Kubernetes Engine spring.cloud.gcp.security.iap.audience property must be provided, as the audience string depends on the specific Backend Services setup and cannot be inferred automatically. +To determine the audience value, follow directions in IAP Verify the JWT payload guide. +If spring.cloud.gcp.security.iap.audience is not provided, the application will fail to start the following message:

+
+
+
+
No qualifying bean of type 'com.google.cloud.spring.security.iap.AudienceProvider' available.
+
+
+
+ + + + + +
+ + +If you create a custom WebSecurityConfigurerAdapter, enable extracting user identity by adding .oauth2ResourceServer().jwt() configuration to the HttpSecurity object. + If no custom WebSecurityConfigurerAdapter is present, nothing needs to be done because Spring Boot will add this customization by default. +
+
+
+

Starter Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-security-iap</artifactId>
+</dependency>
+
+
+
+

Starter Gradle coordinates:

+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-security-iap")
+}
+
+
+
+

19.1. Configuration

+
+

The following properties are available.

+
+
+ + + + + +
+ + +Modifying registry, algorithm, and header properties might be useful for testing, but the defaults should not be changed in production. +
+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionRequiredDefault

spring.cloud.gcp.security.iap.registry

Link to JWK public key registry.

true

www.gstatic.com/iap/verify/public_key-jwk

spring.cloud.gcp.security.iap.algorithm

Encryption algorithm used to sign the JWK token.

true

ES256

spring.cloud.gcp.security.iap.header

Header from which to extract the JWK key.

true

x-goog-iap-jwt-assertion

spring.cloud.gcp.security.iap.issuer

JWK issuer to verify.

true

cloud.google.com/iap

spring.cloud.gcp.security.iap.audience

Custom JWK audience to verify.

false on App Engine; true on GCE/GKE

+
+
+

19.2. Sample

+
+

A sample application is available.

+
+
+
+
+
+

20. Cloud Vision

+
+
+

The Google Cloud Vision API allows users to leverage machine learning algorithms for processing images and documents including: image classification, face detection, text extraction, optical character recognition, and others.

+
+
+

Spring Framework on Google Cloud provides:

+
+
+
    +
  • +

    A convenience starter which automatically configures authentication settings and client objects needed to begin using the Google Cloud Vision API.

    +
  • +
  • +

    CloudVisionTemplate which simplifies interactions with the Cloud Vision API.

    +
    +
      +
    • +

      Allows you to easily send images, PDF, TIFF and GIF documents to the API as Spring Resources.

      +
    • +
    • +

      Offers convenience methods for common operations, such as classifying content of an image.

      +
    • +
    +
    +
  • +
  • +

    DocumentOcrTemplate which offers convenient methods for running optical character recognition (OCR) on PDF and TIFF documents.

    +
  • +
+
+
+

20.1. Dependency Setup

+
+

To begin using this library, add the spring-cloud-gcp-starter-vision artifact to your project.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-vision</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-vision")
+}
+
+
+
+
+

20.2. Configuration

+
+

The following options may be configured with Spring Framework on Google Cloud Vision libraries.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.vision.enabled

Enables or disables Cloud Vision autoconfiguration

No

true

spring.cloud.gcp.vision.executors-threads-count

Number of threads used during document OCR processing for waiting on long-running OCR operations

No

1

spring.cloud.gcp.vision.json-output-batch-size

Number of document pages to include in each OCR output file.

No

20

+
+

20.2.1. Cloud Vision OCR Dependencies

+
+

If you are interested in applying optical character recognition (OCR) on documents for your project, you’ll need to add both spring-cloud-gcp-starter-vision and spring-cloud-gcp-starter-storage to your dependencies. +The storage starter is necessary because the Cloud Vision API will process your documents and write OCR output files all within your Google Cloud Storage buckets.

+
+
+

Maven coordinates using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-vision</artifactId>
+</dependency>
+<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-storage</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-vision")
+  implementation("com.google.cloud:spring-cloud-gcp-starter-storage")
+}
+
+
+
+
+
+

20.3. Image Analysis

+
+

The CloudVisionTemplate allows you to easily analyze images; it provides the following method for interfacing with Cloud Vision:

+
+
+

public AnnotateImageResponse analyzeImage(Resource imageResource, Feature.Type…​ featureTypes)

+
+
+

Parameters:

+
+
+
    +
  • +

    Resource imageResource refers to the Spring Resource of the image object you wish to analyze. +The Google Cloud Vision documentation provides a list of the image types that they support.

    +
  • +
  • +

    Feature.Type…​ featureTypes refers to a var-arg array of Cloud Vision Features to extract from the image. +A feature refers to a kind of image analysis one wishes to perform on an image, such as label detection, OCR recognition, facial detection, etc. +One may specify multiple features to analyze within one request. +A full list of Cloud Vision Features is provided in the Cloud Vision Feature docs.

    +
  • +
+
+
+

Returns:

+
+
+
    +
  • +

    AnnotateImageResponse contains the results of all the feature analyses that were specified in the request. +For each feature type that you provide in the request, AnnotateImageResponse provides a getter method to get the result of that feature analysis. +For example, if you analyzed an image using the LABEL_DETECTION feature, you would retrieve the results from the response using annotateImageResponse.getLabelAnnotationsList().

    +
    +

    AnnotateImageResponse is provided by the Google Cloud Vision libraries; please consult the RPC reference or Javadoc for more details. +Additionally, you may consult the Cloud Vision docs to familiarize yourself with the concepts and features of the API.

    +
    +
  • +
+
+
+

20.3.1. Detect Image Labels Example

+
+

Image labeling refers to producing labels that describe the contents of an image. +Below is a code sample of how this is done using the Cloud Vision Spring Template.

+
+
+
+
@Autowired
+private ResourceLoader resourceLoader;
+
+@Autowired
+private CloudVisionTemplate cloudVisionTemplate;
+
+public void processImage() {
+  Resource imageResource = this.resourceLoader.getResource("my_image.jpg");
+  AnnotateImageResponse response = this.cloudVisionTemplate.analyzeImage(
+      imageResource, Type.LABEL_DETECTION);
+  System.out.println("Image Classification results: " + response.getLabelAnnotationsList());
+}
+
+
+
+
+
+
+

20.4. File Analysis

+
+

The CloudVisionTemplate allows you to easily analyze PDF, TIFF and GIF documents; it provides the following method for interfacing with Cloud Vision:

+
+
+

public AnnotateFileResponse analyzeFile(Resource fileResource, String mimeType, Feature.Type…​ featureTypes)

+
+
+

Parameters:

+
+
+
    +
  • +

    Resource fileResource refers to the Spring Resource of the PDF, TIFF or GIF object you wish to analyze. +Documents with more than 5 pages are not supported.

    +
  • +
  • +

    String mimeType is the mime type of the fileResource. +Currently, only application/pdf, image/tiff and image/gif are supported.

    +
  • +
  • +

    Feature.Type…​ featureTypes refers to a var-arg array of Cloud Vision Features to extract from the document. +A feature refers to a kind of image analysis one wishes to perform on a document, such as label detection, OCR recognition, facial detection, etc. +One may specify multiple features to analyze within one request. +A full list of Cloud Vision Features is provided in the Cloud Vision Feature docs.

    +
  • +
+
+
+

Returns:

+
+
+
    +
  • +

    AnnotateFileResponse contains the results of all the feature analyses that were specified in the request. +For each page of the analysed document the response will contain an AnnotateImageResponse object which you can retrieve using annotateFileResponse.getResponsesList(). +For each feature type that you provide in the request, AnnotateImageResponse provides a getter method to get the result of that feature analysis. +For example, if you analysed an PDF using the DOCUMENT_TEXT_DETECTION feature, you would retrieve the results from the response using annotateImageResponse.getFullTextAnnotation().getText().

    +
    +

    AnnotateFileResponse is provided by the Google Cloud Vision libraries; please consult the RPC reference or Javadoc for more details. +Additionally, you may consult the Cloud Vision docs to familiarize yourself with the concepts and features of the API.

    +
    +
  • +
+
+
+

20.4.1. Running Text Detection Example

+
+

Detect text in files refers to extracting text from small document such as PDF or TIFF. +Below is a code sample of how this is done using the Cloud Vision Spring Template.

+
+
+
+
@Autowired
+private ResourceLoader resourceLoader;
+
+@Autowired
+private CloudVisionTemplate cloudVisionTemplate;
+
+public void processPdf() {
+  Resource imageResource = this.resourceLoader.getResource("my_file.pdf");
+  AnnotateFileResponse response =
+    this.cloudVisionTemplate.analyzeFile(
+        imageResource, "application/pdf", Type.DOCUMENT_TEXT_DETECTION);
+
+  response
+    .getResponsesList()
+    .forEach(
+        annotateImageResponse ->
+            System.out.println(annotateImageResponse.getFullTextAnnotation().getText()));
+}
+
+
+
+
+
+
+

20.5. Document OCR Template

+
+

The DocumentOcrTemplate allows you to easily run optical character recognition (OCR) on your PDF and TIFF documents stored in your Google Storage bucket.

+
+
+

First, you will need to create a bucket in Google Cloud Storage and upload the documents you wish to process into the bucket.

+
+
+

20.5.1. Running OCR on a Document

+
+

When OCR is run on a document, the Cloud Vision APIs will output a collection of OCR output files in JSON which describe the text content, bounding rectangles of words and letters, and other information about the document.

+
+
+

The DocumentOcrTemplate provides the following method for running OCR on a document saved in Google Cloud Storage:

+
+
+

CompletableFuture<DocumentOcrResultSet> runOcrForDocument(GoogleStorageLocation document, GoogleStorageLocation outputFilePathPrefix)

+
+
+

The method allows you to specify the location of the document and the output location for where all the JSON output files will be saved in Google Cloud Storage. +It returns a CompletableFuture containing DocumentOcrResultSet which contains the OCR content of the document.

+
+
+ + + + + +
+ + +Running OCR on a document is an operation that can take between several minutes to several hours depending on how large the document is. +It is recommended to register callbacks to the returned CompletableFuture or ignore it and process the JSON output files at a later point in time using readOcrOutputFile or readOcrOutputFileSet. +
+
+
+
+

20.5.2. Running OCR Example

+
+

Below is a code snippet of how to run OCR on a document stored in a Google Storage bucket and read the text in the first page of the document.

+
+
+
+
@Autowired
+private DocumentOcrTemplate documentOcrTemplate;
+
+public void runOcrOnDocument() {
+    GoogleStorageLocation document = GoogleStorageLocation.forFile(
+            "your-bucket", "test.pdf");
+    GoogleStorageLocation outputLocationPrefix = GoogleStorageLocation.forFolder(
+            "your-bucket", "output_folder/test.pdf/");
+
+    CompletableFuture<DocumentOcrResultSet> result =
+        this.documentOcrTemplate.runOcrForDocument(
+            document, outputLocationPrefix);
+
+    DocumentOcrResultSet ocrPages = result.get(5, TimeUnit.MINUTES);
+
+    String page1Text = ocrPages.getPage(1).getText();
+    System.out.println(page1Text);
+}
+
+
+
+
+

20.5.3. Reading OCR Output Files

+
+

In some use-cases, you may need to directly read OCR output files stored in Google Cloud Storage.

+
+
+

DocumentOcrTemplate offers the following methods for reading and processing OCR output files:

+
+
+
    +
  • +

    readOcrOutputFileSet(GoogleStorageLocation jsonOutputFilePathPrefix): +Reads a collection of OCR output files under a file path prefix and returns the parsed contents. +All the files under the path should correspond to the same document.

    +
  • +
  • +

    readOcrOutputFile(GoogleStorageLocation jsonFile): +Reads a single OCR output file and returns the parsed contents.

    +
  • +
+
+
+
+

20.5.4. Reading OCR Output Files Example

+
+

The code snippet below describes how to read the OCR output files of a single document.

+
+
+
+
@Autowired
+private DocumentOcrTemplate documentOcrTemplate;
+
+// Parses the OCR output files corresponding to a single document in a directory
+public void parseOutputFileSet() {
+  GoogleStorageLocation ocrOutputPrefix = GoogleStorageLocation.forFolder(
+      "your-bucket", "json_output_set/");
+
+  DocumentOcrResultSet result = this.documentOcrTemplate.readOcrOutputFileSet(ocrOutputPrefix);
+  System.out.println("Page 2 text: " + result.getPage(2).getText());
+}
+
+// Parses a single OCR output file
+public void parseSingleOutputFile() {
+  GoogleStorageLocation ocrOutputFile = GoogleStorageLocation.forFile(
+      "your-bucket", "json_output_set/test_output-2-to-2.json");
+
+  DocumentOcrResultSet result = this.documentOcrTemplate.readOcrOutputFile(ocrOutputFile);
+  System.out.println("Page 2 text: " + result.getPage(2).getText());
+}
+
+
+
+
+
+

20.6. Sample

+
+

Samples are provided to show example usages of Spring Framework on Google Cloud with Google Cloud Vision.

+
+
+
    +
  • +

    The Image Labeling Sample shows you how to use image labelling in your Spring application. +The application generates labels describing the content inside the images you specify in the application.

    +
  • +
  • +

    The Document OCR demo shows how you can apply OCR processing on your PDF/TIFF documents in order to extract their text contents.

    +
  • +
+
+
+
+
+
+

21. Secret Manager

+
+
+

Google Cloud Secret Manager is a secure and convenient method for storing API keys, passwords, certificates, and other sensitive data. +A detailed summary of its features can be found in the Secret Manager documentation.

+
+
+

Spring Framework on Google Cloud provides:

+
+
+
    +
  • +

    A config data resource which allows you to specify and load the secrets of your Google Cloud project into your application context using Spring Boot’s Config Data API.

    +
  • +
  • +

    A SecretManagerTemplate which allows you to read, write, and update secrets in Secret Manager.

    +
  • +
+
+
+

21.1. Dependency Setup

+
+

To begin using this library, add the spring-cloud-gcp-starter-secretmanager artifact to your project.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-secretmanager")
+}
+
+
+
+

21.1.1. Configuration

+
+

By default, Spring Framework on Google Cloud Secret Manager will authenticate using Application Default Credentials. +This can be overridden using the authentication properties.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.secretmanager.enabled

Enables the Secret Manager integration.

No

true

spring.cloud.gcp.secretmanager.credentials.location

OAuth2 credentials for authenticating to the Google Cloud Secret Manager API.

No

By default, infers credentials from Application Default Credentials.

spring.cloud.gcp.secretmanager.credentials.encoded-key

Base64-encoded contents of OAuth2 account private key for authenticating to the Google Cloud Secret Manager API.

No

By default, infers credentials from Application Default Credentials.

spring.cloud.gcp.secretmanager.project-id

The default Google Cloud project used to access Secret Manager API for the template and property source.

No

By default, infers the project from Application Default Credentials.

spring.cloud.gcp.secretmanager.allow-default-secret

Define the behavior when accessing a non-existent secret string/bytes.
+If set to true, null will be returned when accessing a non-existent secret; otherwise throwing an exception.

No

false

+
+
+
+

21.2. Secret Manager Config Data Resource

+
+

The Spring Framework on Google Cloud integration for Google Cloud Secret Manager enables you to use Secret Manager as an external config data resource. +This allows you to specify and load secrets from Google Cloud Secret Manager as properties into the application context using Spring Boot’s Config Data API.

+
+
+

The Secret Manager config data resource uses the following syntax to specify secrets:

+
+
+
+
# 1. Long form - specify the project ID, secret ID, and version
+sm://projects/<project-id>/secrets/<secret-id>/versions/<version-id>}
+
+# 2.  Long form - specify project ID, secret ID, and use latest version
+sm://projects/<project-id>/secrets/<secret-id>
+
+# 3. Short form - specify project ID, secret ID, and version
+sm://<project-id>/<secret-id>/<version-id>
+
+# 4. Short form - default project; specify secret + version
+#
+# The project is inferred from the spring.cloud.gcp.secretmanager.project-id setting
+# in your application.properties (see Configuration) or from application-default credentials if
+# this is not set.
+sm://<secret-id>/<version>
+
+# 5. Shortest form - specify secret ID, use default project and latest version.
+sm://<secret-id>
+
+
+
+

You can use this syntax in the following places:

+
+
+
    +
  1. +

    In your application.properties file:

    +
    +
    +
    # Example of the project-secret long-form syntax.
    +spring.config.import=sm://
    +spring.datasource.password=${sm://projects/my-gcp-project/secrets/my-secret}
    +
    +
    +
    +

    The former is used to enable Spring Boot’s Config Data API.

    +
    +
  2. +
  3. +

    Access the value using the @Value annotation.

    +
    +
    +
    // Example of using shortest form syntax.
    +@Value("${sm://my-secret}")
    +
    +
    +
  4. +
+
+
+
+

21.3. Secret Manager Template

+
+

The SecretManagerTemplate class simplifies operations of creating, updating, and reading secrets.

+
+
+

To begin using this class, you may inject an instance of the class using @Autowired after adding the starter dependency to your project.

+
+
+
+
@Autowired
+private SecretManagerTemplate secretManagerTemplate;
+
+
+
+
+

Please consult SecretManagerOperations for information on what operations are available for the Secret Manager template.

+
+
+
+

21.4. Refresh secrets without restarting the application

+
+
    +
  1. +

    Before running your application, change the project’s configuration files as follows:

    +
    +

    import the actuator starter dependency to your project,

    +
    +
    +
    +
    <dependency>
    +    <groupId>org.springframework.boot</groupId>
    +    <artifactId>spring-boot-starter-actuator</artifactId>
    +</dependency>
    +
    +
    +
    +

    add the following properties to your project’s application.properties.

    +
    +
    +
    +
    management.endpoints.web.exposure.include=refresh
    +
    +
    +
  2. +
  3. +

    After running the application, update your secret stored in the Secret Manager.

    +
  4. +
  5. +

    To refresh the secret, send the following command to your application sever:

    +
    +
    +
    curl -X POST http://[host]:[port]/actuator/refresh
    +
    +
    +
    +

    Note that only @ConfigurationProperties annotated with @RefreshScope support updating secrets without restarting the application.

    +
    +
  6. +
+
+
+
+

21.5. Allow default secret

+
+

By default, when accessing a non-existent secret, the Secret Manager will throw an exception.

+
+
+

However, if your want to use a default value in such a scenario, you can add the following property to project’s properties.

+
+
+
+
`spring.cloud.gcp.secretmanager.allow-default-secret=true`
+
+
+
+

Therefore, a variable annotated with @Value("${${sm://application-fake}:DEFAULT}") will be resolved as DEFAULT when there is no application-fake in Secret Manager and application-fake is NOT a valid application property.

+
+
+
+

21.6. Sample

+
+

A Secret Manager Sample Application is provided which demonstrates basic property source loading and usage of the template class.

+
+
+
+
+
+

22. Google Cloud Key Management Service

+
+
+

The Google Cloud Key Management Service (KMS) allows you to create, import, and manage cryptographic keys and perform cryptographic operations in a single centralized cloud service.

+
+
+

Spring Framework on Google Cloud offers a utility template class KmsTemplate which allows you to conveniently encrypt and decrypt binary or text data.

+
+
+

22.1. Dependency Setup

+
+

To begin using this library, add the spring-cloud-gcp-starter-kms artifact to your project.

+
+
+

Maven coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-kms</artifactId>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+  implementation("com.google.cloud:spring-cloud-gcp-starter-kms")
+}
+
+
+
+
+

22.2. Configuration

+
+

The following options may be configured with Spring Framework on Google Cloud KMS libraries.

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.kms.enabled

Enables or disables Google Cloud KMS autoconfiguration

No

true

spring.cloud.gcp.kms.project-id

Google Cloud project ID of the project using Cloud KMS APIs, if different from the one in the Spring Framework on Google Cloud Core Module.

No

Project ID is typically inferred from gcloud configuration.

spring.cloud.gcp.kms.credentials.location

Credentials file location for authenticating with the Cloud KMS APIs, if different from the ones in the Spring Framework on Google Cloud Core Module

No

Inferred from Application Default Credentials, typically set by gcloud.

+
+
+

22.3. Basic Usage

+
+

Once you have added the spring-cloud-gcp-starter-kms to your project, the autoconfiguration class com.google.cloud.spring.autoconfigure.kms.GcpKmsAutoConfiguration will be activated for your project.

+
+
+

The com.google.cloud.spring.kms.KmsTemplate bean provided by the autoconfiguration is the entrypoint to using Spring Framework on Google Cloud support for Google KMS. This class allows you to specify a Cloud KMS key in your project via a URI string (format described below) and perform encryption/decryption with it.

+
+
+

The template class automatically validates the CRC32 checksums received responses from Cloud KMS APIs to verify correctness of the response.

+
+
+

22.3.1. Cloud KMS Key ID format

+
+

Spring Framework on Google Cloud offers the following key syntax to specify Cloud KMS keys in your project:

+
+
+
+
 1. Shortest form - specify the key by key ring ID, and key ID.
+ The project is inferred from the spring.cloud.gcp.kms.project-id if set, otherwise
+ the default Google Cloud project (such as using application-default-credentials) is used.
+ The location is assumed to be `global`.
+
+ {key-ring-id}/{key-id}
+
+ 2. Short form - specify the key by location ID, key ring ID, and key ID.
+ The project is inferred from the spring.cloud.gcp.kms.project-id if set, otherwise
+ the default Google Cloud project (such as using application-default-credentials) is used.
+
+ {location-id}/{key-ring-id}/{key-id}
+
+ 3. Full form - specify project ID, location ID, key ring ID, and key ID
+
+ {project-id}/{location-id}/{key-ring-id}/{key-id}
+
+ 4. Long form - specify project ID, location ID, key ring ID, and key ID.
+ This format is equivalent to the fully-qualified resource name of a Cloud KMS key.
+
+ projects/{project-id}/locations/{location-id}/keyRings/{key-ring-id}/cryptoKeys/{key-id}
+
+
+
+
+
+

22.4. Sample

+
+

A Cloud KMS Sample Application is provided which demonstrates basic encryption and decryption operations.

+
+
+
+
+
+

23. Cloud Runtime Configuration API

+
+
+ + + + + +
+ + +The Google Cloud Runtime Configuration service is in Beta status, and is only available in snapshot and milestone versions of the project. It’s also not available in the Spring Framework on Google Cloud BOM, unlike other modules. +
+
+
+

Spring Framework on Google Cloud makes it possible to use the Google Runtime Configuration API as a Spring Cloud Config server to remotely store your application configuration data.

+
+
+

The Spring Framework on Google Cloud Config support is provided via its own Spring Boot starter. +It enables the use of the Google Runtime Configuration API as a source for Spring Boot configuration properties.

+
+
+

Maven coordinates:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-config</artifactId>
+    <version>5.4.1</version>
+</dependency>
+
+
+
+

Gradle coordinates:

+
+
+
+
dependencies {
+    compile group: 'org.springframework.cloud',
+    name: 'spring-cloud-gcp-starter-config',
+    version: '5.4.1'
+}
+
+
+
+

23.1. Configuration

+
+

The following parameters are configurable in Spring Framework on Google Cloud Config:

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Description

Required

Default value

spring.cloud.gcp.config.enabled

Enables the Config client

No

false

spring.cloud.gcp.config.name

Name of your application

No

Value of the spring.application.name property. +If none, application

spring.cloud.gcp.config.profile

Active profile

No

Value of the spring.profiles.active property. +If more than a single profile, last one is chosen

spring.cloud.gcp.config.timeout-millis

Timeout in milliseconds for connecting to the Google Runtime Configuration API

No

60000

spring.cloud.gcp.config.project-id

Google Cloud project ID where the Google Runtime Configuration API is hosted

No

spring.cloud.gcp.config.credentials.location

OAuth2 credentials for authenticating with the Google Runtime Configuration API

No

spring.cloud.gcp.config.credentials.encoded-key

Base64-encoded OAuth2 credentials for authenticating with the Google Runtime Configuration API

No

spring.cloud.gcp.config.credentials.scopes

OAuth2 scope for Spring Framework on Google Cloud Config credentials

No

www.googleapis.com/auth/cloudruntimeconfig

+
+ + + + + +
+ + +These properties should be specified in a bootstrap.yml/bootstrap.properties file, rather than the usual applications.yml/application.properties. +
+
+
+ + + + + +
+ + +Core properties, as described in Spring Framework on Google Cloud Core Module, do not apply to Spring Framework on Google Cloud Config. +
+
+
+
+

23.2. Quick start

+
+
    +
  1. +

    Create a configuration in the Google Runtime Configuration API that is called ${spring.application.name}_${spring.profiles.active}. +In other words, if spring.application.name is myapp and spring.profiles.active is prod, the configuration should be called myapp_prod.

    +
    +

    In order to do that, you should have the Google Cloud SDK installed, own a Google Cloud Project and run the following command:

    +
    +
    +
    +
    gcloud init # if this is your first Google Cloud SDK run.
    +gcloud beta runtime-config configs create myapp_prod
    +gcloud beta runtime-config configs variables set myapp.queue-size 25 --config-name myapp_prod
    +
    +
    +
  2. +
  3. +

    Configure your bootstrap.properties file with your application’s configuration data:

    +
    +
    +
    spring.application.name=myapp
    +spring.profiles.active=prod
    +
    +
    +
  4. +
  5. +

    Add the @ConfigurationProperties annotation to a Spring-managed bean:

    +
    +
    +
    @Component
    +@ConfigurationProperties("myapp")
    +public class SampleConfig {
    +
    +  private int queueSize;
    +
    +  public int getQueueSize() {
    +    return this.queueSize;
    +  }
    +
    +  public void setQueueSize(int queueSize) {
    +    this.queueSize = queueSize;
    +  }
    +}
    +
    +
    +
  6. +
+
+
+

When your Spring application starts, the queueSize field value will be set to 25 for the above SampleConfig bean.

+
+
+
+

23.3. Refreshing the configuration at runtime

+
+

Spring Cloud provides support to have configuration parameters be reloadable with the POST request to /actuator/refresh endpoint.

+
+
+
    +
  1. +

    Add the Spring Boot Actuator dependency:

    +
    +

    Maven coordinates:

    +
    +
    +
    +
    <dependency>
    +    <groupId>org.springframework.boot</groupId>
    +    <artifactId>spring-boot-starter-actuator</artifactId>
    +</dependency>
    +
    +
    +
    +

    Gradle coordinates:

    +
    +
    +
    +
    dependencies {
    +    implementation("org.springframework.boot:spring-boot-starter-actuator")
    +}
    +
    +
    +
  2. +
  3. +

    Add @RefreshScope to your Spring configuration class to have parameters be reloadable at runtime.

    +
  4. +
  5. +

    Add management.endpoints.web.exposure.include=refresh to your application.properties to allow unrestricted access to /actuator/refresh.

    +
  6. +
  7. +

    Update a property with gcloud:

    +
    +
    +
    $ gcloud beta runtime-config configs variables set \
    +  myapp.queue_size 200 \
    +  --config-name myapp_prod
    +
    +
    +
  8. +
  9. +

    Send a POST request to the refresh endpoint:

    +
    +
    +
    $ curl -XPOST https://myapp.host.com/actuator/refresh
    +
    +
    +
  10. +
+
+
+
+

23.4. Sample

+
+

A sample application and a codelab are available.

+
+
+
+
+
+

24. Cloud Foundry

+
+
+

Spring Framework on Google Cloud provides support for Cloud Foundry’s GCP Service Broker. +Our Pub/Sub, Cloud Spanner, Storage, Cloud Trace and Cloud SQL MySQL and PostgreSQL starters are Cloud Foundry aware and retrieve properties like project ID, credentials, etc., that are used in auto configuration from the Cloud Foundry environment.

+
+
+

In order to take advantage of the Cloud Foundry support make sure the following dependency is added:

+
+
+
+
<dependency>
+    <groupId>com.google.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter-cloudfoundry</artifactId>
+</dependency>
+
+
+
+

In cases like Pub/Sub’s topic and subscription, or Storage’s bucket name, where those parameters are not used in auto configuration, you can fetch them using the VCAP mapping provided by Spring Boot. +For example, to retrieve the provisioned Pub/Sub topic, you can use the vcap.services.mypubsub.credentials.topic_name property from the application environment.

+
+
+ + + + + +
+ + +If the same service is bound to the same application more than once, the auto configuration will not be able to choose among bindings and will not be activated for that service. +This includes both MySQL and PostgreSQL bindings to the same app. +
+
+
+ + + + + +
+ + +In order for the Cloud SQL integration to work in Cloud Foundry, auto-reconfiguration must be disabled. +You can do so using the cf set-env <APP> JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}' command. +Otherwise, Cloud Foundry will produce a DataSource with an invalid JDBC URL (i.e., jdbc:mysql://null/null). +
+
+
+

24.1. User-Provided Services

+
+

User-provided services enable developers to use services that are not available in the marketplace with their apps running on Cloud Foundry. +For example, you may want to use a user-provided service that points to a shared Google Service (like Cloud Spanner) used across your organization.

+
+
+

In order for Spring Framework on Google Cloud to detect your user-provided service as a Google Cloud Service, you must add an instance tag indicating the Google Cloud Service it uses. +The tag should simply be the Cloud Foundry name for the Google Service.

+
+
+

For example, if you create a user-provided service using Cloud Spanner, you might run:

+
+
+
+
$ cf create-user-provided-service user-spanner-service -t "google-spanner" ...
+
+
+
+

This allows Spring Framework on Google Cloud to retrieve the correct service properties from Cloud Foundry and use them in the auto configuration for your application.

+
+
+

A mapping of Google service names to Cloud Foundry names are provided below:

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Google Cloud Service

Cloud Foundry Name (add this as a tag)

Google Cloud Pub/Sub

google-pubsub

Google Cloud Storage

google-storage

Google Cloud Spanner

google-spanner

Datastore

google-datastore

Firestore

google-firestore

BigQuery

google-bigquery

Cloud Trace

google-stackdriver-trace

Cloud Sql (MySQL)

google-cloudsql-mysql

Cloud Sql (PostgreSQL)

google-cloudsql-postgres

+
+
+
+
+

25. Kotlin Support

+
+
+

The latest version of the Spring Framework provides first-class support for Kotlin. +For Kotlin users of Spring, the Spring Framework on Google Cloud libraries work out-of-the-box and are fully interoperable with Kotlin applications.

+
+
+

For more information on building a Spring application in Kotlin, please consult the Spring Kotlin documentation.

+
+
+

25.1. Prerequisites

+
+

Ensure that your Kotlin application is properly set up. +Based on your build system, you will need to include the correct Kotlin build plugin in your project:

+
+ +
+

Depending on your application’s needs, you may need to augment your build configuration with compiler plugins:

+
+
+ +
+
+

Once your Kotlin project is properly configured, the Spring Framework on Google Cloud libraries will work within your application without any additional setup.

+
+
+
+

25.2. Sample

+
+

A Kotlin sample application is provided to demonstrate a working Maven setup and various Spring Framework on Google Cloud integrations from within Kotlin.

+
+
+
+
+
+

26. AlloyDB

+
+
+

Spring Framework on Google Cloud adds integrations with +Spring JDBC, so you can run your PostgreSQL databases in Google AlloyDB using Spring JDBC.

+
+
+

The AlloyDB support is provided by Spring Framework on Google Cloud in the form of a Spring Boot AlloyDB starter for PostgreSQL. +The role of the starters is to read configuration from properties and assume default settings so that user experience connecting to PostgreSQL is as simple as possible.

+
+
+

26.1. JDBC Support

+
+

Maven and Gradle coordinates, using Spring Framework on Google Cloud BOM:

+
+
+
+
<dependency>
+  <groupId>com.google.cloud</groupId>
+  <artifactId>spring-cloud-gcp-starter-alloydb</artifactId>
+</dependency>
+
+
+
+
+
dependencies {
+    implementation("com.google.cloud:spring-cloud-gcp-starter-alloydb")
+}
+
+
+
+

26.1.1. Prerequisites

+
+

In order to use the Spring Boot Starters for Google AlloyDB, the Google AlloyDB API must be enabled in your Google Cloud project.

+
+
+

To do that, go to the API library page of the Google Cloud Console, search for "AlloyDB API" and enable the option that is called "AlloyDB API" .

+
+
+
+

26.1.2. Spring Boot Starter for Google AlloyDB

+
+

The Spring Boot Starters for Google AlloyDB provide an autoconfigured DataSource object. +Coupled with Spring JDBC, it provides a +JdbcTemplate object bean that allows for operations such as querying and modifying a database.

+
+
+
+
public List<Map<String, Object>> listUsers() {
+    return jdbcTemplate.queryForList("SELECT * FROM user;");
+}
+
+
+
+
+

You can rely on +Spring Boot data source autoconfiguration to configure a DataSource bean. +In other words, properties like the username, spring.datasource.username, and password, spring.datasource.password can be used. +There is also some configuration specific to Google AlloyDB (see "AlloyDB Configuration Properties" section below).

+
+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.datasource.username

Database username

No

postgres

spring.datasource.password

Database password

No

null

spring.datasource.driver-class-name

JDBC driver to use.

No

org.postgresql.Driver

+
+ + + + + +
+ + +If you provide your own spring.datasource.url, it will be ignored, unless you disable AlloyDB autoconfiguration with spring.cloud.gcp.alloydb.enabled=false. +
+
+
+
DataSource creation flow
+
+

Spring Boot starter for Google AlloyDB registers an AlloyDbEnvironmentPostProcessor that provides a correctly formatted spring.datasource.url property to the environment based on the properties mentioned above. +It also provides defaults for spring.datasource.username and spring.datasource.driver-class-name, which can be overridden. +The starter also configures credentials for the JDBC connection based on the AlloyDB properties below.

+
+
+

The user properties and the properties provided by the AlloyDbEnvironmentPostProcessor are then used by Spring Boot to create the DataSource. +You can select the type of connection pool (e.g., Tomcat, HikariCP, etc.) by adding their dependency to the classpath.

+
+
+

Using the created DataSource in conjunction with Spring JDBC provides you with a fully configured and operational JdbcTemplate object that you can use to interact with your AlloyDB database. +You can connect to your database with as little as a database and instance names.

+
+
+
+
+
+

26.2. AlloyDB IAM database authentication

+
+

Currently, AlloyDB supports IAM database authentication. +It allows you to connect to the database using an IAM account, rather than a predefined database username and password. +You will need to do the following to enable it:

+
+
+
    +
  1. +

    In your AlloyDB instance settings, turn on the alloydb.iam_authentication flag.

    +
  2. +
  3. +

    Add the IAM user or service account to the list of cluster users.

    +
  4. +
  5. +

    In the application settings, set spring.cloud.gcp.alloydb.enable-iam-auth to true. Note that this will also set the database protocol sslmode to disabled, as it’s required for IAM authentication to work. +However, it doesn’t compromise the security of the communication because the connection is always encrypted.

    +
  6. +
  7. +

    Set spring.datasource.username to the IAM user or service account created in step 2. Note that IAM user or service account still needs to be granted permissions before modifying or querying the database.

    +
  8. +
+
+
+
+

26.3. AlloyDB Configuration Properties

+ ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Property name

Description

Required

Default value

spring.cloud.gcp.alloydb.enabled

Enables or disables AlloyDB auto configuration

No

true

spring.cloud.gcp.alloydb.database-name

The name of the database to connect to.

Yes

spring.cloud.gcp.alloydb.instance-connection-uri

The Google AlloyDB instance connection URI.

Yes

For example, projects/PROJECT_ID/locations/REGION_ID/clusters/CLUSTER_ID/instances/INSTANCE_ID.

spring.cloud.gcp.alloydb.ip-type

Specifies a preferred IP type for connecting to a AlloyDB instance. (PUBLIC, PRIVATE, PSC)

No

PRIVATE

spring.cloud.gcp.alloydb.enable-iam-auth

Specifies whether to enable IAM database authentication.

No

False

spring.cloud.gcp.alloydb.admin-service-endpoint

An alternate AlloyDB API endpoint.

No

spring.cloud.gcp.alloydb.quota-project

The project ID for quota and billing.

No

spring.cloud.gcp.alloydb.target-principal

The service account to impersonate when connecting to the database and database admin API.

No

spring.cloud.gcp.alloydb.delegates

A comma-separated list of service accounts delegates.

No

spring.cloud.gcp.alloydb.named-connector

The name of the named connector.

No

+
+ + + + + +
+ + +You need to run your application from a VM within the created VPC to connect to AlloyDB using its private IP. +To connect using Public IP, enable the AlloyDB instance’s for external connections +following these instructions and +add spring.cloud.gcp.alloydb.ip-type=PUBLIC to your application.properties. +
+
+
+
+

26.4. Troubleshooting tips

+
+

26.4.1. Connection issues

+
+

If you’re not able to connect to a database and see an endless loop of Connecting to AlloyDB instance […​] on IP […​], it’s likely that exceptions are being thrown and logged at a level lower than your logger’s level. +This may be the case with HikariCP, if your logger is set to INFO or higher level.

+
+
+

To see what’s going on in the background, you should add a logback.xml file to your application resources folder, that looks like this:

+
+
+
+
<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <include resource="org/springframework/boot/logging/logback/base.xml"/>
+  <logger name="com.zaxxer.hikari.pool" level="DEBUG"/>
+</configuration>
+
+
+
+
+

26.4.2. PostgreSQL: java.net.SocketException: already connected issue

+
+

We found this exception to be common if your Maven project’s parent is spring-boot version 1.5.x, or in any other circumstance that would cause the version of the org.postgresql:postgresql dependency to be an older one (e.g., 9.4.1212.jre7).

+
+
+

To fix this, re-declare the dependency in its correct version. +For example, in Maven:

+
+
+
+
<dependency>
+  <groupId>org.postgresql</groupId>
+  <artifactId>postgresql</artifactId>
+  <version>42.7.3</version>
+</dependency>
+
+
+
+
+
+

26.5. Samples

+
+

Available sample applications and codelabs:

+
+ +
+
+
+
+

27. Configuration properties

+
+
+

To see the list of all Google Cloud related configuration properties please check the Appendix page.

+
+
+
+
+

28. Migration Guide from Spring Framework on Google Cloud 1.x to 2.x

+
+
+

28.1. Maven Group ID Change

+
+

Spring Cloud unbundled Spring Framework on Google Cloud and other cloud providers from their release train. +To use the newly unbundled libraries, add the spring-cloud-gcp-dependencies bill of materials (BOM) and change the spring-cloud-gcp group IDs in your pom.xml files:

+
+
+
Before (pom.xml)
+
+
<dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-dependencies</artifactId>
+      <version>${spring-cloud.version}</version>
+      <type>pom</type>
+      <scope>import</scope>
+    </dependency>
+  </dependencies>
+</dependencyManagement>
+
+<dependencies>
+  <dependency>
+    <groupId>org.springframework.cloud</groupId>
+    <artifactId>spring-cloud-gcp-starter</artifactId>
+  </dependency>
+</dependencies>
+
+
+
+
After (pom.xml)
+
+
<dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.cloud</groupId> (2)
+      <artifactId>spring-cloud-gcp-dependencies</artifactId>
+      <version>3.4.0</version>
+      <type>pom</type>
+      <scope>import</scope>
+    </dependency>
+  </dependencies>
+</dependencyManagement>
+
+<dependencies>
+  <dependency>
+    <groupId>com.google.cloud</groupId> (3)
+    <artifactId>spring-cloud-gcp-starter</artifactId>
+  </dependency>
+  ... (4)
+</dependencies>
+
+
+
+ + + + + + + + + + + + + + + + + +
1Upgrade to Spring Cloud Ilford release
2Explicitly add spring-cloud-gcp-dependencies to import the BOM
3Change Group IDs to com.google.cloud
4Add other starters as desired (i.e., spring-cloud-gcp-starter-pubsub or spring-cloud-gcp-starter-storage)
+
+
+
+

28.2. Java Package Name Change

+
+

All code in Spring Framework on Google Cloud has been moved from org.springframework.cloud.gcp over to the com.google.cloud.spring package.

+
+
+
+

28.3. Deprecated Items Removed

+
+
+
Property spring.cloud.gcp.datastore.emulatorHost
+
+

Use spring.cloud.gcp.datastore.host instead

+
+
GcpPubSubHeaders.ACKNOWLEDGEMENT
+
+

Use GcpPubSubHeaders.ORIGINAL_MESSAGE, which is of type BasicAcknowledgeablePubsubMessage

+
+
SpannerQueryOptions.getQueryOptions()
+
+

Use getOptions()

+
+
PubSubTemplate.subscribe(String, MessageReceiver)
+
+

Use subscribe(String, Consumer<BasicAcknowledgeablePubsubMessage>)

+
+
SpannerReadOptions.getReadOptions()
+
+

Use getOptions()

+
+
Cloud Logging
+
+
+
+
org.springframework.cloud.gcp.autoconfigure.logging package
+
+

Use com.google.cloud.spring.logging from the spring-cloud-gcp-logging module.

+
+
Cloud Logging Logback Appenders
+
+

Replace org/springframework/cloud/gcp/autoconfigure/logging/logback[-json]-appender.xml with com/google/cloud/spring/logging/logback[-json]-appender.xml from the spring-cloud-gcp-logging module.

+
+
logback-spring.xml
+
+
<configuration>
+  <include resource="com/google/cloud/spring/logging/logback-appender.xml" />
+  ...
+</configuration>
+
+
+
+
+
+
+
+
+
+
+
+
+

29. Migration Guide from Spring Cloud GCP 3.x to 4.x

+
+
+

29.1. Before you start

+
+

29.1.1. Upgrade to the 3.x version

+
+

This doc assumes you are running with Spring Cloud GCP 3.x.

+
+
+

If you are currently running with an earlier major version of Spring Cloud GCP, i.e., 1.x or 2.x, we recommend that you upgrade to Spring Cloud GCP 3.x before migrating to Spring Cloud GCP 4.0.

+
+ +
+

Note that since Spring Cloud GCP 3.0 has few breaking changes, we only provide a release note.

+
+
+
+

29.1.2. Review System requirements

+
+

Spring Cloud GCP 4.0 is built on Spring Boot 3.0 and Spring Framework 6.0, which requires Java 17 at minimum. +If you are currently on Java 8 or Java 11, you need to upgrade your JDK before you can develop an application based on Spring Cloud GCP 4.0.

+
+
+
+

29.1.3. Review Deprecations from 3.x

+
+

Classes, methods and properties that were deprecated in Spring Cloud GCP 3.x have been removed in this release. +Please ensure that you aren’t calling deprecated methods before upgrading.

+
+
+
+
+

29.2. Upgrade to Spring Cloud GCP 4.0

+
+

29.2.1. Spring Boot 3.0

+
+

Spring Cloud GCP 4.0 builds on Spring Boot 3.0. Review the Spring Boot 3.0 migration guide before continuing.

+
+
+
+

29.2.2. Update Bill of Materials (BOM)

+
+

If you’re a Maven user, add our BOM to your pom.xml <dependencyManagement> section. +This will allow you to not specify versions for any of the Maven dependencies and instead delegate versioning to the BOM.

+
+
+
+
<dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.cloud</groupId>
+            <artifactId>spring-cloud-gcp-dependencies</artifactId>
+            <version>4.0.0</version>
+            <type>pom</type>
+            <scope>import</scope>
+        </dependency>
+    </dependencies>
+</dependencyManagement>
+
+
+
+
Review Dependencies
+
+

Run mvn dependency:tree (gradlew dependencies for Gradle projects) to see the dependency tree of your project. +Ensure Spring-related dependencies have matching versions:

+
+
+ +
+
+
+
+

29.2.3. Cloud BigQuery

+
+

Replaced ListenableFuture and SettableListenableFuture with CompletableFuture as the former two Classes are deprecated in Spring Framework 6.0.

+
+
+
+

29.2.4. Cloud SQL

+
+

MySQL R2DBC is not supported by Spring Cloud GCP 4.0 due to compatibility issues with the Mariadb driver.

+
+
+
+

29.2.5. Cloud Pub/Sub

+
+

Replaced ListenableFuture and SettableListenableFuture with CompletableFuture as the former two Classes are deprecated in Spring Framework 6.0.

+
+
+
+

29.2.6. Spring Cloud Stream binder to Google Cloud Pub/Sub

+
+

Change to functional model as annotation-based model is removed from Spring Cloud Stream 4.0.0.

+
+
+
+

29.2.7. Secret Manager

+
+

To enable the application to fetch a secret from SecretManager, add spring.config.import=sm:// in the application.properties or application.yml files and inject the secret into the application by adding application.secret=${sm://your-secret-name}. +Do not write secret values in the file.

+
+
+

Please also remove spring.cloud.gcp.secretmanager.enabled and spring.cloud.gcp.secretmanager.legacy in bootstrap.yml or bootstrap.properties files.

+
+
+
+

29.2.8. Cloud Trace

+
+

Annotation org.springframework.cloud.sleuth.annotation.NewSpan is deprecated in favor of io.micrometer.observation.annotation.Observed since Spring Boot 3.0 builds on Micrometer 1.0 rather than Spring Cloud Sleuth (which is excluded from the Spring Cloud release train).

+
+
+

If you use NewSpan to generate an additional span, replace the annotation with Observed. +The default name of the additional span is <class-name>#<method-name>. +If you want to customize the additional span name, specify the contextualName parameter.

+
+
+

Please also remove spring.sleuth.enabled from your application.properties or application.yml file. +Note that spring.cloud.gcp.trace.enabled=true is still required if you want to enable Trace.

+
+
+
+

29.2.9. Cloud Vision

+
+

Replaced ListenableFuture and SettableListenableFuture with CompletableFuture as the former two Classes are deprecated in Spring Framework 6.0.

+
+
+
+
+

29.3. Configuration Changelog

+
+

29.3.1. Removed

+
+

The following properties are removed from the codebase thus no longer needed in your application.

+
+
+
    +
  • +

    spring.cloud.gcp.secretmanager.legacy

    +
  • +
+
+
+

See the "SecretManager" section.

+
+
+
    +
  • +

    spring.sleuth.enabled

    +
  • +
+
+
+

See the "Trace" section

+
+
+
+
+

29.4. Deprecated Items Removed

+
+

29.4.1. Cloud BigQuery

+
+
+
BigQueryTemplate(BigQuery bigQuery, String datasetName)
+
+

Use BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler) instead

+
+
BigQueryTemplate(BigQuery, String, TaskScheduler)
+
+

Use BigQueryTemplate(BigQuery, BigQueryWriteClient, Map, TaskScheduler) instead

+
+
+
+
+
+

29.4.2. Cloud Datastore

+
+
+
DatastorePersistentPropertyImpl.getPersistentEntityTypes()
+
+

Use DatastorePersistentPropertyImpl.getPersistentEntityTypeInformation() instead

+
+
+
+
+
+

29.4.3. Cloud Pub/Sub

+
+
+
DefaultSubscriberFactory(GcpProjectIdProvider)
+
+

Use DefaultSubscriberFactory(GcpProjectIdProvider, PubSubConfiguration) instead

+
+
PubSubConfiguration.computeSubscriberRetrySettings(String, String)
+
+

Use PubSubConfiguration.computeSubscriberRetrySettings(ProjectSubscriptionName) instead

+
+
PubSubConfiguration.computeSubscriberFlowControlSettings(String, String)
+
+

Use PubSubConfiguration.computeSubscriberFlowControlSettings(ProjectSubscriptionName) instead

+
+
PubSubConfiguration.getSubscriber(String, String)
+
+

Use PubSubConfiguration.getSubscriptionProperties(ProjectSubscriptionName) instead

+
+
+
+
+
+

29.4.4. Cloud Spanner

+
+
+
SpannerPersistentEntityImpl(TypeInformation<T>)
+
+

Use SpannerPersistentEntityImpl(TypeInformation, SpannerMappingContext, SpannerEntityProcessor) instead

+
+
SpannerCompositeKeyProperty.getPersistentEntityTypes()
+
+

Use SpannerCompositeKeyProperty.getPersistentEntityTypeInformation() instead

+
+
+
+
+
+

29.4.5. Cloud Trace

+
+
+
TracingSubscriberFactory.createSubscriberStub()
+
+

Use TracingSubscriberFactory.createSubscriberStub(String) instead

+
+
+
+
+
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/5.4.1/reference/html/js/setup.js b/5.4.1/reference/html/js/setup.js new file mode 100755 index 0000000000..ae5b1b7bd7 --- /dev/null +++ b/5.4.1/reference/html/js/setup.js @@ -0,0 +1,3 @@ +!function(){"use strict";document.getElementsByTagName("html")[0].classList.add("js")}(); +!function(){var t=function(t,n,e){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,e)}),n)};var n=function(t){return t};var e=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)},r=Math.max;var o=function(t,n,o){return n=r(void 0===n?t.length-1:n,0),function(){for(var c=arguments,u=-1,i=r(c.length-n,0),a=Array(i);++u0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},D=C(R);var G=/\s/;var U=function(t){for(var n=t.length;n--&&G.test(t.charAt(n)););return n},z=/^\s+/;var B=function(t){return t?t.slice(0,U(t)+1).replace(z,""):t};var H=function(t){return null!=t&&"object"==typeof t};var J=function(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==g(t)},K=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,V=/^0o[0-7]+$/i,W=parseInt;var X=function(t){if("number"==typeof t)return t;if(J(t))return NaN;if(m(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=m(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=B(t);var e=Q.test(t);return e||V.test(t)?W(t.slice(2),e?2:8):K.test(t)?NaN:+t},Y=function(t,e){return D(o(t,e,n),t+"")}((function(n,e,r){return t(n,X(e)||0,r)}));!function(){"use strict";const t=window.localStorage,n=document.documentElement,e=window.matchMedia("(prefers-color-scheme: dark)");function r(){const n=null!==t?t.getItem("theme"):null;return n?"dark"===n:e.matches}function o(){this.checked?(Y((function(){n.classList.add("dark-theme")}),100),c("dark")):(Y((function(){n.classList.remove("dark-theme")}),100),c("light"))}function c(n){t&&t.setItem("theme",n)}r()&&n.classList.add("dark-theme"),window.addEventListener("load",(function(){const t=document.querySelector("#switch-theme-checkbox");t.checked=r(),t.addEventListener("change",o.bind(t))}))}()}(); +//# sourceMappingURL=setup.js.map diff --git a/5.4.1/reference/html/js/setup.js.map b/5.4.1/reference/html/js/setup.js.map new file mode 100755 index 0000000000..2971105ec2 --- /dev/null +++ b/5.4.1/reference/html/js/setup.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["setup/src/main/js/setup/layout.js","setup/node_modules/browser-pack-flat/_prelude","setup/node_modules/lodash/_baseDelay.js","setup/switchtheme.js","setup/node_modules/lodash/identity.js","setup/node_modules/lodash/_apply.js","setup/node_modules/lodash/_overRest.js","setup/node_modules/lodash/constant.js","setup/node_modules/lodash/_freeGlobal.js","setup/node_modules/lodash/_root.js","setup/node_modules/lodash/_Symbol.js","setup/node_modules/lodash/_getRawTag.js","setup/node_modules/lodash/_objectToString.js","setup/node_modules/lodash/_baseGetTag.js","setup/node_modules/lodash/isObject.js","setup/node_modules/lodash/isFunction.js","setup/node_modules/lodash/_isMasked.js","setup/node_modules/lodash/_coreJsData.js","setup/node_modules/lodash/_toSource.js","setup/node_modules/lodash/_baseIsNative.js","setup/node_modules/lodash/_getValue.js","setup/node_modules/lodash/_getNative.js","setup/node_modules/lodash/_defineProperty.js","setup/node_modules/lodash/_baseSetToString.js","setup/node_modules/lodash/_shortOut.js","setup/node_modules/lodash/_setToString.js","setup/node_modules/lodash/_baseRest.js","setup/node_modules/lodash/_trimmedEndIndex.js","setup/node_modules/lodash/_baseTrim.js","setup/node_modules/lodash/isObjectLike.js","setup/node_modules/lodash/isSymbol.js","setup/node_modules/lodash/toNumber.js","setup/node_modules/lodash/delay.js","setup/src/main/js/setup/switchtheme.js","setup/node_modules/browser-pack-flat/_postlude"],"names":["document","getElementsByTagName","classList","add","_$baseDelay_3","func","wait","args","TypeError","setTimeout","apply","undefined","_$identity_25","value","_$apply_2","thisArg","length","call","nativeMax","Math","max","_$overRest_17","start","transform","arguments","index","array","Array","otherArgs","this","_$constant_23","_$freeGlobal_11","global","freeGlobal","Object","self","window","freeSelf","_$root_18","Function","_$Symbol_1","Symbol","objectProto","prototype","hasOwnProperty","nativeObjectToString","toString","symToStringTag","toStringTag","_$getRawTag_13","isOwn","tag","unmasked","e","result","__nativeObjectToString_16","_$objectToString_16","__symToStringTag_4","_$baseGetTag_4","_$isObject_27","type","uid","_$isFunction_26","_$coreJsData_9","maskSrcKey","exec","keys","IE_PROTO","_$isMasked_15","funcToString","_$toSource_21","reIsHostCtor","__funcProto_5","__objectProto_5","__funcToString_5","__hasOwnProperty_5","reIsNative","RegExp","replace","_$baseIsNative_5","test","_$getValue_14","object","key","_$getNative_12","_$defineProperty_10","_$baseSetToString_7","string","configurable","enumerable","writable","nativeNow","Date","now","_$shortOut_20","count","lastCalled","stamp","remaining","_$setToString_19","reWhitespace","_$trimmedEndIndex_22","charAt","reTrimStart","_$baseTrim_8","slice","_$isObjectLike_28","_$isSymbol_29","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","_$toNumber_30","other","valueOf","isBinary","_$delay_24","_$baseRest_6","localStorage","htmlElement","documentElement","prefersDarkColorScheme","matchMedia","isInitialThemeDark","theme","getItem","matches","onThemeChange","checked","saveTheme","remove","setItem","addEventListener","toggleCheckboxElement","querySelector","bind"],"mappings":"CAgBA,WACE,aACAA,SAASC,qBAAqB,QAAQ,GAAGC,UAAUC,IAAI,KACxD,CAHD;CChBA,WCoBA,IAAAC,EAPA,SAAmBC,EAAMC,EAAMC,GAC7B,GAAmB,mBAARF,EACT,MAAM,IAAIG,UAdQ,uBAgBpB,OAAOC,YAAW,WAAaJ,EAAKK,WAAMC,EAAWJ,EAAM,GAAID,ECEjE,ECCA,IAAAM,EAJA,SAAkBC,GAChB,OAAOA,CDwBT,EErBA,IAAAC,EAVA,SAAeT,EAAMU,EAASR,GAC5B,OAAQA,EAAKS,QACX,KAAK,EAAG,OAAOX,EAAKY,KAAKF,GACzB,KAAK,EAAG,OAAOV,EAAKY,KAAKF,EAASR,EAAK,IACvC,KAAK,EAAG,OAAOF,EAAKY,KAAKF,EAASR,EAAK,GAAIA,EAAK,IAChD,KAAK,EAAG,OAAOF,EAAKY,KAAKF,EAASR,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAE3D,OAAOF,EAAKK,MAAMK,EAASR,EF8C7B,EG5DIW,EAAYC,KAAKC,IAgCrB,IAAAC,EArBA,SAAkBhB,EAAMiB,EAAOC,GAE7B,OADAD,EAAQJ,OAAoBP,IAAVW,EAAuBjB,EAAKW,OAAS,EAAKM,EAAO,GAC5D,WAML,IALA,IAAIf,EAAOiB,UACPC,GAAS,EACTT,EAASE,EAAUX,EAAKS,OAASM,EAAO,GACxCI,EAAQC,MAAMX,KAETS,EAAQT,GACfU,EAAMD,GAASlB,EAAKe,EAAQG,GAE9BA,GAAS,EAET,IADA,IAAIG,EAAYD,MAAML,EAAQ,KACrBG,EAAQH,GACfM,EAAUH,GAASlB,EA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UAAUC,IAAI,cAJ9BiC,OAAOiG,iBAAiB,QAQxB,WACE,MAAMC,EAAwBtI,SAASuI,cACrC,0BAEFD,EAAsBL,QAAUL,IAChCU,EAAsBD,iBACpB,SACAL,EAAcQ,KAAKF,G9B2uBvB,G8B3sBD,CA3DD,ECfA,CjCDA","file":"setup.js","sourcesContent":["/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n document.getElementsByTagName(\"html\")[0].classList.add(\"js\");\n})();\n","(function(){\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n const delay = require(\"lodash/delay\");\n\n const localStorage = window.localStorage;\n const htmlElement = document.documentElement;\n const prefersDarkColorScheme = window.matchMedia(\n \"(prefers-color-scheme: dark)\"\n );\n\n swithInitialTheme();\n window.addEventListener(\"load\", onWindowLoad);\n\n function swithInitialTheme() {\n if (isInitialThemeDark()) {\n htmlElement.classList.add(\"dark-theme\");\n }\n }\n\n function onWindowLoad() {\n const toggleCheckboxElement = document.querySelector(\n \"#switch-theme-checkbox\"\n );\n toggleCheckboxElement.checked = isInitialThemeDark();\n toggleCheckboxElement.addEventListener(\n \"change\",\n onThemeChange.bind(toggleCheckboxElement)\n );\n }\n\n function isInitialThemeDark() {\n const theme = loadTheme();\n return theme ? theme === \"dark\" : prefersDarkColorScheme.matches;\n }\n\n function onThemeChange() {\n if (this.checked) {\n delay(function () {\n htmlElement.classList.add(\"dark-theme\");\n }, 100);\n saveTheme(\"dark\");\n } else {\n delay(function () {\n htmlElement.classList.remove(\"dark-theme\");\n }, 100);\n saveTheme(\"light\");\n }\n }\n\n function saveTheme(theme) {\n if (localStorage) {\n localStorage.setItem(\"theme\", theme);\n }\n }\n\n function loadTheme() {\n return localStorage !== null ? localStorage.getItem(\"theme\") : null;\n }\n})();\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest'),\n toNumber = require('./toNumber');\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nmodule.exports = delay;\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n const delay = require(\"lodash/delay\");\n\n const localStorage = window.localStorage;\n const htmlElement = document.documentElement;\n const prefersDarkColorScheme = window.matchMedia(\n \"(prefers-color-scheme: dark)\"\n );\n\n swithInitialTheme();\n window.addEventListener(\"load\", onWindowLoad);\n\n function swithInitialTheme() {\n if (isInitialThemeDark()) {\n htmlElement.classList.add(\"dark-theme\");\n }\n }\n\n function onWindowLoad() {\n const toggleCheckboxElement = document.querySelector(\n \"#switch-theme-checkbox\"\n );\n toggleCheckboxElement.checked = isInitialThemeDark();\n toggleCheckboxElement.addEventListener(\n \"change\",\n onThemeChange.bind(toggleCheckboxElement)\n );\n }\n\n function isInitialThemeDark() {\n const theme = loadTheme();\n return theme ? theme === \"dark\" : prefersDarkColorScheme.matches;\n }\n\n function onThemeChange() {\n if (this.checked) {\n delay(function () {\n htmlElement.classList.add(\"dark-theme\");\n }, 100);\n saveTheme(\"dark\");\n } else {\n delay(function () {\n htmlElement.classList.remove(\"dark-theme\");\n }, 100);\n saveTheme(\"light\");\n }\n }\n\n function saveTheme(theme) {\n if (localStorage) {\n localStorage.setItem(\"theme\", theme);\n }\n }\n\n function loadTheme() {\n return localStorage !== null ? localStorage.getItem(\"theme\") : null;\n }\n})();\n","\n}());"]} \ No newline at end of file diff --git a/5.4.1/reference/html/js/site.js b/5.4.1/reference/html/js/site.js new file mode 100755 index 0000000000..24a40b4f65 --- /dev/null +++ b/5.4.1/reference/html/js/site.js @@ -0,0 +1,7 @@ +!function(){"use strict";function n(){const n=document.getElementById("anchor-rewrite"),o=window.location.hash.substr(1);n&&o&&function(n,o){const e=[n];for(console.debug(n);o[n];){if(n=o[n],e.includes(n))return void console.error("Skipping circular anchor update");e.push(n)}window.location.hash=n}(o,JSON.parse(n.innerHTML))}window.addEventListener("load",n),window.addEventListener("hashchange",n)}(); +!function(){"use strict";!function(){let t=document.getElementById("author"),n=t;for(;t;)t.classList.contains("author")&&(n=t),t=t.nextElementSibling;n&&n.classList.add("last-author")}()}(); +!function(){var t=function(t,n,e){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,e)}),n)};var n=function(t){return t};var e=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)},r=Math.max;var o=function(t,n,o){return n=r(void 0===n?t.length-1:n,0),function(){for(var c=arguments,i=-1,u=r(c.length-n,0),a=Array(u);++i0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},G=D(I);var M=/\s/;var U=function(t){for(var n=t.length;n--&&M.test(t.charAt(n)););return n},z=/^\s+/;var B=function(t){return t?t.slice(0,U(t)+1).replace(z,""):t};var H=function(t){return null!=t&&"object"==typeof t};var J=function(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==g(t)},K=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,V=/^0o[0-7]+$/i,W=parseInt;var X=function(t){if("number"==typeof t)return t;if(J(t))return NaN;if(m(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=m(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=B(t);var e=Q.test(t);return e||V.test(t)?W(t.slice(2),e?2:8):K.test(t)?NaN:+t},Y=function(t,e){return G(o(t,e,n),t+"")}((function(n,e,r){return t(n,X(e)||0,r)}));!function(){"use strict";function t(t){const e=t.querySelector("code").cloneNode(!0);for(const t of e.querySelectorAll(".hide-when-unfolded"))t.parentNode.removeChild(t);const r=e.innerText;r&&window.navigator.clipboard.writeText(r+"\n").then(n.bind(this))}function n(){this.classList.add("clicked")}function e(){this.classList.remove("clicked")}function r(t){const n=t.querySelector("code"),e=!n.classList.contains("unfolded");n.classList.remove(e?"folding":"unfolding"),n.classList.add(e?"unfolding":"folding"),Y((function(){n.classList.remove(e?"unfolding":"folding"),n.classList.toggle("unfolded")}),1100),o(this,!e)}function o(t,n){const e=n?"Expand folded text":"Collapse foldable text";t.classList.remove(n?"fold-button":"unfold-button"),t.classList.add(n?"unfold-button":"fold-button"),t.querySelector("span.label").innerText=e,t.title=e}!function(){for(const t of document.querySelectorAll(".doc pre.highlight")){const e=document.createElement("div");e.className="codetools",n(t,e)&&t.appendChild(e)}function n(n,i){let u=0;return function(t){return!!t.querySelector("span.hide-when-folded")}(n)&&(!function(t,n){const e=c();o(e,!0),e.addEventListener("click",r.bind(e,t)),n.appendChild(e)}(n,i),u++),window.navigator.clipboard&&(!function(n,r){const o=c("Copy to clipboard","copy-button");o.addEventListener("click",t.bind(o,n)),o.addEventListener("mouseleave",e.bind(o)),o.addEventListener("blur",e.bind(o));const i=document.createElement("span");o.appendChild(i),i.className="copied",r.appendChild(o)}(n,i),u++),u>0}function c(t,n){const e=document.createElement("button");e.className=n,e.title=t,e.type="button";const r=document.createElement("span");return r.appendChild(document.createTextNode(t)),r.className="label",e.appendChild(r),e}}()}()}(); +!function(){function e(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((function(t){var a=n[t];"object"!=typeof a||Object.isFrozen(a)||e(a)})),n}var n=e,t=e;n.default=t;class a{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!r(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}const d=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const u="[a-zA-Z]\\w*",b="[a-zA-Z_]\\w*",m="\\b\\d+(\\.\\d+)?",h="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",p="\\b(0b[01]+)",f={begin:"\\\\[\\s\\S]",relevance:0},_={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[f]},E={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[f]},v={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},N=function(e,n,t={}){const a=s({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(v),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},y=N("//","$"),w=N("/\\*","\\*/"),x=N("#","$"),M={className:"number",begin:m,relevance:0},O={className:"number",begin:h,relevance:0},k={className:"number",begin:p,relevance:0},R={className:"number",begin:m+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},S={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[f,{begin:/\[/,end:/\]/,relevance:0,contains:[f]}]}]},A={className:"title",begin:u,relevance:0},T={className:"title",begin:b,relevance:0},C={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var D=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:u,UNDERSCORE_IDENT_RE:b,NUMBER_RE:m,C_NUMBER_RE:h,BINARY_NUMBER_RE:p,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map((e=>g(e))).join("")}(n,/.*\b/,e.binary,/\b.*/)),s({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:f,APOS_STRING_MODE:_,QUOTE_STRING_MODE:E,PHRASAL_WORDS_MODE:v,COMMENT:N,C_LINE_COMMENT_MODE:y,C_BLOCK_COMMENT_MODE:w,HASH_COMMENT_MODE:x,NUMBER_MODE:M,C_NUMBER_MODE:O,BINARY_NUMBER_MODE:k,CSS_NUMBER_MODE:R,REGEXP_MODE:S,TITLE_MODE:A,UNDERSCORE_TITLE_MODE:T,METHOD_GUARD:C,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}});function L(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function B(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=L,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function $(e,n){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map((e=>g(e))).join("|")+")"}(...e.illegal))}function I(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function j(e,n){void 0===e.relevance&&(e.relevance=1)}const z=["of","and","for","in","not","or","if","then","parent","list","value"];function P(e,n,t="keyword"){const a={};return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((function(t){Object.assign(a,P(e[t],n,t))})),a;function i(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");a[t[0]]=[e,U(t[0],t[1])]}))}}function U(e,n){return n?Number(n):function(e){return z.includes(e.toLowerCase())}(e)?0:1}function K(e,{plugins:n}){function t(n,t){return new RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(function(e,n="|"){let t=0;return e.map((e=>{t+=1;const n=t;let a=g(e),i="";for(;a.length>0;){const e=d.exec(a);if(!e){i+=a;break}i+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+n):(i+=e[0],"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,a)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new a;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=s(e.classNameAliases||{}),function n(a,r){const o=a;if(a.isCompiled)return o;[I].forEach((e=>e(a,r))),e.compilerExtensions.forEach((e=>e(a,r))),a.__beforeBegin=null,[B,$,j].forEach((e=>e(a,r))),a.isCompiled=!0;let l=null;if("object"==typeof a.keywords&&(l=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=P(a.keywords,e.case_insensitive)),a.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l=l||a.lexemes||/\w+/,o.keywordPatternRe=t(l,!0),r&&(a.begin||(a.begin=/\B|\b/),o.beginRe=t(a.begin),a.endSameAsBegin&&(a.end=a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(o.endRe=t(a.end)),o.terminatorEnd=g(a.end)||"",a.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(a.end?"|":"")+r.terminatorEnd)),a.illegal&&(o.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return s(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(H(e))return s(e,{starts:e.starts?s(e.starts):null});if(Object.isFrozen(e))return s(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){n(e,o)})),a.starts&&n(a.starts,r),o.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(o),o}(e)}function H(e){return!!e&&(e.endsWithParent||H(e.starts))}function Z(e){const n={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,i(this.code);let n={};return this.autoDetect?(n=e.highlightAuto(this.code),this.detectedLanguage=n.language):(n=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),n.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:n,VuePlugin:{install(e){e.component("highlightjs",n)}}}}const G={"after:highlightElement":({el:e,result:n,text:t})=>{const a=F(e);if(!a.length)return;const s=document.createElement("div");s.innerHTML=n.value,n.value=function(e,n,t){let a=0,s="";const r=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function c(e){s+=""}function g(e){("start"===e.event?l:c)(e.node)}for(;e.length||n.length;){let n=o();if(s+=i(t.substring(a,n[0].offset)),a=n[0].offset,n===e){r.reverse().forEach(c);do{g(n.splice(0,1)[0]),n=o()}while(n===e&&n.length&&n[0].offset===a);r.reverse().forEach(l)}else"start"===n[0].event?r.push(n[0].node):r.pop(),g(n.splice(0,1)[0])}return s+i(t.substr(a))}(a,F(s),t)}};function q(e){return e.nodeName.toLowerCase()}function F(e){const n=[];return function e(t,a){for(let i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=e(i,a),q(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}const W={},Q=e=>{console.error(e)},X=(e,...n)=>{console.log(`WARN: ${e}`,...n)},V=(e,n)=>{W[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),W[`${e}/${n}`]=!0)},J=i,Y=s,ee=Symbol("nomatch");var ne=function(e){const t=Object.create(null),i=Object.create(null),s=[];let r=!0;const o=/(^(<[^>]+>|\t|)+|\n)/gm,l="Could not find the language '{}', did you forget to load/include a language module?",g={disableAutodetect:!0,name:"Plain text",contains:[]};let d={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:c};function u(e){return d.noHighlightRe.test(e)}function b(e,n,t,a){let i="",s="";"object"==typeof n?(i=e,t=n.ignoreIllegals,s=n.language,a=void 0):(V("10.7.0","highlight(lang, code, ...args) has been deprecated."),V("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,i=n);const r={code:i,language:s};O("before:highlight",r);const o=r.result?r.result:m(r.language,r.code,t,a);return o.code=r.code,O("after:highlight",o),o}function m(e,n,i,o){function c(e,n){const t=N.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function g(){null!=M.subLanguage?function(){if(""===R)return;let e=null;if("string"==typeof M.subLanguage){if(!t[M.subLanguage])return void k.addText(R);e=m(M.subLanguage,R,!0,O[M.subLanguage]),O[M.subLanguage]=e.top}else e=h(R,M.subLanguage.length?M.subLanguage:null);M.relevance>0&&(S+=e.relevance),k.addSublanguage(e.emitter,e.language)}():function(){if(!M.keywords)return void k.addText(R);let e=0;M.keywordPatternRe.lastIndex=0;let n=M.keywordPatternRe.exec(R),t="";for(;n;){t+=R.substring(e,n.index);const a=c(M,n);if(a){const[e,i]=a;if(k.addText(t),t="",S+=i,e.startsWith("_"))t+=n[0];else{const t=N.classNameAliases[e]||e;k.addKeyword(n[0],t)}}else t+=n[0];e=M.keywordPatternRe.lastIndex,n=M.keywordPatternRe.exec(R)}t+=R.substr(e),k.addText(t)}(),R=""}function u(e){return e.className&&k.openNode(N.classNameAliases[e.className]||e.className),M=Object.create(e,{parent:{value:M}}),M}function b(e,n,t){let i=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,t);if(i){if(e["on:end"]){const t=new a(e);e["on:end"](n,t),t.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,n,t)}function p(e){return 0===M.matcher.regexIndex?(R+=e[0],1):(C=!0,0)}function f(e){const n=e[0],t=e.rule,i=new a(t),s=[t.__beforeBegin,t["on:begin"]];for(const t of s)if(t&&(t(e,i),i.isMatchIgnored))return p(n);return t&&t.endSameAsBegin&&(t.endRe=new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),t.skip?R+=n:(t.excludeBegin&&(R+=n),g(),t.returnBegin||t.excludeBegin||(R=n)),u(t),t.returnBegin?0:n.length}function _(e){const t=e[0],a=n.substr(e.index),i=b(M,e,a);if(!i)return ee;const s=M;s.skip?R+=t:(s.returnEnd||s.excludeEnd||(R+=t),g(),s.excludeEnd&&(R=t));do{M.className&&k.closeNode(),M.skip||M.subLanguage||(S+=M.relevance),M=M.parent}while(M!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),u(i.starts)),s.returnEnd?0:t.length}let E={};function v(t,a){const s=a&&a[0];if(R+=t,null==s)return g(),0;if("begin"===E.type&&"end"===a.type&&E.index===a.index&&""===s){if(R+=n.slice(a.index,a.index+1),!r){const n=new Error("0 width match regex");throw n.languageName=e,n.badRule=E.rule,n}return 1}if(E=a,"begin"===a.type)return f(a);if("illegal"===a.type&&!i){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(M.className||"")+'"');throw e.mode=M,e}if("end"===a.type){const e=_(a);if(e!==ee)return e}if("illegal"===a.type&&""===s)return 1;if(T>1e5&&T>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return R+=s,s.length}const N=w(e);if(!N)throw Q(l.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=K(N,{plugins:s});let x="",M=o||y;const O={},k=new d.__emitter(d);!function(){const e=[];for(let n=M;n!==N;n=n.parent)n.className&&e.unshift(n.className);e.forEach((e=>k.openNode(e)))}();let R="",S=0,A=0,T=0,C=!1;try{for(M.matcher.considerAll();;){T++,C?C=!1:M.matcher.considerAll(),M.matcher.lastIndex=A;const e=M.matcher.exec(n);if(!e)break;const t=v(n.substring(A,e.index),e);A=e.index+t}return v(n.substr(A)),k.closeAllNodes(),k.finalize(),x=k.toHTML(),{relevance:Math.floor(S),value:x,language:e,illegal:!1,emitter:k,top:M}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(A-100,A+100),mode:t.mode},sofar:x,relevance:0,value:J(n),emitter:k};if(r)return{illegal:!1,relevance:0,value:J(n),emitter:k,language:e,top:M,errorRaised:t};throw t}}function h(e,n){n=n||d.languages||Object.keys(t);const a=function(e){const n={relevance:0,emitter:new d.__emitter(d),value:J(e),illegal:!1,top:g};return n.emitter.addText(e),n}(e),i=n.filter(w).filter(M).map((n=>m(n,e,!1)));i.unshift(a);const s=i.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(w(e.language).supersetOf===n.language)return 1;if(w(n.language).supersetOf===e.language)return-1}return 0})),[r,o]=s,l=r;return l.second_best=o,l}const p={"before:highlightElement":({el:e})=>{d.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:e})=>{d.useBR&&(e.value=e.value.replace(/\n/g,"
"))}},f=/^(<[^>]+>|\t)+/gm,_={"after:highlightElement":({result:e})=>{d.tabReplace&&(e.value=e.value.replace(f,(e=>e.replace(/\t/g,d.tabReplace))))}};function E(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=d.languageDetectRe.exec(n);if(t){const n=w(t[1]);return n||(X(l.replace("{}",t[1])),X("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>u(e)||w(e)))}(e);if(u(t))return;O("before:highlightElement",{el:e,language:t}),n=e;const a=n.textContent,s=t?b(a,{language:t,ignoreIllegals:!0}):h(a);O("after:highlightElement",{el:e,result:s,text:a}),e.innerHTML=s.value,function(e,n,t){const a=n?i[n]:t;e.classList.add("hljs"),a&&e.classList.add(a)}(e,t,s.language),e.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best&&(e.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance})}const v=()=>{if(v.called)return;v.called=!0,V("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(E)};let N=!1;function y(){if("loading"===document.readyState)return void(N=!0);document.querySelectorAll("pre code").forEach(E)}function w(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function x(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{i[e.toLowerCase()]=n}))}function M(e){const n=w(e);return n&&!n.disableAutodetect}function O(e,n){const t=e;s.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){N&&y()}),!1),Object.assign(e,{highlight:b,highlightAuto:h,highlightAll:y,fixMarkup:function(e){return V("10.2.0","fixMarkup will be removed entirely in v11.0"),V("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),n=e,d.tabReplace||d.useBR?n.replace(o,(e=>"\n"===e?d.useBR?"
":e:d.tabReplace?e.replace(/\t/g,d.tabReplace):e)):n;var n},highlightElement:E,highlightBlock:function(e){return V("10.7.0","highlightBlock will be removed entirely in v12.0"),V("10.7.0","Please use highlightElement now."),E(e)},configure:function(e){e.useBR&&(V("10.3.0","'useBR' will be removed entirely in v11.0"),V("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),d=Y(d,e)},initHighlighting:v,initHighlightingOnLoad:function(){V("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),N=!0},registerLanguage:function(n,a){let i=null;try{i=a(e)}catch(e){if(Q("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;Q(e),i=g}i.name||(i.name=n),t[n]=i,i.rawDefinition=a.bind(null,e),i.aliases&&x(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const n of Object.keys(i))i[n]===e&&delete i[n]},listLanguages:function(){return Object.keys(t)},getLanguage:w,registerAliases:x,requireLanguage:function(e){V("10.4.0","requireLanguage will be removed entirely in v11."),V("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const n=w(e);if(n)return n;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:M,inherit:Y,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),s.push(e)},vuePlugin:Z(e).VuePlugin}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString="10.7.3";for(const e in D)"object"==typeof D[e]&&n(D[e]);return Object.assign(e,D),e.addPlugin(p),e.addPlugin(G),e.addPlugin(_),e}({});function te(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var ae=function(e){const n=[{className:"strong",begin:/\*{2}([^\n]+?)\*{2}/},{className:"strong",begin:te(/\*\*/,/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,/\*\*/),relevance:0},{className:"strong",begin:/\B\*(\S|\S[^\n]*?\S)\*(?!\w)/},{className:"strong",begin:/\*[^\s]([^\n]+\n)+([^\n]+)\*/}],t=[{className:"emphasis",begin:/_{2}([^\n]+?)_{2}/},{className:"emphasis",begin:te(/__/,/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,/(_(?!_)|\\[^\n]|[^_\n\\])*/,/__/),relevance:0},{className:"emphasis",begin:/\b_(\S|\S[^\n]*?\S)_(?!\w)/},{className:"emphasis",begin:/_[^\s]([^\n]+\n)+([^\n]+)_/},{className:"emphasis",begin:"\\B'(?!['\\s])",end:"(\\n{2}|')",contains:[{begin:"\\\\'\\w",relevance:0}],relevance:0}];return{name:"AsciiDoc",aliases:["adoc"],contains:[e.COMMENT("^/{4,}\\n","\\n/{4,}$",{relevance:10}),e.COMMENT("^//","$",{relevance:0}),{className:"title",begin:"^\\.\\w.*$"},{begin:"^[=\\*]{4,}\\n",end:"\\n^[=\\*]{4,}$",relevance:10},{className:"section",relevance:10,variants:[{begin:"^(={1,6})[ \t].+?([ \t]\\1)?$"},{begin:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{className:"meta",begin:"^:.+?:",end:"\\s",excludeEnd:!0,relevance:10},{className:"meta",begin:"^\\[.+?\\]$",relevance:0},{className:"quote",begin:"^_{4,}\\n",end:"\\n_{4,}$",relevance:10},{className:"code",begin:"^[\\-\\.]{4,}\\n",end:"\\n[\\-\\.]{4,}$",relevance:10},{begin:"^\\+{4,}\\n",end:"\\n\\+{4,}$",contains:[{begin:"<",end:">",subLanguage:"xml",relevance:0}],relevance:10},{className:"bullet",begin:"^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"},{className:"symbol",begin:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",relevance:10},{begin:/\\[*_`]/},{begin:/\\\\\*{2}[^\n]*?\*{2}/},{begin:/\\\\_{2}[^\n]*_{2}/},{begin:/\\\\`{2}[^\n]*`{2}/},{begin:/[:;}][*_`](?![*_`])/},...n,...t,{className:"string",variants:[{begin:"``.+?''"},{begin:"`.+?'"}]},{className:"code",begin:/`{2}/,end:/(\n{2}|`{2})/},{className:"code",begin:"(`.+?`|\\+.+?\\+)",relevance:0},{className:"code",begin:"^[ \\t]",end:"$",relevance:0},{begin:"^'{3,}[ \\t]*$",relevance:10},{begin:"(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",returnBegin:!0,contains:[{begin:"(link|image:?):",relevance:0},{className:"link",begin:"\\w",end:"[^\\[]+",relevance:0},{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0,relevance:0}],relevance:10}]}};function ie(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var se=function(e){const n={},t={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:ie(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},t]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(s);const r={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},o=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[o,e.SHEBANG(),l,r,e.HASH_COMMENT_MODE,i,s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}};const re=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],oe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],le=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ce=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ge=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function de(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var ue=function(e){const n=(e=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]}}))(e),t=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[e.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},e.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+le.join("|")+")"},{begin:"::("+ce.join("|")+")"}]},{className:"attribute",begin:"\\b("+ge.join("|")+")\\b"},{begin:":",end:"[;}]",contains:[n.HEXCOLOR,n.IMPORTANT,e.CSS_NUMBER_MODE,...t,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},{className:"built_in",begin:/[\w-]+(?=\()/}]},{begin:de(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:oe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...t,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+re.join("|")+")\\b"}]}};var be=function(e){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}};var me=function(e){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:"from maintainer expose env arg user onbuild stopsignal",contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}function _e(e,n={}){return n.variants=e,n}var Ee=function(e){const n="[A-Za-z0-9_$]+",t=_e([e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]})]),a={className:"regexp",begin:/~?\/[^\/\n]+\//,contains:[e.BACKSLASH_ESCAPE]},i=_e([e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]),s=_e([{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:"\\$/",end:"/\\$",relevance:10},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE],{className:"string"});return{name:"Groovy",keywords:{built_in:"this super",literal:"true false null",keyword:"byte short char int long boolean float double void def as in assert trait abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},contains:[e.SHEBANG({binary:"groovy",relevance:10}),t,s,a,i,{className:"class",beginKeywords:"class interface trait enum",end:/\{/,illegal:":",contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{className:"meta",begin:"@[A-Za-z]+",relevance:0},{className:"attr",begin:n+"[ \t]*:",relevance:0},{begin:/\?/,end:/:/,relevance:0,contains:[t,s,a,i,"self"]},{className:"symbol",begin:"^[ \t]*"+fe(n+":"),excludeBegin:!0,end:n+":",relevance:0}],illegal:/#|<\//}};function ve(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var Ne=function(e){const n="HTTP/(2|1\\.[01])",t={className:"attribute",begin:ve("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},a=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+n+" \\d{3})",end:/$/,contains:[{className:"meta",begin:n},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:a}},{begin:"(?=^[A-Z]+ (.*?) "+n+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:n},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:a}},e.inherit(t,{relevance:0})]}},ye="\\.([0-9](_*[0-9])*)",we="[0-9a-fA-F](_*[0-9a-fA-F])*",xe={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${ye})|\\.)?|(${ye}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${ye})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ye})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${we})\\.?|(${we})?\\.(${we}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${we})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};var Me=function(e){var n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",a={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const i=xe;return{name:"Java",aliases:["jsp"],keywords:t,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"class",begin:"record\\s+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0,end:/[{;=]/,keywords:t,contains:[{beginKeywords:"record"},{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"function",begin:"([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:t,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},i,a]}};const Oe="[A-Za-z$_][0-9A-Za-z$_]*",ke=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Re=["true","false","null","undefined","NaN","Infinity"],Se=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function Ae(e){return Te("(?=",e,")")}function Te(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var Ce=function(e){const n=Oe,t="<>",a="",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];"<"!==a?">"===a&&(((e,{after:n})=>{const t="",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:p}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:t,end:a},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:s,contains:["self",e.inherit(e.TITLE_MODE,{begin:n}),f],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[f,e.inherit(e.TITLE_MODE,{begin:n})]},{variants:[{begin:"\\."+n},{begin:"\\$"+n}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:n}),"self",f]},{begin:"(get|set)\\s+(?="+n+"\\()",end:/\{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:n}),{begin:/\(\)/},f]},{begin:/\$[(.]/}]}};var De=function(e){const n={literal:"true false null"},t=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],a=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],i={end:",",endsWithParent:!0,excludeEnd:!0,contains:a,keywords:n},s={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(i,{begin:/:/})].concat(t),illegal:"\\S"},r={begin:"\\[",end:"\\]",contains:[e.inherit(i)],illegal:"\\S"};return a.push(s,r),t.forEach((function(e){a.push(e)})),{name:"JSON",contains:a,keywords:n,illegal:"\\S"}},Le="\\.([0-9](_*[0-9])*)",Be="[0-9a-fA-F](_*[0-9a-fA-F])*",$e={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${Le})|\\.)?|(${Le}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${Le})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Le})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${Be})\\.?|(${Be})?\\.(${Be}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Be})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};var Ie=function(e){const n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(s);const r={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"meta-string"})]}]},l=$e,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=g;return d.variants[1].contains=[g],g.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},t,r,o,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,r,o,s,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},r,o]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}};function je(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var ze=function(e){const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:je(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};a.contains.push(i),i.contains.push(a);let s=[n,t];return a.contains=a.contains.concat(s),i.contains=i.contains.concat(s),s=s.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}};var Pe=function(e){const n={keyword:"rec with let in inherit assert if else then",literal:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"},t={className:"subst",begin:/\$\{/,end:/\}/,keywords:n},a={className:"string",contains:[t],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}]},i=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,{begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/\S+/}]}];return t.contains=i,{name:"Nix",aliases:["nixos"],keywords:n,contains:i}};var Ue=function(e){const n={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},t={begin:"`[\\s\\S]",relevance:0},a={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},i={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[t,a,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},s={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},r=e.inherit(e.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[{className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]}]}),o={className:"built_in",variants:[{begin:"(".concat("Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",")+(-)[\\w\\d]+")}]},l={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[e.TITLE_MODE]},c={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:/\w[\w\d]*((-)[\w\d]+)*/,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[a]}]},g={begin:/using\s/,end:/$/,returnBegin:!0,contains:[i,s,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},d={variants:[{className:"operator",begin:"(".concat("-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",")\\b")},{className:"literal",begin:/(-)[\w\d]+/,relevance:0}]},u={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(n.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},e.inherit(e.TITLE_MODE,{endsParent:!0})]},b=[u,r,t,e.NUMBER_MODE,i,s,o,a,{className:"literal",begin:/\$(null|true|false)\b/},{className:"selector-tag",begin:/@\B/,relevance:0}],m={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",b,{begin:"("+["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"].join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return u.contains.unshift(m),{name:"PowerShell",aliases:["ps","ps1"],case_insensitive:!0,keywords:n,contains:b.concat(l,c,g,d,m)}};var Ke=function(e){var n="[ \\t\\f]*",t=n+"[:=]"+n,a="[ \\t\\f]+",i="("+t+"|"+"[ \\t\\f]+)",s="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",r="([^\\\\:= \\t\\f\\n]|\\\\.)+",o={end:i,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:s+t,relevance:1},{begin:s+a,relevance:0}],contains:[{className:"attr",begin:s,endsParent:!0,relevance:0}],starts:o},{begin:r+i,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:r,endsParent:!0,relevance:0}],starts:o},{className:"attr",relevance:0,begin:r+n+"$"}]}};function He(...e){return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}var Ze=function(e){const n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",t={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},a={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__","\\n$")],r={className:"subst",begin:/#\{/,end:/\}/,keywords:t},o={className:"string",contains:[e.BACKSLASH_ESCAPE,r],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,r]})]}]},l="[0-9](_?[0-9])*",c={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${l}))?([eE][+-]?(${l})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:t},d=[o,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(s)},{className:"function",begin:He(/def\s+/,(u=n+"\\s*(\\(|;|$)",He("(?=",u,")"))),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),g].concat(s)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[o,{begin:n}],relevance:0},c,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:t},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,r],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i,s),relevance:0}].concat(i,s);var u;r.contains=d,g.contains=d;const b=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",contains:d}}];return s.unshift(i),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:t,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(b).concat(s).concat(d)}};var Ge=function(e){const n={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},t={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,n]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[n],relevance:10}]},a={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},i={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},s={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[a]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[a]},i]},r={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[i]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"symbol",begin:"'\\w[\\w\\d_]*(?!')"},a,r,s,e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"}]}};var qe=function(e){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#]/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}};function Fe(e){return e?"string"==typeof e?e:e.source:null}function We(...e){return e.map((e=>Fe(e))).join("")}function Qe(...e){return"("+e.map((e=>Fe(e))).join("|")+")"}var Xe=function(e){const n=e.COMMENT("--","$"),t=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],r=i,o=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={begin:We(/\b/,Qe(...r),/\s*\(/),keywords:{built_in:r}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:n,when:t}={}){const a=t;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?`${e}|0`:e))}(o,{when:e=>e.length<3}),literal:t,type:a,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:Qe(...s),keywords:{$pattern:/[\w\.]+/,keyword:o.concat(s),literal:t,type:a}},{className:"type",begin:Qe("double precision","large object","with timezone","without timezone")},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}};function Ve(e){return e?"string"==typeof e?e:e.source:null}function Je(e){return Ye("(?=",e,")")}function Ye(...e){return e.map((e=>Ve(e))).join("")}function en(...e){return"("+e.map((e=>Ve(e))).join("|")+")"}var nn=function(e){const n=Ye(/[A-Z_]/,Ye("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),t={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),r=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),o={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[a,r,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,i,r,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[o],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[o],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Ye(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:o}]},{className:"tag",begin:Ye(/<\//,Je(Ye(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}};var tn=function(e){var n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},r={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},o={begin:/\{/,end:/\}/,contains:[r],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[r],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},s,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},o,l,a],g=[...c];return g.pop(),g.push(i),r.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}};!function(){"use strict";ne.registerLanguage("asciidoc",ae),ne.registerLanguage("bash",se),ne.registerLanguage("css",ue),ne.registerLanguage("diff",be),ne.registerLanguage("dockerfile",me),ne.registerLanguage("dos",he),ne.registerLanguage("gradle",pe),ne.registerLanguage("groovy",Ee),ne.registerLanguage("http",Ne),ne.registerLanguage("java",Me),ne.registerLanguage("javascript",Ce),ne.registerLanguage("json",De),ne.registerLanguage("kotlin",Ie),ne.registerLanguage("markdown",ze),ne.registerLanguage("nix",Pe),ne.registerLanguage("powershell",Ue),ne.registerLanguage("properties",Ke),ne.registerLanguage("ruby",Ze),ne.registerLanguage("scala",Ge),ne.registerLanguage("shell",qe),ne.registerLanguage("sql",Xe),ne.registerLanguage("xml",nn),ne.registerLanguage("yaml",tn),ne.configure({ignoreUnescapedHTML:!0});for(const e of document.querySelectorAll("pre.highlight > code"))ne.highlightBlock(e)}()}(); +!function(){"use strict";function t(t){const e=n('
');return t.prepend(e),e}function e(t,e){const o=t.querySelector(".title").textContent,c=t.querySelectorAll(".content").item(0),s=function(t,e,n){let o=t.nextElementSibling;for(;o;){if(o.matches(e))return o;if(o.matches(n))return;o=o.nextElementSibling}}(t,".colist",".listingblock");s&&c.append(s);const i=n('
'+o+"
");return i.dataset.blockName=o,c.dataset.blockName=o,e.append(i),{tabElement:i,content:c}}function n(t){const e=document.createElement("template");return e.innerHTML=t,e.content.firstChild}function o(t){let e=t.previousElementSibling;for(;e&&!e.classList.contains("primary");)e=e.previousElementSibling;return e}function c(t){const e=this.textContent;window.localStorage.setItem(t,e);for(const n of document.querySelectorAll(".tab"))i(n)===t&&n.textContent===e&&s(n)}function s(t){for(const e of t.parentNode.children)e.classList.remove("selected");t.classList.add("selected");for(const e of t.parentNode.parentNode.children)e.classList.contains("content")&&(t.dataset.blockName===e.dataset.blockName?e.classList.remove("hidden"):e.classList.add("hidden"))}function i(t){const e=[];for(t of t.parentNode.querySelectorAll(".tab"))e.push(t.textContent.toLowerCase());return e.sort().join("-")}window.addEventListener("load",(function(){(function(){for(const n of document.querySelectorAll(".primary")){if(n.querySelector("div.switch"))return void console.debug("Skipping tabs due to existing blockswitches");e(n,t(n)).tabElement.classList.add("selected"),n.querySelector(".title").remove(),n.classList.add("tabs-content")}for(const t of document.querySelectorAll(".secondary")){const n=o(t);if(n){const o=e(t,n.querySelector(".tabs"));o.content.classList.add("hidden"),n.append(o.content),t.remove()}else console.error("Found secondary block with no primary sibling")}})(),function(){for(const t of document.querySelectorAll(".tab")){const e=i(t);t.addEventListener("click",c.bind(t,e)),t.textContent===window.localStorage.getItem(e)&&s(t)}}()}))}(); +!function(){var t=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},e={};(function(t){(function(){var n="object"==typeof t&&t&&t.Object===Object&&t;e=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var n="object"==typeof self&&self&&self.Object===Object&&self,o=e||n||Function("return this")(),r=function(){return o.Date.now()},i=/\s/;var c=function(t){for(var e=t.length;e--&&i.test(t.charAt(e)););return e},u=/^\s+/;var a=function(t){return t?t.slice(0,c(t)+1).replace(u,""):t},l=o.Symbol,f=Object.prototype,d=f.hasOwnProperty,s=f.toString,m=l?l.toStringTag:void 0;var v=function(t){var e=d.call(t,m),n=t[m];try{t[m]=void 0;var o=!0}catch(t){}var r=s.call(t);return o&&(e?t[m]=n:delete t[m]),r},p=Object.prototype.toString;var g=function(t){return p.call(t)},h=l?l.toStringTag:void 0;var y=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":h&&h in Object(t)?v(t):g(t)};var w=function(t){return null!=t&&"object"==typeof t};var E=function(t){return"symbol"==typeof t||w(t)&&"[object Symbol]"==y(t)},b=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,j=/^0o[0-7]+$/i,x=parseInt;var S=function(e){if("number"==typeof e)return e;if(E(e))return NaN;if(t(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=t(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=a(e);var o=L.test(e);return o||j.test(e)?x(e.slice(2),o?2:8):b.test(e)?NaN:+e},T=Math.max,O=Math.min;var N=function(e,n,o){var i,c,u,a,l,f,d=0,s=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=c;return i=c=void 0,d=t,a=e.apply(o,n)}function g(t){return d=t,l=setTimeout(y,n),s?p(t):a}function h(t){var e=t-f;return void 0===f||e>=n||e<0||m&&t-d>=u}function y(){var t=r();if(h(t))return w(t);l=setTimeout(y,function(t){var e=n-(t-f);return m?O(e,u-(t-d)):e}(t))}function w(t){return l=void 0,v&&i?p(t):(i=c=void 0,a)}function E(){var t=r(),e=h(t);if(i=arguments,c=this,f=t,e){if(void 0===l)return g(f);if(m)return clearTimeout(l),l=setTimeout(y,n),p(f)}return void 0===l&&(l=setTimeout(y,n)),a}return n=S(n)||0,t(o)&&(s=!!o.leading,u=(m="maxWait"in o)?T(S(o.maxWait)||0,n):u,v="trailing"in o?!!o.trailing:v),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=f=c=l=void 0},E.flush=function(){return void 0===l?a:w(r())},E};var q=function(e,n,o){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return t(o)&&(r="leading"in o?!!o.leading:r,i="trailing"in o?!!o.trailing:i),N(e,n,{leading:r,maxWait:n,trailing:i})};!function(){"use strict";let t,e,n,o,r,i,c=null,u=!1;function a(){v();const t=r.get(window.location.hash),e=g(window.location.hash);t&&E(e)&&(u=!0,b("activating window location hash"),y(t.parentElement)),f()}window.addEventListener("load",(function(){if(t=document.querySelector("#toc"),e=document.querySelector("#toggle-toc"),n=document.querySelector("#content"),!t||!n)return;o=function(){const e=r(),o=[];for(let t=0;t<=e;t++)o.push("h"+(t+1)+"[id]");return n.querySelectorAll(o);function r(){let e=1;for(const n of t.querySelectorAll("ul","ol"))e=Math.max(e,i(n));return e}function i(e){let n=0;for(;e&&e!==t;)n+="UL"===e.nodeName||"OL"===e.nodeName?1:0,e=e.parentElement;return e?n:-1}}(),r=function(){const e=new Map;for(const n of t.querySelectorAll("li > a")){const t=n.getAttribute("href");t&&e.set(t,n)}return e}(),i=function(){const t=new Map;for(const e of o){const n=h(e);if(n){const o=r.get(n);if(o){const n=o.parentElement;t.set(e,n)}}}return t}(),a(),window.addEventListener("hashchange",a),window.addEventListener("scroll",l),window.addEventListener("scroll",f),window.addEventListener("resize",d),t.addEventListener("click",s),e.addEventListener("click",m)}));const l=q((function(){v(),u||p()}),50,{leading:!0}),f=N((function(){if(b("scrolling ended"),v(),u=!1,c){E(g(h(c)))||p()}else p()}),50),d=q((function(){v()}),50,{leading:!0});function s(t){if("A"===t.target.nodeName){const e=t.target.parentElement;if(e&&"back-to-index"===e.id)return;u=!0,b("activating clicked toc element"),y(t.target.parentElement)}}function m(t){t.stopPropagation();document.body.classList.toggle("show-toc")?document.documentElement.addEventListener("click",m):document.documentElement.removeEventListener("click",m)}function v(){const t=window.getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--layout-banner-height"),10);w()>=e?document.body.classList.add("fixed-toc"):document.body.classList.remove("fixed-toc")}function p(){b("activating top header element");const t=function(){const t=w()+45;for(let e=0;et)return o[e-1>=0?e-1:0];return o[o.length-1]}();y(i.get(t))}function g(t){for(let e=0;e=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)}function b(t){false}}()}(); +//# sourceMappingURL=site.js.map diff --git a/5.4.1/reference/html/js/site.js.map b/5.4.1/reference/html/js/site.js.map new file mode 100755 index 0000000000..89de67094d --- /dev/null +++ b/5.4.1/reference/html/js/site.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["site/src/main/js/site/anchorrewrite.js","site/anchorrewrite.js","site/src/main/js/site/author.js","site/author.js","site/node_modules/browser-pack-flat/_prelude","site/node_modules/lodash/_baseDelay.js","site/codetools.js","site/node_modules/lodash/identity.js","site/node_modules/lodash/_apply.js","site/node_modules/lodash/_overRest.js","site/node_modules/lodash/constant.js","site/node_modules/lodash/_freeGlobal.js","site/node_modules/lodash/_root.js","site/node_modules/lodash/_Symbol.js","site/node_modules/lodash/_getRawTag.js","site/node_modules/lodash/_objectToString.js","site/node_modules/lodash/_baseGetTag.js","site/node_modules/lodash/isObject.js","site/node_modules/lodash/isFunction.js","site/node_modules/lodash/_isMasked.js","site/node_modules/lodash/_coreJsData.js","site/node_modules/lodash/_toSource.js","site/node_modules/lodash/_baseIsNative.js","site/node_modules/lodash/_getValue.js","site/node_modules/lodash/_getNative.js","site/node_modules/lodash/_defineProperty.js","site/node_modules/lodash/_baseSetToString.js","site/node_modules/lodash/_shortOut.js","site/node_modules/lodash/_setToString.js","site/node_modules/lodash/_baseRest.js","site/node_modules/lodash/_trimmedEndIndex.js","site/node_modules/lodash/_baseTrim.js","site/node_modules/lodash/isObjectLike.js","site/node_modules/lodash/isSymbol.js","site/node_modules/lodash/toNumber.js","site/node_modules/lodash/delay.js","site/src/main/js/site/codetools.js","site/node_modules/browser-pack-flat/_postlude","site/node_modules/highlight.js/lib/core.js","site/highlight.js","site/node_modules/highlight.js/lib/languages/asciidoc.js","site/node_modules/highlight.js/lib/languages/bash.js","site/node_modules/highlight.js/lib/languages/css.js","site/node_modules/highlight.js/lib/languages/diff.js","site/node_modules/highlight.js/lib/languages/dockerfile.js","site/node_modules/highlight.js/lib/languages/dos.js","site/node_modules/highlight.js/lib/languages/gradle.js","site/node_modules/highlight.js/lib/languages/groovy.js","site/node_modules/highlight.js/lib/languages/http.js","site/node_modules/highlight.js/lib/languages/java.js","site/node_modules/highlight.js/lib/languages/javascript.js","site/node_modules/highlight.js/lib/languages/json.js","site/node_modules/highlight.js/lib/languages/kotlin.js","site/node_modules/highlight.js/lib/languages/markdown.js","site/node_modules/highlight.js/lib/languages/nix.js","site/node_modules/highlight.js/lib/languages/powershell.js","site/node_modules/highlight.js/lib/languages/properties.js","site/node_modules/highlight.js/lib/languages/ruby.js","site/node_modules/highlight.js/lib/languages/scala.js","site/node_modules/highlight.js/lib/languages/shell.js","site/node_modules/highlight.js/lib/languages/sql.js","site/node_modules/highlight.js/lib/languages/xml.js","site/node_modules/highlight.js/lib/languages/yaml.js","site/src/main/js/site/highlight.js","site/src/main/js/site/tabs.js","site/tabs.js","site/toc.js","site/node_modules/lodash/now.js","site/node_modules/lodash/debounce.js","site/node_modules/lodash/throttle.js","site/src/main/js/site/toc.js"],"names":["onChange","element","document","getElementById","anchor","window","location","hash","substr","rewrites","seen","console","debug","includes","error","push","updateAnchor","JSON","parse","innerHTML","addEventListener","candidate","lastAuthorElement","classList","contains","nextElementSibling","add","markLastAuthor","_$baseDelay_3","func","wait","args","TypeError","setTimeout","apply","undefined","_$identity_25","value","_$apply_2","thisArg","length","call","nativeMax","Math","max","_$overRest_17","start","transform","arguments","index","array","Array","otherArgs","this","_$constant_23","_$freeGlobal_11","global","freeGlobal","Object","self","freeSelf","_$root_18","Function","_$Symbol_1","Symbol","objectProto","prototype","hasOwnProperty","nativeObjectToString","toString","symToStringTag","toStringTag","_$getRawTag_13","isOwn","tag","unmasked","e","result","__nativeObjectToString_16","_$objectToString_16","__symToStringTag_4","_$baseGetTag_4","_$isObject_27","type","uid","_$isFunction_26","_$coreJsData_9","maskSrcKey","exec","keys","IE_PROTO","_$isMasked_15","funcToString","_$toSource_21","reIsHostCtor","__funcProto_5","__objectProto_5","__funcToString_5","__hasOwnProperty_5","reIsNative","RegExp","replace","_$baseIsNative_5","test","_$getValue_14","object","key","_$getNative_12","_$defineProperty_10","_$baseSetToString_7","string","configurable","enumerable","writable","nativeNow","Date","now","_$shortOut_20","count","lastCalled","stamp","remaining","_$setToString_19","reWhitespace","_$trimmedEndIndex_22","charAt","reTrimStart","_$baseTrim_8","slice","_$isObjectLike_28","_$isSymbol_29","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","_$toNumber_30","other","valueOf","isBinary","_$delay_24","_$baseRest_6","onCopyButtonClick","preElement","copy","querySelector","cloneNode","hideWhenFoldedElement","querySelectorAll","parentNode","removeChild","text","innerText","navigator","clipboard","writeText","then","markClicked","bind","clearClicked","remove","onFoldUnfoldButtonClick","codeElement","unfolding","toggle","updateFoldUnfoldButton","button","unfold","label","title","codeToolsElement","createElement","className","addButtons","appendChild","numberOfButtons","hasHideWhenFoldedSpans","foldUnfoldButton","createButton","addFoldUnfoldButton","copyButton","copiedPopup","addCopyButton","buttonElement","labelElement","createTextNode","addCodeToolElements","deepFreeze","obj","Map","clear","delete","set","Error","Set","freeze","getOwnPropertyNames","forEach","name","prop","isFrozen","deepFreezeEs6","_default","default","Response","constructor","mode","data","isMatchIgnored","ignoreMatch","escapeHTML","inherit","original","objects","create","emitsWrappingTags","node","kind","HTMLRenderer","parseTree","options","buffer","classPrefix","walk","addText","openNode","sublanguage","span","closeNode","TokenTree","rootNode","children","stack","top","root","pop","closeAllNodes","toJSON","stringify","builder","_walk","static","child","every","el","join","_collapse","TokenTreeEmitter","super","addKeyword","addSublanguage","emitter","toHTML","finalize","source","re","BACKREF_RE","IDENT_RE","UNDERSCORE_IDENT_RE","NUMBER_RE","C_NUMBER_RE","BINARY_NUMBER_RE","BACKSLASH_ESCAPE","begin","relevance","APOS_STRING_MODE","end","illegal","QUOTE_STRING_MODE","PHRASAL_WORDS_MODE","COMMENT","modeOptions","C_LINE_COMMENT_MODE","C_BLOCK_COMMENT_MODE","HASH_COMMENT_MODE","NUMBER_MODE","C_NUMBER_MODE","BINARY_NUMBER_MODE","CSS_NUMBER_MODE","REGEXP_MODE","TITLE_MODE","UNDERSCORE_TITLE_MODE","METHOD_GUARD","MODES","__proto__","MATCH_NOTHING_RE","RE_STARTERS_RE","SHEBANG","opts","beginShebang","binary","map","x","concat","m","resp","END_SAME_AS_BEGIN","assign","_beginMatch","skipIfhasPrecedingDot","match","response","input","beginKeywords","parent","split","__beforeBegin","keywords","compileIllegal","_parent","isArray","either","compileMatch","compileRelevance","COMMON_KEYWORDS","compileKeywords","rawKeywords","caseInsensitive","compiledKeywords","compileList","keywordList","toLowerCase","keyword","pair","scoreForKeyword","providedScore","Number","commonKeyword","compileLanguage","language","plugins","langRe","case_insensitive","MultiRegex","matchIndexes","regexes","matchAt","position","addRule","countMatchGroups","compile","terminators","matcherRe","regexps","separator","numCaptures","regex","offset","out","substring","String","lastIndex","s","i","findIndex","matchData","splice","ResumableMultiRegex","rules","multiRegexes","regexIndex","getMatcher","matcher","resumingScanAtSamePosition","considerAll","m2","compilerExtensions","classNameAliases","compileMode","cmode","isCompiled","ext","keywordPattern","$pattern","lexemes","keywordPatternRe","beginRe","endSameAsBegin","endsWithParent","endRe","terminatorEnd","illegalRe","c","variants","cachedVariants","variant","dependencyOnParent","starts","expandOrCloneMode","mm","term","rule","buildModeRegex","BuildVuePlugin","hljs","Component","props","detectedLanguage","unknownLanguage","computed","highlighted","autoDetect","getLanguage","warn","code","highlightAuto","highlight","ignoreIllegals","autodetect","Boolean","render","class","domProps","VuePlugin","install","Vue","component","mergeHTMLPlugin","originalStream","nodeStream","resultNode","processed","nodeStack","selectStream","event","open","attributeString","attr","nodeName","attributes","close","stream","reverse","mergeStreams","_nodeStream","firstChild","nextSibling","nodeType","nodeValue","seenDeprecations","message","log","deprecated","version","escape$1","inherit$1","NO_MATCH","_$highlight_1","languages","aliases","SAFE_MODE","fixMarkupRe","LANGUAGE_NOT_FOUND","PLAINTEXT_LANGUAGE","disableAutodetect","noHighlightRe","languageDetectRe","tabReplace","useBR","__emitter","shouldNotHighlight","languageName","codeOrlanguageName","optionsOrCode","continuation","context","fire","_highlight","codeToHighlight","keywordData","matchText","processBuffer","subLanguage","modeBuffer","continuations","processSubLanguage","buf","keywordRelevance","startsWith","cssClass","processKeywords","startNewMode","endOfMode","matchPlusRemainder","matched","lexeme","endsParent","doIgnore","resumeScanAtSamePosition","doBeginMatch","newMode","beforeCallbacks","cb","skip","excludeBegin","returnBegin","doEndMatch","endMode","origin","returnEnd","excludeEnd","lastMatch","processLexeme","textBeforeMatch","err","badRule","iterations","md","list","current","unshift","item","processContinuations","processedCount","floor","illegalBy","msg","sofar","errorRaised","languageSubset","plaintext","justTextHighlightResult","results","filter","autoDetection","sorted","sort","a","b","supersetOf","best","secondBest","second_best","brPlugin","TAB_REPLACE_RE","tabReplacePlugin","highlightElement","block","classes","find","_class","blockLanguage","textContent","currentLang","resultLang","updateClassName","relavance","initHighlighting","called","wantsHighlight","highlightAll","readyState","registerAliases","aliasList","alias","lang","plugin","fixMarkup","arg","html","highlightBlock","configure","userOptions","initHighlightingOnLoad","registerLanguage","languageDefinition","error$1","rawDefinition","unregisterLanguage","listLanguages","requireLanguage","addPlugin","upgradePluginAPI","vuePlugin","debugMode","safeMode","versionString","HLJS","__concat_2","__source_2","_$asciidoc_2","STRONG","EMPHASIS","__concat_3","__source_3","_$bash_3","VAR","BRACED_VAR","SUBST","HERE_DOC","QUOTE_STRING","ARITHMETIC","KNOWN_SHEBANG","FUNCTION","literal","built_in","TAGS","MEDIA_FEATURES","PSEUDO_CLASSES","PSEUDO_ELEMENTS","ATTRIBUTES","lookahead","__source_4","__concat_4","_$css_4","modes","IMPORTANT","HEXCOLOR","ATTRIBUTE_SELECTOR_MODE","__MODES_4","STRINGS","keyframePosition","attribute","_$diff_5","_$dockerfile_6","_$dos_7","_$gradle_8","__lookahead_9","__source_9","__concat_9","_$groovy_9","REGEXP","NUMBER","STRING","__concat_10","__source_10","_$http_10","VERSION","HEADER","HEADERS_AND_BODY","frac","hexDigits","NUMERIC","_$java_11","JAVA_IDENT_RE","KEYWORDS","ANNOTATION","__IDENT_RE_12","LITERALS","BUILT_INS","__lookahead_12","__concat_12","__source_12","_$javascript_12","IDENT_RE$1","FRAGMENT","XML_TAG","isTrulyOpeningTag","afterMatchIndex","nextChar","after","indexOf","hasClosingTag","KEYWORDS$1","decimalInteger","HTML_TEMPLATE","CSS_TEMPLATE","TEMPLATE_STRING","SUBST_INTERNALS","SUBST_AND_COMMENTS","PARAMS_CONTAINS","PARAMS","exports","_$json_13","ALLOWED_COMMENTS","TYPES","VALUE_CONTAINER","OBJECT","ARRAY","__frac_14","__hexDigits_14","__NUMERIC_14","_$kotlin_14","LABEL","VARIABLE","ANNOTATION_USE_SITE","KOTLIN_NUMBER_MODE","KOTLIN_NESTED_COMMENT","KOTLIN_PAREN_TYPE","KOTLIN_PAREN_TYPE2","__concat_15","__source_15","_$markdown_15","INLINE_HTML","LINK","BOLD","ITALIC","CONTAINABLE","_$nix_16","NIX_KEYWORDS","ANTIQUOTE","EXPRESSIONS","_$powershell_17","BACKTICK_ESCAPE","APOS_STRING","PS_COMMENT","CMDLETS","PS_CLASS","PS_FUNCTION","PS_USING","PS_ARGUMENTS","PS_METHODS","GENTLEMANS_SET","PS_TYPE","_$properties_18","WS0","EQUAL_DELIM","WS_DELIM","DELIM","KEY_ALPHANUM","KEY_OTHER","DELIM_AND_VALUE","__concat_19","__source_19","_$ruby_19","RUBY_METHOD_RE","RUBY_KEYWORDS","YARDOCTAG","IRB_OBJECT","COMMENT_MODES","digits","RUBY_DEFAULT_CONTAINS","IRB_DEFAULT","_$scala_20","TYPE","NAME","CLASS","METHOD","_$shell_21","__source_22","__concat_22","__either_22","_$sql_22","COMMENT_MODE","RESERVED_FUNCTIONS","COMBOS","FUNCTIONS","FUNCTION_CALL","exceptions","when","qualifyFn","reduceRelevancy","__source_23","__lookahead_23","__concat_23","__either_23","_$xml_23","TAG_NAME_RE","XML_ENTITIES","XML_META_KEYWORDS","XML_META_PAR_KEYWORDS","APOS_META_STRING_MODE","QUOTE_META_STRING_MODE","TAG_INTERNALS","_$yaml_24","URI_CHARACTERS","CONTAINER_STRING","TIMESTAMP","VALUE_MODES","ignoreUnescapedHTML","createTabsElement","primaryElement","tabsElement","createElementFromHtml","prepend","createTab","blockElement","content","colist","selector","stopSelector","sibling","matches","append","tabElement","dataset","blockName","template","findPrimaryElement","secondaryElement","previousElementSibling","onTabClick","tabId","localStorage","setItem","getTabId","select","id","tab","addTabs","getItem","configureTabs","_$isObject_10","_$freeGlobal_4","_$root_7","_$now_13","_$trimmedEndIndex_8","_$baseTrim_3","_$getRawTag_5","__nativeObjectToString_6","_$objectToString_6","__symToStringTag_2","_$baseGetTag_2","_$isObjectLike_11","_$isSymbol_12","_$toNumber_15","nativeMin","min","_$debounce_9","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","leadingEdge","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","clearTimeout","cancel","flush","_$throttle_14","tocElement","toggleTocElement","contentElement","headingElements","hrefToTocAnchorElement","headingElementToTocElement","lastActiveTocElement","disableOnScroll","onLocationHashChange","updateFixedPositionClass","tocAnchorElement","get","headingElement","getHeadingElementByHref","isInViewport","activateTocElement","parentElement","onEndScroll","maxHeadingLevel","getMaxHeadingLevel","headingSelectors","headingLevel","listElement","getHeadingLevel","findHeadingElements","href","getAttribute","buildHrefToTocAnchorElement","getChildAnchorHref","buildHeadingElementToTocElement","onScroll","onResize","onTocElementClick","onToggleTocClick","activateTopHeadingTocElement","target","stopPropagation","body","documentElement","removeEventListener","computedStyle","getComputedStyle","bannerHeight","getPropertyValue","getTop","topHeadingElement","topHeadingPos","offsetTop","getTopHeading","achorElement","deactivateTocElement","scrollTop","rect","getBoundingClientRect","bottom","innerHeight","clientHeight"],"mappings":"CAgBA,WACE,aAKA,SAASA,IACP,MAAMC,EAAUC,SAASC,eAAe,kBAClCC,EAASC,OAAOC,SAASC,KAAKC,OAAO,GACvCP,GAAWG,GAMjB,SAAsBA,EAAQK,GAC5B,MAAMC,EAAO,CAACN,GAEd,IADAO,QAAQC,MAAMR,GACPK,EAASL,IAAS,CAEvB,GADAA,EAASK,EAASL,GACdM,EAAKG,SAAST,GAEhB,YADAO,QAAQG,MAAM,mCAGhBJ,EAAKK,KAAKX,ECGZ,CDDAC,OAAOC,SAASC,KAAOH,CCGzB,CDlBIY,CAAaZ,EADGa,KAAKC,MAAMjB,EAAQkB,WCK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,KAAM,OAChB9I,SAAU,CACRkE,SAAU,gBACVnD,QACE,+DACFgR,QACE,aACFC,SAGE,6uBAeJ3jB,SAAU,CACRwjB,EACAtM,EAAK3G,UACLkT,EACAF,EACArM,EAAKxH,kBACL2T,EACAC,EA3EkB,CACpBla,UAAW,GACX2F,MAAO,OAGW,CAClB3F,UAAW,SACX2F,MAAO,IAAKG,IAAK,KAuEfgU,GF0wFN,EG76FA,MAuBMU,GAAO,CACX,IACA,OACA,UACA,UACA,QACA,QACA,IACA,aACA,OACA,SACA,SACA,UACA,OACA,OACA,KACA,MACA,UACA,MACA,MACA,KACA,KACA,KACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,SACA,SACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,OACA,OACA,MACA,SACA,KACA,IACA,IACA,QACA,OACA,UACA,OACA,SACA,UACA,MACA,QACA,QACA,KACA,WACA,QACA,KACA,QACA,OACA,KACA,KACA,MACA,SAGIC,GAAiB,CACrB,YACA,cACA,eACA,QACA,cACA,cACA,sBACA,gBACA,eACA,eACA,gBACA,OACA,SACA,QACA,kBACA,aACA,cACA,iBACA,kBACA,UACA,uBACA,mBACA,yBACA,+BACA,aACA,OACA,YACA,SACA,QAEA,YACA,YACA,aACA,cAIIC,GAAiB,CACrB,SACA,WACA,QACA,UACA,UACA,UACA,UACA,MACA,WACA,OACA,QACA,UACA,QACA,cACA,gBACA,aACA,SACA,QACA,gBACA,eACA,MACA,OACA,eACA,QACA,gBACA,WACA,UACA,KACA,OACA,aACA,eACA,OACA,OACA,aACA,MACA,YACA,UACA,iBACA,eACA,mBACA,cACA,aACA,eACA,WACA,eACA,OACA,oBACA,YACA,aACA,WACA,QACA,OACA,QACA,SACA,gBACA,eACA,QACA,UACA,SAIIC,GAAkB,CACtB,QACA,WACA,SACA,MACA,aACA,eACA,aACA,gBACA,SACA,OACA,cACA,YACA,UACA,kBAGIC,GAAa,CACjB,gBACA,cACA,aACA,YACA,kBACA,sBACA,qBACA,sBACA,4BACA,iBACA,uBACA,4BACA,OACA,sBACA,aACA,wBACA,kBACA,mBACA,mBACA,oBACA,sBACA,oBACA,kBACA,SACA,gBACA,sBACA,4BACA,6BACA,sBACA,sBACA,kBACA,eACA,eACA,sBACA,sBACA,qBACA,sBACA,qBACA,cACA,oBACA,oBACA,oBACA,gBACA,eACA,qBACA,qBACA,qBACA,iBACA,eACA,aACA,mBACA,yBACA,0BACA,mBACA,mBACA,eACA,SACA,uBACA,aACA,aACA,cACA,eACA,eACA,eACA,QACA,OACA,YACA,QACA,eACA,cACA,aACA,cACA,oBACA,oBACA,oBACA,cACA,eACA,UACA,UACA,oBACA,gBACA,SACA,YACA,UACA,cACA,SACA,OACA,aACA,iBACA,YACA,YACA,cACA,YACA,QACA,OACA,eACA,cACA,wBACA,eACA,yBACA,YACA,mBACA,iBACA,eACA,aACA,eACA,yBACA,0BACA,cACA,SACA,UACA,OACA,oBACA,kBACA,mBACA,WACA,UACA,UACA,kBACA,OACA,iBACA,cACA,aACA,mBACA,sBACA,kBACA,SACA,gBACA,cACA,eACA,aACA,QACA,OACA,aACA,YACA,aACA,YACA,WACA,YACA,WACA,YACA,SACA,OACA,SACA,aACA,kBACA,UACA,QACA,UACA,UACA,gBACA,iBACA,gBACA,gBACA,WACA,gBACA,aACA,aACA,UACA,iBACA,eACA,gBACA,cACA,mBACA,oBACA,oBACA,cACA,qBACA,iBACA,WACA,SACA,SACA,QACA,MACA,WACA,eACA,aACA,kBACA,kBACA,wBACA,uBACA,wBACA,cACA,gBACA,iBACA,cACA,iBACA,0BACA,MACA,YACA,mBACA,kBACA,aACA,mBACA,sBACA,sBACA,6BACA,eACA,iBACA,aACA,cACA,SACA,QACA,aACA,eACA,YACA,WAGAxK,UAsBF,SAASyK,GAAU1V,GACjB,OAOF,YAAmBhO,GAEjB,OADeA,EAAKoQ,KAAKC,GApB3B,SAAgBrC,GACd,OAAKA,EACa,iBAAPA,EAAwBA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X,UAAW,EACXhP,SAAU,CACRomB,EACAlP,EAAKjI,iBACLiI,EAAK9H,kBACLkW,EACApO,EAAKzH,uBAGTyH,EAAK1H,oBACL0H,EAAKzH,uBAGT6V,EACAc,GV2iIN,EW1tIA,MAAMC,GAAW,2BACXF,GAAW,CACf,KACA,KACA,KACA,KACA,MACA,QACA,UACA,MACA,MACA,WACA,KACA,SACA,OACA,OACA,QACA,QACA,aACA,OACA,QACA,OACA,UACA,MACA,SACA,WACA,SACA,SACA,MACA,QACA,QACA,QAIA,WACA,QACA,QACA,SACA,SACA,OACA,SACA,WAEIG,GAAW,CACf,OACA,QACA,OACA,YACA,MACA,YAoFIC,GAAY,GAAG1V,OAlCI,CACvB,cACA,aACA,gBACA,eAEA,UACA,UAEA,OACA,WACA,QACA,aACA,WACA,YACA,qBACA,YACA,qBACA,SACA,YAGyB,CACzB,YACA,OACA,QACA,UACA,SACA,WACA,eACA,SACA,UA9EY,CACZ,OACA,WACA,SACA,OACA,OACA,SACA,SACA,SACA,WACA,UACA,QACA,SACA,MACA,MACA,UACA,UACA,QACA,UACA,OACA,UACA,eACA,aACA,aACA,YACA,cACA,cACA,eACA,QACA,aACA,oBACA,cACA,gBACA,iBACA,UAGkB,CAClB,YACA,gBACA,aACA,iBACA,cACA,YACA,aAgEF,SAAS2V,GAAUjY,GACjB,OAAOkY,GAAO,MAAOlY,EAAI,IX+tI3B,CWxtIA,SAASkY,MAAUlmB,GAEjB,OADeA,EAAKoQ,KAAKC,IAAM8V,OApBjBnY,EAoBwBqC,GAlBpB,iBAAPrC,EAAwBA,EAE5BA,EAAGD,OAHM,KADlB,IAAgBC,CAoB0B,IAAEV,KAAK,GXguIjD,CW/yHA,IAAA8Y,GAraA,SAAoBzP,GAQlB,MAMM0P,EAAaP,GACbQ,EACG,KADHA,EAEC,MAEDC,EAAU,CACd/X,MAAO,sBACPG,IAAK,4BAKL6X,kBAAmB,CAAC3V,EAAOC,KACzB,MAAM2V,EAAkB5V,EAAM,GAAGpQ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EAAW,CACf,OACA,QAGA,WAUI2B,EAAQ,CACZ,SACA,SACA,OACA,UACA,OACA,YACA,OACA,OACA,MACA,WACA,UACA,QACA,MACA,UACA,WACA,QACA,QACA,WACA,UACA,OACA,MACA,WACA,OACA,YACA,UACA,UACA,aAmYIqE,EAAqB,CACzB,MACA,OACA,YACA,OACA,OACA,MACA,OACA,OACA,UACA,WACA,OACA,MACA,OACA,QACA,YACA,aACA,YACA,aACA,QACA,UACA,MACA,UACA,cACA,QACA,aACA,gBACA,cACA,cACA,iBACA,aACA,aACA,uBACA,aACA,MACA,aACA,OACA,UACA,KACA,MACA,QACA,QACA,MACA,MACA,MACA,YACA,QACA,SACA,eACA,kBACA,kBACA,WACA,iBACA,QACA,OACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,aACA,MACA,OACA,OACA,aACA,cACA,YACA,kBACA,MACA,MACA,OACA,YACA,kBACA,QACA,OACA,aACA,SACA,QACA,WACA,UACA,WACA,gBAwBIC,EAAS,CACb,eACA,cACA,cACA,cACA,WACA,cACA,iBACA,gBACA,cACA,gBACA,gBACA,eACA,cACA,aACA,cACA,iBAGIC,EAAYF,EAEZnG,EAAW,CArff,MACA,OACA,MACA,WACA,QACA,MACA,MACA,MACA,QACA,YACA,wBACA,KACA,aACA,OACA,aACA,KACA,OACA,SACA,gBACA,MACA,QACA,cACA,kBACA,UACA,SACA,SACA,OACA,UACA,OACA,KACA,OACA,SACA,cACA,WACA,OACA,OACA,OACA,UACA,OACA,cACA,YACA,mBACA,QACA,aACA,OACA,QACA,WACA,UACA,UACA,SACA,SACA,YACA,UACA,aACA,WACA,UACA,OACA,OACA,gBACA,MACA,OACA,QACA,YACA,aACA,SACA,QACA,OACA,YACA,UACA,kBACA,eACA,kCACA,eACA,eACA,cACA,iBACA,eACA,oBACA,eACA,eACA,mCACA,eACA,SACA,QACA,OACA,MACA,aACA,MACA,UACA,WACA,UACA,UACA,SACA,SACA,aACA,QACA,WACA,gBACA,aACA,WACA,SACA,OACA,UACA,OACA,UACA,OACA,QACA,MACA,YACA,gBACA,WACA,SACA,SACA,QACA,SACA,OACA,UACA,SACA,MACA,WACA,UACA,QACA,QACA,SACA,cACA,QACA,QACA,MACA,UACA,YACA,OACA,OACA,OACA,WACA,SACA,MACA,SACA,QACA,QACA,WACA,SACA,SACA,OACA,OACA,WACA,KACA,YACA,UACA,QACA,QACA,cACA,SACA,MACA,UACA,YACA,eACA,WACA,OACA,KACA,OACA,aACA,gBACA,cACA,cACA,iBACA,aACA,aACA,uBACA,aACA,MACA,WACA,QACA,aACA,UACA,OACA,UACA,OACA,OACA,aACA,UACA,KACA,QACA,YACA,iBACA,MACA,QACA,QACA,QACA,eACA,kBACA,UACA,MACA,SACA,QACA,SACA,MACA,SACA,MACA,WACA,SACA,QACA,WACA,WACA,UACA,QACA,QACA,MACA,KACA,OACA,YACA,MACA,YACA,QACA,OACA,SACA,UACA,eACA,oBACA,KACA,SACA,MACA,OACA,KACA,MACA,OACA,OACA,KACA,QACA,MACA,QACA,OACA,WACA,UACA,YACA,YACA,UACA,MACA,UACA,eACA,kBACA,kBACA,SACA,UACA,WACA,iBACA,QACA,WACA,YACA,UACA,UACA,YACA,MACA,QACA,OACA,QACA,OACA,YACA,MACA,aACA,cACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,UACA,SACA,SACA,UACA,SACA,QACA,WACA,SACA,MACA,aACA,OACA,UACA,YACA,QACA,SACA,SACA,SACA,OACA,SACA,YACA,eACA,MACA,OACA,UACA,MACA,OACA,OACA,WACA,OACA,WACA,eACA,MACA,eACA,WACA,aACA,OACA,QACA,SACA,aACA,cACA,cACA,SACA,YACA,kBACA,WACA,MACA,YACA,SACA,cACA,cACA,QACA,cACA,MACA,OACA,OACA,OACA,YACA,gBACA,kBACA,KACA,WACA,YACA,kBACA,cACA,QACA,UACA,OACA,aACA,OACA,WACA,UACA,QACA,SACA,UACA,SACA,YACA,QACA,OACA,QACA,QACA,SACA,WACA,UACA,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B,GACxDh0B,EAAQg1B,cAAc1zB,UAAUG,IAAI,YACpCzB,EAAUA,EAAQg1B,aJumBxB,CIxlBA,SAAS4B,IACP,OAAO32B,SAASq2B,gBAAgBa,WAAal3B,SAASo2B,KAAKc,SJ2lB7D,CIxlBA,SAASrC,EAAa90B,GACpB,IAAKA,EACH,OAAO,EAET,MAAMo3B,EAAOp3B,EAAQq3B,wBACrB,OACED,EAAK5oB,KAAO,GACZ4oB,EAAKE,SACFl3B,OAAOm3B,aAAet3B,SAASq2B,gBAAgBkB,aJ4lBtD,CIxlBA,SAAS72B,EAAM4a,GArPG,KJm1BlB,CIzlBD,CAhQD,EjCfA,CjCDA","file":"site.js","sourcesContent":["/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n window.addEventListener(\"load\", onChange);\n window.addEventListener(\"hashchange\", onChange);\n\n function onChange() {\n const element = document.getElementById(\"anchor-rewrite\");\n const anchor = window.location.hash.substr(1);\n if (element && anchor) {\n const rewites = JSON.parse(element.innerHTML);\n updateAnchor(anchor, rewites);\n }\n }\n\n function updateAnchor(anchor, rewrites) {\n const seen = [anchor];\n console.debug(anchor);\n while (rewrites[anchor]) {\n anchor = rewrites[anchor];\n if (seen.includes(anchor)) {\n console.error(\"Skipping circular anchor update\");\n return;\n }\n seen.push(anchor);\n }\n window.location.hash = anchor;\n }\n})();\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n window.addEventListener(\"load\", onChange);\n window.addEventListener(\"hashchange\", onChange);\n\n function onChange() {\n const element = document.getElementById(\"anchor-rewrite\");\n const anchor = window.location.hash.substr(1);\n if (element && anchor) {\n const rewites = JSON.parse(element.innerHTML);\n updateAnchor(anchor, rewites);\n }\n }\n\n function updateAnchor(anchor, rewrites) {\n const seen = [anchor];\n console.debug(anchor);\n while (rewrites[anchor]) {\n anchor = rewrites[anchor];\n if (seen.includes(anchor)) {\n console.error(\"Skipping circular anchor update\");\n return;\n }\n seen.push(anchor);\n }\n window.location.hash = anchor;\n }\n})();\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n markLastAuthor();\n\n function markLastAuthor() {\n let candidate = document.getElementById(\"author\");\n let lastAuthorElement = candidate;\n while (candidate) {\n if (candidate.classList.contains(\"author\")) {\n lastAuthorElement = candidate;\n }\n candidate = candidate.nextElementSibling;\n }\n if (lastAuthorElement) {\n lastAuthorElement.classList.add(\"last-author\");\n }\n }\n})();\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n markLastAuthor();\n\n function markLastAuthor() {\n let candidate = document.getElementById(\"author\");\n let lastAuthorElement = candidate;\n while (candidate) {\n if (candidate.classList.contains(\"author\")) {\n lastAuthorElement = candidate;\n }\n candidate = candidate.nextElementSibling;\n }\n if (lastAuthorElement) {\n lastAuthorElement.classList.add(\"last-author\");\n }\n }\n})();\n","(function(){\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n const delay = require(\"lodash/delay\");\n\n addCodeToolElements();\n\n function addCodeToolElements() {\n for (const preElement of document.querySelectorAll(\".doc pre.highlight\")) {\n const codeToolsElement = document.createElement(\"div\");\n codeToolsElement.className = \"codetools\";\n if (addButtons(preElement, codeToolsElement)) {\n preElement.appendChild(codeToolsElement);\n }\n }\n\n function addButtons(preElement, codeToolsElement) {\n let numberOfButtons = 0;\n if (hasHideWhenFoldedSpans(preElement)) {\n addFoldUnfoldButton(preElement, codeToolsElement);\n numberOfButtons++;\n }\n if (window.navigator.clipboard) {\n addCopyButton(preElement, codeToolsElement);\n numberOfButtons++;\n }\n return numberOfButtons > 0;\n }\n\n function hasHideWhenFoldedSpans(preElement) {\n return !!preElement.querySelector(\"span.hide-when-folded\");\n }\n\n function addFoldUnfoldButton(preElement, codeToolsElement) {\n const foldUnfoldButton = createButton();\n updateFoldUnfoldButton(foldUnfoldButton, true);\n foldUnfoldButton.addEventListener(\n \"click\",\n onFoldUnfoldButtonClick.bind(foldUnfoldButton, preElement)\n );\n codeToolsElement.appendChild(foldUnfoldButton);\n }\n\n function addCopyButton(preElement, codeToolsElement) {\n const copyButton = createButton(\"Copy to clipboard\", \"copy-button\");\n copyButton.addEventListener(\n \"click\",\n onCopyButtonClick.bind(copyButton, preElement)\n );\n copyButton.addEventListener(\"mouseleave\", clearClicked.bind(copyButton));\n copyButton.addEventListener(\"blur\", clearClicked.bind(copyButton));\n const copiedPopup = document.createElement(\"span\");\n copyButton.appendChild(copiedPopup);\n copiedPopup.className = \"copied\";\n codeToolsElement.appendChild(copyButton);\n }\n\n function createButton(label, className) {\n const buttonElement = document.createElement(\"button\");\n buttonElement.className = className;\n buttonElement.title = label;\n buttonElement.type = \"button\";\n const labelElement = document.createElement(\"span\");\n labelElement.appendChild(document.createTextNode(label));\n labelElement.className = \"label\";\n buttonElement.appendChild(labelElement);\n return buttonElement;\n }\n }\n\n function onCopyButtonClick(preElement) {\n const codeElement = preElement.querySelector(\"code\");\n const copy = codeElement.cloneNode(true);\n for (const hideWhenFoldedElement of copy.querySelectorAll(\n \".hide-when-unfolded\"\n )) {\n hideWhenFoldedElement.parentNode.removeChild(hideWhenFoldedElement);\n }\n const text = copy.innerText;\n if (text) {\n window.navigator.clipboard\n .writeText(text + \"\\n\")\n .then(markClicked.bind(this));\n }\n }\n\n function markClicked() {\n this.classList.add(\"clicked\");\n }\n\n function clearClicked() {\n this.classList.remove(\"clicked\");\n }\n\n function onFoldUnfoldButtonClick(preElement) {\n const codeElement = preElement.querySelector(\"code\");\n const unfolding = !codeElement.classList.contains(\"unfolded\");\n codeElement.classList.remove(unfolding ? \"folding\" : \"unfolding\");\n codeElement.classList.add(unfolding ? \"unfolding\" : \"folding\");\n delay(function () {\n codeElement.classList.remove(unfolding ? \"unfolding\" : \"folding\");\n codeElement.classList.toggle(\"unfolded\");\n }, 1100);\n updateFoldUnfoldButton(this, !unfolding);\n }\n\n function updateFoldUnfoldButton(button, unfold) {\n const label = unfold ? \"Expand folded text\" : \"Collapse foldable text\";\n button.classList.remove(unfold ? \"fold-button\" : \"unfold-button\");\n button.classList.add(unfold ? \"unfold-button\" : \"fold-button\");\n button.querySelector(\"span.label\").innerText = label;\n button.title = label;\n }\n})();\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest'),\n toNumber = require('./toNumber');\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nmodule.exports = delay;\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n \"use strict\";\n\n const delay = require(\"lodash/delay\");\n\n addCodeToolElements();\n\n function addCodeToolElements() {\n for (const preElement of document.querySelectorAll(\".doc pre.highlight\")) {\n const codeToolsElement = document.createElement(\"div\");\n codeToolsElement.className = \"codetools\";\n if (addButtons(preElement, codeToolsElement)) {\n preElement.appendChild(codeToolsElement);\n }\n }\n\n function addButtons(preElement, codeToolsElement) {\n let numberOfButtons = 0;\n if (hasHideWhenFoldedSpans(preElement)) {\n addFoldUnfoldButton(preElement, codeToolsElement);\n numberOfButtons++;\n }\n if (window.navigator.clipboard) {\n addCopyButton(preElement, codeToolsElement);\n numberOfButtons++;\n }\n return numberOfButtons > 0;\n }\n\n function hasHideWhenFoldedSpans(preElement) {\n return !!preElement.querySelector(\"span.hide-when-folded\");\n }\n\n function addFoldUnfoldButton(preElement, codeToolsElement) {\n const foldUnfoldButton = createButton();\n updateFoldUnfoldButton(foldUnfoldButton, true);\n foldUnfoldButton.addEventListener(\n \"click\",\n onFoldUnfoldButtonClick.bind(foldUnfoldButton, preElement)\n );\n codeToolsElement.appendChild(foldUnfoldButton);\n }\n\n function addCopyButton(preElement, codeToolsElement) {\n const copyButton = createButton(\"Copy to clipboard\", \"copy-button\");\n copyButton.addEventListener(\n \"click\",\n onCopyButtonClick.bind(copyButton, preElement)\n );\n copyButton.addEventListener(\"mouseleave\", clearClicked.bind(copyButton));\n copyButton.addEventListener(\"blur\", clearClicked.bind(copyButton));\n const copiedPopup = document.createElement(\"span\");\n copyButton.appendChild(copiedPopup);\n copiedPopup.className = \"copied\";\n codeToolsElement.appendChild(copyButton);\n }\n\n function createButton(label, className) {\n const buttonElement = document.createElement(\"button\");\n buttonElement.className = className;\n buttonElement.title = label;\n buttonElement.type = \"button\";\n const labelElement = document.createElement(\"span\");\n labelElement.appendChild(document.createTextNode(label));\n labelElement.className = \"label\";\n buttonElement.appendChild(labelElement);\n return buttonElement;\n }\n }\n\n function onCopyButtonClick(preElement) {\n const codeElement = preElement.querySelector(\"code\");\n const copy = codeElement.cloneNode(true);\n for (const hideWhenFoldedElement of copy.querySelectorAll(\n \".hide-when-unfolded\"\n )) {\n hideWhenFoldedElement.parentNode.removeChild(hideWhenFoldedElement);\n }\n const text = copy.innerText;\n if (text) {\n window.navigator.clipboard\n .writeText(text + \"\\n\")\n .then(markClicked.bind(this));\n }\n }\n\n function markClicked() {\n this.classList.add(\"clicked\");\n }\n\n function clearClicked() {\n this.classList.remove(\"clicked\");\n }\n\n function onFoldUnfoldButtonClick(preElement) {\n const codeElement = preElement.querySelector(\"code\");\n const unfolding = !codeElement.classList.contains(\"unfolded\");\n codeElement.classList.remove(unfolding ? \"folding\" : \"unfolding\");\n codeElement.classList.add(unfolding ? \"unfolding\" : \"folding\");\n delay(function () {\n codeElement.classList.remove(unfolding ? \"unfolding\" : \"folding\");\n codeElement.classList.toggle(\"unfolded\");\n }, 1100);\n updateFoldUnfoldButton(this, !unfolding);\n }\n\n function updateFoldUnfoldButton(button, unfold) {\n const label = unfold ? \"Expand folded text\" : \"Collapse foldable text\";\n button.classList.remove(unfold ? \"fold-button\" : \"unfold-button\");\n button.classList.add(unfold ? \"unfold-button\" : \"fold-button\");\n button.querySelector(\"span.label\").innerText = label;\n button.title = label;\n }\n})();\n","\n}());","function deepFreeze(obj) {\n if (obj instanceof Map) {\n obj.clear = obj.delete = obj.set = function () {\n throw new Error('map is read-only');\n };\n } else if (obj instanceof Set) {\n obj.add = obj.clear = obj.delete = function () {\n throw new Error('set is read-only');\n };\n }\n\n // Freeze self\n Object.freeze(obj);\n\n Object.getOwnPropertyNames(obj).forEach(function (name) {\n var prop = obj[name];\n\n // Freeze prop if it is an object\n if (typeof prop == 'object' && !Object.isFrozen(prop)) {\n deepFreeze(prop);\n }\n });\n\n return obj;\n}\n\nvar deepFreezeEs6 = deepFreeze;\nvar _default = deepFreeze;\ndeepFreezeEs6.default = _default;\n\n/** @implements CallbackResponse */\nclass Response {\n /**\n * @param {CompiledMode} mode\n */\n constructor(mode) {\n // eslint-disable-next-line no-undefined\n if (mode.data === undefined) mode.data = {};\n\n this.data = mode.data;\n this.isMatchIgnored = false;\n }\n\n ignoreMatch() {\n this.isMatchIgnored = true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {string}\n */\nfunction escapeHTML(value) {\n return value\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\n/**\n * performs a shallow merge of multiple objects into one\n *\n * @template T\n * @param {T} original\n * @param {Record[]} objects\n * @returns {T} a single new object\n */\nfunction inherit(original, ...objects) {\n /** @type Record */\n const result = Object.create(null);\n\n for (const key in original) {\n result[key] = original[key];\n }\n objects.forEach(function(obj) {\n for (const key in obj) {\n result[key] = obj[key];\n }\n });\n return /** @type {T} */ (result);\n}\n\n/**\n * @typedef {object} Renderer\n * @property {(text: string) => void} addText\n * @property {(node: Node) => void} openNode\n * @property {(node: Node) => void} closeNode\n * @property {() => string} value\n */\n\n/** @typedef {{kind?: string, sublanguage?: boolean}} Node */\n/** @typedef {{walk: (r: Renderer) => void}} Tree */\n/** */\n\nconst SPAN_CLOSE = '
';\n\n/**\n * Determines if a node needs to be wrapped in \n *\n * @param {Node} node */\nconst emitsWrappingTags = (node) => {\n return !!node.kind;\n};\n\n/** @type {Renderer} */\nclass HTMLRenderer {\n /**\n * Creates a new HTMLRenderer\n *\n * @param {Tree} parseTree - the parse tree (must support `walk` API)\n * @param {{classPrefix: string}} options\n */\n constructor(parseTree, options) {\n this.buffer = \"\";\n this.classPrefix = options.classPrefix;\n parseTree.walk(this);\n }\n\n /**\n * Adds texts to the output stream\n *\n * @param {string} text */\n addText(text) {\n this.buffer += escapeHTML(text);\n }\n\n /**\n * Adds a node open to the output stream (if needed)\n *\n * @param {Node} node */\n openNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n let className = node.kind;\n if (!node.sublanguage) {\n className = `${this.classPrefix}${className}`;\n }\n this.span(className);\n }\n\n /**\n * Adds a node close to the output stream (if needed)\n *\n * @param {Node} node */\n closeNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n this.buffer += SPAN_CLOSE;\n }\n\n /**\n * returns the accumulated buffer\n */\n value() {\n return this.buffer;\n }\n\n // helpers\n\n /**\n * Builds a span element\n *\n * @param {string} className */\n span(className) {\n this.buffer += ``;\n }\n}\n\n/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */\n/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */\n/** */\n\nclass TokenTree {\n constructor() {\n /** @type DataNode */\n this.rootNode = { children: [] };\n this.stack = [this.rootNode];\n }\n\n get top() {\n return this.stack[this.stack.length - 1];\n }\n\n get root() { return this.rootNode; }\n\n /** @param {Node} node */\n add(node) {\n this.top.children.push(node);\n }\n\n /** @param {string} kind */\n openNode(kind) {\n /** @type Node */\n const node = { kind, children: [] };\n this.add(node);\n this.stack.push(node);\n }\n\n closeNode() {\n if (this.stack.length > 1) {\n return this.stack.pop();\n }\n // eslint-disable-next-line no-undefined\n return undefined;\n }\n\n closeAllNodes() {\n while (this.closeNode());\n }\n\n toJSON() {\n return JSON.stringify(this.rootNode, null, 4);\n }\n\n /**\n * @typedef { import(\"./html_renderer\").Renderer } Renderer\n * @param {Renderer} builder\n */\n walk(builder) {\n // this does not\n return this.constructor._walk(builder, this.rootNode);\n // this works\n // return TokenTree._walk(builder, this.rootNode);\n }\n\n /**\n * @param {Renderer} builder\n * @param {Node} node\n */\n static _walk(builder, node) {\n if (typeof node === \"string\") {\n builder.addText(node);\n } else if (node.children) {\n builder.openNode(node);\n node.children.forEach((child) => this._walk(builder, child));\n builder.closeNode(node);\n }\n return builder;\n }\n\n /**\n * @param {Node} node\n */\n static _collapse(node) {\n if (typeof node === \"string\") return;\n if (!node.children) return;\n\n if (node.children.every(el => typeof el === \"string\")) {\n // node.text = node.children.join(\"\");\n // delete node.children;\n node.children = [node.children.join(\"\")];\n } else {\n node.children.forEach((child) => {\n TokenTree._collapse(child);\n });\n }\n }\n}\n\n/**\n Currently this is all private API, but this is the minimal API necessary\n that an Emitter must implement to fully support the parser.\n\n Minimal interface:\n\n - addKeyword(text, kind)\n - addText(text)\n - addSublanguage(emitter, subLanguageName)\n - finalize()\n - openNode(kind)\n - closeNode()\n - closeAllNodes()\n - toHTML()\n\n*/\n\n/**\n * @implements {Emitter}\n */\nclass TokenTreeEmitter extends TokenTree {\n /**\n * @param {*} options\n */\n constructor(options) {\n super();\n this.options = options;\n }\n\n /**\n * @param {string} text\n * @param {string} kind\n */\n addKeyword(text, kind) {\n if (text === \"\") { return; }\n\n this.openNode(kind);\n this.addText(text);\n this.closeNode();\n }\n\n /**\n * @param {string} text\n */\n addText(text) {\n if (text === \"\") { return; }\n\n this.add(text);\n }\n\n /**\n * @param {Emitter & {root: DataNode}} emitter\n * @param {string} name\n */\n addSublanguage(emitter, name) {\n /** @type DataNode */\n const node = emitter.root;\n node.kind = name;\n node.sublanguage = true;\n this.add(node);\n }\n\n toHTML() {\n const renderer = new HTMLRenderer(this, this.options);\n return renderer.value();\n }\n\n finalize() {\n return true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {RegExp}\n * */\nfunction escape(value) {\n return new RegExp(value.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] } args\n * @returns {string}\n */\nfunction either(...args) {\n const joined = '(' + args.map((x) => source(x)).join(\"|\") + \")\";\n return joined;\n}\n\n/**\n * @param {RegExp} re\n * @returns {number}\n */\nfunction countMatchGroups(re) {\n return (new RegExp(re.toString() + '|')).exec('').length - 1;\n}\n\n/**\n * Does lexeme start with a regular expression match at the beginning\n * @param {RegExp} re\n * @param {string} lexeme\n */\nfunction startsWith(re, lexeme) {\n const match = re && re.exec(lexeme);\n return match && match.index === 0;\n}\n\n// BACKREF_RE matches an open parenthesis or backreference. To avoid\n// an incorrect parse, it additionally matches the following:\n// - [...] elements, where the meaning of parentheses and escapes change\n// - other escape sequences, so we do not misparse escape sequences as\n// interesting elements\n// - non-matching or lookahead parentheses, which do not capture. These\n// follow the '(' with a '?'.\nconst BACKREF_RE = /\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./;\n\n// join logically computes regexps.join(separator), but fixes the\n// backreferences so they continue to match.\n// it also places each individual regular expression into it's own\n// match group, keeping track of the sequencing of those match groups\n// is currently an exercise for the caller. :-)\n/**\n * @param {(string | RegExp)[]} regexps\n * @param {string} separator\n * @returns {string}\n */\nfunction join(regexps, separator = \"|\") {\n let numCaptures = 0;\n\n return regexps.map((regex) => {\n numCaptures += 1;\n const offset = numCaptures;\n let re = source(regex);\n let out = '';\n\n while (re.length > 0) {\n const match = BACKREF_RE.exec(re);\n if (!match) {\n out += re;\n break;\n }\n out += re.substring(0, match.index);\n re = re.substring(match.index + match[0].length);\n if (match[0][0] === '\\\\' && match[1]) {\n // Adjust the backreference.\n out += '\\\\' + String(Number(match[1]) + offset);\n } else {\n out += match[0];\n if (match[0] === '(') {\n numCaptures++;\n }\n }\n }\n return out;\n }).map(re => `(${re})`).join(separator);\n}\n\n// Common regexps\nconst MATCH_NOTHING_RE = /\\b\\B/;\nconst IDENT_RE = '[a-zA-Z]\\\\w*';\nconst UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\\\w*';\nconst NUMBER_RE = '\\\\b\\\\d+(\\\\.\\\\d+)?';\nconst C_NUMBER_RE = '(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)'; // 0x..., 0..., decimal, float\nconst BINARY_NUMBER_RE = '\\\\b(0b[01]+)'; // 0b...\nconst RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~';\n\n/**\n* @param { Partial & {binary?: string | RegExp} } opts\n*/\nconst SHEBANG = (opts = {}) => {\n const beginShebang = /^#![ ]*\\//;\n if (opts.binary) {\n opts.begin = concat(\n beginShebang,\n /.*\\b/,\n opts.binary,\n /\\b.*/);\n }\n return inherit({\n className: 'meta',\n begin: beginShebang,\n end: /$/,\n relevance: 0,\n /** @type {ModeCallback} */\n \"on:begin\": (m, resp) => {\n if (m.index !== 0) resp.ignoreMatch();\n }\n }, opts);\n};\n\n// Common modes\nconst BACKSLASH_ESCAPE = {\n begin: '\\\\\\\\[\\\\s\\\\S]', relevance: 0\n};\nconst APOS_STRING_MODE = {\n className: 'string',\n begin: '\\'',\n end: '\\'',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst QUOTE_STRING_MODE = {\n className: 'string',\n begin: '\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst PHRASAL_WORDS_MODE = {\n begin: /\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/\n};\n/**\n * Creates a comment mode\n *\n * @param {string | RegExp} begin\n * @param {string | RegExp} end\n * @param {Mode | {}} [modeOptions]\n * @returns {Partial}\n */\nconst COMMENT = function(begin, end, modeOptions = {}) {\n const mode = inherit(\n {\n className: 'comment',\n begin,\n end,\n contains: []\n },\n modeOptions\n );\n mode.contains.push(PHRASAL_WORDS_MODE);\n mode.contains.push({\n className: 'doctag',\n begin: '(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):',\n relevance: 0\n });\n return mode;\n};\nconst C_LINE_COMMENT_MODE = COMMENT('//', '$');\nconst C_BLOCK_COMMENT_MODE = COMMENT('/\\\\*', '\\\\*/');\nconst HASH_COMMENT_MODE = COMMENT('#', '$');\nconst NUMBER_MODE = {\n className: 'number',\n begin: NUMBER_RE,\n relevance: 0\n};\nconst C_NUMBER_MODE = {\n className: 'number',\n begin: C_NUMBER_RE,\n relevance: 0\n};\nconst BINARY_NUMBER_MODE = {\n className: 'number',\n begin: BINARY_NUMBER_RE,\n relevance: 0\n};\nconst CSS_NUMBER_MODE = {\n className: 'number',\n begin: NUMBER_RE + '(' +\n '%|em|ex|ch|rem' +\n '|vw|vh|vmin|vmax' +\n '|cm|mm|in|pt|pc|px' +\n '|deg|grad|rad|turn' +\n '|s|ms' +\n '|Hz|kHz' +\n '|dpi|dpcm|dppx' +\n ')?',\n relevance: 0\n};\nconst REGEXP_MODE = {\n // this outer rule makes sure we actually have a WHOLE regex and not simply\n // an expression such as:\n //\n // 3 / something\n //\n // (which will then blow up when regex's `illegal` sees the newline)\n begin: /(?=\\/[^/\\n]*\\/)/,\n contains: [{\n className: 'regexp',\n begin: /\\//,\n end: /\\/[gimuy]*/,\n illegal: /\\n/,\n contains: [\n BACKSLASH_ESCAPE,\n {\n begin: /\\[/,\n end: /\\]/,\n relevance: 0,\n contains: [BACKSLASH_ESCAPE]\n }\n ]\n }]\n};\nconst TITLE_MODE = {\n className: 'title',\n begin: IDENT_RE,\n relevance: 0\n};\nconst UNDERSCORE_TITLE_MODE = {\n className: 'title',\n begin: UNDERSCORE_IDENT_RE,\n relevance: 0\n};\nconst METHOD_GUARD = {\n // excludes method names from keyword processing\n begin: '\\\\.\\\\s*' + UNDERSCORE_IDENT_RE,\n relevance: 0\n};\n\n/**\n * Adds end same as begin mechanics to a mode\n *\n * Your mode must include at least a single () match group as that first match\n * group is what is used for comparison\n * @param {Partial} mode\n */\nconst END_SAME_AS_BEGIN = function(mode) {\n return Object.assign(mode,\n {\n /** @type {ModeCallback} */\n 'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },\n /** @type {ModeCallback} */\n 'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }\n });\n};\n\nvar MODES = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MATCH_NOTHING_RE: MATCH_NOTHING_RE,\n IDENT_RE: IDENT_RE,\n UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,\n NUMBER_RE: NUMBER_RE,\n C_NUMBER_RE: C_NUMBER_RE,\n BINARY_NUMBER_RE: BINARY_NUMBER_RE,\n RE_STARTERS_RE: RE_STARTERS_RE,\n SHEBANG: SHEBANG,\n BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,\n APOS_STRING_MODE: APOS_STRING_MODE,\n QUOTE_STRING_MODE: QUOTE_STRING_MODE,\n PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,\n COMMENT: COMMENT,\n C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,\n C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,\n HASH_COMMENT_MODE: HASH_COMMENT_MODE,\n NUMBER_MODE: NUMBER_MODE,\n C_NUMBER_MODE: C_NUMBER_MODE,\n BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,\n CSS_NUMBER_MODE: CSS_NUMBER_MODE,\n REGEXP_MODE: REGEXP_MODE,\n TITLE_MODE: TITLE_MODE,\n UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE,\n METHOD_GUARD: METHOD_GUARD,\n END_SAME_AS_BEGIN: END_SAME_AS_BEGIN\n});\n\n// Grammar extensions / plugins\n// See: https://github.com/highlightjs/highlight.js/issues/2833\n\n// Grammar extensions allow \"syntactic sugar\" to be added to the grammar modes\n// without requiring any underlying changes to the compiler internals.\n\n// `compileMatch` being the perfect small example of now allowing a grammar\n// author to write `match` when they desire to match a single expression rather\n// than being forced to use `begin`. The extension then just moves `match` into\n// `begin` when it runs. Ie, no features have been added, but we've just made\n// the experience of writing (and reading grammars) a little bit nicer.\n\n// ------\n\n// TODO: We need negative look-behind support to do this properly\n/**\n * Skip a match if it has a preceding dot\n *\n * This is used for `beginKeywords` to prevent matching expressions such as\n * `bob.keyword.do()`. The mode compiler automatically wires this up as a\n * special _internal_ 'on:begin' callback for modes with `beginKeywords`\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\nfunction skipIfhasPrecedingDot(match, response) {\n const before = match.input[match.index - 1];\n if (before === \".\") {\n response.ignoreMatch();\n }\n}\n\n\n/**\n * `beginKeywords` syntactic sugar\n * @type {CompilerExt}\n */\nfunction beginKeywords(mode, parent) {\n if (!parent) return;\n if (!mode.beginKeywords) return;\n\n // for languages with keywords that include non-word characters checking for\n // a word boundary is not sufficient, so instead we check for a word boundary\n // or whitespace - this does no harm in any case since our keyword engine\n // doesn't allow spaces in keywords anyways and we still check for the boundary\n // first\n mode.begin = '\\\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\\\.)(?=\\\\b|\\\\s)';\n mode.__beforeBegin = skipIfhasPrecedingDot;\n mode.keywords = mode.keywords || mode.beginKeywords;\n delete mode.beginKeywords;\n\n // prevents double relevance, the keywords themselves provide\n // relevance, the mode doesn't need to double it\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 0;\n}\n\n/**\n * Allow `illegal` to contain an array of illegal values\n * @type {CompilerExt}\n */\nfunction compileIllegal(mode, _parent) {\n if (!Array.isArray(mode.illegal)) return;\n\n mode.illegal = either(...mode.illegal);\n}\n\n/**\n * `match` to match a single expression for readability\n * @type {CompilerExt}\n */\nfunction compileMatch(mode, _parent) {\n if (!mode.match) return;\n if (mode.begin || mode.end) throw new Error(\"begin & end are not supported with match\");\n\n mode.begin = mode.match;\n delete mode.match;\n}\n\n/**\n * provides the default 1 relevance to all modes\n * @type {CompilerExt}\n */\nfunction compileRelevance(mode, _parent) {\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 1;\n}\n\n// keywords that should have no default relevance value\nconst COMMON_KEYWORDS = [\n 'of',\n 'and',\n 'for',\n 'in',\n 'not',\n 'or',\n 'if',\n 'then',\n 'parent', // common variable name\n 'list', // common variable name\n 'value' // common variable name\n];\n\nconst DEFAULT_KEYWORD_CLASSNAME = \"keyword\";\n\n/**\n * Given raw keywords from a language definition, compile them.\n *\n * @param {string | Record | Array} rawKeywords\n * @param {boolean} caseInsensitive\n */\nfunction compileKeywords(rawKeywords, caseInsensitive, className = DEFAULT_KEYWORD_CLASSNAME) {\n /** @type KeywordDict */\n const compiledKeywords = {};\n\n // input can be a string of keywords, an array of keywords, or a object with\n // named keys representing className (which can then point to a string or array)\n if (typeof rawKeywords === 'string') {\n compileList(className, rawKeywords.split(\" \"));\n } else if (Array.isArray(rawKeywords)) {\n compileList(className, rawKeywords);\n } else {\n Object.keys(rawKeywords).forEach(function(className) {\n // collapse all our objects back into the parent object\n Object.assign(\n compiledKeywords,\n compileKeywords(rawKeywords[className], caseInsensitive, className)\n );\n });\n }\n return compiledKeywords;\n\n // ---\n\n /**\n * Compiles an individual list of keywords\n *\n * Ex: \"for if when while|5\"\n *\n * @param {string} className\n * @param {Array} keywordList\n */\n function compileList(className, keywordList) {\n if (caseInsensitive) {\n keywordList = keywordList.map(x => x.toLowerCase());\n }\n keywordList.forEach(function(keyword) {\n const pair = keyword.split('|');\n compiledKeywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])];\n });\n }\n}\n\n/**\n * Returns the proper score for a given keyword\n *\n * Also takes into account comment keywords, which will be scored 0 UNLESS\n * another score has been manually assigned.\n * @param {string} keyword\n * @param {string} [providedScore]\n */\nfunction scoreForKeyword(keyword, providedScore) {\n // manual scores always win over common keywords\n // so you can force a score of 1 if you really insist\n if (providedScore) {\n return Number(providedScore);\n }\n\n return commonKeyword(keyword) ? 0 : 1;\n}\n\n/**\n * Determines if a given keyword is common or not\n *\n * @param {string} keyword */\nfunction commonKeyword(keyword) {\n return COMMON_KEYWORDS.includes(keyword.toLowerCase());\n}\n\n// compilation\n\n/**\n * Compiles a language definition result\n *\n * Given the raw result of a language definition (Language), compiles this so\n * that it is ready for highlighting code.\n * @param {Language} language\n * @param {{plugins: HLJSPlugin[]}} opts\n * @returns {CompiledLanguage}\n */\nfunction compileLanguage(language, { plugins }) {\n /**\n * Builds a regex with the case sensativility of the current language\n *\n * @param {RegExp | string} value\n * @param {boolean} [global]\n */\n function langRe(value, global) {\n return new RegExp(\n source(value),\n 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '')\n );\n }\n\n /**\n Stores multiple regular expressions and allows you to quickly search for\n them all in a string simultaneously - returning the first match. It does\n this by creating a huge (a|b|c) regex - each individual item wrapped with ()\n and joined by `|` - using match groups to track position. When a match is\n found checking which position in the array has content allows us to figure\n out which of the original regexes / match groups triggered the match.\n\n The match object itself (the result of `Regex.exec`) is returned but also\n enhanced by merging in any meta-data that was registered with the regex.\n This is how we keep track of which mode matched, and what type of rule\n (`illegal`, `begin`, end, etc).\n */\n class MultiRegex {\n constructor() {\n this.matchIndexes = {};\n // @ts-ignore\n this.regexes = [];\n this.matchAt = 1;\n this.position = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n opts.position = this.position++;\n // @ts-ignore\n this.matchIndexes[this.matchAt] = opts;\n this.regexes.push([opts, re]);\n this.matchAt += countMatchGroups(re) + 1;\n }\n\n compile() {\n if (this.regexes.length === 0) {\n // avoids the need to check length every time exec is called\n // @ts-ignore\n this.exec = () => null;\n }\n const terminators = this.regexes.map(el => el[1]);\n this.matcherRe = langRe(join(terminators), true);\n this.lastIndex = 0;\n }\n\n /** @param {string} s */\n exec(s) {\n this.matcherRe.lastIndex = this.lastIndex;\n const match = this.matcherRe.exec(s);\n if (!match) { return null; }\n\n // eslint-disable-next-line no-undefined\n const i = match.findIndex((el, i) => i > 0 && el !== undefined);\n // @ts-ignore\n const matchData = this.matchIndexes[i];\n // trim off any earlier non-relevant match groups (ie, the other regex\n // match groups that make up the multi-matcher)\n match.splice(0, i);\n\n return Object.assign(match, matchData);\n }\n }\n\n /*\n Created to solve the key deficiently with MultiRegex - there is no way to\n test for multiple matches at a single location. Why would we need to do\n that? In the future a more dynamic engine will allow certain matches to be\n ignored. An example: if we matched say the 3rd regex in a large group but\n decided to ignore it - we'd need to started testing again at the 4th\n regex... but MultiRegex itself gives us no real way to do that.\n\n So what this class creates MultiRegexs on the fly for whatever search\n position they are needed.\n\n NOTE: These additional MultiRegex objects are created dynamically. For most\n grammars most of the time we will never actually need anything more than the\n first MultiRegex - so this shouldn't have too much overhead.\n\n Say this is our search group, and we match regex3, but wish to ignore it.\n\n regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0\n\n What we need is a new MultiRegex that only includes the remaining\n possibilities:\n\n regex4 | regex5 ' ie, startAt = 3\n\n This class wraps all that complexity up in a simple API... `startAt` decides\n where in the array of expressions to start doing the matching. It\n auto-increments, so if a match is found at position 2, then startAt will be\n set to 3. If the end is reached startAt will return to 0.\n\n MOST of the time the parser will be setting startAt manually to 0.\n */\n class ResumableMultiRegex {\n constructor() {\n // @ts-ignore\n this.rules = [];\n // @ts-ignore\n this.multiRegexes = [];\n this.count = 0;\n\n this.lastIndex = 0;\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n getMatcher(index) {\n if (this.multiRegexes[index]) return this.multiRegexes[index];\n\n const matcher = new MultiRegex();\n this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));\n matcher.compile();\n this.multiRegexes[index] = matcher;\n return matcher;\n }\n\n resumingScanAtSamePosition() {\n return this.regexIndex !== 0;\n }\n\n considerAll() {\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n this.rules.push([re, opts]);\n if (opts.type === \"begin\") this.count++;\n }\n\n /** @param {string} s */\n exec(s) {\n const m = this.getMatcher(this.regexIndex);\n m.lastIndex = this.lastIndex;\n let result = m.exec(s);\n\n // The following is because we have no easy way to say \"resume scanning at the\n // existing position but also skip the current rule ONLY\". What happens is\n // all prior rules are also skipped which can result in matching the wrong\n // thing. Example of matching \"booger\":\n\n // our matcher is [string, \"booger\", number]\n //\n // ....booger....\n\n // if \"booger\" is ignored then we'd really need a regex to scan from the\n // SAME position for only: [string, number] but ignoring \"booger\" (if it\n // was the first match), a simple resume would scan ahead who knows how\n // far looking only for \"number\", ignoring potential string matches (or\n // future \"booger\" matches that might be valid.)\n\n // So what we do: We execute two matchers, one resuming at the same\n // position, but the second full matcher starting at the position after:\n\n // /--- resume first regex match here (for [number])\n // |/---- full match here for [string, \"booger\", number]\n // vv\n // ....booger....\n\n // Which ever results in a match first is then used. So this 3-4 step\n // process essentially allows us to say \"match at this position, excluding\n // a prior rule that was ignored\".\n //\n // 1. Match \"booger\" first, ignore. Also proves that [string] does non match.\n // 2. Resume matching for [number]\n // 3. Match at index + 1 for [string, \"booger\", number]\n // 4. If #2 and #3 result in matches, which came first?\n if (this.resumingScanAtSamePosition()) {\n if (result && result.index === this.lastIndex) ; else { // use the second matcher result\n const m2 = this.getMatcher(0);\n m2.lastIndex = this.lastIndex + 1;\n result = m2.exec(s);\n }\n }\n\n if (result) {\n this.regexIndex += result.position + 1;\n if (this.regexIndex === this.count) {\n // wrap-around to considering all matches again\n this.considerAll();\n }\n }\n\n return result;\n }\n }\n\n /**\n * Given a mode, builds a huge ResumableMultiRegex that can be used to walk\n * the content and find matches.\n *\n * @param {CompiledMode} mode\n * @returns {ResumableMultiRegex}\n */\n function buildModeRegex(mode) {\n const mm = new ResumableMultiRegex();\n\n mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: \"begin\" }));\n\n if (mode.terminatorEnd) {\n mm.addRule(mode.terminatorEnd, { type: \"end\" });\n }\n if (mode.illegal) {\n mm.addRule(mode.illegal, { type: \"illegal\" });\n }\n\n return mm;\n }\n\n /** skip vs abort vs ignore\n *\n * @skip - The mode is still entered and exited normally (and contains rules apply),\n * but all content is held and added to the parent buffer rather than being\n * output when the mode ends. Mostly used with `sublanguage` to build up\n * a single large buffer than can be parsed by sublanguage.\n *\n * - The mode begin ands ends normally.\n * - Content matched is added to the parent mode buffer.\n * - The parser cursor is moved forward normally.\n *\n * @abort - A hack placeholder until we have ignore. Aborts the mode (as if it\n * never matched) but DOES NOT continue to match subsequent `contains`\n * modes. Abort is bad/suboptimal because it can result in modes\n * farther down not getting applied because an earlier rule eats the\n * content but then aborts.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is added to the mode buffer.\n * - The parser cursor is moved forward accordingly.\n *\n * @ignore - Ignores the mode (as if it never matched) and continues to match any\n * subsequent `contains` modes. Ignore isn't technically possible with\n * the current parser implementation.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is ignored.\n * - The parser cursor is not moved forward.\n */\n\n /**\n * Compiles an individual mode\n *\n * This can raise an error if the mode contains certain detectable known logic\n * issues.\n * @param {Mode} mode\n * @param {CompiledMode | null} [parent]\n * @returns {CompiledMode | never}\n */\n function compileMode(mode, parent) {\n const cmode = /** @type CompiledMode */ (mode);\n if (mode.isCompiled) return cmode;\n\n [\n // do this early so compiler extensions generally don't have to worry about\n // the distinction between match/begin\n compileMatch\n ].forEach(ext => ext(mode, parent));\n\n language.compilerExtensions.forEach(ext => ext(mode, parent));\n\n // __beforeBegin is considered private API, internal use only\n mode.__beforeBegin = null;\n\n [\n beginKeywords,\n // do this later so compiler extensions that come earlier have access to the\n // raw array if they wanted to perhaps manipulate it, etc.\n compileIllegal,\n // default to 1 relevance if not specified\n compileRelevance\n ].forEach(ext => ext(mode, parent));\n\n mode.isCompiled = true;\n\n let keywordPattern = null;\n if (typeof mode.keywords === \"object\") {\n keywordPattern = mode.keywords.$pattern;\n delete mode.keywords.$pattern;\n }\n\n if (mode.keywords) {\n mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);\n }\n\n // both are not allowed\n if (mode.lexemes && keywordPattern) {\n throw new Error(\"ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) \");\n }\n\n // `mode.lexemes` was the old standard before we added and now recommend\n // using `keywords.$pattern` to pass the keyword pattern\n keywordPattern = keywordPattern || mode.lexemes || /\\w+/;\n cmode.keywordPatternRe = langRe(keywordPattern, true);\n\n if (parent) {\n if (!mode.begin) mode.begin = /\\B|\\b/;\n cmode.beginRe = langRe(mode.begin);\n if (mode.endSameAsBegin) mode.end = mode.begin;\n if (!mode.end && !mode.endsWithParent) mode.end = /\\B|\\b/;\n if (mode.end) cmode.endRe = langRe(mode.end);\n cmode.terminatorEnd = source(mode.end) || '';\n if (mode.endsWithParent && parent.terminatorEnd) {\n cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;\n }\n }\n if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));\n if (!mode.contains) mode.contains = [];\n\n mode.contains = [].concat(...mode.contains.map(function(c) {\n return expandOrCloneMode(c === 'self' ? mode : c);\n }));\n mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });\n\n if (mode.starts) {\n compileMode(mode.starts, parent);\n }\n\n cmode.matcher = buildModeRegex(cmode);\n return cmode;\n }\n\n if (!language.compilerExtensions) language.compilerExtensions = [];\n\n // self is not valid at the top-level\n if (language.contains && language.contains.includes('self')) {\n throw new Error(\"ERR: contains `self` is not supported at the top-level of a language. See documentation.\");\n }\n\n // we need a null object, which inherit will guarantee\n language.classNameAliases = inherit(language.classNameAliases || {});\n\n return compileMode(/** @type Mode */ (language));\n}\n\n/**\n * Determines if a mode has a dependency on it's parent or not\n *\n * If a mode does have a parent dependency then often we need to clone it if\n * it's used in multiple places so that each copy points to the correct parent,\n * where-as modes without a parent can often safely be re-used at the bottom of\n * a mode chain.\n *\n * @param {Mode | null} mode\n * @returns {boolean} - is there a dependency on the parent?\n * */\nfunction dependencyOnParent(mode) {\n if (!mode) return false;\n\n return mode.endsWithParent || dependencyOnParent(mode.starts);\n}\n\n/**\n * Expands a mode or clones it if necessary\n *\n * This is necessary for modes with parental dependenceis (see notes on\n * `dependencyOnParent`) and for nodes that have `variants` - which must then be\n * exploded into their own individual modes at compile time.\n *\n * @param {Mode} mode\n * @returns {Mode | Mode[]}\n * */\nfunction expandOrCloneMode(mode) {\n if (mode.variants && !mode.cachedVariants) {\n mode.cachedVariants = mode.variants.map(function(variant) {\n return inherit(mode, { variants: null }, variant);\n });\n }\n\n // EXPAND\n // if we have variants then essentially \"replace\" the mode with the variants\n // this happens in compileMode, where this function is called from\n if (mode.cachedVariants) {\n return mode.cachedVariants;\n }\n\n // CLONE\n // if we have dependencies on parents then we need a unique\n // instance of ourselves, so we can be reused with many\n // different parents without issue\n if (dependencyOnParent(mode)) {\n return inherit(mode, { starts: mode.starts ? inherit(mode.starts) : null });\n }\n\n if (Object.isFrozen(mode)) {\n return inherit(mode);\n }\n\n // no special dependency issues, just return ourselves\n return mode;\n}\n\nvar version = \"10.7.3\";\n\n// @ts-nocheck\n\nfunction hasValueOrEmptyAttribute(value) {\n return Boolean(value || value === \"\");\n}\n\nfunction BuildVuePlugin(hljs) {\n const Component = {\n props: [\"language\", \"code\", \"autodetect\"],\n data: function() {\n return {\n detectedLanguage: \"\",\n unknownLanguage: false\n };\n },\n computed: {\n className() {\n if (this.unknownLanguage) return \"\";\n\n return \"hljs \" + this.detectedLanguage;\n },\n highlighted() {\n // no idea what language to use, return raw code\n if (!this.autoDetect && !hljs.getLanguage(this.language)) {\n console.warn(`The language \"${this.language}\" you specified could not be found.`);\n this.unknownLanguage = true;\n return escapeHTML(this.code);\n }\n\n let result = {};\n if (this.autoDetect) {\n result = hljs.highlightAuto(this.code);\n this.detectedLanguage = result.language;\n } else {\n result = hljs.highlight(this.language, this.code, this.ignoreIllegals);\n this.detectedLanguage = this.language;\n }\n return result.value;\n },\n autoDetect() {\n return !this.language || hasValueOrEmptyAttribute(this.autodetect);\n },\n ignoreIllegals() {\n return true;\n }\n },\n // this avoids needing to use a whole Vue compilation pipeline just\n // to build Highlight.js\n render(createElement) {\n return createElement(\"pre\", {}, [\n createElement(\"code\", {\n class: this.className,\n domProps: { innerHTML: this.highlighted }\n })\n ]);\n }\n // template: `
`\n };\n\n const VuePlugin = {\n install(Vue) {\n Vue.component('highlightjs', Component);\n }\n };\n\n return { Component, VuePlugin };\n}\n\n/* plugin itself */\n\n/** @type {HLJSPlugin} */\nconst mergeHTMLPlugin = {\n \"after:highlightElement\": ({ el, result, text }) => {\n const originalStream = nodeStream(el);\n if (!originalStream.length) return;\n\n const resultNode = document.createElement('div');\n resultNode.innerHTML = result.value;\n result.value = mergeStreams(originalStream, nodeStream(resultNode), text);\n }\n};\n\n/* Stream merging support functions */\n\n/**\n * @typedef Event\n * @property {'start'|'stop'} event\n * @property {number} offset\n * @property {Node} node\n */\n\n/**\n * @param {Node} node\n */\nfunction tag(node) {\n return node.nodeName.toLowerCase();\n}\n\n/**\n * @param {Node} node\n */\nfunction nodeStream(node) {\n /** @type Event[] */\n const result = [];\n (function _nodeStream(node, offset) {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 3) {\n offset += child.nodeValue.length;\n } else if (child.nodeType === 1) {\n result.push({\n event: 'start',\n offset: offset,\n node: child\n });\n offset = _nodeStream(child, offset);\n // Prevent void elements from having an end tag that would actually\n // double them in the output. There are more void elements in HTML\n // but we list only those realistically expected in code display.\n if (!tag(child).match(/br|hr|img|input/)) {\n result.push({\n event: 'stop',\n offset: offset,\n node: child\n });\n }\n }\n }\n return offset;\n })(node, 0);\n return result;\n}\n\n/**\n * @param {any} original - the original stream\n * @param {any} highlighted - stream of the highlighted source\n * @param {string} value - the original source itself\n */\nfunction mergeStreams(original, highlighted, value) {\n let processed = 0;\n let result = '';\n const nodeStack = [];\n\n function selectStream() {\n if (!original.length || !highlighted.length) {\n return original.length ? original : highlighted;\n }\n if (original[0].offset !== highlighted[0].offset) {\n return (original[0].offset < highlighted[0].offset) ? original : highlighted;\n }\n\n /*\n To avoid starting the stream just before it should stop the order is\n ensured that original always starts first and closes last:\n\n if (event1 == 'start' && event2 == 'start')\n return original;\n if (event1 == 'start' && event2 == 'stop')\n return highlighted;\n if (event1 == 'stop' && event2 == 'start')\n return original;\n if (event1 == 'stop' && event2 == 'stop')\n return highlighted;\n\n ... which is collapsed to:\n */\n return highlighted[0].event === 'start' ? original : highlighted;\n }\n\n /**\n * @param {Node} node\n */\n function open(node) {\n /** @param {Attr} attr */\n function attributeString(attr) {\n return ' ' + attr.nodeName + '=\"' + escapeHTML(attr.value) + '\"';\n }\n // @ts-ignore\n result += '<' + tag(node) + [].map.call(node.attributes, attributeString).join('') + '>';\n }\n\n /**\n * @param {Node} node\n */\n function close(node) {\n result += '';\n }\n\n /**\n * @param {Event} event\n */\n function render(event) {\n (event.event === 'start' ? open : close)(event.node);\n }\n\n while (original.length || highlighted.length) {\n let stream = selectStream();\n result += escapeHTML(value.substring(processed, stream[0].offset));\n processed = stream[0].offset;\n if (stream === original) {\n /*\n On any opening or closing tag of the original markup we first close\n the entire highlighted node stack, then render the original tag along\n with all the following original tags at the same offset and then\n reopen all the tags on the highlighted stack.\n */\n nodeStack.reverse().forEach(close);\n do {\n render(stream.splice(0, 1)[0]);\n stream = selectStream();\n } while (stream === original && stream.length && stream[0].offset === processed);\n nodeStack.reverse().forEach(open);\n } else {\n if (stream[0].event === 'start') {\n nodeStack.push(stream[0].node);\n } else {\n nodeStack.pop();\n }\n render(stream.splice(0, 1)[0]);\n }\n }\n return result + escapeHTML(value.substr(processed));\n}\n\n/*\n\nFor the reasoning behind this please see:\nhttps://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419\n\n*/\n\n/**\n * @type {Record}\n */\nconst seenDeprecations = {};\n\n/**\n * @param {string} message\n */\nconst error = (message) => {\n console.error(message);\n};\n\n/**\n * @param {string} message\n * @param {any} args\n */\nconst warn = (message, ...args) => {\n console.log(`WARN: ${message}`, ...args);\n};\n\n/**\n * @param {string} version\n * @param {string} message\n */\nconst deprecated = (version, message) => {\n if (seenDeprecations[`${version}/${message}`]) return;\n\n console.log(`Deprecated as of ${version}. ${message}`);\n seenDeprecations[`${version}/${message}`] = true;\n};\n\n/*\nSyntax highlighting with language autodetection.\nhttps://highlightjs.org/\n*/\n\nconst escape$1 = escapeHTML;\nconst inherit$1 = inherit;\nconst NO_MATCH = Symbol(\"nomatch\");\n\n/**\n * @param {any} hljs - object that is extended (legacy)\n * @returns {HLJSApi}\n */\nconst HLJS = function(hljs) {\n // Global internal variables used within the highlight.js library.\n /** @type {Record} */\n const languages = Object.create(null);\n /** @type {Record} */\n const aliases = Object.create(null);\n /** @type {HLJSPlugin[]} */\n const plugins = [];\n\n // safe/production mode - swallows more errors, tries to keep running\n // even if a single syntax or parse hits a fatal error\n let SAFE_MODE = true;\n const fixMarkupRe = /(^(<[^>]+>|\\t|)+|\\n)/gm;\n const LANGUAGE_NOT_FOUND = \"Could not find the language '{}', did you forget to load/include a language module?\";\n /** @type {Language} */\n const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] };\n\n // Global options used when within external APIs. This is modified when\n // calling the `hljs.configure` function.\n /** @type HLJSOptions */\n let options = {\n noHighlightRe: /^(no-?highlight)$/i,\n languageDetectRe: /\\blang(?:uage)?-([\\w-]+)\\b/i,\n classPrefix: 'hljs-',\n tabReplace: null,\n useBR: false,\n languages: null,\n // beta configuration options, subject to change, welcome to discuss\n // https://github.com/highlightjs/highlight.js/issues/1086\n __emitter: TokenTreeEmitter\n };\n\n /* Utility functions */\n\n /**\n * Tests a language name to see if highlighting should be skipped\n * @param {string} languageName\n */\n function shouldNotHighlight(languageName) {\n return options.noHighlightRe.test(languageName);\n }\n\n /**\n * @param {HighlightedHTMLElement} block - the HTML element to determine language for\n */\n function blockLanguage(block) {\n let classes = block.className + ' ';\n\n classes += block.parentNode ? block.parentNode.className : '';\n\n // language-* takes precedence over non-prefixed class names.\n const match = options.languageDetectRe.exec(classes);\n if (match) {\n const language = getLanguage(match[1]);\n if (!language) {\n warn(LANGUAGE_NOT_FOUND.replace(\"{}\", match[1]));\n warn(\"Falling back to no-highlight mode for this block.\", block);\n }\n return language ? match[1] : 'no-highlight';\n }\n\n return classes\n .split(/\\s+/)\n .find((_class) => shouldNotHighlight(_class) || getLanguage(_class));\n }\n\n /**\n * Core highlighting function.\n *\n * OLD API\n * highlight(lang, code, ignoreIllegals, continuation)\n *\n * NEW API\n * highlight(code, {lang, ignoreIllegals})\n *\n * @param {string} codeOrlanguageName - the language to use for highlighting\n * @param {string | HighlightOptions} optionsOrCode - the code to highlight\n * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n * @param {CompiledMode} [continuation] - current continuation mode, if any\n *\n * @returns {HighlightResult} Result - an object that represents the result\n * @property {string} language - the language name\n * @property {number} relevance - the relevance score\n * @property {string} value - the highlighted HTML code\n * @property {string} code - the original raw code\n * @property {CompiledMode} top - top of the current mode stack\n * @property {boolean} illegal - indicates whether any illegal matches were found\n */\n function highlight(codeOrlanguageName, optionsOrCode, ignoreIllegals, continuation) {\n let code = \"\";\n let languageName = \"\";\n if (typeof optionsOrCode === \"object\") {\n code = codeOrlanguageName;\n ignoreIllegals = optionsOrCode.ignoreIllegals;\n languageName = optionsOrCode.language;\n // continuation not supported at all via the new API\n // eslint-disable-next-line no-undefined\n continuation = undefined;\n } else {\n // old API\n deprecated(\"10.7.0\", \"highlight(lang, code, ...args) has been deprecated.\");\n deprecated(\"10.7.0\", \"Please use highlight(code, options) instead.\\nhttps://github.com/highlightjs/highlight.js/issues/2277\");\n languageName = codeOrlanguageName;\n code = optionsOrCode;\n }\n\n /** @type {BeforeHighlightContext} */\n const context = {\n code,\n language: languageName\n };\n // the plugin can change the desired language or the code to be highlighted\n // just be changing the object it was passed\n fire(\"before:highlight\", context);\n\n // a before plugin can usurp the result completely by providing it's own\n // in which case we don't even need to call highlight\n const result = context.result\n ? context.result\n : _highlight(context.language, context.code, ignoreIllegals, continuation);\n\n result.code = context.code;\n // the plugin can change anything in result to suite it\n fire(\"after:highlight\", result);\n\n return result;\n }\n\n /**\n * private highlight that's used internally and does not fire callbacks\n *\n * @param {string} languageName - the language to use for highlighting\n * @param {string} codeToHighlight - the code to highlight\n * @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n * @param {CompiledMode?} [continuation] - current continuation mode, if any\n * @returns {HighlightResult} - result of the highlight operation\n */\n function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {\n /**\n * Return keyword data if a match is a keyword\n * @param {CompiledMode} mode - current mode\n * @param {RegExpMatchArray} match - regexp match data\n * @returns {KeywordData | false}\n */\n function keywordData(mode, match) {\n const matchText = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return Object.prototype.hasOwnProperty.call(mode.keywords, matchText) && mode.keywords[matchText];\n }\n\n function processKeywords() {\n if (!top.keywords) {\n emitter.addText(modeBuffer);\n return;\n }\n\n let lastIndex = 0;\n top.keywordPatternRe.lastIndex = 0;\n let match = top.keywordPatternRe.exec(modeBuffer);\n let buf = \"\";\n\n while (match) {\n buf += modeBuffer.substring(lastIndex, match.index);\n const data = keywordData(top, match);\n if (data) {\n const [kind, keywordRelevance] = data;\n emitter.addText(buf);\n buf = \"\";\n\n relevance += keywordRelevance;\n if (kind.startsWith(\"_\")) {\n // _ implied for relevance only, do not highlight\n // by applying a class name\n buf += match[0];\n } else {\n const cssClass = language.classNameAliases[kind] || kind;\n emitter.addKeyword(match[0], cssClass);\n }\n } else {\n buf += match[0];\n }\n lastIndex = top.keywordPatternRe.lastIndex;\n match = top.keywordPatternRe.exec(modeBuffer);\n }\n buf += modeBuffer.substr(lastIndex);\n emitter.addText(buf);\n }\n\n function processSubLanguage() {\n if (modeBuffer === \"\") return;\n /** @type HighlightResult */\n let result = null;\n\n if (typeof top.subLanguage === 'string') {\n if (!languages[top.subLanguage]) {\n emitter.addText(modeBuffer);\n return;\n }\n result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);\n continuations[top.subLanguage] = /** @type {CompiledMode} */ (result.top);\n } else {\n result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);\n }\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n emitter.addSublanguage(result.emitter, result.language);\n }\n\n function processBuffer() {\n if (top.subLanguage != null) {\n processSubLanguage();\n } else {\n processKeywords();\n }\n modeBuffer = '';\n }\n\n /**\n * @param {Mode} mode - new mode to start\n */\n function startNewMode(mode) {\n if (mode.className) {\n emitter.openNode(language.classNameAliases[mode.className] || mode.className);\n }\n top = Object.create(mode, { parent: { value: top } });\n return top;\n }\n\n /**\n * @param {CompiledMode } mode - the mode to potentially end\n * @param {RegExpMatchArray} match - the latest match\n * @param {string} matchPlusRemainder - match plus remainder of content\n * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode\n */\n function endOfMode(mode, match, matchPlusRemainder) {\n let matched = startsWith(mode.endRe, matchPlusRemainder);\n\n if (matched) {\n if (mode[\"on:end\"]) {\n const resp = new Response(mode);\n mode[\"on:end\"](match, resp);\n if (resp.isMatchIgnored) matched = false;\n }\n\n if (matched) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n }\n // even if on:end fires an `ignore` it's still possible\n // that we might trigger the end node because of a parent mode\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, match, matchPlusRemainder);\n }\n }\n\n /**\n * Handle matching but then ignoring a sequence of text\n *\n * @param {string} lexeme - string containing full match text\n */\n function doIgnore(lexeme) {\n if (top.matcher.regexIndex === 0) {\n // no more regexs to potentially match here, so we move the cursor forward one\n // space\n modeBuffer += lexeme[0];\n return 1;\n } else {\n // no need to move the cursor, we still have additional regexes to try and\n // match at this very spot\n resumeScanAtSamePosition = true;\n return 0;\n }\n }\n\n /**\n * Handle the start of a new potential mode match\n *\n * @param {EnhancedMatch} match - the current match\n * @returns {number} how far to advance the parse cursor\n */\n function doBeginMatch(match) {\n const lexeme = match[0];\n const newMode = match.rule;\n\n const resp = new Response(newMode);\n // first internal before callbacks, then the public ones\n const beforeCallbacks = [newMode.__beforeBegin, newMode[\"on:begin\"]];\n for (const cb of beforeCallbacks) {\n if (!cb) continue;\n cb(match, resp);\n if (resp.isMatchIgnored) return doIgnore(lexeme);\n }\n\n if (newMode && newMode.endSameAsBegin) {\n newMode.endRe = escape(lexeme);\n }\n\n if (newMode.skip) {\n modeBuffer += lexeme;\n } else {\n if (newMode.excludeBegin) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (!newMode.returnBegin && !newMode.excludeBegin) {\n modeBuffer = lexeme;\n }\n }\n startNewMode(newMode);\n // if (mode[\"after:begin\"]) {\n // let resp = new Response(mode);\n // mode[\"after:begin\"](match, resp);\n // }\n return newMode.returnBegin ? 0 : lexeme.length;\n }\n\n /**\n * Handle the potential end of mode\n *\n * @param {RegExpMatchArray} match - the current match\n */\n function doEndMatch(match) {\n const lexeme = match[0];\n const matchPlusRemainder = codeToHighlight.substr(match.index);\n\n const endMode = endOfMode(top, match, matchPlusRemainder);\n if (!endMode) { return NO_MATCH; }\n\n const origin = top;\n if (origin.skip) {\n modeBuffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n modeBuffer = lexeme;\n }\n }\n do {\n if (top.className) {\n emitter.closeNode();\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== endMode.parent);\n if (endMode.starts) {\n if (endMode.endSameAsBegin) {\n endMode.starts.endRe = endMode.endRe;\n }\n startNewMode(endMode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n function processContinuations() {\n const list = [];\n for (let current = top; current !== language; current = current.parent) {\n if (current.className) {\n list.unshift(current.className);\n }\n }\n list.forEach(item => emitter.openNode(item));\n }\n\n /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */\n let lastMatch = {};\n\n /**\n * Process an individual match\n *\n * @param {string} textBeforeMatch - text preceeding the match (since the last match)\n * @param {EnhancedMatch} [match] - the match itself\n */\n function processLexeme(textBeforeMatch, match) {\n const lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n modeBuffer += textBeforeMatch;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type === \"begin\" && match.type === \"end\" && lastMatch.index === match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n modeBuffer += codeToHighlight.slice(match.index, match.index + 1);\n if (!SAFE_MODE) {\n /** @type {AnnotatedError} */\n const err = new Error('0 width match regex');\n err.languageName = languageName;\n err.badRule = lastMatch.rule;\n throw err;\n }\n return 1;\n }\n lastMatch = match;\n\n if (match.type === \"begin\") {\n return doBeginMatch(match);\n } else if (match.type === \"illegal\" && !ignoreIllegals) {\n // illegal match, we do not continue processing\n /** @type {AnnotatedError} */\n const err = new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '') + '\"');\n err.mode = top;\n throw err;\n } else if (match.type === \"end\") {\n const processed = doEndMatch(match);\n if (processed !== NO_MATCH) {\n return processed;\n }\n }\n\n // edge case for when illegal matches $ (end of line) which is technically\n // a 0 width match but not a begin/end match so it's not caught by the\n // first handler (when ignoreIllegals is true)\n if (match.type === \"illegal\" && lexeme === \"\") {\n // advance so we aren't stuck in an infinite loop\n return 1;\n }\n\n // infinite loops are BAD, this is a last ditch catch all. if we have a\n // decent number of iterations yet our index (cursor position in our\n // parsing) still 3x behind our index then something is very wrong\n // so we bail\n if (iterations > 100000 && iterations > match.index * 3) {\n const err = new Error('potential infinite loop, way more iterations than matches');\n throw err;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n modeBuffer += lexeme;\n return lexeme.length;\n }\n\n const language = getLanguage(languageName);\n if (!language) {\n error(LANGUAGE_NOT_FOUND.replace(\"{}\", languageName));\n throw new Error('Unknown language: \"' + languageName + '\"');\n }\n\n const md = compileLanguage(language, { plugins });\n let result = '';\n /** @type {CompiledMode} */\n let top = continuation || md;\n /** @type Record */\n const continuations = {}; // keep continuations for sub-languages\n const emitter = new options.__emitter(options);\n processContinuations();\n let modeBuffer = '';\n let relevance = 0;\n let index = 0;\n let iterations = 0;\n let resumeScanAtSamePosition = false;\n\n try {\n top.matcher.considerAll();\n\n for (;;) {\n iterations++;\n if (resumeScanAtSamePosition) {\n // only regexes not matched previously will now be\n // considered for a potential match\n resumeScanAtSamePosition = false;\n } else {\n top.matcher.considerAll();\n }\n top.matcher.lastIndex = index;\n\n const match = top.matcher.exec(codeToHighlight);\n // console.log(\"match\", match[0], match.rule && match.rule.begin)\n\n if (!match) break;\n\n const beforeMatch = codeToHighlight.substring(index, match.index);\n const processedCount = processLexeme(beforeMatch, match);\n index = match.index + processedCount;\n }\n processLexeme(codeToHighlight.substr(index));\n emitter.closeAllNodes();\n emitter.finalize();\n result = emitter.toHTML();\n\n return {\n // avoid possible breakage with v10 clients expecting\n // this to always be an integer\n relevance: Math.floor(relevance),\n value: result,\n language: languageName,\n illegal: false,\n emitter: emitter,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.includes('Illegal')) {\n return {\n illegal: true,\n illegalBy: {\n msg: err.message,\n context: codeToHighlight.slice(index - 100, index + 100),\n mode: err.mode\n },\n sofar: result,\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter\n };\n } else if (SAFE_MODE) {\n return {\n illegal: false,\n relevance: 0,\n value: escape$1(codeToHighlight),\n emitter: emitter,\n language: languageName,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }\n\n /**\n * returns a valid highlight result, without actually doing any actual work,\n * auto highlight starts with this and it's possible for small snippets that\n * auto-detection may not find a better match\n * @param {string} code\n * @returns {HighlightResult}\n */\n function justTextHighlightResult(code) {\n const result = {\n relevance: 0,\n emitter: new options.__emitter(options),\n value: escape$1(code),\n illegal: false,\n top: PLAINTEXT_LANGUAGE\n };\n result.emitter.addText(code);\n return result;\n }\n\n /**\n Highlighting with language detection. Accepts a string with the code to\n highlight. Returns an object with the following properties:\n\n - language (detected language)\n - relevance (int)\n - value (an HTML string with highlighting markup)\n - second_best (object with the same structure for second-best heuristically\n detected language, may be absent)\n\n @param {string} code\n @param {Array} [languageSubset]\n @returns {AutoHighlightResult}\n */\n function highlightAuto(code, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n const plaintext = justTextHighlightResult(code);\n\n const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name =>\n _highlight(name, code, false)\n );\n results.unshift(plaintext); // plaintext is always an option\n\n const sorted = results.sort((a, b) => {\n // sort base on relevance\n if (a.relevance !== b.relevance) return b.relevance - a.relevance;\n\n // always award the tie to the base language\n // ie if C++ and Arduino are tied, it's more likely to be C++\n if (a.language && b.language) {\n if (getLanguage(a.language).supersetOf === b.language) {\n return 1;\n } else if (getLanguage(b.language).supersetOf === a.language) {\n return -1;\n }\n }\n\n // otherwise say they are equal, which has the effect of sorting on\n // relevance while preserving the original ordering - which is how ties\n // have historically been settled, ie the language that comes first always\n // wins in the case of a tie\n return 0;\n });\n\n const [best, secondBest] = sorted;\n\n /** @type {AutoHighlightResult} */\n const result = best;\n result.second_best = secondBest;\n\n return result;\n }\n\n /**\n Post-processing of the highlighted markup:\n\n - replace TABs with something more useful\n - replace real line-breaks with '
' for non-pre containers\n\n @param {string} html\n @returns {string}\n */\n function fixMarkup(html) {\n if (!(options.tabReplace || options.useBR)) {\n return html;\n }\n\n return html.replace(fixMarkupRe, match => {\n if (match === '\\n') {\n return options.useBR ? '
' : match;\n } else if (options.tabReplace) {\n return match.replace(/\\t/g, options.tabReplace);\n }\n return match;\n });\n }\n\n /**\n * Builds new class name for block given the language name\n *\n * @param {HTMLElement} element\n * @param {string} [currentLang]\n * @param {string} [resultLang]\n */\n function updateClassName(element, currentLang, resultLang) {\n const language = currentLang ? aliases[currentLang] : resultLang;\n\n element.classList.add(\"hljs\");\n if (language) element.classList.add(language);\n }\n\n /** @type {HLJSPlugin} */\n const brPlugin = {\n \"before:highlightElement\": ({ el }) => {\n if (options.useBR) {\n el.innerHTML = el.innerHTML.replace(/\\n/g, '').replace(//g, '\\n');\n }\n },\n \"after:highlightElement\": ({ result }) => {\n if (options.useBR) {\n result.value = result.value.replace(/\\n/g, \"
\");\n }\n }\n };\n\n const TAB_REPLACE_RE = /^(<[^>]+>|\\t)+/gm;\n /** @type {HLJSPlugin} */\n const tabReplacePlugin = {\n \"after:highlightElement\": ({ result }) => {\n if (options.tabReplace) {\n result.value = result.value.replace(TAB_REPLACE_RE, (m) =>\n m.replace(/\\t/g, options.tabReplace)\n );\n }\n }\n };\n\n /**\n * Applies highlighting to a DOM node containing code. Accepts a DOM node and\n * two optional parameters for fixMarkup.\n *\n * @param {HighlightedHTMLElement} element - the HTML element to highlight\n */\n function highlightElement(element) {\n /** @type HTMLElement */\n let node = null;\n const language = blockLanguage(element);\n\n if (shouldNotHighlight(language)) return;\n\n // support for v10 API\n fire(\"before:highlightElement\",\n { el: element, language: language });\n\n node = element;\n const text = node.textContent;\n const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text);\n\n // support for v10 API\n fire(\"after:highlightElement\", { el: element, result, text });\n\n element.innerHTML = result.value;\n updateClassName(element, language, result.language);\n element.result = {\n language: result.language,\n // TODO: remove with version 11.0\n re: result.relevance,\n relavance: result.relevance\n };\n if (result.second_best) {\n element.second_best = {\n language: result.second_best.language,\n // TODO: remove with version 11.0\n re: result.second_best.relevance,\n relavance: result.second_best.relevance\n };\n }\n }\n\n /**\n * Updates highlight.js global options with the passed options\n *\n * @param {Partial} userOptions\n */\n function configure(userOptions) {\n if (userOptions.useBR) {\n deprecated(\"10.3.0\", \"'useBR' will be removed entirely in v11.0\");\n deprecated(\"10.3.0\", \"Please see https://github.com/highlightjs/highlight.js/issues/2559\");\n }\n options = inherit$1(options, userOptions);\n }\n\n /**\n * Highlights to all
 blocks on a page\n   *\n   * @type {Function & {called?: boolean}}\n   */\n  // TODO: remove v12, deprecated\n  const initHighlighting = () => {\n    if (initHighlighting.called) return;\n    initHighlighting.called = true;\n\n    deprecated(\"10.6.0\", \"initHighlighting() is deprecated.  Use highlightAll() instead.\");\n\n    const blocks = document.querySelectorAll('pre code');\n    blocks.forEach(highlightElement);\n  };\n\n  // Higlights all when DOMContentLoaded fires\n  // TODO: remove v12, deprecated\n  function initHighlightingOnLoad() {\n    deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated.  Use highlightAll() instead.\");\n    wantsHighlight = true;\n  }\n\n  let wantsHighlight = false;\n\n  /**\n   * auto-highlights all pre>code elements on the page\n   */\n  function highlightAll() {\n    // if we are called too early in the loading process\n    if (document.readyState === \"loading\") {\n      wantsHighlight = true;\n      return;\n    }\n\n    const blocks = document.querySelectorAll('pre code');\n    blocks.forEach(highlightElement);\n  }\n\n  function boot() {\n    // if a highlight was requested before DOM was loaded, do now\n    if (wantsHighlight) highlightAll();\n  }\n\n  // make sure we are in the browser environment\n  if (typeof window !== 'undefined' && window.addEventListener) {\n    window.addEventListener('DOMContentLoaded', boot, false);\n  }\n\n  /**\n   * Register a language grammar module\n   *\n   * @param {string} languageName\n   * @param {LanguageFn} languageDefinition\n   */\n  function registerLanguage(languageName, languageDefinition) {\n    let lang = null;\n    try {\n      lang = languageDefinition(hljs);\n    } catch (error$1) {\n      error(\"Language definition for '{}' could not be registered.\".replace(\"{}\", languageName));\n      // hard or soft error\n      if (!SAFE_MODE) { throw error$1; } else { error(error$1); }\n      // languages that have serious errors are replaced with essentially a\n      // \"plaintext\" stand-in so that the code blocks will still get normal\n      // css classes applied to them - and one bad language won't break the\n      // entire highlighter\n      lang = PLAINTEXT_LANGUAGE;\n    }\n    // give it a temporary name if it doesn't have one in the meta-data\n    if (!lang.name) lang.name = languageName;\n    languages[languageName] = lang;\n    lang.rawDefinition = languageDefinition.bind(null, hljs);\n\n    if (lang.aliases) {\n      registerAliases(lang.aliases, { languageName });\n    }\n  }\n\n  /**\n   * Remove a language grammar module\n   *\n   * @param {string} languageName\n   */\n  function unregisterLanguage(languageName) {\n    delete languages[languageName];\n    for (const alias of Object.keys(aliases)) {\n      if (aliases[alias] === languageName) {\n        delete aliases[alias];\n      }\n    }\n  }\n\n  /**\n   * @returns {string[]} List of language internal names\n   */\n  function listLanguages() {\n    return Object.keys(languages);\n  }\n\n  /**\n    intended usage: When one language truly requires another\n\n    Unlike `getLanguage`, this will throw when the requested language\n    is not available.\n\n    @param {string} name - name of the language to fetch/require\n    @returns {Language | never}\n  */\n  function requireLanguage(name) {\n    deprecated(\"10.4.0\", \"requireLanguage will be removed entirely in v11.\");\n    deprecated(\"10.4.0\", \"Please see https://github.com/highlightjs/highlight.js/pull/2844\");\n\n    const lang = getLanguage(name);\n    if (lang) { return lang; }\n\n    const err = new Error('The \\'{}\\' language is required, but not loaded.'.replace('{}', name));\n    throw err;\n  }\n\n  /**\n   * @param {string} name - name of the language to retrieve\n   * @returns {Language | undefined}\n   */\n  function getLanguage(name) {\n    name = (name || '').toLowerCase();\n    return languages[name] || languages[aliases[name]];\n  }\n\n  /**\n   *\n   * @param {string|string[]} aliasList - single alias or list of aliases\n   * @param {{languageName: string}} opts\n   */\n  function registerAliases(aliasList, { languageName }) {\n    if (typeof aliasList === 'string') {\n      aliasList = [aliasList];\n    }\n    aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });\n  }\n\n  /**\n   * Determines if a given language has auto-detection enabled\n   * @param {string} name - name of the language\n   */\n  function autoDetection(name) {\n    const lang = getLanguage(name);\n    return lang && !lang.disableAutodetect;\n  }\n\n  /**\n   * Upgrades the old highlightBlock plugins to the new\n   * highlightElement API\n   * @param {HLJSPlugin} plugin\n   */\n  function upgradePluginAPI(plugin) {\n    // TODO: remove with v12\n    if (plugin[\"before:highlightBlock\"] && !plugin[\"before:highlightElement\"]) {\n      plugin[\"before:highlightElement\"] = (data) => {\n        plugin[\"before:highlightBlock\"](\n          Object.assign({ block: data.el }, data)\n        );\n      };\n    }\n    if (plugin[\"after:highlightBlock\"] && !plugin[\"after:highlightElement\"]) {\n      plugin[\"after:highlightElement\"] = (data) => {\n        plugin[\"after:highlightBlock\"](\n          Object.assign({ block: data.el }, data)\n        );\n      };\n    }\n  }\n\n  /**\n   * @param {HLJSPlugin} plugin\n   */\n  function addPlugin(plugin) {\n    upgradePluginAPI(plugin);\n    plugins.push(plugin);\n  }\n\n  /**\n   *\n   * @param {PluginEvent} event\n   * @param {any} args\n   */\n  function fire(event, args) {\n    const cb = event;\n    plugins.forEach(function(plugin) {\n      if (plugin[cb]) {\n        plugin[cb](args);\n      }\n    });\n  }\n\n  /**\n  Note: fixMarkup is deprecated and will be removed entirely in v11\n\n  @param {string} arg\n  @returns {string}\n  */\n  function deprecateFixMarkup(arg) {\n    deprecated(\"10.2.0\", \"fixMarkup will be removed entirely in v11.0\");\n    deprecated(\"10.2.0\", \"Please see https://github.com/highlightjs/highlight.js/issues/2534\");\n\n    return fixMarkup(arg);\n  }\n\n  /**\n   *\n   * @param {HighlightedHTMLElement} el\n   */\n  function deprecateHighlightBlock(el) {\n    deprecated(\"10.7.0\", \"highlightBlock will be removed entirely in v12.0\");\n    deprecated(\"10.7.0\", \"Please use highlightElement now.\");\n\n    return highlightElement(el);\n  }\n\n  /* Interface definition */\n  Object.assign(hljs, {\n    highlight,\n    highlightAuto,\n    highlightAll,\n    fixMarkup: deprecateFixMarkup,\n    highlightElement,\n    // TODO: Remove with v12 API\n    highlightBlock: deprecateHighlightBlock,\n    configure,\n    initHighlighting,\n    initHighlightingOnLoad,\n    registerLanguage,\n    unregisterLanguage,\n    listLanguages,\n    getLanguage,\n    registerAliases,\n    requireLanguage,\n    autoDetection,\n    inherit: inherit$1,\n    addPlugin,\n    // plugins for frameworks\n    vuePlugin: BuildVuePlugin(hljs).VuePlugin\n  });\n\n  hljs.debugMode = function() { SAFE_MODE = false; };\n  hljs.safeMode = function() { SAFE_MODE = true; };\n  hljs.versionString = version;\n\n  for (const key in MODES) {\n    // @ts-ignore\n    if (typeof MODES[key] === \"object\") {\n      // @ts-ignore\n      deepFreezeEs6(MODES[key]);\n    }\n  }\n\n  // merge all the modes/regexs into our main object\n  Object.assign(hljs, MODES);\n\n  // built-in plugins, likely to be moved out of core in the future\n  hljs.addPlugin(brPlugin); // slated to be removed in v11\n  hljs.addPlugin(mergeHTMLPlugin);\n  hljs.addPlugin(tabReplacePlugin);\n  return hljs;\n};\n\n// export an \"instance\" of the highlighter\nvar highlight = HLJS({});\n\nmodule.exports = highlight;\n","/*\n * Copyright 2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the 'License');\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an 'AS IS' BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function () {\n  'use strict';\n\n  const highlightJs = require('highlight.js/lib/core');\n\n  highlightJs.registerLanguage('asciidoc', require('highlight.js/lib/languages/asciidoc'));\n  highlightJs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));\n  highlightJs.registerLanguage('css', require('highlight.js/lib/languages/css'));\n  highlightJs.registerLanguage('diff', require('highlight.js/lib/languages/diff'));\n  highlightJs.registerLanguage('dockerfile', require('highlight.js/lib/languages/dockerfile'));\n  highlightJs.registerLanguage('dos', require('highlight.js/lib/languages/dos'));\n  highlightJs.registerLanguage('gradle', require('highlight.js/lib/languages/gradle'));\n  highlightJs.registerLanguage('groovy', require('highlight.js/lib/languages/groovy'));\n  highlightJs.registerLanguage('http', require('highlight.js/lib/languages/http'));\n  highlightJs.registerLanguage('java', require('highlight.js/lib/languages/java'));\n  highlightJs.registerLanguage('javascript',require('highlight.js/lib/languages/javascript'));\n  highlightJs.registerLanguage('json', require('highlight.js/lib/languages/json'));\n  highlightJs.registerLanguage('kotlin', require('highlight.js/lib/languages/kotlin'));\n  highlightJs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));\n  highlightJs.registerLanguage('nix', require('highlight.js/lib/languages/nix'));\n  highlightJs.registerLanguage('powershell', require('highlight.js/lib/languages/powershell'));\n  highlightJs.registerLanguage('properties', require('highlight.js/lib/languages/properties'));\n  highlightJs.registerLanguage('ruby', require('highlight.js/lib/languages/ruby'));\n  highlightJs.registerLanguage('scala', require('highlight.js/lib/languages/scala'));\n  highlightJs.registerLanguage('shell', require('highlight.js/lib/languages/shell'));\n  highlightJs.registerLanguage('sql', require('highlight.js/lib/languages/sql'));\n  highlightJs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));\n  highlightJs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));\n\n  highlightJs.configure({ignoreUnescapedHTML: true});\n\n  for(const codeElement of document.querySelectorAll('pre.highlight > code')) {\n    highlightJs.highlightBlock(codeElement);\n  }\n\n})();\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: AsciiDoc\nRequires: xml.js\nAuthor: Dan Allen \nWebsite: http://asciidoc.org\nDescription: A semantic, text-based document format that can be exported to HTML, DocBook and other backends.\nCategory: markup\n*/\n\n/** @type LanguageFn */\nfunction asciidoc(hljs) {\n  const HORIZONTAL_RULE = {\n    begin: '^\\'{3,}[ \\\\t]*$',\n    relevance: 10\n  };\n  const ESCAPED_FORMATTING = [\n    // escaped constrained formatting marks (i.e., \\* \\_ or \\`)\n    {\n      begin: /\\\\[*_`]/\n    },\n    // escaped unconstrained formatting marks (i.e., \\\\** \\\\__ or \\\\``)\n    // must ignore until the next formatting marks\n    // this rule might not be 100% compliant with Asciidoctor 2.0 but we are entering undefined behavior territory...\n    {\n      begin: /\\\\\\\\\\*{2}[^\\n]*?\\*{2}/\n    },\n    {\n      begin: /\\\\\\\\_{2}[^\\n]*_{2}/\n    },\n    {\n      begin: /\\\\\\\\`{2}[^\\n]*`{2}/\n    },\n    // guard: constrained formatting mark may not be preceded by \":\", \";\" or\n    // \"}\". match these so the constrained rule doesn't see them\n    {\n      begin: /[:;}][*_`](?![*_`])/\n    }\n  ];\n  const STRONG = [\n    // inline unconstrained strong (single line)\n    {\n      className: 'strong',\n      begin: /\\*{2}([^\\n]+?)\\*{2}/\n    },\n    // inline unconstrained strong (multi-line)\n    {\n      className: 'strong',\n      begin: concat(\n        /\\*\\*/,\n        /((\\*(?!\\*)|\\\\[^\\n]|[^*\\n\\\\])+\\n)+/,\n        /(\\*(?!\\*)|\\\\[^\\n]|[^*\\n\\\\])*/,\n        /\\*\\*/\n      ),\n      relevance: 0\n    },\n    // inline constrained strong (single line)\n    {\n      className: 'strong',\n      // must not precede or follow a word character\n      begin: /\\B\\*(\\S|\\S[^\\n]*?\\S)\\*(?!\\w)/\n    },\n    // inline constrained strong (multi-line)\n    {\n      className: 'strong',\n      // must not precede or follow a word character\n      begin: /\\*[^\\s]([^\\n]+\\n)+([^\\n]+)\\*/\n    }\n  ];\n  const EMPHASIS = [\n    // inline unconstrained emphasis (single line)\n    {\n      className: 'emphasis',\n      begin: /_{2}([^\\n]+?)_{2}/\n    },\n    // inline unconstrained emphasis (multi-line)\n    {\n      className: 'emphasis',\n      begin: concat(\n        /__/,\n        /((_(?!_)|\\\\[^\\n]|[^_\\n\\\\])+\\n)+/,\n        /(_(?!_)|\\\\[^\\n]|[^_\\n\\\\])*/,\n        /__/\n      ),\n      relevance: 0\n    },\n    // inline constrained emphasis (single line)\n    {\n      className: 'emphasis',\n      // must not precede or follow a word character\n      begin: /\\b_(\\S|\\S[^\\n]*?\\S)_(?!\\w)/\n    },\n    // inline constrained emphasis (multi-line)\n    {\n      className: 'emphasis',\n      // must not precede or follow a word character\n      begin: /_[^\\s]([^\\n]+\\n)+([^\\n]+)_/\n    },\n    // inline constrained emphasis using single quote (legacy)\n    {\n      className: 'emphasis',\n      // must not follow a word character or be followed by a single quote or space\n      begin: '\\\\B\\'(?![\\'\\\\s])',\n      end: '(\\\\n{2}|\\')',\n      // allow escaped single quote followed by word char\n      contains: [{\n        begin: '\\\\\\\\\\'\\\\w',\n        relevance: 0\n      }],\n      relevance: 0\n    }\n  ];\n  const ADMONITION = {\n    className: 'symbol',\n    begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\\\s+',\n    relevance: 10\n  };\n  const BULLET_LIST = {\n    className: 'bullet',\n    begin: '^(\\\\*+|-+|\\\\.+|[^\\\\n]+?::)\\\\s+'\n  };\n\n  return {\n    name: 'AsciiDoc',\n    aliases: ['adoc'],\n    contains: [\n      // block comment\n      hljs.COMMENT(\n        '^/{4,}\\\\n',\n        '\\\\n/{4,}$',\n        // can also be done as...\n        // '^/{4,}$',\n        // '^/{4,}$',\n        {\n          relevance: 10\n        }\n      ),\n      // line comment\n      hljs.COMMENT(\n        '^//',\n        '$',\n        {\n          relevance: 0\n        }\n      ),\n      // title\n      {\n        className: 'title',\n        begin: '^\\\\.\\\\w.*$'\n      },\n      // example, admonition & sidebar blocks\n      {\n        begin: '^[=\\\\*]{4,}\\\\n',\n        end: '\\\\n^[=\\\\*]{4,}$',\n        relevance: 10\n      },\n      // headings\n      {\n        className: 'section',\n        relevance: 10,\n        variants: [\n          {\n            begin: '^(={1,6})[ \\t].+?([ \\t]\\\\1)?$'\n          },\n          {\n            begin: '^[^\\\\[\\\\]\\\\n]+?\\\\n[=\\\\-~\\\\^\\\\+]{2,}$'\n          }\n        ]\n      },\n      // document attributes\n      {\n        className: 'meta',\n        begin: '^:.+?:',\n        end: '\\\\s',\n        excludeEnd: true,\n        relevance: 10\n      },\n      // block attributes\n      {\n        className: 'meta',\n        begin: '^\\\\[.+?\\\\]$',\n        relevance: 0\n      },\n      // quoteblocks\n      {\n        className: 'quote',\n        begin: '^_{4,}\\\\n',\n        end: '\\\\n_{4,}$',\n        relevance: 10\n      },\n      // listing and literal blocks\n      {\n        className: 'code',\n        begin: '^[\\\\-\\\\.]{4,}\\\\n',\n        end: '\\\\n[\\\\-\\\\.]{4,}$',\n        relevance: 10\n      },\n      // passthrough blocks\n      {\n        begin: '^\\\\+{4,}\\\\n',\n        end: '\\\\n\\\\+{4,}$',\n        contains: [{\n          begin: '<',\n          end: '>',\n          subLanguage: 'xml',\n          relevance: 0\n        }],\n        relevance: 10\n      },\n\n      BULLET_LIST,\n      ADMONITION,\n      ...ESCAPED_FORMATTING,\n      ...STRONG,\n      ...EMPHASIS,\n\n      // inline smart quotes\n      {\n        className: 'string',\n        variants: [\n          {\n            begin: \"``.+?''\"\n          },\n          {\n            begin: \"`.+?'\"\n          }\n        ]\n      },\n      // inline unconstrained emphasis\n      {\n        className: 'code',\n        begin: /`{2}/,\n        end: /(\\n{2}|`{2})/\n      },\n      // inline code snippets (TODO should get same treatment as strong and emphasis)\n      {\n        className: 'code',\n        begin: '(`.+?`|\\\\+.+?\\\\+)',\n        relevance: 0\n      },\n      // indented literal block\n      {\n        className: 'code',\n        begin: '^[ \\\\t]',\n        end: '$',\n        relevance: 0\n      },\n      HORIZONTAL_RULE,\n      // images and links\n      {\n        begin: '(link:)?(http|https|ftp|file|irc|image:?):\\\\S+?\\\\[[^[]*?\\\\]',\n        returnBegin: true,\n        contains: [\n          {\n            begin: '(link|image:?):',\n            relevance: 0\n          },\n          {\n            className: 'link',\n            begin: '\\\\w',\n            end: '[^\\\\[]+',\n            relevance: 0\n          },\n          {\n            className: 'string',\n            begin: '\\\\[',\n            end: '\\\\]',\n            excludeBegin: true,\n            excludeEnd: true,\n            relevance: 0\n          }\n        ],\n        relevance: 10\n      }\n    ]\n  };\n}\n\nmodule.exports = asciidoc;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: Bash\nAuthor: vah \nContributrors: Benjamin Pannell \nWebsite: https://www.gnu.org/software/bash/\nCategory: common\n*/\n\n/** @type LanguageFn */\nfunction bash(hljs) {\n  const VAR = {};\n  const BRACED_VAR = {\n    begin: /\\$\\{/,\n    end:/\\}/,\n    contains: [\n      \"self\",\n      {\n        begin: /:-/,\n        contains: [ VAR ]\n      } // default values\n    ]\n  };\n  Object.assign(VAR,{\n    className: 'variable',\n    variants: [\n      {begin: concat(/\\$[\\w\\d#@][\\w\\d_]*/,\n        // negative look-ahead tries to avoid matching patterns that are not\n        // Perl at all like $ident$, @ident@, etc.\n        `(?![\\\\w\\\\d])(?![$])`) },\n      BRACED_VAR\n    ]\n  });\n\n  const SUBST = {\n    className: 'subst',\n    begin: /\\$\\(/, end: /\\)/,\n    contains: [hljs.BACKSLASH_ESCAPE]\n  };\n  const HERE_DOC = {\n    begin: /<<-?\\s*(?=\\w+)/,\n    starts: {\n      contains: [\n        hljs.END_SAME_AS_BEGIN({\n          begin: /(\\w+)/,\n          end: /(\\w+)/,\n          className: 'string'\n        })\n      ]\n    }\n  };\n  const QUOTE_STRING = {\n    className: 'string',\n    begin: /\"/, end: /\"/,\n    contains: [\n      hljs.BACKSLASH_ESCAPE,\n      VAR,\n      SUBST\n    ]\n  };\n  SUBST.contains.push(QUOTE_STRING);\n  const ESCAPED_QUOTE = {\n    className: '',\n    begin: /\\\\\"/\n\n  };\n  const APOS_STRING = {\n    className: 'string',\n    begin: /'/, end: /'/\n  };\n  const ARITHMETIC = {\n    begin: /\\$\\(\\(/,\n    end: /\\)\\)/,\n    contains: [\n      { begin: /\\d+#[0-9a-f]+/, className: \"number\" },\n      hljs.NUMBER_MODE,\n      VAR\n    ]\n  };\n  const SH_LIKE_SHELLS = [\n    \"fish\",\n    \"bash\",\n    \"zsh\",\n    \"sh\",\n    \"csh\",\n    \"ksh\",\n    \"tcsh\",\n    \"dash\",\n    \"scsh\",\n  ];\n  const KNOWN_SHEBANG = hljs.SHEBANG({\n    binary: `(${SH_LIKE_SHELLS.join(\"|\")})`,\n    relevance: 10\n  });\n  const FUNCTION = {\n    className: 'function',\n    begin: /\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,\n    returnBegin: true,\n    contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\\w[\\w\\d_]*/})],\n    relevance: 0\n  };\n\n  return {\n    name: 'Bash',\n    aliases: ['sh', 'zsh'],\n    keywords: {\n      $pattern: /\\b[a-z._-]+\\b/,\n      keyword:\n        'if then else elif fi for while in do done case esac function',\n      literal:\n        'true false',\n      built_in:\n        // Shell built-ins\n        // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html\n        'break cd continue eval exec exit export getopts hash pwd readonly return shift test times ' +\n        'trap umask unset ' +\n        // Bash built-ins\n        'alias bind builtin caller command declare echo enable help let local logout mapfile printf ' +\n        'read readarray source type typeset ulimit unalias ' +\n        // Shell modifiers\n        'set shopt ' +\n        // Zsh built-ins\n        'autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles ' +\n        'compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate ' +\n        'fc fg float functions getcap getln history integer jobs kill limit log noglob popd print ' +\n        'pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit ' +\n        'unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof ' +\n        'zpty zregexparse zsocket zstyle ztcp'\n    },\n    contains: [\n      KNOWN_SHEBANG, // to catch known shells and boost relevancy\n      hljs.SHEBANG(), // to catch unknown shells but still highlight the shebang\n      FUNCTION,\n      ARITHMETIC,\n      hljs.HASH_COMMENT_MODE,\n      HERE_DOC,\n      QUOTE_STRING,\n      ESCAPED_QUOTE,\n      APOS_STRING,\n      VAR\n    ]\n  };\n}\n\nmodule.exports = bash;\n","const MODES = (hljs) => {\n  return {\n    IMPORTANT: {\n      className: 'meta',\n      begin: '!important'\n    },\n    HEXCOLOR: {\n      className: 'number',\n      begin: '#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})'\n    },\n    ATTRIBUTE_SELECTOR_MODE: {\n      className: 'selector-attr',\n      begin: /\\[/,\n      end: /\\]/,\n      illegal: '$',\n      contains: [\n        hljs.APOS_STRING_MODE,\n        hljs.QUOTE_STRING_MODE\n      ]\n    }\n  };\n};\n\nconst TAGS = [\n  'a',\n  'abbr',\n  'address',\n  'article',\n  'aside',\n  'audio',\n  'b',\n  'blockquote',\n  'body',\n  'button',\n  'canvas',\n  'caption',\n  'cite',\n  'code',\n  'dd',\n  'del',\n  'details',\n  'dfn',\n  'div',\n  'dl',\n  'dt',\n  'em',\n  'fieldset',\n  'figcaption',\n  'figure',\n  'footer',\n  'form',\n  'h1',\n  'h2',\n  'h3',\n  'h4',\n  'h5',\n  'h6',\n  'header',\n  'hgroup',\n  'html',\n  'i',\n  'iframe',\n  'img',\n  'input',\n  'ins',\n  'kbd',\n  'label',\n  'legend',\n  'li',\n  'main',\n  'mark',\n  'menu',\n  'nav',\n  'object',\n  'ol',\n  'p',\n  'q',\n  'quote',\n  'samp',\n  'section',\n  'span',\n  'strong',\n  'summary',\n  'sup',\n  'table',\n  'tbody',\n  'td',\n  'textarea',\n  'tfoot',\n  'th',\n  'thead',\n  'time',\n  'tr',\n  'ul',\n  'var',\n  'video'\n];\n\nconst MEDIA_FEATURES = [\n  'any-hover',\n  'any-pointer',\n  'aspect-ratio',\n  'color',\n  'color-gamut',\n  'color-index',\n  'device-aspect-ratio',\n  'device-height',\n  'device-width',\n  'display-mode',\n  'forced-colors',\n  'grid',\n  'height',\n  'hover',\n  'inverted-colors',\n  'monochrome',\n  'orientation',\n  'overflow-block',\n  'overflow-inline',\n  'pointer',\n  'prefers-color-scheme',\n  'prefers-contrast',\n  'prefers-reduced-motion',\n  'prefers-reduced-transparency',\n  'resolution',\n  'scan',\n  'scripting',\n  'update',\n  'width',\n  // TODO: find a better solution?\n  'min-width',\n  'max-width',\n  'min-height',\n  'max-height'\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes\nconst PSEUDO_CLASSES = [\n  'active',\n  'any-link',\n  'blank',\n  'checked',\n  'current',\n  'default',\n  'defined',\n  'dir', // dir()\n  'disabled',\n  'drop',\n  'empty',\n  'enabled',\n  'first',\n  'first-child',\n  'first-of-type',\n  'fullscreen',\n  'future',\n  'focus',\n  'focus-visible',\n  'focus-within',\n  'has', // has()\n  'host', // host or host()\n  'host-context', // host-context()\n  'hover',\n  'indeterminate',\n  'in-range',\n  'invalid',\n  'is', // is()\n  'lang', // lang()\n  'last-child',\n  'last-of-type',\n  'left',\n  'link',\n  'local-link',\n  'not', // not()\n  'nth-child', // nth-child()\n  'nth-col', // nth-col()\n  'nth-last-child', // nth-last-child()\n  'nth-last-col', // nth-last-col()\n  'nth-last-of-type', //nth-last-of-type()\n  'nth-of-type', //nth-of-type()\n  'only-child',\n  'only-of-type',\n  'optional',\n  'out-of-range',\n  'past',\n  'placeholder-shown',\n  'read-only',\n  'read-write',\n  'required',\n  'right',\n  'root',\n  'scope',\n  'target',\n  'target-within',\n  'user-invalid',\n  'valid',\n  'visited',\n  'where' // where()\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements\nconst PSEUDO_ELEMENTS = [\n  'after',\n  'backdrop',\n  'before',\n  'cue',\n  'cue-region',\n  'first-letter',\n  'first-line',\n  'grammar-error',\n  'marker',\n  'part',\n  'placeholder',\n  'selection',\n  'slotted',\n  'spelling-error'\n];\n\nconst ATTRIBUTES = [\n  'align-content',\n  'align-items',\n  'align-self',\n  'animation',\n  'animation-delay',\n  'animation-direction',\n  'animation-duration',\n  'animation-fill-mode',\n  'animation-iteration-count',\n  'animation-name',\n  'animation-play-state',\n  'animation-timing-function',\n  'auto',\n  'backface-visibility',\n  'background',\n  'background-attachment',\n  'background-clip',\n  'background-color',\n  'background-image',\n  'background-origin',\n  'background-position',\n  'background-repeat',\n  'background-size',\n  'border',\n  'border-bottom',\n  'border-bottom-color',\n  'border-bottom-left-radius',\n  'border-bottom-right-radius',\n  'border-bottom-style',\n  'border-bottom-width',\n  'border-collapse',\n  'border-color',\n  'border-image',\n  'border-image-outset',\n  'border-image-repeat',\n  'border-image-slice',\n  'border-image-source',\n  'border-image-width',\n  'border-left',\n  'border-left-color',\n  'border-left-style',\n  'border-left-width',\n  'border-radius',\n  'border-right',\n  'border-right-color',\n  'border-right-style',\n  'border-right-width',\n  'border-spacing',\n  'border-style',\n  'border-top',\n  'border-top-color',\n  'border-top-left-radius',\n  'border-top-right-radius',\n  'border-top-style',\n  'border-top-width',\n  'border-width',\n  'bottom',\n  'box-decoration-break',\n  'box-shadow',\n  'box-sizing',\n  'break-after',\n  'break-before',\n  'break-inside',\n  'caption-side',\n  'clear',\n  'clip',\n  'clip-path',\n  'color',\n  'column-count',\n  'column-fill',\n  'column-gap',\n  'column-rule',\n  'column-rule-color',\n  'column-rule-style',\n  'column-rule-width',\n  'column-span',\n  'column-width',\n  'columns',\n  'content',\n  'counter-increment',\n  'counter-reset',\n  'cursor',\n  'direction',\n  'display',\n  'empty-cells',\n  'filter',\n  'flex',\n  'flex-basis',\n  'flex-direction',\n  'flex-flow',\n  'flex-grow',\n  'flex-shrink',\n  'flex-wrap',\n  'float',\n  'font',\n  'font-display',\n  'font-family',\n  'font-feature-settings',\n  'font-kerning',\n  'font-language-override',\n  'font-size',\n  'font-size-adjust',\n  'font-smoothing',\n  'font-stretch',\n  'font-style',\n  'font-variant',\n  'font-variant-ligatures',\n  'font-variation-settings',\n  'font-weight',\n  'height',\n  'hyphens',\n  'icon',\n  'image-orientation',\n  'image-rendering',\n  'image-resolution',\n  'ime-mode',\n  'inherit',\n  'initial',\n  'justify-content',\n  'left',\n  'letter-spacing',\n  'line-height',\n  'list-style',\n  'list-style-image',\n  'list-style-position',\n  'list-style-type',\n  'margin',\n  'margin-bottom',\n  'margin-left',\n  'margin-right',\n  'margin-top',\n  'marks',\n  'mask',\n  'max-height',\n  'max-width',\n  'min-height',\n  'min-width',\n  'nav-down',\n  'nav-index',\n  'nav-left',\n  'nav-right',\n  'nav-up',\n  'none',\n  'normal',\n  'object-fit',\n  'object-position',\n  'opacity',\n  'order',\n  'orphans',\n  'outline',\n  'outline-color',\n  'outline-offset',\n  'outline-style',\n  'outline-width',\n  'overflow',\n  'overflow-wrap',\n  'overflow-x',\n  'overflow-y',\n  'padding',\n  'padding-bottom',\n  'padding-left',\n  'padding-right',\n  'padding-top',\n  'page-break-after',\n  'page-break-before',\n  'page-break-inside',\n  'perspective',\n  'perspective-origin',\n  'pointer-events',\n  'position',\n  'quotes',\n  'resize',\n  'right',\n  'src', // @font-face\n  'tab-size',\n  'table-layout',\n  'text-align',\n  'text-align-last',\n  'text-decoration',\n  'text-decoration-color',\n  'text-decoration-line',\n  'text-decoration-style',\n  'text-indent',\n  'text-overflow',\n  'text-rendering',\n  'text-shadow',\n  'text-transform',\n  'text-underline-position',\n  'top',\n  'transform',\n  'transform-origin',\n  'transform-style',\n  'transition',\n  'transition-delay',\n  'transition-duration',\n  'transition-property',\n  'transition-timing-function',\n  'unicode-bidi',\n  'vertical-align',\n  'visibility',\n  'white-space',\n  'widows',\n  'width',\n  'word-break',\n  'word-spacing',\n  'word-wrap',\n  'z-index'\n  // reverse makes sure longer attributes `font-weight` are matched fully\n  // instead of getting false positives on say `font`\n].reverse();\n\n/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n  return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: CSS\nCategory: common, css\nWebsite: https://developer.mozilla.org/en-US/docs/Web/CSS\n*/\n\n/** @type LanguageFn */\nfunction css(hljs) {\n  const modes = MODES(hljs);\n  const FUNCTION_DISPATCH = {\n    className: \"built_in\",\n    begin: /[\\w-]+(?=\\()/\n  };\n  const VENDOR_PREFIX = {\n    begin: /-(webkit|moz|ms|o)-(?=[a-z])/\n  };\n  const AT_MODIFIERS = \"and or not only\";\n  const AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n  const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n  const STRINGS = [\n    hljs.APOS_STRING_MODE,\n    hljs.QUOTE_STRING_MODE\n  ];\n\n  return {\n    name: 'CSS',\n    case_insensitive: true,\n    illegal: /[=|'\\$]/,\n    keywords: {\n      keyframePosition: \"from to\"\n    },\n    classNameAliases: {\n      // for visual continuity with `tag {}` and because we\n      // don't have a great class for this?\n      keyframePosition: \"selector-tag\"\n    },\n    contains: [\n      hljs.C_BLOCK_COMMENT_MODE,\n      VENDOR_PREFIX,\n      // to recognize keyframe 40% etc which are outside the scope of our\n      // attribute value mode\n      hljs.CSS_NUMBER_MODE,\n      {\n        className: 'selector-id',\n        begin: /#[A-Za-z0-9_-]+/,\n        relevance: 0\n      },\n      {\n        className: 'selector-class',\n        begin: '\\\\.' + IDENT_RE,\n        relevance: 0\n      },\n      modes.ATTRIBUTE_SELECTOR_MODE,\n      {\n        className: 'selector-pseudo',\n        variants: [\n          {\n            begin: ':(' + PSEUDO_CLASSES.join('|') + ')'\n          },\n          {\n            begin: '::(' + PSEUDO_ELEMENTS.join('|') + ')'\n          }\n        ]\n      },\n      // we may actually need this (12/2020)\n      // { // pseudo-selector params\n      //   begin: /\\(/,\n      //   end: /\\)/,\n      //   contains: [ hljs.CSS_NUMBER_MODE ]\n      // },\n      {\n        className: 'attribute',\n        begin: '\\\\b(' + ATTRIBUTES.join('|') + ')\\\\b'\n      },\n      // attribute values\n      {\n        begin: ':',\n        end: '[;}]',\n        contains: [\n          modes.HEXCOLOR,\n          modes.IMPORTANT,\n          hljs.CSS_NUMBER_MODE,\n          ...STRINGS,\n          // needed to highlight these as strings and to avoid issues with\n          // illegal characters that might be inside urls that would tigger the\n          // languages illegal stack\n          {\n            begin: /(url|data-uri)\\(/,\n            end: /\\)/,\n            relevance: 0, // from keywords\n            keywords: {\n              built_in: \"url data-uri\"\n            },\n            contains: [\n              {\n                className: \"string\",\n                // any character other than `)` as in `url()` will be the start\n                // of a string, which ends with `)` (from the parent mode)\n                begin: /[^)]/,\n                endsWithParent: true,\n                excludeEnd: true\n              }\n            ]\n          },\n          FUNCTION_DISPATCH\n        ]\n      },\n      {\n        begin: lookahead(/@/),\n        end: '[{;]',\n        relevance: 0,\n        illegal: /:/, // break on Less variables @var: ...\n        contains: [\n          {\n            className: 'keyword',\n            begin: AT_PROPERTY_RE\n          },\n          {\n            begin: /\\s/,\n            endsWithParent: true,\n            excludeEnd: true,\n            relevance: 0,\n            keywords: {\n              $pattern: /[a-z-]+/,\n              keyword: AT_MODIFIERS,\n              attribute: MEDIA_FEATURES.join(\" \")\n            },\n            contains: [\n              {\n                begin: /[a-z-]+(?=:)/,\n                className: \"attribute\"\n              },\n              ...STRINGS,\n              hljs.CSS_NUMBER_MODE\n            ]\n          }\n        ]\n      },\n      {\n        className: 'selector-tag',\n        begin: '\\\\b(' + TAGS.join('|') + ')\\\\b'\n      }\n    ]\n  };\n}\n\nmodule.exports = css;\n","/*\nLanguage: Diff\nDescription: Unified and context diff\nAuthor: Vasily Polovnyov \nWebsite: https://www.gnu.org/software/diffutils/\nCategory: common\n*/\n\n/** @type LanguageFn */\nfunction diff(hljs) {\n  return {\n    name: 'Diff',\n    aliases: ['patch'],\n    contains: [\n      {\n        className: 'meta',\n        relevance: 10,\n        variants: [\n          {\n            begin: /^@@ +-\\d+,\\d+ +\\+\\d+,\\d+ +@@/\n          },\n          {\n            begin: /^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$/\n          },\n          {\n            begin: /^--- +\\d+,\\d+ +----$/\n          }\n        ]\n      },\n      {\n        className: 'comment',\n        variants: [\n          {\n            begin: /Index: /,\n            end: /$/\n          },\n          {\n            begin: /^index/,\n            end: /$/\n          },\n          {\n            begin: /={3,}/,\n            end: /$/\n          },\n          {\n            begin: /^-{3}/,\n            end: /$/\n          },\n          {\n            begin: /^\\*{3} /,\n            end: /$/\n          },\n          {\n            begin: /^\\+{3}/,\n            end: /$/\n          },\n          {\n            begin: /^\\*{15}$/\n          },\n          {\n            begin: /^diff --git/,\n            end: /$/\n          }\n        ]\n      },\n      {\n        className: 'addition',\n        begin: /^\\+/,\n        end: /$/\n      },\n      {\n        className: 'deletion',\n        begin: /^-/,\n        end: /$/\n      },\n      {\n        className: 'addition',\n        begin: /^!/,\n        end: /$/\n      }\n    ]\n  };\n}\n\nmodule.exports = diff;\n","/*\nLanguage: Dockerfile\nRequires: bash.js\nAuthor: Alexis Hénaut \nDescription: language definition for Dockerfile files\nWebsite: https://docs.docker.com/engine/reference/builder/\nCategory: config\n*/\n\n/** @type LanguageFn */\nfunction dockerfile(hljs) {\n  return {\n    name: 'Dockerfile',\n    aliases: ['docker'],\n    case_insensitive: true,\n    keywords: 'from maintainer expose env arg user onbuild stopsignal',\n    contains: [\n      hljs.HASH_COMMENT_MODE,\n      hljs.APOS_STRING_MODE,\n      hljs.QUOTE_STRING_MODE,\n      hljs.NUMBER_MODE,\n      {\n        beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck shell',\n        starts: {\n          end: /[^\\\\]$/,\n          subLanguage: 'bash'\n        }\n      }\n    ],\n    illegal: '\nContributors: Anton Kochkov \nWebsite: https://en.wikipedia.org/wiki/Batch_file\n*/\n\n/** @type LanguageFn */\nfunction dos(hljs) {\n  const COMMENT = hljs.COMMENT(\n    /^\\s*@?rem\\b/, /$/,\n    {\n      relevance: 10\n    }\n  );\n  const LABEL = {\n    className: 'symbol',\n    begin: '^\\\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\\\s+label)',\n    relevance: 0\n  };\n  return {\n    name: 'Batch file (DOS)',\n    aliases: [\n      'bat',\n      'cmd'\n    ],\n    case_insensitive: true,\n    illegal: /\\/\\*/,\n    keywords: {\n      keyword:\n        'if else goto for in do call exit not exist errorlevel defined ' +\n        'equ neq lss leq gtr geq',\n      built_in:\n        'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux ' +\n        'shift cd dir echo setlocal endlocal set pause copy ' +\n        'append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color ' +\n        'comp compact convert date dir diskcomp diskcopy doskey erase fs ' +\n        'find findstr format ftype graftabl help keyb label md mkdir mode more move path ' +\n        'pause print popd pushd promt rd recover rem rename replace restore rmdir shift ' +\n        'sort start subst time title tree type ver verify vol ' +\n        // winutils\n        'ping net ipconfig taskkill xcopy ren del'\n    },\n    contains: [\n      {\n        className: 'variable',\n        begin: /%%[^ ]|%[^ ]+?%|![^ ]+?!/\n      },\n      {\n        className: 'function',\n        begin: LABEL.begin,\n        end: 'goto:eof',\n        contains: [\n          hljs.inherit(hljs.TITLE_MODE, {\n            begin: '([_a-zA-Z]\\\\w*\\\\.)*([_a-zA-Z]\\\\w*:)?[_a-zA-Z]\\\\w*'\n          }),\n          COMMENT\n        ]\n      },\n      {\n        className: 'number',\n        begin: '\\\\b\\\\d+',\n        relevance: 0\n      },\n      COMMENT\n    ]\n  };\n}\n\nmodule.exports = dos;\n","/*\nLanguage: Gradle\nDescription: Gradle is an open-source build automation tool focused on flexibility and performance.\nWebsite: https://gradle.org\nAuthor: Damian Mee \n*/\n\nfunction gradle(hljs) {\n  return {\n    name: 'Gradle',\n    case_insensitive: true,\n    keywords: {\n      keyword:\n        'task project allprojects subprojects artifacts buildscript configurations ' +\n        'dependencies repositories sourceSets description delete from into include ' +\n        'exclude source classpath destinationDir includes options sourceCompatibility ' +\n        'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +\n        'def abstract break case catch continue default do else extends final finally ' +\n        'for if implements instanceof native new private protected public return static ' +\n        'switch synchronized throw throws transient try volatile while strictfp package ' +\n        'import false null super this true antlrtask checkstyle codenarc copy boolean ' +\n        'byte char class double float int interface long short void compile runTime ' +\n        'file fileTree abs any append asList asWritable call collect compareTo count ' +\n        'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +\n        'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +\n        'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +\n        'newReader newWriter next plus pop power previous print println push putAt read ' +\n        'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +\n        'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +\n        'withStream withWriter withWriterAppend write writeLine'\n    },\n    contains: [\n      hljs.C_LINE_COMMENT_MODE,\n      hljs.C_BLOCK_COMMENT_MODE,\n      hljs.APOS_STRING_MODE,\n      hljs.QUOTE_STRING_MODE,\n      hljs.NUMBER_MODE,\n      hljs.REGEXP_MODE\n\n    ]\n  };\n}\n\nmodule.exports = gradle;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n  return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\n Language: Groovy\n Author: Guillaume Laforge \n Description: Groovy programming language implementation inspired from Vsevolod's Java mode\n Website: https://groovy-lang.org\n */\n\nfunction variants(variants, obj = {}) {\n  obj.variants = variants;\n  return obj;\n}\n\nfunction groovy(hljs) {\n  const IDENT_RE = '[A-Za-z0-9_$]+';\n  const COMMENT = variants([\n    hljs.C_LINE_COMMENT_MODE,\n    hljs.C_BLOCK_COMMENT_MODE,\n    hljs.COMMENT(\n      '/\\\\*\\\\*',\n      '\\\\*/',\n      {\n        relevance: 0,\n        contains: [\n          {\n            // eat up @'s in emails to prevent them to be recognized as doctags\n            begin: /\\w+@/,\n            relevance: 0\n          },\n          {\n            className: 'doctag',\n            begin: '@[A-Za-z]+'\n          }\n        ]\n      }\n    )\n  ]);\n  const REGEXP = {\n    className: 'regexp',\n    begin: /~?\\/[^\\/\\n]+\\//,\n    contains: [ hljs.BACKSLASH_ESCAPE ]\n  };\n  const NUMBER = variants([\n    hljs.BINARY_NUMBER_MODE,\n    hljs.C_NUMBER_MODE\n  ]);\n  const STRING = variants([\n    {\n      begin: /\"\"\"/,\n      end: /\"\"\"/\n    },\n    {\n      begin: /'''/,\n      end: /'''/\n    },\n    {\n      begin: \"\\\\$/\",\n      end: \"/\\\\$\",\n      relevance: 10\n    },\n    hljs.APOS_STRING_MODE,\n    hljs.QUOTE_STRING_MODE\n  ],\n  {\n    className: \"string\"\n  }\n  );\n\n  return {\n    name: 'Groovy',\n    keywords: {\n      built_in: 'this super',\n      literal: 'true false null',\n      keyword:\n            'byte short char int long boolean float double void ' +\n            // groovy specific keywords\n            'def as in assert trait ' +\n            // common keywords with Java\n            'abstract static volatile transient public private protected synchronized final ' +\n            'class interface enum if else for while switch case break default continue ' +\n            'throw throws try catch finally implements extends new import package return instanceof'\n    },\n    contains: [\n      hljs.SHEBANG({\n        binary: \"groovy\",\n        relevance: 10\n      }),\n      COMMENT,\n      STRING,\n      REGEXP,\n      NUMBER,\n      {\n        className: 'class',\n        beginKeywords: 'class interface trait enum',\n        end: /\\{/,\n        illegal: ':',\n        contains: [\n          {\n            beginKeywords: 'extends implements'\n          },\n          hljs.UNDERSCORE_TITLE_MODE\n        ]\n      },\n      {\n        className: 'meta',\n        begin: '@[A-Za-z]+',\n        relevance: 0\n      },\n      {\n        // highlight map keys and named parameters as attrs\n        className: 'attr',\n        begin: IDENT_RE + '[ \\t]*:',\n        relevance: 0\n      },\n      {\n        // catch middle element of the ternary operator\n        // to avoid highlight it as a label, named parameter, or map key\n        begin: /\\?/,\n        end: /:/,\n        relevance: 0,\n        contains: [\n          COMMENT,\n          STRING,\n          REGEXP,\n          NUMBER,\n          'self'\n        ]\n      },\n      {\n        // highlight labeled statements\n        className: 'symbol',\n        begin: '^[ \\t]*' + lookahead(IDENT_RE + ':'),\n        excludeBegin: true,\n        end: IDENT_RE + ':',\n        relevance: 0\n      }\n    ],\n    illegal: /#|<\\//\n  };\n}\n\nmodule.exports = groovy;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: HTTP\nDescription: HTTP request and response headers with automatic body highlighting\nAuthor: Ivan Sagalaev \nCategory: common, protocols\nWebsite: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview\n*/\n\nfunction http(hljs) {\n  const VERSION = 'HTTP/(2|1\\\\.[01])';\n  const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/;\n  const HEADER = {\n    className: 'attribute',\n    begin: concat('^', HEADER_NAME, '(?=\\\\:\\\\s)'),\n    starts: {\n      contains: [\n        {\n          className: \"punctuation\",\n          begin: /: /,\n          relevance: 0,\n          starts: {\n            end: '$',\n            relevance: 0\n          }\n        }\n      ]\n    }\n  };\n  const HEADERS_AND_BODY = [\n    HEADER,\n    {\n      begin: '\\\\n\\\\n',\n      starts: { subLanguage: [], endsWithParent: true }\n    }\n  ];\n\n  return {\n    name: 'HTTP',\n    aliases: ['https'],\n    illegal: /\\S/,\n    contains: [\n      // response\n      {\n        begin: '^(?=' + VERSION + \" \\\\d{3})\",\n        end: /$/,\n        contains: [\n          {\n            className: \"meta\",\n            begin: VERSION\n          },\n          {\n            className: 'number', begin: '\\\\b\\\\d{3}\\\\b'\n          }\n        ],\n        starts: {\n          end: /\\b\\B/,\n          illegal: /\\S/,\n          contains: HEADERS_AND_BODY\n        }\n      },\n      // request\n      {\n        begin: '(?=^[A-Z]+ (.*?) ' + VERSION + '$)',\n        end: /$/,\n        contains: [\n          {\n            className: 'string',\n            begin: ' ',\n            end: ' ',\n            excludeBegin: true,\n            excludeEnd: true\n          },\n          {\n            className: \"meta\",\n            begin: VERSION\n          },\n          {\n            className: 'keyword',\n            begin: '[A-Z]+'\n          }\n        ],\n        starts: {\n          end: /\\b\\B/,\n          illegal: /\\S/,\n          contains: HEADERS_AND_BODY\n        }\n      },\n      // to allow headers to work even without a preamble\n      hljs.inherit(HEADER, {\n        relevance: 0\n      })\n    ]\n  };\n}\n\nmodule.exports = http;\n","// https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10\nvar decimalDigits = '[0-9](_*[0-9])*';\nvar frac = `\\\\.(${decimalDigits})`;\nvar hexDigits = '[0-9a-fA-F](_*[0-9a-fA-F])*';\nvar NUMERIC = {\n  className: 'number',\n  variants: [\n    // DecimalFloatingPointLiteral\n    // including ExponentPart\n    { begin: `(\\\\b(${decimalDigits})((${frac})|\\\\.)?|(${frac}))` +\n      `[eE][+-]?(${decimalDigits})[fFdD]?\\\\b` },\n    // excluding ExponentPart\n    { begin: `\\\\b(${decimalDigits})((${frac})[fFdD]?\\\\b|\\\\.([fFdD]\\\\b)?)` },\n    { begin: `(${frac})[fFdD]?\\\\b` },\n    { begin: `\\\\b(${decimalDigits})[fFdD]\\\\b` },\n\n    // HexadecimalFloatingPointLiteral\n    { begin: `\\\\b0[xX]((${hexDigits})\\\\.?|(${hexDigits})?\\\\.(${hexDigits}))` +\n      `[pP][+-]?(${decimalDigits})[fFdD]?\\\\b` },\n\n    // DecimalIntegerLiteral\n    { begin: '\\\\b(0|[1-9](_*[0-9])*)[lL]?\\\\b' },\n\n    // HexIntegerLiteral\n    { begin: `\\\\b0[xX](${hexDigits})[lL]?\\\\b` },\n\n    // OctalIntegerLiteral\n    { begin: '\\\\b0(_*[0-7])*[lL]?\\\\b' },\n\n    // BinaryIntegerLiteral\n    { begin: '\\\\b0[bB][01](_*[01])*[lL]?\\\\b' },\n  ],\n  relevance: 0\n};\n\n/*\nLanguage: Java\nAuthor: Vsevolod Solovyov \nCategory: common, enterprise\nWebsite: https://www.java.com/\n*/\n\nfunction java(hljs) {\n  var JAVA_IDENT_RE = '[\\u00C0-\\u02B8a-zA-Z_$][\\u00C0-\\u02B8a-zA-Z_$0-9]*';\n  var GENERIC_IDENT_RE = JAVA_IDENT_RE + '(<' + JAVA_IDENT_RE + '(\\\\s*,\\\\s*' + JAVA_IDENT_RE + ')*>)?';\n  var KEYWORDS = 'false synchronized int abstract float private char boolean var static null if const ' +\n    'for true while long strictfp finally protected import native final void ' +\n    'enum else break transient catch instanceof byte super volatile case assert short ' +\n    'package default double public try this switch continue throws protected public private ' +\n    'module requires exports do';\n\n  var ANNOTATION = {\n    className: 'meta',\n    begin: '@' + JAVA_IDENT_RE,\n    contains: [\n      {\n        begin: /\\(/,\n        end: /\\)/,\n        contains: [\"self\"] // allow nested () inside our annotation\n      },\n    ]\n  };\n  const NUMBER = NUMERIC;\n\n  return {\n    name: 'Java',\n    aliases: ['jsp'],\n    keywords: KEYWORDS,\n    illegal: /<\\/|#/,\n    contains: [\n      hljs.COMMENT(\n        '/\\\\*\\\\*',\n        '\\\\*/',\n        {\n          relevance: 0,\n          contains: [\n            {\n              // eat up @'s in emails to prevent them to be recognized as doctags\n              begin: /\\w+@/, relevance: 0\n            },\n            {\n              className: 'doctag',\n              begin: '@[A-Za-z]+'\n            }\n          ]\n        }\n      ),\n      // relevance boost\n      {\n        begin: /import java\\.[a-z]+\\./,\n        keywords: \"import\",\n        relevance: 2\n      },\n      hljs.C_LINE_COMMENT_MODE,\n      hljs.C_BLOCK_COMMENT_MODE,\n      hljs.APOS_STRING_MODE,\n      hljs.QUOTE_STRING_MODE,\n      {\n        className: 'class',\n        beginKeywords: 'class interface enum', end: /[{;=]/, excludeEnd: true,\n        // TODO: can this be removed somehow?\n        // an extra boost because Java is more popular than other languages with\n        // this same syntax feature (this is just to preserve our tests passing\n        // for now)\n        relevance: 1,\n        keywords: 'class interface enum',\n        illegal: /[:\"\\[\\]]/,\n        contains: [\n          { beginKeywords: 'extends implements' },\n          hljs.UNDERSCORE_TITLE_MODE\n        ]\n      },\n      {\n        // Expression keywords prevent 'keyword Name(...)' from being\n        // recognized as a function definition\n        beginKeywords: 'new throw return else',\n        relevance: 0\n      },\n      {\n        className: 'class',\n        begin: 'record\\\\s+' + hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n        returnBegin: true,\n        excludeEnd: true,\n        end: /[{;=]/,\n        keywords: KEYWORDS,\n        contains: [\n          { beginKeywords: \"record\" },\n          {\n            begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n            returnBegin: true,\n            relevance: 0,\n            contains: [hljs.UNDERSCORE_TITLE_MODE]\n          },\n          {\n            className: 'params',\n            begin: /\\(/, end: /\\)/,\n            keywords: KEYWORDS,\n            relevance: 0,\n            contains: [\n              hljs.C_BLOCK_COMMENT_MODE\n            ]\n          },\n          hljs.C_LINE_COMMENT_MODE,\n          hljs.C_BLOCK_COMMENT_MODE\n        ]\n      },\n      {\n        className: 'function',\n        begin: '(' + GENERIC_IDENT_RE + '\\\\s+)+' + hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(', returnBegin: true, end: /[{;=]/,\n        excludeEnd: true,\n        keywords: KEYWORDS,\n        contains: [\n          {\n            begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(', returnBegin: true,\n            relevance: 0,\n            contains: [hljs.UNDERSCORE_TITLE_MODE]\n          },\n          {\n            className: 'params',\n            begin: /\\(/, end: /\\)/,\n            keywords: KEYWORDS,\n            relevance: 0,\n            contains: [\n              ANNOTATION,\n              hljs.APOS_STRING_MODE,\n              hljs.QUOTE_STRING_MODE,\n              NUMBER,\n              hljs.C_BLOCK_COMMENT_MODE\n            ]\n          },\n          hljs.C_LINE_COMMENT_MODE,\n          hljs.C_BLOCK_COMMENT_MODE\n        ]\n      },\n      NUMBER,\n      ANNOTATION\n    ]\n  };\n}\n\nmodule.exports = java;\n","const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';\nconst KEYWORDS = [\n  \"as\", // for exports\n  \"in\",\n  \"of\",\n  \"if\",\n  \"for\",\n  \"while\",\n  \"finally\",\n  \"var\",\n  \"new\",\n  \"function\",\n  \"do\",\n  \"return\",\n  \"void\",\n  \"else\",\n  \"break\",\n  \"catch\",\n  \"instanceof\",\n  \"with\",\n  \"throw\",\n  \"case\",\n  \"default\",\n  \"try\",\n  \"switch\",\n  \"continue\",\n  \"typeof\",\n  \"delete\",\n  \"let\",\n  \"yield\",\n  \"const\",\n  \"class\",\n  // JS handles these with a special rule\n  // \"get\",\n  // \"set\",\n  \"debugger\",\n  \"async\",\n  \"await\",\n  \"static\",\n  \"import\",\n  \"from\",\n  \"export\",\n  \"extends\"\n];\nconst LITERALS = [\n  \"true\",\n  \"false\",\n  \"null\",\n  \"undefined\",\n  \"NaN\",\n  \"Infinity\"\n];\n\nconst TYPES = [\n  \"Intl\",\n  \"DataView\",\n  \"Number\",\n  \"Math\",\n  \"Date\",\n  \"String\",\n  \"RegExp\",\n  \"Object\",\n  \"Function\",\n  \"Boolean\",\n  \"Error\",\n  \"Symbol\",\n  \"Set\",\n  \"Map\",\n  \"WeakSet\",\n  \"WeakMap\",\n  \"Proxy\",\n  \"Reflect\",\n  \"JSON\",\n  \"Promise\",\n  \"Float64Array\",\n  \"Int16Array\",\n  \"Int32Array\",\n  \"Int8Array\",\n  \"Uint16Array\",\n  \"Uint32Array\",\n  \"Float32Array\",\n  \"Array\",\n  \"Uint8Array\",\n  \"Uint8ClampedArray\",\n  \"ArrayBuffer\",\n  \"BigInt64Array\",\n  \"BigUint64Array\",\n  \"BigInt\"\n];\n\nconst ERROR_TYPES = [\n  \"EvalError\",\n  \"InternalError\",\n  \"RangeError\",\n  \"ReferenceError\",\n  \"SyntaxError\",\n  \"TypeError\",\n  \"URIError\"\n];\n\nconst BUILT_IN_GLOBALS = [\n  \"setInterval\",\n  \"setTimeout\",\n  \"clearInterval\",\n  \"clearTimeout\",\n\n  \"require\",\n  \"exports\",\n\n  \"eval\",\n  \"isFinite\",\n  \"isNaN\",\n  \"parseFloat\",\n  \"parseInt\",\n  \"decodeURI\",\n  \"decodeURIComponent\",\n  \"encodeURI\",\n  \"encodeURIComponent\",\n  \"escape\",\n  \"unescape\"\n];\n\nconst BUILT_IN_VARIABLES = [\n  \"arguments\",\n  \"this\",\n  \"super\",\n  \"console\",\n  \"window\",\n  \"document\",\n  \"localStorage\",\n  \"module\",\n  \"global\" // Node.js\n];\n\nconst BUILT_INS = [].concat(\n  BUILT_IN_GLOBALS,\n  BUILT_IN_VARIABLES,\n  TYPES,\n  ERROR_TYPES\n);\n\n/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n  return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: JavaScript\nDescription: JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.\nCategory: common, scripting\nWebsite: https://developer.mozilla.org/en-US/docs/Web/JavaScript\n*/\n\n/** @type LanguageFn */\nfunction javascript(hljs) {\n  /**\n   * Takes a string like \" {\n    const tag = \"',\n    end: ''\n  };\n  const XML_TAG = {\n    begin: /<[A-Za-z0-9\\\\._:-]+/,\n    end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n    /**\n     * @param {RegExpMatchArray} match\n     * @param {CallbackResponse} response\n     */\n    isTrulyOpeningTag: (match, response) => {\n      const afterMatchIndex = match[0].length + match.index;\n      const nextChar = match.input[afterMatchIndex];\n      // nested type?\n      // HTML should not include another raw `<` inside a tag\n      // But a type might: `>`, etc.\n      if (nextChar === \"<\") {\n        response.ignoreMatch();\n        return;\n      }\n      // \n      // This is now either a tag or a type.\n      if (nextChar === \">\") {\n        // if we cannot find a matching closing tag, then we\n        // will ignore it\n        if (!hasClosingTag(match, { after: afterMatchIndex })) {\n          response.ignoreMatch();\n        }\n      }\n    }\n  };\n  const KEYWORDS$1 = {\n    $pattern: IDENT_RE,\n    keyword: KEYWORDS,\n    literal: LITERALS,\n    built_in: BUILT_INS\n  };\n\n  // https://tc39.es/ecma262/#sec-literals-numeric-literals\n  const decimalDigits = '[0-9](_?[0-9])*';\n  const frac = `\\\\.(${decimalDigits})`;\n  // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n  // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n  const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n  const NUMBER = {\n    className: 'number',\n    variants: [\n      // DecimalLiteral\n      { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n        `[eE][+-]?(${decimalDigits})\\\\b` },\n      { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n      // DecimalBigIntegerLiteral\n      { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n      // NonDecimalIntegerLiteral\n      { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n      { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n      { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n      // LegacyOctalIntegerLiteral (does not include underscore separators)\n      // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n      { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n    ],\n    relevance: 0\n  };\n\n  const SUBST = {\n    className: 'subst',\n    begin: '\\\\$\\\\{',\n    end: '\\\\}',\n    keywords: KEYWORDS$1,\n    contains: [] // defined later\n  };\n  const HTML_TEMPLATE = {\n    begin: 'html`',\n    end: '',\n    starts: {\n      end: '`',\n      returnEnd: false,\n      contains: [\n        hljs.BACKSLASH_ESCAPE,\n        SUBST\n      ],\n      subLanguage: 'xml'\n    }\n  };\n  const CSS_TEMPLATE = {\n    begin: 'css`',\n    end: '',\n    starts: {\n      end: '`',\n      returnEnd: false,\n      contains: [\n        hljs.BACKSLASH_ESCAPE,\n        SUBST\n      ],\n      subLanguage: 'css'\n    }\n  };\n  const TEMPLATE_STRING = {\n    className: 'string',\n    begin: '`',\n    end: '`',\n    contains: [\n      hljs.BACKSLASH_ESCAPE,\n      SUBST\n    ]\n  };\n  const JSDOC_COMMENT = hljs.COMMENT(\n    /\\/\\*\\*(?!\\/)/,\n    '\\\\*/',\n    {\n      relevance: 0,\n      contains: [\n        {\n          className: 'doctag',\n          begin: '@[A-Za-z]+',\n          contains: [\n            {\n              className: 'type',\n              begin: '\\\\{',\n              end: '\\\\}',\n              relevance: 0\n            },\n            {\n              className: 'variable',\n              begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n              endsParent: true,\n              relevance: 0\n            },\n            // eat spaces (not newlines) so we can find\n            // types or variables\n            {\n              begin: /(?=[^\\n])\\s/,\n              relevance: 0\n            }\n          ]\n        }\n      ]\n    }\n  );\n  const COMMENT = {\n    className: \"comment\",\n    variants: [\n      JSDOC_COMMENT,\n      hljs.C_BLOCK_COMMENT_MODE,\n      hljs.C_LINE_COMMENT_MODE\n    ]\n  };\n  const SUBST_INTERNALS = [\n    hljs.APOS_STRING_MODE,\n    hljs.QUOTE_STRING_MODE,\n    HTML_TEMPLATE,\n    CSS_TEMPLATE,\n    TEMPLATE_STRING,\n    NUMBER,\n    hljs.REGEXP_MODE\n  ];\n  SUBST.contains = SUBST_INTERNALS\n    .concat({\n      // we need to pair up {} inside our subst to prevent\n      // it from ending too early by matching another }\n      begin: /\\{/,\n      end: /\\}/,\n      keywords: KEYWORDS$1,\n      contains: [\n        \"self\"\n      ].concat(SUBST_INTERNALS)\n    });\n  const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n  const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n    // eat recursive parens in sub expressions\n    {\n      begin: /\\(/,\n      end: /\\)/,\n      keywords: KEYWORDS$1,\n      contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n    }\n  ]);\n  const PARAMS = {\n    className: 'params',\n    begin: /\\(/,\n    end: /\\)/,\n    excludeBegin: true,\n    excludeEnd: true,\n    keywords: KEYWORDS$1,\n    contains: PARAMS_CONTAINS\n  };\n\n  return {\n    name: 'Javascript',\n    aliases: ['js', 'jsx', 'mjs', 'cjs'],\n    keywords: KEYWORDS$1,\n    // this will be extended by TypeScript\n    exports: { PARAMS_CONTAINS },\n    illegal: /#(?![$_A-z])/,\n    contains: [\n      hljs.SHEBANG({\n        label: \"shebang\",\n        binary: \"node\",\n        relevance: 5\n      }),\n      {\n        label: \"use_strict\",\n        className: 'meta',\n        relevance: 10,\n        begin: /^\\s*['\"]use (strict|asm)['\"]/\n      },\n      hljs.APOS_STRING_MODE,\n      hljs.QUOTE_STRING_MODE,\n      HTML_TEMPLATE,\n      CSS_TEMPLATE,\n      TEMPLATE_STRING,\n      COMMENT,\n      NUMBER,\n      { // object attr container\n        begin: concat(/[{,\\n]\\s*/,\n          // we need to look ahead to make sure that we actually have an\n          // attribute coming up so we don't steal a comma from a potential\n          // \"value\" container\n          //\n          // NOTE: this might not work how you think.  We don't actually always\n          // enter this mode and stay.  Instead it might merely match `,\n          // ` and then immediately end after the , because it\n          // fails to find any actual attrs. But this still does the job because\n          // it prevents the value contain rule from grabbing this instead and\n          // prevening this rule from firing when we actually DO have keys.\n          lookahead(concat(\n            // we also need to allow for multiple possible comments inbetween\n            // the first key:value pairing\n            /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n            IDENT_RE$1 + '\\\\s*:'))),\n        relevance: 0,\n        contains: [\n          {\n            className: 'attr',\n            begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n            relevance: 0\n          }\n        ]\n      },\n      { // \"value\" container\n        begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n        keywords: 'return throw case',\n        contains: [\n          COMMENT,\n          hljs.REGEXP_MODE,\n          {\n            className: 'function',\n            // we have to count the parens to make sure we actually have the\n            // correct bounding ( ) before the =>.  There could be any number of\n            // sub-expressions inside also surrounded by parens.\n            begin: '(\\\\(' +\n            '[^()]*(\\\\(' +\n            '[^()]*(\\\\(' +\n            '[^()]*' +\n            '\\\\)[^()]*)*' +\n            '\\\\)[^()]*)*' +\n            '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n            returnBegin: true,\n            end: '\\\\s*=>',\n            contains: [\n              {\n                className: 'params',\n                variants: [\n                  {\n                    begin: hljs.UNDERSCORE_IDENT_RE,\n                    relevance: 0\n                  },\n                  {\n                    className: null,\n                    begin: /\\(\\s*\\)/,\n                    skip: true\n                  },\n                  {\n                    begin: /\\(/,\n                    end: /\\)/,\n                    excludeBegin: true,\n                    excludeEnd: true,\n                    keywords: KEYWORDS$1,\n                    contains: PARAMS_CONTAINS\n                  }\n                ]\n              }\n            ]\n          },\n          { // could be a comma delimited list of params to a function call\n            begin: /,/, relevance: 0\n          },\n          {\n            className: '',\n            begin: /\\s/,\n            end: /\\s*/,\n            skip: true\n          },\n          { // JSX\n            variants: [\n              { begin: FRAGMENT.begin, end: FRAGMENT.end },\n              {\n                begin: XML_TAG.begin,\n                // we carefully check the opening tag to see if it truly\n                // is a tag and not a false positive\n                'on:begin': XML_TAG.isTrulyOpeningTag,\n                end: XML_TAG.end\n              }\n            ],\n            subLanguage: 'xml',\n            contains: [\n              {\n                begin: XML_TAG.begin,\n                end: XML_TAG.end,\n                skip: true,\n                contains: ['self']\n              }\n            ]\n          }\n        ],\n        relevance: 0\n      },\n      {\n        className: 'function',\n        beginKeywords: 'function',\n        end: /[{;]/,\n        excludeEnd: true,\n        keywords: KEYWORDS$1,\n        contains: [\n          'self',\n          hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n          PARAMS\n        ],\n        illegal: /%/\n      },\n      {\n        // prevent this from getting swallowed up by function\n        // since they appear \"function like\"\n        beginKeywords: \"while if switch catch for\"\n      },\n      {\n        className: 'function',\n        // we have to count the parens to make sure we actually have the correct\n        // bounding ( ).  There could be any number of sub-expressions inside\n        // also surrounded by parens.\n        begin: hljs.UNDERSCORE_IDENT_RE +\n          '\\\\(' + // first parens\n          '[^()]*(\\\\(' +\n            '[^()]*(\\\\(' +\n              '[^()]*' +\n            '\\\\)[^()]*)*' +\n          '\\\\)[^()]*)*' +\n          '\\\\)\\\\s*\\\\{', // end parens\n        returnBegin:true,\n        contains: [\n          PARAMS,\n          hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n        ]\n      },\n      // hack: prevents detection of keywords in some circumstances\n      // .keyword()\n      // $keyword = x\n      {\n        variants: [\n          { begin: '\\\\.' + IDENT_RE$1 },\n          { begin: '\\\\$' + IDENT_RE$1 }\n        ],\n        relevance: 0\n      },\n      { // ES6 class\n        className: 'class',\n        beginKeywords: 'class',\n        end: /[{;=]/,\n        excludeEnd: true,\n        illegal: /[:\"[\\]]/,\n        contains: [\n          { beginKeywords: 'extends' },\n          hljs.UNDERSCORE_TITLE_MODE\n        ]\n      },\n      {\n        begin: /\\b(?=constructor)/,\n        end: /[{;]/,\n        excludeEnd: true,\n        contains: [\n          hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n          'self',\n          PARAMS\n        ]\n      },\n      {\n        begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n        end: /\\{/,\n        keywords: \"get set\",\n        contains: [\n          hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n          { begin: /\\(\\)/ }, // eat to avoid empty params\n          PARAMS\n        ]\n      },\n      {\n        begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n      }\n    ]\n  };\n}\n\nmodule.exports = javascript;\n","/*\nLanguage: JSON\nDescription: JSON (JavaScript Object Notation) is a lightweight data-interchange format.\nAuthor: Ivan Sagalaev \nWebsite: http://www.json.org\nCategory: common, protocols\n*/\n\nfunction json(hljs) {\n  const LITERALS = {\n    literal: 'true false null'\n  };\n  const ALLOWED_COMMENTS = [\n    hljs.C_LINE_COMMENT_MODE,\n    hljs.C_BLOCK_COMMENT_MODE\n  ];\n  const TYPES = [\n    hljs.QUOTE_STRING_MODE,\n    hljs.C_NUMBER_MODE\n  ];\n  const VALUE_CONTAINER = {\n    end: ',',\n    endsWithParent: true,\n    excludeEnd: true,\n    contains: TYPES,\n    keywords: LITERALS\n  };\n  const OBJECT = {\n    begin: /\\{/,\n    end: /\\}/,\n    contains: [\n      {\n        className: 'attr',\n        begin: /\"/,\n        end: /\"/,\n        contains: [hljs.BACKSLASH_ESCAPE],\n        illegal: '\\\\n'\n      },\n      hljs.inherit(VALUE_CONTAINER, {\n        begin: /:/\n      })\n    ].concat(ALLOWED_COMMENTS),\n    illegal: '\\\\S'\n  };\n  const ARRAY = {\n    begin: '\\\\[',\n    end: '\\\\]',\n    contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents\n    illegal: '\\\\S'\n  };\n  TYPES.push(OBJECT, ARRAY);\n  ALLOWED_COMMENTS.forEach(function(rule) {\n    TYPES.push(rule);\n  });\n  return {\n    name: 'JSON',\n    contains: TYPES,\n    keywords: LITERALS,\n    illegal: '\\\\S'\n  };\n}\n\nmodule.exports = json;\n","// https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10\nvar decimalDigits = '[0-9](_*[0-9])*';\nvar frac = `\\\\.(${decimalDigits})`;\nvar hexDigits = '[0-9a-fA-F](_*[0-9a-fA-F])*';\nvar NUMERIC = {\n  className: 'number',\n  variants: [\n    // DecimalFloatingPointLiteral\n    // including ExponentPart\n    { begin: `(\\\\b(${decimalDigits})((${frac})|\\\\.)?|(${frac}))` +\n      `[eE][+-]?(${decimalDigits})[fFdD]?\\\\b` },\n    // excluding ExponentPart\n    { begin: `\\\\b(${decimalDigits})((${frac})[fFdD]?\\\\b|\\\\.([fFdD]\\\\b)?)` },\n    { begin: `(${frac})[fFdD]?\\\\b` },\n    { begin: `\\\\b(${decimalDigits})[fFdD]\\\\b` },\n\n    // HexadecimalFloatingPointLiteral\n    { begin: `\\\\b0[xX]((${hexDigits})\\\\.?|(${hexDigits})?\\\\.(${hexDigits}))` +\n      `[pP][+-]?(${decimalDigits})[fFdD]?\\\\b` },\n\n    // DecimalIntegerLiteral\n    { begin: '\\\\b(0|[1-9](_*[0-9])*)[lL]?\\\\b' },\n\n    // HexIntegerLiteral\n    { begin: `\\\\b0[xX](${hexDigits})[lL]?\\\\b` },\n\n    // OctalIntegerLiteral\n    { begin: '\\\\b0(_*[0-7])*[lL]?\\\\b' },\n\n    // BinaryIntegerLiteral\n    { begin: '\\\\b0[bB][01](_*[01])*[lL]?\\\\b' },\n  ],\n  relevance: 0\n};\n\n/*\n Language: Kotlin\n Description: Kotlin is an OSS statically typed programming language that targets the JVM, Android, JavaScript and Native.\n Author: Sergey Mashkov \n Website: https://kotlinlang.org\n Category: common\n */\n\nfunction kotlin(hljs) {\n  const KEYWORDS = {\n    keyword:\n      'abstract as val var vararg get set class object open private protected public noinline ' +\n      'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n      'import package is in fun override companion reified inline lateinit init ' +\n      'interface annotation data sealed internal infix operator out by constructor super ' +\n      'tailrec where const inner suspend typealias external expect actual',\n    built_in:\n      'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n    literal:\n      'true false null'\n  };\n  const KEYWORDS_WITH_LABEL = {\n    className: 'keyword',\n    begin: /\\b(break|continue|return|this)\\b/,\n    starts: {\n      contains: [\n        {\n          className: 'symbol',\n          begin: /@\\w+/\n        }\n      ]\n    }\n  };\n  const LABEL = {\n    className: 'symbol',\n    begin: hljs.UNDERSCORE_IDENT_RE + '@'\n  };\n\n  // for string templates\n  const SUBST = {\n    className: 'subst',\n    begin: /\\$\\{/,\n    end: /\\}/,\n    contains: [ hljs.C_NUMBER_MODE ]\n  };\n  const VARIABLE = {\n    className: 'variable',\n    begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n  };\n  const STRING = {\n    className: 'string',\n    variants: [\n      {\n        begin: '\"\"\"',\n        end: '\"\"\"(?=[^\"])',\n        contains: [\n          VARIABLE,\n          SUBST\n        ]\n      },\n      // Can't use built-in modes easily, as we want to use STRING in the meta\n      // context as 'meta-string' and there's no syntax to remove explicitly set\n      // classNames in built-in modes.\n      {\n        begin: '\\'',\n        end: '\\'',\n        illegal: /\\n/,\n        contains: [ hljs.BACKSLASH_ESCAPE ]\n      },\n      {\n        begin: '\"',\n        end: '\"',\n        illegal: /\\n/,\n        contains: [\n          hljs.BACKSLASH_ESCAPE,\n          VARIABLE,\n          SUBST\n        ]\n      }\n    ]\n  };\n  SUBST.contains.push(STRING);\n\n  const ANNOTATION_USE_SITE = {\n    className: 'meta',\n    begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n  };\n  const ANNOTATION = {\n    className: 'meta',\n    begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n    contains: [\n      {\n        begin: /\\(/,\n        end: /\\)/,\n        contains: [\n          hljs.inherit(STRING, {\n            className: 'meta-string'\n          })\n        ]\n      }\n    ]\n  };\n\n  // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n  // According to the doc above, the number mode of kotlin is the same as java 8,\n  // so the code below is copied from java.js\n  const KOTLIN_NUMBER_MODE = NUMERIC;\n  const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n    '/\\\\*', '\\\\*/',\n    {\n      contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n    }\n  );\n  const KOTLIN_PAREN_TYPE = {\n    variants: [\n      {\n        className: 'type',\n        begin: hljs.UNDERSCORE_IDENT_RE\n      },\n      {\n        begin: /\\(/,\n        end: /\\)/,\n        contains: [] // defined later\n      }\n    ]\n  };\n  const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n  KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n  KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n  return {\n    name: 'Kotlin',\n    aliases: [ 'kt', 'kts' ],\n    keywords: KEYWORDS,\n    contains: [\n      hljs.COMMENT(\n        '/\\\\*\\\\*',\n        '\\\\*/',\n        {\n          relevance: 0,\n          contains: [\n            {\n              className: 'doctag',\n              begin: '@[A-Za-z]+'\n            }\n          ]\n        }\n      ),\n      hljs.C_LINE_COMMENT_MODE,\n      KOTLIN_NESTED_COMMENT,\n      KEYWORDS_WITH_LABEL,\n      LABEL,\n      ANNOTATION_USE_SITE,\n      ANNOTATION,\n      {\n        className: 'function',\n        beginKeywords: 'fun',\n        end: '[(]|$',\n        returnBegin: true,\n        excludeEnd: true,\n        keywords: KEYWORDS,\n        relevance: 5,\n        contains: [\n          {\n            begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n            returnBegin: true,\n            relevance: 0,\n            contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n          },\n          {\n            className: 'type',\n            begin: //,\n            keywords: 'reified',\n            relevance: 0\n          },\n          {\n            className: 'params',\n            begin: /\\(/,\n            end: /\\)/,\n            endsParent: true,\n            keywords: KEYWORDS,\n            relevance: 0,\n            contains: [\n              {\n                begin: /:/,\n                end: /[=,\\/]/,\n                endsWithParent: true,\n                contains: [\n                  KOTLIN_PAREN_TYPE,\n                  hljs.C_LINE_COMMENT_MODE,\n                  KOTLIN_NESTED_COMMENT\n                ],\n                relevance: 0\n              },\n              hljs.C_LINE_COMMENT_MODE,\n              KOTLIN_NESTED_COMMENT,\n              ANNOTATION_USE_SITE,\n              ANNOTATION,\n              STRING,\n              hljs.C_NUMBER_MODE\n            ]\n          },\n          KOTLIN_NESTED_COMMENT\n        ]\n      },\n      {\n        className: 'class',\n        beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n        end: /[:\\{(]|$/,\n        excludeEnd: true,\n        illegal: 'extends implements',\n        contains: [\n          {\n            beginKeywords: 'public protected internal private constructor'\n          },\n          hljs.UNDERSCORE_TITLE_MODE,\n          {\n            className: 'type',\n            begin: //,\n            excludeBegin: true,\n            excludeEnd: true,\n            relevance: 0\n          },\n          {\n            className: 'type',\n            begin: /[,:]\\s*/,\n            end: /[<\\(,]|$/,\n            excludeBegin: true,\n            returnEnd: true\n          },\n          ANNOTATION_USE_SITE,\n          ANNOTATION\n        ]\n      },\n      STRING,\n      {\n        className: 'meta',\n        begin: \"^#!/usr/bin/env\",\n        end: '$',\n        illegal: '\\n'\n      },\n      KOTLIN_NUMBER_MODE\n    ]\n  };\n}\n\nmodule.exports = kotlin;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: Markdown\nRequires: xml.js\nAuthor: John Crepezzi \nWebsite: https://daringfireball.net/projects/markdown/\nCategory: common, markup\n*/\n\nfunction markdown(hljs) {\n  const INLINE_HTML = {\n    begin: /<\\/?[A-Za-z_]/,\n    end: '>',\n    subLanguage: 'xml',\n    relevance: 0\n  };\n  const HORIZONTAL_RULE = {\n    begin: '^[-\\\\*]{3,}',\n    end: '$'\n  };\n  const CODE = {\n    className: 'code',\n    variants: [\n      // TODO: fix to allow these to work with sublanguage also\n      {\n        begin: '(`{3,})[^`](.|\\\\n)*?\\\\1`*[ ]*'\n      },\n      {\n        begin: '(~{3,})[^~](.|\\\\n)*?\\\\1~*[ ]*'\n      },\n      // needed to allow markdown as a sublanguage to work\n      {\n        begin: '```',\n        end: '```+[ ]*$'\n      },\n      {\n        begin: '~~~',\n        end: '~~~+[ ]*$'\n      },\n      {\n        begin: '`.+?`'\n      },\n      {\n        begin: '(?=^( {4}|\\\\t))',\n        // use contains to gobble up multiple lines to allow the block to be whatever size\n        // but only have a single open/close tag vs one per line\n        contains: [\n          {\n            begin: '^( {4}|\\\\t)',\n            end: '(\\\\n)$'\n          }\n        ],\n        relevance: 0\n      }\n    ]\n  };\n  const LIST = {\n    className: 'bullet',\n    begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n    end: '\\\\s+',\n    excludeEnd: true\n  };\n  const LINK_REFERENCE = {\n    begin: /^\\[[^\\n]+\\]:/,\n    returnBegin: true,\n    contains: [\n      {\n        className: 'symbol',\n        begin: /\\[/,\n        end: /\\]/,\n        excludeBegin: true,\n        excludeEnd: true\n      },\n      {\n        className: 'link',\n        begin: /:\\s*/,\n        end: /$/,\n        excludeBegin: true\n      }\n    ]\n  };\n  const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;\n  const LINK = {\n    variants: [\n      // too much like nested array access in so many languages\n      // to have any real relevance\n      {\n        begin: /\\[.+?\\]\\[.*?\\]/,\n        relevance: 0\n      },\n      // popular internet URLs\n      {\n        begin: /\\[.+?\\]\\(((data|javascript|mailto):|(?:http|ftp)s?:\\/\\/).*?\\)/,\n        relevance: 2\n      },\n      {\n        begin: concat(/\\[.+?\\]\\(/, URL_SCHEME, /:\\/\\/.*?\\)/),\n        relevance: 2\n      },\n      // relative urls\n      {\n        begin: /\\[.+?\\]\\([./?&#].*?\\)/,\n        relevance: 1\n      },\n      // whatever else, lower relevance (might not be a link at all)\n      {\n        begin: /\\[.+?\\]\\(.*?\\)/,\n        relevance: 0\n      }\n    ],\n    returnBegin: true,\n    contains: [\n      {\n        className: 'string',\n        relevance: 0,\n        begin: '\\\\[',\n        end: '\\\\]',\n        excludeBegin: true,\n        returnEnd: true\n      },\n      {\n        className: 'link',\n        relevance: 0,\n        begin: '\\\\]\\\\(',\n        end: '\\\\)',\n        excludeBegin: true,\n        excludeEnd: true\n      },\n      {\n        className: 'symbol',\n        relevance: 0,\n        begin: '\\\\]\\\\[',\n        end: '\\\\]',\n        excludeBegin: true,\n        excludeEnd: true\n      }\n    ]\n  };\n  const BOLD = {\n    className: 'strong',\n    contains: [], // defined later\n    variants: [\n      {\n        begin: /_{2}/,\n        end: /_{2}/\n      },\n      {\n        begin: /\\*{2}/,\n        end: /\\*{2}/\n      }\n    ]\n  };\n  const ITALIC = {\n    className: 'emphasis',\n    contains: [], // defined later\n    variants: [\n      {\n        begin: /\\*(?!\\*)/,\n        end: /\\*/\n      },\n      {\n        begin: /_(?!_)/,\n        end: /_/,\n        relevance: 0\n      }\n    ]\n  };\n  BOLD.contains.push(ITALIC);\n  ITALIC.contains.push(BOLD);\n\n  let CONTAINABLE = [\n    INLINE_HTML,\n    LINK\n  ];\n\n  BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n  ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n\n  CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);\n\n  const HEADER = {\n    className: 'section',\n    variants: [\n      {\n        begin: '^#{1,6}',\n        end: '$',\n        contains: CONTAINABLE\n      },\n      {\n        begin: '(?=^.+?\\\\n[=-]{2,}$)',\n        contains: [\n          {\n            begin: '^[=-]*$'\n          },\n          {\n            begin: '^',\n            end: \"\\\\n\",\n            contains: CONTAINABLE\n          }\n        ]\n      }\n    ]\n  };\n\n  const BLOCKQUOTE = {\n    className: 'quote',\n    begin: '^>\\\\s+',\n    contains: CONTAINABLE,\n    end: '$'\n  };\n\n  return {\n    name: 'Markdown',\n    aliases: [\n      'md',\n      'mkdown',\n      'mkd'\n    ],\n    contains: [\n      HEADER,\n      INLINE_HTML,\n      LIST,\n      BOLD,\n      ITALIC,\n      BLOCKQUOTE,\n      CODE,\n      HORIZONTAL_RULE,\n      LINK,\n      LINK_REFERENCE\n    ]\n  };\n}\n\nmodule.exports = markdown;\n","/*\nLanguage: Nix\nAuthor: Domen Kožar \nDescription: Nix functional language\nWebsite: http://nixos.org/nix\n*/\n\nfunction nix(hljs) {\n  const NIX_KEYWORDS = {\n    keyword:\n      'rec with let in inherit assert if else then',\n    literal:\n      'true false or and null',\n    built_in:\n      'import abort baseNameOf dirOf isNull builtins map removeAttrs throw ' +\n      'toString derivation'\n  };\n  const ANTIQUOTE = {\n    className: 'subst',\n    begin: /\\$\\{/,\n    end: /\\}/,\n    keywords: NIX_KEYWORDS\n  };\n  const ATTRS = {\n    begin: /[a-zA-Z0-9-_]+(\\s*=)/,\n    returnBegin: true,\n    relevance: 0,\n    contains: [\n      {\n        className: 'attr',\n        begin: /\\S+/\n      }\n    ]\n  };\n  const STRING = {\n    className: 'string',\n    contains: [ ANTIQUOTE ],\n    variants: [\n      {\n        begin: \"''\",\n        end: \"''\"\n      },\n      {\n        begin: '\"',\n        end: '\"'\n      }\n    ]\n  };\n  const EXPRESSIONS = [\n    hljs.NUMBER_MODE,\n    hljs.HASH_COMMENT_MODE,\n    hljs.C_BLOCK_COMMENT_MODE,\n    STRING,\n    ATTRS\n  ];\n  ANTIQUOTE.contains = EXPRESSIONS;\n  return {\n    name: 'Nix',\n    aliases: [ \"nixos\" ],\n    keywords: NIX_KEYWORDS,\n    contains: EXPRESSIONS\n  };\n}\n\nmodule.exports = nix;\n","/*\nLanguage: PowerShell\nDescription: PowerShell is a task-based command-line shell and scripting language built on .NET.\nAuthor: David Mohundro \nContributors: Nicholas Blumhardt , Victor Zhou , Nicolas Le Gall \nWebsite: https://docs.microsoft.com/en-us/powershell/\n*/\n\nfunction powershell(hljs) {\n  const TYPES = [\n    \"string\",\n    \"char\",\n    \"byte\",\n    \"int\",\n    \"long\",\n    \"bool\",\n    \"decimal\",\n    \"single\",\n    \"double\",\n    \"DateTime\",\n    \"xml\",\n    \"array\",\n    \"hashtable\",\n    \"void\"\n  ];\n\n  // https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands\n  const VALID_VERBS =\n    'Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|' +\n    'Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|' +\n    'Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|' +\n    'Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|' +\n    'ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|' +\n    'Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|' +\n    'Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|' +\n    'Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|' +\n    'Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|' +\n    'Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|' +\n    'Unprotect|Use|ForEach|Sort|Tee|Where';\n\n  const COMPARISON_OPERATORS =\n    '-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|' +\n    '-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|' +\n    '-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|' +\n    '-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|' +\n    '-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|' +\n    '-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|' +\n    '-split|-wildcard|-xor';\n\n  const KEYWORDS = {\n    $pattern: /-?[A-z\\.\\-]+\\b/,\n    keyword:\n      'if else foreach return do while until elseif begin for trap data dynamicparam ' +\n      'end break throw param continue finally in switch exit filter try process catch ' +\n      'hidden static parameter',\n    // \"echo\" relevance has been set to 0 to avoid auto-detect conflicts with shell transcripts\n    built_in:\n      'ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp ' +\n      'cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx ' +\n      'fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group ' +\n      'gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi ' +\n      'iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh ' +\n      'popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp ' +\n      'rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp ' +\n      'spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write'\n    // TODO: 'validate[A-Z]+' can't work in keywords\n  };\n\n  const TITLE_NAME_RE = /\\w[\\w\\d]*((-)[\\w\\d]+)*/;\n\n  const BACKTICK_ESCAPE = {\n    begin: '`[\\\\s\\\\S]',\n    relevance: 0\n  };\n\n  const VAR = {\n    className: 'variable',\n    variants: [\n      {\n        begin: /\\$\\B/\n      },\n      {\n        className: 'keyword',\n        begin: /\\$this/\n      },\n      {\n        begin: /\\$[\\w\\d][\\w\\d_:]*/\n      }\n    ]\n  };\n\n  const LITERAL = {\n    className: 'literal',\n    begin: /\\$(null|true|false)\\b/\n  };\n\n  const QUOTE_STRING = {\n    className: \"string\",\n    variants: [\n      {\n        begin: /\"/,\n        end: /\"/\n      },\n      {\n        begin: /@\"/,\n        end: /^\"@/\n      }\n    ],\n    contains: [\n      BACKTICK_ESCAPE,\n      VAR,\n      {\n        className: 'variable',\n        begin: /\\$[A-z]/,\n        end: /[^A-z]/\n      }\n    ]\n  };\n\n  const APOS_STRING = {\n    className: 'string',\n    variants: [\n      {\n        begin: /'/,\n        end: /'/\n      },\n      {\n        begin: /@'/,\n        end: /^'@/\n      }\n    ]\n  };\n\n  const PS_HELPTAGS = {\n    className: \"doctag\",\n    variants: [\n      /* no paramater help tags */\n      {\n        begin: /\\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/\n      },\n      /* one parameter help tags */\n      {\n        begin: /\\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\\s+\\S+/\n      }\n    ]\n  };\n\n  const PS_COMMENT = hljs.inherit(\n    hljs.COMMENT(null, null),\n    {\n      variants: [\n        /* single-line comment */\n        {\n          begin: /#/,\n          end: /$/\n        },\n        /* multi-line comment */\n        {\n          begin: /<#/,\n          end: /#>/\n        }\n      ],\n      contains: [ PS_HELPTAGS ]\n    }\n  );\n\n  const CMDLETS = {\n    className: 'built_in',\n    variants: [\n      {\n        begin: '('.concat(VALID_VERBS, ')+(-)[\\\\w\\\\d]+')\n      }\n    ]\n  };\n\n  const PS_CLASS = {\n    className: 'class',\n    beginKeywords: 'class enum',\n    end: /\\s*[{]/,\n    excludeEnd: true,\n    relevance: 0,\n    contains: [ hljs.TITLE_MODE ]\n  };\n\n  const PS_FUNCTION = {\n    className: 'function',\n    begin: /function\\s+/,\n    end: /\\s*\\{|$/,\n    excludeEnd: true,\n    returnBegin: true,\n    relevance: 0,\n    contains: [\n      {\n        begin: \"function\",\n        relevance: 0,\n        className: \"keyword\"\n      },\n      {\n        className: \"title\",\n        begin: TITLE_NAME_RE,\n        relevance: 0\n      },\n      {\n        begin: /\\(/,\n        end: /\\)/,\n        className: \"params\",\n        relevance: 0,\n        contains: [ VAR ]\n      }\n      // CMDLETS\n    ]\n  };\n\n  // Using statment, plus type, plus assembly name.\n  const PS_USING = {\n    begin: /using\\s/,\n    end: /$/,\n    returnBegin: true,\n    contains: [\n      QUOTE_STRING,\n      APOS_STRING,\n      {\n        className: 'keyword',\n        begin: /(using|assembly|command|module|namespace|type)/\n      }\n    ]\n  };\n\n  // Comperison operators & function named parameters.\n  const PS_ARGUMENTS = {\n    variants: [\n      // PS literals are pretty verbose so it's a good idea to accent them a bit.\n      {\n        className: 'operator',\n        begin: '('.concat(COMPARISON_OPERATORS, ')\\\\b')\n      },\n      {\n        className: 'literal',\n        begin: /(-)[\\w\\d]+/,\n        relevance: 0\n      }\n    ]\n  };\n\n  const HASH_SIGNS = {\n    className: 'selector-tag',\n    begin: /@\\B/,\n    relevance: 0\n  };\n\n  // It's a very general rule so I'll narrow it a bit with some strict boundaries\n  // to avoid any possible false-positive collisions!\n  const PS_METHODS = {\n    className: 'function',\n    begin: /\\[.*\\]\\s*[\\w]+[ ]??\\(/,\n    end: /$/,\n    returnBegin: true,\n    relevance: 0,\n    contains: [\n      {\n        className: 'keyword',\n        begin: '('.concat(\n          KEYWORDS.keyword.toString().replace(/\\s/g, '|'\n          ), ')\\\\b'),\n        endsParent: true,\n        relevance: 0\n      },\n      hljs.inherit(hljs.TITLE_MODE, {\n        endsParent: true\n      })\n    ]\n  };\n\n  const GENTLEMANS_SET = [\n    // STATIC_MEMBER,\n    PS_METHODS,\n    PS_COMMENT,\n    BACKTICK_ESCAPE,\n    hljs.NUMBER_MODE,\n    QUOTE_STRING,\n    APOS_STRING,\n    // PS_NEW_OBJECT_TYPE,\n    CMDLETS,\n    VAR,\n    LITERAL,\n    HASH_SIGNS\n  ];\n\n  const PS_TYPE = {\n    begin: /\\[/,\n    end: /\\]/,\n    excludeBegin: true,\n    excludeEnd: true,\n    relevance: 0,\n    contains: [].concat(\n      'self',\n      GENTLEMANS_SET,\n      {\n        begin: \"(\" + TYPES.join(\"|\") + \")\",\n        className: \"built_in\",\n        relevance: 0\n      },\n      {\n        className: 'type',\n        begin: /[\\.\\w\\d]+/,\n        relevance: 0\n      }\n    )\n  };\n\n  PS_METHODS.contains.unshift(PS_TYPE);\n\n  return {\n    name: 'PowerShell',\n    aliases: [\n      \"ps\",\n      \"ps1\"\n    ],\n    case_insensitive: true,\n    keywords: KEYWORDS,\n    contains: GENTLEMANS_SET.concat(\n      PS_CLASS,\n      PS_FUNCTION,\n      PS_USING,\n      PS_ARGUMENTS,\n      PS_TYPE\n    )\n  };\n}\n\nmodule.exports = powershell;\n","/*\nLanguage: .properties\nContributors: Valentin Aitken , Egor Rogov \nWebsite: https://en.wikipedia.org/wiki/.properties\nCategory: common, config\n*/\n\nfunction properties(hljs) {\n\n  // whitespaces: space, tab, formfeed\n  var WS0 = '[ \\\\t\\\\f]*';\n  var WS1 = '[ \\\\t\\\\f]+';\n  // delimiter\n  var EQUAL_DELIM = WS0+'[:=]'+WS0;\n  var WS_DELIM = WS1;\n  var DELIM = '(' + EQUAL_DELIM + '|' + WS_DELIM + ')';\n  var KEY_ALPHANUM = '([^\\\\\\\\\\\\W:= \\\\t\\\\f\\\\n]|\\\\\\\\.)+';\n  var KEY_OTHER = '([^\\\\\\\\:= \\\\t\\\\f\\\\n]|\\\\\\\\.)+';\n\n  var DELIM_AND_VALUE = {\n          // skip DELIM\n          end: DELIM,\n          relevance: 0,\n          starts: {\n            // value: everything until end of line (again, taking into account backslashes)\n            className: 'string',\n            end: /$/,\n            relevance: 0,\n            contains: [\n              { begin: '\\\\\\\\\\\\\\\\'},\n              { begin: '\\\\\\\\\\\\n' }\n            ]\n          }\n        };\n\n  return {\n    name: '.properties',\n    case_insensitive: true,\n    illegal: /\\S/,\n    contains: [\n      hljs.COMMENT('^\\\\s*[!#]', '$'),\n      // key: everything until whitespace or = or : (taking into account backslashes)\n      // case of a \"normal\" key\n      {\n        returnBegin: true,\n        variants: [\n          { begin: KEY_ALPHANUM + EQUAL_DELIM, relevance: 1 },\n          { begin: KEY_ALPHANUM + WS_DELIM, relevance: 0 }\n        ],\n        contains: [\n          {\n            className: 'attr',\n            begin: KEY_ALPHANUM,\n            endsParent: true,\n            relevance: 0\n          }\n        ],\n        starts: DELIM_AND_VALUE\n      },\n      // case of key containing non-alphanumeric chars => relevance = 0\n      {\n        begin: KEY_OTHER + DELIM,\n        returnBegin: true,\n        relevance: 0,\n        contains: [\n          {\n            className: 'meta',\n            begin: KEY_OTHER,\n            endsParent: true,\n            relevance: 0\n          }\n        ],\n        starts: DELIM_AND_VALUE\n      },\n      // case of an empty key\n      {\n        className: 'attr',\n        relevance: 0,\n        begin: KEY_OTHER + WS0 + '$'\n      }\n    ]\n  };\n}\n\nmodule.exports = properties;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n  return concat('(?=', re, ')');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/*\nLanguage: Ruby\nDescription: Ruby is a dynamic, open source programming language with a focus on simplicity and productivity.\nWebsite: https://www.ruby-lang.org/\nAuthor: Anton Kovalyov \nContributors: Peter Leonov , Vasily Polovnyov , Loren Segal , Pascal Hurni , Cedric Sohrauer \nCategory: common\n*/\n\nfunction ruby(hljs) {\n  const RUBY_METHOD_RE = '([a-zA-Z_]\\\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?)';\n  const RUBY_KEYWORDS = {\n    keyword:\n      'and then defined module in return redo if BEGIN retry end for self when ' +\n      'next until do begin unless END rescue else break undef not super class case ' +\n      'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor ' +\n      '__FILE__',\n    built_in: 'proc lambda',\n    literal:\n      'true false nil'\n  };\n  const YARDOCTAG = {\n    className: 'doctag',\n    begin: '@[A-Za-z]+'\n  };\n  const IRB_OBJECT = {\n    begin: '#<',\n    end: '>'\n  };\n  const COMMENT_MODES = [\n    hljs.COMMENT(\n      '#',\n      '$',\n      {\n        contains: [ YARDOCTAG ]\n      }\n    ),\n    hljs.COMMENT(\n      '^=begin',\n      '^=end',\n      {\n        contains: [ YARDOCTAG ],\n        relevance: 10\n      }\n    ),\n    hljs.COMMENT('^__END__', '\\\\n$')\n  ];\n  const SUBST = {\n    className: 'subst',\n    begin: /#\\{/,\n    end: /\\}/,\n    keywords: RUBY_KEYWORDS\n  };\n  const STRING = {\n    className: 'string',\n    contains: [\n      hljs.BACKSLASH_ESCAPE,\n      SUBST\n    ],\n    variants: [\n      {\n        begin: /'/,\n        end: /'/\n      },\n      {\n        begin: /\"/,\n        end: /\"/\n      },\n      {\n        begin: /`/,\n        end: /`/\n      },\n      {\n        begin: /%[qQwWx]?\\(/,\n        end: /\\)/\n      },\n      {\n        begin: /%[qQwWx]?\\[/,\n        end: /\\]/\n      },\n      {\n        begin: /%[qQwWx]?\\{/,\n        end: /\\}/\n      },\n      {\n        begin: /%[qQwWx]?/\n      },\n      {\n        begin: /%[qQwWx]?\\//,\n        end: /\\//\n      },\n      {\n        begin: /%[qQwWx]?%/,\n        end: /%/\n      },\n      {\n        begin: /%[qQwWx]?-/,\n        end: /-/\n      },\n      {\n        begin: /%[qQwWx]?\\|/,\n        end: /\\|/\n      },\n      // in the following expressions, \\B in the beginning suppresses recognition of ?-sequences\n      // where ? is the last character of a preceding identifier, as in: `func?4`\n      {\n        begin: /\\B\\?(\\\\\\d{1,3})/\n      },\n      {\n        begin: /\\B\\?(\\\\x[A-Fa-f0-9]{1,2})/\n      },\n      {\n        begin: /\\B\\?(\\\\u\\{?[A-Fa-f0-9]{1,6}\\}?)/\n      },\n      {\n        begin: /\\B\\?(\\\\M-\\\\C-|\\\\M-\\\\c|\\\\c\\\\M-|\\\\M-|\\\\C-\\\\M-)[\\x20-\\x7e]/\n      },\n      {\n        begin: /\\B\\?\\\\(c|C-)[\\x20-\\x7e]/\n      },\n      {\n        begin: /\\B\\?\\\\?\\S/\n      },\n      { // heredocs\n        begin: /<<[-~]?'?(\\w+)\\n(?:[^\\n]*\\n)*?\\s*\\1\\b/,\n        returnBegin: true,\n        contains: [\n          {\n            begin: /<<[-~]?'?/\n          },\n          hljs.END_SAME_AS_BEGIN({\n            begin: /(\\w+)/,\n            end: /(\\w+)/,\n            contains: [\n              hljs.BACKSLASH_ESCAPE,\n              SUBST\n            ]\n          })\n        ]\n      }\n    ]\n  };\n\n  // Ruby syntax is underdocumented, but this grammar seems to be accurate\n  // as of version 2.7.2 (confirmed with (irb and `Ripper.sexp(...)`)\n  // https://docs.ruby-lang.org/en/2.7.0/doc/syntax/literals_rdoc.html#label-Numbers\n  const decimal = '[1-9](_?[0-9])*|0';\n  const digits = '[0-9](_?[0-9])*';\n  const NUMBER = {\n    className: 'number',\n    relevance: 0,\n    variants: [\n      // decimal integer/float, optionally exponential or rational, optionally imaginary\n      {\n        begin: `\\\\b(${decimal})(\\\\.(${digits}))?([eE][+-]?(${digits})|r)?i?\\\\b`\n      },\n\n      // explicit decimal/binary/octal/hexadecimal integer,\n      // optionally rational and/or imaginary\n      {\n        begin: \"\\\\b0[dD][0-9](_?[0-9])*r?i?\\\\b\"\n      },\n      {\n        begin: \"\\\\b0[bB][0-1](_?[0-1])*r?i?\\\\b\"\n      },\n      {\n        begin: \"\\\\b0[oO][0-7](_?[0-7])*r?i?\\\\b\"\n      },\n      {\n        begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\\\b\"\n      },\n\n      // 0-prefixed implicit octal integer, optionally rational and/or imaginary\n      {\n        begin: \"\\\\b0(_?[0-7])+r?i?\\\\b\"\n      }\n    ]\n  };\n\n  const PARAMS = {\n    className: 'params',\n    begin: '\\\\(',\n    end: '\\\\)',\n    endsParent: true,\n    keywords: RUBY_KEYWORDS\n  };\n\n  const RUBY_DEFAULT_CONTAINS = [\n    STRING,\n    {\n      className: 'class',\n      beginKeywords: 'class module',\n      end: '$|;',\n      illegal: /=/,\n      contains: [\n        hljs.inherit(hljs.TITLE_MODE, {\n          begin: '[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|!)?'\n        }),\n        {\n          begin: '<\\\\s*',\n          contains: [\n            {\n              begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE,\n              // we already get points for <, we don't need poitns\n              // for the name also\n              relevance: 0\n            }\n          ]\n        }\n      ].concat(COMMENT_MODES)\n    },\n    {\n      className: 'function',\n      // def method_name(\n      // def method_name;\n      // def method_name (end of line)\n      begin: concat(/def\\s+/, lookahead(RUBY_METHOD_RE + \"\\\\s*(\\\\(|;|$)\")),\n      relevance: 0, // relevance comes from kewords\n      keywords: \"def\",\n      end: '$|;',\n      contains: [\n        hljs.inherit(hljs.TITLE_MODE, {\n          begin: RUBY_METHOD_RE\n        }),\n        PARAMS\n      ].concat(COMMENT_MODES)\n    },\n    {\n      // swallow namespace qualifiers before symbols\n      begin: hljs.IDENT_RE + '::'\n    },\n    {\n      className: 'symbol',\n      begin: hljs.UNDERSCORE_IDENT_RE + '(!|\\\\?)?:',\n      relevance: 0\n    },\n    {\n      className: 'symbol',\n      begin: ':(?!\\\\s)',\n      contains: [\n        STRING,\n        {\n          begin: RUBY_METHOD_RE\n        }\n      ],\n      relevance: 0\n    },\n    NUMBER,\n    {\n      // negative-look forward attemps to prevent false matches like:\n      // @ident@ or $ident$ that might indicate this is not ruby at all\n      className: \"variable\",\n      begin: '(\\\\$\\\\W)|((\\\\$|@@?)(\\\\w+))(?=[^@$?])' + `(?![A-Za-z])(?![@$?'])`\n    },\n    {\n      className: 'params',\n      begin: /\\|/,\n      end: /\\|/,\n      relevance: 0, // this could be a lot of things (in other languages) other than params\n      keywords: RUBY_KEYWORDS\n    },\n    { // regexp container\n      begin: '(' + hljs.RE_STARTERS_RE + '|unless)\\\\s*',\n      keywords: 'unless',\n      contains: [\n        {\n          className: 'regexp',\n          contains: [\n            hljs.BACKSLASH_ESCAPE,\n            SUBST\n          ],\n          illegal: /\\n/,\n          variants: [\n            {\n              begin: '/',\n              end: '/[a-z]*'\n            },\n            {\n              begin: /%r\\{/,\n              end: /\\}[a-z]*/\n            },\n            {\n              begin: '%r\\\\(',\n              end: '\\\\)[a-z]*'\n            },\n            {\n              begin: '%r!',\n              end: '![a-z]*'\n            },\n            {\n              begin: '%r\\\\[',\n              end: '\\\\][a-z]*'\n            }\n          ]\n        }\n      ].concat(IRB_OBJECT, COMMENT_MODES),\n      relevance: 0\n    }\n  ].concat(IRB_OBJECT, COMMENT_MODES);\n\n  SUBST.contains = RUBY_DEFAULT_CONTAINS;\n  PARAMS.contains = RUBY_DEFAULT_CONTAINS;\n\n  // >>\n  // ?>\n  const SIMPLE_PROMPT = \"[>?]>\";\n  // irb(main):001:0>\n  const DEFAULT_PROMPT = \"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\";\n  const RVM_PROMPT = \"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d+(p\\\\d+)?[^\\\\d][^>]+>\";\n\n  const IRB_DEFAULT = [\n    {\n      begin: /^\\s*=>/,\n      starts: {\n        end: '$',\n        contains: RUBY_DEFAULT_CONTAINS\n      }\n    },\n    {\n      className: 'meta',\n      begin: '^(' + SIMPLE_PROMPT + \"|\" + DEFAULT_PROMPT + '|' + RVM_PROMPT + ')(?=[ ])',\n      starts: {\n        end: '$',\n        contains: RUBY_DEFAULT_CONTAINS\n      }\n    }\n  ];\n\n  COMMENT_MODES.unshift(IRB_OBJECT);\n\n  return {\n    name: 'Ruby',\n    aliases: [\n      'rb',\n      'gemspec',\n      'podspec',\n      'thor',\n      'irb'\n    ],\n    keywords: RUBY_KEYWORDS,\n    illegal: /\\/\\*/,\n    contains: [\n      hljs.SHEBANG({\n        binary: \"ruby\"\n      })\n    ]\n      .concat(IRB_DEFAULT)\n      .concat(COMMENT_MODES)\n      .concat(RUBY_DEFAULT_CONTAINS)\n  };\n}\n\nmodule.exports = ruby;\n","/*\nLanguage: Scala\nCategory: functional\nAuthor: Jan Berkel \nContributors: Erik Osheim \nWebsite: https://www.scala-lang.org\n*/\n\nfunction scala(hljs) {\n  const ANNOTATION = {\n    className: 'meta',\n    begin: '@[A-Za-z]+'\n  };\n\n  // used in strings for escaping/interpolation/substitution\n  const SUBST = {\n    className: 'subst',\n    variants: [\n      {\n        begin: '\\\\$[A-Za-z0-9_]+'\n      },\n      {\n        begin: /\\$\\{/,\n        end: /\\}/\n      }\n    ]\n  };\n\n  const STRING = {\n    className: 'string',\n    variants: [\n      {\n        begin: '\"\"\"',\n        end: '\"\"\"'\n      },\n      {\n        begin: '\"',\n        end: '\"',\n        illegal: '\\\\n',\n        contains: [ hljs.BACKSLASH_ESCAPE ]\n      },\n      {\n        begin: '[a-z]+\"',\n        end: '\"',\n        illegal: '\\\\n',\n        contains: [\n          hljs.BACKSLASH_ESCAPE,\n          SUBST\n        ]\n      },\n      {\n        className: 'string',\n        begin: '[a-z]+\"\"\"',\n        end: '\"\"\"',\n        contains: [ SUBST ],\n        relevance: 10\n      }\n    ]\n\n  };\n\n  const SYMBOL = {\n    className: 'symbol',\n    begin: '\\'\\\\w[\\\\w\\\\d_]*(?!\\')'\n  };\n\n  const TYPE = {\n    className: 'type',\n    begin: '\\\\b[A-Z][A-Za-z0-9_]*',\n    relevance: 0\n  };\n\n  const NAME = {\n    className: 'title',\n    begin: /[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]/,\n    relevance: 0\n  };\n\n  const CLASS = {\n    className: 'class',\n    beginKeywords: 'class object trait type',\n    end: /[:={\\[\\n;]/,\n    excludeEnd: true,\n    contains: [\n      hljs.C_LINE_COMMENT_MODE,\n      hljs.C_BLOCK_COMMENT_MODE,\n      {\n        beginKeywords: 'extends with',\n        relevance: 10\n      },\n      {\n        begin: /\\[/,\n        end: /\\]/,\n        excludeBegin: true,\n        excludeEnd: true,\n        relevance: 0,\n        contains: [ TYPE ]\n      },\n      {\n        className: 'params',\n        begin: /\\(/,\n        end: /\\)/,\n        excludeBegin: true,\n        excludeEnd: true,\n        relevance: 0,\n        contains: [ TYPE ]\n      },\n      NAME\n    ]\n  };\n\n  const METHOD = {\n    className: 'function',\n    beginKeywords: 'def',\n    end: /[:={\\[(\\n;]/,\n    excludeEnd: true,\n    contains: [ NAME ]\n  };\n\n  return {\n    name: 'Scala',\n    keywords: {\n      literal: 'true false null',\n      keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'\n    },\n    contains: [\n      hljs.C_LINE_COMMENT_MODE,\n      hljs.C_BLOCK_COMMENT_MODE,\n      STRING,\n      SYMBOL,\n      TYPE,\n      METHOD,\n      CLASS,\n      hljs.C_NUMBER_MODE,\n      ANNOTATION\n    ]\n  };\n}\n\nmodule.exports = scala;\n","/*\nLanguage: Shell Session\nRequires: bash.js\nAuthor: TSUYUSATO Kitsune \nCategory: common\nAudit: 2020\n*/\n\n/** @type LanguageFn */\nfunction shell(hljs) {\n  return {\n    name: 'Shell Session',\n    aliases: [ 'console' ],\n    contains: [\n      {\n        className: 'meta',\n        // We cannot add \\s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.\n        // For instance, in the following example, it would match \"echo /path/to/home >\" as a prompt:\n        // echo /path/to/home > t.exe\n        begin: /^\\s{0,3}[/~\\w\\d[\\]()@-]*[>%$#]/,\n        starts: {\n          end: /[^\\\\](?=\\s*$)/,\n          subLanguage: 'bash'\n        }\n      }\n    ]\n  };\n}\n\nmodule.exports = shell;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] } args\n * @returns {string}\n */\nfunction either(...args) {\n  const joined = '(' + args.map((x) => source(x)).join(\"|\") + \")\";\n  return joined;\n}\n\n/*\n Language: SQL\n Website: https://en.wikipedia.org/wiki/SQL\n Category: common, database\n */\n\nfunction sql(hljs) {\n  const COMMENT_MODE = hljs.COMMENT('--', '$');\n  const STRING = {\n    className: 'string',\n    variants: [\n      {\n        begin: /'/,\n        end: /'/,\n        contains: [\n          {begin: /''/ }\n        ]\n      }\n    ]\n  };\n  const QUOTED_IDENTIFIER = {\n    begin: /\"/,\n    end: /\"/,\n    contains: [ { begin: /\"\"/ } ]\n  };\n\n  const LITERALS = [\n    \"true\",\n    \"false\",\n    // Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.\n    // \"null\",\n    \"unknown\"\n  ];\n\n  const MULTI_WORD_TYPES = [\n    \"double precision\",\n    \"large object\",\n    \"with timezone\",\n    \"without timezone\"\n  ];\n\n  const TYPES = [\n    'bigint',\n    'binary',\n    'blob',\n    'boolean',\n    'char',\n    'character',\n    'clob',\n    'date',\n    'dec',\n    'decfloat',\n    'decimal',\n    'float',\n    'int',\n    'integer',\n    'interval',\n    'nchar',\n    'nclob',\n    'national',\n    'numeric',\n    'real',\n    'row',\n    'smallint',\n    'time',\n    'timestamp',\n    'varchar',\n    'varying', // modifier (character varying)\n    'varbinary'\n  ];\n\n  const NON_RESERVED_WORDS = [\n    \"add\",\n    \"asc\",\n    \"collation\",\n    \"desc\",\n    \"final\",\n    \"first\",\n    \"last\",\n    \"view\"\n  ];\n\n  // https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#reserved-word\n  const RESERVED_WORDS = [\n    \"abs\",\n    \"acos\",\n    \"all\",\n    \"allocate\",\n    \"alter\",\n    \"and\",\n    \"any\",\n    \"are\",\n    \"array\",\n    \"array_agg\",\n    \"array_max_cardinality\",\n    \"as\",\n    \"asensitive\",\n    \"asin\",\n    \"asymmetric\",\n    \"at\",\n    \"atan\",\n    \"atomic\",\n    \"authorization\",\n    \"avg\",\n    \"begin\",\n    \"begin_frame\",\n    \"begin_partition\",\n    \"between\",\n    \"bigint\",\n    \"binary\",\n    \"blob\",\n    \"boolean\",\n    \"both\",\n    \"by\",\n    \"call\",\n    \"called\",\n    \"cardinality\",\n    \"cascaded\",\n    \"case\",\n    \"cast\",\n    \"ceil\",\n    \"ceiling\",\n    \"char\",\n    \"char_length\",\n    \"character\",\n    \"character_length\",\n    \"check\",\n    \"classifier\",\n    \"clob\",\n    \"close\",\n    \"coalesce\",\n    \"collate\",\n    \"collect\",\n    \"column\",\n    \"commit\",\n    \"condition\",\n    \"connect\",\n    \"constraint\",\n    \"contains\",\n    \"convert\",\n    \"copy\",\n    \"corr\",\n    \"corresponding\",\n    \"cos\",\n    \"cosh\",\n    \"count\",\n    \"covar_pop\",\n    \"covar_samp\",\n    \"create\",\n    \"cross\",\n    \"cube\",\n    \"cume_dist\",\n    \"current\",\n    \"current_catalog\",\n    \"current_date\",\n    \"current_default_transform_group\",\n    \"current_path\",\n    \"current_role\",\n    \"current_row\",\n    \"current_schema\",\n    \"current_time\",\n    \"current_timestamp\",\n    \"current_path\",\n    \"current_role\",\n    \"current_transform_group_for_type\",\n    \"current_user\",\n    \"cursor\",\n    \"cycle\",\n    \"date\",\n    \"day\",\n    \"deallocate\",\n    \"dec\",\n    \"decimal\",\n    \"decfloat\",\n    \"declare\",\n    \"default\",\n    \"define\",\n    \"delete\",\n    \"dense_rank\",\n    \"deref\",\n    \"describe\",\n    \"deterministic\",\n    \"disconnect\",\n    \"distinct\",\n    \"double\",\n    \"drop\",\n    \"dynamic\",\n    \"each\",\n    \"element\",\n    \"else\",\n    \"empty\",\n    \"end\",\n    \"end_frame\",\n    \"end_partition\",\n    \"end-exec\",\n    \"equals\",\n    \"escape\",\n    \"every\",\n    \"except\",\n    \"exec\",\n    \"execute\",\n    \"exists\",\n    \"exp\",\n    \"external\",\n    \"extract\",\n    \"false\",\n    \"fetch\",\n    \"filter\",\n    \"first_value\",\n    \"float\",\n    \"floor\",\n    \"for\",\n    \"foreign\",\n    \"frame_row\",\n    \"free\",\n    \"from\",\n    \"full\",\n    \"function\",\n    \"fusion\",\n    \"get\",\n    \"global\",\n    \"grant\",\n    \"group\",\n    \"grouping\",\n    \"groups\",\n    \"having\",\n    \"hold\",\n    \"hour\",\n    \"identity\",\n    \"in\",\n    \"indicator\",\n    \"initial\",\n    \"inner\",\n    \"inout\",\n    \"insensitive\",\n    \"insert\",\n    \"int\",\n    \"integer\",\n    \"intersect\",\n    \"intersection\",\n    \"interval\",\n    \"into\",\n    \"is\",\n    \"join\",\n    \"json_array\",\n    \"json_arrayagg\",\n    \"json_exists\",\n    \"json_object\",\n    \"json_objectagg\",\n    \"json_query\",\n    \"json_table\",\n    \"json_table_primitive\",\n    \"json_value\",\n    \"lag\",\n    \"language\",\n    \"large\",\n    \"last_value\",\n    \"lateral\",\n    \"lead\",\n    \"leading\",\n    \"left\",\n    \"like\",\n    \"like_regex\",\n    \"listagg\",\n    \"ln\",\n    \"local\",\n    \"localtime\",\n    \"localtimestamp\",\n    \"log\",\n    \"log10\",\n    \"lower\",\n    \"match\",\n    \"match_number\",\n    \"match_recognize\",\n    \"matches\",\n    \"max\",\n    \"member\",\n    \"merge\",\n    \"method\",\n    \"min\",\n    \"minute\",\n    \"mod\",\n    \"modifies\",\n    \"module\",\n    \"month\",\n    \"multiset\",\n    \"national\",\n    \"natural\",\n    \"nchar\",\n    \"nclob\",\n    \"new\",\n    \"no\",\n    \"none\",\n    \"normalize\",\n    \"not\",\n    \"nth_value\",\n    \"ntile\",\n    \"null\",\n    \"nullif\",\n    \"numeric\",\n    \"octet_length\",\n    \"occurrences_regex\",\n    \"of\",\n    \"offset\",\n    \"old\",\n    \"omit\",\n    \"on\",\n    \"one\",\n    \"only\",\n    \"open\",\n    \"or\",\n    \"order\",\n    \"out\",\n    \"outer\",\n    \"over\",\n    \"overlaps\",\n    \"overlay\",\n    \"parameter\",\n    \"partition\",\n    \"pattern\",\n    \"per\",\n    \"percent\",\n    \"percent_rank\",\n    \"percentile_cont\",\n    \"percentile_disc\",\n    \"period\",\n    \"portion\",\n    \"position\",\n    \"position_regex\",\n    \"power\",\n    \"precedes\",\n    \"precision\",\n    \"prepare\",\n    \"primary\",\n    \"procedure\",\n    \"ptf\",\n    \"range\",\n    \"rank\",\n    \"reads\",\n    \"real\",\n    \"recursive\",\n    \"ref\",\n    \"references\",\n    \"referencing\",\n    \"regr_avgx\",\n    \"regr_avgy\",\n    \"regr_count\",\n    \"regr_intercept\",\n    \"regr_r2\",\n    \"regr_slope\",\n    \"regr_sxx\",\n    \"regr_sxy\",\n    \"regr_syy\",\n    \"release\",\n    \"result\",\n    \"return\",\n    \"returns\",\n    \"revoke\",\n    \"right\",\n    \"rollback\",\n    \"rollup\",\n    \"row\",\n    \"row_number\",\n    \"rows\",\n    \"running\",\n    \"savepoint\",\n    \"scope\",\n    \"scroll\",\n    \"search\",\n    \"second\",\n    \"seek\",\n    \"select\",\n    \"sensitive\",\n    \"session_user\",\n    \"set\",\n    \"show\",\n    \"similar\",\n    \"sin\",\n    \"sinh\",\n    \"skip\",\n    \"smallint\",\n    \"some\",\n    \"specific\",\n    \"specifictype\",\n    \"sql\",\n    \"sqlexception\",\n    \"sqlstate\",\n    \"sqlwarning\",\n    \"sqrt\",\n    \"start\",\n    \"static\",\n    \"stddev_pop\",\n    \"stddev_samp\",\n    \"submultiset\",\n    \"subset\",\n    \"substring\",\n    \"substring_regex\",\n    \"succeeds\",\n    \"sum\",\n    \"symmetric\",\n    \"system\",\n    \"system_time\",\n    \"system_user\",\n    \"table\",\n    \"tablesample\",\n    \"tan\",\n    \"tanh\",\n    \"then\",\n    \"time\",\n    \"timestamp\",\n    \"timezone_hour\",\n    \"timezone_minute\",\n    \"to\",\n    \"trailing\",\n    \"translate\",\n    \"translate_regex\",\n    \"translation\",\n    \"treat\",\n    \"trigger\",\n    \"trim\",\n    \"trim_array\",\n    \"true\",\n    \"truncate\",\n    \"uescape\",\n    \"union\",\n    \"unique\",\n    \"unknown\",\n    \"unnest\",\n    \"update   \",\n    \"upper\",\n    \"user\",\n    \"using\",\n    \"value\",\n    \"values\",\n    \"value_of\",\n    \"var_pop\",\n    \"var_samp\",\n    \"varbinary\",\n    \"varchar\",\n    \"varying\",\n    \"versioning\",\n    \"when\",\n    \"whenever\",\n    \"where\",\n    \"width_bucket\",\n    \"window\",\n    \"with\",\n    \"within\",\n    \"without\",\n    \"year\",\n  ];\n\n  // these are reserved words we have identified to be functions\n  // and should only be highlighted in a dispatch-like context\n  // ie, array_agg(...), etc.\n  const RESERVED_FUNCTIONS = [\n    \"abs\",\n    \"acos\",\n    \"array_agg\",\n    \"asin\",\n    \"atan\",\n    \"avg\",\n    \"cast\",\n    \"ceil\",\n    \"ceiling\",\n    \"coalesce\",\n    \"corr\",\n    \"cos\",\n    \"cosh\",\n    \"count\",\n    \"covar_pop\",\n    \"covar_samp\",\n    \"cume_dist\",\n    \"dense_rank\",\n    \"deref\",\n    \"element\",\n    \"exp\",\n    \"extract\",\n    \"first_value\",\n    \"floor\",\n    \"json_array\",\n    \"json_arrayagg\",\n    \"json_exists\",\n    \"json_object\",\n    \"json_objectagg\",\n    \"json_query\",\n    \"json_table\",\n    \"json_table_primitive\",\n    \"json_value\",\n    \"lag\",\n    \"last_value\",\n    \"lead\",\n    \"listagg\",\n    \"ln\",\n    \"log\",\n    \"log10\",\n    \"lower\",\n    \"max\",\n    \"min\",\n    \"mod\",\n    \"nth_value\",\n    \"ntile\",\n    \"nullif\",\n    \"percent_rank\",\n    \"percentile_cont\",\n    \"percentile_disc\",\n    \"position\",\n    \"position_regex\",\n    \"power\",\n    \"rank\",\n    \"regr_avgx\",\n    \"regr_avgy\",\n    \"regr_count\",\n    \"regr_intercept\",\n    \"regr_r2\",\n    \"regr_slope\",\n    \"regr_sxx\",\n    \"regr_sxy\",\n    \"regr_syy\",\n    \"row_number\",\n    \"sin\",\n    \"sinh\",\n    \"sqrt\",\n    \"stddev_pop\",\n    \"stddev_samp\",\n    \"substring\",\n    \"substring_regex\",\n    \"sum\",\n    \"tan\",\n    \"tanh\",\n    \"translate\",\n    \"translate_regex\",\n    \"treat\",\n    \"trim\",\n    \"trim_array\",\n    \"unnest\",\n    \"upper\",\n    \"value_of\",\n    \"var_pop\",\n    \"var_samp\",\n    \"width_bucket\",\n  ];\n\n  // these functions can\n  const POSSIBLE_WITHOUT_PARENS = [\n    \"current_catalog\",\n    \"current_date\",\n    \"current_default_transform_group\",\n    \"current_path\",\n    \"current_role\",\n    \"current_schema\",\n    \"current_transform_group_for_type\",\n    \"current_user\",\n    \"session_user\",\n    \"system_time\",\n    \"system_user\",\n    \"current_time\",\n    \"localtime\",\n    \"current_timestamp\",\n    \"localtimestamp\"\n  ];\n\n  // those exist to boost relevance making these very\n  // \"SQL like\" keyword combos worth +1 extra relevance\n  const COMBOS = [\n    \"create table\",\n    \"insert into\",\n    \"primary key\",\n    \"foreign key\",\n    \"not null\",\n    \"alter table\",\n    \"add constraint\",\n    \"grouping sets\",\n    \"on overflow\",\n    \"character set\",\n    \"respect nulls\",\n    \"ignore nulls\",\n    \"nulls first\",\n    \"nulls last\",\n    \"depth first\",\n    \"breadth first\"\n  ];\n\n  const FUNCTIONS = RESERVED_FUNCTIONS;\n\n  const KEYWORDS = [...RESERVED_WORDS, ...NON_RESERVED_WORDS].filter((keyword) => {\n    return !RESERVED_FUNCTIONS.includes(keyword);\n  });\n\n  const VARIABLE = {\n    className: \"variable\",\n    begin: /@[a-z0-9]+/,\n  };\n\n  const OPERATOR = {\n    className: \"operator\",\n    begin: /[-+*/=%^~]|&&?|\\|\\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,\n    relevance: 0,\n  };\n\n  const FUNCTION_CALL = {\n    begin: concat(/\\b/, either(...FUNCTIONS), /\\s*\\(/),\n    keywords: {\n      built_in: FUNCTIONS\n    }\n  };\n\n  // keywords with less than 3 letters are reduced in relevancy\n  function reduceRelevancy(list, {exceptions, when} = {}) {\n    const qualifyFn = when;\n    exceptions = exceptions || [];\n    return list.map((item) => {\n      if (item.match(/\\|\\d+$/) || exceptions.includes(item)) {\n        return item;\n      } else if (qualifyFn(item)) {\n        return `${item}|0`;\n      } else {\n        return item;\n      }\n    });\n  }\n\n  return {\n    name: 'SQL',\n    case_insensitive: true,\n    // does not include {} or HTML tags ` x.length < 3 }),\n      literal: LITERALS,\n      type: TYPES,\n      built_in: POSSIBLE_WITHOUT_PARENS\n    },\n    contains: [\n      {\n        begin: either(...COMBOS),\n        keywords: {\n          $pattern: /[\\w\\.]+/,\n          keyword: KEYWORDS.concat(COMBOS),\n          literal: LITERALS,\n          type: TYPES\n        },\n      },\n      {\n        className: \"type\",\n        begin: either(...MULTI_WORD_TYPES)\n      },\n      FUNCTION_CALL,\n      VARIABLE,\n      STRING,\n      QUOTED_IDENTIFIER,\n      hljs.C_NUMBER_MODE,\n      hljs.C_BLOCK_COMMENT_MODE,\n      COMMENT_MODE,\n      OPERATOR\n    ]\n  };\n}\n\nmodule.exports = sql;\n","/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n  if (!re) return null;\n  if (typeof re === \"string\") return re;\n\n  return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n  return concat('(?=', re, ')');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction optional(re) {\n  return concat('(', re, ')?');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n  const joined = args.map((x) => source(x)).join(\"\");\n  return joined;\n}\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] } args\n * @returns {string}\n */\nfunction either(...args) {\n  const joined = '(' + args.map((x) => source(x)).join(\"|\") + \")\";\n  return joined;\n}\n\n/*\nLanguage: HTML, XML\nWebsite: https://www.w3.org/XML/\nCategory: common\nAudit: 2020\n*/\n\n/** @type LanguageFn */\nfunction xml(hljs) {\n  // Element names can contain letters, digits, hyphens, underscores, and periods\n  const TAG_NAME_RE = concat(/[A-Z_]/, optional(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/);\n  const XML_IDENT_RE = /[A-Za-z0-9._:-]+/;\n  const XML_ENTITIES = {\n    className: 'symbol',\n    begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/\n  };\n  const XML_META_KEYWORDS = {\n    begin: /\\s/,\n    contains: [\n      {\n        className: 'meta-keyword',\n        begin: /#?[a-z_][a-z1-9_-]+/,\n        illegal: /\\n/\n      }\n    ]\n  };\n  const XML_META_PAR_KEYWORDS = hljs.inherit(XML_META_KEYWORDS, {\n    begin: /\\(/,\n    end: /\\)/\n  });\n  const APOS_META_STRING_MODE = hljs.inherit(hljs.APOS_STRING_MODE, {\n    className: 'meta-string'\n  });\n  const QUOTE_META_STRING_MODE = hljs.inherit(hljs.QUOTE_STRING_MODE, {\n    className: 'meta-string'\n  });\n  const TAG_INTERNALS = {\n    endsWithParent: true,\n    illegal: /`]+/\n              }\n            ]\n          }\n        ]\n      }\n    ]\n  };\n  return {\n    name: 'HTML, XML',\n    aliases: [\n      'html',\n      'xhtml',\n      'rss',\n      'atom',\n      'xjb',\n      'xsd',\n      'xsl',\n      'plist',\n      'wsf',\n      'svg'\n    ],\n    case_insensitive: true,\n    contains: [\n      {\n        className: 'meta',\n        begin: //,\n        relevance: 10,\n        contains: [\n          XML_META_KEYWORDS,\n          QUOTE_META_STRING_MODE,\n          APOS_META_STRING_MODE,\n          XML_META_PAR_KEYWORDS,\n          {\n            begin: /\\[/,\n            end: /\\]/,\n            contains: [\n              {\n                className: 'meta',\n                begin: //,\n                contains: [\n                  XML_META_KEYWORDS,\n                  XML_META_PAR_KEYWORDS,\n                  QUOTE_META_STRING_MODE,\n                  APOS_META_STRING_MODE\n                ]\n              }\n            ]\n          }\n        ]\n      },\n      hljs.COMMENT(\n        //,\n        {\n          relevance: 10\n        }\n      ),\n      {\n        begin: //,\n        relevance: 10\n      },\n      XML_ENTITIES,\n      {\n        className: 'meta',\n        begin: /<\\?xml/,\n        end: /\\?>/,\n        relevance: 10\n      },\n      {\n        className: 'tag',\n        /*\n        The lookahead pattern (?=...) ensures that 'begin' only matches\n        ')/,\n        end: />/,\n        keywords: {\n          name: 'style'\n        },\n        contains: [ TAG_INTERNALS ],\n        starts: {\n          end: /<\\/style>/,\n          returnEnd: true,\n          subLanguage: [\n            'css',\n            'xml'\n          ]\n        }\n      },\n      {\n        className: 'tag',\n        // See the comment in the