diff --git a/Makefile b/Makefile index d6a1f85bc..9dfff4396 100644 --- a/Makefile +++ b/Makefile @@ -261,7 +261,7 @@ golangci-lint: install-golangci-lint golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m install-golangci-lint: - which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.40.1 + which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.42.1 install-wwhrd: which wwhrd || GO111MODULE=off go get github.com/frapposelli/wwhrd diff --git a/README.md b/README.md index bc947e1d7..f7c7118ba 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Enterprise binaries can be downloaded and evaluated for free from [the releases Case studies: +* [AbiosGaming](https://docs.victoriametrics.com/CaseStudies.html#abiosgaming) * [adidas](https://docs.victoriametrics.com/CaseStudies.html#adidas) * [Adsterra](https://docs.victoriametrics.com/CaseStudies.html#adsterra) * [ARNES](https://docs.victoriametrics.com/CaseStudies.html#arnes) @@ -35,12 +36,16 @@ Case studies: * [CERN](https://docs.victoriametrics.com/CaseStudies.html#cern) * [COLOPL](https://docs.victoriametrics.com/CaseStudies.html#colopl) * [Dreamteam](https://docs.victoriametrics.com/CaseStudies.html#dreamteam) +* [Fly.io](https://docs.victoriametrics.com/CaseStudies.html#flyio) * [German Research Center for Artificial Intelligence](https://docs.victoriametrics.com/CaseStudies.html#german-research-center-for-artificial-intelligence) * [Grammarly](https://docs.victoriametrics.com/CaseStudies.html#grammarly) * [Groove X](https://docs.victoriametrics.com/CaseStudies.html#groove-x) * [Idealo.de](https://docs.victoriametrics.com/CaseStudies.html#idealode) * [MHI Vestas Offshore Wind](https://docs.victoriametrics.com/CaseStudies.html#mhi-vestas-offshore-wind) +* [Razorpay](https://docs.victoriametrics.com/CaseStudies.html#razorpay) +* [Percona](https://docs.victoriametrics.com/CaseStudies.html#percona) * [Sensedia](https://docs.victoriametrics.com/CaseStudies.html#sensedia) +* [Smarkets](https://docs.victoriametrics.com/CaseStudies.html#smarkets) * [Synthesio](https://docs.victoriametrics.com/CaseStudies.html#synthesio) * [Wedos.com](https://docs.victoriametrics.com/CaseStudies.html#wedoscom) * [Wix.com](https://docs.victoriametrics.com/CaseStudies.html#wixcom) @@ -604,6 +609,12 @@ The UI allows exploring query results via graphs and tables. Graphs support scro * Drag the graph to the left / right in order to move the displayed time range into the past / future. * Hold `Ctrl` (or `Cmd` on MacOS) and scroll up / down in order to zoom in / out the graph. +Query history can be navigated by holding `Ctrl` (or `Cmd` on MacOS) and pressing `up` or `down` arrows on the keyboard while the cursor is located in the query input field. + +When querying the [backfilled data](https://docs.victoriametrics.com/#backfilling), it may be useful disabling response cache by clicking `Enable cache` checkbox. + +See the [example VMUI at VictoriaMetrics playground](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/?g0.expr=100%20*%20sum(rate(process_cpu_seconds_total))%20by%20(job)&g0.range_input=1d). + ## How to build from sources @@ -1540,6 +1551,9 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li The maximum number of CPU cores to use for big merges. Default value is used if set to 0 -csvTrimTimestamp duration Trim timestamps when importing csv data to this duration. Minimum practical duration is 1ms. Higher duration (i.e. 1s) may be used for reducing disk space usage for timestamp data (default 1ms) + -datadog.maxInsertRequestSize size + The maximum size in bytes of a single DataDog POST request to /api/v1/series + Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 67108864) -dedup.minScrapeInterval duration Leave only the first sample in every time series per each discrete interval equal to -dedup.minScrapeInterval > 0. See https://docs.victoriametrics.com/#deduplication for details -deleteAuthKey string @@ -1705,8 +1719,11 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -promscrape.maxScrapeSize size The maximum size of scrape response in bytes to process from Prometheus targets. Bigger responses are rejected Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 16777216) + -promscrape.minResponseSizeForStreamParse size + The minimum target response size for automatic switching to stream parsing mode, which can reduce memory usage. See https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode + Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 1000000) -promscrape.noStaleMarkers - Whether to disable sending Prometheus stale markers for metrics when scrape target disappears. This option may reduce memory usage if stale markers aren't needed for your setup. See also https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode + Whether to disable sending Prometheus stale markers for metrics when scrape target disappears. This option may reduce memory usage if stale markers aren't needed for your setup. This option also disables populating the scrape_series_added metric. See https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series -promscrape.openstackSDCheckInterval duration Interval for checking for changes in openstack API server. This works only if openstack_sd_configs is configured in '-promscrape.config' file. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#openstack_sd_config for details (default 30s) -promscrape.seriesLimitPerTarget int @@ -1718,7 +1735,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -promscrape.suppressScrapeErrors Whether to suppress scrape errors logging. The last error for each target is always available at '/targets' page even if scrape errors logging is suppressed -relabelConfig string - Optional path to a file with relabeling rules, which are applied to all the ingested metrics. See https://docs.victoriametrics.com/#relabeling for details + Optional path to a file with relabeling rules, which are applied to all the ingested metrics. See https://docs.victoriametrics.com/#relabeling for details. The config is reloaded on SIGHUP signal -relabelDebug Whether to log metrics before and after relabeling with -relabelConfig. If the -relabelDebug is enabled, then the metrics aren't sent to storage. This is useful for debugging the relabeling configs -retentionPeriod value @@ -1795,6 +1812,9 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li The maximum number of unique series can be added to the storage during the last 24 hours. Excess series are logged and dropped. This can be useful for limiting series churn rate. See also -storage.maxHourlySeries -storage.maxHourlySeries int The maximum number of unique series can be added to the storage during the last hour. Excess series are logged and dropped. This can be useful for limiting series cardinality. See also -storage.maxDailySeries + -storage.minFreeDiskSpaceBytes size + The minimum free disk space at -storageDataPath after which the storage stops accepting new data + Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 10000000) -storageDataPath string Path to storage data (default "victoria-metrics-data") -tls diff --git a/app/victoria-metrics/main.go b/app/victoria-metrics/main.go index 25066ca36..025974808 100644 --- a/app/victoria-metrics/main.go +++ b/app/victoria-metrics/main.go @@ -99,7 +99,9 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { {"/vmui", "Web UI"}, {"/targets", "discovered targets list"}, {"/api/v1/targets", "advanced information about discovered targets in JSON format"}, + {"/config", "-promscrape.config contents"}, {"/metrics", "available service metrics"}, + {"/flags", "command-line flags"}, {"/api/v1/status/tsdb", "tsdb status page"}, {"/api/v1/status/top_queries", "top queries"}, {"/api/v1/status/active_queries", "active queries"}, diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 93b612d0a..564b582b6 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -302,12 +302,14 @@ You can read more about relabeling in the following articles: * If the scrape target is removed from the list of targets, then stale markers are sent for all the metrics scraped from this target. * Stale markers are sent for all the scraped metrics on graceful shutdown of `vmagent`. -Prometheus staleness markers aren't sent to `-remoteWrite.url` in [stream parsing mode](#stream-parsing-mode) or if `-promscrape.noStaleMarkers` command-line is set. +Prometheus staleness markers' tracking needs additional memory, since it must store the previous response body per each scrape target in order to compare it to the current response body. The memory usage may be reduced by passing `-promscrape.noStaleMarkers` command-line flag to `vmagent`. This disables staleness tracking. This also disables tracking the number of new time series per each scrape with the auto-generated `scrape_series_added` metric. See [these docs](https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series) for details. ## Stream parsing mode -By default `vmagent` reads the full response from scrape target into memory, then parses it, applies [relabeling](#relabeling) and then pushes the resulting metrics to the configured `-remoteWrite.url`. This mode works good for the majority of cases when the scrape target exposes small number of metrics (e.g. less than 10 thousand). But this mode may take big amounts of memory when the scrape target exposes big number of metrics. In this case it is recommended enabling stream parsing mode. When this mode is enabled, then `vmagent` reads response from scrape target in chunks, then immediately processes every chunk and pushes the processed metrics to remote storage. This allows saving memory when scraping targets that expose millions of metrics. Stream parsing mode may be enabled in the following places: +By default `vmagent` reads the full response body from scrape target into memory, then parses it, applies [relabeling](#relabeling) and then pushes the resulting metrics to the configured `-remoteWrite.url`. This mode works good for the majority of cases when the scrape target exposes small number of metrics (e.g. less than 10 thousand). But this mode may take big amounts of memory when the scrape target exposes big number of metrics. In this case it is recommended enabling stream parsing mode. When this mode is enabled, then `vmagent` reads response from scrape target in chunks, then immediately processes every chunk and pushes the processed metrics to remote storage. This allows saving memory when scraping targets that expose millions of metrics. + +Stream parsing mode is automatically enabled for scrape targets returning response bodies with sizes bigger than the `-promscrape.minResponseSizeForStreamParse` command-line flag value. Additionally, the stream parsing mode can be explicitly enabled in the following places: - Via `-promscrape.streamParse` command-line flag. In this case all the scrape targets defined in the file pointed by `-promscrape.config` are scraped in stream parsing mode. - Via `stream_parse: true` option at `scrape_configs` section. In this case all the scrape targets defined in this section are scraped in stream parsing mode. @@ -329,7 +331,7 @@ scrape_configs: 'match[]': ['{__name__!=""}'] ``` -Note that `sample_limit` option doesn't prevent from data push to remote storage if stream parsing is enabled because the parsed data is pushed to remote storage as soon as it is parsed. +Note that `sample_limit` and `series_limit` options cannot be used in stream parsing mode because the parsed data is pushed to remote storage as soon as it is parsed. ## Scraping big number of targets @@ -449,7 +451,8 @@ It may be useful to perform `vmagent` rolling update without any scrape loss. as `vmagent` establishes at least a single TCP connection per target. * If `vmagent` uses too big amounts of memory, then the following options can help: - * Enabling stream parsing. See [these docs](#stream-parsing-mode). + * Disabling staleness tracking with `-promscrape.noStaleMarkers` option. See [these docs](#prometheus-staleness-markers). + * Enabling stream parsing mode. See [these docs](#stream-parsing-mode). * Reducing the number of output queues with `-remoteWrite.queues` command-line option. * Reducing the amounts of RAM vmagent can use for in-memory buffering with `-memory.allowedPercent` or `-memory.allowedBytes` command-line option. Another option is to reduce memory limits in Docker and/or Kuberntes if `vmagent` runs under these systems. * Reducing the number of CPU cores vmagent can use by passing `GOMAXPROCS=N` environment variable to `vmagent`, where `N` is the desired limit on CPU cores. Another option is to reduce CPU limits in Docker or Kubernetes if `vmagent` runs under these systems. @@ -706,6 +709,9 @@ See the docs at https://docs.victoriametrics.com/vmagent.html . -csvTrimTimestamp duration Trim timestamps when importing csv data to this duration. Minimum practical duration is 1ms. Higher duration (i.e. 1s) may be used for reducing disk space usage for timestamp data (default 1ms) + -datadog.maxInsertRequestSize size + The maximum size in bytes of a single DataDog POST request to /api/v1/series + Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 67108864) -dryRun Whether to check only config files without running vmagent. The following files are checked: -promscrape.config, -remoteWrite.relabelConfig, -remoteWrite.urlRelabelConfig . Unknown config entries are allowed in -promscrape.config by default. This can be changed with -promscrape.config.strictParse -enableTCP6 @@ -853,8 +859,11 @@ See the docs at https://docs.victoriametrics.com/vmagent.html . -promscrape.maxScrapeSize size The maximum size of scrape response in bytes to process from Prometheus targets. Bigger responses are rejected Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 16777216) + -promscrape.minResponseSizeForStreamParse size + The minimum target response size for automatic switching to stream parsing mode, which can reduce memory usage. See https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode + Supports the following optional suffixes for size values: KB, MB, GB, KiB, MiB, GiB (default 1000000) -promscrape.noStaleMarkers - Whether to disable sending Prometheus stale markers for metrics when scrape target disappears. This option may reduce memory usage if stale markers aren't needed for your setup. See also https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode + Whether to disable sending Prometheus stale markers for metrics when scrape target disappears. This option may reduce memory usage if stale markers aren't needed for your setup. This option also disables populating the scrape_series_added metric. See https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series -promscrape.openstackSDCheckInterval duration Interval for checking for changes in openstack API server. This works only if openstack_sd_configs is configured in '-promscrape.config' file. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#openstack_sd_config for details (default 30s) -promscrape.seriesLimitPerTarget int diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 7b2e02ace..befe066eb 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -159,7 +159,9 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { httpserver.WriteAPIHelp(w, [][2]string{ {"/targets", "discovered targets list"}, {"/api/v1/targets", "advanced information about discovered targets in JSON format"}, + {"/config", "-promscrape.config contents"}, {"/metrics", "available service metrics"}, + {"/flags", "command-line flags"}, {"/-/reload", "reload configuration"}, }) return true @@ -259,6 +261,11 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { promscrapeTargetsRequests.Inc() promscrape.WriteHumanReadableTargetsStatus(w, r) return true + case "/config": + promscrapeConfigRequests.Inc() + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + promscrape.WriteConfigData(w) + return true case "/api/v1/targets": promscrapeAPIV1TargetsRequests.Inc() w.Header().Set("Content-Type", "application/json; charset=utf-8") @@ -427,6 +434,8 @@ var ( promscrapeTargetsRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/targets"}`) promscrapeAPIV1TargetsRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/api/v1/targets"}`) + promscrapeConfigRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/config"}`) + promscrapeConfigReloadRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/-/reload"}`) ) diff --git a/app/vmalert/README.md b/app/vmalert/README.md index d62cf6ae4..d7169df6c 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -351,12 +351,12 @@ See full description for these flags in `./vmalert --help`. ## Monitoring -`vmalert` exports various metrics in Prometheus exposition format at `http://vmalert-host:8880/metrics` page. -We recommend setting up regular scraping of this page either through `vmagent` or by Prometheus so that the exported +`vmalert` exports various metrics in Prometheus exposition format at `http://vmalert-host:8880/metrics` page. +We recommend setting up regular scraping of this page either through `vmagent` or by Prometheus so that the exported metrics may be analyzed later. Use official [Grafana dashboard](https://grafana.com/grafana/dashboards/14950) for `vmalert` overview. -If you have suggestions for improvements or have found a bug - please open an issue on github or add +If you have suggestions for improvements or have found a bug - please open an issue on github or add a review to the dashboard. @@ -496,6 +496,8 @@ The shortlist of configuration flags is the following: Optional bearer auth token to use for -remoteRead.url. -remoteRead.bearerTokenFile string Optional path to bearer token file to use for -remoteRead.url. + -remoteRead.disablePathAppend + Whether to disable automatic appending of '/api/v1/query' path to the configured -remoteRead.url. -remoteRead.ignoreRestoreErrors Whether to ignore errors from remote storage when restoring alerts state on startup. (default true) -remoteRead.lookback duration @@ -511,7 +513,7 @@ The shortlist of configuration flags is the following: -remoteRead.tlsServerName string Optional TLS server name to use for connections to -remoteRead.url. By default the server name from -remoteRead.url is used -remoteRead.url vmalert - Optional URL to VictoriaMetrics or vmselect that will be used to restore alerts state. This configuration makes sense only if vmalert was configured with `remoteWrite.url` before and has been successfully persisted its state. E.g. http://127.0.0.1:8428 + Optional URL to VictoriaMetrics or vmselect that will be used to restore alerts state. This configuration makes sense only if vmalert was configured with `remoteWrite.url` before and has been successfully persisted its state. E.g. http://127.0.0.1:8428. See also -remoteRead.disablePathAppend -remoteWrite.basicAuth.password string Optional basic auth password for -remoteWrite.url -remoteWrite.basicAuth.passwordFile string diff --git a/app/vmalert/alerting.go b/app/vmalert/alerting.go index 4aa77adea..d654246c8 100644 --- a/app/vmalert/alerting.go +++ b/app/vmalert/alerting.go @@ -163,7 +163,13 @@ func (ar *AlertingRule) ExecRange(ctx context.Context, start, end time.Time) ([] // so the hash key will be consistent on restore s.SetLabel(k, v) } - + // set additional labels to identify group and rule name + if ar.Name != "" { + s.SetLabel(alertNameLabel, ar.Name) + } + if !*disableAlertGroupLabel && ar.GroupName != "" { + s.SetLabel(alertGroupNameLabel, ar.GroupName) + } a, err := ar.newAlert(s, time.Time{}, qFn) // initial alert if err != nil { return nil, fmt.Errorf("failed to create alert: %s", err) @@ -178,13 +184,11 @@ func (ar *AlertingRule) ExecRange(ctx context.Context, start, end time.Time) ([] // if alert with For > 0 prevT := time.Time{} - //activeAt := time.Time{} for i := range s.Values { at := time.Unix(s.Timestamps[i], 0) if at.Sub(prevT) > ar.EvalInterval { // reset to Pending if there are gaps > EvalInterval between DPs a.State = notifier.StatePending - //activeAt = at a.Start = at } else if at.Sub(a.Start) >= ar.For { a.State = notifier.StateFiring @@ -231,6 +235,14 @@ func (ar *AlertingRule) Exec(ctx context.Context) ([]prompbmarshal.TimeSeries, e // so the hash key will be consistent on restore m.SetLabel(k, v) } + // set additional labels to identify group and rule name + // set additional labels to identify group and rule name + if ar.Name != "" { + m.SetLabel(alertNameLabel, ar.Name) + } + if !*disableAlertGroupLabel && ar.GroupName != "" { + m.SetLabel(alertGroupNameLabel, ar.GroupName) + } h := hash(m) if _, ok := updated[h]; ok { // duplicate may be caused by extra labels @@ -352,11 +364,6 @@ func (ar *AlertingRule) newAlert(m datasource.Metric, start time.Time, qFn notif Start: start, Expr: ar.Expr, } - // label defined here to make override possible by - // time series labels. - if !*disableAlertGroupLabel && ar.GroupName != "" { - a.Labels[alertGroupNameLabel] = ar.GroupName - } for _, l := range m.Labels { // drop __name__ to be consistent with Prometheus alerting if l.Name == "__name__" { @@ -415,7 +422,7 @@ func (ar *AlertingRule) AlertsAPI() []*APIAlert { } func (ar *AlertingRule) newAlertAPI(a notifier.Alert) *APIAlert { - return &APIAlert{ + aa := &APIAlert{ // encode as strings to avoid rounding ID: fmt.Sprintf("%d", a.ID), GroupID: fmt.Sprintf("%d", a.GroupID), @@ -427,8 +434,13 @@ func (ar *AlertingRule) newAlertAPI(a notifier.Alert) *APIAlert { Annotations: a.Annotations, State: a.State.String(), ActiveAt: a.Start, + Restored: a.Restored, Value: strconv.FormatFloat(a.Value, 'f', -1, 32), } + if alertURLGeneratorFn != nil { + aa.SourceLink = alertURLGeneratorFn(a) + } + return aa } const ( @@ -443,43 +455,42 @@ const ( alertStateLabel = "alertstate" // alertGroupNameLabel defines the label name attached for generated time series. + // attaching this label may be disabled via `-disableAlertgroupLabel` flag. alertGroupNameLabel = "alertgroup" ) // alertToTimeSeries converts the given alert with the given timestamp to timeseries func (ar *AlertingRule) alertToTimeSeries(a *notifier.Alert, timestamp int64) []prompbmarshal.TimeSeries { var tss []prompbmarshal.TimeSeries - tss = append(tss, alertToTimeSeries(ar.Name, a, timestamp)) + tss = append(tss, alertToTimeSeries(a, timestamp)) if ar.For > 0 { - tss = append(tss, alertForToTimeSeries(ar.Name, a, timestamp)) + tss = append(tss, alertForToTimeSeries(a, timestamp)) } return tss } -func alertToTimeSeries(name string, a *notifier.Alert, timestamp int64) prompbmarshal.TimeSeries { +func alertToTimeSeries(a *notifier.Alert, timestamp int64) prompbmarshal.TimeSeries { labels := make(map[string]string) for k, v := range a.Labels { labels[k] = v } labels["__name__"] = alertMetricName - labels[alertNameLabel] = name labels[alertStateLabel] = a.State.String() return newTimeSeries([]float64{1}, []int64{timestamp}, labels) } // alertForToTimeSeries returns a timeseries that represents // state of active alerts, where value is time when alert become active -func alertForToTimeSeries(name string, a *notifier.Alert, timestamp int64) prompbmarshal.TimeSeries { +func alertForToTimeSeries(a *notifier.Alert, timestamp int64) prompbmarshal.TimeSeries { labels := make(map[string]string) for k, v := range a.Labels { labels[k] = v } labels["__name__"] = alertForStateMetricName - labels[alertNameLabel] = name return newTimeSeries([]float64{float64(a.Start.Unix())}, []int64{timestamp}, labels) } -// Restore restores the state of active alerts basing on previously written timeseries. +// Restore restores the state of active alerts basing on previously written time series. // Restore restores only Start field. Field State will be always Pending and supposed // to be updated on next Exec, as well as Value field. // Only rules with For > 0 will be restored. @@ -507,23 +518,13 @@ func (ar *AlertingRule) Restore(ctx context.Context, q datasource.Querier, lookb } for _, m := range qMetrics { - labels := m.Labels - m.Labels = make([]datasource.Label, 0) - // drop all extra labels, so hash key will - // be identical to time series received in Exec - for _, l := range labels { - if l.Name == alertNameLabel || l.Name == alertGroupNameLabel { - continue - } - m.Labels = append(m.Labels, l) - } - a, err := ar.newAlert(m, time.Unix(int64(m.Values[0]), 0), qFn) if err != nil { return fmt.Errorf("failed to create alert: %w", err) } a.ID = hash(m) a.State = notifier.StatePending + a.Restored = true ar.alerts[a.ID] = a logger.Infof("alert %q (%d) restored to state at %v", a.Name, a.ID, a.Start) } diff --git a/app/vmalert/alerting_test.go b/app/vmalert/alerting_test.go index 0be0c055a..cff88f53b 100644 --- a/app/vmalert/alerting_test.go +++ b/app/vmalert/alerting_test.go @@ -27,7 +27,6 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { newTimeSeries([]float64{1}, []int64{timestamp.UnixNano()}, map[string]string{ "__name__": alertMetricName, alertStateLabel: notifier.StateFiring.String(), - alertNameLabel: "instant", }), }, }, @@ -41,7 +40,6 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { newTimeSeries([]float64{1}, []int64{timestamp.UnixNano()}, map[string]string{ "__name__": alertMetricName, alertStateLabel: notifier.StateFiring.String(), - alertNameLabel: "instant extra labels", "job": "foo", "instance": "bar", }), @@ -57,7 +55,6 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { newTimeSeries([]float64{1}, []int64{timestamp.UnixNano()}, map[string]string{ "__name__": alertMetricName, alertStateLabel: notifier.StateFiring.String(), - alertNameLabel: "instant labels override", }), }, }, @@ -68,13 +65,11 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { newTimeSeries([]float64{1}, []int64{timestamp.UnixNano()}, map[string]string{ "__name__": alertMetricName, alertStateLabel: notifier.StateFiring.String(), - alertNameLabel: "for", }), newTimeSeries([]float64{float64(timestamp.Add(time.Second).Unix())}, []int64{timestamp.UnixNano()}, map[string]string{ - "__name__": alertForStateMetricName, - alertNameLabel: "for", + "__name__": alertForStateMetricName, }), }, }, @@ -85,13 +80,11 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { newTimeSeries([]float64{1}, []int64{timestamp.UnixNano()}, map[string]string{ "__name__": alertMetricName, alertStateLabel: notifier.StatePending.String(), - alertNameLabel: "for pending", }), newTimeSeries([]float64{float64(timestamp.Add(time.Second).Unix())}, []int64{timestamp.UnixNano()}, map[string]string{ - "__name__": alertForStateMetricName, - alertNameLabel: "for pending", + "__name__": alertForStateMetricName, }), }, }, @@ -109,23 +102,27 @@ func TestAlertingRule_ToTimeSeries(t *testing.T) { func TestAlertingRule_Exec(t *testing.T) { const defaultStep = 5 * time.Millisecond + type testAlert struct { + labels []string + alert *notifier.Alert + } testCases := []struct { rule *AlertingRule steps [][]datasource.Metric - expAlerts map[uint64]*notifier.Alert + expAlerts []testAlert }{ { newTestAlertingRule("empty", 0), [][]datasource.Metric{}, - map[uint64]*notifier.Alert{}, + nil, }, { newTestAlertingRule("empty labels", 0), [][]datasource.Metric{ {datasource.Metric{Values: []float64{1}, Timestamps: []int64{1}}}, }, - map[uint64]*notifier.Alert{ - hash(datasource.Metric{}): {State: notifier.StateFiring}, + []testAlert{ + {alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -133,8 +130,8 @@ func TestAlertingRule_Exec(t *testing.T) { [][]datasource.Metric{ {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -143,8 +140,8 @@ func TestAlertingRule_Exec(t *testing.T) { {metricWithLabels(t, "name", "foo")}, {}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateInactive}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateInactive}}, }, }, { @@ -154,8 +151,8 @@ func TestAlertingRule_Exec(t *testing.T) { {}, {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -166,8 +163,8 @@ func TestAlertingRule_Exec(t *testing.T) { {metricWithLabels(t, "name", "foo")}, {}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateInactive}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateInactive}}, }, }, { @@ -179,7 +176,7 @@ func TestAlertingRule_Exec(t *testing.T) { {}, {}, }, - map[uint64]*notifier.Alert{}, + nil, }, { newTestAlertingRule("single-firing=>inactive=>firing=>inactive=>empty=>firing", 0), @@ -191,8 +188,8 @@ func TestAlertingRule_Exec(t *testing.T) { {}, {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -204,10 +201,10 @@ func TestAlertingRule_Exec(t *testing.T) { metricWithLabels(t, "name", "foo2"), }, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, - hash(metricWithLabels(t, "name", "foo1")): {State: notifier.StateFiring}, - hash(metricWithLabels(t, "name", "foo2")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, + {labels: []string{"name", "foo1"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, + {labels: []string{"name", "foo2"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -220,9 +217,9 @@ func TestAlertingRule_Exec(t *testing.T) { // 1: fire first alert // 2: fire second alert, set first inactive // 3: fire third alert, set second inactive, delete first one - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo1")): {State: notifier.StateInactive}, - hash(metricWithLabels(t, "name", "foo2")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo1"}, alert: ¬ifier.Alert{State: notifier.StateInactive}}, + {labels: []string{"name", "foo2"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -230,8 +227,8 @@ func TestAlertingRule_Exec(t *testing.T) { [][]datasource.Metric{ {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StatePending}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StatePending}}, }, }, { @@ -240,8 +237,8 @@ func TestAlertingRule_Exec(t *testing.T) { {metricWithLabels(t, "name", "foo")}, {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, { @@ -252,7 +249,7 @@ func TestAlertingRule_Exec(t *testing.T) { // empty step to reset and delete pending alerts {}, }, - map[uint64]*notifier.Alert{}, + nil, }, { newTestAlertingRule("for-pending=>firing=>inactive", defaultStep), @@ -262,8 +259,8 @@ func TestAlertingRule_Exec(t *testing.T) { // empty step to reset pending alerts {}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateInactive}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateInactive}}, }, }, { @@ -275,8 +272,8 @@ func TestAlertingRule_Exec(t *testing.T) { {}, {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StatePending}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StatePending}}, }, }, { @@ -289,8 +286,8 @@ func TestAlertingRule_Exec(t *testing.T) { {metricWithLabels(t, "name", "foo")}, {metricWithLabels(t, "name", "foo")}, }, - map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "name", "foo")): {State: notifier.StateFiring}, + []testAlert{ + {labels: []string{"name", "foo"}, alert: ¬ifier.Alert{State: notifier.StateFiring}}, }, }, } @@ -312,7 +309,15 @@ func TestAlertingRule_Exec(t *testing.T) { if len(tc.rule.alerts) != len(tc.expAlerts) { t.Fatalf("expected %d alerts; got %d", len(tc.expAlerts), len(tc.rule.alerts)) } - for key, exp := range tc.expAlerts { + expAlerts := make(map[uint64]*notifier.Alert) + for _, ta := range tc.expAlerts { + labels := ta.labels + labels = append(labels, alertNameLabel) + labels = append(labels, tc.rule.Name) + h := hash(metricWithLabels(t, labels...)) + expAlerts[h] = ta.alert + } + for key, exp := range expAlerts { got, ok := tc.rule.alerts[key] if !ok { t.Fatalf("expected to have key %d", key) @@ -468,6 +473,11 @@ func TestAlertingRule_ExecRange(t *testing.T) { var j int for _, series := range tc.data { for _, timestamp := range series.Timestamps { + a := tc.expAlerts[j] + if a.Labels == nil { + a.Labels = make(map[string]string) + } + a.Labels[alertNameLabel] = tc.rule.Name expTS = append(expTS, tc.rule.alertToTimeSeries(tc.expAlerts[j], timestamp)...) j++ } @@ -496,7 +506,6 @@ func TestAlertingRule_Restore(t *testing.T) { []datasource.Metric{ metricWithValueAndLabels(t, float64(time.Now().Truncate(time.Hour).Unix()), "__name__", alertForStateMetricName, - alertNameLabel, "", ), }, map[uint64]*notifier.Alert{ @@ -509,7 +518,7 @@ func TestAlertingRule_Restore(t *testing.T) { []datasource.Metric{ metricWithValueAndLabels(t, float64(time.Now().Truncate(time.Hour).Unix()), "__name__", alertForStateMetricName, - alertNameLabel, "", + alertNameLabel, "metric labels", alertGroupNameLabel, "groupID", "foo", "bar", "namespace", "baz", @@ -517,6 +526,8 @@ func TestAlertingRule_Restore(t *testing.T) { }, map[uint64]*notifier.Alert{ hash(metricWithLabels(t, + alertNameLabel, "metric labels", + alertGroupNameLabel, "groupID", "foo", "bar", "namespace", "baz", )): {State: notifier.StatePending, @@ -528,7 +539,6 @@ func TestAlertingRule_Restore(t *testing.T) { []datasource.Metric{ metricWithValueAndLabels(t, float64(time.Now().Truncate(time.Hour).Unix()), "__name__", alertForStateMetricName, - alertNameLabel, "", "foo", "bar", "namespace", "baz", // extra labels set by rule @@ -645,18 +655,20 @@ func TestAlertingRule_Template(t *testing.T) { metricWithValueAndLabels(t, 1, "instance", "bar"), }, map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "region", "east", "instance", "foo")): { + hash(metricWithLabels(t, alertNameLabel, "common", "region", "east", "instance", "foo")): { Annotations: map[string]string{}, Labels: map[string]string{ - "region": "east", - "instance": "foo", + alertNameLabel: "common", + "region": "east", + "instance": "foo", }, }, - hash(metricWithLabels(t, "region", "east", "instance", "bar")): { + hash(metricWithLabels(t, alertNameLabel, "common", "region", "east", "instance", "bar")): { Annotations: map[string]string{}, Labels: map[string]string{ - "region": "east", - "instance": "bar", + alertNameLabel: "common", + "region": "east", + "instance": "bar", }, }, }, @@ -679,20 +691,22 @@ func TestAlertingRule_Template(t *testing.T) { metricWithValueAndLabels(t, 10, "instance", "bar"), }, map[uint64]*notifier.Alert{ - hash(metricWithLabels(t, "region", "east", "instance", "foo")): { + hash(metricWithLabels(t, alertNameLabel, "override label", "region", "east", "instance", "foo")): { Labels: map[string]string{ - "instance": "foo", - "region": "east", + alertNameLabel: "override label", + "instance": "foo", + "region": "east", }, Annotations: map[string]string{ "summary": `Too high connection number for "foo" for region east`, "description": `It is 2 connections for "foo"`, }, }, - hash(metricWithLabels(t, "region", "east", "instance", "bar")): { + hash(metricWithLabels(t, alertNameLabel, "override label", "region", "east", "instance", "bar")): { Labels: map[string]string{ - "instance": "bar", - "region": "east", + alertNameLabel: "override label", + "instance": "bar", + "region": "east", }, Annotations: map[string]string{ "summary": `Too high connection number for "bar" for region east`, diff --git a/app/vmalert/datasource/init.go b/app/vmalert/datasource/init.go index 3e28d6e43..72cfddfc9 100644 --- a/app/vmalert/datasource/init.go +++ b/app/vmalert/datasource/init.go @@ -52,6 +52,9 @@ func Init(extraParams []Param) (QuerierBuilder, error) { return nil, fmt.Errorf("failed to create transport: %w", err) } tr.MaxIdleConnsPerHost = *maxIdleConnections + if tr.MaxIdleConns != 0 && tr.MaxIdleConns < tr.MaxIdleConnsPerHost { + tr.MaxIdleConns = tr.MaxIdleConnsPerHost + } if *roundDigits > 0 { extraParams = append(extraParams, Param{ diff --git a/app/vmalert/datasource/vm.go b/app/vmalert/datasource/vm.go index a6058dec8..5d3dc6267 100644 --- a/app/vmalert/datasource/vm.go +++ b/app/vmalert/datasource/vm.go @@ -24,18 +24,20 @@ type VMStorage struct { evaluationInterval time.Duration extraLabels []string extraParams []Param + disablePathAppend bool } // Clone makes clone of VMStorage, shares http client. func (s *VMStorage) Clone() *VMStorage { return &VMStorage{ - c: s.c, - authCfg: s.authCfg, - datasourceURL: s.datasourceURL, - lookBack: s.lookBack, - queryStep: s.queryStep, - appendTypePrefix: s.appendTypePrefix, - dataSourceType: s.dataSourceType, + c: s.c, + authCfg: s.authCfg, + datasourceURL: s.datasourceURL, + lookBack: s.lookBack, + queryStep: s.queryStep, + appendTypePrefix: s.appendTypePrefix, + dataSourceType: s.dataSourceType, + disablePathAppend: s.disablePathAppend, } } @@ -57,15 +59,16 @@ func (s *VMStorage) BuildWithParams(params QuerierParams) Querier { } // NewVMStorage is a constructor for VMStorage -func NewVMStorage(baseURL string, authCfg *promauth.Config, lookBack time.Duration, queryStep time.Duration, appendTypePrefix bool, c *http.Client) *VMStorage { +func NewVMStorage(baseURL string, authCfg *promauth.Config, lookBack time.Duration, queryStep time.Duration, appendTypePrefix bool, c *http.Client, disablePathAppend bool) *VMStorage { return &VMStorage{ - c: c, - authCfg: authCfg, - datasourceURL: strings.TrimSuffix(baseURL, "/"), - appendTypePrefix: appendTypePrefix, - lookBack: lookBack, - queryStep: queryStep, - dataSourceType: NewPrometheusType(), + c: c, + authCfg: authCfg, + datasourceURL: strings.TrimSuffix(baseURL, "/"), + appendTypePrefix: appendTypePrefix, + lookBack: lookBack, + queryStep: queryStep, + dataSourceType: NewPrometheusType(), + disablePathAppend: disablePathAppend, } } @@ -132,12 +135,12 @@ func (s *VMStorage) QueryRange(ctx context.Context, query string, start, end tim func (s *VMStorage) do(ctx context.Context, req *http.Request) (*http.Response, error) { resp, err := s.c.Do(req.WithContext(ctx)) if err != nil { - return nil, fmt.Errorf("error getting response from %s: %w", req.URL, err) + return nil, fmt.Errorf("error getting response from %s: %w", req.URL.Redacted(), err) } if resp.StatusCode != http.StatusOK { body, _ := ioutil.ReadAll(resp.Body) _ = resp.Body.Close() - return nil, fmt.Errorf("unexpected response code %d for %s. Response body %s", resp.StatusCode, req.URL, body) + return nil, fmt.Errorf("unexpected response code %d for %s. Response body %s", resp.StatusCode, req.URL.Redacted(), body) } return resp, nil } diff --git a/app/vmalert/datasource/vm_graphite_api.go b/app/vmalert/datasource/vm_graphite_api.go index 3c6a2ab34..36b89e187 100644 --- a/app/vmalert/datasource/vm_graphite_api.go +++ b/app/vmalert/datasource/vm_graphite_api.go @@ -38,7 +38,7 @@ func (r graphiteResponse) metrics() []Metric { func parseGraphiteResponse(req *http.Request, resp *http.Response) ([]Metric, error) { r := &graphiteResponse{} if err := json.NewDecoder(resp.Body).Decode(r); err != nil { - return nil, fmt.Errorf("error parsing graphite metrics for %s: %w", req.URL, err) + return nil, fmt.Errorf("error parsing graphite metrics for %s: %w", req.URL.Redacted(), err) } return r.metrics(), nil } diff --git a/app/vmalert/datasource/vm_prom_api.go b/app/vmalert/datasource/vm_prom_api.go index 62154c313..2faba4d27 100644 --- a/app/vmalert/datasource/vm_prom_api.go +++ b/app/vmalert/datasource/vm_prom_api.go @@ -82,10 +82,10 @@ const ( func parsePrometheusResponse(req *http.Request, resp *http.Response) ([]Metric, error) { r := &promResponse{} if err := json.NewDecoder(resp.Body).Decode(r); err != nil { - return nil, fmt.Errorf("error parsing prometheus metrics for %s: %w", req.URL, err) + return nil, fmt.Errorf("error parsing prometheus metrics for %s: %w", req.URL.Redacted(), err) } if r.Status == statusError { - return nil, fmt.Errorf("response error, query: %s, errorType: %s, error: %s", req.URL, r.ErrorType, r.Error) + return nil, fmt.Errorf("response error, query: %s, errorType: %s, error: %s", req.URL.Redacted(), r.ErrorType, r.Error) } if r.Status != statusSuccess { return nil, fmt.Errorf("unknown status: %s, Expected success or error ", r.Status) @@ -118,7 +118,9 @@ func (s *VMStorage) setPrometheusInstantReqParams(r *http.Request, query string, if s.appendTypePrefix { r.URL.Path += prometheusPrefix } - r.URL.Path += prometheusInstantPath + if !s.disablePathAppend { + r.URL.Path += prometheusInstantPath + } q := r.URL.Query() if s.lookBack > 0 { timestamp = timestamp.Add(-s.lookBack) @@ -136,7 +138,9 @@ func (s *VMStorage) setPrometheusRangeReqParams(r *http.Request, query string, s if s.appendTypePrefix { r.URL.Path += prometheusPrefix } - r.URL.Path += prometheusRangePath + if !s.disablePathAppend { + r.URL.Path += prometheusRangePath + } q := r.URL.Query() q.Add("start", fmt.Sprintf("%d", start.Unix())) q.Add("end", fmt.Sprintf("%d", end.Unix())) diff --git a/app/vmalert/datasource/vm_test.go b/app/vmalert/datasource/vm_test.go index 801974d9c..ba406a46c 100644 --- a/app/vmalert/datasource/vm_test.go +++ b/app/vmalert/datasource/vm_test.go @@ -83,7 +83,7 @@ func TestVMInstantQuery(t *testing.T) { if err != nil { t.Fatalf("unexpected: %s", err) } - s := NewVMStorage(srv.URL, authCfg, time.Minute, 0, false, srv.Client()) + s := NewVMStorage(srv.URL, authCfg, time.Minute, 0, false, srv.Client(), false) p := NewPrometheusType() pq := s.BuildWithParams(QuerierParams{DataSourceType: &p, EvaluationInterval: 15 * time.Second}) @@ -193,7 +193,7 @@ func TestVMRangeQuery(t *testing.T) { if err != nil { t.Fatalf("unexpected: %s", err) } - s := NewVMStorage(srv.URL, authCfg, time.Minute, 0, false, srv.Client()) + s := NewVMStorage(srv.URL, authCfg, time.Minute, 0, false, srv.Client(), false) p := NewPrometheusType() pq := s.BuildWithParams(QuerierParams{DataSourceType: &p, EvaluationInterval: 15 * time.Second}) @@ -252,6 +252,17 @@ func TestRequestParams(t *testing.T) { checkEqualString(t, prometheusInstantPath, r.URL.Path) }, }, + { + "prometheus path with disablePathAppend", + false, + &VMStorage{ + dataSourceType: NewPrometheusType(), + disablePathAppend: true, + }, + func(t *testing.T, r *http.Request) { + checkEqualString(t, "", r.URL.Path) + }, + }, { "prometheus prefix", false, @@ -263,6 +274,18 @@ func TestRequestParams(t *testing.T) { checkEqualString(t, prometheusPrefix+prometheusInstantPath, r.URL.Path) }, }, + { + "prometheus prefix with disablePathAppend", + false, + &VMStorage{ + dataSourceType: NewPrometheusType(), + appendTypePrefix: true, + disablePathAppend: true, + }, + func(t *testing.T, r *http.Request) { + checkEqualString(t, prometheusPrefix, r.URL.Path) + }, + }, { "prometheus range path", true, @@ -273,6 +296,17 @@ func TestRequestParams(t *testing.T) { checkEqualString(t, prometheusRangePath, r.URL.Path) }, }, + { + "prometheus range path with disablePathAppend", + true, + &VMStorage{ + dataSourceType: NewPrometheusType(), + disablePathAppend: true, + }, + func(t *testing.T, r *http.Request) { + checkEqualString(t, "", r.URL.Path) + }, + }, { "prometheus range prefix", true, @@ -284,6 +318,18 @@ func TestRequestParams(t *testing.T) { checkEqualString(t, prometheusPrefix+prometheusRangePath, r.URL.Path) }, }, + { + "prometheus range prefix with disablePathAppend", + true, + &VMStorage{ + dataSourceType: NewPrometheusType(), + appendTypePrefix: true, + disablePathAppend: true, + }, + func(t *testing.T, r *http.Request) { + checkEqualString(t, prometheusPrefix, r.URL.Path) + }, + }, { "graphite path", false, diff --git a/app/vmalert/group.go b/app/vmalert/group.go index e80b1e6e8..47fab99d2 100644 --- a/app/vmalert/group.go +++ b/app/vmalert/group.go @@ -123,6 +123,9 @@ func (g *Group) newRule(qb datasource.QuerierBuilder, rule config.Rule) Rule { // ID return unique group ID that consists of // rules file and group name func (g *Group) ID() uint64 { + g.mu.RLock() + defer g.mu.RUnlock() + hash := fnv.New64a() hash.Write([]byte(g.File)) hash.Write([]byte("\xff")) diff --git a/app/vmalert/group_test.go b/app/vmalert/group_test.go index 629f705d8..3910f4170 100644 --- a/app/vmalert/group_test.go +++ b/app/vmalert/group_test.go @@ -192,7 +192,14 @@ func TestGroupStart(t *testing.T) { // add rule labels - see config/testdata/rules1-good.rules alert1.Labels["label"] = "bar" alert1.Labels["host"] = inst1 - alert1.ID = hash(m1) + // add service labels + alert1.Labels[alertNameLabel] = alert1.Name + alert1.Labels[alertGroupNameLabel] = g.Name + var labels1 []string + for k, v := range alert1.Labels { + labels1 = append(labels1, k, v) + } + alert1.ID = hash(metricWithLabels(t, labels1...)) alert2, err := r.newAlert(m2, time.Now(), nil) if err != nil { @@ -204,7 +211,14 @@ func TestGroupStart(t *testing.T) { // add rule labels - see config/testdata/rules1-good.rules alert2.Labels["label"] = "bar" alert2.Labels["host"] = inst2 - alert2.ID = hash(m2) + // add service labels + alert2.Labels[alertNameLabel] = alert2.Name + alert2.Labels[alertGroupNameLabel] = g.Name + var labels2 []string + for k, v := range alert2.Labels { + labels2 = append(labels2, k, v) + } + alert2.ID = hash(metricWithLabels(t, labels2...)) finished := make(chan struct{}) fs.add(m1) diff --git a/app/vmalert/helpers_test.go b/app/vmalert/helpers_test.go index a4f99cddc..bc0ce54cb 100644 --- a/app/vmalert/helpers_test.go +++ b/app/vmalert/helpers_test.go @@ -205,7 +205,8 @@ func compareTimeSeries(t *testing.T, a, b []prompbmarshal.TimeSeries) error { }*/ } if len(expTS.Labels) != len(gotTS.Labels) { - return fmt.Errorf("expected number of labels %d; got %d", len(expTS.Labels), len(gotTS.Labels)) + return fmt.Errorf("expected number of labels %d (%v); got %d (%v)", + len(expTS.Labels), expTS.Labels, len(gotTS.Labels), gotTS.Labels) } for i, exp := range expTS.Labels { got := gotTS.Labels[i] diff --git a/app/vmalert/main.go b/app/vmalert/main.go index fa8ed3753..775f756b2 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -59,6 +59,8 @@ eg. 'explore?orgId=1&left=[\"now-1h\",\"now\",\"VictoriaMetrics\",{\"expr\": \"{ dryRun = flag.Bool("dryRun", false, "Whether to check only config files without running vmalert. The rules file are validated. The `-rule` flag must be specified.") ) +var alertURLGeneratorFn notifier.AlertURLGenerator + func main() { // Write flags and help message to stdout, since it is easier to grep or pipe. flag.CommandLine.SetOutput(os.Stdout) @@ -79,15 +81,22 @@ func main() { } return } + + eu, err := getExternalURL(*externalURL, *httpListenAddr, httpserver.IsTLS()) + if err != nil { + logger.Fatalf("failed to init `external.url`: %s", err) + } + notifier.InitTemplateFunc(eu) + alertURLGeneratorFn, err = getAlertURLGenerator(eu, *externalAlertSource, *validateTemplates) + if err != nil { + logger.Fatalf("failed to init `external.alert.source`: %s", err) + } + if *replayFrom != "" || *replayTo != "" { rw, err := remotewrite.Init(context.Background()) if err != nil { logger.Fatalf("failed to init remoteWrite: %s", err) } - eu, err := getExternalURL(*externalURL, *httpListenAddr, httpserver.IsTLS()) - if err != nil { - logger.Fatalf("failed to init `external.url`: %s", err) - } notifier.InitTemplateFunc(eu) groupsCfg, err := config.Parse(*rulePath, *validateTemplates, *validateExpressions) if err != nil { @@ -118,11 +127,16 @@ func main() { logger.Fatalf("cannot parse configuration file: %s", err) } + // Register SIGHUP handler for config re-read just before manager.start call. + // This guarantees that the config will be re-read if the signal arrives during manager.start call. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1240 + sighupCh := procutil.NewSighupChan() + if err := manager.start(ctx, groupsCfg); err != nil { logger.Fatalf("failed to start: %s", err) } - go configReload(ctx, manager, groupsCfg) + go configReload(ctx, manager, groupsCfg, sighupCh) rh := &requestHandler{m: manager} go httpserver.Serve(*httpListenAddr, rh.handler) @@ -148,20 +162,10 @@ func newManager(ctx context.Context) (*manager, error) { if err != nil { return nil, fmt.Errorf("failed to init datasource: %w", err) } - eu, err := getExternalURL(*externalURL, *httpListenAddr, httpserver.IsTLS()) - if err != nil { - return nil, fmt.Errorf("failed to init `external.url`: %w", err) - } - notifier.InitTemplateFunc(eu) - aug, err := getAlertURLGenerator(eu, *externalAlertSource, *validateTemplates) - if err != nil { - return nil, fmt.Errorf("failed to init `external.alert.source`: %w", err) - } - nts, err := notifier.Init(aug) + nts, err := notifier.Init(alertURLGeneratorFn) if err != nil { return nil, fmt.Errorf("failed to init notifier: %w", err) } - manager := &manager{ groups: make(map[uint64]*Group), querierBuilder: q, @@ -246,12 +250,7 @@ See the docs at https://docs.victoriametrics.com/vmalert.html . flagutil.Usage(s) } -func configReload(ctx context.Context, m *manager, groupsCfg []config.Group) { - // Register SIGHUP handler for config re-read just before manager.start call. - // This guarantees that the config will be re-read if the signal arrives during manager.start call. - // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1240 - sighupCh := procutil.NewSighupChan() - +func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sighupCh <-chan os.Signal) { var configCheckCh <-chan time.Time if *rulesCheckInterval > 0 { ticker := time.NewTicker(*rulesCheckInterval) diff --git a/app/vmalert/main_test.go b/app/vmalert/main_test.go index 8a4174ce3..7b927805a 100644 --- a/app/vmalert/main_test.go +++ b/app/vmalert/main_test.go @@ -102,8 +102,9 @@ groups: } syncCh := make(chan struct{}) + sighupCh := procutil.NewSighupChan() go func() { - configReload(ctx, m, nil) + configReload(ctx, m, nil, sighupCh) close(syncCh) }() diff --git a/app/vmalert/notifier/alert.go b/app/vmalert/notifier/alert.go index d345791e5..c2889b94f 100644 --- a/app/vmalert/notifier/alert.go +++ b/app/vmalert/notifier/alert.go @@ -34,6 +34,8 @@ type Alert struct { Value float64 // ID is the unique identifer for the Alert ID uint64 + // Restored is true if Alert was restored after restart + Restored bool } // AlertState type indicates the Alert state diff --git a/app/vmalert/remoteread/init.go b/app/vmalert/remoteread/init.go index 73a2993b5..427b5def2 100644 --- a/app/vmalert/remoteread/init.go +++ b/app/vmalert/remoteread/init.go @@ -12,7 +12,7 @@ import ( var ( addr = flag.String("remoteRead.url", "", "Optional URL to VictoriaMetrics or vmselect that will be used to restore alerts "+ "state. This configuration makes sense only if `vmalert` was configured with `remoteWrite.url` before and has been successfully persisted its state. "+ - "E.g. http://127.0.0.1:8428") + "E.g. http://127.0.0.1:8428. See also -remoteRead.disablePathAppend") basicAuthUsername = flag.String("remoteRead.basicAuth.username", "", "Optional basic auth username for -remoteRead.url") basicAuthPassword = flag.String("remoteRead.basicAuth.password", "", "Optional basic auth password for -remoteRead.url") basicAuthPasswordFile = flag.String("remoteRead.basicAuth.passwordFile", "", "Optional path to basic auth password to use for -remoteRead.url") @@ -26,6 +26,7 @@ var ( "By default system CA is used") tlsServerName = flag.String("remoteRead.tlsServerName", "", "Optional TLS server name to use for connections to -remoteRead.url. "+ "By default the server name from -remoteRead.url is used") + disablePathAppend = flag.Bool("remoteRead.disablePathAppend", false, "Whether to disable automatic appending of '/api/v1/query' path to the configured -remoteRead.url.") ) // Init creates a Querier from provided flag values. @@ -43,5 +44,5 @@ func Init() (datasource.QuerierBuilder, error) { return nil, fmt.Errorf("failed to configure auth: %w", err) } c := &http.Client{Transport: tr} - return datasource.NewVMStorage(*addr, authCfg, 0, 0, false, c), nil + return datasource.NewVMStorage(*addr, authCfg, 0, 0, false, c, *disablePathAppend), nil } diff --git a/app/vmalert/remotewrite/remotewrite.go b/app/vmalert/remotewrite/remotewrite.go index 30d948224..035f2af77 100644 --- a/app/vmalert/remotewrite/remotewrite.go +++ b/app/vmalert/remotewrite/remotewrite.go @@ -246,13 +246,13 @@ func (c *Client) send(ctx context.Context, data []byte) error { resp, err := c.c.Do(req.WithContext(ctx)) if err != nil { return fmt.Errorf("error while sending request to %s: %w; Data len %d(%d)", - req.URL, err, len(data), r.Size()) + req.URL.Redacted(), err, len(data), r.Size()) } defer func() { _ = resp.Body.Close() }() if resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusOK { body, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf("unexpected response code %d for %s. Response body %q", - resp.StatusCode, req.URL, body) + resp.StatusCode, req.URL.Redacted(), body) } return nil } diff --git a/app/vmalert/web.go b/app/vmalert/web.go index ef31ce359..e1034dab7 100644 --- a/app/vmalert/web.go +++ b/app/vmalert/web.go @@ -28,13 +28,14 @@ func initLinks() { {path.Join(pathPrefix, "api/v1/groups"), "list all loaded groups and rules"}, {path.Join(pathPrefix, "api/v1/alerts"), "list all active alerts"}, {path.Join(pathPrefix, "api/v1/groupID/alertID/status"), "get alert status by ID"}, + {path.Join(pathPrefix, "flags"), "command-line flags"}, {path.Join(pathPrefix, "metrics"), "list of application metrics"}, {path.Join(pathPrefix, "-/reload"), "reload configuration"}, } navItems = []tpl.NavItem{ - {Name: "vmalert", Url: path.Join(pathPrefix, "/")}, + {Name: "vmalert", Url: pathPrefix}, {Name: "Groups", Url: path.Join(pathPrefix, "groups")}, - {Name: "Alerts", Url: path.Join(pathPrefix, "/alerts")}, + {Name: "Alerts", Url: path.Join(pathPrefix, "alerts")}, {Name: "Docs", Url: "https://docs.victoriametrics.com/vmalert.html"}, } } diff --git a/app/vmalert/web.qtpl b/app/vmalert/web.qtpl index 7c5c6b2b4..c15fa9de8 100644 --- a/app/vmalert/web.qtpl +++ b/app/vmalert/web.qtpl @@ -51,7 +51,7 @@
{%s g.Name %}{% if g.Type != "prometheus" %} ({%s g.Type %}){% endif %} (every {%s g.Interval %}) - {% if rNotOk[g.Name] > 0 %}{%d rNotOk[g.Name] %} {% endif %} + {% if rNotOk[g.Name] > 0 %}{%d rNotOk[g.Name] %} {% endif %} {%d rOk[g.Name] %}

{%s g.File %}

{% if len(g.ExtraFilterLabels) > 0 %} @@ -155,7 +155,9 @@ sort.Strings(labelKeys) %}
- alert: {%s defaultAR.Name %} ({%d len(alertsByRule[ruleID]) %})
+ alert: {%s defaultAR.Name %} ({%d len(alertsByRule[ruleID]) %}) + | Source +
expr:
{%s defaultAR.Expression %}
@@ -175,8 +177,11 @@ {%s k %}={%s ar.Labels[k] %} {% endfor %} - - + + - {% for _, ts := range js.targetsStatus %} + {% for j, ts := range js.targetsStatus %} {% if onlyUnhealthy && ts.up %}{% continue %}{% endif %} - @@ -116,9 +121,12 @@ job={%q= jobName %} (0/0 up) {% endfunc %} {% func formatLabel(labels []prompbmarshal.Label) %} -{% for _, label := range labels %} - {%s label.Name %}={%q label.Value %} {% space %} -{% endfor %} +{ + {% for i, label := range labels %} + {%s label.Name %}={%q label.Value %} + {% if i+1 < len(labels) %},{% space %}{% endif %} + {% endfor %} +} {% endfunc %} {% endstripspace %} diff --git a/lib/promscrape/targets_response.qtpl.go b/lib/promscrape/targets_response.qtpl.go index 334d1873f..0ee64550d 100644 --- a/lib/promscrape/targets_response.qtpl.go +++ b/lib/promscrape/targets_response.qtpl.go @@ -225,7 +225,7 @@ func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatus //line lib/promscrape/targets_response.qtpl:52 qw422016.N().S(`>Unhealthy`) //line lib/promscrape/targets_response.qtpl:56 - for _, js := range jts { + for i, js := range jts { //line lib/promscrape/targets_response.qtpl:57 if onlyUnhealthy && js.upCount == js.targetsTotal { //line lib/promscrape/targets_response.qtpl:57 @@ -247,7 +247,7 @@ func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatus //line lib/promscrape/targets_response.qtpl:60 qw422016.N().S(`up)
{%s ar.State %}{%s ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00") %}{%= badgeState(ar.State) %} + {%s ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00") %} + {% if ar.Restored %}{%= badgeRestored() %}{% endif %} + {%s ar.Value %} Details @@ -270,7 +275,31 @@ {%s alert.GroupID %} + +
+
+
+ Source link +
+
+ Link +
+
{%= tpl.Footer() %} +{% endfunc %} + +{% func badgeState(state string) %} +{%code + badgeClass := "bg-warning text-dark" + if state == "firing" { + badgeClass = "bg-danger" + } +%} +{%s state %} +{% endfunc %} + +{% func badgeRestored() %} +restored {% endfunc %} \ No newline at end of file diff --git a/app/vmalert/web.qtpl.go b/app/vmalert/web.qtpl.go index a15c6523f..be8372249 100644 --- a/app/vmalert/web.qtpl.go +++ b/app/vmalert/web.qtpl.go @@ -190,7 +190,7 @@ func StreamListGroups(qw422016 *qt422016.Writer, groups []APIGroup) { //line app/vmalert/web.qtpl:54 if rNotOk[g.Name] > 0 { //line app/vmalert/web.qtpl:54 - qw422016.N().S(``) + qw422016.N().S(``) //line app/vmalert/web.qtpl:54 qw422016.N().D(rNotOk[g.Name]) //line app/vmalert/web.qtpl:54 @@ -573,11 +573,17 @@ func StreamListAlerts(qw422016 *qt422016.Writer, groupAlerts []GroupAlerts) { //line app/vmalert/web.qtpl:158 qw422016.N().D(len(alertsByRule[ruleID])) //line app/vmalert/web.qtpl:158 - qw422016.N().S(`)
+ qw422016.N().S(`) + | Source +
expr:
`)
-//line app/vmalert/web.qtpl:159
+//line app/vmalert/web.qtpl:161
 				qw422016.E().S(defaultAR.Expression)
-//line app/vmalert/web.qtpl:159
+//line app/vmalert/web.qtpl:161
 				qw422016.N().S(`
@@ -591,152 +597,151 @@ func StreamListAlerts(qw422016 *qt422016.Writer, groupAlerts []GroupAlerts) { `) -//line app/vmalert/web.qtpl:171 +//line app/vmalert/web.qtpl:173 for _, ar := range alertsByRule[ruleID] { -//line app/vmalert/web.qtpl:171 +//line app/vmalert/web.qtpl:173 qw422016.N().S(` - - + + `) -//line app/vmalert/web.qtpl:185 +//line app/vmalert/web.qtpl:190 } -//line app/vmalert/web.qtpl:185 +//line app/vmalert/web.qtpl:190 qw422016.N().S(`
`) -//line app/vmalert/web.qtpl:174 +//line app/vmalert/web.qtpl:176 for _, k := range labelKeys { -//line app/vmalert/web.qtpl:174 +//line app/vmalert/web.qtpl:176 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:175 +//line app/vmalert/web.qtpl:177 qw422016.E().S(k) -//line app/vmalert/web.qtpl:175 +//line app/vmalert/web.qtpl:177 qw422016.N().S(`=`) -//line app/vmalert/web.qtpl:175 +//line app/vmalert/web.qtpl:177 qw422016.E().S(ar.Labels[k]) -//line app/vmalert/web.qtpl:175 +//line app/vmalert/web.qtpl:177 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:176 +//line app/vmalert/web.qtpl:178 } -//line app/vmalert/web.qtpl:176 +//line app/vmalert/web.qtpl:178 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:178 - qw422016.E().S(ar.State) -//line app/vmalert/web.qtpl:178 - qw422016.N().S(``) -//line app/vmalert/web.qtpl:179 - qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00")) -//line app/vmalert/web.qtpl:179 - qw422016.N().S(` `) //line app/vmalert/web.qtpl:180 - qw422016.E().S(ar.Value) + streambadgeState(qw422016, ar.State) //line app/vmalert/web.qtpl:180 qw422016.N().S(` + `) +//line app/vmalert/web.qtpl:182 + qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00")) +//line app/vmalert/web.qtpl:182 + qw422016.N().S(` + `) +//line app/vmalert/web.qtpl:183 + if ar.Restored { +//line app/vmalert/web.qtpl:183 + streambadgeRestored(qw422016) +//line app/vmalert/web.qtpl:183 + } +//line app/vmalert/web.qtpl:183 + qw422016.N().S(` + `) +//line app/vmalert/web.qtpl:185 + qw422016.E().S(ar.Value) +//line app/vmalert/web.qtpl:185 + qw422016.N().S(` Details
`) -//line app/vmalert/web.qtpl:188 +//line app/vmalert/web.qtpl:193 } -//line app/vmalert/web.qtpl:188 +//line app/vmalert/web.qtpl:193 qw422016.N().S(`
`) -//line app/vmalert/web.qtpl:191 +//line app/vmalert/web.qtpl:196 } -//line app/vmalert/web.qtpl:191 +//line app/vmalert/web.qtpl:196 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:193 +//line app/vmalert/web.qtpl:198 } else { -//line app/vmalert/web.qtpl:193 +//line app/vmalert/web.qtpl:198 qw422016.N().S(`

No items...

`) -//line app/vmalert/web.qtpl:197 +//line app/vmalert/web.qtpl:202 } -//line app/vmalert/web.qtpl:197 +//line app/vmalert/web.qtpl:202 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:199 +//line app/vmalert/web.qtpl:204 tpl.StreamFooter(qw422016) -//line app/vmalert/web.qtpl:199 +//line app/vmalert/web.qtpl:204 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:201 -} - -//line app/vmalert/web.qtpl:201 -func WriteListAlerts(qq422016 qtio422016.Writer, groupAlerts []GroupAlerts) { -//line app/vmalert/web.qtpl:201 - qw422016 := qt422016.AcquireWriter(qq422016) -//line app/vmalert/web.qtpl:201 - StreamListAlerts(qw422016, groupAlerts) -//line app/vmalert/web.qtpl:201 - qt422016.ReleaseWriter(qw422016) -//line app/vmalert/web.qtpl:201 -} - -//line app/vmalert/web.qtpl:201 -func ListAlerts(groupAlerts []GroupAlerts) string { -//line app/vmalert/web.qtpl:201 - qb422016 := qt422016.AcquireByteBuffer() -//line app/vmalert/web.qtpl:201 - WriteListAlerts(qb422016, groupAlerts) -//line app/vmalert/web.qtpl:201 - qs422016 := string(qb422016.B) -//line app/vmalert/web.qtpl:201 - qt422016.ReleaseByteBuffer(qb422016) -//line app/vmalert/web.qtpl:201 - return qs422016 -//line app/vmalert/web.qtpl:201 -} - -//line app/vmalert/web.qtpl:203 -func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) { -//line app/vmalert/web.qtpl:203 - qw422016.N().S(` - `) -//line app/vmalert/web.qtpl:204 - tpl.StreamHeader(qw422016, "", navItems) -//line app/vmalert/web.qtpl:204 - qw422016.N().S(` - `) //line app/vmalert/web.qtpl:206 +} + +//line app/vmalert/web.qtpl:206 +func WriteListAlerts(qq422016 qtio422016.Writer, groupAlerts []GroupAlerts) { +//line app/vmalert/web.qtpl:206 + qw422016 := qt422016.AcquireWriter(qq422016) +//line app/vmalert/web.qtpl:206 + StreamListAlerts(qw422016, groupAlerts) +//line app/vmalert/web.qtpl:206 + qt422016.ReleaseWriter(qw422016) +//line app/vmalert/web.qtpl:206 +} + +//line app/vmalert/web.qtpl:206 +func ListAlerts(groupAlerts []GroupAlerts) string { +//line app/vmalert/web.qtpl:206 + qb422016 := qt422016.AcquireByteBuffer() +//line app/vmalert/web.qtpl:206 + WriteListAlerts(qb422016, groupAlerts) +//line app/vmalert/web.qtpl:206 + qs422016 := string(qb422016.B) +//line app/vmalert/web.qtpl:206 + qt422016.ReleaseByteBuffer(qb422016) +//line app/vmalert/web.qtpl:206 + return qs422016 +//line app/vmalert/web.qtpl:206 +} + +//line app/vmalert/web.qtpl:208 +func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) { +//line app/vmalert/web.qtpl:208 + qw422016.N().S(` + `) +//line app/vmalert/web.qtpl:209 + tpl.StreamHeader(qw422016, "", navItems) +//line app/vmalert/web.qtpl:209 + qw422016.N().S(` + `) +//line app/vmalert/web.qtpl:211 var labelKeys []string for k := range alert.Labels { labelKeys = append(labelKeys, k) @@ -749,28 +754,28 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) { } sort.Strings(annotationKeys) -//line app/vmalert/web.qtpl:217 +//line app/vmalert/web.qtpl:222 qw422016.N().S(`
`) -//line app/vmalert/web.qtpl:218 +//line app/vmalert/web.qtpl:223 qw422016.E().S(alert.Name) -//line app/vmalert/web.qtpl:218 +//line app/vmalert/web.qtpl:223 qw422016.N().S(``) -//line app/vmalert/web.qtpl:218 +//line app/vmalert/web.qtpl:223 qw422016.E().S(alert.State) -//line app/vmalert/web.qtpl:218 +//line app/vmalert/web.qtpl:223 qw422016.N().S(`
@@ -779,9 +784,9 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) {
`) -//line app/vmalert/web.qtpl:225 +//line app/vmalert/web.qtpl:230 qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00")) -//line app/vmalert/web.qtpl:225 +//line app/vmalert/web.qtpl:230 qw422016.N().S(`
@@ -793,9 +798,9 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) {
`)
-//line app/vmalert/web.qtpl:235
+//line app/vmalert/web.qtpl:240
 	qw422016.E().S(alert.Expression)
-//line app/vmalert/web.qtpl:235
+//line app/vmalert/web.qtpl:240
 	qw422016.N().S(`
@@ -807,23 +812,23 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) {
`) -//line app/vmalert/web.qtpl:245 +//line app/vmalert/web.qtpl:250 for _, k := range labelKeys { -//line app/vmalert/web.qtpl:245 +//line app/vmalert/web.qtpl:250 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:246 +//line app/vmalert/web.qtpl:251 qw422016.E().S(k) -//line app/vmalert/web.qtpl:246 +//line app/vmalert/web.qtpl:251 qw422016.N().S(`=`) -//line app/vmalert/web.qtpl:246 +//line app/vmalert/web.qtpl:251 qw422016.E().S(alert.Labels[k]) -//line app/vmalert/web.qtpl:246 +//line app/vmalert/web.qtpl:251 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:247 +//line app/vmalert/web.qtpl:252 } -//line app/vmalert/web.qtpl:247 +//line app/vmalert/web.qtpl:252 qw422016.N().S(`
@@ -835,24 +840,24 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) {
`) -//line app/vmalert/web.qtpl:257 +//line app/vmalert/web.qtpl:262 for _, k := range annotationKeys { -//line app/vmalert/web.qtpl:257 +//line app/vmalert/web.qtpl:262 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:258 +//line app/vmalert/web.qtpl:263 qw422016.E().S(k) -//line app/vmalert/web.qtpl:258 +//line app/vmalert/web.qtpl:263 qw422016.N().S(`:

`) -//line app/vmalert/web.qtpl:259 +//line app/vmalert/web.qtpl:264 qw422016.E().S(alert.Annotations[k]) -//line app/vmalert/web.qtpl:259 +//line app/vmalert/web.qtpl:264 qw422016.N().S(`

`) -//line app/vmalert/web.qtpl:260 +//line app/vmalert/web.qtpl:265 } -//line app/vmalert/web.qtpl:260 +//line app/vmalert/web.qtpl:265 qw422016.N().S(`
@@ -864,49 +869,150 @@ func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) { + +
+
+
+ Source link +
+
+ Link +
+
`) -//line app/vmalert/web.qtpl:274 +//line app/vmalert/web.qtpl:289 tpl.StreamFooter(qw422016) -//line app/vmalert/web.qtpl:274 +//line app/vmalert/web.qtpl:289 qw422016.N().S(` `) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 } -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 func WriteAlert(qq422016 qtio422016.Writer, alert *APIAlert) { -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 qw422016 := qt422016.AcquireWriter(qq422016) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 StreamAlert(qw422016, alert) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 qt422016.ReleaseWriter(qw422016) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 } -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 func Alert(alert *APIAlert) string { -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 qb422016 := qt422016.AcquireByteBuffer() -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 WriteAlert(qb422016, alert) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 qs422016 := string(qb422016.B) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 qt422016.ReleaseByteBuffer(qb422016) -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 return qs422016 -//line app/vmalert/web.qtpl:276 +//line app/vmalert/web.qtpl:291 +} + +//line app/vmalert/web.qtpl:293 +func streambadgeState(qw422016 *qt422016.Writer, state string) { +//line app/vmalert/web.qtpl:293 + qw422016.N().S(` +`) +//line app/vmalert/web.qtpl:295 + badgeClass := "bg-warning text-dark" + if state == "firing" { + badgeClass = "bg-danger" + } + +//line app/vmalert/web.qtpl:299 + qw422016.N().S(` +`) +//line app/vmalert/web.qtpl:300 + qw422016.E().S(state) +//line app/vmalert/web.qtpl:300 + qw422016.N().S(` +`) +//line app/vmalert/web.qtpl:301 +} + +//line app/vmalert/web.qtpl:301 +func writebadgeState(qq422016 qtio422016.Writer, state string) { +//line app/vmalert/web.qtpl:301 + qw422016 := qt422016.AcquireWriter(qq422016) +//line app/vmalert/web.qtpl:301 + streambadgeState(qw422016, state) +//line app/vmalert/web.qtpl:301 + qt422016.ReleaseWriter(qw422016) +//line app/vmalert/web.qtpl:301 +} + +//line app/vmalert/web.qtpl:301 +func badgeState(state string) string { +//line app/vmalert/web.qtpl:301 + qb422016 := qt422016.AcquireByteBuffer() +//line app/vmalert/web.qtpl:301 + writebadgeState(qb422016, state) +//line app/vmalert/web.qtpl:301 + qs422016 := string(qb422016.B) +//line app/vmalert/web.qtpl:301 + qt422016.ReleaseByteBuffer(qb422016) +//line app/vmalert/web.qtpl:301 + return qs422016 +//line app/vmalert/web.qtpl:301 +} + +//line app/vmalert/web.qtpl:303 +func streambadgeRestored(qw422016 *qt422016.Writer) { +//line app/vmalert/web.qtpl:303 + qw422016.N().S(` +restored +`) +//line app/vmalert/web.qtpl:305 +} + +//line app/vmalert/web.qtpl:305 +func writebadgeRestored(qq422016 qtio422016.Writer) { +//line app/vmalert/web.qtpl:305 + qw422016 := qt422016.AcquireWriter(qq422016) +//line app/vmalert/web.qtpl:305 + streambadgeRestored(qw422016) +//line app/vmalert/web.qtpl:305 + qt422016.ReleaseWriter(qw422016) +//line app/vmalert/web.qtpl:305 +} + +//line app/vmalert/web.qtpl:305 +func badgeRestored() string { +//line app/vmalert/web.qtpl:305 + qb422016 := qt422016.AcquireByteBuffer() +//line app/vmalert/web.qtpl:305 + writebadgeRestored(qb422016) +//line app/vmalert/web.qtpl:305 + qs422016 := string(qb422016.B) +//line app/vmalert/web.qtpl:305 + qt422016.ReleaseByteBuffer(qb422016) +//line app/vmalert/web.qtpl:305 + return qs422016 +//line app/vmalert/web.qtpl:305 } diff --git a/app/vmalert/web_types.go b/app/vmalert/web_types.go index 5a4f25362..cb13fb23f 100644 --- a/app/vmalert/web_types.go +++ b/app/vmalert/web_types.go @@ -17,6 +17,8 @@ type APIAlert struct { Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` ActiveAt time.Time `json:"activeAt"` + SourceLink string `json:"source"` + Restored bool `json:"restored"` } // APIGroup represents Group for WEB view diff --git a/app/vmauth/README.md b/app/vmauth/README.md index 574dee7b4..8478575cb 100644 --- a/app/vmauth/README.md +++ b/app/vmauth/README.md @@ -37,9 +37,8 @@ Each `url_prefix` in the [-auth.config](#auth-config) may contain either a singl `-auth.config` is represented in the following simple `yml` format: ```yml - # Arbitrary number of usernames may be put here. -# Usernames must be unique. +# Username and bearer_token values must be unique. users: # Requests with the 'Authorization: Bearer XXXX' header are proxied to http://localhost:8428 . @@ -47,6 +46,14 @@ users: - bearer_token: "XXXX" url_prefix: "http://localhost:8428" + # Requests with the 'Authorization: Bearer YYY' header are proxied to http://localhost:8428 , + # The `X-Scope-OrgID: foobar` http header is added to every proxied request. + # For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query +- bearer_token: "YYY" + url_prefix: "http://localhost:8428" + headers: + - "X-Scope-OrgID: foobar" + # The user for querying local single-node VictoriaMetrics. # All the requests to http://vmauth:8427 with the given Basic Auth (username:password) # will be proxied to http://localhost:8428 . @@ -89,7 +96,6 @@ users: - "http://vminsert1:8480/insert/42/prometheus" - "http://vminsert2:8480/insert/42/prometheus" - # A single user for querying and inserting data: # - Requests to http://vmauth:8427/api/v1/query, http://vmauth:8427/api/v1/query_range # and http://vmauth:8427/api/v1/label//values are proxied to the following urls in a round-robin manner: @@ -97,7 +103,8 @@ users: # - http://vmselect2:8481/select/42/prometheus # For example, http://vmauth:8427/api/v1/query is proxied to http://vmselect1:8480/select/42/prometheus/api/v1/query # or to http://vmselect2:8480/select/42/prometheus/api/v1/query . - # - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write + # - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write . + # The "X-Scope-OrgID: abc" http header is added to these requests. - username: "foobar" url_map: - src_paths: @@ -109,7 +116,8 @@ users: - "http://vmselect2:8481/select/42/prometheus" - src_paths: ["/api/v1/write"] url_prefix: "http://vminsert:8480/insert/42/prometheus" -``` + headers: + - "X-Scope-OrgID: abc"``` The config may contain `%{ENV_VAR}` placeholders, which are substituted by the corresponding `ENV_VAR` environment variable values. This may be useful for passing secrets to the config. diff --git a/app/vmauth/auth_config.go b/app/vmauth/auth_config.go index d368bb766..3deb8a67c 100644 --- a/app/vmauth/auth_config.go +++ b/app/vmauth/auth_config.go @@ -27,24 +27,53 @@ var ( // AuthConfig represents auth config. type AuthConfig struct { - Users []UserInfo `yaml:"users"` + Users []UserInfo `yaml:"users,omitempty"` } // UserInfo is user information read from authConfigPath type UserInfo struct { - BearerToken string `yaml:"bearer_token"` - Username string `yaml:"username"` - Password string `yaml:"password"` - URLPrefix *URLPrefix `yaml:"url_prefix"` - URLMap []URLMap `yaml:"url_map"` + BearerToken string `yaml:"bearer_token,omitempty"` + Username string `yaml:"username,omitempty"` + Password string `yaml:"password,omitempty"` + URLPrefix *URLPrefix `yaml:"url_prefix,omitempty"` + URLMap []URLMap `yaml:"url_map,omitempty"` + Headers []Header `yaml:"headers,omitempty"` requests *metrics.Counter } +// Header is `Name: Value` http header, which must be added to the proxied request. +type Header struct { + Name string + Value string +} + +// UnmarshalYAML unmarshals h from f. +func (h *Header) UnmarshalYAML(f func(interface{}) error) error { + var s string + if err := f(&s); err != nil { + return err + } + n := strings.IndexByte(s, ':') + if n < 0 { + return fmt.Errorf("missing speparator char ':' between Name and Value in the header %q; expected format - 'Name: Value'", s) + } + h.Name = strings.TrimSpace(s[:n]) + h.Value = strings.TrimSpace(s[n+1:]) + return nil +} + +// MarshalYAML marshals h to yaml. +func (h *Header) MarshalYAML() (interface{}, error) { + s := fmt.Sprintf("%s: %s", h.Name, h.Value) + return s, nil +} + // URLMap is a mapping from source paths to target urls. type URLMap struct { - SrcPaths []*SrcPath `yaml:"src_paths"` - URLPrefix *URLPrefix `yaml:"url_prefix"` + SrcPaths []*SrcPath `yaml:"src_paths,omitempty"` + URLPrefix *URLPrefix `yaml:"url_prefix,omitempty"` + Headers []Header `yaml:"headers,omitempty"` } // SrcPath represents an src path diff --git a/app/vmauth/auth_config_test.go b/app/vmauth/auth_config_test.go index 1b6ad3d4a..f1221e4ff 100644 --- a/app/vmauth/auth_config_test.go +++ b/app/vmauth/auth_config_test.go @@ -69,6 +69,14 @@ users: - [foo] `) + // Invalid headers + f(` +users: +- username: foo + url_prefix: http://foo.bar + headers: foobar +`) + // empty url_prefix f(` users: @@ -156,6 +164,27 @@ users: - src_paths: ['fo[obar'] url_prefix: http://foobar `) + + // Invalid headers in url_map (missing ':') + f(` +users: +- username: a + url_map: + - src_paths: ['/foobar'] + url_prefix: http://foobar + headers: + - foobar +`) + // Invalid headers in url_map (dictionary instead of array) + f(` +users: +- username: a + url_map: + - src_paths: ['/foobar'] + url_prefix: http://foobar + headers: + aaa: bbb +`) } func TestParseAuthConfigSuccess(t *testing.T) { @@ -231,6 +260,9 @@ users: url_prefix: http://vmselect/select/0/prometheus - src_paths: ["/api/v1/write"] url_prefix: ["http://vminsert1/insert/0/prometheus","http://vminsert2/insert/0/prometheus"] + headers: + - "foo: bar" + - "xxx: y" `, map[string]*UserInfo{ getAuthToken("foo", "", ""): { BearerToken: "foo", @@ -245,6 +277,16 @@ users: "http://vminsert1/insert/0/prometheus", "http://vminsert2/insert/0/prometheus", }), + Headers: []Header{ + { + Name: "foo", + Value: "bar", + }, + { + Name: "xxx", + Value: "y", + }, + }, }, }, }, diff --git a/app/vmauth/example_config.yml b/app/vmauth/example_config.yml index 01e497dfc..e8b91e231 100644 --- a/app/vmauth/example_config.yml +++ b/app/vmauth/example_config.yml @@ -1,5 +1,5 @@ # Arbitrary number of usernames may be put here. -# Usernames must be unique. +# Username and bearer_token values must be unique. users: # Requests with the 'Authorization: Bearer XXXX' header are proxied to http://localhost:8428 . @@ -7,6 +7,14 @@ users: - bearer_token: "XXXX" url_prefix: "http://localhost:8428" + # Requests with the 'Authorization: Bearer YYY' header are proxied to http://localhost:8428 , + # The `X-Scope-OrgID: foobar` http header is added to every proxied request. + # For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query +- bearer_token: "YYY" + url_prefix: "http://localhost:8428" + headers: + - "X-Scope-OrgID: foobar" + # The user for querying local single-node VictoriaMetrics. # All the requests to http://vmauth:8427 with the given Basic Auth (username:password) # will be proxied to http://localhost:8428 . @@ -49,7 +57,6 @@ users: - "http://vminsert1:8480/insert/42/prometheus" - "http://vminsert2:8480/insert/42/prometheus" - # A single user for querying and inserting data: # - Requests to http://vmauth:8427/api/v1/query, http://vmauth:8427/api/v1/query_range # and http://vmauth:8427/api/v1/label//values are proxied to the following urls in a round-robin manner: @@ -57,7 +64,8 @@ users: # - http://vmselect2:8481/select/42/prometheus # For example, http://vmauth:8427/api/v1/query is proxied to http://vmselect1:8480/select/42/prometheus/api/v1/query # or to http://vmselect2:8480/select/42/prometheus/api/v1/query . - # - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write + # - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write . + # The "X-Scope-OrgID: abc" http header is added to these requests. - username: "foobar" url_map: - src_paths: @@ -69,3 +77,5 @@ users: - "http://vmselect2:8481/select/42/prometheus" - src_paths: ["/api/v1/write"] url_prefix: "http://vminsert:8480/insert/42/prometheus" + headers: + - "X-Scope-OrgID: abc" diff --git a/app/vmauth/main.go b/app/vmauth/main.go index e1b282bec..c4f0154f3 100644 --- a/app/vmauth/main.go +++ b/app/vmauth/main.go @@ -23,7 +23,7 @@ var ( maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host") reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...") logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+ - `Such requests are always counted at vmagent_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`) + `Such requests are always counted at vmauth_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`) ) func main() { @@ -84,12 +84,15 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { return true } ui.requests.Inc() - targetURL, err := createTargetURL(ui, r.URL) + targetURL, headers, err := createTargetURL(ui, r.URL) if err != nil { httpserver.Errorf(w, r, "cannot determine targetURL: %s", err) return true } r.Header.Set("vm-target-url", targetURL.String()) + for _, h := range headers { + r.Header.Set(h.Name, h.Value) + } proxyRequest(w, r) return true } @@ -109,9 +112,9 @@ func proxyRequest(w http.ResponseWriter, r *http.Request) { } var ( - configReloadRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/-/reload"}`) - invalidAuthTokenRequests = metrics.NewCounter(`vmagent_http_request_errors_total{reason="invalid_auth_token"}`) - missingRouteRequests = metrics.NewCounter(`vmagent_http_request_errors_total{reason="missing_route"}`) + configReloadRequests = metrics.NewCounter(`vmauth_http_requests_total{path="/-/reload"}`) + invalidAuthTokenRequests = metrics.NewCounter(`vmauth_http_request_errors_total{reason="invalid_auth_token"}`) + missingRouteRequests = metrics.NewCounter(`vmauth_http_request_errors_total{reason="missing_route"}`) ) var reverseProxy = &httputil.ReverseProxy{ @@ -130,6 +133,9 @@ var reverseProxy = &httputil.ReverseProxy{ // Disable HTTP/2.0, since VictoriaMetrics components don't support HTTP/2.0 (because there is no sense in this). tr.ForceAttemptHTTP2 = false tr.MaxIdleConnsPerHost = *maxIdleConnsPerBackend + if tr.MaxIdleConns != 0 && tr.MaxIdleConns < tr.MaxIdleConnsPerHost { + tr.MaxIdleConns = tr.MaxIdleConnsPerHost + } return tr }(), FlushInterval: time.Second, diff --git a/app/vmauth/target_url.go b/app/vmauth/target_url.go index cffadba9d..be5134b9c 100644 --- a/app/vmauth/target_url.go +++ b/app/vmauth/target_url.go @@ -35,7 +35,7 @@ func mergeURLs(uiURL, requestURI *url.URL) *url.URL { return &targetURL } -func createTargetURL(ui *UserInfo, uOrig *url.URL) (*url.URL, error) { +func createTargetURL(ui *UserInfo, uOrig *url.URL) (*url.URL, []Header, error) { u := *uOrig // Prevent from attacks with using `..` in r.URL.Path u.Path = path.Clean(u.Path) @@ -46,13 +46,13 @@ func createTargetURL(ui *UserInfo, uOrig *url.URL) (*url.URL, error) { for _, e := range ui.URLMap { for _, sp := range e.SrcPaths { if sp.match(u.Path) { - return e.URLPrefix.mergeURLs(&u), nil + return e.URLPrefix.mergeURLs(&u), e.Headers, nil } } } if ui.URLPrefix != nil { - return ui.URLPrefix.mergeURLs(&u), nil + return ui.URLPrefix.mergeURLs(&u), ui.Headers, nil } missingRouteRequests.Inc() - return nil, fmt.Errorf("missing route for %q", u.String()) + return nil, nil, fmt.Errorf("missing route for %q", u.String()) } diff --git a/app/vmauth/target_url_test.go b/app/vmauth/target_url_test.go index e037bd783..84c9e681b 100644 --- a/app/vmauth/target_url_test.go +++ b/app/vmauth/target_url_test.go @@ -1,47 +1,56 @@ package main import ( + "fmt" "net/url" "testing" ) func TestCreateTargetURLSuccess(t *testing.T) { - f := func(ui *UserInfo, requestURI, expectedTarget string) { + f := func(ui *UserInfo, requestURI, expectedTarget, expectedHeaders string) { t.Helper() u, err := url.Parse(requestURI) if err != nil { t.Fatalf("cannot parse %q: %s", requestURI, err) } - target, err := createTargetURL(ui, u) + target, headers, err := createTargetURL(ui, u) if err != nil { t.Fatalf("unexpected error: %s", err) } if target.String() != expectedTarget { t.Fatalf("unexpected target; got %q; want %q", target, expectedTarget) } + headersStr := fmt.Sprintf("%q", headers) + if headersStr != expectedHeaders { + t.Fatalf("unexpected headers; got %s; want %s", headersStr, expectedHeaders) + } } // Simple routing with `url_prefix` f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar"), - }, "", "http://foo.bar/.") + }, "", "http://foo.bar/.", "[]") f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar"), - }, "/", "http://foo.bar") + Headers: []Header{{ + Name: "bb", + Value: "aaa", + }}, + }, "/", "http://foo.bar", `[{"bb" "aaa"}]`) f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar/federate"), - }, "/", "http://foo.bar/federate") + }, "/", "http://foo.bar/federate", "[]") f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar"), - }, "a/b?c=d", "http://foo.bar/a/b?c=d") + }, "a/b?c=d", "http://foo.bar/a/b?c=d", "[]") f(&UserInfo{ URLPrefix: mustParseURL("https://sss:3894/x/y"), - }, "/z", "https://sss:3894/x/y/z") + }, "/z", "https://sss:3894/x/y/z", "[]") f(&UserInfo{ URLPrefix: mustParseURL("https://sss:3894/x/y"), - }, "/../../aaa", "https://sss:3894/x/y/aaa") + }, "/../../aaa", "https://sss:3894/x/y/aaa", "[]") f(&UserInfo{ URLPrefix: mustParseURL("https://sss:3894/x/y"), - }, "/./asd/../../aaa?a=d&s=s/../d", "https://sss:3894/x/y/aaa?a=d&s=s%2F..%2Fd") + }, "/./asd/../../aaa?a=d&s=s/../d", "https://sss:3894/x/y/aaa?a=d&s=s%2F..%2Fd", "[]") // Complex routing with `url_map` ui := &UserInfo{ @@ -49,6 +58,16 @@ func TestCreateTargetURLSuccess(t *testing.T) { { SrcPaths: getSrcPaths([]string{"/api/v1/query"}), URLPrefix: mustParseURL("http://vmselect/0/prometheus"), + Headers: []Header{ + { + Name: "xx", + Value: "aa", + }, + { + Name: "yy", + Value: "asdf", + }, + }, }, { SrcPaths: getSrcPaths([]string{"/api/v1/write"}), @@ -56,10 +75,14 @@ func TestCreateTargetURLSuccess(t *testing.T) { }, }, URLPrefix: mustParseURL("http://default-server"), + Headers: []Header{{ + Name: "bb", + Value: "aaa", + }}, } - f(ui, "/api/v1/query?query=up", "http://vmselect/0/prometheus/api/v1/query?query=up") - f(ui, "/api/v1/write", "http://vminsert/0/prometheus/api/v1/write") - f(ui, "/api/v1/query_range", "http://default-server/api/v1/query_range") + f(ui, "/api/v1/query?query=up", "http://vmselect/0/prometheus/api/v1/query?query=up", `[{"xx" "aa"} {"yy" "asdf"}]`) + f(ui, "/api/v1/write", "http://vminsert/0/prometheus/api/v1/write", "[]") + f(ui, "/api/v1/query_range", "http://default-server/api/v1/query_range", `[{"bb" "aaa"}]`) // Complex routing regexp paths in `url_map` ui = &UserInfo{ @@ -75,17 +98,17 @@ func TestCreateTargetURLSuccess(t *testing.T) { }, URLPrefix: mustParseURL("http://default-server"), } - f(ui, "/api/v1/query?query=up", "http://vmselect/0/prometheus/api/v1/query?query=up") - f(ui, "/api/v1/query_range?query=up", "http://vmselect/0/prometheus/api/v1/query_range?query=up") - f(ui, "/api/v1/label/foo/values", "http://vmselect/0/prometheus/api/v1/label/foo/values") - f(ui, "/api/v1/write", "http://vminsert/0/prometheus/api/v1/write") - f(ui, "/api/v1/foo/bar", "http://default-server/api/v1/foo/bar") + f(ui, "/api/v1/query?query=up", "http://vmselect/0/prometheus/api/v1/query?query=up", "[]") + f(ui, "/api/v1/query_range?query=up", "http://vmselect/0/prometheus/api/v1/query_range?query=up", "[]") + f(ui, "/api/v1/label/foo/values", "http://vmselect/0/prometheus/api/v1/label/foo/values", "[]") + f(ui, "/api/v1/write", "http://vminsert/0/prometheus/api/v1/write", "[]") + f(ui, "/api/v1/foo/bar", "http://default-server/api/v1/foo/bar", "[]") f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar?extra_label=team=dev"), - }, "/api/v1/query", "http://foo.bar/api/v1/query?extra_label=team=dev") + }, "/api/v1/query", "http://foo.bar/api/v1/query?extra_label=team=dev", "[]") f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar?extra_label=team=mobile"), - }, "/api/v1/query?extra_label=team=dev", "http://foo.bar/api/v1/query?extra_label=team%3Dmobile") + }, "/api/v1/query?extra_label=team=dev", "http://foo.bar/api/v1/query?extra_label=team%3Dmobile", "[]") } @@ -96,13 +119,16 @@ func TestCreateTargetURLFailure(t *testing.T) { if err != nil { t.Fatalf("cannot parse %q: %s", requestURI, err) } - target, err := createTargetURL(ui, u) + target, headers, err := createTargetURL(ui, u) if err == nil { t.Fatalf("expecting non-nil error") } if target != nil { t.Fatalf("unexpected target=%q; want empty string", target) } + if headers != nil { + t.Fatalf("unexpected headers=%q; want empty string", headers) + } } f(&UserInfo{}, "/foo/bar") f(&UserInfo{ diff --git a/app/vmctl/influx/parser.go b/app/vmctl/influx/parser.go index e8b425f42..a4b7ab7d6 100644 --- a/app/vmctl/influx/parser.go +++ b/app/vmctl/influx/parser.go @@ -58,6 +58,11 @@ func toFloat64(v interface{}) (float64, error) { return float64(i), nil case string: return strconv.ParseFloat(i, 64) + case bool: + if i { + return 1, nil + } + return 0, nil default: return 0, fmt.Errorf("unexpected value type %v", i) } diff --git a/app/vmctl/influx/parser_test.go b/app/vmctl/influx/parser_test.go index 15ce9adaa..70ee424bb 100644 --- a/app/vmctl/influx/parser_test.go +++ b/app/vmctl/influx/parser_test.go @@ -1,6 +1,7 @@ package influx import ( + "encoding/json" "reflect" "testing" ) @@ -58,3 +59,28 @@ func TestSeries_Unmarshal(t *testing.T) { } } } + +func TestToFloat64(t *testing.T) { + f := func(in interface{}, want float64) { + t.Helper() + got, err := toFloat64(in) + if err != nil { + t.Fatalf("unexpected err: %s", err) + } + if got != want { + t.Errorf("got %v; want %v", got, want) + } + } + f("123.4", 123.4) + f(float64(123.4), 123.4) + f(float32(12), 12) + f(123, 123) + f(true, 1) + f(false, 0) + f(json.Number("123456.789"), 123456.789) + + _, err := toFloat64("text") + if err == nil { + t.Fatalf("expected to get err; got nil instead") + } +} diff --git a/app/vminsert/main.go b/app/vminsert/main.go index dabe0ecea..d85187908 100644 --- a/app/vminsert/main.go +++ b/app/vminsert/main.go @@ -196,6 +196,11 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool { state := r.FormValue("state") promscrape.WriteAPIV1Targets(w, state) return true + case "/prometheus/config", "/config": + promscrapeConfigRequests.Inc() + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + promscrape.WriteConfigData(w) + return true case "/prometheus/-/reload", "/-/reload": promscrapeConfigReloadRequests.Inc() procutil.SelfSIGHUP() @@ -250,6 +255,8 @@ var ( promscrapeTargetsRequests = metrics.NewCounter(`vm_http_requests_total{path="/targets"}`) promscrapeAPIV1TargetsRequests = metrics.NewCounter(`vm_http_requests_total{path="/api/v1/targets"}`) + promscrapeConfigRequests = metrics.NewCounter(`vm_http_requests_total{path="/config"}`) + promscrapeConfigReloadRequests = metrics.NewCounter(`vm_http_requests_total{path="/-/reload"}`) _ = metrics.NewGauge(`vm_metrics_with_dropped_labels_total`, func() float64 { diff --git a/app/vmselect/promql/aggr.go b/app/vmselect/promql/aggr.go index 458061959..ba71ea0d6 100644 --- a/app/vmselect/promql/aggr.go +++ b/app/vmselect/promql/aggr.go @@ -11,6 +11,7 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage" "github.com/VictoriaMetrics/metrics" "github.com/VictoriaMetrics/metricsql" + xxhash "github.com/cespare/xxhash/v2" ) var aggrFuncs = map[string]aggrFunc{ @@ -1010,6 +1011,28 @@ func aggrFuncLimitK(afa *aggrFuncArg) ([]*timeseries, error) { } } afe := func(tss []*timeseries, modifier *metricsql.ModifierExpr) []*timeseries { + // Sort series by metricName in order to get consistent set of output series + // across multiple calls to limitk() function. + // Sort series by hash in order to guarantee uniform selection across series. + type hashSeries struct { + h uint64 + ts *timeseries + } + hss := make([]hashSeries, len(tss)) + d := xxhash.New() + for i, ts := range tss { + h := getHash(d, &ts.MetricName) + hss[i] = hashSeries{ + h: h, + ts: ts, + } + } + sort.Slice(hss, func(i, j int) bool { + return hss[i].h < hss[j].h + }) + for i, hs := range hss { + tss[i] = hs.ts + } if len(tss) > maxK { tss = tss[:maxK] } @@ -1027,6 +1050,17 @@ func aggrFuncLimitK(afa *aggrFuncArg) ([]*timeseries, error) { return aggrFuncExt(afe, args[1], &afa.ae.Modifier, afa.ae.Limit, true) } +func getHash(d *xxhash.Digest, mn *storage.MetricName) uint64 { + d.Reset() + _, _ = d.Write(mn.MetricGroup) + for _, tag := range mn.Tags { + _, _ = d.Write(tag.Key) + _, _ = d.Write(tag.Value) + } + return d.Sum64() + +} + func aggrFuncQuantiles(afa *aggrFuncArg) ([]*timeseries, error) { args := afa.args if len(args) < 3 { diff --git a/app/vmselect/promql/binary_op.go b/app/vmselect/promql/binary_op.go index 48b682cfe..b720573d5 100644 --- a/app/vmselect/promql/binary_op.go +++ b/app/vmselect/promql/binary_op.go @@ -19,6 +19,9 @@ var binaryOpFuncs = map[string]binaryOpFunc{ "%": newBinaryOpArithFunc(binaryop.Mod), "^": newBinaryOpArithFunc(binaryop.Pow), + // See https://github.com/prometheus/prometheus/pull/9248 + "atan2": newBinaryOpArithFunc(binaryop.Atan2), + // cmp ops "==": newBinaryOpCmpFunc(binaryop.Eq), "!=": newBinaryOpCmpFunc(binaryop.Neq), diff --git a/app/vmselect/promql/exec_test.go b/app/vmselect/promql/exec_test.go index f335e3e07..1c033b926 100644 --- a/app/vmselect/promql/exec_test.go +++ b/app/vmselect/promql/exec_test.go @@ -1039,6 +1039,17 @@ func TestExecSuccess(t *testing.T) { resultExpected := []netstorage.Result{r} f(q, resultExpected) }) + t.Run("sinh()", func(t *testing.T) { + t.Parallel() + q := `sinh(pi()*(2000-time())/1000)` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{11.548739357257748, 6.132140673514712, 3.217113080357038, 1.6144880404748523, 0.6704839982471175, 0}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) t.Run("asin()", func(t *testing.T) { t.Parallel() q := `asin((2000-time())/1000)` @@ -1050,6 +1061,50 @@ func TestExecSuccess(t *testing.T) { resultExpected := []netstorage.Result{r} f(q, resultExpected) }) + t.Run("asinh(sinh)", func(t *testing.T) { + t.Parallel() + q := `asinh(sinh((2000-time())/1000))` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{1, 0.8000000000000002, 0.6, 0.4000000000000001, 0.2, 0}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) + t.Run("atan2()", func(t *testing.T) { + t.Parallel() + q := `time() atan2 time()/10` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{0.07853981633974483, 0.07853981633974483, 0.07853981633974483, 0.07853981633974483, 0.07853981633974483, 0.07853981633974483}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) + t.Run("atan()", func(t *testing.T) { + t.Parallel() + q := `atan((2000-time())/1000)` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{0.7853981633974483, 0.6747409422235526, 0.5404195002705842, 0.3805063771123649, 0.19739555984988078, 0}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) + t.Run("atanh(tanh)", func(t *testing.T) { + t.Parallel() + q := `atanh(tanh((2000-time())/1000))` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{1, 0.8000000000000002, 0.6, 0.4000000000000001, 0.2, 0}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) t.Run("cos()", func(t *testing.T) { t.Parallel() q := `cos(pi()*(2000-time())/1000)` @@ -1072,6 +1127,28 @@ func TestExecSuccess(t *testing.T) { resultExpected := []netstorage.Result{r} f(q, resultExpected) }) + t.Run("acosh(cosh)", func(t *testing.T) { + t.Parallel() + q := `acosh(cosh((2000-time())/1000))` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{1, 0.8000000000000002, 0.5999999999999999, 0.40000000000000036, 0.20000000000000023, 0}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) + t.Run("rad(deg)", func(t *testing.T) { + t.Parallel() + q := `rad(deg(time()/500))` + r := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{2, 2.3999999999999995, 2.8, 3.2, 3.6, 4}, + Timestamps: timestampsExpected, + } + resultExpected := []netstorage.Result{r} + f(q, resultExpected) + }) t.Run("floor(time()/500)", func(t *testing.T) { t.Parallel() q := `floor(time()/500)` @@ -4993,7 +5070,7 @@ func TestExecSuccess(t *testing.T) { }) t.Run(`limitk(1)`, func(t *testing.T) { t.Parallel() - q := `limitk(1, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss"))` + q := `limitk(1, label_set(10, "foo", "bar") or label_set(time()/150, "xbaz", "sss"))` r1 := netstorage.Result{ MetricName: metricNameExpected, Values: []float64{10, 10, 10, 10, 10, 10}, @@ -7241,9 +7318,13 @@ func TestExecError(t *testing.T) { f(`smooth_exponential(1)`) f(`remove_resets()`) f(`sin()`) + f(`sinh()`) f(`cos()`) + f(`cosh()`) f(`asin()`) + f(`asinh()`) f(`acos()`) + f(`acosh()`) f(`rand(123, 456)`) f(`rand_normal(123, 456)`) f(`rand_exponential(122, 456)`) diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index 3056c73bf..f540ba9bb 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -1384,7 +1384,7 @@ func rollupIncreasePure(rfa *rollupFuncArg) float64 { prevValue = 0 } if len(values) == 0 { - // Assume the counter didsn't change since prevValue. + // Assume the counter didn't change since prevValue. return 0 } return values[len(values)-1] - prevValue diff --git a/app/vmselect/promql/transform.go b/app/vmselect/promql/transform.go index 722db3bbb..76898dba4 100644 --- a/app/vmselect/promql/transform.go +++ b/app/vmselect/promql/transform.go @@ -43,13 +43,22 @@ var transformFuncs = map[string]transformFunc{ // See funcs accepting instant-vector on https://prometheus.io/docs/prometheus/latest/querying/functions/ . "abs": newTransformFuncOneArg(transformAbs), "absent": transformAbsent, + "acos": newTransformFuncOneArg(transformAcos), + "acosh": newTransformFuncOneArg(transformAcosh), + "asin": newTransformFuncOneArg(transformAsin), + "asinh": newTransformFuncOneArg(transformAsinh), + "atan": newTransformFuncOneArg(transformAtan), + "atanh": newTransformFuncOneArg(transformAtanh), "ceil": newTransformFuncOneArg(transformCeil), "clamp": transformClamp, "clamp_max": transformClampMax, "clamp_min": transformClampMin, + "cos": newTransformFuncOneArg(transformCos), + "cosh": newTransformFuncOneArg(transformCosh), "day_of_month": newTransformFuncDateTime(transformDayOfMonth), "day_of_week": newTransformFuncDateTime(transformDayOfWeek), "days_in_month": newTransformFuncDateTime(transformDaysInMonth), + "deg": newTransformFuncOneArg(transformDeg), "exp": newTransformFuncOneArg(transformExp), "floor": newTransformFuncOneArg(transformFloor), "histogram_quantile": transformHistogramQuantile, @@ -61,12 +70,18 @@ var transformFuncs = map[string]transformFunc{ "log10": newTransformFuncOneArg(transformLog10), "minute": newTransformFuncDateTime(transformMinute), "month": newTransformFuncDateTime(transformMonth), + "pi": transformPi, + "rad": newTransformFuncOneArg(transformRad), "round": transformRound, - "sgn": transformSign, "scalar": transformScalar, + "sgn": transformSgn, + "sin": newTransformFuncOneArg(transformSin), + "sinh": newTransformFuncOneArg(transformSinh), "sort": newTransformFuncSort(false), "sort_desc": newTransformFuncSort(true), "sqrt": newTransformFuncOneArg(transformSqrt), + "tan": newTransformFuncOneArg(transformTan), + "tanh": newTransformFuncOneArg(transformTanh), "time": transformTime, // "timestamp" has been moved to rollup funcs. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/415 "vector": transformVector, @@ -109,11 +124,6 @@ var transformFuncs = map[string]transformFunc{ "rand": newTransformRand(newRandFloat64), "rand_normal": newTransformRand(newRandNormFloat64), "rand_exponential": newTransformRand(newRandExpFloat64), - "pi": transformPi, - "sin": newTransformFuncOneArg(transformSin), - "cos": newTransformFuncOneArg(transformCos), - "asin": newTransformFuncOneArg(transformAsin), - "acos": newTransformFuncOneArg(transformAcos), "prometheus_buckets": transformPrometheusBuckets, "buckets_limit": transformBucketsLimit, "histogram_share": transformHistogramShare, @@ -1777,7 +1787,7 @@ func transformRound(tfa *transformFuncArg) ([]*timeseries, error) { return doTransformValues(args[0], tf, tfa.fe) } -func transformSign(tfa *transformFuncArg) ([]*timeseries, error) { +func transformSgn(tfa *transformFuncArg) ([]*timeseries, error) { args := tfa.args if err := expectTransformArgsNum(args, 1); err != nil { return nil, err @@ -1898,18 +1908,58 @@ func transformSin(v float64) float64 { return math.Sin(v) } +func transformSinh(v float64) float64 { + return math.Sinh(v) +} + func transformCos(v float64) float64 { return math.Cos(v) } +func transformCosh(v float64) float64 { + return math.Cosh(v) +} + +func transformTan(v float64) float64 { + return math.Tan(v) +} + +func transformTanh(v float64) float64 { + return math.Tanh(v) +} + func transformAsin(v float64) float64 { return math.Asin(v) } +func transformAsinh(v float64) float64 { + return math.Asinh(v) +} + +func transformAtan(v float64) float64 { + return math.Atan(v) +} + +func transformAtanh(v float64) float64 { + return math.Atanh(v) +} + func transformAcos(v float64) float64 { return math.Acos(v) } +func transformAcosh(v float64) float64 { + return math.Acosh(v) +} + +func transformDeg(v float64) float64 { + return v * 180 / math.Pi +} + +func transformRad(v float64) float64 { + return v * math.Pi / 180 +} + func newTransformRand(newRandFunc func(r *rand.Rand) func() float64) transformFunc { return func(tfa *transformFuncArg) ([]*timeseries, error) { args := tfa.args diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index b901f2893..f543fe252 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,19 +1,19 @@ { "files": { - "main.css": "./static/css/main.cbb91dd8.chunk.css", - "main.js": "./static/js/main.3fb3f4d1.chunk.js", - "runtime-main.js": "./static/js/runtime-main.22ec3f63.js", + "main.css": "./static/css/main.acc63211.chunk.css", + "main.js": "./static/js/main.fe86f8ba.chunk.js", + "runtime-main.js": "./static/js/runtime-main.b765a534.js", "static/css/2.a684aa27.chunk.css": "./static/css/2.a684aa27.chunk.css", - "static/js/2.72d7cb01.chunk.js": "./static/js/2.72d7cb01.chunk.js", - "static/js/3.3cf0cbc4.chunk.js": "./static/js/3.3cf0cbc4.chunk.js", + "static/js/2.632b68e4.chunk.js": "./static/js/2.632b68e4.chunk.js", + "static/js/3.daeccd9c.chunk.js": "./static/js/3.daeccd9c.chunk.js", "index.html": "./index.html", - "static/js/2.72d7cb01.chunk.js.LICENSE.txt": "./static/js/2.72d7cb01.chunk.js.LICENSE.txt" + "static/js/2.632b68e4.chunk.js.LICENSE.txt": "./static/js/2.632b68e4.chunk.js.LICENSE.txt" }, "entrypoints": [ - "static/js/runtime-main.22ec3f63.js", + "static/js/runtime-main.b765a534.js", "static/css/2.a684aa27.chunk.css", - "static/js/2.72d7cb01.chunk.js", - "static/css/main.cbb91dd8.chunk.css", - "static/js/main.3fb3f4d1.chunk.js" + "static/js/2.632b68e4.chunk.js", + "static/css/main.acc63211.chunk.css", + "static/js/main.fe86f8ba.chunk.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index 801909ecc..d4a5ce0a0 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -VM UI
\ No newline at end of file +VM UI
\ No newline at end of file diff --git a/app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css b/app/vmselect/vmui/static/css/main.acc63211.chunk.css similarity index 58% rename from app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css rename to app/vmselect/vmui/static/css/main.acc63211.chunk.css index 40fd14ec2..d54bbca12 100644 --- a/app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css +++ b/app/vmselect/vmui/static/css/main.acc63211.chunk.css @@ -1 +1 @@ -body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:10px 0!important}.cm-activeLine{background-color:inherit!important}.cm-wrap{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-wrap{height:24px}.cm-content,.cm-gutter{min-height:51px}.one-line-scroll .cm-content,.one-line-scroll .cm-gutter{min-height:auto}.uplot .u-legend{display:grid;align-items:center;justify-content:start;text-align:left;margin-top:25px}.uplot .u-legend .u-series{font-size:12px} \ No newline at end of file +body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:10px 0!important}.cm-activeLine{background-color:inherit!important}.cm-wrap{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-wrap{height:24px}.cm-content,.cm-gutter{min-height:51px}.one-line-scroll .cm-content,.one-line-scroll .cm-gutter{min-height:auto}.uplot .u-legend{display:grid;align-items:center;justify-content:start;text-align:left;margin-top:25px}.uplot .u-legend .u-series{font-size:12px}.u-tooltip{position:absolute;display:none;grid-gap:12px;max-width:300px;padding:8px;border-radius:4px;background:rgba(57,57,57,.9);color:#fff;font-size:10px;line-height:1.4em;font-weight:500;word-wrap:break-word;font-family:monospace;pointer-events:none;z-index:100}.u-tooltip-data{display:flex;flex-wrap:wrap;align-items:center;font-size:11px}.u-tooltip__info{display:grid;grid-gap:4px}.u-tooltip__marker{width:12px;height:12px;margin-right:4px} \ No newline at end of file diff --git a/app/vmselect/vmui/static/js/2.632b68e4.chunk.js b/app/vmselect/vmui/static/js/2.632b68e4.chunk.js new file mode 100644 index 000000000..e7827a1bd --- /dev/null +++ b/app/vmselect/vmui/static/js/2.632b68e4.chunk.js @@ -0,0 +1,2 @@ +/*! For license information please see 2.632b68e4.chunk.js.LICENSE.txt */ +(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(168)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"composeDesc",value:function(e){return this.empty?e:e.empty?this:b(this,e)}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=c.Simple&&l>=e&&(n==c.TrackDel&&re||n==c.TrackBefore&&re))return-1;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"mapPosStable",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0,r=0,i=0,o=0;oe)return r+Math.max(0,e-n);i=r+=a}else{if(t<=0&&l>=e)return i;r+=s}n=l}return r}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];return g(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,o=0;i=0){t[i]=s,t[i+1]=a;for(var c=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new y(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s0&&v(r,t,o.text),o.forward(c),s+=c}for(var f=e[a++];s>1].toJSON()])}return e}},{key:"desc",get:function(){return new d(this.sections)}}],[{key:"of",value:function(e,t,i){var o=[],a=[],s=0,c=null;function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.length){sy||g<0||y>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(y," (in doc of length ").concat(t,")"));var w=O?"string"==typeof O?l.a.of(O.split(i||f)):O:l.a.empty,k=w.length;if(g==y&&0==k)return;gs&&p(o,g-s,-1),p(o,y-g,k),v(a,o,w),s=y}}(e),u(!c),c}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function v(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],c=e.sections[a++];t(i,u,o,f,d),i=u,o=f}}}function g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new y(e),s=new y(t),l=0,c=0;;)if(-1==a.ins)l+=a.len,a.next();else if(-1==s.ins&&c=0&&(a.done||cc&&!a.done&&l+a.len=0)){if(a.done&&s.done)return o?new h(i,o):new d(i);throw new Error("Mismatched change set lengths")}for(var f=0,m=l+a.len;;)if(s.ins>=0&&c>l&&c+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new y(e),a=new y(t),s=!1;;){if(o.done&&a.done)return i?new h(r,i):new d(r);if(0==o.ins)p(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var l=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var u=-1==a.ins?-1:a.off?0:a.ins;p(r,l,u,s),i&&u&&v(i,r,a.text)}else-1==a.ins?(p(r,o.off?0:o.len,l,s),i&&v(i,r,o.textBit(l))):(p(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&v(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}else p(r,0,a.ins,s),i&&v(i,r,a.text),a.next()}}var y=function(){function e(t){Object(a.a)(this,e),this.set=t,this.i=0,this.next()}return Object(s.a)(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return n>=t.length&&!e?l.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var e=this.set.inserted,t=this.i-2>>1;return t>=e.length?l.a.empty:e[t]}}]),e}(),O=function(){function e(t,n,r){Object(a.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{key:"map",value:function(t){var n=t.mapPos(this.from),r=t.mapPos(this.to);return n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return w.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return w.range(e.anchor,e.head)}}]),e}(),w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(a.a)(this,e),this.ranges=t,this.primaryIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t)})),this.primaryIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.primaryIndex!=e.primaryIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.primaryIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.primaryIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.primaryIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),primaryIndex:this.primaryIndex}}},{key:"primary",get:function(){return this.ranges[this.primaryIndex]}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.primaryIndex||t.primaryIndex>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return O.fromJSON(e)})),t.primaryIndex)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new O(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;ri.head?w.range(s,a):w.range(a,s))}}return new w(e,t)}function x(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(o){i.e(o)}finally{i.f()}}var j=0,S=function(){function e(t,n,r,i){Object(a.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=j++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new C([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new C(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new C(e,this,2,t)}},{key:"from",value:function(e,t){var n=this;return function(r){return A(t,n.compute([r],(function(t){return e(t.field(r))})))}}},{key:"nFrom",value:function(e,t){var n=this;return function(r){return A(t,n.computeN([r],(function(t){return e(t.field(r))})))}}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:E),!!t.static)}}]),e}();function E(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var C=function(){function e(t,n,r,i){Object(a.a)(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=j++}return Object(s.a)(e,[{key:"dynamicSlot",value:function(e){var t,n=this.value,i=this.facet.compareInput,o=e[this.id]>>1,a=2==this.type,s=!1,l=!1,c=[],u=Object(r.a)(this.dependencies);try{for(u.s();!(t=u.n()).done;){var f=t.value;"doc"==f?s=!0:"selection"==f?l=!0:0==(1&e[f.id])&&c.push(e[f.id])}}catch(d){u.e(d)}finally{u.f()}return function(e,t){if(!t||t.reconfigure)return e.values[o]=n(e),1;if(!(s&&t.docChanged||l&&(t.docChanged||t.selection)||c.some((function(t){return(1&$(e,t))>0}))))return 0;var r=n(e),u=t.startState.values[o];return(a?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,n){var l,c=n?n.reconfigure?n.startState.config.address[t.id]:s<<1:null,u=null==c,f=Object(r.a)(a);try{for(f.s();!(l=f.n()).done;){1&$(e,l.value)&&(u=!0)}}catch(y){f.e(y)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h>1;return function(e,r){if(!r)return e.values[n]=t.createF(e),1;var i,o=0;if(r.reconfigure){var a=function(e,t){var n=e.config.address[t];return null==n?null:n>>1}(r.startState,t.id);i=null==a?t.createF(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=t.updateF(i,r);return o||t.compareF(i,s)||(o=1),o&&(e.values[n]=s),o}}}],[{key:"define",value:function(t){var n=[],i=new e(j++,t.create,t.update,t.compare||function(e,t){return e===t},n);if(t.provide){var o,a=Object(r.a)(t.provide);try{for(a.s();!(o=a.n()).done;){var s=o.value;s instanceof S?n.push(s.compute([i],(function(e){return e.field(i)}))):n.push(s(i))}}catch(l){a.e(l)}finally{a.f()}}return i}}]),e}(),T={fallback:3,default:2,extend:1,override:0};function D(e,t){if(!T.hasOwnProperty(t))throw new RangeError("Invalid precedence: ".concat(t));return new R(e,T[t])}function A(e,t){return e?D(t,e):t}var R=function e(t,n){Object(a.a)(this,e),this.e=t,this.prec=n},N=function e(t,n){Object(a.a)(this,e),this.tag=t,this.extension=n};var L=function(){function e(t,n,r,i,o){for(Object(a.a)(this,e),this.source=t,this.replacements=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),o=arguments.length>2?arguments[2]:void 0,a=[],s=Object.create(null),l=Object(r.a)(_(t,i));try{for(l.s();!(n=l.n()).done;){var c=n.value;c instanceof M?a.push(c):(s[c.facet.id]||(s[c.facet.id]=[])).push(c)}}catch(b){l.e(b)}finally{l.f()}for(var u=Object.create(null),f=[],d=[],h=function(){var e=v[p];u[e.id]=d.length<<1,d.push((function(t){return e.slot(t)}))},p=0,v=a;p=s)return;var c=n[l].indexOf(e);c>-1&&n[l].splice(c,1)}if(i.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){a(u.value,s)}}catch(d){f.e(d)}finally{f.f()}}else if(e instanceof N){if(e.tag in o)throw new RangeError("Duplicate use of tag '".concat(String(e.tag),"' in extensions"));o[e.tag]=!0,a(t[e.tag]||e.extension,s)}else e.extension?a(e.extension,s):e instanceof R?a(e.e,e.prec):(n[s].push(e),e instanceof M&&a(e.facets,s))}a(e,T.default);var s,l,c=Object(r.a)((l=t,(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l):[]).concat(Object.keys(l))));try{for(c.s();!(s=c.n()).done;){var u=s.value;!(u in o)&&"full"!=u&&t[u]&&(o[u]=!0,a(t[u],T.default))}}catch(f){c.e(f)}finally{c.f()}return n.reduce((function(e,t){return e.concat(t)}))}function $(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function z(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var I=S.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),Q=S.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),B=S.define(),F=S.define(),W=new u.c,H=S.define(),V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),this.state=t,this.options=n}return Object(s.a)(e,[{key:"textAfterPos",value:function(e){var t,n,r=null===(t=this.options)||void 0===t?void 0:t.simulateBreak;return e==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(e,Math.min(e+100,null!=r&&r>e?r:1e9,this.state.doc.lineAt(e).to))}},{key:"countColumn",value:function(e,t){return Object(l.d)(t<0?e:e.slice(0,t),0,this.state.tabSize)}},{key:"lineIndent",value:function(e){var t,n=null===(t=this.options)||void 0===t?void 0:t.overrideIndentation;if(n){var r=n(e.from);if(r>-1)return r}var i=e.slice(0,Math.min(100,e.length));return this.countColumn(i,i.search(/\S/))}},{key:"column",value:function(e){var t,n=this.state.doc.lineAt(e),r=n.slice(0,e-n.from),i=this.countColumn(r,e-n.from),o=(null===(t=this.options)||void 0===t?void 0:t.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"unit",get:function(){return this.state.indentUnit}}]),e}(),q=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new U}}]),e}(),U=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new q(this,e)}}]),e}(),Y=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new X(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value.map(t);a&&i.push(a)}}catch(s){o.e(s)}finally{o.f()}return i}}]),e}(),X=function(){function e(t){Object(a.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new Y(this,e)}}]),e}(),G=function(){function e(t,n,r,i,o,s,l){Object(a.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.reconfigure=s,this.scrollIntoView=l,this._doc=null,this._state=null,r&&x(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{key:"annotation",value:function(e){var t,n=Object(r.a)(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(o){n.e(o)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}}]),e}();function K(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;f--){var d=u[f](e);e=d instanceof G?d:Array.isArray(d)&&1==d.length&&d[0]instanceof G?d[0]:ee(n,Array.isArray(d)?d:[d],!1)}return e}(s):s}G.time=q.define(),G.userEvent=q.define(),G.addToHistory=q.define();var te,ne=[];!function(e){e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other"}(te||(te={}));var re,ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{re=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(le){}function oe(e){return function(t){if(!/\S/.test(t))return te.Space;if(function(e){if(re)return re.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ie.test(n)))return!0}return!1}(t))return te.Word;for(var n=0;n-1)return te.Word;return te.Other}}var ae=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(a.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&!i.reconfigure)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var o in t.address){var s=t.address[o],l=i.startState.config.address[o];null!=l&&0==(1&s)&&(this.values[s>>1]=z(i.startState,l))}this.applying=i,i&&(i._state=this);for(var c=0;c1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return $(this,n),z(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof h?t:h.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return l.a.of(t.split(this.facet(e.lineSeparator)||f))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:($(this,t),z(this,t))}},{key:"toJSON",value:function(){return{doc:this.sliceDoc(),selection:this.selection.toJSON()}}},{key:"indentString",value:function(t){var n="";if(9==this.facet(e.indentUnit).charCodeAt(0))for(;t>=this.tabSize;)n+="\t",t-=this.tabSize;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");return e.create({doc:t.doc,selection:w.fromJSON(t.selection),extensions:n.extensions})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=L.resolve(t.extensions||[]),r=t.doc instanceof l.a?t.doc:l.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||f)),i=t.selection?t.selection instanceof w?t.selection:w.single(t.selection.anchor,t.selection.head):w.single(0);return x(i,r.length),n.staticFacet(I)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function se(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={},a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,l=0,c=Object.keys(s);l=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(53);function i(e,t){if(null==e)return{};var n,i,o=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},O="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),w="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),k="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),x="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),j="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),S=O&&(x||+O[1]<57)||k&&x,E=0;E<10;E++)b[48+E]=b[96+E]=String(E);for(E=1;E<=24;E++)b[E+111]="F"+E;for(E=65;E<=90;E++)b[E]=String.fromCharCode(E+32),y[E]=String.fromCharCode(E);for(var C in b)y.hasOwnProperty(C)||(y[C]=b[C]);var P="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],M=Object(h.a)(P,2),T=M[0],D=M[1],A=/Edge\/(\d+)/.exec(T.userAgent),R=/MSIE \d/.test(T.userAgent),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(T.userAgent),L=!!(R||N||A),_=!L&&/gecko\/(\d+)/i.test(T.userAgent),$=!L&&/Chrome\/(\d+)/.exec(T.userAgent),z="webkitFontSmoothing"in D.documentElement.style,I={mac:/Mac/.test(T.platform),ie:L,ie_version:R?D.documentMode||6:N?+N[1]:A?+A[1]:0,gecko:_,gecko_version:_?+(/Firefox\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,chrome:!!$,chrome_version:$?+$[1]:0,ios:!L&&/AppleWebKit/.test(T.userAgent)&&/Mobile\/\w+/.test(T.userAgent),android:/Android\b/.test(T.userAgent),webkit:z,safari:/Apple Computer/.test(T.vendor),webkit_version:z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=D.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Q(e){return e.getSelection?e.getSelection():document.getSelection()}function B(e,t){if(!t.anchorNode)return!1;try{return e.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)}catch(n){return!1}}function F(e){if(3==e.nodeType){var t=J();return t.setEnd(e,e.nodeValue.length),t.setStart(e,0),t.getClientRects()}return 1==e.nodeType?e.getClientRects():[]}function W(e,t,n,r){return!!n&&(V(e,t,n,r,-1)||V(e,t,n,r,1))}function H(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function V(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:q(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=H(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(i<0?-1:0)],t=i<0?q(e):0}}}function q(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function U(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Y(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var X,G=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),K=null;function Z(e){if(e.setActive)return e.setActive();if(K)return e.focus(K);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==K?{get preventScroll(){return K={preventScroll:!0},!0}}:void 0),!K){K=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];Object(f.a)(this,e),this.node=t,this.offset=n,this.precise=r}return Object(d.a)(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,H(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,H(t)+1,n)}}]),e}(),te=[],ne=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=Object(u.a)(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){if(2&this.dirty){var n,r=this.dom,i=null,o=Object(u.a)(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){var s=i?i.nextSibling:r.firstChild;!s||a.dom||e.get(s)||a.reuseDOM(s),a.sync(t),a.dirty=0}t&&t.node==r&&i!=a.dom&&(t.written=!0),ie(r,i,a.dom),i=a.dom}}catch(h){o.e(h)}finally{o.f()}var l=i?i.nextSibling:r.firstChild;for(l&&t&&t.node==r&&(t.written=!0);l;)l=re(l)}else if(1&this.dirty){var c,f=Object(u.a)(this.children);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.dirty&&(d.sync(t),d.dirty=0)}}catch(h){f.e(h)}finally{f.f()}}}},{key:"reuseDOM",value:function(e){return!1}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==q(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var l=this.children[a];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,l=n;st)return c.domBoundsAround(e,t,l);if(u>=e&&-1==r&&(r=s,i=l),u>=t&&-1==o){o=s,a=u;break}l=u+c.breakAfter}return{from:i,to:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(e))}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom=e,e.cmView=this}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new oe(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function re(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function ie(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=re(r);else e.insertBefore(n,r)}ne.prototype.breakAfter=0;var oe=function(){function e(t,n,r){Object(f.a)(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Object(d.a)(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}(),ae=[],se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(ne);se.prototype.children=ae;var le=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).text=e,r}return Object(d.a)(n,[{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){return 3==e.nodeType&&(this.createDOM(e),!0)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"slice",value:function(e){return new n(this.text.slice(e))}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new ee(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return ue(this.dom,e,t,this.length)}},{key:"length",get:function(){return this.text.length}}]),n}(se),ce=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(r=t.call(this)).mark=e,r.children=o,r.length=a;var s,l=Object(u.a)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.setParent(Object(i.a)(r))}}catch(d){l.e(d)}finally{l.f()}return r}return Object(d.a)(n,[{key:"createDOM",value:function(){var e=document.createElement(this.mark.tagName);if(this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);this.setDOM(e)}},{key:"sync",value:function(e){this.dom||this.createDOM(),Object(o.a)(Object(a.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||tt&&r.push(i=0?I.chrome||I.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=J();s.setEnd(e,o),s.setStart(e,i);var l=s.getBoundingClientRect();return a?U(l,a<0):l}var fe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Object(d.a)(n,[{key:"slice",value:function(e){return n.create(this.widget,this.length-e,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return r}},{key:"overrideDOMText",get:function(){if(0==this.length)return g.a.empty;for(var e=this;e.parent;)e=e.parent;var t=e.editorView,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):g.a.empty}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(se),de=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"domAtPos",value:function(e){return new ee(this.widget.text,e)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(e,t){return ue(this.widget.text,e,t,this.length)}},{key:"overrideDOMText",get:function(){return null}}]),n}(fe);function he(e,t,n,r,i,o){var a,s=e.childCursor(),l=s.findPos(n,1),c=l.i,f=l.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(a=m.n()).done;){v+=a.value.length}}catch(x){m.e(x)}finally{m.f()}e.length+=v;var g=e.children;if(h==c&&p){var b=g[h];if(1==r.length&&b.merge(p,f,r[0],i,o))return;if(0==r.length)return void b.merge(p,f,null,i,o);var y=b.slice(f);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),c++,o=f=0}if(f){var O=g[c];r.length&&O.merge(0,f,r[r.length-1],0,o)?(r.pop(),o=0):O.merge(0,f,null,0,0)}else ci&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return ee.after(s)}return new ee(e,0)}function ve(e,t,n){var r,i=e.children;n>0&&t instanceof ce&&i.length&&(r=i[i.length-1])instanceof ce&&r.mark.eq(t.mark)?ve(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function me(e,t,n){for(var r=0,i=0;i=t:a>t)return o.coordsAt(t-r,n);r=a}}return(e.dom.lastChild||e.dom).getBoundingClientRect()}function ge(e,t){for(var n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function be(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(e){return new xe(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Se(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ee(e),r=n.start,i=n.end;return new Se(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new je(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.b.of(e,t)}}]),n}(m.d);ke.none=m.b.empty;var xe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ee(e),o=i.start,a=i.end;return(r=t.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&be(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);xe.prototype.point=!1;var je=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&be(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);je.prototype.mapMode=p.h.TrackBefore,je.prototype.point=!0;var Se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s){var l;return Object(f.a)(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<0?p.h.TrackBefore:p.h.TrackAfter:p.h.TrackDel,l}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}},{key:"type",get:function(){return this.startSide=5}}]),n}(ke);function Ee(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}Se.prototype.point=!0;function Ce(e,t,n){var r=n.length-1;r>=0&&n[r]+4>e?n[r]=Math.max(n[r],t):n.push(e,t)}var Pe=p.f.define({combine:function(e){return e.join(" ")}}),Me=p.f.define({combine:function(e){return e.indexOf(!0)>-1}}),Te=v.a.newName();function De(e){return e.replace(/\$\w[\w\.]*/g,(function(e){for(var t=e.slice(1).split("."),n="",r=1;r<=t.length;r++)n+=".cm-"+t.slice(0,r).join("-");return n}))}function Ae(e,t){return new v.a(t,{process:function(t){return t=De(t),/\$/.test(t)?t.replace(/\$/,e):e+" "+t},extend:function(t,n){return t=De(t),n.slice(0,e.length+1)==e+" "?e+" "+t.replace(/&/,n.slice(e.length+1)):t.replace(/&/,n)}})}function Re(e){if(e.indexOf(".")<0)return"cm-"+e;for(var t=e.split("."),n="",r=1;r<=t.length;r++)n+=(n?" ":"")+"cm-"+t.slice(0,r).join("-");return n}var Ne,Le=Ae("."+Te,{$:{position:"relative !important",boxSizing:"border-box","&$focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},$scroller:{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},$content:{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},"$$light $content":{caretColor:"black"},"$$dark $content":{caretColor:"white"},$line:{display:"block",padding:"0 2px 0 4px"},$selectionLayer:{zIndex:-1,contain:"size style"},$selectionBackground:{position:"absolute"},"$$light $selectionBackground":{background:"#d9d9d9"},"$$dark $selectionBackground":{background:"#222"},"$$focused$light $selectionBackground":{background:"#d7d4f0"},"$$focused$dark $selectionBackground":{background:"#233"},$cursorLayer:{zIndex:100,contain:"size style",pointerEvents:"none"},"$$focused $cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},$cursor:{position:"absolute",borderLeft:"1.2px solid #aaa",marginLeft:"-0.6px",pointerEvents:"none"},"$$focused $cursor":{borderLeft:"1.2px solid black"},$placeholder:{color:"#888",display:"inline-block"},$button:{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"$$light $button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"$$dark $button":{backgroundImage:"linear-gradient(#555, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},$textfield:{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"$$light $textfield":{backgroundColor:"white"},"$$dark $textfield":{border:"1px solid #555",backgroundColor:"inherit"}}),_e=Re("line"),$e=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),he(this,e,t,r?r.children:ze,o,a),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,o=r.off;o&&(t.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){be(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){ve(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes;t&&(this.attrs=ge(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return pe(this.dom,this.children,e)}},{key:"sync",value:function(e){this.dom||(this.setDOM(document.createElement("div")),this.dom.className=_e,this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ye(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(_e),this.prevAttrs=void 0),Object(o.a)(Object(a.a)(n.prototype),"sync",this).call(this,e);var t=this.dom.lastChild;if(!t||"BR"!=t.nodeName&&ne.get(t)instanceof fe){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof le))return null;var i=F(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return me(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Oe.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var o=e.children[r],a=i+o.length;if(a>=t){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(ne),ze=[],Ie=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t=0;n--)e=new ce(t[n],[e],e.length);return e}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e);this.getLine().append(this.wrapMarks(new le(this.text.slice(this.textOff,this.textOff+s)),t),n),e-=s,this.textOff+=s}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var o=t-e;if(n instanceof Se)if(n.block){var a=n.type;a!=Oe.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new Ie(n.widget||new Be("div"),o,a))}else{var s=this.wrapMarks(fe.create(n.widget||new Be("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var o=new e(t,n,r);return o.openEnd=m.b.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),e}(),Be=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(we);!function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Ne||(Ne={}));var Fe=Ne.LTR,We=Ne.RTL;function He(e){for(var t=[],n=0;n=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.fromt:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),Xe=[];function Ge(e,t){var n,r=e.length,i=t==Fe?1:2;if(!e||1==i&&!Ue.test(e))return Ke(r);for(var o=0,a=i,s=i;ox;){for(var E=S,C=2!=Xe[--S];S>x&&C==(2!=Xe[S-1]);)S--;w.push(new Ye(S,E,C?2:1))}else w.push(new Ye(x,k,0))}else for(var P=0;P-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,o){var a=tt.indexOf(e)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=t;if(this.lineWrapping=a,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,l=a.toA,c=a.fromB,u=a.toB,f=i.lineAt(s,et.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,et.ByPosNoHeight,t,0,0);for(u+=d.to-l,l=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,c=r[o-1].fromB,o--,s0},set:function(e){this.flags=(e?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new st(0,0)}},{key:"of",value:function(t){if(1==t.length)return t[0];for(var n=0,r=t.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(ot),st=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Oe.Text)).collapsed=0,i.widgetHeight=0,i}return Object(d.a)(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof lt&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof lt?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):ot.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(at),lt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,e,0)}return Object(d.a)(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,l=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),c=t.line(o+l),u=c.from,f=c.length;return new it(u,f,n+s*l,s,Oe.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==et.ByHeight)return this.blockAt(e,n,r,i);if(t==et.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new it(a,s-a,0,0,Oe.Text)}var l=this.lines(n,i),c=l.firstLine,u=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new it(d,h,r+u*(p-c),u,Oe.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,l=a.lineHeight,c=e;c0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return ot.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=t+this.length;if(i&&i.from<=t+this.length&&i.more){var a=[],s=Math.max(t,i.from);for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var l=e.doc.lineAt(s).length;a.length&&a.push(null);var c=new st(l,i.heights[i.index++]);c.outdated=!1,a.push(c),s+=l+1}return s<=o&&a.push(null,new n(o-s).updateHeight(e,s)),e.heightChanged=!0,ot.of(a)}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(ot),ct=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,o.right=i,o.size=e.size+i.size,o}return Object(d.a)(n,[{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return l;var c=t==et.ByPosNoHeight?et.ByPosNoHeight:et.ByPos;return s?l.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(l)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,a,s,o);else{var l=this.lineAt(s,et.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var o,a=i.length,s=Object(u.a)(n);try{for(s.s();!(o=s.n()).done;){var l=o.value;i.push(l)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&ut(i,a-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?ot.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(ot);function ut(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof lt&&(r=e[t+1])instanceof lt&&e.splice(t-1,3,new lt(n.length+1+r.length))}var ft=function(){function e(t,n){Object(f.a)(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Object(d.a)(e,[{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof st?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new st(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new st(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new lt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof st)return e;var t=new st(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Oe.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Oe.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof st||this.isCovered?(this.writtenTo0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;o+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}]),e}(),_t=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pt;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.prevState=t.state,this.changes=p.b.empty(this.prevState.doc.length);var i,o=Object(u.a)(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(c){o.e(c)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new Lt(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,this.flags),this.docChanged&&(this.flags|=2)}return Object(d.a)(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}();var $t=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.size=r}return Object(d.a)(e,[{key:"draw",value:function(e){return ke.replace({widget:new zt(this.size,e)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(Rt),i=e.changedRanges,o=Lt.extendWithRanges(i,dt(e.prevState.facet(Rt),r,e?e.changes:p.b.empty(this.state.doc.length))),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2);var s=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),s.eq(this.viewport)||(this.viewport=s,e.flags|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(e.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes)))),this.computeVisibleRanges(),t&&(this.scrollTo=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.primary.empty&&e.state.selection.primary.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e,t){var n=e.dom,r="",i=Ne.LTR;if(!t){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?Ne.RTL:Ne.LTR,this.paddingTop=parseInt(o.paddingTop)||0,this.paddingBottom=parseInt(o.paddingBottom)||0}var a=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(e,t){for(var n=e.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=e.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var l=s.getBoundingClientRect();r=Math.max(r,l.left),i=Math.min(i,l.right),o=Math.max(o,l.top),a=Math.min(a,l.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+t),bottom:a-(n.top+t)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,l=a.bottom-this.pixelViewport.bottom;if(this.pixelViewport=a,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var c=e.measureVisibleLineHeights(),u=!1,f=0,d=0,h=this.heightOracle;if(!t){var p=e.dom.clientWidth;if(h.mustRefresh(c,r,i)||h.lineWrapping&&Math.abs(p-this.contentWidth)>h.charWidth){var v=e.measureTextSize(),m=v.lineHeight,g=v.charWidth;(u=h.refresh(r,i,m,g,p/g,c))&&(e.minWidth=0,d|=16)}this.contentWidth!=p&&(this.contentWidth=p,d|=16),s>0&&l>0?f=Math.max(s,l):s<0&&l<0&&(f=Math.min(s,l))}return h.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(h,0,u,new rt(this.viewport.from,c)),h.heightChanged&&(d|=2),(!this.viewportIsAppropriate(this.viewport,f)||this.scrollTo&&(this.scrollTo.headthis.viewport.to))&&(this.viewport=this.getViewport(f,this.scrollTo),d|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(d|=this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),d}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.pixelViewport,a=o.top,s=o.bottom,l=new Qt(r.lineAt(a-1e3*n,et.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),et.ByHeight,i,0,0).to);if(t)if(t.headl.to){var u=r.lineAt(t.head,et.ByPos,i,0,0).bottom;l=new Qt(r.lineAt(u-(s-a)-500,et.ByHeight,i,0,0).from,r.lineAt(u+500,et.ByHeight,i,0,0).to)}return l}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Qt(this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,et.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,et.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0),s=a.bottom;return(0==t||o<=this.pixelViewport.top-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=this.pixelViewport.bottom+Math.max(10,Math.min(r,250)))&&o>this.pixelViewport.top-2e3&&si&&(r.push({from:i,to:e}),o+=e-i),i=t},minPointSize:20}),i=r.from&&(o=l.from),l.from<=r.to&&l.to>=a&&(a=l.to);var c=o-1e4,u=a+1e4;c>r.from+5e3&&n.push(Wt(e,(function(e){return e.from==r.from&&e.to>c-5e3&&e.tou-5e3&&e.from=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,l=a.to-s;if(i<=l)return s+i;i-=l}}function Ft(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(l){i.e(l)}finally{i.f()}return r/e.total}function Wt(e,t){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Ht=[],Vt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).view=e,r.viewports=Ht,r.compositionDeco=ke.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(e.contentDOM),r.children=[new $e],r.children[0].setParent(Object(i.a)(r)),r.updateInner([new Lt(0,0,0,e.state.doc.length)],r.updateDeco(),0),r}return Object(d.a)(n,[{key:"update",value:function(e){var t,n=this,r=e.changedRanges;this.minWidth>0&&r.length&&(r.every((function(e){var t=e.fromA;return e.toAn.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),(null===(t=this.view.inputState)||void 0===t?void 0:t.composing)?e.transactions.length&&(this.compositionDeco=function(e,t){var n=Q(e.root),r=n.focusNode&&Xt(n.focusNode,n.focusOffset,0);if(!r)return ke.none;var i,o,a=e.docView.nearest(r),s=r;if(a instanceof se){for(;a.parent instanceof se;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof $e))return ke.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!ne.get(l);)l=l.previousSibling;i=o=l?ne.get(l).posAtEnd:a.posAtStart}var c=t.mapPos(i,1),u=Math.max(c,t.mapPos(o,-1)),f=r.nodeValue,d=e.state;if(u-c=this.view.viewport.from&&e.state.selection.primary.to<=this.view.viewport.to?(this.updateSelection(i,l),!1):(this.updateInner(r,a,e.prevState.doc.length,i,l),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.heightMap.height+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=I.chrome?{node:Q(r.view.root).focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,(null===e||void 0===e?void 0:e.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(e,t,n){for(var r=this.childCursor(n),i=e.length-1;;i--){var o=i>=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,l=o.fromB,c=o.toB,u=Qe.build(this.view.state.doc,l,c,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,b=r.findPos(a,-1),y=b.i,O=b.off;this.replaceRange(y,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,o,a,s){var l=this.children[e],c=i.length?i[i.length-1]:null,u=c?c.breakAfter:o;if(e!=n||o||u||!(i.length<2)||!l.merge(t,r,i.length?c:null,0==t,a,s)){var f=this.children[n];for(r0&&(!o&&i.length&&l.merge(t,l.length,i[0],!1,a,0)?l.breakAfter=i.shift().breakAfter:(t0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||this.mayControlSelection()){var n=this.view.state.selection.primary,r=this.domAtPos(n.anchor),i=this.domAtPos(n.head),o=Q(this.root);(e||!o.focusNode||I.gecko&&n.empty&&Gt(o.focusNode,o.focusOffset)||!W(r.node,r.offset,o.anchorNode,o.anchorOffset)||!W(i.node,i.offset,o.focusNode,o.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(I.gecko){var e=Gt(r.node,r.offset);if(e&&3!=e){var t=Xt(r.node,r.offset,1==e?1:-1);t&&(r=new ee(t,1==e?0:t.nodeValue.length))}}o.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel)}else if(o.extend)o.collapse(r.node,r.offset),o.extend(i.node,i.offset);else{var a=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}a.setEnd(i.node,i.offset),a.setStart(r.node,r.offset),o.removeAllRanges(),o.addRange(a)}})),this.impreciseAnchor=r.precise?null:new ee(o.anchorNode,o.anchorOffset),this.impreciseHead=i.precise?null:new ee(o.focusNode,o.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var e=this.view.state.selection.primary,t=Q(this.root);if(e.empty&&e.assoc&&t.modify){var n=$e.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(kt)?this.root.activeElement==this.dom:B(this.dom,Q(this.root))}},{key:"nearest",value:function(e){for(var t=e;t;){var n=ne.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n=o&&i.type!=Oe.WidgetAfter)return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){e.push(s.dom.getBoundingClientRect().height);var c=s.dom.scrollWidth;c>i&&(this.minWidth=i=c,this.minWidthFrom=o,this.minWidthTo=l)}o=l+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof $e){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=F(s.firstChild)[0];o=s.getBoundingClientRect().height,a=e?e.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new oe(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){var e=this.view.viewState.viewport,t=[e],n=this.view.state.selection.primary,r=n.head,i=n.anchor;if(re.to){var o=this.view.viewState.lineAt(r,0),a=o.from,s=o.to;t.push(new Qt(a,s))}if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var l=this.view.viewState.lineAt(i,0),c=l.from,u=l.to;t.push(new Qt(c,u))}this.viewports=t.sort((function(e,t){return e.from-t.from}));for(var f=[],d=0,h=0;;h++){var p=h==t.length?null:t[h],v=p?p.from-1:this.length;if(v>d){var m=this.view.viewState.lineAt(v,0).bottom-this.view.viewState.lineAt(d,0).top;f.push(ke.replace({widget:new Ut(m),block:!0,inclusive:!0}).range(d,v))}if(!p)break;d=p.to+1}return ke.set(f)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(Object(c.a)(this.view.state.facet(Rt)),Object(c.a)(this.view.pluginField(Pt)))}},{key:"scrollPosIntoView",value:function(e,t){var n=this.coordsAt(e,t);if(n){var r,i=0,o=0,a=0,s=0,l=Object(u.a)(this.view.pluginField(jt.scrollMargins));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(o=Math.max(o,d)),null!=h&&(a=Math.max(a,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){l.e(v)}finally{l.f()}!function(e,t){for(var n=e.ownerDocument.defaultView,r=e.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=Y(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var a=r.getBoundingClientRect();i={left:a.left,right:a.left+r.clientWidth,top:a.top,bottom:a.top+r.clientHeight}}var s=0,l=0;if(t.topi.bottom&&(l=t.bottom-i.bottom+5),t.lefti.right&&(s=t.right-i.right+5),s||l)if(o)n.scrollBy(s,l);else{if(l){var c=r.scrollTop;r.scrollTop+=l,l=r.scrollTop-c}if(s){var u=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-u}t={left:t.left-s,top:t.top-l,right:t.right-s,bottom:t.bottom-l}}if(o)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(ne),qt=1e7,Ut=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).height=e,r}return Object(d.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("div");return this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){if(this.height0;t-=qt){e.appendChild(document.createElement("div")).style.height=Math.min(t,qt)+"px"}}return!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(we);var Yt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).top=e,i.text=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return this.top==e.top&&this.text==e.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return de}}]),n}(we);function Xt(e,t,n){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0&&n<=0)t=q(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function Gt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(te?t.left-e:Math.max(0,e-t.right)}function Jt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function en(e,t){return e.topt.top+1}function tn(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function rn(e,t,n){for(var r,i,o,a,s,l,c,u,f=e.firstChild;f;f=f.nextSibling)for(var d=F(f),h=0;hm||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!c||c.bottomp.top)&&(l=f,u=p):c&&en(c,p)?c=nn(c,p.bottom):u&&en(u,p)&&(u=tn(u,p.top))}if(c&&c.bottom>=n?(r=s,i=c):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?on(r,g,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:rn(r,g,n)}function on(e,t,n){for(var r=e.nodeValue.length,i=J(),o=0;o=t&&l.top-1<=n&&l.bottom+1>=n)){var c=t>=(l.left+l.right)/2,u=c;if(I.chrome||I.gecko)i.setEnd(e,o),i.getBoundingClientRect().left==l.right&&(u=!c);return{node:e,offset:o+(u?1:0)}}}}return{node:e,offset:0}}function an(e,t){for(var n,r=t.x,i=t.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=e.contentDOM.getBoundingClientRect(),s=e.defaultLineHeight/2,l=!1;;){if((n=e.blockAtHeight(i,a.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),l)return-1;l=!0}if(n.type==Oe.Text)break;i=o>0?n.bottom+s:n.top-s}var c=n.from;if(ce.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:-1;r=Math.max(a.left+1,Math.min(a.right-1,r));var u,f=e.root,d=f.elementFromPoint(r,i),h=-1;if(d&&e.contentDOM.contains(d)&&!(e.docView.nearest(d)instanceof fe))if(f.caretPositionFromPoint){var p=f.caretPositionFromPoint(r,i);p&&(u=p.offsetNode,h=p.offset)}else if(f.caretRangeFromPoint){var v=f.caretRangeFromPoint(r,i);v&&(u=v.startContainer,h=v.startOffset)}if(!u||!e.docView.dom.contains(u)){var m=$e.find(e.docView,c),g=rn(m.dom,r,i);u=g.node,h=g.offset}return e.docView.posFromDOM(u,h)}function sn(e,t,n,r){var i=e.state.doc.lineAt(t.head),o=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){var a=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==Ne.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(s>-1)return p.d.cursor(s,n?-1:1)}var l=$e.find(e.docView,t.head),c=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return p.d.cursor(c,n?-1:1)}function ln(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=Je(i,o,e.textDirection,a,n),c=Ze;if(!l){if(i.number==(n?e.state.doc.lines:1))return a;c="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),l=p.d.cursor(n?i.from:i.to)}if(s){if(!s(c))return a}else{if(!r)return l;s=r(c)}a=l}}var cn=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=!1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(e){var r=dn[e];t.contentDOM.addEventListener(e,(function(i){fn(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in dn)r(i);t.contentDOM.addEventListener("keydown",(function(e){t.inputState.lastKeyCode=e.keyCode,t.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=t.hasFocus,this.ensureHandlers(t)}return Object(d.a)(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=this.customHandlers=e.pluginField(Mt),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){fn(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in o.handlers)a(s)}}catch(l){i.e(l)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[e];if(a)try{if(a.call(o.plugin,n,t)||n.defaultPrevented)return!0}catch(s){wt(t.state,s)}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Object(u.a)(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,t,e)}catch(a){wt(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(!!this.composing||!!(I.safari&&e.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type||"compositionend"==e.type}},{key:"startMouseSelection",value:function(e,t,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new un(this,e,t,n)}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),this.lastKeyCode=this.lastSelectionTime=0}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),un=function(){function e(t,n,r,i){Object(f.a)(this,e),this.inputState=t,this.view=n,this.startEvent=r,this.style=i;var o=n.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=n.state.facet(p.e.allowMultipleSelections)&&function(e,t){var n=e.state.facet(vt);return n.length?n[0](t):I.mac?t.metaKey:t.ctrlKey}(n,r),this.dragMove=function(e,t){var n=e.state.facet(mt);return n.length?n[0](t):I.mac?!t.altKey:!t.ctrlKey}(n,r),this.dragging=!!function(e,t){if(e.state.selection.primary.empty)return!1;var n=Q(e.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.startEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.primary.assoc==this.view.state.selection.primary.assoc||this.view.dispatch({selection:t,annotations:p.l.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)}}]),e}();function fn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ne.get(r))&&n.ignoreEvent(t))return!1;return!0}var dn=Object.create(null),hn=I.ie&&I.ie_version<15||I.ios&&I.webkit_version<604;function pn(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length;n=xn&&r.selection.ranges.every((function(e){return e.empty}))&&xn==o.toString()?{changes:r.selection.ranges.map((function(e){return r.doc.lineAt(e.from)})).filter((function(e,t,n){return 0==t||n[t-1]!=e})).map((function(e){return{from:e.from,insert:(a?o.line(i++).slice():t)+r.lineBreak}}))}:a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.slice()},range:p.d.cursor(e.from+t.length)}})):r.replaceSelection(o),e.dispatch(n,{annotations:p.l.userEvent.of("paste"),scrollIntoView:!0})}function vn(e,t,n,r){if(1==r)return p.d.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return p.d.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=i.findClusterBreak(o,!1):s=i.findClusterBreak(o,!0);for(var l=r(i.slice(a,s));a>0;){var c=i.findClusterBreak(a,!1);if(r(i.slice(c,a))!=l)break;a=c}for(;sDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(kn+1)%3:1}(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes))},get:function(t,s,l){var c;if(t.clientX==a.clientX&&t.clientY==a.clientY?c=o:(c=o=yn(e,t),a=t),!c||!n)return i;var u=vn(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=vn(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d=t.top&&e<=t.bottom},gn=function(e,t,n){return mn(t,n)&&e>=n.left&&e<=n.right};function bn(e,t,n,r){var i=$e.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&gn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&gn(n,r,s)?1:a&&mn(r,a)?-1:1}function yn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY});return n<0?null:{pos:n,bias:bn(e,n,t.clientX,t.clientY)}}var On=I.ie&&I.ie_version<=11,wn=null,kn=0;dn.dragstart=function(e,t){var n=e.state.selection.primary,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},dn.drop=function(e,t){if(t.dataTransfer){var n=e.posAtCoords({x:t.clientX,y:t.clientY}),r=t.dataTransfer.getData("Text");if(!(n<0)&&r){t.preventDefault();var i=e.inputState.mouseSelection,o=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,a={from:n,insert:r},s=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(n,-1),head:s.mapPos(n,1)},annotations:p.l.userEvent.of("drop")})}}},dn.paste=function(e,t){e.observer.flush();var n=hn?null:t.clipboardData,r=n&&n.getData("text/plain");r?(pn(e,r),t.preventDefault()):function(e){var t=e.dom.parentNode;if(t){var n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){e.focus(),n.remove(),pn(e,n.value)}),50)}}(e)};var xn=null;function jn(e){e.docView.compositionDeco.size&&e.update([])}dn.copy=dn.cut=function(e,t){var n=function(e){var t,n=[],r=[],i=!1,o=Object(u.a)(e.selection.ranges);try{for(o.s();!(t=o.n()).done;){var a=t.value;a.empty||(n.push(e.sliceDoc(a.from,a.to)),r.push(a))}}catch(h){o.e(h)}finally{o.f()}if(!n.length){var s,l=-1,c=Object(u.a)(e.selection.ranges);try{for(c.s();!(s=c.n()).done;){var f=s.value.from,d=e.doc.lineAt(f);d.number>l&&(n.push(d.slice()),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),l=d.number}}catch(h){c.e(h)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r){xn=o?r:null;var a=hn?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"==t.type&&e.dispatch({changes:i,scrollIntoView:!0,annotations:p.l.userEvent.of("cut")})}},dn.focus=dn.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},dn.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},dn.compositionstart=dn.compositionupdate=function(e){e.inputState.composing||(e.docView.compositionDeco.size&&(e.observer.flush(),jn(e)),e.inputState.composing=!0)},dn.compositionend=function(e){e.inputState.composing=!1,e.inputState.compositionEndedAt=Date.now(),setTimeout((function(){e.inputState.composing||jn(e)}),50)};var Sn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},En=I.ie&&I.ie_version<=11,Cn=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new G,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;i.queue.push(r)}}catch(o){n.e(o)}finally{n.f()}I.ie&&I.ie_version<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?i.flushSoon():i.flush()})),En&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=function(){if(i.view.root.activeElement==i.dom){if(I.ie&&I.ie_version<=11&&!i.view.state.selection.primary.empty){var e=Q(i.view.root);if(e.focusNode&&W(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return i.flushSoon()}i.flush()}},this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&(this.flush(),this.onScrollChanged(e))}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var e=0,t=null,n=this.dom;n;)if(1==n.nodeType)!t&&e=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var o=Q(this.view.root),a=!this.ignoreSelection.eq(o)&&B(this.dom,o);if(0!=n.length||a){var s,l=-1,c=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==l?(l=p.from,c=p.to):(l=Math.min(p.from,l),c=Math.max(p.to,c)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(l>-1||a)&&this.onChange(l,c,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(),"childList"==e.type){var n=Pn(t,e.previousSibling||e.target.previousSibling,-1),r=Pn(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function Pn(e,t,n){for(;t;){var r=ne.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}var Mn="\ufdda";function Tn(e,t,n,r){var i,o,a,s=e.state.selection.primary;if(t>-1&&(a=e.docView.domBoundsAround(t,n,0))){var l=a,c=l.from,u=l.to,f=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e,t){var n=[];if(t.activeElement!=e)return n;var r=Q(t),i=r.anchorNode,o=r.anchorOffset,a=r.focusNode,s=r.focusOffset;i&&(n.push(new Rn(i,o)),a==i&&s==o||n.push(new Rn(a,s)));return n}(e.contentDOM,e.root),d=new Dn(f);d.readRange(a.startDOM,a.endDOM),o=function(e,t){if(0==e.length)return null;var n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?p.d.single(n+t,r+t):null}(f,c);var h=s.from,v=null;8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100&&(h=s.to,v="end");var m=function(e,t,n,r){var i=Math.min(e.length,t.length),o=0;for(;o0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.doc.sliceString(c,u,Mn),d.text,h-c,v);m&&(i={from:c+m.from,to:c+m.toA,insert:p.k.of(d.text.slice(m.from,m.toB).split(Mn))})}else if(e.hasFocus){var g=Q(e.root),b=e.docView,y=b.impreciseHead,O=b.impreciseAnchor,w=y&&y.node==g.focusNode&&y.offset==g.focusOffset?e.state.selection.primary.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),k=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset?e.state.selection.primary.anchor:function(e){var t=e.isCollapsed;return t&&I.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t}(g)?w:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);w==s.head&&k==s.anchor||(o=p.d.single(k,w))}if(i||o)if(!i&&r&&!s.empty&&o&&o.primary.empty&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}),i){var x=e.state;if(I.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&Nn(e,"Enter",10)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&Nn(e,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&Nn(e,"Delete",46)))return;var j,S=i.insert.toString();if(e.state.facet(Ot).some((function(t){return t(e,i.from,i.to,S)})))return;if(i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3){var E=s.fromi.to?x.doc.sliceString(i.to,s.to,Mn):"";j=x.replaceSelection(p.k.of((E+i.insert.sliceString(0,void 0,Mn)+C).split(Mn)))}else{var P=x.changes(i);j={changes:P,selection:o&&!x.selection.primary.eq(o.primary)&&o.primary.to<=P.newLength?x.selection.replaceRange(o.primary):void 0}}e.dispatch(j,{scrollIntoView:!0,annotations:p.l.userEvent.of("input")})}else if(o&&!o.primary.eq(s)){var M,T=!1;e.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==e.inputState.lastSelectionOrigin?T=!0:M=p.l.userEvent.of(e.inputState.lastSelectionOrigin)),e.dispatch({selection:o,scrollIntoView:T,annotations:M})}}var Dn=function(){function e(t){Object(f.a)(this,e),this.points=t,this.text=""}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var o=ne.get(r),a=ne.get(i);((o?o.breakAfter:An(r))||(a?a.breakAfter:An(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=Mn),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=ne.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,Mn):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?Mn:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t)}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(o){r.e(o)}finally{r.f()}}}]),e}();function An(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var Rn=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};function Nn(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);e.contentDOM.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return e.contentDOM.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var Ln=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.className=Re("scroller"),this.scrollDOM.appendChild(this.contentDOM),this.dom=document.createElement("div"),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new It(n.state||p.e.create()),this.plugins=this.state.facet(Et).map((function(e){return Tt.create(e,t)})),this.observer=new Cn(this,(function(e,n,r){return Tn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.measure()})),this.docView=new Vt(this),this.inputState=new cn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,In(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof p.l?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");this.updateState=2;var t,n=this.state,r=Object(u.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=i.state}}catch(f){r.e(f)}finally{r.f()}var o=new _t(this,n,e),a=e.some((function(e){return e.scrollIntoView}))?n.selection.primary:null;this.viewState.update(o,a),this.bidiCache=Fn.update(this.bidiCache,o.changes),o.empty||this.updatePlugins(o);var s=this.docView.update(o);this.state.facet(Nt)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.updateState=0,(s||a||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure();var l,c=Object(u.a)(this.state.facet(yt));try{for(c.s();!(l=c.n()).done;){(0,l.value)(o)}}catch(f){c.e(f)}finally{c.f()}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new It(e),this.plugins=e.facet(Et).map((function(e){return Tt.create(e,t)})),this.docView=new Vt(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[],this.updateState=0,this.requestMeasure()}},{key:"updatePlugins",value:function(e){var t=e.prevState.facet(Et),n=e.state.facet(Et);if(t!=n){var r,i=[],o=[],a=Object(u.a)(n);try{for(a.s();!(r=a.n()).done;){var s=r.value,l=t.indexOf(s);if(l<0)i.push(Tt.create(s,this));else{var c=this.plugins[l].update(e);o.push(c),i.push(c)}}}catch(v){a.e(v)}finally{a.f()}var f,d=Object(u.a)(this.plugins);try{for(d.s();!(f=d.n()).done;){var h=f.value;o.indexOf(h)<0&&h.destroy(this)}}catch(v){d.e(v)}finally{d.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else for(var p=0;p-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;for(var t=null,n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var o=i.map((function(t){try{return t.read(e)}catch(n){return wt(e.state,n),Bn}})),a=new _t(this,this.state);a.flags|=r,t?t.flags|=r:t=a,this.updateState=2,this.updatePlugins(a),r&&this.docView.update(a);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure()}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(e,t)}},{key:"viewportLines",value:function(e,t){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,e,$n(t,this.contentDOM))}},{key:"moveByChar",value:function(e,t,n){return ln(this,e,t,n)}},{key:"moveByGroup",value:function(e,t){var n=this;return ln(this,e,t,(function(t){return function(e,t,n){var r=e.state.charCategorizer(t),i=r(n);return function(e){var t=r(e);return i==p.c.Space&&(i=t),i==t}}(n,e.head,t)}))}},{key:"moveToLineBoundary",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return sn(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return function(e,t,n,r){var i,o=t.head,a=n?1:-1;if(o==(n?e.state.doc.length:0))return p.d.cursor(o);var s=e.coordsAtPos(o);if(s)for(var l=e.dom.getBoundingClientRect(),c=null!==(i=t.goalColumn)&&void 0!==i?i:s.left-l.left,u=l.left+c,f=null!==r&&void 0!==r?r:5,d=a<0?s.top:s.bottom,h=0;h<50;h+=10){var v=an(e,{x:u,y:d+(f+h)*a},a);if(v<0)break;if(v!=o)return p.d.cursor(v,void 0,void 0,c)}var m=e.state.doc,b=m.lineAt(o),y=e.state.tabSize,O=t.goalColumn,w=0;if(null==O){for(var k=m.iterRange(b.from,o);!k.next().done;)w=Object(g.d)(k.value,w,y);O=w*e.defaultCharacterWidth}else w=Math.round(O/e.defaultCharacterWidth);if(a<0&&0==b.from)return p.d.cursor(0);if(a>0&&b.to==m.length)return p.d.cursor(b.to);for(var x=m.line(b.number+a),j=x.from,S=0,E=m.iterRange(x.from,x.to);S>=w&&!E.next().done;){var C=Object(g.e)(E.value,S,w,y),P=C.offset;S=w-C.leftOver,j+=P}return p.d.cursor(j,void 0,void 0,O)}(this,e,t,n)}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=p.d.cursor(e),this.requestMeasure()}},{key:"posAtCoords",value:function(e){return this.readMeasured(),an(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[Ye.find(i,e-r.from,-1,t)];return U(n,o.dir==Ne.LTR==t>0)}},{key:"bidiSpans",value:function(e){if(e.length>_n)return Ke(e.length);var t,n=this.textDirection,r=Object(u.a)(this.bidiCache);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.from==e.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Ge(e.slice(),this.textDirection);return this.bidiCache.push(new Fn(e.from,e.to,n,o)),o}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){Z(e.contentDOM),e.docView.updateSelection()}))}},{key:"destroy",value:function(){var e,t=Object(u.a)(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(n){t.e(n)}finally{t.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing}},{key:"themeClasses",get:function(){return Te+" "+(this.state.facet(Me)?"cm-dark":"cm-light")+" "+this.state.facet(Pe)}},{key:"contentHeight",get:function(){return this.viewState.heightMap.height+this.viewState.paddingTop+this.viewState.paddingBottom}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(e){return Ct.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[Pe.of(n),Nt.of(Ae(".".concat(Te,".").concat(n),e))];return t&&t.dark&&r.push(Me.of(!0)),r}},{key:"baseTheme",value:function(e){return Object(p.o)(Nt.of(Ae("."+Te,e)),"fallback")}}]),e}();Ln.styleModule=Nt,Ln.inputHandler=Ot,Ln.exceptionSink=bt,Ln.updateListener=yt,Ln.editable=kt,Ln.dragMovesSelection=mt,Ln.clickAddsSelectionRange=vt,Ln.mouseSelectionStyle=gt,Ln.decorations=Rt,Ln.lineWrapping=Ln.theme({$content:{whiteSpace:"pre-wrap"}}),Ln.contentAttributes=At,Ln.editorAttributes=Dt;var _n=4096;function $n(e,t){return null==e?t.getBoundingClientRect().top:e}var zn=-1;function In(){window.addEventListener("resize",(function(){-1==zn&&(zn=setTimeout(Qn,50))}))}function Qn(){zn=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t1&&void 0!==arguments[1]?arguments[1]:Wn,r=Object.create(null),i=Object.create(null),o=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},a=function(e,t,i,a){for(var s=r[e]||(r[e]=Object.create(null)),l=t.split(/ (?!$)/).map((function(e){return Hn(e,n)})),c=function(t){var n=l.slice(0,t).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=Gn={view:t,prefix:n,scope:e};return setTimeout((function(){Gn==r&&(Gn=null)}),4e3),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[er.of(e),rr,or]}var nr=function(){function e(t,n,r,i,o){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=o}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px",e}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),rr=Ct.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className=Re("selectionLayer"),this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className=Re("cursorLayer"),this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Object(d.a)(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(er).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.prevState.facet(er)!=e.state.facet(er);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((function(e){return e.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}},{key:"readPos",value:function(){var e,t=this,n=this.view.state,r=n.facet(er),i=n.selection.ranges.map((function(e){return e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];var n=Math.max(t.from,e.viewport.from),r=Math.min(t.to,e.viewport.to),i=e.textDirection==Ne.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=sr(e),l=window.getComputedStyle(o.firstChild),c=a.left+parseInt(l.paddingLeft),f=a.right-parseInt(l.paddingRight),d=e.visualLineAt(n),h=e.visualLineAt(r);if(d.from==h.from)return y(O(t.from,t.to));var v=O(t.from,null),m=O(null,t.to),g=[];return d.tod&&m.from=b)break;j>g&&s(Math.max(x,g),null==t&&x<=d,Math.min(j,b),null==n&&j>=h,k.dir)}}catch(E){w.e(E)}finally{w.f()}if((g=O.to+1)>=b)break}}}catch(E){v.e(E)}finally{v.f()}if(0==a.length){var S=e.coordsAtPos(d,-1);r=Math.min(S.top,r),o=Math.max(S.bottom,o)}return{top:r,bottom:o,horizontal:a}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),o=[],a=Object(u.a)(n.selection.ranges);try{for(a.s();!(e=a.n()).done;){var s=e.value,l=s==n.selection.primary;if(s.empty?!l||Jn:r.drawRangeCursor){var c=ur(this.view,s,l);c&&o.push(c)}}}catch(f){a.e(f)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(e){var t=this,n=e.rangePieces,r=e.cursors;if(n.length!=this.rangePieces.length||n.some((function(e,n){return!e.eq(t.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=Object(u.a)(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(f){o.e(f)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){this.cursorLayer.textContent="";var s,l=Object(u.a)(r);try{for(l.s();!(s=l.n()).done;){var c=s.value;this.cursorLayer.appendChild(c.draw())}}catch(f){l.e(f)}finally{l.f()}this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),ir={$content:{"& ::selection":{backgroundColor:"transparent !important"}}};Jn&&(ir.$content.caretColor="transparent !important");var or=Object(p.o)(Ln.theme(ir),"override"),ar=Re("selectionBackground");function sr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:t.left-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}var lr=Re("cursor.primary"),cr=Re("cursor.secondary");function ur(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=sr(e);return new nr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?lr:cr)}var fr=/[\0-\x08\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200C\u200E\u200F\u2028\u2029\uFEFF\uFFF9-\uFFFC]/g,dr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},hr=null;function pr(){if(null==hr&&"undefined"!=typeof document&&document.body){var e=document.body.style;hr=null!=(e.tabSize||e.MozTabSize)}return hr||!1}var vr=null!=/x/.unicode?"gu":"g",mr=p.f.define({combine:function(e){var t=Object(p.m)(e,{render:null,specialChars:fr,addSpecialChars:null});return(t.replaceTabs=!pr())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,vr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,vr)),t}});function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[mr.of(e),br];return pr()||t.push(kr),t}var br=Ct.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=ke.none,this.decorationCache=Object.create(null),this.recompute()}return Object(d.a)(e,[{key:"update",value:function(e){var t=e.prevState.facet(mr)!=e.state.facet(mr);t&&(this.decorationCache=Object.create(null)),(t||e.changes.length||e.viewportChanged)&&this.recompute()}},{key:"recompute",value:function(){var e,t=[],n=Object(u.a)(this.view.visibleRanges);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.from,o=r.to;this.getDecorationsFor(i,o,t)}}catch(a){n.e(a)}finally{n.f()}this.decorations=ke.set(t)}},{key:"getDecorationsFor",value:function(e,t,n){for(var r,i=this.view.state.facet(mr),o=this.view.state.doc,a=e,s=o.iterRange(e,t);!s.next().done;){if(!s.lineBreak)for(;r=i.specialChars.exec(s.value);){var l=Object(g.b)(r[0],0),c=void 0;if(null!=l){if(9==l){var u=o.lineAt(a+r.index),f=this.view.state.tabSize,d=Object(g.d)(o.sliceString(u.from,a+r.index),0,f);c=ke.replace({widget:new Or((f-d%f)*this.view.defaultCharacterWidth)})}else c=this.decorationCache[l]||(this.decorationCache[l]=ke.replace({widget:new yr(i,l)}));n.push(c.range(a+r.index,a+r.index+r[0].length))}}a+=s.value.length}}}]),e}(),{decorations:function(e){return e.decorations}});var yr=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).options=e,i.code=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(){var e,t=((e=this.code)>=32?null:10==e?"\u2424":String.fromCharCode(9216+e))||"\u2022",n="Control character "+(dr[this.code]||this.code),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;var i=document.createElement("span");return i.textContent=t,i.title=n,i.setAttribute("aria-label",n),i.style.color="red",i}},{key:"ignoreEvent",value:function(){return!1}}]),n}(we),Or=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).width=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className=wr,e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(we),wr=v.a.newName(),kr=Ln.styleModule.of(new v.a(Object(r.a)({},"."+wr,{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"})));function xr(){return p.e.transactionFilter.of((function(e){if(!e.docChanged||"input"!=e.annotation(p.l.userEvent))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.primary.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.primary.head,i=n.lineAt(r);if(r>i.from+200)return e;var o=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(o)})))return e;var a,s=e.state,l=-1,f=[],d=Object(u.a)(s.selection.ranges);try{var h=function(){var e=a.value.head,t=s.doc.lineAt(e);if(t.from==l)return"continue";l=t.from;var n=Math.max.apply(Math,Object(c.a)(s.facet(p.e.indentation).map((function(e){return e(new p.g(s),t.from)}))));if(n<0)return"continue";var r=/^\s*/.exec(t.slice(0,Math.min(t.length,200)))[0],i=s.indentString(n);r!=i&&f.push({from:t.from,to:t.from+r.length,insert:i})};for(d.s();!(a=d.n()).done;)h()}catch(v){d.e(v)}finally{d.f()}return f.length?[e,{changes:f}]:e}))}},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=n.n(o),s=(n(11),n(93)),l=n.n(s),c=n(188),u=n(218),f=n(147),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=a.a.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)(Object(r.a)({},n.defaultProps),e)),v=c;return("string"===typeof h||d)&&(s=Object(f.a)()||o,h&&(v=Object(u.a)({theme:s,name:h,props:c})),d&&!v.theme&&(v.theme=s)),a.a.createElement(n,Object(r.a)({ref:l||t,classes:p},v))}));return l()(g,n),g}},h=n(63);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(173)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(16);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;te)return u[t-1]<=e;return!1}function h(e){return e>=127462&&e<=127487}function p(e,t){if(t==e.length)return t;t&&m(e.charCodeAt(t))&&g(e.charCodeAt(t-1))&&t--;var n=b(e,t);for(t+=O(n);t=0&&h(b(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function v(e,t){for(;t>0;){var n=p(e,t-2);if(n=56320&&e<57344}function g(e){return e>=55296&&e<56320}function b(e,t){var n=e.charCodeAt(t);if(!g(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return m(r)?r-56320+(n-55296<<10)+65536:n}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function O(e){return e<65536?1:2}function w(e,t,n){for(var r=0;r=n)return{offset:i,leftOver:0};t+=9==e.charCodeAt(i)?r-t%r:1,i=p(e,i)}return{offset:e.length,leftOver:n-t}}var x=function(){function e(){Object(l.a)(this,e)}return Object(c.a)(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.from<=e&&r.to>=e)return r}}catch(i){n.e(i)}finally{n.f()}return E(this.lineInner(e,!1,1,0).finish(this))}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.number==e)return r}}catch(i){n.e(i)}finally{n.f()}return E(this.lineInner(e,!0,1,0).finish(this))}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r),r.push(n),this.decompose(t,this.length,r),P.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return 0==this.length?e:0==e.length?this:P.from([this,e],this.length+e.length)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n),P.from(n,t-e)}},{key:"eq",value:function(e){return this==e||function(e,t){if(e.length!=t.length||e.lines!=t.lines)return!1;for(var n=new A(e),r=new A(t),i=0,o=0;;){if(n.lineBreak!=r.lineBreak||n.done!=r.done)return!1;if(n.done)return!0;if(n.lineBreak)n.next(),r.next(),i=o=0;else{var a=n.value.slice(i),s=r.value.slice(o);if(a.length==s.length){if(a!=s)return!1;n.next(),r.next(),i=o=0}else if(a.length>s.length){if(a.slice(0,s.length)!=s)return!1;i+=s.length,r.next(),o=0}else{if(s.slice(0,a.length)!=a)return!1;o+=a.length,n.next(),i=0}}}}(this,e)}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new A(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new R(this,e,t)}},{key:"iterLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new N(this,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){for(var e=[],t=this.iterLines();!t.next().done;)e.push(t.value);return e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");if(1==t.length&&!t[0]&&e.empty)return e.empty;var n=M(t);return n<1024?new C(t,n):P.from(C.split(t,[]),n)}}]),e}();"undefined"!=typeof Symbol&&(x.prototype[Symbol.iterator]=function(){return this.iter()});var j=[],S=-1;function E(e){return j[S=(S+1)%10]=e}var C=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M(e);return Object(l.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new L(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r){r.push(new n(D(this.text,e,t),Math.min(t,this.length)-Math.max(0,e)))}},{key:"lastLineLength",value:function(){return this.text[this.text.length-1].length}},{key:"firstLineLength",value:function(){return this.text[0].length}},{key:"replace",value:function(e,t,o){var a=this.length+o.length-(t-e);return a>=1024||!(o instanceof n)?Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,o):new n(T(this.text,T(o.text,D(this.text,0,e)),t),a)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){e[e.length-1]+=this.text[0];for(var t=1;t=56320&&f<57344&&u++,i.push(l.slice(0,u)),t.push(new n(i,512)),l=l.slice(u),o=-1,i=[]}}catch(d){a.e(d)}finally{a.f()}return-1!=o&&t.push(new n(i,o)),t}}]),n}(x),P=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e,r){var i;Object(l.a)(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=1;var o,a=Object(s.a)(e);try{for(a.s();!(o=a.n()).done;){var c=o.value;i.lines+=c.lines-1}}catch(u){a.e(u)}finally{a.f()}return i}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e){var l=o.lineInner(e,t,n,r),c=void 0;return l.from==r&&(c=this.lineLengthTo(i))&&(l.from-=c,l.content=null),l.to==a&&(c=this.lineLengthFrom(i+1))&&(l.to+=c,l.content=null),l}r=a,n=s}}},{key:"decompose",value:function(e,t,n){for(var r=0,i=0;ii&&(i>=e&&a<=t?n.push(o):o.decompose(e-i,t-i,n)),i=a}}},{key:"lineLengthTo",value:function(e){for(var t=0,n=e-1;n>=0;n--){var r=this.children[n];if(r.lines>1)return t+r.lastLineLength();t+=r.length}return t}},{key:"lastLineLength",value:function(){return this.lineLengthTo(this.children.length)}},{key:"lineLengthFrom",value:function(e){for(var t=0,n=e;n1)return t+r.firstLineLength();t+=r.length}return t}},{key:"firstLineLength",value:function(){return this.lineLengthFrom(0)}},{key:"replace",value:function(e,t,o){if(o.length<512&&t-e<512)for(var a=o.length-(t-e),s=0,l=0;s=l&&t<=u&&c.length+a>2&&c.length+a>0){var f=this.children.slice();return f[s]=c.replace(e-l,t-l,o),new n(f,this.length+a)}l=u}return Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;oo){var l=a.sliceString(e-o,t-o,n);if(e>=o&&t<=s)return l;r+=l}o=s}return r}},{key:"flatten",value:function(e){var t,n=Object(s.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(e,t){if(!e.every((function(e){return e instanceof x})))throw new Error("NOP");if(t<1024){var r,i=[""],o=Object(s.a)(e);try{for(o.s();!(r=o.n()).done;){r.value.flatten(i)}}catch(g){o.e(g)}finally{o.f()}return new C(i,t)}var a=Math.max(512,t>>3),l=a<<1,c=a>>1,u=[],f=0,d=[];function h(e){var t,r=e.length;if(r)if(r>l&&e instanceof n){var i,o=Object(s.a)(e.children);try{for(o.s();!(i=o.n()).done;){h(i.value)}}catch(g){o.e(g)}finally{o.f()}}else r>c&&(f>c||0==f)?(p(),u.push(e)):e instanceof C&&f>0&&(t=d[d.length-1])instanceof C&&e.length+t.length<=512?(f+=r,d[d.length-1]=new C(T(e.text,t.text.slice()),e.length+t.length)):(f+r>a&&p(),f+=r,d.push(e))}function p(){0!=f&&(u.push(1==d.length?d[0]:n.from(d,f)),f=0,d.length=0)}var v,m=Object(s.a)(e);try{for(m.s();!(v=m.n()).done;){h(v.value)}}catch(g){m.e(g)}finally{m.f()}return p(),1==u.length?u[0]:new n(u,t)}}]),n}(x);function M(e){var t,n=-1,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function T(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Object(l.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?0:t instanceof C?t.text.length:t.children.length]}return Object(c.a)(e,[{key:"next",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var t=this.nodes.length-1;if(t<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[t],r=this.offsets[t];if(n instanceof C){if(r!=(this.dir>0?0:n.text.length)&&!this.lineBreak){if(this.lineBreak=!0,0==e)return this.value="\n",this;e--;continue}var i=n.text[r-(this.dir<0?1:0)];if(this.offsets[t]=r+=this.dir,r==(this.dir>0?n.text.length:0)&&(this.nodes.pop(),this.offsets.pop()),this.lineBreak=!1,i.length>Math.max(0,e))return this.value=0==e?i:this.dir>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else if(r==(this.dir>0?n.children.length:0))this.nodes.pop(),this.offsets.pop();else{var o=n.children[this.dir>0?r:r-1],a=o.length;this.offsets[t]=r+this.dir,e>a?e-=a:(this.nodes.push(o),this.offsets.push(this.dir>0?0:o instanceof C?o.text.length:o.children.length))}}}}]),e}(),R=function(){function e(t,n,r){Object(l.a)(this,e),this.value="",this.cursor=new A(t,n>r?-1:1),n>r?(this.skip=t.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return Object(c.a)(e,[{key:"next",value:function(){if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;this.skip=0,this.value=t;var i=n?1:t.length;i>this.limit&&(this.value=this.cursor.dir>0?t.slice(0,this.limit):t.slice(i-this.limit)),r||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),e}(),N=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(l.a)(this,e),this.value="",this.done=!1,this.cursor=t.iter(),this.skip=n}return Object(c.a)(e,[{key:"next",value:function(){if(this.cursor.done)return this.done=!0,this.value="",this;for(this.value="";;){var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;if(this.skip=0,r||n)return this;this.value+=t}}},{key:"lineBreak",get:function(){return!1}}]),e}(),L=function(){function e(t,n,r,i){Object(l.a)(this,e),this.from=t,this.to=n,this.number=r,this.content=i}return Object(c.a)(e,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;if(e==t)return"";if("string"==typeof this.content)return this.content.slice(e,t);this.content||(this.content=new _(this.doc,this.from));var n=this.content.slice(e,t);return 0==e&&t==this.length&&(this.content=n),n}},{key:"finish",value:function(e){return this.doc=e,this}},{key:"findClusterBreak",value:function(e,t){if(e<0||e>this.length)throw new RangeError("Invalid position given to Line.findClusterBreak");var n,r;return"string"==this.content?(n=this.from,r=this.content):(n=Math.max(0,e-256),r=this.slice(n,Math.min(this.length,n+512))),(t?p:v)(r,e-n)+n}},{key:"length",get:function(){return this.to-this.from}}]),e}(),_=function(){function e(t,n){Object(l.a)(this,e),this.doc=t,this.start=n,this.cursor=null,this.strings=null}return Object(c.a)(e,[{key:"slice",value:function(e,t){this.cursor||(this.cursor=this.doc.iter(),this.strings=[this.cursor.next(this.start).value]);for(var n="",r=0,i=0;;i++){if(i==this.strings.length){var o=this.cursor.next().value;if(!o)return n;this.strings.push(o)}var a=this.strings[i],s=r;if(!((r+=a.length)<=e)&&(n+=a.slice(Math.max(0,e-s),Math.min(a.length,t-s)),r>=t))return n}}}]),e}()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(37);function i(e){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(81);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}function s(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(r.a)(e);if(t){var o=Object(r.a)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},,function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d}));var r=n(148);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),a({type:c,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?f(e,t):d(e,t)}function u(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function f(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(36);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y}));var r=n(19),i=n(18),o=n(5),a=n(4),s=n(7),l=1024,c=function(){function e(t,n){Object(a.a)(this,e),this.enter=t,this.leave=n,this.result=void 0}return Object(s.a)(e,[{key:"doEnter",value:function(e,t,n){var r=this.enter(e,t,n);return void 0===r||(!1!==r&&(this.result=r),!1)}},{key:"done",get:function(){return void 0!==this.result}}]),e}(),u=0,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.deserialize;Object(a.a)(this,e),this.id=u++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(s.a)(e,[{key:"set",value:function(e,t){return e[this.id]=t,e}},{key:"add",value:function(e){return new d(this,"function"==typeof e?e:h.match(e))}}],[{key:"string",value:function(){return new e({deserialize:function(e){return e}})}},{key:"number",value:function(){return new e({deserialize:Number})}},{key:"flag",value:function(){return new e({deserialize:function(){return!0}})}}]),e}();f.error=f.flag(),f.skipped=f.flag(),f.closedBy=new f({deserialize:function(e){return e.split(" ")}}),f.openedBy=new f({deserialize:function(e){return e.split(" ")}}),f.top=f.flag();var d=function e(t,n){Object(a.a)(this,e),this.prop=t,this.f=n},h=function(){function e(t,n,r){Object(a.a)(this,e),this.name=t,this.props=n,this.id=r}return Object(s.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}}],[{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=Object(o.a)(n.split(" "));try{for(i.s();!(r=i.n()).done;){var a=r.value;t[a]=e[n]}}catch(s){i.e(s)}finally{i.f()}}return function(e){return t[e.name]}}}]),e}();h.none=new h("",Object.create(null),0);var p=function(){function e(t){Object(a.a)(this,e),this.types=t;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.resolveAt(e);if(0!=t)for(;;){var r=t<0?n.childBefore(e):n.childAfter(e);if(!r||(t<0?r.end:r.start)!=e)break;n=r}return n}},{key:"name",get:function(){return this.type.name}},{key:"depth",get:function(){for(var e=0,t=this.parent;t;t=t.parent)e++;return e}},{key:"root",get:function(){for(var e=this;e.parent;)e=e.parent;return e}},{key:"firstChild",get:function(){return this.childAfter(this.start-1)}},{key:"lastChild",get:function(){return this.childBefore(this.end+1)}}]),e}(),m=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o){var s;return Object(a.a)(this,n),(s=t.call(this)).type=e,s.children=r,s.positions=i,s.length=o,s}return Object(s.a)(n,[{key:"toString",value:function(){var e=this.children.map((function(e){return e.toString()})).join();return this.name?(/\W/.test(this.name)&&!this.type.prop(f.error)?JSON.stringify(this.name):this.name)+(e.length?"("+e+")":""):e}},{key:"partial",value:function(e,t,r,i,o){for(var a=0;at)break;var l=this.children[a],c=s+l.length;c=c?(i.push(l),o.push(s+r)):l instanceof n&&l.partial(e-s,t-s,r+s,i,o))}}},{key:"applyChanges",value:function(e){if(0==e.length)return this;var t=[],r=[];function i(e,t,n){var r=-1;return e.iterate({from:t,to:n<0?0:e.length,enter:function(){return r<0&&void 0},leave:function(e,i,o){r<0&&(n<0?o<=t:i>=t)&&!e.prop(f.error)&&(r=n<0?Math.min(t,o-1):Math.max(t,i+1))}}),r>-1?r:n<0?0:e.length}for(var o=0,a=0,s=0;;a++){var l=a==e.length?null:e[a],c=l?i(this,l.fromA,-1):this.length;if(c>s&&this.partial(s,c,o,t,r),!l)break;s=i(this,l.toA,1),o+=l.toB-l.fromB-(l.toA-l.fromA)}return new n(h.none,t,r,this.length+o)}},{key:"cut",value:function(e){if(e>=this.length)return this;for(var t=[],r=[],i=0;i=e)break;var a=this.children[i],s=o+a.length;t.push(s<=e?a:a.cut(e-o)),r.push(o)}return new n(this.type,t,r,e)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return this.iterInner(n,i,0,s),s.result}},{key:"iterInner",value:function(e,t,n,r){if(!this.type.name||r.doEnter(this.type,n,n+this.length)){if(e<=t)for(var i=0;it)break;s=0&&!r.done;l--){var c=this.children[l],u=this.positions[l]+n;if(u+c.lengthe||c.iterInner(e,t,u,r)}r.leave&&this.type.name&&r.leave(this.type,n,n+this.length)}}},{key:"resolveAt",value:function(e){if(g==this)for(var t=b;;){var n=t.parent;if(!n)break;if(t.starte)return t.resolve(e);t=n}return g=this,b=this.resolveInner(e,0,this)}},{key:"childBefore",value:function(e){return this.findChild(e,-1,0,this)}},{key:"childAfter",value:function(e){return this.findChild(e,1,0,this)}},{key:"findChild",value:function(e,t,r,i){for(var o=0;o=e)if(t<0&&o>0)s=o-1;else{if(!(t>0))break;s=o}if(s<0&&(a+this.children[o].length>e||t<0&&o==this.children.length-1)&&(s=o),s>=0){var l=this.children[s],c=this.positions[s]+r;if(0==l.length&&c==e)continue;if(l instanceof n)return l.type.name?new O(l,c,i):l.findChild(e,t,c,i);var u=l.findIndex(e,t,c,0,l.buffer.length);if(u>-1)return new w(l,c,u,i)}}return null}},{key:"resolveInner",value:function(e,t,n){var r=this.findChild(e,0,t,n);return r?r.resolveAt(e):n}},{key:"append",value:function(e){if(e.children.length&&e.positions[0]0&&void 0!==arguments[0]?arguments[0]:l;return this.children.length<=x?this:S(this.type,h.none,this.children,this.positions,0,this.children.length,0,e,this.length)}},{key:"start",get:function(){return 0}},{key:"end",get:function(){return this.length}}],[{key:"build",value:function(e){return j(e)}}]),n}(v);m.empty=new m(h.none,[],[],0),m.prototype.parent=null;var g=m.empty,b=m.empty,y=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.none;Object(a.a)(this,e),this.buffer=t,this.length=n,this.group=r,this.type=i}return Object(s.a)(e,[{key:"toString",value:function(){for(var e=[],t=0;t(e+=4)){for(var a=[];et)return this.buffer.length;if(s>=e&&i.doEnter(o,a,s)){for(;r0?(l=s.pop(),c=a.buffer[l+3]):c=-1};u();e:for(var f=i;f>r&&!o.done;){for(;c==f;){var d=l,h=this.buffer[d],p=this.buffer[d+1]+n,v=this.buffer[d+2]+n;if(u(),p<=e&&v>=t&&!o.doEnter(this.group.types[h],p,v)){for(f=d;c>d;)u();continue e}}var m=this.buffer[--f],g=this.buffer[--f]+n,b=this.buffer[--f]+n,y=this.buffer[--f];b>e||g=e){if(t>0&&!u)return a;break}if(c>e)return a;u||(o=a),a=s[a+3]}return t<0?o:-1}}]),e}(),O=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var o;return Object(a.a)(this,n),(o=t.call(this)).node=e,o.start=r,o.parent=i,o}return Object(s.a)(n,[{key:"resolveAt",value:function(e){return e<=this.start||e>=this.end?this.parent.resolveAt(e):this.node.resolveInner(e,this.start,this)}},{key:"childBefore",value:function(e){return this.node.findChild(e,-1,this.start,this)}},{key:"childAfter",value:function(e){return this.node.findChild(e,1,this.start,this)}},{key:"toString",value:function(){return this.node.toString()}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return this.node.iterInner(n,i,this.start,s),s.result}},{key:"type",get:function(){return this.node.type}},{key:"end",get:function(){return this.start+this.node.length}}]),n}(v),w=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o){var s;return Object(a.a)(this,n),(s=t.call(this)).buffer=e,s.bufferStart=r,s.index=i,s.parent=o,s}return Object(s.a)(n,[{key:"childBefore",value:function(e){var t=this.buffer.findIndex(e,-1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"childAfter",value:function(e){var t=this.buffer.findIndex(e,1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return n<=i?this.buffer.iterChild(n,i,this.bufferStart,this.index,s):this.buffer.iterRev(n,i,this.bufferStart,this.index,this.endIndex,s),s.result}},{key:"resolveAt",value:function(e){if(e<=this.start||e>=this.end)return this.parent.resolveAt(e);var t=this.buffer.findIndex(e,0,this.bufferStart,this.index+4,this.endIndex);return t<0?this:new n(this.buffer,this.bufferStart,t,this).resolveAt(e)}},{key:"toString",value:function(){var e=[];return this.buffer.childToString(this.index,e),e.join("")}},{key:"type",get:function(){return this.buffer.group.types[this.buffer.buffer[this.index]]}},{key:"start",get:function(){return this.buffer.buffer[this.index+1]+this.bufferStart}},{key:"end",get:function(){return this.buffer.buffer[this.index+2]+this.bufferStart}},{key:"endIndex",get:function(){return this.buffer.buffer[this.index+3]}}]),n}(v),k=function(){function e(t,n){Object(a.a)(this,e),this.buffer=t,this.index=n}return Object(s.a)(e,[{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}}]),e}(),x=8;function j(e){var t=e.buffer,n=e.group,r=e.topID,i=void 0===r?0:r,o=e.maxBufferLength,a=void 0===o?l:o,s=e.reused,c=void 0===s?[]:s,u=e.minRepeatType,f=void 0===u?n.types.length:u,d=Array.isArray(t)?new k(t,t.length):t,p=n.types;function v(e,t,r,i,o){for(var s=d.id,l=d.start,u=d.end,b=d.size;s==o;)d.next(),s=d.id,l=d.start,u=d.end,b=d.size;var O=l-e;if(b<0)return r.push(c[s]),i.push(O),void d.next();var w,k,j=p[s];if(u-l<=a&&(k=function(e,t){var n=d.fork(),r=0,i=0,o=0,s=n.end-a,l={size:0,start:0,skip:0};e:for(var c=n.pos-e;n.pos>c;)if(n.id!=t){var u=n.size,h=n.pos-u;if(u<0||h=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0)break e;n.id>=f&&(p+=4),n.next()}i=v,r+=u,o+=p}else l.size=r,l.start=i,l.skip=o,o+=4,r+=4,n.next();(t<0||r==e)&&(l.size=r,l.start=i,l.skip=o);return l.size>4?l:void 0}(d.pos-t,o))){for(var E=new Uint16Array(k.size-k.skip),C=d.pos-k.size,P=E.length;d.pos>C;)P=g(k.start,E,P,o);w=new y(E,u-k.start,n,o<0?h.none:p[o]),O=k.start-e}else{var M=d.pos-b;d.next();for(var T=[],D=[],A=s>=f?s:-1;d.pos>M;)v(l,M,T,D,A);T.reverse(),D.reverse(),w=A>-1&&T.length>x?S(j,j,T,D,0,T.length,0,a,u-l):new m(j,T,D,u-l)}r.push(w),i.push(O)}function g(e,t,n,r){var i=d.id,o=d.start,a=d.end,s=d.size;if(d.next(),i==r)return n;var l=n;if(s>4)for(var c=d.pos-(s-4);d.pos>c;)n=g(e,t,n,r);return i0;)v(0,0,b,O,-1);var w=b.length?O[0]+b[0].length:0;return new m(n.types[i],b.reverse(),O.reverse(),w)}function S(e,t,n,r,i,o,a,s,l){var c=[],u=[];if(l<=s)for(var f=i;fd)break}if(p==v+1){var b=n[v];if(b instanceof m&&b.type==t&&b.length>d<<1){for(var y=0;y1&&void 0!==arguments[1]?arguments[1]:e;return new l(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=a.h.TrackDel;var l=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function c(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=500,f=1e9,d=function(){function e(t,n,r,o){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=o}return Object(o.a)(e,[{key:"findIndex",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t*f,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(e<=0)return r;for(var i=t<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,l=i[s]-e||(t<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==o)return l>=0?o:a;l>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1),o=this.findIndex(n,1,void 0,i);i(h=n.mapPos(f,c.endSide))||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),e}(),h=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,o=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=o}return Object(o.a)(e,[{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filter,s=t.filterFrom,u=void 0===s?0:s,f=t.filterTo,d=void 0===f?this.length:f;if(0==r.length&&!a)return this;if(o&&r.slice().sort(c),this==e.empty)return r.length?e.of(r):this;for(var h=new v(this,null,-1).goto(0),m=0,g=[],b=new p;h.value||m=0){var y=r[m++];b.addInner(y.from,y.to,y.value)||g.push(y)}else 1==h.rangeIndex&&h.chunkIndexthis.chunkEnd(h.chunkIndex)||dh.to||d=o&&t<=o+a.length&&!1===a.between(o,t-o,n-o,r))return}this.nextLayer.between(t,n,r)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this==e.empty)return 0;var t,n=this.nextLayer.size,i=Object(r.a)(this.chunk);try{for(i.s();!(t=i.n()).done;){n+=t.value.value.length}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(e).goto(t)}},{key:"compare",value:function(t,n,i,o){var a,s=null!==(a=o.minPointSize)&&void 0!==a?a:-1,l=t.filter((function(t){return t.maxPoint>=500||t!=e.empty&&n.indexOf(t)<0&&t.maxPoint>=s})),c=n.filter((function(n){return n.maxPoint>=500||n!=e.empty&&t.indexOf(n)<0&&n.maxPoint>=s})),f=function(e,t){var n,i=new Map,o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;sl?1:0)):l>a&&(r.span(a,l,o.active,s),s=o.openEnd(l)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new p,o=Object(r.a)(e instanceof l?[e]:n?e.slice().sort(c):e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return i.finish()}}]),e}();h.empty=new h([],[],null,-1),h.empty.nextLayer=h.empty;var p=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-f,this.lastTo=-f,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(o.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new d(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(h.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new h(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();var v=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=o}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(e){return this.from-e.from||this.startSide-e.startSide||this.to-e.to||this.endSide-e.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),e}(),m=function(){function e(t){Object(i.a)(this,e),this.heap=t}return Object(o.a)(e,[{key:"goto",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=Object(r.a)(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=f,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),g(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new v(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function g(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var b=function(){function e(t,n,r){Object(i.a)(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-f,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){w(this.active,e),w(this.activeTo,e),w(this.activeRank,e),this.minActive=x(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),t&&w(t,r)}else{if(!this.cursor.value){this.to=this.endSide=f;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.frome&&this.forward(this.to,this.endSide);break}this.addActive(t),this.cursor.next()}}if(t){for(var o=0;othis.pointRank);n++)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>this.point.endSide)&&t.push(this.active[n]);return t}},{key:"openEnd",value:function(e){for(var t=0;te;)t++;return t}}]),e}();function y(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,l=r-t;;){var c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))||o.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),u>a)break;s=u,c<=0&&e.next(),c>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function x(e,t){for(var n=-1,r=f,i=0;i=t?e:""+Array(t+1-r.length).join(n)+e},b={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()-1?n.panels[r]:null}var d=a.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.specs=t.state.facet(u),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(l);this.top=new p(t,!0,n.topContainer),this.bottom=new p(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var i,a=Object(o.a)(this.panels);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.dom.className+=" "+h(s),s.mount&&s.mount()}}catch(c){a.e(c)}finally{a.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new p(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(u);if(n!=this.specs){var r,i=[],a=[],s=[],c=[],f=Object(o.a)(n);try{for(f.s();!(r=f.n()).done;){var d=r.value,v=this.specs.indexOf(d),m=void 0;v<0?(m=d(e.view),c.push(m)):(m=this.panels[v]).update&&m.update(e),i.push(m),(m.top?a:s).push(m)}}catch(x){f.e(x)}finally{f.f()}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(s);for(var g=0,b=c;g0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(80);var i=n(91),o=n(74);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(0),i=r.createContext();function o(){return r.useContext(i)}t.a=i},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var r=n(4),i=n(7),o="undefined"==typeof Symbol?"__\u037c":Symbol.for("\u037c"),a="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"==typeof e?window:e,l=function(){function e(t,n){Object(r.a)(this,e),this.rules=[];var i=n||{},o=i.process,a=i.extend;function s(e){if(/^@/.test(e))return[e];var t=e.split(",");return o?t.map(o):t}function l(e,t,n){var r=[],i=/^@(\w+)\b/.exec(e[0]);if(i&&null==t)return n.push(e[0]+";");var o=function(o){var c=t[o];if(/&/.test(o))l(e.map((function(e){return a?a(o,e):o.replace(/&/,e)})),c,n);else if(c&&"object"==typeof c){if(!i)throw new RangeError("The value of a property ("+o+") should be a primitive value.");l("keyframes"==i[1]?[o]:s(o),c,r)}else null!=c&&r.push(o.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+c+";")};for(var c in t)o(c);(r.length||i&&"keyframes"==i[1])&&n.push(e.join(",")+" {"+r.join(" ")+"}")}for(var c in t)l(s(c),t[c],this.rules)}return Object(i.a)(e,null,[{key:"newName",value:function(){var e=s[o]||1;return s[o]=e+1,"\u037c"+e.toString(36)}},{key:"mount",value:function(e,t){(e[a]||new u(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),c=null,u=function(){function e(t){if(Object(r.a)(this,e),t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(c)return t.adoptedStyleSheets=[c.sheet].concat(t.adoptedStyleSheets),t[a]=c;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),c=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[a]=this}return Object(i.a)(e,[{key:"mount",value:function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s0&&m(t.state,l.head-1,1,a)||a.afterCursor&&(m(t.state,l.head,1,a)||l.head0&&void 0!==arguments[0]?arguments[0]:{};return[u.of(e),h]}function v(e,t,n){var r=e.prop(t<0?a.c.openedBy:a.c.closedBy);if(r)return r;if(1==e.name.length){var i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function m(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||l,a=i.brackets||c,s=e.tree,u=s.resolve(t,n);return(r=v(u.type,n,a))?g(e,t,n,u,r,a):b(e,t,n,s,u.type,o,a)}function g(e,t,n,r,i,o){var a=r.parent,s={from:r.start,to:r.end},l=0;return a&&a.iterate({from:n<0?r.start:r.end,to:n<0?a.start:a.end,enter:function(e,t,a){if(!(n<0?a>r.start:t-1)return{start:s,end:{from:t,to:a},matched:!0};if(v(e,n,o))l++;else if(v(e,-n,o)&&0==--l)return{start:s,end:{from:t,to:a},matched:!1};return!1}}})||{start:s,matched:!1}}function b(e,t,n,r,i,o,a){var s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=o;){var h=u.value;n<0&&(d+=h.length);for(var p=t+d*n,v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){var g=a.indexOf(h[v]);if(!(g<0||r.resolve(p+v,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:p+v,to:p+v+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37);function i(e,t,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(24),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(27);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(144),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(187);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";e.exports=n(175)},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return J})),n.d(t,"b",(function(){return ee})),n.d(t,"c",(function(){return G}));n(13);var r=n(25),i=n(19),o=n(18),a=n(5),s=n(4),l=n(7),c=n(82),u=n(3),f=n(9),d=n(15),h=function(){function e(t,n,r){Object(s.a)(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Object(l.a)(e,[{key:"tokenBefore",value:function(e){for(var t=this.state.tree.resolve(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.start,to:this.pos,text:this.state.sliceDoc(t.start,this.pos),type:t.type}:null}},{key:"matchBefore",value:function(e){var t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.slice(n-t.from,this.pos-t.from),i=r.search(m(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"addEventListener",value:function(e,t){this.abortListeners&&this.abortListeners.push(t)}},{key:"aborted",get:function(){return null==this.abortListeners}}]),e}(),p=function e(t,n,r){Object(s.a)(this,e),this.completion=t,this.source=n,this.match=r};function v(e){return e.selection.primary.head}function m(e,t){var n,r=e.source,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(o?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function g(e,t){var n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length}}):n(e,t.completion,r.from,r.to)}var b=function(){function e(t){Object(s.a)(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(var n=0;n=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(j=Object(d.f)(x))!=j.toLowerCase()?1:j!=j.toUpperCase()?2:0;(1==S||0==k&&0!=S&&(this.chars[v]==x||this.folded[v]==x&&(m=!0)))&&(o[v++]=O),k=S,O+=Object(d.c)(x)}return v==l&&0==o[0]?this.result((m?-200:0)-100,o,e):g==l&&0==b?[-200,0,y]:s>-1?[-700,s,s+this.pattern.length]:g==l?[-900,b,y]:v==l?this.result((m?-200:0)-100-700,o,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}},{key:"result",value:function(e,t,n){var r,i=[e],o=1,s=Object(a.a)(t);try{for(s.s();!(r=s.n()).done;){var l=r.value,c=l+(this.astral?Object(d.c)(Object(d.b)(n,l)):1);o>1&&i[o-1]==l?i[o-1]=c:(i[o++]=l,i[o++]=c)}}catch(u){s.e(u)}finally{s.f()}return i}}]),e}(),y=u.f.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100})}}),O=f.d.baseTheme({"$tooltip.autocomplete":{"& > ul":{fontFamily:"monospace",overflowY:"auto",whiteSpace:"nowrap",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},"$completionListIncompleteTop:before, $completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},"$tooltip.completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},"$tooltip.completionInfo.left":{right:"100%"},"$tooltip.completionInfo.right":{left:"100%"},"$$light $snippetField":{backgroundColor:"#ddd"},"$$dark $snippetField":{backgroundColor:"#333"},$snippetFieldPosition:{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},$completionMatchedText:{textDecoration:"underline"},$completionDetail:{marginLeft:"0.5em",fontStyle:"italic"},$completionIcon:{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},"$completionIcon.function, $completionIcon.method":{"&:after":{content:"'\u0192'"}},"$completionIcon.class":{"&:after":{content:"'\u25cb'"}},"$completionIcon.interface":{"&:after":{content:"'\u25cc'"}},"$completionIcon.variable":{"&:after":{content:"'\ud835\udc65'"}},"$completionIcon.constant":{"&:after":{content:"'\ud835\udc36'"}},"$completionIcon.type":{"&:after":{content:"'\ud835\udc61'"}},"$completionIcon.enum":{"&:after":{content:"'\u222a'"}},"$completionIcon.property":{"&:after":{content:"'\u25a1'"}},"$completionIcon.keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},"$completionIcon.namespace":{"&:after":{content:"'\u25a2'"}},"$completionIcon.text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});function w(e,t,n){var r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true");for(var i=n.from;ip&&u.appendChild(document.createTextNode(d.slice(p,m)));var b=u.appendChild(document.createElement("span"));b.appendChild(document.createTextNode(d.slice(m,g))),b.className=Object(f.n)("completionMatchedText"),p=g}if(p>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var x=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.stateField=n,this.info=null,this.placeInfo={read:function(){return r.measureInfo()},write:function(e){return r.positionInfo(e)},key:this};var i=t.state.field(n),o=i.open,a=o.options,l=o.selected,c=t.state.facet(y);this.range=k(a.length,l,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.addEventListener("mousedown",(function(e){for(var n=r.range.from,i=e.target;i&&i!=r.list&&i.parentNode!=r.list;)i=i.parentNode;for(;i=i.previousSibling;)n++;n>=0&&n=this.range.to)&&(this.range=k(n.options.length,n.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(w(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected];r.completion.info&&(this.info=this.dom.appendChild(function(e){var t=document.createElement("div");t.className=Object(f.n)("tooltip.completionInfo");var n=e.completion.info;return"string"==typeof n?t.textContent=n:t.appendChild(n(e.completion)),t}(r)),this.view.requestMeasure(this.placeInfo))}}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==f.c.RTL,i=t.left,o=innerWidth-t.right;return r&&i=this.options.length?this:new e(this.options,E(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,[Object.assign(Object.assign({},this.tooltip[0]),{pos:t.mapPos(this.tooltip[0].pos)})],this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i){var o=function(e,t){var n,r=[],i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.hasResult()){var s,l=new b(t.sliceDoc(o.from,o.to)),c=void 0,u=Object(a.a)(o.result.options);try{for(u.s();!(s=u.n()).done;){var f=s.value;(c=l.match(f.label))&&(null!=f.boost&&(c[0]+=f.boost),r.push(new p(f,o,c)))}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){i.e(d)}finally{i.f()}return r.sort(M),r.length>300?r.slice(0,300):r}(t,n);if(!o.length)return null;var s,l=0;if(i)for(var c=i.options[i.selected].completion,u=0;uo?new T(this.source,"input"==t&&r.activateOnTyping?1:0,!1):this.span&&(i==o||this.span.test(e.state.sliceDoc(i,o)))?new n(this.source,this.explicit,this.result,i,o,this.span):new T(this.source,1,this.explicit)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new T(this.source,0,!1):new n(this.source,this.explicit,this.result,e.changes.mapPos(this.from),e.changes.mapPos(this.to,1),this.span)}},{key:"map",value:function(e){return new n(this.source,this.explicit,this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(T),A=u.i.define(),R=u.i.define({map:function(e,t){return e.map((function(e){return e.hasResult()&&!t.empty?e.map(t):e}))}}),N=u.i.define(),L=u.j.define({create:function(){return S.start()},update:function(e,t){return e.update(t)},provide:[c.b.nFrom((function(e){return e.tooltip})),f.d.contentAttributes.from((function(e){return e.attrs}))]});function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(L,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,o=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(o=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var a=r.open.selected+o*(e?1:-1),s=r.open.options.length;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:N.of(a)}),!0}}var $=function(e){var t=e.state.field(L,!1);return!(!t||!t.open||Date.now()-t.open.timestamp<75)&&(g(e,t.open.options[t.open.selected]),!0)},z=function e(t,n){Object(s.a)(this,e),this.source=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},I=f.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1;var n,r=Object(a.a)(t.state.field(L).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(o){r.e(o)}finally{r.f()}}return Object(l.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(L);if(e.selectionSet||e.docChanged||e.prevState.field(L)!=n){for(var i=e.transactions.some((function(e){var t=e.annotation(u.l.userEvent);return(e.selection||e.docChanged)&&"input"!=t&&"delete"!=t})),o=0;o50&&s.time-Date.now()>1e3){var l,c=Object(a.a)(s.context.abortListeners);try{for(c.s();!(l=c.n()).done;){var d=l.value;try{d()}catch(p){Object(f.l)(this.view.state,p)}}}catch(v){c.e(v)}finally{c.f()}s.context.abortListeners=null,this.running.splice(o--,1)}else{var h;(h=s.updates).push.apply(h,Object(r.a)(e.transactions))}}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(L),r=Object(a.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=v(n),i=new h(n,r,e.explicit),o=new z(e.source,i);this.running.push(o),Promise.resolve(e.source(i)).then((function(e){o.context.aborted||(o.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:A.of(!1)}),Object(f.l)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),50))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(y),i=function(i){var s=t.running[i];if(void 0===s.done)return o=i,"continue";if(t.running.splice(i--,1),s.done){var l,c=new D(s.source,s.context.explicit,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:v(s.updates.length?s.updates[0].startState:t.view.state),s.done.span?m(s.done.span,!0):null),u=Object(a.a)(s.updates);try{for(u.s();!(l=u.n()).done;){var f=l.value;c=c.update(f,r)}}catch(y){u.e(y)}finally{u.f()}if(c.hasResult())return n.push(c),o=i,"continue"}var d=t.view.state.field(L).active.find((function(e){return e.source==s.source}));if(d&&1==d.state)if(null==s.done){var h,p=new T(s.source,0,!1),g=Object(a.a)(s.updates);try{for(g.s();!(h=g.n()).done;){var b=h.value;p=p.update(b,r)}}catch(y){g.e(y)}finally{g.f()}1!=p.state&&n.push(p)}else t.startQuery(d);o=i},o=0;o=e.to}))}))}}]),e}(),q=u.i.define({map:function(e,t){return e&&e.map(t)}}),U=u.i.define(),Y=u.j.define({create:function(){return null},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(q))return i.value;if(i.is(U)&&e)return new V(e.ranges,i.value)}}catch(o){r.e(o)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:[f.d.decorations.from((function(e){return e?e.deco:f.b.none}))]});function X(e,t){return u.d.create(e.filter((function(e){return e.field==t})).map((function(e){return u.d.range(e.from,e.to)})))}function G(e){var t=F.parse(e);return function(e,n,r,i){var o=t.instantiate(e.state,r),a=o.text,s=o.ranges,l={changes:{from:r,to:i,insert:u.k.of(a)}};s.length&&(l.selection=X(s,0)),s.length>1&&(l.effects=q.of(new V(s,0)),void 0===e.state.field(Y,!1)&&(l.reconfigure={append:[Y,Z,O]})),e.dispatch(e.state.update(l))}}function K(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(Y,!1);if(!i||e<0&&0==i.active)return!1;var o=i.active+e,a=e>0&&!i.ranges.some((function(t){return t.field==o+e}));return r(n.update({selection:X(i.ranges,o),effects:q.of(a?null:new V(i.ranges,o))})),!0}}var Z=Object(u.o)(Object(f.k)([{key:"Tab",run:K(1),shift:K(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(Y,!1)&&(n(t.update({effects:q.of(null)})),!0)}}]),"override");function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[L,y.of(e),I,O,Object(c.c)(),Object(u.o)(Object(f.k)([{key:"ArrowDown",run:_(!0)},{key:"ArrowUp",run:_(!1)},{key:"PageDown",run:_(!0,"page")},{key:"PageUp",run:_(!1,"page")},{key:"Enter",run:$}]),"override")]}var ee=[{key:"Mod-Space",run:function(e){return!!e.state.field(L,!1)&&(e.dispatch({effects:A.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(L,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:A.of(!1)}),!0)}}]},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(79);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(80);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.bottom||s.right<=t.left||s.left>=t.right)o.style.top="-10000px";else{var c=l.right-l.left,u=l.bottom-l.top,f=this.view.textDirection==a.c.LTR?Math.min(s.left,e.innerWidth-c):Math.max(0,s.left-c),d=!!r.above;!r.strictSide&&(d?s.top-(l.bottom-l.top)<0:s.bottom+(l.bottom-l.top)>e.innerHeight)&&(d=!d),o.style.top=(d?s.top-u:s.bottom)+"px",o.style.left=f+"px",o.classList.toggle("cm-tooltip-above",d),o.classList.toggle("cm-tooltip-below",!d),i.positioned&&i.positioned()}}}},{key:"maybeMeasure",value:function(){this.tooltips.length&&((this.view.inView||this.inView)&&this.view.requestMeasure(this.measureReq),this.inView=this.view.inView)}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),c=a.d.baseTheme({$tooltip:{position:"fixed",border:"1px solid #ddd",backgroundColor:"#f5f5f5",zIndex:100}});function u(){return[l,c]}var f=s.f.define(),d=function(){function e(t,n,r,o){Object(i.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=o,this.lastMouseMove=null,this.hoverTimeout=-1,this.mouseInside=!1,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseenter",this.mouseenter=this.mouseenter.bind(this)),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(o.a)(e,[{key:"checkHover",value:function(){var e=this;if(this.hoverTimeout=-1,this.mouseInside&&!this.active){var t=Date.now(),n=this.lastMouseMove;if(t-n.timeStamp<750)this.hoverTimeout=setTimeout(this.checkHover,750-(t-n.timeStamp));else{var r=this.view.contentDOM.contains(n.target)?this.view.posAtCoords({x:n.clientX,y:n.clientY}):-1,i=r<0?null:this.source(this.view,(function(t,i){return t<=r&&i>=r&&(t==i||h(e.view,t,i,n.clientX,n.clientY))}));i&&this.view.dispatch({effects:this.setHover.of(i)})}}}},{key:"mousemove",value:function(e){var t;this.lastMouseMove=e,this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,750));var n=this.active;if(n&&!function(e){for(var t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(e.target)){var r=n.pos,i=null!==(t=n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords({x:e.clientX,y:e.clientY})==r:h(this.view,r,i,e.clientX,e.clientY,10))||this.view.dispatch({effects:this.setHover.of(null)})}}},{key:"mouseenter",value:function(){this.mouseInside=!0}},{key:"mouseleave",value:function(){this.mouseInside=!1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}},{key:"destroy",value:function(){this.view.dom.removeEventListener("mouseenter",this.mouseenter),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},{key:"active",get:function(){return this.view.state.field(this.field)}}]),e}();function h(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=document.createRange(),s=e.domAtPos(t),l=e.domAtPos(n);a.setEnd(l.node,l.offset),a.setStart(s.node,s.offset);for(var c=a.getClientRects(),u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=s.i.define(),i=s.j.define({create:function(){return null},update:function(e,i){if(e&&t.hideOnChange&&(i.docChanged||i.selection))return null;var o,a=Object(r.a)(i.effects);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(l.is(n))return l.value}}catch(f){a.e(f)}finally{a.f()}if(e&&i.docChanged){var c=i.changes.mapPos(e.pos,-1,s.h.TrackDel);if(c<0)return null;var u=Object.assign(Object.create(null),e);return u.pos=c,null!=e.end&&(u.end=i.changes.mapPos(e.end)),u}return e},provide:[f.nFrom((function(e){return e?[e]:[]}))]});return[i,a.f.define((function(t){return new d(t,e,i,n)})),u()]}},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=(n(11),n(8)),s=n(10),l=n(14),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=o.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,u=e.classes,f=e.className,d=e.color,h=void 0===d?"initial":d,p=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,b=void 0!==g&&g,y=e.noWrap,O=void 0!==y&&y,w=e.paragraph,k=void 0!==w&&w,x=e.variant,j=void 0===x?"body1":x,S=e.variantMapping,E=void 0===S?c:S,C=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),P=p||(k?"p":E[j]||c[j])||"span";return o.createElement(P,Object(r.a)({className:Object(a.a)(u.root,f,"inherit"!==j&&u[j],"initial"!==h&&u["color".concat(Object(l.a)(h))],O&&u.noWrap,b&&u.gutterBottom,k&&u.paragraph,"inherit"!==s&&u["align".concat(Object(l.a)(s))],"initial"!==m&&u["display".concat(Object(l.a)(m))]),ref:t},C))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=(n(11),n(24)),s=n(8),l=n(22),c=n(28),u=n(10),f=n(61),d=n(54),h=n(259),p="undefined"===typeof window?o.useEffect:o.useLayoutEffect;var v=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,i=e.rippleX,a=e.rippleY,l=e.rippleSize,u=e.in,f=e.onExited,d=void 0===f?function(){}:f,h=e.timeout,v=o.useState(!1),m=v[0],g=v[1],b=Object(s.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),y={width:l,height:l,top:-l/2+a,left:-l/2+i},O=Object(s.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),w=Object(c.a)(d);return p((function(){if(!u){g(!0);var e=setTimeout(w,h);return function(){clearTimeout(e)}}}),[w,u,h]),o.createElement("span",{className:b,style:y},o.createElement("span",{className:O}))},m=o.forwardRef((function(e,t){var n=e.center,a=void 0!==n&&n,l=e.classes,c=e.className,u=Object(i.a)(e,["center","classes","className"]),f=o.useState([]),p=f[0],m=f[1],g=o.useRef(0),b=o.useRef(null);o.useEffect((function(){b.current&&(b.current(),b.current=null)}),[p]);var y=o.useRef(!1),O=o.useRef(null),w=o.useRef(null),k=o.useRef(null);o.useEffect((function(){return function(){clearTimeout(O.current)}}),[]);var x=o.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,i=e.rippleSize,a=e.cb;m((function(e){return[].concat(Object(d.a)(e),[o.createElement(v,{key:g.current,classes:l,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i})])})),g.current+=1,b.current=a}),[l]),j=o.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&y.current)y.current=!1;else{"touchstart"===e.type&&(y.current=!0);var u,f,d,h=c?null:k.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var b=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(b,2)+Math.pow(j,2))}e.touches?null===w.current&&(w.current=function(){x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){w.current&&(w.current(),w.current=null)}),80)):x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[a,x]),S=o.useCallback((function(){j({},{pulsate:!0})}),[j]),E=o.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&w.current)return e.persist(),w.current(),w.current=null,void(O.current=setTimeout((function(){E(e,t)})));w.current=null,m((function(e){return e.length>0?e.slice(1):e})),b.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:E}}),[S,j,E]),o.createElement("span",Object(r.a)({className:Object(s.a)(l.root,c),ref:k},u),o.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(m)),b=o.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,b=e.component,y=void 0===b?"button":b,O=e.disabled,w=void 0!==O&&O,k=e.disableRipple,x=void 0!==k&&k,j=e.disableTouchRipple,S=void 0!==j&&j,E=e.focusRipple,C=void 0!==E&&E,P=e.focusVisibleClassName,M=e.onBlur,T=e.onClick,D=e.onFocus,A=e.onFocusVisible,R=e.onKeyDown,N=e.onKeyUp,L=e.onMouseDown,_=e.onMouseLeave,$=e.onMouseUp,z=e.onTouchEnd,I=e.onTouchMove,Q=e.onTouchStart,B=e.onDragLeave,F=e.tabIndex,W=void 0===F?0:F,H=e.TouchRippleProps,V=e.type,q=void 0===V?"button":V,U=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Y=o.useRef(null);var X=o.useRef(null),G=o.useState(!1),K=G[0],Z=G[1];w&&K&&Z(!1);var J=Object(f.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(c.a)((function(r){return t&&t(r),!n&&X.current&&X.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),Y.current.focus()}}}),[]),o.useEffect((function(){K&&C&&!x&&X.current.pulsate()}),[x,C,K]);var ie=re("start",L),oe=re("stop",B),ae=re("stop",$),se=re("stop",(function(e){K&&e.preventDefault(),_&&_(e)})),le=re("start",Q),ce=re("stop",z),ue=re("stop",I),fe=re("stop",(function(e){K&&(te(e),Z(!1)),M&&M(e)}),!1),de=Object(c.a)((function(e){Y.current||(Y.current=e.currentTarget),ee(e)&&(Z(!0),A&&A(e)),D&&D(e)})),he=function(){var e=a.findDOMNode(Y.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),ve=Object(c.a)((function(e){C&&!pe.current&&K&&X.current&&" "===e.key&&(pe.current=!0,e.persist(),X.current.stop(e,(function(){X.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!w&&(e.preventDefault(),T&&T(e))})),me=Object(c.a)((function(e){C&&" "===e.key&&X.current&&K&&!e.defaultPrevented&&(pe.current=!1,e.persist(),X.current.stop(e,(function(){X.current.pulsate(e)}))),N&&N(e),T&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=y;"button"===ge&&U.href&&(ge="a");var be={};"button"===ge?(be.type=q,be.disabled=w):("a"===ge&&U.href||(be.role="button"),be["aria-disabled"]=w);var ye=Object(l.a)(u,t),Oe=Object(l.a)(ne,Y),we=Object(l.a)(ye,Oe),ke=o.useState(!1),xe=ke[0],je=ke[1];o.useEffect((function(){je(!0)}),[]);var Se=xe&&!x&&!w;return o.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,K&&[v.focusVisible,P],w&&v.disabled),onBlur:fe,onClick:T,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:ue,onTouchStart:le,ref:we,tabIndex:w?-1:W},be,U),p,Se?o.createElement(g,Object(r.a)({ref:X,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(b)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n(54),n(1);var r=n(57),i=(n(11),n(64),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===Object(r.a)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(67),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=l(t),v=l(n),m=0;m2||/[^\s,.;:]/.test(e.sliceDoc(t.start,t.end)))||t.firstChild}function b(e,t,n){for(var r=e.tree.resolve(t.head),o=n?l.c.closedBy:l.c.openedBy,a=t.head;;){var c=n?r.childAfter(a):r.childBefore(a);if(!c)break;g(e,c,o)?r=c:a=n?c.end:c.start}var u,f;return f=r.type.prop(o)&&(u=n?Object(s.b)(e,r.start,1):Object(s.b)(e,r.end,-1))&&u.matched?n?u.end.to:u.end.from:n?r.end:r.start,i.d.cursor(f,n?-1:1)}function y(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t):d(n,t)}))}var O=function(e){return y(e,!1)},w=function(e){return y(e,!0)};function k(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):d(n,t)}))}var x=function(e){return k(e,!1)},j=function(e){return k(e,!0)};function S(e,t,n){var r=e.visualLineAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){var a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head>r.from+a&&(o=i.d.cursor(r.from+a))}return o}var E=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).from,1)}))},C=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).to,-1)}))};function P(e,t,n){var r=!1,o=c(e.selection,(function(t){var o=Object(s.b)(e,t.head,-1)||Object(s.b)(e,t.head,1)||t.head>0&&Object(s.b)(e,t.head-1,1)||t.headl.from&&r-1)return a}}catch(s){o.e(s)}finally{o.f()}return-1}function ne(e,t){var n=-1;return e.changeByRange((function(r){for(var o=[],a=e.doc.lineAt(r.from);a.number>n&&(t(a,o,r),n=a.number),!(r.to<=a.to);)a=e.doc.lineAt(a.to+1);var s=e.changes(o);return{changes:o,range:i.d.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}var re=[{key:"ArrowLeft",run:p,shift:D},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(e){return m(e,e.textDirection!=a.c.LTR)},shift:function(e){return R(e,e.textDirection!=a.c.LTR)}},{mac:"Cmd-ArrowLeft",run:E,shift:Q},{key:"ArrowRight",run:v,shift:A},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(e){return m(e,e.textDirection==a.c.LTR)},shift:function(e){return R(e,e.textDirection==a.c.LTR)}},{mac:"Cmd-ArrowRight",run:C,shift:B},{key:"ArrowUp",run:O,shift:L},{mac:"Cmd-ArrowUp",run:F,shift:H},{mac:"Ctrl-ArrowUp",run:x,shift:z},{key:"ArrowDown",run:w,shift:_},{mac:"Cmd-ArrowDown",run:W,shift:V},{mac:"Ctrl-ArrowDown",run:j,shift:I},{key:"PageUp",run:x,shift:z},{key:"PageDown",run:j,shift:I},{key:"Home",run:function(e){return f(e,(function(t){return S(e,t,!1)}))},shift:function(e){return M(e,(function(t){return S(e,t,!1)}))}},{key:"Mod-Home",run:F,shift:H},{key:"End",run:function(e){return f(e,(function(t){return S(e,t,!0)}))},shift:function(e){return M(e,(function(t){return S(e,t,!0)}))}},{key:"Mod-End",run:W,shift:V},{key:"Enter",run:function(e){var t=e.state,n=e.dispatch,r=t.changeByRange((function(e){var n=e.from,r=e.to,a=n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=e.tree.resolve(t),i=r.childBefore(t),o=r.childAfter(t);return i&&o&&i.end<=t&&o.start>=t&&(n=i.type.prop(l.c.closedBy))&&n.indexOf(o.name)>-1?{from:i.end,to:o.start}:null}(t,n),s=new i.g(t,{simulateBreak:n,simulateDoubleBreak:!!a}),c=te(s,n);c<0&&(c=/^\s*/.exec(t.doc.lineAt(n).slice(0,50))[0].length);for(var u=t.doc.lineAt(n);ru.from&&n",run:W},{key:"Ctrl-v",run:j},{key:"Alt-v",run:x}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))),ie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))},shift:function(e){return M(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))},shift:function(e){return M(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))}},{key:"Alt-ArrowUp",run:function(e){return J(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return ee(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return J(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return ee(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,o=null;return r.ranges.length>1?o=new i.d([r.primary]):r.primary.empty||(o=new i.d([i.d.cursor(r.primary.head)])),!!o&&(n(u(t,o)),!0)}},{key:"Mod-l",run:function(e){var t=e.state,n=e.dispatch,r=Z(t).map((function(e){var n=e.from,r=e.to;return i.d.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:new i.d(r),annotations:i.l.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=c(t.selection,(function(e){for(var n,r=t.tree.resolve(e.head,1);!(r.start=e.to||r.end>e.to&&r.start<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.d.range(r.end,r.start)}));return n(u(t,r)),!0}},{key:"Mod-[",run:function(e){var t=e.state;return(0,e.dispatch)(t.update(ne(t,(function(e,n){var r=e.slice(0,Math.min(e.length,200)),i=/^\s*/.exec(r)[0];if(i){for(var a=Object(o.d)(i,0,t.tabSize),s=t.indentString(Math.max(0,a-t.indentUnit)),l=0;l0?n--:r30||this.typeNames.length>Math.pow(2,30-this.flags.length))throw new RangeError("Too many style tag flags to fit in a 30-bit integer")}return Object(o.a)(e,[{key:"get",value:function(e){var t,n=0,i=Object(r.a)(e.split(" "));try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o){var a=this.flags.indexOf(o);if(a>-1)n+=1<>this.typeShift)throw new RangeError("Multiple tag types specified in '".concat(e,"'"));n+=s<1&&void 0!==arguments[1]?arguments[1]:{},n=this.getWithMode(e),r=n.mode,i=n.tag;return this.prop.set(t,new h(i,r,d))}},{key:"add",value:function(e){var t=Object.create(null);for(var n in e){var i,o=e[n],a=this.getWithMode(o),s=a.mode,l=a.tag,c=Object(r.a)(n.split(" "));try{for(c.s();!(i=c.n()).done;){var u=i.value.split("/"),f=u[u.length-1],p=u.length>1?u.slice(0,u.length-1).map((function(e){return"*"==e?null:e})):d,v=new h(l,s,p);t[f]=v.sort(t[f])}}catch(m){c.e(m)}finally{c.f()}}return this.prop.add(t)}},{key:"highlighter",value:function(e){var t=this,n=new m(this,e);return[Object(c.o)(l.f.define((function(e){return new g(e,t.prop,n)}),{decorations:function(e){return e.decorations}}),"fallback"),l.d.styleModule.of(n.module)]}},{key:"specificity",value:function(e){for(var t=e&this.flagMask,n=0,r=1;r<=this.flags.length;r++)t&1<>this.typeShift;i;i=this.parents[i])n+=/#/.test(this.typeNames[i])?500:1e3;return n}}]),e}())({flags:["invalid","meta","standard","definition","constant","local","control","link","strong","emphasis","monospace","changed","inserted","deleted"],subtypes:7,types:["comment","lineComment=comment","blockComment=comment","docComment=comment","name","variableName=name","typeName=name","propertyName=name","className=name","labelName=name","functionName=name","namespace=name","literal","string=literal","docString=string","character=string","number=literal","integer=number","float=number","bool=literal","regexp=literal","escape=literal","color=literal","content","heading=content","list=content","quote=content","keyword","self=keyword","null=keyword","atom=keyword","unit=keyword","modifier=keyword","operatorKeyword=keyword","operator","derefOperator=operator","arithmeticOperator=operator","logicOperator=operator","bitwiseOperator=operator","compareOperator=operator","updateOperator=operator","typeOperator=operator","punctuation","separator=punctuation","bracket=punctuation","angleBracket=bracket","squareBracket=bracket","paren=bracket","brace=bracket"]}),d=[],h=function(){function e(t,n,r,o){Object(i.a)(this,e),this.tag=t,this.mode=n,this.context=r,this.next=o}return Object(o.a)(e,[{key:"sort",value:function(e){return!e||e.context.length>t.typeShift,h&t.flagMask,t.specificity(h),c))}}catch(p){f.e(p)}finally{f.f()}}this.rules=a.sort((function(e,t){return t.specificity-e.specificity})),this.module=new s.a(o)}return Object(o.a)(e,[{key:"match",value:function(e){var t=this.cache[e];if(null!=t)return t;for(var n="",i=e>>this.tags.typeShift,o=e&this.tags.flagMask;;){var a,s=Object(r.a)(this.rules);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.type==i&&(l.flags&o)==l.flags&&(n&&(n+=" "),n+=l.cls,o&=~l.flags,i))break}}catch(c){s.e(c)}finally{s.f()}if(!i)break;i=this.tags.parents[i]}return this.cache[e]=n}}]),e}(),g=function(){function e(t,n,r){Object(i.a)(this,e),this.prop=n,this.styling=r,this.nodeStack=[""],this.classStack=[""],this.inheritStack=[""],this.tree=t.state.tree,this.decorations=this.buildDeco(t.visibleRanges,this.tree)}return Object(o.a)(e,[{key:"update",value:function(e){var t=e.state.facet(c.e.syntax);t.length?t[0].parsePos(e.state)n&&t&&s.add(n,e,l.b.mark({class:t})),n=e}var f,d=this.nodeStack,h=this.classStack,p=this.inheritStack,v=Object(r.a)(e);try{var m=function(){var e=f.value,r=e.from,s=e.to;i="",o=0,n=r,t.iterate({from:r,to:s,enter:function(e,t){o++;for(var n=p[o-1],r=n,s=e.prop(a.prop),l=!1;s;){if(!s.context.length||b(s.context,d,o)){var u=a.styling.match(s.tag);u&&(r&&(r+=" "),r+=u,1==s.mode?n=r:0==s.mode&&(l=!0));break}s=s.next}if(r!=i&&(c(t,i),i=r),l)return o--,!1;h[o]=r,p[o]=n,d[o]=e.name},leave:function(e,t,n){o--;var r=h[o];r!=i&&(c(Math.min(s,n),i),i=r)}})};for(v.s();!(f=v.n()).done;)m()}catch(g){v.e(g)}finally{v.f()}return s.finish()}}]),e}();function b(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var o=e[i];if(o&&o!=t[r])return!1}return!0}var y,O=(y={deleted:{textDecoration:"line-through"},inserted:{textDecoration:"underline"},link:{textDecoration:"underline"},strong:{fontWeight:"bold"},emphasis:{fontStyle:"italic"},keyword:{color:"#708"},"atom, bool":{color:"#219"},number:{color:"#164"},string:{color:"#a11"},"regexp, escape, string#2":{color:"#e40"},"variableName definition":{color:"#00f"},typeName:{color:"#085"},className:{color:"#167"},"name#2":{color:"#256"},"propertyName definition":{color:"#00c"},comment:{color:"#940"},meta:{color:"#555"},invalid:{color:"#f00"}},f.highlighter(y))},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return S}));var r=n(19),i=n(18),o=n(7),a=n(5),s=n(4),l=n(9),c=n(3),u=n(82),f=n(33),d=function e(t,n,r){Object(s.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},h=function e(t,n,r){Object(s.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r};function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,e.length,(function(e,n,i){var o=i.spec;if(!t||o.diagnostic==t)return r=new d(e,n,o.diagnostic),!1})),r}function v(e){return e.field(y,!1)?void 0:{append:[y,l.d.decorations.compute([y],(function(e){var t=e.field(y),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?l.b.set([O.range(n.from,n.to)]):l.b.none})),Object(f.b)(),Object(u.a)(w),D]}}var m=c.i.define(),g=c.i.define(),b=c.i.define(),y=c.j.define({create:function(){return new h(l.b.none,null,null)},update:function(e,t){if(t.docChanged){var n=e.diagnostics.map(t.changes),r=null;if(e.selected){var i=t.changes.mapPos(e.selected.from,1);r=p(n,e.selected.diagnostic,i)||p(n,null,i)}e=new h(n,e.panel,r)}var o,s=Object(a.a)(t.effects);try{for(s.s();!(o=s.n()).done;){var c=o.value;if(c.is(m)){var u=l.b.set(c.value.map((function(e){return e.fromi&&(e.items.splice(i,u-i),o=!0)),r&&l.diagnostic==r.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),a=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.items.length||this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=Object(a.a)(this.items);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e)}}catch(o){r.e(o)}finally{r.f()}for(;e;)t();this.list.firstChild||this.list.appendChild(E(this.view,{severity:"info",message:this.view.state.phrase("No diagnostics")}))}},{key:"moveSelection",value:function(e){if(0!=this.items.length){var t=p(this.view.state.field(y).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:b.of(t)})}}},{key:"selectedIndex",get:function(){var e=this.view.state.field(y).selected;if(!e)return-1;for(var t=0;t\n ');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var D=l.d.baseTheme({$diagnostic:{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block"},"$diagnostic.error":{borderLeft:"5px solid #d11"},"$diagnostic.warning":{borderLeft:"5px solid orange"},"$diagnostic.info":{borderLeft:"5px solid #999"},$diagnosticAction:{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},$lintRange:{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},"$lintRange.error":{backgroundImage:T("#d11")},"$lintRange.warning":{backgroundImage:T("orange")},"$lintRange.info":{backgroundImage:T("#999")},"$lintRange.active":{backgroundColor:"#ffdd9980"},$lintPoint:{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},"$lintPoint.warning":{"&:after":{borderBottomColor:"orange"}},"$lintPoint.info":{"&:after":{borderBottomColor:"#999"}},"$panel.lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd"},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"$tooltip.lint":{padding:0,margin:0}})},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return k}));var r=n(23);n.d(t,"a",(function(){return r.c}));var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var o,a=function(){function e(e,t,n,r,i,o,a,s,l){this.cx=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=a,this.bufferBase=s,this.parent=l}return e.prototype.toString=function(){return"["+this.stack.filter((function(e,t){return t%3==0})).concat(this.state)+"]@"+this.pos+(this.score?"!"+this.score:"")},e.start=function(t,n,r){return void 0===r&&(r=0),new e(t,[],n,r,r,0,[],0,null)},e.prototype.pushState=function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e},e.prototype.reduce=function(e){var t=e>>19,n=65535&e,r=this.cx.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return no;)this.stack.pop()},e.prototype.storeNode=function(e,t,n,r,i){if(void 0===r&&(r=4),void 0===i&&(i=!1),0==e){var o=this,a=this.buffer.length;if(0==a&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)},e.prototype.shift=function(e,t,n){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var r=this.pos,i=e,o=this.cx.parser;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else t<=this.cx.parser.maxNode&&this.buffer.push(t,this.pos,n,4),this.pos=n},e.prototype.apply=function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)},e.prototype.useNode=function(e,t){var n=this.cx.reused.length-1;(n<0||this.cx.reused[n]!=e)&&(this.cx.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1)},e.prototype.split=function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.cx,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,t)},e.prototype.recoverByDelete=function(e,t){var n=e<=this.cx.parser.maxNode;n&&this.storeNode(e,this.pos,t),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=200},e.prototype.canShift=function(e){for(var t=new s(this);;){var n=this.cx.parser.stateSlot(t.top,4)||this.cx.parser.hasAction(t.top,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}},Object.defineProperty(e.prototype,"ruleStart",{get:function(){for(var e=this.state,t=this.stack.length;;){var n=this.cx.parser.stateSlot(e,5);if(!(65536&n))return 0;if(t-=3*(n>>19),(65535&n)>19,a=65535&i;if(e.indexOf(a)>-1){var s=n-3*(i>>19);return this.stack[s+1]}if(0==n)return-1;0==o?(n-=3,t=this.stack[n]):(n-=3*(o-1),t=r.getGoto(this.stack[n-3],a,!0))}},e.prototype.recoverByInsert=function(e){var t=this;if(this.stack.length>=300)return[];var n=this.cx.parser.nextStates(this.state);if(n.length>4||this.stack.length>=120){var r=n.filter((function(n){return n!=t.state&&t.cx.parser.hasAction(n,e)}));if(this.stack.length<120)for(var i=0;r.length<4&&i>19;0==n?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(n-1);var r=this.stack.cx.parser.getGoto(this.rest[this.offset-3],t,!0);this.top=r},e}(),l=function(){function e(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}return e.create=function(t){return new e(t,t.bufferBase+t.buffer.length,t.buffer.length)},e.prototype.maybeNext=function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)},Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer[this.index-4]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.buffer[this.index-3]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.buffer[this.index-2]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.buffer[this.index-1]},enumerable:!0,configurable:!0}),e.prototype.next=function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()},e.prototype.fork=function(){return new e(this.stack,this.pos,this.index)},e}(),c=function(){function e(){this.start=-1,this.value=-1,this.end=-1}return e.prototype.accept=function(e,t){this.value=e,this.end=t},e}(),u=function(){function e(e,t){void 0===t&&(t=e.length),this.string=e,this.length=t}return e.prototype.get=function(e){return e<0||e>=this.length?-1:this.string.charCodeAt(e)},e.prototype.read=function(e,t){return this.string.slice(e,Math.min(this.length,t))},e.prototype.clip=function(t){return new e(this.string,t)},e}(),f=function(){function e(e,t){this.data=e,this.id=t}return e.prototype.token=function(e,t,n){!function(e,t,n,r,i){var o=0,a=1<0){var f=e[u];if(s.allows(f)&&(-1==n.value||n.value==f||r.cx.parser.overrides(f,n.value))){n.accept(f,l);break}}for(var d=t.get(l++),h=0,p=e[o+2];h>1,m=c+v+(v<<1),g=e[m],b=e[m+1];if(d=b)){o=e[m+2];continue e}h=v+1}}break}}(this.data,e,t,n,this.id)},e}();f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;function d(e,t){if(void 0===t&&(t=Uint16Array),"string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&a--,a>=34&&a--;var l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var h="undefined"!=typeof e&&/\bparse\b/.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).LOG),p=null,v=function(){function e(e){this.start=[0],this.index=[0],this.nextStart=0,this.trees=[e]}return e.prototype.nodeAt=function(e){if(e=e)return a==e?o:null;o instanceof r.f?(this.index[t]++,this.nextStart=a+o.length):(this.index[t]++,a+o.length>=e&&(this.trees.push(o),this.start.push(a),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}},e}(),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extended=-1,t.mask=0,t}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.clear=function(e){this.start=e,this.value=this.extended=-1},t}(c),g=new c,b=function(){function e(e){this.tokens=[],this.mainToken=g,this.actions=[],this.tokens=e.tokenizers.map((function(e){return new m}))}return e.prototype.getActions=function(e,t){for(var n=0,r=null,i=e.cx.parser,o=i.tokenizers,a=i.stateSlot(e.state,3),s=0;s-1&&(n=this.addActions(e,c.extended,c.end,n)),n=this.addActions(e,c.value,c.end,n),!l.extend&&(r=c,n>u))break}}for(;this.actions.length>n;)this.actions.pop();return r||((r=g).start=e.pos,e.pos==t.length?r.accept(e.cx.parser.eofTerm,e.pos):r.accept(0,e.pos+1)),this.mainToken=r,this.actions},e.prototype.updateCachedToken=function(e,t,n,r){if(e.clear(n.pos),t.token(r,e,n),e.value>-1){for(var i=n.cx.parser,o=0;o=0&&n.cx.dialect.allows(a>>1)){0==(1&a)?e.value=a>>1:e.extended=a>>1;break}}}else n.pos==r.length?e.accept(n.cx.parser.eofTerm,n.pos):e.accept(0,n.pos+1)},e.prototype.putAction=function(e,t,n,r){for(var i=0;it)this.putStack(o);else{var a=this.advanceStack(o,e);if(a){o=a;continue}n||(n=[],r=[]),n.push(o);var s=o.cx.tokens.mainToken;r.push(s.value,s.end)}break}if(!this.stacks.length){var l;if(l=n&&function(e){for(var t=null,n=0,r=e;nc&&(this.stacks.sort((function(e,t){return t.score-e.score})),this.stacks.length=c),this.stacks.some((function(e){return e.reducePos>t}))&&this.recovering--}else if(this.stacks.length>1)e:for(i=0;i200&&f.buffer.length>200){if(!((o.score-f.score||o.buffer.length-f.buffer.length)>0)){this.stacks.splice(i--,1);continue e}this.stacks.splice(u--,1)}}}return this.tokenCount++,null},e.prototype.advanceStack=function(e,t){var n=e.pos,i=e.cx,o=i.input,s=i.parser,l=h?this.stackID(e)+" -> ":"";if(this.cache)for(var c=this.cache.nodeAt(n);c;){var u=s.group.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1)return e.useNode(c,u),h&&console.log(l+this.stackID(e)+" (via reuse of "+s.getName(c.type.id)+")"),e;if(!(c instanceof r.e)||0==c.children.length||c.positions[0]>0)break;var f=c.children[0];if(!(f instanceof r.e))break;c=f}var d=s.startNested(e.state);e:if(d>-1){var p=s.nested[d],v=p.grammar,m=p.end,g=p.placeholder,b=void 0,O=null,w=void 0,k=void 0,x=void 0,j=void 0;if("function"==typeof v){var S=v(o,e);if(S.stay)break e;O=S.parseNode,w=S.parser,k=S.top,x=S.dialect,b=S.filterEnd,j=S.wrapType}else w=v;var E=this.scanForNestEnd(e,m,b),C=e.cx.input.clip(E);if(O||!w){var P=O?O(C,e.pos):r.e.empty;return P.length!=E-e.pos&&(P=new r.e(P.type,P.children,P.positions,E-e.pos)),null!=j&&(P=new r.e(s.group.types[j],[P],[0],P.length)),e.useNode(P,s.getGoto(e.state,g,!0)),e}var M=k?w.topRules[k]:w.defaultTop,T=a.start(new y(w,e.cx.maxBufferLength,C,M[1],w.parseDialect(x),e,j),M[0],e.pos);return h&&console.log(l+this.stackID(T)+" (nested)"),T}var D=s.stateSlot(e.state,4);if(D>0)return e.reduce(D),h&&console.log(l+this.stackID(e)+" (via always-reduce "+s.getName(65535&D)+")"),e;for(var A=e.cx.tokens.getActions(e,o),R=0;Rn?this.putStack($):t.push($)}return e.cx.parent&&e.pos==o.length?this.finishNested(e):null},e.prototype.advanceFully=function(e){for(var t=e.pos;;){var n=this.advanceStack(e,null);if(!n)return e;if(n.pos>t)return this.putStackDedup(n),null;e=n}},e.prototype.runRecovery=function(e,t){for(var n=null,r=!1,i=0;i ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),h&&console.log(l+this.stackID(o)+" (restarted)"),!(d=this.advanceFully(o)))continue;o=d}for(var c=o.split(),u=l,f=0;c.forceReduce()&&f<10;f++){var d;if(h&&console.log(u+this.stackID(c)+" (via force-reduce)"),!(d=this.advanceFully(c)))break;c=d,h&&(u=this.stackID(d)+" -> ")}for(var p=0,v=o.recoverByInsert(a);po.pos?(s==o.pos&&(s++,a=0),o.recoverByDelete(a,s),h&&console.log(l+this.stackID(o)+" (via recover-delete "+o.cx.parser.getName(a)+")"),this.putStackDedup(o)):o.cx.parent||n&&!(n.score-1&&(!n||n(r.read(i,g.end))))return i;return r.length},e.prototype.finishNested=function(e){if(-2==e.cx.wrapType)return null;var t=e.cx.parent,n=e.forceAll().toTree(),i=t.cx.parser,o=i.nested[i.startNested(t.state)];return n=new r.e(n.type,n.children,n.positions.map((function(e){return e-t.pos})),e.pos-t.pos),e.cx.wrapType>-1&&(n=new r.e(i.group.types[e.cx.wrapType],[n],[0],n.length)),e.cx.wrapType=-2,t.useNode(n,i.getGoto(t.state,o.placeholder,!0)),h&&console.log(this.stackID(t)+" (via unnest "+(e.cx.wrapType>-1?i.getName(e.cx.wrapType):n.type.name)+")"),t},e.prototype.stackID=function(e){var t=(p||(p=new WeakMap)).get(e);return t||p.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e},e}(),w=function(){function e(e,t,n){this.source=e,this.flags=t,this.disabled=n}return e.prototype.allows=function(e){return!this.disabled||0==this.disabled[e]},e}(),k=function(){function e(e){this.nextStateCache=[],this.cachedDialect=null;var t=d(e.tokenData),n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(var i=0;i=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var l=i+(o>>1);i0},e.prototype.startNested=function(e){var t=this.stateSlot(e,0);return 4&t?t>>10:-1},e.prototype.validAction=function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=x(this.data,n+2)}if(t==x(this.data,n+1))return!0}},e.prototype.nextStates=function(e){var t=this.nextStateCache[e];if(t)return t;for(var n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=x(this.data,r+2)}0==(1&this.data[r+2])&&n.indexOf(this.data[r+1])<0&&n.push(this.data[r+1])}for(var i=this.goto,o=i[0],a=0;a>1);s0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTop",{get:function(){return this.topRules[Object.keys(this.topRules)[0]]},enumerable:!0,configurable:!0}),e.prototype.dynamicPrecedence=function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0},Object.defineProperty(e.prototype,"topType",{get:function(){return this.group.types[this.defaultTop[1]]},enumerable:!0,configurable:!0}),e.prototype.parseDialect=function(e){if(this.cachedDialect&&this.cachedDialect.source==e)return this.cachedDialect;var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e)for(var r=0,i=e.split(" ");r=0&&(n[c]=!0)}for(var a=null,s=0;s-1},T.prototype.set=function(e,t){var n=this.__data__,r=A(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new M,map:new(S||T),string:new M}},D.prototype.delete=function(e){return L(this,e).delete(e)},D.prototype.get=function(e){return L(this,e).get(e)},D.prototype.has=function(e){return L(this,e).has(e)},D.prototype.set=function(e,t){return L(this,e).set(e,t),this};var $=I((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(F(e))return P?P.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(l,(function(e,t,r,i){n.push(r?i.replace(c,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||F(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function I(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(I.Cache||D),n}I.Cache=D;var Q=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function F(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:R(e,t);return void 0===r?n:r}}).call(this,n(85))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=Object.prototype.toString,f=Math.max,d=Math.min,h=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,l,c=0,u=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function y(e){return c=e,s=setTimeout(w,t),u?b(e):a}function O(e){var n=e-l;return void 0===l||n>=t||n<0||m&&e-c>=o}function w(){var e=h();if(O(e))return k(e);s=setTimeout(w,function(e){var n=t-(e-l);return m?d(n,o-(e-c)):n}(e))}function k(e){return s=void 0,g&&r?b(e):(r=i=void 0,a)}function x(){var e=h(),n=O(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return y(l);if(m)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),a}return t=v(t)||0,p(n)&&(u=!!n.leading,o=(m="maxWait"in n)?f(v(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},x.flush=function(){return void 0===s?a:k(h())},x}}).call(this,n(85))},function(e,t,n){e.exports=n(184)},,,,,,,,,,,function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=t.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},isBuffer:function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!==typeof n){if(Array.isArray(t))t.push(n);else{if("object"!==typeof t)return[t,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!==typeof t)return[t].concat(n);var a=t;return Array.isArray(t)&&!Array.isArray(n)&&(a=o(t,i)),Array.isArray(t)&&Array.isArray(n)?(n.forEach((function(n,o){r.call(t,o)?t[o]&&"object"===typeof t[o]?t[o]=e(t[o],n,i):t.push(n):t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t}),a)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,o=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,l=2592e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s,months:l,days:o,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},f=function(e){return e instanceof b},d=function(e,t,n){return new b(e,n,t.$l)},h=function(e){return t.p(e)+"s"},p=function(e){return e<0},v=function(e){return p(e)?Math.ceil(e):Math.floor(e)},m=function(e){return Math.abs(e)},g=function(e,t){return e?p(e)?{negative:!0,format:""+m(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){r.$d[h(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(c);if(i){var o=i.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var m=p.prototype;return m.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},m.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=v(e/s),e%=s,this.$d.months=v(e/l),e%=l,this.$d.days=v(e/o),e%=o,this.$d.hours=v(e/i),e%=i,this.$d.minutes=v(e/r),e%=r,this.$d.seconds=v(e/n),e%=n,this.$d.milliseconds=e},m.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=g(n,"D"),i=g(this.$d.hours,"H"),o=g(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=g(a,"S"),l=e.negative||t.negative||r.negative||i.negative||o.negative||s.negative,c=i.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+o.format+s.format;return"P"===u||"-P"===u?"P0D":u},m.toJSON=function(){return this.toISOString()},m.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(a,(function(e,t){return t||String(r[e])}))},m.as=function(e){return this.$ms/u[h(e)]},m.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?v(t/u[n]):this.$d[n],0===t?0:t},m.add=function(e,t,n){var r;return r=t?e*u[h(t)]:f(e)?e.$ms:d(e,this).$ms,d(this.$ms+r*(n?-1:1),this)},m.subtract=function(e,t){return this.add(e,t,!0)},m.locale=function(e){var t=this.clone();return t.$l=e,t},m.clone=function(){return d(this.$ms,this)},m.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},p}();return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return d(e,{$l:n},t)},i.isDuration=f;var o=r.prototype.add,a=r.prototype.subtract;r.prototype.add=function(e,t){return f(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},r.prototype.subtract=function(e,t){return f(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)}}}()},function(e,t,n){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,o){var a=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(r)))return this;var a=Math.abs(r)<=16?60*r:r,s=this;if(i)return s.$offset=a,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),i=o(e).local();return d.call(r,i,t,n)}}}()},function(e,t,n){"use strict";var r=n(176),i=n(177),o=n(123);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(a)?a:h(a);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=E(e),s=E(t),c=l(e),u=a(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(p=g(p,t)),p}function P(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:m(n),s=t?0:m(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return S(l)}function M(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&M(n)}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function D(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?T(e):v(e,c(t));if("viewport"===r)o=P(a,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=l(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=C(u,a,i);if("HTML"!==u.nodeName||M(a))o=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var m="number"===typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function A(e){return e.width*e.height}function R(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=D(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return j({key:e},s[e],{area:A(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function N(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?T(t):v(t,c(n));return C(n,i,r)}function L(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function _(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function $(e,t,n){n=n.split("-")[0];var r=L(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[_(s)],i}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function I(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=z(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function Q(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=R(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=$(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=I(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function F(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function oe(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(z(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(c=c.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return S(s)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){X(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var ae={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:x({},l,o[l]),end:x({},l,o[l]+o[c]-a[c])};e.offsets.popper=j({},a,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=X(+n)?[+n,0]:oe(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=F("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=D(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),x({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Z(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,l=o.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),h=c?"left":"top",p=c?"bottom":"right",v=L(r)[u];l[p]-vs[p]&&(e.offsets.popper[d]+=l[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=l[d]+l[u]/2-v/2,g=a(e.instance.popper),b=parseFloat(g["margin"+f]),y=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-b-y;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(x(n={},d,Math.round(O)),x(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=D(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=_(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case ne:a=[r,i];break;case re:a=te(r);break;case ie:a=te(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=_(r);var c=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(u.left)||"right"===r&&f(c.left)f(u.top)||"bottom"===r&&f(c.top)f(n.right),v=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===o&&h||b&&"end"===o&&p||!b&&"start"===o&&v||!b&&"end"===o&&m),O=!!t.flipVariationsByContent&&(b&&"start"===o&&p||b&&"end"===o&&h||!b&&"start"===o&&m||!b&&"end"===o&&v),w=y||O;(d||g||w)&&(e.flipped=!0,(d||g)&&(r=a[l+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=j({},e.offsets.popper,$(e.instance.popper,e.offsets.reference,e.placement)),e=I(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=_(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Z(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=j({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(j({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return k(e,[{key:"update",value:function(){return Q.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return U.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();se.Utils=("undefined"!==typeof window?window:e).PopperUtils,se.placements=J,se.Defaults=ae,t.a=se}).call(this,n(85))},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=a},function(e,t,n){var r;window,r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./react/uplot-react.tsx")}({"./common/index.ts":function(e,t,n){"use strict";n.r(t),n.d(t,"optionsUpdateState",(function(){return i})),n.d(t,"dataMatch",(function(){return o}));var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=g&&!o||"t"===o?(m+=d.abbreviations.trillion,t/=g):a=b&&!o||"b"===o?(m+=d.abbreviations.billion,t/=b):a=y&&!o||"m"===o?(m+=d.abbreviations.million,t/=y):(a=O&&!o||"k"===o)&&(m+=d.abbreviations.thousand,t/=O)),e._.includes(n,"[.]")&&(p=!0,n=n.replace("[.]",".")),s=t.toString().split(".")[0],l=n.split(".")[1],u=n.indexOf(","),v=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,l?(e._.includes(l,"[")?(l=(l=l.replace("]","")).split("["),w=e._.toFixed(t,l[0].length+l[1].length,r,l[1].length)):w=e._.toFixed(t,l.length,r),s=w.split(".")[0],w=e._.includes(w,".")?d.delimiters.decimal+w.split(".")[1]:"",p&&0===Number(w.slice(1))&&(w="")):s=e._.toFixed(t,0,r),m&&!o&&Number(s)>=1e3&&m!==d.abbreviations.trillion)switch(s=String(Number(s)/1e3),m){case d.abbreviations.thousand:m=d.abbreviations.million;break;case d.abbreviations.million:m=d.abbreviations.billion;break;case d.abbreviations.billion:m=d.abbreviations.trillion}if(e._.includes(s,"-")&&(s=s.slice(1),k=!0),s.length0;x--)s="0"+s;return u>-1&&(s=s.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===n.indexOf(".")&&(s=""),f=s+w+(m||""),h?f=(h&&k?"(":"")+f+(h&&k?")":""):c>=0?f=0===c?(k?"-":"+")+f:f+(k?"-":"+"):k&&(f="-"+f),f},stringToNumber:function(e){var t,n,r,o=i[a.currentLocale],s=e,l={thousand:3,million:6,billion:9,trillion:12};if(a.zeroFormat&&e===a.zeroFormat)n=0;else if(a.nullFormat&&e===a.nullFormat||!e.replace(/[^0-9]+/g,"").length)n=null;else{for(t in n=1,"."!==o.delimiters.decimal&&(e=e.replace(/\./g,"").replace(o.delimiters.decimal,".")),l)if(r=new RegExp("[^a-zA-Z]"+o.abbreviations[t]+"(?:\\)|(\\"+o.currency.symbol+")?(?:\\))?)?$"),s.match(r)){n*=Math.pow(10,l[t]);break}n*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),n*=Number(e)}return n},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return"number"===typeof e&&isNaN(e)})),includes:function(e,t){return-1!==e.indexOf(t)},insert:function(e,t,n){return e.slice(0,n)+t+e.slice(n)},reduce:function(e,t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!==typeof t)throw new TypeError(t+" is not a function");var n,r=Object(e),i=r.length>>>0,o=0;if(3===arguments.length)n=arguments[2];else{for(;o=i)throw new TypeError("Reduce of empty array with no initial value");n=r[o++]}for(;or?e:r}),1)},toFixed:function(e,t,n,r){var i,o,a,s,l=e.toString().split("."),c=t-(r||0);return i=2===l.length?Math.min(Math.max(l[1].length,c),t):c,a=Math.pow(10,i),s=(n(e+"e+"+i)/a).toFixed(i),r>t-i&&(o=new RegExp("\\.?0{1,"+(r-(t-i))+"}$"),s=s.replace(o,"")),s}},e.options=a,e.formats=r,e.locales=i,e.locale=function(e){return e&&(a.currentLocale=e.toLowerCase()),a.currentLocale},e.localeData=function(e){if(!e)return i[a.currentLocale];if(e=e.toLowerCase(),!i[e])throw new Error("Unknown locale : "+e);return i[e]},e.reset=function(){for(var e in o)a[e]=o[e]},e.zeroFormat=function(e){a.zeroFormat="string"===typeof e?e:null},e.nullFormat=function(e){a.nullFormat="string"===typeof e?e:null},e.defaultFormat=function(e){a.defaultFormat="string"===typeof e?e:"0.0"},e.register=function(e,t,n){if(t=t.toLowerCase(),this[e+"s"][t])throw new TypeError(t+" "+e+" already registered.");return this[e+"s"][t]=n,n},e.validate=function(t,n){var r,i,o,a,s,l,c,u;if("string"!==typeof t&&(t+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{c=e.localeData(n)}catch(f){c=e.localeData(e.locale())}return o=c.currency.symbol,s=c.abbreviations,r=c.delimiters.decimal,i="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===o))&&(null===(u=t.match(/[^\d]+$/))||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(l=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&!((a=t.split(r)).length>2)&&(a.length<2?!!a[0].match(/^\d+.*\d$/)&&!a[0].match(l):1===a[0].length?!!a[0].match(/^\d+$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/):!!a[0].match(/^\d+.*\d$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/)))},e.fn=s.prototype={clone:function(){return e(this)},format:function(t,n){var i,o,s,l=this._value,c=t||a.defaultFormat;if(n=n||Math.round,0===l&&null!==a.zeroFormat)o=a.zeroFormat;else if(null===l&&null!==a.nullFormat)o=a.nullFormat;else{for(i in r)if(c.match(r[i].regexps.format)){s=r[i].format;break}o=(s=s||e._.numberToFormat)(l,c,n)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e+Math.round(n*t)}return this._value=t.reduce([this._value,e],r,0)/n,this},subtract:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e-Math.round(n*t)}return this._value=t.reduce([e],r,Math.round(this._value*n))/n,this},multiply:function(e){function n(e,n,r,i){var o=t.correctionFactor(e,n);return Math.round(e*o)*Math.round(n*o)/Math.round(o*o)}return this._value=t.reduce([this._value,e],n,1),this},divide:function(e){function n(e,n,r,i){var o=t.correctionFactor(e,n);return Math.round(e*o)/Math.round(n*o)}return this._value=t.reduce([this._value,e],n),this},difference:function(t){return Math.abs(e(this._value).subtract(t).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(t,n,r){var i,o=e._.includes(n," BPS")?" ":"";return t*=1e4,n=n.replace(/\s?BPS/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"BPS"),i=i.join("")):i=i+o+"BPS",i},unformat:function(t){return+(1e-4*e._.stringToNumber(t)).toFixed(15)}}),function(){var t={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},r=t.suffixes.concat(n.suffixes.filter((function(e){return t.suffixes.indexOf(e)<0}))).join("|");r="("+r.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(r)},format:function(r,i,o){var a,s,l,c=e._.includes(i,"ib")?n:t,u=e._.includes(i," b")||e._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),a=0;a<=c.suffixes.length;a++)if(s=Math.pow(c.base,a),l=Math.pow(c.base,a+1),null===r||0===r||r>=s&&r0&&(r/=s);break}return e._.numberToFormat(r,i,o)+u},unformat:function(r){var i,o,a=e._.stringToNumber(r);if(a){for(i=t.suffixes.length-1;i>=0;i--){if(e._.includes(r,t.suffixes[i])){o=Math.pow(t.base,i);break}if(e._.includes(r,n.suffixes[i])){o=Math.pow(n.base,i);break}}a*=o||1}return a}})}(),e.register("format","currency",{regexps:{format:/(\$)/},format:function(t,n,r){var i,o,a=e.locales[e.options.currentLocale],s={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(n=n.replace(/\s?\$\s?/,""),i=e._.numberToFormat(t,n,r),t>=0?(s.before=s.before.replace(/[\-\(]/,""),s.after=s.after.replace(/[\-\)]/,"")):t<0&&!e._.includes(s.before,"-")&&!e._.includes(s.before,"(")&&(s.before="-"+s.before),o=0;o=0;o--)switch(s.after[o]){case"$":i=o===s.after.length-1?i+a.currency.symbol:e._.insert(i,a.currency.symbol,-(s.after.length-(1+o)));break;case" ":i=o===s.after.length-1?i+" ":e._.insert(i," ",-(s.after.length-(1+o)+a.currency.symbol.length-1))}return i}}),e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(t,n,r){var i=("number"!==typeof t||e._.isNaN(t)?"0e+0":t.toExponential()).split("e");return n=n.replace(/e[\+|\-]{1}0/,""),e._.numberToFormat(Number(i[0]),n,r)+"e"+i[1]},unformat:function(t){var n=e._.includes(t,"e+")?t.split("e+"):t.split("e-"),r=Number(n[0]),i=Number(n[1]);function o(t,n,r,i){var o=e._.correctionFactor(t,n);return t*o*(n*o)/(o*o)}return i=e._.includes(t,"e-")?i*=-1:i,e._.reduce([r,Math.pow(10,i)],o,1)}}),e.register("format","ordinal",{regexps:{format:/(o)/},format:function(t,n,r){var i=e.locales[e.options.currentLocale],o=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),o+=i.ordinal(t),e._.numberToFormat(t,n,r)+o}}),e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(t,n,r){var i,o=e._.includes(n," %")?" ":"";return e.options.scalePercentBy100&&(t*=100),n=n.replace(/\s?\%/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"%"),i=i.join("")):i=i+o+"%",i},unformat:function(t){var n=e._.stringToNumber(t);return e.options.scalePercentBy100?.01*n:n}}),e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,t,n){var r=Math.floor(e/60/60),i=Math.floor((e-60*r*60)/60),o=Math.round(e-60*r*60-60*i);return r+":"+(i<10?"0"+i:i)+":"+(o<10?"0"+o:o)},unformat:function(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}}),e})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"PlayCircleOutline");t.default=a},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}),"Security");t.default=a},function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(50)).default)(o.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");t.default=a},function(e,t,n){"use strict";var r=n(32),i=n.n(r),o=n(142),a=n.n(o),s=n(143),l=n.n(s);i.a.extend(a.a),i.a.extend(l.a);var c=function(){function e(e){var t=void 0===e?{}:e,n=t.locale,r=t.instance,o=t.dayjs;this.yearFormat="YYYY",this.yearMonthFormat="MMMM YYYY",this.dateTime12hFormat="MMMM Do hh:mm a",this.dateTime24hFormat="MMMM Do HH:mm",this.time12hFormat="hh:mm A",this.time24hFormat="HH:mm",this.dateFormat="MMMM Do",this.dayjs=function(e,t){return t?function(){for(var n=[],r=0;r68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,s("month")],MM:[n,s("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function d(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),i=r.year,o=r.month,a=r.day,s=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,f=r.zone,h=new Date,p=a||(i||o?1:h.getDate()),v=i||h.getFullYear(),m=0;i&&!o||(m=o>0?o-1:h.getMonth());var g=s||0,b=l||0,y=c||0,O=u||0;return f?new Date(Date.UTC(v,m,p,g,b,y,O+60*f.offset*1e3)):n?new Date(Date.UTC(v,m,p,g,b,y,O)):new Date(v,m,p,g,b,y,O)}catch(e){return new Date("")}}(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){a[1]=s[p-1];var v=n.apply(this,a);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,e)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return i.bind(this)(e);var r=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(o)}}}()},function(e,t,n){"use strict";var r=n(17),i=n(6),o=n(187),a=n(1),s=["xs","sm","md","lg","xl"];function l(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function c(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(148),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(21),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,i):"dark"===t&&(e.dark=Object(y.a)(e.main,o)))}function x(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,c=void 0===l?{light:v[300],main:v[500],dark:v[700]}:l,x=e.warning,j=void 0===x?{light:m[300],main:m[500],dark:m[700]}:x,S=e.info,E=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,C=e.success,P=void 0===C?{light:b[300],main:b[500],dark:b[700]}:C,M=e.type,T=void 0===M?"light":M,D=e.contrastThreshold,A=void 0===D?3:D,R=e.tonalOffset,N=void 0===R?.2:R,L=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function _(e){return Object(y.d)(e,w.text.primary)>=A?w.text.primary:O.text.primary}var $=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return k(e,"light",n,N),k(e,"dark",r,N),e.contrastText||(e.contrastText=_(e.main)),e},z={dark:w,light:O};return Object(o.a)(Object(a.a)({common:f,type:T,primary:$(n),secondary:$(s,"A400","A200","A700"),error:$(c),warning:$(j),info:$(E),success:$(P),grey:d,contrastThreshold:A,getContrastText:_,augmentColor:$,tonalOffset:N},z[T]),L)}function j(e){return Math.round(1e5*e)/1e5}var S={textTransform:"uppercase"},E='"Roboto", "Helvetica", "Arial", sans-serif';function C(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?E:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,b=n.htmlFontSize,y=void 0===b?16:b,O=n.allVariants,w=n.pxToRem,k=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var x=c/14,C=w||function(e){return"".concat(e/y*x,"rem")},P=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:C(t),lineHeight:n},s===E?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},M={h1:P(f,96,1.167,-1.5),h2:P(f,60,1.2,-.5),h3:P(h,48,1.167,0),h4:P(h,34,1.235,.25),h5:P(h,24,1.334,0),h6:P(v,20,1.6,.15),subtitle1:P(h,16,1.75,.15),subtitle2:P(v,14,1.57,.1),body1:P(h,16,1.5,.15),body2:P(h,14,1.43,.15),button:P(v,14,1.75,.4,S),caption:P(h,12,1.66,.4),overline:P(h,12,2.66,1,S)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:C,round:j,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},M),k,{clone:!1})}function P(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var M=["none",P(0,2,1,-1,0,1,1,0,0,1,3,0),P(0,3,1,-2,0,2,2,0,0,1,5,0),P(0,3,3,-2,0,3,4,0,0,1,8,0),P(0,2,4,-1,0,4,5,0,0,1,10,0),P(0,3,5,-1,0,5,8,0,0,1,14,0),P(0,3,5,-1,0,6,10,0,0,1,18,0),P(0,4,5,-2,0,7,10,1,0,2,16,1),P(0,5,5,-3,0,8,10,1,0,3,14,2),P(0,5,6,-3,0,9,12,1,0,3,16,2),P(0,6,6,-3,0,10,14,1,0,4,18,3),P(0,6,7,-4,0,11,15,1,0,4,20,3),P(0,7,8,-4,0,12,17,2,0,5,22,4),P(0,7,8,-4,0,13,19,2,0,5,24,4),P(0,7,9,-4,0,14,21,2,0,5,26,4),P(0,8,9,-5,0,15,22,2,0,6,28,5),P(0,8,10,-5,0,16,24,2,0,6,30,5),P(0,8,11,-5,0,17,26,2,0,6,32,5),P(0,9,11,-5,0,18,28,2,0,7,34,6),P(0,9,12,-6,0,19,29,2,0,7,36,6),P(0,10,13,-6,0,20,31,3,0,8,38,7),P(0,10,13,-6,0,21,33,3,0,8,40,7),P(0,10,14,-6,0,22,35,3,0,8,42,7),P(0,11,14,-7,0,23,36,3,0,9,44,8),P(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},D=n(265);function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(D.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=x(u),m=l(n),g=A(f),b=Object(o.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,a),overrides:{},palette:v,props:{},shadows:M,typography:C(v,h),spacing:g,shape:T,transitions:R.a,zIndex:N.a},p),y=arguments.length,O=new Array(y>1?y-1:0),w=1;w-1;return function(e){return b(e,!0,1,void 0,o&&!function(e){var t,n;return e.pos==(null===(t=e.options)||void 0===t?void 0:t.simulateBreak)&&(null===(n=e.options)||void 0===n?void 0:n.simulateDoubleBreak)}(e)?i.start:void 0)}}return null==e.parent?v:null}function v(){return 0}var m=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,i,o){var a;return Object(r.a)(this,n),(a=t.call(this,e.state,e.options)).pos=i,a.node=o,a}return Object(i.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.start);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.start==t.start;)t=t.parent;if(g(t,this.node))break;e=this.state.doc.lineAt(t.start)}return this.lineIndent(e)}}]),n}(u.g);function g(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function b(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,l=t?function(e){var t,n=e.node,r=n.childAfter(n.start),i=n.lastChild;if(!r)return null;for(var o=null===(t=e.options)||void 0===t?void 0:t.simulateBreak,a=e.state.doc.lineAt(r.start),s=null==o||o<=a.from?a.to:Math.min(a.to,o),l=r.end;;){var u=n.childAfter(l);if(!u||u==i)return null;if(!u.type.prop(c.c.skipped))return u.startn)){if(r&&i.start=t&&s.to>n&&(r=s)}}return r})))]}return Object(i.a)(e,[{key:"withDialect",value:function(t){return new e(this.parser,t,this.languageData)}},{key:"getTree",value:function(e){return e.field(this.field).tree}},{key:"parsePos",value:function(e){return e.field(this.field).upto}},{key:"ensureTree",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=e.field(this.field);if(r.upto>=t)return r.updatedTree;if(r.parse||r.startParse(this,e.doc),r.parse.pos1&&void 0!==arguments[1]?arguments[1]:{},r=u.f.define({combine:n.languageData?function(e){return e.concat(n.languageData)}:void 0});return new e(t.withProps(u.n.add(Object(a.a)({},t.topType.name,r))),n.dialect||"",r)}}]),e}(),w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(r.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(i.a)(e,[{key:"get",value:function(e){if(e>=this.length)return-1;var t=this.cursorPos-this.string.length;return(e=this.cursorPos)&&(e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},{key:"clip",value:function(t){return new e(this.doc,t)}}]),e}();function k(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e6,r=Date.now()+t;;){var i=e.advance();if(i)return i;if(e.pos>n||Date.now()>r)return null}}function x(e,t){var n=e.forceFinish(),r=n.applyChanges([{fromA:e.pos,toA:n.length,fromB:e.pos,toB:n.length}]).append(t.applyChanges([{fromA:0,toA:e.pos,fromB:0,toB:e.pos}]));return{parsed:n,cache:r}}var j=function(){function e(t,n,i){Object(r.a)(this,e),this.tree=t,this.upto=n,this.cache=i,this.parse=null,this.updatedTree=t}return Object(i.a)(e,[{key:"apply",value:function(t,n,r){var i,a=Object(o.a)(t.effects);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.is(r))return s.value}}catch(c){a.e(c)}finally{a.f()}if(!t.docChanged)return this;var l=[];return t.changes.iterChangedRanges((function(e,t,n,r){return l.push({fromA:e,toA:t,fromB:n,toB:r})})),e.advance((this.parse?x(this.parse,this.updatedTree).cache:this.cache).applyChanges(l),n,t.state.doc)}},{key:"startParse",value:function(e,t){this.parse=e.parser.startParse(new w(t),{cache:this.cache,dialect:e.dialect})}},{key:"stopParse",value:function(e,t){if(e)this.cache=e;else{var n=x(this.parse,this.updatedTree);e=n.parsed,this.cache=n.cache}return this.updatedTree=e,this.upto=null!==t&&void 0!==t?t:this.parse.pos,this.parse=null,e}}],[{key:"advance",value:function(t,n,r){var i=n.parser.startParse(new w(r),{cache:t,dialect:n.dialect}),o=k(i,25);if(o)return new e(o,r.length,o);var a=x(i,t);return new e(a.parsed,i.pos,a.cache)}}]),e}(),S="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},E="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,C=function(){function e(t,n,i){Object(r.a)(this,e),this.view=t,this.syntax=n,this.setSyntax=i,this.working=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(i.a)(e,[{key:"update",value:function(e){e.docChanged&&this.scheduleWork()}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state;e.field(this.syntax.field).upto>=e.doc.length||(this.working=S(this.work,{timeout:200}))}}},{key:"work",value:function(e){this.working=-1;var t=this.view.state,n=t.field(this.syntax.field);if(!(n.upto>=t.doc.length)){n.parse||n.startParse(this.syntax,t.doc);var r=k(n.parse,e?Math.max(25,e.timeRemaining()):100);if(r||n.parse.badness>.8){var i=n.stopParse(r,t.doc.length);this.view.dispatch({effects:this.setSyntax.of(new j(i,t.doc.length,n.cache))})}else this.scheduleWork()}}},{key:"destroy",value:function(){this.working>=0&&E(this.working)}}]),e}(),P=n(103),M={bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},T={avg:7,bottomk:8,count:9,count_values:10,group:11,max:12,min:13,quantile:14,stddev:15,stdvar:16,sum:17,topk:18,by:19,without:20,and:21,or:22,unless:23},D={__proto__:null,absent_over_time:257,absent:259,abs:261,avg_over_time:263,ceil:265,changes:267,clamp_max:269,clamp_min:271,count_over_time:273,days_in_month:275,day_of_month:277,day_of_week:279,delta:281,deriv:283,exp:285,floor:287,histogram_quantile:289,holt_winters:291,hour:293,idelta:295,increase:297,irate:299,label_replace:301,label_join:303,ln:305,log10:307,log2:309,max_over_time:311,min_over_time:313,minute:315,month:317,predict_linear:319,quantile_over_time:321,rate:323,resets:325,round:327,scalar:329,sort:331,sort_desc:333,sqrt:335,stddev_over_time:337,stdvar_over_time:339,sum_over_time:341,timestamp:343,time:345,vector:347,year:349},A=P.b.deserialize({states:"2SO%jQPOOOOQO'#Cx'#CxO%nQPO'#CwQ'QQQOOOOQO'#De'#DeO%tQPO'#DdO%jQPO'#ElOOQO'#Ep'#EpO%jQPO'#EoOOQO'#Er'#ErO'UQSO'#EsO'^QQO'#EqOOQO'#Eq'#EqOOQO'#Cv'#CvOOQO'#Df'#DfOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpOOQO'#Dq'#DqOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgO(qQPO'#CyO(vQPO'#DOO%tQPO,59cO(}QQO,59cO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/SQQO,5;SO/XQQO,5;VOOQO,5:O,5:OO/^QQO,5;WO/eQQO,5;ZO0uQPO'#EuO1TQPO,5;_OOQO'#Et'#EtOOQO,5;_,5;_OOQO,5;],5;]O1]QSO'#CzOOQO,59e,59eO1eQPO,59jO1mQQO'#DPOOQO,59j,59jOOQO1G.}1G.}OOQO'#DU'#DUO6XQPO'#DTO6cQPO'#DTOOQO'#DS'#DSO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO6mQSO1G0nOOQO1G0q1G0qOOQO1G0r1G0rOOQO'#Ev'#EvO6uQPO,5;aO6zQSO1G0yOOQO1G0y1G0yOOQO'#C|'#C|O7SQPO,59fOOQO'#C{'#C{OOQO,59f,59fO%jQPO,59kOOQO1G/U1G/UO(qQPO,59qO7[QPO,59oO]QQO7+$rO>sQQO7+$rO@XQQO7+$rOOQO7+&Y7+&YO@oQQO7+&`OOQO1G0{1G0{OOQO1G0z1G0zOOQO7+&e7+&eO@wQSO1G/QOOQO1G/Q1G/QOAPQQO1G/VOOQO1G/]1G/]OOQO'#DW'#DWOOQO1G/Z1G/ZOOQO<|Q;xP#]Q!Q![;{QR#g#h+rQ>UR!Q![>R#a#b>_#g#h>eQ>bP#g#h+rQ>jP#]Q!Q![>mQ>pQ!Q![>m#a#b>vQ>yP#g#h+rQ?RP#]Q!Q![?UQ?XQ!Q![?U#a#b?_Q?bP#g#h+rQ?jP#]Q!Q![?mQ?pR!Q![?m#a#b?y#g#hAPQ@OQ#]Q!Q![@U#g#h+rQ@XR!Q![@U#a#b@b#g#h@hQ@eP#g#h+rQ@mP#]Q!Q![@pQ@sQ!Q![@p#a#b@yQ@|P#g#h+rQAUP#]Q!Q![AXQA[Q!Q![AX#a#bAbQAeP#g#h+rQAmQ#]Q!Q![As#g#h+rQAvR!Q![As#a#bBP#g#hBVQBSP#g#h+rQB[P#]Q!Q![B_QBbQ!Q![B_#a#bBhQBkP#g#h+rQBsP#]Q!Q![BvQByQ!Q![Bv#a#bCPQCSP#g#h+rQC[P#]Q!Q![C_QCbT!Q![C_#W#XCq#[#]Gz#a#bI}#g#hKTQCvP#]Q!Q![CyQC|S!Q![Cy#[#]DY#a#bF]#g#hGcQD_P#]Q!Q![DbQDeR!Q![Db#a#bDn#g#hEtQDsQ#]Q!Q![Dy#g#h+rQD|R!Q![Dy#a#bEV#g#hE]QEYP#g#h+rQEbP#]Q!Q![EeQEhQ!Q![Ee#a#bEnQEqP#g#h+rQEyP#]Q!Q![E|QFPQ!Q![E|#a#bFVQFYP#g#h+rQFbQ#]Q!Q![Fh#g#h+rQFkR!Q![Fh#a#bFt#g#hFzQFwP#g#h+rQGPP#]Q!Q![GSQGVQ!Q![GS#a#bG]QG`P#g#h+rQGhP#]Q!Q![GkQGnQ!Q![Gk#a#bGtQGwP#g#h+rQHPP#]Q!Q![HSQHVR!Q![HS#a#bH`#g#hIfQHeQ#]Q!Q![Hk#g#h+rQHnR!Q![Hk#a#bHw#g#hH}QHzP#g#h+rQISP#]Q!Q![IVQIYQ!Q![IV#a#bI`QIcP#g#h+rQIkP#]Q!Q![InQIqQ!Q![In#a#bIwQIzP#g#h+rQJSQ#]Q!Q![JY#g#h+rQJ]R!Q![JY#a#bJf#g#hJlQJiP#g#h+rQJqP#]Q!Q![JtQJwQ!Q![Jt#a#bJ}QKQP#g#h+rQKYP#]Q!Q![K]QK`Q!Q![K]#a#bKfQKiP#g#h+rPKoR!Q![Kx!c!iKx#T#ZKxPK}R#^P!Q![Kx!c!iKx#T#ZKxVL_T$wS!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLnRLsT!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLn~MXP!U~!_!`M[~MaO!T~~MfQ#kP!_!`Ml#r#sMqQMqO!QQ~MvO#l~~M{P!S~!_!`NO~NTO!R~VN[T!ZRqS!Q![NT![!]Ln!c!}NT#R#SNT#T#oNT~NpO$u~~NuO$v~~NzOu~~N}RO#SNz#S#T%Y#T~Nz~! ]O$z~~! bO${~",tokenizers:[0,1,2],topRules:{"@top":[0,25]},specialized:[{term:57,get:function(e,t){return function(e,t){return M[e.toLowerCase()]||-1}(e)<<1}},{term:57,get:function(e,t){return function(e,t){return T[e.toLowerCase()]||-1}(e)<<1|1}},{term:57,get:function(e){return D[e]||-1}}],tokenPrec:0}),R=26,N=36,L=38,_=39,$=104,z=107,I=109,Q=113,B=117,F=119,W=n(98),H=n(13),V=n(25);function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=n.length){var a=e.resolve(o,-1);if(a.type.id===t.id&&a.start===r&&a.end===o)return a;for(a=e.resolve(r,1);a&&(a.type.id!==t.id||a.start!==r||a.end!==o);)a=a.parent;return a}}})}function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"and"},{label:"or"},{label:"unless"}],Z=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate \u03c6-quantile (0 \u2264 \u03c6 \u2264 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],J=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(G.c)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:Object(G.c)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:Object(G.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')}],ee={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:K,duration:[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],binOpModifier:[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],functionIdentifier:[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from histogram buckets",type:"function"},{label:"holt_winters",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variation within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],aggregateOp:Z,aggregateOpModifier:[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}]};function te(e,t){var n=function(e,t){for(var n=e;n&&n.type.id!==t;)n=n.parent;return n}(e,Q);return n&&(n=q(n,114,57))?t.sliceDoc(n.start,n.end):""}function ne(e,t){var n,r,i,o,a,s,l,c,u,f,d,h,p,v,m,g,b,y=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===z){y.push({kind:X.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===$){y.push({kind:X.Duration});break}var O=e.sliceDoc(t.start,t.end);K.filter((function(e){return e.label.includes(O)})).length>0&&y.push({kind:X.BinOp});break;case 57:if(0===(null===(i=t.parent)||void 0===i?void 0:i.type.id)){if(27===(null===(o=t.parent.parent)||void 0===o?void 0:o.type.id)){y.push({kind:X.AggregateOpModifier},{kind:X.BinOp});break}if((null===(a=t.parent.parent)||void 0===a?void 0:a.type.id)===Q){var w=te(t,e);Z.filter((function(e){return e.label===w})).length>0&&y.push({kind:X.AggregateOpModifier}),y.push({kind:X.BinOp},{kind:X.Offset});break}}var k=null===(c=null===(l=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===l?void 0:l.parent)||void 0===c?void 0:c.parent;if(!k){y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break}(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&i++;var o=0,a=e.iterate({enter:function(t){if(t.id!==e.type.id||0!==i)return(t.id===n[o]||t.name===n[o])&&++o>=n.length;i++}});return void 0!==a&&a})(k,R,R)?k.type.id!==N||U(k,0)?(k.type.id!==N||k.type.id===N&&U(k,0))&&y.push({kind:X.BinOp},{kind:X.Offset}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation},{kind:X.BinOpModifier}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 30:y.push({kind:X.LabelName});break;case 115:y.push({kind:X.LabelName,metricName:te(t,e)});break;case 33:32===(null===(u=t.parent)||void 0===u?void 0:u.type.id)?y.push({kind:X.LabelName}):(null===(f=t.parent)||void 0===f?void 0:f.type.id)===B&&y.push({kind:X.LabelName,metricName:te(t,e)});break;case B:33===(null===(d=t.firstChild)||void 0===d?void 0:d.type.id)&&0===(null===(h=t.lastChild)||void 0===h?void 0:h.type.id)&&null===(null===(p=t.lastChild)||void 0===p?void 0:p.firstChild)&&y.push({kind:X.MatchOp});break;case I:if((null===(v=t.parent)||void 0===v?void 0:v.type.id)===B){var x="";33===(null===(m=t.parent.firstChild)||void 0===m?void 0:m.type.id)&&(x=e.sliceDoc(t.parent.firstChild.start,t.parent.firstChild.end));var j=te(t,e);y.push({kind:X.LabelValue,metricName:j,labelName:x})}break;case 105:case z:y.push({kind:X.Duration});break;case 34:y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 53:118===(null===(g=t.parent)||void 0===g?void 0:g.type.id)?y.push({kind:X.MatchOp}):(null===(b=t.parent)||void 0===b?void 0:b.type.id)===N&&y.push({kind:X.BinOp});break;case F:case 120:case 121:case 118:y.push({kind:X.MatchOp});break;case 37:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 21:case 23:case 22:case N:y.push({kind:X.BinOp})}return y}!function(e){e[e.MetricName=0]="MetricName",e[e.LabelName=1]="LabelName",e[e.LabelValue=2]="LabelValue",e[e.Function=3]="Function",e[e.Aggregation=4]="Aggregation",e[e.BinOpModifier=5]="BinOpModifier",e[e.BinOp=6]="BinOp",e[e.MatchOp=7]="MatchOp",e[e.AggregateOpModifier=8]="AggregateOpModifier",e[e.Duration=9]="Duration",e[e.Offset=10]="Offset"}(X||(X={}));var re=function(){function e(t){Object(r.a)(this,e),this.prometheusClient=t}return Object(i.a)(e,[{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,a=r.tree.resolve(i,-1),s=ne(r,a),l=Promise.resolve([]),c=!1,u=!0,f=Object(o.a)(s);try{var d=function(){var e=t.value;switch(e.kind){case X.Aggregation:l=l.then((function(e){return e.concat(ee.aggregateOp)}));break;case X.Function:l=l.then((function(e){return e.concat(ee.functionIdentifier)}));break;case X.BinOpModifier:l=l.then((function(e){return e.concat(ee.binOpModifier)}));break;case X.BinOp:l=l.then((function(e){return e.concat(ee.binOp)}));break;case X.MatchOp:l=l.then((function(e){return e.concat(ee.matchOp)}));break;case X.AggregateOpModifier:l=l.then((function(e){return e.concat(ee.aggregateOpModifier)}));break;case X.Duration:u=!1,l=l.then((function(e){return e.concat(ee.duration)}));break;case X.Offset:l=l.then((function(e){return e.concat([{label:"offset"}])}));break;case X.MetricName:l=l.then((function(e){return c=!0,n.autocompleteMetricName(e)}));break;case X.LabelName:l=l.then((function(t){return n.autocompleteLabelName(t,e.metricName)}));break;case X.LabelValue:l=l.then((function(t){return n.autocompleteLabelValue(t,e.labelName,e.metricName)}))}};for(f.s();!(t=f.n()).done;)d()}catch(h){f.e(h)}finally{f.f()}return l.then((function(e){return function(e,t,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&i.push.apply(i,Object(V.a)(J)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,o,a,s,l=e.start;return 30===e.type.id||115===e.type.id||34===e.type.id||e.type.id===I&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===B?l++:e.type.id===B&&33===(null===(r=e.firstChild)||void 0===r?void 0:r.type.id)&&0===(null===(i=e.lastChild)||void 0===i?void 0:i.type.id)&&null===(null===(o=e.lastChild)||void 0===o?void 0:o.firstChild)?l=e.lastChild.start:e.type.id!==z&&(0!==e.type.id||(null===(a=e.parent)||void 0===a?void 0:a.type.id)!==z&&(null===(s=e.parent)||void 0===s?void 0:s.type.id)!==$)||(l=t),l}(a,i),i,c,u)}))}},{key:"autocompleteMetricName",value:function(e){var t=this;if(!this.prometheusClient)return e;var n=new Map;return this.prometheusClient.labelValues("__name__").then((function(e){var r,i,a=Object(o.a)(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;n.set(s,{label:s,type:"constant"})}}catch(l){a.e(l)}finally{a.f()}if(e.length<=1e4)return null===(r=t.prometheusClient)||void 0===r?void 0:r.metricMetadata()})).then((function(t){if(t){var r,i=Object(o.a)(n);try{for(i.s();!(r=i.n()).done;){var a=Object(H.a)(r.value,2),s=a[0],l=a[1],c=t.get(s.replace(/(_count|_sum|_bucket)$/,""));if(c)if(c.length>1){var u,f=Object(o.a)(c);try{for(f.s();!(u=f.n()).done;){var d=u.value;""===l.detail?l.detail=d.type:l.detail!==d.type&&(l.detail="unknown",l.info="multiple different definitions for this metric"),""===l.info?l.info=d.help:l.info!==d.help&&(l.info="multiple different definitions for this metric")}}catch(m){f.e(m)}finally{f.f()}}else if(1===c.length){var h=c[0],p=h.type,v=h.help;"histogram"!==p&&"summary"!==p||(s.endsWith("_count")&&(p="counter",v="The total number of observations for: ".concat(v)),s.endsWith("_sum")&&(p="counter",v="The total sum of observations for: ".concat(v)),s.endsWith("_bucket")&&(p="counter",v="The total count of observations for a bucket in the histogram: ".concat(v))),l.detail=p,l.info=v}}}catch(m){i.e(m)}finally{i.f()}}return e.concat(Array.from(n.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t,n){return this.prometheusClient&&t?this.prometheusClient.labelValues(t,n).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),ie="/api/v1/label/:name/values",oe=function(){function e(){Object(r.a)(this,e),this.completeAssociation=new Map,this.metricMetadata=new Map,this.labelValues=new Map,this.labelNames=[]}return Object(i.a)(e,[{key:"setAssociation",value:function(e,t){var n=this.completeAssociation.get(e);n||(n=new Map,this.completeAssociation.set(e,n));for(var r=0,i=Object.entries(t);r0)return Promise.resolve(this.cache.getLabelNames(e));var n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=new URLSearchParams({start:r.toISOString(),end:n.toISOString()});return this.fetchAPI("".concat("/api/v1/labels","?").concat(i)).then((function(e){return t.cache.setLabelNames(e),e})).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e,r,n).then((function(n){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this;if(this.cache.getLabelValues(e,t)&&this.cache.getLabelValues(e,t).length>0)return Promise.resolve(this.cache.getLabelValues(e,t));var r=new Date,i=new Date(r.getTime()-this.lookbackInterval);if(!t||0===t.length){var o=new URLSearchParams({start:i.toISOString(),end:r.toISOString()});return this.fetchAPI("".concat(ie.replace(/:name/gi,e),"?").concat(o)).then((function(t){return n.cache.setLabelValues(e,t),t})).catch((function(e){return n.errorHandler&&n.errorHandler(e),[]}))}return this.series(t,i,r).then((function(r){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this;return this.cache.getMetricMetadata()&&this.cache.getMetricMetadata().size>0?Promise.resolve(this.cache.getMetricMetadata()):this.fetchAPI("/api/v1/metadata").then((function(t){for(var n=0,r=Object.entries(t);n0){var s,l=Object(o.a)(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;n.matchingLabels.push(e.sliceDoc(c.start,c.end))}}catch(m){l.e(m)}finally{l.f()}}}var u=q(t,L,_,4),f=q(t,L,_,5);if(u||f){n.card=u?pe.CardManyToOne:pe.CardOneToMany;var d=Y(q(t,L,_,42,30),31,32);if(d.length>0){var h,p=Object(o.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.start,v.end))}}catch(m){p.e(m)}finally{p.f()}}}return U(t,21,22,23)&&n.card===pe.CardOneToOne&&(n.card=pe.CardManyToMany),n}(this.state,e);if(null!==c&&c.on){var u,f=Object(o.a)(c.matchingLabels);try{for(f.s();!(u=f.n()).done;){var d,h=u.value,p=Object(o.a)(c.include);try{for(p.s();!(d=p.n()).done;){h===d.value&&this.addDiagnostic(e,'label "'.concat(h,'" must not occur in ON and GROUP clause at once'))}}catch(v){p.e(v)}finally{p.f()}}}catch(v){f.e(v)}finally{f.f()}}r!==de.scalar&&r!==de.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),i!==de.scalar&&i!==de.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===de.vector&&i===de.vector||null===c?l&&((null===c||void 0===c?void 0:c.card)!==pe.CardOneToMany&&(null===c||void 0===c?void 0:c.card)!==pe.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===c||void 0===c?void 0:c.card)!==pe.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):c.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==de.scalar&&i!==de.scalar||!l||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=Y(q(e,34),35,R),i=me(n.type.id),o=i.argTypes.length;if(0===i.variadic)r.length!==o&&this.addDiagnostic(e,"expected ".concat(o," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var a=o-1;if(a>r.length)this.addDiagnostic(e,"expected at least ".concat(a," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var s=a+i.variadic;i.variadic>0&&s=i.argTypes.length){if(0===i.variadic)break;l=i.argTypes.length-1}this.expectType(r[c],i.argTypes[l],"call to function ".concat(i.name))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=ye(Y(q(e,115,116),116,B),this.state),n="",r=q(e,114,57);if(r&&(n=this.state.sliceDoc(r.start,r.end)),""!==n){var i=t.find((function(e){return"__name__"===e.name}));i&&this.addDiagnostic(e,"metric name must not be set twice: ".concat(n," or ").concat(i.value)),t.push(new be(F,"__name__",n))}t.every((function(e){return e.matchesEmpty()}))&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}},{key:"expectType",value:function(e,t,n){var r=this.checkAST(e);r!==t&&this.addDiagnostic(e,"expected type ".concat(t," in ").concat(n,", got ").concat(r))}},{key:"addDiagnostic",value:function(e,t){this.diagnostics.push({severity:"error",message:t,from:e.start,to:e.end})}}]),e}(),we=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,[{key:"promQL",value:function(){return function(e){var t=new Oe(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();var ke=O.define(A.withProps(Object(W.b)({LineComment:"comment",LabelName:"labelName",StringLiteral:"string",NumberLiteral:"number",Duration:"number","Abs Absent AbsentOverTime AvgOverTime Ceil Changes ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear QuantileOverTime Rate Resets Round Scalar Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year":"functionName","Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":"operatorKeyword","By Without Bool On Ignoring GroupLeft GroupRight Offset":"modifier","And Unless Or":"logicOperator","Sub Add Mul Mod Div Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow":"operator",UnaryOp:"arithmeticOperator","( )":"paren","[ ]":"squareBracket","{ }":"brace","\u26a0":"invalid"})),{languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),xe=function(){function e(){Object(r.a)(this,e),this.complete=ue(),this.lint=new we,this.enableLinter=!0,this.enableCompletion=!0}return Object(i.a)(e,[{key:"setComplete",value:function(e){return this.complete=ue(e),this}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e,t,n=this,r=[ke];if(this.enableCompletion){var i=ke.languageData.of({autocomplete:function(e){return n.complete.promQL(e)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat((e=this.lint.promQL,t=this.lint,Object(he.b)(e.call(t))))),r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return Mt}));var r=n(25),i=n(9),o=n(3),a=n(5),s=n(4),l=n(7),c=o.a.define(),u=o.a.define(),f=o.f.define(),d=o.f.define({combine:function(e){return Object(o.m)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),h=o.j.define({create:function(){return P.empty},update:function(e,t){var n=t.state.facet(d),r=t.annotation(c);if(r){var i=O.fromTransaction(t),a=r.side,s=0==a?e.undone:e.done;return s=i?w(s,s.length,n.minDepth,i):j(s,t.startState.selection),new P(0==a?r.rest:s,0==a?s:r.rest)}var l=t.annotation(u);if("full"!=l&&"before"!=l||(e=e.isolate()),!1===t.annotation(o.l.addToHistory))return t.changes.length?e.addMapping(t.changes.desc):e;var f=O.fromTransaction(t),h=t.annotation(o.l.time),p=t.annotation(o.l.userEvent);return f?e=e.addChanges(f,h,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,p,n.newGroupDelay)),"full"!=l&&"after"!=l||(e=e.isolate()),e}});function p(e,t){return function(n){var r=n.state,i=n.dispatch,o=r.field(h,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var v=p(0,!1),m=p(1,!1),g=p(0,!0),b=p(1,!0);function y(e){return function(t){var n=t.field(h,!1);if(!n)return 0;var r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}y(0),y(1);var O=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return Object(l.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}}],[{key:"fromTransaction",value:function(t){var n,r=x,i=Object(a.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(t);o.length&&(r=r.concat(o))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,t.startState.selection,x)}},{key:"selection",value:function(t){return new e(void 0,x,void 0,void 0,t)}}]),e}();function w(e,t,n,r){var i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function k(e,t){return e.length?t.length?e.concat(t):e:t}var x=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),w(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function E(e,t){if(!e.length)return e;for(var n=e.length,r=x;n;){var i=C(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=e.slice(0,n);return o[n-1]=i,o}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:x}function C(e,t,n){var r=k(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):x,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new O(i,o.i.mapEffects(e.effects,t),s,e.startSelection.map(a),r)}var P=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(l.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,o){var a=this.done,s=a[a.length-1];return new e(a=s&&s.changes&&n-this.prevTime=s&&i<=l&&(r=!0)}})),r}(s.changes,t.changes)?w(a,a.length-1,o,new O(t.changes.compose(s.changes),k(t.effects,s.effects),s.mapped,s.startSelection,x)):w(a,a.length,o,t),x,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:x;return s.length>0&&n-this.prevTimethis.i;)e.dom.removeChild(e.elements.pop().dom)}}]),e}(),F=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className=Object(i.n)("gutter"+(this.config.style?"."+this.config.style:"")),this.elementClass=Object(i.n)("gutterElement"+(this.config.style?"."+this.config.style:""));var o=function(e){r.dom.addEventListener(e,(function(r){var i=t.visualLineAtHeight(r.clientY,t.contentDOM.getBoundingClientRect().top);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var a in n.domEventHandlers)o(a);this.markers=n.markers(t.state),n.initialSpacer&&(this.spacer=new W(t,0,0,[n.initialSpacer(t)],this.elementClass),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(l.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=this.config.markers(e.state),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n],this.elementClass)}return this.markers!=t}}]),e}(),W=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i,o)}return Object(l.a)(e,[{key:"update",value:function(e,t,n,r,i){if(this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var o;o=this.dom.lastChild;)o.remove();var s,l=i,c=Object(a.a)(r);try{for(c.s();!(s=c.n()).done;){var u=s.value,f=u.toDOM(e);f&&this.dom.appendChild(f);var d=u.elementClass;d&&(l+=" "+d)}}catch(h){c.e(h)}finally{c.f()}this.dom.className=l}}}]),e}();var H=o.f.define(),V=o.f.define({combine:function(e){return Object(o.m)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(e,t){var n=Object.assign({},e),r=function(e){var r=n[e],i=t[e];n[e]=r?function(e,t,n){return r(e,t,n)||i(e,t,n)}:i};for(var i in t)r(i);return n}})}}),q=function(e){Object(T.a)(n,e);var t=Object(D.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(l.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){var t=e.state.facet(V);return document.createTextNode(t.formatNumber(this.number))}}]),n}(R),U=_({style:"lineNumber",markers:function(e){return e.facet(H)},lineMarker:function(e,t,n){return n.length?null:new q(e.state.doc.lineAt(t.from).number)},initialSpacer:function(e){return new q(Y(e.state.doc.lines))},updateSpacer:function(e,t){var n=Y(t.view.state.doc.lines);return n==e.number?e:new q(n)}});function Y(e){for(var t=9;t=r?void 0:{from:n,to:r}}var G=o.i.define({map:X}),K=o.i.define({map:X});function Z(e){var t,n=[],r=Object(a.a)(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return"continue";n.push(e.visualLineAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}return n}var J=o.j.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(a.a)(t.effects);try{var i=function(){var t=n.value;t.is(G)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,t.value.from,t.value.to)?e=e.update({add:[se.range(t.value.from,t.value.to)]}):t.is(K)&&(e=e.update({filter:function(e,n){return t.value.from!=e||t.value.to!=n},filterFrom:t.value.from,filterTo:t.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(l){r.e(l)}finally{r.f()}if(t.selection){var o=!1,s=t.selection.primary.head;e.between(s,s,(function(e,t){es&&(o=!0)})),o&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:[i.d.decorations]});function ee(e,t,n){var r,i=null;return null===(r=e.field(J,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function te(e,t,n){return e.facet(o.e.foldable).reduce((function(r,i){return r||i(e,t,n)}),null)}function ne(e){return e.field(J,!1)?void 0:{append:ae()}}var re=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(a.a)(Z(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=te(e.state,r.from,r.to);if(i)return e.dispatch({effects:G.of(i),reconfigure:ne(e.state)}),!0}}catch(o){n.e(o)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(J,!1))return!1;var t,n=[],r=Object(a.a)(Z(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=ee(e.state,i.from,i.to);o&&n.push(K.of(o))}}catch(s){r.e(s)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r"};var ve="()[]{}<>";function me(e){for(var t=0;t2||2==r.length&&1==Object(he.c)(Object(he.b)(r,0))||t!=i.from||n!=i.to)return!1;var o=function(e,t){var n,r=ge(e,e.selection.primary.head),i=r.brackets||pe.brackets,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=me(Object(he.b)(s,0));if(t==s)return l==s?xe(e,s,i.indexOf(s+s+s)>-1):we(e,s,l,r.before||pe.before);if(t==l)return ke(e,s,l)}}catch(c){o.e(c)}finally{o.f()}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}var ye=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=ge(t,t.selection.primary.head).brackets||pe.brackets,i=null,s=t.changeByRange((function(e){if(e.empty){var n,s=function(e,t){var n=e.sliceString(t-2,t);return Object(he.c)(Object(he.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),l=Object(a.a)(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(c==s&&Oe(t.doc,e.head)==me(Object(he.b)(c,0)))return{changes:{from:e.head-c.length,to:e.head+c.length},range:o.d.cursor(e.head-c.length),annotations:o.l.userEvent.of("delete")}}}catch(u){l.e(u)}finally{l.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function Oe(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(he.c)(Object(he.b)(n,0)))}function we(e,t,n,r){var i=null,a=e.changeByRange((function(a){if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],range:o.d.range(a.anchor+t.length,a.head+t.length)};var s=Oe(e.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:a.head},range:o.d.cursor(a.head+t.length)}:{range:i=a}}));return i?null:e.update(a,{scrollIntoView:!0,annotations:o.l.userEvent.of("input")})}function ke(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Oe(e.doc,t.head)==n?o.d.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:o.d.create(i,e.selection.primaryIndex),scrollIntoView:!0})}function xe(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],range:o.d.range(i.anchor+t.length,i.head+t.length)};var a=i.head,s=Oe(e.doc,a);if(s==t){if(je(e,a))return{changes:{insert:t+t,from:a},range:o.d.cursor(a+t.length)};var l=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:o.d.cursor(a+t.length*(l?3:1))}}if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&je(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},range:o.d.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=o.c.Word){var c=e.sliceDoc(a-1,a);if(c!=t&&e.charCategorizer(a)(c)!=o.c.Word)return{changes:{insert:t+t,from:a},range:o.d.cursor(a+t.length)}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,annotations:o.l.userEvent.of("input")})}function je(e,t){var n=e.tree.resolve(t+1);return n.parent&&n.start==t}var Se=n(33),Ee="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},Ce=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,o=arguments.length>4?arguments[4]:void 0;Object(s.a)(this,e),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(e){return o(Ee(e))}:Ee,this.query=this.normalize(n)}return Object(l.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=String.fromCharCode(e),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,t+=String.fromCharCode(r)}for(var i=this.normalize(t),o=0,a=n;;o++){var s=i.charCodeAt(o),l=this.match(s,a);if(l)return this.value=l,this;if(o==i.length-1)break;a==n&&o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Ce(e,this.search,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),e}(),Me=o.i.define(),Te=o.i.define(),De=o.j.define({create:function(){return new Ae(new Pe("","",!1),[])},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Me)?e=new Ae(i.value,e.panel):i.is(Te)&&(e=new Ae(e.query,i.value?[He]:[]))}}catch(o){r.e(o)}finally{r.f()}return e},provide:[Se.c.nFrom((function(e){return e.panel}))]}),Ae=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},Re=i.b.mark({class:Object(i.n)("searchMatch")}),Ne=i.b.mark({class:Object(i.n)("searchMatch.selected")}),Le=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(De))}return Object(l.a)(e,[{key:"update",value:function(e){var t=e.state.field(De);(t!=e.prevState.field(De)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel.length||!t.valid)return i.b.none;for(var n=this.view.state,r=this.view.viewport,o=t.cursor(n.doc,Math.max(0,r.from-t.search.length),Math.min(r.to+t.search.length,n.doc.length)),a=new A.c,s=function(){var e=o.value,t=e.from,r=e.to,i=n.selection.ranges.some((function(e){return e.from==t&&e.to==r}));a.add(t,r,i?Ne:Re)};!o.next().done;)s();return a.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function _e(e){return function(t){var n=t.state.field(De,!1);return n&&n.query.valid?e(t,n):Ve(t)}}function $e(e,t,n){var r=n.cursor(e,t).next();return r.done&&(r=n.cursor(e,0,t+n.search.length-1).next()).done?null:r.value}var ze=_e((function(e,t){var n=e.state.selection.primary,r=n.from,i=n.to,o=$e(e.state.doc,e.state.selection.primary.from+1,t.query);return!(!o||o.from==r&&o.to==i)&&(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),Ke(e),!0)}));function Ie(e,t,n,r){for(var i=r;;){for(var o=Math.max(n,i-1e4-e.search.length),a=e.cursor(t,o,i),s=null;!a.next().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}var Qe=_e((function(e,t){var n=t.query,r=e.state,i=Ie(n,r.doc,0,r.selection.primary.to-1)||Ie(n,r.doc,r.selection.primary.from+1,r.doc.length);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Ke(e),!0)})),Be=_e((function(e,t){for(var n=t.query.cursor(e.state.doc),r=[];!n.next().done;)r.push(o.d.range(n.value.from,n.value.to));return!!r.length&&(e.dispatch({selection:o.d.create(r)}),!0)})),Fe=_e((function(e,t){var n=t.query,r=e.state,i=$e(r.doc,r.selection.primary.from,n);if(!i)return!1;var o,a=r.selection.primary,s=a.from,l=a.to,c=[];if(i.from==s&&i.to==l&&(c.push({from:i.from,to:i.to,insert:n.replace}),i=$e(r.doc,i.to,n)),i){var u=0==c.length||c[0].from>=i.to?0:i.to-i.from-n.replace.length;o={anchor:i.from-u,head:i.to-u}}return e.dispatch({changes:c,selection:o,scrollIntoView:!!o}),i&&Ke(e),!0})),We=_e((function(e,t){for(var n=t.query,r=n.cursor(e.state.doc),i=[];!r.next().done;){var o=r.value,a=o.from,s=o.to;i.push({from:a,to:s,insert:n.replace})}return!!i.length&&(e.dispatch({changes:i}),!0)}));function He(e){var t=e.state.field(De).query;return{dom:Xe({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:Me.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,style:"search"}}var Ve=function(e){var t=e.state.field(De,!1);if(t&&t.panel.length){var n=Object(Se.a)(e,He);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else e.dispatch({effects:Te.of(!0),reconfigure:t?void 0:{append:et}});return!0},qe=function(e){var t=e.state.field(De,!1);if(!t||!t.panel.length)return!1;var n=Object(Se.a)(e,He);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Te.of(!1)}),!0},Ue=[{key:"Mod-f",run:Ve,scope:"editor search-panel"},{key:"F3",run:ze,shift:Qe,scope:"editor search-panel"},{key:"Mod-g",run:ze,shift:Qe,scope:"editor search-panel"},{key:"Escape",run:qe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.primary.empty)return!1;for(var i=r.primary,a=i.from,s=i.to,l=[],c=0,u=new Ce(t.doc,t.sliceDoc(a,s));!u.next().done;){if(l.length>1e3)return!1;u.value.from==a&&(c=l.length),l.push(o.d.range(u.value.from,u.value.to))}return n(t.update({selection:new o.d(l,c)})),!0}}];function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=document.createElement(e);if(t)for(var i in t){var o=t[i];"string"==typeof o?r.setAttribute(i,o):r[i]=o}var s,l=Object(a.a)(n);try{for(l.s();!(s=l.n()).done;){var c=s.value;r.appendChild("string"==typeof c?document.createTextNode(c):c)}}catch(u){l.e(u)}finally{l.f()}return r}function Xe(e){function t(t){return e.view.state.phrase(t)}var n=Ye("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:Object(i.n)("textfield"),name:"search",onchange:a,onkeyup:a}),r=Ye("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:Object(i.n)("textfield"),name:"replace",onchange:a,onkeyup:a}),o=Ye("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:a});function a(){e.updateQuery(new Pe(n.value,r.value,!o.checked))}function s(e,t,n){return Ye("button",{class:Object(i.n)("button"),name:e,onclick:t},n)}return Ye("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?Qe:ze)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),Fe(e.view))}},[n,s("next",(function(){return ze(e.view)}),[t("next")]),s("prev",(function(){return Qe(e.view)}),[t("previous")]),s("select",(function(){return Be(e.view)}),[t("all")]),Ye("label",null,[o,"match case"]),Ye("br"),r,s("replace",(function(){return Fe(e.view)}),[t("replace")]),s("replaceAll",(function(){return We(e.view)}),[t("replace all")]),Ye("button",{name:"close",onclick:function(){return qe(e.view)},"aria-label":t("close")},["\xd7"]),Ye("div",{style:"position: absolute; top: -10000px","aria-live":"polite"})])}var Ge=/[\s\.,:;?!]/;function Ke(e){var t=e.state.selection.primary,n=t.from,r=t.to,i=e.state.doc.lineAt(n).from,o=e.state.doc.lineAt(r).to,a=Math.max(i,n-30),s=Math.min(o,r+30),l=e.state.sliceDoc(a,s);if(a!=i)for(var c=0;c<30;c++)if(!Ge.test(l[c+1])&&Ge.test(l[c])){l=l.slice(c);break}if(s!=o)for(var u=l.length-1;u>l.length-30;u--)if(!Ge.test(l[u-1])&&Ge.test(l[u])){l=l.slice(0,u);break}var f=Object(Se.a)(e,He);f&&f.dom.contains(e.root.activeElement)&&(f.dom.querySelector("div[aria-live]").textContent=e.state.phrase("current match")+". "+l)}var Ze,Je=i.d.baseTheme({"$panel.search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"$$light $searchMatch":{backgroundColor:"#ffff0054"},"$$dark $searchMatch":{backgroundColor:"#00ffff8a"},"$$light $searchMatch.selected":{backgroundColor:"#ff6a0054"},"$$dark $searchMatch.selected":{backgroundColor:"#ff00ff8a"}}),et=[De,Object(o.o)(Le,"override"),Object(Se.b)(),Je],tt=n(70),nt=[{key:"Mod-/",run:function(e){return rt(at(Ze.Toggle),e)}},{key:"Alt-A",run:function(e){return rt(ot(Ze.Toggle),e)}}];function rt(e,t){var n=e(t.state);return!!n&&(t.dispatch(n),!0)}function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.primary.head;return e.languageDataAt("commentTokens",t)[0]||{}}!function(e){e[e.Toggle=0]="Toggle",e[e.OnlyComment=1]="OnlyComment",e[e.OnlyUncomment=2]="OnlyUncomment"}(Ze||(Ze={}));var ot=function(e){return function(t){var n=it(t);return n.block?new st(n.block.open,n.block.close).toggle(e,t):null}},at=function(e){return function(t){var n=it(t);return n.line?new ct(n.line).toggle(e,t):null}},st=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";Object(s.a)(this,e),this.open=t,this.close=n,this.margin=r}return Object(l.a)(e,[{key:"toggle",value:function(e,t){var n=this,r=this.isSelectionCommented(t);if(null!==r){if(e!==Ze.OnlyComment)return t.update({changes:r.map((function(e){var t=e.open,r=e.close;return[{from:t.pos-n.open.length,to:t.pos+t.margin},{from:r.pos-r.margin,to:r.pos+n.close.length}]}))})}else if(e!==Ze.OnlyUncomment)return t.update(t.changeByRange((function(e){var t=(n.open+n.margin).length;return{changes:[{from:e.from,insert:n.open+n.margin},{from:e.to,insert:n.margin+n.close}],range:o.d.range(e.anchor+t,e.head+t)}})));return null}},{key:"isSelectionCommented",value:function(e){var t,n=[],r=Object(a.a)(e.selection.ranges);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=this.isRangeCommented(e,i);if(null===o)return null;n.push(o)}}catch(s){r.e(s)}finally{r.f()}return n}},{key:"isRangeCommented",value:function(e,t){var n,r,i=e.sliceDoc(t.from-lt,t.from),o=e.sliceDoc(t.to,t.to+lt),a=/\s*$/.exec(i)[0].length,s=/^\s*/.exec(o)[0].length,l=i.length-a;if(i.slice(l-this.open.length,l)==this.open&&o.slice(s,s+this.close.length)==this.close)return{open:{pos:t.from-a,margin:a&&1},close:{pos:t.to+s,margin:s&&1}};t.to-t.from<=2*lt?n=r=e.sliceDoc(t.from,t.to):(n=e.sliceDoc(t.from,t.from+lt),r=e.sliceDoc(t.to-lt,t.to));var c=/^\s*/.exec(n)[0].length,u=/\s*$/.exec(r)[0].length,f=r.length-u-this.close.length;return n.slice(c,c+this.open.length)==this.open&&r.slice(f,f+this.close.length)==this.close?{open:{pos:t.from+c+this.open.length,margin:/\s/.test(n.charAt(c+this.open.length))?1:0},close:{pos:t.to-u-this.close.length,margin:/\s/.test(r.charAt(f-1))?1:0}}:null}}]),e}(),lt=50,ct=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";Object(s.a)(this,e),this.lineCommentToken=t,this.margin=n}return Object(l.a)(e,[{key:"toggle",value:function(e,t){for(var n=[],i={},o=0;o1&&l.isLineSkipped[p.number])){var v=p.from+l.minCol,m=l.minCol+this.lineCommentToken.length,g=" "==p.slice(m,m+1)?1:0;c.push({from:v,to:v+this.lineCommentToken.length+g})}}}catch(j){h.e(j)}finally{h.f()}}return t.update({changes:c})}}else if(e!=Ze.OnlyUncomment){for(var b=[],y=0;yft?-1:i==r.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(he.d)(r.slice(0,n-r.from),0,e.state.tabSize);return{line:r.number,col:o,off:i}}function ht(e,t){var n=dt(e,t),r=e.state.selection;return{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.prevState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,a){var s=dt(e,t),l=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>ft||n.off>ft||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),l=Math.max(t.off,n.off),c=r;c<=i;c++){var u=e.doc.line(c);u.length<=l&&a.push(o.d.range(u.from+s,u.to+l))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=p.length>ft?p.slice(0,2*d):p.slice(),m=Object(he.e)(v,0,f,e.tabSize),g=Object(he.e)(v,0,d,e.tabSize);m.leftOver||a.push(o.d.range(p.from+m.offset,p.from+g.offset))}return a}(e.state,n,s);return l.length?a?o.d.create(l.concat(r.ranges)):o.d.create(l):r}}}var pt=n(16),vt="undefined"==typeof Symbol?"__goto-line":Symbol("goto-line");function mt(e){var t=document.createElement("form");t.innerHTML="\n");var n=t.querySelector("input");function r(){var t=parseInt(n.value,10);e.dispatch({reconfigure:Object(pt.a)({},vt,[gt]),selection:!isNaN(t)&&t>0&&t<=e.state.doc.lines?o.d.cursor(e.state.doc.line(t).from):void 0,scrollIntoView:!0}),e.focus()}return t.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({reconfigure:{append:[gt]}}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())})),t.addEventListener("submit",r),{dom:t,style:"gotoLine",pos:-10}}var gt=i.d.baseTheme({"$panel.gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),bt=[{key:"Alt-g",run:function(e){var t=Object(Se.a)(e,mt);return t||(e.dispatch({reconfigure:{append:[Object(Se.b)(),Se.c.of(mt),gt]}}),t=Object(Se.a)(e,mt)),t&&t.dom.querySelector("input").focus(),!0}}];var yt=i.b.line({attributes:{class:Object(i.n)("activeLine")}}),Ot=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],o=Object(a.a)(e.state.selection.ranges);try{for(o.s();!(t=o.n()).done;){var s=t.value;if(s.empty){var l=e.visualLineAt(s.head);l.from>n&&(r.push(yt.range(l.from)),n=l.from)}}}catch(c){o.e(c)}finally{o.f()}return i.b.set(r)}}]),e}(),{decorations:function(e){return e.decorations}}),wt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},kt=o.f.define({combine:function(e){return Object(o.m)(e,wt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});var xt=i.b.mark({class:Object(i.n)("selectionMatch")}),jt=i.b.mark({class:Object(i.n)("selectionMatch.main")}),St=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(kt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,l=r.primary,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return i.b.none;if(c=n.charCategorizer(l.head),!(s=function(e,t,n){for(var r=e.lineAt(t),i=t-r.from,a=t-r.from;i>0;){var s=r.findClusterBreak(i,!1);if(n(r.slice(s,i))!=o.c.Word)break;i=s}for(;a200)return i.b.none;if(!(s=n.sliceDoc(l.from,l.to).trim()))return i.b.none}var f,d=[],h=Object(a.a)(e.visibleRanges);try{for(h.s();!(f=h.n()).done;)for(var p=f.value,v=new Ce(n.doc,s,p.from,p.to);!v.next().done;){var m=v.value,g=m.from,b=m.to;if((!c||(0==g||c(n.sliceDoc(g-1,g))!=o.c.Word)&&(b==n.doc.length||c(n.sliceDoc(b,b+1))!=o.c.Word))&&(c&&g<=l.from&&b>=l.to?d.push(jt.range(g,b)):(g>=l.to||b<=l.from)&&d.push(xt.range(g,b)),d.length>t.maxMatches))return i.b.none}}catch(y){h.e(y)}finally{h.f()}return i.b.set(d)}}]),e}(),{decorations:function(e){return e.decorations}}),Et=i.d.baseTheme({"$$light $activeLine":{backgroundColor:"#eff5ff"},"$$dark $activeLine":{backgroundColor:"#223039"},$selectionMatch:{backgroundColor:"#99ff7780"},"$searchMatch $selectionMatch":{backgroundColor:"transparent"}}),Ct=n(98),Pt=n(99),Mt=[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V.of(e),U]}(),Object(i.i)(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e)]}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},le),e),n=new ce(t,!0),r=new ce(t,!1);return[_({style:"foldGutter",lineMarker:function(e,t){return ee(e.state,t.from,t.to)?r:te(e.state,t.from,t.to)?n:null},initialSpacer:function(){return new ce(t,!1)},domEventHandlers:{click:function(e,t){var n=ee(e.state,t.from,t.to);if(n)return e.dispatch({effects:K.of(n)}),!0;var r=te(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:G.of(r)}),!0)}}}),ae()]}(),Object(i.h)(),o.e.allowMultipleSelections.of(!0),Object(i.j)(),Ct.a,Object(de.a)(),i.d.inputHandler.of(be),Object(tt.a)(),function(e){var t=e||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?ht(e,n):null}))}(),[Et,Ot],function(e){var t=[Et,St];return e&&t.push(kt.of(e)),t}(),Object(i.k)([].concat(Object(r.a)(ye),Object(r.a)(fe.a),Object(r.a)(Ue),Object(r.a)(M),Object(r.a)(re),Object(r.a)(nt),Object(r.a)(bt),Object(r.a)(tt.b),Object(r.a)(Pt.a)))]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(89);function a(){return i.a.useContext(o.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n
{%s ts.endpoint %}
{% if ts.up %}UP{% else %}DOWN{% endif %} + + {% space %} {%= formatLabel(ts.labels) %} + {%f.3 ts.lastScrapeTime.Seconds() %}s ago {%f.3 ts.scrapeDuration.Seconds() %}s
`) //line lib/promscrape/targets_response.qtpl:75 - for _, ts := range js.targetsStatus { + for j, ts := range js.targetsStatus { //line lib/promscrape/targets_response.qtpl:76 if onlyUnhealthy && ts.up { //line lib/promscrape/targets_response.qtpl:76 @@ -285,117 +285,155 @@ func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatus //line lib/promscrape/targets_response.qtpl:79 } //line lib/promscrape/targets_response.qtpl:79 - qw422016.N().S(``) -//line lib/promscrape/targets_response.qtpl:88 +//line lib/promscrape/targets_response.qtpl:93 } -//line lib/promscrape/targets_response.qtpl:88 +//line lib/promscrape/targets_response.qtpl:93 qw422016.N().S(`
EndpointStateLabelsLast ScrapeScrape DurationSamples ScrapedError
`) + qw422016.N().S(``) +//line lib/promscrape/targets_response.qtpl:81 + qw422016.N().S(` `) +//line lib/promscrape/targets_response.qtpl:82 streamformatLabel(qw422016, ts.labels) -//line lib/promscrape/targets_response.qtpl:81 - qw422016.N().S(``) +//line lib/promscrape/targets_response.qtpl:82 + qw422016.N().S(``) +//line lib/promscrape/targets_response.qtpl:88 qw422016.N().FPrec(ts.lastScrapeTime.Seconds(), 3) -//line lib/promscrape/targets_response.qtpl:83 +//line lib/promscrape/targets_response.qtpl:88 qw422016.N().S(`s ago`) -//line lib/promscrape/targets_response.qtpl:84 +//line lib/promscrape/targets_response.qtpl:89 qw422016.N().FPrec(ts.scrapeDuration.Seconds(), 3) -//line lib/promscrape/targets_response.qtpl:84 +//line lib/promscrape/targets_response.qtpl:89 qw422016.N().S(`s`) -//line lib/promscrape/targets_response.qtpl:85 +//line lib/promscrape/targets_response.qtpl:90 qw422016.N().D(ts.samplesScraped) -//line lib/promscrape/targets_response.qtpl:85 +//line lib/promscrape/targets_response.qtpl:90 qw422016.N().S(``) -//line lib/promscrape/targets_response.qtpl:86 +//line lib/promscrape/targets_response.qtpl:91 qw422016.E().S(ts.errMsg) -//line lib/promscrape/targets_response.qtpl:86 +//line lib/promscrape/targets_response.qtpl:91 qw422016.N().S(`
`) -//line lib/promscrape/targets_response.qtpl:92 +//line lib/promscrape/targets_response.qtpl:97 } -//line lib/promscrape/targets_response.qtpl:94 +//line lib/promscrape/targets_response.qtpl:99 for _, jobName := range emptyJobs { -//line lib/promscrape/targets_response.qtpl:94 +//line lib/promscrape/targets_response.qtpl:99 qw422016.N().S(`

`) -//line lib/promscrape/targets_response.qtpl:97 +//line lib/promscrape/targets_response.qtpl:102 qw422016.E().S(jobName) -//line lib/promscrape/targets_response.qtpl:97 +//line lib/promscrape/targets_response.qtpl:102 qw422016.N().S(`(0/0 up)

EndpointStateLabelsLast ScrapeScrape DurationSamples ScrapedError
`) -//line lib/promscrape/targets_response.qtpl:113 - } -//line lib/promscrape/targets_response.qtpl:113 - qw422016.N().S(``) -//line lib/promscrape/targets_response.qtpl:116 -} - -//line lib/promscrape/targets_response.qtpl:116 -func WriteTargetsResponseHTML(qq422016 qtio422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) { -//line lib/promscrape/targets_response.qtpl:116 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targets_response.qtpl:116 - StreamTargetsResponseHTML(qw422016, jts, emptyJobs, redirectPath, onlyUnhealthy) -//line lib/promscrape/targets_response.qtpl:116 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targets_response.qtpl:116 -} - -//line lib/promscrape/targets_response.qtpl:116 -func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) string { -//line lib/promscrape/targets_response.qtpl:116 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targets_response.qtpl:116 - WriteTargetsResponseHTML(qb422016, jts, emptyJobs, redirectPath, onlyUnhealthy) -//line lib/promscrape/targets_response.qtpl:116 - qs422016 := string(qb422016.B) -//line lib/promscrape/targets_response.qtpl:116 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targets_response.qtpl:116 - return qs422016 -//line lib/promscrape/targets_response.qtpl:116 -} - //line lib/promscrape/targets_response.qtpl:118 -func streamformatLabel(qw422016 *qt422016.Writer, labels []prompbmarshal.Label) { -//line lib/promscrape/targets_response.qtpl:119 - for _, label := range labels { -//line lib/promscrape/targets_response.qtpl:120 - qw422016.E().S(label.Name) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.N().S(`=`) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.E().Q(label.Value) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.N().S(` `) -//line lib/promscrape/targets_response.qtpl:121 } -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:118 + qw422016.N().S(``) +//line lib/promscrape/targets_response.qtpl:121 } -//line lib/promscrape/targets_response.qtpl:122 -func writeformatLabel(qq422016 qtio422016.Writer, labels []prompbmarshal.Label) { -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 +func WriteTargetsResponseHTML(qq422016 qtio422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) { +//line lib/promscrape/targets_response.qtpl:121 qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targets_response.qtpl:122 - streamformatLabel(qw422016, labels) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 + StreamTargetsResponseHTML(qw422016, jts, emptyJobs, redirectPath, onlyUnhealthy) +//line lib/promscrape/targets_response.qtpl:121 qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 } -//line lib/promscrape/targets_response.qtpl:122 -func formatLabel(labels []prompbmarshal.Label) string { -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 +func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) string { +//line lib/promscrape/targets_response.qtpl:121 qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targets_response.qtpl:122 - writeformatLabel(qb422016, labels) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 + WriteTargetsResponseHTML(qb422016, jts, emptyJobs, redirectPath, onlyUnhealthy) +//line lib/promscrape/targets_response.qtpl:121 qs422016 := string(qb422016.B) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 return qs422016 -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:121 +} + +//line lib/promscrape/targets_response.qtpl:123 +func streamformatLabel(qw422016 *qt422016.Writer, labels []prompbmarshal.Label) { +//line lib/promscrape/targets_response.qtpl:123 + qw422016.N().S(`{`) +//line lib/promscrape/targets_response.qtpl:125 + for i, label := range labels { +//line lib/promscrape/targets_response.qtpl:126 + qw422016.E().S(label.Name) +//line lib/promscrape/targets_response.qtpl:126 + qw422016.N().S(`=`) +//line lib/promscrape/targets_response.qtpl:126 + qw422016.E().Q(label.Value) +//line lib/promscrape/targets_response.qtpl:127 + if i+1 < len(labels) { +//line lib/promscrape/targets_response.qtpl:127 + qw422016.N().S(`,`) +//line lib/promscrape/targets_response.qtpl:127 + qw422016.N().S(` `) +//line lib/promscrape/targets_response.qtpl:127 + } +//line lib/promscrape/targets_response.qtpl:128 + } +//line lib/promscrape/targets_response.qtpl:128 + qw422016.N().S(`}`) +//line lib/promscrape/targets_response.qtpl:130 +} + +//line lib/promscrape/targets_response.qtpl:130 +func writeformatLabel(qq422016 qtio422016.Writer, labels []prompbmarshal.Label) { +//line lib/promscrape/targets_response.qtpl:130 + qw422016 := qt422016.AcquireWriter(qq422016) +//line lib/promscrape/targets_response.qtpl:130 + streamformatLabel(qw422016, labels) +//line lib/promscrape/targets_response.qtpl:130 + qt422016.ReleaseWriter(qw422016) +//line lib/promscrape/targets_response.qtpl:130 +} + +//line lib/promscrape/targets_response.qtpl:130 +func formatLabel(labels []prompbmarshal.Label) string { +//line lib/promscrape/targets_response.qtpl:130 + qb422016 := qt422016.AcquireByteBuffer() +//line lib/promscrape/targets_response.qtpl:130 + writeformatLabel(qb422016, labels) +//line lib/promscrape/targets_response.qtpl:130 + qs422016 := string(qb422016.B) +//line lib/promscrape/targets_response.qtpl:130 + qt422016.ReleaseByteBuffer(qb422016) +//line lib/promscrape/targets_response.qtpl:130 + return qs422016 +//line lib/promscrape/targets_response.qtpl:130 } diff --git a/lib/promscrape/targetstatus.go b/lib/promscrape/targetstatus.go index 2bb4c5e33..511e44736 100644 --- a/lib/promscrape/targetstatus.go +++ b/lib/promscrape/targetstatus.go @@ -295,7 +295,7 @@ func (tsm *targetStatusMap) getTargetsStatusByJob() ([]jobTargetsStatuses, []str byJob := make(map[string][]targetStatus) tsm.mu.Lock() for _, st := range tsm.m { - job := st.sw.Job() + job := st.sw.jobNameOriginal byJob[job] = append(byJob[job], *st) } jobNames := append([]string{}, tsm.jobNames...) diff --git a/lib/protoparser/graphite/parser.go b/lib/protoparser/graphite/parser.go index 5c1643777..c8d08c1cf 100644 --- a/lib/protoparser/graphite/parser.go +++ b/lib/protoparser/graphite/parser.go @@ -9,6 +9,10 @@ import ( "github.com/valyala/fastjson/fastfloat" ) +// graphite text line protocol may use white space or tab as separator +// See https://github.com/grobian/carbon-c-relay/commit/f3ffe6cc2b52b07d14acbda649ad3fd6babdd528 +const graphiteSeparators = " \t" + // Rows contains parsed graphite rows. type Rows struct { Rows []Row @@ -84,9 +88,9 @@ func (r *Row) UnmarshalMetricAndTags(s string, tagsPool []Tag) ([]Tag, error) { func (r *Row) unmarshal(s string, tagsPool []Tag) ([]Tag, error) { r.reset() - n := strings.IndexByte(s, ' ') + n := strings.IndexAny(s, graphiteSeparators) if n < 0 { - return tagsPool, fmt.Errorf("cannot find whitespace between metric and value in %q", s) + return tagsPool, fmt.Errorf("cannot find separator between metric and value in %q", s) } metricAndTags := s[:n] tail := s[n+1:] @@ -96,7 +100,7 @@ func (r *Row) unmarshal(s string, tagsPool []Tag) ([]Tag, error) { return tagsPool, err } - n = strings.IndexByte(tail, ' ') + n = strings.IndexAny(tail, graphiteSeparators) if n < 0 { // There is no timestamp. Use default timestamp instead. v, err := fastfloat.Parse(tail) diff --git a/lib/protoparser/graphite/parser_test.go b/lib/protoparser/graphite/parser_test.go index 85e2cb76e..da986ec2e 100644 --- a/lib/protoparser/graphite/parser_test.go +++ b/lib/protoparser/graphite/parser_test.go @@ -1,10 +1,11 @@ package graphite import ( - "github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime" "reflect" "strings" "testing" + + "github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime" ) func TestUnmarshalMetricAndTagsFailure(t *testing.T) { @@ -258,6 +259,35 @@ func TestRowsUnmarshalSuccess(t *testing.T) { }, }, }) + + // With tab as separator + // See https://github.com/grobian/carbon-c-relay/commit/f3ffe6cc2b52b07d14acbda649ad3fd6babdd528 + f("foo.baz\t125.456\t1789\n", &Rows{ + Rows: []Row{{ + Metric: "foo.baz", + Value: 125.456, + Timestamp: 1789, + }}, + }) + // With tab as separator and tags + f("foo;baz=bar;bb=;y=x;=z\t1\t2", &Rows{ + Rows: []Row{{ + Metric: "foo", + Tags: []Tag{ + { + Key: "baz", + Value: "bar", + }, + { + Key: "y", + Value: "x", + }, + }, + Value: 1, + Timestamp: 2, + }}, + }) + } func Test_streamContext_Read(t *testing.T) { diff --git a/lib/storage/storage.go b/lib/storage/storage.go index 6b9f6d4d2..0f92eefe2 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -57,8 +57,6 @@ type Storage struct { hourlySeriesLimitRowsDropped uint64 dailySeriesLimitRowsDropped uint64 - isReadOnly uint32 - path string cachePath string retentionMsecs int64 @@ -137,6 +135,8 @@ type Storage struct { // metricIDs, since it usually requires 1 bit per deleted metricID. deletedMetricIDs atomic.Value deletedMetricIDsUpdateLock sync.Mutex + + isReadOnly uint32 } // OpenStorage opens storage on the given path with the given retentionMsecs. @@ -581,10 +581,15 @@ func (s *Storage) startFreeDiskSpaceWatcher() { freeSpaceBytes := fs.MustGetFreeSpace(s.path) if freeSpaceBytes < freeDiskSpaceLimitBytes { // Switch the storage to readonly mode if there is no enough free space left at s.path + logger.Warnf("switching the storage at %s to read-only mode, since it has less than -storage.minFreeDiskSpaceBytes=%d of free space: %d bytes left", + s.path, freeDiskSpaceLimitBytes, freeSpaceBytes) atomic.StoreUint32(&s.isReadOnly, 1) return } - atomic.StoreUint32(&s.isReadOnly, 0) + if atomic.CompareAndSwapUint32(&s.isReadOnly, 1, 0) { + logger.Warnf("enabling writing to the storage at %s, since it has more than -storage.minFreeDiskSpaceBytes=%d of free space: %d bytes left", + s.path, freeDiskSpaceLimitBytes, freeSpaceBytes) + } } f() s.freeDiskSpaceWatcherWG.Add(1) diff --git a/vendor/cloud.google.com/go/storage/CHANGES.md b/vendor/cloud.google.com/go/storage/CHANGES.md index 38ca4f8fa..6c0ef2099 100644 --- a/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,5 +1,32 @@ # Changes +### [1.18.2](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.18.1...storage/v1.18.2) (2021-10-18) + + +### Bug Fixes + +* **storage:** upgrade genproto ([#4993](https://www.github.com/googleapis/google-cloud-go/issues/4993)) ([5ca462d](https://www.github.com/googleapis/google-cloud-go/commit/5ca462d99fe851b7cddfd70108798e2fa959bdfd)), refs [#4991](https://www.github.com/googleapis/google-cloud-go/issues/4991) + +### [1.18.1](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.18.0...storage/v1.18.1) (2021-10-14) + + +### Bug Fixes + +* **storage:** don't assume auth from a client option ([#4982](https://www.github.com/googleapis/google-cloud-go/issues/4982)) ([e17334d](https://www.github.com/googleapis/google-cloud-go/commit/e17334d1fe7645d89d14ae7148313498b984dfbb)) + +## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.17.0...storage/v1.18.0) (2021-10-11) + + +### Features + +* **storage:** returned wrapped error for timeouts ([#4802](https://www.github.com/googleapis/google-cloud-go/issues/4802)) ([0e102a3](https://www.github.com/googleapis/google-cloud-go/commit/0e102a385dc67a06f6b444b3a93e6998428529be)), refs [#4197](https://www.github.com/googleapis/google-cloud-go/issues/4197) +* **storage:** SignedUrl can use existing creds to authenticate ([#4604](https://www.github.com/googleapis/google-cloud-go/issues/4604)) ([b824c89](https://www.github.com/googleapis/google-cloud-go/commit/b824c897e6941270747b612f6d36a8d6ae081315)) + + +### Bug Fixes + +* **storage:** update PAP to use inherited instead of unspecified ([#4909](https://www.github.com/googleapis/google-cloud-go/issues/4909)) ([dac26b1](https://www.github.com/googleapis/google-cloud-go/commit/dac26b1af2f2972f12775341173bcc5f982438b8)) + ## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.1...storage/v1.17.0) (2021-09-28) diff --git a/vendor/cloud.google.com/go/storage/bucket.go b/vendor/cloud.google.com/go/storage/bucket.go index f2a59f3b3..ec7dcb5c3 100644 --- a/vendor/cloud.google.com/go/storage/bucket.go +++ b/vendor/cloud.google.com/go/storage/bucket.go @@ -16,15 +16,22 @@ package storage import ( "context" + "encoding/base64" + "encoding/json" + "errors" "fmt" "net/http" "reflect" "time" + "cloud.google.com/go/compute/metadata" "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" + "golang.org/x/xerrors" "google.golang.org/api/googleapi" + "google.golang.org/api/iamcredentials/v1" "google.golang.org/api/iterator" + "google.golang.org/api/option" raw "google.golang.org/api/storage/v1" ) @@ -166,7 +173,8 @@ func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error resp, err = req.Context(ctx).Do() return err }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { + var e *googleapi.Error + if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound { return nil, ErrBucketNotExist } if err != nil { @@ -223,6 +231,118 @@ func (b *BucketHandle) newPatchCall(uattrs *BucketAttrsToUpdate) (*raw.BucketsPa return req, nil } +// SignedURL returns a URL for the specified object. Signed URLs allow anyone +// access to a restricted resource for a limited time without needing a +// Google account or signing in. For more information about signed URLs, see +// https://cloud.google.com/storage/docs/accesscontrol#signed_urls_query_string_authentication +// +// This method only requires the Method and Expires fields in the specified +// SignedURLOptions opts to be non-nil. If not provided, it attempts to fill the +// GoogleAccessID and PrivateKey from the GOOGLE_APPLICATION_CREDENTIALS environment variable. +// If you are authenticating with a custom HTTP client, Service Account based +// auto-detection will be hindered. +// +// If no private key is found, it attempts to use the GoogleAccessID to sign the URL. +// This requires the IAM Service Account Credentials API to be enabled +// (https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview) +// and iam.serviceAccounts.signBlob permissions on the GoogleAccessID service account. +// If you do not want these fields set for you, you may pass them in through opts or use +// SignedURL(bucket, name string, opts *SignedURLOptions) instead. +func (b *BucketHandle) SignedURL(object string, opts *SignedURLOptions) (string, error) { + if opts.GoogleAccessID != "" && (opts.SignBytes != nil || len(opts.PrivateKey) > 0) { + return SignedURL(b.name, object, opts) + } + // Make a copy of opts so we don't modify the pointer parameter. + newopts := opts.clone() + + if newopts.GoogleAccessID == "" { + id, err := b.detectDefaultGoogleAccessID() + if err != nil { + return "", err + } + newopts.GoogleAccessID = id + } + if newopts.SignBytes == nil && len(newopts.PrivateKey) == 0 { + if b.c.creds != nil && len(b.c.creds.JSON) > 0 { + var sa struct { + PrivateKey string `json:"private_key"` + } + err := json.Unmarshal(b.c.creds.JSON, &sa) + if err == nil && sa.PrivateKey != "" { + newopts.PrivateKey = []byte(sa.PrivateKey) + } + } + + // Don't error out if we can't unmarshal the private key from the client, + // fallback to the default sign function for the service account. + if len(newopts.PrivateKey) == 0 { + newopts.SignBytes = b.defaultSignBytesFunc(newopts.GoogleAccessID) + } + } + return SignedURL(b.name, object, newopts) +} + +// TODO: Add a similar wrapper for GenerateSignedPostPolicyV4 allowing users to +// omit PrivateKey/SignBytes + +func (b *BucketHandle) detectDefaultGoogleAccessID() (string, error) { + returnErr := errors.New("no credentials found on client and not on GCE (Google Compute Engine)") + + if b.c.creds != nil && len(b.c.creds.JSON) > 0 { + var sa struct { + ClientEmail string `json:"client_email"` + } + err := json.Unmarshal(b.c.creds.JSON, &sa) + if err == nil && sa.ClientEmail != "" { + return sa.ClientEmail, nil + } else if err != nil { + returnErr = err + } else { + returnErr = errors.New("storage: empty client email in credentials") + } + + } + + // Don't error out if we can't unmarshal, fallback to GCE check. + if metadata.OnGCE() { + email, err := metadata.Email("default") + if err == nil && email != "" { + return email, nil + } else if err != nil { + returnErr = err + } else { + returnErr = errors.New("got empty email from GCE metadata service") + } + + } + return "", fmt.Errorf("storage: unable to detect default GoogleAccessID: %v", returnErr) +} + +func (b *BucketHandle) defaultSignBytesFunc(email string) func([]byte) ([]byte, error) { + return func(in []byte) ([]byte, error) { + ctx := context.Background() + + // It's ok to recreate this service per call since we pass in the http client, + // circumventing the cost of recreating the auth/transport layer + svc, err := iamcredentials.NewService(ctx, option.WithHTTPClient(b.c.hc)) + if err != nil { + return nil, fmt.Errorf("unable to create iamcredentials client: %v", err) + } + + resp, err := svc.Projects.ServiceAccounts.SignBlob(fmt.Sprintf("projects/-/serviceAccounts/%s", email), &iamcredentials.SignBlobRequest{ + Payload: base64.StdEncoding.EncodeToString(in), + }).Do() + if err != nil { + return nil, fmt.Errorf("unable to sign bytes: %v", err) + } + out, err := base64.StdEncoding.DecodeString(resp.SignedBlob) + if err != nil { + return nil, fmt.Errorf("unable to base64 decode response: %v", err) + } + return out, nil + } +} + // BucketAttrs represents the metadata for a Google Cloud Storage bucket. // Read-only fields are ignored by BucketHandle.Create. type BucketAttrs struct { @@ -376,23 +496,29 @@ const ( // not set in a call to GCS. PublicAccessPreventionUnknown PublicAccessPrevention = iota - // PublicAccessPreventionUnspecified corresponds to a value of "unspecified" - // and is the default for buckets. + // PublicAccessPreventionUnspecified corresponds to a value of "unspecified". + // Deprecated: use PublicAccessPreventionInherited PublicAccessPreventionUnspecified // PublicAccessPreventionEnforced corresponds to a value of "enforced". This // enforces Public Access Prevention on the bucket. PublicAccessPreventionEnforced - publicAccessPreventionUnknown string = "" - publicAccessPreventionUnspecified = "unspecified" - publicAccessPreventionEnforced = "enforced" + // PublicAccessPreventionInherited corresponds to a value of "inherited" + // and is the default for buckets. + PublicAccessPreventionInherited + + publicAccessPreventionUnknown string = "" + // TODO: remove unspecified when change is fully completed + publicAccessPreventionUnspecified = "unspecified" + publicAccessPreventionEnforced = "enforced" + publicAccessPreventionInherited = "inherited" ) func (p PublicAccessPrevention) String() string { switch p { - case PublicAccessPreventionUnspecified: - return publicAccessPreventionUnspecified + case PublicAccessPreventionInherited, PublicAccessPreventionUnspecified: + return publicAccessPreventionInherited case PublicAccessPreventionEnforced: return publicAccessPreventionEnforced default: @@ -1212,8 +1338,8 @@ func toPublicAccessPrevention(b *raw.BucketIamConfiguration) PublicAccessPrevent return PublicAccessPreventionUnknown } switch b.PublicAccessPrevention { - case publicAccessPreventionUnspecified: - return PublicAccessPreventionUnspecified + case publicAccessPreventionInherited, publicAccessPreventionUnspecified: + return PublicAccessPreventionInherited case publicAccessPreventionEnforced: return PublicAccessPreventionEnforced default: @@ -1313,7 +1439,8 @@ func (it *ObjectIterator) fetch(pageSize int, pageToken string) (string, error) return err }) if err != nil { - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { + var e *googleapi.Error + if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound { err = ErrBucketNotExist } return "", err diff --git a/vendor/cloud.google.com/go/storage/doc.go b/vendor/cloud.google.com/go/storage/doc.go index 418e16068..53259936d 100644 --- a/vendor/cloud.google.com/go/storage/doc.go +++ b/vendor/cloud.google.com/go/storage/doc.go @@ -247,9 +247,10 @@ as the documentation of GenerateSignedPostPolicyV4. Errors Errors returned by this client are often of the type [`googleapi.Error`](https://godoc.org/google.golang.org/api/googleapi#Error). -These errors can be introspected for more information by type asserting to the richer `googleapi.Error` type. For example: +These errors can be introspected for more information by using `errors.As` with the richer `googleapi.Error` type. For example: - if e, ok := err.(*googleapi.Error); ok { + var e *googleapi.Error + if ok := errors.As(err, &e); ok { if e.Code == 409 { ... } } */ diff --git a/vendor/cloud.google.com/go/storage/go.mod b/vendor/cloud.google.com/go/storage/go.mod index b7d5b3c1c..398017931 100644 --- a/vendor/cloud.google.com/go/storage/go.mod +++ b/vendor/cloud.google.com/go/storage/go.mod @@ -3,14 +3,14 @@ module cloud.google.com/go/storage go 1.11 require ( - cloud.google.com/go v0.94.1 + cloud.google.com/go v0.97.0 github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 - github.com/googleapis/gax-go/v2 v2.1.0 - golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f + github.com/googleapis/gax-go/v2 v2.1.1 + golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 - google.golang.org/api v0.57.0 - google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 + google.golang.org/api v0.58.0 + google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/vendor/cloud.google.com/go/storage/go.sum b/vendor/cloud.google.com/go/storage/go.sum index 82b169952..d1ff437c0 100644 --- a/vendor/cloud.google.com/go/storage/go.sum +++ b/vendor/cloud.google.com/go/storage/go.sum @@ -23,8 +23,9 @@ cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSU cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1 h1:DwuSvDZ1pTYGbXo8yOJevCTr3BoBlE+OVkHAKiYQUXc= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -143,8 +144,9 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -269,8 +271,9 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -326,8 +329,9 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 h1:6wSTsvPddg9gc/mVEEyk9oOAoxn+bT4Z9q1zx+4RwA4= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -424,8 +428,10 @@ google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNe google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0 h1:4t9zuDlHLcIx0ZEhmXEeFVCRsiOgpgn2QOH9N0MNjPI= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.58.0 h1:MDkAbYIB1JpSgCTOCYYoIec/coMlKK4oVbpnBLLcyT0= +google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -488,8 +494,13 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 h1:2ncG/LajxmrclaZH+ppVi02rQxz4eXYJzGHdFN4Y9UA= -google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211015135405-485ec31e706e h1:8QimPqBPS4AUoLliaTHdC00MiGVe4csovJUlesHP9Mw= +google.golang.org/genproto v0.0.0-20211015135405-485ec31e706e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 h1:Rp1vYDPD4TdkMH5S/bZbopsGCsWhPcrLBUwOVhAQCxM= +google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go b/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go index 56dce7e9c..5bbc94e5e 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go @@ -68,7 +68,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210921" +const versionClient = "20211015" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go index 20c2121d8..261ae13d0 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go @@ -172,7 +172,7 @@ func (c *Client) ReadObject(ctx context.Context, req *storagepb.ReadObjectReques // each following call to Create. If there is an error or the connection is // broken during the resumable Create(), the client should check the status // of the Create() by calling QueryWriteStatus() and continue writing from -// the returned committed_size. This may be less than the amount of data the +// the returned persisted_size. This may be less than the amount of data the // client previously sent. // // The service will not view the object as complete until the client has @@ -192,7 +192,7 @@ func (c *Client) StartResumableWrite(ctx context.Context, req *storagepb.StartRe return c.internalClient.StartResumableWrite(ctx, req, opts...) } -// QueryWriteStatus determines the committed_size for an object that is being written, which +// QueryWriteStatus determines the persisted_size for an object that is being written, which // can then be used as the write_offset for the next Write() call. // // If the object does not exist (i.e., the object has been deleted, or the @@ -203,7 +203,7 @@ func (c *Client) StartResumableWrite(ctx context.Context, req *storagepb.StartRe // much data has been processed for this object. This is useful if the // client is buffering data and needs to know which data can be safely // evicted. For any sequence of QueryWriteStatus() calls for a given -// object name, the sequence of returned committed_size values will be +// object name, the sequence of returned persisted_size values will be // non-decreasing. func (c *Client) QueryWriteStatus(ctx context.Context, req *storagepb.QueryWriteStatusRequest, opts ...gax.CallOption) (*storagepb.QueryWriteStatusResponse, error) { return c.internalClient.QueryWriteStatus(ctx, req, opts...) diff --git a/vendor/cloud.google.com/go/storage/invoke.go b/vendor/cloud.google.com/go/storage/invoke.go index 2ecf48fff..0c44c2db1 100644 --- a/vendor/cloud.google.com/go/storage/invoke.go +++ b/vendor/cloud.google.com/go/storage/invoke.go @@ -36,7 +36,7 @@ func runWithRetry(ctx context.Context, call func() error) error { return true, nil } if shouldRetry(err) { - return false, nil + return false, err } return true, err }) diff --git a/vendor/cloud.google.com/go/storage/reader.go b/vendor/cloud.google.com/go/storage/reader.go index ba51c5f51..4192c02ba 100644 --- a/vendor/cloud.google.com/go/storage/reader.go +++ b/vendor/cloud.google.com/go/storage/reader.go @@ -30,7 +30,6 @@ import ( "cloud.google.com/go/internal/trace" "google.golang.org/api/googleapi" storagepb "google.golang.org/genproto/googleapis/storage/v2" - "google.golang.org/protobuf/proto" ) var crc32cTable = crc32.MakeTable(crc32.Castagnoli) @@ -475,8 +474,10 @@ func (o *ObjectHandle) newRangeReaderWithGRPC(ctx context.Context, offset, lengt } req.ReadOffset = start - // TODO: refactor this to use applyCondsProto. - setRequestConditions(req, o.conds) + if err := applyCondsProto("reopenWithGRPC", o.gen, o.conds, req); err != nil { + cancel() + return nil, nil, err + } var stream storagepb.Storage_ReadObjectClient var msg *storagepb.ReadObjectResponse @@ -632,10 +633,7 @@ func (r *Reader) readWithGRPC(p []byte) (int, error) { if leftover > 0 { // Wasn't able to copy all of the data in the message, store for // future Read calls. - // TODO: Instead of acquiring a new block of memory, should we reuse - // the existing leftovers slice, expanding it if necessary? - r.leftovers = make([]byte, leftover) - copy(r.leftovers, content[n:]) + r.leftovers = content[n:] } r.seen += int64(n) @@ -684,29 +682,6 @@ func (r *Reader) reopenStream(seen int64) (*storagepb.ReadObjectResponse, error) return res.response, nil } -// setRequestConditions is used to apply the given Conditions to a gRPC request -// message. -// -// This is an experimental API and not intended for public use. -func setRequestConditions(req *storagepb.ReadObjectRequest, conds *Conditions) { - if conds == nil { - return - } - if conds.MetagenerationMatch != 0 { - req.IfMetagenerationMatch = proto.Int64(conds.MetagenerationMatch) - } else if conds.MetagenerationNotMatch != 0 { - req.IfMetagenerationNotMatch = proto.Int64(conds.MetagenerationNotMatch) - } - switch { - case conds.GenerationNotMatch != 0: - req.IfGenerationNotMatch = proto.Int64(conds.GenerationNotMatch) - case conds.GenerationMatch != 0: - req.IfGenerationMatch = proto.Int64(conds.GenerationMatch) - case conds.DoesNotExist: - req.IfGenerationMatch = proto.Int64(0) - } -} - // Size returns the size of the object in bytes. // The returned value is always the same and is not affected by // calls to Read or Close. diff --git a/vendor/cloud.google.com/go/storage/storage.go b/vendor/cloud.google.com/go/storage/storage.go index a5627be34..36969c1eb 100644 --- a/vendor/cloud.google.com/go/storage/storage.go +++ b/vendor/cloud.google.com/go/storage/storage.go @@ -41,10 +41,13 @@ import ( "cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/version" gapic "cloud.google.com/go/storage/internal/apiv2" + "golang.org/x/oauth2/google" + "golang.org/x/xerrors" "google.golang.org/api/googleapi" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" raw "google.golang.org/api/storage/v1" + "google.golang.org/api/transport" htransport "google.golang.org/api/transport/http" storagepb "google.golang.org/genproto/googleapis/storage/v2" "google.golang.org/protobuf/proto" @@ -97,6 +100,8 @@ type Client struct { scheme string // ReadHost is the default host used on the reader. readHost string + // May be nil. + creds *google.Credentials // gc is an optional gRPC-based, GAPIC client. // @@ -111,6 +116,7 @@ type Client struct { // Clients should be reused instead of created as needed. The methods of Client // are safe for concurrent use by multiple goroutines. func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + var creds *google.Credentials // In general, it is recommended to use raw.NewService instead of htransport.NewClient // since raw.NewService configures the correct default endpoints when initializing the @@ -121,10 +127,18 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error // need to account for STORAGE_EMULATOR_HOST override when setting the default endpoints. if host := os.Getenv("STORAGE_EMULATOR_HOST"); host == "" { // Prepend default options to avoid overriding options passed by the user. - opts = append([]option.ClientOption{option.WithScopes(ScopeFullControl), option.WithUserAgent(userAgent)}, opts...) + opts = append([]option.ClientOption{option.WithScopes(ScopeFullControl, "https://www.googleapis.com/auth/cloud-platform"), option.WithUserAgent(userAgent)}, opts...) opts = append(opts, internaloption.WithDefaultEndpoint("https://storage.googleapis.com/storage/v1/")) opts = append(opts, internaloption.WithDefaultMTLSEndpoint("https://storage.mtls.googleapis.com/storage/v1/")) + + // Don't error out here. The user may have passed in their own HTTP + // client which does not auth with ADC or other common conventions. + c, err := transport.Creds(ctx, opts...) + if err == nil { + creds = c + opts = append(opts, internaloption.WithCredentials(creds)) + } } else { var hostURL *url.URL @@ -171,6 +185,7 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error raw: rawService, scheme: u.Scheme, readHost: u.Host, + creds: creds, }, nil } @@ -209,6 +224,7 @@ func (c *Client) Close() error { // Set fields to nil so that subsequent uses will panic. c.hc = nil c.raw = nil + c.creds = nil if c.gc != nil { return c.gc.Close() } @@ -395,6 +411,23 @@ type SignedURLOptions struct { Scheme SigningScheme } +func (opts *SignedURLOptions) clone() *SignedURLOptions { + return &SignedURLOptions{ + GoogleAccessID: opts.GoogleAccessID, + SignBytes: opts.SignBytes, + PrivateKey: opts.PrivateKey, + Method: opts.Method, + Expires: opts.Expires, + ContentType: opts.ContentType, + Headers: opts.Headers, + QueryParameters: opts.QueryParameters, + MD5: opts.MD5, + Style: opts.Style, + Insecure: opts.Insecure, + Scheme: opts.Scheme, + } +} + var ( tabRegex = regexp.MustCompile(`[\t]+`) // I was tempted to call this spacex. :) @@ -508,11 +541,11 @@ func v4SanitizeHeaders(hdrs []string) []string { return sanitizedHeaders } -// SignedURL returns a URL for the specified object. Signed URLs allow -// the users access to a restricted resource for a limited time without having a -// Google account or signing in. For more information about the signed -// URLs, see https://cloud.google.com/storage/docs/accesscontrol#Signed-URLs. -func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) { +// SignedURL returns a URL for the specified object. Signed URLs allow anyone +// access to a restricted resource for a limited time without needing a +// Google account or signing in. For more information about signed URLs, see +// https://cloud.google.com/storage/docs/accesscontrol#signed_urls_query_string_authentication +func SignedURL(bucket, object string, opts *SignedURLOptions) (string, error) { now := utcNow() if err := validateOptions(opts, now); err != nil { return "", err @@ -521,13 +554,13 @@ func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) { switch opts.Scheme { case SigningSchemeV2: opts.Headers = v2SanitizeHeaders(opts.Headers) - return signedURLV2(bucket, name, opts) + return signedURLV2(bucket, object, opts) case SigningSchemeV4: opts.Headers = v4SanitizeHeaders(opts.Headers) - return signedURLV4(bucket, name, opts, now) + return signedURLV4(bucket, object, opts, now) default: // SigningSchemeDefault opts.Headers = v2SanitizeHeaders(opts.Headers) - return signedURLV2(bucket, name, opts) + return signedURLV2(bucket, object, opts) } } @@ -867,7 +900,8 @@ func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error var obj *raw.Object setClientHeader(call.Header()) err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { + var e *googleapi.Error + if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound { return nil, ErrObjectNotExist } if err != nil { @@ -967,7 +1001,8 @@ func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) ( var obj *raw.Object setClientHeader(call.Header()) err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) - if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { + var e *googleapi.Error + if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound { return nil, ErrObjectNotExist } if err != nil { @@ -1030,13 +1065,9 @@ func (o *ObjectHandle) Delete(ctx context.Context) error { // Encryption doesn't apply to Delete. setClientHeader(call.Header()) err := runWithRetry(ctx, func() error { return call.Do() }) - switch e := err.(type) { - case nil: - return nil - case *googleapi.Error: - if e.Code == http.StatusNotFound { - return ErrObjectNotExist - } + var e *googleapi.Error + if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound { + return ErrObjectNotExist } return err } @@ -1413,7 +1444,7 @@ func newObjectFromProto(o *storagepb.Object) *ObjectAttrs { Generation: o.Generation, Metageneration: o.Metageneration, StorageClass: o.StorageClass, - CustomerKeySHA256: o.GetCustomerEncryption().GetKeySha256(), + CustomerKeySHA256: string(o.GetCustomerEncryption().GetKeySha256Bytes()), KMSKeyName: o.GetKmsKey(), Created: convertProtoTime(o.GetCreateTime()), Deleted: convertProtoTime(o.GetDeleteTime()), diff --git a/vendor/cloud.google.com/go/storage/writer.go b/vendor/cloud.google.com/go/storage/writer.go index ff30ff78b..ec55e4a3b 100644 --- a/vendor/cloud.google.com/go/storage/writer.go +++ b/vendor/cloud.google.com/go/storage/writer.go @@ -24,9 +24,12 @@ import ( "unicode/utf8" "github.com/golang/protobuf/proto" + "golang.org/x/xerrors" "google.golang.org/api/googleapi" raw "google.golang.org/api/storage/v1" storagepb "google.golang.org/genproto/googleapis/storage/v2" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) const ( @@ -217,7 +220,7 @@ func (w *Writer) Write(p []byte) (n int, err error) { // Preserve existing functionality that when context is canceled, Write will return // context.Canceled instead of "io: read/write on closed pipe". This hides the // pipe implementation detail from users and makes Write seem as though it's an RPC. - if werr == context.Canceled || werr == context.DeadlineExceeded { + if xerrors.Is(werr, context.Canceled) || xerrors.Is(werr, context.DeadlineExceeded) { return n, werr } } @@ -353,6 +356,7 @@ func (w *Writer) openGRPC() error { // Note: This blocks until either the buffer is full or EOF is read. recvd, doneReading, err := read(pr, buf) if err != nil { + err = checkCanceled(err) w.error(err) pr.CloseWithError(err) return @@ -369,6 +373,7 @@ func (w *Writer) openGRPC() error { if !doneReading && w.upid == "" { err = w.startResumableUpload() if err != nil { + err = checkCanceled(err) w.error(err) pr.CloseWithError(err) return @@ -377,6 +382,7 @@ func (w *Writer) openGRPC() error { o, off, finalized, err := w.uploadBuffer(toWrite, recvd, offset, doneReading) if err != nil { + err = checkCanceled(err) w.error(err) pr.CloseWithError(err) return @@ -430,7 +436,7 @@ func (w *Writer) queryProgress() (int64, error) { q, err := w.o.c.gc.QueryWriteStatus(w.ctx, &storagepb.QueryWriteStatusRequest{UploadId: w.upid}) // q.GetCommittedSize() will return 0 if q is nil. - return q.GetCommittedSize(), err + return q.GetPersistedSize(), err } // uploadBuffer opens a Write stream and uploads the buffer at the given offset (if @@ -637,3 +643,11 @@ func read(r io.Reader, buf []byte) (int, bool, error) { } return recvd, done, err } + +func checkCanceled(err error) error { + if status.Code(err) == codes.Canceled { + return context.Canceled + } + + return err +} diff --git a/vendor/github.com/VictoriaMetrics/metricsql/binary_op.go b/vendor/github.com/VictoriaMetrics/metricsql/binary_op.go index a265af00b..5005089ec 100644 --- a/vendor/github.com/VictoriaMetrics/metricsql/binary_op.go +++ b/vendor/github.com/VictoriaMetrics/metricsql/binary_op.go @@ -16,6 +16,9 @@ var binaryOps = map[string]bool{ "%": true, "^": true, + // See https://github.com/prometheus/prometheus/pull/9248 + "atan2": true, + // cmp ops "==": true, "!=": true, @@ -57,9 +60,10 @@ var binaryOpPriorities = map[string]int{ "+": 4, "-": 4, - "*": 5, - "/": 5, - "%": 5, + "*": 5, + "/": 5, + "%": 5, + "atan2": 5, "^": 6, } @@ -140,6 +144,7 @@ func isBinaryOpLogicalSet(op string) bool { } func binaryOpEvalNumber(op string, left, right float64, isBool bool) float64 { + op = strings.ToLower(op) if IsBinaryOpCmp(op) { evalCmp := func(cf func(left, right float64) bool) float64 { if isBool { @@ -181,6 +186,8 @@ func binaryOpEvalNumber(op string, left, right float64, isBool bool) float64 { left = binaryop.Div(left, right) case "%": left = binaryop.Mod(left, right) + case "atan2": + left = binaryop.Atan2(left, right) case "^": left = binaryop.Pow(left, right) case "and": diff --git a/vendor/github.com/VictoriaMetrics/metricsql/binaryop/funcs.go b/vendor/github.com/VictoriaMetrics/metricsql/binaryop/funcs.go index 9a123e24d..1cce8cba4 100644 --- a/vendor/github.com/VictoriaMetrics/metricsql/binaryop/funcs.go +++ b/vendor/github.com/VictoriaMetrics/metricsql/binaryop/funcs.go @@ -79,6 +79,11 @@ func Pow(left, right float64) float64 { return math.Pow(left, right) } +// Atan2 returns atan2(left, right) +func Atan2(left, right float64) float64 { + return math.Atan2(left, right) +} + // Default returns left or right if left is NaN. func Default(left, right float64) float64 { if math.IsNaN(left) { diff --git a/vendor/github.com/VictoriaMetrics/metricsql/transform.go b/vendor/github.com/VictoriaMetrics/metricsql/transform.go index 131e5a6a4..d8e3c9c85 100644 --- a/vendor/github.com/VictoriaMetrics/metricsql/transform.go +++ b/vendor/github.com/VictoriaMetrics/metricsql/transform.go @@ -9,13 +9,22 @@ var transformFuncs = map[string]bool{ // See funcs accepting instant-vector on https://prometheus.io/docs/prometheus/latest/querying/functions/ . "abs": true, "absent": true, + "acos": true, + "acosh": true, + "asin": true, + "asinh": true, + "atan": true, + "atanh": true, "ceil": true, "clamp": true, "clamp_max": true, "clamp_min": true, + "cos": true, + "cosh": true, "day_of_month": true, "day_of_week": true, "days_in_month": true, + "deg": true, "exp": true, "floor": true, "histogram_quantile": true, @@ -27,12 +36,18 @@ var transformFuncs = map[string]bool{ "log10": true, "minute": true, "month": true, + "pi": true, + "rad": true, "round": true, "scalar": true, "sgn": true, + "sin": true, + "sinh": true, "sort": true, "sort_desc": true, "sqrt": true, + "tan": true, + "tanh": true, "time": true, // "timestamp" has been moved to rollup funcs. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/415 "vector": true, @@ -75,11 +90,6 @@ var transformFuncs = map[string]bool{ "rand": true, "rand_normal": true, "rand_exponential": true, - "pi": true, - "sin": true, - "cos": true, - "asin": true, - "acos": true, "prometheus_buckets": true, "buckets_limit": true, "histogram_share": true, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 2d90f21b1..845160f71 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -55,6 +55,7 @@ const ( // AWS ISO (US) partition's regions. const ( UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. + UsIsoWest1RegionID = "us-iso-west-1" // US ISO WEST. ) // AWS ISOB (US) partition's regions. @@ -881,6 +882,31 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "applicationinsights": service{ + + Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "appmesh": service{ Endpoints: endpoints{ @@ -7661,6 +7687,54 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "textract": service{ + + Endpoints: endpoints{ + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "textract-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "textract-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "textract-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "textract-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "textract-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -8133,6 +8207,17 @@ var awsPartition = partition{ }, }, }, + "wisdom": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "workdocs": service{ Endpoints: endpoints{ @@ -8344,6 +8429,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "applicationinsights": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "appmesh": service{ Endpoints: endpoints{ @@ -9429,6 +9521,23 @@ var awsusgovPartition = partition{ }, }, }, + "applicationinsights": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "applicationinsights.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "applicationinsights.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "appstream2": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -10332,6 +10441,18 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "kendra": service{ + + Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "kendra-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, "kinesis": service{ Endpoints: endpoints{ @@ -11193,6 +11314,25 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "textract": service{ + + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "textract-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "textract-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "transcribe": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -11334,6 +11474,9 @@ var awsisoPartition = partition{ "us-iso-east-1": region{ Description: "US ISO East", }, + "us-iso-west-1": region{ + Description: "US ISO WEST", + }, }, Services: services{ "api.ecr": service{ @@ -11345,6 +11488,12 @@ var awsisoPartition = partition{ Region: "us-iso-east-1", }, }, + "us-iso-west-1": endpoint{ + Hostname: "api.ecr.us-iso-west-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-west-1", + }, + }, }, }, "api.sagemaker": service{ @@ -11365,6 +11514,7 @@ var awsisoPartition = partition{ }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "autoscaling": service{ @@ -11373,24 +11523,28 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "cloudformation": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "codedeploy": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "comprehend": service{ @@ -11405,6 +11559,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "datapipeline": service{ @@ -11417,6 +11572,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "dms": service{ @@ -11443,24 +11599,28 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "ec2": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "ecs": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "elasticache": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "elasticfilesystem": service{ @@ -11481,6 +11641,7 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "elasticmapreduce": service{ @@ -11489,6 +11650,7 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"https"}, }, + "us-iso-west-1": endpoint{}, }, }, "es": service{ @@ -11501,6 +11663,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "firehose": service{ @@ -11515,6 +11678,7 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "health": service{ @@ -11540,6 +11704,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "kms": service{ @@ -11552,12 +11717,14 @@ var awsisoPartition = partition{ }, }, "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "lambda": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "license-manager": service{ @@ -11570,6 +11737,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "medialive": service{ @@ -11588,6 +11756,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "outposts": service{ @@ -11606,12 +11775,14 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "route53": service{ @@ -11668,6 +11839,7 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "sqs": service{ @@ -11676,6 +11848,7 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{ Protocols: []string{"http", "https"}, }, + "us-iso-west-1": endpoint{}, }, }, "ssm": service{ @@ -11688,6 +11861,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "streams.dynamodb": service{ @@ -11707,6 +11881,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "support": service{ @@ -11725,6 +11900,7 @@ var awsisoPartition = partition{ Endpoints: endpoints{ "us-iso-east-1": endpoint{}, + "us-iso-west-1": endpoint{}, }, }, "transcribe": service{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 2fc6d4485..1d26ce3fb 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.40.58" +const SDKVersion = "1.41.8" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go index 864fb6704..2aec80661 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go @@ -82,13 +82,17 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) field, _ := value.Type().FieldByName(payload) tag = field.Tag value = elemOf(value.FieldByName(payload)) - - if !value.IsValid() { + if !value.IsValid() && tag.Get("type") != "structure" { return nil } } buf.WriteByte('{') + defer buf.WriteString("}") + + if !value.IsValid() { + return nil + } t := value.Type() first := true @@ -144,8 +148,6 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) } - buf.WriteString("}") - return nil } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go index a029217e4..d9aa27114 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go @@ -49,9 +49,8 @@ func Build(req *request.Request) { buf = emptyJSON } - if req.ClientInfo.TargetPrefix != "" || string(buf) != "{}" { - req.SetBufferBody(buf) - } + // Always serialize the body, don't suppress it. + req.SetBufferBody(buf) if req.ClientInfo.TargetPrefix != "" { target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go index 4366de2e1..b54c99eda 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go @@ -28,18 +28,27 @@ func PayloadMember(i interface{}) interface{} { return nil } -// PayloadType returns the type of a payload field member of i if there is one, or "". +const nopayloadPayloadType = "nopayload" + +// PayloadType returns the type of a payload field member of i if there is one, +// or "". func PayloadType(i interface{}) string { v := reflect.Indirect(reflect.ValueOf(i)) if !v.IsValid() { return "" } + if field, ok := v.Type().FieldByName("_"); ok { + if noPayload := field.Tag.Get(nopayloadPayloadType); noPayload != "" { + return nopayloadPayloadType + } + if payloadName := field.Tag.Get("payload"); payloadName != "" { if member, ok := v.Type().FieldByName(payloadName); ok { return member.Tag.Get("type") } } } + return "" } diff --git a/vendor/github.com/aws/aws-sdk-go/service/sso/api.go b/vendor/github.com/aws/aws-sdk-go/service/sso/api.go index e3711e642..948f060ca 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sso/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sso/api.go @@ -550,7 +550,7 @@ func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo { } type GetRoleCredentialsInput struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure" nopayload:"true"` // The token issued by the CreateToken API call. For more information, see CreateToken // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) @@ -726,7 +726,7 @@ func (s *InvalidRequestException) RequestID() string { } type ListAccountRolesInput struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure" nopayload:"true"` // The token issued by the CreateToken API call. For more information, see CreateToken // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) @@ -855,7 +855,7 @@ func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOut } type ListAccountsInput struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure" nopayload:"true"` // The token issued by the CreateToken API call. For more information, see CreateToken // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) @@ -970,7 +970,7 @@ func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput { } type LogoutInput struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure" nopayload:"true"` // The token issued by the CreateToken API call. For more information, see CreateToken // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) diff --git a/vendor/github.com/valyala/gozstd/gozstd.go b/vendor/github.com/valyala/gozstd/gozstd.go index 4287778d5..cc9ffa467 100644 --- a/vendor/github.com/valyala/gozstd/gozstd.go +++ b/vendor/github.com/valyala/gozstd/gozstd.go @@ -123,7 +123,6 @@ func compress(cctx, cctxDict *cctxWrapper, dst, src []byte, cd *CDict, compressi // All OK. return dst[:dstLen+compressedSize] } - if C.ZSTD_getErrorCode(result) != C.ZSTD_error_dstSize_tooSmall { // Unexpected error. panic(fmt.Errorf("BUG: unexpected error during compression with cd=%p: %s", cd, errStr(result))) @@ -139,7 +138,12 @@ func compress(cctx, cctxDict *cctxWrapper, dst, src []byte, cd *CDict, compressi result := compressInternal(cctx, cctxDict, dst[dstLen:dstLen+compressBound], src, cd, compressionLevel, true) compressedSize := int(result) - return dst[:dstLen+compressedSize] + dst = dst[:dstLen+compressedSize] + if cap(dst)-len(dst) > 4096 { + // Re-allocate dst in order to remove superflouos capacity and reduce memory usage. + dst = append([]byte{}, dst...) + } + return dst } func compressInternal(cctx, cctxDict *cctxWrapper, dst, src []byte, cd *CDict, compressionLevel int, mustSucceed bool) C.size_t { @@ -234,7 +238,7 @@ func decompress(dctx, dctxDict *dctxWrapper, dst, src []byte, dd *DDict) ([]byte } dstLen := len(dst) - if cap(dst)-dstLen >= len(src) { + if cap(dst) > dstLen { // Fast path - try decompressing without dst resize. result := decompressInternal(dctx, dctxDict, dst[dstLen:cap(dst)], src, dd) decompressedSize := int(result) @@ -270,8 +274,12 @@ func decompress(dctx, dctxDict *dctxWrapper, dst, src []byte, dd *DDict) ([]byte result := decompressInternal(dctx, dctxDict, dst[dstLen:dstLen+decompressBound], src, dd) decompressedSize := int(result) if decompressedSize >= 0 { - // All OK. - return dst[:dstLen+decompressedSize], nil + dst = dst[:dstLen+decompressedSize] + if cap(dst)-len(dst) > 4096 { + // Re-allocate dst in order to remove superflouos capacity and reduce memory usage. + dst = append([]byte{}, dst...) + } + return dst, nil } // Error during decompression. diff --git a/vendor/golang.org/x/net/http2/hpack/huffman.go b/vendor/golang.org/x/net/http2/hpack/huffman.go index a1ab2f056..fe0b84ccd 100644 --- a/vendor/golang.org/x/net/http2/hpack/huffman.go +++ b/vendor/golang.org/x/net/http2/hpack/huffman.go @@ -140,25 +140,29 @@ func buildRootHuffmanNode() { panic("unexpected size") } lazyRootHuffmanNode = newInternalNode() - for i, code := range huffmanCodes { - addDecoderNode(byte(i), code, huffmanCodeLen[i]) - } -} + // allocate a leaf node for each of the 256 symbols + leaves := new([256]node) -func addDecoderNode(sym byte, code uint32, codeLen uint8) { - cur := lazyRootHuffmanNode - for codeLen > 8 { - codeLen -= 8 - i := uint8(code >> codeLen) - if cur.children[i] == nil { - cur.children[i] = newInternalNode() + for sym, code := range huffmanCodes { + codeLen := huffmanCodeLen[sym] + + cur := lazyRootHuffmanNode + for codeLen > 8 { + codeLen -= 8 + i := uint8(code >> codeLen) + if cur.children[i] == nil { + cur.children[i] = newInternalNode() + } + cur = cur.children[i] + } + shift := 8 - codeLen + start, end := int(uint8(code<299 // while still writing request body - if req.Body != nil { - if e := req.Body.Close(); err == nil { - err = e - } + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cs.reqBodyClosed = true + cc.mu.Unlock() + if !bodyClosed && cs.reqBody != nil { + cs.reqBody.Close() } if err != nil && cs.sentEndStream { @@ -1375,7 +1395,6 @@ func (cs *clientStream) cleanupWriteRequest(err error) { if cs.ID != 0 { cc.forgetStreamID(cs.ID) } - close(cs.donec) cc.wmu.Lock() werr := cc.werr @@ -1383,6 +1402,8 @@ func (cs *clientStream) cleanupWriteRequest(err error) { if werr != nil { cc.Close() } + + close(cs.donec) } // awaitOpenSlotForStream waits until len(streams) < maxConcurrentStreams. @@ -1456,7 +1477,7 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { if n > max { n = max } - if cl := actualContentLength(cs.req); cl != -1 && cl+1 < n { + if cl := cs.reqBodyContentLength; cl != -1 && cl+1 < n { // Add an extra byte past the declared content-length to // give the caller's Request.Body io.Reader a chance to // give us more bytes than they declared, so we can catch it @@ -1471,13 +1492,13 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { var bufPool sync.Pool // of *[]byte -func (cs *clientStream) writeRequestBody(body io.Reader) (err error) { +func (cs *clientStream) writeRequestBody(req *http.Request) (err error) { cc := cs.cc + body := cs.reqBody sentEnd := false // whether we sent the final DATA frame w/ END_STREAM - req := cs.req hasTrailers := req.Trailer != nil - remainLen := actualContentLength(req) + remainLen := cs.reqBodyContentLength hasContentLen := remainLen != -1 cc.mu.Lock() @@ -1518,23 +1539,26 @@ func (cs *clientStream) writeRequestBody(body io.Reader) (err error) { return err } } - if err == io.EOF { - sawEOF = true - err = nil - } else if err != nil { - return err + if err != nil { + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cc.mu.Unlock() + switch { + case bodyClosed: + return errStopReqBodyWrite + case err == io.EOF: + sawEOF = true + err = nil + default: + return err + } } remain := buf[:n] for len(remain) > 0 && err == nil { var allowed int32 allowed, err = cs.awaitFlowControl(len(remain)) - switch { - case err == errStopReqBodyWrite: - return err - case err == errStopReqBodyWriteAndCancel: - return err - case err != nil: + if err != nil { return err } cc.wmu.Lock() @@ -1565,16 +1589,26 @@ func (cs *clientStream) writeRequestBody(body io.Reader) (err error) { return nil } + // Since the RoundTrip contract permits the caller to "mutate or reuse" + // a request after the Response's Body is closed, verify that this hasn't + // happened before accessing the trailers. + cc.mu.Lock() + trailer := req.Trailer + err = cs.abortErr + cc.mu.Unlock() + if err != nil { + return err + } + cc.wmu.Lock() + defer cc.wmu.Unlock() var trls []byte - if hasTrailers { - trls, err = cc.encodeTrailers(req) + if len(trailer) > 0 { + trls, err = cc.encodeTrailers(trailer) if err != nil { - cc.wmu.Unlock() return err } } - defer cc.wmu.Unlock() // Two ways to send END_STREAM: either with trailers, or // with an empty DATA frame. @@ -1595,23 +1629,22 @@ func (cs *clientStream) writeRequestBody(body io.Reader) (err error) { // if the stream is dead. func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { cc := cs.cc - req := cs.req - ctx := req.Context() + ctx := cs.ctx cc.mu.Lock() defer cc.mu.Unlock() for { if cc.closed { return 0, errClientConnClosed } - if cs.stopReqBody != nil { - return 0, cs.stopReqBody + if cs.reqBodyClosed { + return 0, errStopReqBodyWrite } select { case <-cs.abort: return 0, cs.abortErr case <-ctx.Done(): return 0, ctx.Err() - case <-req.Cancel: + case <-cs.reqCancel: return 0, errRequestCanceled default: } @@ -1825,11 +1858,11 @@ func shouldSendReqContentLength(method string, contentLength int64) bool { } // requires cc.wmu be held. -func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { +func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) { cc.hbuf.Reset() hlSize := uint64(0) - for k, vv := range req.Trailer { + for k, vv := range trailer { for _, v := range vv { hf := hpack.HeaderField{Name: k, Value: v} hlSize += uint64(hf.Size()) @@ -1839,7 +1872,7 @@ func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { return nil, errRequestHeaderListSize } - for k, vv := range req.Trailer { + for k, vv := range trailer { lowKey, ascii := asciiToLower(k) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header @@ -1975,7 +2008,13 @@ func (rl *clientConnReadLoop) cleanup() { } cc.closed = true for _, cs := range cc.streams { - cs.abortStreamLocked(err) + select { + case <-cs.peerClosed: + // The server closed the stream before closing the conn, + // so no need to interrupt it. + default: + cs.abortStreamLocked(err) + } } cc.cond.Broadcast() cc.mu.Unlock() @@ -2217,28 +2256,33 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra return nil, nil } - streamEnded := f.StreamEnded() - isHead := cs.req.Method == "HEAD" - if !streamEnded || isHead { - res.ContentLength = -1 - if clens := res.Header["Content-Length"]; len(clens) == 1 { - if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { - res.ContentLength = int64(cl) - } else { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. - } - } else if len(clens) > 1 { + res.ContentLength = -1 + if clens := res.Header["Content-Length"]; len(clens) == 1 { + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) + } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } + } else if len(clens) > 1 { + // TODO: care? unlike http/1, it won't mess up our framing, so it's + // more safe smuggling-wise to ignore. } - if streamEnded || isHead { + if cs.isHead { res.Body = noBody return res, nil } + if f.StreamEnded() { + if res.ContentLength > 0 { + res.Body = missingBody{} + } else { + res.Body = noBody + } + return res, nil + } + cs.bufPipe.setBuffer(&dataBuffer{expected: res.ContentLength}) cs.bytesRemain = res.ContentLength res.Body = transportResponseBody{cs} @@ -2282,8 +2326,7 @@ func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFr } // transportResponseBody is the concrete type of Transport.RoundTrip's -// Response.Body. It is an io.ReadCloser. On Read, it reads from cs.body. -// On Close it sends RST_STREAM if EOF wasn't already seen. +// Response.Body. It is an io.ReadCloser. type transportResponseBody struct { cs *clientStream } @@ -2366,6 +2409,8 @@ func (b transportResponseBody) Close() error { } cc.mu.Unlock() + // TODO(dneil): Acquiring this mutex can block indefinitely. + // Move flow control return to a goroutine? cc.wmu.Lock() // Return connection-level flow control. if unread > 0 { @@ -2380,9 +2425,9 @@ func (b transportResponseBody) Close() error { select { case <-cs.donec: - case <-cs.req.Context().Done(): - return cs.req.Context().Err() - case <-cs.req.Cancel: + case <-cs.ctx.Done(): + return cs.ctx.Err() + case <-cs.reqCancel: return errRequestCanceled } return nil @@ -2436,7 +2481,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { return nil } if f.Length > 0 { - if cs.req.Method == "HEAD" && len(data) > 0 { + if cs.isHead && len(data) > 0 { cc.logf("protocol error: received DATA on a HEAD request") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, @@ -2786,6 +2831,11 @@ func (t *Transport) logf(format string, args ...interface{}) { var noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil)) +type missingBody struct{} + +func (missingBody) Close() error { return nil } +func (missingBody) Read([]byte) (int, error) { return 0, io.ErrUnexpectedEOF } + func strSliceContains(ss []string, s string) bool { for _, v := range ss { if v == s { diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go index af3af60db..a20ebea63 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build windows -// +build go1.9 +//go:build windows && go1.9 +// +build windows,go1.9 package windows diff --git a/vendor/golang.org/x/sys/windows/eventlog.go b/vendor/golang.org/x/sys/windows/eventlog.go index 40af946e1..2cd60645e 100644 --- a/vendor/golang.org/x/sys/windows/eventlog.go +++ b/vendor/golang.org/x/sys/windows/eventlog.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package windows diff --git a/vendor/golang.org/x/sys/windows/mksyscall.go b/vendor/golang.org/x/sys/windows/mksyscall.go index 328e3b2ac..610291098 100644 --- a/vendor/golang.org/x/sys/windows/mksyscall.go +++ b/vendor/golang.org/x/sys/windows/mksyscall.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build generate // +build generate package windows diff --git a/vendor/golang.org/x/sys/windows/race.go b/vendor/golang.org/x/sys/windows/race.go index a74e3e24b..9196b089c 100644 --- a/vendor/golang.org/x/sys/windows/race.go +++ b/vendor/golang.org/x/sys/windows/race.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows && race // +build windows,race package windows diff --git a/vendor/golang.org/x/sys/windows/race0.go b/vendor/golang.org/x/sys/windows/race0.go index e44a3cbf6..7bae4817a 100644 --- a/vendor/golang.org/x/sys/windows/race0.go +++ b/vendor/golang.org/x/sys/windows/race0.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows && !race // +build windows,!race package windows diff --git a/vendor/golang.org/x/sys/windows/service.go b/vendor/golang.org/x/sys/windows/service.go index b269850d0..5b28ae168 100644 --- a/vendor/golang.org/x/sys/windows/service.go +++ b/vendor/golang.org/x/sys/windows/service.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package windows @@ -235,3 +236,4 @@ type QUERY_SERVICE_LOCK_STATUS struct { //sys NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) = advapi32.NotifyServiceStatusChangeW //sys SubscribeServiceChangeNotifications(service Handle, eventType uint32, callback uintptr, callbackCtx uintptr, subscription *uintptr) (ret error) = sechost.SubscribeServiceChangeNotifications? //sys UnsubscribeServiceChangeNotifications(subscription uintptr) = sechost.UnsubscribeServiceChangeNotifications? +//sys RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) = advapi32.RegisterServiceCtrlHandlerExW diff --git a/vendor/golang.org/x/sys/windows/str.go b/vendor/golang.org/x/sys/windows/str.go index 917cc2aae..4fc01434e 100644 --- a/vendor/golang.org/x/sys/windows/str.go +++ b/vendor/golang.org/x/sys/windows/str.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package windows diff --git a/vendor/golang.org/x/sys/windows/syscall.go b/vendor/golang.org/x/sys/windows/syscall.go index 6122f557a..72074d582 100644 --- a/vendor/golang.org/x/sys/windows/syscall.go +++ b/vendor/golang.org/x/sys/windows/syscall.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows // Package windows contains an interface to the low-level operating system diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index d3b59ae69..42b494555 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -401,6 +401,11 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys LoadResource(module Handle, resInfo Handle) (resData Handle, err error) = kernel32.LoadResource //sys LockResource(resData Handle) (addr uintptr, err error) = kernel32.LockResource +// Version APIs +//sys GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error) = version.GetFileVersionInfoSizeW +//sys GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) = version.GetFileVersionInfoW +//sys VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) = version.VerQueryValueW + // Process Status API (PSAPI) //sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses //sys EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) = psapi.EnumProcessModules @@ -423,6 +428,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys RtlDefaultNpAcl(acl **ACL) (ntstatus error) = ntdll.RtlDefaultNpAcl //sys NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQueryInformationProcess //sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess +//sys NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQuerySystemInformation +//sys NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) = ntdll.NtSetSystemInformation +//sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable +//sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable // syscall interface implementation for other packages diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 88e0ce5d0..53e215227 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -66,9 +66,21 @@ var signals = [...]string{ } const ( - FILE_LIST_DIRECTORY = 0x00000001 - FILE_APPEND_DATA = 0x00000004 + FILE_READ_DATA = 0x00000001 + FILE_READ_ATTRIBUTES = 0x00000080 + FILE_READ_EA = 0x00000008 + FILE_WRITE_DATA = 0x00000002 FILE_WRITE_ATTRIBUTES = 0x00000100 + FILE_WRITE_EA = 0x00000010 + FILE_APPEND_DATA = 0x00000004 + FILE_EXECUTE = 0x00000020 + + FILE_GENERIC_READ = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE + FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE + FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE + + FILE_LIST_DIRECTORY = 0x00000001 + FILE_TRAVERSE = 0x00000020 FILE_SHARE_READ = 0x00000001 FILE_SHARE_WRITE = 0x00000002 @@ -1789,7 +1801,53 @@ type reparseDataBuffer struct { } const ( - FSCTL_GET_REPARSE_POINT = 0x900A8 + FSCTL_CREATE_OR_GET_OBJECT_ID = 0x0900C0 + FSCTL_DELETE_OBJECT_ID = 0x0900A0 + FSCTL_DELETE_REPARSE_POINT = 0x0900AC + FSCTL_DUPLICATE_EXTENTS_TO_FILE = 0x098344 + FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX = 0x0983E8 + FSCTL_FILESYSTEM_GET_STATISTICS = 0x090060 + FSCTL_FILE_LEVEL_TRIM = 0x098208 + FSCTL_FIND_FILES_BY_SID = 0x09008F + FSCTL_GET_COMPRESSION = 0x09003C + FSCTL_GET_INTEGRITY_INFORMATION = 0x09027C + FSCTL_GET_NTFS_VOLUME_DATA = 0x090064 + FSCTL_GET_REFS_VOLUME_DATA = 0x0902D8 + FSCTL_GET_OBJECT_ID = 0x09009C + FSCTL_GET_REPARSE_POINT = 0x0900A8 + FSCTL_GET_RETRIEVAL_POINTER_COUNT = 0x09042B + FSCTL_GET_RETRIEVAL_POINTERS = 0x090073 + FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT = 0x0903D3 + FSCTL_IS_PATHNAME_VALID = 0x09002C + FSCTL_LMR_SET_LINK_TRACKING_INFORMATION = 0x1400EC + FSCTL_MARK_HANDLE = 0x0900FC + FSCTL_OFFLOAD_READ = 0x094264 + FSCTL_OFFLOAD_WRITE = 0x098268 + FSCTL_PIPE_PEEK = 0x11400C + FSCTL_PIPE_TRANSCEIVE = 0x11C017 + FSCTL_PIPE_WAIT = 0x110018 + FSCTL_QUERY_ALLOCATED_RANGES = 0x0940CF + FSCTL_QUERY_FAT_BPB = 0x090058 + FSCTL_QUERY_FILE_REGIONS = 0x090284 + FSCTL_QUERY_ON_DISK_VOLUME_INFO = 0x09013C + FSCTL_QUERY_SPARING_INFO = 0x090138 + FSCTL_READ_FILE_USN_DATA = 0x0900EB + FSCTL_RECALL_FILE = 0x090117 + FSCTL_REFS_STREAM_SNAPSHOT_MANAGEMENT = 0x090440 + FSCTL_SET_COMPRESSION = 0x09C040 + FSCTL_SET_DEFECT_MANAGEMENT = 0x098134 + FSCTL_SET_ENCRYPTION = 0x0900D7 + FSCTL_SET_INTEGRITY_INFORMATION = 0x09C280 + FSCTL_SET_INTEGRITY_INFORMATION_EX = 0x090380 + FSCTL_SET_OBJECT_ID = 0x090098 + FSCTL_SET_OBJECT_ID_EXTENDED = 0x0900BC + FSCTL_SET_REPARSE_POINT = 0x0900A4 + FSCTL_SET_SPARSE = 0x0900C4 + FSCTL_SET_ZERO_DATA = 0x0980C8 + FSCTL_SET_ZERO_ON_DEALLOCATION = 0x090194 + FSCTL_SIS_COPYFILE = 0x090100 + FSCTL_WRITE_USN_CLOSE_RECORD = 0x0900EF + MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024 IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003 IO_REPARSE_TAG_SYMLINK = 0xA000000C @@ -2308,6 +2366,12 @@ type LIST_ENTRY struct { Blink *LIST_ENTRY } +type RUNTIME_FUNCTION struct { + BeginAddress uint32 + EndAddress uint32 + UnwindData uint32 +} + type LDR_DATA_TABLE_ENTRY struct { reserved1 [2]uintptr InMemoryOrderLinks LIST_ENTRY @@ -2614,6 +2678,203 @@ type PROCESS_BASIC_INFORMATION struct { InheritedFromUniqueProcessId uintptr } +// SystemInformationClasses for NtQuerySystemInformation and NtSetSystemInformation +const ( + SystemBasicInformation = iota + SystemProcessorInformation + SystemPerformanceInformation + SystemTimeOfDayInformation + SystemPathInformation + SystemProcessInformation + SystemCallCountInformation + SystemDeviceInformation + SystemProcessorPerformanceInformation + SystemFlagsInformation + SystemCallTimeInformation + SystemModuleInformation + SystemLocksInformation + SystemStackTraceInformation + SystemPagedPoolInformation + SystemNonPagedPoolInformation + SystemHandleInformation + SystemObjectInformation + SystemPageFileInformation + SystemVdmInstemulInformation + SystemVdmBopInformation + SystemFileCacheInformation + SystemPoolTagInformation + SystemInterruptInformation + SystemDpcBehaviorInformation + SystemFullMemoryInformation + SystemLoadGdiDriverInformation + SystemUnloadGdiDriverInformation + SystemTimeAdjustmentInformation + SystemSummaryMemoryInformation + SystemMirrorMemoryInformation + SystemPerformanceTraceInformation + systemObsolete0 + SystemExceptionInformation + SystemCrashDumpStateInformation + SystemKernelDebuggerInformation + SystemContextSwitchInformation + SystemRegistryQuotaInformation + SystemExtendServiceTableInformation + SystemPrioritySeperation + SystemVerifierAddDriverInformation + SystemVerifierRemoveDriverInformation + SystemProcessorIdleInformation + SystemLegacyDriverInformation + SystemCurrentTimeZoneInformation + SystemLookasideInformation + SystemTimeSlipNotification + SystemSessionCreate + SystemSessionDetach + SystemSessionInformation + SystemRangeStartInformation + SystemVerifierInformation + SystemVerifierThunkExtend + SystemSessionProcessInformation + SystemLoadGdiDriverInSystemSpace + SystemNumaProcessorMap + SystemPrefetcherInformation + SystemExtendedProcessInformation + SystemRecommendedSharedDataAlignment + SystemComPlusPackage + SystemNumaAvailableMemory + SystemProcessorPowerInformation + SystemEmulationBasicInformation + SystemEmulationProcessorInformation + SystemExtendedHandleInformation + SystemLostDelayedWriteInformation + SystemBigPoolInformation + SystemSessionPoolTagInformation + SystemSessionMappedViewInformation + SystemHotpatchInformation + SystemObjectSecurityMode + SystemWatchdogTimerHandler + SystemWatchdogTimerInformation + SystemLogicalProcessorInformation + SystemWow64SharedInformationObsolete + SystemRegisterFirmwareTableInformationHandler + SystemFirmwareTableInformation + SystemModuleInformationEx + SystemVerifierTriageInformation + SystemSuperfetchInformation + SystemMemoryListInformation + SystemFileCacheInformationEx + SystemThreadPriorityClientIdInformation + SystemProcessorIdleCycleTimeInformation + SystemVerifierCancellationInformation + SystemProcessorPowerInformationEx + SystemRefTraceInformation + SystemSpecialPoolInformation + SystemProcessIdInformation + SystemErrorPortInformation + SystemBootEnvironmentInformation + SystemHypervisorInformation + SystemVerifierInformationEx + SystemTimeZoneInformation + SystemImageFileExecutionOptionsInformation + SystemCoverageInformation + SystemPrefetchPatchInformation + SystemVerifierFaultsInformation + SystemSystemPartitionInformation + SystemSystemDiskInformation + SystemProcessorPerformanceDistribution + SystemNumaProximityNodeInformation + SystemDynamicTimeZoneInformation + SystemCodeIntegrityInformation + SystemProcessorMicrocodeUpdateInformation + SystemProcessorBrandString + SystemVirtualAddressInformation + SystemLogicalProcessorAndGroupInformation + SystemProcessorCycleTimeInformation + SystemStoreInformation + SystemRegistryAppendString + SystemAitSamplingValue + SystemVhdBootInformation + SystemCpuQuotaInformation + SystemNativeBasicInformation + systemSpare1 + SystemLowPriorityIoInformation + SystemTpmBootEntropyInformation + SystemVerifierCountersInformation + SystemPagedPoolInformationEx + SystemSystemPtesInformationEx + SystemNodeDistanceInformation + SystemAcpiAuditInformation + SystemBasicPerformanceInformation + SystemQueryPerformanceCounterInformation + SystemSessionBigPoolInformation + SystemBootGraphicsInformation + SystemScrubPhysicalMemoryInformation + SystemBadPageInformation + SystemProcessorProfileControlArea + SystemCombinePhysicalMemoryInformation + SystemEntropyInterruptTimingCallback + SystemConsoleInformation + SystemPlatformBinaryInformation + SystemThrottleNotificationInformation + SystemHypervisorProcessorCountInformation + SystemDeviceDataInformation + SystemDeviceDataEnumerationInformation + SystemMemoryTopologyInformation + SystemMemoryChannelInformation + SystemBootLogoInformation + SystemProcessorPerformanceInformationEx + systemSpare0 + SystemSecureBootPolicyInformation + SystemPageFileInformationEx + SystemSecureBootInformation + SystemEntropyInterruptTimingRawInformation + SystemPortableWorkspaceEfiLauncherInformation + SystemFullProcessInformation + SystemKernelDebuggerInformationEx + SystemBootMetadataInformation + SystemSoftRebootInformation + SystemElamCertificateInformation + SystemOfflineDumpConfigInformation + SystemProcessorFeaturesInformation + SystemRegistryReconciliationInformation + SystemEdidInformation + SystemManufacturingInformation + SystemEnergyEstimationConfigInformation + SystemHypervisorDetailInformation + SystemProcessorCycleStatsInformation + SystemVmGenerationCountInformation + SystemTrustedPlatformModuleInformation + SystemKernelDebuggerFlags + SystemCodeIntegrityPolicyInformation + SystemIsolatedUserModeInformation + SystemHardwareSecurityTestInterfaceResultsInformation + SystemSingleModuleInformation + SystemAllowedCpuSetsInformation + SystemDmaProtectionInformation + SystemInterruptCpuSetsInformation + SystemSecureBootPolicyFullInformation + SystemCodeIntegrityPolicyFullInformation + SystemAffinitizedInterruptProcessorInformation + SystemRootSiloInformation +) + +type RTL_PROCESS_MODULE_INFORMATION struct { + Section Handle + MappedBase uintptr + ImageBase uintptr + ImageSize uint32 + Flags uint32 + LoadOrderIndex uint16 + InitOrderIndex uint16 + LoadCount uint16 + OffsetToFileName uint16 + FullPathName [256]byte +} + +type RTL_PROCESS_MODULES struct { + NumberOfModules uint32 + Modules [1]RTL_PROCESS_MODULE_INFORMATION +} + // Constants for LocalAlloc flags. const ( LMEM_FIXED = 0x0 @@ -2708,6 +2969,22 @@ var ( RT_MANIFEST ResourceID = 24 ) +type VS_FIXEDFILEINFO struct { + Signature uint32 + StrucVersion uint32 + FileVersionMS uint32 + FileVersionLS uint32 + ProductVersionMS uint32 + ProductVersionLS uint32 + FileFlagsMask uint32 + FileFlags uint32 + FileOS uint32 + FileType uint32 + FileSubtype uint32 + FileDateMS uint32 + FileDateLS uint32 +} + type COAUTHIDENTITY struct { User *uint16 UserLength uint32 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 4ea788e4c..42e10dd38 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -51,6 +51,7 @@ var ( modshell32 = NewLazySystemDLL("shell32.dll") moduser32 = NewLazySystemDLL("user32.dll") moduserenv = NewLazySystemDLL("userenv.dll") + modversion = NewLazySystemDLL("version.dll") modwintrust = NewLazySystemDLL("wintrust.dll") modws2_32 = NewLazySystemDLL("ws2_32.dll") modwtsapi32 = NewLazySystemDLL("wtsapi32.dll") @@ -124,6 +125,7 @@ var ( procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW") procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW") procRegisterEventSourceW = modadvapi32.NewProc("RegisterEventSourceW") + procRegisterServiceCtrlHandlerExW = modadvapi32.NewProc("RegisterServiceCtrlHandlerExW") procReportEventW = modadvapi32.NewProc("ReportEventW") procRevertToSelf = modadvapi32.NewProc("RevertToSelf") procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW") @@ -365,8 +367,12 @@ var ( procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") + procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") + procNtSetSystemInformation = modntdll.NewProc("NtSetSystemInformation") + procRtlAddFunctionTable = modntdll.NewProc("RtlAddFunctionTable") procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") + procRtlDeleteFunctionTable = modntdll.NewProc("RtlDeleteFunctionTable") procRtlDosPathNameToNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToNtPathName_U_WithStatus") procRtlDosPathNameToRelativeNtPathName_U_WithStatus = modntdll.NewProc("RtlDosPathNameToRelativeNtPathName_U_WithStatus") procRtlGetCurrentPeb = modntdll.NewProc("RtlGetCurrentPeb") @@ -402,6 +408,9 @@ var ( procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") + procGetFileVersionInfoSizeW = modversion.NewProc("GetFileVersionInfoSizeW") + procGetFileVersionInfoW = modversion.NewProc("GetFileVersionInfoW") + procVerQueryValueW = modversion.NewProc("VerQueryValueW") procWinVerifyTrustEx = modwintrust.NewProc("WinVerifyTrustEx") procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") @@ -1055,6 +1064,15 @@ func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Hand return } +func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) { + r0, _, e1 := syscall.Syscall(procRegisterServiceCtrlHandlerExW.Addr(), 3, uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) + handle = Handle(r0) + if handle == 0 { + err = errnoErr(e1) + } + return +} + func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) if r1 == 0 { @@ -3160,6 +3178,14 @@ func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe return } +func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { + r0, _, _ := syscall.Syscall6(procNtQuerySystemInformation.Addr(), 4, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen)), 0, 0) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { r0, _, _ := syscall.Syscall6(procNtSetInformationProcess.Addr(), 4, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), 0, 0) if r0 != 0 { @@ -3168,6 +3194,20 @@ func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.P return } +func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { + r0, _, _ := syscall.Syscall(procNtSetSystemInformation.Addr(), 3, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { + r0, _, _ := syscall.Syscall(procRtlAddFunctionTable.Addr(), 3, uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) + ret = r0 != 0 + return +} + func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(acl)), 0, 0) if r0 != 0 { @@ -3176,6 +3216,12 @@ func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { return } +func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { + r0, _, _ := syscall.Syscall(procRtlDeleteFunctionTable.Addr(), 1, uintptr(unsafe.Pointer(functionTable)), 0, 0) + ret = r0 != 0 + return +} + func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) if r0 != 0 { @@ -3449,6 +3495,58 @@ func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { return } +func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error) { + var _p0 *uint16 + _p0, err = syscall.UTF16PtrFromString(filename) + if err != nil { + return + } + return _GetFileVersionInfoSize(_p0, zeroHandle) +} + +func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) { + r0, _, e1 := syscall.Syscall(procGetFileVersionInfoSizeW.Addr(), 2, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle)), 0) + bufSize = uint32(r0) + if bufSize == 0 { + err = errnoErr(e1) + } + return +} + +func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { + var _p0 *uint16 + _p0, err = syscall.UTF16PtrFromString(filename) + if err != nil { + return + } + return _GetFileVersionInfo(_p0, handle, bufSize, buffer) +} + +func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { + r1, _, e1 := syscall.Syscall6(procGetFileVersionInfoW.Addr(), 4, uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { + var _p0 *uint16 + _p0, err = syscall.UTF16PtrFromString(subBlock) + if err != nil { + return + } + return _VerQueryValue(block, _p0, pointerToBufferPointer, bufSize) +} + +func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procVerQueryValueW.Addr(), 4, uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { r0, _, _ := syscall.Syscall(procWinVerifyTrustEx.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) if r0 != 0 { diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json new file mode 100644 index 000000000..ed9ccd034 --- /dev/null +++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json @@ -0,0 +1,372 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://iamcredentials.googleapis.com/", + "batchPath": "batch", + "canonicalName": "IAM Credentials", + "description": "Creates short-lived credentials for impersonating IAM service accounts. To enable this API, you must enable the IAM API (iam.googleapis.com). ", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "iamcredentials:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://iamcredentials.mtls.googleapis.com/", + "name": "iamcredentials", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "projects": { + "resources": { + "serviceAccounts": { + "methods": { + "generateAccessToken": { + "description": "Generates an OAuth 2.0 access token for a service account.", + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateAccessToken", + "httpMethod": "POST", + "id": "iamcredentials.projects.serviceAccounts.generateAccessToken", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "location": "path", + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:generateAccessToken", + "request": { + "$ref": "GenerateAccessTokenRequest" + }, + "response": { + "$ref": "GenerateAccessTokenResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "generateIdToken": { + "description": "Generates an OpenID Connect ID token for a service account.", + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateIdToken", + "httpMethod": "POST", + "id": "iamcredentials.projects.serviceAccounts.generateIdToken", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "location": "path", + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:generateIdToken", + "request": { + "$ref": "GenerateIdTokenRequest" + }, + "response": { + "$ref": "GenerateIdTokenResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "signBlob": { + "description": "Signs a blob using a service account's system-managed private key.", + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob", + "httpMethod": "POST", + "id": "iamcredentials.projects.serviceAccounts.signBlob", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "location": "path", + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:signBlob", + "request": { + "$ref": "SignBlobRequest" + }, + "response": { + "$ref": "SignBlobResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "signJwt": { + "description": "Signs a JWT using a service account's system-managed private key.", + "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt", + "httpMethod": "POST", + "id": "iamcredentials.projects.serviceAccounts.signJwt", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "location": "path", + "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:signJwt", + "request": { + "$ref": "SignJwtRequest" + }, + "response": { + "$ref": "SignJwtResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + }, + "revision": "20210813", + "rootUrl": "https://iamcredentials.googleapis.com/", + "schemas": { + "GenerateAccessTokenRequest": { + "id": "GenerateAccessTokenRequest", + "properties": { + "delegates": { + "description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "items": { + "type": "string" + }, + "type": "array" + }, + "lifetime": { + "description": "The desired lifetime duration of the access token in seconds. By default, the maximum allowed value is 1 hour. To set a lifetime of up to 12 hours, you can add the service account as an allowed value in an Organization Policy that enforces the `constraints/iam.allowServiceAccountCredentialLifetimeExtension` constraint. See detailed instructions at https://cloud.google.com/iam/help/credentials/lifetime If a value is not specified, the token's lifetime will be set to a default value of 1 hour.", + "format": "google-duration", + "type": "string" + }, + "scope": { + "description": "Required. Code to identify the scopes to be included in the OAuth 2.0 access token. See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GenerateAccessTokenResponse": { + "id": "GenerateAccessTokenResponse", + "properties": { + "accessToken": { + "description": "The OAuth 2.0 access token.", + "type": "string" + }, + "expireTime": { + "description": "Token expiration time. The expiration time is always set.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GenerateIdTokenRequest": { + "id": "GenerateIdTokenRequest", + "properties": { + "audience": { + "description": "Required. The audience for the token, such as the API or account that this token grants access to.", + "type": "string" + }, + "delegates": { + "description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "items": { + "type": "string" + }, + "type": "array" + }, + "includeEmail": { + "description": "Include the service account email in the token. If set to `true`, the token will contain `email` and `email_verified` claims.", + "type": "boolean" + } + }, + "type": "object" + }, + "GenerateIdTokenResponse": { + "id": "GenerateIdTokenResponse", + "properties": { + "token": { + "description": "The OpenId Connect ID token.", + "type": "string" + } + }, + "type": "object" + }, + "SignBlobRequest": { + "id": "SignBlobRequest", + "properties": { + "delegates": { + "description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "items": { + "type": "string" + }, + "type": "array" + }, + "payload": { + "description": "Required. The bytes to sign.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "SignBlobResponse": { + "id": "SignBlobResponse", + "properties": { + "keyId": { + "description": "The ID of the key used to sign the blob. The key used for signing will remain valid for at least 12 hours after the blob is signed. To verify the signature, you can retrieve the public key in several formats from the following endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT_EMAIL}` - Raw key in JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_EMAIL}` - JSON Web Key (JWK): `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_EMAIL}`", + "type": "string" + }, + "signedBlob": { + "description": "The signature for the blob. Does not include the original blob. After the key pair referenced by the `key_id` response field expires, Google no longer exposes the public key that can be used to verify the blob. As a result, the receiver can no longer verify the signature.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "SignJwtRequest": { + "id": "SignJwtRequest", + "properties": { + "delegates": { + "description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + "items": { + "type": "string" + }, + "type": "array" + }, + "payload": { + "description": "Required. The JWT payload to sign. Must be a serialized JSON object that contains a JWT Claims Set. For example: `{\"sub\": \"user@example.com\", \"iat\": 313435}` If the JWT Claims Set contains an expiration time (`exp`) claim, it must be an integer timestamp that is not in the past and no more than 12 hours in the future.", + "type": "string" + } + }, + "type": "object" + }, + "SignJwtResponse": { + "id": "SignJwtResponse", + "properties": { + "keyId": { + "description": "The ID of the key used to sign the JWT. The key used for signing will remain valid for at least 12 hours after the JWT is signed. To verify the signature, you can retrieve the public key in several formats from the following endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT_EMAIL}` - Raw key in JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_EMAIL}` - JSON Web Key (JWK): `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_EMAIL}`", + "type": "string" + }, + "signedJwt": { + "description": "The signed JWT. Contains the automatically generated header; the client-supplied payload; and the signature, which is generated using the key referenced by the `kid` field in the header. After the key pair referenced by the `key_id` response field expires, Google no longer exposes the public key that can be used to verify the JWT. As a result, the receiver can no longer verify the signature.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "IAM Service Account Credentials API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go new file mode 100644 index 000000000..415ef0d1b --- /dev/null +++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go @@ -0,0 +1,1089 @@ +// Copyright 2021 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package iamcredentials provides access to the IAM Service Account Credentials API. +// +// For product documentation, see: https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials +// +// Creating a client +// +// Usage example: +// +// import "google.golang.org/api/iamcredentials/v1" +// ... +// ctx := context.Background() +// iamcredentialsService, err := iamcredentials.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// iamcredentialsService, err := iamcredentials.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// iamcredentialsService, err := iamcredentials.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package iamcredentials // import "google.golang.org/api/iamcredentials/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint + +const apiId = "iamcredentials:v1" +const apiName = "iamcredentials" +const apiVersion = "v1" +const basePath = "https://iamcredentials.googleapis.com/" +const mtlsBasePath = "https://iamcredentials.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := option.WithScopes( + "https://www.googleapis.com/auth/cloud-platform", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.ServiceAccounts = NewProjectsServiceAccountsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + ServiceAccounts *ProjectsServiceAccountsService +} + +func NewProjectsServiceAccountsService(s *Service) *ProjectsServiceAccountsService { + rs := &ProjectsServiceAccountsService{s: s} + return rs +} + +type ProjectsServiceAccountsService struct { + s *Service +} + +type GenerateAccessTokenRequest struct { + // Delegates: The sequence of service accounts in a delegation chain. + // Each service account must be granted the + // `roles/iam.serviceAccountTokenCreator` role on its next service + // account in the chain. The last service account in the chain must be + // granted the `roles/iam.serviceAccountTokenCreator` role on the + // service account that is specified in the `name` field of the request. + // The delegates must have the following format: + // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` + // wildcard character is required; replacing it with a project ID is + // invalid. + Delegates []string `json:"delegates,omitempty"` + + // Lifetime: The desired lifetime duration of the access token in + // seconds. By default, the maximum allowed value is 1 hour. To set a + // lifetime of up to 12 hours, you can add the service account as an + // allowed value in an Organization Policy that enforces the + // `constraints/iam.allowServiceAccountCredentialLifetimeExtension` + // constraint. See detailed instructions at + // https://cloud.google.com/iam/help/credentials/lifetime If a value is + // not specified, the token's lifetime will be set to a default value of + // 1 hour. + Lifetime string `json:"lifetime,omitempty"` + + // Scope: Required. Code to identify the scopes to be included in the + // OAuth 2.0 access token. See + // https://developers.google.com/identity/protocols/googlescopes for + // more information. At least one value required. + Scope []string `json:"scope,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Delegates") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Delegates") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GenerateAccessTokenRequest) MarshalJSON() ([]byte, error) { + type NoMethod GenerateAccessTokenRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GenerateAccessTokenResponse struct { + // AccessToken: The OAuth 2.0 access token. + AccessToken string `json:"accessToken,omitempty"` + + // ExpireTime: Token expiration time. The expiration time is always set. + ExpireTime string `json:"expireTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AccessToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GenerateAccessTokenResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateAccessTokenResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GenerateIdTokenRequest struct { + // Audience: Required. The audience for the token, such as the API or + // account that this token grants access to. + Audience string `json:"audience,omitempty"` + + // Delegates: The sequence of service accounts in a delegation chain. + // Each service account must be granted the + // `roles/iam.serviceAccountTokenCreator` role on its next service + // account in the chain. The last service account in the chain must be + // granted the `roles/iam.serviceAccountTokenCreator` role on the + // service account that is specified in the `name` field of the request. + // The delegates must have the following format: + // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` + // wildcard character is required; replacing it with a project ID is + // invalid. + Delegates []string `json:"delegates,omitempty"` + + // IncludeEmail: Include the service account email in the token. If set + // to `true`, the token will contain `email` and `email_verified` + // claims. + IncludeEmail bool `json:"includeEmail,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Audience") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Audience") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GenerateIdTokenRequest) MarshalJSON() ([]byte, error) { + type NoMethod GenerateIdTokenRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GenerateIdTokenResponse struct { + // Token: The OpenId Connect ID token. + Token string `json:"token,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Token") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Token") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GenerateIdTokenResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateIdTokenResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SignBlobRequest struct { + // Delegates: The sequence of service accounts in a delegation chain. + // Each service account must be granted the + // `roles/iam.serviceAccountTokenCreator` role on its next service + // account in the chain. The last service account in the chain must be + // granted the `roles/iam.serviceAccountTokenCreator` role on the + // service account that is specified in the `name` field of the request. + // The delegates must have the following format: + // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` + // wildcard character is required; replacing it with a project ID is + // invalid. + Delegates []string `json:"delegates,omitempty"` + + // Payload: Required. The bytes to sign. + Payload string `json:"payload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Delegates") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Delegates") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SignBlobRequest) MarshalJSON() ([]byte, error) { + type NoMethod SignBlobRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SignBlobResponse struct { + // KeyId: The ID of the key used to sign the blob. The key used for + // signing will remain valid for at least 12 hours after the blob is + // signed. To verify the signature, you can retrieve the public key in + // several formats from the following endpoints: - RSA public key + // wrapped in an X.509 v3 certificate: + // `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT + // _EMAIL}` - Raw key in JSON format: + // `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_ + // EMAIL}` - JSON Web Key (JWK): + // `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_ + // EMAIL}` + KeyId string `json:"keyId,omitempty"` + + // SignedBlob: The signature for the blob. Does not include the original + // blob. After the key pair referenced by the `key_id` response field + // expires, Google no longer exposes the public key that can be used to + // verify the blob. As a result, the receiver can no longer verify the + // signature. + SignedBlob string `json:"signedBlob,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "KeyId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "KeyId") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SignBlobResponse) MarshalJSON() ([]byte, error) { + type NoMethod SignBlobResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SignJwtRequest struct { + // Delegates: The sequence of service accounts in a delegation chain. + // Each service account must be granted the + // `roles/iam.serviceAccountTokenCreator` role on its next service + // account in the chain. The last service account in the chain must be + // granted the `roles/iam.serviceAccountTokenCreator` role on the + // service account that is specified in the `name` field of the request. + // The delegates must have the following format: + // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` + // wildcard character is required; replacing it with a project ID is + // invalid. + Delegates []string `json:"delegates,omitempty"` + + // Payload: Required. The JWT payload to sign. Must be a serialized JSON + // object that contains a JWT Claims Set. For example: `{"sub": + // "user@example.com", "iat": 313435}` If the JWT Claims Set contains an + // expiration time (`exp`) claim, it must be an integer timestamp that + // is not in the past and no more than 12 hours in the future. + Payload string `json:"payload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Delegates") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Delegates") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SignJwtRequest) MarshalJSON() ([]byte, error) { + type NoMethod SignJwtRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type SignJwtResponse struct { + // KeyId: The ID of the key used to sign the JWT. The key used for + // signing will remain valid for at least 12 hours after the JWT is + // signed. To verify the signature, you can retrieve the public key in + // several formats from the following endpoints: - RSA public key + // wrapped in an X.509 v3 certificate: + // `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT + // _EMAIL}` - Raw key in JSON format: + // `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_ + // EMAIL}` - JSON Web Key (JWK): + // `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_ + // EMAIL}` + KeyId string `json:"keyId,omitempty"` + + // SignedJwt: The signed JWT. Contains the automatically generated + // header; the client-supplied payload; and the signature, which is + // generated using the key referenced by the `kid` field in the header. + // After the key pair referenced by the `key_id` response field expires, + // Google no longer exposes the public key that can be used to verify + // the JWT. As a result, the receiver can no longer verify the + // signature. + SignedJwt string `json:"signedJwt,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "KeyId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "KeyId") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SignJwtResponse) MarshalJSON() ([]byte, error) { + type NoMethod SignJwtResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "iamcredentials.projects.serviceAccounts.generateAccessToken": + +type ProjectsServiceAccountsGenerateAccessTokenCall struct { + s *Service + name string + generateaccesstokenrequest *GenerateAccessTokenRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GenerateAccessToken: Generates an OAuth 2.0 access token for a +// service account. +// +// - name: The resource name of the service account for which the +// credentials are requested, in the following format: +// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` +// wildcard character is required; replacing it with a project ID is +// invalid. +func (r *ProjectsServiceAccountsService) GenerateAccessToken(name string, generateaccesstokenrequest *GenerateAccessTokenRequest) *ProjectsServiceAccountsGenerateAccessTokenCall { + c := &ProjectsServiceAccountsGenerateAccessTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.generateaccesstokenrequest = generateaccesstokenrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountsGenerateAccessTokenCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Context(ctx context.Context) *ProjectsServiceAccountsGenerateAccessTokenCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsServiceAccountsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateaccesstokenrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:generateAccessToken") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "iamcredentials.projects.serviceAccounts.generateAccessToken" call. +// Exactly one of *GenerateAccessTokenResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateAccessTokenResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Do(opts ...googleapi.CallOption) (*GenerateAccessTokenResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GenerateAccessTokenResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates an OAuth 2.0 access token for a service account.", + // "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateAccessToken", + // "httpMethod": "POST", + // "id": "iamcredentials.projects.serviceAccounts.generateAccessToken", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + // "location": "path", + // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:generateAccessToken", + // "request": { + // "$ref": "GenerateAccessTokenRequest" + // }, + // "response": { + // "$ref": "GenerateAccessTokenResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "iamcredentials.projects.serviceAccounts.generateIdToken": + +type ProjectsServiceAccountsGenerateIdTokenCall struct { + s *Service + name string + generateidtokenrequest *GenerateIdTokenRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GenerateIdToken: Generates an OpenID Connect ID token for a service +// account. +// +// - name: The resource name of the service account for which the +// credentials are requested, in the following format: +// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` +// wildcard character is required; replacing it with a project ID is +// invalid. +func (r *ProjectsServiceAccountsService) GenerateIdToken(name string, generateidtokenrequest *GenerateIdTokenRequest) *ProjectsServiceAccountsGenerateIdTokenCall { + c := &ProjectsServiceAccountsGenerateIdTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.generateidtokenrequest = generateidtokenrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsServiceAccountsGenerateIdTokenCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountsGenerateIdTokenCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsServiceAccountsGenerateIdTokenCall) Context(ctx context.Context) *ProjectsServiceAccountsGenerateIdTokenCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsServiceAccountsGenerateIdTokenCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsServiceAccountsGenerateIdTokenCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateidtokenrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:generateIdToken") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "iamcredentials.projects.serviceAccounts.generateIdToken" call. +// Exactly one of *GenerateIdTokenResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GenerateIdTokenResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsServiceAccountsGenerateIdTokenCall) Do(opts ...googleapi.CallOption) (*GenerateIdTokenResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GenerateIdTokenResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates an OpenID Connect ID token for a service account.", + // "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateIdToken", + // "httpMethod": "POST", + // "id": "iamcredentials.projects.serviceAccounts.generateIdToken", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + // "location": "path", + // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:generateIdToken", + // "request": { + // "$ref": "GenerateIdTokenRequest" + // }, + // "response": { + // "$ref": "GenerateIdTokenResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "iamcredentials.projects.serviceAccounts.signBlob": + +type ProjectsServiceAccountsSignBlobCall struct { + s *Service + name string + signblobrequest *SignBlobRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SignBlob: Signs a blob using a service account's system-managed +// private key. +// +// - name: The resource name of the service account for which the +// credentials are requested, in the following format: +// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` +// wildcard character is required; replacing it with a project ID is +// invalid. +func (r *ProjectsServiceAccountsService) SignBlob(name string, signblobrequest *SignBlobRequest) *ProjectsServiceAccountsSignBlobCall { + c := &ProjectsServiceAccountsSignBlobCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.signblobrequest = signblobrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsServiceAccountsSignBlobCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountsSignBlobCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsServiceAccountsSignBlobCall) Context(ctx context.Context) *ProjectsServiceAccountsSignBlobCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsServiceAccountsSignBlobCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsServiceAccountsSignBlobCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.signblobrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:signBlob") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "iamcredentials.projects.serviceAccounts.signBlob" call. +// Exactly one of *SignBlobResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SignBlobResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsServiceAccountsSignBlobCall) Do(opts ...googleapi.CallOption) (*SignBlobResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SignBlobResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Signs a blob using a service account's system-managed private key.", + // "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob", + // "httpMethod": "POST", + // "id": "iamcredentials.projects.serviceAccounts.signBlob", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + // "location": "path", + // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:signBlob", + // "request": { + // "$ref": "SignBlobRequest" + // }, + // "response": { + // "$ref": "SignBlobResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "iamcredentials.projects.serviceAccounts.signJwt": + +type ProjectsServiceAccountsSignJwtCall struct { + s *Service + name string + signjwtrequest *SignJwtRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SignJwt: Signs a JWT using a service account's system-managed private +// key. +// +// - name: The resource name of the service account for which the +// credentials are requested, in the following format: +// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` +// wildcard character is required; replacing it with a project ID is +// invalid. +func (r *ProjectsServiceAccountsService) SignJwt(name string, signjwtrequest *SignJwtRequest) *ProjectsServiceAccountsSignJwtCall { + c := &ProjectsServiceAccountsSignJwtCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.signjwtrequest = signjwtrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsServiceAccountsSignJwtCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountsSignJwtCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsServiceAccountsSignJwtCall) Context(ctx context.Context) *ProjectsServiceAccountsSignJwtCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsServiceAccountsSignJwtCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsServiceAccountsSignJwtCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.signjwtrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:signJwt") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "iamcredentials.projects.serviceAccounts.signJwt" call. +// Exactly one of *SignJwtResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SignJwtResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsServiceAccountsSignJwtCall) Do(opts ...googleapi.CallOption) (*SignJwtResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SignJwtResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Signs a JWT using a service account's system-managed private key.", + // "flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt", + // "httpMethod": "POST", + // "id": "iamcredentials.projects.serviceAccounts.signJwt", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.", + // "location": "path", + // "pattern": "^projects/[^/]+/serviceAccounts/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:signJwt", + // "request": { + // "$ref": "SignJwtRequest" + // }, + // "response": { + // "$ref": "SignJwtResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go index 2f4aa4496..23cba981c 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -2485,7 +2485,7 @@ func (c *BucketAccessControlsDeleteCall) Header() http.Header { func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2638,7 +2638,7 @@ func (c *BucketAccessControlsGetCall) Header() http.Header { func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2807,7 +2807,7 @@ func (c *BucketAccessControlsInsertCall) Header() http.Header { func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2982,7 +2982,7 @@ func (c *BucketAccessControlsListCall) Header() http.Header { func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3148,7 +3148,7 @@ func (c *BucketAccessControlsPatchCall) Header() http.Header { func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3327,7 +3327,7 @@ func (c *BucketAccessControlsUpdateCall) Header() http.Header { func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3515,7 +3515,7 @@ func (c *BucketsDeleteCall) Header() http.Header { func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3696,7 +3696,7 @@ func (c *BucketsGetCall) Header() http.Header { func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3904,7 +3904,7 @@ func (c *BucketsGetIamPolicyCall) Header() http.Header { func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4123,7 +4123,7 @@ func (c *BucketsInsertCall) Header() http.Header { func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4382,7 +4382,7 @@ func (c *BucketsListCall) Header() http.Header { func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4596,7 +4596,7 @@ func (c *BucketsLockRetentionPolicyCall) Header() http.Header { func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4833,7 +4833,7 @@ func (c *BucketsPatchCall) Header() http.Header { func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5064,7 +5064,7 @@ func (c *BucketsSetIamPolicyCall) Header() http.Header { func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5242,7 +5242,7 @@ func (c *BucketsTestIamPermissionsCall) Header() http.Header { func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5484,7 +5484,7 @@ func (c *BucketsUpdateCall) Header() http.Header { func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5696,7 +5696,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5818,7 +5818,7 @@ func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5971,7 +5971,7 @@ func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6141,7 +6141,7 @@ func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6333,7 +6333,7 @@ func (c *DefaultObjectAccessControlsListCall) Header() http.Header { func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6511,7 +6511,7 @@ func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6690,7 +6690,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6865,7 +6865,7 @@ func (c *NotificationsDeleteCall) Header() http.Header { func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7016,7 +7016,7 @@ func (c *NotificationsGetCall) Header() http.Header { func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7188,7 +7188,7 @@ func (c *NotificationsInsertCall) Header() http.Header { func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7365,7 +7365,7 @@ func (c *NotificationsListCall) Header() http.Header { func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7545,7 +7545,7 @@ func (c *ObjectAccessControlsDeleteCall) Header() http.Header { func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7724,7 +7724,7 @@ func (c *ObjectAccessControlsGetCall) Header() http.Header { func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7919,7 +7919,7 @@ func (c *ObjectAccessControlsInsertCall) Header() http.Header { func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8120,7 +8120,7 @@ func (c *ObjectAccessControlsListCall) Header() http.Header { func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8312,7 +8312,7 @@ func (c *ObjectAccessControlsPatchCall) Header() http.Header { func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8517,7 +8517,7 @@ func (c *ObjectAccessControlsUpdateCall) Header() http.Header { func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8760,7 +8760,7 @@ func (c *ObjectsComposeCall) Header() http.Header { func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9116,7 +9116,7 @@ func (c *ObjectsCopyCall) Header() http.Header { func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9448,7 +9448,7 @@ func (c *ObjectsDeleteCall) Header() http.Header { func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9685,7 +9685,7 @@ func (c *ObjectsGetCall) Header() http.Header { func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9939,7 +9939,7 @@ func (c *ObjectsGetIamPolicyCall) Header() http.Header { func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10259,7 +10259,7 @@ func (c *ObjectsInsertCall) Header() http.Header { func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10634,7 +10634,7 @@ func (c *ObjectsListCall) Header() http.Header { func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10955,7 +10955,7 @@ func (c *ObjectsPatchCall) Header() http.Header { func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11360,7 +11360,7 @@ func (c *ObjectsRewriteCall) Header() http.Header { func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11667,7 +11667,7 @@ func (c *ObjectsSetIamPolicyCall) Header() http.Header { func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11872,7 +11872,7 @@ func (c *ObjectsTestIamPermissionsCall) Header() http.Header { func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12137,7 +12137,7 @@ func (c *ObjectsUpdateCall) Header() http.Header { func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12457,7 +12457,7 @@ func (c *ObjectsWatchAllCall) Header() http.Header { func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12676,7 +12676,7 @@ func (c *ProjectsHmacKeysCreateCall) Header() http.Header { func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12829,7 +12829,7 @@ func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12968,7 +12968,7 @@ func (c *ProjectsHmacKeysGetCall) Header() http.Header { func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -13170,7 +13170,7 @@ func (c *ProjectsHmacKeysListCall) Header() http.Header { func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -13369,7 +13369,7 @@ func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } @@ -13548,7 +13548,7 @@ func (c *ProjectsServiceAccountGetCall) Header() http.Header { func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210927") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210930") for k, v := range c.header_ { reqHeaders[k] = v } diff --git a/vendor/google.golang.org/api/transport/dial.go b/vendor/google.golang.org/api/transport/dial.go new file mode 100644 index 000000000..2c495ad53 --- /dev/null +++ b/vendor/google.golang.org/api/transport/dial.go @@ -0,0 +1,36 @@ +// Copyright 2015 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package transport + +import ( + "context" + "net/http" + + "google.golang.org/grpc" + + "google.golang.org/api/option" + gtransport "google.golang.org/api/transport/grpc" + htransport "google.golang.org/api/transport/http" +) + +// NewHTTPClient returns an HTTP client for use communicating with a Google cloud +// service, configured with the given ClientOptions. It also returns the endpoint +// for the service as specified in the options. +func NewHTTPClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, string, error) { + return htransport.NewClient(ctx, opts...) +} + +// DialGRPC returns a GRPC connection for use communicating with a Google cloud +// service, configured with the given ClientOptions. +func DialGRPC(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) { + return gtransport.Dial(ctx, opts...) +} + +// DialGRPCInsecure returns an insecure GRPC connection for use communicating +// with fake or mock Google cloud service implementations, such as emulators. +// The connection is configured with the given ClientOptions. +func DialGRPCInsecure(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) { + return gtransport.DialInsecure(ctx, opts...) +} diff --git a/vendor/google.golang.org/api/transport/doc.go b/vendor/google.golang.org/api/transport/doc.go new file mode 100644 index 000000000..7143abee4 --- /dev/null +++ b/vendor/google.golang.org/api/transport/doc.go @@ -0,0 +1,11 @@ +// Copyright 2019 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package transport provides utility methods for creating authenticated +// transports to Google's HTTP and gRPC APIs. It is intended to be used in +// conjunction with google.golang.org/api/option. +// +// This package is not intended for use by end developers. Use the +// google.golang.org/api/option package to configure API clients. +package transport diff --git a/vendor/google.golang.org/api/transport/go19.go b/vendor/google.golang.org/api/transport/go19.go new file mode 100644 index 000000000..d40bcf332 --- /dev/null +++ b/vendor/google.golang.org/api/transport/go19.go @@ -0,0 +1,26 @@ +// Copyright 2018 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.9 +// +build go1.9 + +package transport + +import ( + "context" + + "golang.org/x/oauth2/google" + "google.golang.org/api/internal" + "google.golang.org/api/option" +) + +// Creds constructs a google.Credentials from the information in the options, +// or obtains the default credentials in the same way as google.FindDefaultCredentials. +func Creds(ctx context.Context, opts ...option.ClientOption) (*google.Credentials, error) { + var ds internal.DialSettings + for _, opt := range opts { + opt.Apply(&ds) + } + return internal.Creds(ctx, &ds) +} diff --git a/vendor/google.golang.org/api/transport/not_go19.go b/vendor/google.golang.org/api/transport/not_go19.go new file mode 100644 index 000000000..bb5667a51 --- /dev/null +++ b/vendor/google.golang.org/api/transport/not_go19.go @@ -0,0 +1,26 @@ +// Copyright 2018 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.9 +// +build !go1.9 + +package transport + +import ( + "context" + + "golang.org/x/oauth2/google" + "google.golang.org/api/internal" + "google.golang.org/api/option" +) + +// Creds constructs a google.DefaultCredentials from the information in the options, +// or obtains the default credentials in the same way as google.FindDefaultCredentials. +func Creds(ctx context.Context, opts ...option.ClientOption) (*google.DefaultCredentials, error) { + var ds internal.DialSettings + for _, opt := range opts { + opt.Apply(&ds) + } + return internal.Creds(ctx, &ds) +} diff --git a/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go b/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go index 468d46696..dd45cf6e6 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go @@ -37,7 +37,7 @@ const ( ) // Specifies the routing information that should be sent along with the request -// in the form of routing headers. +// in the form of routing header. // **NOTE:** All service configuration rules follow the "last one wins" order. // // The examples below will apply to an RPC which has the following request type: @@ -66,7 +66,12 @@ const ( // app_profile_id: profiles/prof_qux // } // -// ## Example 1 +// The routing header consists of one or multiple key-value pairs. Every key +// and value must be percent-encoded, and joined together in the format of +// `key1=value1&key2=value2`. +// In the examples below I am skipping the percent-encoding for readablity. +// +// Example 1 // // Extracting a field from the request to put into the routing header // unchanged, with the key equal to the field name. @@ -84,7 +89,7 @@ const ( // // x-goog-request-params: app_profile_id=profiles/prof_qux // -// ## Example 2 +// Example 2 // // Extracting a field from the request to put into the routing header // unchanged, with the key different from the field name. @@ -103,7 +108,7 @@ const ( // // x-goog-request-params: routing_id=profiles/prof_qux // -// ## Example 3 +// Example 3 // // Extracting a field from the request to put into the routing // header, while matching a path template syntax on the field's value. @@ -111,7 +116,7 @@ const ( // NB: it is more useful to send nothing than to send garbage for the purpose // of dynamic routing, since garbage pollutes cache. Thus the matching. // -// ### Sub-example 3a +// Sub-example 3a // // The field matches the template. // @@ -131,7 +136,7 @@ const ( // x-goog-request-params: // table_name=projects/proj_foo/instances/instance_bar/table/table_baz // -// ### Sub-example 3b +// Sub-example 3b // // The field does not match the template. // @@ -150,7 +155,7 @@ const ( // // // -// ### Sub-example 3c +// Sub-example 3c // // Multiple alternative conflictingly named path templates are // specified. The one that matches is used to construct the header. @@ -176,7 +181,7 @@ const ( // x-goog-request-params: // table_name=projects/proj_foo/instances/instance_bar/table/table_baz // -// ## Example 4 +// Example 4 // // Extracting a single routing header key-value pair by matching a // template syntax on (a part of) a single request field. @@ -195,7 +200,7 @@ const ( // // x-goog-request-params: routing_id=projects/proj_foo // -// ## Example 5 +// Example 5 // // Extracting a single routing header key-value pair by matching // several conflictingly named path templates on (parts of) a single request @@ -223,12 +228,12 @@ const ( // x-goog-request-params: // routing_id=projects/proj_foo/instances/instance_bar // -// ## Example 6 +// Example 6 // // Extracting multiple routing header key-value pairs by matching // several non-conflicting path templates on (parts of) a single request field. // -// ### Sub-example 6a +// Sub-example 6a // // Make the templates strict, so that if the `table_name` does not // have an instance information, nothing is sent. @@ -253,12 +258,12 @@ const ( // result: // // x-goog-request-params: -// project_id=projects/proj_foo,instance_id=instances/instance_bar +// project_id=projects/proj_foo&instance_id=instances/instance_bar // -// ### Sub-example 6b +// Sub-example 6b // // Make the templates loose, so that if the `table_name` does not -// have an instance information, the project id part is sent. +// have an instance information, just the project id part is sent. // // annotation: // @@ -281,9 +286,9 @@ const ( // information): // // x-goog-request-params: -// project_id=projects/proj_foo,instance_id=instances/instance_bar +// project_id=projects/proj_foo&instance_id=instances/instance_bar // -// ## Example 7 +// Example 7 // // Extracting multiple routing header key-value pairs by matching // several path templates on multiple request fields. @@ -313,9 +318,9 @@ const ( // result: // // x-goog-request-params: -// project_id=projects/proj_foo,routing_id=profiles/prof_qux +// project_id=projects/proj_foo&routing_id=profiles/prof_qux // -// ## Example 8 +// Example 8 // // Extracting a single routing header key-value pair by matching // several conflictingly named path templates on several request fields. The @@ -346,7 +351,7 @@ const ( // // x-goog-request-params: routing_id=profiles/prof_qux // -// ## Example 9 +// Example 9 // // Bringing it all together. // @@ -389,20 +394,23 @@ const ( // result: // // x-goog-request-params: -// table_location=instances/instance_bar,routing_id=prof_qux -type Routing struct { +// table_location=instances/instance_bar&routing_id=prof_qux +type RoutingRule struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A collection of Routing Parameter specifications. - // **NOTE:** If multiple parameters have the same name, "last one wins" rule - // is used to determine which one gets sent. - RoutingParameters []*RoutingParameter `protobuf:"bytes,1,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"` + // **NOTE:** If multiple Routing Parameters describe the same key + // (via the `path_template` field or via the `field` field when + // `path_template` is not provided), "last one wins" rule + // determines which Parameter gets used. + // See the examples for more details. + RoutingParameters []*RoutingParameter `protobuf:"bytes,2,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"` } -func (x *Routing) Reset() { - *x = Routing{} +func (x *RoutingRule) Reset() { + *x = RoutingRule{} if protoimpl.UnsafeEnabled { mi := &file_google_api_routing_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -410,13 +418,13 @@ func (x *Routing) Reset() { } } -func (x *Routing) String() string { +func (x *RoutingRule) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Routing) ProtoMessage() {} +func (*RoutingRule) ProtoMessage() {} -func (x *Routing) ProtoReflect() protoreflect.Message { +func (x *RoutingRule) ProtoReflect() protoreflect.Message { mi := &file_google_api_routing_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -428,12 +436,12 @@ func (x *Routing) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Routing.ProtoReflect.Descriptor instead. -func (*Routing) Descriptor() ([]byte, []int) { +// Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. +func (*RoutingRule) Descriptor() ([]byte, []int) { return file_google_api_routing_proto_rawDescGZIP(), []int{0} } -func (x *Routing) GetRoutingParameters() []*RoutingParameter { +func (x *RoutingRule) GetRoutingParameters() []*RoutingParameter { if x != nil { return x.RoutingParameters } @@ -484,6 +492,24 @@ type RoutingParameter struct { // - The value is extracted from the request message's `table_name` field // if it matches the full pattern specified: // `projects/*/instances/*/tables/*`. + // + // **NB:** If the `path_template` field is not provided, the key name is + // equal to the field name, and the whole field should be sent as a value. + // This makes the pattern for the field and the value functionally equivalent + // to `**`, and the configuration + // + // { + // field: "table_name" + // } + // + // is a functionally equivalent shorthand to: + // + // { + // field: "table_name" + // path_template: "{table_name=**}" + // } + // + // See Example 1 for more details. PathTemplate string `protobuf:"bytes,2,opt,name=path_template,json=pathTemplate,proto3" json:"path_template,omitempty"` } @@ -536,7 +562,7 @@ func (x *RoutingParameter) GetPathTemplate() string { var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*Routing)(nil), + ExtensionType: (*RoutingRule)(nil), Field: 72295729, Name: "google.api.routing", Tag: "bytes,72295729,opt,name=routing", @@ -546,7 +572,9 @@ var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{ // Extension fields to descriptorpb.MethodOptions. var ( - // optional google.api.Routing routing = 72295729; + // See RoutingRule. + // + // optional google.api.RoutingRule routing = 72295729; E_Routing = &file_google_api_routing_proto_extTypes[0] ) @@ -557,30 +585,30 @@ var file_google_api_routing_proto_rawDesc = []byte{ 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x07, 0x52, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x11, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, - 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x3a, - 0x50, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, 0xca, 0xbc, 0x22, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, - 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x52, 0x6f, 0x75, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69, + 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x52, 0x11, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x3a, 0x54, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, + 0xca, 0xbc, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, + 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, + 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, + 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -597,14 +625,14 @@ func file_google_api_routing_proto_rawDescGZIP() []byte { var file_google_api_routing_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_routing_proto_goTypes = []interface{}{ - (*Routing)(nil), // 0: google.api.Routing + (*RoutingRule)(nil), // 0: google.api.RoutingRule (*RoutingParameter)(nil), // 1: google.api.RoutingParameter (*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions } var file_google_api_routing_proto_depIdxs = []int32{ - 1, // 0: google.api.Routing.routing_parameters:type_name -> google.api.RoutingParameter + 1, // 0: google.api.RoutingRule.routing_parameters:type_name -> google.api.RoutingParameter 2, // 1: google.api.routing:extendee -> google.protobuf.MethodOptions - 0, // 2: google.api.routing:type_name -> google.api.Routing + 0, // 2: google.api.routing:type_name -> google.api.RoutingRule 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 2, // [2:3] is the sub-list for extension type_name @@ -619,7 +647,7 @@ func file_google_api_routing_proto_init() { } if !protoimpl.UnsafeEnabled { file_google_api_routing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Routing); i { + switch v := v.(*RoutingRule); i { case 0: return &v.state case 1: diff --git a/vendor/google.golang.org/genproto/googleapis/storage/v2/storage.pb.go b/vendor/google.golang.org/genproto/googleapis/storage/v2/storage.pb.go index 13008e3f8..6452d377d 100644 --- a/vendor/google.golang.org/genproto/googleapis/storage/v2/storage.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/storage/v2/storage.pb.go @@ -257,14 +257,15 @@ func (ServiceConstants_Values) EnumDescriptor() ([]byte, []int) { type Bucket_IamConfig_PublicAccessPrevention int32 const ( - // Does not prevent access from being granted to public members 'allUsers' - // or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy - // at the project/folder/organization level. + // No specified PublicAccessPrevention. Bucket_IamConfig_PUBLIC_ACCESS_PREVENTION_UNSPECIFIED Bucket_IamConfig_PublicAccessPrevention = 0 // Prevents access from being granted to public members 'allUsers' and // 'allAuthenticatedUsers'. Prevents attempts to grant new access to // public members. Bucket_IamConfig_ENFORCED Bucket_IamConfig_PublicAccessPrevention = 1 + // This setting is inherited from Org Policy. Does not prevent access from + // being granted to public members 'allUsers' or 'allAuthenticatedUsers'. + Bucket_IamConfig_INHERITED Bucket_IamConfig_PublicAccessPrevention = 2 ) // Enum value maps for Bucket_IamConfig_PublicAccessPrevention. @@ -272,10 +273,12 @@ var ( Bucket_IamConfig_PublicAccessPrevention_name = map[int32]string{ 0: "PUBLIC_ACCESS_PREVENTION_UNSPECIFIED", 1: "ENFORCED", + 2: "INHERITED", } Bucket_IamConfig_PublicAccessPrevention_value = map[string]int32{ "PUBLIC_ACCESS_PREVENTION_UNSPECIFIED": 0, "ENFORCED": 1, + "INHERITED": 2, } ) @@ -682,7 +685,7 @@ type WriteObjectRequest struct { // // In the first `WriteObjectRequest` of a `WriteObject()` action, it // indicates the initial offset for the `Write()` call. The value **must** be - // equal to the `committed_size` that a call to `QueryWriteStatus()` would + // equal to the `persisted_size` that a call to `QueryWriteStatus()` would // return (0 if this is the first write to the object). // // On subsequent calls, this value **must** be no larger than the sum of the @@ -857,7 +860,7 @@ type WriteObjectResponse struct { // The response will set one of the following. // // Types that are assignable to WriteStatus: - // *WriteObjectResponse_CommittedSize + // *WriteObjectResponse_PersistedSize // *WriteObjectResponse_Resource WriteStatus isWriteObjectResponse_WriteStatus `protobuf_oneof:"write_status"` } @@ -901,9 +904,9 @@ func (m *WriteObjectResponse) GetWriteStatus() isWriteObjectResponse_WriteStatus return nil } -func (x *WriteObjectResponse) GetCommittedSize() int64 { - if x, ok := x.GetWriteStatus().(*WriteObjectResponse_CommittedSize); ok { - return x.CommittedSize +func (x *WriteObjectResponse) GetPersistedSize() int64 { + if x, ok := x.GetWriteStatus().(*WriteObjectResponse_PersistedSize); ok { + return x.PersistedSize } return 0 } @@ -919,10 +922,10 @@ type isWriteObjectResponse_WriteStatus interface { isWriteObjectResponse_WriteStatus() } -type WriteObjectResponse_CommittedSize struct { +type WriteObjectResponse_PersistedSize struct { // The total number of bytes that have been processed for the given object // from all `WriteObject` calls. Only set if the upload has not finalized. - CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3,oneof"` + PersistedSize int64 `protobuf:"varint,1,opt,name=persisted_size,json=persistedSize,proto3,oneof"` } type WriteObjectResponse_Resource struct { @@ -931,7 +934,7 @@ type WriteObjectResponse_Resource struct { Resource *Object `protobuf:"bytes,2,opt,name=resource,proto3,oneof"` } -func (*WriteObjectResponse_CommittedSize) isWriteObjectResponse_WriteStatus() {} +func (*WriteObjectResponse_PersistedSize) isWriteObjectResponse_WriteStatus() {} func (*WriteObjectResponse_Resource) isWriteObjectResponse_WriteStatus() {} @@ -1012,7 +1015,7 @@ type QueryWriteStatusResponse struct { // The response will set one of the following. // // Types that are assignable to WriteStatus: - // *QueryWriteStatusResponse_CommittedSize + // *QueryWriteStatusResponse_PersistedSize // *QueryWriteStatusResponse_Resource WriteStatus isQueryWriteStatusResponse_WriteStatus `protobuf_oneof:"write_status"` } @@ -1056,9 +1059,9 @@ func (m *QueryWriteStatusResponse) GetWriteStatus() isQueryWriteStatusResponse_W return nil } -func (x *QueryWriteStatusResponse) GetCommittedSize() int64 { - if x, ok := x.GetWriteStatus().(*QueryWriteStatusResponse_CommittedSize); ok { - return x.CommittedSize +func (x *QueryWriteStatusResponse) GetPersistedSize() int64 { + if x, ok := x.GetWriteStatus().(*QueryWriteStatusResponse_PersistedSize); ok { + return x.PersistedSize } return 0 } @@ -1074,12 +1077,12 @@ type isQueryWriteStatusResponse_WriteStatus interface { isQueryWriteStatusResponse_WriteStatus() } -type QueryWriteStatusResponse_CommittedSize struct { +type QueryWriteStatusResponse_PersistedSize struct { // The total number of bytes that have been processed for the given object // from all `WriteObject` calls. This is the correct value for the // 'write_offset' field to use when resuming the `WriteObject` operation. // Only set if the upload has not finalized. - CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3,oneof"` + PersistedSize int64 `protobuf:"varint,1,opt,name=persisted_size,json=persistedSize,proto3,oneof"` } type QueryWriteStatusResponse_Resource struct { @@ -1088,7 +1091,7 @@ type QueryWriteStatusResponse_Resource struct { Resource *Object `protobuf:"bytes,2,opt,name=resource,proto3,oneof"` } -func (*QueryWriteStatusResponse_CommittedSize) isQueryWriteStatusResponse_WriteStatus() {} +func (*QueryWriteStatusResponse_PersistedSize) isQueryWriteStatusResponse_WriteStatus() {} func (*QueryWriteStatusResponse_Resource) isQueryWriteStatusResponse_WriteStatus() {} @@ -1480,6 +1483,8 @@ type Bucket struct { // but won't be able to use zonal quota. The values are case-insensitive. // Attempting to update this field after bucket is created will result in an // error. + // + // Deprecated: Do not use. ZoneAffinity []string `protobuf:"bytes,24,rep,name=zone_affinity,json=zoneAffinity,proto3" json:"zone_affinity,omitempty"` // Reserved for future use. SatisfiesPzs bool `protobuf:"varint,25,opt,name=satisfies_pzs,json=satisfiesPzs,proto3" json:"satisfies_pzs,omitempty"` @@ -1678,6 +1683,7 @@ func (x *Bucket) GetIamConfig() *Bucket_IamConfig { return nil } +// Deprecated: Do not use. func (x *Bucket) GetZoneAffinity() []string { if x != nil { return x.ZoneAffinity @@ -3449,7 +3455,8 @@ type Object_CustomerEncryption struct { // The encryption algorithm. EncryptionAlgorithm string `protobuf:"bytes,1,opt,name=encryption_algorithm,json=encryptionAlgorithm,proto3" json:"encryption_algorithm,omitempty"` // SHA256 hash value of the encryption key. - KeySha256 string `protobuf:"bytes,2,opt,name=key_sha256,json=keySha256,proto3" json:"key_sha256,omitempty"` + // In raw bytes format (not base64-encoded). + KeySha256Bytes []byte `protobuf:"bytes,3,opt,name=key_sha256_bytes,json=keySha256Bytes,proto3" json:"key_sha256_bytes,omitempty"` } func (x *Object_CustomerEncryption) Reset() { @@ -3491,11 +3498,11 @@ func (x *Object_CustomerEncryption) GetEncryptionAlgorithm() string { return "" } -func (x *Object_CustomerEncryption) GetKeySha256() string { +func (x *Object_CustomerEncryption) GetKeySha256Bytes() []byte { if x != nil { - return x.KeySha256 + return x.KeySha256Bytes } - return "" + return nil } var File_google_storage_v2_storage_proto protoreflect.FileDescriptor @@ -3660,9 +3667,9 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x53, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, @@ -3686,9 +3693,9 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, + 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, @@ -3780,7 +3787,7 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x50, 0x4c, 0x49, 0x54, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, 0x41, 0x59, - 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0xfb, 0x1b, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b, + 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0x8c, 0x1c, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, @@ -3864,381 +3871,383 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x09, 0x69, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, + 0x66, 0x69, 0x67, 0x52, 0x09, 0x69, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x0d, 0x7a, 0x6f, 0x6e, 0x65, 0x5f, 0x61, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x18, - 0x18, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x0c, 0x7a, 0x6f, 0x6e, 0x65, - 0x41, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, 0x74, 0x69, - 0x73, 0x66, 0x69, 0x65, 0x73, 0x5f, 0x70, 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x1a, 0x30, 0x0a, - 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, 0x73, 0x1a, - 0x87, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, - 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x41, - 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0x5c, 0x0a, 0x0a, 0x45, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x1a, 0xbf, 0x03, 0x0a, 0x09, 0x49, 0x61, 0x6d, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x7b, 0x0a, 0x1b, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, - 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x18, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, - 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x12, 0x74, 0x0a, 0x18, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6d, 0x0a, 0x18, 0x55, 0x6e, 0x69, 0x66, + 0x18, 0x20, 0x03, 0x28, 0x09, 0x42, 0x05, 0x18, 0x01, 0xe0, 0x41, 0x05, 0x52, 0x0c, 0x7a, 0x6f, + 0x6e, 0x65, 0x41, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, + 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x5f, 0x70, 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x1a, + 0x30, 0x0a, 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, + 0x73, 0x1a, 0x87, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, + 0x78, 0x41, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0x5c, 0x0a, 0x0a, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x0f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, + 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x1a, 0xce, 0x03, 0x0a, 0x09, 0x49, 0x61, + 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x7b, 0x0a, 0x1b, 0x75, 0x6e, 0x69, 0x66, 0x6f, + 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x18, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x37, - 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x74, 0x0a, 0x18, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6d, 0x0a, 0x18, 0x55, 0x6e, + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x16, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x41, 0x43, + 0x43, 0x45, 0x53, 0x53, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x45, 0x4e, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x49, + 0x4e, 0x48, 0x45, 0x52, 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x8d, 0x07, 0x0a, 0x09, 0x4c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, + 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0xc1, 0x06, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x47, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x41, 0x0a, 0x06, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0xda, 0x04, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x08, 0x61, + 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, + 0x07, 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x0e, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, + 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, + 0x02, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x4e, 0x65, 0x77, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, + 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, + 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, + 0x61, 0x74, 0x65, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x42, + 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, + 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x04, 0x52, 0x17, 0x64, 0x61, 0x79, + 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x42, 0x0a, 0x0a, + 0x08, 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, 0x75, + 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, + 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x54, 0x0a, 0x07, 0x4c, 0x6f, + 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x6f, 0x67, 0x5f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x6c, 0x6f, 0x67, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x1a, 0x9c, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x1a, + 0x26, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x59, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, + 0x69, 0x6e, 0x50, 0x61, 0x67, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x24, 0x0a, 0x0e, + 0x6e, 0x6f, 0x74, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x61, + 0x67, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x47, 0xea, + 0x41, 0x44, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x23, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x7d, 0x22, 0xdf, 0x01, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x53, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, + 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x54, 0x0a, + 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, + 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, + 0x08, 0x6d, 0x64, 0x35, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x6d, 0x64, 0x35, 0x48, 0x61, 0x73, 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x22, 0xd2, 0x0c, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, + 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, + 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, + 0x67, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x73, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x38, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x03, 0x61, 0x63, + 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0b, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x16, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x41, 0x43, 0x43, 0x45, - 0x53, 0x53, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, - 0x4e, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x8d, 0x07, 0x0a, 0x09, 0x4c, 0x69, - 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0xc1, 0x06, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x47, - 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, - 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, - 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x41, 0x0a, 0x06, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0xda, 0x04, 0x0a, - 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x67, - 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, - 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x0e, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x65, - 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x88, - 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, - 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x4e, 0x65, 0x77, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, - 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, 0x79, - 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, 0x79, - 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, - 0x74, 0x65, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x65, - 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, - 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x04, 0x52, 0x17, 0x64, 0x61, 0x79, 0x73, - 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x42, - 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, 0x75, 0x6d, - 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, - 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x64, - 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x54, 0x0a, 0x07, 0x4c, 0x6f, 0x67, - 0x67, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x6f, 0x67, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x6c, 0x6f, 0x67, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x1a, - 0x9c, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x1a, 0x26, - 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x59, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, - 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x69, - 0x6e, 0x50, 0x61, 0x67, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x24, 0x0a, 0x0e, 0x6e, - 0x6f, 0x74, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x61, 0x67, - 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x47, 0xea, 0x41, - 0x44, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x23, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x7d, 0x22, 0xdf, 0x01, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x53, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, - 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x54, 0x0a, 0x0f, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, - 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x48, - 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x08, - 0x6d, 0x64, 0x35, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x6d, 0x64, 0x35, 0x48, 0x61, 0x73, 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, - 0x32, 0x63, 0x22, 0xc7, 0x0c, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x0a, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x38, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x03, 0x61, 0x63, 0x6c, - 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, - 0x75, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, - 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x45, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x6b, 0x6d, 0x73, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, - 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x45, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x16, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x4e, 0x0a, - 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x43, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, - 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x88, 0x01, - 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x5d, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x19, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, - 0x6d, 0x65, 0x1a, 0x66, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, - 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xdf, 0x01, 0x0a, - 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, - 0x6d, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x48, - 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, - 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x3c, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, - 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, - 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2a, 0xff, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x65, 0x64, - 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, - 0x25, 0x0a, 0x21, 0x50, 0x52, 0x45, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x5f, 0x4f, 0x42, - 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, - 0x45, 0x44, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x28, 0x0a, 0x24, 0x4f, 0x42, 0x4a, - 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4f, - 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x4f, - 0x4c, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, - 0x4c, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x52, - 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x41, 0x43, 0x4c, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, - 0x1a, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x4a, - 0x45, 0x43, 0x54, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x05, 0x12, 0x1a, 0x0a, - 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x50, 0x55, 0x42, 0x4c, - 0x49, 0x43, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x06, 0x32, 0x93, 0x06, 0x0a, 0x07, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2b, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x30, 0x01, - 0x12, 0x60, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x12, 0x76, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, - 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x10, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x6b, 0x6d, + 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, + 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6f, + 0x72, 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x4e, + 0x0a, 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x43, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, 0x73, + 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x88, + 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x18, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x5d, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x19, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, + 0x69, 0x6d, 0x65, 0x1a, 0x71, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x28, 0x0a, 0x10, + 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, + 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, + 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xdf, 0x01, 0x0a, 0x13, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x0b, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x48, 0x0a, 0x0b, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x65, 0x61, 0x6d, 0x22, 0x3c, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, + 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x2a, 0xff, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x25, 0x0a, 0x21, 0x50, + 0x52, 0x45, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, + 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, + 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x52, + 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x28, 0x0a, 0x24, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, + 0x41, 0x43, 0x4c, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, + 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x10, 0x02, 0x12, + 0x20, 0x0a, 0x1c, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x42, 0x55, + 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, + 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, + 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, + 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x5f, 0x41, 0x43, 0x4c, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x52, + 0x45, 0x41, 0x44, 0x10, 0x06, 0x32, 0x93, 0x06, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0xda, + 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, + 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x30, 0x01, 0x12, 0x60, 0x0a, 0x0b, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x76, + 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0c, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x69, 0x64, 0x1a, 0xa7, 0x02, 0xca, 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0xd2, 0x41, 0x8a, 0x02, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, - 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, - 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, - 0xdc, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, - 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, - 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x0c, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, + 0x64, 0x1a, 0xa7, 0x02, 0xca, 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, + 0x02, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x72, + 0x65, 0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, + 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, + 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xdc, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, + 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0xea, + 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, + 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, + 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -4810,11 +4819,11 @@ func file_google_storage_v2_storage_proto_init() { (*WriteObjectRequest_ChecksummedData)(nil), } file_google_storage_v2_storage_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*WriteObjectResponse_CommittedSize)(nil), + (*WriteObjectResponse_PersistedSize)(nil), (*WriteObjectResponse_Resource)(nil), } file_google_storage_v2_storage_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*QueryWriteStatusResponse_CommittedSize)(nil), + (*QueryWriteStatusResponse_PersistedSize)(nil), (*QueryWriteStatusResponse_Resource)(nil), } file_google_storage_v2_storage_proto_msgTypes[14].OneofWrappers = []interface{}{} @@ -4871,7 +4880,7 @@ type StorageClient interface { // each following call to `Create`. If there is an error or the connection is // broken during the resumable `Create()`, the client should check the status // of the `Create()` by calling `QueryWriteStatus()` and continue writing from - // the returned `committed_size`. This may be less than the amount of data the + // the returned `persisted_size`. This may be less than the amount of data the // client previously sent. // // The service will not view the object as complete until the client has @@ -4885,7 +4894,7 @@ type StorageClient interface { // what happens when the write operation becomes invalid, are // service-dependent. StartResumableWrite(ctx context.Context, in *StartResumableWriteRequest, opts ...grpc.CallOption) (*StartResumableWriteResponse, error) - // Determines the `committed_size` for an object that is being written, which + // Determines the `persisted_size` for an object that is being written, which // can then be used as the `write_offset` for the next `Write()` call. // // If the object does not exist (i.e., the object has been deleted, or the @@ -4896,7 +4905,7 @@ type StorageClient interface { // much data has been processed for this object. This is useful if the // client is buffering data and needs to know which data can be safely // evicted. For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `committed_size` values will be + // object name, the sequence of returned `persisted_size` values will be // non-decreasing. QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) } @@ -5012,7 +5021,7 @@ type StorageServer interface { // each following call to `Create`. If there is an error or the connection is // broken during the resumable `Create()`, the client should check the status // of the `Create()` by calling `QueryWriteStatus()` and continue writing from - // the returned `committed_size`. This may be less than the amount of data the + // the returned `persisted_size`. This may be less than the amount of data the // client previously sent. // // The service will not view the object as complete until the client has @@ -5026,7 +5035,7 @@ type StorageServer interface { // what happens when the write operation becomes invalid, are // service-dependent. StartResumableWrite(context.Context, *StartResumableWriteRequest) (*StartResumableWriteResponse, error) - // Determines the `committed_size` for an object that is being written, which + // Determines the `persisted_size` for an object that is being written, which // can then be used as the `write_offset` for the next `Write()` call. // // If the object does not exist (i.e., the object has been deleted, or the @@ -5037,7 +5046,7 @@ type StorageServer interface { // much data has been processed for this object. This is useful if the // client is buffering data and needs to know which data can be safely // evicted. For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `committed_size` values will be + // object name, the sequence of returned `persisted_size` values will be // non-decreasing. QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2fb82beea..804c70086 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,5 +1,4 @@ # cloud.google.com/go v0.97.0 -## explicit cloud.google.com/go cloud.google.com/go/compute/metadata cloud.google.com/go/iam @@ -7,7 +6,7 @@ cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/storage v1.17.0 +# cloud.google.com/go/storage v1.18.2 ## explicit cloud.google.com/go/storage cloud.google.com/go/storage/internal/apiv2 @@ -22,14 +21,14 @@ github.com/VictoriaMetrics/fasthttp/stackless # github.com/VictoriaMetrics/metrics v1.18.0 ## explicit github.com/VictoriaMetrics/metrics -# github.com/VictoriaMetrics/metricsql v0.26.0 +# github.com/VictoriaMetrics/metricsql v0.27.0 ## explicit github.com/VictoriaMetrics/metricsql github.com/VictoriaMetrics/metricsql/binaryop # github.com/VividCortex/ewma v1.2.0 ## explicit github.com/VividCortex/ewma -# github.com/aws/aws-sdk-go v1.40.58 +# github.com/aws/aws-sdk-go v1.41.8 ## explicit github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/arn @@ -165,7 +164,7 @@ github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal # github.com/prometheus/client_model v0.2.0 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.31.1 +# github.com/prometheus/common v0.32.1 ## explicit github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg @@ -210,7 +209,7 @@ github.com/valyala/fastrand # github.com/valyala/fasttemplate v1.2.1 ## explicit github.com/valyala/fasttemplate -# github.com/valyala/gozstd v1.13.0 +# github.com/valyala/gozstd v1.14.1 ## explicit github.com/valyala/gozstd # github.com/valyala/histogram v1.2.0 @@ -238,7 +237,7 @@ go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate # go.uber.org/atomic v1.9.0 go.uber.org/atomic -# golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d +# golang.org/x/net v0.0.0-20211020060615-d418f374d309 ## explicit golang.org/x/net/context golang.org/x/net/context/ctxhttp @@ -262,7 +261,7 @@ golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sync/errgroup -# golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac +# golang.org/x/sys v0.0.0-20211020174200-9d6173849985 ## explicit golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix @@ -275,10 +274,11 @@ golang.org/x/text/unicode/norm # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors golang.org/x/xerrors/internal -# google.golang.org/api v0.58.0 +# google.golang.org/api v0.59.0 ## explicit google.golang.org/api/googleapi google.golang.org/api/googleapi/transport +google.golang.org/api/iamcredentials/v1 google.golang.org/api/internal google.golang.org/api/internal/gensupport google.golang.org/api/internal/impersonate @@ -287,6 +287,7 @@ google.golang.org/api/iterator google.golang.org/api/option google.golang.org/api/option/internaloption google.golang.org/api/storage/v1 +google.golang.org/api/transport google.golang.org/api/transport/cert google.golang.org/api/transport/grpc google.golang.org/api/transport/http @@ -305,7 +306,7 @@ google.golang.org/appengine/internal/socket google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/socket google.golang.org/appengine/urlfetch -# google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4 +# google.golang.org/genproto v0.0.0-20211021150943-2b146023228c ## explicit google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/iam/v1 @@ -412,4 +413,3 @@ google.golang.org/protobuf/types/known/timestamppb # gopkg.in/yaml.v2 v2.4.0 ## explicit gopkg.in/yaml.v2 -# cloud.google.com/go v0.94.1 => cloud.google.com/go v0.93.3