dd-trace 5.80.0 → 5.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-3rdparty.csv +79 -88
- package/ext/tags.d.ts +1 -0
- package/ext/tags.js +1 -0
- package/index.d.ts +42 -35
- package/loader-hook.mjs +16 -4
- package/package.json +33 -56
- package/packages/datadog-core/src/utils/src/parse-tags.js +1 -1
- package/packages/datadog-esbuild/index.js +44 -26
- package/packages/datadog-esbuild/src/utils.js +14 -2
- package/packages/datadog-instrumentations/index.js +1 -0
- package/packages/datadog-instrumentations/src/aerospike.js +3 -2
- package/packages/datadog-instrumentations/src/ai.js +2 -2
- package/packages/datadog-instrumentations/src/amqp10.js +1 -1
- package/packages/datadog-instrumentations/src/amqplib.js +4 -4
- package/packages/datadog-instrumentations/src/anthropic.js +14 -2
- package/packages/datadog-instrumentations/src/apollo-server-core.js +2 -2
- package/packages/datadog-instrumentations/src/apollo-server.js +1 -1
- package/packages/datadog-instrumentations/src/apollo.js +3 -2
- package/packages/datadog-instrumentations/src/avsc.js +1 -1
- package/packages/datadog-instrumentations/src/aws-sdk.js +6 -2
- package/packages/datadog-instrumentations/src/azure-event-hubs.js +4 -3
- package/packages/datadog-instrumentations/src/azure-functions.js +2 -2
- package/packages/datadog-instrumentations/src/azure-service-bus.js +3 -4
- package/packages/datadog-instrumentations/src/bluebird.js +1 -1
- package/packages/datadog-instrumentations/src/bullmq.js +11 -0
- package/packages/datadog-instrumentations/src/bunyan.js +1 -1
- package/packages/datadog-instrumentations/src/cassandra-driver.js +1 -1
- package/packages/datadog-instrumentations/src/child_process.js +2 -2
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +3 -3
- package/packages/datadog-instrumentations/src/couchbase.js +1 -1
- package/packages/datadog-instrumentations/src/crypto.js +1 -1
- package/packages/datadog-instrumentations/src/cucumber.js +12 -13
- package/packages/datadog-instrumentations/src/cypress.js +1 -1
- package/packages/datadog-instrumentations/src/dns.js +1 -1
- package/packages/datadog-instrumentations/src/elasticsearch.js +1 -1
- package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +1 -1
- package/packages/datadog-instrumentations/src/express.js +1 -1
- package/packages/datadog-instrumentations/src/find-my-way.js +6 -5
- package/packages/datadog-instrumentations/src/fs.js +1 -1
- package/packages/datadog-instrumentations/src/generic-pool.js +1 -1
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +137 -15
- package/packages/datadog-instrumentations/src/google-cloud-vertexai.js +2 -3
- package/packages/datadog-instrumentations/src/google-genai.js +120 -0
- package/packages/datadog-instrumentations/src/graphql.js +21 -1
- package/packages/datadog-instrumentations/src/grpc/client.js +1 -1
- package/packages/datadog-instrumentations/src/grpc/server.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/hook.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +5 -1
- package/packages/datadog-instrumentations/src/helpers/instrument.js +11 -1
- package/packages/datadog-instrumentations/src/helpers/register.js +12 -5
- package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +27 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +152 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/bullmq.json +106 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +6 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langchain.js +237 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/loader.js +9 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +11 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +139 -0
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/shared-utils.js +9 -0
- package/packages/datadog-instrumentations/src/hono.js +55 -10
- package/packages/datadog-instrumentations/src/ioredis.js +1 -1
- package/packages/datadog-instrumentations/src/iovalkey.js +1 -1
- package/packages/datadog-instrumentations/src/jest.js +2 -2
- package/packages/datadog-instrumentations/src/kafkajs.js +3 -3
- package/packages/datadog-instrumentations/src/knex.js +1 -1
- package/packages/datadog-instrumentations/src/langchain.js +3 -109
- package/packages/datadog-instrumentations/src/ldapjs.js +1 -1
- package/packages/datadog-instrumentations/src/light-my-request.js +93 -0
- package/packages/datadog-instrumentations/src/limitd-client.js +1 -1
- package/packages/datadog-instrumentations/src/lodash.js +1 -2
- package/packages/datadog-instrumentations/src/mariadb.js +1 -2
- package/packages/datadog-instrumentations/src/memcached.js +1 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +1 -1
- package/packages/datadog-instrumentations/src/mongodb-core.js +1 -1
- package/packages/datadog-instrumentations/src/mongodb.js +1 -1
- package/packages/datadog-instrumentations/src/mongoose.js +1 -1
- package/packages/datadog-instrumentations/src/mquery.js +1 -1
- package/packages/datadog-instrumentations/src/mysql.js +1 -1
- package/packages/datadog-instrumentations/src/mysql2.js +2 -2
- package/packages/datadog-instrumentations/src/net.js +1 -1
- package/packages/datadog-instrumentations/src/next.js +1 -1
- package/packages/datadog-instrumentations/src/nyc.js +1 -1
- package/packages/datadog-instrumentations/src/openai.js +2 -2
- package/packages/datadog-instrumentations/src/opensearch.js +1 -1
- package/packages/datadog-instrumentations/src/oracledb.js +1 -1
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +1 -1
- package/packages/datadog-instrumentations/src/pg.js +3 -3
- package/packages/datadog-instrumentations/src/pino.js +1 -1
- package/packages/datadog-instrumentations/src/playwright.js +46 -17
- package/packages/datadog-instrumentations/src/prisma.js +52 -37
- package/packages/datadog-instrumentations/src/process.js +1 -1
- package/packages/datadog-instrumentations/src/promise-js.js +1 -1
- package/packages/datadog-instrumentations/src/promise.js +1 -1
- package/packages/datadog-instrumentations/src/protobufjs.js +1 -1
- package/packages/datadog-instrumentations/src/q.js +1 -1
- package/packages/datadog-instrumentations/src/redis.js +1 -1
- package/packages/datadog-instrumentations/src/rhea.js +1 -1
- package/packages/datadog-instrumentations/src/router.js +1 -1
- package/packages/datadog-instrumentations/src/selenium.js +4 -2
- package/packages/datadog-instrumentations/src/sequelize.js +1 -2
- package/packages/datadog-instrumentations/src/sharedb.js +1 -1
- package/packages/datadog-instrumentations/src/tedious.js +1 -1
- package/packages/datadog-instrumentations/src/undici.js +4 -4
- package/packages/datadog-instrumentations/src/url.js +1 -1
- package/packages/datadog-instrumentations/src/vitest.js +1 -1
- package/packages/datadog-instrumentations/src/vm.js +1 -1
- package/packages/datadog-instrumentations/src/when.js +1 -1
- package/packages/datadog-instrumentations/src/winston.js +1 -1
- package/packages/datadog-instrumentations/src/ws.js +38 -19
- package/packages/datadog-plugin-amqp10/src/index.js +1 -1
- package/packages/datadog-plugin-amqplib/src/index.js +1 -1
- package/packages/datadog-plugin-anthropic/src/index.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +4 -4
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +2 -2
- package/packages/datadog-plugin-aws-sdk/src/util.js +3 -3
- package/packages/datadog-plugin-azure-event-hubs/src/index.js +1 -1
- package/packages/datadog-plugin-azure-event-hubs/src/producer.js +19 -5
- package/packages/datadog-plugin-azure-service-bus/src/index.js +1 -1
- package/packages/datadog-plugin-azure-service-bus/src/producer.js +4 -0
- package/packages/datadog-plugin-bullmq/src/consumer.js +60 -0
- package/packages/datadog-plugin-bullmq/src/index.js +18 -0
- package/packages/datadog-plugin-bullmq/src/producer.js +178 -0
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +1 -1
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/index.js +1 -1
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +23 -2
- package/packages/datadog-plugin-cypress/src/plugin.js +2 -2
- package/packages/datadog-plugin-cypress/src/support.js +73 -31
- package/packages/datadog-plugin-express/src/index.js +1 -1
- package/packages/datadog-plugin-fastify/src/index.js +1 -1
- package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +13 -3
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +171 -12
- package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +1 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +160 -13
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +217 -0
- package/packages/datadog-plugin-google-cloud-vertexai/src/index.js +1 -1
- package/packages/datadog-plugin-google-genai/src/index.js +17 -0
- package/packages/datadog-plugin-google-genai/src/tracing.js +41 -0
- package/packages/datadog-plugin-graphql/src/resolve.js +1 -1
- package/packages/datadog-plugin-graphql/src/tools/transforms.js +5 -4
- package/packages/datadog-plugin-grpc/src/index.js +1 -1
- package/packages/datadog-plugin-http/src/client.js +2 -1
- package/packages/datadog-plugin-http/src/index.js +25 -5
- package/packages/datadog-plugin-http2/src/client.js +2 -2
- package/packages/datadog-plugin-http2/src/index.js +1 -1
- package/packages/datadog-plugin-jest/src/util.js +1 -1
- package/packages/datadog-plugin-kafkajs/src/index.js +1 -1
- package/packages/datadog-plugin-langchain/src/index.js +1 -1
- package/packages/datadog-plugin-langchain/src/tracing.js +7 -3
- package/packages/datadog-plugin-moleculer/src/index.js +1 -1
- package/packages/datadog-plugin-mongodb-core/src/index.js +6 -2
- package/packages/datadog-plugin-next/src/index.js +11 -3
- package/packages/datadog-plugin-openai/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/stream-helpers.js +30 -10
- package/packages/datadog-plugin-openai/src/tracing.js +2 -2
- package/packages/datadog-plugin-rhea/src/index.js +1 -1
- package/packages/datadog-plugin-ws/src/close.js +56 -3
- package/packages/datadog-plugin-ws/src/index.js +4 -0
- package/packages/datadog-plugin-ws/src/producer.js +39 -4
- package/packages/datadog-plugin-ws/src/receiver.js +39 -3
- package/packages/datadog-plugin-ws/src/server.js +13 -1
- package/packages/datadog-plugin-ws/src/util.js +107 -0
- package/packages/datadog-shimmer/src/shimmer.js +2 -2
- package/packages/dd-trace/src/aiguard/sdk.js +21 -13
- package/packages/dd-trace/src/appsec/api_security_sampler.js +1 -1
- package/packages/dd-trace/src/appsec/graphql.js +2 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/code-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-base-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +3 -3
- package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/untrusted-deserialization-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js +3 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-randomness-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/iast-plugin.js +3 -3
- package/packages/dd-trace/src/appsec/iast/index.js +5 -5
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +1 -1
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +11 -16
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +1 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js +1 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +4 -4
- package/packages/dd-trace/src/appsec/index.js +8 -8
- package/packages/dd-trace/src/appsec/rasp/command_injection.js +1 -1
- package/packages/dd-trace/src/appsec/rasp/index.js +1 -1
- package/packages/dd-trace/src/appsec/rasp/lfi.js +1 -1
- package/packages/dd-trace/src/appsec/rc-products.js +10 -0
- package/packages/dd-trace/src/appsec/recommended.json +230 -3
- package/packages/dd-trace/src/appsec/remote_config.js +177 -0
- package/packages/dd-trace/src/appsec/reporter.js +3 -7
- package/packages/dd-trace/src/appsec/rule_manager.js +37 -20
- package/packages/dd-trace/src/appsec/sdk/index.js +1 -1
- package/packages/dd-trace/src/appsec/sdk/set_user.js +1 -1
- package/packages/dd-trace/src/appsec/sdk/track_event.js +2 -2
- package/packages/dd-trace/src/appsec/sdk/user_blocking.js +2 -2
- package/packages/dd-trace/src/appsec/user_tracking.js +2 -2
- package/packages/dd-trace/src/appsec/waf/index.js +17 -3
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +11 -0
- package/packages/dd-trace/src/azure_metadata.js +8 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +8 -6
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +1 -1
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +4 -2
- package/packages/dd-trace/src/config/remote_config.js +34 -0
- package/packages/dd-trace/src/config.js +109 -34
- package/packages/dd-trace/src/config_defaults.js +16 -3
- package/packages/dd-trace/src/constants.js +5 -0
- package/packages/dd-trace/src/crashtracking/crashtracker.js +10 -1
- package/packages/dd-trace/src/datastreams/checkpointer.js +2 -2
- package/packages/dd-trace/src/datastreams/encoding.js +23 -6
- package/packages/dd-trace/src/datastreams/index.js +1 -1
- package/packages/dd-trace/src/datastreams/pathway.js +41 -2
- package/packages/dd-trace/src/datastreams/processor.js +3 -3
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -1
- package/packages/dd-trace/src/datastreams/writer.js +2 -2
- package/packages/dd-trace/src/debugger/config.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +15 -5
- package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/config.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/index.js +37 -17
- package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +24 -18
- package/packages/dd-trace/src/debugger/devtools_client/send.js +21 -11
- package/packages/dd-trace/src/debugger/devtools_client/session.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +103 -15
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/constants.js +25 -0
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +56 -25
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +64 -23
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +404 -0
- package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/state.js +8 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +3 -3
- package/packages/dd-trace/src/debugger/index.js +2 -2
- package/packages/dd-trace/src/dogstatsd.js +3 -2
- package/packages/dd-trace/src/encode/0.4.js +1 -1
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +2 -2
- package/packages/dd-trace/src/encode/coverage-ci-visibility.js +1 -1
- package/packages/dd-trace/src/encode/span-stats.js +13 -2
- package/packages/dd-trace/src/exporter.js +2 -2
- package/packages/dd-trace/src/exporters/agent/index.js +1 -1
- package/packages/dd-trace/src/exporters/common/agent-info-exporter.js +1 -1
- package/packages/dd-trace/src/exporters/common/request.js +2 -2
- package/packages/dd-trace/src/exporters/common/writer.js +1 -1
- package/packages/dd-trace/src/exporters/span-stats/index.js +1 -1
- package/packages/dd-trace/src/external-logger/src/index.js +1 -2
- package/packages/dd-trace/src/flare/index.js +1 -1
- package/packages/dd-trace/src/guardrails/index.js +6 -3
- package/packages/dd-trace/src/histogram.js +1 -1
- package/packages/dd-trace/src/id.js +60 -0
- package/packages/dd-trace/src/index.js +1 -1
- package/packages/dd-trace/src/lambda/handler.js +4 -4
- package/packages/dd-trace/src/lambda/index.js +1 -1
- package/packages/dd-trace/src/lambda/runtime/patch.js +4 -4
- package/packages/dd-trace/src/lambda/runtime/ritm.js +2 -2
- package/packages/dd-trace/src/llmobs/constants/tags.js +8 -1
- package/packages/dd-trace/src/llmobs/index.js +8 -9
- package/packages/dd-trace/src/llmobs/plugins/ai/index.js +38 -7
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +30 -9
- package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +3 -3
- package/packages/dd-trace/src/llmobs/plugins/genai/index.js +104 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +486 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/llm.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +2 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +16 -0
- package/packages/dd-trace/src/llmobs/plugins/{openai.js → openai/index.js} +63 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +126 -0
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +1 -1
- package/packages/dd-trace/src/llmobs/sdk.js +20 -22
- package/packages/dd-trace/src/llmobs/span_processor.js +15 -14
- package/packages/dd-trace/src/llmobs/tagger.js +4 -0
- package/packages/dd-trace/src/llmobs/telemetry.js +3 -4
- package/packages/dd-trace/src/llmobs/writers/base.js +2 -2
- package/packages/dd-trace/src/llmobs/writers/spans.js +1 -2
- package/packages/dd-trace/src/log/index.js +1 -1
- package/packages/dd-trace/src/noop/proxy.js +2 -2
- package/packages/dd-trace/src/noop/span.js +1 -1
- package/packages/dd-trace/src/openfeature/index.js +2 -2
- package/packages/dd-trace/src/openfeature/noop.js +14 -14
- package/packages/dd-trace/src/openfeature/remote_config.js +31 -0
- package/packages/dd-trace/src/openfeature/writers/base.js +5 -5
- package/packages/dd-trace/src/openfeature/writers/exposures.js +9 -9
- package/packages/dd-trace/src/opentelemetry/context_manager.js +2 -2
- package/packages/dd-trace/src/opentelemetry/logs/index.js +2 -2
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +3 -2
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +4 -4
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +5 -3
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +17 -16
- package/packages/dd-trace/src/opentelemetry/metrics/constants.js +34 -0
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +81 -0
- package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +225 -0
- package/packages/dd-trace/src/opentelemetry/metrics/meter.js +171 -0
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +54 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +62 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +251 -0
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +557 -0
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +10 -18
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +47 -32
- package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +1 -1
- package/packages/dd-trace/src/opentelemetry/span.js +3 -3
- package/packages/dd-trace/src/opentelemetry/tracer.js +4 -4
- package/packages/dd-trace/src/opentelemetry/tracer_provider.js +1 -1
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +24 -8
- package/packages/dd-trace/src/opentracing/span.js +3 -3
- package/packages/dd-trace/src/opentracing/tracer.js +5 -5
- package/packages/dd-trace/src/payload-tagging/index.js +8 -4
- package/packages/dd-trace/src/plugin_manager.js +5 -3
- package/packages/dd-trace/src/plugins/apollo.js +1 -1
- package/packages/dd-trace/src/plugins/ci_plugin.js +27 -27
- package/packages/dd-trace/src/plugins/database.js +1 -1
- package/packages/dd-trace/src/plugins/index.js +6 -1
- package/packages/dd-trace/src/plugins/log_plugin.js +1 -1
- package/packages/dd-trace/src/plugins/outbound.js +1 -1
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/ci.js +1 -1
- package/packages/dd-trace/src/plugins/util/git.js +8 -8
- package/packages/dd-trace/src/plugins/util/stacktrace.js +1 -1
- package/packages/dd-trace/src/plugins/util/test.js +27 -27
- package/packages/dd-trace/src/plugins/util/url.js +119 -1
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +1 -1
- package/packages/dd-trace/src/plugins/util/web.js +18 -46
- package/packages/dd-trace/src/priority_sampler.js +15 -16
- package/packages/dd-trace/src/process-tags/index.js +83 -0
- package/packages/dd-trace/src/profiling/config.js +33 -22
- package/packages/dd-trace/src/profiling/exporter_cli.js +4 -4
- package/packages/dd-trace/src/profiling/exporters/agent.js +5 -5
- package/packages/dd-trace/src/profiling/index.js +1 -1
- package/packages/dd-trace/src/profiling/libuv-size.js +1 -1
- package/packages/dd-trace/src/profiling/profiler.js +4 -5
- package/packages/dd-trace/src/profiling/profilers/event_plugins/event.js +1 -1
- package/packages/dd-trace/src/profiling/profilers/events.js +11 -2
- package/packages/dd-trace/src/profiling/profilers/wall.js +4 -4
- package/packages/dd-trace/src/proxy.js +17 -18
- package/packages/dd-trace/src/rate_limiter.js +1 -1
- package/packages/dd-trace/src/remote_config/index.js +541 -137
- package/packages/dd-trace/src/require-package-json.js +1 -1
- package/packages/dd-trace/src/ritm.js +50 -27
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +1 -1
- package/packages/dd-trace/src/serverless.js +16 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +8 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +8 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
- package/packages/dd-trace/src/span_format.js +10 -5
- package/packages/dd-trace/src/span_processor.js +8 -3
- package/packages/dd-trace/src/span_stats.js +21 -8
- package/packages/dd-trace/src/spanleak.js +1 -1
- package/packages/dd-trace/src/standalone/index.js +1 -1
- package/packages/dd-trace/src/startup-log.js +3 -3
- package/packages/dd-trace/src/supported-configurations.json +16 -0
- package/packages/dd-trace/src/telemetry/dependencies.js +4 -4
- package/packages/dd-trace/src/telemetry/endpoints.js +8 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +22 -8
- package/packages/dd-trace/src/tracer.js +3 -3
- package/packages/dd-trace/src/tracer_metadata.js +19 -15
- package/vendor/dist/@datadog/sketches-js/LICENSE +39 -0
- package/vendor/dist/@datadog/sketches-js/index.js +1 -0
- package/vendor/dist/@datadog/source-map/LICENSE +28 -0
- package/vendor/dist/@datadog/source-map/index.js +1 -0
- package/vendor/dist/@isaacs/ttlcache/LICENSE +55 -0
- package/vendor/dist/@isaacs/ttlcache/index.js +1 -0
- package/vendor/dist/@opentelemetry/core/LICENSE +201 -0
- package/vendor/dist/@opentelemetry/core/index.js +1 -0
- package/vendor/dist/@opentelemetry/resources/LICENSE +201 -0
- package/vendor/dist/@opentelemetry/resources/index.js +1 -0
- package/vendor/dist/astring/LICENSE +19 -0
- package/vendor/dist/astring/index.js +1 -0
- package/vendor/dist/crypto-randomuuid/index.js +1 -0
- package/vendor/dist/escape-string-regexp/LICENSE +9 -0
- package/vendor/dist/escape-string-regexp/index.js +1 -0
- package/vendor/dist/esquery/LICENSE +24 -0
- package/vendor/dist/esquery/index.js +1 -0
- package/vendor/dist/ignore/LICENSE +21 -0
- package/vendor/dist/ignore/index.js +1 -0
- package/vendor/dist/istanbul-lib-coverage/LICENSE +24 -0
- package/vendor/dist/istanbul-lib-coverage/index.js +1 -0
- package/vendor/dist/jest-docblock/LICENSE +21 -0
- package/vendor/dist/jest-docblock/index.js +1 -0
- package/vendor/dist/jsonpath-plus/LICENSE +22 -0
- package/vendor/dist/jsonpath-plus/index.js +1 -0
- package/vendor/dist/limiter/LICENSE +19 -0
- package/vendor/dist/limiter/index.js +1 -0
- package/vendor/dist/lodash.sortby/LICENSE +47 -0
- package/vendor/dist/lodash.sortby/index.js +1 -0
- package/vendor/dist/lru-cache/LICENSE +15 -0
- package/vendor/dist/lru-cache/index.js +1 -0
- package/vendor/dist/meriyah/LICENSE +7 -0
- package/vendor/dist/meriyah/index.js +1 -0
- package/vendor/dist/module-details-from-path/LICENSE +21 -0
- package/vendor/dist/module-details-from-path/index.js +1 -0
- package/vendor/dist/mutexify/promise/LICENSE +21 -0
- package/vendor/dist/mutexify/promise/index.js +1 -0
- package/vendor/dist/opentracing/LICENSE +201 -0
- package/vendor/dist/opentracing/binary_carrier.d.ts +11 -0
- package/vendor/dist/opentracing/constants.d.ts +61 -0
- package/vendor/dist/opentracing/examples/demo/demo.d.ts +2 -0
- package/vendor/dist/opentracing/ext/tags.d.ts +90 -0
- package/vendor/dist/opentracing/functions.d.ts +20 -0
- package/vendor/dist/opentracing/global_tracer.d.ts +14 -0
- package/vendor/dist/opentracing/index.d.ts +12 -0
- package/vendor/dist/opentracing/index.js +1 -0
- package/vendor/dist/opentracing/mock_tracer/index.d.ts +5 -0
- package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +13 -0
- package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +16 -0
- package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +50 -0
- package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +26 -0
- package/vendor/dist/opentracing/noop.d.ts +8 -0
- package/vendor/dist/opentracing/reference.d.ts +33 -0
- package/vendor/dist/opentracing/span.d.ts +147 -0
- package/vendor/dist/opentracing/span_context.d.ts +26 -0
- package/vendor/dist/opentracing/test/api_compatibility.d.ts +16 -0
- package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +3 -0
- package/vendor/dist/opentracing/test/noop_implementation.d.ts +4 -0
- package/vendor/dist/opentracing/test/opentracing_api.d.ts +3 -0
- package/vendor/dist/opentracing/test/unittest.d.ts +2 -0
- package/vendor/dist/opentracing/tracer.d.ts +127 -0
- package/vendor/dist/path-to-regexp/LICENSE +21 -0
- package/vendor/dist/path-to-regexp/index.js +1 -0
- package/vendor/dist/pprof-format/LICENSE +8 -0
- package/vendor/dist/pprof-format/index.js +1 -0
- package/vendor/dist/protobufjs/LICENSE +39 -0
- package/vendor/dist/protobufjs/index.js +1 -0
- package/vendor/dist/protobufjs/minimal/LICENSE +39 -0
- package/vendor/dist/protobufjs/minimal/index.js +1 -0
- package/vendor/dist/retry/LICENSE +21 -0
- package/vendor/dist/retry/index.js +1 -0
- package/vendor/dist/rfdc/LICENSE +15 -0
- package/vendor/dist/rfdc/index.js +1 -0
- package/vendor/dist/semifies/LICENSE +201 -0
- package/vendor/dist/semifies/index.js +1 -0
- package/vendor/dist/shell-quote/LICENSE +24 -0
- package/vendor/dist/shell-quote/index.js +1 -0
- package/vendor/dist/source-map/LICENSE +28 -0
- package/vendor/dist/source-map/index.js +1 -0
- package/vendor/dist/source-map/lib/util/LICENSE +28 -0
- package/vendor/dist/source-map/lib/util/index.js +1 -0
- package/vendor/dist/source-map/mappings.wasm +0 -0
- package/vendor/dist/tlhunter-sorted-set/LICENSE +21 -0
- package/vendor/dist/tlhunter-sorted-set/index.js +1 -0
- package/vendor/dist/ttl-set/LICENSE +21 -0
- package/vendor/dist/ttl-set/index.js +1 -0
- package/packages/dd-trace/src/remote_config/manager.js +0 -368
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,t,r,n,o,i,a,_,T,E={};E.d=(e,t)=>{for(var r in t)E.o(t,r)&&!E.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},E.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),E.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};E.r(u),E.d(u,{baggageUtils:()=>e6,hrTime:()=>w,timeInputToHrTime:()=>X,W3CTraceContextPropagator:()=>eI,callWithTimeout:()=>eQ,AlwaysOnSampler:()=>eb,isTracingSuppressed:()=>O,AlwaysOffSampler:()=>eN,loggingErrorHandler:()=>C,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>eo,deleteRPCMetadata:()=>ev,suppressTracing:()=>f,RPCType:()=>T,RandomIdGenerator:()=>Z,setRPCMetadata:()=>eA,unrefTimer:()=>ef,hrTimeToMilliseconds:()=>V,TRACE_PARENT_HEADER:()=>ey,unsuppressTracing:()=>s,globalErrorHandler:()=>U,_globalThis:()=>q,getEnvWithoutDefaults:()=>el,ParentBasedSampler:()=>eU,millisToHrTime:()=>D,isTimeInputHrTime:()=>F,otperformance:()=>M,internal:()=>e5,urlMatches:()=>eq,BindOnceFuture:()=>e8,DEFAULT_ENVIRONMENT:()=>e_,SDK_INFO:()=>$,isWrapped:()=>e1,isAttributeKey:()=>m,TraceState:()=>eP,hexToBase64:()=>ec,TRACE_STATE_HEADER:()=>ed,getEnv:()=>eu,getTimeOrigin:()=>B,TraceIdRatioBasedSampler:()=>eM,hrTimeDuration:()=>j,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>ei,isTimeInput:()=>K,hexToBinary:()=>Y,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>ea,parseTraceParent:()=>eh,isUrlIgnored:()=>e0,parseEnvironment:()=>eE,setGlobalErrorHandler:()=>b,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>en,isAttributeValue:()=>A,CompositePropagator:()=>eO,hrTimeToMicroseconds:()=>H,AnchoredClock:()=>d,TracesSamplerValues:()=>_,ExportResultCode:()=>i,hrTimeToNanoseconds:()=>G,merge:()=>eH,TimeoutError:()=>eJ,W3CBaggagePropagator:()=>y,addHrTimes:()=>k,getRPCMetadata:()=>eC,sanitizeAttributes:()=>I,hrTimeToTimeStamp:()=>x,VERSION:()=>Q});let l=require("@opentelemetry/api");var c=(0,l.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function f(e){return e.setValue(c,!0)}function s(e){return e.deleteValue(c)}function O(e){return!0===e.getValue(c)}var p="baggage",R=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};function L(e){return e.reduce(function(e,t){var r=""+e+(""!==e?",":"")+t;return r.length>8192?e:r},"")}function S(e){return e.getAllEntries().map(function(e){var t=R(e,2),r=t[0],n=t[1],o=encodeURIComponent(r)+"="+encodeURIComponent(n.value);return void 0!==n.metadata&&(o+=";"+n.metadata.toString()),o})}function P(e){var t,r=e.split(";");if(!(r.length<=0)){var n=r.shift();if(n){var o=n.indexOf("=");if(!(o<=0)){var i=decodeURIComponent(n.substring(0,o).trim()),a=decodeURIComponent(n.substring(o+1).trim());return r.length>0&&(t=(0,l.baggageEntryMetadataFromString)(r.join(";"))),{key:i,value:a,metadata:t}}}}}var y=function(){function e(){}return e.prototype.inject=function(e,t,r){var n=l.propagation.getBaggage(e);if(!(!n||O(e))){var o=L(S(n).filter(function(e){return e.length<=4096}).slice(0,180));o.length>0&&r.set(t,p,o)}},e.prototype.extract=function(e,t,r){var n=r.get(t,p),o=Array.isArray(n)?n.join(","):n;if(!o)return e;var i={};return 0===o.length||(o.split(",").forEach(function(e){var t=P(e);if(t){var r={value:t.value};t.metadata&&(r.metadata=t.metadata),i[t.key]=r}}),0===Object.entries(i).length)?e:l.propagation.setBaggage(e,l.propagation.createBaggage(i))},e.prototype.fields=function(){return[p]},e}(),d=function(){function e(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}return e.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},e}(),g=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},h=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};function I(e){var t,r,n={};if("object"!=typeof e||null==e)return n;try{for(var o=g(Object.entries(e)),i=o.next();!i.done;i=o.next()){var a=h(i.value,2),_=a[0],T=a[1];if(!m(_)){l.diag.warn("Invalid attribute key: "+_);continue}if(!A(T)){l.diag.warn("Invalid attribute value set for key: "+_);continue}Array.isArray(T)?n[_]=T.slice():n[_]=T}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}function m(e){return"string"==typeof e&&e.length>0}function A(e){return null==e||(Array.isArray(e)?function(e){try{for(var t,r,n,o=g(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){if(!n){if(v(a)){n=typeof a;continue}return!1}if(typeof a!==n)return!1}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0}(e):v(e))}function v(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}function C(){return function(e){var t;l.diag.error("string"==typeof(t=e)?t:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach(function(e){if(!t[e]){var n=r[e];n&&(t[e]=String(n))}}),r=Object.getPrototypeOf(r);return t}(t)))}}var N=C();function b(e){N=e}function U(e){try{N(e)}catch(e){}}var M=require("perf_hooks").performance;function D(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}function B(){var e=M.timeOrigin;return"number"!=typeof e&&(e=M.timing&&M.timing.fetchStart),e}function w(e){return k(D(B()),D("number"==typeof e?e:M.now()))}function X(e){if(F(e))return e;if("number"==typeof e)if(e<B())return w(e);else return D(e);if(e instanceof Date)return D(e.getTime());throw TypeError("Invalid input type")}function j(e,t){var r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=1e9),[r,n]}function x(e){var t=""+"0".repeat(9)+e[1]+"Z",r=t.substring(t.length-9-1);return new Date(1e3*e[0]).toISOString().replace("000Z",r)}function G(e){return 1e9*e[0]+e[1]}function V(e){return 1e3*e[0]+e[1]/1e6}function H(e){return 1e6*e[0]+e[1]/1e3}function F(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function K(e){return F(e)||"number"==typeof e||e instanceof Date}function k(e,t){var r=[e[0]+t[0],e[1]+t[1]];return r[1]>=1e9&&(r[1]-=1e9,r[0]+=1),r}function z(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Y(e){for(var t=new Uint8Array(e.length/2),r=0,n=0;n<e.length;n+=2){var o=z(e.charCodeAt(n)),i=z(e.charCodeAt(n+1));t[r++]=o<<4|i}return t}(r=i||(i={}))[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED";var Z=function(){this.generateTraceId=J(16),this.generateSpanId=J(8)},W=Buffer.allocUnsafe(16);function J(e){return function(){for(var t=0;t<e/4;t++)W.writeUInt32BE(0x100000000*Math.random()>>>0,4*t);for(var t=0;t<e;t++)if(W[t]>0)break;else t===e-1&&(W[e-1]=1);return W.toString("hex",0,e)}}var Q="1.30.1",$=((a={})["telemetry.sdk.name"]="opentelemetry",a["process.runtime.name"]="node",a["telemetry.sdk.language"]="nodejs",a["telemetry.sdk.version"]=Q,a),q="object"==typeof globalThis?globalThis:global;(n=_||(_={})).AlwaysOff="always_off",n.AlwaysOn="always_on",n.ParentBasedAlwaysOff="parentbased_always_off",n.ParentBasedAlwaysOn="parentbased_always_on",n.ParentBasedTraceIdRatio="parentbased_traceidratio",n.TraceIdRatio="traceidratio";var ee=["OTEL_SDK_DISABLED"],et=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"],er=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"],en=1/0,eo=128,ei=128,ea=128,e_={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:l.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:en,OTEL_ATTRIBUTE_COUNT_LIMIT:eo,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:en,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:eo,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:en,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:eo,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:ei,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:ea,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:_.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]},eT={ALL:l.DiagLogLevel.ALL,VERBOSE:l.DiagLogLevel.VERBOSE,DEBUG:l.DiagLogLevel.DEBUG,INFO:l.DiagLogLevel.INFO,WARN:l.DiagLogLevel.WARN,ERROR:l.DiagLogLevel.ERROR,NONE:l.DiagLogLevel.NONE};function eE(e){var t={};for(var r in e_)if("OTEL_LOG_LEVEL"===r)!function(e,t,r){var n=r[e];if("string"==typeof n){var o=eT[n.toUpperCase()];null!=o&&(t[e]=o)}}(r,t,e);else if(ee.indexOf(r)>-1)!function(e,t,r){if(void 0!==r[e]){var n=String(r[e]);t[e]="true"===n.toLowerCase()}}(r,t,e);else if(et.indexOf(r)>-1)!function(e,t,r,n,o){if(void 0===n&&(n=-1/0),void 0===o&&(o=1/0),void 0!==r[e]){var i=Number(r[e]);isNaN(i)||(i<n?t[e]=n:i>o?t[e]=o:t[e]=i)}}(r,t,e);else if(er.indexOf(r)>-1)!function(e,t,r,n){void 0===n&&(n=",");var o=r[e];"string"==typeof o&&(t[e]=o.split(n).map(function(e){return e.trim()}))}(r,t,e);else{var n=e[r];null!=n&&(t[r]=String(n))}return t}function eu(){return Object.assign({},e_,eE(process.env))}function el(){return eE(process.env)}function ec(e){return Buffer.from(Y(e)).toString("base64")}function ef(e){e.unref()}var es=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},eO=function(){function e(e){var t;void 0===e&&(e={}),this._propagators=null!=(t=e.propagators)?t:[],this._fields=Array.from(new Set(this._propagators.map(function(e){return"function"==typeof e.fields?e.fields():[]}).reduce(function(e,t){return e.concat(t)},[])))}return e.prototype.inject=function(e,t,r){var n,o;try{for(var i=es(this._propagators),a=i.next();!a.done;a=i.next()){var _=a.value;try{_.inject(e,t,r)}catch(e){l.diag.warn("Failed to inject with "+_.constructor.name+". Err: "+e.message)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}},e.prototype.extract=function(e,t,r){return this._propagators.reduce(function(e,n){try{return n.extract(e,t,r)}catch(e){l.diag.warn("Failed to extract with "+n.constructor.name+". Err: "+e.message)}return e},e)},e.prototype.fields=function(){return this._fields.slice()},e}(),ep="[_0-9a-z-*/]",eR=RegExp("^(?:[a-z]"+ep+"{0,255}|"+("[a-z0-9]"+ep+"{0,240}@[a-z]")+ep+"{0,13})$"),eL=/^[ -~]{0,255}[!-~]$/,eS=/,|=/,eP=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,r){return t.push(r+"="+e.get(r)),t},[]).join(",")},e.prototype._parse=function(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce(function(e,t){var r=t.trim(),n=r.indexOf("=");if(-1!==n){var o=r.slice(0,n),i=r.slice(n+1,t.length);eR.test(o)&&eL.test(i)&&!eS.test(i)&&e.set(o,i)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}(),ey="traceparent",ed="tracestate",eg=RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");function eh(e){var t=eg.exec(e);return!t||"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var eI=function(){function e(){}return e.prototype.inject=function(e,t,r){var n=l.trace.getSpanContext(e);if(!(!n||O(e))&&(0,l.isSpanContextValid)(n)){var o="00-"+n.traceId+"-"+n.spanId+"-0"+Number(n.traceFlags||l.TraceFlags.NONE).toString(16);r.set(t,ey,o),n.traceState&&r.set(t,ed,n.traceState.serialize())}},e.prototype.extract=function(e,t,r){var n=r.get(t,ey);if(!n)return e;var o=Array.isArray(n)?n[0]:n;if("string"!=typeof o)return e;var i=eh(o);if(!i)return e;i.isRemote=!0;var a=r.get(t,ed);if(a){var _=Array.isArray(a)?a.join(","):a;i.traceState=new eP("string"==typeof _?_:void 0)}return l.trace.setSpanContext(e,i)},e.prototype.fields=function(){return[ey,ed]},e}(),em=(0,l.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA");function eA(e,t){return e.setValue(em,t)}function ev(e){return e.deleteValue(em)}function eC(e){return e.getValue(em)}(T||(T={})).HTTP="http";var eN=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:l.SamplingDecision.NOT_RECORD}},e.prototype.toString=function(){return"AlwaysOffSampler"},e}(),eb=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:l.SamplingDecision.RECORD_AND_SAMPLED}},e.prototype.toString=function(){return"AlwaysOnSampler"},e}(),eU=function(){function e(e){var t,r,n,o;this._root=e.root,this._root||(U(Error("ParentBasedSampler must have a root sampler configured")),this._root=new eb),this._remoteParentSampled=null!=(t=e.remoteParentSampled)?t:new eb,this._remoteParentNotSampled=null!=(r=e.remoteParentNotSampled)?r:new eN,this._localParentSampled=null!=(n=e.localParentSampled)?n:new eb,this._localParentNotSampled=null!=(o=e.localParentNotSampled)?o:new eN}return e.prototype.shouldSample=function(e,t,r,n,o,i){var a=l.trace.getSpanContext(e);return a&&(0,l.isSpanContextValid)(a)?a.isRemote?a.traceFlags&l.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,n,o,i):this._remoteParentNotSampled.shouldSample(e,t,r,n,o,i):a.traceFlags&l.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,r,n,o,i):this._localParentNotSampled.shouldSample(e,t,r,n,o,i):this._root.shouldSample(e,t,r,n,o,i)},e.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},e}(),eM=function(){function e(e){void 0===e&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(0xffffffff*this._ratio)}return e.prototype.shouldSample=function(e,t){return{decision:(0,l.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?l.SamplingDecision.RECORD_AND_SAMPLED:l.SamplingDecision.NOT_RECORD}},e.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},e.prototype._normalize=function(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e},e.prototype._accumulate=function(e){for(var t=0,r=0;r<e.length/8;r++){var n=8*r;t=(t^parseInt(e.slice(n,n+8),16))>>>0}return t},e}(),eD=Function.prototype.toString,eB=eD.call(Object),ew=(e=Object.getPrototypeOf,t=Object,function(r){return e(t(r))}),eX=Object.prototype,ej=eX.hasOwnProperty,ex=Symbol?Symbol.toStringTag:void 0,eG=eX.toString;function eV(e){if(null==(t=e)||"object"!=typeof t||"[object Object]"!==(null==(r=e)?void 0===r?"[object Undefined]":"[object Null]":ex&&ex in Object(r)?function(e){var t=ej.call(e,ex),r=e[ex],n=!1;try{e[ex]=void 0,n=!0}catch(e){}var o=eG.call(e);return n&&(t?e[ex]=r:delete e[ex]),o}(r):(n=r,eG.call(n))))return!1;var t,r,n,o=ew(e);if(null===o)return!0;var i=ej.call(o,"constructor")&&o.constructor;return"function"==typeof i&&i instanceof i&&eD.call(i)===eB}function eH(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e.shift(),n=new WeakMap;e.length>0;)r=function e(t,r,n,o){if(void 0===n&&(n=0),!(n>20)){if(n++,eZ(t)||eZ(r)||ez(r))_=eF(r);else if(ek(t)){if(_=t.slice(),ek(r))for(var i,a,_,T=0,E=r.length;T<E;T++)_.push(eF(r[T]));else if(eY(r))for(var u=Object.keys(r),T=0,E=u.length;T<E;T++){var l=u[T];_[l]=eF(r[l])}}else if(eY(t))if(eY(r)){if(i=t,a=r,!(eV(i)&&eV(a)))return r;_=Object.assign({},t);for(var u=Object.keys(r),T=0,E=u.length;T<E;T++){var l=u[T],c=r[l];if(eZ(c))void 0===c?delete _[l]:_[l]=c;else{var f=_[l];if(eK(t,l,o)||eK(r,l,o))delete _[l];else{if(eY(f)&&eY(c)){var s=o.get(f)||[],O=o.get(c)||[];s.push({obj:t,key:l}),O.push({obj:r,key:l}),o.set(f,s),o.set(c,O)}_[l]=e(_[l],c,n,o)}}}}else _=r;return _}}(r,e.shift(),0,n);return r}function eF(e){return ek(e)?e.slice():e}function eK(e,t,r){for(var n=r.get(e[t])||[],o=0,i=n.length;o<i;o++){var a=n[o];if(a.key===t&&a.obj===e)return!0}return!1}function ek(e){return Array.isArray(e)}function ez(e){return"function"==typeof e}function eY(e){return!eZ(e)&&!ek(e)&&!ez(e)&&"object"==typeof e}function eZ(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}var eW=(o=function(e,t){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),eJ=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return eW(t,e),t}(Error);function eQ(e,t){var r;return Promise.race([e,new Promise(function(e,n){r=setTimeout(function(){n(new eJ("Operation timed out."))},t)})]).then(function(e){return clearTimeout(r),e},function(e){throw clearTimeout(r),e})}var e$=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function eq(e,t){return"string"==typeof t?e===t:!!e.match(t)}function e0(e,t){var r,n;if(!t)return!1;try{for(var o=e$(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(eq(e,a))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function e1(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var e2=function(){function e(){var e=this;this._promise=new Promise(function(t,r){e._resolve=t,e._reject=r})}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this._resolve(e)},e.prototype.reject=function(e){this._reject(e)},e}(),e3=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},e4=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},e8=function(){function e(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new e2}return Object.defineProperty(e.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),e.prototype.call=function(){for(var e,t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((e=this._callback).call.apply(e,e4([this._that],e3(r),!1))).then(function(e){return t._deferred.resolve(e)},function(e){return t._deferred.reject(e)})}catch(e){this._deferred.reject(e)}}return this._deferred.promise},e}(),e6={getKeyPairs:S,serializeKeyPairs:L,parseKeyPairsIntoRecord:function(e){return"string"!=typeof e||0===e.length?{}:e.split(",").map(function(e){return P(e)}).filter(function(e){return void 0!==e&&e.value.length>0}).reduce(function(e,t){return e[t.key]=t.value,e},{})},parsePairKeyValue:P},e5={_export:function(e,t){return new Promise(function(r){l.context.with(f(l.context.active()),function(){e.export(t,function(e){r(e)})})})}};module.exports=u})();
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js":function(e,t,r){r.d(t,{q:()=>o});let n=require("child_process");var o=require("util").promisify(n.exec)},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("fs"),o=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),i=r("@opentelemetry/api"),a=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n.promises.readFile("/etc/hostid",{encoding:"utf8"})];case 1:return[2,r.sent().trim()];case 2:return e=r.sent(),i.diag.debug("error reading machine id: "+e),[3,3];case 3:return r.trys.push([3,5,,6]),[4,(0,o.q)("kenv -q smbios.system.uuid")];case 4:return[2,r.sent().stdout.trim()];case 5:return t=r.sent(),i.diag.debug("error reading machine id: "+t),[3,6];case 6:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-darwin.js":function(e,t,r){r.d(t,{D:()=>a});var n=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),o=r("@opentelemetry/api"),i=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function a(){var e,t,r,a;return e=this,t=void 0,r=void 0,a=function(){var e,t,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,n.q)('ioreg -rd1 -c "IOPlatformExpertDevice"')];case 1:if(!(e=i.sent().stdout.split("\n").find(function(e){return e.includes("IOPlatformUUID")})))return[2,""];if(2===(t=e.split('" = "')).length)return[2,t[1].slice(0,-1)];return[3,3];case 2:return r=i.sent(),o.diag.debug("error reading machine id: "+r),[3,3];case 3:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function u(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,u)}c((a=a.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-linux.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("fs"),o=r("@opentelemetry/api"),i=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t,r,u,c,s,l;return i(this,function(i){switch(i.label){case 0:e=["/etc/machine-id","/var/lib/dbus/machine-id"],i.label=1;case 1:i.trys.push([1,8,9,10]),r=(t=a(e)).next(),i.label=2;case 2:if(r.done)return[3,7];u=r.value,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,n.promises.readFile(u,{encoding:"utf8"})];case 4:return[2,i.sent().trim()];case 5:return c=i.sent(),o.diag.debug("error reading machine id: "+c),[3,6];case 6:return r=t.next(),[3,2];case 7:return[3,10];case 8:return s={error:i.sent()},[3,10];case 9:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(s)throw s.error}return[7];case 10:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-unsupported.js":function(e,t,r){r.d(t,{D:()=>i});var n=r("@opentelemetry/api"),o=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function i(){var e,t,r,i;return e=this,t=void 0,r=void 0,i=function(){return o(this,function(e){return n.diag.debug("could not read machine-id: unsupported platform"),[2,""]})},new(r||(r=Promise))(function(n,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function u(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((i=i.apply(e,t||[])).next())})}},"./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js":function(e,t,r){r.d(t,{D:()=>u});var n=r("process"),o=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js"),i=r("@opentelemetry/api"),a=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};function u(){var e,t,r,u;return e=this,t=void 0,r=void 0,u=function(){var e,t,r,u;return a(this,function(a){switch(a.label){case 0:e="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",t="%windir%\\System32\\REG.exe","ia32"===n.arch&&"PROCESSOR_ARCHITEW6432"in n.env&&(t="%windir%\\sysnative\\cmd.exe /c "+t),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,o.q)(t+" "+e)];case 2:if(2===(r=a.sent().stdout.split("REG_SZ")).length)return[2,r[1].trim()];return[3,4];case 3:return u=a.sent(),i.diag.debug("error reading machine id: "+u),[3,4];case 4:return[2,""]}})},new(r||(r=Promise))(function(n,o){function i(e){try{c(u.next(e))}catch(e){o(e)}}function a(e){try{c(u.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,a)}c((u=u.apply(e,t||[])).next())})}},"@opentelemetry/api":function(e){e.exports=require("@opentelemetry/api")},fs:function(e){e.exports=require("fs")},process:function(e){e.exports=require("process")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{envDetector:()=>N,envDetectorSync:()=>C,hostDetector:()=>X,Resource:()=>h,osDetector:()=>G,detectResources:()=>Z,osDetectorSync:()=>B,browserDetectorSync:()=>R,processDetectorSync:()=>V,detectResourcesSync:()=>J,browserDetector:()=>b,processDetector:()=>H,defaultServiceName:()=>d,hostDetectorSync:()=>D,serviceInstanceIdDetectorSync:()=>Y});var e,t,o,i,a=r("@opentelemetry/api"),u="process.runtime.name",c="process.runtime.version",s="process.runtime.description",l="service.name",E="telemetry.sdk.name",_="telemetry.sdk.language",T="telemetry.sdk.version",f=((t={})[E]="opentelemetry",t[u]="node",t[_]="nodejs",t[T]="1.30.1",t);function d(){return"unknown_service:"+process.argv0}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},O=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},h=function(){function e(e,t){var r,n=this;this._attributes=e,this.asyncAttributesPending=null!=t,this._syncAttributes=null!=(r=this._attributes)?r:{},this._asyncAttributesPromise=null==t?void 0:t.then(function(e){return n._attributes=Object.assign({},n._attributes,e),n.asyncAttributesPending=!1,e},function(e){return a.diag.debug("a resource's async attributes promise rejected: %s",e),n.asyncAttributesPending=!1,{}})}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e(((t={})[l]=d(),t[_]=f[_],t[E]=f[E],t[T]=f[T],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){var e;return this.asyncAttributesPending&&a.diag.error("Accessing resource attributes before async attributes settled"),null!=(e=this._attributes)?e:{}},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function(){return O(this,function(e){switch(e.label){case 0:if(!this.asyncAttributesPending)return[3,2];return[4,this._asyncAttributesPromise];case 1:e.sent(),e.label=2;case 2:return[2]}})},new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((n=n.apply(e,t||[])).next())})},e.prototype.merge=function(t){var r,n=this;if(!t)return this;var o=p(p({},this._syncAttributes),null!=(r=t._syncAttributes)?r:t.attributes);return this._asyncAttributesPromise||t._asyncAttributesPromise?new e(o,Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then(function(e){var r,o=y(e,2),i=o[0],a=o[1];return p(p(p(p({},n._syncAttributes),i),null!=(r=t._syncAttributes)?r:t.attributes),a)})):new e(o)},e.EMPTY=new e({}),e}(),L=function(){return(L=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},R=new(function(){function e(){}return e.prototype.detect=function(e){if("undefined"==typeof navigator||(null==(n=null==(r=global.process)?void 0:r.versions)?void 0:n.node)!==void 0||(null==(o=global.Bun)?void 0:o.version)!==void 0)return h.empty();var t,r,n,o,i=((t={})[u]="browser",t[s]="Web Browser",t[c]=navigator.userAgent,t);return this._getResourceAttributes(i,e)},e.prototype._getResourceAttributes=function(e,t){return""===e[c]?(a.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),h.empty()):new h(L({},e))},e}()),b=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(R.detect(e))},e}());(e=o||(o={})).AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio";var v=["OTEL_SDK_DISABLED"],P=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"],A=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"],m=1/0,I={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:a.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:m,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:o.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]},S={ALL:a.DiagLogLevel.ALL,VERBOSE:a.DiagLogLevel.VERBOSE,DEBUG:a.DiagLogLevel.DEBUG,INFO:a.DiagLogLevel.INFO,WARN:a.DiagLogLevel.WARN,ERROR:a.DiagLogLevel.ERROR,NONE:a.DiagLogLevel.NONE},g=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},C=new(function(){function e(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}return e.prototype.detect=function(e){var t,r={},n=(t=function(e){var t={};for(var r in I)if("OTEL_LOG_LEVEL"===r)!function(e,t,r){var n=r[e];if("string"==typeof n){var o=S[n.toUpperCase()];null!=o&&(t[e]=o)}}(r,t,e);else if(v.indexOf(r)>-1)!function(e,t,r){if(void 0!==r[e]){var n=String(r[e]);t[e]="true"===n.toLowerCase()}}(r,t,e);else if(P.indexOf(r)>-1)!function(e,t,r,n,o){if(void 0===n&&(n=-1/0),void 0===o&&(o=1/0),void 0!==r[e]){var i=Number(r[e]);isNaN(i)||(i<n?t[e]=n:i>o?t[e]=o:t[e]=i)}}(r,t,e);else if(A.indexOf(r)>-1)!function(e,t,r,n){void 0===n&&(n=",");var o=r[e];"string"==typeof o&&(t[e]=o.split(n).map(function(e){return e.trim()}))}(r,t,e);else{var n=e[r];null!=n&&(t[r]=String(n))}return t}(process.env),Object.assign({},I,t)),o=n.OTEL_RESOURCE_ATTRIBUTES,i=n.OTEL_SERVICE_NAME;if(o)try{var u=this._parseResourceAttributes(o);Object.assign(r,u)}catch(e){a.diag.debug("EnvDetector failed: "+e.message)}return i&&(r[l]=i),new h(r)},e.prototype._parseResourceAttributes=function(e){if(!e)return{};var t,r,n={},o=e.split(this._COMMA_SEPARATOR,-1);try{for(var i=g(o),a=i.next();!a.done;a=i.next()){var u=a.value.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(2===u.length){var c=w(u,2),s=c[0],l=c[1];if(s=s.trim(),l=l.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(s))throw Error("Attribute key "+this._ERROR_MESSAGE_INVALID_CHARS);if(!this._isValid(l))throw Error("Attribute value "+this._ERROR_MESSAGE_INVALID_VALUE);n[s]=decodeURIComponent(l)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.prototype._isValid=function(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)},e.prototype._isBaggageOctetString=function(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<33||44===r||59===r||92===r||r>126)return!1}return!0},e.prototype._isValidAndNotEmpty=function(e){return e.length>0&&this._isValid(e)},e}()),N=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(C.detect(e))},e}());let M=require("os");var U=function(e){switch(e){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return e}},x=function(e){switch(e){case"sunos":return"solaris";case"win32":return"windows";default:return e}};switch(r("process").platform){case"darwin":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-darwin.js").D;break;case"linux":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-linux.js").D;break;case"freebsd":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js").D;break;case"win32":i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js").D;break;default:i=r("./@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-unsupported.js").D}var D=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["host.name"]=(0,M.hostname)(),t["host.arch"]=U((0,M.arch)()),t),this._getAsyncAttributes())},e.prototype._getAsyncAttributes=function(){return i().then(function(e){var t={};return e&&(t["host.id"]=e),t})},e}()),X=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(D.detect(e))},e}()),B=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["os.type"]=x((0,M.platform)()),t["os.version"]=(0,M.release)(),t))},e}()),G=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(B.detect(e))},e}()),k=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},j=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},V=new(function(){function e(){}return e.prototype.detect=function(e){var t,r=((t={})["process.pid"]=process.pid,t["process.executable.name"]=process.title,t["process.executable.path"]=process.execPath,t["process.command_args"]=j(j([process.argv[0]],k(process.execArgv),!1),k(process.argv.slice(1)),!1),t[c]=process.versions.node,t[u]="nodejs",t[s]="Node.js",t);process.argv.length>1&&(r["process.command"]=process.argv[1]);try{var n=M.userInfo();r["process.owner"]=n.username}catch(e){a.diag.debug("error obtaining process owner: "+e)}return new h(r)},e}()),H=new(function(){function e(){}return e.prototype.detect=function(e){return Promise.resolve(V.detect(e))},e}());let F=require("crypto");var Y=new(function(){function e(){}return e.prototype.detect=function(e){var t;return new h(((t={})["service.instance.id"]=(0,F.randomUUID)(),t))},e}()),K=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,u)}c((n=n.apply(e,t||[])).next())})},q=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var c=[i,u];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},Z=function(e){return void 0===e&&(e={}),K(void 0,void 0,void 0,function(){var t;return q(this,function(r){switch(r.label){case 0:return[4,Promise.all((e.detectors||[]).map(function(t){return K(void 0,void 0,void 0,function(){var r,n;return q(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.detect(e)];case 1:return r=o.sent(),a.diag.debug(t.constructor.name+" found resource.",r),[2,r];case 2:return n=o.sent(),a.diag.debug(t.constructor.name+" failed: "+n.message),[2,h.empty()];case 3:return[2]}})})}))];case 1:return W(t=r.sent()),[2,t.reduce(function(e,t){return e.merge(t)},h.empty())]}})})},J=function(e){void 0===e&&(e={});var t,r=(null!=(t=e.detectors)?t:[]).map(function(t){try{var r,n=t.detect(e);return(r=null!==n&&"object"==typeof n&&"function"==typeof n.then?new h({},K(void 0,void 0,void 0,function(){var e,t;return q(this,function(r){switch(r.label){case 0:return[4,n];case 1:return e=r.sent(),[4,null==(t=e.waitForAsyncAttributes)?void 0:t.call(e)];case 2:return r.sent(),[2,e.attributes]}})})):n).waitForAsyncAttributes?r.waitForAsyncAttributes().then(function(){return a.diag.debug(t.constructor.name+" found resource.",r)}):a.diag.debug(t.constructor.name+" found resource.",r),r}catch(e){return a.diag.error(t.constructor.name+" failed: "+e.message),h.empty()}}),n=r.reduce(function(e,t){return e.merge(t)},h.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(function(){W(r)}),n},W=function(e){e.forEach(function(e){if(Object.keys(e.attributes).length>0){var t=JSON.stringify(e.attributes,null,4);a.diag.verbose(t)}})}})(),module.exports=n})();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2015, David Bonnet <david@bonnet.cc>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";let e,t,i,r,n,s;var l={};l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};l.r(o),l.d(o,{EXPRESSIONS_PRECEDENCE:()=>u,GENERATOR:()=>f,NEEDS_PARENTHESES:()=>w,baseGenerator:()=>b,generate:()=>E});let{stringify:a}=JSON;if(!String.prototype.repeat)throw Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");let p={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},w=17,u={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:17,ClassExpression:17,FunctionExpression:17,ObjectExpression:17,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function h(e,t){let{generator:i}=e;if(e.write("("),null!=t&&t.length>0){i[t[0].type](t[0],e);let{length:r}=t;for(let n=1;n<r;n++){let r=t[n];e.write(", "),i[r.type](r,e)}}e.write(")")}function c(e,t,i,r){let n=e.expressionsPrecedence[t.type];if(n===w)return!0;let s=e.expressionsPrecedence[i.type];return n!==s?!r&&15===n&&14===s&&"**"===i.operator||n<s:(13===n||14===n)&&("**"===t.operator&&"**"===i.operator?!r:13===n&&13===s&&("??"===t.operator||"??"===i.operator)||(r?p[t.operator]<=p[i.operator]:p[t.operator]<p[i.operator]))}function m(e,t,i,r){let{generator:n}=e;c(e,t,i,r)?(e.write("("),n[t.type](t,e),e.write(")")):n[t.type](t,e)}function y(e,t,i,r){let{length:n}=t;for(let s=0;s<n;s++){let n=t[s];e.write(i),"L"===n.type[0]?e.write("// "+n.value.trim()+"\n",n):(e.write("/*"),function(e,t,i,r){let n=t.split("\n"),s=n.length-1;if(e.write(n[0].trim()),s>0){e.write(r);for(let t=1;t<s;t++)e.write(i+n[t].trim()+r);e.write(i+n[s].trim())}}(e,n.value,i,r),e.write("*/"+r))}}function d(e,t){let{generator:i}=e,{declarations:r}=t;e.write(t.kind+" ");let{length:n}=r;if(n>0){i.VariableDeclarator(r[0],e);for(let t=1;t<n;t++)e.write(", "),i.VariableDeclarator(r[t],e)}}let f={Program(e,t){let i=t.indent.repeat(t.indentLevel),{lineEnd:r,writeComments:n}=t;n&&null!=e.comments&&y(t,e.comments,i,r);let s=e.body,{length:l}=s;for(let e=0;e<l;e++){let l=s[e];n&&null!=l.comments&&y(t,l.comments,i,r),t.write(i),this[l.type](l,t),t.write(r)}n&&null!=e.trailingComments&&y(t,e.trailingComments,i,r)},BlockStatement:s=function(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t,s=i+t.indent;t.write("{");let l=e.body;if(null!=l&&l.length>0){t.write(r),n&&null!=e.comments&&y(t,e.comments,s,r);let{length:o}=l;for(let e=0;e<o;e++){let i=l[e];n&&null!=i.comments&&y(t,i.comments,s,r),t.write(s),this[i.type](i,t),t.write(r)}t.write(i)}else n&&null!=e.comments&&(t.write(r),y(t,e.comments,s,r),t.write(i));n&&null!=e.trailingComments&&y(t,e.trailingComments,s,r),t.write("}"),t.indentLevel--},ClassBody:s,StaticBlock(e,t){t.write("static "),this.BlockStatement(e,t)},EmptyStatement(e,t){t.write(";")},ExpressionStatement(e,t){let i=t.expressionsPrecedence[e.expression.type];i===w||3===i&&"O"===e.expression.left.type[0]?(t.write("("),this[e.expression.type](e.expression,t),t.write(")")):this[e.expression.type](e.expression,t),t.write(";")},IfStatement(e,t){t.write("if ("),this[e.test.type](e.test,t),t.write(") "),this[e.consequent.type](e.consequent,t),null!=e.alternate&&(t.write(" else "),this[e.alternate.type](e.alternate,t))},LabeledStatement(e,t){this[e.label.type](e.label,t),t.write(": "),this[e.body.type](e.body,t)},BreakStatement(e,t){t.write("break"),null!=e.label&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},ContinueStatement(e,t){t.write("continue"),null!=e.label&&(t.write(" "),this[e.label.type](e.label,t)),t.write(";")},WithStatement(e,t){t.write("with ("),this[e.object.type](e.object,t),t.write(") "),this[e.body.type](e.body,t)},SwitchStatement(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t;t.indentLevel++;let s=i+t.indent,l=s+t.indent;t.write("switch ("),this[e.discriminant.type](e.discriminant,t),t.write(") {"+r);let{cases:o}=e,{length:a}=o;for(let e=0;e<a;e++){let i=o[e];n&&null!=i.comments&&y(t,i.comments,s,r),i.test?(t.write(s+"case "),this[i.test.type](i.test,t),t.write(":"+r)):t.write(s+"default:"+r);let{consequent:a}=i,{length:p}=a;for(let e=0;e<p;e++){let i=a[e];n&&null!=i.comments&&y(t,i.comments,l,r),t.write(l),this[i.type](i,t),t.write(r)}}t.indentLevel-=2,t.write(i+"}")},ReturnStatement(e,t){t.write("return"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t)),t.write(";")},ThrowStatement(e,t){t.write("throw "),this[e.argument.type](e.argument,t),t.write(";")},TryStatement(e,t){if(t.write("try "),this[e.block.type](e.block,t),e.handler){let{handler:i}=e;null==i.param?t.write(" catch "):(t.write(" catch ("),this[i.param.type](i.param,t),t.write(") ")),this[i.body.type](i.body,t)}e.finalizer&&(t.write(" finally "),this[e.finalizer.type](e.finalizer,t))},WhileStatement(e,t){t.write("while ("),this[e.test.type](e.test,t),t.write(") "),this[e.body.type](e.body,t)},DoWhileStatement(e,t){t.write("do "),this[e.body.type](e.body,t),t.write(" while ("),this[e.test.type](e.test,t),t.write(");")},ForStatement(e,t){if(t.write("for ("),null!=e.init){let{init:i}=e;"V"===i.type[0]?d(t,i):this[i.type](i,t)}t.write("; "),e.test&&this[e.test.type](e.test,t),t.write("; "),e.update&&this[e.update.type](e.update,t),t.write(") "),this[e.body.type](e.body,t)},ForInStatement:e=function(e,t){t.write(`for ${e.await?"await ":""}(`);let{left:i}=e;"V"===i.type[0]?d(t,i):this[i.type](i,t),t.write("I"===e.type[3]?" in ":" of "),this[e.right.type](e.right,t),t.write(") "),this[e.body.type](e.body,t)},ForOfStatement:e,DebuggerStatement(e,t){t.write("debugger;",e)},FunctionDeclaration:t=function(e,t){t.write((e.async?"async ":"")+(e.generator?"function* ":"function ")+(e.id?e.id.name:""),e),h(t,e.params),t.write(" "),this[e.body.type](e.body,t)},FunctionExpression:t,VariableDeclaration(e,t){d(t,e),t.write(";")},VariableDeclarator(e,t){this[e.id.type](e.id,t),null!=e.init&&(t.write(" = "),this[e.init.type](e.init,t))},ClassDeclaration(e,t){if(t.write("class "+(e.id?`${e.id.name} `:""),e),e.superClass){t.write("extends ");let{superClass:i}=e,{type:r}=i,n=t.expressionsPrecedence[r];("C"!==r[0]||"l"!==r[1]||"E"!==r[5])&&(n===w||n<t.expressionsPrecedence.ClassExpression)?(t.write("("),this[e.superClass.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ")}this.ClassBody(e.body,t)},ImportDeclaration(e,t){t.write("import ");let{specifiers:i,attributes:r}=e,{length:n}=i,s=0;if(n>0){for(;s<n;){s>0&&t.write(", ");let e=i[s],r=e.type[6];if("D"===r)t.write(e.local.name,e),s++;else if("N"===r)t.write("* as "+e.local.name,e),s++;else break}if(s<n){for(t.write("{");;){let e=i[s],{name:r}=e.imported;if(t.write(r,e),r!==e.local.name&&t.write(" as "+e.local.name),++s<n)t.write(", ");else break}t.write("}")}t.write(" from ")}if(this.Literal(e.source,t),r&&r.length>0){t.write(" with { ");for(let e=0;e<r.length;e++)this.ImportAttribute(r[e],t),e<r.length-1&&t.write(", ");t.write(" }")}t.write(";")},ImportAttribute(e,t){this.Identifier(e.key,t),t.write(": "),this.Literal(e.value,t)},ImportExpression(e,t){t.write("import("),this[e.source.type](e.source,t),t.write(")")},ExportDefaultDeclaration(e,t){t.write("export default "),this[e.declaration.type](e.declaration,t),null!=t.expressionsPrecedence[e.declaration.type]&&"F"!==e.declaration.type[0]&&t.write(";")},ExportNamedDeclaration(e,t){if(t.write("export "),e.declaration)this[e.declaration.type](e.declaration,t);else{t.write("{");let{specifiers:i}=e,{length:r}=i;if(r>0)for(let e=0;;){let n=i[e],{name:s}=n.local;if(t.write(s,n),s!==n.exported.name&&t.write(" as "+n.exported.name),++e<r)t.write(", ");else break}if(t.write("}"),e.source&&(t.write(" from "),this.Literal(e.source,t)),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")}},ExportAllDeclaration(e,t){if(null!=e.exported?t.write("export * as "+e.exported.name+" from "):t.write("export * from "),this.Literal(e.source,t),e.attributes&&e.attributes.length>0){t.write(" with { ");for(let i=0;i<e.attributes.length;i++)this.ImportAttribute(e.attributes[i],t),i<e.attributes.length-1&&t.write(", ");t.write(" }")}t.write(";")},MethodDefinition(e,t){e.static&&t.write("static ");let i=e.kind[0];("g"===i||"s"===i)&&t.write(e.kind+" "),e.value.async&&t.write("async "),e.value.generator&&t.write("*"),e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),h(t,e.value.params),t.write(" "),this[e.value.body.type](e.value.body,t)},ClassExpression(e,t){this.ClassDeclaration(e,t)},ArrowFunctionExpression(e,t){t.write(e.async?"async ":"",e);let{params:i}=e;null!=i&&(1===i.length&&"I"===i[0].type[0]?t.write(i[0].name,i[0]):h(t,e.params)),t.write(" => "),"O"===e.body.type[0]?(t.write("("),this.ObjectExpression(e.body,t),t.write(")")):this[e.body.type](e.body,t)},ThisExpression(e,t){t.write("this",e)},Super(e,t){t.write("super",e)},RestElement:i=function(e,t){t.write("..."),this[e.argument.type](e.argument,t)},SpreadElement:i,YieldExpression(e,t){t.write(e.delegate?"yield*":"yield"),e.argument&&(t.write(" "),this[e.argument.type](e.argument,t))},AwaitExpression(e,t){t.write("await ",e),m(t,e.argument,e)},TemplateLiteral(e,t){let{quasis:i,expressions:r}=e;t.write("`");let{length:n}=r;for(let e=0;e<n;e++){let n=r[e],s=i[e];t.write(s.value.raw,s),t.write("${"),this[n.type](n,t),t.write("}")}let s=i[i.length-1];t.write(s.value.raw,s),t.write("`")},TemplateElement(e,t){t.write(e.value.raw,e)},TaggedTemplateExpression(e,t){m(t,e.tag,e),this[e.quasi.type](e.quasi,t)},ArrayExpression:n=function(e,t){if(t.write("["),e.elements.length>0){let{elements:i}=e,{length:r}=i;for(let e=0;;){let n=i[e];if(null!=n&&this[n.type](n,t),++e<r)t.write(", ");else{null==n&&t.write(", ");break}}}t.write("]")},ArrayPattern:n,ObjectExpression(e,t){let i=t.indent.repeat(t.indentLevel++),{lineEnd:r,writeComments:n}=t,s=i+t.indent;if(t.write("{"),e.properties.length>0){t.write(r),n&&null!=e.comments&&y(t,e.comments,s,r);let l=","+r,{properties:o}=e,{length:a}=o;for(let e=0;;){let i=o[e];if(n&&null!=i.comments&&y(t,i.comments,s,r),t.write(s),this[i.type](i,t),++e<a)t.write(l);else break}t.write(r),n&&null!=e.trailingComments&&y(t,e.trailingComments,s,r),t.write(i+"}")}else n?null!=e.comments?(t.write(r),y(t,e.comments,s,r),null!=e.trailingComments&&y(t,e.trailingComments,s,r),t.write(i+"}")):null!=e.trailingComments?(t.write(r),y(t,e.trailingComments,s,r),t.write(i+"}")):t.write("}"):t.write("}");t.indentLevel--},Property(e,t){e.method||"i"!==e.kind[0]?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write("["),this[e.key.type](e.key,t),t.write("]")):this[e.key.type](e.key,t),t.write(": ")),this[e.value.type](e.value,t))},PropertyDefinition(e,t){if(e.static&&t.write("static "),e.computed&&t.write("["),this[e.key.type](e.key,t),e.computed&&t.write("]"),null==e.value){"F"!==e.key.type[0]&&t.write(";");return}t.write(" = "),this[e.value.type](e.value,t),t.write(";")},ObjectPattern(e,t){if(t.write("{"),e.properties.length>0){let{properties:i}=e,{length:r}=i;for(let e=0;;)if(this[i[e].type](i[e],t),++e<r)t.write(", ");else break}t.write("}")},SequenceExpression(e,t){h(t,e.expressions)},UnaryExpression(e,t){if(e.prefix){let{operator:i,argument:r,argument:{type:n}}=e;t.write(i);let s=c(t,r,e);!s&&(i.length>1||"U"===n[0]&&("n"===n[1]||"p"===n[1])&&r.prefix&&r.operator[0]===i&&("+"===i||"-"===i))&&t.write(" "),s?(t.write(i.length>1?" (":"("),this[n](r,t),t.write(")")):this[n](r,t)}else this[e.argument.type](e.argument,t),t.write(e.operator)},UpdateExpression(e,t){e.prefix?(t.write(e.operator),this[e.argument.type](e.argument,t)):(this[e.argument.type](e.argument,t),t.write(e.operator))},AssignmentExpression(e,t){this[e.left.type](e.left,t),t.write(" "+e.operator+" "),this[e.right.type](e.right,t)},AssignmentPattern(e,t){this[e.left.type](e.left,t),t.write(" = "),this[e.right.type](e.right,t)},BinaryExpression:r=function(e,t){let i="in"===e.operator;i&&t.write("("),m(t,e.left,e,!1),t.write(" "+e.operator+" "),m(t,e.right,e,!0),i&&t.write(")")},LogicalExpression:r,ConditionalExpression(e,t){let{test:i}=e,r=t.expressionsPrecedence[i.type];r===w||r<=t.expressionsPrecedence.ConditionalExpression?(t.write("("),this[i.type](i,t),t.write(")")):this[i.type](i,t),t.write(" ? "),this[e.consequent.type](e.consequent,t),t.write(" : "),this[e.alternate.type](e.alternate,t)},NewExpression(e,t){t.write("new ");let i=t.expressionsPrecedence[e.callee.type];i===w||i<t.expressionsPrecedence.CallExpression||function(e){let t=e;for(;null!=t;){let{type:e}=t;if("C"===e[0]&&"a"===e[1])return!0;if("M"!==e[0]||"e"!==e[1]||"m"!==e[2])return!1;t=t.object}}(e.callee)?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),h(t,e.arguments)},CallExpression(e,t){let i=t.expressionsPrecedence[e.callee.type];i===w||i<t.expressionsPrecedence.CallExpression?(t.write("("),this[e.callee.type](e.callee,t),t.write(")")):this[e.callee.type](e.callee,t),e.optional&&t.write("?."),h(t,e.arguments)},ChainExpression(e,t){this[e.expression.type](e.expression,t)},MemberExpression(e,t){let i=t.expressionsPrecedence[e.object.type];i===w||i<t.expressionsPrecedence.MemberExpression?(t.write("("),this[e.object.type](e.object,t),t.write(")")):this[e.object.type](e.object,t),e.computed?(e.optional&&t.write("?."),t.write("["),this[e.property.type](e.property,t),t.write("]")):(e.optional?t.write("?."):t.write("."),this[e.property.type](e.property,t))},MetaProperty(e,t){t.write(e.meta.name+"."+e.property.name,e)},Identifier(e,t){t.write(e.name,e)},PrivateIdentifier(e,t){t.write(`#${e.name}`,e)},Literal(e,t){null!=e.raw?t.write(e.raw,e):null!=e.regex?this.RegExpLiteral(e,t):null!=e.bigint?t.write(e.bigint+"n",e):t.write(a(e.value),e)},RegExpLiteral(e,t){let{regex:i}=e;t.write(`/${i.pattern}/${i.flags}`,e)}},g={},b=f;class x{constructor(e){const t=null==e?g:e;this.output="",null!=t.output?(this.output=t.output,this.write=this.writeToStream):this.output="",this.generator=null!=t.generator?t.generator:f,this.expressionsPrecedence=null!=t.expressionsPrecedence?t.expressionsPrecedence:u,this.indent=null!=t.indent?t.indent:" ",this.lineEnd=null!=t.lineEnd?t.lineEnd:"\n",this.indentLevel=null!=t.startingIndentLevel?t.startingIndentLevel:0,this.writeComments=!!t.comments&&t.comments,null!=t.sourceMap&&(this.write=null==t.output?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=t.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split("\n").length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,t){this.output+=e,this.map(e,t)}writeToStreamAndMap(e,t){this.output.write(e),this.map(e,t)}map(e,t){if(null!=t){let{type:i}=t;if("L"===i[0]&&"n"===i[2]){this.column=0,this.line++;return}if(null!=t.loc){let{mapping:e}=this;e.original=t.loc.start,e.name=t.name,this.sourceMap.addMapping(e)}if("T"===i[0]&&"E"===i[8]||"L"===i[0]&&"i"===i[1]&&"string"==typeof t.value){let{length:t}=e,{column:i,line:r}=this;for(let n=0;n<t;n++)"\n"===e[n]?(i=0,r++):i++;this.column=i,this.line=r;return}}let{length:i}=e,{lineEnd:r}=this;i>0&&(this.lineEndSize>0&&(1===r.length?e[i-1]===r:e.endsWith(r))?(this.line+=this.lineEndSize,this.column=0):this.column+=i)}toString(){return this.output}}function E(e,t){let i=new x(t);return i.generator[e.type](e,i),i.output}module.exports=o})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={"./crypto-randomuuid/index.js":function(e,t,o){let n=o("crypto");e.exports="function"==typeof n.randomUUID?n.randomUUID:o("./crypto-randomuuid/polyfill.js")},"./crypto-randomuuid/polyfill.js":function(e,t,o){let n,r,i,s=o("crypto"),{validateBoolean:c,validateObject:u,codes:{ERR_OPERATION_FAILED:l}}=o("./crypto-randomuuid/validators.js"),{randomFillSync:a}=s;function f(e){return a(Buffer.alloc(e))}let p=0;function d(e,t=0){let o=function(){if(void 0===i){i=Array(256);for(let e=0;e<i.length;e++){let t=e.toString(16);i[e]=t.padStart(2,"0")}}return i}();return o[e[t]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[15&e[t+6]|64]+o[e[t+7]]+"-"+o[63&e[t+8]|128]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}e.exports=function(e){void 0!==e&&u(e,"options");let{disableEntropyCache:t=!1}=e||{};return c(t,"options.disableEntropyCache"),t?function(){if(r||(r=f(2048)),void 0===r)throw new l("Out of memory");return a(r),d(r)}():function(){if(n||(n=f(2048)),void 0===n)throw new l("Out of memory");return 0===p&&a(n),d(n,16*(p=(p+1)%128))}()}},"./crypto-randomuuid/validators.js":function(e,t,o){let n=o("assert"),r=o("util"),i=["string","function","number","object","Function","Object","boolean","bigint","symbol"];class s extends TypeError{constructor(e){super(`Operation failed: ${e}`),this.code=this.constructor.name,Object.defineProperties(this,{toString:{value(){return`${this.name} [${this.code}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}})}}class c extends TypeError{constructor(e,t,o){super(),n("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let s="The ";if(e.endsWith(" argument"))s+=`${e} `;else{const t=e.includes(".")?"property":"argument";s+=`"${e}" ${t} `}s+="must be ";const c=[],u=[],l=[];for(const e of t)n("string"==typeof e,"All expected entries have to be of type string"),i.includes(e)?c.push(e.toLowerCase()):classRegExp.test(e)?u.push(e):(n("object"!==e,'The value "object" should be written as "Object"'),l.push(e));if(u.length>0){const e=c.indexOf("object");-1!==e&&(c.splice(e,1),u.push("Object"))}if(c.length>0){if(c.length>2){const e=c.pop();s+=`one of type ${c.join(", ")}, or ${e}`}else 2===c.length?s+=`one of type ${c[0]} or ${c[1]}`:s+=`of type ${c[0]}`;(u.length>0||l.length>0)&&(s+=" or ")}if(u.length>0){if(u.length>2){const e=u.pop();s+=`an instance of ${u.join(", ")}, or ${e}`}else s+=`an instance of ${u[0]}`,2===u.length&&(s+=` or ${u[1]}`);l.length>0&&(s+=" or ")}if(l.length>0)if(l.length>2){const e=l.pop();s+=`one of ${l.join(", ")}, or ${e}`}else 2===l.length?s+=`one of ${l[0]} or ${l[1]}`:(l[0].toLowerCase()!==l[0]&&(s+="an "),s+=`${l[0]}`);if(null==o)s+=`. Received ${o}`;else if("function"==typeof o&&o.name)s+=`. Received function ${o.name}`;else if("object"==typeof o)if(o.constructor&&o.constructor.name)s+=`. Received an instance of ${o.constructor.name}`;else{const e=r.inspect(o,{depth:-1});s+=`. Received ${e}`}else{let e=r.inspect(o,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),s+=`. Received type ${typeof o} (${e})`}this.code=this.constructor.name,Object.defineProperties(this,{message:{value:s,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${this.code}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}})}}e.exports={validateBoolean:function(e,t){if("boolean"!=typeof e)throw new c(t,"boolean",e)},validateObject:function(e,t,{nullable:o=!1,allowArray:n=!1,allowFunction:r=!1}={}){if(!o&&null===e||!n&&Array.isArray(e)||"object"!=typeof e&&(!r||"function"!=typeof e))throw new c(t,"Object",e)},codes:{ERR_OPERATION_FAILED:s}}},assert:function(e){e.exports=require("assert")},crypto:function(e){e.exports=require("crypto")},util:function(e){e.exports=require("util")}},t={},o=function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}("./crypto-randomuuid/index.js");module.exports=o})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={};e.d=(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},e.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function t(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}e.r(r),e.d(r,{default:()=>t}),module.exports=r})();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Copyright (c) 2013, Joel Feenstra
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
* Redistributions of source code must retain the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
* Neither the name of the ESQuery nor the names of its contributors may
|
|
12
|
+
be used to endorse or promote products derived from this software without
|
|
13
|
+
specific prior written permission.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY
|
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={};e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}(e,t)||o(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){return e(t={exports:{}},t.exports),t.exports}e.r(t),e.d(t,{default:()=>E}),"undefined"!=typeof globalThis||("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self);var s=i(function(e,t){!function e(t){var r,n,o,a,i,s;function l(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?l(r):r);return n}function u(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},u.prototype.replace=function(e){this.parent[this.key]=e},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(o=[],e=2,t=this.__leavelist.length;e<t;++e)a(o,this.__leavelist[e].path);return a(o,this.__current.path),o},f.prototype.type=function(){return this.current().type||this.__current.wrap},f.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},f.prototype.current=function(){return this.__current.node},f.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},f.prototype.notify=function(e){this.__state=e},f.prototype.skip=function(){this.notify(i)},f.prototype.break=function(){this.notify(a)},f.prototype.remove=function(){this.notify(s)},f.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=o,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},f.prototype.traverse=function(e,t){var r,n,o,s,l,u,f,d,m,x,v,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((o=r.pop())!==g){if(o.node){if(u=this.__execute(t.enter,o),this.__state===a||u===a)return;if(r.push(g),n.push(o),this.__state===i||u===i)continue;if(l=(s=o.node).type||o.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw Error("Unknown node type "+l+".");x=this.__fallback(s)}for(d=x.length;(d-=1)>=0;)if(v=s[f=x[d]]){if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(l,x[d]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}}else if(o=n.pop(),u=this.__execute(t.leave,o),this.__state===a||u===a)return},f.prototype.replace=function(e,t){var r,n,o,l,f,y,d,m,x,v,g,A,b;function E(e){var t,n,o,a;if(e.ref.remove()){for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key<n)break;--o.ref.key}}}for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,y=new c(e,null,null,new u(A={root:e},"root")),r.push(y),n.push(y);r.length;)if((y=r.pop())!==g){if(void 0!==(f=this.__execute(t.enter,y))&&f!==a&&f!==i&&f!==s&&(y.ref.replace(f),y.node=f),this.__state!==s&&f!==s||(E(y),y.node=null),this.__state===a||f===a)return A.root;if((o=y.node)&&(r.push(g),n.push(y),this.__state!==i&&f!==i)){if(l=o.type||y.wrap,!(x=this.__keys[l])){if(!this.__fallback)throw Error("Unknown node type "+l+".");x=this.__fallback(o)}for(d=x.length;(d-=1)>=0;)if(v=o[b=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(l,x[d]))y=new c(v[m],[b,m],"Property",new u(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[b,m],null,new u(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,b,null,new u(o,b)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==a&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||E(y),this.__state===a||f===a)break;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,u=[];if(!e.range)throw Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;i<a;i+=1)(o=l(t[i])).extendedRange=[0,e.range[0]],u.push(o);e.leadingComments=u}return e}for(i=0,a=t.length;i<a;i+=1)u.push(function(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}(l(t[i]),r));return s=0,d(e,{enter:function(e){for(var t;s<u.length&&!((t=u[s]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?n.Break:u[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;s<u.length&&(t=u[s],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?n.Break:u[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)}),l=i(function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}return"Expected "+function(e){var t,n,o,a=Array(e.length);for(t=0;t<e.length;t++)a[t]=r[(o=e[t]).type](o);if(a.sort(),a.length>0){for(t=1,n=1;t<a.length;t++)a[t-1]!==a[t]&&(a[n]=a[t],n++);a.length=n}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+(t?'"'+o(t)+'"':"end of input")+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,o,a,i,s={},l={start:em},u=em,c=ef(" ",!1),f=/^[^ [\],():#!=><~+.]/,p=ep([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=ef(">",!1),y=ef("~",!1),d=ef("+",!1),m=ef(",",!1),x=function(e,t){return[e].concat(t.map(function(e){return e[3]}))},v=ef("!",!1),g=ef("*",!1),A=ef("#",!1),b=ef("[",!1),E=ef("]",!1),S=/^[><!]/,_=ep([">","<","!"],!1,!1),C=ef("=",!1),P=function(e){return(e||"")+"="},w=/^[><]/,k=ep([">","<"],!1,!1),D=ef(".",!1),j=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},I=ef('"',!1),T=/^[^\\"]/,F=ep(["\\",'"'],!0,!1),O=ef("\\",!1),R={type:"any"},M=function(e,t){return e+t},L=function(e){return{type:"literal",value:e.join("").replace(/\\(.)/g,function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return" ";case"v":return"\v";default:return t}})}},B=ef("'",!1),U=/^[^\\']/,K=ep(["\\","'"],!0,!1),N=/^[0-9]/,W=ep([["0","9"]],!1,!1),V=ef("type(",!1),q=/^[^ )]/,G=ep([" ",")"],!0,!1),z=ef(")",!1),H=/^[imsu]/,Y=ep(["i","m","s","u"],!1,!1),$=ef("/",!1),J=/^[^\/]/,Q=ep(["/"],!0,!1),X=ef(":not(",!1),Z=ef(":matches(",!1),ee=ef(":has(",!1),et=ef(":first-child",!1),er=ef(":last-child",!1),en=ef(":nth-child(",!1),eo=ef(":nth-last-child(",!1),ea=ef(":",!1),ei=0,es=[{line:1,column:1}],el=0,eu=[],ec={};if("startRule"in r){if(!(r.startRule in l))throw Error("Can't start parsing from rule \""+r.startRule+'".');u=l[r.startRule]}function ef(e,t){return{type:"literal",text:e,ignoreCase:t}}function ep(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function eh(e){var r,n=es[e];if(n)return n;for(r=e-1;!es[r];)r--;for(n={line:(n=es[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return es[e]=n,n}function ey(e,t){var r=eh(e),n=eh(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function ed(e){ei<el||(ei>el&&(el=ei,eu=[]),eu.push(e))}function em(){var e,t,r,n,o=32*ei+0,a=ec[o];return a?(ei=a.nextPos,a.result):(e=ei,(t=ex())!==s&&(r=eA())!==s&&ex()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ei=e,e=s),e===s&&(e=ei,(t=ex())!==s&&(t=void 0),e=t),ec[o]={nextPos:ei,result:e},e)}function ex(){var e,r,n=32*ei+1,o=ec[n];if(o)return ei=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ei)?(r=" ",ei++):(r=s,ed(c));r!==s;)e.push(r),32===t.charCodeAt(ei)?(r=" ",ei++):(r=s,ed(c));return ec[n]={nextPos:ei,result:e},e}function ev(){var e,r,n,o=32*ei+2,a=ec[o];if(a)return ei=a.nextPos,a.result;if(r=[],f.test(t.charAt(ei))?(n=t.charAt(ei),ei++):(n=s,ed(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ei))?(n=t.charAt(ei),ei++):(n=s,ed(p));else r=s;return r!==s&&(r=r.join("")),e=r,ec[o]={nextPos:ei,result:e},e}function eg(){var e,r,n,o=32*ei+3,a=ec[o];return a?(ei=a.nextPos,a.result):(e=ei,(r=ex())!==s?(62===t.charCodeAt(ei)?(n=">",ei++):(n=s,ed(h)),n!==s&&ex()!==s?e=r="child":(ei=e,e=s)):(ei=e,e=s),e===s&&(e=ei,(r=ex())!==s?(126===t.charCodeAt(ei)?(n="~",ei++):(n=s,ed(y)),n!==s&&ex()!==s?e=r="sibling":(ei=e,e=s)):(ei=e,e=s),e===s&&(e=ei,(r=ex())!==s?(43===t.charCodeAt(ei)?(n="+",ei++):(n=s,ed(d)),n!==s&&ex()!==s?e=r="adjacent":(ei=e,e=s)):(ei=e,e=s),e===s&&(e=ei,32===t.charCodeAt(ei)?(r=" ",ei++):(r=s,ed(c)),r!==s&&(n=ex())!==s?e=r="descendant":(ei=e,e=s)))),ec[o]={nextPos:ei,result:e},e)}function eA(){var e,r,n,o,a,i,l,u,c=32*ei+5,f=ec[c];if(f)return ei=f.nextPos,f.result;if(e=ei,(r=eE())!==s){for(n=[],o=ei,(a=ex())!==s?(44===t.charCodeAt(ei)?(i=",",ei++):(i=s,ed(m)),i!==s&&(l=ex())!==s&&(u=eE())!==s?o=a=[a,i,l,u]:(ei=o,o=s)):(ei=o,o=s);o!==s;)n.push(o),o=ei,(a=ex())!==s?(44===t.charCodeAt(ei)?(i=",",ei++):(i=s,ed(m)),i!==s&&(l=ex())!==s&&(u=eE())!==s?o=a=[a,i,l,u]:(ei=o,o=s)):(ei=o,o=s);n!==s?e=r=x(r,n):(ei=e,e=s)}else ei=e,e=s;return ec[c]={nextPos:ei,result:e},e}function eb(){var e,t,r,n,o,a=32*ei+6,i=ec[a];return i?(ei=i.nextPos,i.result):(e=ei,(t=eg())===s&&(t=null),t!==s&&(r=eE())!==s?(o=r,e=t=(n=t)?{type:n,left:{type:"exactNode"},right:o}:o):(ei=e,e=s),ec[a]={nextPos:ei,result:e},e)}function eE(){var e,t,r,n,o,a,i,l=32*ei+7,u=ec[l];if(u)return ei=u.nextPos,u.result;if(e=ei,(t=eS())!==s){for(r=[],n=ei,(o=eg())!==s&&(a=eS())!==s?n=o=[o,a]:(ei=n,n=s);n!==s;)r.push(n),n=ei,(o=eg())!==s&&(a=eS())!==s?n=o=[o,a]:(ei=n,n=s);r!==s?(i=t,e=t=r.reduce(function(e,t){return{type:t[0],left:e,right:t[1]}},i)):(ei=e,e=s)}else ei=e,e=s;return ec[l]={nextPos:ei,result:e},e}function eS(){var e,r,n,o,a,i,l,u=32*ei+8,c=ec[u];if(c)return ei=c.nextPos,c.result;if(e=ei,33===t.charCodeAt(ei)?(r="!",ei++):(r=s,ed(v)),r===s&&(r=null),r!==s){if(n=[],(o=e_())!==s)for(;o!==s;)n.push(o),o=e_();else n=s;n!==s?(a=r,l=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(l.subject=!0),e=r=l):(ei=e,e=s)}else ei=e,e=s;return ec[u]={nextPos:ei,result:e},e}function e_(){var e,r,n,o,a,i,l,u,c,f,p,h,y,d,es,el,eu,ef,ep,eh,ey,em,eg,eE,eS,e_,ek,eD,ej,eI,eT,eF,eO,eR,eM,eL,eB,eU,eK,eN,eW,eV,eq,eG,ez,eH,eY,e$,eJ,eQ,eX,eZ,e1,e0,e2,e3,e4,e9,e6,e5,e7,e8,te,tt,tr,tn,to,ta=32*ei+9,ti=ec[ta];return ti?(ei=ti.nextPos,ti.result):((to=(o=ec[n=32*ei+10])?(ei=o.nextPos,o.result):(42===t.charCodeAt(ei)?(r="*",ei++):(r=s,ed(g)),r!==s&&(r={type:"wildcard",value:r}),e=r,ec[n]={nextPos:ei,result:e},e))===s&&(to=(c=ec[u=32*ei+11])?(ei=c.nextPos,c.result):(a=ei,35===t.charCodeAt(ei)?(i="#",ei++):(i=s,ed(A)),i===s&&(i=null),i!==s&&(l=ev())!==s?a=i={type:"identifier",value:l}:(ei=a,a=s),ec[u]={nextPos:ei,result:a},a))===s&&(to=(es=ec[d=32*ei+12])?(ei=es.nextPos,es.result):(f=ei,91===t.charCodeAt(ei)?(p="[",ei++):(p=s,ed(b)),p!==s&&ex()!==s&&(h=(ey=ec[eh=32*ei+16])?(ei=ey.nextPos,ey.result):(el=ei,(eu=eC())!==s&&ex()!==s&&(ef=(e_=ec[eS=32*ei+14])?(ei=e_.nextPos,e_.result):(em=ei,33===t.charCodeAt(ei)?(eg="!",ei++):(eg=s,ed(v)),eg===s&&(eg=null),eg!==s?(61===t.charCodeAt(ei)?(eE="=",ei++):(eE=s,ed(C)),eE!==s?em=eg=P(eg):(ei=em,em=s)):(ei=em,em=s),ec[eS]={nextPos:ei,result:em},em))!==s&&ex()!==s?((ep=function(){var e,r,n,o,a,i=32*ei+20,l=ec[i];if(l)return ei=l.nextPos,l.result;if(e=ei,"type("===t.substr(ei,5)?(r="type(",ei+=5):(r=s,ed(V)),r!==s)if(ex()!==s){if(n=[],q.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(G)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(G));else n=s;n!==s&&(o=ex())!==s?(41===t.charCodeAt(ei)?(a=")",ei++):(a=s,ed(z)),a!==s?e=r={type:"type",value:n.join("")}:(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;else ei=e,e=s;return ec[i]={nextPos:ei,result:e},e}())===s&&(ep=function(){var e,r,n,o,a,i,l=32*ei+22,u=ec[l];if(u)return ei=u.nextPos,u.result;if(e=ei,47===t.charCodeAt(ei)?(r="/",ei++):(r=s,ed($)),r!==s){if(n=[],J.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(Q)),o!==s)for(;o!==s;)n.push(o),J.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(Q));else n=s;n!==s?(47===t.charCodeAt(ei)?(o="/",ei++):(o=s,ed($)),o!==s?((a=function(){var e,r,n=32*ei+21,o=ec[n];if(o)return ei=o.nextPos,o.result;if(e=[],H.test(t.charAt(ei))?(r=t.charAt(ei),ei++):(r=s,ed(Y)),r!==s)for(;r!==s;)e.push(r),H.test(t.charAt(ei))?(r=t.charAt(ei),ei++):(r=s,ed(Y));else e=s;return ec[n]={nextPos:ei,result:e},e}())===s&&(a=null),a!==s?(i=a,e=r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")}):(ei=e,e=s)):(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;return ec[l]={nextPos:ei,result:e},e}()),ep!==s?el=eu=j(eu,ef,ep):(ei=el,el=s)):(ei=el,el=s),el===s&&(el=ei,(eu=eC())!==s&&ex()!==s&&(ef=(eT=ec[eI=32*ei+13])?(ei=eT.nextPos,eT.result):(ek=ei,S.test(t.charAt(ei))?(eD=t.charAt(ei),ei++):(eD=s,ed(_)),eD===s&&(eD=null),eD!==s?(61===t.charCodeAt(ei)?(ej="=",ei++):(ej=s,ed(C)),ej!==s?ek=eD=P(eD):(ei=ek,ek=s)):(ei=ek,ek=s),ek===s&&(w.test(t.charAt(ei))?(ek=t.charAt(ei),ei++):(ek=s,ed(k))),ec[eI]={nextPos:ei,result:ek},ek))!==s&&ex()!==s?((ep=function(){var e,r,n,o,a,i,l=32*ei+17,u=ec[l];if(u)return ei=u.nextPos,u.result;if(e=ei,34===t.charCodeAt(ei)?(r='"',ei++):(r=s,ed(I)),r!==s){for(n=[],T.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(F)),o===s&&(o=ei,92===t.charCodeAt(ei)?(a="\\",ei++):(a=s,ed(O)),a!==s?(t.length>ei?(i=t.charAt(ei),ei++):(i=s,ed(R)),i!==s?o=a=M(a,i):(ei=o,o=s)):(ei=o,o=s));o!==s;)n.push(o),T.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(F)),o===s&&(o=ei,92===t.charCodeAt(ei)?(a="\\",ei++):(a=s,ed(O)),a!==s?(t.length>ei?(i=t.charAt(ei),ei++):(i=s,ed(R)),i!==s?o=a=M(a,i):(ei=o,o=s)):(ei=o,o=s));n!==s?(34===t.charCodeAt(ei)?(o='"',ei++):(o=s,ed(I)),o!==s?e=r=L(n):(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;if(e===s)if(e=ei,39===t.charCodeAt(ei)?(r="'",ei++):(r=s,ed(B)),r!==s){for(n=[],U.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(K)),o===s&&(o=ei,92===t.charCodeAt(ei)?(a="\\",ei++):(a=s,ed(O)),a!==s?(t.length>ei?(i=t.charAt(ei),ei++):(i=s,ed(R)),i!==s?o=a=M(a,i):(ei=o,o=s)):(ei=o,o=s));o!==s;)n.push(o),U.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(K)),o===s&&(o=ei,92===t.charCodeAt(ei)?(a="\\",ei++):(a=s,ed(O)),a!==s?(t.length>ei?(i=t.charAt(ei),ei++):(i=s,ed(R)),i!==s?o=a=M(a,i):(ei=o,o=s)):(ei=o,o=s));n!==s?(39===t.charCodeAt(ei)?(o="'",ei++):(o=s,ed(B)),o!==s?e=r=L(n):(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;return ec[l]={nextPos:ei,result:e},e}())===s&&(ep=function(){var e,r,n,o,a,i,l=32*ei+18,u=ec[l];if(u)return ei=u.nextPos,u.result;for(e=ei,r=ei,n=[],N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W));o!==s;)n.push(o),N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W));if(n!==s?(46===t.charCodeAt(ei)?(o=".",ei++):(o=s,ed(D)),o!==s?r=n=[n,o]:(ei=r,r=s)):(ei=r,r=s),r===s&&(r=null),r!==s){if(n=[],N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W));else n=s;n!==s?(i=n,e=r={type:"literal",value:parseFloat(((a=r)?[].concat.apply([],a).join(""):"")+i.join(""))}):(ei=e,e=s)}else ei=e,e=s;return ec[l]={nextPos:ei,result:e},e}())===s&&(ep=(eM=ec[eR=32*ei+19])?(ei=eM.nextPos,eM.result):((eO=ev())!==s&&(eO={type:"literal",value:eO}),eF=eO,ec[eR]={nextPos:ei,result:eF},eF)),ep!==s?el=eu=j(eu,ef,ep):(ei=el,el=s)):(ei=el,el=s),el===s&&(el=ei,(eu=eC())!==s&&(eu={type:"attribute",name:eu}),el=eu)),ec[eh]={nextPos:ei,result:el},el))!==s&&ex()!==s?(93===t.charCodeAt(ei)?(y="]",ei++):(y=s,ed(E)),y!==s?f=p=h:(ei=f,f=s)):(ei=f,f=s),ec[d]={nextPos:ei,result:f},f))===s&&(to=function(){var e,r,n,o,a,i,l,u=32*ei+23,c=ec[u];if(c)return ei=c.nextPos,c.result;if(e=ei,46===t.charCodeAt(ei)?(r=".",ei++):(r=s,ed(D)),r!==s)if((n=ev())!==s){for(o=[],a=ei,46===t.charCodeAt(ei)?(i=".",ei++):(i=s,ed(D)),i!==s&&(l=ev())!==s?a=i=[i,l]:(ei=a,a=s);a!==s;)o.push(a),a=ei,46===t.charCodeAt(ei)?(i=".",ei++):(i=s,ed(D)),i!==s&&(l=ev())!==s?a=i=[i,l]:(ei=a,a=s);o!==s?e=r={type:"field",name:o.reduce(function(e,t){return e+t[0]+t[1]},n)}:(ei=e,e=s)}else ei=e,e=s;else ei=e,e=s;return ec[u]={nextPos:ei,result:e},e}())===s&&(to=(eW=ec[eN=32*ei+24])?(ei=eW.nextPos,eW.result):(eL=ei,":not("===t.substr(ei,5)?(eB=":not(",ei+=5):(eB=s,ed(X)),eB!==s&&ex()!==s&&(eU=eA())!==s&&ex()!==s?(41===t.charCodeAt(ei)?(eK=")",ei++):(eK=s,ed(z)),eK!==s?eL=eB={type:"not",selectors:eU}:(ei=eL,eL=s)):(ei=eL,eL=s),ec[eN]={nextPos:ei,result:eL},eL))===s&&(to=(eY=ec[eH=32*ei+25])?(ei=eY.nextPos,eY.result):(eV=ei,":matches("===t.substr(ei,9)?(eq=":matches(",ei+=9):(eq=s,ed(Z)),eq!==s&&ex()!==s&&(eG=eA())!==s&&ex()!==s?(41===t.charCodeAt(ei)?(ez=")",ei++):(ez=s,ed(z)),ez!==s?eV=eq={type:"matches",selectors:eG}:(ei=eV,eV=s)):(ei=eV,eV=s),ec[eH]={nextPos:ei,result:eV},eV))===s&&(to=(e1=ec[eZ=32*ei+26])?(ei=e1.nextPos,e1.result):(e$=ei,":has("===t.substr(ei,5)?(eJ=":has(",ei+=5):(eJ=s,ed(ee)),eJ!==s&&ex()!==s&&(eQ=function(){var e,r,n,o,a,i,l,u,c=32*ei+4,f=ec[c];if(f)return ei=f.nextPos,f.result;if(e=ei,(r=eb())!==s){for(n=[],o=ei,(a=ex())!==s?(44===t.charCodeAt(ei)?(i=",",ei++):(i=s,ed(m)),i!==s&&(l=ex())!==s&&(u=eb())!==s?o=a=[a,i,l,u]:(ei=o,o=s)):(ei=o,o=s);o!==s;)n.push(o),o=ei,(a=ex())!==s?(44===t.charCodeAt(ei)?(i=",",ei++):(i=s,ed(m)),i!==s&&(l=ex())!==s&&(u=eb())!==s?o=a=[a,i,l,u]:(ei=o,o=s)):(ei=o,o=s);n!==s?e=r=x(r,n):(ei=e,e=s)}else ei=e,e=s;return ec[c]={nextPos:ei,result:e},e}())!==s&&ex()!==s?(41===t.charCodeAt(ei)?(eX=")",ei++):(eX=s,ed(z)),eX!==s?e$=eJ={type:"has",selectors:eQ}:(ei=e$,e$=s)):(ei=e$,e$=s),ec[eZ]={nextPos:ei,result:e$},e$))===s&&(to=(e4=ec[e3=32*ei+27])?(ei=e4.nextPos,e4.result):(":first-child"===t.substr(ei,12)?(e2=":first-child",ei+=12):(e2=s,ed(et)),e2!==s&&(e2=eP(1)),e0=e2,ec[e3]={nextPos:ei,result:e0},e0))===s&&(to=(e7=ec[e5=32*ei+28])?(ei=e7.nextPos,e7.result):(":last-child"===t.substr(ei,11)?(e6=":last-child",ei+=11):(e6=s,ed(er)),e6!==s&&(e6=ew(1)),e9=e6,ec[e5]={nextPos:ei,result:e9},e9))===s&&(to=function(){var e,r,n,o,a,i=32*ei+29,l=ec[i];if(l)return ei=l.nextPos,l.result;if(e=ei,":nth-child("===t.substr(ei,11)?(r=":nth-child(",ei+=11):(r=s,ed(en)),r!==s)if(ex()!==s){if(n=[],N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W));else n=s;n!==s&&(o=ex())!==s?(41===t.charCodeAt(ei)?(a=")",ei++):(a=s,ed(z)),a!==s?e=r=eP(parseInt(n.join(""),10)):(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;else ei=e,e=s;return ec[i]={nextPos:ei,result:e},e}())===s&&(to=function(){var e,r,n,o,a,i=32*ei+30,l=ec[i];if(l)return ei=l.nextPos,l.result;if(e=ei,":nth-last-child("===t.substr(ei,16)?(r=":nth-last-child(",ei+=16):(r=s,ed(eo)),r!==s)if(ex()!==s){if(n=[],N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ei))?(o=t.charAt(ei),ei++):(o=s,ed(W));else n=s;n!==s&&(o=ex())!==s?(41===t.charCodeAt(ei)?(a=")",ei++):(a=s,ed(z)),a!==s?e=r=ew(parseInt(n.join(""),10)):(ei=e,e=s)):(ei=e,e=s)}else ei=e,e=s;else ei=e,e=s;return ec[i]={nextPos:ei,result:e},e}())===s&&(to=(tn=ec[tr=32*ei+31])?(ei=tn.nextPos,tn.result):(e8=ei,58===t.charCodeAt(ei)?(te=":",ei++):(te=s,ed(ea)),te!==s&&(tt=ev())!==s?e8=te={type:"class",name:tt}:(ei=e8,e8=s),ec[tr]={nextPos:ei,result:e8},e8)),ec[ta]={nextPos:ei,result:to},to)}function eC(){var e,r,n,o,a,i,l,u=32*ei+15,c=ec[u];if(c)return ei=c.nextPos,c.result;if(e=ei,(r=ev())!==s){for(n=[],o=ei,46===t.charCodeAt(ei)?(a=".",ei++):(a=s,ed(D)),a!==s&&(i=ev())!==s?o=a=[a,i]:(ei=o,o=s);o!==s;)n.push(o),o=ei,46===t.charCodeAt(ei)?(a=".",ei++):(a=s,ed(D)),a!==s&&(i=ev())!==s?o=a=[a,i]:(ei=o,o=s);n!==s?(l=r,e=r=[].concat.apply([l],n).join("")):(ei=e,e=s)}else ei=e,e=s;return ec[u]={nextPos:ei,result:e},e}function eP(e){return{type:"nth-child",index:{type:"literal",value:e}}}function ew(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=u())!==s&&ei===t.length)return n;throw n!==s&&ei<t.length&&ed({type:"end"}),o=eu,a=el<t.length?t.charAt(el):null,i=el<t.length?ey(el,el+1):ey(el,el),new e(e.buildMessage(o,a),o,a,i)}}}())});function u(e,t){for(var r=0;r<t.length&&null!=e;++r)e=e[t[r]];return e}var c="function"==typeof WeakMap?new WeakMap:null;function f(e){if(null==e)return function(){return!0};if(null!=c){var t=c.get(e);return null!=t||(t=p(e),c.set(e,t)),t}return p(e)}function p(e){switch(e.type){case"wildcard":return function(){return!0};case"identifier":var t=e.value.toLowerCase();return function(e,r,n){return t===e[n&&n.nodeTypeKey||"type"].toLowerCase()};case"exactNode":return function(e,t){return 0===t.length};case"field":var n=e.name.split(".");return function(e,t){return function e(t,r,n,o){for(var a=r,i=o;i<n.length;++i){if(null==a)return!1;var s=a[n[i]];if(Array.isArray(s)){for(var l=0;l<s.length;++l)if(e(t,s[l],n,i+1))return!0;return!1}a=s}return t===a}(e,t[n.length-1],n,0)};case"matches":var o=e.selectors.map(f);return function(e,t,r){for(var n=0;n<o.length;++n)if(o[n](e,t,r))return!0;return!1};case"compound":var a=e.selectors.map(f);return function(e,t,r){for(var n=0;n<a.length;++n)if(!a[n](e,t,r))return!1;return!0};case"not":var i=e.selectors.map(f);return function(e,t,r){for(var n=0;n<i.length;++n)if(i[n](e,t,r))return!1;return!0};case"has":var l=e.selectors.map(f);return function(e,t,r){var n=!1,o=[];return s.traverse(e,{enter:function(e,t){null!=t&&o.unshift(t);for(var a=0;a<l.length;++a)if(l[a](e,o,r))return n=!0,void this.break()},leave:function(){o.shift()},keys:r&&r.visitorKeys,fallback:r&&r.fallback||"iteration"}),n};case"child":var c=f(e.left),p=f(e.right);return function(e,t,r){return!!(t.length>0&&p(e,t,r))&&c(t[0],t.slice(1),r)};case"descendant":var h=f(e.left),y=f(e.right);return function(e,t,r){if(y(e,t,r)){for(var n=0,o=t.length;n<o;++n)if(h(t[n],t.slice(n+1),r))return!0}return!1};case"attribute":var v=e.name.split(".");switch(e.operator){case void 0:return function(e){return null!=u(e,v)};case"=":switch(e.value.type){case"regexp":return function(t){var r=u(t,v);return"string"==typeof r&&e.value.value.test(r)};case"literal":var g="".concat(e.value.value);return function(e){return g==="".concat(u(e,v))};case"type":return function(t){return e.value.value===r(u(t,v))}}throw Error("Unknown selector value type: ".concat(e.value.type));case"!=":switch(e.value.type){case"regexp":return function(t){return!e.value.value.test(u(t,v))};case"literal":var A="".concat(e.value.value);return function(e){return A!=="".concat(u(e,v))};case"type":return function(t){return e.value.value!==r(u(t,v))}}throw Error("Unknown selector value type: ".concat(e.value.type));case"<=":return function(t){return u(t,v)<=e.value.value};case"<":return function(t){return u(t,v)<e.value.value};case">":return function(t){return u(t,v)>e.value.value};case">=":return function(t){return u(t,v)>=e.value.value}}throw Error("Unknown operator: ".concat(e.operator));case"sibling":var b=f(e.left),E=f(e.right);return function(t,r,n){return E(t,r,n)&&d(t,b,r,"LEFT_SIDE",n)||e.left.subject&&b(t,r,n)&&d(t,E,r,"RIGHT_SIDE",n)};case"adjacent":var S=f(e.left),_=f(e.right);return function(t,r,n){return _(t,r,n)&&m(t,S,r,"LEFT_SIDE",n)||e.right.subject&&S(t,r,n)&&m(t,_,r,"RIGHT_SIDE",n)};case"nth-child":var C=e.index.value,P=f(e.right);return function(e,t,r){return P(e,t,r)&&x(e,t,C,r)};case"nth-last-child":var w=-e.index.value,k=f(e.right);return function(e,t,r){return k(e,t,r)&&x(e,t,w,r)};case"class":var D=e.name.toLowerCase();return function(t,r,n){if(n&&n.matchClass)return n.matchClass(e.name,t,r);if(n&&n.nodeTypeKey)return!1;switch(D){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw Error("Unknown class name: ".concat(e.name))}}throw Error("Unknown selector type: ".concat(e.type))}function h(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:s.VisitorKeys[n]?s.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter(function(e){return e!==r})}function y(e,t){var n=t&&t.nodeTypeKey||"type";return null!==e&&"object"===r(e)&&"string"==typeof e[n]}function d(e,t,r,o,a){var i=n(r,1)[0];if(!i)return!1;for(var s=h(i,a),l=0;l<s.length;++l){var u=i[s[l]];if(Array.isArray(u)){var c=u.indexOf(e);if(c<0)continue;var f=void 0,p=void 0;"LEFT_SIDE"===o?(f=0,p=c):(f=c+1,p=u.length);for(var d=f;d<p;++d)if(y(u[d],a)&&t(u[d],r,a))return!0}}return!1}function m(e,t,r,o,a){var i=n(r,1)[0];if(!i)return!1;for(var s=h(i,a),l=0;l<s.length;++l){var u=i[s[l]];if(Array.isArray(u)){var c=u.indexOf(e);if(c<0)continue;if("LEFT_SIDE"===o&&c>0&&y(u[c-1],a)&&t(u[c-1],r,a)||"RIGHT_SIDE"===o&&c<u.length-1&&y(u[c+1],a)&&t(u[c+1],r,a))return!0}}return!1}function x(e,t,r,o){if(0===r)return!1;var a=n(t,1)[0];if(!a)return!1;for(var i=h(a,o),s=0;s<i.length;++s){var l=a[i[s]];if(Array.isArray(l)){var u=r<0?l.length+r:r-1;if(u>=0&&u<l.length&&l[u]===e)return!0}}return!1}function v(e,t,n,i){if(t){var l=[],u=f(t),c=(function e(t,n){if(null==t||"object"!=r(t))return[];null==n&&(n=t);for(var i=t.subject?[n]:[],s=Object.keys(t),l=0;l<s.length;++l){var u,c=s[l],f=t[c];i.push.apply(i,function(e){if(Array.isArray(e))return a(e)}(u=e(f,"left"===c?f:n))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||o(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return i})(t).map(f);s.traverse(e,{enter:function(e,t){if(null!=t&&l.unshift(t),u(e,l,i))if(c.length)for(var r=0,o=c.length;r<o;++r){c[r](e,l,i)&&n(e,t,l);for(var a=0,s=l.length;a<s;++a){var f=l.slice(a+1);c[r](l[a],f,i)&&n(l[a],t,f)}}else n(e,t,l)},leave:function(){l.shift()},keys:i&&i.visitorKeys,fallback:i&&i.fallback||"iteration"})}}function g(e,t,r){var n=[];return v(e,t,function(e){n.push(e)},r),n}function A(e){return l.parse(e)}function b(e,t,r){return g(e,A(t),r)}b.parse=A,b.match=g,b.traverse=v,b.matches=function(e,t,r,n){return!t||!!e&&(r||(r=[]),f(t)(e,r,n))},b.query=b;let E=b;module.exports=t})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) 2013 Kael Zhang <i@kael.me>, contributors
|
|
2
|
+
http://kael.me/
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
5
|
+
a copy of this software and associated documentation files (the
|
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
10
|
+
the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={"./ignore/index.js":function(t){function e(t){return Array.isArray(t)?t:[t]}let r,s=/^\s+$/,i=/(?:[^\\]|^)\\$/,n=/^\\!/,h=/^\\#/,o=/\r?\n/g,l=/^\.{0,2}\/|^\.{1,2}$/,a=/\/$/,u="node-ignore";"undefined"!=typeof Symbol&&(u=Symbol.for("node-ignore"));let c=u,d=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),g=/([0-z])-([0-z])/g,p=()=>!1,_=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(0===r.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+" "}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>e+r.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,i)=>"\\"===e?`\\[${r}${(t=>{let{length:e}=t;return t.slice(0,e-e%2)})(s)}${i}`:"]"===i&&s.length%2==0?`[${r.replace(g,(t,e,r)=>e.charCodeAt(0)<=r.charCodeAt(0)?t:"")}${s}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],f=/(^|\\\/)?\\\*$/,$="regex",x="checkRegex",y={[$](t,e){let r=e?`${e}[^/]+`:"[^/]*";return`${r}(?=$|\\/$)`},[x](t,e){let r=e?`${e}[^/]*`:"[^/]*";return`${r}(?=$|\\/$)`}};class C{constructor(t,e,r,s,i,n){this.pattern=t,this.mark=e,this.negative=i,d(this,"body",r),d(this,"ignoreCase",s),d(this,"regexPrefix",n)}get regex(){let t="_"+$;return this[t]?this[t]:this._make($,t)}get checkRegex(){let t="_"+x;return this[t]?this[t]:this._make(x,t)}_make(t,e){let r=this.regexPrefix.replace(f,y[t]);return d(this,e,this.ignoreCase?RegExp(r,"i"):new RegExp(r))}}class b{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){let e;if(t&&t[c]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if("string"==typeof t&&(t={pattern:t}),(e=t.pattern)&&"string"==typeof e&&!s.test(e)&&!i.test(e)&&0!==e.indexOf("#")){let e=(({pattern:t,mark:e},r)=>{let s,i=!1,o=t;0===o.indexOf("!")&&(i=!0,o=o.substr(1));let l=(s=o=o.replace(n,"!").replace(h,"#"),_.reduce((t,[e,r])=>t.replace(e,r.bind(s)),s));return new C(t,e,o,r,i,l)})(t,this._ignoreCase);this._added=!0,this._rules.push(e)}}add(t){return this._added=!1,e("string"==typeof t?t.split(o).filter(Boolean):t).forEach(this._add,this),this._added}test(t,e,s){let i,n=!1,h=!1;this._rules.forEach(o=>{let{negative:l}=o;(h!==l||n===h)&&(!l||n||h||e)&&o[s].test(t)&&(n=!l,h=l,i=l?r:o)});let o={ignored:n,unignored:h};return i&&(o.rule=i),o}}let v=(t,e)=>{throw new e(t)},m=(t,e,r)=>"string"!=typeof t?r(`path must be a string, but got \`${e}\``,TypeError):t?!m.isNotRelative(t)||r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):r("path must not be empty",TypeError),k=t=>l.test(t);m.isNotRelative=k,m.convert=t=>t;class w{constructor({ignorecase:t=!0,ignoreCase:e=t,allowRelativePaths:r=!1}={}){d(this,c,!0),this._rules=new b(e),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,e,r,s){let i=t&&m.convert(t);return m(i,t,this._strictPathCheck?v:p),this._t(i,e,r,s)}checkIgnore(t){if(!a.test(t))return this.test(t);let e=t.split("/").filter(Boolean);if(e.pop(),e.length){let t=this._t(e.join("/")+"/",this._testCache,!0,e);if(t.ignored)return t}return this._rules.test(t,!1,x)}_t(t,e,r,s){if(t in e)return e[t];if(s||(s=t.split("/").filter(Boolean)),s.pop(),!s.length)return e[t]=this._rules.test(t,r,$);let i=this._t(s.join("/")+"/",e,r,s);return e[t]=i.ignored?i:this._rules.test(t,r,$)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return e(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}let E=t=>new w(t),R=()=>{m.convert=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");let t=/^[a-z]:\//i;m.isNotRelative=e=>t.test(e)||k(e)};"undefined"!=typeof process&&"win32"===process.platform&&R(),t.exports=E,E.default=E,t.exports.isPathValid=t=>m(t&&m.convert(t),t,p),d(t.exports,Symbol.for("setupWindows"),R)}},e={},r=function r(s){var i=e[s];if(void 0!==i)return i.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,r),n.exports}("./ignore/index.js");module.exports=r})();
|