col-browser 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/chunks/{Distributions-Cwl_75VG.js → Distributions-CLwWAH98.js} +424 -417
- package/es/chunks/{Distributions-Cwl_75VG.js.map → Distributions-CLwWAH98.js.map} +1 -1
- package/es/taxon.js +1 -2
- package/es/taxon.js.map +1 -1
- package/es/taxonDistribution.js +1 -1
- package/package.json +2 -2
- package/umd/col-browser.js +48 -44
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +3 -3
- package/umd/col-browser.min.js.map +1 -1
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { j as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { isArray as Le, get as
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
11
|
-
import { E as
|
|
12
|
-
import { I as
|
|
13
|
-
import { M as
|
|
14
|
-
import { P as
|
|
15
|
-
import
|
|
1
|
+
var tt = Object.defineProperty;
|
|
2
|
+
var nt = (e, n, s) => n in e ? tt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[n] = s;
|
|
3
|
+
var J = (e, n, s) => nt(e, typeof n != "symbol" ? n + "" : n, s);
|
|
4
|
+
import { j as r } from "./jsx-runtime-BzflLqGi.js";
|
|
5
|
+
import * as _e from "react";
|
|
6
|
+
import rt, { useState as L, useRef as M, useMemo as oe, useEffect as $ } from "react";
|
|
7
|
+
import { Spin as st, Popover as ot, Radio as pe } from "antd";
|
|
8
|
+
import { isArray as Le, get as P, keyBy as it, startCase as at } from "lodash-es";
|
|
9
|
+
import { c as re, p as ct } from "./router-CssZk5qZ.js";
|
|
10
|
+
import { c as O } from "./config-BPRXv9x8.js";
|
|
11
|
+
import { E as lt } from "./ErrorMsg-K8k5PPTp.js";
|
|
12
|
+
import { I as dt } from "./AntdIcon-B1nMlqyh.js";
|
|
13
|
+
import { M as ut } from "./MergedDataBadge-DsTsn5Xu.js";
|
|
14
|
+
import { P as pt } from "./PresentationItem-C4yZ555-.js";
|
|
15
|
+
import z from "maplibre-gl";
|
|
16
16
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
17
|
-
import { r as
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
return
|
|
17
|
+
import { r as ft, w as ht } from "./storage-BgdCo9fV.js";
|
|
18
|
+
var gt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-260 72h96v209.9L621.5 312 572 347.4V136zm220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3a15.9 15.9 0 0022.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z" } }] }, name: "book", theme: "outlined" };
|
|
19
|
+
function me() {
|
|
20
|
+
return me = Object.assign ? Object.assign.bind() : function(e) {
|
|
21
21
|
for (var n = 1; n < arguments.length; n++) {
|
|
22
|
-
var
|
|
23
|
-
for (var
|
|
24
|
-
Object.prototype.hasOwnProperty.call(
|
|
22
|
+
var s = arguments[n];
|
|
23
|
+
for (var i in s)
|
|
24
|
+
Object.prototype.hasOwnProperty.call(s, i) && (e[i] = s[i]);
|
|
25
25
|
}
|
|
26
26
|
return e;
|
|
27
|
-
},
|
|
27
|
+
}, me.apply(this, arguments);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const mt = (e, n) => /* @__PURE__ */ _e.createElement(dt, me({}, e, {
|
|
30
30
|
ref: n,
|
|
31
|
-
icon:
|
|
32
|
-
})),
|
|
33
|
-
process.env.NODE_ENV !== "production" && (
|
|
34
|
-
class
|
|
35
|
-
constructor(
|
|
36
|
-
super(
|
|
37
|
-
|
|
38
|
-
const { referenceId:
|
|
39
|
-
if (
|
|
40
|
-
const c = Le(
|
|
31
|
+
icon: gt
|
|
32
|
+
})), $e = /* @__PURE__ */ _e.forwardRef(mt);
|
|
33
|
+
process.env.NODE_ENV !== "production" && ($e.displayName = "BookOutlined");
|
|
34
|
+
class yt extends rt.Component {
|
|
35
|
+
constructor(s) {
|
|
36
|
+
super(s);
|
|
37
|
+
J(this, "getData", () => {
|
|
38
|
+
const { referenceId: s, datasetKey: i, references: o } = this.props;
|
|
39
|
+
if (s) {
|
|
40
|
+
const c = Le(s) ? s : [s], f = [];
|
|
41
41
|
this.setState({ loading: !0 }), Promise.allSettled(
|
|
42
42
|
c.map(
|
|
43
|
-
(u) =>
|
|
44
|
-
`${
|
|
45
|
-
).then((
|
|
43
|
+
(u) => P(o, u) ? Promise.resolve(f.push(o[u])) : re(
|
|
44
|
+
`${O.dataApi}dataset/${i}/reference/${u}`
|
|
45
|
+
).then((a) => f.push(a.data)).catch((a) => this.setState({ error: a }))
|
|
46
46
|
)
|
|
47
47
|
).then(() => this.setState({ reference: f, loading: !1 }));
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
const { error:
|
|
52
|
-
return o ? /* @__PURE__ */
|
|
50
|
+
J(this, "getContent", () => {
|
|
51
|
+
const { error: s, reference: i, loading: o } = this.state;
|
|
52
|
+
return o ? /* @__PURE__ */ r.jsx(st, {}) : s ? /* @__PURE__ */ r.jsx(lt, { error: s }) : i.length === 1 ? i[0].citation : /* @__PURE__ */ r.jsx("ul", { children: i.map((c) => /* @__PURE__ */ r.jsx("li", { children: c.citation }, c.id)) });
|
|
53
53
|
});
|
|
54
|
-
|
|
55
|
-
const o = document.getElementById(`col-reference-${
|
|
56
|
-
o && (
|
|
54
|
+
J(this, "scrollToReference", (s, i) => {
|
|
55
|
+
const o = document.getElementById(`col-reference-${i}`);
|
|
56
|
+
o && (s.preventDefault(), o.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
57
57
|
});
|
|
58
|
-
|
|
59
|
-
const { referenceId:
|
|
60
|
-
let f =
|
|
58
|
+
J(this, "render", () => {
|
|
59
|
+
const { referenceId: s, referenceIndexMap: i, trigger: o } = this.props, c = Le(s) ? s : [s];
|
|
60
|
+
let f = i && P(i, c[0]) ? c.map((u) => /* @__PURE__ */ r.jsx(
|
|
61
61
|
"a",
|
|
62
62
|
{
|
|
63
63
|
className: "col-reference-link",
|
|
64
64
|
href: `#col-reference-${u}`,
|
|
65
|
-
onClick: (
|
|
66
|
-
children: `[${
|
|
65
|
+
onClick: (a) => this.scrollToReference(a, u),
|
|
66
|
+
children: `[${i[u]}]`
|
|
67
67
|
},
|
|
68
68
|
u
|
|
69
|
-
)) : /* @__PURE__ */
|
|
70
|
-
return
|
|
71
|
-
|
|
69
|
+
)) : /* @__PURE__ */ r.jsx($e, { style: { cursor: "pointer" } });
|
|
70
|
+
return s ? /* @__PURE__ */ r.jsx("div", { id: `reference_${s}`, style: this.props.style, children: /* @__PURE__ */ r.jsx(
|
|
71
|
+
ot,
|
|
72
72
|
{
|
|
73
|
-
getPopupContainer: () => document.getElementById(`reference_${
|
|
73
|
+
getPopupContainer: () => document.getElementById(`reference_${s}`),
|
|
74
74
|
placement: this.props.placement || "left",
|
|
75
75
|
title: "Reference",
|
|
76
76
|
onOpenChange: (u) => u && this.getData(),
|
|
77
|
-
content: /* @__PURE__ */
|
|
77
|
+
content: /* @__PURE__ */ r.jsx("div", { style: { maxWidth: "500px" }, children: this.getContent() }),
|
|
78
78
|
trigger: o || "hover",
|
|
79
79
|
children: f
|
|
80
80
|
}
|
|
81
|
-
) }, `reference_${
|
|
81
|
+
) }, `reference_${s}`) : "";
|
|
82
82
|
});
|
|
83
83
|
this.state = {
|
|
84
84
|
reference: [],
|
|
@@ -94,68 +94,68 @@ const ae = [
|
|
|
94
94
|
"form",
|
|
95
95
|
"subform",
|
|
96
96
|
"infraspecific name"
|
|
97
|
-
],
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
},
|
|
101
|
-
var n,
|
|
102
|
-
return ((n = e == null ? void 0 : e.area) == null ? void 0 : n.gazetteer) !== "text" && !!((
|
|
103
|
-
},
|
|
104
|
-
const
|
|
97
|
+
], Ae = (e, n) => {
|
|
98
|
+
const s = n.indexOf(e);
|
|
99
|
+
return s === -1 ? [] : ae.filter((i) => n.indexOf(i) > s);
|
|
100
|
+
}, bt = 16, xt = (e) => {
|
|
101
|
+
var n, s;
|
|
102
|
+
return ((n = e == null ? void 0 : e.area) == null ? void 0 : n.gazetteer) !== "text" && !!((s = e == null ? void 0 : e.area) != null && s.globalId);
|
|
103
|
+
}, vt = async (e, n, s) => {
|
|
104
|
+
const i = new Array(e.length);
|
|
105
105
|
let o = 0;
|
|
106
|
-
const c = Array.from({ length: Math.min(
|
|
106
|
+
const c = Array.from({ length: Math.min(s, e.length) }, async () => {
|
|
107
107
|
for (; ; ) {
|
|
108
108
|
const f = o++;
|
|
109
109
|
if (f >= e.length) return;
|
|
110
|
-
|
|
110
|
+
i[f] = await n(e[f], f);
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
return await Promise.all(c),
|
|
114
|
-
},
|
|
113
|
+
return await Promise.all(c), i;
|
|
114
|
+
}, St = async (e, n, s) => {
|
|
115
115
|
var u;
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
-
),
|
|
121
|
-
const o = `${
|
|
122
|
-
return (((u = c == null ? void 0 : c.data) == null ? void 0 : u.result) || []).filter((
|
|
116
|
+
if (s.length === 0) return [];
|
|
117
|
+
const i = new URLSearchParams();
|
|
118
|
+
i.append("TAXON_ID", n), s.forEach((a) => i.append("rank", a)), ["accepted", "provisionally accepted"].forEach(
|
|
119
|
+
(a) => i.append("status", a)
|
|
120
|
+
), i.append("limit", "1000");
|
|
121
|
+
const o = `${O.dataApi}dataset/${e}/nameusage/search?${i}`, c = await re(o);
|
|
122
|
+
return (((u = c == null ? void 0 : c.data) == null ? void 0 : u.result) || []).filter((a) => {
|
|
123
123
|
var p;
|
|
124
|
-
return (p =
|
|
125
|
-
}).map((
|
|
126
|
-
var p,
|
|
124
|
+
return (p = a == null ? void 0 : a.usage) == null ? void 0 : p.id;
|
|
125
|
+
}).map((a) => {
|
|
126
|
+
var p, k, S, C, R, j;
|
|
127
127
|
return {
|
|
128
|
-
id:
|
|
129
|
-
scientificName: ((
|
|
130
|
-
rank: (
|
|
131
|
-
parentId: (j =
|
|
128
|
+
id: a.usage.id,
|
|
129
|
+
scientificName: ((k = (p = a.usage) == null ? void 0 : p.name) == null ? void 0 : k.scientificName) || ((S = a.usage) == null ? void 0 : S.label) || a.usage.id,
|
|
130
|
+
rank: (R = (C = a.usage) == null ? void 0 : C.name) == null ? void 0 : R.rank,
|
|
131
|
+
parentId: (j = a.usage) == null ? void 0 : j.parentId
|
|
132
132
|
};
|
|
133
133
|
});
|
|
134
|
-
},
|
|
135
|
-
const
|
|
134
|
+
}, jt = async (e, n) => {
|
|
135
|
+
const s = `${O.dataApi}dataset/${e}/taxon/${encodeURIComponent(n)}/distribution`;
|
|
136
136
|
try {
|
|
137
|
-
const
|
|
138
|
-
return Array.isArray(
|
|
137
|
+
const i = await re(s);
|
|
138
|
+
return Array.isArray(i == null ? void 0 : i.data) ? i.data : [];
|
|
139
139
|
} catch {
|
|
140
140
|
return [];
|
|
141
141
|
}
|
|
142
|
-
},
|
|
143
|
-
var
|
|
144
|
-
const
|
|
142
|
+
}, It = async ({ datasetKey: e, focalTaxon: n, rankOrder: s }) => {
|
|
143
|
+
var a;
|
|
144
|
+
const i = Ae((a = n == null ? void 0 : n.name) == null ? void 0 : a.rank, s);
|
|
145
145
|
let o = !1, c = [];
|
|
146
146
|
try {
|
|
147
|
-
c = await
|
|
147
|
+
c = await St(e, n.id, i);
|
|
148
148
|
} catch {
|
|
149
149
|
return o = !0, { taxa: [], descendantsFailed: o };
|
|
150
150
|
}
|
|
151
|
-
const f = await
|
|
151
|
+
const f = await vt(
|
|
152
152
|
c,
|
|
153
|
-
(p) =>
|
|
154
|
-
|
|
153
|
+
(p) => jt(e, p.id),
|
|
154
|
+
bt
|
|
155
155
|
);
|
|
156
|
-
return { taxa: c.map((p,
|
|
157
|
-
const S = f[
|
|
158
|
-
return { ...p, distributions: S, mappable: S.filter(
|
|
156
|
+
return { taxa: c.map((p, k) => {
|
|
157
|
+
const S = f[k] || [];
|
|
158
|
+
return { ...p, distributions: S, mappable: S.filter(xt) };
|
|
159
159
|
}), descendantsFailed: o };
|
|
160
160
|
}, ke = [
|
|
161
161
|
"#E58606",
|
|
@@ -171,17 +171,17 @@ const ae = [
|
|
|
171
171
|
"#CC3A8E",
|
|
172
172
|
"#A5AA99"
|
|
173
173
|
], Ce = (e, n) => {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
const
|
|
174
|
+
const s = n.indexOf(e);
|
|
175
|
+
return s === -1 ? n.length : s;
|
|
176
|
+
}, wt = (e, n) => {
|
|
177
|
+
const s = [...e].sort((o, c) => {
|
|
178
178
|
const f = Ce(o.rank, n), u = Ce(c.rank, n);
|
|
179
179
|
return f !== u ? f - u : o.scientificName.localeCompare(c.scientificName);
|
|
180
|
-
}),
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
}),
|
|
184
|
-
},
|
|
180
|
+
}), i = {};
|
|
181
|
+
return s.forEach((o, c) => {
|
|
182
|
+
i[o.id] = ke[c % ke.length];
|
|
183
|
+
}), i;
|
|
184
|
+
}, Lt = {
|
|
185
185
|
position: "absolute",
|
|
186
186
|
bottom: 8,
|
|
187
187
|
left: 8,
|
|
@@ -193,21 +193,21 @@ const ae = [
|
|
|
193
193
|
fontSize: 12,
|
|
194
194
|
lineHeight: 1.5,
|
|
195
195
|
maxWidth: 260
|
|
196
|
-
},
|
|
196
|
+
}, kt = {
|
|
197
197
|
maxHeight: 240,
|
|
198
198
|
overflowY: "auto"
|
|
199
|
-
},
|
|
199
|
+
}, Pe = {
|
|
200
200
|
fontWeight: 600,
|
|
201
201
|
marginTop: 4
|
|
202
|
-
},
|
|
203
|
-
...
|
|
202
|
+
}, Ct = {
|
|
203
|
+
...Pe,
|
|
204
204
|
marginTop: 0
|
|
205
|
-
},
|
|
205
|
+
}, Oe = {
|
|
206
206
|
display: "flex",
|
|
207
207
|
alignItems: "center",
|
|
208
208
|
gap: 6,
|
|
209
209
|
paddingLeft: 4
|
|
210
|
-
},
|
|
210
|
+
}, Rt = (e) => ({
|
|
211
211
|
display: "inline-block",
|
|
212
212
|
width: 12,
|
|
213
213
|
height: 12,
|
|
@@ -215,27 +215,27 @@ const ae = [
|
|
|
215
215
|
border: "1px solid rgba(0,0,0,0.15)",
|
|
216
216
|
borderRadius: 2,
|
|
217
217
|
flex: "0 0 auto"
|
|
218
|
-
}),
|
|
218
|
+
}), Et = {
|
|
219
219
|
marginTop: 6,
|
|
220
220
|
cursor: "pointer",
|
|
221
221
|
color: "#1890ff",
|
|
222
222
|
fontSize: 11
|
|
223
|
-
},
|
|
223
|
+
}, Ft = {
|
|
224
224
|
marginTop: 4,
|
|
225
225
|
borderTop: "1px solid #eee",
|
|
226
226
|
paddingTop: 4,
|
|
227
227
|
color: "#666"
|
|
228
|
-
},
|
|
228
|
+
}, De = {
|
|
229
229
|
fontWeight: 600,
|
|
230
230
|
marginTop: 4
|
|
231
231
|
}, Bt = {
|
|
232
|
-
...
|
|
232
|
+
...De,
|
|
233
233
|
marginTop: 0
|
|
234
|
-
},
|
|
234
|
+
}, Gt = {
|
|
235
235
|
fontStyle: "italic",
|
|
236
236
|
paddingLeft: 4
|
|
237
|
-
}, Re = (e) => e.reduce((n,
|
|
238
|
-
/* @__PURE__ */
|
|
237
|
+
}, Re = (e) => e.reduce((n, s) => n + s.taxa.length, 0), Mt = () => /* @__PURE__ */ r.jsxs("div", { style: Oe, children: [
|
|
238
|
+
/* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
239
239
|
"polygon",
|
|
240
240
|
{
|
|
241
241
|
points: "3,1 9,1 11,6 9,11 3,11 1,6",
|
|
@@ -244,54 +244,54 @@ const ae = [
|
|
|
244
244
|
strokeWidth: "0.75"
|
|
245
245
|
}
|
|
246
246
|
) }),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
] }),
|
|
249
|
-
const [
|
|
250
|
-
return c === 0 && f === 0 && !
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
e.map((u,
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
u.taxa.map((p) => /* @__PURE__ */
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ r.jsx("span", { children: "GBIF occurrences" })
|
|
248
|
+
] }), Nt = ({ visibleGroups: e, unmappableGroups: n, showGbif: s }) => {
|
|
249
|
+
const [i, o] = L(!1), c = Re(e), f = Re(n);
|
|
250
|
+
return c === 0 && f === 0 && !s ? null : /* @__PURE__ */ r.jsxs("div", { style: Lt, children: [
|
|
251
|
+
/* @__PURE__ */ r.jsxs("div", { style: kt, children: [
|
|
252
|
+
e.map((u, a) => /* @__PURE__ */ r.jsxs("div", { children: [
|
|
253
|
+
/* @__PURE__ */ r.jsx("div", { style: a === 0 ? Ct : Pe, children: u.label }),
|
|
254
|
+
u.taxa.map((p) => /* @__PURE__ */ r.jsxs("div", { style: Oe, children: [
|
|
255
|
+
/* @__PURE__ */ r.jsx("span", { style: Rt(p.color) }),
|
|
256
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontStyle: "italic" }, children: p.displayName || p.scientificName })
|
|
257
257
|
] }, p.id))
|
|
258
258
|
] }, u.rank)),
|
|
259
|
-
|
|
259
|
+
s && /* @__PURE__ */ r.jsx(Mt, {})
|
|
260
260
|
] }),
|
|
261
|
-
f > 0 && /* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
261
|
+
f > 0 && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
262
|
+
/* @__PURE__ */ r.jsxs(
|
|
263
263
|
"div",
|
|
264
264
|
{
|
|
265
|
-
style:
|
|
265
|
+
style: Et,
|
|
266
266
|
onClick: () => o((u) => !u),
|
|
267
267
|
children: [
|
|
268
|
-
|
|
268
|
+
i ? "− Hide" : "+",
|
|
269
269
|
" ",
|
|
270
270
|
f,
|
|
271
271
|
" without map data"
|
|
272
272
|
]
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
|
-
|
|
276
|
-
/* @__PURE__ */
|
|
275
|
+
i && /* @__PURE__ */ r.jsx("div", { style: Ft, children: n.map((u, a) => /* @__PURE__ */ r.jsxs("div", { children: [
|
|
276
|
+
/* @__PURE__ */ r.jsx(
|
|
277
277
|
"div",
|
|
278
278
|
{
|
|
279
|
-
style:
|
|
279
|
+
style: a === 0 ? Bt : De,
|
|
280
280
|
children: u.label
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
|
-
u.taxa.map((p) => /* @__PURE__ */
|
|
283
|
+
u.taxa.map((p) => /* @__PURE__ */ r.jsx("div", { style: Gt, children: p.displayName || p.scientificName }, p.id))
|
|
284
284
|
] }, u.rank)) })
|
|
285
285
|
] })
|
|
286
286
|
] });
|
|
287
|
-
},
|
|
287
|
+
}, _t = [
|
|
288
288
|
"establishmentMeans",
|
|
289
289
|
"degreeOfEstablishment",
|
|
290
290
|
"pathway",
|
|
291
291
|
"threatStatus",
|
|
292
292
|
"year",
|
|
293
293
|
"lifeStage"
|
|
294
|
-
],
|
|
294
|
+
], ze = [
|
|
295
295
|
{ key: "nativeendemic", label: "Native endemic", color: "#0F8554" },
|
|
296
296
|
{ key: "native", label: "Native", color: "#87C55F" },
|
|
297
297
|
{ key: "nativereintroduced", label: "Native reintroduced", color: "#C9DB74" },
|
|
@@ -303,49 +303,49 @@ const ae = [
|
|
|
303
303
|
},
|
|
304
304
|
{ key: "vagrant", label: "Vagrant", color: "#F6CF71" },
|
|
305
305
|
{ key: "uncertain", label: "Uncertain", color: "#8BE0A4" }
|
|
306
|
-
],
|
|
307
|
-
|
|
308
|
-
),
|
|
306
|
+
], He = Object.fromEntries(
|
|
307
|
+
ze.map((e) => [e.key, e.color])
|
|
308
|
+
), ce = "#66C5CC", $t = (e) => String(e || "").toLowerCase().replace(/[^a-z]/g, ""), Ve = (e) => {
|
|
309
309
|
const n = e == null ? void 0 : e.establishmentMeans;
|
|
310
310
|
if (n == null || n === "") return null;
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
},
|
|
314
|
-
const n =
|
|
315
|
-
return n == null ?
|
|
316
|
-
},
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
311
|
+
const s = $t(n);
|
|
312
|
+
return He[s] ? s : "uncertain";
|
|
313
|
+
}, At = (e) => {
|
|
314
|
+
const n = Ve(e);
|
|
315
|
+
return n == null ? ce : He[n];
|
|
316
|
+
}, Pt = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json", Ue = "gbif-visible", Ot = (e) => ft(Ue, e), Ee = (e) => ht(Ue, e), Dt = "/v2/map/occurrence/density/{z}/{x}/{y}@1x.png?srs=EPSG%3A3857&style=iNaturalist.poly&bin=hex&hexPerTile=64&hasCoordinate=true&hasGeospatialIssue=false&occurrenceStatus=PRESENT&checklistKey={checklistKey}&taxonKey={taxonKey}", Q = "col-focal-distributions", W = "col-focal-fill", fe = "col-focal-line", ie = "col-gbif-occurrences", _ = "col-gbif-occurrences", he = (e) => `col-descendant-${e}`, ee = (e) => `col-descendant-fill-${e}`, te = (e) => `col-descendant-line-${e}`, ge = /* @__PURE__ */ new Map(), Fe = (e, n) => {
|
|
317
|
+
const s = `${e}:${n}`;
|
|
318
|
+
if (ge.has(s)) return ge.get(s);
|
|
319
|
+
const i = `${O.dataApi}vocab/area/${s}`, o = re(i, {
|
|
320
320
|
headers: { Accept: "application/geo+json" }
|
|
321
321
|
}).then(
|
|
322
322
|
(c) => c.data,
|
|
323
323
|
() => null
|
|
324
324
|
);
|
|
325
|
-
return
|
|
326
|
-
},
|
|
327
|
-
var
|
|
328
|
-
const n = ((
|
|
329
|
-
([c, f]) => `<div><strong>${
|
|
325
|
+
return ge.set(s, o), o;
|
|
326
|
+
}, ne = (e) => String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), We = (e) => {
|
|
327
|
+
var i, o;
|
|
328
|
+
const n = ((i = e == null ? void 0 : e.area) == null ? void 0 : i.name) || ((o = e == null ? void 0 : e.area) == null ? void 0 : o.globalId) || "", s = _t.map((c) => [c, e == null ? void 0 : e[c]]).filter(([, c]) => c != null && c !== "").map(
|
|
329
|
+
([c, f]) => `<div><strong>${ne(c)}:</strong> ${ne(f)}</div>`
|
|
330
330
|
).join("");
|
|
331
|
-
return `<div style="min-width:180px"><div style="font-weight:600;margin-bottom:4px">${
|
|
331
|
+
return `<div style="min-width:180px"><div style="font-weight:600;margin-bottom:4px">${ne(
|
|
332
332
|
n
|
|
333
|
-
)}</div>${
|
|
334
|
-
},
|
|
333
|
+
)}</div>${s}</div>`;
|
|
334
|
+
}, zt = (e, n) => `<div style="font-weight:600;font-style:italic;margin-bottom:4px">${ne(
|
|
335
335
|
e.scientificName
|
|
336
|
-
)}</div><div style="color:#888;margin-bottom:4px">${
|
|
336
|
+
)}</div><div style="color:#888;margin-bottom:4px">${ne(e.rank || "")}</div>` + We(n), Ht = {
|
|
337
337
|
subspecies: "subspecies",
|
|
338
338
|
variety: "varieties",
|
|
339
339
|
subvariety: "subvarieties",
|
|
340
340
|
form: "forms",
|
|
341
341
|
subform: "subforms",
|
|
342
342
|
"infraspecific name": "infraspecific names"
|
|
343
|
-
},
|
|
343
|
+
}, Be = (e) => Ht[e] || e, Ke = (e) => {
|
|
344
344
|
if (!e) return "";
|
|
345
345
|
const n = e.trim().split(/\s+/);
|
|
346
346
|
return n[n.length - 1];
|
|
347
|
-
},
|
|
348
|
-
/* @__PURE__ */
|
|
347
|
+
}, Vt = () => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
348
|
+
/* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ r.jsx(
|
|
349
349
|
"polygon",
|
|
350
350
|
{
|
|
351
351
|
points: "3,1 9,1 11,6 9,11 3,11 1,6",
|
|
@@ -354,33 +354,33 @@ const ae = [
|
|
|
354
354
|
strokeWidth: "0.75"
|
|
355
355
|
}
|
|
356
356
|
) }),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
] }),
|
|
357
|
+
/* @__PURE__ */ r.jsx("span", { children: "GBIF occurrences" })
|
|
358
|
+
] }), Ut = (e) => {
|
|
359
359
|
var f;
|
|
360
|
-
let n = 1 / 0,
|
|
360
|
+
let n = 1 / 0, s = 1 / 0, i = -1 / 0, o = -1 / 0;
|
|
361
361
|
const c = (u) => {
|
|
362
362
|
if (typeof u[0] == "number") {
|
|
363
|
-
const [
|
|
364
|
-
|
|
363
|
+
const [a, p] = u;
|
|
364
|
+
a < n && (n = a), a > i && (i = a), p < s && (s = p), p > o && (o = p);
|
|
365
365
|
} else
|
|
366
|
-
for (let
|
|
366
|
+
for (let a = 0; a < u.length; a++) c(u[a]);
|
|
367
367
|
};
|
|
368
368
|
for (let u = 0; u < e.length; u++) {
|
|
369
|
-
const
|
|
370
|
-
|
|
369
|
+
const a = (f = e[u]) == null ? void 0 : f.geometry;
|
|
370
|
+
a != null && a.coordinates && c(a.coordinates);
|
|
371
371
|
}
|
|
372
372
|
return n === 1 / 0 ? null : [
|
|
373
|
-
[n,
|
|
374
|
-
[
|
|
373
|
+
[n, s],
|
|
374
|
+
[i, o]
|
|
375
375
|
];
|
|
376
376
|
}, Ge = (e) => e ? e.type === "FeatureCollection" ? e.features || [] : [e] : [], Me = () => {
|
|
377
377
|
var e;
|
|
378
|
-
return typeof ((e =
|
|
379
|
-
},
|
|
378
|
+
return typeof ((e = z) == null ? void 0 : e.supported) == "function" ? z.supported() : typeof WebGLRenderingContext < "u";
|
|
379
|
+
}, Wt = ({
|
|
380
380
|
records: e,
|
|
381
381
|
onUnmappable: n,
|
|
382
|
-
datasetKey:
|
|
383
|
-
focalTaxon:
|
|
382
|
+
datasetKey: s,
|
|
383
|
+
focalTaxon: i,
|
|
384
384
|
rankOrder: o,
|
|
385
385
|
gbifChecklistKey: c,
|
|
386
386
|
// true | null → show GBIF layer; false → GBIF API returned 0 occurrences,
|
|
@@ -389,59 +389,59 @@ const ae = [
|
|
|
389
389
|
gbifAvailable: f = !0
|
|
390
390
|
}) => {
|
|
391
391
|
var we;
|
|
392
|
-
const u = M(null),
|
|
392
|
+
const u = M(null), a = M(null), p = M(null), k = M(/* @__PURE__ */ new Map()), S = M(/* @__PURE__ */ new Map()), C = M(/* @__PURE__ */ new Map()), R = M(!1), j = M(!1), E = M(/* @__PURE__ */ new Set()), [F, H] = L(!1), [I, N] = L(!1), [b, m] = L({
|
|
393
393
|
status: "idle",
|
|
394
394
|
// idle | loading | ready | empty | error
|
|
395
395
|
taxa: []
|
|
396
|
-
}), [
|
|
397
|
-
() =>
|
|
398
|
-
), [
|
|
399
|
-
|
|
396
|
+
}), [D, K] = L(!0), T = !!c && (!e || e.length === 0), [B, Y] = L(
|
|
397
|
+
() => Ot(!0)
|
|
398
|
+
), [w, A] = L(/* @__PURE__ */ new Set()), [se, ye] = L(!1), le = M(!1), Te = () => {
|
|
399
|
+
Y((t) => {
|
|
400
400
|
const d = !t;
|
|
401
401
|
return Ee(d), d;
|
|
402
402
|
});
|
|
403
403
|
}, be = () => {
|
|
404
|
-
|
|
405
|
-
}, xe =
|
|
404
|
+
Y(!0), Ee(!0);
|
|
405
|
+
}, xe = oe(() => {
|
|
406
406
|
if (!(e != null && e.length)) return [];
|
|
407
407
|
const t = /* @__PURE__ */ new Set();
|
|
408
408
|
return e.forEach((d) => {
|
|
409
|
-
const l =
|
|
409
|
+
const l = Ve(d);
|
|
410
410
|
l != null && t.add(l);
|
|
411
|
-
}),
|
|
412
|
-
}, [e]),
|
|
411
|
+
}), ze.filter((d) => t.has(d.key));
|
|
412
|
+
}, [e]), q = oe(() => b.status !== "ready" ? {} : wt(
|
|
413
413
|
b.taxa.filter((t) => t.mappable.length > 0),
|
|
414
414
|
o || []
|
|
415
|
-
), [b, o]),
|
|
415
|
+
), [b, o]), de = oe(() => {
|
|
416
416
|
if (b.status !== "ready")
|
|
417
417
|
return { visibleGroups: [], unmappableGroups: [] };
|
|
418
418
|
const t = (h) => ({
|
|
419
419
|
...h,
|
|
420
|
-
color:
|
|
421
|
-
displayName:
|
|
420
|
+
color: q[h.id],
|
|
421
|
+
displayName: Ke(h.scientificName)
|
|
422
422
|
}), d = (h) => {
|
|
423
423
|
const x = {};
|
|
424
424
|
return h.forEach((y) => {
|
|
425
425
|
(x[y.rank] = x[y.rank] || []).push(t(y));
|
|
426
426
|
}), ae.filter((y) => x[y]).map((y) => ({
|
|
427
427
|
rank: y,
|
|
428
|
-
label:
|
|
428
|
+
label: Be(y),
|
|
429
429
|
taxa: x[y]
|
|
430
430
|
}));
|
|
431
431
|
}, l = d(
|
|
432
432
|
b.taxa.filter(
|
|
433
|
-
(h) => h.mappable.length > 0 &&
|
|
433
|
+
(h) => h.mappable.length > 0 && w.has(h.id)
|
|
434
434
|
)
|
|
435
435
|
), g = d(
|
|
436
436
|
b.taxa.filter((h) => h.mappable.length === 0)
|
|
437
437
|
);
|
|
438
438
|
return { visibleGroups: l, unmappableGroups: g };
|
|
439
|
-
}, [b,
|
|
439
|
+
}, [b, q, w]), ve = de.visibleGroups.length > 0;
|
|
440
440
|
$(() => {
|
|
441
|
-
if (!u.current ||
|
|
442
|
-
const t = new
|
|
441
|
+
if (!u.current || a.current || !Me()) return;
|
|
442
|
+
const t = new z.Map({
|
|
443
443
|
container: u.current,
|
|
444
|
-
style:
|
|
444
|
+
style: Pt,
|
|
445
445
|
center: [0, 20],
|
|
446
446
|
zoom: 1,
|
|
447
447
|
minZoom: 0,
|
|
@@ -449,28 +449,28 @@ const ae = [
|
|
|
449
449
|
renderWorldCopies: !0
|
|
450
450
|
});
|
|
451
451
|
t.addControl(
|
|
452
|
-
new
|
|
452
|
+
new z.AttributionControl({ compact: !0 }),
|
|
453
453
|
"bottom-right"
|
|
454
454
|
), t.addControl(
|
|
455
|
-
new
|
|
455
|
+
new z.NavigationControl({ showCompass: !1 }),
|
|
456
456
|
"top-left"
|
|
457
|
-
),
|
|
458
|
-
|
|
457
|
+
), a.current = t, t.on("load", () => {
|
|
458
|
+
H(!0);
|
|
459
459
|
const l = t.getContainer().querySelector(".maplibregl-ctrl-attrib");
|
|
460
460
|
l && l.classList.remove("maplibregl-compact-show");
|
|
461
461
|
});
|
|
462
462
|
const d = typeof ResizeObserver < "u" ? new ResizeObserver(() => t.resize()) : null;
|
|
463
463
|
return d && d.observe(u.current), () => {
|
|
464
|
-
d && d.disconnect(), p.current && (p.current.remove(), p.current = null), t.remove(),
|
|
464
|
+
d && d.disconnect(), p.current && (p.current.remove(), p.current = null), t.remove(), a.current = null, R.current = !1, j.current = !1, E.current = /* @__PURE__ */ new Set();
|
|
465
465
|
};
|
|
466
466
|
}, []), $(() => {
|
|
467
|
-
if (!
|
|
468
|
-
const t =
|
|
467
|
+
if (!F || !(e != null && e.length)) return;
|
|
468
|
+
const t = a.current;
|
|
469
469
|
if (!t) return;
|
|
470
470
|
let d = !1;
|
|
471
471
|
return N(!1), Promise.allSettled(
|
|
472
472
|
e.map(
|
|
473
|
-
(l) =>
|
|
473
|
+
(l) => Fe(l.area.gazetteer, l.area.id).then((g) => ({
|
|
474
474
|
record: l,
|
|
475
475
|
geojson: g
|
|
476
476
|
}))
|
|
@@ -484,82 +484,82 @@ const ae = [
|
|
|
484
484
|
x += 1;
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
487
|
-
const { record: V, geojson: U } = v.value,
|
|
488
|
-
h.set(
|
|
487
|
+
const { record: V, geojson: U } = v.value, ue = At(V), Z = `focal-${G}`;
|
|
488
|
+
h.set(Z, V), Ge(U).forEach((X) => {
|
|
489
489
|
g.push({
|
|
490
|
-
...
|
|
490
|
+
...X,
|
|
491
491
|
properties: {
|
|
492
|
-
...
|
|
493
|
-
_recordKey:
|
|
494
|
-
_color:
|
|
492
|
+
...X.properties || {},
|
|
493
|
+
_recordKey: Z,
|
|
494
|
+
_color: ue
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
});
|
|
498
|
-
}),
|
|
498
|
+
}), k.current = h;
|
|
499
499
|
const y = { type: "FeatureCollection", features: g };
|
|
500
|
-
if (t.getSource(
|
|
501
|
-
t.getSource(
|
|
500
|
+
if (t.getSource(Q))
|
|
501
|
+
t.getSource(Q).setData(y);
|
|
502
502
|
else {
|
|
503
503
|
const v = t.getLayer(_) ? _ : void 0;
|
|
504
|
-
t.addSource(
|
|
504
|
+
t.addSource(Q, { type: "geojson", data: y }), t.addLayer(
|
|
505
505
|
{
|
|
506
506
|
id: W,
|
|
507
507
|
type: "fill",
|
|
508
|
-
source:
|
|
508
|
+
source: Q,
|
|
509
509
|
paint: {
|
|
510
|
-
"fill-color": ["coalesce", ["get", "_color"],
|
|
510
|
+
"fill-color": ["coalesce", ["get", "_color"], ce],
|
|
511
511
|
"fill-opacity": 0.65
|
|
512
512
|
}
|
|
513
513
|
},
|
|
514
514
|
v
|
|
515
515
|
), t.addLayer(
|
|
516
516
|
{
|
|
517
|
-
id:
|
|
517
|
+
id: fe,
|
|
518
518
|
type: "line",
|
|
519
|
-
source:
|
|
519
|
+
source: Q,
|
|
520
520
|
paint: {
|
|
521
|
-
"line-color": ["coalesce", ["get", "_color"],
|
|
521
|
+
"line-color": ["coalesce", ["get", "_color"], ce],
|
|
522
522
|
"line-width": 1
|
|
523
523
|
}
|
|
524
524
|
},
|
|
525
525
|
v
|
|
526
|
-
), t.on("click", W,
|
|
526
|
+
), t.on("click", W, Ye), t.on("mouseenter", W, Se), t.on("mouseleave", W, je), R.current = !0;
|
|
527
527
|
}
|
|
528
528
|
if (g.length > 0) {
|
|
529
|
-
const v =
|
|
529
|
+
const v = Ut(g);
|
|
530
530
|
v && t.fitBounds(v, { padding: 20, animate: !1 });
|
|
531
531
|
}
|
|
532
532
|
typeof n == "function" && n(x), N(!0);
|
|
533
533
|
}), () => {
|
|
534
534
|
d = !0;
|
|
535
535
|
};
|
|
536
|
-
}, [
|
|
537
|
-
const
|
|
536
|
+
}, [F, e]);
|
|
537
|
+
const Ye = (t) => {
|
|
538
538
|
var x, y;
|
|
539
|
-
const d =
|
|
539
|
+
const d = a.current;
|
|
540
540
|
if (!d) return;
|
|
541
|
-
const l = (x = t.features) == null ? void 0 : x[0], g = (y = l == null ? void 0 : l.properties) == null ? void 0 : y._recordKey, h = g ?
|
|
542
|
-
h && (p.current && p.current.remove(), p.current = new
|
|
541
|
+
const l = (x = t.features) == null ? void 0 : x[0], g = (y = l == null ? void 0 : l.properties) == null ? void 0 : y._recordKey, h = g ? k.current.get(g) : null;
|
|
542
|
+
h && (p.current && p.current.remove(), p.current = new z.Popup({ closeButton: !0, maxWidth: "320px" }).setLngLat(t.lngLat).setHTML(We(h)).addTo(d));
|
|
543
543
|
}, Se = () => {
|
|
544
|
-
const t =
|
|
544
|
+
const t = a.current;
|
|
545
545
|
t && (t.getCanvas().style.cursor = "pointer");
|
|
546
546
|
}, je = () => {
|
|
547
|
-
const t =
|
|
547
|
+
const t = a.current;
|
|
548
548
|
t && (t.getCanvas().style.cursor = "");
|
|
549
549
|
};
|
|
550
550
|
$(() => {
|
|
551
|
-
const t =
|
|
552
|
-
if (!t || !
|
|
553
|
-
const d =
|
|
554
|
-
t.getLayer(W) && t.setLayoutProperty(W, "visibility", d), t.getLayer(
|
|
555
|
-
}, [
|
|
556
|
-
if (!
|
|
557
|
-
const t =
|
|
551
|
+
const t = a.current;
|
|
552
|
+
if (!t || !R.current) return;
|
|
553
|
+
const d = D ? "visible" : "none";
|
|
554
|
+
t.getLayer(W) && t.setLayoutProperty(W, "visibility", d), t.getLayer(fe) && t.setLayoutProperty(fe, "visibility", d);
|
|
555
|
+
}, [D, I]), $(() => {
|
|
556
|
+
if (!F) return;
|
|
557
|
+
const t = a.current;
|
|
558
558
|
if (!t || ((() => {
|
|
559
|
-
t.getLayer(_) && t.removeLayer(_), t.getSource(
|
|
560
|
-
})(), !c || !(
|
|
561
|
-
const l = (
|
|
562
|
-
t.addSource(
|
|
559
|
+
t.getLayer(_) && t.removeLayer(_), t.getSource(ie) && t.removeSource(ie), j.current = !1;
|
|
560
|
+
})(), !c || !(i != null && i.id)) || f === !1) return;
|
|
561
|
+
const l = (O.gbifApi + Dt).replace("{checklistKey}", encodeURIComponent(c)).replace("{taxonKey}", encodeURIComponent(i.id)), g = O.gbifPortal + "/occurrence/search?checklist_key=" + encodeURIComponent(c) + "&taxon_key=" + encodeURIComponent(i.id);
|
|
562
|
+
t.addSource(ie, {
|
|
563
563
|
type: "raster",
|
|
564
564
|
tiles: [l],
|
|
565
565
|
tileSize: 256,
|
|
@@ -567,53 +567,53 @@ const ae = [
|
|
|
567
567
|
}), t.addLayer({
|
|
568
568
|
id: _,
|
|
569
569
|
type: "raster",
|
|
570
|
-
source:
|
|
570
|
+
source: ie,
|
|
571
571
|
paint: { "raster-opacity": 0.9 },
|
|
572
|
-
layout: { visibility:
|
|
572
|
+
layout: { visibility: B ? "visible" : "none" }
|
|
573
573
|
}), j.current = !0;
|
|
574
|
-
}, [
|
|
575
|
-
const t =
|
|
574
|
+
}, [F, c, i == null ? void 0 : i.id, f]), $(() => {
|
|
575
|
+
const t = a.current;
|
|
576
576
|
if (!t || !j.current) return;
|
|
577
|
-
const d =
|
|
577
|
+
const d = B ? "visible" : "none";
|
|
578
578
|
t.getLayer(_) && t.setLayoutProperty(_, "visibility", d);
|
|
579
|
-
}, [
|
|
580
|
-
if (!
|
|
581
|
-
const t =
|
|
579
|
+
}, [B]), $(() => {
|
|
580
|
+
if (!F) return;
|
|
581
|
+
const t = a.current;
|
|
582
582
|
if (!t || (E.current.forEach((l) => {
|
|
583
|
-
t.getLayer(
|
|
584
|
-
}), E.current = /* @__PURE__ */ new Set(), S.current = /* @__PURE__ */ new Map(),
|
|
585
|
-
const d =
|
|
583
|
+
t.getLayer(ee(l)) && t.removeLayer(ee(l)), t.getLayer(te(l)) && t.removeLayer(te(l)), t.getSource(he(l)) && t.removeSource(he(l));
|
|
584
|
+
}), E.current = /* @__PURE__ */ new Set(), S.current = /* @__PURE__ */ new Map(), C.current = /* @__PURE__ */ new Map(), b.status !== "ready")) return;
|
|
585
|
+
const d = q;
|
|
586
586
|
b.taxa.forEach((l) => {
|
|
587
587
|
l.mappable.length !== 0 && (S.current.set(l.id, l), Promise.allSettled(
|
|
588
588
|
l.mappable.map(
|
|
589
|
-
(g) =>
|
|
589
|
+
(g) => Fe(g.area.gazetteer, g.area.id).then((h) => ({
|
|
590
590
|
record: g,
|
|
591
591
|
geojson: h
|
|
592
592
|
}))
|
|
593
593
|
)
|
|
594
594
|
).then((g) => {
|
|
595
|
-
if (!
|
|
595
|
+
if (!a.current) return;
|
|
596
596
|
const h = [];
|
|
597
597
|
g.forEach((G, V) => {
|
|
598
598
|
if (G.status !== "fulfilled" || !G.value.geojson) return;
|
|
599
|
-
const { record: U, geojson:
|
|
600
|
-
|
|
599
|
+
const { record: U, geojson: ue } = G.value, Z = `desc-${l.id}-${V}`;
|
|
600
|
+
C.current.set(Z, { taxon: l, record: U }), Ge(ue).forEach((X) => {
|
|
601
601
|
h.push({
|
|
602
|
-
...
|
|
602
|
+
...X,
|
|
603
603
|
properties: {
|
|
604
|
-
...
|
|
605
|
-
_recordKey:
|
|
604
|
+
...X.properties || {},
|
|
605
|
+
_recordKey: Z
|
|
606
606
|
}
|
|
607
607
|
});
|
|
608
608
|
});
|
|
609
609
|
});
|
|
610
|
-
const x = d[l.id] ||
|
|
611
|
-
if (
|
|
612
|
-
|
|
610
|
+
const x = d[l.id] || ce, y = { type: "FeatureCollection", features: h }, v = he(l.id);
|
|
611
|
+
if (a.current.getSource(v))
|
|
612
|
+
a.current.getSource(v).setData(y);
|
|
613
613
|
else {
|
|
614
|
-
|
|
615
|
-
const G =
|
|
616
|
-
|
|
614
|
+
a.current.addSource(v, { type: "geojson", data: y });
|
|
615
|
+
const G = ee(l.id), V = te(l.id), U = a.current.getLayer(_) ? _ : void 0;
|
|
616
|
+
a.current.addLayer(
|
|
617
617
|
{
|
|
618
618
|
id: G,
|
|
619
619
|
type: "fill",
|
|
@@ -622,7 +622,7 @@ const ae = [
|
|
|
622
622
|
layout: { visibility: "none" }
|
|
623
623
|
},
|
|
624
624
|
U
|
|
625
|
-
),
|
|
625
|
+
), a.current.addLayer(
|
|
626
626
|
{
|
|
627
627
|
id: V,
|
|
628
628
|
type: "line",
|
|
@@ -631,30 +631,30 @@ const ae = [
|
|
|
631
631
|
layout: { visibility: "none" }
|
|
632
632
|
},
|
|
633
633
|
U
|
|
634
|
-
),
|
|
634
|
+
), a.current.on("click", G, qe), a.current.on("mouseenter", G, Se), a.current.on("mouseleave", G, je), E.current.add(l.id);
|
|
635
635
|
}
|
|
636
636
|
}));
|
|
637
637
|
});
|
|
638
|
-
}, [
|
|
639
|
-
const
|
|
638
|
+
}, [F, b, q]);
|
|
639
|
+
const qe = (t) => {
|
|
640
640
|
var x, y;
|
|
641
|
-
const d =
|
|
641
|
+
const d = a.current;
|
|
642
642
|
if (!d) return;
|
|
643
|
-
const l = (x = t.features) == null ? void 0 : x[0], g = (y = l == null ? void 0 : l.properties) == null ? void 0 : y._recordKey, h = g ?
|
|
644
|
-
h && (p.current && p.current.remove(), p.current = new
|
|
643
|
+
const l = (x = t.features) == null ? void 0 : x[0], g = (y = l == null ? void 0 : l.properties) == null ? void 0 : y._recordKey, h = g ? C.current.get(g) : null;
|
|
644
|
+
h && (p.current && p.current.remove(), p.current = new z.Popup({ closeButton: !0, maxWidth: "320px" }).setLngLat(t.lngLat).setHTML(zt(h.taxon, h.record)).addTo(d));
|
|
645
645
|
};
|
|
646
646
|
$(() => {
|
|
647
|
-
const t =
|
|
647
|
+
const t = a.current;
|
|
648
648
|
t && E.current.forEach((d) => {
|
|
649
|
-
const l =
|
|
650
|
-
t.getLayer(
|
|
649
|
+
const l = w.has(d) ? "visible" : "none";
|
|
650
|
+
t.getLayer(ee(d)) && t.setLayoutProperty(ee(d), "visibility", l), t.getLayer(te(d)) && t.setLayoutProperty(te(d), "visibility", l);
|
|
651
651
|
});
|
|
652
|
-
}, [
|
|
652
|
+
}, [w, b]);
|
|
653
653
|
const Ie = () => {
|
|
654
654
|
var l;
|
|
655
|
-
if (
|
|
656
|
-
const t = (l =
|
|
657
|
-
!t || t !== "species" && !ae.includes(t) ||
|
|
655
|
+
if (le.current || !s || !i || !o) return;
|
|
656
|
+
const t = (l = i == null ? void 0 : i.name) == null ? void 0 : l.rank;
|
|
657
|
+
!t || t !== "species" && !ae.includes(t) || Ae(t, o).length === 0 || (le.current = !0, m({ status: "loading", taxa: [] }), It({ datasetKey: s, focalTaxon: i, rankOrder: o }).then(
|
|
658
658
|
({ taxa: g, descendantsFailed: h }) => {
|
|
659
659
|
if (h) {
|
|
660
660
|
m({ status: "error", taxa: [] });
|
|
@@ -667,27 +667,27 @@ const ae = [
|
|
|
667
667
|
m({ status: "ready", taxa: g });
|
|
668
668
|
}
|
|
669
669
|
));
|
|
670
|
-
},
|
|
670
|
+
}, Ze = () => {
|
|
671
671
|
ye(!0), Ie();
|
|
672
|
-
},
|
|
672
|
+
}, Xe = oe(() => {
|
|
673
673
|
if (b.status !== "ready") return [];
|
|
674
674
|
const t = {};
|
|
675
675
|
return b.taxa.filter((d) => d.mappable.length > 0).forEach((d) => {
|
|
676
676
|
(t[d.rank] = t[d.rank] || []).push(d);
|
|
677
677
|
}), ae.filter((d) => t[d]).map((d) => ({
|
|
678
678
|
rank: d,
|
|
679
|
-
label:
|
|
679
|
+
label: Be(d),
|
|
680
680
|
taxa: t[d].slice().sort(
|
|
681
681
|
(l, g) => l.scientificName.localeCompare(g.scientificName)
|
|
682
682
|
)
|
|
683
683
|
}));
|
|
684
|
-
}, [b]),
|
|
685
|
-
|
|
684
|
+
}, [b]), Je = (t) => {
|
|
685
|
+
A((d) => {
|
|
686
686
|
const l = new Set(d);
|
|
687
687
|
return l.has(t) ? l.delete(t) : l.add(t), l;
|
|
688
688
|
});
|
|
689
|
-
},
|
|
690
|
-
|
|
689
|
+
}, Qe = (t) => {
|
|
690
|
+
A((d) => {
|
|
691
691
|
const l = new Set(d), g = t.every((h) => d.has(h.id));
|
|
692
692
|
return t.forEach((h) => {
|
|
693
693
|
g ? l.delete(h.id) : l.add(h.id);
|
|
@@ -695,7 +695,7 @@ const ae = [
|
|
|
695
695
|
});
|
|
696
696
|
};
|
|
697
697
|
if (!Me())
|
|
698
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ r.jsx(
|
|
699
699
|
"div",
|
|
700
700
|
{
|
|
701
701
|
style: {
|
|
@@ -709,8 +709,8 @@ const ae = [
|
|
|
709
709
|
children: "Maps require WebGL, which your browser doesn't support."
|
|
710
710
|
}
|
|
711
711
|
);
|
|
712
|
-
if (
|
|
713
|
-
return /* @__PURE__ */
|
|
712
|
+
if (T && !B)
|
|
713
|
+
return /* @__PURE__ */ r.jsxs(
|
|
714
714
|
"div",
|
|
715
715
|
{
|
|
716
716
|
className: "col-distributions-map col-distributions-map--collapsed",
|
|
@@ -726,8 +726,8 @@ const ae = [
|
|
|
726
726
|
fontSize: 12
|
|
727
727
|
},
|
|
728
728
|
children: [
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ r.jsx("span", { children: "No curated distribution data." }),
|
|
730
|
+
/* @__PURE__ */ r.jsx(
|
|
731
731
|
"a",
|
|
732
732
|
{
|
|
733
733
|
role: "button",
|
|
@@ -743,41 +743,41 @@ const ae = [
|
|
|
743
743
|
]
|
|
744
744
|
}
|
|
745
745
|
);
|
|
746
|
-
const
|
|
747
|
-
return /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
746
|
+
const et = ((we = i == null ? void 0 : i.name) == null ? void 0 : we.scientificName) || "This taxon";
|
|
747
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "col-distributions-map", style: { position: "relative" }, children: [
|
|
748
|
+
/* @__PURE__ */ r.jsx(
|
|
749
749
|
"div",
|
|
750
750
|
{
|
|
751
751
|
ref: u,
|
|
752
752
|
style: { height: 360, width: "100%", background: "#f5f5f5" }
|
|
753
753
|
}
|
|
754
754
|
),
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
|
|
755
|
+
/* @__PURE__ */ r.jsx(
|
|
756
|
+
Kt,
|
|
757
757
|
{
|
|
758
|
-
open:
|
|
759
|
-
onOpen:
|
|
758
|
+
open: se,
|
|
759
|
+
onOpen: Ze,
|
|
760
760
|
onClose: () => ye(!1),
|
|
761
|
-
focalName:
|
|
761
|
+
focalName: et,
|
|
762
762
|
focalReady: I,
|
|
763
|
-
focalVisible:
|
|
763
|
+
focalVisible: D,
|
|
764
764
|
onToggleFocal: () => K((t) => !t),
|
|
765
765
|
gbifEnabled: !!c,
|
|
766
|
-
gbifVisible:
|
|
766
|
+
gbifVisible: B,
|
|
767
767
|
gbifAvailable: f,
|
|
768
|
-
onToggleGbif:
|
|
768
|
+
onToggleGbif: Te,
|
|
769
769
|
descendantStatus: b.status,
|
|
770
|
-
descendantsByRank:
|
|
771
|
-
descendantColors:
|
|
772
|
-
visibleTaxonIds:
|
|
773
|
-
onToggleTaxon:
|
|
774
|
-
onToggleRankGroup:
|
|
770
|
+
descendantsByRank: Xe,
|
|
771
|
+
descendantColors: q,
|
|
772
|
+
visibleTaxonIds: w,
|
|
773
|
+
onToggleTaxon: Je,
|
|
774
|
+
onToggleRankGroup: Qe,
|
|
775
775
|
onRetry: () => {
|
|
776
|
-
|
|
776
|
+
le.current = !1, m({ status: "idle", taxa: [] }), Ie();
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
|
-
!ve && (xe.length > 0 || c && f !== !1 &&
|
|
780
|
+
!ve && (xe.length > 0 || c && f !== !1 && B) && /* @__PURE__ */ r.jsxs(
|
|
781
781
|
"div",
|
|
782
782
|
{
|
|
783
783
|
style: {
|
|
@@ -793,12 +793,12 @@ const ae = [
|
|
|
793
793
|
lineHeight: 1.5
|
|
794
794
|
},
|
|
795
795
|
children: [
|
|
796
|
-
xe.map((t) => /* @__PURE__ */
|
|
796
|
+
xe.map((t) => /* @__PURE__ */ r.jsxs(
|
|
797
797
|
"div",
|
|
798
798
|
{
|
|
799
799
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
800
800
|
children: [
|
|
801
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ r.jsx(
|
|
802
802
|
"span",
|
|
803
803
|
{
|
|
804
804
|
style: {
|
|
@@ -811,44 +811,44 @@ const ae = [
|
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
),
|
|
814
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ r.jsx("span", { children: t.label })
|
|
815
815
|
]
|
|
816
816
|
},
|
|
817
817
|
t.key
|
|
818
818
|
)),
|
|
819
|
-
c && f !== !1 &&
|
|
819
|
+
c && f !== !1 && B && /* @__PURE__ */ r.jsx(Vt, {})
|
|
820
820
|
]
|
|
821
821
|
}
|
|
822
822
|
),
|
|
823
|
-
ve && /* @__PURE__ */
|
|
824
|
-
|
|
823
|
+
ve && /* @__PURE__ */ r.jsx(
|
|
824
|
+
Nt,
|
|
825
825
|
{
|
|
826
|
-
visibleGroups:
|
|
827
|
-
unmappableGroups:
|
|
828
|
-
showGbif: !!c && f !== !1 &&
|
|
826
|
+
visibleGroups: de.visibleGroups,
|
|
827
|
+
unmappableGroups: de.unmappableGroups,
|
|
828
|
+
showGbif: !!c && f !== !1 && B
|
|
829
829
|
}
|
|
830
830
|
)
|
|
831
831
|
] });
|
|
832
|
-
},
|
|
832
|
+
}, Kt = ({
|
|
833
833
|
open: e,
|
|
834
834
|
onOpen: n,
|
|
835
|
-
onClose:
|
|
836
|
-
focalName:
|
|
835
|
+
onClose: s,
|
|
836
|
+
focalName: i,
|
|
837
837
|
focalReady: o,
|
|
838
838
|
focalVisible: c,
|
|
839
839
|
onToggleFocal: f,
|
|
840
840
|
gbifEnabled: u,
|
|
841
|
-
gbifVisible:
|
|
841
|
+
gbifVisible: a,
|
|
842
842
|
gbifAvailable: p,
|
|
843
|
-
onToggleGbif:
|
|
843
|
+
onToggleGbif: k,
|
|
844
844
|
descendantStatus: S,
|
|
845
|
-
descendantsByRank:
|
|
846
|
-
descendantColors:
|
|
845
|
+
descendantsByRank: C,
|
|
846
|
+
descendantColors: R,
|
|
847
847
|
visibleTaxonIds: j,
|
|
848
848
|
onToggleTaxon: E,
|
|
849
|
-
onToggleRankGroup:
|
|
850
|
-
onRetry:
|
|
851
|
-
}) => e ? /* @__PURE__ */
|
|
849
|
+
onToggleRankGroup: F,
|
|
850
|
+
onRetry: H
|
|
851
|
+
}) => e ? /* @__PURE__ */ r.jsxs(
|
|
852
852
|
"div",
|
|
853
853
|
{
|
|
854
854
|
style: {
|
|
@@ -866,10 +866,10 @@ const ae = [
|
|
|
866
866
|
overflowY: "auto",
|
|
867
867
|
minWidth: 160
|
|
868
868
|
},
|
|
869
|
-
onMouseLeave:
|
|
869
|
+
onMouseLeave: s,
|
|
870
870
|
children: [
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
872
|
+
/* @__PURE__ */ r.jsx(
|
|
873
873
|
"input",
|
|
874
874
|
{
|
|
875
875
|
type: "checkbox",
|
|
@@ -878,9 +878,9 @@ const ae = [
|
|
|
878
878
|
onChange: f
|
|
879
879
|
}
|
|
880
880
|
),
|
|
881
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontStyle: "italic" }, children: i })
|
|
882
882
|
] }),
|
|
883
|
-
u && /* @__PURE__ */
|
|
883
|
+
u && /* @__PURE__ */ r.jsxs(
|
|
884
884
|
"div",
|
|
885
885
|
{
|
|
886
886
|
style: {
|
|
@@ -891,29 +891,29 @@ const ae = [
|
|
|
891
891
|
},
|
|
892
892
|
title: p === !1 ? "GBIF has no occurrence records for this taxon." : void 0,
|
|
893
893
|
children: [
|
|
894
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ r.jsx(
|
|
895
895
|
"input",
|
|
896
896
|
{
|
|
897
897
|
type: "checkbox",
|
|
898
|
-
checked: p === !1 ? !1 :
|
|
898
|
+
checked: p === !1 ? !1 : a,
|
|
899
899
|
disabled: p === !1,
|
|
900
|
-
onChange:
|
|
900
|
+
onChange: k
|
|
901
901
|
}
|
|
902
902
|
),
|
|
903
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ r.jsx("span", { children: "GBIF occurrences" })
|
|
904
904
|
]
|
|
905
905
|
}
|
|
906
906
|
),
|
|
907
|
-
S === "loading" && /* @__PURE__ */
|
|
908
|
-
S === "error" && /* @__PURE__ */
|
|
907
|
+
S === "loading" && /* @__PURE__ */ r.jsx("div", { style: { marginTop: 6, color: "#888" }, children: "Loading descendants…" }),
|
|
908
|
+
S === "error" && /* @__PURE__ */ r.jsxs("div", { style: { marginTop: 6, color: "#888" }, children: [
|
|
909
909
|
"Couldn't load descendants.",
|
|
910
910
|
" ",
|
|
911
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ r.jsx("a", { onClick: H, style: { cursor: "pointer" }, children: "Retry" })
|
|
912
912
|
] }),
|
|
913
|
-
S === "ready" &&
|
|
913
|
+
S === "ready" && C.map((I) => {
|
|
914
914
|
const N = I.taxa.every((m) => j.has(m.id)), b = I.taxa.some((m) => j.has(m.id));
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { marginTop: 6 }, children: [
|
|
916
|
+
/* @__PURE__ */ r.jsxs(
|
|
917
917
|
"label",
|
|
918
918
|
{
|
|
919
919
|
style: {
|
|
@@ -923,7 +923,7 @@ const ae = [
|
|
|
923
923
|
fontWeight: 600
|
|
924
924
|
},
|
|
925
925
|
children: [
|
|
926
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ r.jsx(
|
|
927
927
|
"input",
|
|
928
928
|
{
|
|
929
929
|
type: "checkbox",
|
|
@@ -931,14 +931,14 @@ const ae = [
|
|
|
931
931
|
ref: (m) => {
|
|
932
932
|
m && (m.indeterminate = !N && b);
|
|
933
933
|
},
|
|
934
|
-
onChange: () =>
|
|
934
|
+
onChange: () => F(I.taxa)
|
|
935
935
|
}
|
|
936
936
|
),
|
|
937
937
|
I.label
|
|
938
938
|
]
|
|
939
939
|
}
|
|
940
940
|
),
|
|
941
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ r.jsx("div", { style: { paddingLeft: 18 }, children: I.taxa.map((m) => /* @__PURE__ */ r.jsxs(
|
|
942
942
|
"label",
|
|
943
943
|
{
|
|
944
944
|
style: {
|
|
@@ -947,7 +947,7 @@ const ae = [
|
|
|
947
947
|
gap: 6
|
|
948
948
|
},
|
|
949
949
|
children: [
|
|
950
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ r.jsx(
|
|
951
951
|
"input",
|
|
952
952
|
{
|
|
953
953
|
type: "checkbox",
|
|
@@ -955,20 +955,20 @@ const ae = [
|
|
|
955
955
|
onChange: () => E(m.id)
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ r.jsx(
|
|
959
959
|
"span",
|
|
960
960
|
{
|
|
961
961
|
style: {
|
|
962
962
|
display: "inline-block",
|
|
963
963
|
width: 10,
|
|
964
964
|
height: 10,
|
|
965
|
-
background:
|
|
965
|
+
background: R[m.id],
|
|
966
966
|
border: "1px solid rgba(0,0,0,0.15)",
|
|
967
967
|
borderRadius: 2
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
970
|
),
|
|
971
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ r.jsx("span", { style: { fontStyle: "italic" }, children: Ke(m.scientificName) })
|
|
972
972
|
]
|
|
973
973
|
},
|
|
974
974
|
m.id
|
|
@@ -977,7 +977,7 @@ const ae = [
|
|
|
977
977
|
})
|
|
978
978
|
]
|
|
979
979
|
}
|
|
980
|
-
) : /* @__PURE__ */
|
|
980
|
+
) : /* @__PURE__ */ r.jsx(
|
|
981
981
|
"button",
|
|
982
982
|
{
|
|
983
983
|
type: "button",
|
|
@@ -1002,11 +1002,11 @@ const ae = [
|
|
|
1002
1002
|
},
|
|
1003
1003
|
children: "+"
|
|
1004
1004
|
}
|
|
1005
|
-
),
|
|
1006
|
-
var n,
|
|
1007
|
-
return ((n = e == null ? void 0 : e.area) == null ? void 0 : n.gazetteer) !== "text" && !!((
|
|
1008
|
-
},
|
|
1009
|
-
const [
|
|
1005
|
+
), Tt = (e) => {
|
|
1006
|
+
var n, s;
|
|
1007
|
+
return ((n = e == null ? void 0 : e.area) == null ? void 0 : n.gazetteer) !== "text" && !!((s = e == null ? void 0 : e.area) != null && s.globalId);
|
|
1008
|
+
}, Ne = ({ datasetKey: e, data: n }) => {
|
|
1009
|
+
const [s, i] = L({});
|
|
1010
1010
|
return $(() => {
|
|
1011
1011
|
let o = !1;
|
|
1012
1012
|
for (let c = 0; c < n.length; c++)
|
|
@@ -1014,12 +1014,12 @@ const ae = [
|
|
|
1014
1014
|
o = !0;
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
|
-
o &&
|
|
1018
|
-
|
|
1017
|
+
o && re(`${O.dataApi}vocab/country`).then((c) => {
|
|
1018
|
+
i(it(c.data, "alpha3"));
|
|
1019
1019
|
});
|
|
1020
|
-
}, []), /* @__PURE__ */
|
|
1021
|
-
(o == null ? void 0 : o.merged) && /* @__PURE__ */
|
|
1022
|
-
|
|
1020
|
+
}, []), /* @__PURE__ */ r.jsx("div", { children: n.map((o, c) => /* @__PURE__ */ r.jsxs("span", { children: [
|
|
1021
|
+
(o == null ? void 0 : o.merged) && /* @__PURE__ */ r.jsx(
|
|
1022
|
+
ut,
|
|
1023
1023
|
{
|
|
1024
1024
|
createdBy: o == null ? void 0 : o.createdBy,
|
|
1025
1025
|
datasetKey: o.datasetKey,
|
|
@@ -1028,10 +1028,10 @@ const ae = [
|
|
|
1028
1028
|
style: { marginRight: "4px" }
|
|
1029
1029
|
}
|
|
1030
1030
|
),
|
|
1031
|
-
(
|
|
1031
|
+
(P(s, `[${P(o, "area.name")}].name`) ? at(P(s, `[${P(o, "area.name")}].name`)) : null) || P(o, "area.name") || P(o, "area.globalId"),
|
|
1032
1032
|
" ",
|
|
1033
|
-
o.referenceId && /* @__PURE__ */
|
|
1034
|
-
|
|
1033
|
+
o.referenceId && /* @__PURE__ */ r.jsx(
|
|
1034
|
+
yt,
|
|
1035
1035
|
{
|
|
1036
1036
|
datasetKey: e,
|
|
1037
1037
|
referenceId: o.referenceId,
|
|
@@ -1043,23 +1043,23 @@ const ae = [
|
|
|
1043
1043
|
}, ln = ({
|
|
1044
1044
|
datasetKey: e,
|
|
1045
1045
|
data: n,
|
|
1046
|
-
style:
|
|
1047
|
-
showDistributionMap:
|
|
1046
|
+
style: s,
|
|
1047
|
+
showDistributionMap: i,
|
|
1048
1048
|
focalTaxon: o,
|
|
1049
1049
|
rankOrder: c,
|
|
1050
1050
|
gbifChecklistKey: f,
|
|
1051
1051
|
label: u,
|
|
1052
|
-
md:
|
|
1052
|
+
md: a
|
|
1053
1053
|
}) => {
|
|
1054
|
-
const p = n.filter(
|
|
1054
|
+
const p = n.filter(Tt), k = n.length - p.length, S = !!f, C = n.length > 0, [R, j] = L("map"), [E, F] = L(0), [H, I] = L(null);
|
|
1055
1055
|
$(() => {
|
|
1056
1056
|
if (!f || !(o != null && o.id)) {
|
|
1057
1057
|
I(null);
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
I(null);
|
|
1061
|
-
let
|
|
1062
|
-
return
|
|
1061
|
+
let w = !1;
|
|
1062
|
+
return ct.get(`${O.gbifApi}/v1/occurrence/search`, {
|
|
1063
1063
|
params: {
|
|
1064
1064
|
checklistKey: f,
|
|
1065
1065
|
taxonKey: o.id,
|
|
@@ -1069,64 +1069,71 @@ const ae = [
|
|
|
1069
1069
|
limit: 0
|
|
1070
1070
|
}
|
|
1071
1071
|
}).then(
|
|
1072
|
-
(
|
|
1073
|
-
var
|
|
1074
|
-
|
|
1072
|
+
(A) => {
|
|
1073
|
+
var se;
|
|
1074
|
+
w || I(((se = A == null ? void 0 : A.data) == null ? void 0 : se.count) ?? 0);
|
|
1075
1075
|
},
|
|
1076
1076
|
() => {
|
|
1077
|
-
|
|
1077
|
+
w || I(null);
|
|
1078
1078
|
}
|
|
1079
1079
|
), () => {
|
|
1080
|
-
|
|
1080
|
+
w = !0;
|
|
1081
1081
|
};
|
|
1082
1082
|
}, [f, o == null ? void 0 : o.id]);
|
|
1083
|
-
const N = S ?
|
|
1084
|
-
if (!m && !
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1083
|
+
const N = S ? H === null || H > 0 : !1, b = p.length > 0 && E >= p.length, m = i && (p.length > 0 || N) && !(p.length > 0 && b && !N);
|
|
1084
|
+
if (!m && !C) return null;
|
|
1085
|
+
const D = k + E, K = C;
|
|
1086
|
+
let T;
|
|
1087
|
+
if (!m)
|
|
1088
|
+
T = /* @__PURE__ */ r.jsx(Ne, { datasetKey: e, data: n });
|
|
1089
|
+
else {
|
|
1090
|
+
const w = K ? R : "map";
|
|
1091
|
+
T = /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1092
|
+
K ? /* @__PURE__ */ r.jsxs(
|
|
1093
|
+
pe.Group,
|
|
1094
|
+
{
|
|
1095
|
+
size: "small",
|
|
1096
|
+
value: w,
|
|
1097
|
+
onChange: (A) => j(A.target.value),
|
|
1098
|
+
style: { marginBottom: 8 },
|
|
1099
|
+
children: [
|
|
1100
|
+
/* @__PURE__ */ r.jsx(pe.Button, { value: "map", children: "Map" }),
|
|
1101
|
+
/* @__PURE__ */ r.jsx(pe.Button, { value: "list", children: "List" })
|
|
1102
|
+
]
|
|
1103
|
+
}
|
|
1104
|
+
) : (
|
|
1105
|
+
// Reserve the vertical space the Map/List toggle would occupy so the
|
|
1106
|
+
// map's top edge lines up with the "Distributions" label.
|
|
1107
|
+
/* @__PURE__ */ r.jsx("div", { style: { height: 24, marginBottom: 8 } })
|
|
1108
|
+
),
|
|
1109
|
+
w === "map" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1110
|
+
/* @__PURE__ */ r.jsx(
|
|
1111
|
+
Wt,
|
|
1112
|
+
{
|
|
1113
|
+
records: p,
|
|
1114
|
+
onUnmappable: F,
|
|
1115
|
+
datasetKey: e,
|
|
1116
|
+
focalTaxon: o,
|
|
1117
|
+
rankOrder: c,
|
|
1118
|
+
gbifChecklistKey: f,
|
|
1119
|
+
gbifAvailable: N
|
|
1120
|
+
}
|
|
1121
|
+
),
|
|
1122
|
+
K && D > 0 && /* @__PURE__ */ r.jsx("div", { style: { marginTop: 6 }, children: /* @__PURE__ */ r.jsxs("a", { onClick: () => j("list"), style: { cursor: "pointer" }, children: [
|
|
1123
|
+
"+",
|
|
1124
|
+
D,
|
|
1125
|
+
" distribution",
|
|
1126
|
+
D === 1 ? "" : "s",
|
|
1127
|
+
" not on map"
|
|
1128
|
+
] }) })
|
|
1129
|
+
] }) : /* @__PURE__ */ r.jsx(Ne, { datasetKey: e, data: n })
|
|
1130
|
+
] });
|
|
1131
|
+
}
|
|
1132
|
+
const B = u && m ? { marginTop: -3 } : null, Y = /* @__PURE__ */ r.jsx("div", { style: { ...B, ...s }, children: T });
|
|
1133
|
+
return u ? /* @__PURE__ */ r.jsx(pt, { md: a, label: u, children: Y }) : Y;
|
|
1127
1134
|
};
|
|
1128
1135
|
export {
|
|
1129
1136
|
ln as D,
|
|
1130
|
-
|
|
1137
|
+
yt as R
|
|
1131
1138
|
};
|
|
1132
|
-
//# sourceMappingURL=Distributions-
|
|
1139
|
+
//# sourceMappingURL=Distributions-CLwWAH98.js.map
|