@genspectrum/dashboard-components 0.1.3 → 0.1.5

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 (78) hide show
  1. package/custom-elements.json +488 -117
  2. package/dist/dashboard-components.js +904 -466
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +473 -67
  5. package/dist/style.css +273 -153
  6. package/package.json +11 -7
  7. package/src/preact/aggregatedData/aggregate.stories.tsx +7 -5
  8. package/src/preact/aggregatedData/aggregate.tsx +16 -7
  9. package/src/preact/components/ReferenceGenomesAwaiter.tsx +25 -0
  10. package/src/preact/components/csv-download-button.tsx +8 -2
  11. package/src/preact/components/headline.stories.tsx +19 -1
  12. package/src/preact/components/headline.tsx +25 -5
  13. package/src/preact/components/info.stories.tsx +24 -3
  14. package/src/preact/components/info.tsx +49 -5
  15. package/src/preact/components/min-max-range-slider.tsx +4 -4
  16. package/src/preact/components/percent-intput.tsx +2 -3
  17. package/src/preact/components/resize-container.tsx +23 -0
  18. package/src/preact/components/table.tsx +1 -0
  19. package/src/preact/components/tabs.stories.tsx +2 -2
  20. package/src/preact/components/tabs.tsx +47 -24
  21. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +36 -4
  22. package/src/preact/dateRangeSelector/date-range-selector.tsx +67 -53
  23. package/src/preact/locationFilter/location-filter.tsx +2 -2
  24. package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +5 -5
  25. package/src/preact/mutationComparison/getMutationComparisonTableData.ts +45 -10
  26. package/src/preact/mutationComparison/mutation-comparison-table.tsx +20 -22
  27. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +6 -3
  28. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +11 -1
  29. package/src/preact/mutationComparison/mutation-comparison.tsx +16 -7
  30. package/src/preact/mutationFilter/mutation-filter.stories.tsx +70 -31
  31. package/src/preact/mutationFilter/mutation-filter.tsx +62 -14
  32. package/src/preact/mutations/getInsertionsTableData.spec.ts +6 -4
  33. package/src/preact/mutations/getInsertionsTableData.ts +1 -1
  34. package/src/preact/mutations/getMutationsTableData.spec.ts +9 -19
  35. package/src/preact/mutations/getMutationsTableData.ts +1 -1
  36. package/src/preact/mutations/mutations-insertions-table.tsx +3 -1
  37. package/src/preact/mutations/mutations-table.tsx +3 -1
  38. package/src/preact/mutations/mutations.stories.tsx +11 -1
  39. package/src/preact/mutations/mutations.tsx +24 -7
  40. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +1 -0
  41. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -0
  42. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +1 -0
  43. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +8 -0
  44. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +31 -13
  45. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +8 -5
  46. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +15 -0
  47. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +62 -12
  48. package/src/preact/shared/sort/sortInsertions.spec.ts +11 -10
  49. package/src/preact/shared/sort/sortInsertions.ts +10 -17
  50. package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +19 -10
  51. package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +45 -12
  52. package/src/preact/textInput/text-input.stories.tsx +22 -1
  53. package/src/preact/textInput/text-input.tsx +3 -1
  54. package/src/utils/typeAssertions.spec.ts +31 -0
  55. package/src/utils/typeAssertions.ts +16 -0
  56. package/src/web-components/PreactLitAdapter.tsx +0 -1
  57. package/src/web-components/app.stories.ts +129 -0
  58. package/src/web-components/app.ts +27 -6
  59. package/src/web-components/display/aggregate-component.stories.ts +24 -11
  60. package/src/web-components/display/aggregate-component.tsx +26 -5
  61. package/src/web-components/display/mutation-comparison-component.stories.ts +32 -11
  62. package/src/web-components/display/mutation-comparison-component.tsx +79 -4
  63. package/src/web-components/display/mutations-component.stories.ts +40 -19
  64. package/src/web-components/display/mutations-component.tsx +71 -4
  65. package/src/web-components/display/prevalence-over-time-component.stories.ts +44 -18
  66. package/src/web-components/display/prevalence-over-time-component.tsx +105 -5
  67. package/src/web-components/display/relative-growth-advantage-component.stories.ts +32 -10
  68. package/src/web-components/display/relative-growth-advantage-component.tsx +66 -3
  69. package/src/web-components/input/date-range-selector-component.stories.ts +51 -9
  70. package/src/web-components/input/date-range-selector-component.tsx +69 -4
  71. package/src/web-components/input/location-filter-component.stories.ts +15 -4
  72. package/src/web-components/input/location-filter-component.tsx +2 -6
  73. package/src/web-components/input/mutation-filter-component.stories.ts +33 -12
  74. package/src/web-components/input/mutation-filter-component.tsx +60 -4
  75. package/src/web-components/input/text-input-component.stories.ts +26 -6
  76. package/src/web-components/input/text-input-component.tsx +34 -3
  77. package/src/web-components/display/aggregate-component.mdx +0 -25
  78. package/src/web-components/input/location-filter.mdx +0 -25
@@ -2,10 +2,11 @@ import { createContext, provide, consume } from "@lit/context";
2
2
  import { Task } from "@lit/task";
3
3
  import { LitElement, html, unsafeCSS } from "lit";
4
4
  import z$1 from "zod";
5
- import { options, Fragment, createContext as createContext$1, render } from "preact";
5
+ import { options, createContext as createContext$1, Fragment, render } from "preact";
6
6
  import { Grid } from "gridjs";
7
7
  import { Chart, registerables, Scale } from "chart.js";
8
8
  import { VennDiagramController, ArcSlice, extractSets } from "chartjs-chart-venn";
9
+ import { ReactiveElement } from "@lit/reactive-element";
9
10
  import { BarWithErrorBarsController, BarWithErrorBar } from "chartjs-chart-error-bars";
10
11
  import flatpickr from "flatpickr";
11
12
  /**
@@ -490,14 +491,10 @@ let App = class extends LitElement {
490
491
  }
491
492
  render() {
492
493
  return this.updateReferenceGenome.render({
493
- complete: () => {
494
- return html` <slot></slot>`;
495
- },
494
+ complete: () => html` <slot></slot>`,
496
495
  error: () => html`<p>Error</p>`,
497
496
  // TODO(#143): Add more advanced error handling
498
- pending: () => {
499
- return html`<p>Loading...</p>`;
500
- }
497
+ pending: () => html` <p>Loading reference genomes...</p> `
501
498
  });
502
499
  }
503
500
  createRenderRoot() {
@@ -516,9 +513,11 @@ App = __decorateClass$a([
516
513
  ], App);
517
514
  var f$1 = 0;
518
515
  function u$1(e2, t2, n3, o2, i2, u2) {
519
- var a2, c2, p2 = {};
520
- for (c2 in t2)
521
- "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
516
+ t2 || (t2 = {});
517
+ var a2, c2, p2 = t2;
518
+ if ("ref" in p2)
519
+ for (c2 in p2 = {}, t2)
520
+ "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
522
521
  var l2 = { type: e2, props: p2, key: n3, ref: a2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --f$1, __i: -1, __u: 0, __source: i2, __self: u2 };
523
522
  if ("function" == typeof e2 && (a2 = e2.defaultProps))
524
523
  for (c2 in a2)
@@ -662,18 +661,29 @@ function getMutationComparisonTableData(data, proportionInterval) {
662
661
  const mutationsToProportions = /* @__PURE__ */ new Map();
663
662
  for (const mutationData of data.content) {
664
663
  for (const mutationEntry of mutationData.data) {
665
- const mutation = mutationEntry.mutation.toString();
666
- const proportions = mutationsToProportions.get(mutation) || {};
667
- proportions[mutationData.displayName] = mutationEntry.proportion;
668
- mutationsToProportions.set(mutation, proportions);
664
+ const mutationKey = mutationEntry.mutation.toString();
665
+ const existingRow = mutationsToProportions.get(mutationKey);
666
+ if (!existingRow) {
667
+ mutationsToProportions.set(
668
+ mutationKey,
669
+ initializeMutationRow(mutationEntry.mutation, mutationData.displayName, mutationEntry.proportion)
670
+ );
671
+ } else {
672
+ existingRow.proportions = updateProportions(
673
+ existingRow.proportions,
674
+ mutationData.displayName,
675
+ mutationEntry.proportion
676
+ );
677
+ mutationsToProportions.set(mutationKey, existingRow);
678
+ }
669
679
  }
670
680
  }
671
- return [...mutationsToProportions.entries()].map(([mutation, proportions]) => {
681
+ return [...mutationsToProportions.values()].map((row) => {
672
682
  return {
673
- mutation,
683
+ mutation: row.mutation,
674
684
  ...data.content.map((mutationData) => {
675
685
  return {
676
- [`${mutationData.displayName} prevalence`]: proportions[mutationData.displayName] || 0
686
+ [`${mutationData.displayName} prevalence`]: row.proportions[mutationData.displayName] || 0
677
687
  };
678
688
  }).reduce((acc, val) => ({ ...acc, ...val }), {})
679
689
  };
@@ -683,6 +693,17 @@ function getMutationComparisonTableData(data, proportionInterval) {
683
693
  )
684
694
  );
685
695
  }
696
+ function initializeMutationRow(mutation, displayName, proportion) {
697
+ return {
698
+ mutation,
699
+ proportions: {
700
+ [displayName]: proportion
701
+ }
702
+ };
703
+ }
704
+ function updateProportions(proportions, displayName, proportion) {
705
+ return { ...proportions, [displayName]: proportion };
706
+ }
686
707
  const tableStyle = {
687
708
  table: {
688
709
  fontSize: "12px"
@@ -717,49 +738,183 @@ const Table = ({ data, columns, pagination }) => {
717
738
  });
718
739
  return /* @__PURE__ */ u$1("div", { ref: wrapper3 });
719
740
  };
720
- const substitutionAndDeletionRegex = /(?:([A-Za-z0-9]+):)?([A-Za-z])(\d+)([A-Za-z]|-|\*)/;
721
- const sortSubstitutionsAndDeletions = (a2, b2) => {
722
- const aMatch = a2.match(substitutionAndDeletionRegex);
723
- const bMatch = b2.match(substitutionAndDeletionRegex);
724
- if (aMatch && bMatch) {
725
- if (aMatch[1] !== bMatch[1]) {
726
- return aMatch[1].localeCompare(bMatch[1]);
741
+ const substitutionRegex = /^((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<valueAtReference>[A-Za-z])?(?<position>\d+)(?<substitutionValue>[A-Za-z.])?$/;
742
+ class Substitution {
743
+ constructor(segment, valueAtReference, substitutionValue, position) {
744
+ this.segment = segment;
745
+ this.valueAtReference = valueAtReference;
746
+ this.substitutionValue = substitutionValue;
747
+ this.position = position;
748
+ const segmentString = this.segment ? `${this.segment}:` : "";
749
+ const valueAtReferenceString = this.valueAtReference ? `${this.valueAtReference}` : "";
750
+ const substitutionValueString = this.substitutionValue ? `${this.substitutionValue}` : "";
751
+ this.code = `${segmentString}${valueAtReferenceString}${this.position}${substitutionValueString}`;
752
+ }
753
+ equals(other) {
754
+ if (!(other instanceof Substitution)) {
755
+ return false;
756
+ }
757
+ return this.segment === other.segment && this.valueAtReference === other.valueAtReference && this.substitutionValue === other.substitutionValue && this.position === other.position;
758
+ }
759
+ toString() {
760
+ return this.code;
761
+ }
762
+ static parse(mutationStr) {
763
+ const match = mutationStr.match(substitutionRegex);
764
+ if (match === null || match.groups === void 0) {
765
+ return null;
766
+ }
767
+ return new Substitution(
768
+ match.groups.segment,
769
+ match.groups.valueAtReference,
770
+ match.groups.substitutionValue,
771
+ parseInt(match.groups.position, 10)
772
+ );
773
+ }
774
+ }
775
+ const deletionRegex = /^((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<valueAtReference>[A-Za-z])?(?<position>\d+)(-)$/;
776
+ class Deletion {
777
+ constructor(segment, valueAtReference, position) {
778
+ this.segment = segment;
779
+ this.valueAtReference = valueAtReference;
780
+ this.position = position;
781
+ const segmentString = this.segment ? `${this.segment}:` : "";
782
+ const valueAtReferenceString = this.valueAtReference ? `${this.valueAtReference}` : "";
783
+ this.code = `${segmentString}${valueAtReferenceString}${this.position}-`;
784
+ }
785
+ equals(other) {
786
+ if (!(other instanceof Deletion)) {
787
+ return false;
727
788
  }
728
- if (aMatch[3] !== bMatch[3]) {
729
- return parseInt(aMatch[3], 10) - parseInt(bMatch[3], 10);
789
+ return this.segment === other.segment && this.valueAtReference === other.valueAtReference && this.position === other.position;
790
+ }
791
+ toString() {
792
+ return this.code;
793
+ }
794
+ static parse(mutationStr) {
795
+ const match = mutationStr.match(deletionRegex);
796
+ if (match === null || match.groups === void 0) {
797
+ return null;
798
+ }
799
+ return new Deletion(match.groups.segment, match.groups.valueAtReference, parseInt(match.groups.position, 10));
800
+ }
801
+ }
802
+ const insertionRegexp = /^ins_((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<position>\d+):(?<insertedSymbols>(([A-Za-z?]|(\.\*))+))$/i;
803
+ class Insertion {
804
+ constructor(segment, position, insertedSymbols) {
805
+ this.segment = segment;
806
+ this.position = position;
807
+ this.insertedSymbols = insertedSymbols;
808
+ this.code = `ins_${this.segment ? `${this.segment}:` : ""}${this.position}:${this.insertedSymbols}`;
809
+ }
810
+ equals(other) {
811
+ if (!(other instanceof Insertion)) {
812
+ return false;
813
+ }
814
+ return this.segment === other.segment && this.insertedSymbols === other.insertedSymbols && this.position === other.position;
815
+ }
816
+ toString() {
817
+ return this.code;
818
+ }
819
+ static parse(mutationStr) {
820
+ const match = mutationStr.match(insertionRegexp);
821
+ if (match === null || match.groups === void 0) {
822
+ return null;
823
+ }
824
+ return new Insertion(match.groups.segment, parseInt(match.groups.position, 10), match.groups.insertedSymbols);
825
+ }
826
+ }
827
+ const bases = {
828
+ nucleotide: ["A", "C", "G", "T", "-"],
829
+ "amino acid": [
830
+ "I",
831
+ "L",
832
+ "V",
833
+ "F",
834
+ "M",
835
+ "C",
836
+ "A",
837
+ "G",
838
+ "P",
839
+ "T",
840
+ "S",
841
+ "Y",
842
+ "W",
843
+ "Q",
844
+ "N",
845
+ "H",
846
+ "E",
847
+ "D",
848
+ "K",
849
+ "R",
850
+ "-"
851
+ ]
852
+ };
853
+ const sortSubstitutionsAndDeletions = (a2, b2) => {
854
+ if (a2.segment !== b2.segment) {
855
+ compareSegments(a2.segment, b2.segment);
856
+ }
857
+ if (a2.position !== b2.position) {
858
+ return comparePositions(a2.position, b2.position);
859
+ }
860
+ const aIsDeletion = a2 instanceof Deletion;
861
+ const bIsDeletion = b2 instanceof Deletion;
862
+ if (aIsDeletion !== bIsDeletion) {
863
+ return aIsDeletion ? 1 : -1;
864
+ }
865
+ if (!aIsDeletion && !bIsDeletion) {
866
+ if (a2.substitutionValue !== b2.substitutionValue) {
867
+ return compareSubstitutionValues(a2.substitutionValue, b2.substitutionValue);
730
868
  }
731
- return aMatch[4].localeCompare(bMatch[4]);
732
869
  }
733
- throw new Error(`Invalid substitution or deletion: ${a2} or ${b2}`);
870
+ return 0;
871
+ };
872
+ const compareSegments = (a2, b2) => {
873
+ if (a2 === void 0) {
874
+ return -1;
875
+ }
876
+ if (b2 === void 0) {
877
+ return 1;
878
+ }
879
+ return a2.localeCompare(b2);
880
+ };
881
+ const comparePositions = (a2, b2) => {
882
+ return a2 - b2;
883
+ };
884
+ const compareSubstitutionValues = (a2, b2) => {
885
+ if (a2 === void 0) {
886
+ return -1;
887
+ }
888
+ if (b2 === void 0) {
889
+ return 1;
890
+ }
891
+ return a2.localeCompare(b2);
734
892
  };
735
893
  const formatProportion = (proportion) => {
736
894
  return `${(proportion * 100).toFixed(2)}%`;
737
895
  };
738
896
  const MutationComparisonTable = ({ data, proportionInterval }) => {
739
- const getHeaders = () => {
740
- return [
741
- {
742
- name: "Mutation",
743
- sort: {
744
- compare: (a2, b2) => {
745
- return sortSubstitutionsAndDeletions(a2, b2);
746
- }
747
- }
897
+ const headers = [
898
+ {
899
+ name: "Mutation",
900
+ sort: {
901
+ compare: sortSubstitutionsAndDeletions
748
902
  },
749
- {
750
- name: "Prevalence",
751
- columns: data.content.map((mutationData) => {
752
- return {
753
- name: mutationData.displayName,
754
- sort: true,
755
- formatter: (cell) => formatProportion(cell)
756
- };
757
- })
758
- }
759
- ];
760
- };
903
+ formatter: (cell) => cell.toString()
904
+ },
905
+ {
906
+ name: "Prevalence",
907
+ columns: data.content.map((mutationData) => {
908
+ return {
909
+ name: mutationData.displayName,
910
+ sort: true,
911
+ formatter: (cell) => formatProportion(cell)
912
+ };
913
+ })
914
+ }
915
+ ];
761
916
  const tableData = getMutationComparisonTableData(data, proportionInterval).map((row) => Object.values(row));
762
- return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pagination: true });
917
+ return /* @__PURE__ */ u$1(Table, { data: tableData, columns: headers, pagination: true });
763
918
  };
764
919
  const GsChart = ({ configuration }) => {
765
920
  const canvasRef = F(null);
@@ -821,6 +976,7 @@ const MutationComparisonVenn = ({
821
976
  type: "venn",
822
977
  data: sets,
823
978
  options: {
979
+ maintainAspectRatio: false,
824
980
  scales: {
825
981
  x: {
826
982
  ticks: {
@@ -868,123 +1024,11 @@ const MutationComparisonVenn = ({
868
1024
  if (data.content.length > 5) {
869
1025
  return /* @__PURE__ */ u$1("div", { children: "Too many variants to display. Maximum are five. " });
870
1026
  }
871
- return /* @__PURE__ */ u$1(Fragment, { children: [
872
- /* @__PURE__ */ u$1(GsChart, { configuration: config }),
1027
+ return /* @__PURE__ */ u$1("div", { className: "h-full flex flex-col", children: [
1028
+ /* @__PURE__ */ u$1("div", { className: "flex-1", children: /* @__PURE__ */ u$1(GsChart, { configuration: config }) }),
873
1029
  /* @__PURE__ */ u$1("div", { class: "flex flex-wrap break-words m-2", ref: divRef })
874
1030
  ] });
875
1031
  };
876
- const substitutionRegex = /^((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<valueAtReference>[A-Za-z])?(?<position>\d+)(?<substitutionValue>[A-Za-z.])?$/;
877
- class Substitution {
878
- constructor(segment, valueAtReference, substitutionValue, position) {
879
- this.segment = segment;
880
- this.valueAtReference = valueAtReference;
881
- this.substitutionValue = substitutionValue;
882
- this.position = position;
883
- const segmentString = this.segment ? `${this.segment}:` : "";
884
- const valueAtReferenceString = this.valueAtReference ? `${this.valueAtReference}` : "";
885
- const substitutionValueString = this.substitutionValue ? `${this.substitutionValue}` : "";
886
- this.code = `${segmentString}${valueAtReferenceString}${this.position}${substitutionValueString}`;
887
- }
888
- equals(other) {
889
- if (!(other instanceof Substitution)) {
890
- return false;
891
- }
892
- return this.segment === other.segment && this.valueAtReference === other.valueAtReference && this.substitutionValue === other.substitutionValue && this.position === other.position;
893
- }
894
- toString() {
895
- return this.code;
896
- }
897
- static parse(mutationStr) {
898
- const match = mutationStr.match(substitutionRegex);
899
- if (match === null || match.groups === void 0) {
900
- return null;
901
- }
902
- return new Substitution(
903
- match.groups.segment,
904
- match.groups.valueAtReference,
905
- match.groups.substitutionValue,
906
- parseInt(match.groups.position, 10)
907
- );
908
- }
909
- }
910
- const deletionRegex = /^((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<valueAtReference>[A-Za-z])?(?<position>\d+)(-)$/;
911
- class Deletion {
912
- constructor(segment, valueAtReference, position) {
913
- this.segment = segment;
914
- this.valueAtReference = valueAtReference;
915
- this.position = position;
916
- const segmentString = this.segment ? `${this.segment}:` : "";
917
- const valueAtReferenceString = this.valueAtReference ? `${this.valueAtReference}` : "";
918
- this.code = `${segmentString}${valueAtReferenceString}${this.position}-`;
919
- }
920
- equals(other) {
921
- if (!(other instanceof Deletion)) {
922
- return false;
923
- }
924
- return this.segment === other.segment && this.valueAtReference === other.valueAtReference && this.position === other.position;
925
- }
926
- toString() {
927
- return this.code;
928
- }
929
- static parse(mutationStr) {
930
- const match = mutationStr.match(deletionRegex);
931
- if (match === null || match.groups === void 0) {
932
- return null;
933
- }
934
- return new Deletion(match.groups.segment, match.groups.valueAtReference, parseInt(match.groups.position, 10));
935
- }
936
- }
937
- const insertionRegexp = /^ins_((?<segment>[A-Za-z0-9_-]+)(?=:):)?(?<position>\d+):(?<insertedSymbols>(([A-Za-z?]|(\.\*))+))$/i;
938
- class Insertion {
939
- constructor(segment, position, insertedSymbols) {
940
- this.segment = segment;
941
- this.position = position;
942
- this.insertedSymbols = insertedSymbols;
943
- this.code = `ins_${this.segment ? `${this.segment}:` : ""}${this.position}:${this.insertedSymbols}`;
944
- }
945
- equals(other) {
946
- if (!(other instanceof Insertion)) {
947
- return false;
948
- }
949
- return this.segment === other.segment && this.insertedSymbols === other.insertedSymbols && this.position === other.position;
950
- }
951
- toString() {
952
- return this.code;
953
- }
954
- static parse(mutationStr) {
955
- const match = mutationStr.match(insertionRegexp);
956
- if (match === null || match.groups === void 0) {
957
- return null;
958
- }
959
- return new Insertion(match.groups.segment, parseInt(match.groups.position, 10), match.groups.insertedSymbols);
960
- }
961
- }
962
- const bases = {
963
- nucleotide: ["A", "C", "G", "T", "-"],
964
- "amino acid": [
965
- "I",
966
- "L",
967
- "V",
968
- "F",
969
- "M",
970
- "C",
971
- "A",
972
- "G",
973
- "P",
974
- "T",
975
- "S",
976
- "Y",
977
- "W",
978
- "Q",
979
- "N",
980
- "H",
981
- "E",
982
- "D",
983
- "K",
984
- "R",
985
- "-"
986
- ]
987
- };
988
1032
  class FetchSubstitutionsOrDeletionsOperator {
989
1033
  constructor(filter, sequenceType, minProportion) {
990
1034
  this.filter = filter;
@@ -1181,13 +1225,56 @@ const ErrorDisplay = ({ error }) => {
1181
1225
  ] });
1182
1226
  };
1183
1227
  const Headline = ({ heading, children }) => {
1184
- return /* @__PURE__ */ u$1(Fragment, { children: [
1185
- /* @__PURE__ */ u$1("h1", { children: heading }),
1186
- children
1228
+ if (!heading) {
1229
+ return /* @__PURE__ */ u$1(Fragment, { children });
1230
+ }
1231
+ return /* @__PURE__ */ u$1(ResizingHeadline, { heading, children });
1232
+ };
1233
+ const ResizingHeadline = ({ heading, children }) => {
1234
+ const ref = F(null);
1235
+ const [h1Height, setH1Height] = p("2rem");
1236
+ _(() => {
1237
+ if (ref.current) {
1238
+ const h1Height2 = ref.current.getBoundingClientRect().height;
1239
+ setH1Height(`${h1Height2}px`);
1240
+ }
1241
+ }, []);
1242
+ return /* @__PURE__ */ u$1("div", { className: "h-full w-full", children: [
1243
+ /* @__PURE__ */ u$1("h1", { ref, children: heading }),
1244
+ /* @__PURE__ */ u$1("div", { style: { height: `calc(100% - ${h1Height})` }, children })
1245
+ ] });
1246
+ };
1247
+ const Info = ({ children, size }) => {
1248
+ const [showHelp, setShowHelp] = p(false);
1249
+ const toggleHelp = () => {
1250
+ setShowHelp(!showHelp);
1251
+ };
1252
+ return /* @__PURE__ */ u$1("div", { className: "relative", children: [
1253
+ /* @__PURE__ */ u$1("button", { className: "btn btn-xs", onClick: toggleHelp, children: "?" }),
1254
+ showHelp && /* @__PURE__ */ u$1(
1255
+ "div",
1256
+ {
1257
+ className: "absolute top-8 right-6 bg-white p-2 border border-black flex flex-col overflow-auto shadow-lg rounded z-50",
1258
+ style: size,
1259
+ children: [
1260
+ /* @__PURE__ */ u$1("div", { className: "flex flex-col", children }),
1261
+ /* @__PURE__ */ u$1("div", { className: "flex justify-end", children: /* @__PURE__ */ u$1("button", { className: "text-sm underline mt-2", onClick: toggleHelp, children: "Close" }) })
1262
+ ]
1263
+ }
1264
+ )
1187
1265
  ] });
1188
1266
  };
1189
- const Info = ({ content, className }) => {
1190
- return /* @__PURE__ */ u$1("div", { class: `${className} tooltip`, "data-tip": content, children: /* @__PURE__ */ u$1("button", { class: "btn btn-xs", children: "?" }) });
1267
+ const InfoHeadline1 = ({ children }) => {
1268
+ return /* @__PURE__ */ u$1("h1", { className: "text-lg font-bold", children });
1269
+ };
1270
+ const InfoHeadline2 = ({ children }) => {
1271
+ return /* @__PURE__ */ u$1("h2", { className: "text-base font-bold mt-4", children });
1272
+ };
1273
+ const InfoParagraph = ({ children }) => {
1274
+ return /* @__PURE__ */ u$1("p", { className: "text-justify my-1", children });
1275
+ };
1276
+ const InfoLink = ({ children, href }) => {
1277
+ return /* @__PURE__ */ u$1("a", { className: "text-blue-600 hover:text-blue-800", href, target: "_blank", rel: "noopener noreferrer", children });
1191
1278
  };
1192
1279
  const LoadingDisplay = () => {
1193
1280
  return /* @__PURE__ */ u$1("div", { children: "Loading..." });
@@ -1379,30 +1466,51 @@ const ProportionSelectorDropdown = ({
1379
1466
  ) }) })
1380
1467
  ] });
1381
1468
  };
1469
+ const ResizeContainer = ({ children, size, defaultSize }) => {
1470
+ return /* @__PURE__ */ u$1("div", { style: extendByDefault(size, defaultSize), children });
1471
+ };
1472
+ const extendByDefault = (size, defaultSize) => {
1473
+ if (size === void 0) {
1474
+ return defaultSize;
1475
+ }
1476
+ return { ...defaultSize, ...size };
1477
+ };
1382
1478
  const Tabs = ({ tabs, toolbar }) => {
1383
1479
  const [activeTab, setActiveTab] = p(tabs[0].title);
1384
- const tabNames = tabs.map((tab) => tab.title).join(", ");
1385
- const tabElements = tabs.map((tab) => {
1386
- return /* @__PURE__ */ u$1(Fragment, { children: [
1387
- /* @__PURE__ */ u$1(
1388
- "input",
1389
- {
1390
- type: "radio",
1391
- name: tabNames,
1392
- role: "tab",
1393
- className: "tab",
1394
- "aria-label": tab.title,
1395
- checked: activeTab === tab.title,
1396
- onChange: () => setActiveTab(tab.title)
1397
- }
1398
- ),
1399
- /* @__PURE__ */ u$1("div", { role: "tabpanel", className: "tab-content bg-base-100 border-base-300 rounded-box p-1", children: tab.content })
1400
- ] }, tab.title);
1401
- });
1480
+ const [heightOfTabs, setHeightOfTabs] = p("3rem");
1481
+ const tabRef = F(null);
1482
+ _(() => {
1483
+ if (tabRef.current) {
1484
+ const heightOfTabs2 = tabRef.current.getBoundingClientRect().height;
1485
+ setHeightOfTabs(`${heightOfTabs2}px`);
1486
+ }
1487
+ }, []);
1488
+ const tabElements = /* @__PURE__ */ u$1("div", { className: "flex flex-row", children: tabs.map((tab) => {
1489
+ return /* @__PURE__ */ u$1(Fragment, { children: /* @__PURE__ */ u$1(
1490
+ "button",
1491
+ {
1492
+ className: `px-4 py-2 text-sm font-medium leading-5 transition-colors duration-150 ${activeTab === tab.title ? "border-b-2 border-gray-400" : "text-gray-600 hover:bg-gray-100 hover:text-gray-700"}`,
1493
+ onClick: () => {
1494
+ setActiveTab(tab.title);
1495
+ },
1496
+ children: tab.title
1497
+ }
1498
+ ) }, tab.title);
1499
+ }) });
1402
1500
  const toolbarElement = typeof toolbar === "function" ? toolbar(activeTab) : toolbar;
1403
- return /* @__PURE__ */ u$1("div", { role: "tablist", className: "tabs tabs-lifted", children: [
1404
- tabElements,
1405
- toolbar && /* @__PURE__ */ u$1("div", { className: "m-1 col-[9999]", children: toolbarElement })
1501
+ return /* @__PURE__ */ u$1("div", { className: "h-full w-full", children: [
1502
+ /* @__PURE__ */ u$1("div", { ref: tabRef, className: "flex flex-row justify-between", children: [
1503
+ tabElements,
1504
+ toolbar && /* @__PURE__ */ u$1("div", { className: "py-2", children: toolbarElement })
1505
+ ] }),
1506
+ /* @__PURE__ */ u$1(
1507
+ "div",
1508
+ {
1509
+ className: `p-2 border-2 border-gray-100 rounded-b-md rounded-tr-md ${activeTab === tabs[0].title ? "" : "rounded-tl-md"}`,
1510
+ style: { height: `calc(100% - ${heightOfTabs})` },
1511
+ children: tabs.map((tab) => /* @__PURE__ */ u$1("div", { className: "h-full overflow-auto", hidden: activeTab !== tab.title, children: tab.content }, tab.title))
1512
+ }
1513
+ )
1406
1514
  ] });
1407
1515
  };
1408
1516
  function useQuery(fetchDataCallback, dependencies = []) {
@@ -1426,12 +1534,17 @@ function useQuery(fetchDataCallback, dependencies = []) {
1426
1534
  }, [JSON.stringify(dependencies)]);
1427
1535
  return { data, error, isLoading };
1428
1536
  }
1429
- const MutationComparison = ({ variants, sequenceType, views }) => {
1537
+ const MutationComparison = ({
1538
+ variants,
1539
+ sequenceType,
1540
+ views,
1541
+ size,
1542
+ headline = "Mutation comparison"
1543
+ }) => {
1430
1544
  const lapis = P(LapisUrlContext);
1431
1545
  const { data, error, isLoading } = useQuery(async () => {
1432
1546
  return queryMutationData(variants, sequenceType, lapis);
1433
1547
  }, [variants, sequenceType, lapis]);
1434
- const headline = "Mutation comparison";
1435
1548
  if (isLoading) {
1436
1549
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
1437
1550
  }
@@ -1441,7 +1554,7 @@ const MutationComparison = ({ variants, sequenceType, views }) => {
1441
1554
  if (data === null) {
1442
1555
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
1443
1556
  }
1444
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonTabs, { data: data.mutationData, sequenceType, views }) });
1557
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonTabs, { data: data.mutationData, sequenceType, views }) }) });
1445
1558
  };
1446
1559
  const MutationComparisonTabs = ({ data, views, sequenceType }) => {
1447
1560
  const [proportionInterval, setProportionInterval] = p({ min: 0.5, max: 1 });
@@ -1534,7 +1647,7 @@ const Toolbar$3 = ({
1534
1647
  filename: "mutation_comparison.csv"
1535
1648
  }
1536
1649
  ),
1537
- /* @__PURE__ */ u$1(Info, { className: "mx-1", content: "Info for mutation comparison" })
1650
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutation comparison" })
1538
1651
  ] });
1539
1652
  };
1540
1653
  const gridJsStyle = '.gridjs-head button, .gridjs-footer button {\n cursor: pointer;\n background-color: transparent;\n background-image: none;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n}\n\n.gridjs-temp {\n position: relative;\n}\n\n.gridjs-head {\n width: 100%;\n margin-bottom: 5px;\n padding: 5px 1px;\n}\n.gridjs-head::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-head:empty {\n padding: 0;\n border: none;\n}\n\n.gridjs-container {\n overflow: hidden;\n display: inline-block;\n padding: 2px;\n color: #000;\n position: relative;\n z-index: 0;\n}\n\n.gridjs-footer {\n display: block;\n position: relative;\n width: 100%;\n z-index: 5;\n padding: 12px 24px;\n border-top: 1px solid #e5e7eb;\n background-color: #fff;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 0 0 8px 8px;\n border-bottom-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-footer:empty {\n padding: 0;\n border: none;\n}\n\ninput.gridjs-input {\n outline: none;\n background-color: #fff;\n border: 1px solid #d2d6dc;\n border-radius: 5px;\n padding: 10px 13px;\n font-size: 14px;\n line-height: 1.45;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\ninput.gridjs-input:focus {\n box-shadow: 0 0 0 3px rgba(149, 189, 243, 0.5);\n border-color: #9bc2f7;\n}\n\n.gridjs-pagination {\n color: #3d4044;\n}\n.gridjs-pagination::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-pagination .gridjs-summary {\n float: left;\n margin-top: 5px;\n}\n.gridjs-pagination .gridjs-pages {\n float: right;\n}\n.gridjs-pagination .gridjs-pages button {\n padding: 5px 14px;\n border: 1px solid #d2d6dc;\n background-color: #fff;\n border-right: none;\n outline: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.gridjs-pagination .gridjs-pages button:focus {\n box-shadow: 0 0 0 2px rgba(149, 189, 243, 0.5);\n position: relative;\n margin-right: -1px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:hover {\n background-color: #f7f7f7;\n color: rgb(60, 66, 87);\n outline: none;\n}\n.gridjs-pagination .gridjs-pages button:disabled,\n.gridjs-pagination .gridjs-pages button[disabled],\n.gridjs-pagination .gridjs-pages button:hover:disabled {\n cursor: default;\n background-color: #fff;\n color: #6b7280;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-spread {\n cursor: default;\n box-shadow: none;\n background-color: #fff;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-currentPage {\n background-color: #f7f7f7;\n font-weight: bold;\n}\n.gridjs-pagination .gridjs-pages button:last-child {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:first-child {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.gridjs-pagination .gridjs-pages button:last-child:focus {\n margin-right: 0;\n}\n\nbutton.gridjs-sort {\n float: right;\n height: 24px;\n width: 13px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position-x: center;\n cursor: pointer;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background-size: contain;\n}\nbutton.gridjs-sort-neutral {\n opacity: 0.3;\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSI0MDEuOTk4cHgiIGhlaWdodD0iNDAxLjk5OHB4IiB2aWV3Qm94PSIwIDAgNDAxLjk5OCA0MDEuOTk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDEuOTk4IDQwMS45OTg7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnPgoJCTxwYXRoIGQ9Ik03My4wOTIsMTY0LjQ1MmgyNTUuODEzYzQuOTQ5LDAsOS4yMzMtMS44MDcsMTIuODQ4LTUuNDI0YzMuNjEzLTMuNjE2LDUuNDI3LTcuODk4LDUuNDI3LTEyLjg0NwoJCQljMC00Ljk0OS0xLjgxMy05LjIyOS01LjQyNy0xMi44NUwyMTMuODQ2LDUuNDI0QzIxMC4yMzIsMS44MTIsMjA1Ljk1MSwwLDIwMC45OTksMHMtOS4yMzMsMS44MTItMTIuODUsNS40MjRMNjAuMjQyLDEzMy4zMzEKCQkJYy0zLjYxNywzLjYxNy01LjQyNCw3LjkwMS01LjQyNCwxMi44NWMwLDQuOTQ4LDEuODA3LDkuMjMxLDUuNDI0LDEyLjg0N0M2My44NjMsMTYyLjY0NSw2OC4xNDQsMTY0LjQ1Miw3My4wOTIsMTY0LjQ1MnoiLz4KCQk8cGF0aCBkPSJNMzI4LjkwNSwyMzcuNTQ5SDczLjA5MmMtNC45NTIsMC05LjIzMywxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MTctNS40MjQsNy44OTgtNS40MjQsMTIuODQ3CgkJCWMwLDQuOTQ5LDEuODA3LDkuMjMzLDUuNDI0LDEyLjg0OEwxODguMTQ5LDM5Ni41N2MzLjYyMSwzLjYxNyw3LjkwMiw1LjQyOCwxMi44NSw1LjQyOHM5LjIzMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNy0xMjcuOTA2CgkJCWMzLjYxMy0zLjYxNCw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDhjMC00Ljk0OC0xLjgxMy05LjIyOS01LjQyNy0xMi44NDdDMzM4LjEzOSwyMzkuMzUzLDMzMy44NTQsMjM3LjU0OSwzMjguOTA1LDIzNy41NDl6Ii8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: center;\n}\nbutton.gridjs-sort-asc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MXB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYxIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjE7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDE5Ny4yODdMMTU5LjAyOCw2OS4zODFjLTMuNjEzLTMuNjE3LTcuODk1LTUuNDI0LTEyLjg0Ny01LjQyNHMtOS4yMzMsMS44MDctMTIuODUsNS40MjRMNS40MjQsMTk3LjI4NwoJCUMxLjgwNywyMDAuOTA0LDAsMjA1LjE4NiwwLDIxMC4xMzRzMS44MDcsOS4yMzMsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI1LDEyLjg1LDUuNDI1aDI1NS44MTMKCQljNC45NDksMCw5LjIzMy0xLjgwOCwxMi44NDgtNS40MjVjMy42MTMtMy42MTMsNS40MjctNy44OTgsNS40MjctMTIuODQ3UzI5MC41NDgsMjAwLjkwNCwyODYuOTM1LDE5Ny4yODd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 35%;\n background-size: 10px;\n}\nbutton.gridjs-sort-desc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MnB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjI7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDY5LjM3N2MtMy42MTQtMy42MTctNy44OTgtNS40MjQtMTIuODQ4LTUuNDI0SDE4LjI3NGMtNC45NTIsMC05LjIzMywxLjgwNy0xMi44NSw1LjQyNAoJCUMxLjgwNyw3Mi45OTgsMCw3Ny4yNzksMCw4Mi4yMjhjMCw0Ljk0OCwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDdsMTI3LjkwNywxMjcuOTA3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4CgkJczkuMjMzLTEuODExLDEyLjg0Ny01LjQyOEwyODYuOTM1LDk1LjA3NGMzLjYxMy0zLjYxNyw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDdDMjkyLjM2Miw3Ny4yNzksMjkwLjU0OCw3Mi45OTgsMjg2LjkzNSw2OS4zNzd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 65%;\n background-size: 10px;\n}\nbutton.gridjs-sort:focus {\n outline: none;\n}\n\ntable.gridjs-table {\n width: 100%;\n max-width: 100%;\n border-collapse: collapse;\n text-align: left;\n display: table;\n margin: 0;\n padding: 0;\n overflow: auto;\n table-layout: fixed;\n}\n\n.gridjs-tbody {\n background-color: #fff;\n}\n\ntd.gridjs-td {\n border: 1px solid #e5e7eb;\n padding: 12px 24px;\n background-color: #fff;\n box-sizing: content-box;\n}\ntd.gridjs-td:first-child {\n border-left: none;\n}\ntd.gridjs-td:last-child {\n border-right: none;\n}\ntd.gridjs-message {\n text-align: center;\n}\n\nth.gridjs-th {\n position: relative;\n color: #6b7280;\n background-color: #f9fafb;\n border: 1px solid #e5e7eb;\n border-top: none;\n padding: 14px 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n white-space: nowrap;\n outline: none;\n vertical-align: middle;\n}\nth.gridjs-th .gridjs-th-content {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 100%;\n float: left;\n}\nth.gridjs-th-sort {\n cursor: pointer;\n}\nth.gridjs-th-sort .gridjs-th-content {\n width: calc(100% - 15px);\n}\nth.gridjs-th-sort:hover {\n background-color: #e5e7eb;\n}\nth.gridjs-th-sort:focus {\n background-color: #e5e7eb;\n}\nth.gridjs-th-fixed {\n position: sticky;\n box-shadow: 0 1px 0 0 #e5e7eb;\n}\n@supports (-moz-appearance: none) {\n th.gridjs-th-fixed {\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n}\nth.gridjs-th:first-child {\n border-left: none;\n}\nth.gridjs-th:last-child {\n border-right: none;\n}\n\n.gridjs-tr {\n border: none;\n}\n.gridjs-tr-selected td {\n background-color: #ebf5ff;\n}\n.gridjs-tr:last-child td {\n border-bottom: 0;\n}\n\n.gridjs *,\n.gridjs :after,\n.gridjs :before {\n box-sizing: border-box;\n}\n\n.gridjs-wrapper {\n position: relative;\n z-index: 1;\n overflow: auto;\n width: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 8px 8px 0 0;\n display: block;\n border-top-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-wrapper:nth-last-of-type(2) {\n border-radius: 8px;\n border-bottom-width: 1px;\n}\n\n.gridjs-search {\n float: left;\n}\n.gridjs-search-input {\n width: 250px;\n}\n\n.gridjs-loading-bar {\n z-index: 10;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: #fff;\n opacity: 0.5;\n}\n.gridjs-loading-bar::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(204, 204, 204, 0) 0, rgba(204, 204, 204, 0.2) 20%, rgba(204, 204, 204, 0.5) 60%, rgba(204, 204, 204, 0));\n animation: shimmer 2s infinite;\n content: "";\n}\n@keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.gridjs-td .gridjs-checkbox {\n display: block;\n margin: auto;\n cursor: pointer;\n}\n\n.gridjs-resizable {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 5px;\n}\n.gridjs-resizable:hover {\n cursor: ew-resize;\n background-color: #9bc2f7;\n}\n/*# sourceMappingURL=mermaid.css?inline.map */';
@@ -2032,108 +2145,6 @@ html {
2032
2145
  --bc: 27.8078% 0.029596 256.847952;
2033
2146
  }
2034
2147
 
2035
- @media (prefers-color-scheme: dark) {
2036
-
2037
- :root {
2038
- color-scheme: dark;
2039
- --in: 72.06% 0.191 231.6;
2040
- --su: 64.8% 0.150 160;
2041
- --wa: 84.71% 0.199 83.87;
2042
- --er: 71.76% 0.221 22.18;
2043
- --pc: 13.138% 0.0392 275.75;
2044
- --sc: 14.96% 0.052 342.55;
2045
- --ac: 14.902% 0.0334 183.61;
2046
- --inc: 0% 0 0;
2047
- --suc: 0% 0 0;
2048
- --wac: 0% 0 0;
2049
- --erc: 0% 0 0;
2050
- --rounded-box: 1rem;
2051
- --rounded-btn: 0.5rem;
2052
- --rounded-badge: 1.9rem;
2053
- --animation-btn: 0.25s;
2054
- --animation-input: .2s;
2055
- --btn-focus-scale: 0.95;
2056
- --border-btn: 1px;
2057
- --tab-border: 1px;
2058
- --tab-radius: 0.5rem;
2059
- --p: 65.69% 0.196 275.75;
2060
- --s: 74.8% 0.26 342.55;
2061
- --a: 74.51% 0.167 183.61;
2062
- --n: 31.3815% 0.021108 254.139175;
2063
- --nc: 74.6477% 0.0216 264.435964;
2064
- --b1: 25.3267% 0.015896 252.417568;
2065
- --b2: 23.2607% 0.013807 253.100675;
2066
- --b3: 21.1484% 0.01165 254.087939;
2067
- --bc: 74.6477% 0.0216 264.435964;
2068
- }
2069
- }
2070
-
2071
- [data-theme=light] {
2072
- color-scheme: light;
2073
- --in: 72.06% 0.191 231.6;
2074
- --su: 64.8% 0.150 160;
2075
- --wa: 84.71% 0.199 83.87;
2076
- --er: 71.76% 0.221 22.18;
2077
- --pc: 89.824% 0.06192 275.75;
2078
- --ac: 15.352% 0.0368 183.61;
2079
- --inc: 0% 0 0;
2080
- --suc: 0% 0 0;
2081
- --wac: 0% 0 0;
2082
- --erc: 0% 0 0;
2083
- --rounded-box: 1rem;
2084
- --rounded-btn: 0.5rem;
2085
- --rounded-badge: 1.9rem;
2086
- --animation-btn: 0.25s;
2087
- --animation-input: .2s;
2088
- --btn-focus-scale: 0.95;
2089
- --border-btn: 1px;
2090
- --tab-border: 1px;
2091
- --tab-radius: 0.5rem;
2092
- --p: 49.12% 0.3096 275.75;
2093
- --s: 69.71% 0.329 342.55;
2094
- --sc: 98.71% 0.0106 342.55;
2095
- --a: 76.76% 0.184 183.61;
2096
- --n: 32.1785% 0.02476 255.701624;
2097
- --nc: 89.4994% 0.011585 252.096176;
2098
- --b1: 100% 0 0;
2099
- --b2: 96.1151% 0 0;
2100
- --b3: 92.4169% 0.00108 197.137559;
2101
- --bc: 27.8078% 0.029596 256.847952;
2102
- }
2103
-
2104
- [data-theme=dark] {
2105
- color-scheme: dark;
2106
- --in: 72.06% 0.191 231.6;
2107
- --su: 64.8% 0.150 160;
2108
- --wa: 84.71% 0.199 83.87;
2109
- --er: 71.76% 0.221 22.18;
2110
- --pc: 13.138% 0.0392 275.75;
2111
- --sc: 14.96% 0.052 342.55;
2112
- --ac: 14.902% 0.0334 183.61;
2113
- --inc: 0% 0 0;
2114
- --suc: 0% 0 0;
2115
- --wac: 0% 0 0;
2116
- --erc: 0% 0 0;
2117
- --rounded-box: 1rem;
2118
- --rounded-btn: 0.5rem;
2119
- --rounded-badge: 1.9rem;
2120
- --animation-btn: 0.25s;
2121
- --animation-input: .2s;
2122
- --btn-focus-scale: 0.95;
2123
- --border-btn: 1px;
2124
- --tab-border: 1px;
2125
- --tab-radius: 0.5rem;
2126
- --p: 65.69% 0.196 275.75;
2127
- --s: 74.8% 0.26 342.55;
2128
- --a: 74.51% 0.167 183.61;
2129
- --n: 31.3815% 0.021108 254.139175;
2130
- --nc: 74.6477% 0.0216 264.435964;
2131
- --b1: 25.3267% 0.015896 252.417568;
2132
- --b2: 23.2607% 0.013807 253.100675;
2133
- --b3: 21.1484% 0.01165 254.087939;
2134
- --bc: 74.6477% 0.0216 264.435964;
2135
- }
2136
-
2137
2148
  *, ::before, ::after {
2138
2149
  --tw-border-spacing-x: 0;
2139
2150
  --tw-border-spacing-y: 0;
@@ -2241,6 +2252,39 @@ html {
2241
2252
  --tw-contain-paint: ;
2242
2253
  --tw-contain-style: ;
2243
2254
  }
2255
+ .container {
2256
+ width: 100%;
2257
+ }
2258
+ @media (min-width: 640px) {
2259
+
2260
+ .container {
2261
+ max-width: 640px;
2262
+ }
2263
+ }
2264
+ @media (min-width: 768px) {
2265
+
2266
+ .container {
2267
+ max-width: 768px;
2268
+ }
2269
+ }
2270
+ @media (min-width: 1024px) {
2271
+
2272
+ .container {
2273
+ max-width: 1024px;
2274
+ }
2275
+ }
2276
+ @media (min-width: 1280px) {
2277
+
2278
+ .container {
2279
+ max-width: 1280px;
2280
+ }
2281
+ }
2282
+ @media (min-width: 1536px) {
2283
+
2284
+ .container {
2285
+ max-width: 1536px;
2286
+ }
2287
+ }
2244
2288
  .avatar.placeholder > div {
2245
2289
  display: flex;
2246
2290
  align-items: center;
@@ -2298,7 +2342,6 @@ html {
2298
2342
  transition-duration: 200ms;
2299
2343
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
2300
2344
  border-width: var(--border-btn, 1px);
2301
- animation: button-pop var(--animation-btn, 0.25s) ease-out;
2302
2345
  transition-property: color, background-color, border-color, opacity, box-shadow, transform;
2303
2346
  --tw-text-opacity: 1;
2304
2347
  color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
@@ -2773,6 +2816,14 @@ html {
2773
2816
  z-index: 3;
2774
2817
  opacity: 1;
2775
2818
  }
2819
+ .steps {
2820
+ display: inline-grid;
2821
+ grid-auto-flow: column;
2822
+ overflow: hidden;
2823
+ overflow-x: auto;
2824
+ counter-reset: step;
2825
+ grid-auto-columns: 1fr;
2826
+ }
2776
2827
  .steps .step {
2777
2828
  display: grid;
2778
2829
  grid-template-columns: repeat(1, minmax(0, 1fr));
@@ -2787,8 +2838,7 @@ html {
2787
2838
  display: grid;
2788
2839
  align-items: flex-end;
2789
2840
  }
2790
- .tabs-lifted:has(.tab-content[class^="rounded-"]) .tab:first-child:not(.tab-active),
2791
- .tabs-lifted:has(.tab-content[class*=" rounded-"]) .tab:first-child:not(.tab-active) {
2841
+ .tabs-lifted:has(.tab-content[class^="rounded-"]) .tab:first-child:not(:is(.tab-active, [aria-selected="true"])), .tabs-lifted:has(.tab-content[class*=" rounded-"]) .tab:first-child:not(:is(.tab-active, [aria-selected="true"])) {
2792
2842
  border-bottom-color: transparent;
2793
2843
  }
2794
2844
  .tab {
@@ -2832,21 +2882,8 @@ html {
2832
2882
  cursor: default;
2833
2883
  grid-column-start: span 9999;
2834
2884
  }
2835
- .tab-content {
2836
- grid-column-start: 1;
2837
- grid-column-end: span 9999;
2838
- grid-row-start: 2;
2839
- margin-top: calc(var(--tab-border) * -1);
2840
- display: none;
2841
- border-color: transparent;
2842
- border-width: var(--tab-border, 0);
2843
- }
2844
- :checked + .tab-content:nth-child(2),
2845
- .tab-active + .tab-content:nth-child(2) {
2846
- border-start-start-radius: 0px;
2847
- }
2848
2885
  input.tab:checked + .tab-content,
2849
- .tab-active + .tab-content {
2886
+ :is(.tab-active, [aria-selected="true"]) + .tab-content {
2850
2887
  display: block;
2851
2888
  }
2852
2889
  .table {
@@ -2891,6 +2928,12 @@ input.tab:checked + .tab-content,
2891
2928
  font-size: 1rem;
2892
2929
  line-height: 1.5rem;
2893
2930
  }
2931
+ @media (prefers-reduced-motion: no-preference) {
2932
+
2933
+ .btn {
2934
+ animation: button-pop var(--animation-btn, 0.25s) ease-out;
2935
+ }
2936
+ }
2894
2937
  .btn:active:hover,
2895
2938
  .btn:active:focus {
2896
2939
  animation: button-pop 0s ease-out;
@@ -2992,6 +3035,14 @@ input.tab:checked + .tab-content,
2992
3035
  outline-offset: 2px;
2993
3036
  outline-color: var(--fallback-bc,oklch(var(--bc)/1));
2994
3037
  }
3038
+ .checkbox:disabled {
3039
+ border-width: 0px;
3040
+ cursor: not-allowed;
3041
+ border-color: transparent;
3042
+ --tw-bg-opacity: 1;
3043
+ background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
3044
+ opacity: 0.2;
3045
+ }
2995
3046
  .checkbox:checked,
2996
3047
  .checkbox[aria-checked="true"] {
2997
3048
  background-repeat: no-repeat;
@@ -3018,13 +3069,6 @@ input.tab:checked + .tab-content,
3018
3069
  linear-gradient(-90deg, transparent 80%, var(--chkbg) 80%),
3019
3070
  linear-gradient(0deg, var(--chkbg) 43%, var(--chkfg) 43%, var(--chkfg) 57%, var(--chkbg) 57%);
3020
3071
  }
3021
- .checkbox:disabled {
3022
- cursor: not-allowed;
3023
- border-color: transparent;
3024
- --tw-bg-opacity: 1;
3025
- background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
3026
- opacity: 0.2;
3027
- }
3028
3072
  @keyframes checkmark {
3029
3073
 
3030
3074
  0% {
@@ -3080,7 +3124,8 @@ input.tab:checked + .tab-content,
3080
3124
  border-color: var(--fallback-er,oklch(var(--er)/var(--tw-border-opacity)));
3081
3125
  outline-color: var(--fallback-er,oklch(var(--er)/1));
3082
3126
  }
3083
- .input-disabled,
3127
+ .input:has(> input[disabled]),
3128
+ .input-disabled,
3084
3129
  .input:disabled,
3085
3130
  .input[disabled] {
3086
3131
  cursor: not-allowed;
@@ -3090,16 +3135,20 @@ input.tab:checked + .tab-content,
3090
3135
  background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
3091
3136
  color: var(--fallback-bc,oklch(var(--bc)/0.4));
3092
3137
  }
3093
- .input-disabled::-moz-placeholder, .input:disabled::-moz-placeholder, .input[disabled]::-moz-placeholder {
3138
+ .input:has(> input[disabled])::-moz-placeholder, .input-disabled::-moz-placeholder, .input:disabled::-moz-placeholder, .input[disabled]::-moz-placeholder {
3094
3139
  color: var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));
3095
3140
  --tw-placeholder-opacity: 0.2;
3096
3141
  }
3097
- .input-disabled::placeholder,
3142
+ .input:has(> input[disabled])::placeholder,
3143
+ .input-disabled::placeholder,
3098
3144
  .input:disabled::placeholder,
3099
3145
  .input[disabled]::placeholder {
3100
3146
  color: var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));
3101
3147
  --tw-placeholder-opacity: 0.2;
3102
3148
  }
3149
+ .input:has(> input[disabled]) > input[disabled] {
3150
+ cursor: not-allowed;
3151
+ }
3103
3152
  .input::-webkit-date-and-time-value {
3104
3153
  text-align: inherit;
3105
3154
  }
@@ -3126,6 +3175,13 @@ input.tab:checked + .tab-content,
3126
3175
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
3127
3176
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
3128
3177
  }
3178
+ .loading-spinner {
3179
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
3180
+ mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
3181
+ }
3182
+ .loading-md {
3183
+ width: 1.5rem;
3184
+ }
3129
3185
  :where(.menu li:empty) {
3130
3186
  --tw-bg-opacity: 1;
3131
3187
  background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
@@ -3455,12 +3511,79 @@ input.tab:checked + .tab-content,
3455
3511
  .steps .step[data-content]:after {
3456
3512
  content: attr(data-content);
3457
3513
  }
3514
+ .steps .step-neutral + .step-neutral:before,
3515
+ .steps .step-neutral:after {
3516
+ --tw-bg-opacity: 1;
3517
+ background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
3518
+ --tw-text-opacity: 1;
3519
+ color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
3520
+ }
3521
+ .steps .step-primary + .step-primary:before,
3522
+ .steps .step-primary:after {
3523
+ --tw-bg-opacity: 1;
3524
+ background-color: var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));
3525
+ --tw-text-opacity: 1;
3526
+ color: var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));
3527
+ }
3528
+ .steps .step-secondary + .step-secondary:before,
3529
+ .steps .step-secondary:after {
3530
+ --tw-bg-opacity: 1;
3531
+ background-color: var(--fallback-s,oklch(var(--s)/var(--tw-bg-opacity)));
3532
+ --tw-text-opacity: 1;
3533
+ color: var(--fallback-sc,oklch(var(--sc)/var(--tw-text-opacity)));
3534
+ }
3535
+ .steps .step-accent + .step-accent:before,
3536
+ .steps .step-accent:after {
3537
+ --tw-bg-opacity: 1;
3538
+ background-color: var(--fallback-a,oklch(var(--a)/var(--tw-bg-opacity)));
3539
+ --tw-text-opacity: 1;
3540
+ color: var(--fallback-ac,oklch(var(--ac)/var(--tw-text-opacity)));
3541
+ }
3542
+ .steps .step-info + .step-info:before {
3543
+ --tw-bg-opacity: 1;
3544
+ background-color: var(--fallback-in,oklch(var(--in)/var(--tw-bg-opacity)));
3545
+ }
3546
+ .steps .step-info:after {
3547
+ --tw-bg-opacity: 1;
3548
+ background-color: var(--fallback-in,oklch(var(--in)/var(--tw-bg-opacity)));
3549
+ --tw-text-opacity: 1;
3550
+ color: var(--fallback-inc,oklch(var(--inc)/var(--tw-text-opacity)));
3551
+ }
3552
+ .steps .step-success + .step-success:before {
3553
+ --tw-bg-opacity: 1;
3554
+ background-color: var(--fallback-su,oklch(var(--su)/var(--tw-bg-opacity)));
3555
+ }
3556
+ .steps .step-success:after {
3557
+ --tw-bg-opacity: 1;
3558
+ background-color: var(--fallback-su,oklch(var(--su)/var(--tw-bg-opacity)));
3559
+ --tw-text-opacity: 1;
3560
+ color: var(--fallback-suc,oklch(var(--suc)/var(--tw-text-opacity)));
3561
+ }
3562
+ .steps .step-warning + .step-warning:before {
3563
+ --tw-bg-opacity: 1;
3564
+ background-color: var(--fallback-wa,oklch(var(--wa)/var(--tw-bg-opacity)));
3565
+ }
3566
+ .steps .step-warning:after {
3567
+ --tw-bg-opacity: 1;
3568
+ background-color: var(--fallback-wa,oklch(var(--wa)/var(--tw-bg-opacity)));
3569
+ --tw-text-opacity: 1;
3570
+ color: var(--fallback-wac,oklch(var(--wac)/var(--tw-text-opacity)));
3571
+ }
3572
+ .steps .step-error + .step-error:before {
3573
+ --tw-bg-opacity: 1;
3574
+ background-color: var(--fallback-er,oklch(var(--er)/var(--tw-bg-opacity)));
3575
+ }
3576
+ .steps .step-error:after {
3577
+ --tw-bg-opacity: 1;
3578
+ background-color: var(--fallback-er,oklch(var(--er)/var(--tw-bg-opacity)));
3579
+ --tw-text-opacity: 1;
3580
+ color: var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)));
3581
+ }
3458
3582
  .tabs-lifted > .tab:focus-visible {
3459
3583
  border-end-end-radius: 0;
3460
3584
  border-end-start-radius: 0;
3461
3585
  }
3462
- .tab.tab-active:not(.tab-disabled):not([disabled]),
3463
- .tab:is(input:checked) {
3586
+ .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]), .tab:is(input:checked) {
3464
3587
  border-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));
3465
3588
  --tw-border-opacity: 1;
3466
3589
  --tw-text-opacity: 1;
@@ -3495,8 +3618,7 @@ input.tab:checked + .tab-content,
3495
3618
  padding-inline-end: var(--tab-padding, 1rem);
3496
3619
  padding-top: var(--tab-border, 1px);
3497
3620
  }
3498
- .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]),
3499
- .tabs-lifted > .tab:is(input:checked) {
3621
+ .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]), .tabs-lifted > .tab:is(input:checked) {
3500
3622
  background-color: var(--tab-bg);
3501
3623
  border-width: var(--tab-border, 1px) var(--tab-border, 1px) 0 var(--tab-border, 1px);
3502
3624
  border-inline-start-color: var(--tab-border-color);
@@ -3507,7 +3629,7 @@ input.tab:checked + .tab-content,
3507
3629
  padding-bottom: var(--tab-border, 1px);
3508
3630
  padding-top: 0;
3509
3631
  }
3510
- .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]):before, .tabs-lifted > .tab:is(input:checked):before {
3632
+ .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):before, .tabs-lifted > .tab:is(input:checked):before {
3511
3633
  z-index: 1;
3512
3634
  content: "";
3513
3635
  display: block;
@@ -3536,26 +3658,26 @@ input.tab:checked + .tab-content,
3536
3658
  );
3537
3659
  background-image: var(--radius-start), var(--radius-end);
3538
3660
  }
3539
- .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]):first-child:before, .tabs-lifted > .tab:is(input:checked):first-child:before {
3661
+ .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):first-child:before, .tabs-lifted > .tab:is(input:checked):first-child:before {
3540
3662
  background-image: var(--radius-end);
3541
3663
  background-position: top right;
3542
3664
  }
3543
- [dir="rtl"] .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]):first-child:before, [dir="rtl"] .tabs-lifted > .tab:is(input:checked):first-child:before {
3665
+ [dir="rtl"] .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):first-child:before, [dir="rtl"] .tabs-lifted > .tab:is(input:checked):first-child:before {
3544
3666
  background-image: var(--radius-start);
3545
3667
  background-position: top left;
3546
3668
  }
3547
- .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]):last-child:before, .tabs-lifted > .tab:is(input:checked):last-child:before {
3669
+ .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):last-child:before, .tabs-lifted > .tab:is(input:checked):last-child:before {
3548
3670
  background-image: var(--radius-start);
3549
3671
  background-position: top left;
3550
3672
  }
3551
- [dir="rtl"] .tabs-lifted > .tab.tab-active:not(.tab-disabled):not([disabled]):last-child:before, [dir="rtl"] .tabs-lifted > .tab:is(input:checked):last-child:before {
3673
+ [dir="rtl"] .tabs-lifted > .tab:is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):last-child:before, [dir="rtl"] .tabs-lifted > .tab:is(input:checked):last-child:before {
3552
3674
  background-image: var(--radius-end);
3553
3675
  background-position: top right;
3554
3676
  }
3555
3677
  .tabs-lifted
3556
- > .tab-active:not(.tab-disabled):not([disabled])
3678
+ > :is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled])
3557
3679
  + .tabs-lifted
3558
- .tab-active:not(.tab-disabled):not([disabled]):before, .tabs-lifted > .tab:is(input:checked) + .tabs-lifted .tab:is(input:checked):before {
3680
+ :is(.tab-active, [aria-selected="true"]):not(.tab-disabled):not([disabled]):before, .tabs-lifted > .tab:is(input:checked) + .tabs-lifted .tab:is(input:checked):before {
3559
3681
  background-image: var(--radius-end);
3560
3682
  background-position: top right;
3561
3683
  }
@@ -3876,17 +3998,23 @@ input.tab:checked + .tab-content,
3876
3998
  .static {
3877
3999
  position: static;
3878
4000
  }
4001
+ .absolute {
4002
+ position: absolute;
4003
+ }
3879
4004
  .relative {
3880
4005
  position: relative;
3881
4006
  }
3882
- .z-\\[1\\] {
3883
- z-index: 1;
4007
+ .right-6 {
4008
+ right: 1.5rem;
4009
+ }
4010
+ .top-8 {
4011
+ top: 2rem;
3884
4012
  }
3885
- .col-\\[9999\\] {
3886
- grid-column: 9999;
4013
+ .z-50 {
4014
+ z-index: 50;
3887
4015
  }
3888
- .m-1 {
3889
- margin: 0.25rem;
4016
+ .z-\\[1\\] {
4017
+ z-index: 1;
3890
4018
  }
3891
4019
  .m-2 {
3892
4020
  margin: 0.5rem;
@@ -3921,6 +4049,9 @@ input.tab:checked + .tab-content,
3921
4049
  .mt-2 {
3922
4050
  margin-top: 0.5rem;
3923
4051
  }
4052
+ .mt-4 {
4053
+ margin-top: 1rem;
4054
+ }
3924
4055
  .inline {
3925
4056
  display: inline;
3926
4057
  }
@@ -3933,8 +4064,11 @@ input.tab:checked + .tab-content,
3933
4064
  .grid {
3934
4065
  display: grid;
3935
4066
  }
3936
- .w-11\\/12 {
3937
- width: 91.666667%;
4067
+ .hidden {
4068
+ display: none;
4069
+ }
4070
+ .h-full {
4071
+ height: 100%;
3938
4072
  }
3939
4073
  .w-16 {
3940
4074
  width: 4rem;
@@ -3957,6 +4091,9 @@ input.tab:checked + .tab-content,
3957
4091
  .max-w-screen-lg {
3958
4092
  max-width: 1024px;
3959
4093
  }
4094
+ .flex-1 {
4095
+ flex: 1 1 0%;
4096
+ }
3960
4097
  .grow {
3961
4098
  flex-grow: 1;
3962
4099
  }
@@ -3975,15 +4112,24 @@ input.tab:checked + .tab-content,
3975
4112
  .items-center {
3976
4113
  align-items: center;
3977
4114
  }
4115
+ .justify-end {
4116
+ justify-content: flex-end;
4117
+ }
3978
4118
  .justify-center {
3979
4119
  justify-content: center;
3980
4120
  }
4121
+ .justify-between {
4122
+ justify-content: space-between;
4123
+ }
3981
4124
  .gap-1 {
3982
4125
  gap: 0.25rem;
3983
4126
  }
3984
4127
  .gap-2 {
3985
4128
  gap: 0.5rem;
3986
4129
  }
4130
+ .overflow-auto {
4131
+ overflow: auto;
4132
+ }
3987
4133
  .whitespace-nowrap {
3988
4134
  white-space: nowrap;
3989
4135
  }
@@ -4005,24 +4151,45 @@ input.tab:checked + .tab-content,
4005
4151
  .rounded-none {
4006
4152
  border-radius: 0px;
4007
4153
  }
4154
+ .rounded-b-md {
4155
+ border-bottom-right-radius: 0.375rem;
4156
+ border-bottom-left-radius: 0.375rem;
4157
+ }
4158
+ .rounded-tl-md {
4159
+ border-top-left-radius: 0.375rem;
4160
+ }
4161
+ .rounded-tr-md {
4162
+ border-top-right-radius: 0.375rem;
4163
+ }
4008
4164
  .border {
4009
4165
  border-width: 1px;
4010
4166
  }
4011
4167
  .border-2 {
4012
4168
  border-width: 2px;
4013
4169
  }
4014
- .border-base-300 {
4170
+ .border-b-2 {
4171
+ border-bottom-width: 2px;
4172
+ }
4173
+ .border-black {
4015
4174
  --tw-border-opacity: 1;
4016
- border-color: var(--fallback-b3,oklch(var(--b3)/var(--tw-border-opacity)));
4175
+ border-color: rgb(0 0 0 / var(--tw-border-opacity));
4017
4176
  }
4018
4177
  .border-error {
4019
4178
  --tw-border-opacity: 1;
4020
4179
  border-color: var(--fallback-er,oklch(var(--er)/var(--tw-border-opacity)));
4021
4180
  }
4181
+ .border-gray-100 {
4182
+ --tw-border-opacity: 1;
4183
+ border-color: rgb(243 244 246 / var(--tw-border-opacity));
4184
+ }
4022
4185
  .border-gray-300 {
4023
4186
  --tw-border-opacity: 1;
4024
4187
  border-color: rgb(209 213 219 / var(--tw-border-opacity));
4025
4188
  }
4189
+ .border-gray-400 {
4190
+ --tw-border-opacity: 1;
4191
+ border-color: rgb(156 163 175 / var(--tw-border-opacity));
4192
+ }
4026
4193
  .bg-base-100 {
4027
4194
  --tw-bg-opacity: 1;
4028
4195
  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
@@ -4035,9 +4202,6 @@ input.tab:checked + .tab-content,
4035
4202
  --tw-bg-opacity: 1;
4036
4203
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
4037
4204
  }
4038
- .p-1 {
4039
- padding: 0.25rem;
4040
- }
4041
4205
  .p-2 {
4042
4206
  padding: 0.5rem;
4043
4207
  }
@@ -4065,20 +4229,89 @@ input.tab:checked + .tab-content,
4065
4229
  padding-top: 4rem;
4066
4230
  padding-bottom: 4rem;
4067
4231
  }
4232
+ .py-2 {
4233
+ padding-top: 0.5rem;
4234
+ padding-bottom: 0.5rem;
4235
+ }
4236
+ .text-justify {
4237
+ text-align: justify;
4238
+ }
4239
+ .text-base {
4240
+ font-size: 1rem;
4241
+ line-height: 1.5rem;
4242
+ }
4243
+ .text-lg {
4244
+ font-size: 1.125rem;
4245
+ line-height: 1.75rem;
4246
+ }
4247
+ .text-sm {
4248
+ font-size: 0.875rem;
4249
+ line-height: 1.25rem;
4250
+ }
4251
+ .text-xl {
4252
+ font-size: 1.25rem;
4253
+ line-height: 1.75rem;
4254
+ }
4068
4255
  .text-xs {
4069
4256
  font-size: 0.75rem;
4070
4257
  line-height: 1rem;
4071
4258
  }
4259
+ .font-bold {
4260
+ font-weight: 700;
4261
+ }
4072
4262
  .font-medium {
4073
4263
  font-weight: 500;
4074
4264
  }
4265
+ .leading-5 {
4266
+ line-height: 1.25rem;
4267
+ }
4268
+ .text-blue-600 {
4269
+ --tw-text-opacity: 1;
4270
+ color: rgb(37 99 235 / var(--tw-text-opacity));
4271
+ }
4272
+ .text-gray-600 {
4273
+ --tw-text-opacity: 1;
4274
+ color: rgb(75 85 99 / var(--tw-text-opacity));
4275
+ }
4276
+ .underline {
4277
+ text-decoration-line: underline;
4278
+ }
4075
4279
  .shadow {
4076
4280
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
4077
4281
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
4078
4282
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
4079
4283
  }
4284
+ .shadow-lg {
4285
+ --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
4286
+ --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
4287
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
4288
+ }
4289
+ .blur {
4290
+ --tw-blur: blur(8px);
4291
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
4292
+ }
4080
4293
  .filter {
4081
4294
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
4295
+ }
4296
+ .transition-colors {
4297
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
4298
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
4299
+ transition-duration: 150ms;
4300
+ }
4301
+ .duration-150 {
4302
+ transition-duration: 150ms;
4303
+ }
4304
+ .hover\\:bg-gray-100:hover {
4305
+ --tw-bg-opacity: 1;
4306
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity));
4307
+ }
4308
+ .hover\\:text-blue-800:hover {
4309
+ --tw-text-opacity: 1;
4310
+ color: rgb(30 64 175 / var(--tw-text-opacity));
4311
+ }
4312
+ .hover\\:text-gray-700:hover {
4313
+ --tw-text-opacity: 1;
4314
+ color: rgb(55 65 81 / var(--tw-text-opacity));
4082
4315
  }`;
4083
4316
  var __defProp$9 = Object.defineProperty;
4084
4317
  var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
@@ -4093,7 +4326,7 @@ var __decorateClass$9 = (decorators, target, key, kind) => {
4093
4326
  };
4094
4327
  const tailwindElementCss = unsafeCSS(tailwindStyle);
4095
4328
  const minMaxPercentSliderElementCss = unsafeCSS(minMaxPercentSliderCss);
4096
- const _PreactLitAdapter = class _PreactLitAdapter extends b {
4329
+ const _PreactLitAdapter = class _PreactLitAdapter extends ReactiveElement {
4097
4330
  constructor() {
4098
4331
  super(...arguments);
4099
4332
  this.lapis = "";
@@ -4103,7 +4336,6 @@ const _PreactLitAdapter = class _PreactLitAdapter extends b {
4103
4336
  };
4104
4337
  }
4105
4338
  update(changedProperties) {
4106
- console.log("this.lapis", this.lapis);
4107
4339
  const vdom = /* @__PURE__ */ u$1(LapisUrlContext.Provider, { value: this.lapis, children: /* @__PURE__ */ u$1(ReferenceGenomeContext.Provider, { value: this.referenceGenome, children: this.render() }) });
4108
4340
  super.update(changedProperties);
4109
4341
  render(vdom, this.renderRoot);
@@ -4139,9 +4371,20 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
4139
4371
  this.variants = [];
4140
4372
  this.sequenceType = "nucleotide";
4141
4373
  this.views = ["table"];
4374
+ this.size = void 0;
4375
+ this.headline = "Mutation comparison";
4142
4376
  }
4143
4377
  render() {
4144
- return /* @__PURE__ */ u$1(MutationComparison, { variants: this.variants, sequenceType: this.sequenceType, views: this.views });
4378
+ return /* @__PURE__ */ u$1(
4379
+ MutationComparison,
4380
+ {
4381
+ variants: this.variants,
4382
+ sequenceType: this.sequenceType,
4383
+ views: this.views,
4384
+ size: this.size,
4385
+ headline: this.headline
4386
+ }
4387
+ );
4145
4388
  }
4146
4389
  };
4147
4390
  __decorateClass$8([
@@ -4153,13 +4396,19 @@ __decorateClass$8([
4153
4396
  __decorateClass$8([
4154
4397
  n2({ type: Array })
4155
4398
  ], MutationComparisonComponent.prototype, "views", 2);
4399
+ __decorateClass$8([
4400
+ n2({ type: Object })
4401
+ ], MutationComparisonComponent.prototype, "size", 2);
4402
+ __decorateClass$8([
4403
+ n2({ type: String })
4404
+ ], MutationComparisonComponent.prototype, "headline", 2);
4156
4405
  MutationComparisonComponent = __decorateClass$8([
4157
4406
  t$2("gs-mutation-comparison-component")
4158
4407
  ], MutationComparisonComponent);
4159
4408
  function getInsertionsTableData(data) {
4160
4409
  return data.map((mutationEntry) => {
4161
4410
  return {
4162
- insertion: mutationEntry.mutation.toString(),
4411
+ insertion: mutationEntry.mutation,
4163
4412
  count: mutationEntry.count
4164
4413
  };
4165
4414
  });
@@ -4170,7 +4419,7 @@ function getMutationsTableData(data, proportionInterval) {
4170
4419
  };
4171
4420
  return data.filter(byProportion2).map((mutationEntry) => {
4172
4421
  return {
4173
- mutation: mutationEntry.mutation.toString(),
4422
+ mutation: mutationEntry.mutation,
4174
4423
  type: mutationEntry.type,
4175
4424
  count: mutationEntry.count,
4176
4425
  proportion: mutationEntry.proportion
@@ -4301,22 +4550,13 @@ const MutationsGrid = ({ data, sequenceType, proportionInterval }) => {
4301
4550
  return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pagination: true });
4302
4551
  };
4303
4552
  const sortInsertions = (a2, b2) => {
4304
- const insertionA = Insertion.parse(a2);
4305
- const insertionB = Insertion.parse(b2);
4306
- if (insertionA && insertionB) {
4307
- const segmentA = insertionA.segment;
4308
- const segmentB = insertionB.segment;
4309
- if (segmentA !== void 0 && segmentB !== void 0 && segmentA !== segmentB) {
4310
- return segmentA.localeCompare(segmentB);
4311
- }
4312
- const positionA = insertionA.position;
4313
- const positionB = insertionB.position;
4314
- if (positionA !== positionB) {
4315
- return positionA - positionB;
4316
- }
4317
- return insertionA.insertedSymbols.localeCompare(insertionB.insertedSymbols);
4553
+ if (a2.segment !== b2.segment) {
4554
+ return compareSegments(a2.segment, b2.segment);
4555
+ }
4556
+ if (a2.position !== b2.position) {
4557
+ return comparePositions(a2.position, b2.position);
4318
4558
  }
4319
- throw new Error(`Invalid insertion: ${a2} or ${b2}`);
4559
+ return a2.insertedSymbols.localeCompare(b2.insertedSymbols);
4320
4560
  };
4321
4561
  const InsertionsTable = ({ data }) => {
4322
4562
  const getHeaders = () => {
@@ -4327,7 +4567,8 @@ const InsertionsTable = ({ data }) => {
4327
4567
  compare: (a2, b2) => {
4328
4568
  return sortInsertions(a2, b2);
4329
4569
  }
4330
- }
4570
+ },
4571
+ formatter: (cell) => cell.toString()
4331
4572
  },
4332
4573
  {
4333
4574
  name: "Count",
@@ -4347,7 +4588,8 @@ const MutationsTable = ({ data, proportionInterval }) => {
4347
4588
  compare: (a2, b2) => {
4348
4589
  return sortSubstitutionsAndDeletions(a2, b2);
4349
4590
  }
4350
- }
4591
+ },
4592
+ formatter: (cell) => cell.toString()
4351
4593
  },
4352
4594
  {
4353
4595
  name: "Type",
@@ -4421,12 +4663,17 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
4421
4663
  gridData: filteredSubstitutionsOrDeletions
4422
4664
  };
4423
4665
  }
4424
- const Mutations = ({ variant, sequenceType, views }) => {
4666
+ const Mutations = ({
4667
+ variant,
4668
+ sequenceType,
4669
+ views,
4670
+ size,
4671
+ headline = "Mutations"
4672
+ }) => {
4425
4673
  const lapis = P(LapisUrlContext);
4426
4674
  const { data, error, isLoading } = useQuery(async () => {
4427
4675
  return queryMutationsData(variant, sequenceType, lapis);
4428
4676
  }, [variant, sequenceType, lapis]);
4429
- const headline = "Mutations";
4430
4677
  if (isLoading) {
4431
4678
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
4432
4679
  }
@@ -4436,7 +4683,7 @@ const Mutations = ({ variant, sequenceType, views }) => {
4436
4683
  if (data === null) {
4437
4684
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
4438
4685
  }
4439
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views }) });
4686
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views }) }) });
4440
4687
  };
4441
4688
  const MutationsTabs = ({ mutationsData, sequenceType, views }) => {
4442
4689
  const [proportionInterval, setProportionInterval] = p({ min: 0.05, max: 1 });
@@ -4530,11 +4777,16 @@ const Toolbar$2 = ({
4530
4777
  CsvDownloadButton,
4531
4778
  {
4532
4779
  className: "mx-1 btn btn-xs",
4533
- getData: () => getInsertionsTableData(filteredData.insertions),
4780
+ getData: () => getInsertionsTableData(filteredData.insertions).map((row) => {
4781
+ return {
4782
+ insertion: row.insertion.toString(),
4783
+ count: row.count
4784
+ };
4785
+ }),
4534
4786
  filename: "insertions.csv"
4535
4787
  }
4536
4788
  ),
4537
- /* @__PURE__ */ u$1(Info, { className: "mx-1", content: "Info for mutations" })
4789
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutations" })
4538
4790
  ] });
4539
4791
  };
4540
4792
  var __defProp$7 = Object.defineProperty;
@@ -4554,9 +4806,20 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
4554
4806
  this.variant = { displayName: "" };
4555
4807
  this.sequenceType = "nucleotide";
4556
4808
  this.views = ["table", "grid"];
4809
+ this.size = void 0;
4810
+ this.headline = "Mutations";
4557
4811
  }
4558
4812
  render() {
4559
- return /* @__PURE__ */ u$1(Mutations, { variant: this.variant, sequenceType: this.sequenceType, views: this.views });
4813
+ return /* @__PURE__ */ u$1(
4814
+ Mutations,
4815
+ {
4816
+ variant: this.variant,
4817
+ sequenceType: this.sequenceType,
4818
+ views: this.views,
4819
+ size: this.size,
4820
+ headline: this.headline
4821
+ }
4822
+ );
4560
4823
  }
4561
4824
  };
4562
4825
  __decorateClass$7([
@@ -4568,6 +4831,12 @@ __decorateClass$7([
4568
4831
  __decorateClass$7([
4569
4832
  n2({ type: Array })
4570
4833
  ], MutationsComponent.prototype, "views", 2);
4834
+ __decorateClass$7([
4835
+ n2({ type: Object })
4836
+ ], MutationsComponent.prototype, "size", 2);
4837
+ __decorateClass$7([
4838
+ n2({ type: String })
4839
+ ], MutationsComponent.prototype, "headline", 2);
4571
4840
  MutationsComponent = __decorateClass$7([
4572
4841
  t$2("gs-mutations-component")
4573
4842
  ], MutationsComponent);
@@ -4680,6 +4949,7 @@ const PrevalenceOverTimeBarChart = ({
4680
4949
  datasets: data.map((graphData, index) => datasets$1(graphData, index, confidenceIntervalMethod))
4681
4950
  },
4682
4951
  options: {
4952
+ maintainAspectRatio: false,
4683
4953
  animation: false,
4684
4954
  scales: {
4685
4955
  y: getYAxisScale(yAxisScaleType)
@@ -5633,6 +5903,7 @@ const PrevalenceOverTimeBubbleChart = ({ data, yAxisScaleType }) => {
5633
5903
  },
5634
5904
  options: {
5635
5905
  animation: false,
5906
+ maintainAspectRatio: false,
5636
5907
  scales: {
5637
5908
  x: {
5638
5909
  ticks: {
@@ -5690,6 +5961,7 @@ const PrevalenceOverTimeLineChart = ({
5690
5961
  },
5691
5962
  options: {
5692
5963
  animation: false,
5964
+ maintainAspectRatio: false,
5693
5965
  scales: {
5694
5966
  y: getYAxisScale(yAxisScaleType)
5695
5967
  },
@@ -6106,14 +6378,15 @@ const PrevalenceOverTime = ({
6106
6378
  granularity,
6107
6379
  smoothingWindow,
6108
6380
  views,
6109
- confidenceIntervalMethods
6381
+ confidenceIntervalMethods,
6382
+ size,
6383
+ headline = "Prevalence over time"
6110
6384
  }) => {
6111
6385
  const lapis = P(LapisUrlContext);
6112
6386
  const { data, error, isLoading } = useQuery(
6113
6387
  () => queryPrevalenceOverTime(numerator, denominator, granularity, smoothingWindow, lapis),
6114
6388
  [lapis, numerator, denominator, granularity, smoothingWindow]
6115
6389
  );
6116
- const headline = "Prevalence over time";
6117
6390
  if (isLoading) {
6118
6391
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
6119
6392
  }
@@ -6123,7 +6396,7 @@ const PrevalenceOverTime = ({
6123
6396
  if (data === null) {
6124
6397
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
6125
6398
  }
6126
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6399
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "600px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6127
6400
  PrevalenceOverTimeTabs,
6128
6401
  {
6129
6402
  views,
@@ -6131,7 +6404,7 @@ const PrevalenceOverTime = ({
6131
6404
  granularity,
6132
6405
  confidenceIntervalMethods
6133
6406
  }
6134
- ) });
6407
+ ) }) });
6135
6408
  };
6136
6409
  const PrevalenceOverTimeTabs = ({
6137
6410
  views,
@@ -6175,7 +6448,10 @@ const PrevalenceOverTimeTabs = ({
6175
6448
  content: /* @__PURE__ */ u$1(PrevalenceOverTimeBubbleChart, { data, yAxisScaleType })
6176
6449
  };
6177
6450
  case "table":
6178
- return { title: "Table", content: /* @__PURE__ */ u$1(PrevalenceOverTimeTable, { data, granularity }) };
6451
+ return {
6452
+ title: "Table",
6453
+ content: /* @__PURE__ */ u$1(PrevalenceOverTimeTable, { data, granularity })
6454
+ };
6179
6455
  }
6180
6456
  };
6181
6457
  const tabs = views.map((view) => getTab(view));
@@ -6222,7 +6498,13 @@ const Toolbar$1 = ({
6222
6498
  filename: "prevalence-over-time.csv"
6223
6499
  }
6224
6500
  ),
6225
- /* @__PURE__ */ u$1(Info, { className: "ml-1", content: "Info for prevalence over time" })
6501
+ /* @__PURE__ */ u$1(PrevalenceOverTimeInfo, {})
6502
+ ] });
6503
+ };
6504
+ const PrevalenceOverTimeInfo = () => {
6505
+ return /* @__PURE__ */ u$1(Info, { size: { width: "600px", height: "30vh" }, children: [
6506
+ /* @__PURE__ */ u$1(InfoHeadline1, { children: "Prevalence over time" }),
6507
+ /* @__PURE__ */ u$1(InfoParagraph, { children: "Prevalence over time info." })
6226
6508
  ] });
6227
6509
  };
6228
6510
  var __defProp$6 = Object.defineProperty;
@@ -6245,6 +6527,8 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6245
6527
  this.smoothingWindow = 0;
6246
6528
  this.views = ["bar", "line", "bubble", "table"];
6247
6529
  this.confidenceIntervalMethods = ["wilson"];
6530
+ this.headline = "Prevalence over time";
6531
+ this.size = void 0;
6248
6532
  }
6249
6533
  render() {
6250
6534
  return /* @__PURE__ */ u$1(
@@ -6255,7 +6539,9 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
6255
6539
  granularity: this.granularity,
6256
6540
  smoothingWindow: this.smoothingWindow,
6257
6541
  views: this.views,
6258
- confidenceIntervalMethods: this.confidenceIntervalMethods
6542
+ confidenceIntervalMethods: this.confidenceIntervalMethods,
6543
+ size: this.size,
6544
+ headline: this.headline
6259
6545
  }
6260
6546
  );
6261
6547
  }
@@ -6278,6 +6564,12 @@ __decorateClass$6([
6278
6564
  __decorateClass$6([
6279
6565
  n2({ type: Array })
6280
6566
  ], PrevalenceOverTimeComponent.prototype, "confidenceIntervalMethods", 2);
6567
+ __decorateClass$6([
6568
+ n2({ type: String })
6569
+ ], PrevalenceOverTimeComponent.prototype, "headline", 2);
6570
+ __decorateClass$6([
6571
+ n2({ type: Object })
6572
+ ], PrevalenceOverTimeComponent.prototype, "size", 2);
6281
6573
  PrevalenceOverTimeComponent = __decorateClass$6([
6282
6574
  t$2("gs-prevalence-over-time")
6283
6575
  ], PrevalenceOverTimeComponent);
@@ -6290,6 +6582,7 @@ const RelativeGrowthAdvantageChart = ({ data, yAxisScaleType }) => {
6290
6582
  datasets: datasets(data)
6291
6583
  },
6292
6584
  options: {
6585
+ maintainAspectRatio: false,
6293
6586
  animation: false,
6294
6587
  scales: {
6295
6588
  y: getYAxisScale(yAxisScaleType)
@@ -6302,9 +6595,9 @@ const RelativeGrowthAdvantageChart = ({ data, yAxisScaleType }) => {
6302
6595
  }
6303
6596
  }
6304
6597
  };
6305
- return /* @__PURE__ */ u$1(Fragment, { children: [
6306
- /* @__PURE__ */ u$1(GsChart, { configuration: config }),
6307
- /* @__PURE__ */ u$1("div", { children: [
6598
+ return /* @__PURE__ */ u$1("div", { className: "flex flex-col h-full", children: [
6599
+ /* @__PURE__ */ u$1("div", { className: "flex-1", children: /* @__PURE__ */ u$1(GsChart, { configuration: config }) }),
6600
+ /* @__PURE__ */ u$1("p", { children: [
6308
6601
  "Advantage: ",
6309
6602
  (data.params.fd.value * 100).toFixed(2),
6310
6603
  "% (",
@@ -6469,7 +6762,9 @@ const RelativeGrowthAdvantage = ({
6469
6762
  numerator,
6470
6763
  denominator,
6471
6764
  generationTime,
6472
- views
6765
+ views,
6766
+ size,
6767
+ headline = "Relative growth advantage"
6473
6768
  }) => {
6474
6769
  const lapis = P(LapisUrlContext);
6475
6770
  const [yAxisScaleType, setYAxisScaleType] = p("linear");
@@ -6477,7 +6772,6 @@ const RelativeGrowthAdvantage = ({
6477
6772
  () => queryRelativeGrowthAdvantage(numerator, denominator, generationTime, lapis),
6478
6773
  [lapis, numerator, denominator, generationTime, views]
6479
6774
  );
6480
- const headline = "Relative growth advantage";
6481
6775
  if (isLoading) {
6482
6776
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
6483
6777
  }
@@ -6487,21 +6781,23 @@ const RelativeGrowthAdvantage = ({
6487
6781
  if (data === null) {
6488
6782
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
6489
6783
  }
6490
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6784
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6491
6785
  RelativeGrowthAdvantageTabs,
6492
6786
  {
6493
6787
  data,
6494
6788
  yAxisScaleType,
6495
6789
  setYAxisScaleType,
6496
- views
6790
+ views,
6791
+ generationTime
6497
6792
  }
6498
- ) });
6793
+ ) }) });
6499
6794
  };
6500
6795
  const RelativeGrowthAdvantageTabs = ({
6501
6796
  data,
6502
6797
  yAxisScaleType,
6503
6798
  setYAxisScaleType,
6504
- views
6799
+ views,
6800
+ generationTime
6505
6801
  }) => {
6506
6802
  const getTab = (view) => {
6507
6803
  switch (view) {
@@ -6523,16 +6819,45 @@ const RelativeGrowthAdvantageTabs = ({
6523
6819
  }
6524
6820
  };
6525
6821
  const tabs = views.map((view) => getTab(view));
6526
- const toolbar = () => /* @__PURE__ */ u$1(RelativeGrowthAdvantageToolbar, { yAxisScaleType, setYAxisScaleType });
6822
+ const toolbar = () => /* @__PURE__ */ u$1(
6823
+ RelativeGrowthAdvantageToolbar,
6824
+ {
6825
+ generationTime,
6826
+ yAxisScaleType,
6827
+ setYAxisScaleType
6828
+ }
6829
+ );
6527
6830
  return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
6528
6831
  };
6529
6832
  const RelativeGrowthAdvantageToolbar = ({
6530
6833
  yAxisScaleType,
6531
- setYAxisScaleType
6834
+ setYAxisScaleType,
6835
+ generationTime
6532
6836
  }) => {
6533
6837
  return /* @__PURE__ */ u$1("div", { class: "flex", children: [
6534
6838
  /* @__PURE__ */ u$1(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
6535
- /* @__PURE__ */ u$1(Info, { className: "ml-1", content: "Line chart" })
6839
+ /* @__PURE__ */ u$1(RelativeGrowthAdvantageInfo, { generationTime })
6840
+ ] });
6841
+ };
6842
+ const RelativeGrowthAdvantageInfo = ({ generationTime }) => {
6843
+ return /* @__PURE__ */ u$1(Info, { size: { width: "600px", height: "30vh" }, children: [
6844
+ /* @__PURE__ */ u$1(InfoHeadline1, { children: "Relative growth advantage" }),
6845
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
6846
+ "If variants spread pre-dominantly by local transmission across demographic groups, this estimate reflects the relative viral intrinsic growth advantage of the focal variant in the selected country and time frame. We report the relative growth advantage per ",
6847
+ generationTime,
6848
+ " days (in percentage; 0% means equal growth). Importantly, the relative growth advantage estimate reflects the advantage compared to the co-circulating variants. Thus, as new variants spread, the advantage of the focal variant may decrease. Different mechanisms can alter the intrinsic growth rate, including an intrinsic transmission advantage, immune evasion, and a prolonged infectious period. When absolute numbers of a variant are low, the growth advantage may merely reflect the current importance of introductions from abroad or the variant spreading in a particular demographic group. In this case, the estimate does not provide information on any intrinsic fitness advantages."
6849
+ ] }),
6850
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
6851
+ "Example: Assume that 10 infections from the focal variant and 100 infections from the co-circulating variants occur today and that the focal variant has a relative growth advantage of 50%. Then, if the number of new infections from the co-circulating variants remains at 100 in ",
6852
+ generationTime,
6853
+ " days from today, we expect the number of new infections from the focal variant to be 15."
6854
+ ] }),
6855
+ /* @__PURE__ */ u$1(InfoHeadline2, { children: "Reference" }),
6856
+ /* @__PURE__ */ u$1(InfoParagraph, { children: [
6857
+ 'Chen, Chaoran, et al. "Quantification of the spread of SARS-CoV-2 variant B.1.1.7 in Switzerland." Epidemics (2021); doi:',
6858
+ " ",
6859
+ /* @__PURE__ */ u$1(InfoLink, { href: "https://www.sciencedirect.com/science/article/pii/S1755436521000335?via=ihub", children: "10.1016/j.epidem.2021.100480" })
6860
+ ] })
6536
6861
  ] });
6537
6862
  };
6538
6863
  var __defProp$5 = Object.defineProperty;
@@ -6553,6 +6878,8 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
6553
6878
  this.denominator = {};
6554
6879
  this.generationTime = 7;
6555
6880
  this.views = ["line"];
6881
+ this.headline = "Relative growth advantage";
6882
+ this.size = void 0;
6556
6883
  }
6557
6884
  render() {
6558
6885
  return /* @__PURE__ */ u$1(
@@ -6561,7 +6888,9 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
6561
6888
  numerator: this.numerator,
6562
6889
  denominator: this.denominator,
6563
6890
  generationTime: this.generationTime,
6564
- views: this.views
6891
+ views: this.views,
6892
+ size: this.size,
6893
+ headline: this.headline
6565
6894
  }
6566
6895
  );
6567
6896
  }
@@ -6578,6 +6907,12 @@ __decorateClass$5([
6578
6907
  __decorateClass$5([
6579
6908
  n2({ type: Array })
6580
6909
  ], RelativeGrowthAdvantageComponent.prototype, "views", 2);
6910
+ __decorateClass$5([
6911
+ n2({ type: String })
6912
+ ], RelativeGrowthAdvantageComponent.prototype, "headline", 2);
6913
+ __decorateClass$5([
6914
+ n2({ type: Object })
6915
+ ], RelativeGrowthAdvantageComponent.prototype, "size", 2);
6581
6916
  RelativeGrowthAdvantageComponent = __decorateClass$5([
6582
6917
  t$2("gs-relative-growth-advantage")
6583
6918
  ], RelativeGrowthAdvantageComponent);
@@ -6612,12 +6947,17 @@ async function queryAggregateData(variant, fields, lapis, signal) {
6612
6947
  })
6613
6948
  );
6614
6949
  }
6615
- const Aggregate = ({ fields, views, filter }) => {
6950
+ const Aggregate = ({
6951
+ fields,
6952
+ views,
6953
+ filter,
6954
+ size,
6955
+ headline = "Aggregate"
6956
+ }) => {
6616
6957
  const lapis = P(LapisUrlContext);
6617
6958
  const { data, error, isLoading } = useQuery(async () => {
6618
6959
  return queryAggregateData(filter, fields, lapis);
6619
6960
  }, [filter, fields, lapis]);
6620
- const headline = "Aggregate";
6621
6961
  if (isLoading) {
6622
6962
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
6623
6963
  }
@@ -6627,7 +6967,7 @@ const Aggregate = ({ fields, views, filter }) => {
6627
6967
  if (data === null) {
6628
6968
  return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
6629
6969
  }
6630
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields }) });
6970
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields }) }) });
6631
6971
  };
6632
6972
  const AggregatedDataTabs = ({ data, views, fields }) => {
6633
6973
  const getTab = (view) => {
@@ -6645,7 +6985,7 @@ const AggregatedDataTabs = ({ data, views, fields }) => {
6645
6985
  const Toolbar = ({ data }) => {
6646
6986
  return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
6647
6987
  /* @__PURE__ */ u$1(CsvDownloadButton, { className: "mx-1 btn btn-xs", getData: () => data, filename: "aggregate.csv" }),
6648
- /* @__PURE__ */ u$1(Info, { className: "mx-1", content: "Info for aggregate" })
6988
+ /* @__PURE__ */ u$1(Info, { children: "Info for aggregate" })
6649
6989
  ] });
6650
6990
  };
6651
6991
  var __defProp$4 = Object.defineProperty;
@@ -6665,9 +7005,20 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
6665
7005
  this.fields = [];
6666
7006
  this.views = ["table"];
6667
7007
  this.filter = {};
7008
+ this.size = void 0;
7009
+ this.headline = "Aggregate";
6668
7010
  }
6669
7011
  render() {
6670
- return /* @__PURE__ */ u$1(Aggregate, { fields: this.fields, views: this.views, filter: this.filter });
7012
+ return /* @__PURE__ */ u$1(
7013
+ Aggregate,
7014
+ {
7015
+ fields: this.fields,
7016
+ views: this.views,
7017
+ filter: this.filter,
7018
+ size: this.size,
7019
+ headline: this.headline
7020
+ }
7021
+ );
6671
7022
  }
6672
7023
  };
6673
7024
  __decorateClass$4([
@@ -6679,6 +7030,12 @@ __decorateClass$4([
6679
7030
  __decorateClass$4([
6680
7031
  n2({ type: Object })
6681
7032
  ], AggregateComponent.prototype, "filter", 2);
7033
+ __decorateClass$4([
7034
+ n2({ type: Object })
7035
+ ], AggregateComponent.prototype, "size", 2);
7036
+ __decorateClass$4([
7037
+ n2({ type: String })
7038
+ ], AggregateComponent.prototype, "headline", 2);
6682
7039
  AggregateComponent = __decorateClass$4([
6683
7040
  t$2("gs-aggregate-component")
6684
7041
  ], AggregateComponent);
@@ -6689,16 +7046,36 @@ const toYYYYMMDD = (date) => {
6689
7046
  const options2 = { year: "numeric", month: "2-digit", day: "2-digit" };
6690
7047
  return date.toLocaleDateString("en-CA", options2);
6691
7048
  };
7049
+ const PRESET_VALUE_CUSTOM = "custom";
7050
+ const PRESET_VALUE_ALL_TIMES = "allTimes";
7051
+ const PRESET_VALUE_LAST_2_WEEKS = "last2Weeks";
7052
+ const PRESET_VALUE_LAST_MONTH = "lastMonth";
7053
+ const PRESET_VALUE_LAST_2_MONTHS = "last2Months";
7054
+ const PRESET_VALUE_LAST_3_MONTHS = "last3Months";
7055
+ const PRESET_VALUE_LAST_6_MONTHS = "last6Months";
7056
+ const presets = {
7057
+ [PRESET_VALUE_CUSTOM]: { label: "Custom" },
7058
+ [PRESET_VALUE_ALL_TIMES]: { label: "All times" },
7059
+ [PRESET_VALUE_LAST_2_WEEKS]: { label: "Last 2 weeks" },
7060
+ [PRESET_VALUE_LAST_MONTH]: { label: "Last month" },
7061
+ [PRESET_VALUE_LAST_2_MONTHS]: { label: "Last 2 months" },
7062
+ [PRESET_VALUE_LAST_3_MONTHS]: { label: "Last 3 months" },
7063
+ [PRESET_VALUE_LAST_6_MONTHS]: { label: "Last 6 months" }
7064
+ };
6692
7065
  const DateRangeSelector = ({
6693
7066
  customSelectOptions,
6694
- earliestDate = "1900-01-01"
7067
+ earliestDate = "1900-01-01",
7068
+ initialValue
6695
7069
  }) => {
6696
- const datePickerRef = F(null);
6697
- const endDatePickerRef = F(null);
7070
+ const fromDatePickerRef = F(null);
7071
+ const toDatePickerRef = F(null);
6698
7072
  const divRef = F(null);
6699
7073
  const [dateFromPicker, setDateFromPicker] = p(null);
6700
7074
  const [dateToPicker, setDateToPicker] = p(null);
6701
- const [selectedDateRange, setSelectedDateRange] = p("last6Months");
7075
+ const selectableOptions = getSelectableOptions(customSelectOptions);
7076
+ const [selectedDateRange, setSelectedDateRange] = p(
7077
+ initialValue !== void 0 && selectableOptions.some((option) => option.value === initialValue) ? initialValue : PRESET_VALUE_LAST_6_MONTHS
7078
+ );
6702
7079
  const [selectedDates, setSelectedDates] = p({
6703
7080
  dateFrom: getDatesForSelectorValue("last6Months", customSelectOptions, earliestDate).dateFrom,
6704
7081
  dateTo: getDatesForSelectorValue("last6Months", customSelectOptions, earliestDate).dateTo
@@ -6708,17 +7085,17 @@ const DateRangeSelector = ({
6708
7085
  allowInput: true,
6709
7086
  dateFormat: "Y-m-d"
6710
7087
  };
6711
- if (datePickerRef.current) {
7088
+ if (fromDatePickerRef.current) {
6712
7089
  setDateFromPicker(
6713
- flatpickr(datePickerRef.current, {
7090
+ flatpickr(fromDatePickerRef.current, {
6714
7091
  ...commonConfig,
6715
7092
  defaultDate: selectedDates.dateFrom
6716
7093
  })
6717
7094
  );
6718
7095
  }
6719
- if (endDatePickerRef.current) {
7096
+ if (toDatePickerRef.current) {
6720
7097
  setDateToPicker(
6721
- flatpickr(endDatePickerRef.current, {
7098
+ flatpickr(toDatePickerRef.current, {
6722
7099
  ...commonConfig,
6723
7100
  defaultDate: selectedDates.dateTo
6724
7101
  })
@@ -6728,24 +7105,7 @@ const DateRangeSelector = ({
6728
7105
  dateFromPicker == null ? void 0 : dateFromPicker.destroy();
6729
7106
  dateToPicker == null ? void 0 : dateToPicker.destroy();
6730
7107
  };
6731
- }, [datePickerRef, endDatePickerRef]);
6732
- const selectableOptions = () => {
6733
- const presetOptions = [
6734
- { label: "Custom", value: "custom" },
6735
- { label: "All times", value: "allTimes" },
6736
- { label: "Last 2 weeks", value: "last2Weeks" },
6737
- { label: "Last month", value: "lastMonth" },
6738
- { label: "Last 2 weeks", value: "last2Weeks" },
6739
- { label: "Last month", value: "lastMonth" },
6740
- { label: "Last 2 months", value: "last2Months" },
6741
- { label: "Last 3 months", value: "last3Months" },
6742
- { label: "Last 6 months", value: "last6Months" }
6743
- ];
6744
- const customOptions = customSelectOptions.map((customSelectOption) => {
6745
- return { label: customSelectOption.label, value: customLabelToOptionValue(customSelectOption.label) };
6746
- });
6747
- return [...presetOptions, ...customOptions];
6748
- };
7108
+ }, [fromDatePickerRef, toDatePickerRef]);
6749
7109
  const onSelectChange = (value) => {
6750
7110
  setSelectedDateRange(value);
6751
7111
  const dateRange = getDatesForSelectorValue(value, customSelectOptions, earliestDate);
@@ -6797,7 +7157,7 @@ const DateRangeSelector = ({
6797
7157
  /* @__PURE__ */ u$1(
6798
7158
  Select,
6799
7159
  {
6800
- items: selectableOptions(),
7160
+ items: selectableOptions,
6801
7161
  selected: selectedDateRange,
6802
7162
  selectStyle: "select-bordered rounded-none join-item",
6803
7163
  onChange: (event) => {
@@ -6814,7 +7174,7 @@ const DateRangeSelector = ({
6814
7174
  class: "input input-bordered rounded-none join-item",
6815
7175
  type: "text",
6816
7176
  placeholder: "Date from",
6817
- ref: datePickerRef,
7177
+ ref: fromDatePickerRef,
6818
7178
  onChange: onChangeDateFrom,
6819
7179
  onBlur: onChangeDateFrom
6820
7180
  }
@@ -6825,51 +7185,55 @@ const DateRangeSelector = ({
6825
7185
  class: "input input-bordered rounded-none join-item",
6826
7186
  type: "text",
6827
7187
  placeholder: "Date to",
6828
- ref: endDatePickerRef,
7188
+ ref: toDatePickerRef,
6829
7189
  onChange: onChangeDateTo,
6830
- onBlur: onChangeDateFrom
7190
+ onBlur: onChangeDateTo
6831
7191
  }
6832
7192
  )
6833
7193
  ] });
6834
7194
  };
6835
- const customLabelToOptionValue = (customLabel) => {
6836
- return `${customLabel}customLabel`;
7195
+ const getSelectableOptions = (customSelectOptions) => {
7196
+ const presetOptions = Object.entries(presets).map(([key, value]) => {
7197
+ return { label: value.label, value: key };
7198
+ });
7199
+ const customOptions = customSelectOptions.map((customSelectOption) => {
7200
+ return { label: customSelectOption.label, value: customSelectOption.label };
7201
+ });
7202
+ return [...presetOptions, ...customOptions];
6837
7203
  };
6838
7204
  const getDatesForSelectorValue = (selectorValue, customSelectOptions, earliestDate) => {
6839
7205
  const today = /* @__PURE__ */ new Date();
6840
- const customSelectOption = customSelectOptions.find(
6841
- (option) => customLabelToOptionValue(option.label) === selectorValue
6842
- );
7206
+ const customSelectOption = customSelectOptions.find((option) => option.label === selectorValue);
6843
7207
  if (customSelectOption) {
6844
7208
  return { dateFrom: new Date(customSelectOption.dateFrom), dateTo: new Date(customSelectOption.dateTo) };
6845
7209
  }
6846
7210
  switch (selectorValue) {
6847
- case "last2Weeks": {
7211
+ case PRESET_VALUE_LAST_2_WEEKS: {
6848
7212
  const twoWeeksAgo = new Date(today);
6849
7213
  twoWeeksAgo.setDate(today.getDate() - 14);
6850
7214
  return { dateFrom: twoWeeksAgo, dateTo: today };
6851
7215
  }
6852
- case "lastMonth": {
7216
+ case PRESET_VALUE_LAST_MONTH: {
6853
7217
  const lastMonth = new Date(today);
6854
7218
  lastMonth.setMonth(today.getMonth() - 1);
6855
7219
  return { dateFrom: lastMonth, dateTo: today };
6856
7220
  }
6857
- case "last2Months": {
7221
+ case PRESET_VALUE_LAST_2_MONTHS: {
6858
7222
  const twoMonthsAgo = new Date(today);
6859
7223
  twoMonthsAgo.setMonth(today.getMonth() - 2);
6860
7224
  return { dateFrom: twoMonthsAgo, dateTo: today };
6861
7225
  }
6862
- case "last3Months": {
7226
+ case PRESET_VALUE_LAST_3_MONTHS: {
6863
7227
  const threeMonthsAgo = new Date(today);
6864
7228
  threeMonthsAgo.setMonth(today.getMonth() - 3);
6865
7229
  return { dateFrom: threeMonthsAgo, dateTo: today };
6866
7230
  }
6867
- case "last6Months": {
7231
+ case PRESET_VALUE_LAST_6_MONTHS: {
6868
7232
  const sixMonthsAgo = new Date(today);
6869
7233
  sixMonthsAgo.setMonth(today.getMonth() - 6);
6870
7234
  return { dateFrom: sixMonthsAgo, dateTo: today };
6871
7235
  }
6872
- case "allTimes": {
7236
+ case PRESET_VALUE_ALL_TIMES: {
6873
7237
  return { dateFrom: new Date(earliestDate), dateTo: today };
6874
7238
  }
6875
7239
  default:
@@ -6892,9 +7256,17 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
6892
7256
  super(...arguments);
6893
7257
  this.customSelectOptions = [];
6894
7258
  this.earliestDate = "1900-01-01";
7259
+ this.initialValue = "last6Months";
6895
7260
  }
6896
7261
  render() {
6897
- return /* @__PURE__ */ u$1(DateRangeSelector, { customSelectOptions: this.customSelectOptions, earliestDate: this.earliestDate });
7262
+ return /* @__PURE__ */ u$1(
7263
+ DateRangeSelector,
7264
+ {
7265
+ customSelectOptions: this.customSelectOptions,
7266
+ earliestDate: this.earliestDate,
7267
+ initialValue: this.initialValue
7268
+ }
7269
+ );
6898
7270
  }
6899
7271
  };
6900
7272
  __decorateClass$3([
@@ -6903,6 +7275,9 @@ __decorateClass$3([
6903
7275
  __decorateClass$3([
6904
7276
  n2({ type: String })
6905
7277
  ], DateRangeSelectorComponent.prototype, "earliestDate", 2);
7278
+ __decorateClass$3([
7279
+ n2()
7280
+ ], DateRangeSelectorComponent.prototype, "initialValue", 2);
6906
7281
  DateRangeSelectorComponent = __decorateClass$3([
6907
7282
  t$2("gs-date-range-selector")
6908
7283
  ], DateRangeSelectorComponent);
@@ -6938,7 +7313,7 @@ function compareLocationEntries(fields) {
6938
7313
  return 0;
6939
7314
  };
6940
7315
  }
6941
- const LocationFilter = ({ value: initialValue, fields }) => {
7316
+ const LocationFilter = ({ initialValue, fields }) => {
6942
7317
  const lapis = P(LapisUrlContext);
6943
7318
  const [value, setValue] = p(initialValue ?? "");
6944
7319
  const [unknownLocation, setUnknownLocation] = p(false);
@@ -7031,16 +7406,16 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
7031
7406
  let LocationFilterComponent = class extends PreactLitAdapter {
7032
7407
  constructor() {
7033
7408
  super(...arguments);
7034
- this.value = "";
7409
+ this.initialValue = "";
7035
7410
  this.fields = [];
7036
7411
  }
7037
7412
  render() {
7038
- return /* @__PURE__ */ u$1(LocationFilter, { value: this.value, fields: this.fields });
7413
+ return /* @__PURE__ */ u$1(LocationFilter, { initialValue: this.initialValue, fields: this.fields });
7039
7414
  }
7040
7415
  };
7041
7416
  __decorateClass$2([
7042
7417
  n2()
7043
- ], LocationFilterComponent.prototype, "value", 2);
7418
+ ], LocationFilterComponent.prototype, "initialValue", 2);
7044
7419
  __decorateClass$2([
7045
7420
  n2({ type: Array })
7046
7421
  ], LocationFilterComponent.prototype, "fields", 2);
@@ -7052,7 +7427,7 @@ async function fetchAutocompleteList(lapis, field, signal) {
7052
7427
  const data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
7053
7428
  return data.map((item) => item[field]);
7054
7429
  }
7055
- const TextInput = ({ lapisField, placeholderText }) => {
7430
+ const TextInput = ({ lapisField, placeholderText, initialValue }) => {
7056
7431
  const lapis = P(LapisUrlContext);
7057
7432
  const inputRef = F(null);
7058
7433
  const { data, error, isLoading } = useQuery(() => fetchAutocompleteList(lapis, lapisField), [lapisField, lapis]);
@@ -7093,7 +7468,8 @@ const TextInput = ({ lapisField, placeholderText }) => {
7093
7468
  placeholder: placeholderText !== void 0 ? placeholderText : lapisField,
7094
7469
  onInput,
7095
7470
  ref: inputRef,
7096
- list: lapisField
7471
+ list: lapisField,
7472
+ value: initialValue
7097
7473
  }
7098
7474
  ),
7099
7475
  /* @__PURE__ */ u$1("datalist", { id: lapisField, children: data.map((item) => /* @__PURE__ */ u$1("option", { value: item }, item)) })
@@ -7113,13 +7489,24 @@ var __decorateClass$1 = (decorators, target, key, kind) => {
7113
7489
  let TextInputComponent = class extends PreactLitAdapter {
7114
7490
  constructor() {
7115
7491
  super(...arguments);
7492
+ this.initialValue = "";
7116
7493
  this.lapisField = "";
7117
7494
  this.placeholderText = "";
7118
7495
  }
7119
7496
  render() {
7120
- return /* @__PURE__ */ u$1(TextInput, { lapisField: this.lapisField, placeholderText: this.placeholderText });
7497
+ return /* @__PURE__ */ u$1(
7498
+ TextInput,
7499
+ {
7500
+ lapisField: this.lapisField,
7501
+ placeholderText: this.placeholderText,
7502
+ initialValue: this.initialValue
7503
+ }
7504
+ );
7121
7505
  }
7122
7506
  };
7507
+ __decorateClass$1([
7508
+ n2()
7509
+ ], TextInputComponent.prototype, "initialValue", 2);
7123
7510
  __decorateClass$1([
7124
7511
  n2()
7125
7512
  ], TextInputComponent.prototype, "lapisField", 2);
@@ -7129,6 +7516,16 @@ __decorateClass$1([
7129
7516
  TextInputComponent = __decorateClass$1([
7130
7517
  t$2("gs-text-input")
7131
7518
  ], TextInputComponent);
7519
+ const ReferenceGenomesAwaiter = ({ children }) => {
7520
+ const referenceGenome = P(ReferenceGenomeContext);
7521
+ if (isNotInitialized(referenceGenome)) {
7522
+ return /* @__PURE__ */ u$1("div", { className: "laoding loading-spinner loading-md", children: "Loading..." });
7523
+ }
7524
+ return /* @__PURE__ */ u$1(Fragment, { children });
7525
+ };
7526
+ function isNotInitialized(referenceGenome) {
7527
+ return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
7528
+ }
7132
7529
  const sequenceTypeFromSegment = (possibleSegment, referenceGenome) => {
7133
7530
  if (possibleSegment === void 0) {
7134
7531
  return referenceGenome.nucleotideSequences.length === 1 ? "nucleotide" : void 0;
@@ -7195,14 +7592,11 @@ const DeleteIcon = () => {
7195
7592
  }
7196
7593
  );
7197
7594
  };
7198
- const MutationFilter = () => {
7595
+ const MutationFilter = ({ initialValue }) => {
7199
7596
  const referenceGenome = P(ReferenceGenomeContext);
7200
- const [selectedFilters, setSelectedFilters] = p({
7201
- nucleotideMutations: [],
7202
- aminoAcidMutations: [],
7203
- nucleotideInsertions: [],
7204
- aminoAcidInsertions: []
7205
- });
7597
+ const [selectedFilters, setSelectedFilters] = p(
7598
+ getInitialState(initialValue, referenceGenome)
7599
+ );
7206
7600
  const [inputValue, setInputValue] = p("");
7207
7601
  const [isError, setIsError] = p(false);
7208
7602
  const formRef = F(null);
@@ -7248,14 +7642,17 @@ const MutationFilter = () => {
7248
7642
  setIsError(false);
7249
7643
  };
7250
7644
  return /* @__PURE__ */ u$1("div", { class: `rounded-lg border border-gray-300 bg-white p-2`, children: [
7251
- /* @__PURE__ */ u$1(
7252
- SelectedMutationDisplay,
7253
- {
7254
- selectedFilters,
7255
- setSelectedFilters,
7256
- fireChangeEvent
7257
- }
7258
- ),
7645
+ /* @__PURE__ */ u$1("div", { class: "flex justify-between", children: [
7646
+ /* @__PURE__ */ u$1(
7647
+ SelectedMutationDisplay,
7648
+ {
7649
+ selectedFilters,
7650
+ setSelectedFilters,
7651
+ fireChangeEvent
7652
+ }
7653
+ ),
7654
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutation filter" })
7655
+ ] }),
7259
7656
  /* @__PURE__ */ u$1("form", { className: "mt-2 w-full", onSubmit: handleSubmit, ref: formRef, children: /* @__PURE__ */ u$1("label", { className: `input flex items-center gap-2 ${isError ? "input-error" : "input-bordered"}`, children: [
7260
7657
  /* @__PURE__ */ u$1(
7261
7658
  "input",
@@ -7264,7 +7661,7 @@ const MutationFilter = () => {
7264
7661
  type: "text",
7265
7662
  value: inputValue,
7266
7663
  onInput: handleInputChange,
7267
- placeholder: "Enter a mutation",
7664
+ placeholder: getPlaceholder(referenceGenome),
7268
7665
  onBlur: handleOnBlur
7269
7666
  }
7270
7667
  ),
@@ -7272,6 +7669,40 @@ const MutationFilter = () => {
7272
7669
  ] }) })
7273
7670
  ] });
7274
7671
  };
7672
+ function getInitialState(initialValue, referenceGenome) {
7673
+ if (initialValue === void 0) {
7674
+ return {
7675
+ nucleotideMutations: [],
7676
+ aminoAcidMutations: [],
7677
+ nucleotideInsertions: [],
7678
+ aminoAcidInsertions: []
7679
+ };
7680
+ }
7681
+ const values = Array.isArray(initialValue) ? initialValue : Object.values(initialValue).flatMap((it) => it);
7682
+ return values.reduce(
7683
+ (selectedFilters, value) => {
7684
+ const parsedMutation = parseAndValidateMutation(value, referenceGenome);
7685
+ if (parsedMutation === null) {
7686
+ return selectedFilters;
7687
+ }
7688
+ return {
7689
+ ...selectedFilters,
7690
+ [parsedMutation.type]: [...selectedFilters[parsedMutation.type], parsedMutation.value]
7691
+ };
7692
+ },
7693
+ {
7694
+ nucleotideMutations: [],
7695
+ aminoAcidMutations: [],
7696
+ nucleotideInsertions: [],
7697
+ aminoAcidInsertions: []
7698
+ }
7699
+ );
7700
+ }
7701
+ function getPlaceholder(referenceGenome) {
7702
+ const segmentPrefix = referenceGenome.nucleotideSequences.length > 1 ? `${referenceGenome.nucleotideSequences[0].name}:` : "";
7703
+ const firstGene = referenceGenome.genes[0].name;
7704
+ return `Enter a mutation (e.g. ${segmentPrefix}A123T, ins_${segmentPrefix}123:AT, ${firstGene}:M123E, ins_${firstGene}:123:ME)`;
7705
+ }
7275
7706
  const SelectedMutationDisplay = ({ selectedFilters, setSelectedFilters, fireChangeEvent }) => {
7276
7707
  const onSelectedRemoved = (mutation, key) => {
7277
7708
  const newSelectedValues = {
@@ -7402,10 +7833,17 @@ var __decorateClass = (decorators, target, key, kind) => {
7402
7833
  return result;
7403
7834
  };
7404
7835
  let MutationFilterComponent = class extends PreactLitAdapter {
7836
+ constructor() {
7837
+ super(...arguments);
7838
+ this.initialValue = void 0;
7839
+ }
7405
7840
  render() {
7406
- return /* @__PURE__ */ u$1(MutationFilter, {});
7841
+ return /* @__PURE__ */ u$1(ReferenceGenomesAwaiter, { children: /* @__PURE__ */ u$1(MutationFilter, { initialValue: this.initialValue }) });
7407
7842
  }
7408
7843
  };
7844
+ __decorateClass([
7845
+ n2()
7846
+ ], MutationFilterComponent.prototype, "initialValue", 2);
7409
7847
  MutationFilterComponent = __decorateClass([
7410
7848
  t$2("gs-mutation-filter")
7411
7849
  ], MutationFilterComponent);