col-browser 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +17 -0
  2. package/es/bibtex.js +8 -0
  3. package/es/bibtex.js.map +1 -0
  4. package/es/chunks/AntdIcon-B1nMlqyh.js +984 -0
  5. package/es/chunks/AntdIcon-B1nMlqyh.js.map +1 -0
  6. package/es/chunks/BibTex-BqzD3qLB.js +13 -0
  7. package/es/chunks/BibTex-BqzD3qLB.js.map +1 -0
  8. package/es/chunks/DatasetCitation-bkPmDDYB.js +119 -0
  9. package/es/chunks/DatasetCitation-bkPmDDYB.js.map +1 -0
  10. package/es/chunks/DatasetlogoWithFallback-CbP7vRs_.js +823 -0
  11. package/es/chunks/DatasetlogoWithFallback-CbP7vRs_.js.map +1 -0
  12. package/es/chunks/Distributions-DDYEbGhW.js +1110 -0
  13. package/es/chunks/Distributions-DDYEbGhW.js.map +1 -0
  14. package/es/chunks/ErrorMsg-K8k5PPTp.js +26 -0
  15. package/es/chunks/ErrorMsg-K8k5PPTp.js.map +1 -0
  16. package/es/chunks/LinkOutlined-2IkQWTV7.js +22 -0
  17. package/es/chunks/LinkOutlined-2IkQWTV7.js.map +1 -0
  18. package/es/chunks/MergedDataBadge-DsTsn5Xu.js +134 -0
  19. package/es/chunks/MergedDataBadge-DsTsn5Xu.js.map +1 -0
  20. package/es/chunks/MetricsPresentation-U_CO8JoH.js +66 -0
  21. package/es/chunks/MetricsPresentation-U_CO8JoH.js.map +1 -0
  22. package/es/chunks/TaxonBreakdown-BshFaQql.js +205 -0
  23. package/es/chunks/TaxonBreakdown-BshFaQql.js.map +1 -0
  24. package/es/chunks/config-BPRXv9x8.js +31 -0
  25. package/es/chunks/config-BPRXv9x8.js.map +1 -0
  26. package/es/chunks/dataset-DvQG4NjA.js +30 -0
  27. package/es/chunks/dataset-DvQG4NjA.js.map +1 -0
  28. package/es/chunks/enumeration-yDQXSZsf.js +12 -0
  29. package/es/chunks/enumeration-yDQXSZsf.js.map +1 -0
  30. package/es/chunks/index-CNK3JADR.js +95 -0
  31. package/es/chunks/index-CNK3JADR.js.map +1 -0
  32. package/es/chunks/jsx-runtime-BzflLqGi.js +283 -0
  33. package/es/chunks/jsx-runtime-BzflLqGi.js.map +1 -0
  34. package/es/chunks/router-CssZk5qZ.js +109 -0
  35. package/es/chunks/router-CssZk5qZ.js.map +1 -0
  36. package/es/chunks/sector-BnVzMnMO.js +9 -0
  37. package/es/chunks/sector-BnVzMnMO.js.map +1 -0
  38. package/es/chunks/withDatasetKey-BgMY05XE.js +48 -0
  39. package/es/chunks/withDatasetKey-BgMY05XE.js.map +1 -0
  40. package/es/col-browser.css +1 -1
  41. package/es/index.js +18 -7964
  42. package/es/index.js.map +1 -1
  43. package/es/routing.js +5 -0
  44. package/es/routing.js.map +1 -0
  45. package/es/search.js +803 -0
  46. package/es/search.js.map +1 -0
  47. package/es/sourceDataset.js +453 -0
  48. package/es/sourceDataset.js.map +1 -0
  49. package/es/sourceDatasetList.js +366 -0
  50. package/es/sourceDatasetList.js.map +1 -0
  51. package/es/taxon.js +1643 -0
  52. package/es/taxon.js.map +1 -0
  53. package/es/taxonBreakdown.js +42 -0
  54. package/es/taxonBreakdown.js.map +1 -0
  55. package/es/taxonDistribution.js +48 -0
  56. package/es/taxonDistribution.js.map +1 -0
  57. package/es/tree.js +821 -0
  58. package/es/tree.js.map +1 -0
  59. package/package.json +51 -9
  60. package/types/bibtex.d.ts +1 -0
  61. package/types/index.d.ts +158 -0
  62. package/types/routing.d.ts +1 -0
  63. package/types/search.d.ts +1 -0
  64. package/types/sourceDataset.d.ts +1 -0
  65. package/types/sourceDatasetList.d.ts +1 -0
  66. package/types/taxon.d.ts +1 -0
  67. package/types/taxonBreakdown.d.ts +1 -0
  68. package/types/taxonDistribution.d.ts +1 -0
  69. package/types/tree.d.ts +1 -0
  70. package/umd/col-browser.js +20478 -27048
  71. package/umd/col-browser.js.map +1 -1
  72. package/umd/col-browser.min.js +5 -13
  73. package/umd/col-browser.min.js.map +1 -1
@@ -0,0 +1,205 @@
1
+ import { j as c } from "./jsx-runtime-BzflLqGi.js";
2
+ import { useState as w, useEffect as N } from "react";
3
+ import { c as A } from "./config-BPRXv9x8.js";
4
+ import { u as Z, c as T } from "./router-CssZk5qZ.js";
5
+ import C from "highcharts";
6
+ import "highcharts/modules/exporting";
7
+ import K from "highcharts-react-official";
8
+ import { get as l, keyBy as ee } from "lodash-es";
9
+ import { Row as te, Col as S, Spin as ne, Switch as se } from "antd";
10
+ const E = 100, oe = [
11
+ "kingdom",
12
+ "phylum",
13
+ "class",
14
+ "order",
15
+ "family",
16
+ "genus",
17
+ "species"
18
+ ], z = (t) => t ? `Not assigned ${t}` : "Not assigned", B = (t) => {
19
+ if (!t || t.length === 0) return [];
20
+ const o = [...t].sort((i, n) => (n.species || 0) - (i.species || 0));
21
+ return o.length <= E ? o : o.slice(0, E);
22
+ }, ie = (t, o) => {
23
+ const i = B(t || []), n = i.reduce((u, L) => u + (L.species || 0), 0);
24
+ return n >= o ? i : [
25
+ ...i,
26
+ {
27
+ name: z(l(i, "[0].rank", "")),
28
+ species: o - n,
29
+ children: []
30
+ }
31
+ ];
32
+ }, be = ({
33
+ taxon: t,
34
+ datasetKey: o,
35
+ rank: i = [],
36
+ dataset: n,
37
+ level: u = 1,
38
+ showLevelSwitch: L = !1,
39
+ darkMode: _
40
+ }) => {
41
+ const G = Z("taxon"), [I, H] = w(null), [W, k] = w(!1), [M, X] = w(!1), [m, R] = w(u);
42
+ N(() => {
43
+ R(u);
44
+ }, [u]), N(() => {
45
+ t != null && t.id && o && U();
46
+ }, [t, o, m]);
47
+ const P = async () => {
48
+ const r = await T(
49
+ `${A.dataApi}dataset/${o}/nameusage/search?TAXON_ID=${encodeURIComponent(
50
+ t.id
51
+ )}&facet=rank&status=accepted&status=provisionally%20accepted&limit=0`
52
+ );
53
+ return ee(l(r, "data.facets.rank", []), "value");
54
+ }, U = async () => {
55
+ k(!0);
56
+ try {
57
+ const r = await P(), d = oe;
58
+ let f = d.indexOf(l(t, "name.rank"));
59
+ if (f === -1) {
60
+ let s = i.indexOf(l(t, "name.rank")) + 1;
61
+ for (; f === -1 && s < i.length - 1; ) {
62
+ const h = d.indexOf(i[s]);
63
+ h > -1 && (f = h - 1), s++;
64
+ }
65
+ }
66
+ let p, x = f + 1;
67
+ for (; !p && x < d.length; ) {
68
+ const s = l(d, `[${x}]`);
69
+ s && l(r, `${s}.count`, 0) > 0 ? p = s : x++;
70
+ }
71
+ if (!p) {
72
+ X(!0), k(!1);
73
+ return;
74
+ }
75
+ const y = (await T(
76
+ `${A.dataApi}dataset/${o}/taxon/${t.id}/breakdown?level=${m}`
77
+ )).data || [], j = l(r, "species.count", 0);
78
+ k(!1), V(y, j);
79
+ } catch {
80
+ k(!1);
81
+ }
82
+ }, V = (r, d) => {
83
+ const f = n.doi ? "https://doi.org/" + n.doi : null, p = C.getOptions().colors, O = (typeof _ == "boolean" ? _ : typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches) ? "#1f1f1f" : "#ffffff", y = {
84
+ click: (e) => {
85
+ e.point._id && G(e.point._id);
86
+ }
87
+ }, s = ie(r, d).map((e, a) => ({
88
+ name: e.name,
89
+ y: e.species,
90
+ _id: e.id,
91
+ color: p[a % p.length],
92
+ _kids: e.children
93
+ })), h = [], g = m >= 2 && s.some((e) => e._kids && e._kids.length > 0);
94
+ g && s.forEach((e) => {
95
+ const a = B(e._kids || []), v = a.reduce((b, $) => b + ($.species || 0), 0);
96
+ a.forEach((b, $) => {
97
+ const Y = -0.1 + (a.length > 1 ? $ / (a.length - 1) : 0) * 0.4;
98
+ h.push({
99
+ name: b.name,
100
+ y: b.species,
101
+ _id: b.id,
102
+ color: C.color(e.color).brighten(Y).get()
103
+ });
104
+ }), v < e.y && h.push({
105
+ name: z(l(a, "[0].rank", "")),
106
+ y: e.y - v,
107
+ color: O,
108
+ borderColor: O,
109
+ borderWidth: 0,
110
+ dataLabels: { enabled: !1 }
111
+ });
112
+ });
113
+ const F = (e) => e.map(({ _kids: a, ...v }) => v), J = d || s.reduce((e, a) => e + a.y, 0), Q = g ? {
114
+ formatter: function() {
115
+ return this.y > J / 10 ? this.point.name : null;
116
+ },
117
+ distance: -30,
118
+ style: {
119
+ color: "contrast",
120
+ textOutline: "1px contrast",
121
+ fontWeight: "bold"
122
+ }
123
+ } : {
124
+ formatter: function() {
125
+ return this.y > 1 ? "<b>" + this.point.name + ":</b> " + this.y.toLocaleString("en-GB") : null;
126
+ }
127
+ }, D = [
128
+ {
129
+ name: "Species",
130
+ data: F(s),
131
+ size: g ? "60%" : "85%",
132
+ dataLabels: Q,
133
+ point: { events: y }
134
+ }
135
+ ];
136
+ g && D.push({
137
+ name: "Species",
138
+ data: h,
139
+ size: "85%",
140
+ innerSize: "60%",
141
+ dataLabels: {
142
+ formatter: function() {
143
+ return this.y > 1 ? "<b>" + this.point.name + ":</b> " + this.y.toLocaleString("en-GB") : null;
144
+ }
145
+ },
146
+ point: { events: y }
147
+ }), H({
148
+ chart: { type: "pie" },
149
+ credits: {
150
+ text: `${t.name.scientificName} in ${n.title}${n.version ? " (" + n.version + ")" : ""}. ${(n.doi ? "DOI:" + n.doi : null) || n.url || ""}`,
151
+ href: f || n.url || ""
152
+ },
153
+ title: { text: "" },
154
+ plotOptions: { pie: { shadow: !1, center: ["50%", "50%"] } },
155
+ tooltip: {},
156
+ series: D,
157
+ responsive: {
158
+ rules: [
159
+ {
160
+ condition: { maxWidth: 400 },
161
+ chartOptions: {
162
+ series: g ? [{}, { dataLabels: { enabled: !1 } }] : [{}]
163
+ }
164
+ }
165
+ ]
166
+ },
167
+ exporting: {
168
+ chartOptions: {
169
+ plotOptions: { series: { dataLabels: { enabled: !0 } } }
170
+ },
171
+ fallbackToExportServer: !1
172
+ }
173
+ });
174
+ };
175
+ if (M) return null;
176
+ const q = L ? /* @__PURE__ */ c.jsx(
177
+ se,
178
+ {
179
+ size: "small",
180
+ checked: m === 2,
181
+ onChange: (r) => R(r ? 2 : 1),
182
+ checkedChildren: "lvl2",
183
+ unCheckedChildren: "lvl1",
184
+ style: {
185
+ position: "absolute",
186
+ top: 11,
187
+ right: 44,
188
+ zIndex: 2,
189
+ background: m === 2 ? "#8c8c8c" : "#bfbfbf"
190
+ }
191
+ }
192
+ ) : null;
193
+ return /* @__PURE__ */ c.jsxs("div", { style: { position: "relative" }, children: [
194
+ q,
195
+ W || !I ? /* @__PURE__ */ c.jsxs(te, { style: { padding: "48px" }, children: [
196
+ /* @__PURE__ */ c.jsx(S, { flex: "auto" }),
197
+ /* @__PURE__ */ c.jsx(S, { children: /* @__PURE__ */ c.jsx(ne, { size: "large" }) }),
198
+ /* @__PURE__ */ c.jsx(S, { flex: "auto" })
199
+ ] }) : /* @__PURE__ */ c.jsx(K, { highcharts: C, options: I })
200
+ ] });
201
+ };
202
+ export {
203
+ be as T
204
+ };
205
+ //# sourceMappingURL=TaxonBreakdown-BshFaQql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxonBreakdown-BshFaQql.js","sources":["../../src/Taxon/TaxonBreakdown.js"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport config from \"../config\";\nimport client from \"../api/client\";\nimport Highcharts from \"highcharts\";\nimport \"highcharts/modules/exporting\";\nimport HighchartsReact from \"highcharts-react-official\";\nimport { get, keyBy } from \"lodash-es\";\nimport { Spin, Row, Col, Switch } from \"antd\";\nimport { useNavigateTo } from \"../router\";\n\nconst MAX_SLICES_PER_RING = 100;\nconst canonicalRanks = [\n \"kingdom\",\n \"phylum\",\n \"class\",\n \"order\",\n \"family\",\n \"genus\",\n \"species\",\n];\n\nconst notAssignedLabel = (rk) => (rk ? `Not assigned ${rk}` : \"Not assigned\");\n\nconst sortAndClip = (nodes) => {\n if (!nodes || nodes.length === 0) return [];\n const sorted = [...nodes].sort((a, b) => (b.species || 0) - (a.species || 0));\n return sorted.length <= MAX_SLICES_PER_RING\n ? sorted\n : sorted.slice(0, MAX_SLICES_PER_RING);\n};\n\n// Append a \"Not assigned <rank>\" slice for the difference between a parent's\n// total species count and the sum of its visible children. Covers two cases:\n// 1. species that sit directly under the parent without an intermediate rank\n// 2. species under children that were clipped out by sortAndClip\nconst padNotAssigned = (kids, parentSpecies) => {\n const sorted = sortAndClip(kids || []);\n const sum = sorted.reduce((a, n) => a + (n.species || 0), 0);\n if (sum >= parentSpecies) return sorted;\n return [\n ...sorted,\n {\n name: notAssignedLabel(get(sorted, \"[0].rank\", \"\")),\n species: parentSpecies - sum,\n children: [],\n },\n ];\n};\n\nconst TaxonBreakdown = ({\n taxon,\n datasetKey,\n rank = [],\n dataset,\n level = 1,\n showLevelSwitch = false,\n darkMode,\n}) => {\n const navigateToTaxon = useNavigateTo(\"taxon\");\n const [options, setOptions] = useState(null);\n const [loading, setLoading] = useState(false);\n const [invalid, setInvalid] = useState(false);\n // The chart's effective level is controlled internally when the switch\n // is enabled, so toggling can refetch + re-render the chart. Otherwise\n // the prop drives directly.\n const [activeLevel, setActiveLevel] = useState(level);\n useEffect(() => {\n setActiveLevel(level);\n }, [level]);\n useEffect(() => {\n if (taxon?.id && datasetKey) {\n getData();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [taxon, datasetKey, activeLevel]);\n\n const getOverView = async () => {\n const res = await client(\n `${\n config.dataApi\n }dataset/${datasetKey}/nameusage/search?TAXON_ID=${encodeURIComponent(\n taxon.id\n )}&facet=rank&status=accepted&status=provisionally%20accepted&limit=0`\n );\n return keyBy(get(res, \"data.facets.rank\", []), \"value\");\n };\n\n const getData = async () => {\n setLoading(true);\n try {\n const counts = await getOverView();\n\n // confirm the focal taxon has at least one child rank with content\n const ranks = canonicalRanks;\n let taxonRankIdx = ranks.indexOf(get(taxon, \"name.rank\"));\n if (taxonRankIdx === -1) {\n let rankIndex = rank.indexOf(get(taxon, \"name.rank\")) + 1;\n while (taxonRankIdx === -1 && rankIndex < rank.length - 1) {\n const canonicalRankIndex = ranks.indexOf(rank[rankIndex]);\n if (canonicalRankIndex > -1) {\n taxonRankIdx = canonicalRankIndex - 1;\n }\n rankIndex++;\n }\n }\n let childRank;\n let childRankIndex = taxonRankIdx + 1;\n while (!childRank && childRankIndex < ranks.length) {\n const nextRank = get(ranks, `[${childRankIndex}]`);\n if (nextRank && get(counts, `${nextRank}.count`, 0) > 0) {\n childRank = nextRank;\n } else {\n childRankIndex++;\n }\n }\n if (!childRank) {\n setInvalid(true);\n setLoading(false);\n return;\n }\n\n const res = await client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${taxon.id}/breakdown?level=${activeLevel}`\n );\n const children = res.data || [];\n const totalSpecies = get(counts, \"species.count\", 0);\n\n setLoading(false);\n buildChart(children, totalSpecies);\n } catch (err) {\n setLoading(false);\n }\n };\n\n const buildChart = (children, totalSpecies) => {\n const DOI = dataset.doi ? \"https://doi.org/\" + dataset.doi : null;\n const baseColors = Highcharts.getOptions().colors;\n // Colour used for outer-ring \"gap\" slices: match the page background so\n // the wedge reads as empty space rather than overlapping the inner pie.\n // Follows the explicit `darkMode` prop if given, otherwise prefers-color-scheme.\n const prefersDark =\n typeof darkMode === \"boolean\"\n ? darkMode\n : typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const gapColor = prefersDark ? \"#1f1f1f\" : \"#ffffff\";\n const taxonClickHandler = {\n click: (e) => {\n if (e.point._id) {\n navigateToTaxon(e.point._id);\n }\n },\n };\n\n // Inner pie: direct children of the focal taxon. Pad with a single\n // \"Not assigned <rank>\" slice if focal-taxon species don't fully sum up.\n const innerNodes = padNotAssigned(children, totalSpecies);\n const innerData = innerNodes.map((n, i) => ({\n name: n.name,\n y: n.species,\n _id: n.id,\n color: baseColors[i % baseColors.length],\n _kids: n.children,\n }));\n\n // Outer ring: children of each inner slice (grandchildren of focal),\n // coloured as a monochrome brightness shift of the parent so each\n // family of arcs reads as one hue group. Only rendered when level >= 2\n // AND the response actually carries that depth. With level=1 we draw\n // a single-ring pie even if the API returned nested children.\n const outerData = [];\n const hasOuterData =\n activeLevel >= 2 && innerData.some((s) => s._kids && s._kids.length > 0);\n if (hasOuterData) {\n innerData.forEach((slice) => {\n const sorted = sortAndClip(slice._kids || []);\n const sum = sorted.reduce((a, n) => a + (n.species || 0), 0);\n sorted.forEach((g, j) => {\n const t = sorted.length > 1 ? j / (sorted.length - 1) : 0;\n const shift = -0.1 + t * 0.4;\n outerData.push({\n name: g.name,\n y: g.species,\n _id: g.id,\n color: Highcharts.color(slice.color).brighten(shift).get(),\n });\n });\n // Where children don't fully account for the inner slice, add a\n // transparent gap slice so the outer ring stays angularly aligned\n // with the inner pie but the missing portion reads as empty space\n // (rather than a labelled \"Not assigned\" wedge).\n if (sum < slice.y) {\n outerData.push({\n name: notAssignedLabel(get(sorted, \"[0].rank\", \"\")),\n y: slice.y - sum,\n color: gapColor,\n borderColor: gapColor,\n borderWidth: 0,\n dataLabels: { enabled: false },\n });\n }\n });\n }\n\n const clean = (rows) => rows.map(({ _kids, ...rest }) => rest);\n const grandTotal = totalSpecies || innerData.reduce((a, s) => a + s.y, 0);\n\n const innerLabelStyle = {\n color: \"contrast\",\n textOutline: \"1px contrast\",\n fontWeight: \"bold\",\n };\n\n // Inner-ring data labels: only positioned inside the ring when there's\n // an outer ring fighting for the external label gutter. With just one\n // ring (level=1) the labels live outside the chart, same as the outer\n // ring at level=2, with the slice name + species count.\n const innerDataLabels = hasOuterData\n ? {\n formatter: function () {\n return this.y > grandTotal / 10 ? this.point.name : null;\n },\n distance: -30,\n style: innerLabelStyle,\n }\n : {\n formatter: function () {\n return this.y > 1\n ? \"<b>\" +\n this.point.name +\n \":</b> \" +\n this.y.toLocaleString(\"en-GB\")\n : null;\n },\n };\n\n const series = [\n {\n name: \"Species\",\n data: clean(innerData),\n size: hasOuterData ? \"60%\" : \"85%\",\n dataLabels: innerDataLabels,\n point: { events: taxonClickHandler },\n },\n ];\n if (hasOuterData) {\n series.push({\n name: \"Species\",\n data: outerData,\n size: \"85%\",\n innerSize: \"60%\",\n dataLabels: {\n formatter: function () {\n return this.y > 1\n ? \"<b>\" +\n this.point.name +\n \":</b> \" +\n this.y.toLocaleString(\"en-GB\")\n : null;\n },\n },\n point: { events: taxonClickHandler },\n });\n }\n\n setOptions({\n chart: { type: \"pie\" },\n credits: {\n text: `${taxon.name.scientificName} in ${dataset.title}${\n dataset.version ? \" (\" + dataset.version + \")\" : \"\"\n }. ${(dataset.doi ? \"DOI:\" + dataset.doi : null) || dataset.url || \"\"}`,\n href: DOI || dataset.url || \"\",\n },\n title: { text: \"\" },\n plotOptions: { pie: { shadow: false, center: [\"50%\", \"50%\"] } },\n tooltip: {},\n series,\n responsive: {\n rules: [\n {\n condition: { maxWidth: 400 },\n chartOptions: {\n series: hasOuterData\n ? [{}, { dataLabels: { enabled: false } }]\n : [{}],\n },\n },\n ],\n },\n exporting: {\n chartOptions: {\n plotOptions: { series: { dataLabels: { enabled: true } } },\n },\n fallbackToExportServer: false,\n },\n });\n };\n\n if (invalid) return null;\n\n // Place the level toggle inside the chart's top-right area, just left of\n // the Highcharts context-menu (≡) icon, so it doesn't consume an extra\n // row. Colourless switch with lvl1 / lvl2 labels.\n const levelSwitch = showLevelSwitch ? (\n <Switch\n size=\"small\"\n checked={activeLevel === 2}\n onChange={(checked) => setActiveLevel(checked ? 2 : 1)}\n checkedChildren=\"lvl2\"\n unCheckedChildren=\"lvl1\"\n style={{\n position: \"absolute\",\n top: 11,\n right: 44,\n zIndex: 2,\n background: activeLevel === 2 ? \"#8c8c8c\" : \"#bfbfbf\",\n }}\n />\n ) : null;\n\n return (\n <div style={{ position: \"relative\" }}>\n {levelSwitch}\n {loading || !options ? (\n <Row style={{ padding: \"48px\" }}>\n <Col flex=\"auto\"></Col>\n <Col>\n <Spin size=\"large\" />\n </Col>\n <Col flex=\"auto\"></Col>\n </Row>\n ) : (\n <HighchartsReact highcharts={Highcharts} options={options} />\n )}\n </div>\n );\n};\n\nexport default TaxonBreakdown;\n"],"names":["MAX_SLICES_PER_RING","canonicalRanks","notAssignedLabel","rk","sortAndClip","nodes","sorted","a","b","padNotAssigned","kids","parentSpecies","sum","n","get","TaxonBreakdown","taxon","datasetKey","rank","dataset","level","showLevelSwitch","darkMode","navigateToTaxon","useNavigateTo","options","setOptions","useState","loading","setLoading","invalid","setInvalid","activeLevel","setActiveLevel","useEffect","getData","getOverView","res","client","config","keyBy","counts","ranks","taxonRankIdx","rankIndex","canonicalRankIndex","childRank","childRankIndex","nextRank","children","totalSpecies","buildChart","DOI","baseColors","Highcharts","gapColor","taxonClickHandler","innerData","i","outerData","hasOuterData","s","slice","g","j","shift","clean","rows","_kids","rest","grandTotal","innerDataLabels","series","levelSwitch","jsx","Switch","checked","jsxs","Row","Col","Spin","HighchartsReact"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAsB,KACtBC,KAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAmB,CAACC,MAAQA,IAAK,gBAAgBA,CAAE,KAAK,gBAExDC,IAAc,CAACC,MAAU;AAC7B,MAAI,CAACA,KAASA,EAAM,WAAW,UAAU,CAAA;AACzC,QAAMC,IAAS,CAAC,GAAGD,CAAK,EAAE,KAAK,CAACE,GAAGC,OAAOA,EAAE,WAAW,MAAMD,EAAE,WAAW,EAAE;AAC5E,SAAOD,EAAO,UAAUN,IACpBM,IACAA,EAAO,MAAM,GAAGN,CAAmB;AACzC,GAMMS,KAAiB,CAACC,GAAMC,MAAkB;AAC9C,QAAML,IAASF,EAAYM,KAAQ,EAAE,GAC/BE,IAAMN,EAAO,OAAO,CAACC,GAAGM,MAAMN,KAAKM,EAAE,WAAW,IAAI,CAAC;AAC3D,SAAID,KAAOD,IAAsBL,IAC1B;AAAA,IACL,GAAGA;AAAA,IACH;AAAA,MACE,MAAMJ,EAAiBY,EAAIR,GAAQ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SAAQ,GACrB;AAAA,MACAN,gBAAAA,EAAAA,IAACK,GAAA,EAAI,MAAK,OAAA,CAAO;AAAA,IAAA,EAAA,CACnB,IAEAL,gBAAAA,EAAAA,IAACO,GAAA,EAAgB,YAAY3B,GAAY,SAAA7B,EAAA,CAAkB;AAAA,EAAA,GAE/D;AAEJ;"}
@@ -0,0 +1,31 @@
1
+ import { j as i } from "./jsx-runtime-BzflLqGi.js";
2
+ import "react";
3
+ import { theme as m, ConfigProvider as p } from "antd";
4
+ function d(t) {
5
+ const o = (h) => {
6
+ const { theme: a, darkMode: r, ...s } = h;
7
+ if (!a && !r)
8
+ return /* @__PURE__ */ i.jsx(t, { ...s });
9
+ const e = { ...a || {} };
10
+ return r && !e.algorithm && (e.algorithm = m.darkAlgorithm), /* @__PURE__ */ i.jsx(p, { theme: e, children: /* @__PURE__ */ i.jsx(t, { darkMode: r, ...s }) });
11
+ };
12
+ return o.displayName = `withTheme(${t.displayName || t.name || "Component"})`, o;
13
+ }
14
+ const f = {
15
+ dataApi: "https://api.checklistbank.org/",
16
+ // Human-facing ChecklistBank portal. Used for outbound links to
17
+ // dataset / publisher pages we don't host ourselves.
18
+ clbPortal: "https://www.checklistbank.org",
19
+ // GBIF API base (no trailing slash). Used for the occurrence count and
20
+ // the v2 map tile endpoint.
21
+ gbifApi: "https://api.gbif.org",
22
+ // GBIF human-facing portal where the attribution link points. Stays on
23
+ // demo.gbif.org until the multitaxonomy occurrence search ships on
24
+ // www.gbif.org (expected mid-2026).
25
+ gbifPortal: "https://demo.gbif.org"
26
+ };
27
+ export {
28
+ f as c,
29
+ d as w
30
+ };
31
+ //# sourceMappingURL=config-BPRXv9x8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-BPRXv9x8.js","sources":["../../src/withTheme.js","../../src/config.js"],"sourcesContent":["import React from \"react\";\nimport { ConfigProvider, theme as antdTheme } from \"antd\";\n\n// Optional antd theming. Embedders can pass:\n// - `theme`: a full antd ThemeConfig (token / algorithm / components),\n// forwarded straight to ConfigProvider.\n// - `darkMode`: convenience boolean. When true and theme.algorithm is not\n// set, antd's darkAlgorithm is applied.\n// When neither prop is provided we render the wrapped component directly,\n// without a ConfigProvider, so the library's defaults are untouched.\nexport function withTheme(Component) {\n const Wrapped = (props) => {\n const { theme, darkMode, ...rest } = props;\n\n if (!theme && !darkMode) {\n return <Component {...rest} />;\n }\n\n const merged = { ...(theme || {}) };\n if (darkMode && !merged.algorithm) {\n merged.algorithm = antdTheme.darkAlgorithm;\n }\n\n return (\n <ConfigProvider theme={merged}>\n <Component darkMode={darkMode} {...rest} />\n </ConfigProvider>\n );\n };\n Wrapped.displayName = `withTheme(${\n Component.displayName || Component.name || \"Component\"\n })`;\n return Wrapped;\n}\n\nexport default withTheme;\n","export default {\n dataApi: \"https://api.checklistbank.org/\",\n // Human-facing ChecklistBank portal. Used for outbound links to\n // dataset / publisher pages we don't host ourselves.\n clbPortal: \"https://www.checklistbank.org\",\n // GBIF API base (no trailing slash). Used for the occurrence count and\n // the v2 map tile endpoint.\n gbifApi: \"https://api.gbif.org\",\n // GBIF human-facing portal where the attribution link points. Stays on\n // demo.gbif.org until the multitaxonomy occurrence search ships on\n // www.gbif.org (expected mid-2026).\n gbifPortal: \"https://demo.gbif.org\",\n};"],"names":["withTheme","Component","Wrapped","props","theme","darkMode","rest","jsx","merged","antdTheme","ConfigProvider","config"],"mappings":";;;AAUO,SAASA,EAAUC,GAAW;AACnC,QAAMC,IAAU,CAACC,MAAU;AACzB,UAAM,EAAA,OAAEC,GAAO,UAAAC,GAAU,GAAGC,MAASH;AAErC,QAAI,CAACC,KAAS,CAACC;AACb,aAAOE,gBAAAA,MAACN,GAAA,EAAW,GAAGK,EAAA,CAAM;AAG9B,UAAME,IAAS,EAAE,GAAIJ,KAAS,GAAC;AAC/B,WAAIC,KAAY,CAACG,EAAO,cACtBA,EAAO,YAAYC,EAAU,gBAI7BF,gBAAAA,EAAAA,IAACG,KAAe,OAAOF,GACrB,gCAACP,GAAA,EAAU,UAAAI,GAAqB,GAAGC,EAAA,CAAM,EAAA,CAC3C;AAAA,EAEJ;AACA,SAAAJ,EAAQ,cAAc,aACpBD,EAAU,eAAeA,EAAU,QAAQ,WAC7C,KACOC;AACT;ACjCA,MAAAS,IAAe;AAAA,EACX,SAAS;AAAA;AAAA;AAAA,EAGT,WAAW;AAAA;AAAA;AAAA,EAGX,SAAS;AAAA;AAAA;AAAA;AAAA,EAIT,YAAY;AAChB;"}
@@ -0,0 +1,30 @@
1
+ import { c } from "./router-CssZk5qZ.js";
2
+ import { c as s } from "./config-BPRXv9x8.js";
3
+ const p = (t) => t.then(
4
+ (e) => e.data,
5
+ (e) => null
6
+ ), $ = (t, e) => {
7
+ if (!(t != null && t.length)) return Promise.resolve([]);
8
+ const n = () => t.map(() => null), l = t.map((r) => `id=${encodeURIComponent(r)}`).join("&");
9
+ return c(`${s.dataApi}dataset/${e}/source/simple?${l}`).then((r) => {
10
+ try {
11
+ const o = /* @__PURE__ */ new Map();
12
+ return (Array.isArray(r == null ? void 0 : r.data) ? r.data : []).forEach((a) => {
13
+ a && a.key != null && o.set(a.key, a);
14
+ }), t.map((a) => o.get(a) ?? o.get(Number(a)) ?? null);
15
+ } catch {
16
+ return n();
17
+ }
18
+ }).catch(() => n());
19
+ }, h = (t, e) => Promise.all(
20
+ t.map(
21
+ (n) => p(c(`${s.dataApi}dataset/${e}/sector/publisher/${n}`))
22
+ )
23
+ ), g = (t) => c(`${s.dataApi}dataset/${t}`), f = (t) => c(`${s.dataApi}dataset/${t}`);
24
+ export {
25
+ f as a,
26
+ $ as b,
27
+ h as c,
28
+ g
29
+ };
30
+ //# sourceMappingURL=dataset-DvQG4NjA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataset-DvQG4NjA.js","sources":["../../src/api/dataset.js"],"sourcesContent":["import client from \"./client\";\nimport config from \"../config\";\n\nconst reflect = (p) =>\n p.then(\n (v) => v.data,\n (e) => null\n );\n\n// Bulk lookup using the API's `/source/simple?id=…&id=…` endpoint. One\n// HTTP request resolves all ids in the batch. The endpoint returns a\n// lightweight dataset object per id; results may come back in any order,\n// so we reorder by `key` to match what DataLoader expects (same length\n// and same order as the requested ids).\n//\n// Tolerates any failure mode (404, network error, malformed response, …)\n// by resolving every id in the failing batch to null. Returning the\n// expected-length array is critical — DataLoader rejects every pending\n// load() if the batch function rejects or returns the wrong length, and\n// the per-id load() rejections would in turn reject the Promise.all in\n// TaxonSources and leave the popover spinner stuck.\nexport const getDatasetsBatch = (ids, datasetKey) => {\n if (!ids?.length) return Promise.resolve([]);\n const nullsForAll = () => ids.map(() => null);\n const params = ids.map((id) => `id=${encodeURIComponent(id)}`).join(\"&\");\n return client(`${config.dataApi}dataset/${datasetKey}/source/simple?${params}`)\n .then((res) => {\n try {\n const byKey = new Map();\n const arr = Array.isArray(res?.data) ? res.data : [];\n arr.forEach((d) => {\n if (d && d.key != null) byKey.set(d.key, d);\n });\n return ids.map((id) => byKey.get(id) ?? byKey.get(Number(id)) ?? null);\n } catch (parseErr) {\n return nullsForAll();\n }\n })\n .catch(() => nullsForAll());\n};\n\nexport const getPublishersBatch = (ids, datasetKey) => {\n return Promise.all(\n ids.map((i) =>\n reflect(client(`${config.dataApi}dataset/${datasetKey}/sector/publisher/${i}`))\n )\n );\n};\n\nexport const getCatalogues = () => {\n return client(`${config.dataApi}dataset/catalogues`).then(({ data }) =>\n getDatasetsBatch(data)\n );\n};\n\nexport const getDataset = (datasetKey) =>\n client(`${config.dataApi}dataset/${datasetKey}`);\n\n// Lightweight dataset descriptor — includes `origin`, `title`, `version`,\n// `key`, etc. Used by Search to gate filter UI on the dataset's origin.\n// TODO: switch to `/dataset/{key}/simple` once that endpoint deploys.\n// The full /dataset/{key} response is a superset, so it works today.\nexport const getDatasetSimple = (datasetKey) =>\n client(`${config.dataApi}dataset/${datasetKey}`);\n"],"names":["reflect","p","v","getDatasetsBatch","ids","datasetKey","nullsForAll","params","id","client","config","res","byKey","d","getPublishersBatch","i","getDataset","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+ import { c as a } from "./router-CssZk5qZ.js";
2
+ import { c as o } from "./config-BPRXv9x8.js";
3
+ const c = () => a(`${o.dataApi}vocab/country`).then(
4
+ (t) => t.data
5
+ ), e = () => a(`${o.dataApi}vocab/taxgroup`).then(
6
+ (t) => t.data
7
+ );
8
+ export {
9
+ e as a,
10
+ c as g
11
+ };
12
+ //# sourceMappingURL=enumeration-yDQXSZsf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enumeration-yDQXSZsf.js","sources":["../../src/api/enumeration.js"],"sourcesContent":["// import axiosInstance from './util/axiosInstance';\nimport client from \"./client\";\nimport config from \"../config\";\n\nexport const getFrequency = () => {\n return client(`${config.dataApi}vocab/frequency`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getDatasetType = () => {\n return client(`${config.dataApi}vocab/datasettype`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getDataFormatType = () => {\n return client(`${config.dataApi}vocab/dataformat`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getDatasetOrigin = () => {\n return client(`${config.dataApi}vocab/datasetorigin`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getRank = () => {\n return client(`${config.dataApi}vocab/rank`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getTaxonomicStatus = () => {\n return client(`${config.dataApi}vocab/taxonomicstatus`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getIssue = () => {\n return client(`${config.dataApi}vocab/issue`).then(res =>\n res.data\n );\n};\n\nexport const getNameType = () => {\n return client(`${config.dataApi}vocab/nametype`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getNameField = () => {\n return client(`${config.dataApi}vocab/namefield`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getNomStatus = () => {\n return client(`${config.dataApi}vocab/nomstatus`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getLicense = () => {\n return client(`${config.dataApi}vocab/license`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getNomCode = () => {\n return client(`${config.dataApi}vocab/nomcode`).then(res =>\n res.data\n );\n};\n\nexport const getImportState = () => {\n return client(`${config.dataApi}vocab/importstate`).then(res =>\n res.data\n );\n};\n\nexport const getLifezones = () => {\n return client(`${config.dataApi}vocab/lifezone`).then(res =>\n res.data\n );\n};\n\nexport const getSectorImportState = () => {\n return client(`${config.dataApi}vocab/sectorimport$state`).then(res =>\n res.data.map(e => e.name)\n );\n};\n\nexport const getCountries = () => {\n return client(`${config.dataApi}vocab/country`).then(res =>\n res.data\n );\n};\n\nexport const getTaxGroup = () => {\n return client(`${config.dataApi}vocab/taxgroup`).then(res =>\n res.data\n );\n};\n\n\n\n\n"],"names":["getCountries","client","config","res","getTaxGroup"],"mappings":";;AA8FO,MAAMA,IAAe,MACnBC,EAAO,GAAGC,EAAO,OAAO,eAAe,EAAE;AAAA,EAAK,OACnDC,EAAI;AAAA,GAIKC,IAAc,MAClBH,EAAO,GAAGC,EAAO,OAAO,gBAAgB,EAAE;AAAA,EAAK,OACpDC,EAAI;AAAA;"}
@@ -0,0 +1,95 @@
1
+ import { j as K } from "./jsx-runtime-BzflLqGi.js";
2
+ import { useState as j, useEffect as k, useMemo as g, useCallback as T } from "react";
3
+ import d from "query-string";
4
+ const y = (n) => n === "hash", b = (n) => {
5
+ if (y(n)) {
6
+ const o = typeof window < "u" && window.location.hash || "", e = o.startsWith("#") ? o.slice(1) : o, t = e.indexOf("?");
7
+ return {
8
+ path: t >= 0 ? e.slice(0, t) : e,
9
+ search: t >= 0 ? e.slice(t) : ""
10
+ };
11
+ }
12
+ return {
13
+ path: typeof window < "u" && window.location.pathname || "",
14
+ search: typeof window < "u" && window.location.search || ""
15
+ };
16
+ }, v = (n, o, e) => {
17
+ const t = e && Object.keys(e).length > 0 ? `?${d.stringify(e, { arrayFormat: "none" })}` : "";
18
+ if (y(n)) {
19
+ const s = `${o}${t}`;
20
+ window.location.hash = s;
21
+ } else {
22
+ const s = `${o}${t}`;
23
+ window.history.pushState(null, "", s), window.dispatchEvent(new PopStateEvent("popstate"));
24
+ }
25
+ }, E = (n, o) => {
26
+ const e = y(n) ? "hashchange" : "popstate";
27
+ return window.addEventListener(e, o), () => window.removeEventListener(e, o);
28
+ }, f = (n, o, e) => {
29
+ if (!o) return null;
30
+ const t = e == null || typeof e == "object" ? "" : String(e), s = typeof e == "object" && e && Object.keys(e).length > 0 ? `?${d.stringify(e, { arrayFormat: "none" })}` : "", r = `${o}${t}${s}`;
31
+ return y(n) ? `#${r}` : r;
32
+ }, p = (n, o, e, t) => {
33
+ if (!e) return;
34
+ if (o === "reload") {
35
+ const a = f(n, e, t);
36
+ a != null && typeof window < "u" && window.location.assign(a);
37
+ return;
38
+ }
39
+ let s = e, r = null;
40
+ typeof t == "string" || typeof t == "number" ? s = `${e}${t}` : t && typeof t == "object" && (r = t), v(n, s, r);
41
+ }, N = (n, o, e) => ({
42
+ hrefForTaxon: (t) => f(n, e.taxon, t),
43
+ hrefForTree: (t) => f(n, e.tree, t),
44
+ hrefForSearch: (t) => f(n, e.search, t),
45
+ hrefForSource: (t) => f(n, e.source, t),
46
+ onNavigateToTaxon: (t) => p(n, o, e.taxon, t),
47
+ onNavigateToTree: (t) => p(n, o, e.tree, t),
48
+ onNavigateToSearch: (t) => p(n, o, e.search, t),
49
+ onNavigateToSource: (t) => p(n, o, e.source, t)
50
+ }), u = (n, o) => {
51
+ if (o) {
52
+ if (!n.startsWith(o)) {
53
+ const e = n.indexOf(o);
54
+ return e < 0 ? void 0 : n.slice(e + o.length).split("/").filter(Boolean).pop();
55
+ }
56
+ return n.slice(o.length).split("/").filter(Boolean).pop();
57
+ }
58
+ };
59
+ function I(n, o) {
60
+ const { kind: e, mode: t = "path", navigation: s = "spa", paths: r = {} } = o, a = (m) => {
61
+ const [B, S] = j(0);
62
+ k(() => E(t, () => S((l) => l + 1)), []);
63
+ const { path: c, search: $ } = b(t), F = g(() => N(t, s, r), []);
64
+ let i = {};
65
+ if (e === "taxon")
66
+ i.taxonKey = u(c, r.taxon);
67
+ else if (e === "source")
68
+ i.sourceDatasetKey = u(c, r.source);
69
+ else if (e === "taxonBreakdown")
70
+ i.taxonId = u(c, r.taxonBreakdown);
71
+ else if (e === "taxonDistribution")
72
+ i.taxonId = u(c, r.taxonDistribution);
73
+ else if (e === "bibtex")
74
+ i.sourceDatasetKey = u(c, r.bibtex);
75
+ else if (e === "tree") {
76
+ const l = d.parse($);
77
+ i.expandedTaxonKey = l.taxonKey || void 0, i.onExpandedTaxonKeyChange = T((h) => {
78
+ const w = b(t), x = d.parse(w.search);
79
+ h ? x.taxonKey = h : delete x.taxonKey, v(t, w.path || r.tree || "/", x);
80
+ }, []);
81
+ } else if (e === "search") {
82
+ const l = d.parse($, { arrayFormat: "none" });
83
+ i.filters = l, i.onFiltersChange = T((h) => {
84
+ const w = b(t);
85
+ v(t, w.path || r.search || "/", h);
86
+ }, []);
87
+ }
88
+ return /* @__PURE__ */ K.jsx(n, { ...F, ...i, ...m });
89
+ };
90
+ return a.displayName = `withRouting(${n.displayName || n.name || "Component"})`, a;
91
+ }
92
+ export {
93
+ I as w
94
+ };
95
+ //# sourceMappingURL=index-CNK3JADR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CNK3JADR.js","sources":["../../src/url/index.js"],"sourcesContent":["import React, { useState, useEffect, useMemo, useCallback } from \"react\";\nimport qs from \"query-string\";\n\n// withRouting(Component, options): adapts a controlled col-browser\n// component to read/write the host page's URL.\n//\n// options.kind — one of \"taxon\" | \"tree\" | \"source\" | \"sourceList\" |\n// \"search\" | \"taxonBreakdown\" | \"taxonDistribution\" |\n// \"bibtex\"\n// options.mode — \"path\" (recommended for the COL portal) or \"hash\"\n// (used by the GitHub Pages demo)\n// options.navigation — \"spa\" (default) or \"reload\". Controls what the four\n// onNavigateToX callbacks do when an in-component\n// action triggers cross-page navigation (e.g. a\n// Highcharts pie segment click with no <a href>\n// fallback). \"spa\" uses history.pushState — right\n// for SPA hosts (react-router, Next.js, TanStack\n// Router). \"reload\" calls window.location.assign,\n// forcing the browser to load the target page —\n// right for static / multi-page hosts (a Jekyll\n// portal, the GitHub Pages demo, any plain HTML).\n// The in-component state callbacks\n// (onExpandedTaxonKeyChange, onFiltersChange) always\n// use pushState so they don't reload the page while\n// the user is interacting with a single component.\n// options.paths — prefix strings for the four navigation targets, e.g.\n// { taxon: \"/taxon/\", tree: \"/tree\", search: \"/search\",\n// source: \"/source/\" }. For hash mode, the prefixes\n// are applied to window.location.hash (without the\n// leading #). Both modes use plain pathnames; query\n// strings are only used for `expandedTaxonKey` (Tree)\n// and `filters` (Search).\n//\n// All wrappers provide the four hrefForX + onNavigateToX pairs, derived\n// from `paths` and the active routing mode. Kind-specific wrappers also\n// inject the controlled identifier and the appropriate change handler\n// (e.g. `filters` + `onFiltersChange` for Search).\n\nconst isHash = (mode) => mode === \"hash\";\n\nconst readLocationKind = (mode) => {\n if (isHash(mode)) {\n const raw = (typeof window !== \"undefined\" && window.location.hash) || \"\";\n const hash = raw.startsWith(\"#\") ? raw.slice(1) : raw;\n const qIdx = hash.indexOf(\"?\");\n return {\n path: qIdx >= 0 ? hash.slice(0, qIdx) : hash,\n search: qIdx >= 0 ? hash.slice(qIdx) : \"\",\n };\n }\n return {\n path: (typeof window !== \"undefined\" && window.location.pathname) || \"\",\n search: (typeof window !== \"undefined\" && window.location.search) || \"\",\n };\n};\n\nconst writeLocation = (mode, path, search) => {\n const searchStr = search && Object.keys(search).length > 0\n ? `?${qs.stringify(search, { arrayFormat: \"none\" })}`\n : \"\";\n if (isHash(mode)) {\n const next = `${path}${searchStr}`;\n window.location.hash = next;\n } else {\n const url = `${path}${searchStr}`;\n window.history.pushState(null, \"\", url);\n // notify any listeners (the adapter subscribes via popstate / hashchange)\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }\n};\n\nconst subscribe = (mode, cb) => {\n const evt = isHash(mode) ? \"hashchange\" : \"popstate\";\n window.addEventListener(evt, cb);\n return () => window.removeEventListener(evt, cb);\n};\n\n// Build href: the URL the host would land on for each target.\nconst hrefFor = (mode, prefix, args) => {\n if (!prefix) return null;\n const arg = args == null ? \"\" : typeof args === \"object\" ? \"\" : String(args);\n const tail = typeof args === \"object\" && args && Object.keys(args).length > 0\n ? `?${qs.stringify(args, { arrayFormat: \"none\" })}`\n : \"\";\n const url = `${prefix}${arg}${tail}`;\n return isHash(mode) ? `#${url}` : url;\n};\n\nconst navigate = (mode, navigation, prefix, args) => {\n if (!prefix) return;\n if (navigation === \"reload\") {\n // Force a real browser navigation. hrefFor builds the same URL the\n // adapter would render in href= attributes, so the imperative and\n // anchor paths land on identical URLs.\n const url = hrefFor(mode, prefix, args);\n if (url != null && typeof window !== \"undefined\") {\n window.location.assign(url);\n }\n return;\n }\n // Default \"spa\" behaviour: pushState + popstate so an SPA host re-renders.\n let path = prefix;\n let search = null;\n if (typeof args === \"string\" || typeof args === \"number\") {\n path = `${prefix}${args}`;\n } else if (args && typeof args === \"object\") {\n search = args;\n }\n writeLocation(mode, path, search);\n};\n\nconst buildNavProps = (mode, navigation, paths) => ({\n hrefForTaxon: (id) => hrefFor(mode, paths.taxon, id),\n hrefForTree: (a) => hrefFor(mode, paths.tree, a),\n hrefForSearch: (a) => hrefFor(mode, paths.search, a),\n hrefForSource: (id) => hrefFor(mode, paths.source, id),\n\n onNavigateToTaxon: (id) => navigate(mode, navigation, paths.taxon, id),\n onNavigateToTree: (a) => navigate(mode, navigation, paths.tree, a),\n onNavigateToSearch: (a) => navigate(mode, navigation, paths.search, a),\n onNavigateToSource: (id) => navigate(mode, navigation, paths.source, id),\n});\n\n// Extract the last path segment after a prefix, ignoring trailing slash.\nconst lastSegmentAfter = (path, prefix) => {\n if (!prefix) return undefined;\n if (!path.startsWith(prefix)) {\n // Allow matching when the host wraps in a base path; fall back to\n // \"anything after the prefix substring\".\n const i = path.indexOf(prefix);\n if (i < 0) return undefined;\n return path.slice(i + prefix.length).split(\"/\").filter(Boolean).pop();\n }\n return path.slice(prefix.length).split(\"/\").filter(Boolean).pop();\n};\n\nexport function withRouting(Component, options) {\n const { kind, mode = \"path\", navigation = \"spa\", paths = {} } = options;\n\n const Wrapped = (props) => {\n const [tick, setTick] = useState(0);\n useEffect(() => subscribe(mode, () => setTick((t) => t + 1)), []);\n\n const { path, search } = readLocationKind(mode);\n\n const navProps = useMemo(() => buildNavProps(mode, navigation, paths), []);\n\n // Controlled identifier per kind.\n let extra = {};\n if (kind === \"taxon\") {\n extra.taxonKey = lastSegmentAfter(path, paths.taxon);\n } else if (kind === \"source\") {\n extra.sourceDatasetKey = lastSegmentAfter(path, paths.source);\n } else if (kind === \"taxonBreakdown\") {\n extra.taxonId = lastSegmentAfter(path, paths.taxonBreakdown);\n } else if (kind === \"taxonDistribution\") {\n extra.taxonId = lastSegmentAfter(path, paths.taxonDistribution);\n } else if (kind === \"bibtex\") {\n extra.sourceDatasetKey = lastSegmentAfter(path, paths.bibtex);\n } else if (kind === \"tree\") {\n const parsed = qs.parse(search);\n extra.expandedTaxonKey = parsed.taxonKey || undefined;\n extra.onExpandedTaxonKeyChange = useCallback((id) => {\n const cur = readLocationKind(mode);\n const next = qs.parse(cur.search);\n if (id) next.taxonKey = id;\n else delete next.taxonKey;\n writeLocation(mode, cur.path || paths.tree || \"/\", next);\n }, []);\n } else if (kind === \"search\") {\n const parsed = qs.parse(search, { arrayFormat: \"none\" });\n extra.filters = parsed;\n extra.onFiltersChange = useCallback((filters) => {\n const cur = readLocationKind(mode);\n writeLocation(mode, cur.path || paths.search || \"/\", filters);\n }, []);\n }\n // sourceList: no controlled identifier; only nav callbacks.\n\n return <Component {...navProps} {...extra} {...props} />;\n };\n Wrapped.displayName = `withRouting(${\n Component.displayName || Component.name || \"Component\"\n })`;\n return Wrapped;\n}\n\nexport default withRouting;\n"],"names":["isHash","mode","readLocationKind","raw","hash","qIdx","writeLocation","path","search","searchStr","qs","next","url","subscribe","cb","evt","hrefFor","prefix","args","arg","tail","navigate","navigation","buildNavProps","paths","id","a","lastSegmentAfter","i","withRouting","Component","options","kind","Wrapped","props","tick","setTick","useState","useEffect","t","navProps","useMemo","extra","parsed","useCallback","cur","filters"],"mappings":";;;AAsCA,MAAMA,IAAS,CAACC,MAASA,MAAS,QAE5BC,IAAmB,CAACD,MAAS;AACjC,MAAID,EAAOC,CAAI,GAAG;AAChB,UAAME,IAAO,OAAO,SAAW,OAAe,OAAO,SAAS,QAAS,IACjEC,IAAOD,EAAI,WAAW,GAAG,IAAIA,EAAI,MAAM,CAAC,IAAIA,GAC5CE,IAAOD,EAAK,QAAQ,GAAG;AAC7B,WAAO;AAAA,MACL,MAAMC,KAAQ,IAAID,EAAK,MAAM,GAAGC,CAAI,IAAID;AAAA,MACxC,QAAQC,KAAQ,IAAID,EAAK,MAAMC,CAAI,IAAI;AAAA,IAAA;AAAA,EAE3C;AACA,SAAO;AAAA,IACL,MAAO,OAAO,SAAW,OAAe,OAAO,SAAS,YAAa;AAAA,IACrE,QAAS,OAAO,SAAW,OAAe,OAAO,SAAS,UAAW;AAAA,EAAA;AAEzE,GAEMC,IAAgB,CAACL,GAAMM,GAAMC,MAAW;AAC5C,QAAMC,IAAYD,KAAU,OAAO,KAAKA,CAAM,EAAE,SAAS,IACrD,IAAIE,EAAG,UAAUF,GAAQ,EAAE,aAAa,OAAA,CAAQ,CAAC,KACjD;AACJ,MAAIR,EAAOC,CAAI,GAAG;AAChB,UAAMU,IAAO,GAAGJ,CAAI,GAAGE,CAAS;AAChC,WAAO,SAAS,OAAOE;AAAA,EACzB,OAAO;AACL,UAAMC,IAAM,GAAGL,CAAI,GAAGE,CAAS;AAC/B,WAAO,QAAQ,UAAU,MAAM,IAAIG,CAAG,GAEtC,OAAO,cAAc,IAAI,cAAc,UAAU,CAAC;AAAA,EACpD;AACF,GAEMC,IAAY,CAACZ,GAAMa,MAAO;AAC9B,QAAMC,IAAMf,EAAOC,CAAI,IAAI,eAAe;AAC1C,gBAAO,iBAAiBc,GAAKD,CAAE,GACxB,MAAM,OAAO,o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