@rpcbase/ui 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/useMapsLibrary.d.ts.map +1 -1
- package/dist/index.js +102 -103
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMapsLibrary.d.ts","sourceRoot":"","sources":["../../lib/helpers/useMapsLibrary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMapsLibrary.d.ts","sourceRoot":"","sources":["../../lib/helpers/useMapsLibrary.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,cAAc,GAAI,GAAG,QAAQ,EAAE,SAAS,MAAM,oBAoB1D,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ve from "react";
|
|
2
|
-
import _e, { useState as I, useEffect as $, useRef as C, useMemo as
|
|
3
|
-
import ie, { clsx as
|
|
2
|
+
import _e, { useState as I, useEffect as $, useRef as C, useMemo as xe } from "react";
|
|
3
|
+
import ie, { clsx as ye } from "clsx";
|
|
4
4
|
import * as N from "@radix-ui/react-dialog";
|
|
5
5
|
import { XIcon as Ee } from "lucide-react";
|
|
6
6
|
import { Link as we } from "react-router";
|
|
@@ -24,8 +24,8 @@ function Te() {
|
|
|
24
24
|
var d = null;
|
|
25
25
|
if (c !== void 0 && (d = "" + c), a.key !== void 0 && (d = "" + a.key), "key" in a) {
|
|
26
26
|
c = {};
|
|
27
|
-
for (var
|
|
28
|
-
|
|
27
|
+
for (var p in a)
|
|
28
|
+
p !== "key" && (c[p] = a[p]);
|
|
29
29
|
} else c = a;
|
|
30
30
|
return a = c.ref, {
|
|
31
31
|
$$typeof: e,
|
|
@@ -53,14 +53,14 @@ function ke() {
|
|
|
53
53
|
function e(t) {
|
|
54
54
|
if (t == null) return null;
|
|
55
55
|
if (typeof t == "function")
|
|
56
|
-
return t.$$typeof ===
|
|
56
|
+
return t.$$typeof === Q ? null : t.displayName || t.name || null;
|
|
57
57
|
if (typeof t == "string") return t;
|
|
58
58
|
switch (t) {
|
|
59
59
|
case k:
|
|
60
60
|
return "Fragment";
|
|
61
61
|
case D:
|
|
62
62
|
return "Profiler";
|
|
63
|
-
case
|
|
63
|
+
case y:
|
|
64
64
|
return "StrictMode";
|
|
65
65
|
case O:
|
|
66
66
|
return "Suspense";
|
|
@@ -138,9 +138,9 @@ function ke() {
|
|
|
138
138
|
}
|
|
139
139
|
return t.key !== void 0;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function p(t, i) {
|
|
142
142
|
function g() {
|
|
143
|
-
|
|
143
|
+
K || (K = !0, console.error(
|
|
144
144
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
145
145
|
i
|
|
146
146
|
));
|
|
@@ -150,13 +150,13 @@ function ke() {
|
|
|
150
150
|
configurable: !0
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function m() {
|
|
154
154
|
var t = e(this.type);
|
|
155
155
|
return V[t] || (V[t] = !0, console.error(
|
|
156
156
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
157
157
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function x(t, i, g, h, G, S) {
|
|
160
160
|
var _ = g.ref;
|
|
161
161
|
return t = {
|
|
162
162
|
$$typeof: w,
|
|
@@ -166,7 +166,7 @@ function ke() {
|
|
|
166
166
|
_owner: h
|
|
167
167
|
}, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(t, "ref", {
|
|
168
168
|
enumerable: !1,
|
|
169
|
-
get:
|
|
169
|
+
get: m
|
|
170
170
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
171
171
|
configurable: !1,
|
|
172
172
|
enumerable: !1,
|
|
@@ -225,10 +225,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
225
225
|
for (var z in i)
|
|
226
226
|
z !== "key" && (g[z] = i[z]);
|
|
227
227
|
} else g = i;
|
|
228
|
-
return _ &&
|
|
228
|
+
return _ && p(
|
|
229
229
|
g,
|
|
230
230
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
231
|
-
),
|
|
231
|
+
), x(
|
|
232
232
|
t,
|
|
233
233
|
_,
|
|
234
234
|
g,
|
|
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
function f(t) {
|
|
244
244
|
return typeof t == "object" && t !== null && t.$$typeof === w;
|
|
245
245
|
}
|
|
246
|
-
var T = _e, w = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"),
|
|
246
|
+
var T = _e, w = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), R = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), U = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, te = Array.isArray, B = console.createTask ? console.createTask : function() {
|
|
247
247
|
return null;
|
|
248
248
|
};
|
|
249
249
|
T = {
|
|
@@ -251,7 +251,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
251
251
|
return t();
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
var
|
|
254
|
+
var K, V = {}, u = T.react_stack_bottom_frame.bind(
|
|
255
255
|
T,
|
|
256
256
|
c
|
|
257
257
|
)(), E = B(n(c)), J = {};
|
|
@@ -287,11 +287,11 @@ function Re(e, r) {
|
|
|
287
287
|
e.src = r;
|
|
288
288
|
}
|
|
289
289
|
const Pe = (e) => {
|
|
290
|
-
var r, o, n, a = "The Google Maps JavaScript API", c = "google", d = "importLibrary",
|
|
291
|
-
await (o =
|
|
290
|
+
var r, o, n, a = "The Google Maps JavaScript API", c = "google", d = "importLibrary", p = "__ib__", m = document, x = window, b = x[c] || (x[c] = {}), l = b.maps || (b.maps = {}), f = /* @__PURE__ */ new Set(), T = new URLSearchParams(), w = () => r || (r = new Promise(async (v, k) => {
|
|
291
|
+
await (o = m.createElement("script")), T.set("libraries", [...f] + "");
|
|
292
292
|
for (n in e)
|
|
293
|
-
T.set(n.replace(/[A-Z]/g, (
|
|
294
|
-
T.set("callback", c + ".maps." +
|
|
293
|
+
T.set(n.replace(/[A-Z]/g, (y) => "_" + y[0].toLowerCase()), e[n]);
|
|
294
|
+
T.set("callback", c + ".maps." + p), Re(o, "https://maps.googleapis.com/maps/api/js?" + T), l[p] = v, o.onerror = () => r = k(Error(a + " could not load.")), o.nonce = m.querySelector("script[nonce]")?.nonce || "", m.head.append(o);
|
|
295
295
|
}));
|
|
296
296
|
l[d] ? console.warn(a + " only loads once. Ignoring:", e) : l[d] = (v, ...k) => f.add(v) && w().then(() => l[d](v, ...k));
|
|
297
297
|
}, Ne = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, Ae = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, Oe = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", Se = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", ge = process.env.NODE_ENV !== "production", le = ge ? (e) => {
|
|
@@ -318,17 +318,16 @@ function Ce(e) {
|
|
|
318
318
|
const r = !!window.google?.maps?.importLibrary;
|
|
319
319
|
r ? Ie(Ae(e)) : Me && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && le(Se), r || Pe(e);
|
|
320
320
|
}
|
|
321
|
-
let re = null,
|
|
321
|
+
let re = null, me = null;
|
|
322
322
|
const $e = (e) => {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return console.error(n.message), Promise.reject(n);
|
|
323
|
+
if (!e) {
|
|
324
|
+
const r = new Error("useMapsLibrary: missing Google Maps API key");
|
|
325
|
+
return console.error(r.message), Promise.reject(r);
|
|
327
326
|
}
|
|
328
|
-
return re ?
|
|
327
|
+
return re ? me !== e && console.warn(
|
|
329
328
|
"useMapsLibrary: ignoring attempt to re-initialize Google Maps with a different API key than the one already in use."
|
|
330
|
-
) : (
|
|
331
|
-
key:
|
|
329
|
+
) : (me = e, De({
|
|
330
|
+
key: e,
|
|
332
331
|
v: "weekly"
|
|
333
332
|
}), re = Le("core").then(() => {
|
|
334
333
|
})), re;
|
|
@@ -346,7 +345,7 @@ const $e = (e) => {
|
|
|
346
345
|
}, [r]), o ? "loaded" : null;
|
|
347
346
|
};
|
|
348
347
|
function M(...e) {
|
|
349
|
-
return
|
|
348
|
+
return ye(e);
|
|
350
349
|
}
|
|
351
350
|
function he(e) {
|
|
352
351
|
const { className: r, type: o, ...n } = e;
|
|
@@ -404,13 +403,13 @@ const ft = {
|
|
|
404
403
|
return /* @__PURE__ */ s.jsx(s.Fragment, { children: r });
|
|
405
404
|
const c = [];
|
|
406
405
|
let d = 0;
|
|
407
|
-
return n.forEach((
|
|
408
|
-
if (a &&
|
|
406
|
+
return n.forEach((p, m) => {
|
|
407
|
+
if (a && p.startOffset >= r.length)
|
|
409
408
|
return;
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
const l = r.substring(
|
|
413
|
-
c.push(/* @__PURE__ */ s.jsx("strong", { children: l },
|
|
409
|
+
const x = p.startOffset, b = Math.min(p.endOffset, r.length);
|
|
410
|
+
if (x > d && c.push(r.substring(d, x)), b > x) {
|
|
411
|
+
const l = r.substring(x, b);
|
|
412
|
+
c.push(/* @__PURE__ */ s.jsx("strong", { children: l }, m));
|
|
414
413
|
}
|
|
415
414
|
d = Math.max(d, b);
|
|
416
415
|
}), d < r.length && c.push(r.substring(d)), c.length === 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: r }) : /* @__PURE__ */ s.jsx(s.Fragment, { children: c });
|
|
@@ -423,7 +422,7 @@ const ft = {
|
|
|
423
422
|
}, qe = (e, r) => e.filter((o) => Ue(o, r)), Be = (e) => e.sort((r, o) => {
|
|
424
423
|
const n = r.distanceMeters ?? Number.POSITIVE_INFINITY, a = o.distanceMeters ?? Number.POSITIVE_INFINITY;
|
|
425
424
|
return n - a;
|
|
426
|
-
}), Ve = (e, r) => Be(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(),
|
|
425
|
+
}), Ve = (e, r) => Be(qe(We(e), r)), Je = (e, r) => ce(e).toLowerCase() === r.trim().toLowerCase(), mt = ({
|
|
427
426
|
id: e,
|
|
428
427
|
label: r,
|
|
429
428
|
placeholder: o,
|
|
@@ -431,13 +430,13 @@ const ft = {
|
|
|
431
430
|
onValueChange: a,
|
|
432
431
|
disabled: c,
|
|
433
432
|
name: d,
|
|
434
|
-
className:
|
|
435
|
-
autofillShimName:
|
|
436
|
-
googleMapsApiKey:
|
|
433
|
+
className: p,
|
|
434
|
+
autofillShimName: m,
|
|
435
|
+
googleMapsApiKey: x,
|
|
437
436
|
boundingBox: b,
|
|
438
437
|
allowedTypes: l
|
|
439
438
|
}) => {
|
|
440
|
-
const [f, T] = I(n ?? ""), [w, v] = I([]), [k,
|
|
439
|
+
const [f, T] = I(n ?? ""), [w, v] = I([]), [k, y] = I(!1), [D, j] = I(-1), R = C(null), A = C(null), O = C(!1), F = C(!1), P = C(null), Y = ze("places", x), [W, Q] = I(null), U = xe(() => {
|
|
441
440
|
if (!l)
|
|
442
441
|
return Fe;
|
|
443
442
|
const u = /* @__PURE__ */ new Set();
|
|
@@ -452,9 +451,9 @@ const ft = {
|
|
|
452
451
|
return;
|
|
453
452
|
let u = !0;
|
|
454
453
|
return google.maps.importLibrary("places").then((E) => {
|
|
455
|
-
u &&
|
|
454
|
+
u && Q(E);
|
|
456
455
|
}).catch(() => {
|
|
457
|
-
u && (console.error("AddressAutocompleteInput: failed to load places library"),
|
|
456
|
+
u && (console.error("AddressAutocompleteInput: failed to load places library"), Q(null));
|
|
458
457
|
}), () => {
|
|
459
458
|
u = !1;
|
|
460
459
|
};
|
|
@@ -468,13 +467,13 @@ const ft = {
|
|
|
468
467
|
if (!u)
|
|
469
468
|
return;
|
|
470
469
|
if (f.trim() === "") {
|
|
471
|
-
v([]),
|
|
470
|
+
v([]), y(!1), P.current = null, n !== "" && a("");
|
|
472
471
|
return;
|
|
473
472
|
}
|
|
474
473
|
if (!W) return;
|
|
475
474
|
const { AutocompleteSuggestion: t, AutocompleteSessionToken: i } = W;
|
|
476
475
|
if (!t || !i) {
|
|
477
|
-
console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]),
|
|
476
|
+
console.error("AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports"), v([]), y(!1);
|
|
478
477
|
return;
|
|
479
478
|
}
|
|
480
479
|
P.current || (P.current = new i());
|
|
@@ -489,12 +488,12 @@ const ft = {
|
|
|
489
488
|
return;
|
|
490
489
|
const G = h.suggestions.map((z) => z.placePrediction).filter((z) => !!z), S = Ve(G, U), _ = S[0], L = _ && S.length === 1 && Je(_, f);
|
|
491
490
|
if (!F.current && L) {
|
|
492
|
-
v(S),
|
|
491
|
+
v(S), y(!1);
|
|
493
492
|
return;
|
|
494
493
|
}
|
|
495
|
-
S.length > 0 ? (v(S), F.current &&
|
|
494
|
+
S.length > 0 ? (v(S), F.current && y(!0), j(-1)) : (v([]), y(!1));
|
|
496
495
|
}).catch((h) => {
|
|
497
|
-
u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]),
|
|
496
|
+
u && (console.error("AddressAutocompleteInput: suggestion fetch failed", h), v([]), y(!1));
|
|
498
497
|
});
|
|
499
498
|
}, 300);
|
|
500
499
|
return () => {
|
|
@@ -502,7 +501,7 @@ const ft = {
|
|
|
502
501
|
};
|
|
503
502
|
}, [f, W, a, n, b, U]), $(() => {
|
|
504
503
|
const u = (E) => {
|
|
505
|
-
R.current && !R.current.contains(E.target) && A.current && !A.current.contains(E.target) &&
|
|
504
|
+
R.current && !R.current.contains(E.target) && A.current && !A.current.contains(E.target) && y(!1);
|
|
506
505
|
};
|
|
507
506
|
return document.addEventListener("mousedown", u), () => {
|
|
508
507
|
document.removeEventListener("mousedown", u);
|
|
@@ -511,18 +510,18 @@ const ft = {
|
|
|
511
510
|
const q = (u) => {
|
|
512
511
|
O.current = !0;
|
|
513
512
|
const E = ce(u);
|
|
514
|
-
T(E), a(E), v([]),
|
|
513
|
+
T(E), a(E), v([]), y(!1), P.current = null;
|
|
515
514
|
}, te = (u) => {
|
|
516
515
|
F.current = !0, T(u.target.value);
|
|
517
516
|
}, B = (u) => {
|
|
518
517
|
if (!k || w.length === 0) {
|
|
519
|
-
u.key === "Enter" && (u.preventDefault(), a(f),
|
|
518
|
+
u.key === "Enter" && (u.preventDefault(), a(f), y(!1), P.current = null);
|
|
520
519
|
return;
|
|
521
520
|
}
|
|
522
|
-
u.key === "ArrowDown" ? (u.preventDefault(), j((E) => (E + 1) % w.length)) : u.key === "ArrowUp" ? (u.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : u.key === "Enter" ? (u.preventDefault(), D > -1 && w[D] ? q(w[D]) : (a(f),
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
}, V =
|
|
521
|
+
u.key === "ArrowDown" ? (u.preventDefault(), j((E) => (E + 1) % w.length)) : u.key === "ArrowUp" ? (u.preventDefault(), j((E) => (E - 1 + w.length) % w.length)) : u.key === "Enter" ? (u.preventDefault(), D > -1 && w[D] ? q(w[D]) : (a(f), y(!1), P.current = null)) : u.key === "Escape" && y(!1);
|
|
522
|
+
}, K = () => {
|
|
523
|
+
y(!1), n !== f && a(f), P.current = null;
|
|
524
|
+
}, V = m ?? (d ? `${d}_shim` : void 0);
|
|
526
525
|
return /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
|
|
527
526
|
V && /* @__PURE__ */ s.jsx(
|
|
528
527
|
"input",
|
|
@@ -547,12 +546,12 @@ const ft = {
|
|
|
547
546
|
onChange: te,
|
|
548
547
|
onKeyDown: B,
|
|
549
548
|
onFocus: () => {
|
|
550
|
-
w.length > 0 && f &&
|
|
549
|
+
w.length > 0 && f && y(!0);
|
|
551
550
|
},
|
|
552
|
-
onBlur:
|
|
551
|
+
onBlur: K,
|
|
553
552
|
disabled: c,
|
|
554
553
|
autoComplete: "off",
|
|
555
|
-
className: M("w-full",
|
|
554
|
+
className: M("w-full", p)
|
|
556
555
|
}
|
|
557
556
|
),
|
|
558
557
|
k && w.length > 0 && /* @__PURE__ */ s.jsx(
|
|
@@ -577,7 +576,7 @@ const ft = {
|
|
|
577
576
|
}
|
|
578
577
|
)
|
|
579
578
|
] });
|
|
580
|
-
},
|
|
579
|
+
}, pt = ({
|
|
581
580
|
className: e,
|
|
582
581
|
onClick: r,
|
|
583
582
|
children: o,
|
|
@@ -608,14 +607,14 @@ const ft = {
|
|
|
608
607
|
checked: a,
|
|
609
608
|
onChange: c,
|
|
610
609
|
color: d = "sky",
|
|
611
|
-
...
|
|
610
|
+
...p
|
|
612
611
|
}) => {
|
|
613
|
-
const
|
|
612
|
+
const m = Xe[d];
|
|
614
613
|
return /* @__PURE__ */ s.jsx("div", { className: "flex h-6 shrink-0 items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "group grid size-4 grid-cols-1", children: [
|
|
615
614
|
/* @__PURE__ */ s.jsx(
|
|
616
615
|
"input",
|
|
617
616
|
{
|
|
618
|
-
...
|
|
617
|
+
...p,
|
|
619
618
|
id: e,
|
|
620
619
|
name: r,
|
|
621
620
|
type: "checkbox",
|
|
@@ -623,7 +622,7 @@ const ft = {
|
|
|
623
622
|
defaultChecked: n,
|
|
624
623
|
checked: a,
|
|
625
624
|
onChange: c,
|
|
626
|
-
className: `col-start-1 row-start-1 appearance-none cursor-pointer rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ${
|
|
625
|
+
className: `col-start-1 row-start-1 appearance-none cursor-pointer rounded-sm border border-gray-300 bg-white focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ${m}`
|
|
627
626
|
}
|
|
628
627
|
),
|
|
629
628
|
/* @__PURE__ */ s.jsxs(
|
|
@@ -678,7 +677,7 @@ function vt({
|
|
|
678
677
|
}) {
|
|
679
678
|
return /* @__PURE__ */ s.jsx(N.Close, { "data-slot": "dialog-close", ...e });
|
|
680
679
|
}
|
|
681
|
-
function
|
|
680
|
+
function Ze({
|
|
682
681
|
className: e,
|
|
683
682
|
...r
|
|
684
683
|
}) {
|
|
@@ -694,7 +693,7 @@ function Ke({
|
|
|
694
693
|
}
|
|
695
694
|
);
|
|
696
695
|
}
|
|
697
|
-
const
|
|
696
|
+
const Qe = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0, showCloseButtonOutside: n = !1, ...a }, c) => /* @__PURE__ */ s.jsx(He, { "data-slot": "dialog-portal", children: /* @__PURE__ */ s.jsx(Ze, { children: /* @__PURE__ */ s.jsxs(
|
|
698
697
|
N.Content,
|
|
699
698
|
{
|
|
700
699
|
ref: c,
|
|
@@ -723,7 +722,7 @@ const Ze = ve.forwardRef(({ className: e, children: r, showCloseButton: o = !0,
|
|
|
723
722
|
]
|
|
724
723
|
}
|
|
725
724
|
) }) }));
|
|
726
|
-
|
|
725
|
+
Qe.displayName = N.Content.displayName;
|
|
727
726
|
function _t({ className: e, ...r }) {
|
|
728
727
|
return /* @__PURE__ */ s.jsx(
|
|
729
728
|
"div",
|
|
@@ -734,7 +733,7 @@ function _t({ className: e, ...r }) {
|
|
|
734
733
|
}
|
|
735
734
|
);
|
|
736
735
|
}
|
|
737
|
-
function
|
|
736
|
+
function xt({ className: e, ...r }) {
|
|
738
737
|
return /* @__PURE__ */ s.jsx(
|
|
739
738
|
"div",
|
|
740
739
|
{
|
|
@@ -744,7 +743,7 @@ function yt({ className: e, ...r }) {
|
|
|
744
743
|
}
|
|
745
744
|
);
|
|
746
745
|
}
|
|
747
|
-
function
|
|
746
|
+
function yt({
|
|
748
747
|
className: e,
|
|
749
748
|
...r
|
|
750
749
|
}) {
|
|
@@ -770,10 +769,10 @@ function Et({
|
|
|
770
769
|
}
|
|
771
770
|
);
|
|
772
771
|
}
|
|
773
|
-
var
|
|
772
|
+
var Ke = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "#", "$", "%", "*", "+", ",", "-", ".", ":", ";", "=", "?", "@", "[", "]", "^", "_", "{", "|", "}", "~"], Z = (e) => {
|
|
774
773
|
let r = 0;
|
|
775
774
|
for (let o = 0; o < e.length; o++) {
|
|
776
|
-
let n = e[o], a =
|
|
775
|
+
let n = e[o], a = Ke.indexOf(n);
|
|
777
776
|
r = r * 83 + a;
|
|
778
777
|
}
|
|
779
778
|
return r;
|
|
@@ -783,14 +782,14 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
|
|
|
783
782
|
}, ne = (e) => {
|
|
784
783
|
let r = Math.max(0, Math.min(1, e));
|
|
785
784
|
return r <= 31308e-7 ? Math.trunc(r * 12.92 * 255 + 0.5) : Math.trunc((1.055 * Math.pow(r, 0.4166666666666667) - 0.055) * 255 + 0.5);
|
|
786
|
-
}, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r),
|
|
785
|
+
}, et = (e) => e < 0 ? -1 : 1, se = (e, r) => et(e) * Math.pow(Math.abs(e), r), pe = class extends Error {
|
|
787
786
|
constructor(e) {
|
|
788
787
|
super(e), this.name = "ValidationError", this.message = e;
|
|
789
788
|
}
|
|
790
789
|
}, tt = (e) => {
|
|
791
|
-
if (!e || e.length < 6) throw new
|
|
792
|
-
let r =
|
|
793
|
-
if (e.length !== 4 + 2 * n * o) throw new
|
|
790
|
+
if (!e || e.length < 6) throw new pe("The blurhash string must be at least 6 characters");
|
|
791
|
+
let r = Z(e[0]), o = Math.floor(r / 9) + 1, n = r % 9 + 1;
|
|
792
|
+
if (e.length !== 4 + 2 * n * o) throw new pe(`blurhash length mismatch: length is ${e.length} but it should be ${4 + 2 * n * o}`);
|
|
794
793
|
}, rt = (e) => {
|
|
795
794
|
let r = e >> 16, o = e >> 8 & 255, n = e & 255;
|
|
796
795
|
return [oe(r), oe(o), oe(n)];
|
|
@@ -799,23 +798,23 @@ var Qe = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
|
|
|
799
798
|
return [se((o - 9) / 9, 2) * r, se((n - 9) / 9, 2) * r, se((a - 9) / 9, 2) * r];
|
|
800
799
|
}, nt = (e, r, o, n) => {
|
|
801
800
|
tt(e), n = n | 1;
|
|
802
|
-
let a =
|
|
803
|
-
for (let l = 0; l <
|
|
804
|
-
let f =
|
|
805
|
-
|
|
801
|
+
let a = Z(e[0]), c = Math.floor(a / 9) + 1, d = a % 9 + 1, p = (Z(e[1]) + 1) / 166, m = new Array(d * c);
|
|
802
|
+
for (let l = 0; l < m.length; l++) if (l === 0) {
|
|
803
|
+
let f = Z(e.substring(2, 6));
|
|
804
|
+
m[l] = rt(f);
|
|
806
805
|
} else {
|
|
807
|
-
let f =
|
|
808
|
-
|
|
806
|
+
let f = Z(e.substring(4 + l * 2, 6 + l * 2));
|
|
807
|
+
m[l] = ot(f, p * n);
|
|
809
808
|
}
|
|
810
|
-
let
|
|
809
|
+
let x = r * 4, b = new Uint8ClampedArray(x * o);
|
|
811
810
|
for (let l = 0; l < o; l++) for (let f = 0; f < r; f++) {
|
|
812
811
|
let T = 0, w = 0, v = 0;
|
|
813
812
|
for (let j = 0; j < c; j++) for (let R = 0; R < d; R++) {
|
|
814
|
-
let A = Math.cos(Math.PI * f * R / r) * Math.cos(Math.PI * l * j / o), O =
|
|
813
|
+
let A = Math.cos(Math.PI * f * R / r) * Math.cos(Math.PI * l * j / o), O = m[R + j * d];
|
|
815
814
|
T += O[0] * A, w += O[1] * A, v += O[2] * A;
|
|
816
815
|
}
|
|
817
|
-
let k = ne(T),
|
|
818
|
-
b[4 * f + 0 + l *
|
|
816
|
+
let k = ne(T), y = ne(w), D = ne(v);
|
|
817
|
+
b[4 * f + 0 + l * x] = k, b[4 * f + 1 + l * x] = y, b[4 * f + 2 + l * x] = D, b[4 * f + 3 + l * x] = 255;
|
|
819
818
|
}
|
|
820
819
|
return b;
|
|
821
820
|
}, st = nt;
|
|
@@ -825,23 +824,23 @@ const wt = ({
|
|
|
825
824
|
alt: o = "",
|
|
826
825
|
className: n
|
|
827
826
|
}) => {
|
|
828
|
-
const [a, c] = I(!1), [d,
|
|
827
|
+
const [a, c] = I(!1), [d, p] = I(null), m = C(null);
|
|
829
828
|
$(() => {
|
|
830
829
|
if (!r) return;
|
|
831
830
|
const [l, f, T] = r, w = st(T, l, f), v = document.createElement("canvas"), k = v.getContext("2d");
|
|
832
831
|
if (k) {
|
|
833
832
|
v.width = l, v.height = f;
|
|
834
|
-
const
|
|
833
|
+
const y = new ImageData(
|
|
835
834
|
new Uint8ClampedArray(w),
|
|
836
835
|
l,
|
|
837
836
|
f
|
|
838
837
|
);
|
|
839
|
-
k.putImageData(
|
|
838
|
+
k.putImageData(y, 0, 0), p(v.toDataURL());
|
|
840
839
|
}
|
|
841
840
|
}, [r]), $(() => {
|
|
842
|
-
|
|
841
|
+
m.current && m.current.complete && c(!0);
|
|
843
842
|
}, [e]);
|
|
844
|
-
const
|
|
843
|
+
const x = () => {
|
|
845
844
|
}, b = () => {
|
|
846
845
|
};
|
|
847
846
|
return /* @__PURE__ */ s.jsxs(
|
|
@@ -849,7 +848,7 @@ const wt = ({
|
|
|
849
848
|
{
|
|
850
849
|
style: { position: "relative", overflow: "hidden" },
|
|
851
850
|
className: n,
|
|
852
|
-
onMouseEnter:
|
|
851
|
+
onMouseEnter: x,
|
|
853
852
|
onMouseLeave: b,
|
|
854
853
|
children: [
|
|
855
854
|
d && !a && /* @__PURE__ */ s.jsx(
|
|
@@ -869,7 +868,7 @@ const wt = ({
|
|
|
869
868
|
/* @__PURE__ */ s.jsx(
|
|
870
869
|
"img",
|
|
871
870
|
{
|
|
872
|
-
ref:
|
|
871
|
+
ref: m,
|
|
873
872
|
src: e,
|
|
874
873
|
alt: o,
|
|
875
874
|
style: {
|
|
@@ -898,20 +897,20 @@ const wt = ({
|
|
|
898
897
|
isActive: a,
|
|
899
898
|
children: c
|
|
900
899
|
}) => {
|
|
901
|
-
const [d,
|
|
902
|
-
|
|
900
|
+
const [d, p] = I(!1), m = C(null), x = C(null), b = () => {
|
|
901
|
+
m.current && clearTimeout(m.current), p(!0);
|
|
903
902
|
}, l = () => {
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
m.current = setTimeout(() => {
|
|
904
|
+
p(!1);
|
|
906
905
|
}, 120);
|
|
907
906
|
};
|
|
908
907
|
return $(() => () => {
|
|
909
|
-
|
|
908
|
+
m.current && clearTimeout(m.current);
|
|
910
909
|
}, []), /* @__PURE__ */ s.jsxs(
|
|
911
910
|
"div",
|
|
912
911
|
{
|
|
913
912
|
className: "flex",
|
|
914
|
-
ref:
|
|
913
|
+
ref: x,
|
|
915
914
|
onMouseEnter: b,
|
|
916
915
|
onMouseLeave: l,
|
|
917
916
|
children: [
|
|
@@ -920,7 +919,7 @@ const wt = ({
|
|
|
920
919
|
{
|
|
921
920
|
to: e,
|
|
922
921
|
onClick: () => {
|
|
923
|
-
|
|
922
|
+
p(!1);
|
|
924
923
|
},
|
|
925
924
|
className: ie(
|
|
926
925
|
"relative z-10 -mb-px flex items-center border-b-2 pt-px text-sm font-medium text-gray-700 cursor-pointer transition-colors duration-200 ease-out hover:text-gray-800",
|
|
@@ -943,7 +942,7 @@ const wt = ({
|
|
|
943
942
|
className: "absolute inset-0 top-1/2 bg-white shadow-sm"
|
|
944
943
|
}
|
|
945
944
|
),
|
|
946
|
-
/* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen:
|
|
945
|
+
/* @__PURE__ */ s.jsx("div", { className: "relative bg-white", children: c({ setIsOpen: p }) })
|
|
947
946
|
]
|
|
948
947
|
}
|
|
949
948
|
)
|
|
@@ -954,19 +953,19 @@ const wt = ({
|
|
|
954
953
|
MenuPopover: at
|
|
955
954
|
};
|
|
956
955
|
export {
|
|
957
|
-
|
|
958
|
-
|
|
956
|
+
mt as AddressAutocompleteInput,
|
|
957
|
+
pt as ApplePayButton,
|
|
959
958
|
gt as Checkbox,
|
|
960
959
|
ft as DEFAULT_ADDRESS_BOUNDING_BOX,
|
|
961
960
|
ht as Dialog,
|
|
962
961
|
vt as DialogClose,
|
|
963
|
-
|
|
962
|
+
Qe as DialogContent,
|
|
964
963
|
Et as DialogDescription,
|
|
965
|
-
|
|
964
|
+
xt as DialogFooter,
|
|
966
965
|
_t as DialogHeader,
|
|
967
|
-
|
|
966
|
+
Ze as DialogOverlay,
|
|
968
967
|
He as DialogPortal,
|
|
969
|
-
|
|
968
|
+
yt as DialogTitle,
|
|
970
969
|
bt as DialogTrigger,
|
|
971
970
|
Tt as Header,
|
|
972
971
|
wt as Image,
|