@bicharts/chart-host 0.6.36 → 0.6.38
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/dist/{chunk-FV7IUIST.mjs → chunk-3OLKWWX5.mjs} +727 -727
- package/dist/index.mjs +25 -25
- package/dist/react.mjs +1 -1
- package/dist/types/host/services.d.ts +1 -0
- package/package.json +1 -1
|
@@ -20,42 +20,42 @@ var require_papaparse_min = __commonJS({
|
|
|
20
20
|
*/
|
|
21
21
|
((e, t) => {
|
|
22
22
|
"function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
|
|
23
|
-
})(exports, function
|
|
24
|
-
var
|
|
25
|
-
var d2, s = !
|
|
23
|
+
})(exports, function r2() {
|
|
24
|
+
var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
|
|
25
|
+
var d2, s = !n.document && !!n.postMessage, a2 = n.IS_PAPA_WORKER || false, o2 = {}, h3 = 0, v2 = {};
|
|
26
26
|
function P4(e) {
|
|
27
27
|
return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
|
|
28
28
|
}
|
|
29
29
|
function u2(e) {
|
|
30
30
|
this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e2) {
|
|
31
|
-
var t =
|
|
31
|
+
var t = b4(e2);
|
|
32
32
|
t.chunkSize = parseInt(t.chunkSize), e2.step || e2.chunk || (t.chunkSize = null);
|
|
33
33
|
this._handle = new i(t), (this._handle.streamer = this)._config = t;
|
|
34
34
|
}.call(this, e), this.parseChunk = function(t, e2) {
|
|
35
35
|
var i2 = parseInt(this._config.skipFirstNLines) || 0;
|
|
36
36
|
if (this.isFirstChunk && 0 < i2) {
|
|
37
37
|
let e4 = this._config.newline;
|
|
38
|
-
e4 || (
|
|
38
|
+
e4 || (r4 = this._config.quoteChar || '"', e4 = this._handle.guessLineEndings(t, r4)), t = [...t.split(e4).slice(i2)].join(e4);
|
|
39
39
|
}
|
|
40
|
-
this.isFirstChunk && q2(this._config.beforeFirstChunk) && void 0 !== (
|
|
41
|
-
var i2 = this._partialLine + t,
|
|
40
|
+
this.isFirstChunk && q2(this._config.beforeFirstChunk) && void 0 !== (r4 = this._config.beforeFirstChunk(t)) && (t = r4), this.isFirstChunk = false, this._halted = false;
|
|
41
|
+
var i2 = this._partialLine + t, r4 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
|
|
42
42
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
43
|
-
t =
|
|
44
|
-
if (a2)
|
|
43
|
+
t = r4.meta.cursor, i2 = (this._finished || (this._partialLine = i2.substring(t - this._baseIndex), this._baseIndex = t), r4 && r4.data && (this._rowCount += r4.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
|
|
44
|
+
if (a2) n.postMessage({ results: r4, workerId: v2.WORKER_ID, finished: i2 });
|
|
45
45
|
else if (q2(this._config.chunk) && !e2) {
|
|
46
|
-
if (this._config.chunk(
|
|
47
|
-
this._completeResults =
|
|
46
|
+
if (this._config.chunk(r4, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
|
|
47
|
+
this._completeResults = r4 = void 0;
|
|
48
48
|
}
|
|
49
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(
|
|
49
|
+
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r4.data), this._completeResults.errors = this._completeResults.errors.concat(r4.errors), this._completeResults.meta = r4.meta), this._completed || !i2 || !q2(this._config.complete) || r4 && r4.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r4 && r4.meta.paused || this._nextChunk(), r4;
|
|
50
50
|
}
|
|
51
51
|
this._halted = true;
|
|
52
52
|
}, this._sendError = function(e2) {
|
|
53
|
-
q2(this._config.error) ? this._config.error(e2) : a2 && this._config.error &&
|
|
53
|
+
q2(this._config.error) ? this._config.error(e2) : a2 && this._config.error && n.postMessage({ workerId: v2.WORKER_ID, error: e2, finished: false });
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function f4(e) {
|
|
57
|
-
var
|
|
58
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
57
|
+
var r4;
|
|
58
|
+
(e = e || {}).chunkSize || (e.chunkSize = v2.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
|
|
59
59
|
this._readChunk(), this._chunkLoaded();
|
|
60
60
|
} : function() {
|
|
61
61
|
this._readChunk();
|
|
@@ -64,36 +64,36 @@ var require_papaparse_min = __commonJS({
|
|
|
64
64
|
}, this._readChunk = function() {
|
|
65
65
|
if (this._finished) this._chunkLoaded();
|
|
66
66
|
else {
|
|
67
|
-
if (
|
|
67
|
+
if (r4 = new XMLHttpRequest(), this._config.withCredentials && (r4.withCredentials = this._config.withCredentials), s || (r4.onload = y4(this._chunkLoaded, this), r4.onerror = y4(this._chunkError, this)), r4.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s), this._config.downloadRequestHeaders) {
|
|
68
68
|
var e2, t = this._config.downloadRequestHeaders;
|
|
69
|
-
for (e2 in t)
|
|
69
|
+
for (e2 in t) r4.setRequestHeader(e2, t[e2]);
|
|
70
70
|
}
|
|
71
71
|
var i2;
|
|
72
|
-
this._config.chunkSize && (i2 = this._start + this._config.chunkSize - 1,
|
|
72
|
+
this._config.chunkSize && (i2 = this._start + this._config.chunkSize - 1, r4.setRequestHeader("Range", "bytes=" + this._start + "-" + i2));
|
|
73
73
|
try {
|
|
74
|
-
|
|
74
|
+
r4.send(this._config.downloadRequestBody);
|
|
75
75
|
} catch (e4) {
|
|
76
76
|
this._chunkError(e4.message);
|
|
77
77
|
}
|
|
78
|
-
s && 0 ===
|
|
78
|
+
s && 0 === r4.status && this._chunkError();
|
|
79
79
|
}
|
|
80
80
|
}, this._chunkLoaded = function() {
|
|
81
|
-
4 ===
|
|
81
|
+
4 === r4.readyState && (r4.status < 200 || 400 <= r4.status ? this._chunkError() : (this._start += this._config.chunkSize || r4.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((e2) => null !== (e2 = e2.getResponseHeader("Content-Range")) ? parseInt(e2.substring(e2.lastIndexOf("/") + 1)) : -1)(r4), this.parseChunk(r4.responseText)));
|
|
82
82
|
}, this._chunkError = function(e2) {
|
|
83
|
-
e2 =
|
|
83
|
+
e2 = r4.statusText || e2;
|
|
84
84
|
this._sendError(new Error(e2));
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
function l(e) {
|
|
88
|
-
(e = e || {}).chunkSize || (e.chunkSize =
|
|
89
|
-
var i2,
|
|
88
|
+
(e = e || {}).chunkSize || (e.chunkSize = v2.LocalChunkSize), u2.call(this, e);
|
|
89
|
+
var i2, r4, n2 = "undefined" != typeof FileReader;
|
|
90
90
|
this.stream = function(e2) {
|
|
91
|
-
this._input = e2,
|
|
91
|
+
this._input = e2, r4 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = y4(this._chunkLoaded, this), i2.onerror = y4(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
|
|
92
92
|
}, this._nextChunk = function() {
|
|
93
93
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
94
94
|
}, this._readChunk = function() {
|
|
95
|
-
var e2 = this._input, t = (this._config.chunkSize && (t = Math.min(this._start + this._config.chunkSize, this._input.size), e2 =
|
|
96
|
-
|
|
95
|
+
var e2 = this._input, t = (this._config.chunkSize && (t = Math.min(this._start + this._config.chunkSize, this._input.size), e2 = r4.call(e2, this._start, t)), i2.readAsText(e2, this._config.encoding));
|
|
96
|
+
n2 || this._chunkLoaded({ target: { result: t } });
|
|
97
97
|
}, this._chunkLoaded = function(e2) {
|
|
98
98
|
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e2.target.result);
|
|
99
99
|
}, this._chunkError = function() {
|
|
@@ -111,7 +111,7 @@ var require_papaparse_min = __commonJS({
|
|
|
111
111
|
}
|
|
112
112
|
function p2(e) {
|
|
113
113
|
u2.call(this, e = e || {});
|
|
114
|
-
var t = [], i2 = true,
|
|
114
|
+
var t = [], i2 = true, r4 = false;
|
|
115
115
|
this.pause = function() {
|
|
116
116
|
u2.prototype.pause.apply(this, arguments), this._input.pause();
|
|
117
117
|
}, this.resume = function() {
|
|
@@ -119,7 +119,7 @@ var require_papaparse_min = __commonJS({
|
|
|
119
119
|
}, this.stream = function(e2) {
|
|
120
120
|
this._input = e2, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
|
|
121
121
|
}, this._checkIsFinished = function() {
|
|
122
|
-
|
|
122
|
+
r4 && 1 === t.length && (this._finished = true);
|
|
123
123
|
}, this._nextChunk = function() {
|
|
124
124
|
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : i2 = true;
|
|
125
125
|
}, this._streamData = y4(function(e2) {
|
|
@@ -131,18 +131,18 @@ var require_papaparse_min = __commonJS({
|
|
|
131
131
|
}, this), this._streamError = y4(function(e2) {
|
|
132
132
|
this._streamCleanUp(), this._sendError(e2);
|
|
133
133
|
}, this), this._streamEnd = y4(function() {
|
|
134
|
-
this._streamCleanUp(),
|
|
134
|
+
this._streamCleanUp(), r4 = true, this._streamData("");
|
|
135
135
|
}, this), this._streamCleanUp = y4(function() {
|
|
136
136
|
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
137
137
|
}, this);
|
|
138
138
|
}
|
|
139
139
|
function i(m4) {
|
|
140
|
-
var
|
|
140
|
+
var n2, s2, a4, t, o4 = Math.pow(2, 53), h4 = -o4, u4 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d3 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i2 = this, r4 = 0, f5 = 0, l2 = false, e = false, c4 = [], p4 = { data: [], errors: [], meta: {} };
|
|
141
141
|
function y5(e2) {
|
|
142
142
|
return "greedy" === m4.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
|
|
143
143
|
}
|
|
144
144
|
function g4() {
|
|
145
|
-
if (p4 && a4 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" +
|
|
145
|
+
if (p4 && a4 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v2.DefaultDelimiter + "'"), a4 = false), m4.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
|
|
146
146
|
return !y5(e4);
|
|
147
147
|
})), _4()) {
|
|
148
148
|
let t4 = function(e4, t5) {
|
|
@@ -155,165 +155,165 @@ var require_papaparse_min = __commonJS({
|
|
|
155
155
|
} else p4.data.forEach(t4);
|
|
156
156
|
}
|
|
157
157
|
function i4(e4, t4) {
|
|
158
|
-
for (var i5 = m4.header ? {} : [],
|
|
159
|
-
var
|
|
158
|
+
for (var i5 = m4.header ? {} : [], r6 = 0; r6 < e4.length; r6++) {
|
|
159
|
+
var n4 = r6, s4 = e4[r6], s4 = ((e5, t5) => ((e6) => (m4.dynamicTypingFunction && void 0 === m4.dynamicTyping[e6] && (m4.dynamicTyping[e6] = m4.dynamicTypingFunction(e6)), true === (m4.dynamicTyping[e6] || m4.dynamicTyping)))(e5) ? "true" === t5 || "TRUE" === t5 || "false" !== t5 && "FALSE" !== t5 && (((e6) => {
|
|
160
160
|
if (u4.test(e6)) {
|
|
161
161
|
e6 = parseFloat(e6);
|
|
162
162
|
if (h4 < e6 && e6 < o4) return 1;
|
|
163
163
|
}
|
|
164
|
-
})(t5) ? parseFloat(t5) : d3.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(
|
|
165
|
-
"__parsed_extra" ===
|
|
164
|
+
})(t5) ? parseFloat(t5) : d3.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(n4 = m4.header ? r6 >= c4.length ? "__parsed_extra" : c4[r6] : n4, s4 = m4.transform ? m4.transform(s4, n4) : s4);
|
|
165
|
+
"__parsed_extra" === n4 ? (i5[n4] = i5[n4] || [], i5[n4].push(s4)) : i5[n4] = s4;
|
|
166
166
|
}
|
|
167
|
-
return m4.header && (
|
|
167
|
+
return m4.header && (r6 > c4.length ? k3("FieldMismatch", "TooManyFields", "Too many fields: expected " + c4.length + " fields but parsed " + r6, f5 + t4) : r6 < c4.length && k3("FieldMismatch", "TooFewFields", "Too few fields: expected " + c4.length + " fields but parsed " + r6, f5 + t4)), i5;
|
|
168
168
|
}
|
|
169
|
-
var
|
|
170
|
-
p4 && (m4.header || m4.dynamicTyping || m4.transform) && (
|
|
169
|
+
var r5;
|
|
170
|
+
p4 && (m4.header || m4.dynamicTyping || m4.transform) && (r5 = 1, !p4.data.length || Array.isArray(p4.data[0]) ? (p4.data = p4.data.map(i4), r5 = p4.data.length) : p4.data = i4(p4.data, 0), m4.header && p4.meta && (p4.meta.fields = c4), f5 += r5);
|
|
171
171
|
}
|
|
172
172
|
function _4() {
|
|
173
173
|
return m4.header && 0 === c4.length;
|
|
174
174
|
}
|
|
175
|
-
function k3(e2, t2, i4,
|
|
175
|
+
function k3(e2, t2, i4, r5) {
|
|
176
176
|
e2 = { type: e2, code: t2, message: i4 };
|
|
177
|
-
void 0 !==
|
|
177
|
+
void 0 !== r5 && (e2.row = r5), p4.errors.push(e2);
|
|
178
178
|
}
|
|
179
179
|
q2(m4.step) && (t = m4.step, m4.step = function(e2) {
|
|
180
|
-
p4 = e2, _4() ? g4() : (g4(), 0 !== p4.data.length && (
|
|
180
|
+
p4 = e2, _4() ? g4() : (g4(), 0 !== p4.data.length && (r4 += e2.data.length, m4.preview && r4 > m4.preview ? s2.abort() : (p4.data = p4.data[0], t(p4, i2))));
|
|
181
181
|
}), this.parse = function(e2, t2, i4) {
|
|
182
|
-
var
|
|
182
|
+
var r5 = m4.quoteChar || '"', r5 = (m4.newline || (m4.newline = this.guessLineEndings(e2, r5)), a4 = false, m4.delimiter ? q2(m4.delimiter) && (m4.delimiter = m4.delimiter(e2), p4.meta.delimiter = m4.delimiter) : ((r5 = ((e4, t4, i5, r6, n4) => {
|
|
183
183
|
var s4, a5, o5, h5;
|
|
184
|
-
|
|
185
|
-
for (var u5 = 0; u5 <
|
|
186
|
-
for (var d4, f6 =
|
|
184
|
+
n4 = n4 || [",", " ", "|", ";", v2.RECORD_SEP, v2.UNIT_SEP];
|
|
185
|
+
for (var u5 = 0; u5 < n4.length; u5++) {
|
|
186
|
+
for (var d4, f6 = n4[u5], l3 = 0, c5 = 0, p5 = 0, g5 = (o5 = void 0, new E4({ comments: r6, delimiter: f6, newline: t4, preview: 10 }).parse(e4)), _5 = 0; _5 < g5.data.length; _5++) i5 && y5(g5.data[_5]) ? p5++ : (d4 = g5.data[_5].length, c5 += d4, void 0 === o5 ? o5 = d4 : 0 < d4 && (l3 += Math.abs(d4 - o5), o5 = d4));
|
|
187
187
|
0 < g5.data.length && (c5 /= g5.data.length - p5), (void 0 === a5 || l3 <= a5) && (void 0 === h5 || h5 < c5) && 1.99 < c5 && (a5 = l3, s4 = f6, h5 = c5);
|
|
188
188
|
}
|
|
189
189
|
return { successful: !!(m4.delimiter = s4), bestDelimiter: s4 };
|
|
190
|
-
})(e2, m4.newline, m4.skipEmptyLines, m4.comments, m4.delimitersToGuess)).successful ? m4.delimiter =
|
|
191
|
-
return m4.preview && m4.header &&
|
|
190
|
+
})(e2, m4.newline, m4.skipEmptyLines, m4.comments, m4.delimitersToGuess)).successful ? m4.delimiter = r5.bestDelimiter : (a4 = true, m4.delimiter = v2.DefaultDelimiter), p4.meta.delimiter = m4.delimiter), b4(m4));
|
|
191
|
+
return m4.preview && m4.header && r5.preview++, n2 = e2, s2 = new E4(r5), p4 = s2.parse(n2, t2, i4), g4(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
|
|
192
192
|
}, this.paused = function() {
|
|
193
193
|
return l2;
|
|
194
194
|
}, this.pause = function() {
|
|
195
|
-
l2 = true, s2.abort(),
|
|
195
|
+
l2 = true, s2.abort(), n2 = q2(m4.chunk) ? "" : n2.substring(s2.getCharIndex());
|
|
196
196
|
}, this.resume = function() {
|
|
197
|
-
i2.streamer._halted ? (l2 = false, i2.streamer.parseChunk(
|
|
197
|
+
i2.streamer._halted ? (l2 = false, i2.streamer.parseChunk(n2, true)) : setTimeout(i2.resume, 3);
|
|
198
198
|
}, this.aborted = function() {
|
|
199
199
|
return e;
|
|
200
200
|
}, this.abort = function() {
|
|
201
|
-
e = true, s2.abort(), p4.meta.aborted = true, q2(m4.complete) && m4.complete(p4),
|
|
201
|
+
e = true, s2.abort(), p4.meta.aborted = true, q2(m4.complete) && m4.complete(p4), n2 = "";
|
|
202
202
|
}, this.guessLineEndings = function(e2, t2) {
|
|
203
203
|
e2 = e2.substring(0, 1048576);
|
|
204
|
-
var t2 = new RegExp(
|
|
204
|
+
var t2 = new RegExp(U2(t2) + "([^]*?)" + U2(t2), "gm"), i4 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i4[0].length;
|
|
205
205
|
if (1 === i4.length || e2) return "\n";
|
|
206
|
-
for (var
|
|
207
|
-
return
|
|
206
|
+
for (var r5 = 0, n4 = 0; n4 < i4.length; n4++) "\n" === i4[n4][0] && r5++;
|
|
207
|
+
return r5 >= i4.length / 2 ? "\r\n" : "\r";
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function U2(e) {
|
|
211
211
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
212
212
|
}
|
|
213
|
-
function E4(
|
|
214
|
-
var S2 = (
|
|
215
|
-
if (void 0 !==
|
|
216
|
-
true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 <
|
|
217
|
-
var
|
|
218
|
-
this.parse = function(i2, t,
|
|
213
|
+
function E4(C2) {
|
|
214
|
+
var S2 = (C2 = C2 || {}).delimiter, O3 = C2.newline, x3 = C2.comments, I5 = C2.step, A2 = C2.preview, T2 = C2.fastMode, D2 = null, L4 = false, F4 = null == C2.quoteChar ? '"' : C2.quoteChar, j4 = F4;
|
|
215
|
+
if (void 0 !== C2.escapeChar && (j4 = C2.escapeChar), ("string" != typeof S2 || -1 < v2.BAD_DELIMITERS.indexOf(S2)) && (S2 = ","), x3 === S2) throw new Error("Comment character same as delimiter");
|
|
216
|
+
true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 < v2.BAD_DELIMITERS.indexOf(x3)) && (x3 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
|
|
217
|
+
var z4 = 0, M2 = false;
|
|
218
|
+
this.parse = function(i2, t, r4) {
|
|
219
219
|
if ("string" != typeof i2) throw new Error("Input must be a string");
|
|
220
|
-
var
|
|
220
|
+
var n2 = i2.length, e = S2.length, s2 = O3.length, a4 = x3.length, o4 = q2(I5), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
|
|
221
221
|
if (!i2) return w2();
|
|
222
|
-
if (T2 || false !== T2 && -1 === i2.indexOf(
|
|
222
|
+
if (T2 || false !== T2 && -1 === i2.indexOf(F4)) {
|
|
223
223
|
for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
|
|
224
|
-
if (d3 = l2[c4],
|
|
225
|
-
else if (
|
|
224
|
+
if (d3 = l2[c4], z4 += d3.length, c4 !== l2.length - 1) z4 += O3.length;
|
|
225
|
+
else if (r4) return w2();
|
|
226
226
|
if (!x3 || d3.substring(0, a4) !== x3) {
|
|
227
227
|
if (o4) {
|
|
228
228
|
if (h4 = [], k3(d3.split(S2)), R2(), M2) return w2();
|
|
229
229
|
} else k3(d3.split(S2));
|
|
230
|
-
if (
|
|
230
|
+
if (A2 && A2 <= c4) return h4 = h4.slice(0, A2), w2(true);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
return w2();
|
|
234
234
|
}
|
|
235
|
-
for (var p4 = i2.indexOf(S2,
|
|
236
|
-
if (-1 === (m4 = i2.indexOf(
|
|
237
|
-
if (m4 ===
|
|
238
|
-
if (
|
|
239
|
-
else if (
|
|
235
|
+
for (var p4 = i2.indexOf(S2, z4), g4 = i2.indexOf(O3, z4), _4 = new RegExp(U2(j4) + U2(F4), "g"), m4 = i2.indexOf(F4, z4); ; ) if (i2[z4] === F4) for (m4 = z4, z4++; ; ) {
|
|
236
|
+
if (-1 === (m4 = i2.indexOf(F4, m4 + 1))) return r4 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z4 }), E5();
|
|
237
|
+
if (m4 === n2 - 1) return E5(i2.substring(z4, m4).replace(_4, F4));
|
|
238
|
+
if (F4 === j4 && i2[m4 + 1] === j4) m4++;
|
|
239
|
+
else if (F4 === j4 || 0 === m4 || i2[m4 - 1] !== j4) {
|
|
240
240
|
-1 !== p4 && p4 < m4 + 1 && (p4 = i2.indexOf(S2, m4 + 1));
|
|
241
|
-
var y5 =
|
|
241
|
+
var y5 = v3(-1 === (g4 = -1 !== g4 && g4 < m4 + 1 ? i2.indexOf(O3, m4 + 1) : g4) ? p4 : Math.min(p4, g4));
|
|
242
242
|
if (i2.substr(m4 + 1 + y5, e) === S2) {
|
|
243
|
-
d3.push(i2.substring(
|
|
243
|
+
d3.push(i2.substring(z4, m4).replace(_4, F4)), i2[z4 = m4 + 1 + y5 + e] !== F4 && (m4 = i2.indexOf(F4, z4)), p4 = i2.indexOf(S2, z4), g4 = i2.indexOf(O3, z4);
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
|
-
y5 =
|
|
246
|
+
y5 = v3(g4);
|
|
247
247
|
if (i2.substring(m4 + 1 + y5, m4 + 1 + y5 + s2) === O3) {
|
|
248
|
-
if (d3.push(i2.substring(
|
|
249
|
-
if (
|
|
248
|
+
if (d3.push(i2.substring(z4, m4).replace(_4, F4)), b5(m4 + 1 + y5 + s2), p4 = i2.indexOf(S2, z4), m4 = i2.indexOf(F4, z4), o4 && (R2(), M2)) return w2();
|
|
249
|
+
if (A2 && h4.length >= A2) return w2(true);
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
|
-
u4.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h4.length, index:
|
|
252
|
+
u4.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h4.length, index: z4 }), m4++;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
else if (x3 && 0 === d3.length && i2.substring(
|
|
255
|
+
else if (x3 && 0 === d3.length && i2.substring(z4, z4 + a4) === x3) {
|
|
256
256
|
if (-1 === g4) return w2();
|
|
257
|
-
|
|
258
|
-
} else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(
|
|
257
|
+
z4 = g4 + s2, g4 = i2.indexOf(O3, z4), p4 = i2.indexOf(S2, z4);
|
|
258
|
+
} else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(z4, p4)), z4 = p4 + e, p4 = i2.indexOf(S2, z4);
|
|
259
259
|
else {
|
|
260
260
|
if (-1 === g4) break;
|
|
261
|
-
if (d3.push(i2.substring(
|
|
262
|
-
if (
|
|
261
|
+
if (d3.push(i2.substring(z4, g4)), b5(g4 + s2), o4 && (R2(), M2)) return w2();
|
|
262
|
+
if (A2 && h4.length >= A2) return w2(true);
|
|
263
263
|
}
|
|
264
264
|
return E5();
|
|
265
265
|
function k3(e2) {
|
|
266
|
-
h4.push(e2), f5 =
|
|
266
|
+
h4.push(e2), f5 = z4;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function v3(e2) {
|
|
269
269
|
var t2 = 0;
|
|
270
270
|
return t2 = -1 !== e2 && (e2 = i2.substring(m4 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
|
|
271
271
|
}
|
|
272
272
|
function E5(e2) {
|
|
273
|
-
return
|
|
273
|
+
return r4 || (void 0 === e2 && (e2 = i2.substring(z4)), d3.push(e2), z4 = n2, k3(d3), o4 && R2()), w2();
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
|
|
275
|
+
function b5(e2) {
|
|
276
|
+
z4 = e2, k3(d3), d3 = [], g4 = i2.indexOf(O3, z4);
|
|
277
277
|
}
|
|
278
278
|
function w2(e2) {
|
|
279
|
-
if (
|
|
279
|
+
if (C2.header && !t && h4.length && !L4) {
|
|
280
280
|
var s4 = h4[0], a5 = /* @__PURE__ */ Object.create(null), o5 = new Set(s4);
|
|
281
|
-
let
|
|
282
|
-
for (let
|
|
283
|
-
let i4 = P4(s4[
|
|
284
|
-
if (a5[i4 = q2(
|
|
281
|
+
let n4 = false;
|
|
282
|
+
for (let r5 = 0; r5 < s4.length; r5++) {
|
|
283
|
+
let i4 = P4(s4[r5]);
|
|
284
|
+
if (a5[i4 = q2(C2.transformHeader) ? C2.transformHeader(i4, r5) : i4]) {
|
|
285
285
|
let e4, t2 = a5[i4];
|
|
286
286
|
for (; e4 = i4 + "_" + t2, t2++, o5.has(e4); ) ;
|
|
287
|
-
o5.add(e4), s4[
|
|
288
|
-
} else a5[i4] = 1, s4[
|
|
287
|
+
o5.add(e4), s4[r5] = e4, a5[i4]++, n4 = true, (D2 = null === D2 ? {} : D2)[e4] = i4;
|
|
288
|
+
} else a5[i4] = 1, s4[r5] = i4;
|
|
289
289
|
o5.add(i4);
|
|
290
290
|
}
|
|
291
|
-
|
|
291
|
+
n4 && console.warn("Duplicate headers found and renamed."), L4 = true;
|
|
292
292
|
}
|
|
293
|
-
return { data: h4, errors: u4, meta: { delimiter: S2, linebreak: O3, aborted: M2, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders:
|
|
293
|
+
return { data: h4, errors: u4, meta: { delimiter: S2, linebreak: O3, aborted: M2, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders: D2 } };
|
|
294
294
|
}
|
|
295
295
|
function R2() {
|
|
296
|
-
|
|
296
|
+
I5(w2()), h4 = [], u4 = [];
|
|
297
297
|
}
|
|
298
298
|
}, this.abort = function() {
|
|
299
299
|
M2 = true;
|
|
300
300
|
}, this.getCharIndex = function() {
|
|
301
|
-
return
|
|
301
|
+
return z4;
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
304
|
function g3(e) {
|
|
305
|
-
var t = e.data, i2 = o2[t.workerId],
|
|
305
|
+
var t = e.data, i2 = o2[t.workerId], r4 = false;
|
|
306
306
|
if (t.error) i2.userError(t.error, t.file);
|
|
307
307
|
else if (t.results && t.results.data) {
|
|
308
|
-
var
|
|
309
|
-
|
|
308
|
+
var n2 = { abort: function() {
|
|
309
|
+
r4 = true, _3(t.workerId, { data: [], errors: [], meta: { aborted: true } });
|
|
310
310
|
}, pause: m2, resume: m2 };
|
|
311
311
|
if (q2(i2.userStep)) {
|
|
312
|
-
for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta },
|
|
312
|
+
for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r4); s2++) ;
|
|
313
313
|
delete t.results;
|
|
314
|
-
} else q2(i2.userChunk) && (i2.userChunk(t.results,
|
|
314
|
+
} else q2(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
|
|
315
315
|
}
|
|
316
|
-
t.finished && !
|
|
316
|
+
t.finished && !r4 && _3(t.workerId, t.results);
|
|
317
317
|
}
|
|
318
318
|
function _3(e, t) {
|
|
319
319
|
var i2 = o2[e];
|
|
@@ -322,10 +322,10 @@ var require_papaparse_min = __commonJS({
|
|
|
322
322
|
function m2() {
|
|
323
323
|
throw new Error("Not implemented.");
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function b4(e) {
|
|
326
326
|
if ("object" != typeof e || null === e) return e;
|
|
327
327
|
var t, i2 = Array.isArray(e) ? [] : {};
|
|
328
|
-
for (t in e) i2[t] =
|
|
328
|
+
for (t in e) i2[t] = b4(e[t]);
|
|
329
329
|
return i2;
|
|
330
330
|
}
|
|
331
331
|
function y4(e, t) {
|
|
@@ -336,44 +336,44 @@ var require_papaparse_min = __commonJS({
|
|
|
336
336
|
function q2(e) {
|
|
337
337
|
return "function" == typeof e;
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return v2.parse = function(e, t) {
|
|
340
340
|
var i2 = (t = t || {}).dynamicTyping || false;
|
|
341
341
|
q2(i2) && (t.dynamicTypingFunction = i2, i2 = {});
|
|
342
|
-
if (t.dynamicTyping = i2, t.transform = !!q2(t.transform) && t.transform, !t.worker || !
|
|
342
|
+
if (t.dynamicTyping = i2, t.transform = !!q2(t.transform) && t.transform, !t.worker || !v2.WORKERS_SUPPORTED) return i2 = null, v2.NODE_STREAM_INPUT, "string" == typeof e ? (e = P4(e), i2 = new (t.download ? f4 : c2)(t)) : true === e.readable && q2(e.read) && q2(e.on) ? i2 = new p2(t) : (n.File && e instanceof File || e instanceof Object) && (i2 = new l(t)), i2.stream(e);
|
|
343
343
|
(i2 = (() => {
|
|
344
344
|
var e2;
|
|
345
|
-
return !!
|
|
346
|
-
var e4 =
|
|
347
|
-
return
|
|
348
|
-
})(), (e2 = new
|
|
345
|
+
return !!v2.WORKERS_SUPPORTED && (e2 = (() => {
|
|
346
|
+
var e4 = n.URL || n.webkitURL || null, t2 = r2.toString();
|
|
347
|
+
return v2.BLOB_URL || (v2.BLOB_URL = e4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t2, ")();"], { type: "text/javascript" })));
|
|
348
|
+
})(), (e2 = new n.Worker(e2)).onmessage = g3, e2.id = h3++, o2[e2.id] = e2);
|
|
349
349
|
})()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.userError = t.error, t.step = q2(t.step), t.chunk = q2(t.chunk), t.complete = q2(t.complete), t.error = q2(t.error), delete t.worker, i2.postMessage({ input: e, config: t, workerId: i2.id });
|
|
350
|
-
},
|
|
351
|
-
var s2 = false, _4 = true, m4 = ",", y5 = "\r\n", a4 = '"', o4 = a4 + a4, i2 = false,
|
|
350
|
+
}, v2.unparse = function(e, t) {
|
|
351
|
+
var s2 = false, _4 = true, m4 = ",", y5 = "\r\n", a4 = '"', o4 = a4 + a4, i2 = false, r4 = null, h4 = false, u4 = ((() => {
|
|
352
352
|
if ("object" == typeof t) {
|
|
353
|
-
if ("string" != typeof t.delimiter ||
|
|
353
|
+
if ("string" != typeof t.delimiter || v2.BAD_DELIMITERS.filter(function(e2) {
|
|
354
354
|
return -1 !== t.delimiter.indexOf(e2);
|
|
355
355
|
}).length || (m4 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s2 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines), "string" == typeof t.newline && (y5 = t.newline), "string" == typeof t.quoteChar && (a4 = t.quoteChar, o4 = a4 + a4), "boolean" == typeof t.header && (_4 = t.header), Array.isArray(t.columns)) {
|
|
356
356
|
if (0 === t.columns.length) throw new Error("Option columns is empty");
|
|
357
|
-
|
|
357
|
+
r4 = t.columns;
|
|
358
358
|
}
|
|
359
359
|
void 0 !== t.escapeChar && (o4 = t.escapeChar + a4), t.escapeFormulae instanceof RegExp ? h4 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h4 = /^[=+\-@\t\r].*$/);
|
|
360
360
|
}
|
|
361
|
-
})(), new RegExp(
|
|
361
|
+
})(), new RegExp(U2(a4), "g"));
|
|
362
362
|
"string" == typeof e && (e = JSON.parse(e));
|
|
363
363
|
if (Array.isArray(e)) {
|
|
364
|
-
if (!e.length || Array.isArray(e[0])) return
|
|
365
|
-
if ("object" == typeof e[0]) return
|
|
366
|
-
} else if ("object" == typeof e) return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields ||
|
|
364
|
+
if (!e.length || Array.isArray(e[0])) return n2(null, e, i2);
|
|
365
|
+
if ("object" == typeof e[0]) return n2(r4 || Object.keys(e[0]), e, i2);
|
|
366
|
+
} else if ("object" == typeof e) return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || r4), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : "object" == typeof e.data[0] ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || "object" == typeof e.data[0] || (e.data = [e.data])), n2(e.fields || [], e.data || [], i2);
|
|
367
367
|
throw new Error("Unable to serialize unrecognized input");
|
|
368
|
-
function
|
|
369
|
-
var
|
|
370
|
-
if (
|
|
371
|
-
for (var a5 = 0; a5 < e2.length; a5++) 0 < a5 && (
|
|
372
|
-
0 < t2.length && (
|
|
368
|
+
function n2(e2, t2, i4) {
|
|
369
|
+
var r5 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length), s4 = !Array.isArray(t2[0]);
|
|
370
|
+
if (n4 && _4) {
|
|
371
|
+
for (var a5 = 0; a5 < e2.length; a5++) 0 < a5 && (r5 += m4), r5 += k3(e2[a5], a5);
|
|
372
|
+
0 < t2.length && (r5 += y5);
|
|
373
373
|
}
|
|
374
374
|
for (var o5 = 0; o5 < t2.length; o5++) {
|
|
375
|
-
var h5 = (
|
|
376
|
-
if (i4 && !
|
|
375
|
+
var h5 = (n4 ? e2 : t2[o5]).length, u5 = false, d3 = n4 ? 0 === Object.keys(t2[o5]).length : 0 === t2[o5].length;
|
|
376
|
+
if (i4 && !n4 && (u5 = "greedy" === i4 ? "" === t2[o5].join("").trim() : 1 === t2[o5].length && 0 === t2[o5][0].length), "greedy" === i4 && n4) {
|
|
377
377
|
for (var f5 = [], l2 = 0; l2 < h5; l2++) {
|
|
378
378
|
var c4 = s4 ? e2[l2] : l2;
|
|
379
379
|
f5.push(t2[o5][c4]);
|
|
@@ -382,54 +382,54 @@ var require_papaparse_min = __commonJS({
|
|
|
382
382
|
}
|
|
383
383
|
if (!u5) {
|
|
384
384
|
for (var p4 = 0; p4 < h5; p4++) {
|
|
385
|
-
0 < p4 && !d3 && (
|
|
386
|
-
var g4 =
|
|
387
|
-
|
|
385
|
+
0 < p4 && !d3 && (r5 += m4);
|
|
386
|
+
var g4 = n4 && s4 ? e2[p4] : p4;
|
|
387
|
+
r5 += k3(t2[o5][g4], p4);
|
|
388
388
|
}
|
|
389
|
-
o5 < t2.length - 1 && (!i4 || 0 < h5 && !d3) && (
|
|
389
|
+
o5 < t2.length - 1 && (!i4 || 0 < h5 && !d3) && (r5 += y5);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return r5;
|
|
393
393
|
}
|
|
394
394
|
function k3(e2, t2) {
|
|
395
|
-
var i4,
|
|
396
|
-
return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (
|
|
395
|
+
var i4, r5, n4;
|
|
396
|
+
return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h4 && "string" == typeof e2 && h4.test(e2) && (e2 = "'" + e2, n4 = true), r5 = (i4 = e2.toString()).replace(u4, o4), (n4 = n4 || true === s2 || "function" == typeof s2 && s2(e2, t2) || Array.isArray(s2) && s2[t2] || ((e4, t4) => {
|
|
397
397
|
for (var i5 = 0; i5 < t4.length; i5++) if (-1 < e4.indexOf(t4[i5])) return true;
|
|
398
398
|
return false;
|
|
399
|
-
})(
|
|
399
|
+
})(r5, v2.BAD_DELIMITERS) || -1 < r5.indexOf(m4) || -1 < i4.indexOf(a4) || " " === r5.charAt(0) || " " === r5.charAt(r5.length - 1)) ? a4 + r5 + a4 : r5);
|
|
400
400
|
}
|
|
401
|
-
},
|
|
401
|
+
}, v2.RECORD_SEP = String.fromCharCode(30), v2.UNIT_SEP = String.fromCharCode(31), v2.BYTE_ORDER_MARK = "\uFEFF", v2.BAD_DELIMITERS = ["\r", "\n", '"', v2.BYTE_ORDER_MARK], v2.WORKERS_SUPPORTED = !s && !!n.Worker, v2.NODE_STREAM_INPUT = 1, v2.LocalChunkSize = 10485760, v2.RemoteChunkSize = 5242880, v2.DefaultDelimiter = ",", v2.Parser = E4, v2.ParserHandle = i, v2.NetworkStreamer = f4, v2.FileStreamer = l, v2.StringStreamer = c2, v2.ReadableStreamStreamer = p2, n.jQuery && ((d2 = n.jQuery).fn.parse = function(o4) {
|
|
402
402
|
var i2 = o4.config || {}, h4 = [];
|
|
403
403
|
return this.each(function(e2) {
|
|
404
|
-
if (!("INPUT" === d2(this).prop("tagName").toUpperCase() && "file" === d2(this).attr("type").toLowerCase() &&
|
|
404
|
+
if (!("INPUT" === d2(this).prop("tagName").toUpperCase() && "file" === d2(this).attr("type").toLowerCase() && n.FileReader) || !this.files || 0 === this.files.length) return true;
|
|
405
405
|
for (var t = 0; t < this.files.length; t++) h4.push({ file: this.files[t], inputElem: this, instanceConfig: d2.extend({}, i2) });
|
|
406
406
|
}), e(), this;
|
|
407
407
|
function e() {
|
|
408
408
|
if (0 === h4.length) q2(o4.complete) && o4.complete();
|
|
409
409
|
else {
|
|
410
|
-
var e2, t, i4,
|
|
410
|
+
var e2, t, i4, r4, n2 = h4[0];
|
|
411
411
|
if (q2(o4.before)) {
|
|
412
|
-
var s2 = o4.before(
|
|
412
|
+
var s2 = o4.before(n2.file, n2.inputElem);
|
|
413
413
|
if ("object" == typeof s2) {
|
|
414
|
-
if ("abort" === s2.action) return e2 = "AbortError", t =
|
|
414
|
+
if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i4 = n2.inputElem, r4 = s2.reason, void (q2(o4.error) && o4.error({ name: e2 }, t, i4, r4));
|
|
415
415
|
if ("skip" === s2.action) return void u4();
|
|
416
|
-
"object" == typeof s2.config && (
|
|
416
|
+
"object" == typeof s2.config && (n2.instanceConfig = d2.extend(n2.instanceConfig, s2.config));
|
|
417
417
|
} else if ("skip" === s2) return void u4();
|
|
418
418
|
}
|
|
419
|
-
var a4 =
|
|
420
|
-
|
|
421
|
-
q2(a4) && a4(e4,
|
|
422
|
-
},
|
|
419
|
+
var a4 = n2.instanceConfig.complete;
|
|
420
|
+
n2.instanceConfig.complete = function(e4) {
|
|
421
|
+
q2(a4) && a4(e4, n2.file, n2.inputElem), u4();
|
|
422
|
+
}, v2.parse(n2.file, n2.instanceConfig);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
function u4() {
|
|
426
426
|
h4.splice(0, 1), e();
|
|
427
427
|
}
|
|
428
|
-
}), a2 && (
|
|
428
|
+
}), a2 && (n.onmessage = function(e) {
|
|
429
429
|
e = e.data;
|
|
430
|
-
void 0 ===
|
|
431
|
-
"string" == typeof e.input ?
|
|
432
|
-
}), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2,
|
|
430
|
+
void 0 === v2.WORKER_ID && e && (v2.WORKER_ID = e.workerId);
|
|
431
|
+
"string" == typeof e.input ? n.postMessage({ workerId: v2.WORKER_ID, results: v2.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v2.parse(e.input, e.config)) && n.postMessage({ workerId: v2.WORKER_ID, results: e, finished: true });
|
|
432
|
+
}), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2, v2;
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
});
|
|
@@ -496,8 +496,8 @@ var MAX_MAP_POINTS_DEFAULT = 2e3;
|
|
|
496
496
|
|
|
497
497
|
// src/deltaE.ts
|
|
498
498
|
function linearise(c2) {
|
|
499
|
-
const
|
|
500
|
-
return
|
|
499
|
+
const v2 = c2 / 255;
|
|
500
|
+
return v2 <= 0.04045 ? v2 / 12.92 : Math.pow((v2 + 0.055) / 1.055, 2.4);
|
|
501
501
|
}
|
|
502
502
|
var Xn = 0.95047;
|
|
503
503
|
var Yn = 1;
|
|
@@ -507,12 +507,12 @@ var KAPPA = 24389 / 27;
|
|
|
507
507
|
function f(t) {
|
|
508
508
|
return t > EPS ? Math.cbrt(t) : (KAPPA * t + 16) / 116;
|
|
509
509
|
}
|
|
510
|
-
function rgbToLab(
|
|
511
|
-
const R2 = linearise(
|
|
510
|
+
function rgbToLab(r2, g3, b4) {
|
|
511
|
+
const R2 = linearise(r2), G3 = linearise(g3), B3 = linearise(b4);
|
|
512
512
|
const X4 = 0.4124564 * R2 + 0.3575761 * G3 + 0.1804375 * B3;
|
|
513
|
-
const
|
|
514
|
-
const
|
|
515
|
-
const fx = f(X4 / Xn), fy = f(
|
|
513
|
+
const Y3 = 0.2126729 * R2 + 0.7151522 * G3 + 0.072175 * B3;
|
|
514
|
+
const Z4 = 0.0193339 * R2 + 0.119192 * G3 + 0.9503041 * B3;
|
|
515
|
+
const fx = f(X4 / Xn), fy = f(Y3 / Yn), fz = f(Z4 / Zn);
|
|
516
516
|
return { L: 116 * fy - 16, a: 500 * (fx - fy), b: 200 * (fy - fz) };
|
|
517
517
|
}
|
|
518
518
|
function hexToLab(hex2) {
|
|
@@ -568,21 +568,21 @@ function labToHex(lab) {
|
|
|
568
568
|
};
|
|
569
569
|
const fy = (lab.L + 16) / 116, fx = fy + lab.a / 500, fz = fy - lab.b / 200;
|
|
570
570
|
const X4 = Xn * finv(fx);
|
|
571
|
-
const
|
|
572
|
-
const
|
|
571
|
+
const Y3 = Yn * (lab.L > KAPPA * EPS ? fy * fy * fy : lab.L / KAPPA);
|
|
572
|
+
const Z4 = Zn * finv(fz);
|
|
573
573
|
const lin = [
|
|
574
|
-
3.2404542 * X4 - 1.5371385 *
|
|
575
|
-
-0.969266 * X4 + 1.8760108 *
|
|
576
|
-
0.0556434 * X4 - 0.2040259 *
|
|
574
|
+
3.2404542 * X4 - 1.5371385 * Y3 - 0.4985314 * Z4,
|
|
575
|
+
-0.969266 * X4 + 1.8760108 * Y3 + 0.041556 * Z4,
|
|
576
|
+
0.0556434 * X4 - 0.2040259 * Y3 + 1.0572252 * Z4
|
|
577
577
|
];
|
|
578
|
-
return "#" + lin.map((
|
|
579
|
-
const c2 = Math.max(0, Math.min(1,
|
|
578
|
+
return "#" + lin.map((v2) => {
|
|
579
|
+
const c2 = Math.max(0, Math.min(1, v2));
|
|
580
580
|
const g3 = c2 <= 31308e-7 ? 12.92 * c2 : 1.055 * Math.pow(c2, 1 / 2.4) - 0.055;
|
|
581
581
|
return Math.round(g3 * 255).toString(16).padStart(2, "0");
|
|
582
582
|
}).join("");
|
|
583
583
|
}
|
|
584
|
-
function deltaEHex(a2,
|
|
585
|
-
const la = hexToLab(a2), lb = hexToLab(
|
|
584
|
+
function deltaEHex(a2, b4) {
|
|
585
|
+
const la = hexToLab(a2), lb = hexToLab(b4);
|
|
586
586
|
return la && lb ? deltaE2000(la, lb) : NaN;
|
|
587
587
|
}
|
|
588
588
|
|
|
@@ -635,7 +635,7 @@ function cellKey(rgb) {
|
|
|
635
635
|
].join(",");
|
|
636
636
|
}
|
|
637
637
|
function hex(rgb) {
|
|
638
|
-
return "#" + rgb.map((
|
|
638
|
+
return "#" + rgb.map((v2) => Math.max(0, Math.min(255, v2)).toString(16).padStart(2, "0")).join("");
|
|
639
639
|
}
|
|
640
640
|
function censusColourSpread(container, doc) {
|
|
641
641
|
if (!container || typeof container.querySelectorAll !== "function") return EMPTY;
|
|
@@ -672,18 +672,18 @@ function censusColourSpread(container, doc) {
|
|
|
672
672
|
else cells.set(k3, { rgb, n: 1 });
|
|
673
673
|
}
|
|
674
674
|
if (marks < MIN_MARKS || distinct.size < MIN_RAMP_FILLS) return EMPTY;
|
|
675
|
-
const top = [...cells.values()].sort((a2,
|
|
675
|
+
const top = [...cells.values()].sort((a2, b4) => b4.n - a2.n).slice(0, MAX_CELLS);
|
|
676
676
|
const cs = top.map((c2) => hexToLab(hex(c2.rgb))).filter((l) => l !== null);
|
|
677
677
|
if (cs.length < MIN_RAMP_FILLS) return EMPTY;
|
|
678
678
|
const d2 = cs.map(() => new Array(cs.length).fill(0));
|
|
679
679
|
let span = 0, lo = 0, hi = 1;
|
|
680
680
|
for (let i = 0; i < cs.length; i++) {
|
|
681
681
|
for (let j4 = i + 1; j4 < cs.length; j4++) {
|
|
682
|
-
const
|
|
683
|
-
d2[i][j4] =
|
|
684
|
-
d2[j4][i] =
|
|
685
|
-
if (
|
|
686
|
-
span =
|
|
682
|
+
const v2 = deltaE2000(cs[i], cs[j4]);
|
|
683
|
+
d2[i][j4] = v2;
|
|
684
|
+
d2[j4][i] = v2;
|
|
685
|
+
if (v2 > span) {
|
|
686
|
+
span = v2;
|
|
687
687
|
lo = i;
|
|
688
688
|
hi = j4;
|
|
689
689
|
}
|
|
@@ -699,11 +699,11 @@ function censusColourSpread(container, doc) {
|
|
|
699
699
|
if (interior < 2 || slack / interior > RAMP_SLACK_MAX) return EMPTY;
|
|
700
700
|
let crowd = 0;
|
|
701
701
|
for (let i = 0; i < cs.length; i++) {
|
|
702
|
-
let
|
|
702
|
+
let n = 0;
|
|
703
703
|
for (let j4 = 0; j4 < cs.length; j4++) {
|
|
704
|
-
if (i === j4 || d2[i][j4] <= SAME_SHADE_DELTA_E)
|
|
704
|
+
if (i === j4 || d2[i][j4] <= SAME_SHADE_DELTA_E) n += top[j4].n;
|
|
705
705
|
}
|
|
706
|
-
if (
|
|
706
|
+
if (n > crowd) crowd = n;
|
|
707
707
|
}
|
|
708
708
|
return {
|
|
709
709
|
marks,
|
|
@@ -734,13 +734,13 @@ function normHex(raw) {
|
|
|
734
734
|
const h3 = m2[1].length === 3 ? m2[1].split("").map((c2) => c2 + c2).join("") : m2[1];
|
|
735
735
|
return "#" + h3.toLowerCase();
|
|
736
736
|
}
|
|
737
|
-
function mixLab(a2,
|
|
738
|
-
return { L: a2.L + (
|
|
737
|
+
function mixLab(a2, b4, t) {
|
|
738
|
+
return { L: a2.L + (b4.L - a2.L) * t, a: a2.a + (b4.a - a2.a) * t, b: a2.b + (b4.b - a2.b) * t };
|
|
739
739
|
}
|
|
740
740
|
function paintedOver(fg, canvas, alpha) {
|
|
741
741
|
const f4 = [1, 3, 5].map((i) => parseInt(fg.slice(i, i + 2), 16));
|
|
742
742
|
const c2 = [1, 3, 5].map((i) => parseInt(canvas.slice(i, i + 2), 16));
|
|
743
|
-
const mixed = f4.map((
|
|
743
|
+
const mixed = f4.map((v2, i) => Math.round(v2 * alpha + c2[i] * (1 - alpha))).map((v2) => v2.toString(16).padStart(2, "0"));
|
|
744
744
|
return hexToLab("#" + mixed.join(""));
|
|
745
745
|
}
|
|
746
746
|
function autoRampMinStep(low, high, canvas, classes = AUTO_RAMP_CLASSES, opacity = AUTO_RAMP_DRAWN_OPACITY) {
|
|
@@ -773,15 +773,15 @@ function resolveAutoColorScale(p2) {
|
|
|
773
773
|
};
|
|
774
774
|
const candidates = p2.isHighContrast ? [normHex(p2.themeAccent), normHex(p2.themeFg)] : [...palette.map(normHex), normHex(p2.themeAccent), normHex(p2.themeFg)];
|
|
775
775
|
const accent = candidates.find(usable) ?? FALLBACK_ACCENT;
|
|
776
|
-
const
|
|
776
|
+
const A2 = hexToLab(accent);
|
|
777
777
|
let t = 0.1;
|
|
778
|
-
let low = mixLab(bg,
|
|
778
|
+
let low = mixLab(bg, A2, t);
|
|
779
779
|
while (t < 0.6 && deltaE2000(paintedOver(labToHex(low), canvas, AUTO_RAMP_DRAWN_OPACITY), bg) < SAME_SHADE_DELTA_E) {
|
|
780
780
|
t += 0.02;
|
|
781
|
-
low = mixLab(bg,
|
|
781
|
+
low = mixLab(bg, A2, t);
|
|
782
782
|
}
|
|
783
783
|
const lowHex = labToHex(low);
|
|
784
|
-
let high = { ...
|
|
784
|
+
let high = { ...A2 };
|
|
785
785
|
let highHex = labToHex(high);
|
|
786
786
|
for (let step = 0; step < 80 && autoRampMinStep(lowHex, highHex, canvas) < AUTO_RAMP_MIN_STEP_DELTA_E; step++) {
|
|
787
787
|
const L4 = Math.max(4, Math.min(98, high.L + (darkCanvas ? 1 : -1)));
|
|
@@ -795,10 +795,10 @@ function resolveAutoColorScale(p2) {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
// src/defaults.ts
|
|
798
|
-
var clamp = (
|
|
798
|
+
var clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
|
|
799
799
|
var numberOr = (raw, dflt) => {
|
|
800
|
-
const
|
|
801
|
-
return Number.isFinite(
|
|
800
|
+
const n = raw == null || raw === "" ? NaN : Number(raw);
|
|
801
|
+
return Number.isFinite(n) ? n : dflt;
|
|
802
802
|
};
|
|
803
803
|
function resolveOptions(p2) {
|
|
804
804
|
return {
|
|
@@ -825,8 +825,8 @@ function resolveOptions(p2) {
|
|
|
825
825
|
// default here makes the chart and the gate agree in every host. A positive value from
|
|
826
826
|
// the host wins; absent, blank, zero or junk means the shared default.
|
|
827
827
|
maxMapPoints: (() => {
|
|
828
|
-
const
|
|
829
|
-
return
|
|
828
|
+
const n = numberOr(p2.maxMapPoints, 0);
|
|
829
|
+
return n > 0 ? Math.round(n) : MAX_MAP_POINTS_DEFAULT;
|
|
830
830
|
})(),
|
|
831
831
|
// FIFTH AND SIXTH OCCURRENCES, and the two that argue hardest for the guard test: both
|
|
832
832
|
// were passed by the visual AND read by the charts, and neither was ever declared here or
|
|
@@ -872,20 +872,20 @@ function resolveOptions(p2) {
|
|
|
872
872
|
// never reach a chart as a live mode. Both of these are read on EVERY render, so a
|
|
873
873
|
// reader can change their mind about a cached chart without regenerating it.
|
|
874
874
|
approximatePositions: (() => {
|
|
875
|
-
const
|
|
876
|
-
return
|
|
875
|
+
const v2 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
|
|
876
|
+
return v2 === "mark" || v2 === "aggregate" || v2 === "skip" ? v2 : APPROXIMATE_POSITIONS_DEFAULT;
|
|
877
877
|
})(),
|
|
878
878
|
valueAxisBaseline: (() => {
|
|
879
|
-
const
|
|
880
|
-
return
|
|
879
|
+
const v2 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
|
|
880
|
+
return v2 === "zero" || v2 === "fit" || v2 === "auto" ? v2 : VALUE_AXIS_BASELINE_DEFAULT;
|
|
881
881
|
})(),
|
|
882
882
|
// Same shape, and the same reason for it: an unrecognised string must never reach a chart
|
|
883
883
|
// as a live mode. Failing open to "auto" is the conservative direction here — "auto" is
|
|
884
884
|
// the setting that makes the chart PROVE the grid before it names a period, so a garbled
|
|
885
885
|
// value withdraws the claim rather than asserting one.
|
|
886
886
|
seasonalMarkers: (() => {
|
|
887
|
-
const
|
|
888
|
-
return
|
|
887
|
+
const v2 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
|
|
888
|
+
return v2 === "auto" || v2 === "always" || v2 === "never" ? v2 : SEASONAL_MARKERS_DEFAULT;
|
|
889
889
|
})(),
|
|
890
890
|
// ---- animation: booleans, default+clamp numerics, "" default enum ----
|
|
891
891
|
animAutoPlay: !!p2.animAutoPlay,
|
|
@@ -1038,17 +1038,17 @@ var H = "AB|CA|Alberta|-113.75|52.18,AK|US|Alaska|-148.32|61.29,AL|US|Alabama|-8
|
|
|
1038
1038
|
var X = "006|-66.84|18.26,007|-66.15|18.15,008|-64.74|17.74,009|-66.12|18.37,010|-72.6|42.26,011|-72.53|42.07,012|-73.21|42.37,013|-72.51|42.58,014|-71.81|42.59,015|-71.85|42.23,016|-71.84|42.28,017|-71.44|42.33,018|-71.21|42.64,019|-70.89|42.66,020|-71.28|42.12,021|-71.05|42.31,022|-71.04|42.35,023|-70.86|41.98,024|-71.22|42.37,025|-70.6|41.71,026|-70.2|41.73,027|-71.07|41.77,028|-71.62|41.69,029|-71.47|41.82,030|-71.51|42.9,031|-71.48|43,032|-71.65|43.57,033|-71.58|43.26,034|-72.19|42.91,035|-71.31|44.69,036|-72.32|43.17,037|-72.13|43.69,038|-71.1|43.56,039|-70.76|43.24,040|-70.6|43.78,041|-70.27|43.7,042|-70.49|44.38,043|-69.75|44.3,044|-68.83|45.45,045|-69.57|43.99,046|-67.8|44.79,047|-68.34|46.55,048|-69.17|44.2,049|-69.97|44.99,050|-72.43|43.85,051|-72.65|43.28,052|-73.14|43.03,053|-72.77|42.94,054|-72.98|44.58,056|-72.6|44.35,057|-73.04|43.69,058|-72.12|44.68,059|-71.7|44.79,060|-72.81|41.88,061|-72.69|41.74,062|-72.12|41.81,063|-72.03|41.5,064|-72.61|41.46,065|-72.94|41.36,066|-73.22|41.24,067|-73.24|41.68,068|-73.42|41.28,069|-73.57|41.14,070|-74.28|40.76,071|-74.2|40.74,072|-74.2|40.68,073|-74.08|40.71,074|-74.4|41.09,075|-74.17|40.92,076|-74.01|40.94,077|-74.17|40.28,078|-74.81|40.97,079|-74.55|40.74,080|-74.98|39.78,081|-75.07|39.94,082|-74.68|39.32,083|-75.04|39.45,084|-74.48|39.35,085|-74.62|40.25,086|-74.68|40.23,087|-74.22|39.96,088|-74.72|40.54,089|-74.48|40.45,100|-73.96|40.77,101|-73.95|40.78,102|-74.02|40.72,103|-74.15|40.58,104|-73.85|40.9,105|-73.75|41.27,106|-73.74|41.02,107|-73.84|40.96,108|-73.8|40.95,109|-74.27|41.3,110|-73.69|40.74,111|-73.93|40.76,112|-73.94|40.66,113|-73.84|40.73,114|-73.77|40.69,115|-73.62|40.71,116|-73.88|40.57,117|-73.23|40.82,118|-73.5|40.77,119|-72.53|40.95,120|-74.22|42.92,121|-74.4|43.46,122|-73.81|42.7,123|-73.96|42.82,124|-74.27|42.09,125|-73.7|41.89,126|-73.88|41.69,127|-74.75|41.74,128|-73.91|43.61,129|-74.03|44.53,130|-76.16|43.08,131|-76.46|43.27,132|-76.2|43.03,133|-75.07|43.45,134|-75.35|43.03,135|-75.15|43.14,136|-75.39|44.33,137|-75.2|42.21,138|-75.46|42.43,139|-75.88|42.12,140|-78.48|43.01,141|-78.7|42.49,142|-78.8|42.91,143|-78.96|43.12,144|-77.71|42.96,145|-77.17|43.14,146|-77.65|43.17,147|-78.84|42.21,148|-77.18|42.29,149|-76.78|42.09,150|-80.23|40.56,151|-80.18|40.53,152|-79.97|40.46,153|-80.24|40.01,154|-79.65|39.92,155|-78.8|39.95,156|-79.47|40.33,157|-79.02|40.71,158|-78.66|41.32,159|-78.84|40.35,160|-79.88|40.93,161|-80.3|41.19,162|-79.35|41.08,163|-79.58|41.59,164|-80|41.87,165|-80.04|42.1,166|-78.28|40.48,167|-78.47|41.76,168|-78|40.97,169|-77.37|41.8,170|-77.29|40.44,171|-76.78|40.33,172|-77.81|39.98,173|-76.93|39.89,174|-76.72|39.97,175|-76.24|40.05,176|-76.34|40.05,177|-77.22|41.34,178|-76.77|40.93,179|-76.27|40.69,180|-75.45|40.67,181|-75.47|40.6,182|-75.88|40.9,183|-75.19|41.12,184|-75.38|41.53,185|-75.68|41.37,186|-76.17|41.4,187|-75.86|41.22,188|-76.12|41.82,189|-75.14|40.36,190|-75.37|39.97,191|-75.15|40.01,193|-75.78|39.92,194|-75.46|40.19,195|-75.9|40.42,196|-75.95|40.34,197|-75.68|39.53,198|-75.58|39.77,199|-75.46|38.83,200|-77.02|38.9,201|-77.68|38.9,202|-77.03|38.89,203|-77.01|38.86,204|-77.05|38.89,205|-77.01|38.87,206|-76.76|38.45,207|-76.78|38.88,208|-77.23|39.15,209|-76.99|39.05,210|-76.32|39.53,211|-76.73|39.58,212|-76.58|39.31,214|-76.55|39,215|-79.08|39.56,216|-76.02|38.86,217|-77.5|39.52,218|-75.57|38.27,219|-75.94|39.57,220|-77.25|38.78,221|-77.25|38.92,222|-77.11|38.88,223|-77.13|38.79,224|-77.25|38.22,225|-77.51|38.09,226|-78.25|39.03,227|-78.05|38.49,228|-78.79|38.57,229|-78.55|38.02,230|-78.09|37.66,231|-76.96|37.55,232|-77.46|37.51,233|-76.3|36.68,234|-76.66|36.77,235|-76.26|36.87,236|-76.44|37.12,237|-76.38|36.85,238|-77.41|36.94,239|-78.39|37.03,240|-80.1|37.23,241|-79.89|36.9,242|-82.49|36.83,243|-81.13|36.86,244|-79.51|38.05,245|-79.11|37.15,246|-81.8|37.19,247|-81.14|37.39,248|-81.64|37.47,249|-80.32|37.95,250|-81.45|38.27,251|-81.89|38.64,252|-81.45|38.77,253|-81.64|38.42,254|-78.11|39.45,255|-82.19|38.25,256|-82.08|37.76,257|-82.41|38.4,258|-81.21|37.72,259|-80.89|37.83,260|-80.63|40.05,261|-81.27|39.2,262|-80.02|38.75,263|-80.23|39.27,264|-80.65|39.21,265|-80.05|39.59,266|-80.8|38.48,267|-78.98|39.33,268|-79.12|38.88,270|-80.45|36.24,271|-80.24|36.06,272|-79.82|35.86,273|-79.52|35.55,274|-79.81|36.09,275|-78.54|35.93,276|-78.65|35.81,277|-78.9|35.99,278|-77.32|35.88,279|-76.5|36.19,280|-81.2|35.4,281|-80.41|35.21,282|-80.83|35.22,283|-78.94|34.96,284|-78.23|34.39,285|-77.23|35.06,286|-81.36|36.06,287|-82.78|35.51,288|-82.55|35.6,289|-83.97|35.11,290|-80.88|34.19,291|-80.62|33.71,292|-80.96|34.04,293|-81.86|34.78,294|-80.08|33.05,295|-79.49|34.07,296|-82.57|34.61,297|-80.92|34.83,298|-81.74|33.51,299|-80.96|32.55,300|-84.08|33.85,301|-84.91|34.04,302|-84.55|33.25,303|-84.42|33.77,304|-82.11|32.48,305|-83.81|34.58,306|-83.14|33.86,307|-85.1|34.71,308|-82.34|33.35,309|-82.01|33.4,310|-83.42|32.64,312|-83.64|32.83,313|-81.49|31.68,314|-81.15|32.03,315|-82.21|31.4,316|-83.21|31.02,317|-83.87|31.48,318|-84.69|32.45,319|-84.95|32.47,320|-82.58|30.27,321|-81.48|29.39,322|-81.69|30.3,323|-84.25|30.29,324|-85.58|30.55,325|-87.03|30.76,326|-82.6|29.58,327|-81.28|28.79,328|-81.32|28.47,329|-80.67|27.96,330|-80.58|25.31,331|-80.38|25.74,333|-80.25|26.13,334|-81.01|26.64,335|-82.22|28.19,336|-82.47|28.01,337|-82.73|27.85,338|-81.64|27.72,339|-81.71|26.77,341|-81.32|26.11,342|-82.16|27.29,344|-82.35|29.01,346|-82.52|28.41,347|-81.4|28.29,349|-80.72|27.34,350|-86.8|34.05,351|-86.38|33.43,352|-86.77|33.5,354|-87.86|33.07,355|-87.71|33.96,356|-87.4|34.67,357|-86.26|34.75,358|-86.59|34.69,359|-85.94|34.27,360|-86.09|32.09,361|-86.27|32.31,362|-85.65|33.53,363|-85.56|31.34,364|-86.97|31.38,365|-88.14|31.32,366|-88.19|30.68,367|-87.34|32.33,368|-85.41|32.61,369|-88.25|32.12,370|-87.02|36.12,371|-86.23|35.75,372|-86.83|36.15,373|-85.36|35.32,374|-85.33|35.06,376|-82.3|36.36,377|-84.31|36.27,378|-83.35|36.3,379|-83.97|35.97,380|-89.43|35.55,381|-89.96|35.1,382|-88.68|36.29,383|-88.5|35.61,384|-87.36|35.34,385|-85.34|36.18,386|-89.76|34.57,387|-90.81|33.54,388|-88.63|34.36,389|-89.9|33.77,390|-90|32.53,391|-90.67|32.51,392|-90.22|32.32,393|-88.8|32.42,394|-89.26|31.23,395|-89|30.59,396|-90.67|31.32,397|-88.87|33.53,398|-84.67|31.32,400|-85.29|38.07,401|-86.2|37.85,402|-85.66|38.19,403|-84.2|38.06,404|-84.42|37.53,405|-84.45|38.04,406|-84.87|38.22,407|-84.12|36.95,408|-83.26|36.9,409|-83.74|36.95,410|-84.32|38.64,411|-83.06|38.38,412|-82.67|37.89,413|-83.48|37.58,414|-83.15|37.84,415|-82.39|37.46,416|-82.78|37.54,417|-83.25|37.23,418|-82.88|37.21,420|-88.57|36.9,421|-86.09|36.89,422|-87.11|36.95,423|-87.02|37.52,424|-87.7|37.47,425|-84.71|37.15,426|-84.82|36.81,427|-85.73|37.32,430|-82.9|40.21,431|-82.99|39.69,432|-82.97|39.98,433|-83.38|40.55,434|-83.3|41.42,435|-84.22|41.46,436|-83.54|41.67,437|-81.66|39.85,438|-81.88|40.27,439|-80.9|40.25,440|-80.97|41.64,441|-81.66|41.42,442|-81.6|41.13,443|-81.54|41.07,444|-80.77|41.09,445|-80.64|41.05,446|-81.53|40.65,447|-81.39|40.83,448|-82.77|41.02,449|-82.55|40.74,450|-84.48|39.43,451|-83.84|39.16,452|-84.48|39.18,453|-84.3|39.97,454|-84.18|39.74,455|-83.81|39.94,456|-82.86|38.99,457|-81.78|39.35,458|-84.23|40.83,460|-86.13|40.17,461|-86.18|39.62,462|-86.14|39.79,463|-87.05|41.41,464|-87.34|41.55,465|-86.08|41.44,466|-86.28|41.66,467|-85.21|41.17,468|-85.17|41.09,469|-86.14|40.76,470|-85.08|39.16,471|-86.02|38.43,472|-85.74|39.05,473|-85.15|40.09,474|-86.63|38.99,475|-87.03|38.46,476|-87.53|38.13,477|-87.58|38.03,478|-87.29|39.45,479|-87.11|40.5,480|-82.79|42.83,481|-83.62|42.2,482|-83.1|42.38,483|-83.35|42.66,484|-83.22|43.29,485|-83.69|43.03,486|-84.36|43.99,487|-83.67|44.45,488|-84.67|43.02,489|-84.59|42.74,490|-85.54|42.2,491|-86.36|41.87,492|-84.36|42.06,493|-85.57|43.33,494|-86.14|43.39,495|-85.66|42.96,496|-85.52|44.44,497|-84.37|45.17,498|-86.94|46.17,499|-88.93|46.6,500|-94.77|41.63,501|-92.79|41.84,502|-93.67|42.12,503|-93.63|41.59,504|-93.37|43.17,505|-94.45|42.77,506|-92.45|42.65,507|-92.31|42.49,508|-94.56|40.96,510|-95.91|42.6,511|-96.39|42.52,512|-96.06|43.28,513|-95.16|43.27,514|-95.08|42.11,515|-95.55|41.44,516|-95.37|40.74,520|-90.98|42.46,521|-91.73|43.2,522|-92.31|41.9,523|-91.66|41.87,524|-91.69|41.96,525|-92.46|40.95,526|-91.44|40.88,527|-90.88|41.64,528|-90.61|41.56,530|-88.24|43.51,531|-88.33|42.75,532|-87.98|43.06,534|-87.86|42.74,535|-89.66|42.95,537|-89.38|43.08,538|-90.73|42.88,539|-89.55|43.64,540|-92.46|45.08,541|-88.23|45.09,542|-87.6|44.52,543|-88.01|44.53,544|-89.85|44.93,545|-89.86|45.89,546|-90.87|43.93,547|-91.52|44.85,548|-91.63|46.04,549|-88.96|44.19,550|-92.98|45.17,551|-93.08|44.96,553|-94.06|44.99,554|-93.31|45.01,556|-91.03|47.67,557|-92.68|47.39,558|-92.08|46.96,559|-92.28|43.89,560|-94.04|44.02,561|-95.65|43.92,562|-95.75|45.08,563|-94.59|45.83,564|-94.5|46.63,565|-96.08|46.86,566|-94.31|47.88,567|-96.22|48.39,570|-97.07|43.48,571|-96.76|43.54,572|-97.18|45.04,573|-98.53|43.91,574|-98.93|45.36,575|-100.61|43.86,576|-101.59|45.43,577|-103.11|44.26,580|-97.39|46.66,581|-96.83|46.86,582|-97.72|48.25,583|-99.34|48.32,584|-99.12|46.88,585|-100.98|46.76,586|-102.99|46.75,587|-101.7|48.34,588|-103.48|48.2,590|-108.62|45.98,591|-108.45|45.69,592|-105.6|48.2,593|-105.58|46.4,594|-111.24|47.79,595|-109.12|48.38,596|-111.74|46.65,597|-112.31|45.48,598|-114.25|46.97,599|-114.57|48.37,600|-88.15|42.29,601|-88.47|42.01,602|-87.69|42.04,603|-87.79|41.89,604|-88.09|41.39,605|-88.55|41.69,606|-87.69|41.83,607|-87.82|42.03,608|-87.76|41.84,609|-87.92|40.8,610|-89.56|42.18,611|-89.08|42.28,612|-90.29|41.5,613|-89.16|41.34,614|-90.43|40.82,615|-89.68|40.71,616|-89.61|40.72,617|-88.89|40.52,618|-88.15|40.11,619|-88.19|39.66,620|-90.01|39.13,622|-89.72|38.41,623|-91.02|39.99,624|-88.19|39.04,625|-89.21|39.63,626|-90|39.86,627|-89.66|39.8,628|-88.65|38.35,629|-88.89|37.55,630|-90.83|38.35,631|-90.32|38.64,633|-91.11|39.02,634|-91.78|39.93,635|-92.61|40.2,636|-90.64|37.61,637|-89.81|37.37,638|-89.73|36.55,639|-90.62|36.84,640|-94.1|39.07,641|-94.58|39.14,644|-94.69|40.13,645|-94.83|39.75,646|-93.55|39.89,647|-94.15|38.06,648|-94.35|36.93,650|-92.23|38.45,651|-92.19|38.51,652|-92.38|39.21,653|-93.26|38.71,654|-92.03|37.93,655|-91.92|37.67,656|-93.08|36.76,657|-92.43|37.03,658|-93.3|37.22,660|-95.12|38.84,661|-94.73|39.11,662|-94.72|38.95,664|-96.15|39.64,665|-96.34|39.4,666|-95.76|39.06,667|-95.23|37.64,668|-96.39|38.36,669|-97.86|39.77,670|-98.49|37.33,671|-98.4|37.44,672|-97.33|37.7,673|-95.81|37.23,674|-97.79|38.98,675|-98.99|38.25,676|-99.47|39.34,677|-101.15|39.35,678|-100.82|37.91,679|-101.43|37.18,680|-96.46|41.55,681|-96.05|41.24,683|-96.93|40.39,684|-97.26|40.89,685|-96.69|40.82,686|-97.68|41.55,687|-98.16|42.43,688|-99.15|41.34,689|-98.9|40.34,690|-100.99|40.37,691|-101.59|41.42,692|-100.64|42.67,693|-102.84|42.29,700|-89.93|29.63,701|-89.93|30.02,703|-90.65|29.62,704|-90.27|30.66,705|-92.25|30.2,706|-93.21|30.34,707|-91.2|30.57,708|-91.1|30.45,710|-93.4|32.45,711|-93.75|32.47,712|-91.95|32.56,713|-91.86|31.43,714|-92.84|31.57,716|-91.75|33.61,717|-92.79|33.48,718|-93.84|33.66,719|-93.61|34.4,720|-91.9|34.92,721|-92.56|34.93,722|-92.37|34.7,723|-90.59|35.07,724|-90.76|36.04,725|-91.81|36.01,726|-92.93|36.15,727|-94.05|36.11,728|-93.33|35.3,729|-94.08|35.29,730|-97.83|35.31,731|-97.5|35.43,734|-97.14|34.21,735|-98.81|34.53,736|-99.33|35.52,737|-98.2|36.42,738|-99.54|36.5,739|-101.67|36.74,740|-96.19|36.34,741|-95.96|36.15,743|-95.02|36.55,744|-95.44|35.64,745|-95.65|34.66,746|-97.05|36.71,747|-95.41|34.02,748|-96.66|35.17,749|-94.69|35.23,750|-96.76|33.06,751|-96.32|32.48,752|-96.78|32.79,753|-96.84|32.81,754|-95.67|33.37,755|-94.45|33.3,756|-94.58|32.49,757|-95.37|32.24,758|-95.68|31.44,759|-94.29|31.29,760|-97.54|32.59,761|-97.38|32.77,762|-97.44|33.52,763|-98.87|33.73,764|-98.59|32.61,765|-97.62|31.11,766|-97.06|31.7,767|-97.15|31.57,768|-99.37|31.23,769|-100.88|31.03,770|-95.39|29.79,772|-95.37|29.77,773|-95.24|30.48,774|-96.02|29.38,775|-94.98|29.68,776|-94.16|30.27,777|-94.19|29.96,778|-96.32|30.67,779|-96.95|28.92,780|-99.01|28.67,781|-97.93|29.08,782|-98.53|29.47,783|-98.14|27.63,784|-97.44|27.73,785|-98.19|26.39,786|-98.1|30.27,787|-97.78|30.3,788|-100.26|29.44,789|-96.87|29.92,790|-101.63|35.48,791|-101.85|35.21,792|-100.57|34.25,793|-102.15|33.37,794|-101.88|33.58,795|-100.31|32.7,796|-99.72|32.46,797|-102.22|31.57,798|-104.17|30.53,799|-106.16|31.8,800|-105.11|39.91,801|-104.47|39.51,802|-104.93|39.78,803|-105.31|40.04,804|-106.16|39.98,805|-105.35|40.57,806|-104.49|40.38,807|-103.09|40.4,808|-103.16|39.12,809|-104.67|38.79,810|-103.58|37.77,811|-106.39|37.54,812|-106.39|38.46,813|-108.42|37.49,814|-108.02|38.43,815|-108.7|38.92,816|-107.86|39.99,820|-105.27|41.31,821|-110.51|44.57,822|-104.67|42.39,823|-107.03|41.75,824|-108.65|44.32,825|-108.91|43.14,826|-106.43|43.1,827|-105|44.2,828|-106.71|44.55,829|-109.71|42.82,830|-110.51|43.7,831|-110.53|42.6,832|-112.17|42.66,833|-114.23|42.81,834|-111.63|43.86,835|-115.77|46.07,836|-115.99|44,837|-116.04|43.58,838|-116.47|47.77,840|-110.86|40.53,841|-111.81|40.71,843|-112.18|41.67,844|-112.01|41.23,845|-109.72|38.09,846|-111.68|39.63,847|-112.82|37.61,850|-112.09|33.63,851|-111.41|33,852|-111.69|33.6,853|-113.44|33.49,855|-110.3|33.43,856|-110.59|32,857|-111.09|32.18,859|-109.81|34.23,860|-111.15|35.89,863|-112.57|34.85,864|-113.79|35.66,865|-109.55|36.03,870|-106.9|35.22,871|-106.72|35.12,873|-108.56|35.44,874|-108.23|36.59,875|-106.04|36.27,877|-104.68|36.06,878|-107.94|34,879|-107.48|33.2,880|-108.03|32.37,881|-103.81|34.26,882|-104.07|32.87,883|-105.48|33.62,884|-103.79|35.74,890|-114.84|37,891|-115.42|36.33,893|-116.96|39.5,894|-118.06|41.29,895|-119.72|39.9,897|-119.8|39.18,898|-115.71|40.95,900|-118.32|34.04,902|-118.76|34.07,903|-118.34|33.95,904|-118.48|34.02,905|-118.33|33.83,906|-118.03|33.93,907|-118.45|33.39,908|-118.18|33.8,910|-118.25|34.28,911|-118.13|34.15,912|-118.25|34.19,913|-118.55|34.36,914|-118.47|34.18,915|-118.33|34.19,916|-118.38|34.18,917|-117.78|34.14,918|-118.13|34.09,919|-116.62|32.73,920|-116.7|33.16,921|-117.14|32.85,922|-115.5|33.59,923|-117.14|34.66,924|-117.33|34.17,925|-117.06|33.68,926|-117.73|33.63,927|-117.85|33.74,928|-117.71|33.85,930|-119.12|34.39,931|-119.97|34.48,932|-119.07|35.98,933|-119.01|35.35,934|-120.5|35.38,935|-118.36|37.37,936|-119.72|36.95,937|-119.85|36.71,939|-121.42|36.34,940|-122.31|37.41,941|-122.44|37.77,943|-122.13|37.44,944|-122.32|37.53,945|-122.05|38.09,946|-122.19|37.78,947|-122.26|37.89,948|-122.3|37.97,949|-122.74|38.14,950|-121.42|36.85,951|-121.76|37.33,952|-120.79|38.14,953|-120.56|37.62,954|-123.15|39.08,955|-123.75|40.5,956|-121.34|38.62,957|-120.86|39.13,958|-121.44|38.58,959|-121.73|39.47,960|-122.42|41.06,961|-120.33|40.52,967|-155.53|19.6,968|-157.83|21.34,969|144.77|13.45,970|-121.45|45.3,971|-123.79|45.64,972|-122.74|45.57,973|-123.26|44.68,974|-123.46|43.61,975|-123.06|42.34,976|-120.4|42.67,977|-120.77|44.32,978|-118.59|45.21,979|-117.63|43.34,980|-121.78|47.42,981|-122.32|47.6,982|-121.79|48.39,983|-123.87|47.96,984|-122.46|47.18,985|-123.27|46.94,986|-122.15|45.99,988|-119.91|48,989|-120.57|46.71,990|-117.56|47.62,991|-118.13|47.91,992|-117.4|47.67,993|-118.82|46.4,994|-117.21|46.2,995|-156.93|60.89,996|-151.66|60.82,997|-146.69|65.19,998|-136.2|58.94,999|-131.24|55.86";
|
|
1039
1039
|
var k = "ABW|-70.02|12.54,AFG|68|34.63,AGO|14.24|-9.84,AIA|-63.06|18.22,ALA|19.93|60.1,ALB|19.81|41.14,AND|1.53|42.51,ARE|55.24|24.99,ARG|-61.28|-32.95,ARM|44.52|40.23,ASM|-170.7|-14.28,ATA|21.28|-80.52,ATF|70.22|-49.35,ATG|-61.84|17.12,AUS|144.91|-33.49,AUT|15.51|47.93,AZE|49.02|40.37,BDI|29.49|-3.34,BEL|4.37|50.89,BEN|2.33|7.65,BES|-68.27|12.15,BFA|-2.08|12.15,BGD|90.42|23.65,BGR|24.92|42.71,BHR|50.57|26.18,BHS|-77.34|25.06,BIH|17.97|44.18,BLM|-62.85|17.9,BLR|27.81|53.57,BLZ|-88.41|17.54,BMU|-64.78|32.29,BOL|-65.79|-17.39,BRA|-45.89|-17.51,BRB|-59.62|13.11,BRN|114.74|4.82,BTN|89.69|27.32,BWA|25.99|-23.43,CAF|18.32|4.94,CAN|-79.4|43.71,CCK|96.82|-12.16,CHE|7.96|47.07,CHL|-71.21|-33.72,CHN|114.44|32,CIV|-4.89|6.16,CMR|11.19|5.41,COD|20.23|-4.72,COG|14.18|-4.04,COK|-159.78|-21.21,COL|-74.85|5.93,COM|43.58|-11.89,CPV|-23.87|15.66,CRI|-84.14|9.99,CUB|-80.25|22.21,CUW|-68.88|12.12,CXR|105.68|-10.42,CYM|-81.38|19.32,CYP|33.31|35,CZE|15.44|49.89,DEU|9.65|51.24,DJI|43.15|11.59,DMA|-61.39|15.3,DNK|11.42|55.79,DOM|-70.07|18.75,DZA|3.55|35.62,ECU|-79.29|-1.4,EGY|31.22|29.84,ERI|38.84|15.25,ESH|-13.19|27.14,ESP|-2.91|39.69,EST|25.17|59.29,ETH|39.02|9.26,FIN|24.87|61.26,FJI|178.2|-17.85,FLK|-57.86|-51.69,FRA|2.87|47.28,FRO|-6.77|62.01,FSM|158.16|6.92,GAB|10.22|-0.06,GBR|-1.37|52.49,GEO|43.92|41.84,GGY|-2.54|49.46,GHA|-0.98|6.4,GIB|-5.35|36.14,GIN|-12.8|9.75,GLP|-61.53|16.23,GMB|-16.59|13.41,GNB|-15.48|11.9,GNQ|9.77|1.86,GRC|23.73|37.98,GRD|-61.75|12.05,GRL|-51.72|64.18,GTM|-90.71|14.73,GUF|-52.64|5.04,GUM|144.82|13.5,GUY|-58.11|6.63,HKG|114.15|22.33,HMD|73.5|-53.1,HND|-87.41|14.94,HRV|16.21|45.31,HTI|-72.34|18.54,HUN|19.21|47.39,IDN|106.85|-6.21,IMN|-4.48|54.15,IND|78.36|21,IOT|71.35|-6.19,IRL|-6.87|53.12,IRN|51.6|34.4,IRQ|44.78|33.65,ISL|-21.7|64.22,ISR|34.97|32.07,ITA|12|42.73,JAM|-76.91|18.03,JEY|-2.1|49.19,JOR|35.96|32.03,JPN|137.27|35.53,KAZ|70.17|47.24,KEN|36.81|-0.97,KGZ|73.96|41.94,KHM|104.7|11.75,KIR|172.98|1.33,KNA|-62.72|17.3,KOR|127.51|36.58,KWT|48.06|29.2,Kosovo|20.9|42.58,LAO|102.6|17.97,LBN|35.53|33.87,LBR|-10.39|6.36,LBY|13.19|32.89,LCA|-60.97|14.04,LIE|9.52|47.14,LKA|80.25|7.25,LSO|27.67|-29.38,LTU|24.18|55.04,LUX|6.08|49.56,LVA|24.13|56.85,MAC|113.55|22.19,MAF|-63.08|18.07,MAR|-6.65|33.43,MCO|7.42|43.74,MDA|28.82|47.09,MDG|47.46|-18.89,MDV|73.51|4.18,MEX|-100.65|21.59,MHL|171.38|7.09,MKD|21.47|41.8,MLI|-7.15|12.95,MLT|14.46|35.91,MMR|96.18|18.74,MNE|19.17|42.53,MNG|105.33|47.94,MNP|145.75|15.21,MOZ|32.58|-25.97,MRT|-14.58|18.01,MSR|-62.21|16.79,MTQ|-61.01|14.64,MUS|57.51|-20.23,MWI|34.34|-14.24,MYS|103.35|3.45,MYT|45.23|-12.77,N. Cyprus|33.56|35.27,NAM|17.19|-21.34,NCL|166.47|-22.26,NER|5.05|14.04,NFK|167.97|-29.05,NGA|5.91|7.87,NIC|-86.17|12.33,NIU|-169.92|-19.05,NLD|5.21|52.09,NOR|9.62|60.46,NPL|84.7|27.64,NRU|166.93|-0.55,NZL|174.54|-38.9,OMN|57.69|23.27,PAK|71.47|30.24,PAN|-79.83|8.98,PCN|-130.1|-25.07,PER|-76.4|-11.18,PHL|121.05|14.65,PLW|134.58|7.52,PNG|147.4|-7.71,POL|19.26|51.79,PRI|-66.24|18.35,PRK|126.54|39.52,PRT|-9.08|39.42,PRY|-57.15|-25.27,PSE|35.23|31.78,PYF|-149.59|-17.57,QAT|51.49|25.32,REU|55.45|-21.08,ROU|25.47|45.38,RUS|51.84|54.52,RWA|29.78|-1.98,SAU|43.01|23.76,SDN|31.67|14.67,SEN|-16.73|14.66,SGP|103.85|1.33,SGS|-36.51|-54.28,SHN|-5.72|-15.92,SJM|15.65|78.22,SLB|159.97|-9.44,SLE|-12.4|8.36,SLV|-89.08|13.7,SMR|12.45|43.94,SOM|44.96|4.91,SPM|-56.18|46.78,SRB|20.62|44.5,SSD|29.91|6.61,STP|6.73|0.34,SUR|-55.18|5.84,SVK|18.69|48.55,SVN|14.83|46.16,SWE|16.03|58.86,SWZ|31.28|-26.43,SXM|-63.05|18.03,SYC|55.46|-4.62,SYR|37.18|35.12,Somaliland|46.23|9.76,TCA|-72.1|21.74,TCD|16.57|11.53,TGO|1.16|6.8,THA|100.71|13.71,TJK|69.39|39.08,TKM|59.4|38.74,TLS|125.65|-8.67,TON|-175.2|-21.14,TTO|-61.4|10.5,TUN|10.23|35.87,TUR|32.1|39.5,TUV|179.19|-8.52,TWN|121.06|24.37,TZA|36.11|-5.88,UGA|32.23|0.59,UKR|32.8|48.99,URY|-56.28|-34.1,USA|-93.51|37.4,UZB|69.22|41.26,VAT|12.45|41.9,VCT|-61.21|13.14,VEN|-67.82|9.83,VGB|-64.62|18.43,VIR|-64.8|17.9,VNM|106.63|10.82,VUT|168.31|-17.74,WLF|-176.17|-13.28,WSM|-171.77|-13.83,YEM|44.62|14.36,ZAF|26.96|-28.33,ZMB|28.41|-13.86,ZWE|30.49|-18.56";
|
|
1040
1040
|
var W = { \u00F8: "o", \u0153: "oe", \u00E6: "ae", \u00DF: "ss", \u0142: "l", \u0111: "d", \u00F0: "d", \u00FE: "th", \u0131: "i", \u0127: "h", \u0167: "t", \u014B: "n", \u0138: "k", \u0259: "e", \u01DD: "e", \u0133: "ij", \u0140: "l", \u017F: "s" };
|
|
1041
|
-
function u(
|
|
1042
|
-
return
|
|
1041
|
+
function u(n) {
|
|
1042
|
+
return n.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().replace(/[øœæßłđðþıħŧŋəĸ]/g, (e) => W[e]).replace(/[^\p{L}\p{Nd}\s]/gu, " ").replace(/\s+/g, " ").trim();
|
|
1043
1043
|
}
|
|
1044
1044
|
var _ = "AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,AS ASM,AT AUT,AU AUS,AW ABW,AX ALA,AZ AZE,BA BIH,BB BRB,BD BGD,BE BEL,BF BFA,BG BGR,BH BHR,BI BDI,BJ BEN,BL BLM,BM BMU,BN BRN,BO BOL,BQ BES,BR BRA,BS BHS,BT BTN,BV BVT,BW BWA,BY BLR,BZ BLZ,CA CAN,CC CCK,CD COD,CF CAF,CG COG,CH CHE,CI CIV,CK COK,CL CHL,CM CMR,CN CHN,CO COL,CR CRI,CU CUB,CV CPV,CW CUW,CX CXR,CY CYP,CZ CZE,DE DEU,DJ DJI,DK DNK,DM DMA,DO DOM,DZ DZA,EC ECU,EE EST,EG EGY,EH ESH,ER ERI,ES ESP,ET ETH,FI FIN,FJ FJI,FK FLK,FM FSM,FO FRO,FR FRA,GA GAB,GB GBR,GD GRD,GE GEO,GF GUF,GG GGY,GH GHA,GI GIB,GL GRL,GM GMB,GN GIN,GP GLP,GQ GNQ,GR GRC,GS SGS,GT GTM,GU GUM,GW GNB,GY GUY,HK HKG,HM HMD,HN HND,HR HRV,HT HTI,HU HUN,ID IDN,IE IRL,IL ISR,IM IMN,IN IND,IO IOT,IQ IRQ,IR IRN,IS ISL,IT ITA,JE JEY,JM JAM,JO JOR,JP JPN,KE KEN,KG KGZ,KH KHM,KI KIR,KM COM,KN KNA,KP PRK,KR KOR,KW KWT,KY CYM,KZ KAZ,LA LAO,LB LBN,LC LCA,LI LIE,LK LKA,LR LBR,LS LSO,LT LTU,LU LUX,LV LVA,LY LBY,MA MAR,MC MCO,MD MDA,ME MNE,MF MAF,MG MDG,MH MHL,MK MKD,ML MLI,MM MMR,MN MNG,MO MAC,MP MNP,MQ MTQ,MR MRT,MS MSR,MT MLT,MU MUS,MV MDV,MW MWI,MX MEX,MY MYS,MZ MOZ,NA NAM,NC NCL,NE NER,NF NFK,NG NGA,NI NIC,NL NLD,NO NOR,NP NPL,NR NRU,NU NIU,NZ NZL,OM OMN,PA PAN,PE PER,PF PYF,PG PNG,PH PHL,PK PAK,PL POL,PM SPM,PN PCN,PR PRI,PS PSE,PT PRT,PW PLW,PY PRY,QA QAT,RE REU,RO ROU,RS SRB,RU RUS,RW RWA,SA SAU,SB SLB,SC SYC,SD SDN,SE SWE,SG SGP,SH SHN,SI SVN,SJ SJM,SK SVK,SL SLE,SM SMR,SN SEN,SO SOM,SR SUR,SS SSD,ST STP,SV SLV,SX SXM,SY SYR,SZ SWZ,TC TCA,TD TCD,TF ATF,TG TGO,TH THA,TJ TJK,TK TKL,TL TLS,TM TKM,TN TUN,TO TON,TR TUR,TT TTO,TV TUV,TW TWN,TZ TZA,UA UKR,UG UGA,UM UMI,US USA,UY URY,UZ UZB,VA VAT,VC VCT,VE VEN,VG VGB,VI VIR,VN VNM,VU VUT,WF WLF,WS WSM,YE YEM,YT MYT,ZA ZAF,ZM ZMB,ZW ZWE";
|
|
1045
1045
|
var N = (() => {
|
|
1046
|
-
let
|
|
1046
|
+
let n = /* @__PURE__ */ new Map();
|
|
1047
1047
|
for (let e of _.split(",")) {
|
|
1048
1048
|
let [t, o2] = e.split(" ");
|
|
1049
|
-
t && o2 &&
|
|
1049
|
+
t && o2 && n.set(t, o2);
|
|
1050
1050
|
}
|
|
1051
|
-
return
|
|
1051
|
+
return n;
|
|
1052
1052
|
})();
|
|
1053
1053
|
var z = new Set(N.keys());
|
|
1054
1054
|
var J = new Set(N.values());
|
|
@@ -1057,7 +1057,7 @@ var Q = { usa: "USA", "u.s.": "USA", "u.s.a.": "USA", us: "USA", america: "USA",
|
|
|
1057
1057
|
var b = null;
|
|
1058
1058
|
function j() {
|
|
1059
1059
|
if (b) return b;
|
|
1060
|
-
let
|
|
1060
|
+
let n = /* @__PURE__ */ new Map(), e = ["en", ...v.filter((t) => t !== "en")];
|
|
1061
1061
|
for (let t of e) {
|
|
1062
1062
|
let o2 = null;
|
|
1063
1063
|
try {
|
|
@@ -1065,7 +1065,7 @@ function j() {
|
|
|
1065
1065
|
} catch {
|
|
1066
1066
|
continue;
|
|
1067
1067
|
}
|
|
1068
|
-
for (let [i,
|
|
1068
|
+
for (let [i, r2] of N) {
|
|
1069
1069
|
let a2;
|
|
1070
1070
|
try {
|
|
1071
1071
|
a2 = o2.of(i);
|
|
@@ -1074,38 +1074,38 @@ function j() {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
if (!a2 || a2 === i) continue;
|
|
1076
1076
|
let s = u(a2);
|
|
1077
|
-
s && !
|
|
1077
|
+
s && !n.has(s) && n.set(s, r2);
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
for (let [t, o2] of Object.entries(Q)) {
|
|
1081
1081
|
let i = u(t);
|
|
1082
|
-
i &&
|
|
1082
|
+
i && n.set(i, o2);
|
|
1083
1083
|
}
|
|
1084
|
-
return b =
|
|
1084
|
+
return b = n, n;
|
|
1085
1085
|
}
|
|
1086
|
-
function T(
|
|
1087
|
-
return N.get(String(
|
|
1086
|
+
function T(n) {
|
|
1087
|
+
return N.get(String(n || "").trim().toUpperCase()) ?? null;
|
|
1088
1088
|
}
|
|
1089
|
-
function E(
|
|
1090
|
-
if (
|
|
1091
|
-
let e = String(
|
|
1089
|
+
function E(n) {
|
|
1090
|
+
if (n == null) return null;
|
|
1091
|
+
let e = String(n).trim();
|
|
1092
1092
|
if (!e) return null;
|
|
1093
1093
|
let t = e.toUpperCase();
|
|
1094
1094
|
return t.length === 3 && J.has(t) ? t : t.length === 2 && z.has(t) ? N.get(t) ?? null : j().get(u(e)) ?? null;
|
|
1095
1095
|
}
|
|
1096
1096
|
var $ = /* @__PURE__ */ new Set(["n a", "none", "null", "nil", "unknown", "not applicable", "not available", "not specified", "unspecified", "missing", "blank", "empty", "tbd", "to be determined"]);
|
|
1097
|
-
function V(
|
|
1098
|
-
return
|
|
1097
|
+
function V(n) {
|
|
1098
|
+
return n ? $.has(n) : true;
|
|
1099
1099
|
}
|
|
1100
1100
|
var m3 = 80;
|
|
1101
1101
|
var q = { "north-america": "N", world: "W" };
|
|
1102
|
-
function F(
|
|
1103
|
-
let t =
|
|
1104
|
-
return t.length ? t : (e || "north-america") === "world" ?
|
|
1102
|
+
function F(n, e) {
|
|
1103
|
+
let t = n.filter((o2) => o2.row.kinds.includes(q[e || "north-america"]));
|
|
1104
|
+
return t.length ? t : (e || "north-america") === "world" ? n : t;
|
|
1105
1105
|
}
|
|
1106
1106
|
var P = a;
|
|
1107
|
-
function L3(
|
|
1108
|
-
|
|
1107
|
+
function L3(n) {
|
|
1108
|
+
n !== P && (P = n || "", U = null, L = null, I = null);
|
|
1109
1109
|
}
|
|
1110
1110
|
function n3() {
|
|
1111
1111
|
return P.length > 0;
|
|
@@ -1114,39 +1114,39 @@ var t3 = { US: "washington", CA: "ottawa", MX: "mexico city", GB: "london", FR:
|
|
|
1114
1114
|
var U = null;
|
|
1115
1115
|
function y() {
|
|
1116
1116
|
if (U) return U;
|
|
1117
|
-
let
|
|
1117
|
+
let n = /* @__PURE__ */ new Map(), e = P, t = (o2, i, r2) => {
|
|
1118
1118
|
if (!o2) return;
|
|
1119
|
-
let a2 =
|
|
1120
|
-
a2 ? a2.some((s) => s.row === i) || a2.push({ row: i, primary:
|
|
1119
|
+
let a2 = n.get(o2);
|
|
1120
|
+
a2 ? a2.some((s) => s.row === i) || a2.push({ row: i, primary: r2 }) : n.set(o2, [{ row: i, primary: r2 }]);
|
|
1121
1121
|
};
|
|
1122
1122
|
for (let o2 of e.split(",")) {
|
|
1123
1123
|
let i = o2.split("|");
|
|
1124
1124
|
if (i.length < 7) continue;
|
|
1125
|
-
let
|
|
1126
|
-
i.length > 8 && i[8] && (
|
|
1127
|
-
let a2 = t3[
|
|
1128
|
-
if (a2 && u(i[0]) === a2 && (
|
|
1125
|
+
let r2 = { a1: i[1], cc: i[2], lon: +i[3], lat: +i[4], pop: +i[5], kinds: i[6] || "N" };
|
|
1126
|
+
i.length > 8 && i[8] && (r2.tags = i[8].split(";").filter(Boolean));
|
|
1127
|
+
let a2 = t3[r2.cc];
|
|
1128
|
+
if (a2 && u(i[0]) === a2 && (r2.tags || (r2.tags = []), r2.tags.includes("capital") || r2.tags.push("capital")), t(u(i[0]), r2, true), i.length > 7 && i[7]) for (let s of i[7].split(";")) t(u(s), r2, false);
|
|
1129
1129
|
}
|
|
1130
|
-
for (let o2 of
|
|
1131
|
-
return U =
|
|
1130
|
+
for (let o2 of n.values()) o2.sort((i, r2) => r2.row.pop - i.row.pop);
|
|
1131
|
+
return U = n, n;
|
|
1132
1132
|
}
|
|
1133
1133
|
var e3 = 200;
|
|
1134
1134
|
var L = null;
|
|
1135
1135
|
function i3() {
|
|
1136
1136
|
if (L) return L;
|
|
1137
|
-
let
|
|
1137
|
+
let n = /* @__PURE__ */ new Map();
|
|
1138
1138
|
for (let [e, t] of y()) {
|
|
1139
1139
|
if (!e.endsWith(" city")) continue;
|
|
1140
1140
|
let o2 = e.slice(0, -5);
|
|
1141
|
-
!o2 || y().get(o2)?.some((i) => i.primary) || t[0].row.pop < e3 ||
|
|
1141
|
+
!o2 || y().get(o2)?.some((i) => i.primary) || t[0].row.pop < e3 || n.set(o2, t);
|
|
1142
1142
|
}
|
|
1143
|
-
return L =
|
|
1143
|
+
return L = n, n;
|
|
1144
1144
|
}
|
|
1145
|
-
function O(
|
|
1146
|
-
if (!
|
|
1147
|
-
let e = y().get(
|
|
1145
|
+
function O(n) {
|
|
1146
|
+
if (!n) return;
|
|
1147
|
+
let e = y().get(n);
|
|
1148
1148
|
if (e?.some((i) => i.primary)) return e;
|
|
1149
|
-
let t = i3().get(
|
|
1149
|
+
let t = i3().get(n);
|
|
1150
1150
|
if (!t) return e;
|
|
1151
1151
|
let o2 = t.map((i) => ({ row: i.row, primary: true }));
|
|
1152
1152
|
return e ? [...o2, ...e] : o2;
|
|
@@ -1154,68 +1154,68 @@ function O(n2) {
|
|
|
1154
1154
|
var I = null;
|
|
1155
1155
|
function o3() {
|
|
1156
1156
|
if (I) return I;
|
|
1157
|
-
let
|
|
1157
|
+
let n = /* @__PURE__ */ new Map();
|
|
1158
1158
|
for (let t of k.split(",")) {
|
|
1159
1159
|
let o2 = t.split("|");
|
|
1160
|
-
o2.length < 3 ||
|
|
1160
|
+
o2.length < 3 || n.set(o2[0], { lon: +o2[1], lat: +o2[2] });
|
|
1161
1161
|
}
|
|
1162
1162
|
let e = /* @__PURE__ */ new Map();
|
|
1163
1163
|
for (let t of y().values()) for (let o2 of t) {
|
|
1164
1164
|
let i = T(o2.row.cc);
|
|
1165
1165
|
if (!i) continue;
|
|
1166
|
-
let
|
|
1167
|
-
(
|
|
1166
|
+
let r2 = e.get(i);
|
|
1167
|
+
(r2 === void 0 || o2.row.pop > r2) && (e.set(i, o2.row.pop), n.set(i, { lon: o2.row.lon, lat: o2.row.lat }));
|
|
1168
1168
|
}
|
|
1169
|
-
return I =
|
|
1169
|
+
return I = n, n;
|
|
1170
1170
|
}
|
|
1171
1171
|
var h = null;
|
|
1172
1172
|
function D() {
|
|
1173
1173
|
if (h) return h;
|
|
1174
|
-
let
|
|
1174
|
+
let n = /* @__PURE__ */ new Map();
|
|
1175
1175
|
for (let e of H.split(",")) {
|
|
1176
1176
|
let t = e.split("|");
|
|
1177
1177
|
if (t.length < 5) continue;
|
|
1178
1178
|
let o2 = { key: t[0], cc: t[1], name: t[2], lon: +t[3], lat: +t[4] };
|
|
1179
|
-
|
|
1179
|
+
n.set(u(o2.key), o2);
|
|
1180
1180
|
let i = u(o2.name);
|
|
1181
|
-
i === "mexico" && o2.cc === "MX" ? (
|
|
1181
|
+
i === "mexico" && o2.cc === "MX" ? (n.set("estado de mexico", o2), n.set("edomex", o2)) : n.set(i, o2);
|
|
1182
1182
|
}
|
|
1183
|
-
return h =
|
|
1183
|
+
return h = n, n;
|
|
1184
1184
|
}
|
|
1185
1185
|
var B = null;
|
|
1186
1186
|
function a3() {
|
|
1187
1187
|
if (B) return B;
|
|
1188
|
-
let
|
|
1188
|
+
let n = /* @__PURE__ */ new Map();
|
|
1189
1189
|
for (let e of X.split(",")) {
|
|
1190
1190
|
let t = e.split("|");
|
|
1191
|
-
t.length < 3 ||
|
|
1191
|
+
t.length < 3 || n.set(t[0], { lon: +t[1], lat: +t[2] });
|
|
1192
1192
|
}
|
|
1193
|
-
return B =
|
|
1193
|
+
return B = n, n;
|
|
1194
1194
|
}
|
|
1195
1195
|
var r3 = /* @__PURE__ */ new Set(["USA", "PRI", "VIR", "GUM", "ASM", "MNP"]);
|
|
1196
1196
|
var s3 = /* @__PURE__ */ new Set(["USA", "CAN", "MEX"]);
|
|
1197
|
-
function Y(
|
|
1198
|
-
if (
|
|
1199
|
-
let e = u(String(
|
|
1197
|
+
function Y(n) {
|
|
1198
|
+
if (n == null) return null;
|
|
1199
|
+
let e = u(String(n));
|
|
1200
1200
|
return e ? D().get(e)?.key ?? null : null;
|
|
1201
1201
|
}
|
|
1202
|
-
function u3(
|
|
1203
|
-
return D().get(u(
|
|
1202
|
+
function u3(n) {
|
|
1203
|
+
return D().get(u(n))?.cc ?? null;
|
|
1204
1204
|
}
|
|
1205
|
-
function c3(
|
|
1206
|
-
let e = u3(
|
|
1205
|
+
function c3(n) {
|
|
1206
|
+
let e = u3(n);
|
|
1207
1207
|
return e ? T(e) : null;
|
|
1208
1208
|
}
|
|
1209
|
-
function M3(
|
|
1210
|
-
if (
|
|
1211
|
-
let e = String(
|
|
1209
|
+
function M3(n) {
|
|
1210
|
+
if (n == null) return null;
|
|
1211
|
+
let e = String(n).trim().replace(/\.0+$/, "");
|
|
1212
1212
|
if (!e) return null;
|
|
1213
1213
|
let t = /^(\d{5})(-\d{4})?$/.exec(e);
|
|
1214
1214
|
return t ? t[1] : /^\d{3,4}$/.test(e) ? e.padStart(5, "0") : null;
|
|
1215
1215
|
}
|
|
1216
|
-
function Z(
|
|
1217
|
-
if (
|
|
1218
|
-
let e = String(
|
|
1216
|
+
function Z(n) {
|
|
1217
|
+
if (n == null) return [];
|
|
1218
|
+
let e = String(n).trim().replace(/\.0+$/, "");
|
|
1219
1219
|
if (!e) return [];
|
|
1220
1220
|
if (/^\d{3}$/.test(e)) {
|
|
1221
1221
|
let o2 = e.padStart(5, "0").slice(0, 3);
|
|
@@ -1224,28 +1224,28 @@ function Z(n2) {
|
|
|
1224
1224
|
let t = M3(e);
|
|
1225
1225
|
return t ? [t.slice(0, 3)] : [];
|
|
1226
1226
|
}
|
|
1227
|
-
function S3(
|
|
1228
|
-
return !!
|
|
1227
|
+
function S3(n) {
|
|
1228
|
+
return !!n && n.ambiguous === true && !("precision" in n);
|
|
1229
1229
|
}
|
|
1230
|
-
function A3(
|
|
1231
|
-
let e = null, t = typeof
|
|
1230
|
+
function A3(n) {
|
|
1231
|
+
let e = null, t = typeof n.lat == "string" ? n.lat.trim() : n.lat, o2 = typeof n.lon == "string" ? n.lon.trim() : n.lon;
|
|
1232
1232
|
if (t != null && t !== "" && o2 !== void 0 && o2 !== null && o2 !== "") {
|
|
1233
1233
|
let a2 = +t, s = +o2;
|
|
1234
1234
|
if (isFinite(a2) && isFinite(s) && a2 >= -90 && a2 <= 90 && s >= -180 && s <= 180) if (a2 === 0 && s === 0) e = { lat: 0, lon: 0, precision: "latlon" };
|
|
1235
1235
|
else return { lat: a2, lon: s, precision: "latlon" };
|
|
1236
1236
|
}
|
|
1237
|
-
let i = E(
|
|
1238
|
-
if (
|
|
1239
|
-
let a2 = u(String(
|
|
1237
|
+
let i = E(n.country), r2 = Y(n.state);
|
|
1238
|
+
if (r2 && i && c3(r2) !== i && (r2 = null), n.city !== void 0 && n.city !== null) {
|
|
1239
|
+
let a2 = u(String(n.city)), s = O(a2), f4 = s ? F(s, n.mapKind) : null;
|
|
1240
1240
|
if (f4 && f4.length) {
|
|
1241
|
-
let d2 =
|
|
1241
|
+
let d2 = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R2 = d2 ? u(d2) : "", g3 = d2 ? Y(d2) : null, S2 = [], m2 = -1;
|
|
1242
1242
|
for (let c2 of f4) {
|
|
1243
|
-
let l = c2.row,
|
|
1244
|
-
if (d2 && l.a1 !== "") if (g3 && l.a1 === g3 || u(l.a1) === R2)
|
|
1243
|
+
let l = c2.row, A2 = 0;
|
|
1244
|
+
if (d2 && l.a1 !== "") if (g3 && l.a1 === g3 || u(l.a1) === R2) A2++;
|
|
1245
1245
|
else continue;
|
|
1246
|
-
if (i) if (T(l.cc) === i)
|
|
1246
|
+
if (i) if (T(l.cc) === i) A2++;
|
|
1247
1247
|
else continue;
|
|
1248
|
-
|
|
1248
|
+
A2 > m2 ? (m2 = A2, S2 = [c2]) : A2 === m2 && S2.push(c2);
|
|
1249
1249
|
}
|
|
1250
1250
|
S2.some((c2) => c2.primary) && (S2 = S2.filter((c2) => c2.primary));
|
|
1251
1251
|
let p2 = /* @__PURE__ */ new Map();
|
|
@@ -1257,15 +1257,15 @@ function A3(n2) {
|
|
|
1257
1257
|
if (p2.size > 1) return { ambiguous: true, matches: p2.size };
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
if (!i || r3.has(i)) for (let a2 of Z(
|
|
1260
|
+
if (!i || r3.has(i)) for (let a2 of Z(n.zip)) {
|
|
1261
1261
|
let s = a3().get(a2);
|
|
1262
1262
|
if (s) return { lat: s.lat, lon: s.lon, precision: "zip3" };
|
|
1263
1263
|
}
|
|
1264
|
-
if (
|
|
1265
|
-
let a2 = D().get(u(
|
|
1264
|
+
if (r2) {
|
|
1265
|
+
let a2 = D().get(u(r2));
|
|
1266
1266
|
if (a2) return { lat: a2.lat, lon: a2.lon, precision: "state" };
|
|
1267
1267
|
}
|
|
1268
|
-
if (i && (
|
|
1268
|
+
if (i && (n.mapKind !== "north-america" || s3.has(i))) {
|
|
1269
1269
|
let a2 = o3().get(i);
|
|
1270
1270
|
if (a2) return { lat: a2.lat, lon: a2.lon, precision: "country" };
|
|
1271
1271
|
}
|
|
@@ -1273,159 +1273,159 @@ function A3(n2) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
var G = { latlon: 0, city: 1, zip3: 2, state: 3, country: 4 };
|
|
1275
1275
|
var x = 8;
|
|
1276
|
-
function y3(
|
|
1277
|
-
let t = new Array(
|
|
1278
|
-
for (let l = 0; l <
|
|
1279
|
-
let
|
|
1280
|
-
if (S3(
|
|
1276
|
+
function y3(n, e) {
|
|
1277
|
+
let t = new Array(n.length), o2 = new Array(n.length), i = new Array(n.length), r2 = /* @__PURE__ */ new Set(), a2 = [], s = /* @__PURE__ */ new Set(), f4 = [], d2 = /* @__PURE__ */ new Set(), R2 = [], g3 = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S2 = 0, m2 = 0, p2 = null;
|
|
1278
|
+
for (let l = 0; l < n.length; ++l) {
|
|
1279
|
+
let A2 = n[l], C2 = A3({ ...A2, mapKind: e });
|
|
1280
|
+
if (S3(C2)) {
|
|
1281
1281
|
t[l] = null, o2[l] = null, i[l] = null, m2++;
|
|
1282
|
-
let M2 = K(
|
|
1282
|
+
let M2 = K(A2);
|
|
1283
1283
|
M2 && !d2.has(M2.toLowerCase()) && (d2.add(M2.toLowerCase()), R2.length < x && R2.push(M2));
|
|
1284
|
-
} else if (
|
|
1285
|
-
if (t[l] =
|
|
1286
|
-
let M2 = K(
|
|
1284
|
+
} else if (C2) {
|
|
1285
|
+
if (t[l] = C2.lat, o2[l] = C2.lon, i[l] = C2.precision, S2++, g3[C2.precision]++, (p2 === null || G[C2.precision] > G[p2]) && (p2 = C2.precision), G[C2.precision] > G.city) {
|
|
1286
|
+
let M2 = K(A2);
|
|
1287
1287
|
M2 && !s.has(M2.toLowerCase()) && (s.add(M2.toLowerCase()), f4.length < x && f4.push(M2));
|
|
1288
1288
|
}
|
|
1289
1289
|
} else {
|
|
1290
1290
|
t[l] = null, o2[l] = null, i[l] = null;
|
|
1291
|
-
let M2 = K(
|
|
1292
|
-
M2 && !
|
|
1291
|
+
let M2 = K(A2);
|
|
1292
|
+
M2 && !r2.has(M2.toLowerCase()) && (r2.add(M2.toLowerCase()), a2.push(M2));
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
|
-
let c2 = !n3() &&
|
|
1296
|
-
return { lat: t, lon: o2, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a2, ambiguousRows: m2, ambiguousExamples: R2, matchedRows: S2, totalRows:
|
|
1295
|
+
let c2 = !n3() && n.some((l) => l.city !== null && l.city !== void 0 && String(l.city).trim() !== "");
|
|
1296
|
+
return { lat: t, lon: o2, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a2, ambiguousRows: m2, ambiguousExamples: R2, matchedRows: S2, totalRows: n.length, ...c2 ? { cityTableMissing: true } : {} };
|
|
1297
1297
|
}
|
|
1298
|
-
function K(
|
|
1299
|
-
let e = [
|
|
1300
|
-
return e || (
|
|
1298
|
+
function K(n) {
|
|
1299
|
+
let e = [n.city, n.state, n.zip, n.country].filter((t) => t != null && String(t).trim() !== "").map((t) => String(t).trim()).join(", ");
|
|
1300
|
+
return e || (n.label === null || n.label === void 0 ? "" : String(n.label).trim());
|
|
1301
1301
|
}
|
|
1302
|
-
function p3(
|
|
1303
|
-
if (!
|
|
1304
|
-
let t = O(
|
|
1302
|
+
function p3(n, e) {
|
|
1303
|
+
if (!n) return false;
|
|
1304
|
+
let t = O(n);
|
|
1305
1305
|
return t ? F(t, e).length > 0 : false;
|
|
1306
1306
|
}
|
|
1307
1307
|
|
|
1308
|
-
// ../shape-core/dist/chunk-
|
|
1308
|
+
// ../shape-core/dist/chunk-4VN252CK.mjs
|
|
1309
1309
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1310
|
-
var o = (e,
|
|
1310
|
+
var o = (e, n, t, r2 = {}) => ({ code: e, name: n, script: t, dir: "ltr", intl: e, aliases: [], wordBreaks: true, compounds: false, gluedPrefixes: [], foldSensitive: false, ...r2 });
|
|
1311
1311
|
var g = Object.freeze([o("en", "English", "Latn"), o("nl", "Dutch", "Latn", { compounds: true }), o("de", "German", "Latn", { compounds: true }), o("fr", "French", "Latn"), o("es", "Spanish", "Latn"), o("pt", "Portuguese", "Latn"), o("it", "Italian", "Latn"), o("pl", "Polish", "Latn"), o("cs", "Czech", "Latn"), o("sk", "Slovak", "Latn"), o("sv", "Swedish", "Latn", { compounds: true }), o("da", "Danish", "Latn", { compounds: true }), o("nb", "Norwegian Bokmal", "Latn", { compounds: true, aliases: ["no"] }), o("fi", "Finnish", "Latn", { compounds: true }), o("hu", "Hungarian", "Latn", { compounds: true }), o("tr", "Turkish", "Latn"), o("ro", "Romanian", "Latn"), o("hr", "Croatian", "Latn"), o("id", "Indonesian", "Latn", { aliases: ["in"] }), o("vi", "Vietnamese", "Latn", { foldSensitive: true }), o("ru", "Russian", "Cyrl"), o("uk", "Ukrainian", "Cyrl"), o("el", "Greek", "Grek"), o("zh", "Chinese (Simplified)", "Hani", { intl: "zh-Hans", wordBreaks: false }), o("ja", "Japanese", "Jpan", { wordBreaks: false }), o("ko", "Korean", "Hang"), o("ar", "Arabic", "Arab", { dir: "rtl", gluedPrefixes: ["\u0627\u0644", "\u0648\u0627\u0644", "\u0628\u0627\u0644", "\u0641\u0627\u0644", "\u0643\u0627\u0644", "\u0644\u0644", "\u0648", "\u0641", "\u0628", "\u0643", "\u0644"] }), o("he", "Hebrew", "Hebr", { dir: "rtl", aliases: ["iw"], gluedPrefixes: ["\u05D4", "\u05D5", "\u05D1", "\u05DC", "\u05DE", "\u05E9", "\u05DB", "\u05D5\u05D4", "\u05E9\u05D4", "\u05DE\u05D4", "\u05D5\u05D1", "\u05D5\u05DC", "\u05D5\u05DE", "\u05D1\u05D4", "\u05DC\u05D4"] }), o("hi", "Hindi", "Deva"), o("th", "Thai", "Thai", { wordBreaks: false })]);
|
|
1312
|
-
var
|
|
1312
|
+
var S = Object.freeze(g.map((e) => e.code));
|
|
1313
1313
|
var c = new Map(g.map((e) => [e.code, e]));
|
|
1314
|
-
var
|
|
1314
|
+
var F2 = new Map(g.flatMap((e) => e.aliases.map((n) => [n, e])));
|
|
1315
1315
|
var h2 = Object.freeze([o("fa", "Persian", "Arab", { dir: "rtl" })]);
|
|
1316
|
-
var
|
|
1317
|
-
var
|
|
1318
|
-
var
|
|
1319
|
-
var
|
|
1320
|
-
var
|
|
1321
|
-
function
|
|
1322
|
-
let
|
|
1323
|
-
if (
|
|
1316
|
+
var Z2 = Object.freeze([...S, ...h2.map((e) => e.code)]);
|
|
1317
|
+
var b2 = new Map(h2.map((e) => [e.code, e]));
|
|
1318
|
+
var E2 = { \u0142: "l", \u0141: "L", \u0131: "i", \u00F8: "o", \u00D8: "O", \u0111: "d", \u0110: "D", \u00F0: "d", \u00D0: "D" };
|
|
1319
|
+
var R = [1632, 1776, 2406, 3664, 65296];
|
|
1320
|
+
var A = /[\u0300-\u036F]/g;
|
|
1321
|
+
function _2(e) {
|
|
1322
|
+
let n = E2[e];
|
|
1323
|
+
if (n) return n;
|
|
1324
1324
|
let t = e.codePointAt(0);
|
|
1325
|
-
for (let a2 of
|
|
1325
|
+
for (let a2 of R) if (t >= a2 && t <= a2 + 9) return String.fromCharCode(48 + t - a2);
|
|
1326
1326
|
if (t >= 65313 && t <= 65338 || t >= 65345 && t <= 65370) return String.fromCharCode(t - 65248);
|
|
1327
|
-
let
|
|
1328
|
-
return
|
|
1327
|
+
let r2 = e.normalize("NFD").replace(A, "");
|
|
1328
|
+
return r2.length === 1 ? r2 : e;
|
|
1329
1329
|
}
|
|
1330
|
-
function f2(e) {
|
|
1331
|
-
if (!e) return e ?? "";
|
|
1332
|
-
let n2 = "";
|
|
1333
|
-
for (let t of e) n2 += E2(t);
|
|
1334
|
-
return n2;
|
|
1335
|
-
}
|
|
1336
|
-
var A = /([\p{Ll}\p{Nd}])(\p{Lu})/gu;
|
|
1337
|
-
var _2 = /[_\-./]+/g;
|
|
1338
|
-
var M = /[^\p{L}\p{M}\p{N}\x00-\x7F]/gu;
|
|
1339
1330
|
function p(e) {
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1331
|
+
if (!e) return e ?? "";
|
|
1332
|
+
let n = "";
|
|
1333
|
+
for (let t of e) n += _2(t);
|
|
1334
|
+
return n;
|
|
1335
|
+
}
|
|
1336
|
+
var m = /([\p{Ll}\p{Nd}])(\p{Lu})/gu;
|
|
1337
|
+
var M = /[_\-./]+/g;
|
|
1338
|
+
var O2 = /[^\p{L}\p{M}\p{N}\x00-\x7F]/gu;
|
|
1339
|
+
function d(e) {
|
|
1340
|
+
return e ? String(e).normalize("NFC").replace(m, "$1 $2").replace(M, " ").replace(O2, " ").toLowerCase().split(/\s+/).filter((n) => n.length > 0) : [];
|
|
1341
|
+
}
|
|
1342
|
+
function le(e) {
|
|
1343
|
+
let n = Date.parse(e);
|
|
1344
|
+
if (isNaN(n)) return null;
|
|
1345
|
+
let t = new Date(n);
|
|
1346
|
+
if (j2.test(e) || K2.test(e.trim()) || J2.test(e)) return t;
|
|
1347
|
+
let r2 = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds())), a2 = t.getFullYear();
|
|
1348
|
+
return a2 >= 0 && a2 < 100 && r2.setUTCFullYear(a2), r2;
|
|
1349
|
+
}
|
|
1350
|
+
function L2(e) {
|
|
1351
1351
|
return !(e instanceof Date) || isNaN(e.getTime()) ? null : e.getUTCHours() === 0 && e.getUTCMinutes() === 0 && e.getUTCSeconds() === 0 && e.getUTCMilliseconds() === 0 ? "utc" : e.getHours() === 0 && e.getMinutes() === 0 && e.getSeconds() === 0 && e.getMilliseconds() === 0 ? "local" : null;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
let
|
|
1355
|
-
return t >= 0 && t < 100 &&
|
|
1353
|
+
function W2(e) {
|
|
1354
|
+
let n = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), t = e.getFullYear();
|
|
1355
|
+
return t >= 0 && t < 100 && n.setUTCFullYear(t), n;
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function $2(e, n) {
|
|
1358
1358
|
let t = [];
|
|
1359
|
-
for (let
|
|
1360
|
-
if (!
|
|
1359
|
+
for (let r2 of e) {
|
|
1360
|
+
if (!r2 || !/date|time/i.test(String(r2.dataType ?? ""))) continue;
|
|
1361
1361
|
let a2 = 0, i = true;
|
|
1362
|
-
for (let u2 of
|
|
1363
|
-
let s = u2 ? u2[
|
|
1362
|
+
for (let u2 of n) {
|
|
1363
|
+
let s = u2 ? u2[r2.name] : void 0;
|
|
1364
1364
|
if (s == null || s === "") continue;
|
|
1365
1365
|
if (!(s instanceof Date)) {
|
|
1366
1366
|
i = false;
|
|
1367
1367
|
break;
|
|
1368
1368
|
}
|
|
1369
|
-
let l =
|
|
1369
|
+
let l = L2(s);
|
|
1370
1370
|
if (l === null) {
|
|
1371
1371
|
i = false;
|
|
1372
1372
|
break;
|
|
1373
1373
|
}
|
|
1374
1374
|
l === "local" && a2++;
|
|
1375
1375
|
}
|
|
1376
|
-
i && a2 > 0 && t.push(
|
|
1376
|
+
i && a2 > 0 && t.push(r2.name);
|
|
1377
1377
|
}
|
|
1378
1378
|
return t;
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1381
|
-
let t =
|
|
1382
|
-
return t.length === 0 ? { rows:
|
|
1380
|
+
function ge(e, n) {
|
|
1381
|
+
let t = $2(e, n);
|
|
1382
|
+
return t.length === 0 ? { rows: n, columns: t } : { rows: n.map((a2) => {
|
|
1383
1383
|
if (!a2) return a2;
|
|
1384
1384
|
let i = { ...a2 };
|
|
1385
1385
|
for (let u2 of t) {
|
|
1386
1386
|
let s = i[u2];
|
|
1387
|
-
s instanceof Date &&
|
|
1387
|
+
s instanceof Date && L2(s) === "local" && (i[u2] = W2(s));
|
|
1388
1388
|
}
|
|
1389
1389
|
return i;
|
|
1390
1390
|
}), columns: t };
|
|
1391
1391
|
}
|
|
1392
|
-
var
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1392
|
+
var j2 = /^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/;
|
|
1393
|
+
var K2 = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
1394
|
+
var J2 = /\b(?:GMT|UTC)\b/i;
|
|
1395
1395
|
|
|
1396
|
-
// ../shape-core/dist/chunk-
|
|
1396
|
+
// ../shape-core/dist/chunk-VIWJJUDA.mjs
|
|
1397
1397
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1398
1398
|
var St = "006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999";
|
|
1399
1399
|
var w = new Set(St.match(/.{3}/g) ?? []);
|
|
1400
1400
|
var at = [["AL", "Alabama"], ["AK", "Alaska"], ["AZ", "Arizona"], ["AR", "Arkansas"], ["CA", "California"], ["CO", "Colorado"], ["CT", "Connecticut"], ["DE", "Delaware"], ["FL", "Florida"], ["GA", "Georgia"], ["HI", "Hawaii"], ["ID", "Idaho"], ["IL", "Illinois"], ["IN", "Indiana"], ["IA", "Iowa"], ["KS", "Kansas"], ["KY", "Kentucky"], ["LA", "Louisiana"], ["ME", "Maine"], ["MD", "Maryland"], ["MA", "Massachusetts"], ["MI", "Michigan"], ["MN", "Minnesota"], ["MS", "Mississippi"], ["MO", "Missouri"], ["MT", "Montana"], ["NE", "Nebraska"], ["NV", "Nevada"], ["NH", "New Hampshire"], ["NJ", "New Jersey"], ["NM", "New Mexico"], ["NY", "New York"], ["NC", "North Carolina"], ["ND", "North Dakota"], ["OH", "Ohio"], ["OK", "Oklahoma"], ["OR", "Oregon"], ["PA", "Pennsylvania"], ["RI", "Rhode Island"], ["SC", "South Carolina"], ["SD", "South Dakota"], ["TN", "Tennessee"], ["TX", "Texas"], ["UT", "Utah"], ["VT", "Vermont"], ["VA", "Virginia"], ["WA", "Washington"], ["WV", "West Virginia"], ["WI", "Wisconsin"], ["WY", "Wyoming"], ["DC", "District of Columbia"], ["PR", "Puerto Rico"], ["GU", "Guam"], ["VI", "U.S. Virgin Islands"], ["AS", "American Samoa"], ["MP", "Northern Mariana Islands"]];
|
|
1401
|
-
var ct = new Set(at.map((
|
|
1401
|
+
var ct = new Set(at.map((n) => n[0]));
|
|
1402
1402
|
var yt = { "Ala.": "AL", "Alab.": "AL", "Ariz.": "AZ", "Ark.": "AR", "Calif.": "CA", "Cal.": "CA", "Colo.": "CO", "Col.": "CO", "Conn.": "CT", "Del.": "DE", "Fla.": "FL", "Flor.": "FL", "Ga.": "GA", "Ill.": "IL", "Ind.": "IN", "Kan.": "KS", "Kans.": "KS", "Ky.": "KY", "La.": "LA", "Md.": "MD", "Mass.": "MA", "Mich.": "MI", "Minn.": "MN", "Miss.": "MS", "Mo.": "MO", "Mont.": "MT", "Neb.": "NE", "Nebr.": "NE", "Nev.": "NV", "N.H.": "NH", "N.J.": "NJ", "N.M.": "NM", "N.Mex.": "NM", "N. Mex.": "NM", "N.Y.": "NY", "N.C.": "NC", "N.D.": "ND", "N.Dak.": "ND", "N. Dak.": "ND", "Okla.": "OK", "Ore.": "OR", "Oreg.": "OR", "Pa.": "PA", "Penn.": "PA", "Penna.": "PA", "R.I.": "RI", "S.C.": "SC", "S.D.": "SD", "S.Dak.": "SD", "S. Dak.": "SD", "Tenn.": "TN", "Tex.": "TX", "Vt.": "VT", "Va.": "VA", "Wash.": "WA", "W.Va.": "WV", "W. Va.": "WV", "Wis.": "WI", "Wisc.": "WI", "Wyo.": "WY", "D.C.": "DC", "Wash. D.C.": "DC", "Wash., D.C.": "DC", "P.R.": "PR", "V.I.": "VI" };
|
|
1403
1403
|
var ut = (() => {
|
|
1404
|
-
let
|
|
1405
|
-
for (let [s, i] of at)
|
|
1406
|
-
|
|
1404
|
+
let n = /* @__PURE__ */ new Map();
|
|
1405
|
+
for (let [s, i] of at) n.set(g2(i), s);
|
|
1406
|
+
n.set(g2("Washington DC"), "DC"), n.set(g2("Washington D.C."), "DC"), n.set(g2("US Virgin Islands"), "VI");
|
|
1407
1407
|
for (let [s, i] of Object.entries(yt)) {
|
|
1408
|
-
let
|
|
1409
|
-
|
|
1408
|
+
let r2 = g2(s);
|
|
1409
|
+
r2 && !n.has(r2) && n.set(r2, i);
|
|
1410
1410
|
}
|
|
1411
|
-
return
|
|
1411
|
+
return n;
|
|
1412
1412
|
})();
|
|
1413
1413
|
var lt = /* @__PURE__ */ new Set(["01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49", "50", "51", "53", "54", "55", "56", "60", "66", "69", "72", "78"]);
|
|
1414
|
-
function ft(
|
|
1415
|
-
return
|
|
1414
|
+
function ft(n) {
|
|
1415
|
+
return n.trim().toUpperCase();
|
|
1416
1416
|
}
|
|
1417
|
-
function g2(
|
|
1418
|
-
return u(
|
|
1417
|
+
function g2(n) {
|
|
1418
|
+
return u(n);
|
|
1419
1419
|
}
|
|
1420
1420
|
var rt = /* @__PURE__ */ new Set(["zip", "zipcode", "postal", "postcode", "plz"]);
|
|
1421
|
-
function y2(
|
|
1422
|
-
if (!
|
|
1423
|
-
for (let i of
|
|
1421
|
+
function y2(n, s) {
|
|
1422
|
+
if (!n) return false;
|
|
1423
|
+
for (let i of d(n)) if (s.has(i)) return true;
|
|
1424
1424
|
return false;
|
|
1425
1425
|
}
|
|
1426
|
-
function Mt(
|
|
1427
|
-
if (
|
|
1428
|
-
let i = String(
|
|
1426
|
+
function Mt(n, s) {
|
|
1427
|
+
if (n == null) return null;
|
|
1428
|
+
let i = String(n).trim();
|
|
1429
1429
|
if (i.length === 0) return null;
|
|
1430
1430
|
switch (s) {
|
|
1431
1431
|
case "country-iso3":
|
|
@@ -1434,8 +1434,8 @@ function Mt(n2, s) {
|
|
|
1434
1434
|
return E(i);
|
|
1435
1435
|
case "us-state-code":
|
|
1436
1436
|
case "us-state-name": {
|
|
1437
|
-
let
|
|
1438
|
-
return ct.has(
|
|
1437
|
+
let r2 = ft(i);
|
|
1438
|
+
return ct.has(r2) ? r2 : ut.get(g2(i)) ?? null;
|
|
1439
1439
|
}
|
|
1440
1440
|
case "us-zip5":
|
|
1441
1441
|
return M3(i);
|
|
@@ -1445,8 +1445,8 @@ function Mt(n2, s) {
|
|
|
1445
1445
|
return null;
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
function Gt(
|
|
1449
|
-
switch (
|
|
1448
|
+
function Gt(n) {
|
|
1449
|
+
switch (n) {
|
|
1450
1450
|
case "country-iso3":
|
|
1451
1451
|
case "country-iso2":
|
|
1452
1452
|
case "country-name":
|
|
@@ -1459,110 +1459,110 @@ function Gt(n2) {
|
|
|
1459
1459
|
return false;
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
function It(
|
|
1463
|
-
return s === "us-zip5" ? w.has(
|
|
1462
|
+
function It(n, s) {
|
|
1463
|
+
return s === "us-zip5" ? w.has(n.slice(0, 3)) : true;
|
|
1464
1464
|
}
|
|
1465
|
-
function Wt(
|
|
1466
|
-
let i = new Array(
|
|
1467
|
-
for (let
|
|
1468
|
-
let
|
|
1469
|
-
if (i[
|
|
1465
|
+
function Wt(n, s) {
|
|
1466
|
+
let i = new Array(n.length), r2 = /* @__PURE__ */ new Set(), M2 = [], h3 = 0;
|
|
1467
|
+
for (let N2 = 0; N2 < n.length; ++N2) {
|
|
1468
|
+
let I5 = Mt(n[N2], s), O3 = I5 !== null && It(I5, s) ? I5 : null;
|
|
1469
|
+
if (i[N2] = O3, O3 !== null) h3++;
|
|
1470
1470
|
else {
|
|
1471
|
-
let d2 =
|
|
1471
|
+
let d2 = n[N2];
|
|
1472
1472
|
if (d2 != null) {
|
|
1473
1473
|
let p2 = String(d2).trim();
|
|
1474
1474
|
if (p2.length > 0) {
|
|
1475
1475
|
let m2 = p2.toLowerCase();
|
|
1476
|
-
|
|
1476
|
+
r2.has(m2) || (r2.add(m2), M2.push(p2));
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
|
-
return { iso: i, unmatched: M2, matchedRows: h3, totalRows:
|
|
1481
|
+
return { iso: i, unmatched: M2, matchedRows: h3, totalRows: n.length };
|
|
1482
1482
|
}
|
|
1483
1483
|
|
|
1484
|
-
// ../shape-core/dist/chunk-
|
|
1484
|
+
// ../shape-core/dist/chunk-Q7UDK4PL.mjs
|
|
1485
1485
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1486
1486
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1487
|
-
var
|
|
1488
|
-
var
|
|
1487
|
+
var Ie = { "north-america": "AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI", "south-america": "AR BO BR CL CO EC FK GF GY PE PY SR UY VE", europe: "AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA", africa: "AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW", asia: "AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE", oceania: "AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS", antarctica: "AQ BV GS HM TF" };
|
|
1488
|
+
var J3 = (() => {
|
|
1489
1489
|
let t = /* @__PURE__ */ new Map();
|
|
1490
|
-
for (let e of Object.keys(
|
|
1490
|
+
for (let e of Object.keys(Ie)) for (let n of Ie[e].split(/\s+/)) n && t.set(n, e);
|
|
1491
1491
|
return t;
|
|
1492
1492
|
})();
|
|
1493
|
-
function
|
|
1494
|
-
for (let [e,
|
|
1495
|
-
let
|
|
1496
|
-
|
|
1493
|
+
function ut2(t) {
|
|
1494
|
+
for (let [e, n] of t) {
|
|
1495
|
+
let r2 = J3.get(e);
|
|
1496
|
+
r2 && !J3.has(n) && J3.set(n, r2);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
|
|
1500
|
-
var
|
|
1501
|
-
var
|
|
1502
|
-
var ht = ["latitude", "longitude"];
|
|
1499
|
+
ut2(N);
|
|
1500
|
+
var pt = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "z[_-]?score", "average", "avg", "mean", "median", "stddev", "variance", "gpa", "percentile", "quantile", "efficiency", "accuracy", "probability", "multiplier", "coefficient", "correlation", "occupancy", "age", "bmi", "temperature", "density", "pressure", "humidity", "ph", "velocity", "speed", "elevation", "altitude", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps", "temperatuur", "temperatur", "temperatura", "teplota", "lampotila", "homerseklet", "sicaklik", "pression", "presion", "pressao", "pressione", "druck", "tryck", "tlak", "paine", "nyomas", "presiune", "humidite", "humedad", "umidade", "umidita", "feuchtigkeit", "vochtigheid", "kosteus", "vlhkost", "vitesse", "velocidad", "velocidade", "velocita", "geschwindigkeit", "snelheid", "hastighet", "hastighed", "rychlost", "nopeus", "sebesseg", "brzina", "predkosc", "densite", "densidad", "densidade", "densita", "dichte", "dichtheid", "hustota", "tiheys", "gustoca", "moyenne", "mediane", "promedio", "mediana", "gemiddelde", "durchschnitt", "mittelwert", "genomsnitt", "gennemsnit", "gjennomsnitt", "keskiarvo", "atlag", "ortalama", "prosjek", "srednia", "prumer", "priemer", "medie", "taux", "tasa", "taxa", "tasso", "verhaltnis", "verhouding", "aandeel", "anteil", "andel", "osuus", "podil", "udzial", "udio", "pourcentage", "porcentaje", "percentual", "prozent", "procent", "prosentti", "szazalek", "yuzde", "participacion", "participacao", "pondere", "omjer", "arany", "oran", "rata", "leeftijd", "edad", "idade", "wiek", "eletkor", "varsta", "puntuacion", "pontuacao", "punteggio", "betyg", "ocena", "indice", "indeks", "wskaznik", "puan"];
|
|
1501
|
+
var ht = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
|
|
1503
1502
|
var bt = ["latitude", "longitude"];
|
|
1503
|
+
var yt2 = ["latitude", "longitude"];
|
|
1504
1504
|
function j3(t) {
|
|
1505
|
-
return
|
|
1505
|
+
return p(t);
|
|
1506
1506
|
}
|
|
1507
1507
|
var de = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z"];
|
|
1508
|
-
function
|
|
1509
|
-
return [...t].sort((e,
|
|
1510
|
-
}
|
|
1511
|
-
var
|
|
1512
|
-
var
|
|
1513
|
-
var
|
|
1514
|
-
var
|
|
1515
|
-
function
|
|
1508
|
+
function St2(t) {
|
|
1509
|
+
return [...t].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
|
|
1510
|
+
}
|
|
1511
|
+
var Fe = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + St2(de) + ")\\s+)", "i");
|
|
1512
|
+
var _t = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
|
|
1513
|
+
var At = new RegExp("\\b(" + pt.join("|") + ")\\b|(" + ht.join("|") + ")$", "i");
|
|
1514
|
+
var Ct = new RegExp("\\b(" + bt.join("|") + ")\\b|(" + yt2.join("|") + ")$", "i");
|
|
1515
|
+
function Ge(t) {
|
|
1516
1516
|
if (!t) return "";
|
|
1517
|
-
let e = String(t),
|
|
1518
|
-
return (
|
|
1517
|
+
let e = String(t), n = Fe.exec(j3(e));
|
|
1518
|
+
return (n ? e.slice(n[0].length) : e).trim();
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return !!t &&
|
|
1520
|
+
function Mt2(t) {
|
|
1521
|
+
return !!t && Fe.test(j3(String(t)));
|
|
1522
1522
|
}
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1526
|
-
var
|
|
1527
|
-
function
|
|
1528
|
-
let e =
|
|
1529
|
-
return e.length === 0 ? "" : e.replace(
|
|
1523
|
+
var xt = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
|
|
1524
|
+
var Pe = new RegExp("^\\s*(" + [...xt].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
|
|
1525
|
+
var Be = { Sum: ["Sum of "], Avg: ["Average of "], Average: ["Average of "], Count: ["Count of "], CountNonNull: ["Count of "], Min: ["Min of ", "First ", "Earliest "], Max: ["Max of ", "Last ", "Latest "], Median: ["Median of "], StandardDeviation: ["Standard deviation of "], Variance: ["Variance of "] };
|
|
1526
|
+
var Rt = new RegExp("^(" + Object.keys(Be).join("|") + ")\\((.+)\\)$");
|
|
1527
|
+
function Tt(t) {
|
|
1528
|
+
let e = Ge(t);
|
|
1529
|
+
return e.length === 0 ? "" : e.replace(_t, " ");
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function $e(t, e) {
|
|
1532
1532
|
if (!e) return false;
|
|
1533
|
-
let
|
|
1534
|
-
return t.test(j3(
|
|
1533
|
+
let n = Ge(e);
|
|
1534
|
+
return t.test(j3(Tt(e))) || t.test(j3(n)) || t.test(j3(d(n).join(" ")));
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1537
|
-
return
|
|
1538
|
-
}
|
|
1539
|
-
function Tt(t) {
|
|
1540
|
-
return ze(_t, t) || $e(t);
|
|
1536
|
+
function Ue(t) {
|
|
1537
|
+
return $e(Ct, t);
|
|
1541
1538
|
}
|
|
1542
|
-
var Ue = /int|double|decimal|single|float|number|currency|money/i;
|
|
1543
1539
|
function Nt(t) {
|
|
1544
|
-
|
|
1545
|
-
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ue.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1540
|
+
return $e(At, t) || Ue(t);
|
|
1546
1541
|
}
|
|
1542
|
+
var Ve = /int|double|decimal|single|float|number|currency|money/i;
|
|
1547
1543
|
function Et(t) {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
if ($e(e.name)) return { nature: n2, additivity: "positional", basis: "name", suppressed: true };
|
|
1554
|
-
let r = String(e.additivity ?? "").trim().toLowerCase();
|
|
1555
|
-
if (!(r === "additive" && Ct(e.name))) {
|
|
1556
|
-
if (r === "additive") return { nature: n2, additivity: "additive", basis: "measured", suppressed: false };
|
|
1557
|
-
if (r === "part_of_whole") return { nature: n2, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1558
|
-
if (r === "intensive_rate") return { nature: n2, additivity: "intensive_rate", basis: "measured", suppressed: false };
|
|
1559
|
-
}
|
|
1560
|
-
return e.discourageAggregationAcrossGroups === true ? { nature: n2, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Tt(e.name) ? { nature: n2, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n2, additivity: "additive", basis: "default", suppressed: false };
|
|
1544
|
+
let e = String(t?.valueNature ?? "").trim().toLowerCase();
|
|
1545
|
+
return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ve.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
|
|
1546
|
+
}
|
|
1547
|
+
function vt(t) {
|
|
1548
|
+
return t?.isMeasure === true || Ve.test(String(t?.dataType ?? ""));
|
|
1561
1549
|
}
|
|
1562
1550
|
function Ke(t) {
|
|
1563
|
-
let e =
|
|
1551
|
+
let e = t ?? {}, n = Et(e);
|
|
1552
|
+
if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
|
|
1553
|
+
if (Ue(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
|
|
1554
|
+
let r2 = String(e.additivity ?? "").trim().toLowerCase();
|
|
1555
|
+
if (!(r2 === "additive" && Mt2(e.name))) {
|
|
1556
|
+
if (r2 === "additive") return { nature: n, additivity: "additive", basis: "measured", suppressed: false };
|
|
1557
|
+
if (r2 === "part_of_whole") return { nature: n, additivity: "part_of_whole", basis: "measured", suppressed: false };
|
|
1558
|
+
if (r2 === "intensive_rate") return { nature: n, additivity: "intensive_rate", basis: "measured", suppressed: false };
|
|
1559
|
+
}
|
|
1560
|
+
return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Nt(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
|
|
1561
|
+
}
|
|
1562
|
+
function Ye(t) {
|
|
1563
|
+
let e = Ke(t), n = t ?? {};
|
|
1564
1564
|
if (e.nature === "Categorical") return ["first", "distinctcount", "count"];
|
|
1565
|
-
if (e.nature === "Ordinal") return
|
|
1565
|
+
if (e.nature === "Ordinal") return vt(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
|
|
1566
1566
|
switch (e.additivity) {
|
|
1567
1567
|
case "positional":
|
|
1568
1568
|
return ["min", "max", "count", "distinctcount", "first"];
|
|
@@ -1572,167 +1572,167 @@ function Ke(t) {
|
|
|
1572
1572
|
return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1575
|
+
function Dn(t) {
|
|
1576
|
+
return Ye(t)[0];
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function Pn(t, e) {
|
|
1579
1579
|
if (e !== "sum" && e !== "count") return false;
|
|
1580
1580
|
if (e === "count") return true;
|
|
1581
|
-
let
|
|
1582
|
-
return
|
|
1581
|
+
let n = Ke(t);
|
|
1582
|
+
return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1584
|
+
var Lt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
|
|
1585
1585
|
|
|
1586
1586
|
// ../shape-core/dist/index.mjs
|
|
1587
1587
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1588
|
-
var
|
|
1589
|
-
var
|
|
1590
|
-
function
|
|
1588
|
+
var X3 = 2;
|
|
1589
|
+
var de2 = 400;
|
|
1590
|
+
function Z3(t) {
|
|
1591
1591
|
return !!E(t);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function F3(t) {
|
|
1594
1594
|
let e = /* @__PURE__ */ new Set();
|
|
1595
|
-
for (let
|
|
1596
|
-
if (
|
|
1597
|
-
let o2 = u(String(
|
|
1598
|
-
if (!V(o2) && !e.has(o2) && (e.add(o2), e.size >=
|
|
1595
|
+
for (let n of t) {
|
|
1596
|
+
if (n == null) continue;
|
|
1597
|
+
let o2 = u(String(n));
|
|
1598
|
+
if (!V(o2) && !e.has(o2) && (e.add(o2), e.size >= de2)) break;
|
|
1599
1599
|
}
|
|
1600
1600
|
return Array.from(e);
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1603
|
-
let e =
|
|
1604
|
-
if (e.length === 0 ||
|
|
1605
|
-
let
|
|
1606
|
-
return
|
|
1602
|
+
function I4(t) {
|
|
1603
|
+
let e = F3(t);
|
|
1604
|
+
if (e.length === 0 || ee3(t) < 95) return false;
|
|
1605
|
+
let n = e.filter((u2) => Z3(u2) && !Y(u2)).length, o2 = e.filter((u2) => !Z3(u2) && !!Y(u2)).length;
|
|
1606
|
+
return n >= 1 && n >= o2;
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1608
|
+
function ue2(t, e) {
|
|
1609
1609
|
if (!Y(t)) return false;
|
|
1610
|
-
let
|
|
1611
|
-
return
|
|
1610
|
+
let n = E(t);
|
|
1611
|
+
return n ? e === "world" ? true : s3.has(n) : false;
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1614
|
-
let e =
|
|
1613
|
+
function ee3(t) {
|
|
1614
|
+
let e = F3(t);
|
|
1615
1615
|
if (e.length === 0) return 0;
|
|
1616
|
-
let
|
|
1617
|
-
for (let o2 of e)
|
|
1618
|
-
return Math.round(
|
|
1616
|
+
let n = 0;
|
|
1617
|
+
for (let o2 of e) Z3(o2) && n++;
|
|
1618
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1621
|
-
let e =
|
|
1620
|
+
function z3(t) {
|
|
1621
|
+
let e = F3(t);
|
|
1622
1622
|
if (e.length === 0) return 0;
|
|
1623
|
-
let
|
|
1624
|
-
for (let o2 of e) Y(o2) &&
|
|
1625
|
-
return Math.round(
|
|
1623
|
+
let n = 0;
|
|
1624
|
+
for (let o2 of e) Y(o2) && n++;
|
|
1625
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function ne2(t) {
|
|
1628
1628
|
let e = /* @__PURE__ */ new Set();
|
|
1629
|
-
for (let
|
|
1630
|
-
if (
|
|
1631
|
-
let o2 = String(
|
|
1632
|
-
if (!V(u(o2)) && !e.has(o2) && (e.add(o2), e.size >=
|
|
1629
|
+
for (let n of t) {
|
|
1630
|
+
if (n == null) continue;
|
|
1631
|
+
let o2 = String(n).trim();
|
|
1632
|
+
if (!V(u(o2)) && !e.has(o2) && (e.add(o2), e.size >= de2)) break;
|
|
1633
1633
|
}
|
|
1634
1634
|
return Array.from(e);
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1637
|
-
let e =
|
|
1636
|
+
function te(t) {
|
|
1637
|
+
let e = ne2(t);
|
|
1638
1638
|
if (e.length === 0) return 0;
|
|
1639
|
-
let
|
|
1640
|
-
for (let o2 of e) Z(o2).length > 0 &&
|
|
1641
|
-
return Math.round(
|
|
1639
|
+
let n = 0;
|
|
1640
|
+
for (let o2 of e) Z(o2).length > 0 && n++;
|
|
1641
|
+
return Math.round(n / e.length * 1e3) / 10;
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1644
|
-
return y2(e, rt) ? true :
|
|
1643
|
+
function ce2(t, e) {
|
|
1644
|
+
return y2(e, rt) ? true : ne2(t).some((n) => /^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/, "")));
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1647
|
-
let
|
|
1648
|
-
if (
|
|
1646
|
+
function En2(t, e) {
|
|
1647
|
+
let n = F3(t);
|
|
1648
|
+
if (n.length === 0) return 0;
|
|
1649
1649
|
let o2 = 0;
|
|
1650
|
-
for (let u2 of
|
|
1651
|
-
return Math.round(o2 /
|
|
1650
|
+
for (let u2 of n) p3(u2, e) && o2++;
|
|
1651
|
+
return Math.round(o2 / n.length * 1e3) / 10;
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1654
|
-
let
|
|
1655
|
-
for (let o2 of
|
|
1656
|
-
return
|
|
1653
|
+
function J4(t, e) {
|
|
1654
|
+
let n = 0;
|
|
1655
|
+
for (let o2 of F3(t)) e(o2) && n++;
|
|
1656
|
+
return n;
|
|
1657
1657
|
}
|
|
1658
|
-
function
|
|
1659
|
-
let
|
|
1660
|
-
for (let o2 of
|
|
1661
|
-
return
|
|
1658
|
+
function Sn(t, e) {
|
|
1659
|
+
let n = 0;
|
|
1660
|
+
for (let o2 of ne2(t)) e(o2) && n++;
|
|
1661
|
+
return n;
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1664
|
-
let l = [], a2 = [], i = {},
|
|
1663
|
+
function Rn(t, e, n, o2, u2) {
|
|
1664
|
+
let l = [], a2 = [], i = {}, S2 = {}, T2 = new Set(t), b4 = (s) => e.map((d2) => d2[s]);
|
|
1665
1665
|
for (let s of ["city", "country"]) {
|
|
1666
|
-
let
|
|
1667
|
-
|
|
1666
|
+
let d2 = n?.[s];
|
|
1667
|
+
d2 && T2.has(d2) && (i[s] = d2);
|
|
1668
1668
|
}
|
|
1669
|
-
let
|
|
1669
|
+
let y4 = new Set(u2 ?? t);
|
|
1670
1670
|
for (let s of ["lat", "lon"]) {
|
|
1671
|
-
let
|
|
1672
|
-
|
|
1671
|
+
let d2 = n?.[s];
|
|
1672
|
+
d2 && y4.has(d2) && (i[s] = d2);
|
|
1673
1673
|
}
|
|
1674
|
-
let
|
|
1675
|
-
if (
|
|
1676
|
-
let s =
|
|
1677
|
-
|
|
1674
|
+
let m2 = n?.zip;
|
|
1675
|
+
if (m2 && T2.has(m2)) {
|
|
1676
|
+
let s = b4(m2), d2 = te(s);
|
|
1677
|
+
d2 < 95 ? a2.push(`zip=${m2} (only ${d2}% of values read as ZIPs)`) : ce2(s, m2) ? i.zip = m2 : a2.push(`zip=${m2} (all values are 3-4 digits with nothing to say they are postal)`);
|
|
1678
1678
|
}
|
|
1679
|
-
let p2 =
|
|
1679
|
+
let p2 = n?.state;
|
|
1680
1680
|
if (p2 && T2.has(p2)) {
|
|
1681
|
-
let s =
|
|
1682
|
-
|
|
1681
|
+
let s = b4(p2), d2 = F3(s);
|
|
1682
|
+
d2.length > 0 && d2.every((E4) => ue2(E4, o2)) ? a2.push(`state=${p2} (every value is "CA", which is both Canada and California)`) : I4(s) ? (a2.push(`state=${p2} (every value is a country, not a state)`), i.country || (i.country = p2)) : z3(s) < 95 ? a2.push(`state=${p2} (only ${z3(s)}% of values are states/provinces)`) : i.state = p2;
|
|
1683
1683
|
}
|
|
1684
|
-
let
|
|
1684
|
+
let c2 = new Set(Object.values(i).filter(Boolean)), C2 = t.filter((s) => !c2.has(s) && !s.startsWith("__"));
|
|
1685
1685
|
if (!i.state) {
|
|
1686
1686
|
let s = null;
|
|
1687
|
-
for (let
|
|
1688
|
-
let
|
|
1689
|
-
if (
|
|
1690
|
-
let
|
|
1691
|
-
if (
|
|
1692
|
-
let
|
|
1693
|
-
|
|
1687
|
+
for (let d2 of C2) {
|
|
1688
|
+
let E4 = b4(d2);
|
|
1689
|
+
if (I4(E4)) continue;
|
|
1690
|
+
let P4 = z3(E4);
|
|
1691
|
+
if (P4 < 95) continue;
|
|
1692
|
+
let K3 = J4(E4, (V3) => !!Y(V3)), Pe2 = J4(E4, (V3) => !!Y(V3) && !ue2(V3, o2));
|
|
1693
|
+
K3 < X3 && Pe2 < 1 || (!s || P4 > s.pct) && (s = { name: d2, pct: P4 });
|
|
1694
1694
|
}
|
|
1695
|
-
s && (i.state = s.name,
|
|
1695
|
+
s && (i.state = s.name, c2.add(s.name), l.push(`state=${s.name} (${s.pct}% states/provinces)`));
|
|
1696
1696
|
}
|
|
1697
|
-
if (!i.zip) for (let s of
|
|
1698
|
-
if (
|
|
1699
|
-
let
|
|
1700
|
-
if (!(
|
|
1701
|
-
i.zip = s,
|
|
1697
|
+
if (!i.zip) for (let s of C2) {
|
|
1698
|
+
if (c2.has(s)) continue;
|
|
1699
|
+
let d2 = b4(s), E4 = te(d2);
|
|
1700
|
+
if (!(E4 < 95) && ce2(d2, s) && !(Sn(d2, (P4) => Z(P4).length > 0) < X3)) {
|
|
1701
|
+
i.zip = s, c2.add(s), l.push(`zip=${s} (${E4}% ZIP codes)`);
|
|
1702
1702
|
break;
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
|
-
let
|
|
1706
|
-
if (!
|
|
1705
|
+
let R2 = i.country;
|
|
1706
|
+
if (!R2 || !I4(b4(R2))) {
|
|
1707
1707
|
let s = null;
|
|
1708
|
-
for (let
|
|
1709
|
-
if (
|
|
1710
|
-
let
|
|
1711
|
-
(!s ||
|
|
1708
|
+
for (let d2 of C2) {
|
|
1709
|
+
if (c2.has(d2) || !I4(b4(d2))) continue;
|
|
1710
|
+
let E4 = ee3(b4(d2));
|
|
1711
|
+
(!s || E4 > s.pct) && (s = { name: d2, pct: E4 });
|
|
1712
1712
|
}
|
|
1713
|
-
s && (
|
|
1713
|
+
s && (R2 && (a2.push(`country=${R2} (only ${ee3(b4(R2))}% of values are country identifiers; using ${s.name} instead)`), S2.country = R2), i.country = s.name, c2.add(s.name), l.push(`country=${s.name}`));
|
|
1714
1714
|
}
|
|
1715
1715
|
if (!i.city) {
|
|
1716
1716
|
let s = null;
|
|
1717
|
-
for (let
|
|
1718
|
-
if (
|
|
1719
|
-
let
|
|
1720
|
-
|
|
1717
|
+
for (let d2 of C2) {
|
|
1718
|
+
if (c2.has(d2)) continue;
|
|
1719
|
+
let E4 = b4(d2), P4 = En2(E4, o2);
|
|
1720
|
+
P4 < m3 || J4(E4, (K3) => p3(K3, o2)) < X3 || (!s || P4 > s.pct) && (s = { name: d2, pct: P4 });
|
|
1721
1721
|
}
|
|
1722
1722
|
s && (i.city = s.name, l.push(`city=${s.name} (${s.pct}% known cities)`));
|
|
1723
1723
|
}
|
|
1724
|
-
let
|
|
1725
|
-
let
|
|
1726
|
-
return isFinite(
|
|
1724
|
+
let w2 = i.country ? b4(i.country) : [], v2 = !!i.country && I4(w2), _3 = v2 ? new Set(w2.map((s) => E(s == null ? null : String(s))).filter(Boolean)).size : 0, x3 = v2 && _3 >= 2, g3 = !!(i.lat && i.lon) && e.some((s) => {
|
|
1725
|
+
let d2 = +String(s[i.lat] ?? "").trim(), E4 = +String(s[i.lon] ?? "").trim();
|
|
1726
|
+
return isFinite(d2) && isFinite(E4) && d2 >= -90 && d2 <= 90 && E4 >= -180 && E4 <= 180 && String(s[i.lat] ?? "").trim() !== "" && String(s[i.lon] ?? "").trim() !== "";
|
|
1727
1727
|
});
|
|
1728
|
-
return i.lat && i.lon && !
|
|
1729
|
-
}
|
|
1730
|
-
var
|
|
1731
|
-
var
|
|
1732
|
-
var
|
|
1733
|
-
var
|
|
1734
|
-
var
|
|
1735
|
-
var
|
|
1728
|
+
return i.lat && i.lon && !g3 && a2.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !x3 && !(i.city || i.state || i.zip || g3) && a2.push(v2 ? `country=${i.country} (every row resolves to the same country - nothing to place apart)` : `country=${i.country} (values are not country identifiers)`), { bind: !!(i.city || i.state || i.zip || x3 || g3) ? i : null, backfilled: l, refused: a2, ...Object.keys(S2).length ? { labelFallback: S2 } : {} };
|
|
1729
|
+
}
|
|
1730
|
+
var r = (t, ...e) => ({ part: t, langs: Object.freeze(e) });
|
|
1731
|
+
var re2 = Object.freeze({ jaar: r("year", "nl"), kwartaal: r("quarter", "nl"), maand: r("month", "nl"), dag: r("day", "nl", "sv", "da", "nb"), jahr: r("year", "de"), quartal: r("quarter", "de"), monat: r("month", "de"), tag: r("day", "de"), ann\u00E9e: r("year", "fr"), mois: r("month", "fr"), jour: r("day", "fr"), trimestre: r("quarter", "fr", "es", "pt", "it"), a\u00F1o: r("year", "es"), mes: r("month", "es"), d\u00EDa: r("day", "es"), ano: r("year", "pt"), m\u00EAs: r("month", "pt"), dia: r("day", "pt"), anno: r("year", "it"), mese: r("month", "it"), giorno: r("day", "it"), \u0433\u043E\u0434: r("year", "ru"), \u043C\u0435\u0441\u044F\u0446: r("month", "ru"), \u0440\u0456\u043A: r("year", "uk"), \u043C\u0456\u0441\u044F\u0446\u044C: r("month", "uk"), \u043A\u0432\u0430\u0440\u0442\u0430\u043B: r("quarter", "ru", "uk"), \u0434\u0435\u043D\u044C: r("day", "ru", "uk"), rok: r("year", "pl", "cs", "sk"), kwarta\u0142: r("quarter", "pl"), miesi\u0105c: r("month", "pl"), dzie\u0144: r("day", "pl"), \u010Dtvrtlet\u00ED: r("quarter", "cs"), m\u011Bs\u00EDc: r("month", "cs"), den: r("day", "cs"), \u0161tvr\u0165rok: r("quarter", "sk"), mesiac: r("month", "sk"), de\u0148: r("day", "sk"), \u00E5r: r("year", "sv", "da", "nb"), kvartal: r("quarter", "sv", "da", "nb"), m\u00E5nad: r("month", "sv"), m\u00E5ned: r("month", "da", "nb"), vuosi: r("year", "fi"), vuosinelj\u00E4nnes: r("quarter", "fi"), kuukausi: r("month", "fi"), p\u00E4iv\u00E4: r("day", "fi"), \u00E9v: r("year", "hu"), negyed\u00E9v: r("quarter", "hu"), h\u00F3nap: r("month", "hu"), nap: r("day", "hu"), y\u0131l: r("year", "tr"), \u00E7eyrek: r("quarter", "tr"), ay: r("month", "tr"), g\u00FCn: r("day", "tr"), \u03AD\u03C4\u03BF\u03C2: r("year", "el"), \u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF: r("quarter", "el"), \u03BC\u03AE\u03BD\u03B1\u03C2: r("month", "el"), \u03B7\u03BC\u03AD\u03C1\u03B1: r("day", "el"), an: r("year", "ro"), trimestru: r("quarter", "ro"), lun\u0103: r("month", "ro"), zi: r("day", "ro"), godina: r("year", "hr"), tromjese\u010Dje: r("quarter", "hr"), mjesec: r("month", "hr"), dan: r("day", "hr"), \u5E74: r("year", "ja", "zh"), \u56DB\u534A\u671F: r("quarter", "ja"), \u5B63\u5EA6: r("quarter", "zh"), \u6708: r("month", "ja", "zh"), \u65E5: r("day", "ja", "zh"), \uC5F0\uB3C4: r("year", "ko"), \uBD84\uAE30: r("quarter", "ko"), \uC6D4: r("month", "ko"), \uC77C: r("day", "ko"), tahun: r("year", "id"), kuartal: r("quarter", "id"), triwulan: r("quarter", "id"), bulan: r("month", "id"), hari: r("day", "id"), n\u0103m: r("year", "vi"), qu\u00FD: r("quarter", "vi"), th\u00E1ng: r("month", "vi"), ng\u00E0y: r("day", "vi"), \u0E1B\u0E35: r("year", "th"), \u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A: r("quarter", "th"), \u0E40\u0E14\u0E37\u0E2D\u0E19: r("month", "th"), \u0E27\u0E31\u0E19: r("day", "th"), \u0627\u0644\u0633\u0646\u0629: r("year", "ar"), \u0633\u0646\u0629: r("year", "ar"), \u0627\u0644\u0639\u0627\u0645: r("year", "ar"), \u0639\u0627\u0645: r("year", "ar"), \u0627\u0644\u0631\u0628\u0639: r("quarter", "ar"), \u0631\u0628\u0639: r("quarter", "ar"), "\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629": r("quarter", "ar"), \u0627\u0644\u0634\u0647\u0631: r("month", "ar"), \u0634\u0647\u0631: r("month", "ar"), \u0627\u0644\u064A\u0648\u0645: r("day", "ar"), \u064A\u0648\u0645: r("day", "ar"), \u05E9\u05E0\u05D4: r("year", "he"), \u05E8\u05D1\u05E2\u05D5\u05DF: r("quarter", "he"), \u05D7\u05D5\u05D3\u05E9: r("month", "he"), \u05D9\u05D5\u05DD: r("day", "he"), \u0935\u0930\u094D\u0937: r("year", "hi"), \u0938\u093E\u0932: r("year", "hi"), \u0924\u093F\u092E\u093E\u0939\u0940: r("quarter", "hi"), \u092E\u0939\u0940\u0928\u093E: r("month", "hi"), \u092E\u093E\u0939: r("month", "hi"), \u0926\u093F\u0928: r("day", "hi"), \u0633\u0627\u0644: r("year", "fa"), \u0645\u0627\u0647: r("month", "fa"), \u0631\u0648\u0632: r("day", "fa") });
|
|
1732
|
+
var xn2 = Object.freeze(Array.from(new Set(Object.values(re2).flatMap((t) => t.langs))));
|
|
1733
|
+
var me = Object.freeze(["fa", "ar", "he", "th"]);
|
|
1734
|
+
var jn = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
|
|
1735
|
+
var tr = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
|
|
1736
1736
|
|
|
1737
1737
|
// src/payload.ts
|
|
1738
1738
|
var ROW_IDX_COLUMN = "__rowIdx__";
|
|
@@ -1747,7 +1747,7 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1747
1747
|
let labelCol;
|
|
1748
1748
|
if (bind) {
|
|
1749
1749
|
const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
|
|
1750
|
-
const res =
|
|
1750
|
+
const res = Rn(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
|
|
1751
1751
|
bind = res.bind;
|
|
1752
1752
|
rolesBackfilled = res.backfilled;
|
|
1753
1753
|
rolesRefused = res.refused;
|
|
@@ -1757,14 +1757,14 @@ function resolvePointChannel(cols, rowObjs, point) {
|
|
|
1757
1757
|
const hasPointBind = !!bind && !!(bind.city || bind.state || bind.zip || bind.country || bind.lat && bind.lon);
|
|
1758
1758
|
if (hasPointBind) {
|
|
1759
1759
|
const p2 = bind;
|
|
1760
|
-
const built = y3(rowObjs.map((
|
|
1761
|
-
lat: p2.lat ?
|
|
1762
|
-
lon: p2.lon ?
|
|
1763
|
-
city: p2.city ?
|
|
1764
|
-
state: p2.state ?
|
|
1765
|
-
zip: p2.zip ?
|
|
1766
|
-
country: p2.country ?
|
|
1767
|
-
label: labelCol ?
|
|
1760
|
+
const built = y3(rowObjs.map((r2) => ({
|
|
1761
|
+
lat: p2.lat ? r2[p2.lat] : null,
|
|
1762
|
+
lon: p2.lon ? r2[p2.lon] : null,
|
|
1763
|
+
city: p2.city ? r2[p2.city] : null,
|
|
1764
|
+
state: p2.state ? r2[p2.state] : null,
|
|
1765
|
+
zip: p2.zip ? r2[p2.zip] : null,
|
|
1766
|
+
country: p2.country ? r2[p2.country] : null,
|
|
1767
|
+
label: labelCol ? r2[labelCol] : null
|
|
1768
1768
|
})), point?.mapKind);
|
|
1769
1769
|
pLat = built.lat;
|
|
1770
1770
|
pLon = built.lon;
|
|
@@ -1795,7 +1795,7 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1795
1795
|
cols = cols.filter((c2) => c2.name !== ROW_IDX_COLUMN);
|
|
1796
1796
|
let utcDayColumns = null;
|
|
1797
1797
|
if (opts?.utcDays) {
|
|
1798
|
-
const norm =
|
|
1798
|
+
const norm = ge(cols, rowObjs);
|
|
1799
1799
|
rowObjs = norm.rows;
|
|
1800
1800
|
utcDayColumns = norm.columns;
|
|
1801
1801
|
}
|
|
@@ -1810,7 +1810,7 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1810
1810
|
let geoUnmatched;
|
|
1811
1811
|
let geoUnmatchedDistinct;
|
|
1812
1812
|
if (geo && geo.column && geo.kind && Gt(geo.kind)) {
|
|
1813
|
-
const built = Wt(rowObjs.map((
|
|
1813
|
+
const built = Wt(rowObjs.map((r2) => r2[geo.column]), geo.kind);
|
|
1814
1814
|
geoIso = built.iso;
|
|
1815
1815
|
geoUnmatched = { count: built.totalRows - built.matchedRows, examples: built.unmatched.slice(0, 8) };
|
|
1816
1816
|
geoUnmatchedDistinct = built.unmatched.length;
|
|
@@ -1834,32 +1834,32 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
const extra = hostNames.length + aliasCols.length;
|
|
1836
1836
|
const out = new Array(rowObjs.length);
|
|
1837
|
-
for (let
|
|
1838
|
-
const row = rowObjs[
|
|
1837
|
+
for (let r2 = 0; r2 < rowObjs.length; r2++) {
|
|
1838
|
+
const row = rowObjs[r2];
|
|
1839
1839
|
const a2 = new Array(cols.length + extra);
|
|
1840
1840
|
for (let c2 = 0; c2 < cols.length; c2++) {
|
|
1841
|
-
const
|
|
1842
|
-
if (
|
|
1843
|
-
a2[c2] =
|
|
1841
|
+
const v2 = row[colNames[c2]];
|
|
1842
|
+
if (v2 instanceof Date) {
|
|
1843
|
+
a2[c2] = v2.toISOString();
|
|
1844
1844
|
} else {
|
|
1845
|
-
a2[c2] =
|
|
1845
|
+
a2[c2] = v2 ?? null;
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
1848
|
let k3 = cols.length;
|
|
1849
|
-
a2[k3++] =
|
|
1850
|
-
if (geoIso) a2[k3++] = geoIso[
|
|
1849
|
+
a2[k3++] = r2;
|
|
1850
|
+
if (geoIso) a2[k3++] = geoIso[r2];
|
|
1851
1851
|
if (pLat && pLon) {
|
|
1852
|
-
a2[k3++] = pLat[
|
|
1853
|
-
a2[k3++] = pLon[
|
|
1854
|
-
a2[k3++] = pPrec ? pPrec[
|
|
1852
|
+
a2[k3++] = pLat[r2];
|
|
1853
|
+
a2[k3++] = pLon[r2];
|
|
1854
|
+
a2[k3++] = pPrec ? pPrec[r2] : null;
|
|
1855
1855
|
}
|
|
1856
1856
|
if (dLat && dLon) {
|
|
1857
|
-
a2[k3++] = dLat[
|
|
1858
|
-
a2[k3++] = dLon[
|
|
1859
|
-
a2[k3++] = dPrec ? dPrec[
|
|
1857
|
+
a2[k3++] = dLat[r2];
|
|
1858
|
+
a2[k3++] = dLon[r2];
|
|
1859
|
+
a2[k3++] = dPrec ? dPrec[r2] : null;
|
|
1860
1860
|
}
|
|
1861
1861
|
for (const ac of aliasCols) a2[k3++] = a2[ac.from];
|
|
1862
|
-
out[
|
|
1862
|
+
out[r2] = a2;
|
|
1863
1863
|
}
|
|
1864
1864
|
const colsOut = [...cols, { name: ROW_IDX_COLUMN, dataType: "Integer", isMeasure: false, modelDesc: "" }];
|
|
1865
1865
|
if (geoIso) colsOut.push({ name: "__geoIso__", dataType: "String", isMeasure: false, modelDesc: "" });
|
|
@@ -1896,7 +1896,7 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
|
|
|
1896
1896
|
// src/codeComments.ts
|
|
1897
1897
|
function stripJsComments(code) {
|
|
1898
1898
|
const src = String(code ?? "");
|
|
1899
|
-
const
|
|
1899
|
+
const n = src.length;
|
|
1900
1900
|
let out = "";
|
|
1901
1901
|
let i = 0;
|
|
1902
1902
|
const templates = [];
|
|
@@ -1908,9 +1908,9 @@ function stripJsComments(code) {
|
|
|
1908
1908
|
if ("(,=:[!&|?{};+-*%<>~^".includes(prevSig)) return true;
|
|
1909
1909
|
return /^(return|typeof|instanceof|in|of|new|delete|void|throw|case|do|else|yield|await)$/.test(prevWord);
|
|
1910
1910
|
};
|
|
1911
|
-
while (i <
|
|
1911
|
+
while (i < n) {
|
|
1912
1912
|
const ch = src[i];
|
|
1913
|
-
const next = i + 1 <
|
|
1913
|
+
const next = i + 1 < n ? src[i + 1] : "";
|
|
1914
1914
|
const top = templates.length > 0 ? templates[templates.length - 1] : null;
|
|
1915
1915
|
if (top === -1) {
|
|
1916
1916
|
if (ch === "\\") {
|
|
@@ -1942,7 +1942,7 @@ function stripJsComments(code) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
if (ch === "/" && next === "/") {
|
|
1944
1944
|
let j4 = i + 2;
|
|
1945
|
-
while (j4 <
|
|
1945
|
+
while (j4 < n && src[j4] !== "\n" && src[j4] !== "\r") j4++;
|
|
1946
1946
|
out += " ";
|
|
1947
1947
|
i = j4;
|
|
1948
1948
|
wordOpen = false;
|
|
@@ -1953,14 +1953,14 @@ function stripJsComments(code) {
|
|
|
1953
1953
|
const body = end < 0 ? src.slice(i + 2) : src.slice(i + 2, end);
|
|
1954
1954
|
const newlines = body.match(/\r\n|\r|\n/g);
|
|
1955
1955
|
out += newlines ? newlines.join("") : " ";
|
|
1956
|
-
i = end < 0 ?
|
|
1956
|
+
i = end < 0 ? n : end + 2;
|
|
1957
1957
|
wordOpen = false;
|
|
1958
1958
|
continue;
|
|
1959
1959
|
}
|
|
1960
1960
|
if (ch === "'" || ch === '"') {
|
|
1961
1961
|
let j4 = i + 1;
|
|
1962
|
-
while (j4 <
|
|
1963
|
-
out += src.slice(i, Math.min(j4 + 1,
|
|
1962
|
+
while (j4 < n && src[j4] !== ch && src[j4] !== "\n") j4 += src[j4] === "\\" ? 2 : 1;
|
|
1963
|
+
out += src.slice(i, Math.min(j4 + 1, n));
|
|
1964
1964
|
i = j4 + 1;
|
|
1965
1965
|
prevSig = ch;
|
|
1966
1966
|
prevWord = "";
|
|
@@ -1976,7 +1976,7 @@ function stripJsComments(code) {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
if (ch === "/" && regexMayFollow()) {
|
|
1978
1978
|
let j4 = i + 1, inClass = false;
|
|
1979
|
-
while (j4 <
|
|
1979
|
+
while (j4 < n && src[j4] !== "\n") {
|
|
1980
1980
|
const c2 = src[j4];
|
|
1981
1981
|
if (c2 === "\\") {
|
|
1982
1982
|
j4 += 2;
|
|
@@ -1987,9 +1987,9 @@ function stripJsComments(code) {
|
|
|
1987
1987
|
else if (c2 === "/" && !inClass) break;
|
|
1988
1988
|
j4++;
|
|
1989
1989
|
}
|
|
1990
|
-
if (j4 <
|
|
1990
|
+
if (j4 < n && src[j4] === "/") {
|
|
1991
1991
|
j4++;
|
|
1992
|
-
while (j4 <
|
|
1992
|
+
while (j4 < n && /[A-Za-z]/.test(src[j4])) j4++;
|
|
1993
1993
|
out += src.slice(i, j4);
|
|
1994
1994
|
i = j4;
|
|
1995
1995
|
prevSig = "/";
|
|
@@ -2045,10 +2045,10 @@ function createMarkResolver(env) {
|
|
|
2045
2045
|
if (E4 && t instanceof E4) return true;
|
|
2046
2046
|
return !!t && typeof t.closest === "function" && typeof t.getAttribute === "function";
|
|
2047
2047
|
};
|
|
2048
|
-
const viewStyle = (
|
|
2048
|
+
const viewStyle = (n) => {
|
|
2049
2049
|
try {
|
|
2050
2050
|
const gcs = doc?.defaultView?.getComputedStyle ?? (typeof getComputedStyle === "function" ? getComputedStyle : null);
|
|
2051
|
-
return gcs ? gcs(
|
|
2051
|
+
return gcs ? gcs(n).pointerEvents : "";
|
|
2052
2052
|
} catch {
|
|
2053
2053
|
return "";
|
|
2054
2054
|
}
|
|
@@ -2067,9 +2067,9 @@ function createMarkResolver(env) {
|
|
|
2067
2067
|
const m2 = el.getScreenCTM();
|
|
2068
2068
|
if (!m2) return Number.MAX_VALUE;
|
|
2069
2069
|
let best = Number.MAX_VALUE;
|
|
2070
|
-
const
|
|
2071
|
-
for (let i = 0; i <=
|
|
2072
|
-
const pt2 = el.getPointAtLength(L4 * i /
|
|
2070
|
+
const N2 = 64;
|
|
2071
|
+
for (let i = 0; i <= N2; i++) {
|
|
2072
|
+
const pt2 = el.getPointAtLength(L4 * i / N2);
|
|
2073
2073
|
const dx = m2.a * pt2.x + m2.c * pt2.y + m2.e - x3;
|
|
2074
2074
|
const dy = m2.b * pt2.x + m2.d * pt2.y + m2.f - y4;
|
|
2075
2075
|
const d2 = dx * dx + dy * dy;
|
|
@@ -2126,8 +2126,8 @@ function createMarkResolver(env) {
|
|
|
2126
2126
|
if (!raw) return [];
|
|
2127
2127
|
const out = [];
|
|
2128
2128
|
for (const tok of raw.split(",")) {
|
|
2129
|
-
const
|
|
2130
|
-
if (!isNaN(
|
|
2129
|
+
const n = parseInt(tok.trim(), 10);
|
|
2130
|
+
if (!isNaN(n) && n >= 0) out.push(n);
|
|
2131
2131
|
}
|
|
2132
2132
|
return out;
|
|
2133
2133
|
};
|
|
@@ -2152,10 +2152,10 @@ function createMarkResolver(env) {
|
|
|
2152
2152
|
if (cands.length <= 600) {
|
|
2153
2153
|
for (const el of Array.from(cands)) {
|
|
2154
2154
|
if (!el.getAttribute("data-row-idx")) continue;
|
|
2155
|
-
const
|
|
2156
|
-
if (!
|
|
2157
|
-
if (x3 <
|
|
2158
|
-
const area =
|
|
2155
|
+
const r2 = el.getBoundingClientRect ? el.getBoundingClientRect() : null;
|
|
2156
|
+
if (!r2 || r2.width <= 0 || r2.height <= 0) continue;
|
|
2157
|
+
if (x3 < r2.left || x3 > r2.right || y4 < r2.top || y4 > r2.bottom) continue;
|
|
2158
|
+
const area = r2.width * r2.height;
|
|
2159
2159
|
if (area < bestArea) {
|
|
2160
2160
|
bestArea = area;
|
|
2161
2161
|
best = el;
|
|
@@ -2165,10 +2165,10 @@ function createMarkResolver(env) {
|
|
|
2165
2165
|
const hasHittableShape = (node) => {
|
|
2166
2166
|
const SHAPE = /^(rect|circle|ellipse|path|line|polygon|polyline|text|image|use)$/;
|
|
2167
2167
|
const all = [node, ...Array.from(node.querySelectorAll("*"))];
|
|
2168
|
-
for (const
|
|
2169
|
-
const tag = (
|
|
2168
|
+
for (const n of all) {
|
|
2169
|
+
const tag = (n.tagName || "").toLowerCase();
|
|
2170
2170
|
if (!SHAPE.test(tag)) continue;
|
|
2171
|
-
const pe = viewStyle(
|
|
2171
|
+
const pe = viewStyle(n);
|
|
2172
2172
|
if (pe && pe !== "none") return true;
|
|
2173
2173
|
}
|
|
2174
2174
|
return false;
|
|
@@ -2333,8 +2333,8 @@ function isUnfilled(fill) {
|
|
|
2333
2333
|
function widthPx(raw) {
|
|
2334
2334
|
const m2 = /^(-?\d+(?:\.\d+)?)\s*(px)?$/i.exec(raw);
|
|
2335
2335
|
if (!m2) return NaN;
|
|
2336
|
-
const
|
|
2337
|
-
return isFinite(
|
|
2336
|
+
const n = parseFloat(m2[1]);
|
|
2337
|
+
return isFinite(n) ? n : NaN;
|
|
2338
2338
|
}
|
|
2339
2339
|
function censusHitBands(container, doc) {
|
|
2340
2340
|
if (!container || typeof container.querySelectorAll !== "function") return EMPTY3;
|
|
@@ -2361,15 +2361,15 @@ function censusHitBands(container, doc) {
|
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
2363
|
const out = { ...EMPTY3 };
|
|
2364
|
-
for (const
|
|
2365
|
-
if (!
|
|
2364
|
+
for (const r2 of rows) {
|
|
2365
|
+
if (!r2.open) continue;
|
|
2366
2366
|
out.openStrokes++;
|
|
2367
|
-
if (
|
|
2367
|
+
if (r2.inert) continue;
|
|
2368
2368
|
out.interactive++;
|
|
2369
|
-
if (isFinite(
|
|
2370
|
-
if (!(
|
|
2369
|
+
if (isFinite(r2.w) && r2.w > out.widestPx) out.widestPx = Math.round(r2.w);
|
|
2370
|
+
if (!(r2.w < MIN_HIT_BAND_PX)) continue;
|
|
2371
2371
|
out.hairline++;
|
|
2372
|
-
const best = widestByGeom.get(
|
|
2372
|
+
const best = widestByGeom.get(r2.geom);
|
|
2373
2373
|
if (best === void 0 || best < MIN_HIT_BAND_PX) out.uncovered++;
|
|
2374
2374
|
}
|
|
2375
2375
|
return out;
|
|
@@ -2390,34 +2390,34 @@ var VALUE_AXIS_MIN_FIT = 0.8;
|
|
|
2390
2390
|
var MIN_AXIS_SPAN_PX = 40;
|
|
2391
2391
|
var EMPTY4 = { marks: 0, axis: "", column: "", fit: 0, offShare: 0, medianOffRadii: 0 };
|
|
2392
2392
|
function num(el, name) {
|
|
2393
|
-
const
|
|
2394
|
-
if (
|
|
2395
|
-
return parseFloat(String(
|
|
2393
|
+
const v2 = el.getAttribute?.(name);
|
|
2394
|
+
if (v2 === null || v2 === void 0 || String(v2).trim() === "") return NaN;
|
|
2395
|
+
return parseFloat(String(v2));
|
|
2396
2396
|
}
|
|
2397
2397
|
function median(xs) {
|
|
2398
2398
|
if (!xs.length) return NaN;
|
|
2399
|
-
const s = [...xs].sort((a2,
|
|
2399
|
+
const s = [...xs].sort((a2, b4) => a2 - b4);
|
|
2400
2400
|
const m2 = s.length >> 1;
|
|
2401
2401
|
return s.length % 2 ? s[m2] : (s[m2 - 1] + s[m2]) / 2;
|
|
2402
2402
|
}
|
|
2403
|
-
function robustLine(
|
|
2404
|
-
const
|
|
2405
|
-
const step = Math.max(1, Math.floor(
|
|
2403
|
+
function robustLine(v2, pos) {
|
|
2404
|
+
const n = v2.length;
|
|
2405
|
+
const step = Math.max(1, Math.floor(n / FIT_SAMPLE));
|
|
2406
2406
|
const idx = [];
|
|
2407
|
-
for (let i = 0; i <
|
|
2407
|
+
for (let i = 0; i < n; i += step) idx.push(i);
|
|
2408
2408
|
const slopes = [];
|
|
2409
2409
|
for (let p2 = 0; p2 < idx.length; p2++) {
|
|
2410
2410
|
for (let q2 = p2 + 1; q2 < idx.length; q2++) {
|
|
2411
|
-
const dv =
|
|
2411
|
+
const dv = v2[idx[q2]] - v2[idx[p2]];
|
|
2412
2412
|
if (Math.abs(dv) < 1e-12) continue;
|
|
2413
2413
|
slopes.push((pos[idx[q2]] - pos[idx[p2]]) / dv);
|
|
2414
2414
|
}
|
|
2415
2415
|
}
|
|
2416
2416
|
if (slopes.length < 3) return null;
|
|
2417
|
-
const
|
|
2418
|
-
if (!Number.isFinite(
|
|
2419
|
-
const a2 = median(pos.map((y4, i) => y4 -
|
|
2420
|
-
return Number.isFinite(a2) ? { a: a2, b:
|
|
2417
|
+
const b4 = median(slopes);
|
|
2418
|
+
if (!Number.isFinite(b4) || Math.abs(b4) < 1e-12) return null;
|
|
2419
|
+
const a2 = median(pos.map((y4, i) => y4 - b4 * v2[i]));
|
|
2420
|
+
return Number.isFinite(a2) ? { a: a2, b: b4 } : null;
|
|
2421
2421
|
}
|
|
2422
2422
|
function censusValuePlacement(container, data) {
|
|
2423
2423
|
try {
|
|
@@ -2434,40 +2434,40 @@ function censusValuePlacement(container, data) {
|
|
|
2434
2434
|
if (!/^\d+$/.test(raw)) continue;
|
|
2435
2435
|
const i = +raw;
|
|
2436
2436
|
const row = rows[i];
|
|
2437
|
-
const x3 = num(el, "cx"), y4 = num(el, "cy"),
|
|
2438
|
-
if (!row || !Number.isFinite(x3) || !Number.isFinite(y4) || !(
|
|
2437
|
+
const x3 = num(el, "cx"), y4 = num(el, "cy"), r2 = num(el, "r");
|
|
2438
|
+
if (!row || !Number.isFinite(x3) || !Number.isFinite(y4) || !(r2 > 0)) continue;
|
|
2439
2439
|
seen.add(i);
|
|
2440
|
-
dots.push({ row, x: x3, y: y4, r });
|
|
2440
|
+
dots.push({ row, x: x3, y: y4, r: r2 });
|
|
2441
2441
|
}
|
|
2442
2442
|
if (dots.length < MIN_MARKS2 || seen.size < dots.length * 0.9) return EMPTY4;
|
|
2443
2443
|
let best = null;
|
|
2444
2444
|
for (let c2 = 0; c2 < columns.length; c2++) {
|
|
2445
2445
|
if (/^__.*__$/.test(String(columns[c2]?.name ?? ""))) continue;
|
|
2446
2446
|
const vals = dots.map((d2) => {
|
|
2447
|
-
const
|
|
2448
|
-
return
|
|
2447
|
+
const v2 = d2.row[c2];
|
|
2448
|
+
return v2 === null || v2 === void 0 || v2 === "" ? NaN : typeof v2 === "number" ? v2 : Number(v2);
|
|
2449
2449
|
});
|
|
2450
2450
|
const finite = vals.filter(Number.isFinite);
|
|
2451
2451
|
if (finite.length < dots.length * 0.9 || new Set(finite).size < 8) continue;
|
|
2452
|
-
const logs = finite.every((
|
|
2452
|
+
const logs = finite.every((v2) => v2 > 0) ? [false, true] : [false];
|
|
2453
2453
|
for (const log of logs) {
|
|
2454
2454
|
for (const axis of ["x", "y"]) {
|
|
2455
2455
|
const keep = [];
|
|
2456
|
-
const
|
|
2456
|
+
const v2 = [], pos = [];
|
|
2457
2457
|
dots.forEach((d2, k3) => {
|
|
2458
2458
|
if (!Number.isFinite(vals[k3])) return;
|
|
2459
2459
|
keep.push(k3);
|
|
2460
|
-
|
|
2460
|
+
v2.push(log ? Math.log10(vals[k3]) : vals[k3]);
|
|
2461
2461
|
pos.push(axis === "x" ? d2.x : d2.y);
|
|
2462
2462
|
});
|
|
2463
|
-
const line = robustLine(
|
|
2463
|
+
const line = robustLine(v2, pos);
|
|
2464
2464
|
if (!line) continue;
|
|
2465
2465
|
const lo = Math.min(...pos), hi = Math.max(...pos);
|
|
2466
2466
|
if (hi - lo < MIN_AXIS_SPAN_PX) continue;
|
|
2467
2467
|
const mean = pos.reduce((s, p2) => s + p2, 0) / pos.length;
|
|
2468
2468
|
let ssRes = 0, ssTot = 0;
|
|
2469
2469
|
const res = pos.map((p2, k3) => {
|
|
2470
|
-
const e = p2 - (line.a + line.b *
|
|
2470
|
+
const e = p2 - (line.a + line.b * v2[k3]);
|
|
2471
2471
|
ssRes += e * e;
|
|
2472
2472
|
ssTot += (p2 - mean) ** 2;
|
|
2473
2473
|
return e;
|
|
@@ -2524,14 +2524,14 @@ function needsScroll(contentPx, viewportPx, slackPx = SCROLL_SLACK_PX) {
|
|
|
2524
2524
|
}
|
|
2525
2525
|
function contentExtentOf(boxes) {
|
|
2526
2526
|
if (!boxes || boxes.length === 0) return { w: 0, h: 0, source: "none" };
|
|
2527
|
-
const usable = boxes.filter((
|
|
2527
|
+
const usable = boxes.filter((b4) => b4 && isFinite(b4.right) && isFinite(b4.bottom) && (b4.right > 0 || b4.bottom > 0));
|
|
2528
2528
|
if (usable.length === 0) return { w: 0, h: 0, source: "none" };
|
|
2529
|
-
const inFlow = usable.filter((
|
|
2529
|
+
const inFlow = usable.filter((b4) => !b4.floating);
|
|
2530
2530
|
const counted = inFlow.length > 0 ? inFlow : usable;
|
|
2531
2531
|
let w2 = 0, h3 = 0;
|
|
2532
|
-
for (const
|
|
2533
|
-
if (
|
|
2534
|
-
if (
|
|
2532
|
+
for (const b4 of counted) {
|
|
2533
|
+
if (b4.right > w2) w2 = b4.right;
|
|
2534
|
+
if (b4.bottom > h3) h3 = b4.bottom;
|
|
2535
2535
|
}
|
|
2536
2536
|
return { w: w2, h: h3, source: inFlow.length > 0 ? "in-flow" : "all-floating" };
|
|
2537
2537
|
}
|
|
@@ -2565,8 +2565,8 @@ var AXIS_PIN_TRACK_REACH_PX = 12;
|
|
|
2565
2565
|
function isHorizontalLabelRow(boxes) {
|
|
2566
2566
|
if (!boxes || boxes.length < 2) return false;
|
|
2567
2567
|
let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
|
|
2568
|
-
for (const
|
|
2569
|
-
const cx = (
|
|
2568
|
+
for (const b4 of boxes) {
|
|
2569
|
+
const cx = (b4.left + b4.right) / 2, cy = (b4.top + b4.bottom) / 2;
|
|
2570
2570
|
if (!isFinite(cx) || !isFinite(cy)) return false;
|
|
2571
2571
|
if (cx < minX) minX = cx;
|
|
2572
2572
|
if (cx > maxX) maxX = cx;
|
|
@@ -2578,10 +2578,10 @@ function isHorizontalLabelRow(boxes) {
|
|
|
2578
2578
|
function labelBand(boxes, tracks = [], pad = AXIS_PIN_BAND_PAD_PX, trackReach = AXIS_PIN_TRACK_REACH_PX) {
|
|
2579
2579
|
if (!boxes || boxes.length === 0) return null;
|
|
2580
2580
|
let top = Infinity, bottom = -Infinity;
|
|
2581
|
-
for (const
|
|
2582
|
-
if (!isFinite(
|
|
2583
|
-
if (
|
|
2584
|
-
if (
|
|
2581
|
+
for (const b4 of boxes) {
|
|
2582
|
+
if (!isFinite(b4.top) || !isFinite(b4.bottom)) continue;
|
|
2583
|
+
if (b4.top < top) top = b4.top;
|
|
2584
|
+
if (b4.bottom > bottom) bottom = b4.bottom;
|
|
2585
2585
|
}
|
|
2586
2586
|
if (!isFinite(top) || !isFinite(bottom) || bottom <= top) return null;
|
|
2587
2587
|
for (const t of tracks || []) {
|
|
@@ -2631,12 +2631,12 @@ function svgInkReach(svg) {
|
|
|
2631
2631
|
const els = svg.querySelectorAll(FIT_CONTENT_SELECTOR);
|
|
2632
2632
|
let right = -Infinity, bottom = -Infinity, seen = 0;
|
|
2633
2633
|
for (let i = 0; i < els.length && seen < FIT_WALK_CAP; i++) {
|
|
2634
|
-
const
|
|
2635
|
-
if (
|
|
2636
|
-
if (isPhantomBox(
|
|
2634
|
+
const r2 = els[i].getBoundingClientRect();
|
|
2635
|
+
if (r2.width <= 0 && r2.height <= 0) continue;
|
|
2636
|
+
if (isPhantomBox(r2.width, r2.height, box.width, box.height)) continue;
|
|
2637
2637
|
seen++;
|
|
2638
|
-
if (
|
|
2639
|
-
if (
|
|
2638
|
+
if (r2.right > right) right = r2.right;
|
|
2639
|
+
if (r2.bottom > bottom) bottom = r2.bottom;
|
|
2640
2640
|
}
|
|
2641
2641
|
if (seen === 0) return null;
|
|
2642
2642
|
return { right: right - box.left, bottom: bottom - box.top };
|
|
@@ -2658,15 +2658,15 @@ function measureContainerBoxes(c2, inkOf) {
|
|
|
2658
2658
|
floating = cs.position === "absolute" || cs.position === "fixed";
|
|
2659
2659
|
} catch {
|
|
2660
2660
|
}
|
|
2661
|
-
const
|
|
2662
|
-
let right =
|
|
2663
|
-
let bottom =
|
|
2661
|
+
const r2 = el.getBoundingClientRect();
|
|
2662
|
+
let right = r2.right - cRect.left - c2.clientLeft + c2.scrollLeft;
|
|
2663
|
+
let bottom = r2.bottom - cRect.top - c2.clientTop + c2.scrollTop;
|
|
2664
2664
|
if (inkOf) {
|
|
2665
2665
|
try {
|
|
2666
2666
|
const ink = inkOf(el);
|
|
2667
2667
|
if (ink) {
|
|
2668
|
-
const originX =
|
|
2669
|
-
const originY =
|
|
2668
|
+
const originX = r2.left - cRect.left - c2.clientLeft + c2.scrollLeft;
|
|
2669
|
+
const originY = r2.top - cRect.top - c2.clientTop + c2.scrollTop;
|
|
2670
2670
|
if (isFinite(ink.right)) right = Math.max(right, originX + ink.right);
|
|
2671
2671
|
if (isFinite(ink.bottom)) bottom = Math.max(bottom, originY + ink.bottom);
|
|
2672
2672
|
}
|
|
@@ -2696,7 +2696,7 @@ function fitReadingFor(lane, c2, slackPx = SCROLL_SLACK_PX, inkOf) {
|
|
|
2696
2696
|
overflowsY: needsScroll(contentH, viewH, slackPx),
|
|
2697
2697
|
extentSource: extent.source,
|
|
2698
2698
|
boxes: boxes.length,
|
|
2699
|
-
floating: boxes.filter((
|
|
2699
|
+
floating: boxes.filter((b4) => b4.floating).length,
|
|
2700
2700
|
scrollW: c2.scrollWidth,
|
|
2701
2701
|
scrollH: c2.scrollHeight
|
|
2702
2702
|
};
|
|
@@ -2707,14 +2707,14 @@ var SVG_NS2 = "http://www.w3.org/2000/svg";
|
|
|
2707
2707
|
var AXIS_PIN_MAX_CARRIED = 12;
|
|
2708
2708
|
function unpinScrolledAxis(container) {
|
|
2709
2709
|
if (!container) return;
|
|
2710
|
-
const
|
|
2711
|
-
if (!
|
|
2710
|
+
const st2 = container[CONTAINER_SLOT_AXIS_PIN];
|
|
2711
|
+
if (!st2) return;
|
|
2712
2712
|
try {
|
|
2713
|
-
container.removeEventListener("scroll",
|
|
2713
|
+
container.removeEventListener("scroll", st2.onScroll);
|
|
2714
2714
|
} catch {
|
|
2715
2715
|
}
|
|
2716
2716
|
try {
|
|
2717
|
-
if (
|
|
2717
|
+
if (st2.overlay.parentNode) st2.overlay.parentNode.removeChild(st2.overlay);
|
|
2718
2718
|
} catch {
|
|
2719
2719
|
}
|
|
2720
2720
|
try {
|
|
@@ -2735,16 +2735,16 @@ function backdropFill(svg, container, view, svgBox) {
|
|
|
2735
2735
|
try {
|
|
2736
2736
|
const rects = svg.querySelectorAll("rect");
|
|
2737
2737
|
for (let i = 0; i < rects.length && i < 6; i++) {
|
|
2738
|
-
const
|
|
2739
|
-
if (
|
|
2740
|
-
const
|
|
2741
|
-
if (
|
|
2738
|
+
const r2 = rects[i];
|
|
2739
|
+
if (r2.closest(".d3-mark")) continue;
|
|
2740
|
+
const b4 = r2.getBoundingClientRect();
|
|
2741
|
+
if (b4.width >= svgBox.width * 0.9 && b4.height >= svgBox.height * 0.9) {
|
|
2742
2742
|
let fill = "";
|
|
2743
2743
|
try {
|
|
2744
|
-
fill = view.getComputedStyle(
|
|
2744
|
+
fill = view.getComputedStyle(r2).fill || "";
|
|
2745
2745
|
} catch {
|
|
2746
2746
|
}
|
|
2747
|
-
if (!fill || fill === "none") fill =
|
|
2747
|
+
if (!fill || fill === "none") fill = r2.getAttribute("fill") || "";
|
|
2748
2748
|
if (fill && fill !== "none" && fill !== "transparent") return fill;
|
|
2749
2749
|
break;
|
|
2750
2750
|
}
|
|
@@ -2763,10 +2763,10 @@ function backdropFill(svg, container, view, svgBox) {
|
|
|
2763
2763
|
}
|
|
2764
2764
|
function cloneWithChain(el, svg, root) {
|
|
2765
2765
|
const chain = [];
|
|
2766
|
-
let
|
|
2767
|
-
while (
|
|
2768
|
-
chain.unshift(
|
|
2769
|
-
|
|
2766
|
+
let n = el.parentElement;
|
|
2767
|
+
while (n && n !== svg) {
|
|
2768
|
+
chain.unshift(n);
|
|
2769
|
+
n = n.parentElement;
|
|
2770
2770
|
}
|
|
2771
2771
|
let parent = root;
|
|
2772
2772
|
for (const anc of chain) {
|
|
@@ -2791,7 +2791,7 @@ function pinScrolledAxis(container, svg) {
|
|
|
2791
2791
|
if (!m2 || !(m2.a > 0) || !(m2.d > 0) || !isFinite(m2.e) || !isFinite(m2.f)) return noPin("no-ctm");
|
|
2792
2792
|
const viewportH = container.clientHeight;
|
|
2793
2793
|
if (!(viewportH > 0)) return noPin("unmeasurable");
|
|
2794
|
-
const rel = (
|
|
2794
|
+
const rel = (r2) => ({ left: r2.left - svgBox.left, top: r2.top - svgBox.top, right: r2.right - svgBox.left, bottom: r2.bottom - svgBox.top });
|
|
2795
2795
|
const ticks = svg.querySelectorAll(".tick");
|
|
2796
2796
|
const byAxis = /* @__PURE__ */ new Map();
|
|
2797
2797
|
for (let i = 0; i < ticks.length; i++) {
|
|
@@ -2810,16 +2810,16 @@ function pinScrolledAxis(container, svg) {
|
|
|
2810
2810
|
for (const tick of group) {
|
|
2811
2811
|
const txt = tick.querySelector("text");
|
|
2812
2812
|
if (!txt || textHidden(txt, view)) continue;
|
|
2813
|
-
const
|
|
2814
|
-
if (!(
|
|
2815
|
-
labels.push(rel(
|
|
2813
|
+
const r2 = txt.getBoundingClientRect();
|
|
2814
|
+
if (!(r2.width > 0) || !(r2.height > 0)) continue;
|
|
2815
|
+
labels.push(rel(r2));
|
|
2816
2816
|
}
|
|
2817
2817
|
const tracks = [];
|
|
2818
2818
|
for (let i = 0; i < axis2.children.length; i++) {
|
|
2819
2819
|
const ch = axis2.children[i];
|
|
2820
2820
|
if (ch.tagName.toLowerCase() !== "path" || !(ch.getAttribute("class") || "").split(/\s+/).includes("domain")) continue;
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2821
|
+
const r2 = ch.getBoundingClientRect();
|
|
2822
|
+
if (r2.width > 0 && r2.height <= 4) tracks.push(rel(r2));
|
|
2823
2823
|
}
|
|
2824
2824
|
cands.push({ index: axes.length, labels, tracks });
|
|
2825
2825
|
axes.push(axis2);
|
|
@@ -2837,14 +2837,14 @@ function pinScrolledAxis(container, svg) {
|
|
|
2837
2837
|
if (t.closest("svg") !== svg) continue;
|
|
2838
2838
|
if (t.closest(".tick") || t.closest(".d3-mark") || t.closest(".d3-legend-mark")) continue;
|
|
2839
2839
|
if (axis.contains(t) || textHidden(t, view)) continue;
|
|
2840
|
-
const
|
|
2841
|
-
if (!(
|
|
2842
|
-
if (
|
|
2840
|
+
const r2 = rel(t.getBoundingClientRect());
|
|
2841
|
+
if (!(r2.right > r2.left) || !(r2.bottom > r2.top)) continue;
|
|
2842
|
+
if (r2.top >= band.top && r2.bottom <= band.bottom) carried.push(t);
|
|
2843
2843
|
}
|
|
2844
2844
|
const pinSvg = doc.createElementNS(SVG_NS2, "svg");
|
|
2845
2845
|
for (const a2 of ["font-family", "font-size", "font-weight", "font", "fill", "color", "text-rendering"]) {
|
|
2846
|
-
const
|
|
2847
|
-
if (
|
|
2846
|
+
const v2 = svg.getAttribute(a2);
|
|
2847
|
+
if (v2) pinSvg.setAttribute(a2, v2);
|
|
2848
2848
|
}
|
|
2849
2849
|
const styles = svg.querySelectorAll("style");
|
|
2850
2850
|
for (let i = 0; i < styles.length; i++) pinSvg.appendChild(styles[i].cloneNode(true));
|
|
@@ -2892,15 +2892,15 @@ function pinScrolledAxis(container, svg) {
|
|
|
2892
2892
|
const svgTop = svgBox.top - cRect.top - container.clientTop + container.scrollTop;
|
|
2893
2893
|
const contentBand = { top: svgTop + band.top, bottom: svgTop + band.bottom };
|
|
2894
2894
|
const place = () => {
|
|
2895
|
-
const
|
|
2896
|
-
const edge2 = axisPinPlacement(contentBand,
|
|
2895
|
+
const st2 = container.scrollTop, vh = container.clientHeight;
|
|
2896
|
+
const edge2 = axisPinPlacement(contentBand, st2, vh);
|
|
2897
2897
|
if (!edge2) {
|
|
2898
2898
|
o2.display = "none";
|
|
2899
2899
|
return null;
|
|
2900
2900
|
}
|
|
2901
2901
|
o2.display = "block";
|
|
2902
2902
|
o2.left = `${svgLeft}px`;
|
|
2903
|
-
o2.top = `${edge2 === "top" ?
|
|
2903
|
+
o2.top = `${edge2 === "top" ? st2 : st2 + vh - bandPx}px`;
|
|
2904
2904
|
return edge2;
|
|
2905
2905
|
};
|
|
2906
2906
|
const onScroll = () => {
|
|
@@ -2977,8 +2977,8 @@ function fitRenderedChart(container, opts = {}) {
|
|
|
2977
2977
|
if (plan.grow) {
|
|
2978
2978
|
svg.setAttribute("height", String(plan.heightPx));
|
|
2979
2979
|
if (vb > 0) {
|
|
2980
|
-
const
|
|
2981
|
-
svg.setAttribute("viewBox", `${
|
|
2980
|
+
const b4 = svg.viewBox.baseVal;
|
|
2981
|
+
svg.setAttribute("viewBox", `${b4.x} ${b4.y} ${b4.width} ${plan.viewBoxH}`);
|
|
2982
2982
|
}
|
|
2983
2983
|
result.grew = true;
|
|
2984
2984
|
}
|
|
@@ -3076,8 +3076,8 @@ function compositeOver(fg, bg) {
|
|
|
3076
3076
|
];
|
|
3077
3077
|
}
|
|
3078
3078
|
function relativeLuminance(rgb) {
|
|
3079
|
-
const lin = rgb.map((
|
|
3080
|
-
const s =
|
|
3079
|
+
const lin = rgb.map((v2) => {
|
|
3080
|
+
const s = v2 / 255;
|
|
3081
3081
|
return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
3082
3082
|
});
|
|
3083
3083
|
return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
|
|
@@ -3111,10 +3111,10 @@ function decideLabelColor(textColor, fill, fillOpacity, pageBg, minContrast = MI
|
|
|
3111
3111
|
return useLight ? { fix: true, color: LIGHT_TEXT, reason: "fixed-light" } : { fix: true, color: DARK_TEXT, reason: "fixed-dark" };
|
|
3112
3112
|
}
|
|
3113
3113
|
var GLYPH_SAMPLE_N = 3;
|
|
3114
|
-
function glyphSampleGrid(box,
|
|
3114
|
+
function glyphSampleGrid(box, n = GLYPH_SAMPLE_N) {
|
|
3115
3115
|
const out = [];
|
|
3116
|
-
if (!box || !(box.width > 0) || !(box.height > 0) || !(
|
|
3117
|
-
const k3 = Math.floor(
|
|
3116
|
+
if (!box || !(box.width > 0) || !(box.height > 0) || !(n >= 1)) return out;
|
|
3117
|
+
const k3 = Math.floor(n);
|
|
3118
3118
|
for (let i = 0; i < k3; i++) {
|
|
3119
3119
|
for (let j4 = 0; j4 < k3; j4++) {
|
|
3120
3120
|
out.push({
|
|
@@ -3125,9 +3125,9 @@ function glyphSampleGrid(box, n2 = GLYPH_SAMPLE_N) {
|
|
|
3125
3125
|
}
|
|
3126
3126
|
return out;
|
|
3127
3127
|
}
|
|
3128
|
-
function clamp01(
|
|
3129
|
-
if (typeof
|
|
3130
|
-
return Math.max(0, Math.min(1,
|
|
3128
|
+
function clamp01(v2) {
|
|
3129
|
+
if (typeof v2 !== "number" || !isFinite(v2)) return 1;
|
|
3130
|
+
return Math.max(0, Math.min(1, v2));
|
|
3131
3131
|
}
|
|
3132
3132
|
function hexToRGB(hex2) {
|
|
3133
3133
|
const p2 = toRGBA(hex2);
|
|
@@ -3140,10 +3140,10 @@ var LABEL_CONTRAST_CAP = 2e3;
|
|
|
3140
3140
|
var EMPTY5 = { rects: 0, scanned: 0, fixed: 0, pillsBoosted: 0, offFill: 0, pageMajority: 0, paintedOver: 0 };
|
|
3141
3141
|
function backedSamples(el, pts) {
|
|
3142
3142
|
try {
|
|
3143
|
-
const
|
|
3144
|
-
if (typeof
|
|
3145
|
-
const m2 =
|
|
3146
|
-
const svg =
|
|
3143
|
+
const ge3 = el;
|
|
3144
|
+
if (typeof ge3.isPointInFill !== "function" || typeof ge3.getScreenCTM !== "function") return null;
|
|
3145
|
+
const m2 = ge3.getScreenCTM();
|
|
3146
|
+
const svg = ge3.ownerSVGElement;
|
|
3147
3147
|
if (!m2 || !svg || typeof svg.createSVGPoint !== "function") return null;
|
|
3148
3148
|
if (pts.length === 0) return null;
|
|
3149
3149
|
const inv = m2.inverse();
|
|
@@ -3152,7 +3152,7 @@ function backedSamples(el, pts) {
|
|
|
3152
3152
|
const p2 = svg.createSVGPoint();
|
|
3153
3153
|
p2.x = pts[i].x;
|
|
3154
3154
|
p2.y = pts[i].y;
|
|
3155
|
-
hit.push(
|
|
3155
|
+
hit.push(ge3.isPointInFill(p2.matrixTransform(inv)));
|
|
3156
3156
|
}
|
|
3157
3157
|
return hit;
|
|
3158
3158
|
} catch {
|
|
@@ -3162,9 +3162,9 @@ function backedSamples(el, pts) {
|
|
|
3162
3162
|
var DOC_POSITION_FOLLOWING = 4;
|
|
3163
3163
|
function paintRoot(el, container) {
|
|
3164
3164
|
let root = null;
|
|
3165
|
-
for (let
|
|
3166
|
-
if (String(
|
|
3167
|
-
if (
|
|
3165
|
+
for (let n = el.parentElement; n; n = n.parentElement) {
|
|
3166
|
+
if (String(n.tagName || "").toLowerCase() === "svg") root = n;
|
|
3167
|
+
if (n === container) break;
|
|
3168
3168
|
}
|
|
3169
3169
|
return root;
|
|
3170
3170
|
}
|
|
@@ -3187,8 +3187,8 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3187
3187
|
const pushShape = (el) => {
|
|
3188
3188
|
const tag = el.tagName.toLowerCase();
|
|
3189
3189
|
if (tag !== "rect" && tag !== "path") return;
|
|
3190
|
-
const
|
|
3191
|
-
if (
|
|
3190
|
+
const r2 = el.getBoundingClientRect();
|
|
3191
|
+
if (r2.width <= 0 || r2.height <= 0) return;
|
|
3192
3192
|
let fill = el.getAttribute("fill") || "";
|
|
3193
3193
|
const win2 = container.ownerDocument?.defaultView;
|
|
3194
3194
|
if ((!fill || fill === "none") && win2 && typeof win2.getComputedStyle === "function") {
|
|
@@ -3198,10 +3198,10 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3198
3198
|
const opAttr = el.getAttribute("fill-opacity");
|
|
3199
3199
|
const op = opAttr === null ? 1 : parseFloat(opAttr);
|
|
3200
3200
|
rects.push({
|
|
3201
|
-
r,
|
|
3201
|
+
r: r2,
|
|
3202
3202
|
fill,
|
|
3203
3203
|
op: isFinite(op) ? op : 1,
|
|
3204
|
-
area:
|
|
3204
|
+
area: r2.width * r2.height,
|
|
3205
3205
|
el,
|
|
3206
3206
|
ord: ord++,
|
|
3207
3207
|
root: paintRoot(el, container)
|
|
@@ -3237,10 +3237,10 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3237
3237
|
for (let t = 0; t < texts.length; t++) {
|
|
3238
3238
|
const tx = texts[t];
|
|
3239
3239
|
if (tx.getAttribute(LABEL_CONTRAST_DONE_ATTR) === "1") continue;
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
const ovArea = (
|
|
3243
|
-
const glyphArea =
|
|
3240
|
+
const tr2 = tx.getBoundingClientRect();
|
|
3241
|
+
if (tr2.width <= 0 || tr2.height <= 0) continue;
|
|
3242
|
+
const ovArea = (r2) => Math.max(0, Math.min(r2.right, tr2.right) - Math.max(r2.left, tr2.left)) * Math.max(0, Math.min(r2.bottom, tr2.bottom) - Math.max(r2.top, tr2.top));
|
|
3243
|
+
const glyphArea = tr2.width * tr2.height;
|
|
3244
3244
|
const txRoot = paintRoot(tx, container);
|
|
3245
3245
|
let over = 0;
|
|
3246
3246
|
const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x3) => {
|
|
@@ -3250,7 +3250,7 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3250
3250
|
return false;
|
|
3251
3251
|
});
|
|
3252
3252
|
if (over > 0) report.paintedOver++;
|
|
3253
|
-
const pts = glyphSampleGrid({ left:
|
|
3253
|
+
const pts = glyphSampleGrid({ left: tr2.left, top: tr2.top, width: tr2.width, height: tr2.height });
|
|
3254
3254
|
const painted = pts.map(() => false);
|
|
3255
3255
|
let unmeasured = 0;
|
|
3256
3256
|
const under = boxed.map((x3) => {
|
|
@@ -3280,7 +3280,7 @@ function applyLabelContrast(container, opts = {}) {
|
|
|
3280
3280
|
}
|
|
3281
3281
|
report.scanned++;
|
|
3282
3282
|
const opaqueUnder = under.filter((x3) => effAlpha(x3.mk) >= PILL_OPAQUE_ALPHA);
|
|
3283
|
-
const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((a2,
|
|
3283
|
+
const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((a2, b4) => b4.ov > a2.ov || b4.ov === a2.ov && b4.mk.ord > a2.mk.ord ? b4 : a2);
|
|
3284
3284
|
const cell = cellEntry.mk;
|
|
3285
3285
|
const pill = under.find((x3) => x3.mk !== cell && isPillBackdropAlpha(effAlpha(x3.mk)) && x3.mk.ord > cell.ord && pillBacksGlyph(x3.ov, glyphArea))?.mk;
|
|
3286
3286
|
const cellRGBA = toRGBA(cell.fill);
|
|
@@ -3343,7 +3343,7 @@ function noopViewStateProvider() {
|
|
|
3343
3343
|
return { load: () => ({}), save: () => {
|
|
3344
3344
|
} };
|
|
3345
3345
|
}
|
|
3346
|
-
var parseRowIdxs = (s) => (s || "").split(",").map((x3) => parseInt(x3, 10)).filter((
|
|
3346
|
+
var parseRowIdxs = (s) => (s || "").split(",").map((x3) => parseInt(x3, 10)).filter((n) => Number.isFinite(n));
|
|
3347
3347
|
function assembleD3(base, ...plugins) {
|
|
3348
3348
|
return Object.assign({}, base, ...plugins);
|
|
3349
3349
|
}
|
|
@@ -3437,7 +3437,7 @@ function compileRenderFn(code, win, doc, d3) {
|
|
|
3437
3437
|
return fn;
|
|
3438
3438
|
}
|
|
3439
3439
|
var ASYNC_RENDER_TIMEOUT_MS = 15e3;
|
|
3440
|
-
var isThenable = (
|
|
3440
|
+
var isThenable = (v2) => !!v2 && (typeof v2 === "object" || typeof v2 === "function") && typeof v2.then === "function";
|
|
3441
3441
|
function createChartHost(container, config) {
|
|
3442
3442
|
const doc = container.ownerDocument;
|
|
3443
3443
|
const win = doc?.defaultView ?? globalThis;
|
|
@@ -3445,7 +3445,7 @@ function createChartHost(container, config) {
|
|
|
3445
3445
|
let data = config.data;
|
|
3446
3446
|
{
|
|
3447
3447
|
const stamped = config.data?.meta?.hostContract;
|
|
3448
|
-
const major = (
|
|
3448
|
+
const major = (v2) => (v2 || "").split(".")[0];
|
|
3449
3449
|
if (stamped && major(stamped) !== major(HOST_CONTRACT_VERSION)) {
|
|
3450
3450
|
try {
|
|
3451
3451
|
(win?.console ?? console)?.warn(
|
|
@@ -3499,9 +3499,9 @@ function createChartHost(container, config) {
|
|
|
3499
3499
|
const ensureAffordanceStyles = () => {
|
|
3500
3500
|
try {
|
|
3501
3501
|
if (!doc || doc.getElementById("bic-chart-host-affordances")) return;
|
|
3502
|
-
const
|
|
3503
|
-
|
|
3504
|
-
|
|
3502
|
+
const st2 = doc.createElement("style");
|
|
3503
|
+
st2.id = "bic-chart-host-affordances";
|
|
3504
|
+
st2.textContent = `
|
|
3505
3505
|
/* TYPOGRAPHY FIREWALL. Generated charts set font-size but almost never line-height or
|
|
3506
3506
|
letter-spacing, so they INHERIT whatever the host page cascades in. A page with
|
|
3507
3507
|
\`:root { font: 18px/145% }\` (the stock Vite template does exactly this) hands every
|
|
@@ -3550,7 +3550,7 @@ function createChartHost(container, config) {
|
|
|
3550
3550
|
font-weight: 700 !important;
|
|
3551
3551
|
text-decoration: underline !important;
|
|
3552
3552
|
}`;
|
|
3553
|
-
(doc.head || doc.documentElement)?.appendChild(
|
|
3553
|
+
(doc.head || doc.documentElement)?.appendChild(st2);
|
|
3554
3554
|
} catch {
|
|
3555
3555
|
}
|
|
3556
3556
|
};
|
|
@@ -3568,7 +3568,7 @@ function createChartHost(container, config) {
|
|
|
3568
3568
|
const marks = container.querySelectorAll(`.${MARK_CLASS}[${ROW_IDX_ATTR}], .${LEGEND_MARK_CLASS}[${ROW_IDX_ATTR}]`);
|
|
3569
3569
|
for (const m2 of Array.from(marks)) {
|
|
3570
3570
|
const rows = parseRowIdxs(m2.getAttribute(ROW_IDX_ATTR));
|
|
3571
|
-
const on = active && rows.some((
|
|
3571
|
+
const on = active && rows.some((r2) => wanted.has(r2));
|
|
3572
3572
|
m2.classList?.[on ? "add" : "remove"](MARK_SELECTED_CLASS);
|
|
3573
3573
|
}
|
|
3574
3574
|
} catch {
|
|
@@ -3626,14 +3626,14 @@ function createChartHost(container, config) {
|
|
|
3626
3626
|
const tick = el.classList?.contains?.(AXIS_FILTER_CLASS) ? el : null;
|
|
3627
3627
|
if (e?.ctrlKey || e?.metaKey || e?.shiftKey) {
|
|
3628
3628
|
const next = new Set(current ?? []);
|
|
3629
|
-
for (const
|
|
3630
|
-
if (next.has(
|
|
3631
|
-
else next.add(
|
|
3629
|
+
for (const r2 of rows) {
|
|
3630
|
+
if (next.has(r2)) next.delete(r2);
|
|
3631
|
+
else next.add(r2);
|
|
3632
3632
|
}
|
|
3633
3633
|
notify(Array.from(next), "user", tick);
|
|
3634
3634
|
return;
|
|
3635
3635
|
}
|
|
3636
|
-
const same = !!current && current.length === rows.length && rows.every((
|
|
3636
|
+
const same = !!current && current.length === rows.length && rows.every((r2) => current.includes(r2));
|
|
3637
3637
|
notify(same ? [] : rows, "user", same ? null : tick);
|
|
3638
3638
|
};
|
|
3639
3639
|
container.addEventListener(XFILTER_REFRESH_EVENT, onXf);
|
|
@@ -3659,8 +3659,8 @@ function createChartHost(container, config) {
|
|
|
3659
3659
|
const bg = resolved.backgroundColor ?? resolved.themeBg;
|
|
3660
3660
|
if (typeof bg === "string" && bg) lc.pageBg = bg;
|
|
3661
3661
|
}
|
|
3662
|
-
const
|
|
3663
|
-
config.onLabelContrast?.(
|
|
3662
|
+
const r2 = applyLabelContrast(container, lc);
|
|
3663
|
+
config.onLabelContrast?.(r2);
|
|
3664
3664
|
} catch {
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
@@ -3707,8 +3707,8 @@ function createChartHost(container, config) {
|
|
|
3707
3707
|
}
|
|
3708
3708
|
if (fitOpts !== false) {
|
|
3709
3709
|
try {
|
|
3710
|
-
const
|
|
3711
|
-
config.onFit?.(
|
|
3710
|
+
const r2 = fitRenderedChart(container, fitOpts === true ? {} : fitOpts);
|
|
3711
|
+
config.onFit?.(r2);
|
|
3712
3712
|
} catch {
|
|
3713
3713
|
}
|
|
3714
3714
|
}
|
|
@@ -3862,16 +3862,16 @@ function toSourceRows(rowMap, payloadRowIdxs) {
|
|
|
3862
3862
|
return payloadRowIdxs.map((i) => rowMap[i]).filter((i) => i !== void 0);
|
|
3863
3863
|
}
|
|
3864
3864
|
function toPayloadRows(rowMap, sourceRowIdxs) {
|
|
3865
|
-
const
|
|
3865
|
+
const at2 = /* @__PURE__ */ new Map();
|
|
3866
3866
|
rowMap.forEach((src, k3) => {
|
|
3867
|
-
if (!
|
|
3867
|
+
if (!at2.has(src)) at2.set(src, k3);
|
|
3868
3868
|
});
|
|
3869
|
-
return sourceRowIdxs.map((s) =>
|
|
3869
|
+
return sourceRowIdxs.map((s) => at2.get(s)).filter((k3) => k3 !== void 0);
|
|
3870
3870
|
}
|
|
3871
|
-
var sameRows = (a2,
|
|
3872
|
-
if (a2.length !==
|
|
3873
|
-
const x3 = a2.slice().sort((p2, q2) => p2 - q2), y4 =
|
|
3874
|
-
return x3.every((
|
|
3871
|
+
var sameRows = (a2, b4) => {
|
|
3872
|
+
if (a2.length !== b4.length) return false;
|
|
3873
|
+
const x3 = a2.slice().sort((p2, q2) => p2 - q2), y4 = b4.slice().sort((p2, q2) => p2 - q2);
|
|
3874
|
+
return x3.every((v2, i) => v2 === y4[i]);
|
|
3875
3875
|
};
|
|
3876
3876
|
function syncMemberSelection(host, selection, id, highlight, incoming, rowMap) {
|
|
3877
3877
|
const mine = selection.sourceId === id && selection.rows.length > 0;
|
|
@@ -4048,13 +4048,13 @@ export {
|
|
|
4048
4048
|
registerGeo,
|
|
4049
4049
|
registerGeoAsset,
|
|
4050
4050
|
clearGeoCache,
|
|
4051
|
-
|
|
4052
|
-
|
|
4051
|
+
le,
|
|
4052
|
+
L2 as L,
|
|
4053
4053
|
L3,
|
|
4054
|
-
Ve,
|
|
4055
4054
|
Ke,
|
|
4056
|
-
|
|
4057
|
-
|
|
4055
|
+
Ye,
|
|
4056
|
+
Dn,
|
|
4057
|
+
Pn,
|
|
4058
4058
|
buildRenderPayload,
|
|
4059
4059
|
stripJsComments,
|
|
4060
4060
|
isInsideControl,
|