switchroom 0.18.12 → 0.18.13

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.
Files changed (49) hide show
  1. package/dist/agent-scheduler/index.js +8 -0
  2. package/dist/auth-broker/index.js +63 -65
  3. package/dist/cli/ms-365-write-pretool.mjs +31 -8
  4. package/dist/cli/notion-write-pretool.mjs +9 -1
  5. package/dist/cli/skill-validate-pretool.mjs +144 -2847
  6. package/dist/cli/switchroom.js +952 -3126
  7. package/dist/host-control/main.js +216 -2862
  8. package/dist/vault/approvals/kernel-server.js +67 -0
  9. package/dist/vault/broker/server.js +98 -44
  10. package/package.json +1 -1
  11. package/telegram-plugin/dist/bridge/bridge.js +49 -3
  12. package/telegram-plugin/dist/gateway/gateway.js +656 -2326
  13. package/telegram-plugin/dist/server.js +65 -3
  14. package/telegram-plugin/format.ts +19 -0
  15. package/telegram-plugin/gateway/approval-hold.ts +21 -2
  16. package/telegram-plugin/gateway/callback-query-handlers.ts +12 -0
  17. package/telegram-plugin/gateway/gateway.ts +221 -73
  18. package/telegram-plugin/history.ts +51 -0
  19. package/telegram-plugin/inline-keyboard-callbacks.ts +94 -0
  20. package/telegram-plugin/model-unavailable.ts +41 -11
  21. package/telegram-plugin/outbound-field-redact.ts +69 -0
  22. package/telegram-plugin/render/render.ts +32 -14
  23. package/telegram-plugin/scoped-approval.ts +11 -2
  24. package/telegram-plugin/secret-detect/chunker.ts +18 -4
  25. package/telegram-plugin/secret-detect/index.ts +12 -56
  26. package/telegram-plugin/send-gate-degraded.test.ts +131 -0
  27. package/telegram-plugin/send-gate.test.ts +25 -6
  28. package/telegram-plugin/send-gate.ts +82 -8
  29. package/telegram-plugin/session-tail.ts +82 -7
  30. package/telegram-plugin/subagent-watcher.ts +71 -16
  31. package/telegram-plugin/tests/approval-hold-outcome.test.ts +36 -5
  32. package/telegram-plugin/tests/callback-query-handlers.test.ts +65 -0
  33. package/telegram-plugin/tests/gateway-outbound-redact.test.ts +57 -0
  34. package/telegram-plugin/tests/history.test.ts +115 -0
  35. package/telegram-plugin/tests/inbound-message-types.test.ts +5 -1
  36. package/telegram-plugin/tests/inline-keyboard-callbacks.test.ts +164 -0
  37. package/telegram-plugin/tests/operator-events-session-tail.test.ts +74 -0
  38. package/telegram-plugin/tests/outbound-field-redact.test.ts +107 -0
  39. package/telegram-plugin/tests/reaction-gate-routing.test.ts +173 -0
  40. package/telegram-plugin/tests/render/render.test.ts +88 -0
  41. package/telegram-plugin/tests/scoped-approval.test.ts +27 -0
  42. package/telegram-plugin/tests/secret-detect-chunk-overlap.test.ts +65 -0
  43. package/telegram-plugin/tests/secret-detect-oauth-code.test.ts +5 -4
  44. package/telegram-plugin/tests/session-tail-sidecar-reap.test.ts +268 -0
  45. package/telegram-plugin/tests/subagent-watcher-fd-leak.test.ts +275 -0
  46. package/telegram-plugin/tests/worktree-watch-cwds.test.ts +215 -1
  47. package/telegram-plugin/worktree-watch-cwds.ts +194 -5
  48. package/telegram-plugin/secret-detect/secretlint-source.ts +0 -95
  49. package/telegram-plugin/tests/secret-detect-secretlint.test.ts +0 -105
@@ -1,36 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
2
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
34
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
35
4
 
36
5
  // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
@@ -6948,2823 +6917,155 @@ var require_public_api = __commonJS((exports) => {
6948
6917
  exports.stringify = stringify;
6949
6918
  });
6950
6919
 
6951
- // telegram-plugin/secret-detect/suppressor.ts
6952
- var MARKERS, MARKER_RE;
6953
- var init_suppressor = __esm(() => {
6954
- MARKERS = ["test", "mock", "example", "fixture", "dummy"];
6955
- MARKER_RE = new RegExp(`\\b(?:${MARKERS.join("|")})\\b`, "i");
6956
- });
6957
- // node_modules/.bun/boundary@2.0.0/node_modules/boundary/lib/index.js
6958
- var require_lib = __commonJS((exports) => {
6959
- Object.defineProperty(exports, "__esModule", { value: true });
6960
- exports.binarySearch = exports.upperBound = exports.lowerBound = exports.compare = undefined;
6961
- function compare(v1, v2) {
6962
- return v1 < v2;
6963
- }
6964
- exports.compare = compare;
6965
- function upperBound(array, value, comp = compare) {
6966
- let len = array.length;
6967
- let i = 0;
6968
- while (len) {
6969
- let diff = len >>> 1;
6970
- let cursor = i + diff;
6971
- if (comp(value, array[cursor])) {
6972
- len = diff;
6973
- } else {
6974
- i = cursor + 1;
6975
- len -= diff + 1;
6976
- }
6977
- }
6978
- return i;
6979
- }
6980
- exports.upperBound = upperBound;
6981
- function lowerBound(array, value, comp = compare) {
6982
- let len = array.length;
6983
- let i = 0;
6984
- while (len) {
6985
- let diff = len >>> 1;
6986
- let cursor = i + diff;
6987
- if (comp(array[cursor], value)) {
6988
- i = cursor + 1;
6989
- len -= diff + 1;
6990
- } else {
6991
- len = diff;
6992
- }
6993
- }
6994
- return i;
6995
- }
6996
- exports.lowerBound = lowerBound;
6997
- function binarySearch(array, value, comp = compare) {
6998
- let cursor = lowerBound(array, value, comp);
6999
- return cursor !== array.length && !comp(value, array[cursor]);
7000
- }
7001
- exports.binarySearch = binarySearch;
7002
- });
7003
-
7004
- // node_modules/.bun/structured-source@4.0.0/node_modules/structured-source/lib/structured-source.js
7005
- var require_structured_source = __commonJS((exports) => {
7006
- Object.defineProperty(exports, "__esModule", { value: true });
7007
- exports.StructuredSource = undefined;
7008
- var boundary_1 = require_lib();
6920
+ // src/cli/skill-validate-pretool.ts
6921
+ import { readFileSync, lstatSync, readdirSync } from "node:fs";
6922
+ import { join } from "node:path";
7009
6923
 
7010
- class StructuredSource {
7011
- constructor(source) {
7012
- this.indice = [0];
7013
- let regexp = /[\r\n\u2028\u2029]/g;
7014
- const length = source.length;
7015
- regexp.lastIndex = 0;
7016
- while (true) {
7017
- let result = regexp.exec(source);
7018
- if (!result) {
7019
- break;
7020
- }
7021
- let index = result.index;
7022
- if (source.charCodeAt(index) === 13 && source.charCodeAt(index + 1) === 10) {
7023
- index += 1;
7024
- }
7025
- let nextIndex = index + 1;
7026
- if (length < nextIndex) {
7027
- break;
7028
- }
7029
- this.indice.push(nextIndex);
7030
- regexp.lastIndex = nextIndex;
7031
- }
7032
- }
7033
- get line() {
7034
- return this.indice.length;
7035
- }
7036
- locationToRange(loc) {
7037
- return [this.positionToIndex(loc.start), this.positionToIndex(loc.end)];
7038
- }
7039
- rangeToLocation(range) {
7040
- return {
7041
- start: this.indexToPosition(range[0]),
7042
- end: this.indexToPosition(range[1])
7043
- };
7044
- }
7045
- positionToIndex(pos) {
7046
- let start = this.indice[pos.line - 1];
7047
- return start + pos.column;
7048
- }
7049
- indexToPosition(index) {
7050
- const startLine = (0, boundary_1.upperBound)(this.indice, index);
7051
- return {
7052
- line: startLine,
7053
- column: index - this.indice[startLine - 1]
7054
- };
7055
- }
7056
- }
7057
- exports.StructuredSource = StructuredSource;
7058
- });
7059
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/SecretLintSourceCodeImpl.js
7060
- var import_structured_source;
7061
- var init_SecretLintSourceCodeImpl = __esm(() => {
7062
- import_structured_source = __toESM(require_structured_source(), 1);
7063
- });
6924
+ // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
6925
+ var composer = require_composer();
6926
+ var Document = require_Document();
6927
+ var Schema = require_Schema();
6928
+ var errors = require_errors();
6929
+ var Alias = require_Alias();
6930
+ var identity = require_identity();
6931
+ var Pair = require_Pair();
6932
+ var Scalar = require_Scalar();
6933
+ var YAMLMap = require_YAMLMap();
6934
+ var YAMLSeq = require_YAMLSeq();
6935
+ var cst = require_cst();
6936
+ var lexer = require_lexer();
6937
+ var lineCounter = require_line_counter();
6938
+ var parser = require_parser();
6939
+ var publicApi = require_public_api();
6940
+ var visit = require_visit();
6941
+ var $Composer = composer.Composer;
6942
+ var $Document = Document.Document;
6943
+ var $Schema = Schema.Schema;
6944
+ var $YAMLError = errors.YAMLError;
6945
+ var $YAMLParseError = errors.YAMLParseError;
6946
+ var $YAMLWarning = errors.YAMLWarning;
6947
+ var $Alias = Alias.Alias;
6948
+ var $isAlias = identity.isAlias;
6949
+ var $isCollection = identity.isCollection;
6950
+ var $isDocument = identity.isDocument;
6951
+ var $isMap = identity.isMap;
6952
+ var $isNode = identity.isNode;
6953
+ var $isPair = identity.isPair;
6954
+ var $isScalar = identity.isScalar;
6955
+ var $isSeq = identity.isSeq;
6956
+ var $Pair = Pair.Pair;
6957
+ var $Scalar = Scalar.Scalar;
6958
+ var $YAMLMap = YAMLMap.YAMLMap;
6959
+ var $YAMLSeq = YAMLSeq.YAMLSeq;
6960
+ var $Lexer = lexer.Lexer;
6961
+ var $LineCounter = lineCounter.LineCounter;
6962
+ var $Parser = parser.Parser;
6963
+ var $parse = publicApi.parse;
6964
+ var $parseAllDocuments = publicApi.parseAllDocuments;
6965
+ var $parseDocument = publicApi.parseDocument;
6966
+ var $stringify = publicApi.stringify;
6967
+ var $visit = visit.visit;
6968
+ var $visitAsync = visit.visitAsync;
7064
6969
 
7065
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/helper/promise-event-emitter.js
7066
- class EventEmitter {
7067
- #listeners = new Map;
7068
- on(type, listener) {
7069
- const prevSet = this.#listeners.get(type);
7070
- const listenerSet = prevSet ?? new Set;
7071
- listenerSet?.add(listener);
7072
- this.#listeners.set(type, listenerSet);
7073
- }
7074
- emit(type, ...args) {
7075
- const listenerSet = this.#listeners.get(type);
7076
- if (!listenerSet) {
7077
- return;
7078
- }
7079
- for (const listenerSetElement of listenerSet) {
7080
- listenerSetElement(...args);
7081
- }
7082
- }
7083
- off(type, listener) {
7084
- const listenerSet = this.#listeners.get(type);
7085
- if (!listenerSet) {
7086
- return;
7087
- }
7088
- for (const listenerSetElement of listenerSet) {
7089
- if (listenerSetElement === listener) {
7090
- listenerSet.delete(listener);
7091
- }
7092
- }
7093
- }
7094
- removeAllListeners() {
7095
- this.#listeners.clear();
7096
- }
7097
- listenerCount(type) {
7098
- return this.#listeners.get(type)?.size ?? 0;
7099
- }
7100
- listeners(type) {
7101
- return Array.from(this.#listeners.get(type) ?? []);
7102
- }
7103
- }
7104
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RuleContext.js
7105
- var init_RuleContext = () => {};
7106
- // node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/index.js
7107
- class SecretLintProfiler {
7108
- perf;
7109
- entries = [];
7110
- measures = [];
7111
- executionPromises = [];
7112
- constructor(options) {
7113
- this.perf = options.perf;
7114
- const pattern = /(.*?)::end(\|\|.*)?/;
7115
- const observer = new options.PerformanceObserver((items) => {
7116
- const entries = items.getEntries();
7117
- entries.forEach((entry) => {
7118
- if (entry.entryType === "mark") {
7119
- const match = entry.name.match(pattern);
7120
- const endIdentifier = match ? match[1] : undefined;
7121
- const suffix = match && match[2] ? match[2] : "";
7122
- if (endIdentifier) {
7123
- const startIdentifier = `${endIdentifier}::start`;
7124
- this.entries.find((savedEntry) => {
7125
- return savedEntry.name === startIdentifier;
7126
- });
7127
- if (startIdentifier) {
7128
- this.executionPromises.push(Promise.resolve().then(() => {
7129
- this.perf.measure(endIdentifier + suffix, `${endIdentifier}::start${suffix}`, `${endIdentifier}::end${suffix}`);
7130
- }));
7131
- }
7132
- }
7133
- this.entries.push(entry);
7134
- } else if (entry.entryType === "measure") {
7135
- this.measures.push(entry);
7136
- }
7137
- });
7138
- });
7139
- observer.observe({ entryTypes: ["mark", "measure"] });
7140
- }
7141
- mark(marker) {
7142
- if ("id" in marker) {
7143
- this.perf.mark(`${marker.type}||${marker.id}`);
7144
- } else {
7145
- this.perf.mark(marker.type);
7146
- }
7147
- }
7148
- waifForExecutionPromises = () => {
7149
- return Promise.all(this.executionPromises).finally(() => {
7150
- this.executionPromises.length = 0;
7151
- });
7152
- };
7153
- async getEntries() {
7154
- await this.waifForExecutionPromises();
7155
- return this.entries;
7156
- }
7157
- async getMeasures() {
7158
- await this.waifForExecutionPromises();
7159
- return this.measures;
6970
+ // telegram-plugin/secret-detect/patterns.ts
6971
+ var ANCHORED_PATTERNS = [
6972
+ { rule_id: "anthropic_api_key", regex: /\b(sk-ant-[A-Za-z0-9_-]{8,})\b/g, captureIndex: 1, slugHint: "anthropic_api_key" },
6973
+ { rule_id: "anthropic_oauth_code", regex: /(?:^|\s)([A-Za-z0-9_-]{20,}#[A-Za-z0-9_-]{20,})(?=\s|$)/gm, captureIndex: 1, slugHint: "anthropic_oauth_code" },
6974
+ { rule_id: "openai_api_key", regex: /\b(sk-[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "openai_api_key" },
6975
+ { rule_id: "github_pat_classic", regex: /\b(ghp_[A-Za-z0-9]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
6976
+ { rule_id: "github_pat_fine_grained", regex: /\b(github_pat_[A-Za-z0-9_]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
6977
+ { rule_id: "slack_token", regex: /\b(xox[baprs]-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_token" },
6978
+ { rule_id: "slack_app_token", regex: /\b(xapp-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_app_token" },
6979
+ { rule_id: "groq_api_key", regex: /\b(gsk_[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "groq_api_key" },
6980
+ { rule_id: "google_api_key", regex: /\b(AIza[0-9A-Za-z\-_]{20,})\b/g, captureIndex: 1, slugHint: "google_api_key" },
6981
+ { rule_id: "perplexity_api_key", regex: /\b(pplx-[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "perplexity_api_key" },
6982
+ { rule_id: "npm_token", regex: /\b(npm_[A-Za-z0-9]{10,})\b/g, captureIndex: 1, slugHint: "npm_token" },
6983
+ { rule_id: "telegram_bot_token_prefixed", regex: /\bbot(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
6984
+ { rule_id: "telegram_bot_token", regex: /\b(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
6985
+ { rule_id: "laravel_sanctum_token", regex: /\b(\d+\|[A-Za-z0-9]{40,})\b/g, captureIndex: 1, slugHint: "api_token" },
6986
+ { rule_id: "aws_access_key", regex: /\b(AKIA[0-9A-Z]{16})\b/g, captureIndex: 1, slugHint: "aws_access_key" },
6987
+ { rule_id: "jwt", regex: /\b(eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "jwt" }
6988
+ ];
6989
+ var STRUCTURED_PATTERNS = [
6990
+ {
6991
+ rule_id: "env_key_value",
6992
+ regex: /\b([A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD))\b\s*[=:]\s*(["']?)([^\s"'\\]+)\2/g,
6993
+ captureIndex: 3,
6994
+ slugHint: "env"
6995
+ },
6996
+ {
6997
+ rule_id: "json_secret_field",
6998
+ regex: /"(?:apiKey|token|secret|password|passwd|accessToken|refreshToken)"\s*:\s*"([^"]+)"/g,
6999
+ captureIndex: 1,
7000
+ slugHint: "json_secret"
7001
+ },
7002
+ {
7003
+ rule_id: "cli_flag",
7004
+ regex: /--(?:api[-_]?key|hook[-_]?token|token|secret|password|passwd)\s+(["']?)([^\s"']+)\1/g,
7005
+ captureIndex: 2,
7006
+ slugHint: "cli_flag"
7007
+ },
7008
+ {
7009
+ rule_id: "bearer_auth_header",
7010
+ regex: /Authorization\s*[:=]\s*Bearer\s+([A-Za-z0-9._\-+=]+)/g,
7011
+ captureIndex: 1,
7012
+ slugHint: "bearer_token"
7013
+ },
7014
+ {
7015
+ rule_id: "bearer_loose",
7016
+ regex: /\bBearer\s+([A-Za-z0-9._\-+=]{18,})\b/g,
7017
+ captureIndex: 1,
7018
+ slugHint: "bearer_token"
7019
+ },
7020
+ {
7021
+ rule_id: "pem_private_key",
7022
+ regex: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]+?-----END [A-Z ]*PRIVATE KEY-----/g,
7023
+ captureIndex: 0,
7024
+ slugHint: "pem_private_key"
7160
7025
  }
7161
- }
7162
-
7163
- // node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/node.js
7164
- import perf_hooks from "node:perf_hooks";
7165
-
7166
- class NullPerformanceObserver {
7167
- disconnect() {}
7168
- observe(_options) {}
7169
- }
7170
- var secretLintProfiler;
7171
- var init_node = __esm(() => {
7172
- secretLintProfiler = new SecretLintProfiler({
7173
- perf: perf_hooks.performance,
7174
- PerformanceObserver: perf_hooks.PerformanceObserver ? perf_hooks.PerformanceObserver : NullPerformanceObserver
7175
- });
7176
- });
7177
-
7178
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RunningEvents.js
7179
- var init_RunningEvents = __esm(() => {
7180
- init_node();
7181
- });
7182
-
7183
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RulePresetContext.js
7184
- var init_RulePresetContext = __esm(() => {
7185
- init_RuleContext();
7186
- });
7187
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/messages/index.js
7188
- var init_messages = () => {};
7026
+ ];
7027
+ var PROVIDER_PATTERNS = [
7028
+ { rule_id: "slack_webhook", regex: /(https:\/\/hooks\.slack\.com\/services\/[A-Za-z0-9_/]+)/g, captureIndex: 1, slugHint: "slack_webhook" },
7029
+ { rule_id: "stripe_live_secret", regex: /\b(sk_live_[A-Za-z0-9]{24,})\b/g, captureIndex: 1, slugHint: "stripe_key" },
7030
+ { rule_id: "stripe_restricted", regex: /\b(rk_live_[A-Za-z0-9]{24,})\b/g, captureIndex: 1, slugHint: "stripe_key" },
7031
+ { rule_id: "sendgrid_api_key", regex: /\b(SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43})\b/g, captureIndex: 1, slugHint: "sendgrid_key" },
7032
+ { rule_id: "gitlab_pat", regex: /\b(glpat-[A-Za-z0-9_-]{20})\b/g, captureIndex: 1, slugHint: "gitlab_pat" },
7033
+ { rule_id: "huggingface_token", regex: /\b(hf_[A-Za-z0-9]{34,})\b/g, captureIndex: 1, slugHint: "huggingface_token" },
7034
+ { rule_id: "twilio_api_key", regex: /\b(SK[0-9a-f]{32})\b/g, captureIndex: 1, slugHint: "twilio_api_key" },
7035
+ { rule_id: "mailgun_key", regex: /\b(key-[0-9a-f]{32})\b/g, captureIndex: 1, slugHint: "mailgun_key" },
7036
+ { rule_id: "digitalocean_pat", regex: /\b(dop_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
7037
+ { rule_id: "digitalocean_oauth", regex: /\b(doo_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
7038
+ { rule_id: "digitalocean_refresh", regex: /\b(dor_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
7039
+ { rule_id: "doppler_token", regex: /\b(dp\.(?:pt|st|ct|sa|scim|audit)\.[A-Za-z0-9]{40,44})\b/g, captureIndex: 1, slugHint: "doppler_token" },
7040
+ { rule_id: "linear_api_key", regex: /\b(lin_api_[A-Za-z0-9]{40})\b/g, captureIndex: 1, slugHint: "linear_api_key" },
7041
+ { rule_id: "shopify_access_token", regex: /\b(shpat_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
7042
+ { rule_id: "shopify_shared_secret", regex: /\b(shpss_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
7043
+ { rule_id: "shopify_private_app", regex: /\b(shppa_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
7044
+ { rule_id: "square_access_token", regex: /\b(sq0atp-[A-Za-z0-9_-]{22})\b/g, captureIndex: 1, slugHint: "square_token" },
7045
+ { rule_id: "square_oauth_secret", regex: /\b(sq0csp-[A-Za-z0-9_-]{43})\b/g, captureIndex: 1, slugHint: "square_token" },
7046
+ { rule_id: "newrelic_key", regex: /\b(NRAK-[A-Z0-9]{27})\b/g, captureIndex: 1, slugHint: "newrelic_key" },
7047
+ { rule_id: "notion_token", regex: /\b(ntn_[A-Za-z0-9]{46})\b/g, captureIndex: 1, slugHint: "notion_token" },
7048
+ { rule_id: "planetscale_password", regex: /\b(pscale_pw_[A-Za-z0-9_.-]{43})\b/g, captureIndex: 1, slugHint: "planetscale_token" },
7049
+ { rule_id: "planetscale_token", regex: /\b(pscale_tkn_[A-Za-z0-9_.-]{43})\b/g, captureIndex: 1, slugHint: "planetscale_token" },
7050
+ { rule_id: "supabase_service_key", regex: /\b(sbp_[a-f0-9]{40})\b/g, captureIndex: 1, slugHint: "supabase_key" },
7051
+ { rule_id: "atlassian_token", regex: /\b(ATATT[A-Za-z0-9_\-=]{20,})\b/g, captureIndex: 1, slugHint: "atlassian_token" },
7052
+ { rule_id: "dropbox_token", regex: /\b(sl\.[A-Za-z0-9_-]{130,})/g, captureIndex: 1, slugHint: "dropbox_token" },
7053
+ { rule_id: "databricks_token", regex: /\b(dapi[a-f0-9]{32})\b/g, captureIndex: 1, slugHint: "databricks_token" },
7054
+ { rule_id: "grafana_service_account", regex: /\b(glsa_[A-Za-z0-9]{32}_[a-fA-F0-9]{8})\b/g, captureIndex: 1, slugHint: "grafana_token" },
7055
+ { rule_id: "pypi_token", regex: /\b(pypi-AgEIcHlwaS[A-Za-z0-9_-]{50,})/g, captureIndex: 1, slugHint: "pypi_token" },
7056
+ { rule_id: "aws_temp_access_key", regex: /\b(ASIA[0-9A-Z]{16})\b/g, captureIndex: 1, slugHint: "aws_access_key" },
7057
+ { rule_id: "gcp_oauth_token", regex: /\b(ya29\.[A-Za-z0-9_-]{30,})/g, captureIndex: 1, slugHint: "gcp_oauth_token" }
7058
+ ];
7059
+ var ALL_PATTERNS = [...ANCHORED_PATTERNS, ...PROVIDER_PATTERNS, ...STRUCTURED_PATTERNS];
7189
7060
 
7190
- // node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
7191
- var require_ms = __commonJS((exports, module) => {
7192
- var s = 1000;
7193
- var m = s * 60;
7194
- var h = m * 60;
7195
- var d = h * 24;
7196
- var w = d * 7;
7197
- var y = d * 365.25;
7198
- module.exports = function(val, options) {
7199
- options = options || {};
7200
- var type = typeof val;
7201
- if (type === "string" && val.length > 0) {
7202
- return parse(val);
7203
- } else if (type === "number" && isFinite(val)) {
7204
- return options.long ? fmtLong(val) : fmtShort(val);
7205
- }
7206
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
7207
- };
7208
- function parse(str) {
7209
- str = String(str);
7210
- if (str.length > 100) {
7211
- return;
7212
- }
7213
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
7214
- if (!match) {
7215
- return;
7216
- }
7217
- var n = parseFloat(match[1]);
7218
- var type = (match[2] || "ms").toLowerCase();
7219
- switch (type) {
7220
- case "years":
7221
- case "year":
7222
- case "yrs":
7223
- case "yr":
7224
- case "y":
7225
- return n * y;
7226
- case "weeks":
7227
- case "week":
7228
- case "w":
7229
- return n * w;
7230
- case "days":
7231
- case "day":
7232
- case "d":
7233
- return n * d;
7234
- case "hours":
7235
- case "hour":
7236
- case "hrs":
7237
- case "hr":
7238
- case "h":
7239
- return n * h;
7240
- case "minutes":
7241
- case "minute":
7242
- case "mins":
7243
- case "min":
7244
- case "m":
7245
- return n * m;
7246
- case "seconds":
7247
- case "second":
7248
- case "secs":
7249
- case "sec":
7250
- case "s":
7251
- return n * s;
7252
- case "milliseconds":
7253
- case "millisecond":
7254
- case "msecs":
7255
- case "msec":
7256
- case "ms":
7257
- return n;
7258
- default:
7259
- return;
7260
- }
7261
- }
7262
- function fmtShort(ms) {
7263
- var msAbs = Math.abs(ms);
7264
- if (msAbs >= d) {
7265
- return Math.round(ms / d) + "d";
7266
- }
7267
- if (msAbs >= h) {
7268
- return Math.round(ms / h) + "h";
7269
- }
7270
- if (msAbs >= m) {
7271
- return Math.round(ms / m) + "m";
7272
- }
7273
- if (msAbs >= s) {
7274
- return Math.round(ms / s) + "s";
7275
- }
7276
- return ms + "ms";
7277
- }
7278
- function fmtLong(ms) {
7279
- var msAbs = Math.abs(ms);
7280
- if (msAbs >= d) {
7281
- return plural(ms, msAbs, d, "day");
7282
- }
7283
- if (msAbs >= h) {
7284
- return plural(ms, msAbs, h, "hour");
7285
- }
7286
- if (msAbs >= m) {
7287
- return plural(ms, msAbs, m, "minute");
7288
- }
7289
- if (msAbs >= s) {
7290
- return plural(ms, msAbs, s, "second");
7291
- }
7292
- return ms + " ms";
7293
- }
7294
- function plural(ms, msAbs, n, name) {
7295
- var isPlural = msAbs >= n * 1.5;
7296
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
7297
- }
7298
- });
7299
-
7300
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
7301
- var require_common = __commonJS((exports, module) => {
7302
- function setup(env) {
7303
- createDebug.debug = createDebug;
7304
- createDebug.default = createDebug;
7305
- createDebug.coerce = coerce;
7306
- createDebug.disable = disable;
7307
- createDebug.enable = enable;
7308
- createDebug.enabled = enabled;
7309
- createDebug.humanize = require_ms();
7310
- createDebug.destroy = destroy;
7311
- Object.keys(env).forEach((key) => {
7312
- createDebug[key] = env[key];
7313
- });
7314
- createDebug.names = [];
7315
- createDebug.skips = [];
7316
- createDebug.formatters = {};
7317
- function selectColor(namespace) {
7318
- let hash = 0;
7319
- for (let i = 0;i < namespace.length; i++) {
7320
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
7321
- hash |= 0;
7322
- }
7323
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
7324
- }
7325
- createDebug.selectColor = selectColor;
7326
- function createDebug(namespace) {
7327
- let prevTime;
7328
- let enableOverride = null;
7329
- let namespacesCache;
7330
- let enabledCache;
7331
- function debug(...args) {
7332
- if (!debug.enabled) {
7333
- return;
7334
- }
7335
- const self2 = debug;
7336
- const curr = Number(new Date);
7337
- const ms = curr - (prevTime || curr);
7338
- self2.diff = ms;
7339
- self2.prev = prevTime;
7340
- self2.curr = curr;
7341
- prevTime = curr;
7342
- args[0] = createDebug.coerce(args[0]);
7343
- if (typeof args[0] !== "string") {
7344
- args.unshift("%O");
7345
- }
7346
- let index = 0;
7347
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
7348
- if (match === "%%") {
7349
- return "%";
7350
- }
7351
- index++;
7352
- const formatter = createDebug.formatters[format];
7353
- if (typeof formatter === "function") {
7354
- const val = args[index];
7355
- match = formatter.call(self2, val);
7356
- args.splice(index, 1);
7357
- index--;
7358
- }
7359
- return match;
7360
- });
7361
- createDebug.formatArgs.call(self2, args);
7362
- const logFn = self2.log || createDebug.log;
7363
- logFn.apply(self2, args);
7364
- }
7365
- debug.namespace = namespace;
7366
- debug.useColors = createDebug.useColors();
7367
- debug.color = createDebug.selectColor(namespace);
7368
- debug.extend = extend;
7369
- debug.destroy = createDebug.destroy;
7370
- Object.defineProperty(debug, "enabled", {
7371
- enumerable: true,
7372
- configurable: false,
7373
- get: () => {
7374
- if (enableOverride !== null) {
7375
- return enableOverride;
7376
- }
7377
- if (namespacesCache !== createDebug.namespaces) {
7378
- namespacesCache = createDebug.namespaces;
7379
- enabledCache = createDebug.enabled(namespace);
7380
- }
7381
- return enabledCache;
7382
- },
7383
- set: (v) => {
7384
- enableOverride = v;
7385
- }
7386
- });
7387
- if (typeof createDebug.init === "function") {
7388
- createDebug.init(debug);
7389
- }
7390
- return debug;
7391
- }
7392
- function extend(namespace, delimiter) {
7393
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
7394
- newDebug.log = this.log;
7395
- return newDebug;
7396
- }
7397
- function enable(namespaces) {
7398
- createDebug.save(namespaces);
7399
- createDebug.namespaces = namespaces;
7400
- createDebug.names = [];
7401
- createDebug.skips = [];
7402
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
7403
- for (const ns of split) {
7404
- if (ns[0] === "-") {
7405
- createDebug.skips.push(ns.slice(1));
7406
- } else {
7407
- createDebug.names.push(ns);
7408
- }
7409
- }
7410
- }
7411
- function matchesTemplate(search, template) {
7412
- let searchIndex = 0;
7413
- let templateIndex = 0;
7414
- let starIndex = -1;
7415
- let matchIndex = 0;
7416
- while (searchIndex < search.length) {
7417
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
7418
- if (template[templateIndex] === "*") {
7419
- starIndex = templateIndex;
7420
- matchIndex = searchIndex;
7421
- templateIndex++;
7422
- } else {
7423
- searchIndex++;
7424
- templateIndex++;
7425
- }
7426
- } else if (starIndex !== -1) {
7427
- templateIndex = starIndex + 1;
7428
- matchIndex++;
7429
- searchIndex = matchIndex;
7430
- } else {
7431
- return false;
7432
- }
7433
- }
7434
- while (templateIndex < template.length && template[templateIndex] === "*") {
7435
- templateIndex++;
7436
- }
7437
- return templateIndex === template.length;
7438
- }
7439
- function disable() {
7440
- const namespaces = [
7441
- ...createDebug.names,
7442
- ...createDebug.skips.map((namespace) => "-" + namespace)
7443
- ].join(",");
7444
- createDebug.enable("");
7445
- return namespaces;
7446
- }
7447
- function enabled(name) {
7448
- for (const skip of createDebug.skips) {
7449
- if (matchesTemplate(name, skip)) {
7450
- return false;
7451
- }
7452
- }
7453
- for (const ns of createDebug.names) {
7454
- if (matchesTemplate(name, ns)) {
7455
- return true;
7456
- }
7457
- }
7458
- return false;
7459
- }
7460
- function coerce(val) {
7461
- if (val instanceof Error) {
7462
- return val.stack || val.message;
7463
- }
7464
- return val;
7465
- }
7466
- function destroy() {
7467
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7468
- }
7469
- createDebug.enable(createDebug.load());
7470
- return createDebug;
7471
- }
7472
- module.exports = setup;
7473
- });
7474
-
7475
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
7476
- var require_browser = __commonJS((exports, module) => {
7477
- exports.formatArgs = formatArgs;
7478
- exports.save = save;
7479
- exports.load = load;
7480
- exports.useColors = useColors;
7481
- exports.storage = localstorage();
7482
- exports.destroy = (() => {
7483
- let warned = false;
7484
- return () => {
7485
- if (!warned) {
7486
- warned = true;
7487
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7488
- }
7489
- };
7490
- })();
7491
- exports.colors = [
7492
- "#0000CC",
7493
- "#0000FF",
7494
- "#0033CC",
7495
- "#0033FF",
7496
- "#0066CC",
7497
- "#0066FF",
7498
- "#0099CC",
7499
- "#0099FF",
7500
- "#00CC00",
7501
- "#00CC33",
7502
- "#00CC66",
7503
- "#00CC99",
7504
- "#00CCCC",
7505
- "#00CCFF",
7506
- "#3300CC",
7507
- "#3300FF",
7508
- "#3333CC",
7509
- "#3333FF",
7510
- "#3366CC",
7511
- "#3366FF",
7512
- "#3399CC",
7513
- "#3399FF",
7514
- "#33CC00",
7515
- "#33CC33",
7516
- "#33CC66",
7517
- "#33CC99",
7518
- "#33CCCC",
7519
- "#33CCFF",
7520
- "#6600CC",
7521
- "#6600FF",
7522
- "#6633CC",
7523
- "#6633FF",
7524
- "#66CC00",
7525
- "#66CC33",
7526
- "#9900CC",
7527
- "#9900FF",
7528
- "#9933CC",
7529
- "#9933FF",
7530
- "#99CC00",
7531
- "#99CC33",
7532
- "#CC0000",
7533
- "#CC0033",
7534
- "#CC0066",
7535
- "#CC0099",
7536
- "#CC00CC",
7537
- "#CC00FF",
7538
- "#CC3300",
7539
- "#CC3333",
7540
- "#CC3366",
7541
- "#CC3399",
7542
- "#CC33CC",
7543
- "#CC33FF",
7544
- "#CC6600",
7545
- "#CC6633",
7546
- "#CC9900",
7547
- "#CC9933",
7548
- "#CCCC00",
7549
- "#CCCC33",
7550
- "#FF0000",
7551
- "#FF0033",
7552
- "#FF0066",
7553
- "#FF0099",
7554
- "#FF00CC",
7555
- "#FF00FF",
7556
- "#FF3300",
7557
- "#FF3333",
7558
- "#FF3366",
7559
- "#FF3399",
7560
- "#FF33CC",
7561
- "#FF33FF",
7562
- "#FF6600",
7563
- "#FF6633",
7564
- "#FF9900",
7565
- "#FF9933",
7566
- "#FFCC00",
7567
- "#FFCC33"
7568
- ];
7569
- function useColors() {
7570
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
7571
- return true;
7572
- }
7573
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
7574
- return false;
7575
- }
7576
- let m;
7577
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
7578
- }
7579
- function formatArgs(args) {
7580
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
7581
- if (!this.useColors) {
7582
- return;
7583
- }
7584
- const c = "color: " + this.color;
7585
- args.splice(1, 0, c, "color: inherit");
7586
- let index = 0;
7587
- let lastC = 0;
7588
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
7589
- if (match === "%%") {
7590
- return;
7591
- }
7592
- index++;
7593
- if (match === "%c") {
7594
- lastC = index;
7595
- }
7596
- });
7597
- args.splice(lastC, 0, c);
7598
- }
7599
- exports.log = console.debug || console.log || (() => {});
7600
- function save(namespaces) {
7601
- try {
7602
- if (namespaces) {
7603
- exports.storage.setItem("debug", namespaces);
7604
- } else {
7605
- exports.storage.removeItem("debug");
7606
- }
7607
- } catch (error) {}
7608
- }
7609
- function load() {
7610
- let r;
7611
- try {
7612
- r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
7613
- } catch (error) {}
7614
- if (!r && typeof process !== "undefined" && "env" in process) {
7615
- r = process.env.DEBUG;
7616
- }
7617
- return r;
7618
- }
7619
- function localstorage() {
7620
- try {
7621
- return localStorage;
7622
- } catch (error) {}
7623
- }
7624
- module.exports = require_common()(exports);
7625
- var { formatters } = module.exports;
7626
- formatters.j = function(v) {
7627
- try {
7628
- return JSON.stringify(v);
7629
- } catch (error) {
7630
- return "[UnexpectedJSONParseError]: " + error.message;
7631
- }
7632
- };
7633
- });
7634
-
7635
- // node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
7636
- var require_has_flag = __commonJS((exports, module) => {
7637
- module.exports = (flag, argv = process.argv) => {
7638
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7639
- const position = argv.indexOf(prefix + flag);
7640
- const terminatorPosition = argv.indexOf("--");
7641
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7642
- };
7643
- });
7644
-
7645
- // node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
7646
- var require_supports_color = __commonJS((exports, module) => {
7647
- var os = __require("os");
7648
- var tty = __require("tty");
7649
- var hasFlag = require_has_flag();
7650
- var { env } = process;
7651
- var forceColor;
7652
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
7653
- forceColor = 0;
7654
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
7655
- forceColor = 1;
7656
- }
7657
- if ("FORCE_COLOR" in env) {
7658
- if (env.FORCE_COLOR === "true") {
7659
- forceColor = 1;
7660
- } else if (env.FORCE_COLOR === "false") {
7661
- forceColor = 0;
7662
- } else {
7663
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
7664
- }
7665
- }
7666
- function translateLevel(level) {
7667
- if (level === 0) {
7668
- return false;
7669
- }
7670
- return {
7671
- level,
7672
- hasBasic: true,
7673
- has256: level >= 2,
7674
- has16m: level >= 3
7675
- };
7676
- }
7677
- function supportsColor(haveStream, streamIsTTY) {
7678
- if (forceColor === 0) {
7679
- return 0;
7680
- }
7681
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
7682
- return 3;
7683
- }
7684
- if (hasFlag("color=256")) {
7685
- return 2;
7686
- }
7687
- if (haveStream && !streamIsTTY && forceColor === undefined) {
7688
- return 0;
7689
- }
7690
- const min = forceColor || 0;
7691
- if (env.TERM === "dumb") {
7692
- return min;
7693
- }
7694
- if (process.platform === "win32") {
7695
- const osRelease = os.release().split(".");
7696
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7697
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
7698
- }
7699
- return 1;
7700
- }
7701
- if ("CI" in env) {
7702
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
7703
- return 1;
7704
- }
7705
- return min;
7706
- }
7707
- if ("TEAMCITY_VERSION" in env) {
7708
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
7709
- }
7710
- if (env.COLORTERM === "truecolor") {
7711
- return 3;
7712
- }
7713
- if ("TERM_PROGRAM" in env) {
7714
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
7715
- switch (env.TERM_PROGRAM) {
7716
- case "iTerm.app":
7717
- return version >= 3 ? 3 : 2;
7718
- case "Apple_Terminal":
7719
- return 2;
7720
- }
7721
- }
7722
- if (/-256(color)?$/i.test(env.TERM)) {
7723
- return 2;
7724
- }
7725
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
7726
- return 1;
7727
- }
7728
- if ("COLORTERM" in env) {
7729
- return 1;
7730
- }
7731
- return min;
7732
- }
7733
- function getSupportLevel(stream) {
7734
- const level = supportsColor(stream, stream && stream.isTTY);
7735
- return translateLevel(level);
7736
- }
7737
- module.exports = {
7738
- supportsColor: getSupportLevel,
7739
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
7740
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
7741
- };
7742
- });
7743
-
7744
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
7745
- var require_node = __commonJS((exports, module) => {
7746
- var tty = __require("tty");
7747
- var util = __require("util");
7748
- exports.init = init;
7749
- exports.log = log;
7750
- exports.formatArgs = formatArgs;
7751
- exports.save = save;
7752
- exports.load = load;
7753
- exports.useColors = useColors;
7754
- exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
7755
- exports.colors = [6, 2, 3, 4, 5, 1];
7756
- try {
7757
- const supportsColor = require_supports_color();
7758
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
7759
- exports.colors = [
7760
- 20,
7761
- 21,
7762
- 26,
7763
- 27,
7764
- 32,
7765
- 33,
7766
- 38,
7767
- 39,
7768
- 40,
7769
- 41,
7770
- 42,
7771
- 43,
7772
- 44,
7773
- 45,
7774
- 56,
7775
- 57,
7776
- 62,
7777
- 63,
7778
- 68,
7779
- 69,
7780
- 74,
7781
- 75,
7782
- 76,
7783
- 77,
7784
- 78,
7785
- 79,
7786
- 80,
7787
- 81,
7788
- 92,
7789
- 93,
7790
- 98,
7791
- 99,
7792
- 112,
7793
- 113,
7794
- 128,
7795
- 129,
7796
- 134,
7797
- 135,
7798
- 148,
7799
- 149,
7800
- 160,
7801
- 161,
7802
- 162,
7803
- 163,
7804
- 164,
7805
- 165,
7806
- 166,
7807
- 167,
7808
- 168,
7809
- 169,
7810
- 170,
7811
- 171,
7812
- 172,
7813
- 173,
7814
- 178,
7815
- 179,
7816
- 184,
7817
- 185,
7818
- 196,
7819
- 197,
7820
- 198,
7821
- 199,
7822
- 200,
7823
- 201,
7824
- 202,
7825
- 203,
7826
- 204,
7827
- 205,
7828
- 206,
7829
- 207,
7830
- 208,
7831
- 209,
7832
- 214,
7833
- 215,
7834
- 220,
7835
- 221
7836
- ];
7837
- }
7838
- } catch (error) {}
7839
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
7840
- return /^debug_/i.test(key);
7841
- }).reduce((obj, key) => {
7842
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
7843
- return k.toUpperCase();
7844
- });
7845
- let val = process.env[key];
7846
- if (/^(yes|on|true|enabled)$/i.test(val)) {
7847
- val = true;
7848
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
7849
- val = false;
7850
- } else if (val === "null") {
7851
- val = null;
7852
- } else {
7853
- val = Number(val);
7854
- }
7855
- obj[prop] = val;
7856
- return obj;
7857
- }, {});
7858
- function useColors() {
7859
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
7860
- }
7861
- function formatArgs(args) {
7862
- const { namespace: name, useColors: useColors2 } = this;
7863
- if (useColors2) {
7864
- const c = this.color;
7865
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
7866
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
7867
- args[0] = prefix + args[0].split(`
7868
- `).join(`
7869
- ` + prefix);
7870
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
7871
- } else {
7872
- args[0] = getDate() + name + " " + args[0];
7873
- }
7874
- }
7875
- function getDate() {
7876
- if (exports.inspectOpts.hideDate) {
7877
- return "";
7878
- }
7879
- return new Date().toISOString() + " ";
7880
- }
7881
- function log(...args) {
7882
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + `
7883
- `);
7884
- }
7885
- function save(namespaces) {
7886
- if (namespaces) {
7887
- process.env.DEBUG = namespaces;
7888
- } else {
7889
- delete process.env.DEBUG;
7890
- }
7891
- }
7892
- function load() {
7893
- return process.env.DEBUG;
7894
- }
7895
- function init(debug) {
7896
- debug.inspectOpts = {};
7897
- const keys = Object.keys(exports.inspectOpts);
7898
- for (let i = 0;i < keys.length; i++) {
7899
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
7900
- }
7901
- }
7902
- module.exports = require_common()(exports);
7903
- var { formatters } = module.exports;
7904
- formatters.o = function(v) {
7905
- this.inspectOpts.colors = this.useColors;
7906
- return util.inspect(v, this.inspectOpts).split(`
7907
- `).map((str) => str.trim()).join(" ");
7908
- };
7909
- formatters.O = function(v) {
7910
- this.inspectOpts.colors = this.useColors;
7911
- return util.inspect(v, this.inspectOpts);
7912
- };
7913
- });
7914
-
7915
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
7916
- var require_src = __commonJS((exports, module) => {
7917
- if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
7918
- module.exports = require_browser();
7919
- } else {
7920
- module.exports = require_node();
7921
- }
7922
- });
7923
-
7924
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/index.js
7925
- var import_debug, debug;
7926
- var init_module = __esm(() => {
7927
- init_SecretLintSourceCodeImpl();
7928
- init_RuleContext();
7929
- init_RunningEvents();
7930
- init_node();
7931
- init_RulePresetContext();
7932
- init_messages();
7933
- import_debug = __toESM(require_src(), 1);
7934
- debug = import_debug.default("@secretlint/core");
7935
- });
7936
-
7937
- // node_modules/.bun/@secretlint+secretlint-rule-preset-recommend@12.2.0/node_modules/@secretlint/secretlint-rule-preset-recommend/module/index.js
7938
- function requireLodash_uniq() {
7939
- if (hasRequiredLodash_uniq)
7940
- return lodash_uniq;
7941
- hasRequiredLodash_uniq = 1;
7942
- var LARGE_ARRAY_SIZE = 200;
7943
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
7944
- var INFINITY = 1 / 0;
7945
- var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
7946
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
7947
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
7948
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
7949
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
7950
- var root = freeGlobal || freeSelf || Function("return this")();
7951
- function arrayIncludes(array, value) {
7952
- var length = array ? array.length : 0;
7953
- return !!length && baseIndexOf(array, value, 0) > -1;
7954
- }
7955
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
7956
- var length = array.length, index = fromIndex + -1;
7957
- while (++index < length) {
7958
- if (predicate(array[index], index, array)) {
7959
- return index;
7960
- }
7961
- }
7962
- return -1;
7963
- }
7964
- function baseIndexOf(array, value, fromIndex) {
7965
- if (value !== value) {
7966
- return baseFindIndex(array, baseIsNaN, fromIndex);
7967
- }
7968
- var index = fromIndex - 1, length = array.length;
7969
- while (++index < length) {
7970
- if (array[index] === value) {
7971
- return index;
7972
- }
7973
- }
7974
- return -1;
7975
- }
7976
- function baseIsNaN(value) {
7977
- return value !== value;
7978
- }
7979
- function cacheHas(cache, key) {
7980
- return cache.has(key);
7981
- }
7982
- function getValue(object, key) {
7983
- return object == null ? undefined : object[key];
7984
- }
7985
- function isHostObject(value) {
7986
- var result = false;
7987
- if (value != null && typeof value.toString != "function") {
7988
- try {
7989
- result = !!(value + "");
7990
- } catch (e) {}
7991
- }
7992
- return result;
7993
- }
7994
- function setToArray(set) {
7995
- var index = -1, result = Array(set.size);
7996
- set.forEach(function(value) {
7997
- result[++index] = value;
7998
- });
7999
- return result;
8000
- }
8001
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8002
- var coreJsData = root["__core-js_shared__"];
8003
- var maskSrcKey = function() {
8004
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8005
- return uid ? "Symbol(src)_1." + uid : "";
8006
- }();
8007
- var funcToString = funcProto.toString;
8008
- var hasOwnProperty = objectProto.hasOwnProperty;
8009
- var objectToString = objectProto.toString;
8010
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8011
- var splice = arrayProto.splice;
8012
- var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
8013
- function Hash(entries) {
8014
- var index = -1, length = entries ? entries.length : 0;
8015
- this.clear();
8016
- while (++index < length) {
8017
- var entry = entries[index];
8018
- this.set(entry[0], entry[1]);
8019
- }
8020
- }
8021
- function hashClear() {
8022
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
8023
- }
8024
- function hashDelete(key) {
8025
- return this.has(key) && delete this.__data__[key];
8026
- }
8027
- function hashGet(key) {
8028
- var data = this.__data__;
8029
- if (nativeCreate) {
8030
- var result = data[key];
8031
- return result === HASH_UNDEFINED ? undefined : result;
8032
- }
8033
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
8034
- }
8035
- function hashHas(key) {
8036
- var data = this.__data__;
8037
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8038
- }
8039
- function hashSet(key, value) {
8040
- var data = this.__data__;
8041
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8042
- return this;
8043
- }
8044
- Hash.prototype.clear = hashClear;
8045
- Hash.prototype["delete"] = hashDelete;
8046
- Hash.prototype.get = hashGet;
8047
- Hash.prototype.has = hashHas;
8048
- Hash.prototype.set = hashSet;
8049
- function ListCache(entries) {
8050
- var index = -1, length = entries ? entries.length : 0;
8051
- this.clear();
8052
- while (++index < length) {
8053
- var entry = entries[index];
8054
- this.set(entry[0], entry[1]);
8055
- }
8056
- }
8057
- function listCacheClear() {
8058
- this.__data__ = [];
8059
- }
8060
- function listCacheDelete(key) {
8061
- var data = this.__data__, index = assocIndexOf(data, key);
8062
- if (index < 0) {
8063
- return false;
8064
- }
8065
- var lastIndex = data.length - 1;
8066
- if (index == lastIndex) {
8067
- data.pop();
8068
- } else {
8069
- splice.call(data, index, 1);
8070
- }
8071
- return true;
8072
- }
8073
- function listCacheGet(key) {
8074
- var data = this.__data__, index = assocIndexOf(data, key);
8075
- return index < 0 ? undefined : data[index][1];
8076
- }
8077
- function listCacheHas(key) {
8078
- return assocIndexOf(this.__data__, key) > -1;
8079
- }
8080
- function listCacheSet(key, value) {
8081
- var data = this.__data__, index = assocIndexOf(data, key);
8082
- if (index < 0) {
8083
- data.push([key, value]);
8084
- } else {
8085
- data[index][1] = value;
8086
- }
8087
- return this;
8088
- }
8089
- ListCache.prototype.clear = listCacheClear;
8090
- ListCache.prototype["delete"] = listCacheDelete;
8091
- ListCache.prototype.get = listCacheGet;
8092
- ListCache.prototype.has = listCacheHas;
8093
- ListCache.prototype.set = listCacheSet;
8094
- function MapCache(entries) {
8095
- var index = -1, length = entries ? entries.length : 0;
8096
- this.clear();
8097
- while (++index < length) {
8098
- var entry = entries[index];
8099
- this.set(entry[0], entry[1]);
8100
- }
8101
- }
8102
- function mapCacheClear() {
8103
- this.__data__ = {
8104
- hash: new Hash,
8105
- map: new (Map2 || ListCache),
8106
- string: new Hash
8107
- };
8108
- }
8109
- function mapCacheDelete(key) {
8110
- return getMapData(this, key)["delete"](key);
8111
- }
8112
- function mapCacheGet(key) {
8113
- return getMapData(this, key).get(key);
8114
- }
8115
- function mapCacheHas(key) {
8116
- return getMapData(this, key).has(key);
8117
- }
8118
- function mapCacheSet(key, value) {
8119
- getMapData(this, key).set(key, value);
8120
- return this;
8121
- }
8122
- MapCache.prototype.clear = mapCacheClear;
8123
- MapCache.prototype["delete"] = mapCacheDelete;
8124
- MapCache.prototype.get = mapCacheGet;
8125
- MapCache.prototype.has = mapCacheHas;
8126
- MapCache.prototype.set = mapCacheSet;
8127
- function SetCache(values) {
8128
- var index = -1, length = values ? values.length : 0;
8129
- this.__data__ = new MapCache;
8130
- while (++index < length) {
8131
- this.add(values[index]);
8132
- }
8133
- }
8134
- function setCacheAdd(value) {
8135
- this.__data__.set(value, HASH_UNDEFINED);
8136
- return this;
8137
- }
8138
- function setCacheHas(value) {
8139
- return this.__data__.has(value);
8140
- }
8141
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8142
- SetCache.prototype.has = setCacheHas;
8143
- function assocIndexOf(array, key) {
8144
- var length = array.length;
8145
- while (length--) {
8146
- if (eq(array[length][0], key)) {
8147
- return length;
8148
- }
8149
- }
8150
- return -1;
8151
- }
8152
- function baseIsNative(value) {
8153
- if (!isObject(value) || isMasked(value)) {
8154
- return false;
8155
- }
8156
- var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
8157
- return pattern.test(toSource(value));
8158
- }
8159
- function baseUniq(array, iteratee, comparator) {
8160
- var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
8161
- if (length >= LARGE_ARRAY_SIZE) {
8162
- var set = createSet(array);
8163
- if (set) {
8164
- return setToArray(set);
8165
- }
8166
- isCommon = false;
8167
- includes = cacheHas;
8168
- seen = new SetCache;
8169
- } else {
8170
- seen = result;
8171
- }
8172
- outer:
8173
- while (++index < length) {
8174
- var value = array[index], computed = value;
8175
- value = value !== 0 ? value : 0;
8176
- if (isCommon && computed === computed) {
8177
- var seenIndex = seen.length;
8178
- while (seenIndex--) {
8179
- if (seen[seenIndex] === computed) {
8180
- continue outer;
8181
- }
8182
- }
8183
- result.push(value);
8184
- } else if (!includes(seen, computed, comparator)) {
8185
- if (seen !== result) {
8186
- seen.push(computed);
8187
- }
8188
- result.push(value);
8189
- }
8190
- }
8191
- return result;
8192
- }
8193
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
8194
- return new Set2(values);
8195
- };
8196
- function getMapData(map, key) {
8197
- var data = map.__data__;
8198
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
8199
- }
8200
- function getNative(object, key) {
8201
- var value = getValue(object, key);
8202
- return baseIsNative(value) ? value : undefined;
8203
- }
8204
- function isKeyable(value) {
8205
- var type = typeof value;
8206
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
8207
- }
8208
- function isMasked(func) {
8209
- return !!maskSrcKey && maskSrcKey in func;
8210
- }
8211
- function toSource(func) {
8212
- if (func != null) {
8213
- try {
8214
- return funcToString.call(func);
8215
- } catch (e) {}
8216
- try {
8217
- return func + "";
8218
- } catch (e) {}
8219
- }
8220
- return "";
8221
- }
8222
- function uniq(array) {
8223
- return array && array.length ? baseUniq(array) : [];
8224
- }
8225
- function eq(value, other) {
8226
- return value === other || value !== value && other !== other;
8227
- }
8228
- function isFunction(value) {
8229
- var tag = isObject(value) ? objectToString.call(value) : "";
8230
- return tag == funcTag || tag == genTag;
8231
- }
8232
- function isObject(value) {
8233
- var type = typeof value;
8234
- return !!value && (type == "object" || type == "function");
8235
- }
8236
- function noop() {}
8237
- lodash_uniq = uniq;
8238
- return lodash_uniq;
8239
- }
8240
- function requireLodash_uniqwith() {
8241
- if (hasRequiredLodash_uniqwith)
8242
- return lodash_uniqwith;
8243
- hasRequiredLodash_uniqwith = 1;
8244
- var LARGE_ARRAY_SIZE = 200;
8245
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
8246
- var INFINITY = 1 / 0;
8247
- var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
8248
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
8249
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
8250
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
8251
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
8252
- var root = freeGlobal || freeSelf || Function("return this")();
8253
- function arrayIncludes(array, value) {
8254
- var length = array ? array.length : 0;
8255
- return !!length && baseIndexOf(array, value, 0) > -1;
8256
- }
8257
- function arrayIncludesWith(array, value, comparator) {
8258
- var index = -1, length = array ? array.length : 0;
8259
- while (++index < length) {
8260
- if (comparator(value, array[index])) {
8261
- return true;
8262
- }
8263
- }
8264
- return false;
8265
- }
8266
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
8267
- var length = array.length, index = fromIndex + -1;
8268
- while (++index < length) {
8269
- if (predicate(array[index], index, array)) {
8270
- return index;
8271
- }
8272
- }
8273
- return -1;
8274
- }
8275
- function baseIndexOf(array, value, fromIndex) {
8276
- if (value !== value) {
8277
- return baseFindIndex(array, baseIsNaN, fromIndex);
8278
- }
8279
- var index = fromIndex - 1, length = array.length;
8280
- while (++index < length) {
8281
- if (array[index] === value) {
8282
- return index;
8283
- }
8284
- }
8285
- return -1;
8286
- }
8287
- function baseIsNaN(value) {
8288
- return value !== value;
8289
- }
8290
- function cacheHas(cache, key) {
8291
- return cache.has(key);
8292
- }
8293
- function getValue(object, key) {
8294
- return object == null ? undefined : object[key];
8295
- }
8296
- function isHostObject(value) {
8297
- var result = false;
8298
- if (value != null && typeof value.toString != "function") {
8299
- try {
8300
- result = !!(value + "");
8301
- } catch (e) {}
8302
- }
8303
- return result;
8304
- }
8305
- function setToArray(set) {
8306
- var index = -1, result = Array(set.size);
8307
- set.forEach(function(value) {
8308
- result[++index] = value;
8309
- });
8310
- return result;
8311
- }
8312
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8313
- var coreJsData = root["__core-js_shared__"];
8314
- var maskSrcKey = function() {
8315
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8316
- return uid ? "Symbol(src)_1." + uid : "";
8317
- }();
8318
- var funcToString = funcProto.toString;
8319
- var hasOwnProperty = objectProto.hasOwnProperty;
8320
- var objectToString = objectProto.toString;
8321
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8322
- var splice = arrayProto.splice;
8323
- var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
8324
- function Hash(entries) {
8325
- var index = -1, length = entries ? entries.length : 0;
8326
- this.clear();
8327
- while (++index < length) {
8328
- var entry = entries[index];
8329
- this.set(entry[0], entry[1]);
8330
- }
8331
- }
8332
- function hashClear() {
8333
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
8334
- }
8335
- function hashDelete(key) {
8336
- return this.has(key) && delete this.__data__[key];
8337
- }
8338
- function hashGet(key) {
8339
- var data = this.__data__;
8340
- if (nativeCreate) {
8341
- var result = data[key];
8342
- return result === HASH_UNDEFINED ? undefined : result;
8343
- }
8344
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
8345
- }
8346
- function hashHas(key) {
8347
- var data = this.__data__;
8348
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8349
- }
8350
- function hashSet(key, value) {
8351
- var data = this.__data__;
8352
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8353
- return this;
8354
- }
8355
- Hash.prototype.clear = hashClear;
8356
- Hash.prototype["delete"] = hashDelete;
8357
- Hash.prototype.get = hashGet;
8358
- Hash.prototype.has = hashHas;
8359
- Hash.prototype.set = hashSet;
8360
- function ListCache(entries) {
8361
- var index = -1, length = entries ? entries.length : 0;
8362
- this.clear();
8363
- while (++index < length) {
8364
- var entry = entries[index];
8365
- this.set(entry[0], entry[1]);
8366
- }
8367
- }
8368
- function listCacheClear() {
8369
- this.__data__ = [];
8370
- }
8371
- function listCacheDelete(key) {
8372
- var data = this.__data__, index = assocIndexOf(data, key);
8373
- if (index < 0) {
8374
- return false;
8375
- }
8376
- var lastIndex = data.length - 1;
8377
- if (index == lastIndex) {
8378
- data.pop();
8379
- } else {
8380
- splice.call(data, index, 1);
8381
- }
8382
- return true;
8383
- }
8384
- function listCacheGet(key) {
8385
- var data = this.__data__, index = assocIndexOf(data, key);
8386
- return index < 0 ? undefined : data[index][1];
8387
- }
8388
- function listCacheHas(key) {
8389
- return assocIndexOf(this.__data__, key) > -1;
8390
- }
8391
- function listCacheSet(key, value) {
8392
- var data = this.__data__, index = assocIndexOf(data, key);
8393
- if (index < 0) {
8394
- data.push([key, value]);
8395
- } else {
8396
- data[index][1] = value;
8397
- }
8398
- return this;
8399
- }
8400
- ListCache.prototype.clear = listCacheClear;
8401
- ListCache.prototype["delete"] = listCacheDelete;
8402
- ListCache.prototype.get = listCacheGet;
8403
- ListCache.prototype.has = listCacheHas;
8404
- ListCache.prototype.set = listCacheSet;
8405
- function MapCache(entries) {
8406
- var index = -1, length = entries ? entries.length : 0;
8407
- this.clear();
8408
- while (++index < length) {
8409
- var entry = entries[index];
8410
- this.set(entry[0], entry[1]);
8411
- }
8412
- }
8413
- function mapCacheClear() {
8414
- this.__data__ = {
8415
- hash: new Hash,
8416
- map: new (Map2 || ListCache),
8417
- string: new Hash
8418
- };
8419
- }
8420
- function mapCacheDelete(key) {
8421
- return getMapData(this, key)["delete"](key);
8422
- }
8423
- function mapCacheGet(key) {
8424
- return getMapData(this, key).get(key);
8425
- }
8426
- function mapCacheHas(key) {
8427
- return getMapData(this, key).has(key);
8428
- }
8429
- function mapCacheSet(key, value) {
8430
- getMapData(this, key).set(key, value);
8431
- return this;
8432
- }
8433
- MapCache.prototype.clear = mapCacheClear;
8434
- MapCache.prototype["delete"] = mapCacheDelete;
8435
- MapCache.prototype.get = mapCacheGet;
8436
- MapCache.prototype.has = mapCacheHas;
8437
- MapCache.prototype.set = mapCacheSet;
8438
- function SetCache(values) {
8439
- var index = -1, length = values ? values.length : 0;
8440
- this.__data__ = new MapCache;
8441
- while (++index < length) {
8442
- this.add(values[index]);
8443
- }
8444
- }
8445
- function setCacheAdd(value) {
8446
- this.__data__.set(value, HASH_UNDEFINED);
8447
- return this;
8448
- }
8449
- function setCacheHas(value) {
8450
- return this.__data__.has(value);
8451
- }
8452
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8453
- SetCache.prototype.has = setCacheHas;
8454
- function assocIndexOf(array, key) {
8455
- var length = array.length;
8456
- while (length--) {
8457
- if (eq(array[length][0], key)) {
8458
- return length;
8459
- }
8460
- }
8461
- return -1;
8462
- }
8463
- function baseIsNative(value) {
8464
- if (!isObject(value) || isMasked(value)) {
8465
- return false;
8466
- }
8467
- var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
8468
- return pattern.test(toSource(value));
8469
- }
8470
- function baseUniq(array, iteratee, comparator) {
8471
- var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
8472
- if (comparator) {
8473
- isCommon = false;
8474
- includes = arrayIncludesWith;
8475
- } else if (length >= LARGE_ARRAY_SIZE) {
8476
- var set = createSet(array);
8477
- if (set) {
8478
- return setToArray(set);
8479
- }
8480
- isCommon = false;
8481
- includes = cacheHas;
8482
- seen = new SetCache;
8483
- } else {
8484
- seen = result;
8485
- }
8486
- outer:
8487
- while (++index < length) {
8488
- var value = array[index], computed = value;
8489
- value = comparator || value !== 0 ? value : 0;
8490
- if (isCommon && computed === computed) {
8491
- var seenIndex = seen.length;
8492
- while (seenIndex--) {
8493
- if (seen[seenIndex] === computed) {
8494
- continue outer;
8495
- }
8496
- }
8497
- result.push(value);
8498
- } else if (!includes(seen, computed, comparator)) {
8499
- if (seen !== result) {
8500
- seen.push(computed);
8501
- }
8502
- result.push(value);
8503
- }
8504
- }
8505
- return result;
8506
- }
8507
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
8508
- return new Set2(values);
8509
- };
8510
- function getMapData(map, key) {
8511
- var data = map.__data__;
8512
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
8513
- }
8514
- function getNative(object, key) {
8515
- var value = getValue(object, key);
8516
- return baseIsNative(value) ? value : undefined;
8517
- }
8518
- function isKeyable(value) {
8519
- var type = typeof value;
8520
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
8521
- }
8522
- function isMasked(func) {
8523
- return !!maskSrcKey && maskSrcKey in func;
8524
- }
8525
- function toSource(func) {
8526
- if (func != null) {
8527
- try {
8528
- return funcToString.call(func);
8529
- } catch (e) {}
8530
- try {
8531
- return func + "";
8532
- } catch (e) {}
8533
- }
8534
- return "";
8535
- }
8536
- function uniqWith(array, comparator) {
8537
- return array && array.length ? baseUniq(array, undefined, comparator) : [];
8538
- }
8539
- function eq(value, other) {
8540
- return value === other || value !== value && other !== other;
8541
- }
8542
- function isFunction(value) {
8543
- var tag = isObject(value) ? objectToString.call(value) : "";
8544
- return tag == funcTag || tag == genTag;
8545
- }
8546
- function isObject(value) {
8547
- var type = typeof value;
8548
- return !!value && (type == "object" || type == "function");
8549
- }
8550
- function noop() {}
8551
- lodash_uniqwith = uniqWith;
8552
- return lodash_uniqwith;
8553
- }
8554
- function requireLodash_sortby() {
8555
- if (hasRequiredLodash_sortby)
8556
- return lodash_sortby.exports;
8557
- hasRequiredLodash_sortby = 1;
8558
- (function(module, exports$1) {
8559
- var LARGE_ARRAY_SIZE = 200;
8560
- var FUNC_ERROR_TEXT = "Expected a function";
8561
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
8562
- var UNORDERED_COMPARE_FLAG = 1, PARTIAL_COMPARE_FLAG = 2;
8563
- var MAX_SAFE_INTEGER = 9007199254740991;
8564
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
8565
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
8566
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8567
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
8568
- var reEscapeChar = /\\(\\)?/g;
8569
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
8570
- var reIsUint = /^(?:0|[1-9]\d*)$/;
8571
- var typedArrayTags = {};
8572
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
8573
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
8574
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
8575
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
8576
- var root = freeGlobal || freeSelf || Function("return this")();
8577
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
8578
- var freeModule = freeExports && true && module && !module.nodeType && module;
8579
- var moduleExports = freeModule && freeModule.exports === freeExports;
8580
- var freeProcess = moduleExports && freeGlobal.process;
8581
- var nodeUtil = function() {
8582
- try {
8583
- return freeProcess && freeProcess.binding("util");
8584
- } catch (e) {}
8585
- }();
8586
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
8587
- function apply(func, thisArg, args) {
8588
- switch (args.length) {
8589
- case 0:
8590
- return func.call(thisArg);
8591
- case 1:
8592
- return func.call(thisArg, args[0]);
8593
- case 2:
8594
- return func.call(thisArg, args[0], args[1]);
8595
- case 3:
8596
- return func.call(thisArg, args[0], args[1], args[2]);
8597
- }
8598
- return func.apply(thisArg, args);
8599
- }
8600
- function arrayMap(array, iteratee) {
8601
- var index = -1, length = array ? array.length : 0, result = Array(length);
8602
- while (++index < length) {
8603
- result[index] = iteratee(array[index], index, array);
8604
- }
8605
- return result;
8606
- }
8607
- function arrayPush(array, values) {
8608
- var index = -1, length = values.length, offset = array.length;
8609
- while (++index < length) {
8610
- array[offset + index] = values[index];
8611
- }
8612
- return array;
8613
- }
8614
- function arraySome(array, predicate) {
8615
- var index = -1, length = array ? array.length : 0;
8616
- while (++index < length) {
8617
- if (predicate(array[index], index, array)) {
8618
- return true;
8619
- }
8620
- }
8621
- return false;
8622
- }
8623
- function baseProperty(key) {
8624
- return function(object) {
8625
- return object == null ? undefined : object[key];
8626
- };
8627
- }
8628
- function baseSortBy(array, comparer) {
8629
- var length = array.length;
8630
- array.sort(comparer);
8631
- while (length--) {
8632
- array[length] = array[length].value;
8633
- }
8634
- return array;
8635
- }
8636
- function baseTimes(n, iteratee) {
8637
- var index = -1, result = Array(n);
8638
- while (++index < n) {
8639
- result[index] = iteratee(index);
8640
- }
8641
- return result;
8642
- }
8643
- function baseUnary(func) {
8644
- return function(value) {
8645
- return func(value);
8646
- };
8647
- }
8648
- function getValue(object, key) {
8649
- return object == null ? undefined : object[key];
8650
- }
8651
- function isHostObject(value) {
8652
- var result = false;
8653
- if (value != null && typeof value.toString != "function") {
8654
- try {
8655
- result = !!(value + "");
8656
- } catch (e) {}
8657
- }
8658
- return result;
8659
- }
8660
- function mapToArray(map) {
8661
- var index = -1, result = Array(map.size);
8662
- map.forEach(function(value, key) {
8663
- result[++index] = [key, value];
8664
- });
8665
- return result;
8666
- }
8667
- function overArg(func, transform) {
8668
- return function(arg) {
8669
- return func(transform(arg));
8670
- };
8671
- }
8672
- function setToArray(set) {
8673
- var index = -1, result = Array(set.size);
8674
- set.forEach(function(value) {
8675
- result[++index] = value;
8676
- });
8677
- return result;
8678
- }
8679
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
8680
- var coreJsData = root["__core-js_shared__"];
8681
- var maskSrcKey = function() {
8682
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
8683
- return uid ? "Symbol(src)_1." + uid : "";
8684
- }();
8685
- var funcToString = funcProto.toString;
8686
- var hasOwnProperty = objectProto.hasOwnProperty;
8687
- var objectToString = objectProto.toString;
8688
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
8689
- var { Symbol: Symbol2, Uint8Array: Uint8Array2 } = root, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined;
8690
- var nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max;
8691
- var DataView = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
8692
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
8693
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
8694
- function Hash(entries) {
8695
- var index = -1, length = entries ? entries.length : 0;
8696
- this.clear();
8697
- while (++index < length) {
8698
- var entry = entries[index];
8699
- this.set(entry[0], entry[1]);
8700
- }
8701
- }
8702
- function hashClear() {
8703
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
8704
- }
8705
- function hashDelete(key) {
8706
- return this.has(key) && delete this.__data__[key];
8707
- }
8708
- function hashGet(key) {
8709
- var data = this.__data__;
8710
- if (nativeCreate) {
8711
- var result = data[key];
8712
- return result === HASH_UNDEFINED ? undefined : result;
8713
- }
8714
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
8715
- }
8716
- function hashHas(key) {
8717
- var data = this.__data__;
8718
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
8719
- }
8720
- function hashSet(key, value) {
8721
- var data = this.__data__;
8722
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
8723
- return this;
8724
- }
8725
- Hash.prototype.clear = hashClear;
8726
- Hash.prototype["delete"] = hashDelete;
8727
- Hash.prototype.get = hashGet;
8728
- Hash.prototype.has = hashHas;
8729
- Hash.prototype.set = hashSet;
8730
- function ListCache(entries) {
8731
- var index = -1, length = entries ? entries.length : 0;
8732
- this.clear();
8733
- while (++index < length) {
8734
- var entry = entries[index];
8735
- this.set(entry[0], entry[1]);
8736
- }
8737
- }
8738
- function listCacheClear() {
8739
- this.__data__ = [];
8740
- }
8741
- function listCacheDelete(key) {
8742
- var data = this.__data__, index = assocIndexOf(data, key);
8743
- if (index < 0) {
8744
- return false;
8745
- }
8746
- var lastIndex = data.length - 1;
8747
- if (index == lastIndex) {
8748
- data.pop();
8749
- } else {
8750
- splice.call(data, index, 1);
8751
- }
8752
- return true;
8753
- }
8754
- function listCacheGet(key) {
8755
- var data = this.__data__, index = assocIndexOf(data, key);
8756
- return index < 0 ? undefined : data[index][1];
8757
- }
8758
- function listCacheHas(key) {
8759
- return assocIndexOf(this.__data__, key) > -1;
8760
- }
8761
- function listCacheSet(key, value) {
8762
- var data = this.__data__, index = assocIndexOf(data, key);
8763
- if (index < 0) {
8764
- data.push([key, value]);
8765
- } else {
8766
- data[index][1] = value;
8767
- }
8768
- return this;
8769
- }
8770
- ListCache.prototype.clear = listCacheClear;
8771
- ListCache.prototype["delete"] = listCacheDelete;
8772
- ListCache.prototype.get = listCacheGet;
8773
- ListCache.prototype.has = listCacheHas;
8774
- ListCache.prototype.set = listCacheSet;
8775
- function MapCache(entries) {
8776
- var index = -1, length = entries ? entries.length : 0;
8777
- this.clear();
8778
- while (++index < length) {
8779
- var entry = entries[index];
8780
- this.set(entry[0], entry[1]);
8781
- }
8782
- }
8783
- function mapCacheClear() {
8784
- this.__data__ = {
8785
- hash: new Hash,
8786
- map: new (Map2 || ListCache),
8787
- string: new Hash
8788
- };
8789
- }
8790
- function mapCacheDelete(key) {
8791
- return getMapData(this, key)["delete"](key);
8792
- }
8793
- function mapCacheGet(key) {
8794
- return getMapData(this, key).get(key);
8795
- }
8796
- function mapCacheHas(key) {
8797
- return getMapData(this, key).has(key);
8798
- }
8799
- function mapCacheSet(key, value) {
8800
- getMapData(this, key).set(key, value);
8801
- return this;
8802
- }
8803
- MapCache.prototype.clear = mapCacheClear;
8804
- MapCache.prototype["delete"] = mapCacheDelete;
8805
- MapCache.prototype.get = mapCacheGet;
8806
- MapCache.prototype.has = mapCacheHas;
8807
- MapCache.prototype.set = mapCacheSet;
8808
- function SetCache(values) {
8809
- var index = -1, length = values ? values.length : 0;
8810
- this.__data__ = new MapCache;
8811
- while (++index < length) {
8812
- this.add(values[index]);
8813
- }
8814
- }
8815
- function setCacheAdd(value) {
8816
- this.__data__.set(value, HASH_UNDEFINED);
8817
- return this;
8818
- }
8819
- function setCacheHas(value) {
8820
- return this.__data__.has(value);
8821
- }
8822
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
8823
- SetCache.prototype.has = setCacheHas;
8824
- function Stack(entries) {
8825
- this.__data__ = new ListCache(entries);
8826
- }
8827
- function stackClear() {
8828
- this.__data__ = new ListCache;
8829
- }
8830
- function stackDelete(key) {
8831
- return this.__data__["delete"](key);
8832
- }
8833
- function stackGet(key) {
8834
- return this.__data__.get(key);
8835
- }
8836
- function stackHas(key) {
8837
- return this.__data__.has(key);
8838
- }
8839
- function stackSet(key, value) {
8840
- var cache = this.__data__;
8841
- if (cache instanceof ListCache) {
8842
- var pairs = cache.__data__;
8843
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
8844
- pairs.push([key, value]);
8845
- return this;
8846
- }
8847
- cache = this.__data__ = new MapCache(pairs);
8848
- }
8849
- cache.set(key, value);
8850
- return this;
8851
- }
8852
- Stack.prototype.clear = stackClear;
8853
- Stack.prototype["delete"] = stackDelete;
8854
- Stack.prototype.get = stackGet;
8855
- Stack.prototype.has = stackHas;
8856
- Stack.prototype.set = stackSet;
8857
- function arrayLikeKeys(value, inherited) {
8858
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
8859
- var length = result.length, skipIndexes = !!length;
8860
- for (var key in value) {
8861
- if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
8862
- result.push(key);
8863
- }
8864
- }
8865
- return result;
8866
- }
8867
- function assocIndexOf(array, key) {
8868
- var length = array.length;
8869
- while (length--) {
8870
- if (eq(array[length][0], key)) {
8871
- return length;
8872
- }
8873
- }
8874
- return -1;
8875
- }
8876
- var baseEach = createBaseEach(baseForOwn);
8877
- function baseFlatten(array, depth, predicate, isStrict, result) {
8878
- var index = -1, length = array.length;
8879
- predicate || (predicate = isFlattenable);
8880
- result || (result = []);
8881
- while (++index < length) {
8882
- var value = array[index];
8883
- if (predicate(value)) {
8884
- {
8885
- arrayPush(result, value);
8886
- }
8887
- } else {
8888
- result[result.length] = value;
8889
- }
8890
- }
8891
- return result;
8892
- }
8893
- var baseFor = createBaseFor();
8894
- function baseForOwn(object, iteratee) {
8895
- return object && baseFor(object, iteratee, keys);
8896
- }
8897
- function baseGet(object, path) {
8898
- path = isKey(path, object) ? [path] : castPath(path);
8899
- var index = 0, length = path.length;
8900
- while (object != null && index < length) {
8901
- object = object[toKey(path[index++])];
8902
- }
8903
- return index && index == length ? object : undefined;
8904
- }
8905
- function baseGetTag(value) {
8906
- return objectToString.call(value);
8907
- }
8908
- function baseHasIn(object, key) {
8909
- return object != null && key in Object(object);
8910
- }
8911
- function baseIsEqual(value, other, customizer, bitmask, stack) {
8912
- if (value === other) {
8913
- return true;
8914
- }
8915
- if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
8916
- return value !== value && other !== other;
8917
- }
8918
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
8919
- }
8920
- function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
8921
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag;
8922
- if (!objIsArr) {
8923
- objTag = getTag(object);
8924
- objTag = objTag == argsTag ? objectTag : objTag;
8925
- }
8926
- if (!othIsArr) {
8927
- othTag = getTag(other);
8928
- othTag = othTag == argsTag ? objectTag : othTag;
8929
- }
8930
- var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
8931
- if (isSameTag && !objIsObj) {
8932
- stack || (stack = new Stack);
8933
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
8934
- }
8935
- if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
8936
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
8937
- if (objIsWrapped || othIsWrapped) {
8938
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
8939
- stack || (stack = new Stack);
8940
- return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
8941
- }
8942
- }
8943
- if (!isSameTag) {
8944
- return false;
8945
- }
8946
- stack || (stack = new Stack);
8947
- return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
8948
- }
8949
- function baseIsMatch(object, source, matchData, customizer) {
8950
- var index = matchData.length, length = index;
8951
- if (object == null) {
8952
- return !length;
8953
- }
8954
- object = Object(object);
8955
- while (index--) {
8956
- var data = matchData[index];
8957
- if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
8958
- return false;
8959
- }
8960
- }
8961
- while (++index < length) {
8962
- data = matchData[index];
8963
- var key = data[0], objValue = object[key], srcValue = data[1];
8964
- if (data[2]) {
8965
- if (objValue === undefined && !(key in object)) {
8966
- return false;
8967
- }
8968
- } else {
8969
- var stack = new Stack;
8970
- var result;
8971
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
8972
- return false;
8973
- }
8974
- }
8975
- }
8976
- return true;
8977
- }
8978
- function baseIsNative(value) {
8979
- if (!isObject(value) || isMasked(value)) {
8980
- return false;
8981
- }
8982
- var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
8983
- return pattern.test(toSource(value));
8984
- }
8985
- function baseIsTypedArray(value) {
8986
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
8987
- }
8988
- function baseIteratee(value) {
8989
- if (typeof value == "function") {
8990
- return value;
8991
- }
8992
- if (value == null) {
8993
- return identity2;
8994
- }
8995
- if (typeof value == "object") {
8996
- return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
8997
- }
8998
- return property(value);
8999
- }
9000
- function baseKeys(object) {
9001
- if (!isPrototype(object)) {
9002
- return nativeKeys(object);
9003
- }
9004
- var result = [];
9005
- for (var key in Object(object)) {
9006
- if (hasOwnProperty.call(object, key) && key != "constructor") {
9007
- result.push(key);
9008
- }
9009
- }
9010
- return result;
9011
- }
9012
- function baseMap(collection, iteratee) {
9013
- var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
9014
- baseEach(collection, function(value, key, collection2) {
9015
- result[++index] = iteratee(value, key, collection2);
9016
- });
9017
- return result;
9018
- }
9019
- function baseMatches(source) {
9020
- var matchData = getMatchData(source);
9021
- if (matchData.length == 1 && matchData[0][2]) {
9022
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
9023
- }
9024
- return function(object) {
9025
- return object === source || baseIsMatch(object, source, matchData);
9026
- };
9027
- }
9028
- function baseMatchesProperty(path, srcValue) {
9029
- if (isKey(path) && isStrictComparable(srcValue)) {
9030
- return matchesStrictComparable(toKey(path), srcValue);
9031
- }
9032
- return function(object) {
9033
- var objValue = get(object, path);
9034
- return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
9035
- };
9036
- }
9037
- function baseOrderBy(collection, iteratees, orders) {
9038
- var index = -1;
9039
- iteratees = arrayMap(iteratees.length ? iteratees : [identity2], baseUnary(baseIteratee));
9040
- var result = baseMap(collection, function(value, key, collection2) {
9041
- var criteria = arrayMap(iteratees, function(iteratee) {
9042
- return iteratee(value);
9043
- });
9044
- return { criteria, index: ++index, value };
9045
- });
9046
- return baseSortBy(result, function(object, other) {
9047
- return compareMultiple(object, other, orders);
9048
- });
9049
- }
9050
- function basePropertyDeep(path) {
9051
- return function(object) {
9052
- return baseGet(object, path);
9053
- };
9054
- }
9055
- function baseRest(func, start) {
9056
- start = nativeMax(start === undefined ? func.length - 1 : start, 0);
9057
- return function() {
9058
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
9059
- while (++index < length) {
9060
- array[index] = args[start + index];
9061
- }
9062
- index = -1;
9063
- var otherArgs = Array(start + 1);
9064
- while (++index < start) {
9065
- otherArgs[index] = args[index];
9066
- }
9067
- otherArgs[start] = array;
9068
- return apply(func, this, otherArgs);
9069
- };
9070
- }
9071
- function baseToString(value) {
9072
- if (typeof value == "string") {
9073
- return value;
9074
- }
9075
- if (isSymbol(value)) {
9076
- return symbolToString ? symbolToString.call(value) : "";
9077
- }
9078
- var result = value + "";
9079
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
9080
- }
9081
- function castPath(value) {
9082
- return isArray(value) ? value : stringToPath(value);
9083
- }
9084
- function compareAscending(value, other) {
9085
- if (value !== other) {
9086
- var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
9087
- var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
9088
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
9089
- return 1;
9090
- }
9091
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
9092
- return -1;
9093
- }
9094
- }
9095
- return 0;
9096
- }
9097
- function compareMultiple(object, other, orders) {
9098
- var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
9099
- while (++index < length) {
9100
- var result = compareAscending(objCriteria[index], othCriteria[index]);
9101
- if (result) {
9102
- if (index >= ordersLength) {
9103
- return result;
9104
- }
9105
- var order = orders[index];
9106
- return result * (order == "desc" ? -1 : 1);
9107
- }
9108
- }
9109
- return object.index - other.index;
9110
- }
9111
- function createBaseEach(eachFunc, fromRight) {
9112
- return function(collection, iteratee) {
9113
- if (collection == null) {
9114
- return collection;
9115
- }
9116
- if (!isArrayLike(collection)) {
9117
- return eachFunc(collection, iteratee);
9118
- }
9119
- var length = collection.length, index = -1, iterable = Object(collection);
9120
- while (++index < length) {
9121
- if (iteratee(iterable[index], index, iterable) === false) {
9122
- break;
9123
- }
9124
- }
9125
- return collection;
9126
- };
9127
- }
9128
- function createBaseFor(fromRight) {
9129
- return function(object, iteratee, keysFunc) {
9130
- var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
9131
- while (length--) {
9132
- var key = props[++index];
9133
- if (iteratee(iterable[key], key, iterable) === false) {
9134
- break;
9135
- }
9136
- }
9137
- return object;
9138
- };
9139
- }
9140
- function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
9141
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length;
9142
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
9143
- return false;
9144
- }
9145
- var stacked = stack.get(array);
9146
- if (stacked && stack.get(other)) {
9147
- return stacked == other;
9148
- }
9149
- var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache : undefined;
9150
- stack.set(array, other);
9151
- stack.set(other, array);
9152
- while (++index < arrLength) {
9153
- var arrValue = array[index], othValue = other[index];
9154
- if (customizer) {
9155
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
9156
- }
9157
- if (compared !== undefined) {
9158
- if (compared) {
9159
- continue;
9160
- }
9161
- result = false;
9162
- break;
9163
- }
9164
- if (seen) {
9165
- if (!arraySome(other, function(othValue2, othIndex) {
9166
- if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) {
9167
- return seen.add(othIndex);
9168
- }
9169
- })) {
9170
- result = false;
9171
- break;
9172
- }
9173
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
9174
- result = false;
9175
- break;
9176
- }
9177
- }
9178
- stack["delete"](array);
9179
- stack["delete"](other);
9180
- return result;
9181
- }
9182
- function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
9183
- switch (tag) {
9184
- case dataViewTag:
9185
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
9186
- return false;
9187
- }
9188
- object = object.buffer;
9189
- other = other.buffer;
9190
- case arrayBufferTag:
9191
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
9192
- return false;
9193
- }
9194
- return true;
9195
- case boolTag:
9196
- case dateTag:
9197
- case numberTag:
9198
- return eq(+object, +other);
9199
- case errorTag:
9200
- return object.name == other.name && object.message == other.message;
9201
- case regexpTag:
9202
- case stringTag:
9203
- return object == other + "";
9204
- case mapTag:
9205
- var convert = mapToArray;
9206
- case setTag:
9207
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
9208
- convert || (convert = setToArray);
9209
- if (object.size != other.size && !isPartial) {
9210
- return false;
9211
- }
9212
- var stacked = stack.get(object);
9213
- if (stacked) {
9214
- return stacked == other;
9215
- }
9216
- bitmask |= UNORDERED_COMPARE_FLAG;
9217
- stack.set(object, other);
9218
- var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
9219
- stack["delete"](object);
9220
- return result;
9221
- case symbolTag:
9222
- if (symbolValueOf) {
9223
- return symbolValueOf.call(object) == symbolValueOf.call(other);
9224
- }
9225
- }
9226
- return false;
9227
- }
9228
- function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
9229
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
9230
- if (objLength != othLength && !isPartial) {
9231
- return false;
9232
- }
9233
- var index = objLength;
9234
- while (index--) {
9235
- var key = objProps[index];
9236
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
9237
- return false;
9238
- }
9239
- }
9240
- var stacked = stack.get(object);
9241
- if (stacked && stack.get(other)) {
9242
- return stacked == other;
9243
- }
9244
- var result = true;
9245
- stack.set(object, other);
9246
- stack.set(other, object);
9247
- var skipCtor = isPartial;
9248
- while (++index < objLength) {
9249
- key = objProps[index];
9250
- var objValue = object[key], othValue = other[key];
9251
- if (customizer) {
9252
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
9253
- }
9254
- if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
9255
- result = false;
9256
- break;
9257
- }
9258
- skipCtor || (skipCtor = key == "constructor");
9259
- }
9260
- if (result && !skipCtor) {
9261
- var objCtor = object.constructor, othCtor = other.constructor;
9262
- if (objCtor != othCtor && (("constructor" in object) && ("constructor" in other)) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
9263
- result = false;
9264
- }
9265
- }
9266
- stack["delete"](object);
9267
- stack["delete"](other);
9268
- return result;
9269
- }
9270
- function getMapData(map, key) {
9271
- var data = map.__data__;
9272
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
9273
- }
9274
- function getMatchData(object) {
9275
- var result = keys(object), length = result.length;
9276
- while (length--) {
9277
- var key = result[length], value = object[key];
9278
- result[length] = [key, value, isStrictComparable(value)];
9279
- }
9280
- return result;
9281
- }
9282
- function getNative(object, key) {
9283
- var value = getValue(object, key);
9284
- return baseIsNative(value) ? value : undefined;
9285
- }
9286
- var getTag = baseGetTag;
9287
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2) != setTag || WeakMap2 && getTag(new WeakMap2) != weakMapTag) {
9288
- getTag = function(value) {
9289
- var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : undefined;
9290
- if (ctorString) {
9291
- switch (ctorString) {
9292
- case dataViewCtorString:
9293
- return dataViewTag;
9294
- case mapCtorString:
9295
- return mapTag;
9296
- case promiseCtorString:
9297
- return promiseTag;
9298
- case setCtorString:
9299
- return setTag;
9300
- case weakMapCtorString:
9301
- return weakMapTag;
9302
- }
9303
- }
9304
- return result;
9305
- };
9306
- }
9307
- function hasPath(object, path, hasFunc) {
9308
- path = isKey(path, object) ? [path] : castPath(path);
9309
- var result, index = -1, length = path.length;
9310
- while (++index < length) {
9311
- var key = toKey(path[index]);
9312
- if (!(result = object != null && hasFunc(object, key))) {
9313
- break;
9314
- }
9315
- object = object[key];
9316
- }
9317
- if (result) {
9318
- return result;
9319
- }
9320
- var length = object ? object.length : 0;
9321
- return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
9322
- }
9323
- function isFlattenable(value) {
9324
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
9325
- }
9326
- function isIndex(value, length) {
9327
- length = length == null ? MAX_SAFE_INTEGER : length;
9328
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
9329
- }
9330
- function isIterateeCall(value, index, object) {
9331
- if (!isObject(object)) {
9332
- return false;
9333
- }
9334
- var type = typeof index;
9335
- if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && (index in object)) {
9336
- return eq(object[index], value);
9337
- }
9338
- return false;
9339
- }
9340
- function isKey(value, object) {
9341
- if (isArray(value)) {
9342
- return false;
9343
- }
9344
- var type = typeof value;
9345
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
9346
- return true;
9347
- }
9348
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
9349
- }
9350
- function isKeyable(value) {
9351
- var type = typeof value;
9352
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
9353
- }
9354
- function isMasked(func) {
9355
- return !!maskSrcKey && maskSrcKey in func;
9356
- }
9357
- function isPrototype(value) {
9358
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
9359
- return value === proto;
9360
- }
9361
- function isStrictComparable(value) {
9362
- return value === value && !isObject(value);
9363
- }
9364
- function matchesStrictComparable(key, srcValue) {
9365
- return function(object) {
9366
- if (object == null) {
9367
- return false;
9368
- }
9369
- return object[key] === srcValue && (srcValue !== undefined || (key in Object(object)));
9370
- };
9371
- }
9372
- var stringToPath = memoize(function(string) {
9373
- string = toString(string);
9374
- var result = [];
9375
- if (reLeadingDot.test(string)) {
9376
- result.push("");
9377
- }
9378
- string.replace(rePropName, function(match, number, quote, string2) {
9379
- result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match);
9380
- });
9381
- return result;
9382
- });
9383
- function toKey(value) {
9384
- if (typeof value == "string" || isSymbol(value)) {
9385
- return value;
9386
- }
9387
- var result = value + "";
9388
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
9389
- }
9390
- function toSource(func) {
9391
- if (func != null) {
9392
- try {
9393
- return funcToString.call(func);
9394
- } catch (e) {}
9395
- try {
9396
- return func + "";
9397
- } catch (e) {}
9398
- }
9399
- return "";
9400
- }
9401
- var sortBy = baseRest(function(collection, iteratees) {
9402
- if (collection == null) {
9403
- return [];
9404
- }
9405
- var length = iteratees.length;
9406
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
9407
- iteratees = [];
9408
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9409
- iteratees = [iteratees[0]];
9410
- }
9411
- return baseOrderBy(collection, baseFlatten(iteratees), []);
9412
- });
9413
- function memoize(func, resolver) {
9414
- if (typeof func != "function" || resolver && typeof resolver != "function") {
9415
- throw new TypeError(FUNC_ERROR_TEXT);
9416
- }
9417
- var memoized = function() {
9418
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
9419
- if (cache.has(key)) {
9420
- return cache.get(key);
9421
- }
9422
- var result = func.apply(this, args);
9423
- memoized.cache = cache.set(key, result);
9424
- return result;
9425
- };
9426
- memoized.cache = new (memoize.Cache || MapCache);
9427
- return memoized;
9428
- }
9429
- memoize.Cache = MapCache;
9430
- function eq(value, other) {
9431
- return value === other || value !== value && other !== other;
9432
- }
9433
- function isArguments(value) {
9434
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
9435
- }
9436
- var isArray = Array.isArray;
9437
- function isArrayLike(value) {
9438
- return value != null && isLength(value.length) && !isFunction(value);
9439
- }
9440
- function isArrayLikeObject(value) {
9441
- return isObjectLike(value) && isArrayLike(value);
9442
- }
9443
- function isFunction(value) {
9444
- var tag = isObject(value) ? objectToString.call(value) : "";
9445
- return tag == funcTag || tag == genTag;
9446
- }
9447
- function isLength(value) {
9448
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
9449
- }
9450
- function isObject(value) {
9451
- var type = typeof value;
9452
- return !!value && (type == "object" || type == "function");
9453
- }
9454
- function isObjectLike(value) {
9455
- return !!value && typeof value == "object";
9456
- }
9457
- function isSymbol(value) {
9458
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
9459
- }
9460
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
9461
- function toString(value) {
9462
- return value == null ? "" : baseToString(value);
9463
- }
9464
- function get(object, path, defaultValue) {
9465
- var result = object == null ? undefined : baseGet(object, path);
9466
- return result === undefined ? defaultValue : result;
9467
- }
9468
- function hasIn(object, path) {
9469
- return object != null && hasPath(object, path, baseHasIn);
9470
- }
9471
- function keys(object) {
9472
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
9473
- }
9474
- function identity2(value) {
9475
- return value;
9476
- }
9477
- function property(path) {
9478
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
9479
- }
9480
- module.exports = sortBy;
9481
- })(lodash_sortby, lodash_sortby.exports);
9482
- return lodash_sortby.exports;
9483
- }
9484
- function requireEscapeStringRegexp() {
9485
- if (hasRequiredEscapeStringRegexp)
9486
- return escapeStringRegexp;
9487
- hasRequiredEscapeStringRegexp = 1;
9488
- escapeStringRegexp = (string) => {
9489
- if (typeof string !== "string") {
9490
- throw new TypeError("Expected a string");
9491
- }
9492
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
9493
- };
9494
- return escapeStringRegexp;
9495
- }
9496
- function requireRegexpParse() {
9497
- if (hasRequiredRegexpParse)
9498
- return regexpParse;
9499
- hasRequiredRegexpParse = 1;
9500
- Object.defineProperty(regexpParse, "__esModule", { value: true });
9501
- regexpParse.isRegExpString = regexpParse.parseRegExpString = undefined;
9502
- var REGEXP_LITERAL_PATTERN = /^\/(.+)\/([guimysd]*)$/;
9503
- var parseRegExpString = function(str) {
9504
- var result = str.match(REGEXP_LITERAL_PATTERN);
9505
- if (!result) {
9506
- return null;
9507
- }
9508
- return {
9509
- source: result[1],
9510
- flagString: result[2]
9511
- };
9512
- };
9513
- regexpParse.parseRegExpString = parseRegExpString;
9514
- var isRegExpString = function(str) {
9515
- return REGEXP_LITERAL_PATTERN.test(str);
9516
- };
9517
- regexpParse.isRegExpString = isRegExpString;
9518
- return regexpParse;
9519
- }
9520
- function requireRegexpStringMatcher() {
9521
- if (hasRequiredRegexpStringMatcher)
9522
- return regexpStringMatcher;
9523
- hasRequiredRegexpStringMatcher = 1;
9524
- (function(exports$1) {
9525
- var __importDefault = regexpStringMatcher && regexpStringMatcher.__importDefault || function(mod) {
9526
- return mod && mod.__esModule ? mod : { default: mod };
9527
- };
9528
- Object.defineProperty(exports$1, "__esModule", { value: true });
9529
- exports$1.matchPatterns = exports$1.createRegExp = undefined;
9530
- var lodash_uniq_1 = __importDefault(requireLodash_uniq());
9531
- var lodash_uniqwith_1 = __importDefault(requireLodash_uniqwith());
9532
- var lodash_sortby_1 = __importDefault(requireLodash_sortby());
9533
- var escape_string_regexp_1 = __importDefault(requireEscapeStringRegexp());
9534
- var regexp_parse_1 = requireRegexpParse();
9535
- var DEFAULT_FLAGS = "ug";
9536
- var defaultFlags = function(flagsString) {
9537
- if (flagsString.length === 0) {
9538
- return DEFAULT_FLAGS;
9539
- }
9540
- return (0, lodash_uniq_1.default)((flagsString + DEFAULT_FLAGS).split("")).join("");
9541
- };
9542
- var createRegExp = function(patternString, defaultFlag) {
9543
- if (defaultFlag === undefined) {
9544
- defaultFlag = DEFAULT_FLAGS;
9545
- }
9546
- if (patternString.length === 0) {
9547
- throw new Error("Empty string can not handled");
9548
- }
9549
- if ((0, regexp_parse_1.isRegExpString)(patternString)) {
9550
- var regExpStructure = (0, regexp_parse_1.parseRegExpString)(patternString);
9551
- if (regExpStructure) {
9552
- return new RegExp(regExpStructure.source, defaultFlags(regExpStructure.flagString));
9553
- }
9554
- throw new Error('"'.concat(patternString, '" can not parse as RegExp.'));
9555
- } else {
9556
- return new RegExp((0, escape_string_regexp_1.default)(patternString), defaultFlag);
9557
- }
9558
- };
9559
- exports$1.createRegExp = createRegExp;
9560
- var isEqualMatchPatternResult = function(a, b) {
9561
- return a.startIndex === b.startIndex && a.endIndex === b.endIndex && a.match === b.match;
9562
- };
9563
- var matchPatterns = function(text, regExpLikeStrings) {
9564
- var matchPatternResults = [];
9565
- regExpLikeStrings.map(function(patternString) {
9566
- return (0, exports$1.createRegExp)(patternString);
9567
- }).forEach(function(regExp) {
9568
- var results = text.matchAll(regExp);
9569
- Array.from(results).forEach(function(result) {
9570
- if (result.index === undefined) {
9571
- return;
9572
- }
9573
- var match = result[0];
9574
- var index = result.index;
9575
- matchPatternResults.push({
9576
- match,
9577
- captures: result.slice(1),
9578
- startIndex: index,
9579
- endIndex: index + match.length
9580
- });
9581
- });
9582
- });
9583
- var uniqResults = (0, lodash_uniqwith_1.default)(matchPatternResults, isEqualMatchPatternResult);
9584
- return (0, lodash_sortby_1.default)(uniqResults, ["startIndex", "endIndex"]);
9585
- };
9586
- exports$1.matchPatterns = matchPatterns;
9587
- })(regexpStringMatcher);
9588
- return regexpStringMatcher;
9589
- }
9590
- var commonjsGlobal, regexpStringMatcher, lodash_uniq, hasRequiredLodash_uniq, lodash_uniqwith, hasRequiredLodash_uniqwith, lodash_sortby, hasRequiredLodash_sortby, escapeStringRegexp, hasRequiredEscapeStringRegexp, regexpParse, hasRequiredRegexpParse, hasRequiredRegexpStringMatcher, regexpStringMatcherExports, OID_DATA, OID_SHA1, OID_SHA256, OID_SHA384, OID_SHA512, typeMap;
9591
- var init_module2 = __esm(() => {
9592
- commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
9593
- regexpStringMatcher = {};
9594
- lodash_sortby = { exports: {} };
9595
- lodash_sortby.exports;
9596
- regexpParse = {};
9597
- regexpStringMatcherExports = requireRegexpStringMatcher();
9598
- OID_DATA = new Uint8Array([42, 134, 72, 134, 247, 13, 1, 7, 1]);
9599
- OID_SHA1 = new Uint8Array([43, 14, 3, 2, 26]);
9600
- OID_SHA256 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 1]);
9601
- OID_SHA384 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 2]);
9602
- OID_SHA512 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 3]);
9603
- typeMap = new Map([
9604
- ["ghp", "GitHub personal access tokens"],
9605
- ["gho", "OAuth access tokens"],
9606
- ["ghu", "GitHub user-to-server tokens"],
9607
- ["ghs", "GitHub server-to-server tokens"],
9608
- ["ghr", "refresh tokens"],
9609
- ["github_pat", "fine-grained personal access tokens"]
9610
- ]);
9611
- });
9612
-
9613
- // telegram-plugin/secret-detect/secretlint-source.ts
9614
- var init_secretlint_source = __esm(() => {
9615
- init_module();
9616
- init_module2();
9617
- init_suppressor();
9618
- });
9619
-
9620
- // src/cli/skill-validate-pretool.ts
9621
- import { readFileSync, lstatSync, readdirSync } from "node:fs";
9622
- import { join } from "node:path";
9623
-
9624
- // node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
9625
- var composer = require_composer();
9626
- var Document = require_Document();
9627
- var Schema = require_Schema();
9628
- var errors = require_errors();
9629
- var Alias = require_Alias();
9630
- var identity = require_identity();
9631
- var Pair = require_Pair();
9632
- var Scalar = require_Scalar();
9633
- var YAMLMap = require_YAMLMap();
9634
- var YAMLSeq = require_YAMLSeq();
9635
- var cst = require_cst();
9636
- var lexer = require_lexer();
9637
- var lineCounter = require_line_counter();
9638
- var parser = require_parser();
9639
- var publicApi = require_public_api();
9640
- var visit = require_visit();
9641
- var $Composer = composer.Composer;
9642
- var $Document = Document.Document;
9643
- var $Schema = Schema.Schema;
9644
- var $YAMLError = errors.YAMLError;
9645
- var $YAMLParseError = errors.YAMLParseError;
9646
- var $YAMLWarning = errors.YAMLWarning;
9647
- var $Alias = Alias.Alias;
9648
- var $isAlias = identity.isAlias;
9649
- var $isCollection = identity.isCollection;
9650
- var $isDocument = identity.isDocument;
9651
- var $isMap = identity.isMap;
9652
- var $isNode = identity.isNode;
9653
- var $isPair = identity.isPair;
9654
- var $isScalar = identity.isScalar;
9655
- var $isSeq = identity.isSeq;
9656
- var $Pair = Pair.Pair;
9657
- var $Scalar = Scalar.Scalar;
9658
- var $YAMLMap = YAMLMap.YAMLMap;
9659
- var $YAMLSeq = YAMLSeq.YAMLSeq;
9660
- var $Lexer = lexer.Lexer;
9661
- var $LineCounter = lineCounter.LineCounter;
9662
- var $Parser = parser.Parser;
9663
- var $parse = publicApi.parse;
9664
- var $parseAllDocuments = publicApi.parseAllDocuments;
9665
- var $parseDocument = publicApi.parseDocument;
9666
- var $stringify = publicApi.stringify;
9667
- var $visit = visit.visit;
9668
- var $visitAsync = visit.visitAsync;
9669
-
9670
- // telegram-plugin/secret-detect/patterns.ts
9671
- var ANCHORED_PATTERNS = [
9672
- { rule_id: "anthropic_api_key", regex: /\b(sk-ant-[A-Za-z0-9_-]{8,})\b/g, captureIndex: 1, slugHint: "anthropic_api_key" },
9673
- { rule_id: "anthropic_oauth_code", regex: /(?:^|\s)([A-Za-z0-9_-]{20,}#[A-Za-z0-9_-]{20,})(?=\s|$)/gm, captureIndex: 1, slugHint: "anthropic_oauth_code" },
9674
- { rule_id: "openai_api_key", regex: /\b(sk-[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "openai_api_key" },
9675
- { rule_id: "github_pat_classic", regex: /\b(ghp_[A-Za-z0-9]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
9676
- { rule_id: "github_pat_fine_grained", regex: /\b(github_pat_[A-Za-z0-9_]{20,})\b/g, captureIndex: 1, slugHint: "github_pat" },
9677
- { rule_id: "slack_token", regex: /\b(xox[baprs]-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_token" },
9678
- { rule_id: "slack_app_token", regex: /\b(xapp-[A-Za-z0-9-]{10,})\b/g, captureIndex: 1, slugHint: "slack_app_token" },
9679
- { rule_id: "groq_api_key", regex: /\b(gsk_[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "groq_api_key" },
9680
- { rule_id: "google_api_key", regex: /\b(AIza[0-9A-Za-z\-_]{20,})\b/g, captureIndex: 1, slugHint: "google_api_key" },
9681
- { rule_id: "perplexity_api_key", regex: /\b(pplx-[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "perplexity_api_key" },
9682
- { rule_id: "npm_token", regex: /\b(npm_[A-Za-z0-9]{10,})\b/g, captureIndex: 1, slugHint: "npm_token" },
9683
- { rule_id: "telegram_bot_token_prefixed", regex: /\bbot(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
9684
- { rule_id: "telegram_bot_token", regex: /\b(\d{6,}:[A-Za-z0-9_-]{20,})\b/g, captureIndex: 1, slugHint: "telegram_bot_token" },
9685
- { rule_id: "laravel_sanctum_token", regex: /\b(\d+\|[A-Za-z0-9]{40,})\b/g, captureIndex: 1, slugHint: "api_token" },
9686
- { rule_id: "aws_access_key", regex: /\b(AKIA[0-9A-Z]{16})\b/g, captureIndex: 1, slugHint: "aws_access_key" },
9687
- { rule_id: "jwt", regex: /\b(eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,})\b/g, captureIndex: 1, slugHint: "jwt" }
9688
- ];
9689
- var STRUCTURED_PATTERNS = [
9690
- {
9691
- rule_id: "env_key_value",
9692
- regex: /\b([A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD))\b\s*[=:]\s*(["']?)([^\s"'\\]+)\2/g,
9693
- captureIndex: 3,
9694
- slugHint: "env"
9695
- },
9696
- {
9697
- rule_id: "json_secret_field",
9698
- regex: /"(?:apiKey|token|secret|password|passwd|accessToken|refreshToken)"\s*:\s*"([^"]+)"/g,
9699
- captureIndex: 1,
9700
- slugHint: "json_secret"
9701
- },
9702
- {
9703
- rule_id: "cli_flag",
9704
- regex: /--(?:api[-_]?key|hook[-_]?token|token|secret|password|passwd)\s+(["']?)([^\s"']+)\1/g,
9705
- captureIndex: 2,
9706
- slugHint: "cli_flag"
9707
- },
9708
- {
9709
- rule_id: "bearer_auth_header",
9710
- regex: /Authorization\s*[:=]\s*Bearer\s+([A-Za-z0-9._\-+=]+)/g,
9711
- captureIndex: 1,
9712
- slugHint: "bearer_token"
9713
- },
9714
- {
9715
- rule_id: "bearer_loose",
9716
- regex: /\bBearer\s+([A-Za-z0-9._\-+=]{18,})\b/g,
9717
- captureIndex: 1,
9718
- slugHint: "bearer_token"
9719
- },
9720
- {
9721
- rule_id: "pem_private_key",
9722
- regex: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]+?-----END [A-Z ]*PRIVATE KEY-----/g,
9723
- captureIndex: 0,
9724
- slugHint: "pem_private_key"
9725
- }
9726
- ];
9727
- var PROVIDER_PATTERNS = [
9728
- { rule_id: "slack_webhook", regex: /(https:\/\/hooks\.slack\.com\/services\/[A-Za-z0-9_/]+)/g, captureIndex: 1, slugHint: "slack_webhook" },
9729
- { rule_id: "stripe_live_secret", regex: /\b(sk_live_[A-Za-z0-9]{24,})\b/g, captureIndex: 1, slugHint: "stripe_key" },
9730
- { rule_id: "stripe_restricted", regex: /\b(rk_live_[A-Za-z0-9]{24,})\b/g, captureIndex: 1, slugHint: "stripe_key" },
9731
- { rule_id: "sendgrid_api_key", regex: /\b(SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43})\b/g, captureIndex: 1, slugHint: "sendgrid_key" },
9732
- { rule_id: "gitlab_pat", regex: /\b(glpat-[A-Za-z0-9_-]{20})\b/g, captureIndex: 1, slugHint: "gitlab_pat" },
9733
- { rule_id: "huggingface_token", regex: /\b(hf_[A-Za-z0-9]{34,})\b/g, captureIndex: 1, slugHint: "huggingface_token" },
9734
- { rule_id: "twilio_api_key", regex: /\b(SK[0-9a-f]{32})\b/g, captureIndex: 1, slugHint: "twilio_api_key" },
9735
- { rule_id: "mailgun_key", regex: /\b(key-[0-9a-f]{32})\b/g, captureIndex: 1, slugHint: "mailgun_key" },
9736
- { rule_id: "digitalocean_pat", regex: /\b(dop_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
9737
- { rule_id: "digitalocean_oauth", regex: /\b(doo_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
9738
- { rule_id: "digitalocean_refresh", regex: /\b(dor_v1_[a-f0-9]{64})\b/g, captureIndex: 1, slugHint: "digitalocean_token" },
9739
- { rule_id: "doppler_token", regex: /\b(dp\.(?:pt|st|ct|sa|scim|audit)\.[A-Za-z0-9]{40,44})\b/g, captureIndex: 1, slugHint: "doppler_token" },
9740
- { rule_id: "linear_api_key", regex: /\b(lin_api_[A-Za-z0-9]{40})\b/g, captureIndex: 1, slugHint: "linear_api_key" },
9741
- { rule_id: "shopify_access_token", regex: /\b(shpat_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
9742
- { rule_id: "shopify_shared_secret", regex: /\b(shpss_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
9743
- { rule_id: "shopify_private_app", regex: /\b(shppa_[a-fA-F0-9]{32})\b/g, captureIndex: 1, slugHint: "shopify_token" },
9744
- { rule_id: "square_access_token", regex: /\b(sq0atp-[A-Za-z0-9_-]{22})\b/g, captureIndex: 1, slugHint: "square_token" },
9745
- { rule_id: "square_oauth_secret", regex: /\b(sq0csp-[A-Za-z0-9_-]{43})\b/g, captureIndex: 1, slugHint: "square_token" },
9746
- { rule_id: "newrelic_key", regex: /\b(NRAK-[A-Z0-9]{27})\b/g, captureIndex: 1, slugHint: "newrelic_key" },
9747
- { rule_id: "notion_token", regex: /\b(ntn_[A-Za-z0-9]{46})\b/g, captureIndex: 1, slugHint: "notion_token" },
9748
- { rule_id: "planetscale_password", regex: /\b(pscale_pw_[A-Za-z0-9_.-]{43})\b/g, captureIndex: 1, slugHint: "planetscale_token" },
9749
- { rule_id: "planetscale_token", regex: /\b(pscale_tkn_[A-Za-z0-9_.-]{43})\b/g, captureIndex: 1, slugHint: "planetscale_token" },
9750
- { rule_id: "supabase_service_key", regex: /\b(sbp_[a-f0-9]{40})\b/g, captureIndex: 1, slugHint: "supabase_key" },
9751
- { rule_id: "atlassian_token", regex: /\b(ATATT[A-Za-z0-9_\-=]{20,})\b/g, captureIndex: 1, slugHint: "atlassian_token" },
9752
- { rule_id: "dropbox_token", regex: /\b(sl\.[A-Za-z0-9_-]{130,})/g, captureIndex: 1, slugHint: "dropbox_token" },
9753
- { rule_id: "databricks_token", regex: /\b(dapi[a-f0-9]{32})\b/g, captureIndex: 1, slugHint: "databricks_token" },
9754
- { rule_id: "grafana_service_account", regex: /\b(glsa_[A-Za-z0-9]{32}_[a-fA-F0-9]{8})\b/g, captureIndex: 1, slugHint: "grafana_token" },
9755
- { rule_id: "pypi_token", regex: /\b(pypi-AgEIcHlwaS[A-Za-z0-9_-]{50,})/g, captureIndex: 1, slugHint: "pypi_token" },
9756
- { rule_id: "aws_temp_access_key", regex: /\b(ASIA[0-9A-Z]{16})\b/g, captureIndex: 1, slugHint: "aws_access_key" },
9757
- { rule_id: "gcp_oauth_token", regex: /\b(ya29\.[A-Za-z0-9_-]{30,})/g, captureIndex: 1, slugHint: "gcp_oauth_token" }
9758
- ];
9759
- var ALL_PATTERNS = [...ANCHORED_PATTERNS, ...PROVIDER_PATTERNS, ...STRUCTURED_PATTERNS];
9760
-
9761
- // telegram-plugin/secret-detect/chunker.ts
9762
- var CHUNK_THRESHOLD = 32 * 1024;
9763
- var WINDOW_SIZE = 16 * 1024;
9764
-
9765
- // telegram-plugin/secret-detect/index.ts
9766
- init_suppressor();
7061
+ // telegram-plugin/secret-detect/chunker.ts
7062
+ var CHUNK_THRESHOLD = 32 * 1024;
7063
+ var WINDOW_SIZE = 16 * 1024;
7064
+ var OVERLAP = 8 * 1024;
9767
7065
 
7066
+ // telegram-plugin/secret-detect/suppressor.ts
7067
+ var MARKERS = ["test", "mock", "example", "fixture", "dummy"];
7068
+ var MARKER_RE = new RegExp(`\\b(?:${MARKERS.join("|")})\\b`, "i");
9768
7069
  // telegram-plugin/secret-detect/url-redact.ts
9769
7070
  var SENSITIVE_PARAMS = new Set([
9770
7071
  "token",
@@ -9780,10 +7081,6 @@ var SENSITIVE_PARAMS = new Set([
9780
7081
  "refresh_token",
9781
7082
  "signature"
9782
7083
  ]);
9783
-
9784
- // telegram-plugin/secret-detect/index.ts
9785
- init_secretlint_source();
9786
-
9787
7084
  // src/cli/skill-common.ts
9788
7085
  var MAX_FILE_BYTES = 256 * 1024;
9789
7086
  var MAX_SKILL_BYTES = 2 * 1024 * 1024;