dd-trace 5.80.0 → 5.81.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 +35 -35
- package/loader-hook.mjs +10 -3
- package/package.json +22 -40
- package/packages/datadog-esbuild/index.js +36 -19
- package/packages/datadog-instrumentations/index.js +1 -0
- package/packages/datadog-instrumentations/src/anthropic.js +12 -0
- package/packages/datadog-instrumentations/src/aws-sdk.js +5 -1
- package/packages/datadog-instrumentations/src/cucumber.js +2 -2
- package/packages/datadog-instrumentations/src/find-my-way.js +6 -5
- package/packages/datadog-instrumentations/src/google-genai.js +120 -0
- package/packages/datadog-instrumentations/src/graphql.js +20 -0
- package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +10 -0
- package/packages/datadog-instrumentations/src/helpers/register.js +6 -1
- 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/index.js +5 -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/langchain.js +3 -109
- package/packages/datadog-instrumentations/src/mocha/main.js +1 -1
- package/packages/datadog-instrumentations/src/mysql2.js +1 -1
- package/packages/datadog-instrumentations/src/playwright.js +45 -16
- package/packages/datadog-instrumentations/src/router.js +1 -1
- package/packages/datadog-instrumentations/src/selenium.js +3 -1
- package/packages/datadog-instrumentations/src/ws.js +35 -17
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +1 -1
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +23 -2
- package/packages/datadog-plugin-cypress/src/plugin.js +1 -1
- package/packages/datadog-plugin-cypress/src/support.js +73 -31
- 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/tools/transforms.js +5 -4
- package/packages/datadog-plugin-jest/src/util.js +1 -1
- package/packages/datadog-plugin-langchain/src/tracing.js +7 -3
- package/packages/datadog-plugin-next/src/index.js +11 -3
- package/packages/dd-trace/src/aiguard/sdk.js +18 -10
- package/packages/dd-trace/src/appsec/api_security_sampler.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.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 +1 -2
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
- package/packages/dd-trace/src/appsec/reporter.js +0 -4
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +4 -8
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +4 -2
- package/packages/dd-trace/src/config.js +81 -7
- package/packages/dd-trace/src/config_defaults.js +14 -2
- package/packages/dd-trace/src/datastreams/encoding.js +23 -6
- package/packages/dd-trace/src/datastreams/pathway.js +40 -1
- package/packages/dd-trace/src/datastreams/processor.js +1 -1
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -1
- 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 +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +30 -15
- 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 +18 -8
- 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 +7 -2
- package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -1
- package/packages/dd-trace/src/debugger/index.js +1 -1
- package/packages/dd-trace/src/encode/span-stats.js +7 -1
- package/packages/dd-trace/src/histogram.js +1 -1
- package/packages/dd-trace/src/id.js +60 -0
- package/packages/dd-trace/src/lambda/runtime/ritm.js +1 -1
- package/packages/dd-trace/src/llmobs/constants/tags.js +1 -0
- 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/index.js +2 -2
- package/packages/dd-trace/src/llmobs/plugins/{openai.js → openai/index.js} +48 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +114 -0
- package/packages/dd-trace/src/llmobs/sdk.js +5 -0
- package/packages/dd-trace/src/llmobs/span_processor.js +6 -1
- package/packages/dd-trace/src/llmobs/tagger.js +4 -0
- 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/otlp_http_log_exporter.js +5 -3
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +8 -8
- 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 +532 -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 +36 -22
- package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +1 -1
- package/packages/dd-trace/src/opentelemetry/span.js +1 -1
- package/packages/dd-trace/src/opentelemetry/tracer.js +1 -1
- package/packages/dd-trace/src/opentelemetry/tracer_provider.js +1 -1
- package/packages/dd-trace/src/payload-tagging/index.js +2 -2
- package/packages/dd-trace/src/plugin_manager.js +4 -2
- package/packages/dd-trace/src/plugins/index.js +1 -0
- package/packages/dd-trace/src/plugins/util/test.js +3 -3
- package/packages/dd-trace/src/plugins/util/url.js +119 -1
- package/packages/dd-trace/src/plugins/util/web.js +10 -41
- package/packages/dd-trace/src/process-tags/index.js +81 -0
- package/packages/dd-trace/src/profiling/config.js +1 -1
- package/packages/dd-trace/src/profiling/exporters/agent.js +1 -1
- package/packages/dd-trace/src/profiling/profilers/events.js +10 -1
- package/packages/dd-trace/src/proxy.js +5 -0
- package/packages/dd-trace/src/rate_limiter.js +1 -1
- package/packages/dd-trace/src/remote_config/manager.js +1 -1
- package/packages/dd-trace/src/ritm.js +1 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
- package/packages/dd-trace/src/span_format.js +9 -4
- package/packages/dd-trace/src/span_processor.js +8 -3
- package/packages/dd-trace/src/span_stats.js +15 -4
- package/packages/dd-trace/src/spanleak.js +1 -1
- package/packages/dd-trace/src/supported-configurations.json +13 -0
- package/packages/dd-trace/src/telemetry/dependencies.js +1 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +11 -2
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={"./semifies/index.js":function(t){function e(t){return"latest"===t&&(t=">=0"),t.match(/^([^\d+]*)(\d.*)$/)||[null,"","*.*.*"]}function n(t,e){let n=t.slice(0);if(-1===t[e])return n;for(n[e++]++;e<3;e++)n[e]=0;return n}function r(t){return"x"===t||"X"===t||"*"===t||"latest"===t?-1:Number(t)}function i(t){return/^\d+$/.test(t)?Number(t):t}function u(t,e,n){return -1===n?"<"!==t:"="===t?e===n:">"===t?e>n:">="===t?e>=n:"<"===t?e<n:"<="===t&&e<=n}function l(t,e){let[n,u]=(t=t.split("+")[0]).split("-"),l=n.split(".").map(r).slice(0,3),s=Math.max(l.length-1,0);return(">"===e?(e=">=",l.push(0,0,0),l[s]++):""===e?l.push(0,0,0):l.push(-1,-1,-1),u)?[l.slice(0,3).concat(u.split(".").map(i)),e]:[l.slice(0,3),e]}t.exports=function(t,r){let[i]=l(t,"");for(let t of function(t){let r=[],i=[],u=t.trim().split(/\s+/);for(let t=0;t<u.length;t++){let s=u[t];if("-"===s)continue;if("||"===s){r.push(i),i=[];continue}if(/^[<>=~v^]+$/.test(s)&&t+1<u.length){u[t+1]=s+u[t+1];continue}let f=e(s),o=f[1]||"=";o.endsWith("v")&&(o=o.slice(0,-1));let[h,p]=l(f[2],o);if(t+2<u.length&&"-"===u[t+1]){let n=e(u[t+2]);u[t+2]="<="+(-1===n[2].indexOf("-")?n[2]+".*.*":n[2]),p=">="}if("~"===p[0]){let t=f[2].split("-")[0].split(".").length;i.push([">=",h]),i.push(["<",1===t?n(h,0):n(h,1)])}else if("^"===p[0]){let t=0!==h[0]?0:0!==h[1]?1:2;i.push([">=",h]),i.push(["<",0===t?n(h,0):1===t?n(h,1):n(h,2)])}else i.push([p.replace("~","").replace("^",""),h])}return i.length&&r.push(i),r}(r))if(function(t,e){for(let[n,r]of t)if(!function(t,e,n){if(!u("=",t[0],e[0]))return u(n,t[0],e[0]);if(!u("=",t[1],e[1]))return u(n,t[1],e[1]);if(!u("=",t[2],e[2])||3===t.length&&3===e.length)return u(n,t[2],e[2]);if("<"===n[0]&&(3===e.length||3===t.length))return!1;if(">"===n[0]){if(3===t.length)return!0;if(3===e.length)return!1}for(let r=3;r<Math.max(t.length,e.length);r++)if(u(n,t[r]||"",e[r]||""))return!0;return!1}(e,r,n))return!1;return!0}(t,i))return!0;return!1}}},e={},n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var u=e[r]={exports:{}};return t[r](u,u.exports,n),u.exports}("./semifies/index.js");module.exports=n})();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 James Halliday (mail@substack.net)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge,
|
|
6
|
+
to any person obtaining a copy of this software and
|
|
7
|
+
associated documentation files (the "Software"), to
|
|
8
|
+
deal in the Software without restriction, including
|
|
9
|
+
without limitation the rights to use, copy, modify,
|
|
10
|
+
merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom
|
|
12
|
+
the Software is furnished to do so,
|
|
13
|
+
subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice
|
|
16
|
+
shall be included in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
20
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
21
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
22
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
23
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
24
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={"./shell-quote/parse.js":function(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",r=RegExp("^"+t+"$"),n="|&;()<> \\t",o=/^#$/,i="",s=0;s<4;s++)i+=(0x100000000*Math.random()).toString(16);var a=RegExp("^"+i);e.exports=function(e,s,u){var c=function(e,s,a){a||(a={});var u=a.escape||"\\",c=function(e,t){for(var r,n=t.lastIndex,o=[];r=t.exec(e);)o.push(r),t.lastIndex===r.index&&(t.lastIndex+=1);return t.lastIndex=n,o}(e,RegExp(["("+t+")","("+("(\\"+u+"['\""+n+"]|[^\\s'\""+n)+"])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')+"].join("|"),"g"));if(0===c.length)return[];s||(s={});var f=!1;return c.map(function(t){var n,a=t[0];if(a&&!f){if(r.test(a))return{op:a};var c=!1,l=!1,p="",x=!1;for(n=0;n<a.length;n++){var v=a.charAt(n);if(x=x||!c&&("*"===v||"?"===v),l)p+=v,l=!1;else if(c)v===c?c=!1:"'"==c?p+=v:v===u?(n+=1,'"'===(v=a.charAt(n))||v===u||"$"===v?p+=v:p+=u+v):"$"===v?p+=g():p+=v;else if('"'===v||"'"===v)c=v;else if(r.test(v))return{op:a};else if(o.test(v)){f=!0;var d={comment:e.slice(t.index+n+1)};if(p.length)return[p,d];return[d]}else v===u?l=!0:"$"===v?p+=g():p+=v}return x?{op:"glob",pattern:p}:p}function g(){n+=1;var e,t,r,o,u,c=a.charAt(n);if("{"===c){if(n+=1,"}"===a.charAt(n))throw Error("Bad substitution: "+a.slice(n-2,n+1));if((o=a.indexOf("}",n))<0)throw Error("Bad substitution: "+a.slice(n));u=a.slice(n,o),n=o}else if(/[*@#?$!_-]/.test(c))u=c,n+=1;else{var f=a.slice(n);(o=f.match(/[^\w\d_]/))?(u=f.slice(0,o.index),n+=o.index-1):(u=f,n=a.length)}return e=s,t=u,(void 0===(r="function"==typeof e?e(t):e[t])&&""!=t?r="":void 0===r&&(r="$"),"object"==typeof r)?""+i+JSON.stringify(r)+i:""+r}}).reduce(function(e,t){return void 0===t?e:e.concat(t)},[])}(e,s,u);return"function"!=typeof s?c:c.reduce(function(e,t){if("object"==typeof t)return e.concat(t);var r=t.split(RegExp("("+i+".*?"+i+")","g"));return 1===r.length?e.concat(r[0]):e.concat(r.filter(Boolean).map(function(e){return a.test(e)?JSON.parse(e.split(i)[1]):e}))},[])}},"./shell-quote/quote.js":function(e){e.exports=function(e){return e.map(function(e){return""===e?"''":e&&"object"==typeof e?e.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}}},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}var n={};n.quote=r("./shell-quote/quote.js"),n.parse=r("./shell-quote/parse.js"),module.exports=n})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the names of the Mozilla Foundation nor the names of project
|
|
16
|
+
contributors may be used to endorse or promote products derived from this
|
|
17
|
+
software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={"./source-map/lib/array-set.js":function(e,n){class t{constructor(){this._array=[],this._set=new Map}static fromArray(e,n){let r=new t;for(let t=0,o=e.length;t<o;t++)r.add(e[t],n);return r}size(){return this._set.size}add(e,n){let t=this.has(e),r=this._array.length;(!t||n)&&this._array.push(e),t||this._set.set(e,r)}has(e){return this._set.has(e)}indexOf(e){let n=this._set.get(e);if(n>=0)return n;throw Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&e<this._array.length)return this._array[e];throw Error("No element indexed by "+e)}toArray(){return this._array.slice()}}n.ArraySet=t},"./source-map/lib/base64-vlq.js":function(e,n,t){let r=t("./source-map/lib/base64.js");n.encode=function(e){let n,t="",o=e<0?(-e<<1)+1:(e<<1)+0;do n=31&o,(o>>>=5)>0&&(n|=32),t+=r.encode(n);while(o>0);return t}},"./source-map/lib/base64.js":function(e,n){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<t.length)return t[e];throw TypeError("Must be between 0 and 63: "+e)}},"./source-map/lib/binary-search.js":function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,r,o){if(0===t.length)return -1;let s=function e(t,r,o,s,i,l){let a=Math.floor((r-t)/2)+t,u=i(o,s[a],!0);return 0===u?a:u>0?r-a>1?e(a,r,o,s,i,l):l===n.LEAST_UPPER_BOUND?r<s.length?r:-1:a:a-t>1?e(t,a,o,s,i,l):l==n.LEAST_UPPER_BOUND?a:t<0?-1:t}(-1,t.length,e,t,r,o||n.GREATEST_LOWER_BOUND);if(s<0)return -1;for(;s-1>=0&&0===r(t[s],t[s-1],!0);)--s;return s}},"./source-map/lib/mapping-list.js":function(e,n,t){let r=t("./source-map/lib/util.js");n.MappingList=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(e,n){this._array.forEach(e,n)}add(e){var n;let t,o,s,i;(n=this._last,t=n.generatedLine,o=e.generatedLine,s=n.generatedColumn,i=e.generatedColumn,o>t||o==t&&i>=s||0>=r.compareByGeneratedPositionsInflated(n,e))?this._last=e:this._sorted=!1,this._array.push(e)}toArray(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},"./source-map/lib/read-wasm.js":function(e,n,t){"use strict";let r=t("fs"),o=t("path");e.exports=function(){return new Promise((e,n)=>{let t=o.join(__dirname,"mappings.wasm");r.readFile(t,null,(t,r)=>{t?n(t):e(r.buffer)})})},e.exports.initialize=e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")}},"./source-map/lib/source-map-consumer.js":function(e,n,t){let r=t("./source-map/lib/util.js"),o=t("./source-map/lib/binary-search.js"),s=t("./source-map/lib/array-set.js").ArraySet;t("./source-map/lib/base64-vlq.js");let i=t("./source-map/lib/read-wasm.js"),l=t("./source-map/lib/wasm.js"),a=Symbol("smcInternal");class u{constructor(e,n){if(e==a)return Promise.resolve(this);return function(e,n){let t=e;return"string"==typeof e&&(t=r.parseSourceMapInput(e)),Promise.resolve(null!=t.sections?new g(t,n):new c(t,n))}(e,n)}static initialize(e){i.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,n){var t,r;return t=e,r=n,c.fromSourceMap(t,r)}static async with(e,n,t){let r=await new u(e,n);try{return await t(r)}finally{r.destroy()}}eachMapping(e,n,t){throw Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw Error("Subclasses must implement destroy")}}u.prototype._version=3,u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,n.SourceMapConsumer=u;class c extends u{constructor(e,n){return super(a).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));let i=r.getArg(o,"version"),a=r.getArg(o,"sources").map(String),u=r.getArg(o,"names",[]),c=r.getArg(o,"sourceRoot",null),g=r.getArg(o,"sourcesContent",null),h=r.getArg(o,"mappings"),m=r.getArg(o,"file",null),p=r.getArg(o,"x_google_ignoreList",null);if(i!=t._version)throw Error("Unsupported version: "+i);return t._sourceLookupCache=new Map,t._names=s.fromArray(u.map(String),!0),t._sources=s.fromArray(a,!0),t._absoluteSources=s.fromArray(t._sources.toArray().map(function(e){return r.computeSourceURL(c,e,n)}),!0),t.sourceRoot=c,t.sourcesContent=g,t._mappings=h,t._sourceMapURL=n,t.file=m,t.x_google_ignoreList=p,t._computedColumnSpans=!1,t._mappingsPtr=0,t._wasm=null,l().then(e=>(t._wasm=e,t))})}_findSourceIndex(e){let n=this._sourceLookupCache.get(e);if("number"==typeof n)return n;let t=r.computeSourceURL(null,e,this._sourceMapURL);if(this._absoluteSources.has(t)){let n=this._absoluteSources.indexOf(t);return this._sourceLookupCache.set(e,n),n}let o=r.computeSourceURL(this.sourceRoot,e,this._sourceMapURL);if(this._absoluteSources.has(o)){let n=this._absoluteSources.indexOf(o);return this._sourceLookupCache.set(e,n),n}return -1}static fromSourceMap(e,n){return new c(e.toString())}get sources(){return this._absoluteSources.toArray()}_getMappingsPtr(){return 0===this._mappingsPtr&&this._parseMappings(),this._mappingsPtr}_parseMappings(){let e=this._mappings,n=e.length,t=this._wasm.exports.allocate_mappings(n)>>>0,r=new Uint8Array(this._wasm.exports.memory.buffer,t,n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);let o=this._wasm.exports.parse_mappings(t);if(!o){let e=this._wasm.exports.get_last_error(),n=`Error parsing mappings (code ${e}): `;switch(e){case 1:n+="the mappings contained a negative line, column, source index, or name index";break;case 2:n+="the mappings contained a number larger than 2**32";break;case 3:n+="reached EOF while in the middle of parsing a VLQ";break;case 4:n+="invalid base 64 character while parsing a VLQ";break;default:n+="unknown error code"}throw Error(n)}this._mappingsPtr=o}eachMapping(e,n,t){let r=n||null,o=t||u.GENERATED_ORDER;this._wasm.withMappingCallback(n=>{null!==n.source&&(n.source=this._absoluteSources.at(n.source),null!==n.name&&(n.name=this._names.at(n.name))),this._computedColumnSpans&&null===n.lastGeneratedColumn&&(n.lastGeneratedColumn=1/0),e.call(r,n)},()=>{switch(o){case u.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case u.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let n=r.getArg(e,"source"),t=r.getArg(e,"line"),o=e.column||0;if((n=this._findSourceIndex(n))<0)return[];if(t<1)throw Error("Line numbers must be >= 1");if(o<0)throw Error("Column numbers must be >= 0");let s=[];return this._wasm.withMappingCallback(e=>{let n=e.lastGeneratedColumn;this._computedColumnSpans&&null===n&&(n=1/0),s.push({line:e.generatedLine,column:e.generatedColumn,lastColumn:n})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),n,t-1,"column"in e,o)}),s}destroy(){0!==this._mappingsPtr&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){let n,t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};if(t.generatedLine<1)throw Error("Line numbers must be >= 1");if(t.generatedColumn<0)throw Error("Column numbers must be >= 0");let o=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==o&&(o=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>n=e,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),t.generatedLine-1,t.generatedColumn,o)}),n&&n.generatedLine===t.generatedLine){let e=r.getArg(n,"source",null);null!==e&&(e=this._absoluteSources.at(e));let t=r.getArg(n,"name",null);return null!==t&&(t=this._names.at(t)),{source:e,line:r.getArg(n,"originalLine",null),column:r.getArg(n,"originalColumn",null),name:t}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})}sourceContentFor(e,n){if(!this.sourcesContent)return null;let t=this._findSourceIndex(e);if(t>=0)return this.sourcesContent[t];if(n)return null;throw Error('"'+e+'" is not in the SourceMap.')}generatedPositionFor(e){let n,t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};let o={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(o.originalLine<1)throw Error("Line numbers must be >= 1");if(o.originalColumn<0)throw Error("Column numbers must be >= 0");let s=r.getArg(e,"bias",u.GREATEST_LOWER_BOUND);if(null==s&&(s=u.GREATEST_LOWER_BOUND),this._wasm.withMappingCallback(e=>n=e,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),o.source,o.originalLine-1,o.originalColumn,s)}),n&&n.source===o.source){let e=n.lastGeneratedColumn;return this._computedColumnSpans&&null===e&&(e=1/0),{line:r.getArg(n,"generatedLine",null),column:r.getArg(n,"generatedColumn",null),lastColumn:e}}return{line:null,column:null,lastColumn:null}}}c.prototype.consumer=u;class g extends u{constructor(e,n){return super(a).then(t=>{let o=e;"string"==typeof e&&(o=r.parseSourceMapInput(e));let s=r.getArg(o,"version"),i=r.getArg(o,"sections");if(s!=t._version)throw Error("Unsupported version: "+s);let l={line:-1,column:0};return Promise.all(i.map(e=>{if(e.url)throw Error("Support for url field in sections not implemented.");let t=r.getArg(e,"offset"),o=r.getArg(t,"line"),s=r.getArg(t,"column");if(o<l.line||o===l.line&&s<l.column)throw Error("Section offsets must be ordered and non-overlapping.");return l=t,new u(r.getArg(e,"map"),n).then(e=>({generatedOffset:{generatedLine:o+1,generatedColumn:s+1},consumer:e}))})).then(e=>(t._sections=e,t))})}get sources(){let e=[];for(let n=0;n<this._sections.length;n++)for(let t=0;t<this._sections[n].consumer.sources.length;t++)e.push(this._sections[n].consumer.sources[t]);return e}originalPositionFor(e){let n={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},t=o.search(n,this._sections,function(e,n){let t=e.generatedLine-n.generatedOffset.generatedLine;return t||e.generatedColumn-(n.generatedOffset.generatedColumn-1)}),s=this._sections[t];return s?s.consumer.originalPositionFor({line:n.generatedLine-(s.generatedOffset.generatedLine-1),column:n.generatedColumn-(s.generatedOffset.generatedLine===n.generatedLine?s.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})}sourceContentFor(e,n){for(let n=0;n<this._sections.length;n++){let t=this._sections[n].consumer.sourceContentFor(e,!0);if(t)return t}if(n)return null;throw Error('"'+e+'" is not in the SourceMap.')}_findSectionIndex(e){for(let n=0;n<this._sections.length;n++){let{consumer:t}=this._sections[n];if(-1!==t._findSourceIndex(e))return n}return -1}generatedPositionFor(e){let n=this._findSectionIndex(r.getArg(e,"source")),t=n>=0?this._sections[n]:null,o=n>=0&&n+1<this._sections.length?this._sections[n+1]:null,s=t&&t.consumer.generatedPositionFor(e);if(s&&null!==s.line){let e=t.generatedOffset.generatedLine-1,n=t.generatedOffset.generatedColumn-1;return 1===s.line&&(s.column+=n,"number"==typeof s.lastColumn&&(s.lastColumn+=n)),s.lastColumn===1/0&&o&&s.line===o.generatedOffset.generatedLine&&(s.lastColumn=o.generatedOffset.generatedColumn-2),s.line+=e,s}return{line:null,column:null,lastColumn:null}}allGeneratedPositionsFor(e){let n=this._findSectionIndex(r.getArg(e,"source")),t=n>=0?this._sections[n]:null,o=n>=0&&n+1<this._sections.length?this._sections[n+1]:null;return t?t.consumer.allGeneratedPositionsFor(e).map(e=>{let n=t.generatedOffset.generatedLine-1,r=t.generatedOffset.generatedColumn-1;return 1===e.line&&(e.column+=r,"number"==typeof e.lastColumn&&(e.lastColumn+=r)),e.lastColumn===1/0&&o&&e.line===o.generatedOffset.generatedLine&&(e.lastColumn=o.generatedOffset.generatedColumn-2),e.line+=n,e}):[]}eachMapping(e,n,t){this._sections.forEach((r,o)=>{let s=o+1<this._sections.length?this._sections[o+1]:null,{generatedOffset:i}=r,l=i.generatedLine-1,a=i.generatedColumn-1;r.consumer.eachMapping(function(n){1===n.generatedLine&&(n.generatedColumn+=a,"number"==typeof n.lastGeneratedColumn&&(n.lastGeneratedColumn+=a)),n.lastGeneratedColumn===1/0&&s&&n.generatedLine===s.generatedOffset.generatedLine&&(n.lastGeneratedColumn=s.generatedOffset.generatedColumn-2),n.generatedLine+=l,e.call(this,n)},n,t)})}computeColumnSpans(){for(let e=0;e<this._sections.length;e++)this._sections[e].consumer.computeColumnSpans()}destroy(){for(let e=0;e<this._sections.length;e++)this._sections[e].consumer.destroy()}}},"./source-map/lib/source-map-generator.js":function(e,n,t){let r=t("./source-map/lib/base64-vlq.js"),o=t("./source-map/lib/util.js"),s=t("./source-map/lib/array-set.js").ArraySet,i=t("./source-map/lib/mapping-list.js").MappingList;class l{constructor(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}static fromSourceMap(e){let n=e.sourceRoot,t=new l({file:e.file,sourceRoot:n});return e.eachMapping(function(e){let r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=n&&(r.source=o.relative(n,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),t.addMapping(r)}),e.sources.forEach(function(r){let s=r;null!=n&&(s=o.relative(n,r)),t._sources.has(s)||t._sources.add(s);let i=e.sourceContentFor(r);null!=i&&t.setSourceContent(r,i)}),t}addMapping(e){let n=o.getArg(e,"generated"),t=o.getArg(e,"original",null),r=o.getArg(e,"source",null),s=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,t,r,s),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:t&&t.line,originalColumn:t&&t.column,source:r,name:s})}setSourceContent(e,n){let t=e;null!=this._sourceRoot&&(t=o.relative(this._sourceRoot,t)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(t)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(e,n,t){let r=n;if(null==n){if(null==e.file)throw Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}let i=this._sourceRoot;null!=i&&(r=o.relative(i,r));let l=this._mappings.toArray().length>0?new s:this._sources,a=new s;this._mappings.unsortedForEach(function(n){if(n.source===r&&null!=n.originalLine){let r=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=r.source&&(n.source=r.source,null!=t&&(n.source=o.join(t,n.source)),null!=i&&(n.source=o.relative(i,n.source)),n.originalLine=r.line,n.originalColumn=r.column,null!=r.name&&(n.name=r.name))}let s=n.source;null==s||l.has(s)||l.add(s);let u=n.name;null==u||a.has(u)||a.add(u)},this),this._sources=l,this._names=a,e.sources.forEach(function(n){let r=e.sourceContentFor(n);null!=r&&(null!=t&&(n=o.join(t,n)),null!=i&&(n=o.relative(i,n)),this.setSourceContent(n,r))},this)}_validateMapping(e,n,t,r){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!t&&!r);else if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&t);else throw Error("Invalid mapping: "+JSON.stringify({generated:e,source:t,original:n,name:r}))}_serializeMappings(){let e,n,t,s,i=0,l=1,a=0,u=0,c=0,g=0,h="",m=this._mappings.toArray();for(let p=0,d=m.length;p<d;p++){if(n=m[p],e="",n.generatedLine!==l)for(i=0;n.generatedLine!==l;)e+=";",l++;else if(p>0){if(!o.compareByGeneratedPositionsInflated(n,m[p-1]))continue;e+=","}e+=r.encode(n.generatedColumn-i),i=n.generatedColumn,null!=n.source&&(s=this._sources.indexOf(n.source),e+=r.encode(s-g),g=s,e+=r.encode(n.originalLine-1-u),u=n.originalLine-1,e+=r.encode(n.originalColumn-a),a=n.originalColumn,null!=n.name&&(t=this._names.indexOf(n.name),e+=r.encode(t-c),c=t)),h+=e}return h}_generateSourcesContent(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=o.relative(n,e));let t=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)}toJSON(){let e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}l.prototype._version=3,n.SourceMapGenerator=l},"./source-map/lib/source-node.js":function(e,n,t){let r=t("./source-map/lib/source-map-generator.js").SourceMapGenerator,o=t("./source-map/lib/util.js"),s=/(\r?\n)/,i="$$$isSourceNode$$$";class l{constructor(e,n,t,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==t?null:t,this.name=null==o?null:o,this[i]=!0,null!=r&&this.add(r)}static fromStringWithSourceMap(e,n,t){let r,i=new l,a=e.split(s),u=0,c=function(){return e()+(e()||"");function e(){return u<a.length?a[u++]:void 0}},g=1,h=0,m=null;return n.eachMapping(function(e){if(null!==m)if(g<e.generatedLine)p(m,c()),g++,h=0;else{let n=(r=a[u]||"").substr(0,e.generatedColumn-h);a[u]=r.substr(e.generatedColumn-h),h=e.generatedColumn,p(m,n),m=e;return}for(;g<e.generatedLine;)i.add(c()),g++;h<e.generatedColumn&&(r=a[u]||"",i.add(r.substr(0,e.generatedColumn)),a[u]=r.substr(e.generatedColumn),h=e.generatedColumn),m=e},this),u<a.length&&(m&&p(m,c()),i.add(a.splice(u).join(""))),n.sources.forEach(function(e){let r=n.sourceContentFor(e);null!=r&&(null!=t&&(e=o.join(t,e)),i.setSourceContent(e,r))}),i;function p(e,n){if(null===e||void 0===e.source)i.add(n);else{let r=t?o.join(t,e.source):e.source;i.add(new l(e.originalLine,e.originalColumn,r,n,e.name))}}}add(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else if(e[i]||"string"==typeof e)e&&this.children.push(e);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this}prepend(e){if(Array.isArray(e))for(let n=e.length-1;n>=0;n--)this.prepend(e[n]);else if(e[i]||"string"==typeof e)this.children.unshift(e);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this}walk(e){let n;for(let t=0,r=this.children.length;t<r;t++)(n=this.children[t])[i]?n.walk(e):""!==n&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})}join(e){let n,t,r=this.children.length;if(r>0){for(t=0,n=[];t<r-1;t++)n.push(this.children[t]),n.push(e);n.push(this.children[t]),this.children=n}return this}replaceRight(e,n){let t=this.children[this.children.length-1];return t[i]?t.replaceRight(e,n):"string"==typeof t?this.children[this.children.length-1]=t.replace(e,n):this.children.push("".replace(e,n)),this}setSourceContent(e,n){this.sourceContents[o.toSetString(e)]=n}walkSourceContents(e){for(let n=0,t=this.children.length;n<t;n++)this.children[n][i]&&this.children[n].walkSourceContents(e);let n=Object.keys(this.sourceContents);for(let t=0,r=n.length;t<r;t++)e(o.fromSetString(n[t]),this.sourceContents[n[t]])}toString(){let e="";return this.walk(function(n){e+=n}),e}toStringWithSourceMap(e){let n={code:"",line:1,column:0},t=new r(e),o=!1,s=null,i=null,l=null,a=null;return this.walk(function(e,r){n.code+=e,null!==r.source&&null!==r.line&&null!==r.column?((s!==r.source||i!==r.line||l!==r.column||a!==r.name)&&t.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:n.line,column:n.column},name:r.name}),s=r.source,i=r.line,l=r.column,a=r.name,o=!0):o&&(t.addMapping({generated:{line:n.line,column:n.column}}),s=null,o=!1);for(let i=0,l=e.length;i<l;i++)10===e.charCodeAt(i)?(n.line++,n.column=0,i+1===l?(s=null,o=!1):o&&t.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:n.line,column:n.column},name:r.name})):n.column++}),this.walkSourceContents(function(e,n){t.setSourceContent(e,n)}),{code:n.code,map:t}}}n.SourceNode=l},"./source-map/lib/url.js":function(e,n,t){"use strict";e.exports="function"==typeof URL?URL:t("url").URL},"./source-map/lib/util.js":function(e,n,t){let r=t("./source-map/lib/url.js");n.getArg=function(e,n,t){if(n in e)return e[n];if(3==arguments.length)return t;throw Error('"'+n+'" is a required argument.')};let o=!("__proto__"in Object.create(null));function s(e){return e}function i(e){if(!e)return!1;let n=e.length;if(n<9||95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(let t=n-10;t>=0;t--)if(36!==e.charCodeAt(t))return!1;return!0}function l(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}n.toSetString=o?s:function(e){return i(e)?"$"+e:e},n.fromSetString=o?s:function(e){return i(e)?e.slice(1):e},n.compareByGeneratedPositionsInflated=function(e,n){let t=e.generatedLine-n.generatedLine;return 0!==t||0!=(t=e.generatedColumn-n.generatedColumn)||0!==(t=l(e.source,n.source))||0!=(t=e.originalLine-n.originalLine)||0!=(t=e.originalColumn-n.originalColumn)?t:l(e.name,n.name)},n.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))};let a="http:",u=`${a}//host`;function c(e){return n=>{let t=p(n),o=h(n),s=new r(n,o);e(s);let i=s.toString();return"absolute"===t?i:"scheme-relative"===t?i.slice(a.length):"path-absolute"===t?i.slice(u.length):d(o,i)}}function g(e,n){return new r(e,n).toString()}function h(e){let n=e.split("..").length-1,t=function(e,n){let t=0;for(;;){let e="p"+t++;if(-1===n.indexOf(e))return e}}(0,e),r=`${u}/`;for(let e=0;e<n;e++)r+=`${t}/`;return r}let m=/^[A-Za-z0-9\+\-\.]+:/;function p(e){return"/"===e[0]?"/"===e[1]?"scheme-relative":"path-absolute":m.test(e)?"absolute":"path-relative"}function d(e,n){"string"==typeof e&&(e=new r(e)),"string"==typeof n&&(n=new r(n));let t=n.pathname.split("/"),o=e.pathname.split("/");for(o.length>0&&!o[o.length-1]&&o.pop();t.length>0&&o.length>0&&t[0]===o[0];)t.shift(),o.shift();return o.map(()=>"..").concat(t).join("/")+n.search+n.hash}let _=c(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),f=c(e=>{e.href=new r(".",e.toString()).toString()}),C=c(e=>{});function b(e,n){let t=p(n),r=p(e);if(e=_(e),"absolute"===t)return g(n,void 0);if("absolute"===r)return g(n,e);if("scheme-relative"===t)return C(n);if("scheme-relative"===r)return g(n,g(e,u)).slice(a.length);if("path-absolute"===t)return C(n);if("path-absolute"===r)return g(n,g(e,u)).slice(u.length);let o=h(n+e),s=g(n,g(e,o));return d(o,s)}n.normalize=C,n.join=b,n.relative=function(e,n){let t=function(e,n){if(p(e)!==p(n))return null;let t=h(e+n),o=new r(e,t),s=new r(n,t);try{new r("",s.toString())}catch(e){return null}return s.protocol!==o.protocol||s.user!==o.user||s.password!==o.password||s.hostname!==o.hostname||s.port!==o.port?null:d(o,s)}(e,n);return"string"==typeof t?t:C(n)},n.computeSourceURL=function(e,n,t){e&&"path-absolute"===p(n)&&(n=n.replace(/^\//,""));let r=C(n||"");return e&&(r=b(e,r)),t&&(r=b(f(t),r)),r}},"./source-map/lib/wasm.js":function(e,n,t){let r=t("./source-map/lib/read-wasm.js");function o(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}let s=null;e.exports=function(){if(s)return s;let e=[];return s=r().then(n=>WebAssembly.instantiate(n,{env:{mapping_callback(n,t,r,s,i,l,a,u,c,g){let h=new o;h.generatedLine=n+1,h.generatedColumn=t,r&&(h.lastGeneratedColumn=s-1),i&&(h.source=l,h.originalLine=a+1,h.originalColumn=u,c&&(h.name=g)),e[e.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(n=>({exports:n.instance.exports,withMappingCallback:(n,t)=>{e.push(n);try{t()}finally{e.pop()}}})).then(null,e=>{throw s=null,e})}},fs:function(e){"use strict";e.exports=require("fs")},path:function(e){"use strict";e.exports=require("path")},url:function(e){"use strict";e.exports=require("url")}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var s=n[r]={exports:{}};return e[r](s,s.exports,t),s.exports}var r={};r.SourceMapGenerator=t("./source-map/lib/source-map-generator.js").SourceMapGenerator,r.SourceMapConsumer=t("./source-map/lib/source-map-consumer.js").SourceMapConsumer,r.SourceNode=t("./source-map/lib/source-node.js").SourceNode,module.exports=r})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the names of the Mozilla Foundation nor the names of project
|
|
16
|
+
contributors may be used to endorse or promote products derived from this
|
|
17
|
+
software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={"./source-map/lib/url.js":function(e,t,r){"use strict";e.exports="function"==typeof URL?URL:r("url").URL},url:function(e){"use strict";e.exports=require("url")}},t={},r={};(()=>{let n=function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n](u,u.exports,r),u.exports}("./source-map/lib/url.js");r.getArg=function(e,t,r){if(t in e)return e[t];if(3==arguments.length)return r;throw Error('"'+t+'" is a required argument.')};let o=!("__proto__"in Object.create(null));function u(e){return e}function i(e){if(!e)return!1;let t=e.length;if(t<9||95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(let r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function l(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}r.toSetString=o?u:function(e){return i(e)?"$"+e:e},r.fromSetString=o?u:function(e){return i(e)?e.slice(1):e},r.compareByGeneratedPositionsInflated=function(e,t){let r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||0!==(r=l(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:l(e.name,t.name)},r.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))};let a="http:",c=`${a}//host`;function s(e){return t=>{let r=g(t),o=h(t),u=new n(t,o);e(u);let i=u.toString();return"absolute"===r?i:"scheme-relative"===r?i.slice(a.length):"path-absolute"===r?i.slice(c.length):m(o,i)}}function f(e,t){return new n(e,t).toString()}function h(e){let t=e.split("..").length-1,r=function(e,t){let r=0;for(;;){let e="p"+r++;if(-1===t.indexOf(e))return e}}(0,e),n=`${c}/`;for(let e=0;e<t;e++)n+=`${r}/`;return n}let p=/^[A-Za-z0-9\+\-\.]+:/;function g(e){return"/"===e[0]?"/"===e[1]?"scheme-relative":"path-absolute":p.test(e)?"absolute":"path-relative"}function m(e,t){"string"==typeof e&&(e=new n(e)),"string"==typeof t&&(t=new n(t));let r=t.pathname.split("/"),o=e.pathname.split("/");for(o.length>0&&!o[o.length-1]&&o.pop();r.length>0&&o.length>0&&r[0]===o[0];)r.shift(),o.shift();return o.map(()=>"..").concat(r).join("/")+t.search+t.hash}let d=s(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),C=s(e=>{e.href=new n(".",e.toString()).toString()}),b=s(e=>{});function A(e,t){let r=g(t),n=g(e);if(e=d(e),"absolute"===r)return f(t,void 0);if("absolute"===n)return f(t,e);if("scheme-relative"===r)return b(t);if("scheme-relative"===n)return f(t,f(e,c)).slice(a.length);if("path-absolute"===r)return b(t);if("path-absolute"===n)return f(t,f(e,c)).slice(c.length);let o=h(t+e),u=f(t,f(e,o));return m(o,u)}r.normalize=b,r.join=A,r.relative=function(e,t){let r=function(e,t){if(g(e)!==g(t))return null;let r=h(e+t),o=new n(e,r),u=new n(t,r);try{new n("",u.toString())}catch(e){return null}return u.protocol!==o.protocol||u.user!==o.user||u.password!==o.password||u.hostname!==o.hostname||u.port!==o.port?null:m(o,u)}(e,t);return"string"==typeof r?r:b(t)},r.computeSourceURL=function(e,t,r){e&&"path-absolute"===g(t)&&(t=t.replace(/^\//,""));let n=b(t||"");return e&&(n=A(e,n)),r&&(n=A(C(r),n)),n}})(),module.exports=r})();
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Eli Skeggs, 2017 Akseli Palén, 2023 DataDog, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={"./tlhunter-sorted-set/lib/intersect.js":function(e){e.exports=function(e){let t,n,r,l,i,s,h;if(!e.length)return[];for(i=e.length-1;i>=0;i--){if(!e[i].length)return[];e[i]=e[i]._head.next[0].next}if(1===e.length)return e[0].toArray({field:"key"});if(2===e.length)return function(e,t){let n=Object.create(null),r=[];for(;e;e=e.next[0].next)n[e.key]=!0;for(;t;t=t.next[0].next)n[t.key]&&r.push(t.key);return r}(e[0],e[1]);if(3===e.length)return function(e,t,n){let r=Object.create(null),l=[];for(;e;e=e.next[0].next)r[e.key]=0;for(;t;t=t.next[0].next)0===r[t.key]&&(r[t.key]=1);for(;n;n=n.next[0].next)1===r[n.key]&&l.push(n.key);return l}(e[0],e[1],e[2]);for(r=Object.create(null),n=e.shift();n;n=n.next[0].next)r[n.key]=0;for(i=0,h=e.length-1;i<h;i++){for(l=0,s=i+1,n=e[i];n;n=n.next[0].next)r[n.key]===i&&(r[n.key]=s,l++);if(!l)return[]}for(t=[],n=e[i];n;n=n.next[0].next)r[n.key]===i&&t.push(n.key);return t}},"./tlhunter-sorted-set/lib/set.js":function(e,t,n){"use strict";let r=n("./tlhunter-sorted-set/lib/intersect.js"),l=Array.prototype.slice,i=1/Math.E;class s{constructor(e={}){this._unique=!!e.unique,this.empty()}static intersect(){return r.call(s,l.call(arguments))}add(e,t){let n;if(null==t)return this.rem(e);if(void 0!==(n=this._map.get(e))){if(t===n)return n;this._remove(e,n)}if(!this._insert(e,t))throw void 0===n||this._insert(e,n),Error("unique constraint violated");return this._map.set(e,t),void 0===n?null:n}card(){return this.length?this.length:0}count(e,t){let n;if(!this.length)return 0;if(null==e&&(e=-1/0),null==t&&(t=1/0),e<=this._head.next[0].next.value&&t>=this._tail.value)return this.length;if(t<e||e>this._tail.value||t<this._head.next[0].next.value)return 0;let r=this._first(e),l=0;if(!r)return 0;for(n=r.next.length-1;n>=0;n-=1)for(;r.next[n].next&&r.next[n].next.value<=t;)l+=r.next[n].span,r=r.next[n].next;return l&&l+1}del(e){return this.rem(e)}empty(){this.length=0,this._level=1,this._map=new Map,this._head=new u(32,null,0),this._tail=null;for(let e=0;e<32;e+=1)this._head.next[e]=new h(null,0)}get(e){return this.score(e)}has(e){return this._map.has(e)}incrBy(e,t){let n=this.score(t);return n?(this.add(t,n+e),n+e):(this.add(t,e),e)}intersect(){let e=l.call(arguments);return e.unshift(this),r.call(this,e)}intersectKeys(){let e=l.call(arguments);return e.unshift(this),intersectKeys.call(this,e)}keys(){let e;if(!this.length)return[];let t=Array(this.length),n=this._head.next[0].next;for(e=0;n;n=n.next[0].next)t[e]=n.key,e+=1;return t}range(e,t,n){let r;if(0===this.length||(null==e?e=0:e<0&&(e=Math.max(this.length+e,0)),null==t?t=this.length-1:t<0&&(t=this.length+t),e>t||e>=this.length))return[];t>=this.length&&(t=this.length-1),"object"!=typeof n&&(n={withScores:!1});let l=0,i=t-e+1;try{r=Array(i)}catch(n){throw console.log("start",e),console.log("stop",t),console.log("Invalid length",i),n}let s=e>0?this._get(e):this._head.next[0].next;if(n.withScores)for(;i--;s=s.next[0].next)r[l]=[s.key,s.value],l+=1;else for(;i--;s=s.next[0].next)r[l]=s.key,l+=1;return r}rangeByScore(e,t,n){if(!this.length)return[];if("object"!=typeof n&&(n={withScores:!1}),null==e&&(e=-1/0),null==t&&(t=1/0),e<=this._head.next[0].next.value&&t>=this._tail.value)return this.toArray({withScores:n.withScores});if(t<e||e>this._tail.value||t<this._head.next[0].next.value)return[];let r=this._first(e),l=[];if(n.withScores)for(;r&&r.value<=t;r=r.next[0].next)l.push([r.key,r.value]);else for(;r&&r.value<=t;r=r.next[0].next)l.push(r.key);return l}rank(e){let t,n=this._map.get(e);if(void 0===n)return null;let r=this._head,l=null,i=-1;for(t=this._level-1;t>=0;t-=1){for(;(l=r.next[t].next)&&(l.value<n||l.value===n&&l.key<=e);)i+=r.next[t].span,r=l;if(r.key&&r.key===e)return i}return null}rem(e){let t=this._map.get(e);return void 0!==t?(this._remove(e,t),this._map.delete(e),t):null}remRangeByRank(e,t){let n,r,l=this.length;if(!l||(null==e?e=0:e<0&&(e=Math.max(l+e,0)),null==t?t=l:t<0&&(t=l+t),e>t||e>=l))return 0;if(t>l&&(t=l),0===e&&t===l)return this.empty(),l;let i=this._head,s=Array(32),h=-1;for(n=this._level-1;n>=0;n-=1){for(;(r=i.next[n].next)&&h+i.next[n].span<e;)h+=i.next[n].span,i=r;s[n]=i}let u=0;for(h+=1,i=i.next[0].next;i&&h<t;)r=i.next[0].next,this._removeNode(i,s),this._map.delete(i.key),u+=1,h+=1,i=r;return this.length-=u,u}remRangeByScore(e,t){let n,r,l=0;if(!this.length)return 0;if(null==e&&(e=-1/0),null==t&&(t=1/0),e<=this._head.next[0].next.value&&t>=this._tail.value)return l=this.length,this.empty(),l;let i=this._head,s=Array(32);for(r=this._level-1;r>=0;r-=1){for(;(n=i.next[r].next)&&n.value<e;)i=n;s[r]=i}for(i=i.next[0].next;i&&i.value<=t;)n=i.next[0].next,this._removeNode(i,s),this._map.delete(i.key),l+=1,i=n;return this.length-=l,l}score(e){let t=this._map.get(e);return void 0===t?null:t}set(e,t){return this.add(e,t)}slice(e,t,n){return"number"==typeof t&&0!==t&&(t-=1),this.range(e,t,n)}toArray(e){let t;if(!this.length)return[];"object"!=typeof e&&(e={withScores:!1});let n=Array(this.length),r=this._head.next[0].next;if(e.withScores)for(t=0;r;r=r.next[0].next)n[t]=[r.key,r.value],t+=1;else for(t=0;r;r=r.next[0].next)n[t]=r.key,t+=1;return n}values(){let e;if(!this.length)return[];let t=Array(this.length),n=this._head.next[0].next;for(e=0;n;n=n.next[0].next)t[e]=n.value,e+=1;return t}_first(e){let t=this._tail;if(!t||t.value<e)return null;t=this._head;for(let n=null,r=this._level-1;r>=0;r-=1)for(;(n=t.next[r].next)&&n.value<e;)t=n;return t.next[0].next}_get(e){let t,n=this._head,r=-1;for(t=this._level-1;t>=0;t-=1){for(;n.next[t].next&&r+n.next[t].span<=e;)r+=n.next[t].span,n=n.next[t].next;if(r===e)return n}return null}_insert(e,t){let n,r=Array(32),l=Array(32),s=this._head,a=null;for(n=this._level-1;n>=0;n-=1){for(l[n]=n===this._level-1?0:l[n+1];(a=s.next[n].next)&&a.value<=t;){if(a.value===t){if(this._unique)return null;if(a.key>=e)break}l[n]+=s.next[n].span,s=a}if(this._unique&&s.value===t)return null;r[n]=s}if(this._unique&&s.value===t)return null;let x=function(){let e=1;for(;Math.random()<i;)e+=1;return e<32?e:32}();if(x>this._level){for(n=this._level;n<x;n+=1)l[n]=0,r[n]=this._head,r[n].next[n].span=this.length;this._level=x}for(n=0,s=new u(x,e,t);n<x;n+=1)s.next[n]=new h(r[n].next[n].next,r[n].next[n].span-(l[0]-l[n])),r[n].next[n].next=s,r[n].next[n].span=l[0]-l[n]+1;for(n=x;n<this._level;n+=1)r[n].next[n].span++;return s.prev=r[0]===this._head?null:r[0],s.next[0].next?s.next[0].next.prev=s:this._tail=s,this.length+=1,s}_next(e,t){let n,r;if(!this._tail||this._tail.value<e)return null;for(n=null;(n=t.next[t.next.length-1].next)&&n.value<e;)t=n;if(t.value===e)return t;for(r=t.next.length-1;r>=0;r-=1){for(;(n=t.next[r].next)&&n.value<e;)t=n;if(t.value===e)return t}return t.next[0].next}_remove(e,t){let n,r,l=Array(32),i=this._head;for(n=this._level-1;n>=0;n-=1){for(;(r=i.next[n].next)&&(r.value<t||r.value===t&&r.key<e);)i=r;l[n]=i}if(!(i=i.next[0].next)||t!==i.value||i.key!==e)return!1;this._removeNode(i,l),this.length-=1}_removeNode(e,t){let n=null,r=0,l=this._level;for(;r<l;r+=1)t[r].next[r].next===e?(t[r].next[r].span+=e.next[r].span-1,t[r].next[r].next=e.next[r].next):t[r].next[r].span-=1;for((n=e.next[0].next)?n.prev=e.prev:this._tail=e.prev;this._level>1&&!this._head.next[this._level-1].next;)this._level-=1}}function h(e,t){this.next=e,this.span=t}function u(e,t,n){this.key=t,this.value=n,this.next=Array(e),this.prev=null}e.exports=s}},t={},n=function n(r){var l=t[r];if(void 0!==l)return l.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}("./tlhunter-sorted-set/lib/set.js");module.exports=n})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Thomas Watson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={"./fast-fifo/fixed-size.js":function(t){t.exports=class{constructor(t){if(!(t>0)||(t-1&t)!=0)throw Error("Max size for a FixedFIFO should be a power of two");this.buffer=Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(t){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){let t=this.buffer[this.btm];if(void 0!==t)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},"./fast-fifo/index.js":function(t,i,s){let e=s("./fast-fifo/fixed-size.js");t.exports=class{constructor(t){this.hwm=t||16,this.head=new e(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(t){if(this.length++,!this.head.push(t)){let i=this.head;this.head=i.next=new e(2*this.head.buffer.length),this.head.push(t)}}shift(){0!==this.length&&this.length--;let t=this.tail.shift();if(void 0===t&&this.tail.next){let t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return t}peek(){let t=this.tail.peek();return void 0===t&&this.tail.next?this.tail.next.peek():t}isEmpty(){return 0===this.length}}},"./ttl-set/index.js":function(t,i,s){"use strict";let e=s("./fast-fifo/index.js");t.exports=class{constructor(t){this._ttl=t,this._list=new e,this._index=new Set,this._timer=null}add(t){this._index.add(t),this._list.push([Date.now(),t]),null===this._timer&&(this._timer=setTimeout(this._prune.bind(this),this._ttl).unref())}clear(){this._list.clear(),this._index.clear(),clearTimeout(this._timer),this._timer=null}has(t){return this._index.has(t)}get size(){return this._index.size}_prune(){for(;;){let t=this._list.peek();if(void 0===t){this._timer=null;return}if(t[0]>Date.now()-this._ttl)break;let i=this._list.shift();this._index.delete(i[1])}this._timer=setTimeout(this._prune.bind(this),Date.now()-this._list.peek()[0]).unref()}}}},i={},s=function s(e){var h=i[e];if(void 0!==h)return h.exports;var r=i[e]={exports:{}};return t[e](r,r.exports,s),r.exports}("./ttl-set/index.js");module.exports=s})();
|