bmlt-query-client 1.0.7 → 1.0.9
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/.claude/settings.local.json +10 -0
- package/PROJECT_SUMMARY.md +1 -1
- package/README.md +51 -7
- package/dist/app.d.ts +74 -10
- package/dist/app.js +251 -184
- package/dist/app.js.map +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, i, o, s) => {
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
|
|
3
3
|
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
4
4
|
get: ((e) => i[e]).bind(null, d),
|
|
5
5
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
@@ -223,7 +223,7 @@ var ae = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
223
223
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, t !== void 0 && (t.exports = c);
|
|
224
224
|
})))(), 1);
|
|
225
225
|
//#endregion
|
|
226
|
-
//#region \0@oxc-project+runtime@0.
|
|
226
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/typeof.js
|
|
227
227
|
function _(e) {
|
|
228
228
|
"@babel/helpers - typeof";
|
|
229
229
|
return _ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -233,7 +233,7 @@ function _(e) {
|
|
|
233
233
|
}, _(e);
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region \0@oxc-project+runtime@0.
|
|
236
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/toPrimitive.js
|
|
237
237
|
function oe(e, t) {
|
|
238
238
|
if (_(e) != "object" || !e) return e;
|
|
239
239
|
var n = e[Symbol.toPrimitive];
|
|
@@ -245,13 +245,13 @@ function oe(e, t) {
|
|
|
245
245
|
return (t === "string" ? String : Number)(e);
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
|
-
//#region \0@oxc-project+runtime@0.
|
|
248
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/toPropertyKey.js
|
|
249
249
|
function se(e) {
|
|
250
250
|
var t = oe(e, "string");
|
|
251
251
|
return _(t) == "symbol" ? t : t + "";
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
//#region \0@oxc-project+runtime@0.
|
|
254
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/defineProperty.js
|
|
255
255
|
function v(e, t, n) {
|
|
256
256
|
return (t = se(t)) in e ? Object.defineProperty(e, t, {
|
|
257
257
|
value: n,
|
|
@@ -310,23 +310,23 @@ function de(e, t, n) {
|
|
|
310
310
|
return r;
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
|
-
//#region \0@oxc-project+runtime@0.
|
|
313
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/checkPrivateRedeclaration.js
|
|
314
314
|
function fe(e, t) {
|
|
315
315
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region \0@oxc-project+runtime@0.
|
|
318
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/classPrivateFieldInitSpec.js
|
|
319
319
|
function y(e, t, n) {
|
|
320
320
|
fe(e, t), t.set(e, n);
|
|
321
321
|
}
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region \0@oxc-project+runtime@0.
|
|
323
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/assertClassBrand.js
|
|
324
324
|
function b(e, t, n) {
|
|
325
325
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
326
326
|
throw TypeError("Private element is not present on this object");
|
|
327
327
|
}
|
|
328
328
|
//#endregion
|
|
329
|
-
//#region \0@oxc-project+runtime@0.
|
|
329
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/classPrivateFieldGet2.js
|
|
330
330
|
function x(e, t) {
|
|
331
331
|
return e.get(b(e, t));
|
|
332
332
|
}
|
|
@@ -358,6 +358,10 @@ var S = /* @__PURE__ */ new WeakMap(), pe = class {
|
|
|
358
358
|
id: e
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
+
remove(e) {
|
|
362
|
+
let t = x(S, this).findIndex((t) => typeof e == "string" ? t.id === e : t.run === e);
|
|
363
|
+
t !== -1 && x(S, this).splice(t, 1);
|
|
364
|
+
}
|
|
361
365
|
dequeue() {
|
|
362
366
|
return x(S, this).shift()?.run;
|
|
363
367
|
}
|
|
@@ -369,20 +373,20 @@ var S = /* @__PURE__ */ new WeakMap(), pe = class {
|
|
|
369
373
|
}
|
|
370
374
|
};
|
|
371
375
|
//#endregion
|
|
372
|
-
//#region \0@oxc-project+runtime@0.
|
|
376
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/classPrivateMethodInitSpec.js
|
|
373
377
|
function me(e, t) {
|
|
374
378
|
fe(e, t), t.add(e);
|
|
375
379
|
}
|
|
376
380
|
//#endregion
|
|
377
|
-
//#region \0@oxc-project+runtime@0.
|
|
381
|
+
//#region \0@oxc-project+runtime@0.127.0/helpers/classPrivateFieldSet2.js
|
|
378
382
|
function C(e, t, n) {
|
|
379
383
|
return e.set(b(e, t), n), n;
|
|
380
384
|
}
|
|
381
385
|
//#endregion
|
|
382
386
|
//#region node_modules/p-queue/dist/index.js
|
|
383
|
-
var
|
|
387
|
+
var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakSet(), be = class extends ae.default {
|
|
384
388
|
constructor(e) {
|
|
385
|
-
if (super(), me(this, V), y(this,
|
|
389
|
+
if (super(), me(this, V), y(this, w, void 0), y(this, T, void 0), y(this, E, 0), y(this, D, void 0), y(this, O, !1), y(this, he, !1), y(this, k, void 0), y(this, ge, 0), y(this, _e, 0), y(this, A, void 0), y(this, j, void 0), y(this, M, void 0), y(this, N, []), y(this, P, 0), y(this, F, void 0), y(this, ve, void 0), y(this, I, 0), y(this, L, void 0), y(this, R, void 0), y(this, ye, 1n), y(this, z, /* @__PURE__ */ new Map()), y(this, B, /* @__PURE__ */ new Set()), v(this, "timeout", void 0), e = {
|
|
386
390
|
carryoverIntervalCount: !1,
|
|
387
391
|
intervalCap: Infinity,
|
|
388
392
|
interval: 0,
|
|
@@ -395,54 +399,53 @@ var he = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
395
399
|
if (e.interval === void 0 || !(Number.isFinite(e.interval) && e.interval >= 0)) throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString() ?? ""}\` (${typeof e.interval})`);
|
|
396
400
|
if (e.strict && e.interval === 0) throw TypeError("The `strict` option requires a non-zero `interval`");
|
|
397
401
|
if (e.strict && e.intervalCap === Infinity) throw TypeError("The `strict` option requires a finite `intervalCap`");
|
|
398
|
-
if (C(
|
|
399
|
-
this.timeout = e.timeout, C(
|
|
402
|
+
if (C(w, this, e.carryoverIntervalCount ?? e.carryoverConcurrencyCount ?? !1), C(T, this, e.intervalCap === Infinity || e.interval === 0), C(D, this, e.intervalCap), C(k, this, e.interval), C(M, this, e.strict), C(F, this, new e.queueClass()), C(ve, this, e.queueClass), this.concurrency = e.concurrency, e.timeout !== void 0 && !(Number.isFinite(e.timeout) && e.timeout > 0)) throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);
|
|
403
|
+
this.timeout = e.timeout, C(R, this, e.autoStart === !1), b(V, this, Ie).call(this);
|
|
400
404
|
}
|
|
401
405
|
get concurrency() {
|
|
402
|
-
return x(
|
|
406
|
+
return x(L, this);
|
|
403
407
|
}
|
|
404
408
|
set concurrency(e) {
|
|
405
409
|
if (!(typeof e == "number" && e >= 1)) throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);
|
|
406
|
-
C(
|
|
410
|
+
C(L, this, e), b(V, this, Fe).call(this);
|
|
407
411
|
}
|
|
408
412
|
setPriority(e, t) {
|
|
409
413
|
if (typeof t != "number" || !Number.isFinite(t)) throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);
|
|
410
|
-
x(
|
|
414
|
+
x(F, this).setPriority(e, t);
|
|
411
415
|
}
|
|
412
416
|
async add(e, t = {}) {
|
|
413
417
|
var n, r;
|
|
414
418
|
return t = {
|
|
415
419
|
timeout: this.timeout,
|
|
416
420
|
...t,
|
|
417
|
-
id: t.id ?? (C(
|
|
421
|
+
id: t.id ?? (C(ye, this, (n = x(ye, this), r = n++, n)), r).toString()
|
|
418
422
|
}, new Promise((n, r) => {
|
|
419
|
-
let i = Symbol(`task-${t.id}`)
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
C(L, this, (a = x(L, this), a++, a)), x(B, this).set(i, {
|
|
423
|
+
let i = Symbol(`task-${t.id}`), a = () => void 0, o = async () => {
|
|
424
|
+
var o;
|
|
425
|
+
a(), C(I, this, (o = x(I, this), o++, o)), x(z, this).set(i, {
|
|
423
426
|
id: t.id,
|
|
424
427
|
priority: t.priority ?? 0,
|
|
425
428
|
startTime: Date.now(),
|
|
426
429
|
timeout: t.timeout
|
|
427
430
|
});
|
|
428
|
-
let
|
|
431
|
+
let s;
|
|
429
432
|
try {
|
|
430
433
|
try {
|
|
431
434
|
t.signal?.throwIfAborted();
|
|
432
435
|
} catch (e) {
|
|
433
|
-
throw b(V, this, Le).call(this), x(
|
|
436
|
+
throw b(V, this, Le).call(this), x(z, this).delete(i), e;
|
|
434
437
|
}
|
|
435
|
-
C(
|
|
438
|
+
C(_e, this, Date.now());
|
|
436
439
|
let r = e({ signal: t.signal });
|
|
437
440
|
if (t.timeout && (r = ue(Promise.resolve(r), {
|
|
438
441
|
milliseconds: t.timeout,
|
|
439
|
-
message: `Task timed out after ${t.timeout}ms (queue has ${x(
|
|
442
|
+
message: `Task timed out after ${t.timeout}ms (queue has ${x(I, this)} running, ${x(F, this).size} waiting)`
|
|
440
443
|
})), t.signal) {
|
|
441
444
|
let { signal: e } = t;
|
|
442
445
|
r = Promise.race([r, new Promise((t, n) => {
|
|
443
|
-
|
|
446
|
+
s = () => {
|
|
444
447
|
n(e.reason);
|
|
445
|
-
}, e.addEventListener("abort",
|
|
448
|
+
}, e.addEventListener("abort", s, { once: !0 });
|
|
446
449
|
})]);
|
|
447
450
|
}
|
|
448
451
|
let a = await r;
|
|
@@ -450,42 +453,64 @@ var he = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
450
453
|
} catch (e) {
|
|
451
454
|
r(e), this.emit("error", e);
|
|
452
455
|
} finally {
|
|
453
|
-
|
|
454
|
-
b(V, this,
|
|
456
|
+
s && t.signal?.removeEventListener("abort", s), x(z, this).delete(i), queueMicrotask(() => {
|
|
457
|
+
b(V, this, De).call(this);
|
|
455
458
|
});
|
|
456
459
|
}
|
|
457
|
-
}
|
|
460
|
+
};
|
|
461
|
+
x(F, this).enqueue(o, t);
|
|
462
|
+
let s = () => {
|
|
463
|
+
if (x(F, this) instanceof pe) {
|
|
464
|
+
x(F, this).remove(o);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
x(F, this).remove?.(t.id);
|
|
468
|
+
};
|
|
469
|
+
if (t.signal) {
|
|
470
|
+
let { signal: e } = t, n = () => {
|
|
471
|
+
a(), s(), r(e.reason), b(V, this, H).call(this), this.emit("next");
|
|
472
|
+
};
|
|
473
|
+
if (a = () => {
|
|
474
|
+
e.removeEventListener("abort", n), x(B, this).delete(a);
|
|
475
|
+
}, e.aborted) {
|
|
476
|
+
n();
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
e.addEventListener("abort", n, { once: !0 }), x(B, this).add(a);
|
|
480
|
+
}
|
|
481
|
+
this.emit("add"), b(V, this, H).call(this);
|
|
458
482
|
});
|
|
459
483
|
}
|
|
460
484
|
async addAll(e, t) {
|
|
461
485
|
return Promise.all(e.map(async (e) => this.add(e, t)));
|
|
462
486
|
}
|
|
463
487
|
start() {
|
|
464
|
-
return x(
|
|
488
|
+
return x(R, this) ? (C(R, this, !1), b(V, this, Fe).call(this), this) : this;
|
|
465
489
|
}
|
|
466
490
|
pause() {
|
|
467
|
-
C(
|
|
491
|
+
C(R, this, !0);
|
|
468
492
|
}
|
|
469
493
|
clear() {
|
|
470
|
-
|
|
494
|
+
for (let e of x(B, this)) e();
|
|
495
|
+
C(F, this, new (x(ve, this))()), b(V, this, je).call(this), b(V, this, Re).call(this), this.emit("empty"), x(I, this) === 0 && (b(V, this, Me).call(this), this.emit("idle")), this.emit("next");
|
|
471
496
|
}
|
|
472
497
|
async onEmpty() {
|
|
473
|
-
x(
|
|
498
|
+
x(F, this).size !== 0 && await b(V, this, U).call(this, "empty");
|
|
474
499
|
}
|
|
475
500
|
async onSizeLessThan(e) {
|
|
476
|
-
x(
|
|
501
|
+
x(F, this).size < e || await b(V, this, U).call(this, "next", () => x(F, this).size < e);
|
|
477
502
|
}
|
|
478
503
|
async onIdle() {
|
|
479
|
-
x(
|
|
504
|
+
x(I, this) === 0 && x(F, this).size === 0 || await b(V, this, U).call(this, "idle");
|
|
480
505
|
}
|
|
481
506
|
async onPendingZero() {
|
|
482
|
-
x(
|
|
507
|
+
x(I, this) !== 0 && await b(V, this, U).call(this, "pendingZero");
|
|
483
508
|
}
|
|
484
509
|
async onRateLimit() {
|
|
485
|
-
this.isRateLimited || await b(V, this,
|
|
510
|
+
this.isRateLimited || await b(V, this, U).call(this, "rateLimit");
|
|
486
511
|
}
|
|
487
512
|
async onRateLimitCleared() {
|
|
488
|
-
this.isRateLimited && await b(V, this,
|
|
513
|
+
this.isRateLimited && await b(V, this, U).call(this, "rateLimitCleared");
|
|
489
514
|
}
|
|
490
515
|
onError() {
|
|
491
516
|
return new Promise((e, t) => {
|
|
@@ -496,131 +521,131 @@ var he = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
496
521
|
});
|
|
497
522
|
}
|
|
498
523
|
get size() {
|
|
499
|
-
return x(
|
|
524
|
+
return x(F, this).size;
|
|
500
525
|
}
|
|
501
526
|
sizeBy(e) {
|
|
502
|
-
return x(
|
|
527
|
+
return x(F, this).filter(e).length;
|
|
503
528
|
}
|
|
504
529
|
get pending() {
|
|
505
|
-
return x(
|
|
530
|
+
return x(I, this);
|
|
506
531
|
}
|
|
507
532
|
get isPaused() {
|
|
508
|
-
return x(
|
|
533
|
+
return x(R, this);
|
|
509
534
|
}
|
|
510
535
|
get isRateLimited() {
|
|
511
|
-
return x(
|
|
536
|
+
return x(O, this);
|
|
512
537
|
}
|
|
513
538
|
get isSaturated() {
|
|
514
|
-
return x(
|
|
539
|
+
return x(I, this) === x(L, this) && x(F, this).size > 0 || this.isRateLimited && x(F, this).size > 0;
|
|
515
540
|
}
|
|
516
541
|
get runningTasks() {
|
|
517
|
-
return [...x(
|
|
542
|
+
return [...x(z, this).values()].map((e) => ({ ...e }));
|
|
518
543
|
}
|
|
519
544
|
};
|
|
520
|
-
function
|
|
521
|
-
for (; x(
|
|
522
|
-
let n = x(
|
|
545
|
+
function xe(e) {
|
|
546
|
+
for (; x(P, this) < x(N, this).length;) {
|
|
547
|
+
let n = x(N, this)[x(P, this)];
|
|
523
548
|
if (n !== void 0 && e - n >= x(k, this)) {
|
|
524
549
|
var t;
|
|
525
|
-
C(
|
|
550
|
+
C(P, this, (t = x(P, this), t++, t));
|
|
526
551
|
} else break;
|
|
527
552
|
}
|
|
528
|
-
(x(
|
|
553
|
+
(x(P, this) > 100 && x(P, this) > x(N, this).length / 2 || x(P, this) === x(N, this).length) && (C(N, this, x(N, this).slice(x(P, this))), C(P, this, 0));
|
|
529
554
|
}
|
|
530
|
-
function
|
|
531
|
-
if (x(
|
|
555
|
+
function Se(e) {
|
|
556
|
+
if (x(M, this)) x(N, this).push(e);
|
|
532
557
|
else {
|
|
533
558
|
var t;
|
|
534
|
-
C(
|
|
559
|
+
C(E, this, (t = x(E, this), t++, t));
|
|
535
560
|
}
|
|
536
561
|
}
|
|
537
|
-
function
|
|
538
|
-
if (x(
|
|
539
|
-
else if (x(
|
|
562
|
+
function Ce() {
|
|
563
|
+
if (x(M, this)) x(N, this).length > x(P, this) && x(N, this).pop();
|
|
564
|
+
else if (x(E, this) > 0) {
|
|
540
565
|
var e;
|
|
541
|
-
C(
|
|
566
|
+
C(E, this, (e = x(E, this), e--, e));
|
|
542
567
|
}
|
|
543
568
|
}
|
|
544
|
-
function Ce() {
|
|
545
|
-
return x(P, this).length - x(F, this);
|
|
546
|
-
}
|
|
547
569
|
function we() {
|
|
548
|
-
return x(
|
|
570
|
+
return x(N, this).length - x(P, this);
|
|
549
571
|
}
|
|
550
572
|
function Te() {
|
|
551
|
-
return x(
|
|
573
|
+
return x(T, this) ? !0 : x(M, this) ? b(V, this, we).call(this) < x(D, this) : x(E, this) < x(D, this);
|
|
552
574
|
}
|
|
553
575
|
function Ee() {
|
|
554
|
-
|
|
555
|
-
C(L, this, (e = x(L, this), e--, e)), x(L, this) === 0 && this.emit("pendingZero"), b(V, this, Me).call(this), this.emit("next");
|
|
576
|
+
return x(I, this) < x(L, this);
|
|
556
577
|
}
|
|
557
578
|
function De() {
|
|
558
|
-
|
|
579
|
+
var e;
|
|
580
|
+
C(I, this, (e = x(I, this), e--, e)), x(I, this) === 0 && this.emit("pendingZero"), b(V, this, H).call(this), this.emit("next");
|
|
559
581
|
}
|
|
560
|
-
function Oe(
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
582
|
+
function Oe() {
|
|
583
|
+
C(j, this, void 0), b(V, this, Pe).call(this), b(V, this, Ne).call(this);
|
|
584
|
+
}
|
|
585
|
+
function ke(e) {
|
|
586
|
+
if (x(M, this)) {
|
|
587
|
+
if (b(V, this, xe).call(this, e), b(V, this, we).call(this) >= x(D, this)) {
|
|
588
|
+
let t = x(N, this)[x(P, this)], n = x(k, this) - (e - t);
|
|
589
|
+
return b(V, this, Ae).call(this, n), !0;
|
|
565
590
|
}
|
|
566
591
|
return !1;
|
|
567
592
|
}
|
|
568
|
-
if (x(
|
|
593
|
+
if (x(A, this) === void 0) {
|
|
569
594
|
let t = x(ge, this) - e;
|
|
570
595
|
if (t < 0) {
|
|
571
|
-
if (x(
|
|
572
|
-
let t = e - x(
|
|
573
|
-
if (t < x(k, this)) return b(V, this,
|
|
596
|
+
if (x(_e, this) > 0) {
|
|
597
|
+
let t = e - x(_e, this);
|
|
598
|
+
if (t < x(k, this)) return b(V, this, Ae).call(this, x(k, this) - t), !0;
|
|
574
599
|
}
|
|
575
|
-
C(
|
|
576
|
-
} else return b(V, this,
|
|
600
|
+
C(E, this, x(w, this) ? x(I, this) : 0);
|
|
601
|
+
} else return b(V, this, Ae).call(this, t), !0;
|
|
577
602
|
}
|
|
578
603
|
return !1;
|
|
579
604
|
}
|
|
580
|
-
function
|
|
581
|
-
x(
|
|
582
|
-
b(V, this,
|
|
605
|
+
function Ae(e) {
|
|
606
|
+
x(j, this) === void 0 && C(j, this, setTimeout(() => {
|
|
607
|
+
b(V, this, Oe).call(this);
|
|
583
608
|
}, e));
|
|
584
609
|
}
|
|
585
|
-
function Ae() {
|
|
586
|
-
x(j, this) && (clearInterval(x(j, this)), C(j, this, void 0));
|
|
587
|
-
}
|
|
588
610
|
function je() {
|
|
589
|
-
x(
|
|
611
|
+
x(A, this) && (clearInterval(x(A, this)), C(A, this, void 0));
|
|
590
612
|
}
|
|
591
613
|
function Me() {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
614
|
+
x(j, this) && (clearTimeout(x(j, this)), C(j, this, void 0));
|
|
615
|
+
}
|
|
616
|
+
function H() {
|
|
617
|
+
if (x(F, this).size === 0) {
|
|
618
|
+
if (b(V, this, je).call(this), this.emit("empty"), x(I, this) === 0) {
|
|
619
|
+
if (b(V, this, Me).call(this), x(M, this) && x(P, this) > 0) {
|
|
595
620
|
let e = Date.now();
|
|
596
|
-
b(V, this,
|
|
621
|
+
b(V, this, xe).call(this, e);
|
|
597
622
|
}
|
|
598
623
|
this.emit("idle");
|
|
599
624
|
}
|
|
600
625
|
return !1;
|
|
601
626
|
}
|
|
602
627
|
let e = !1;
|
|
603
|
-
if (!x(
|
|
604
|
-
let t = Date.now(), n = !b(V, this,
|
|
605
|
-
if (
|
|
606
|
-
let r = x(
|
|
607
|
-
x(
|
|
628
|
+
if (!x(R, this)) {
|
|
629
|
+
let t = Date.now(), n = !b(V, this, ke).call(this, t);
|
|
630
|
+
if (Te.call(b(V, this)) && Ee.call(b(V, this))) {
|
|
631
|
+
let r = x(F, this).dequeue();
|
|
632
|
+
x(T, this) || (b(V, this, Se).call(this, t), b(V, this, W).call(this)), this.emit("active"), r(), n && b(V, this, Ne).call(this), e = !0;
|
|
608
633
|
}
|
|
609
634
|
}
|
|
610
635
|
return e;
|
|
611
636
|
}
|
|
612
637
|
function Ne() {
|
|
613
|
-
x(
|
|
638
|
+
x(T, this) || x(A, this) !== void 0 || x(M, this) || (C(A, this, setInterval(() => {
|
|
614
639
|
b(V, this, Pe).call(this);
|
|
615
640
|
}, x(k, this))), C(ge, this, Date.now() + x(k, this)));
|
|
616
641
|
}
|
|
617
642
|
function Pe() {
|
|
618
|
-
x(
|
|
643
|
+
x(M, this) || (x(E, this) === 0 && x(I, this) === 0 && x(A, this) && b(V, this, je).call(this), C(E, this, x(w, this) ? x(I, this) : 0)), b(V, this, Fe).call(this), b(V, this, W).call(this);
|
|
619
644
|
}
|
|
620
645
|
function Fe() {
|
|
621
|
-
for (; b(V, this,
|
|
646
|
+
for (; b(V, this, H).call(this););
|
|
622
647
|
}
|
|
623
|
-
async function
|
|
648
|
+
async function U(e, t) {
|
|
624
649
|
return new Promise((n) => {
|
|
625
650
|
let r = () => {
|
|
626
651
|
t && !t() || (this.off(e, r), n());
|
|
@@ -629,39 +654,39 @@ async function H(e, t) {
|
|
|
629
654
|
});
|
|
630
655
|
}
|
|
631
656
|
function Ie() {
|
|
632
|
-
x(
|
|
633
|
-
x(
|
|
657
|
+
x(T, this) || (this.on("add", () => {
|
|
658
|
+
x(F, this).size > 0 && b(V, this, W).call(this);
|
|
634
659
|
}), this.on("next", () => {
|
|
635
|
-
b(V, this,
|
|
660
|
+
b(V, this, W).call(this);
|
|
636
661
|
}));
|
|
637
662
|
}
|
|
638
|
-
function
|
|
639
|
-
x(
|
|
640
|
-
C(
|
|
663
|
+
function W() {
|
|
664
|
+
x(T, this) || x(he, this) || (C(he, this, !0), queueMicrotask(() => {
|
|
665
|
+
C(he, this, !1), b(V, this, Re).call(this);
|
|
641
666
|
}));
|
|
642
667
|
}
|
|
643
668
|
function Le() {
|
|
644
|
-
x(
|
|
669
|
+
x(T, this) || (b(V, this, Ce).call(this), b(V, this, W).call(this));
|
|
645
670
|
}
|
|
646
671
|
function Re() {
|
|
647
|
-
let e = x(
|
|
648
|
-
if (x(
|
|
649
|
-
e && (C(
|
|
672
|
+
let e = x(O, this);
|
|
673
|
+
if (x(T, this) || x(F, this).size === 0) {
|
|
674
|
+
e && (C(O, this, !1), this.emit("rateLimitCleared"));
|
|
650
675
|
return;
|
|
651
676
|
}
|
|
652
677
|
let t;
|
|
653
|
-
if (x(
|
|
678
|
+
if (x(M, this)) {
|
|
654
679
|
let e = Date.now();
|
|
655
|
-
b(V, this,
|
|
656
|
-
} else t = x(
|
|
657
|
-
let n = t >= x(
|
|
658
|
-
n !== e && (C(
|
|
680
|
+
b(V, this, xe).call(this, e), t = b(V, this, we).call(this);
|
|
681
|
+
} else t = x(E, this);
|
|
682
|
+
let n = t >= x(D, this);
|
|
683
|
+
n !== e && (C(O, this, n), this.emit(n ? "rateLimit" : "rateLimitCleared"));
|
|
659
684
|
}
|
|
660
685
|
//#endregion
|
|
661
686
|
//#region src/utils/errors.ts
|
|
662
|
-
var
|
|
687
|
+
var G = /* @__PURE__ */ function(e) {
|
|
663
688
|
return e.API_ERROR = "ApiError", e.NETWORK_ERROR = "NetworkError", e.VALIDATION_ERROR = "ValidationError", e.GEOCODING_ERROR = "GeocodingError", e.RATE_LIMIT_ERROR = "RateLimitError", e.TIMEOUT_ERROR = "TimeoutError", e.AUTHENTICATION_ERROR = "AuthenticationError", e.SERVER_ERROR = "ServerError", e.CLIENT_ERROR = "ClientError", e.CONFIGURATION_ERROR = "ConfigurationError", e;
|
|
664
|
-
}({}),
|
|
689
|
+
}({}), K = class e extends Error {
|
|
665
690
|
constructor(t, n, r = {}) {
|
|
666
691
|
super(n), v(this, "type", void 0), v(this, "statusCode", void 0), v(this, "response", void 0), v(this, "originalError", void 0), v(this, "context", void 0), this.name = "BmltQueryError", this.type = t, this.statusCode = r.statusCode, this.response = r.response, this.originalError = r.originalError, this.context = r.context, Object.setPrototypeOf(this, e.prototype);
|
|
667
692
|
}
|
|
@@ -670,10 +695,10 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
670
695
|
}
|
|
671
696
|
isRetryable() {
|
|
672
697
|
return [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
698
|
+
G.NETWORK_ERROR,
|
|
699
|
+
G.TIMEOUT_ERROR,
|
|
700
|
+
G.RATE_LIMIT_ERROR,
|
|
701
|
+
G.SERVER_ERROR
|
|
677
702
|
].includes(this.type);
|
|
678
703
|
}
|
|
679
704
|
isClientError() {
|
|
@@ -684,15 +709,15 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
684
709
|
}
|
|
685
710
|
getUserMessage() {
|
|
686
711
|
switch (this.type) {
|
|
687
|
-
case
|
|
688
|
-
case
|
|
689
|
-
case
|
|
690
|
-
case
|
|
691
|
-
case
|
|
692
|
-
case
|
|
693
|
-
case
|
|
694
|
-
case
|
|
695
|
-
case
|
|
712
|
+
case G.NETWORK_ERROR: return "Unable to connect to the BMLT server. Please check your internet connection and try again.";
|
|
713
|
+
case G.TIMEOUT_ERROR: return "The request timed out. Please try again later.";
|
|
714
|
+
case G.RATE_LIMIT_ERROR: return "Too many requests. Please wait a moment and try again.";
|
|
715
|
+
case G.GEOCODING_ERROR: return "Unable to find the specified address. Please check the address and try again.";
|
|
716
|
+
case G.VALIDATION_ERROR: return "Invalid input provided. Please check your parameters and try again.";
|
|
717
|
+
case G.AUTHENTICATION_ERROR: return "Authentication failed. Please check your credentials.";
|
|
718
|
+
case G.SERVER_ERROR: return "The BMLT server encountered an error. Please try again later.";
|
|
719
|
+
case G.API_ERROR: return this.statusCode === 404 ? "The requested resource was not found." : "An error occurred while communicating with the BMLT server.";
|
|
720
|
+
case G.CONFIGURATION_ERROR: return "Invalid configuration. Please check your settings.";
|
|
696
721
|
default: return this.message || "An unexpected error occurred.";
|
|
697
722
|
}
|
|
698
723
|
}
|
|
@@ -712,55 +737,55 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
712
737
|
} : void 0
|
|
713
738
|
};
|
|
714
739
|
}
|
|
715
|
-
},
|
|
740
|
+
}, q = class {
|
|
716
741
|
static createApiError(e, t, n, r) {
|
|
717
742
|
let i;
|
|
718
|
-
return i = t ? t >= 500 ?
|
|
743
|
+
return i = t ? t >= 500 ? G.SERVER_ERROR : t === 401 || t === 403 ? G.AUTHENTICATION_ERROR : t === 429 ? G.RATE_LIMIT_ERROR : t >= 400 ? G.CLIENT_ERROR : G.API_ERROR : G.API_ERROR, new K(i, e, {
|
|
719
744
|
statusCode: t,
|
|
720
745
|
response: n,
|
|
721
746
|
originalError: r
|
|
722
747
|
});
|
|
723
748
|
}
|
|
724
749
|
static createNetworkError(e, t) {
|
|
725
|
-
return new G
|
|
750
|
+
return new K(G.NETWORK_ERROR, e, { originalError: t });
|
|
726
751
|
}
|
|
727
752
|
static createTimeoutError(e, t) {
|
|
728
|
-
return new G
|
|
753
|
+
return new K(G.TIMEOUT_ERROR, e, { originalError: t });
|
|
729
754
|
}
|
|
730
755
|
static createValidationError(e, t) {
|
|
731
|
-
return new G
|
|
756
|
+
return new K(G.VALIDATION_ERROR, e, { context: t });
|
|
732
757
|
}
|
|
733
758
|
static createGeocodingError(e, t, n) {
|
|
734
|
-
return new G
|
|
759
|
+
return new K(G.GEOCODING_ERROR, e, {
|
|
735
760
|
originalError: t,
|
|
736
761
|
context: n
|
|
737
762
|
});
|
|
738
763
|
}
|
|
739
764
|
static createRateLimitError(e, t, n) {
|
|
740
|
-
return new G
|
|
765
|
+
return new K(G.RATE_LIMIT_ERROR, e, {
|
|
741
766
|
statusCode: t,
|
|
742
767
|
response: n
|
|
743
768
|
});
|
|
744
769
|
}
|
|
745
770
|
static createConfigurationError(e, t) {
|
|
746
|
-
return new G
|
|
771
|
+
return new K(G.CONFIGURATION_ERROR, e, { context: t });
|
|
747
772
|
}
|
|
748
|
-
},
|
|
773
|
+
}, ze = class e {
|
|
749
774
|
static handleFetchError(e, t) {
|
|
750
|
-
if (e instanceof Error && e.name === "AbortError") return
|
|
751
|
-
if (e instanceof TypeError) return
|
|
775
|
+
if (e instanceof Error && e.name === "AbortError") return q.createTimeoutError("Request timeout", e);
|
|
776
|
+
if (e instanceof TypeError) return q.createNetworkError("Network connection failed", e);
|
|
752
777
|
if (t && !t.ok) {
|
|
753
778
|
let n = `HTTP ${t.status}: ${t.statusText}`;
|
|
754
|
-
return
|
|
779
|
+
return q.createApiError(n, t.status, void 0, e);
|
|
755
780
|
}
|
|
756
|
-
return e instanceof Error ?
|
|
781
|
+
return e instanceof Error ? q.createApiError(e.message, void 0, void 0, e) : q.createApiError("Unknown error occurred", void 0, void 0, Error(String(e)));
|
|
757
782
|
}
|
|
758
783
|
static handleAxiosError(t) {
|
|
759
784
|
return e.handleFetchError(t);
|
|
760
785
|
}
|
|
761
786
|
static handleValidationError(e, t, n, r) {
|
|
762
787
|
let i = `Invalid ${e}: expected ${n}`;
|
|
763
|
-
return r && r.length > 0 && (i += ` (${r.join(", ")})`),
|
|
788
|
+
return r && r.length > 0 && (i += ` (${r.join(", ")})`), q.createValidationError(i, {
|
|
764
789
|
field: e,
|
|
765
790
|
value: t,
|
|
766
791
|
expectedType: n,
|
|
@@ -769,21 +794,21 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
769
794
|
}
|
|
770
795
|
static handleEndpointError(e, t) {
|
|
771
796
|
let n = `Invalid endpoint/format combination: ${e} with ${t}`;
|
|
772
|
-
return
|
|
797
|
+
return q.createValidationError(n, {
|
|
773
798
|
endpoint: e,
|
|
774
799
|
format: t
|
|
775
800
|
});
|
|
776
801
|
}
|
|
777
802
|
static handleUrlError(e, t) {
|
|
778
803
|
let n = `Invalid URL: ${t}`;
|
|
779
|
-
return
|
|
804
|
+
return q.createValidationError(n, {
|
|
780
805
|
url: e,
|
|
781
806
|
reason: t
|
|
782
807
|
});
|
|
783
808
|
}
|
|
784
809
|
static handleCoordinateError(e, t, n) {
|
|
785
810
|
let r = n || "Invalid coordinates provided";
|
|
786
|
-
return
|
|
811
|
+
return q.createValidationError(r, {
|
|
787
812
|
latitude: e,
|
|
788
813
|
longitude: t,
|
|
789
814
|
reason: n
|
|
@@ -791,7 +816,7 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
791
816
|
}
|
|
792
817
|
static wrapError(e, t, n) {
|
|
793
818
|
let r = `${t}: ${e.message}`;
|
|
794
|
-
return e instanceof
|
|
819
|
+
return e instanceof K ? new K(e.type, r, {
|
|
795
820
|
statusCode: e.statusCode,
|
|
796
821
|
response: e.response,
|
|
797
822
|
originalError: e.originalError || e,
|
|
@@ -799,22 +824,22 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
799
824
|
...e.context,
|
|
800
825
|
...n
|
|
801
826
|
}
|
|
802
|
-
}) :
|
|
827
|
+
}) : q.createApiError(r, void 0, void 0, e);
|
|
803
828
|
}
|
|
804
|
-
},
|
|
829
|
+
}, Be = class {
|
|
805
830
|
static async withRetry(e, t) {
|
|
806
831
|
let { maxRetries: n, baseDelay: r, maxDelay: i, factor: a, onRetry: o } = t, s;
|
|
807
832
|
for (let t = 0; t <= n; t++) try {
|
|
808
833
|
return await e();
|
|
809
834
|
} catch (e) {
|
|
810
|
-
let c = e instanceof
|
|
835
|
+
let c = e instanceof K ? e : ze.wrapError(e, "Operation failed");
|
|
811
836
|
if (s = c, t === n || !c.isRetryable()) throw c;
|
|
812
837
|
let l = Math.min(r * a ** +t, i);
|
|
813
838
|
o && o(c, t + 1), await new Promise((e) => setTimeout(e, l));
|
|
814
839
|
}
|
|
815
840
|
throw s;
|
|
816
841
|
}
|
|
817
|
-
},
|
|
842
|
+
}, Ve = class {
|
|
818
843
|
constructor(e = {}) {
|
|
819
844
|
v(this, "baseURL", void 0), v(this, "queue", void 0), v(this, "defaultOptions", void 0);
|
|
820
845
|
let { retryCount: t = 3, timeout: n = 1e4, userAgent: r = "bmlt-query-client/1.0.0", countryCode: i = "us", viewbox: a, bounded: o = !1, intervalCap: s = 1, interval: c = 1e3, concurrency: l = 1, carryoverConcurrencyCount: u = !1, ...d } = e;
|
|
@@ -825,7 +850,7 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
825
850
|
countryCode: i,
|
|
826
851
|
viewbox: a,
|
|
827
852
|
bounded: o
|
|
828
|
-
}, this.baseURL = "https://nominatim.openstreetmap.org", this.queue = new
|
|
853
|
+
}, this.baseURL = "https://nominatim.openstreetmap.org", this.queue = new be({
|
|
829
854
|
intervalCap: s,
|
|
830
855
|
interval: c,
|
|
831
856
|
concurrency: l,
|
|
@@ -886,7 +911,7 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
886
911
|
r.searchParams.append(e, String(t));
|
|
887
912
|
});
|
|
888
913
|
let i = await this.fetchWithTimeout(r.toString(), n.timeout, n.userAgent);
|
|
889
|
-
if (!i || i.length === 0) throw new G
|
|
914
|
+
if (!i || i.length === 0) throw new K(G.GEOCODING_ERROR, `No results found for address: ${e}`);
|
|
890
915
|
let a = i[0], o = {
|
|
891
916
|
latitude: parseFloat(a.lat),
|
|
892
917
|
longitude: parseFloat(a.lon)
|
|
@@ -1003,22 +1028,22 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
1003
1028
|
return e[e.SUNDAY = 1] = "SUNDAY", e[e.MONDAY = 2] = "MONDAY", e[e.TUESDAY = 3] = "TUESDAY", e[e.WEDNESDAY = 4] = "WEDNESDAY", e[e.THURSDAY = 5] = "THURSDAY", e[e.FRIDAY = 6] = "FRIDAY", e[e.SATURDAY = 7] = "SATURDAY", e;
|
|
1004
1029
|
}({}), Z = /* @__PURE__ */ function(e) {
|
|
1005
1030
|
return e[e.IN_PERSON = 1] = "IN_PERSON", e[e.VIRTUAL = 2] = "VIRTUAL", e[e.HYBRID = 3] = "HYBRID", e;
|
|
1006
|
-
}({}), Ve = /* @__PURE__ */ function(e) {
|
|
1007
|
-
return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
|
|
1008
1031
|
}({}), He = /* @__PURE__ */ function(e) {
|
|
1032
|
+
return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
|
|
1033
|
+
}({}), Ue = /* @__PURE__ */ function(e) {
|
|
1009
1034
|
return e.ENGLISH = "en", e.GERMAN = "de", e.DANISH = "dk", e.SPANISH = "es", e.PERSIAN = "fa", e.FRENCH = "fr", e.ITALIAN = "it", e.POLISH = "pl", e.PORTUGUESE = "pt", e.SWEDISH = "sv", e;
|
|
1010
1035
|
}({});
|
|
1011
1036
|
//#endregion
|
|
1012
1037
|
//#region src/utils/url-builder.ts
|
|
1013
|
-
function
|
|
1014
|
-
let {
|
|
1038
|
+
function We(e) {
|
|
1039
|
+
let { serverURL: t, format: n, endpoint: r, parameters: i = {} } = e, a = `${t.endsWith("/") ? t : `${t}/`}client_interface/${n}/`, o = new URLSearchParams();
|
|
1015
1040
|
return o.set("switcher", r), Object.entries(i).forEach(([e, t]) => {
|
|
1016
1041
|
t != null && (Array.isArray(t) ? t.forEach((t, n) => {
|
|
1017
1042
|
(typeof t == "number" || typeof t == "string") && o.append(`${e}[]`, t.toString());
|
|
1018
1043
|
}) : typeof t == "boolean" ? o.set(e, t ? "1" : "0") : o.set(e, t.toString()));
|
|
1019
1044
|
}), `${a}?${o.toString()}`;
|
|
1020
1045
|
}
|
|
1021
|
-
function
|
|
1046
|
+
function Ge(e) {
|
|
1022
1047
|
let t = {};
|
|
1023
1048
|
return Object.entries(e).forEach(([e, n]) => {
|
|
1024
1049
|
if (n != null) if (Array.isArray(n)) t[e] = n.map((e) => {
|
|
@@ -1036,7 +1061,7 @@ function We(e) {
|
|
|
1036
1061
|
} else t[e] = n;
|
|
1037
1062
|
}), t;
|
|
1038
1063
|
}
|
|
1039
|
-
function
|
|
1064
|
+
function Ke(e, t) {
|
|
1040
1065
|
let n = {
|
|
1041
1066
|
[Y.GET_SEARCH_RESULTS]: [
|
|
1042
1067
|
J.JSON,
|
|
@@ -1054,20 +1079,20 @@ function Ge(e, t) {
|
|
|
1054
1079
|
}[e];
|
|
1055
1080
|
if (!n.includes(t)) throw Error(`Invalid format '${t}' for endpoint '${e}'. Valid formats: ${n.join(", ")}`);
|
|
1056
1081
|
}
|
|
1057
|
-
function
|
|
1082
|
+
function qe(e) {
|
|
1058
1083
|
try {
|
|
1059
1084
|
let t = new URL(e);
|
|
1060
|
-
if (!["http:", "https:"].includes(t.protocol)) throw Error("
|
|
1085
|
+
if (!["http:", "https:"].includes(t.protocol)) throw Error("Server URL must use http or https protocol");
|
|
1061
1086
|
return t.href.replace(/\/$/, "");
|
|
1062
1087
|
} catch (t) {
|
|
1063
|
-
let n = /* @__PURE__ */ Error(`Invalid
|
|
1088
|
+
let n = /* @__PURE__ */ Error(`Invalid server URL: ${e}`);
|
|
1064
1089
|
throw n.cause = t, n;
|
|
1065
1090
|
}
|
|
1066
1091
|
}
|
|
1067
|
-
function
|
|
1092
|
+
function Je(e) {
|
|
1068
1093
|
return typeof e == "number" ? [e] : typeof e == "string" ? e.split(",").map((e) => parseInt(e.trim(), 10)).filter((e) => !isNaN(e)) : Array.isArray(e) ? e.map((e) => typeof e == "number" ? e : parseInt(String(e), 10)).filter((e) => !isNaN(e)) : [];
|
|
1069
1094
|
}
|
|
1070
|
-
function
|
|
1095
|
+
function Ye(e, t) {
|
|
1071
1096
|
let n = {};
|
|
1072
1097
|
if (typeof e == "number") {
|
|
1073
1098
|
if (e < 0 || e > 23) throw Error("Hours must be between 0 and 23");
|
|
@@ -1079,7 +1104,7 @@ function Je(e, t) {
|
|
|
1079
1104
|
}
|
|
1080
1105
|
return n;
|
|
1081
1106
|
}
|
|
1082
|
-
function
|
|
1107
|
+
function Xe(e, t) {
|
|
1083
1108
|
if (typeof e != "number" || isNaN(e)) throw Error("Latitude must be a valid number");
|
|
1084
1109
|
if (typeof t != "number" || isNaN(t)) throw Error("Longitude must be a valid number");
|
|
1085
1110
|
if (e < -90 || e > 90) throw Error("Latitude must be between -90 and 90 degrees");
|
|
@@ -1089,26 +1114,26 @@ function Q(e) {
|
|
|
1089
1114
|
if (typeof e != "number" || isNaN(e)) throw Error("Radius must be a valid number");
|
|
1090
1115
|
if (e <= 0) throw Error("Radius must be greater than 0");
|
|
1091
1116
|
}
|
|
1092
|
-
function
|
|
1117
|
+
function Ze(e) {
|
|
1093
1118
|
return e * 1.60934;
|
|
1094
1119
|
}
|
|
1095
|
-
function
|
|
1120
|
+
function Qe(e) {
|
|
1096
1121
|
return e / 1.60934;
|
|
1097
1122
|
}
|
|
1098
1123
|
//#endregion
|
|
1099
1124
|
//#region src/client/bmlt-client.ts
|
|
1100
|
-
var
|
|
1125
|
+
var $e = class {
|
|
1101
1126
|
constructor(e) {
|
|
1102
|
-
v(this, "timeout", void 0), v(this, "userAgent", void 0), v(this, "geocodingService", void 0), v(this, "
|
|
1103
|
-
let {
|
|
1104
|
-
this.
|
|
1127
|
+
v(this, "timeout", void 0), v(this, "userAgent", void 0), v(this, "geocodingService", void 0), v(this, "serverURL", void 0), v(this, "defaultFormat", void 0);
|
|
1128
|
+
let { serverURL: t, defaultFormat: n = J.JSON, timeout: r = 3e4, userAgent: i = "bmlt-query-client/1.0.0", geocodingOptions: a = {}, enableGeocoding: o = !0 } = e;
|
|
1129
|
+
this.serverURL = qe(t), this.defaultFormat = n, this.timeout = r, this.userAgent = i, o && (this.geocodingService = new Ve(a));
|
|
1105
1130
|
}
|
|
1106
1131
|
async makeRequest(e, t = {}, n = this.defaultFormat) {
|
|
1107
1132
|
let r;
|
|
1108
1133
|
try {
|
|
1109
|
-
|
|
1110
|
-
let i =
|
|
1111
|
-
|
|
1134
|
+
Ke(e, n);
|
|
1135
|
+
let i = We({
|
|
1136
|
+
serverURL: this.serverURL,
|
|
1112
1137
|
format: n,
|
|
1113
1138
|
endpoint: e,
|
|
1114
1139
|
parameters: t
|
|
@@ -1122,7 +1147,7 @@ var Qe = class {
|
|
|
1122
1147
|
} finally {
|
|
1123
1148
|
clearTimeout(o);
|
|
1124
1149
|
}
|
|
1125
|
-
if (!r.ok) throw
|
|
1150
|
+
if (!r.ok) throw ze.handleFetchError(/* @__PURE__ */ Error(`HTTP ${r.status}: ${r.statusText}`), r);
|
|
1126
1151
|
let s = await r.text();
|
|
1127
1152
|
if (n === J.CSV) return s;
|
|
1128
1153
|
if (n === J.JSONP) {
|
|
@@ -1132,7 +1157,7 @@ var Qe = class {
|
|
|
1132
1157
|
}
|
|
1133
1158
|
return n === J.JSON || n === J.TSML ? JSON.parse(s) : s;
|
|
1134
1159
|
} catch (e) {
|
|
1135
|
-
throw
|
|
1160
|
+
throw ze.handleFetchError(e, r);
|
|
1136
1161
|
}
|
|
1137
1162
|
}
|
|
1138
1163
|
async searchMeetings(e = {}) {
|
|
@@ -1157,7 +1182,7 @@ var Qe = class {
|
|
|
1157
1182
|
return n === void 0 ? r !== void 0 && (Q(r), s.geo_width_km = r) : (Q(n), s.geo_width = n), this.searchMeetings(s);
|
|
1158
1183
|
}
|
|
1159
1184
|
async searchMeetingsByCoordinates(e, t, n, r = {}) {
|
|
1160
|
-
|
|
1185
|
+
Xe(e.latitude, e.longitude);
|
|
1161
1186
|
let i = {
|
|
1162
1187
|
...r,
|
|
1163
1188
|
lat_val: e.latitude,
|
|
@@ -1202,11 +1227,11 @@ var Qe = class {
|
|
|
1202
1227
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
1203
1228
|
return this.geocodingService.reverseGeocode(e, t);
|
|
1204
1229
|
}
|
|
1205
|
-
|
|
1206
|
-
return this.
|
|
1230
|
+
getServerURL() {
|
|
1231
|
+
return this.serverURL;
|
|
1207
1232
|
}
|
|
1208
|
-
|
|
1209
|
-
this.
|
|
1233
|
+
setServerURL(e) {
|
|
1234
|
+
this.serverURL = qe(e);
|
|
1210
1235
|
}
|
|
1211
1236
|
getDefaultFormat() {
|
|
1212
1237
|
return this.defaultFormat;
|
|
@@ -1281,6 +1306,9 @@ var Qe = class {
|
|
|
1281
1306
|
searchText(e) {
|
|
1282
1307
|
return this.params.SearchString = e, this;
|
|
1283
1308
|
}
|
|
1309
|
+
searchAddress(e, t) {
|
|
1310
|
+
return this.params.SearchString = e, this.params.StringSearchIsAnAddress = !0, t !== void 0 && (this.params.SearchStringRadius = t), this;
|
|
1311
|
+
}
|
|
1284
1312
|
startingAfter(e, t = 0) {
|
|
1285
1313
|
return this.params.StartsAfterH = e, this.params.StartsAfterM = t, this;
|
|
1286
1314
|
}
|
|
@@ -1364,7 +1392,7 @@ var Qe = class {
|
|
|
1364
1392
|
searchParams: this.params
|
|
1365
1393
|
});
|
|
1366
1394
|
}
|
|
1367
|
-
},
|
|
1395
|
+
}, et = class {
|
|
1368
1396
|
constructor(e) {
|
|
1369
1397
|
v(this, "client", void 0), this.client = e;
|
|
1370
1398
|
}
|
|
@@ -1393,8 +1421,47 @@ var Qe = class {
|
|
|
1393
1421
|
byText(e) {
|
|
1394
1422
|
return new $(this.client).searchText(e);
|
|
1395
1423
|
}
|
|
1396
|
-
}
|
|
1424
|
+
}, tt = [
|
|
1425
|
+
"weekday_tinyint",
|
|
1426
|
+
"start_time",
|
|
1427
|
+
"meeting_name",
|
|
1428
|
+
"location_text"
|
|
1429
|
+
];
|
|
1430
|
+
function nt(e, t) {
|
|
1431
|
+
let n = e == null ? "" : String(e);
|
|
1432
|
+
return t ? n.toLowerCase().trim() : n;
|
|
1433
|
+
}
|
|
1434
|
+
function rt(e, t, n) {
|
|
1435
|
+
return t.map((t) => nt(e[t], n)).join(" | ");
|
|
1436
|
+
}
|
|
1437
|
+
function it(e, t = {}) {
|
|
1438
|
+
let { fields: n = tt, normalize: r = !0 } = t, i = /* @__PURE__ */ new Map();
|
|
1439
|
+
for (let t = 0; t < e.length; t++) for (let a of e[t]) {
|
|
1440
|
+
let e = rt(a, n, r);
|
|
1441
|
+
i.has(e) || i.set(e, []), i.get(e).push({
|
|
1442
|
+
meeting: a,
|
|
1443
|
+
listIndex: t
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
let a = [];
|
|
1447
|
+
for (let [e, t] of i) new Set(t.map((e) => e.listIndex)).size >= 2 && a.push({
|
|
1448
|
+
key: e,
|
|
1449
|
+
entries: t
|
|
1450
|
+
});
|
|
1451
|
+
return a;
|
|
1452
|
+
}
|
|
1453
|
+
function at(e) {
|
|
1454
|
+
let t = /* @__PURE__ */ new Map();
|
|
1455
|
+
for (let { service_body_bigint: n, meeting_name: r } of e) {
|
|
1456
|
+
if (!n || !r) continue;
|
|
1457
|
+
let e = r.trim().toLowerCase();
|
|
1458
|
+
t.has(n) || t.set(n, /* @__PURE__ */ new Set()), t.get(n).add(e);
|
|
1459
|
+
}
|
|
1460
|
+
let n = 0;
|
|
1461
|
+
for (let e of t.values()) n += e.size;
|
|
1462
|
+
return n;
|
|
1463
|
+
}
|
|
1397
1464
|
//#endregion
|
|
1398
|
-
export {
|
|
1465
|
+
export { $e as BmltClient, J as BmltDataFormat, Y as BmltEndpoint, G as BmltErrorType, K as BmltQueryError, q as ErrorFactory, ze as ErrorHandler, Ve as GeocodingService, Ue as Language, $ as MeetingQueryBuilder, et as QuickSearch, Be as RetryHandler, He as SortKey, Z as VenueType, X as Weekday, We as buildBmltURL, at as countUniqueGroups, Je as extractIds, it as findDuplicateMeetings, Ye as formatTimeValue, Qe as kilometersToMiles, Ze as milesToKilometers, Ge as normalizeParameters, Xe as validateCoordinates, Ke as validateEndpointFormat, Q as validateRadius, qe as validateServerURL };
|
|
1399
1466
|
|
|
1400
1467
|
//# sourceMappingURL=app.js.map
|