@sourcegraph/code-host-integration 0.0.92 → 0.0.93

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.
@@ -38942,9 +38942,9 @@ var require_graphql = __commonJS({
38942
38942
  }
38943
38943
  });
38944
38944
 
38945
- // ../../node_modules/.pnpm/ts-key-enum@2.0.8/node_modules/ts-key-enum/dist/js/Key.enum.js
38945
+ // ../../node_modules/.pnpm/ts-key-enum@2.0.12/node_modules/ts-key-enum/dist/js/Key.enum.js
38946
38946
  var require_Key_enum = __commonJS({
38947
- "../../node_modules/.pnpm/ts-key-enum@2.0.8/node_modules/ts-key-enum/dist/js/Key.enum.js"(exports) {
38947
+ "../../node_modules/.pnpm/ts-key-enum@2.0.12/node_modules/ts-key-enum/dist/js/Key.enum.js"(exports) {
38948
38948
  "use strict";
38949
38949
  Object.defineProperty(exports, "__esModule", { value: true });
38950
38950
  var Key3;
@@ -44703,7 +44703,7 @@ if (false) {
44703
44703
  throw new Error("No Link component set. You must call setLinkComponent to set the Link component to use.");
44704
44704
  });
44705
44705
  }
44706
- if (typeof globalThis.process !== "undefined" && process.env.JEST_WORKER_ID !== void 0) {
44706
+ if (globalThis.process !== void 0 && process.env.JEST_WORKER_ID !== void 0) {
44707
44707
  setLinkComponent(AnchorLink);
44708
44708
  }
44709
44709
  function setLinkComponent(component) {
@@ -46807,12 +46807,15 @@ var getAlignmentStyle = ({ alignment }) => (0, import_classnames8.default)(Typog
46807
46807
  var getFontWeightStyle = ({ weight }) => (0, import_classnames8.default)(Typography_module_default[`fontWeight${(0, import_lodash5.upperFirst)(weight)}`]);
46808
46808
  var getModeStyle = ({ mode }) => {
46809
46809
  switch (mode) {
46810
- case "single-line":
46810
+ case "single-line": {
46811
46811
  return Typography_module_default.singleLine;
46812
- case "break-word":
46812
+ }
46813
+ case "break-word": {
46813
46814
  return Typography_module_default.breakWord;
46814
- default:
46815
+ }
46816
+ default: {
46815
46817
  return "";
46818
+ }
46816
46819
  }
46817
46820
  };
46818
46821
 
@@ -46874,6 +46877,7 @@ var Alert = import_react23.default.forwardRef(function Alert2({ children, withIc
46874
46877
 
46875
46878
  // ../common/src/types/utils.ts
46876
46879
  var isDefined2 = (value) => value !== void 0 && value !== null;
46880
+ var defined = (values) => values.filter(isDefined2);
46877
46881
 
46878
46882
  // ../common/src/errors/utils.ts
46879
46883
  function tryCatch(function_) {
@@ -51614,7 +51618,7 @@ function memoizeObservable(func, resolver) {
51614
51618
 
51615
51619
  // ../common/src/util/strings.ts
51616
51620
  function sanitizeClass(value) {
51617
- return value.replace(/[^A-Za-z]/g, "-").toLowerCase();
51621
+ return value.replaceAll(/[^A-Za-z]/g, "-").toLowerCase();
51618
51622
  }
51619
51623
 
51620
51624
  // ../common/src/util/types.ts
@@ -51682,9 +51686,9 @@ function escapeRevspecForURL(revision) {
51682
51686
  function toViewStateHash(viewState) {
51683
51687
  return viewState ? `#tab=${viewState}` : "";
51684
51688
  }
51685
- var encodeURIPathComponent = (component) => component.split("/").map(encodeURIComponent).join("/").replace(/%2B/g, "+");
51689
+ var encodeURIPathComponent = (component) => component.split("/").map(encodeURIComponent).join("/").replaceAll("%2B", "+");
51686
51690
  var isExternalLink = (url) => !!tryCatch(() => new URL(url, window.location.href).origin !== window.location.origin);
51687
- var formatSearchParameters = (searchParameters) => searchParameters.toString().replace(/%2F/g, "/").replace(/%3A/g, ":").replace(/=&/g, "&").replace(/=$/, "");
51691
+ var formatSearchParameters = (searchParameters) => searchParameters.toString().replaceAll("%2F", "/").replaceAll("%3A", ":").replaceAll("=&", "&").replace(/=$/, "");
51688
51692
  var addLineRangeQueryParameter = (searchParameters, range) => {
51689
51693
  const existingLineRangeKey = findLineKeyInSearchParameters(searchParameters);
51690
51694
  if (existingLineRangeKey) {
@@ -54784,7 +54788,7 @@ function validateOperation(operation) {
54784
54788
  // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/link/utils/createOperation.js
54785
54789
  function createOperation(starting, operation) {
54786
54790
  var context2 = __assign({}, starting);
54787
- var setContext2 = function(next) {
54791
+ var setContext3 = function(next) {
54788
54792
  if (typeof next === "function") {
54789
54793
  context2 = __assign(__assign({}, context2), next(context2));
54790
54794
  } else {
@@ -54796,7 +54800,7 @@ function createOperation(starting, operation) {
54796
54800
  };
54797
54801
  Object.defineProperty(operation, "setContext", {
54798
54802
  enumerable: false,
54799
- value: setContext2
54803
+ value: setContext3
54800
54804
  });
54801
54805
  Object.defineProperty(operation, "getContext", {
54802
54806
  enumerable: false,
@@ -60824,6 +60828,33 @@ var ApolloClient = function() {
60824
60828
  // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/core/index.js
60825
60829
  setVerbosity(__DEV__ ? "log" : "silent");
60826
60830
 
60831
+ // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/link/context/index.js
60832
+ function setContext(setter) {
60833
+ return new ApolloLink(function(operation, forward) {
60834
+ var request = __rest(operation, []);
60835
+ return new Observable2(function(observer) {
60836
+ var handle;
60837
+ var closed = false;
60838
+ Promise.resolve(request).then(function(req) {
60839
+ return setter(req, operation.getContext());
60840
+ }).then(operation.setContext).then(function() {
60841
+ if (closed)
60842
+ return;
60843
+ handle = forward(operation).subscribe({
60844
+ next: observer.next.bind(observer),
60845
+ error: observer.error.bind(observer),
60846
+ complete: observer.complete.bind(observer)
60847
+ });
60848
+ }).catch(observer.error.bind(observer));
60849
+ return function() {
60850
+ closed = true;
60851
+ if (handle)
60852
+ handle.unsubscribe();
60853
+ };
60854
+ });
60855
+ });
60856
+ }
60857
+
60827
60858
  // ../http-client/src/graphql/apollo/client.ts
60828
60859
  var import_lodash8 = __toESM(require_lodash());
60829
60860
 
@@ -60919,7 +60950,7 @@ var ConcurrentRequestsLink = class extends ApolloLink {
60919
60950
 
60920
60951
  // ../http-client/src/graphql/apollo/client.ts
60921
60952
  var getGraphQLClient = (0, import_lodash8.once)(async (options2) => {
60922
- const { headers, baseUrl, credentials, cache: cache3 } = options2;
60953
+ const { getHeaders: getHeaders2, baseUrl, credentials, cache: cache3 } = options2;
60923
60954
  const uri = buildGraphQLUrl({ baseUrl });
60924
60955
  const apolloClient = new ApolloClient({
60925
60956
  uri,
@@ -60946,15 +60977,23 @@ var getGraphQLClient = (0, import_lodash8.once)(async (options2) => {
60946
60977
  fetchPolicy: "network-only"
60947
60978
  }
60948
60979
  },
60949
- link: from2([
60950
- new ConcurrentRequestsLink(),
60951
- createHttpLink({
60952
- uri: ({ operationName }) => `${uri}?${operationName}`,
60953
- headers,
60954
- credentials,
60955
- fetch: customFetch
60956
- })
60957
- ])
60980
+ link: from2(
60981
+ defined([
60982
+ new ConcurrentRequestsLink(),
60983
+ getHeaders2 ? setContext((_request, previousContext) => ({
60984
+ ...previousContext,
60985
+ headers: {
60986
+ ...previousContext.headers,
60987
+ ...getHeaders2()
60988
+ }
60989
+ })) : null,
60990
+ createHttpLink({
60991
+ uri: ({ operationName }) => `${uri}?${operationName}`,
60992
+ credentials,
60993
+ fetch: customFetch
60994
+ })
60995
+ ])
60996
+ )
60958
60997
  });
60959
60998
  return Promise.resolve(apolloClient);
60960
60999
  });
@@ -62216,11 +62255,11 @@ function parseLineOrPositionOrRange(lineChar) {
62216
62255
  }
62217
62256
  }
62218
62257
  let lpr = { line, character, endLine, endCharacter };
62219
- if (typeof line === "undefined" || typeof endLine !== "undefined" && typeof character !== typeof endCharacter) {
62258
+ if (line === void 0 || endLine !== void 0 && typeof character !== typeof endCharacter) {
62220
62259
  lpr = {};
62221
- } else if (typeof character === "undefined") {
62222
- lpr = typeof endLine === "undefined" ? { line } : { line, endLine };
62223
- } else if (typeof endLine === "undefined" || typeof endCharacter === "undefined") {
62260
+ } else if (character === void 0) {
62261
+ lpr = endLine === void 0 ? { line } : { line, endLine };
62262
+ } else if (endLine === void 0 || endCharacter === void 0) {
62224
62263
  lpr = { line, character };
62225
62264
  } else {
62226
62265
  lpr = { line, character, endLine, endCharacter };
@@ -62252,7 +62291,7 @@ function parseLineOrPosition(string) {
62252
62291
  }
62253
62292
  line = typeof line === "number" && isNaN(line) ? void 0 : line;
62254
62293
  character = typeof character === "number" && isNaN(character) ? void 0 : character;
62255
- if (typeof line === "undefined") {
62294
+ if (line === void 0) {
62256
62295
  return { line: void 0, character: void 0 };
62257
62296
  }
62258
62297
  return { line, character };
@@ -64004,7 +64043,7 @@ function createHoverifier({
64004
64043
  }
64005
64044
  if (codeElements.length > 0) {
64006
64045
  const topRectangle = codeElements[0].element.getBoundingClientRect();
64007
- const bottomRectangle = codeElements[codeElements.length - 1].element.getBoundingClientRect();
64046
+ const bottomRectangle = codeElements.at(-1).element.getBoundingClientRect();
64008
64047
  const rectangle = {
64009
64048
  top: topRectangle.top,
64010
64049
  bottom: bottomRectangle.bottom,
@@ -64369,7 +64408,6 @@ function registerComlinkTransferHandlers() {
64369
64408
  }
64370
64409
  var syncRemoteSubscription = (subscriptionPromise) => (
64371
64410
  // We cannot pass the proxy subscription directly to Rx because it is a Proxy that looks like a function
64372
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
64373
64411
  new Subscription(async () => {
64374
64412
  const subscriptionProxy = await subscriptionPromise;
64375
64413
  await subscriptionProxy.unsubscribe();
@@ -64584,10 +64622,10 @@ function removeExtension(filePath) {
64584
64622
  return filePath.replace(/\.[^./]+$/, "");
64585
64623
  }
64586
64624
  function slashToDot(value) {
64587
- return value.replace(/\//g, ".");
64625
+ return value.replaceAll("/", ".");
64588
64626
  }
64589
64627
  function dotToSlash(value) {
64590
- return value.replace(/\./g, "/");
64628
+ return value.replaceAll(".", "/");
64591
64629
  }
64592
64630
 
64593
64631
  // ../shared/src/codeintel/legacy-extensions/language-specs/cpp.ts
@@ -64719,7 +64757,7 @@ function filterDefinitions4(results, { filePath, fileContent }) {
64719
64757
  });
64720
64758
  }
64721
64759
  function absoluteImportPath(importPath2) {
64722
- return importPath2.replace(/\./g, "/");
64760
+ return importPath2.replaceAll(".", "/");
64723
64761
  }
64724
64762
  function relativeImportPath(sourcePath, importPath2) {
64725
64763
  const match = /^\.(\.*)(.*)/.exec(importPath2);
@@ -64727,7 +64765,7 @@ function relativeImportPath(sourcePath, importPath2) {
64727
64765
  return void 0;
64728
64766
  }
64729
64767
  const [, parentDots, rest] = match;
64730
- return path3.join(path3.dirname(sourcePath), "../".repeat(parentDots.length), rest.replace(/\./g, "/"));
64768
+ return path3.join(path3.dirname(sourcePath), "../".repeat(parentDots.length), rest.replaceAll(".", "/"));
64731
64769
  }
64732
64770
  var pythonSpec = {
64733
64771
  languageID: "python",
@@ -65548,7 +65586,7 @@ async function updateSettings(platformContext, edit2) {
65548
65586
  if (!isSettingsValid(settings)) {
65549
65587
  throw new Error("invalid settings (internal error)");
65550
65588
  }
65551
- const subject = settings.subjects[settings.subjects.length - 1];
65589
+ const subject = settings.subjects.at(-1);
65552
65590
  await update(subject.subject.id, edit2);
65553
65591
  }
65554
65592
 
@@ -66230,55 +66268,69 @@ function getModeFromPath(path6) {
66230
66268
  }
66231
66269
  function getModeFromExactFilename(fileName) {
66232
66270
  switch (fileName.toLowerCase()) {
66233
- case "dockerfile":
66271
+ case "dockerfile": {
66234
66272
  return "dockerfile";
66273
+ }
66235
66274
  case "build":
66236
- case "workspace":
66275
+ case "workspace": {
66237
66276
  return "starlark";
66238
- default:
66277
+ }
66278
+ default: {
66239
66279
  return void 0;
66280
+ }
66240
66281
  }
66241
66282
  }
66242
66283
  function getModeFromExtension(extension) {
66243
66284
  switch (extension.toLowerCase()) {
66244
66285
  case "adb":
66245
66286
  case "ada":
66246
- case "ads":
66287
+ case "ads": {
66247
66288
  return "ada";
66289
+ }
66248
66290
  case "cls":
66249
66291
  case "apex":
66250
- case "trigger":
66292
+ case "trigger": {
66251
66293
  return "apex";
66252
- case "as":
66294
+ }
66295
+ case "as": {
66253
66296
  return "actionscript";
66254
- case "apacheconf":
66297
+ }
66298
+ case "apacheconf": {
66255
66299
  return "apache";
66300
+ }
66256
66301
  case "applescript":
66257
- case "scpt":
66302
+ case "scpt": {
66258
66303
  return "applescript";
66304
+ }
66259
66305
  case "sh":
66260
66306
  case "bash":
66261
- case "zsh":
66307
+ case "zsh": {
66262
66308
  return "shell";
66309
+ }
66263
66310
  case "clj":
66264
66311
  case "cljs":
66265
- case "cljx":
66312
+ case "cljx": {
66266
66313
  return "clojure";
66267
- case "css":
66314
+ }
66315
+ case "css": {
66268
66316
  return "css";
66317
+ }
66269
66318
  case "cmake":
66270
66319
  case "cmake.in":
66271
- case "in":
66320
+ case "in": {
66272
66321
  return "cmake";
66322
+ }
66273
66323
  case "coffee":
66274
66324
  case "cake":
66275
66325
  case "cson":
66276
66326
  case "cjsx":
66277
- case "iced":
66327
+ case "iced": {
66278
66328
  return "coffescript";
66329
+ }
66279
66330
  case "cs":
66280
- case "csx":
66331
+ case "csx": {
66281
66332
  return "csharp";
66333
+ }
66282
66334
  case "c":
66283
66335
  case "cc":
66284
66336
  case "cpp":
@@ -66289,72 +66341,93 @@ function getModeFromExtension(extension) {
66289
66341
  case "h":
66290
66342
  case "hpp":
66291
66343
  case "pc":
66292
- case "pcc":
66344
+ case "pcc": {
66293
66345
  return "cpp";
66346
+ }
66294
66347
  case "cu":
66295
- case "cuh":
66348
+ case "cuh": {
66296
66349
  return "cuda";
66297
- case "dart":
66350
+ }
66351
+ case "dart": {
66298
66352
  return "dart";
66353
+ }
66299
66354
  case "diff":
66300
- case "patch":
66355
+ case "patch": {
66301
66356
  return "diff";
66302
- case "jinja":
66357
+ }
66358
+ case "jinja": {
66303
66359
  return "django";
66360
+ }
66304
66361
  case "bat":
66305
- case "cmd":
66362
+ case "cmd": {
66306
66363
  return "dos";
66364
+ }
66307
66365
  case "ex":
66308
- case "exs":
66366
+ case "exs": {
66309
66367
  return "elixir";
66310
- case "elm":
66368
+ }
66369
+ case "elm": {
66311
66370
  return "elm";
66312
- case "erl":
66371
+ }
66372
+ case "erl": {
66313
66373
  return "erlang";
66374
+ }
66314
66375
  case "f":
66315
66376
  case "for":
66316
66377
  case "frt":
66317
66378
  case "fr":
66318
66379
  case "forth":
66319
66380
  case "4th":
66320
- case "fth":
66381
+ case "fth": {
66321
66382
  return "fortran";
66322
- case "fs":
66383
+ }
66384
+ case "fs": {
66323
66385
  return "fsharp";
66324
- case "go":
66386
+ }
66387
+ case "go": {
66325
66388
  return "go";
66326
- case "graphql":
66389
+ }
66390
+ case "graphql": {
66327
66391
  return "graphql";
66328
- case "groovy":
66392
+ }
66393
+ case "groovy": {
66329
66394
  return "groovy";
66330
- case "haml":
66395
+ }
66396
+ case "haml": {
66331
66397
  return "haml";
66398
+ }
66332
66399
  case "hbs":
66333
- case "handlebars":
66400
+ case "handlebars": {
66334
66401
  return "handlebars";
66402
+ }
66335
66403
  case "hs":
66336
- case "hsc":
66404
+ case "hsc": {
66337
66405
  return "haskell";
66406
+ }
66338
66407
  case "htm":
66339
66408
  case "html":
66340
- case "xhtml":
66409
+ case "xhtml": {
66341
66410
  return "html";
66411
+ }
66342
66412
  case "ini":
66343
66413
  case "cfg":
66344
66414
  case "prefs":
66345
66415
  case "pro":
66346
- case "properties":
66416
+ case "properties": {
66347
66417
  return "ini";
66348
- case "java":
66418
+ }
66419
+ case "java": {
66349
66420
  return "java";
66421
+ }
66350
66422
  case "js":
66351
66423
  case "jsx":
66352
66424
  case "es":
66353
66425
  case "es6":
66354
66426
  case "mjs":
66355
66427
  case "jss":
66356
- case "jsm":
66428
+ case "jsm": {
66357
66429
  return "javascript";
66430
+ }
66358
66431
  case "json":
66359
66432
  case "sublime_metrics":
66360
66433
  case "sublime_session":
@@ -66362,19 +66435,24 @@ function getModeFromExtension(extension) {
66362
66435
  case "sublime-mousemap":
66363
66436
  case "sublime-project":
66364
66437
  case "sublime-settings":
66365
- case "sublime-workspace":
66438
+ case "sublime-workspace": {
66366
66439
  return "json";
66440
+ }
66367
66441
  case "jsonnet":
66368
- case "libsonnet":
66442
+ case "libsonnet": {
66369
66443
  return "jsonnet";
66370
- case "jl":
66444
+ }
66445
+ case "jl": {
66371
66446
  return "julia";
66447
+ }
66372
66448
  case "kt":
66373
66449
  case "ktm":
66374
- case "kts":
66450
+ case "kts": {
66375
66451
  return "kotlin";
66376
- case "less":
66452
+ }
66453
+ case "less": {
66377
66454
  return "less";
66455
+ }
66378
66456
  case "lisp":
66379
66457
  case "asd":
66380
66458
  case "cl":
@@ -66383,27 +66461,33 @@ function getModeFromExtension(extension) {
66383
66461
  case "ny":
66384
66462
  case "podsl":
66385
66463
  case "sexp":
66386
- case "el":
66464
+ case "el": {
66387
66465
  return "lisp";
66466
+ }
66388
66467
  case "lua":
66389
66468
  case "fcgi":
66390
66469
  case "nse":
66391
66470
  case "pd_lua":
66392
66471
  case "rbxs":
66393
- case "wlua":
66472
+ case "wlua": {
66394
66473
  return "lua";
66474
+ }
66395
66475
  case "mk":
66396
- case "mak":
66476
+ case "mak": {
66397
66477
  return "makefile";
66478
+ }
66398
66479
  case "md":
66399
66480
  case "mkdown":
66400
- case "mkd":
66481
+ case "mkd": {
66401
66482
  return "markdown";
66402
- case "nginxconf":
66483
+ }
66484
+ case "nginxconf": {
66403
66485
  return "nginx";
66486
+ }
66404
66487
  case "m":
66405
- case "mm":
66488
+ case "mm": {
66406
66489
  return "objectivec";
66490
+ }
66407
66491
  case "ml":
66408
66492
  case "eliom":
66409
66493
  case "eliomi":
@@ -66411,12 +66495,14 @@ function getModeFromExtension(extension) {
66411
66495
  case "mli":
66412
66496
  case "mll":
66413
66497
  case "mly":
66414
- case "re":
66498
+ case "re": {
66415
66499
  return "ocaml";
66500
+ }
66416
66501
  case "p":
66417
66502
  case "pas":
66418
- case "pp":
66503
+ case "pp": {
66419
66504
  return "pascal";
66505
+ }
66420
66506
  case "pl":
66421
66507
  case "al":
66422
66508
  case "cgi":
@@ -66426,8 +66512,9 @@ function getModeFromExtension(extension) {
66426
66512
  case "pm":
66427
66513
  case "pod":
66428
66514
  case "psgi":
66429
- case "t":
66515
+ case "t": {
66430
66516
  return "perl";
66517
+ }
66431
66518
  case "php":
66432
66519
  case "phtml":
66433
66520
  case "php3":
@@ -66435,27 +66522,33 @@ function getModeFromExtension(extension) {
66435
66522
  case "php5":
66436
66523
  case "php6":
66437
66524
  case "php7":
66438
- case "phps":
66525
+ case "phps": {
66439
66526
  return "php";
66527
+ }
66440
66528
  case "ps1":
66441
66529
  case "psd1":
66442
- case "psm1":
66530
+ case "psm1": {
66443
66531
  return "powershell";
66444
- case "proto":
66532
+ }
66533
+ case "proto": {
66445
66534
  return "protobuf";
66535
+ }
66446
66536
  case "py":
66447
66537
  case "pyc":
66448
66538
  case "pyd":
66449
66539
  case "pyo":
66450
66540
  case "pyw":
66451
- case "pyz":
66541
+ case "pyz": {
66452
66542
  return "python";
66543
+ }
66453
66544
  case "r":
66454
66545
  case "rd":
66455
- case "rsx":
66546
+ case "rsx": {
66456
66547
  return "r";
66457
- case "repro":
66548
+ }
66549
+ case "repro": {
66458
66550
  return "reprolang";
66551
+ }
66459
66552
  case "rb":
66460
66553
  case "builder":
66461
66554
  case "eye":
@@ -66474,61 +66567,81 @@ function getModeFromExtension(extension) {
66474
66567
  case "ruby":
66475
66568
  case "spec":
66476
66569
  case "thor":
66477
- case "watchr":
66570
+ case "watchr": {
66478
66571
  return "ruby";
66572
+ }
66479
66573
  case "rs":
66480
- case "rs.in":
66574
+ case "rs.in": {
66481
66575
  return "rust";
66576
+ }
66482
66577
  case "sass":
66483
- case "scss":
66578
+ case "scss": {
66484
66579
  return "scss";
66580
+ }
66485
66581
  case "sbt":
66486
66582
  case "sc":
66487
- case "scala":
66583
+ case "scala": {
66488
66584
  return "scala";
66585
+ }
66489
66586
  case "bzl":
66490
- case "bazel":
66587
+ case "bazel": {
66491
66588
  return "starlark";
66492
- case "strato":
66589
+ }
66590
+ case "strato": {
66493
66591
  return "strato";
66592
+ }
66494
66593
  case "scm":
66495
66594
  case "sch":
66496
66595
  case "sls":
66497
66596
  case "sps":
66498
- case "ss":
66597
+ case "ss": {
66499
66598
  return "scheme";
66500
- case "st":
66599
+ }
66600
+ case "st": {
66501
66601
  return "smalltalk";
66502
- case "sql":
66602
+ }
66603
+ case "sql": {
66503
66604
  return "sql";
66504
- case "styl":
66605
+ }
66606
+ case "styl": {
66505
66607
  return "stylus";
66506
- case "swift":
66608
+ }
66609
+ case "swift": {
66507
66610
  return "swift";
66508
- case "thrift":
66611
+ }
66612
+ case "thrift": {
66509
66613
  return "thrift";
66614
+ }
66510
66615
  case "ts":
66511
- case "tsx":
66616
+ case "tsx": {
66512
66617
  return "typescript";
66513
- case "twig":
66618
+ }
66619
+ case "twig": {
66514
66620
  return "twig";
66515
- case "vb":
66621
+ }
66622
+ case "vb": {
66516
66623
  return "vbnet";
66517
- case "vbs":
66624
+ }
66625
+ case "vbs": {
66518
66626
  return "vbscrip";
66627
+ }
66519
66628
  case "v":
66520
66629
  case "veo":
66521
66630
  case "sv":
66522
66631
  case "svh":
66523
- case "svi":
66632
+ case "svi": {
66524
66633
  return "verilog";
66634
+ }
66525
66635
  case "vhd":
66526
- case "vhdl":
66636
+ case "vhdl": {
66527
66637
  return "vhdl";
66528
- case "vim":
66638
+ }
66639
+ case "vim": {
66529
66640
  return "vim";
66530
- case "xlsg":
66641
+ }
66642
+ case "xlsg": {
66531
66643
  return "xlsg";
66644
+ }
66532
66645
  case "xml":
66533
66646
  case "adml":
66534
66647
  case "admx":
@@ -66615,15 +66728,19 @@ function getModeFromExtension(extension) {
66615
66728
  case "xsd":
66616
66729
  case "xspec":
66617
66730
  case "xul":
66618
- case "zcml":
66731
+ case "zcml": {
66619
66732
  return "xml";
66620
- case "zig":
66733
+ }
66734
+ case "zig": {
66621
66735
  return "zig";
66736
+ }
66622
66737
  case "yml":
66623
- case "yaml":
66738
+ case "yaml": {
66624
66739
  return "yaml";
66625
- default:
66740
+ }
66741
+ default: {
66626
66742
  return void 0;
66743
+ }
66627
66744
  }
66628
66745
  }
66629
66746
  function getPathExtension(path6) {
@@ -66634,7 +66751,7 @@ function getPathExtension(path6) {
66634
66751
  if (pathSplit.length === 2 && pathSplit[0] === "") {
66635
66752
  return "";
66636
66753
  }
66637
- return pathSplit[pathSplit.length - 1].toLowerCase();
66754
+ return pathSplit.at(-1).toLowerCase();
66638
66755
  }
66639
66756
 
66640
66757
  // ../shared/src/tracking/utm.ts
@@ -69107,7 +69224,7 @@ function querySelectorAcrossShadowRoots(element, selectors) {
69107
69224
  }
69108
69225
  let currentElement = element;
69109
69226
  const selectorsExceptLast = selectors.slice(0, -1);
69110
- const lastSelector = selectors[selectors.length - 1];
69227
+ const lastSelector = selectors.at(-1);
69111
69228
  for (const selector of selectorsExceptLast) {
69112
69229
  if (!currentElement) {
69113
69230
  return null;
@@ -69334,7 +69451,7 @@ function getDiffResolvedRevision(codeView) {
69334
69451
  if (shaContainers && shaContainers.length === 2) {
69335
69452
  const baseShaElement = shaContainers[0].querySelector("a");
69336
69453
  if (baseShaElement) {
69337
- baseCommitID = baseShaElement.href.split("/").slice(-1)[0];
69454
+ baseCommitID = baseShaElement.href.split("/").at(-1);
69338
69455
  }
69339
69456
  const headShaElement = shaContainers[1].querySelector("span.sha");
69340
69457
  if (headShaElement) {
@@ -69429,10 +69546,12 @@ function isDiffPageType(pageType) {
69429
69546
  switch (pageType) {
69430
69547
  case "commit":
69431
69548
  case "pull":
69432
- case "compare":
69549
+ case "compare": {
69433
69550
  return true;
69434
- default:
69551
+ }
69552
+ default: {
69435
69553
  return false;
69554
+ }
69436
69555
  }
69437
69556
  }
69438
69557
  function parseURL(location2 = window.location) {
@@ -69445,19 +69564,22 @@ function parseURL(location2 = window.location) {
69445
69564
  const rawRepoName = `${host3}/${repoName}`;
69446
69565
  switch (pageType) {
69447
69566
  case "blob":
69448
- case "tree":
69567
+ case "tree": {
69449
69568
  return {
69450
69569
  pageType,
69451
69570
  rawRepoName,
69452
69571
  revisionAndFilePath: decodeURIComponent(rest.join("/")),
69453
69572
  repoName
69454
69573
  };
69574
+ }
69455
69575
  case "pull":
69456
69576
  case "commit":
69457
- case "compare":
69577
+ case "compare": {
69458
69578
  return { pageType, rawRepoName, repoName };
69459
- default:
69579
+ }
69580
+ default: {
69460
69581
  return { pageType: "other", rawRepoName, repoName };
69582
+ }
69461
69583
  }
69462
69584
  }
69463
69585
  var oldUISelectors = {
@@ -69822,7 +69944,7 @@ var createFileLineContainerToolbarMount = (codeViewElement) => {
69822
69944
  mountElement.style.verticalAlign = "middle";
69823
69945
  mountElement.style.alignItems = "center";
69824
69946
  mountElement.className = className2;
69825
- const container = codeViewElement.querySelector("#repos-sticky-header")?.childNodes[0]?.childNodes[0]?.childNodes[1]?.childNodes[2];
69947
+ const container = codeViewElement.querySelector("#repos-sticky-header .react-blob-header-edit-and-raw-actions");
69826
69948
  if (container instanceof HTMLElement) {
69827
69949
  container.prepend(mountElement);
69828
69950
  return mountElement;
@@ -69995,14 +70117,18 @@ var getGithubResultType = () => {
69995
70117
  var getSourcegraphResultType = () => {
69996
70118
  const githubResultType = getGithubResultType();
69997
70119
  switch (githubResultType) {
69998
- case "repositories":
70120
+ case "repositories": {
69999
70121
  return "repo";
70000
- case "commits":
70122
+ }
70123
+ case "commits": {
70001
70124
  return "commit";
70002
- case "code":
70125
+ }
70126
+ case "code": {
70003
70127
  return "";
70004
- default:
70128
+ }
70129
+ default: {
70005
70130
  return isSimpleSearchPage() || isAdvancedSearchPage() ? "repo" : "";
70131
+ }
70006
70132
  }
70007
70133
  };
70008
70134
  var getSourcegraphResultLanguage = () => new URLSearchParams(window.location.search).get("l");
@@ -73851,14 +73977,18 @@ var getPageKindFromPathName = (owner, projectName, pathname) => {
73851
73977
  return 3 /* Other */;
73852
73978
  }
73853
73979
  switch (pageKindMatch[2]) {
73854
- case "commit":
73980
+ case "commit": {
73855
73981
  return 1 /* Commit */;
73856
- case "merge_requests":
73982
+ }
73983
+ case "merge_requests": {
73857
73984
  return 2 /* MergeRequest */;
73858
- case "blob":
73985
+ }
73986
+ case "blob": {
73859
73987
  return 0 /* File */;
73860
- default:
73988
+ }
73989
+ default: {
73861
73990
  return 3 /* Other */;
73991
+ }
73862
73992
  }
73863
73993
  };
73864
73994
  var getGitlabRepoURL = () => {
@@ -74913,7 +75043,6 @@ function createMainThreadExtensionGraphQLHelpers() {
74913
75043
  const graphqlClient = {
74914
75044
  watchQuery: ({ variables, query }) => (
74915
75045
  // Temporary implementation till Apollo-Client is configured in the background script.
74916
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
74917
75046
  requestGraphQLInBackground({
74918
75047
  request: print(query),
74919
75048
  variables,
@@ -74950,7 +75079,7 @@ function createGraphQLHelpers(sourcegraphURL, isExtension2) {
74950
75079
  const getBrowserGraphQLClient = (0, import_lodash30.once)(
74951
75080
  () => getGraphQLClient({
74952
75081
  cache: cache2,
74953
- headers: getHeaders(),
75082
+ getHeaders,
74954
75083
  baseUrl: sourcegraphURL,
74955
75084
  credentials: "include"
74956
75085
  })
@@ -75046,7 +75175,7 @@ function browserPortToMessagePort(browserPort, prefix, connect) {
75046
75175
  };
75047
75176
  }
75048
75177
  function replaceValueAtPath(value, path6, newValue) {
75049
- const lastProperty = path6[path6.length - 1];
75178
+ const lastProperty = path6.at(-1);
75050
75179
  for (const property2 of path6.slice(0, -1)) {
75051
75180
  value = value[property2];
75052
75181
  }
@@ -75140,7 +75269,7 @@ function getURLsForInlineExtension(extensionID, assetsURL) {
75140
75269
  const kebabCaseExtensionID = extensionID.replace(/^sourcegraph\//, "sourcegraph-");
75141
75270
  const manifestPath = `extensions/${kebabCaseExtensionID}/package.json`;
75142
75271
  const scriptPath = `extensions/${kebabCaseExtensionID}/extension.js`;
75143
- if (typeof window.browser !== "undefined") {
75272
+ if (window.browser !== void 0) {
75144
75273
  return {
75145
75274
  manifestURL: browser.runtime.getURL(manifestPath),
75146
75275
  scriptURL: browser.runtime.getURL(scriptPath)