@erikey/react 0.4.21 → 0.4.22
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/styles.css +9 -0
- package/dist/styles.css.map +1 -1
- package/dist/ui/index.mjs +147 -441
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ui/index.mjs
CHANGED
|
@@ -202,311 +202,6 @@ import { useCallback as useCallback2, useContext as useContext3, useState as use
|
|
|
202
202
|
// src/ui/lib/auth-ui-provider.tsx
|
|
203
203
|
import { createContext, useMemo } from "react";
|
|
204
204
|
|
|
205
|
-
// ../../../node_modules/.pnpm/sonner@1.7.4_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/sonner/dist/index.mjs
|
|
206
|
-
import o, { forwardRef as fe, isValidElement as xt } from "react";
|
|
207
|
-
import vt from "react-dom";
|
|
208
|
-
import E from "react";
|
|
209
|
-
import $t from "react";
|
|
210
|
-
import re from "react";
|
|
211
|
-
var jt = (n3) => {
|
|
212
|
-
switch (n3) {
|
|
213
|
-
case "success":
|
|
214
|
-
return ee;
|
|
215
|
-
case "info":
|
|
216
|
-
return ae;
|
|
217
|
-
case "warning":
|
|
218
|
-
return oe;
|
|
219
|
-
case "error":
|
|
220
|
-
return se;
|
|
221
|
-
default:
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
var te = Array(12).fill(0);
|
|
226
|
-
var Yt = ({ visible: n3, className: e }) => E.createElement("div", { className: ["sonner-loading-wrapper", e].filter(Boolean).join(" "), "data-visible": n3 }, E.createElement("div", { className: "sonner-spinner" }, te.map((t2, a2) => E.createElement("div", { className: "sonner-loading-bar", key: `spinner-bar-${a2}` }))));
|
|
227
|
-
var ee = E.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, E.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }));
|
|
228
|
-
var oe = E.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "20", width: "20" }, E.createElement("path", { fillRule: "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", clipRule: "evenodd" }));
|
|
229
|
-
var ae = E.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, E.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }));
|
|
230
|
-
var se = E.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", height: "20", width: "20" }, E.createElement("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }));
|
|
231
|
-
var Ot = E.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }, E.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), E.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }));
|
|
232
|
-
var Ft = () => {
|
|
233
|
-
let [n3, e] = $t.useState(document.hidden);
|
|
234
|
-
return $t.useEffect(() => {
|
|
235
|
-
let t2 = () => {
|
|
236
|
-
e(document.hidden);
|
|
237
|
-
};
|
|
238
|
-
return document.addEventListener("visibilitychange", t2), () => window.removeEventListener("visibilitychange", t2);
|
|
239
|
-
}, []), n3;
|
|
240
|
-
};
|
|
241
|
-
var bt = 1;
|
|
242
|
-
var yt = class {
|
|
243
|
-
constructor() {
|
|
244
|
-
this.subscribe = (e) => (this.subscribers.push(e), () => {
|
|
245
|
-
let t2 = this.subscribers.indexOf(e);
|
|
246
|
-
this.subscribers.splice(t2, 1);
|
|
247
|
-
});
|
|
248
|
-
this.publish = (e) => {
|
|
249
|
-
this.subscribers.forEach((t2) => t2(e));
|
|
250
|
-
};
|
|
251
|
-
this.addToast = (e) => {
|
|
252
|
-
this.publish(e), this.toasts = [...this.toasts, e];
|
|
253
|
-
};
|
|
254
|
-
this.create = (e) => {
|
|
255
|
-
var S2;
|
|
256
|
-
let { message: t2, ...a2 } = e, u = typeof (e == null ? void 0 : e.id) == "number" || ((S2 = e.id) == null ? void 0 : S2.length) > 0 ? e.id : bt++, f = this.toasts.find((g) => g.id === u), w = e.dismissible === void 0 ? true : e.dismissible;
|
|
257
|
-
return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), f ? this.toasts = this.toasts.map((g) => g.id === u ? (this.publish({ ...g, ...e, id: u, title: t2 }), { ...g, ...e, id: u, dismissible: w, title: t2 }) : g) : this.addToast({ title: t2, ...a2, dismissible: w, id: u }), u;
|
|
258
|
-
};
|
|
259
|
-
this.dismiss = (e) => (this.dismissedToasts.add(e), e || this.toasts.forEach((t2) => {
|
|
260
|
-
this.subscribers.forEach((a2) => a2({ id: t2.id, dismiss: true }));
|
|
261
|
-
}), this.subscribers.forEach((t2) => t2({ id: e, dismiss: true })), e);
|
|
262
|
-
this.message = (e, t2) => this.create({ ...t2, message: e });
|
|
263
|
-
this.error = (e, t2) => this.create({ ...t2, message: e, type: "error" });
|
|
264
|
-
this.success = (e, t2) => this.create({ ...t2, type: "success", message: e });
|
|
265
|
-
this.info = (e, t2) => this.create({ ...t2, type: "info", message: e });
|
|
266
|
-
this.warning = (e, t2) => this.create({ ...t2, type: "warning", message: e });
|
|
267
|
-
this.loading = (e, t2) => this.create({ ...t2, type: "loading", message: e });
|
|
268
|
-
this.promise = (e, t2) => {
|
|
269
|
-
if (!t2) return;
|
|
270
|
-
let a2;
|
|
271
|
-
t2.loading !== void 0 && (a2 = this.create({ ...t2, promise: e, type: "loading", message: t2.loading, description: typeof t2.description != "function" ? t2.description : void 0 }));
|
|
272
|
-
let u = e instanceof Promise ? e : e(), f = a2 !== void 0, w, S2 = u.then(async (i3) => {
|
|
273
|
-
if (w = ["resolve", i3], re.isValidElement(i3)) f = false, this.create({ id: a2, type: "default", message: i3 });
|
|
274
|
-
else if (ie(i3) && !i3.ok) {
|
|
275
|
-
f = false;
|
|
276
|
-
let T = typeof t2.error == "function" ? await t2.error(`HTTP error! status: ${i3.status}`) : t2.error, F = typeof t2.description == "function" ? await t2.description(`HTTP error! status: ${i3.status}`) : t2.description;
|
|
277
|
-
this.create({ id: a2, type: "error", message: T, description: F });
|
|
278
|
-
} else if (t2.success !== void 0) {
|
|
279
|
-
f = false;
|
|
280
|
-
let T = typeof t2.success == "function" ? await t2.success(i3) : t2.success, F = typeof t2.description == "function" ? await t2.description(i3) : t2.description;
|
|
281
|
-
this.create({ id: a2, type: "success", message: T, description: F });
|
|
282
|
-
}
|
|
283
|
-
}).catch(async (i3) => {
|
|
284
|
-
if (w = ["reject", i3], t2.error !== void 0) {
|
|
285
|
-
f = false;
|
|
286
|
-
let D = typeof t2.error == "function" ? await t2.error(i3) : t2.error, T = typeof t2.description == "function" ? await t2.description(i3) : t2.description;
|
|
287
|
-
this.create({ id: a2, type: "error", message: D, description: T });
|
|
288
|
-
}
|
|
289
|
-
}).finally(() => {
|
|
290
|
-
var i3;
|
|
291
|
-
f && (this.dismiss(a2), a2 = void 0), (i3 = t2.finally) == null || i3.call(t2);
|
|
292
|
-
}), g = () => new Promise((i3, D) => S2.then(() => w[0] === "reject" ? D(w[1]) : i3(w[1])).catch(D));
|
|
293
|
-
return typeof a2 != "string" && typeof a2 != "number" ? { unwrap: g } : Object.assign(a2, { unwrap: g });
|
|
294
|
-
};
|
|
295
|
-
this.custom = (e, t2) => {
|
|
296
|
-
let a2 = (t2 == null ? void 0 : t2.id) || bt++;
|
|
297
|
-
return this.create({ jsx: e(a2), id: a2, ...t2 }), a2;
|
|
298
|
-
};
|
|
299
|
-
this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id));
|
|
300
|
-
this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
var v = new yt();
|
|
304
|
-
var ne = (n3, e) => {
|
|
305
|
-
let t2 = (e == null ? void 0 : e.id) || bt++;
|
|
306
|
-
return v.addToast({ title: n3, ...e, id: t2 }), t2;
|
|
307
|
-
};
|
|
308
|
-
var ie = (n3) => n3 && typeof n3 == "object" && "ok" in n3 && typeof n3.ok == "boolean" && "status" in n3 && typeof n3.status == "number";
|
|
309
|
-
var le = ne;
|
|
310
|
-
var ce = () => v.toasts;
|
|
311
|
-
var de = () => v.getActiveToasts();
|
|
312
|
-
var ue = Object.assign(le, { success: v.success, info: v.info, warning: v.warning, error: v.error, custom: v.custom, message: v.message, promise: v.promise, dismiss: v.dismiss, loading: v.loading }, { getHistory: ce, getToasts: de });
|
|
313
|
-
function wt(n3, { insertAt: e } = {}) {
|
|
314
|
-
if (!n3 || typeof document == "undefined") return;
|
|
315
|
-
let t2 = document.head || document.getElementsByTagName("head")[0], a2 = document.createElement("style");
|
|
316
|
-
a2.type = "text/css", e === "top" && t2.firstChild ? t2.insertBefore(a2, t2.firstChild) : t2.appendChild(a2), a2.styleSheet ? a2.styleSheet.cssText = n3 : a2.appendChild(document.createTextNode(n3));
|
|
317
|
-
}
|
|
318
|
-
wt(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
319
|
-
`);
|
|
320
|
-
function tt(n3) {
|
|
321
|
-
return n3.label !== void 0;
|
|
322
|
-
}
|
|
323
|
-
var pe = 3;
|
|
324
|
-
var me = "32px";
|
|
325
|
-
var ge = "16px";
|
|
326
|
-
var Wt = 4e3;
|
|
327
|
-
var he = 356;
|
|
328
|
-
var be = 14;
|
|
329
|
-
var ye = 20;
|
|
330
|
-
var we = 200;
|
|
331
|
-
function M(...n3) {
|
|
332
|
-
return n3.filter(Boolean).join(" ");
|
|
333
|
-
}
|
|
334
|
-
function xe(n3) {
|
|
335
|
-
let [e, t2] = n3.split("-"), a2 = [];
|
|
336
|
-
return e && a2.push(e), t2 && a2.push(t2), a2;
|
|
337
|
-
}
|
|
338
|
-
var ve = (n3) => {
|
|
339
|
-
var Dt, Pt2, Nt2, Bt2, Ct, kt2, It, Mt, Ht, At2, Lt2;
|
|
340
|
-
let { invert: e, toast: t2, unstyled: a2, interacting: u, setHeights: f, visibleToasts: w, heights: S2, index: g, toasts: i3, expanded: D, removeToast: T, defaultRichColors: F, closeButton: et, style: ut, cancelButtonStyle: ft, actionButtonStyle: l, className: ot = "", descriptionClassName: at = "", duration: X, position: st, gap: pt, loadingIcon: rt, expandByDefault: B, classNames: s3, icons: P, closeButtonAriaLabel: nt = "Close toast", pauseWhenPageIsHidden: it } = n3, [Y2, C] = o.useState(null), [lt, J] = o.useState(null), [W, H] = o.useState(false), [A, mt] = o.useState(false), [L, z] = o.useState(false), [ct, d] = o.useState(false), [h, y] = o.useState(false), [R, j] = o.useState(0), [p, _] = o.useState(0), O = o.useRef(t2.duration || X || Wt), G = o.useRef(null), k = o.useRef(null), Vt = g === 0, Ut = g + 1 <= w, N = t2.type, V = t2.dismissible !== false, Kt = t2.className || "", Xt = t2.descriptionClassName || "", dt = o.useMemo(() => S2.findIndex((r3) => r3.toastId === t2.id) || 0, [S2, t2.id]), Jt = o.useMemo(() => {
|
|
341
|
-
var r3;
|
|
342
|
-
return (r3 = t2.closeButton) != null ? r3 : et;
|
|
343
|
-
}, [t2.closeButton, et]), Tt2 = o.useMemo(() => t2.duration || X || Wt, [t2.duration, X]), gt2 = o.useRef(0), U2 = o.useRef(0), St2 = o.useRef(0), K = o.useRef(null), [Gt2, Qt] = st.split("-"), Rt = o.useMemo(() => S2.reduce((r3, m, c) => c >= dt ? r3 : r3 + m.height, 0), [S2, dt]), Et2 = Ft(), qt = t2.invert || e, ht2 = N === "loading";
|
|
344
|
-
U2.current = o.useMemo(() => dt * pt + Rt, [dt, Rt]), o.useEffect(() => {
|
|
345
|
-
O.current = Tt2;
|
|
346
|
-
}, [Tt2]), o.useEffect(() => {
|
|
347
|
-
H(true);
|
|
348
|
-
}, []), o.useEffect(() => {
|
|
349
|
-
let r3 = k.current;
|
|
350
|
-
if (r3) {
|
|
351
|
-
let m = r3.getBoundingClientRect().height;
|
|
352
|
-
return _(m), f((c) => [{ toastId: t2.id, height: m, position: t2.position }, ...c]), () => f((c) => c.filter((b) => b.toastId !== t2.id));
|
|
353
|
-
}
|
|
354
|
-
}, [f, t2.id]), o.useLayoutEffect(() => {
|
|
355
|
-
if (!W) return;
|
|
356
|
-
let r3 = k.current, m = r3.style.height;
|
|
357
|
-
r3.style.height = "auto";
|
|
358
|
-
let c = r3.getBoundingClientRect().height;
|
|
359
|
-
r3.style.height = m, _(c), f((b) => b.find((x) => x.toastId === t2.id) ? b.map((x) => x.toastId === t2.id ? { ...x, height: c } : x) : [{ toastId: t2.id, height: c, position: t2.position }, ...b]);
|
|
360
|
-
}, [W, t2.title, t2.description, f, t2.id]);
|
|
361
|
-
let $2 = o.useCallback(() => {
|
|
362
|
-
mt(true), j(U2.current), f((r3) => r3.filter((m) => m.toastId !== t2.id)), setTimeout(() => {
|
|
363
|
-
T(t2);
|
|
364
|
-
}, we);
|
|
365
|
-
}, [t2, T, f, U2]);
|
|
366
|
-
o.useEffect(() => {
|
|
367
|
-
if (t2.promise && N === "loading" || t2.duration === 1 / 0 || t2.type === "loading") return;
|
|
368
|
-
let r3;
|
|
369
|
-
return D || u || it && Et2 ? (() => {
|
|
370
|
-
if (St2.current < gt2.current) {
|
|
371
|
-
let b = (/* @__PURE__ */ new Date()).getTime() - gt2.current;
|
|
372
|
-
O.current = O.current - b;
|
|
373
|
-
}
|
|
374
|
-
St2.current = (/* @__PURE__ */ new Date()).getTime();
|
|
375
|
-
})() : (() => {
|
|
376
|
-
O.current !== 1 / 0 && (gt2.current = (/* @__PURE__ */ new Date()).getTime(), r3 = setTimeout(() => {
|
|
377
|
-
var b;
|
|
378
|
-
(b = t2.onAutoClose) == null || b.call(t2, t2), $2();
|
|
379
|
-
}, O.current));
|
|
380
|
-
})(), () => clearTimeout(r3);
|
|
381
|
-
}, [D, u, t2, N, it, Et2, $2]), o.useEffect(() => {
|
|
382
|
-
t2.delete && $2();
|
|
383
|
-
}, [$2, t2.delete]);
|
|
384
|
-
function Zt() {
|
|
385
|
-
var r3, m, c;
|
|
386
|
-
return P != null && P.loading ? o.createElement("div", { className: M(s3 == null ? void 0 : s3.loader, (r3 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : r3.loader, "sonner-loader"), "data-visible": N === "loading" }, P.loading) : rt ? o.createElement("div", { className: M(s3 == null ? void 0 : s3.loader, (m = t2 == null ? void 0 : t2.classNames) == null ? void 0 : m.loader, "sonner-loader"), "data-visible": N === "loading" }, rt) : o.createElement(Yt, { className: M(s3 == null ? void 0 : s3.loader, (c = t2 == null ? void 0 : t2.classNames) == null ? void 0 : c.loader), visible: N === "loading" });
|
|
387
|
-
}
|
|
388
|
-
return o.createElement("li", { tabIndex: 0, ref: k, className: M(ot, Kt, s3 == null ? void 0 : s3.toast, (Dt = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Dt.toast, s3 == null ? void 0 : s3.default, s3 == null ? void 0 : s3[N], (Pt2 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Pt2[N]), "data-sonner-toast": "", "data-rich-colors": (Nt2 = t2.richColors) != null ? Nt2 : F, "data-styled": !(t2.jsx || t2.unstyled || a2), "data-mounted": W, "data-promise": !!t2.promise, "data-swiped": h, "data-removed": A, "data-visible": Ut, "data-y-position": Gt2, "data-x-position": Qt, "data-index": g, "data-front": Vt, "data-swiping": L, "data-dismissible": V, "data-type": N, "data-invert": qt, "data-swipe-out": ct, "data-swipe-direction": lt, "data-expanded": !!(D || B && W), style: { "--index": g, "--toasts-before": g, "--z-index": i3.length - g, "--offset": `${A ? R : U2.current}px`, "--initial-height": B ? "auto" : `${p}px`, ...ut, ...t2.style }, onDragEnd: () => {
|
|
389
|
-
z(false), C(null), K.current = null;
|
|
390
|
-
}, onPointerDown: (r3) => {
|
|
391
|
-
ht2 || !V || (G.current = /* @__PURE__ */ new Date(), j(U2.current), r3.target.setPointerCapture(r3.pointerId), r3.target.tagName !== "BUTTON" && (z(true), K.current = { x: r3.clientX, y: r3.clientY }));
|
|
392
|
-
}, onPointerUp: () => {
|
|
393
|
-
var x, Q, q, Z;
|
|
394
|
-
if (ct || !V) return;
|
|
395
|
-
K.current = null;
|
|
396
|
-
let r3 = Number(((x = k.current) == null ? void 0 : x.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), m = Number(((Q = k.current) == null ? void 0 : Q.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), c = (/* @__PURE__ */ new Date()).getTime() - ((q = G.current) == null ? void 0 : q.getTime()), b = Y2 === "x" ? r3 : m, I = Math.abs(b) / c;
|
|
397
|
-
if (Math.abs(b) >= ye || I > 0.11) {
|
|
398
|
-
j(U2.current), (Z = t2.onDismiss) == null || Z.call(t2, t2), J(Y2 === "x" ? r3 > 0 ? "right" : "left" : m > 0 ? "down" : "up"), $2(), d(true), y(false);
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
z(false), C(null);
|
|
402
|
-
}, onPointerMove: (r3) => {
|
|
403
|
-
var Q, q, Z, zt;
|
|
404
|
-
if (!K.current || !V || ((Q = window.getSelection()) == null ? void 0 : Q.toString().length) > 0) return;
|
|
405
|
-
let c = r3.clientY - K.current.y, b = r3.clientX - K.current.x, I = (q = n3.swipeDirections) != null ? q : xe(st);
|
|
406
|
-
!Y2 && (Math.abs(b) > 1 || Math.abs(c) > 1) && C(Math.abs(b) > Math.abs(c) ? "x" : "y");
|
|
407
|
-
let x = { x: 0, y: 0 };
|
|
408
|
-
Y2 === "y" ? (I.includes("top") || I.includes("bottom")) && (I.includes("top") && c < 0 || I.includes("bottom") && c > 0) && (x.y = c) : Y2 === "x" && (I.includes("left") || I.includes("right")) && (I.includes("left") && b < 0 || I.includes("right") && b > 0) && (x.x = b), (Math.abs(x.x) > 0 || Math.abs(x.y) > 0) && y(true), (Z = k.current) == null || Z.style.setProperty("--swipe-amount-x", `${x.x}px`), (zt = k.current) == null || zt.style.setProperty("--swipe-amount-y", `${x.y}px`);
|
|
409
|
-
} }, Jt && !t2.jsx ? o.createElement("button", { "aria-label": nt, "data-disabled": ht2, "data-close-button": true, onClick: ht2 || !V ? () => {
|
|
410
|
-
} : () => {
|
|
411
|
-
var r3;
|
|
412
|
-
$2(), (r3 = t2.onDismiss) == null || r3.call(t2, t2);
|
|
413
|
-
}, className: M(s3 == null ? void 0 : s3.closeButton, (Bt2 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Bt2.closeButton) }, (Ct = P == null ? void 0 : P.close) != null ? Ct : Ot) : null, t2.jsx || xt(t2.title) ? t2.jsx ? t2.jsx : typeof t2.title == "function" ? t2.title() : t2.title : o.createElement(o.Fragment, null, N || t2.icon || t2.promise ? o.createElement("div", { "data-icon": "", className: M(s3 == null ? void 0 : s3.icon, (kt2 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : kt2.icon) }, t2.promise || t2.type === "loading" && !t2.icon ? t2.icon || Zt() : null, t2.type !== "loading" ? t2.icon || (P == null ? void 0 : P[N]) || jt(N) : null) : null, o.createElement("div", { "data-content": "", className: M(s3 == null ? void 0 : s3.content, (It = t2 == null ? void 0 : t2.classNames) == null ? void 0 : It.content) }, o.createElement("div", { "data-title": "", className: M(s3 == null ? void 0 : s3.title, (Mt = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Mt.title) }, typeof t2.title == "function" ? t2.title() : t2.title), t2.description ? o.createElement("div", { "data-description": "", className: M(at, Xt, s3 == null ? void 0 : s3.description, (Ht = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Ht.description) }, typeof t2.description == "function" ? t2.description() : t2.description) : null), xt(t2.cancel) ? t2.cancel : t2.cancel && tt(t2.cancel) ? o.createElement("button", { "data-button": true, "data-cancel": true, style: t2.cancelButtonStyle || ft, onClick: (r3) => {
|
|
414
|
-
var m, c;
|
|
415
|
-
tt(t2.cancel) && V && ((c = (m = t2.cancel).onClick) == null || c.call(m, r3), $2());
|
|
416
|
-
}, className: M(s3 == null ? void 0 : s3.cancelButton, (At2 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : At2.cancelButton) }, t2.cancel.label) : null, xt(t2.action) ? t2.action : t2.action && tt(t2.action) ? o.createElement("button", { "data-button": true, "data-action": true, style: t2.actionButtonStyle || l, onClick: (r3) => {
|
|
417
|
-
var m, c;
|
|
418
|
-
tt(t2.action) && ((c = (m = t2.action).onClick) == null || c.call(m, r3), !r3.defaultPrevented && $2());
|
|
419
|
-
}, className: M(s3 == null ? void 0 : s3.actionButton, (Lt2 = t2 == null ? void 0 : t2.classNames) == null ? void 0 : Lt2.actionButton) }, t2.action.label) : null));
|
|
420
|
-
};
|
|
421
|
-
function _t() {
|
|
422
|
-
if (typeof window == "undefined" || typeof document == "undefined") return "ltr";
|
|
423
|
-
let n3 = document.documentElement.getAttribute("dir");
|
|
424
|
-
return n3 === "auto" || !n3 ? window.getComputedStyle(document.documentElement).direction : n3;
|
|
425
|
-
}
|
|
426
|
-
function Te(n3, e) {
|
|
427
|
-
let t2 = {};
|
|
428
|
-
return [n3, e].forEach((a2, u) => {
|
|
429
|
-
let f = u === 1, w = f ? "--mobile-offset" : "--offset", S2 = f ? ge : me;
|
|
430
|
-
function g(i3) {
|
|
431
|
-
["top", "right", "bottom", "left"].forEach((D) => {
|
|
432
|
-
t2[`${w}-${D}`] = typeof i3 == "number" ? `${i3}px` : i3;
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
typeof a2 == "number" || typeof a2 == "string" ? g(a2) : typeof a2 == "object" ? ["top", "right", "bottom", "left"].forEach((i3) => {
|
|
436
|
-
a2[i3] === void 0 ? t2[`${w}-${i3}`] = S2 : t2[`${w}-${i3}`] = typeof a2[i3] == "number" ? `${a2[i3]}px` : a2[i3];
|
|
437
|
-
}) : g(S2);
|
|
438
|
-
}), t2;
|
|
439
|
-
}
|
|
440
|
-
var $e = fe(function(e, t2) {
|
|
441
|
-
let { invert: a2, position: u = "bottom-right", hotkey: f = ["altKey", "KeyT"], expand: w, closeButton: S2, className: g, offset: i3, mobileOffset: D, theme: T = "light", richColors: F, duration: et, style: ut, visibleToasts: ft = pe, toastOptions: l, dir: ot = _t(), gap: at = be, loadingIcon: X, icons: st, containerAriaLabel: pt = "Notifications", pauseWhenPageIsHidden: rt } = e, [B, s3] = o.useState([]), P = o.useMemo(() => Array.from(new Set([u].concat(B.filter((d) => d.position).map((d) => d.position)))), [B, u]), [nt, it] = o.useState([]), [Y2, C] = o.useState(false), [lt, J] = o.useState(false), [W, H] = o.useState(T !== "system" ? T : typeof window != "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), A = o.useRef(null), mt = f.join("+").replace(/Key/g, "").replace(/Digit/g, ""), L = o.useRef(null), z = o.useRef(false), ct = o.useCallback((d) => {
|
|
442
|
-
s3((h) => {
|
|
443
|
-
var y;
|
|
444
|
-
return (y = h.find((R) => R.id === d.id)) != null && y.delete || v.dismiss(d.id), h.filter(({ id: R }) => R !== d.id);
|
|
445
|
-
});
|
|
446
|
-
}, []);
|
|
447
|
-
return o.useEffect(() => v.subscribe((d) => {
|
|
448
|
-
if (d.dismiss) {
|
|
449
|
-
s3((h) => h.map((y) => y.id === d.id ? { ...y, delete: true } : y));
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
setTimeout(() => {
|
|
453
|
-
vt.flushSync(() => {
|
|
454
|
-
s3((h) => {
|
|
455
|
-
let y = h.findIndex((R) => R.id === d.id);
|
|
456
|
-
return y !== -1 ? [...h.slice(0, y), { ...h[y], ...d }, ...h.slice(y + 1)] : [d, ...h];
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
});
|
|
460
|
-
}), []), o.useEffect(() => {
|
|
461
|
-
if (T !== "system") {
|
|
462
|
-
H(T);
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
if (T === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? H("dark") : H("light")), typeof window == "undefined") return;
|
|
466
|
-
let d = window.matchMedia("(prefers-color-scheme: dark)");
|
|
467
|
-
try {
|
|
468
|
-
d.addEventListener("change", ({ matches: h }) => {
|
|
469
|
-
H(h ? "dark" : "light");
|
|
470
|
-
});
|
|
471
|
-
} catch (h) {
|
|
472
|
-
d.addListener(({ matches: y }) => {
|
|
473
|
-
try {
|
|
474
|
-
H(y ? "dark" : "light");
|
|
475
|
-
} catch (R) {
|
|
476
|
-
console.error(R);
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}, [T]), o.useEffect(() => {
|
|
481
|
-
B.length <= 1 && C(false);
|
|
482
|
-
}, [B]), o.useEffect(() => {
|
|
483
|
-
let d = (h) => {
|
|
484
|
-
var R, j;
|
|
485
|
-
f.every((p) => h[p] || h.code === p) && (C(true), (R = A.current) == null || R.focus()), h.code === "Escape" && (document.activeElement === A.current || (j = A.current) != null && j.contains(document.activeElement)) && C(false);
|
|
486
|
-
};
|
|
487
|
-
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
488
|
-
}, [f]), o.useEffect(() => {
|
|
489
|
-
if (A.current) return () => {
|
|
490
|
-
L.current && (L.current.focus({ preventScroll: true }), L.current = null, z.current = false);
|
|
491
|
-
};
|
|
492
|
-
}, [A.current]), o.createElement("section", { ref: t2, "aria-label": `${pt} ${mt}`, tabIndex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false", suppressHydrationWarning: true }, P.map((d, h) => {
|
|
493
|
-
var j;
|
|
494
|
-
let [y, R] = d.split("-");
|
|
495
|
-
return B.length ? o.createElement("ol", { key: d, dir: ot === "auto" ? _t() : ot, tabIndex: -1, ref: A, className: g, "data-sonner-toaster": true, "data-theme": W, "data-y-position": y, "data-lifted": Y2 && B.length > 1 && !w, "data-x-position": R, style: { "--front-toast-height": `${((j = nt[0]) == null ? void 0 : j.height) || 0}px`, "--width": `${he}px`, "--gap": `${at}px`, ...ut, ...Te(i3, D) }, onBlur: (p) => {
|
|
496
|
-
z.current && !p.currentTarget.contains(p.relatedTarget) && (z.current = false, L.current && (L.current.focus({ preventScroll: true }), L.current = null));
|
|
497
|
-
}, onFocus: (p) => {
|
|
498
|
-
p.target instanceof HTMLElement && p.target.dataset.dismissible === "false" || z.current || (z.current = true, L.current = p.relatedTarget);
|
|
499
|
-
}, onMouseEnter: () => C(true), onMouseMove: () => C(true), onMouseLeave: () => {
|
|
500
|
-
lt || C(false);
|
|
501
|
-
}, onDragEnd: () => C(false), onPointerDown: (p) => {
|
|
502
|
-
p.target instanceof HTMLElement && p.target.dataset.dismissible === "false" || J(true);
|
|
503
|
-
}, onPointerUp: () => J(false) }, B.filter((p) => !p.position && h === 0 || p.position === d).map((p, _) => {
|
|
504
|
-
var O, G;
|
|
505
|
-
return o.createElement(ve, { key: p.id, icons: st, index: _, toast: p, defaultRichColors: F, duration: (O = l == null ? void 0 : l.duration) != null ? O : et, className: l == null ? void 0 : l.className, descriptionClassName: l == null ? void 0 : l.descriptionClassName, invert: a2, visibleToasts: ft, closeButton: (G = l == null ? void 0 : l.closeButton) != null ? G : S2, interacting: lt, position: d, style: l == null ? void 0 : l.style, unstyled: l == null ? void 0 : l.unstyled, classNames: l == null ? void 0 : l.classNames, cancelButtonStyle: l == null ? void 0 : l.cancelButtonStyle, actionButtonStyle: l == null ? void 0 : l.actionButtonStyle, removeToast: ct, toasts: B.filter((k) => k.position == p.position), heights: nt.filter((k) => k.position == p.position), setHeights: it, expandByDefault: w, gap: at, loadingIcon: X, expanded: Y2, pauseWhenPageIsHidden: rt, swipeDirections: e.swipeDirections });
|
|
506
|
-
})) : null;
|
|
507
|
-
}));
|
|
508
|
-
});
|
|
509
|
-
|
|
510
205
|
// src/stubs/captcha.ts
|
|
511
206
|
var GoogleReCaptchaProvider = ({ children }) => children;
|
|
512
207
|
var useGoogleReCaptcha = () => ({ executeRecaptcha: null });
|
|
@@ -728,13 +423,13 @@ function r(e) {
|
|
|
728
423
|
var t2, f, n3 = "";
|
|
729
424
|
if ("string" == typeof e || "number" == typeof e) n3 += e;
|
|
730
425
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
731
|
-
var
|
|
732
|
-
for (t2 = 0; t2 <
|
|
426
|
+
var o2 = e.length;
|
|
427
|
+
for (t2 = 0; t2 < o2; t2++) e[t2] && (f = r(e[t2])) && (n3 && (n3 += " "), n3 += f);
|
|
733
428
|
} else for (f in e) e[f] && (n3 && (n3 += " "), n3 += f);
|
|
734
429
|
return n3;
|
|
735
430
|
}
|
|
736
431
|
function clsx() {
|
|
737
|
-
for (var e, t2, f = 0, n3 = "",
|
|
432
|
+
for (var e, t2, f = 0, n3 = "", o2 = arguments.length; f < o2; f++) (e = arguments[f]) && (t2 = r(e)) && (n3 && (n3 += " "), n3 += t2);
|
|
738
433
|
return n3;
|
|
739
434
|
}
|
|
740
435
|
|
|
@@ -6384,29 +6079,29 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
6384
6079
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
6385
6080
|
const fn = ctx.data;
|
|
6386
6081
|
if (this._def.returns instanceof ZodPromise) {
|
|
6387
|
-
const
|
|
6082
|
+
const me = this;
|
|
6388
6083
|
return OK(async function(...args) {
|
|
6389
6084
|
const error = new ZodError([]);
|
|
6390
|
-
const parsedArgs = await
|
|
6085
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
6391
6086
|
error.addIssue(makeArgsIssue(args, e));
|
|
6392
6087
|
throw error;
|
|
6393
6088
|
});
|
|
6394
6089
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
6395
|
-
const parsedReturns = await
|
|
6090
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
6396
6091
|
error.addIssue(makeReturnsIssue(result, e));
|
|
6397
6092
|
throw error;
|
|
6398
6093
|
});
|
|
6399
6094
|
return parsedReturns;
|
|
6400
6095
|
});
|
|
6401
6096
|
} else {
|
|
6402
|
-
const
|
|
6097
|
+
const me = this;
|
|
6403
6098
|
return OK(function(...args) {
|
|
6404
|
-
const parsedArgs =
|
|
6099
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
6405
6100
|
if (!parsedArgs.success) {
|
|
6406
6101
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
6407
6102
|
}
|
|
6408
6103
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
6409
|
-
const parsedReturns =
|
|
6104
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
6410
6105
|
if (!parsedReturns.success) {
|
|
6411
6106
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
6412
6107
|
}
|
|
@@ -8112,12 +7807,7 @@ var defaultNavigate = (href) => {
|
|
|
8112
7807
|
var defaultReplace = (href) => {
|
|
8113
7808
|
window.location.replace(href);
|
|
8114
7809
|
};
|
|
8115
|
-
var defaultToast = (
|
|
8116
|
-
if (variant === "default") {
|
|
8117
|
-
ue(message);
|
|
8118
|
-
} else {
|
|
8119
|
-
ue[variant](message);
|
|
8120
|
-
}
|
|
7810
|
+
var defaultToast = () => {
|
|
8121
7811
|
};
|
|
8122
7812
|
var AuthUIContext = createContext(
|
|
8123
7813
|
{}
|
|
@@ -8905,7 +8595,7 @@ var createSubject = () => {
|
|
|
8905
8595
|
_observers.push(observer);
|
|
8906
8596
|
return {
|
|
8907
8597
|
unsubscribe: () => {
|
|
8908
|
-
_observers = _observers.filter((
|
|
8598
|
+
_observers = _observers.filter((o2) => o2 !== observer);
|
|
8909
8599
|
}
|
|
8910
8600
|
};
|
|
8911
8601
|
};
|
|
@@ -10314,27 +10004,27 @@ function useForm(props = {}) {
|
|
|
10314
10004
|
}
|
|
10315
10005
|
|
|
10316
10006
|
// ../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.66.1_react@19.0.0_/node_modules/@hookform/resolvers/dist/resolvers.mjs
|
|
10317
|
-
var r2 = (t2, r3,
|
|
10007
|
+
var r2 = (t2, r3, o2) => {
|
|
10318
10008
|
if (t2 && "reportValidity" in t2) {
|
|
10319
|
-
const s3 = get(
|
|
10009
|
+
const s3 = get(o2, r3);
|
|
10320
10010
|
t2.setCustomValidity(s3 && s3.message || ""), t2.reportValidity();
|
|
10321
10011
|
}
|
|
10322
10012
|
};
|
|
10323
|
-
var
|
|
10324
|
-
for (const
|
|
10325
|
-
const s3 = t2.fields[
|
|
10326
|
-
s3 && s3.ref && "reportValidity" in s3.ref ? r2(s3.ref,
|
|
10013
|
+
var o = (e, t2) => {
|
|
10014
|
+
for (const o2 in t2.fields) {
|
|
10015
|
+
const s3 = t2.fields[o2];
|
|
10016
|
+
s3 && s3.ref && "reportValidity" in s3.ref ? r2(s3.ref, o2, e) : s3 && s3.refs && s3.refs.forEach((t3) => r2(t3, o2, e));
|
|
10327
10017
|
}
|
|
10328
10018
|
};
|
|
10329
10019
|
var s = (r3, s3) => {
|
|
10330
|
-
s3.shouldUseNativeValidation &&
|
|
10020
|
+
s3.shouldUseNativeValidation && o(r3, s3);
|
|
10331
10021
|
const n3 = {};
|
|
10332
|
-
for (const
|
|
10333
|
-
const f = get(s3.fields,
|
|
10334
|
-
if (i(s3.names || Object.keys(r3),
|
|
10335
|
-
const r4 = Object.assign({}, get(n3,
|
|
10336
|
-
set(r4, "root", c), set(n3,
|
|
10337
|
-
} else set(n3,
|
|
10022
|
+
for (const o2 in r3) {
|
|
10023
|
+
const f = get(s3.fields, o2), c = Object.assign(r3[o2] || {}, { ref: f && f.ref });
|
|
10024
|
+
if (i(s3.names || Object.keys(r3), o2)) {
|
|
10025
|
+
const r4 = Object.assign({}, get(n3, o2));
|
|
10026
|
+
set(r4, "root", c), set(n3, o2, r4);
|
|
10027
|
+
} else set(n3, o2, c);
|
|
10338
10028
|
}
|
|
10339
10029
|
return n3;
|
|
10340
10030
|
};
|
|
@@ -10524,11 +10214,11 @@ var $input = Symbol("ZodInput");
|
|
|
10524
10214
|
// ../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.66.1_react@19.0.0_/node_modules/@hookform/resolvers/zod/dist/zod.mjs
|
|
10525
10215
|
function t(r3, e) {
|
|
10526
10216
|
try {
|
|
10527
|
-
var
|
|
10217
|
+
var o2 = r3();
|
|
10528
10218
|
} catch (r4) {
|
|
10529
10219
|
return e(r4);
|
|
10530
10220
|
}
|
|
10531
|
-
return
|
|
10221
|
+
return o2 && o2.then ? o2.then(void 0, e) : o2;
|
|
10532
10222
|
}
|
|
10533
10223
|
function s2(r3, e) {
|
|
10534
10224
|
for (var n3 = {}; r3.length; ) {
|
|
@@ -10568,14 +10258,14 @@ function i2(r3, e) {
|
|
|
10568
10258
|
}
|
|
10569
10259
|
return n3;
|
|
10570
10260
|
}
|
|
10571
|
-
function a(
|
|
10261
|
+
function a(o2, a2, u) {
|
|
10572
10262
|
if (void 0 === u && (u = {}), (function(r3) {
|
|
10573
10263
|
return "_def" in r3 && "object" == typeof r3._def && "typeName" in r3._def;
|
|
10574
|
-
})(
|
|
10264
|
+
})(o2)) return function(n3, i3, c) {
|
|
10575
10265
|
try {
|
|
10576
10266
|
return Promise.resolve(t(function() {
|
|
10577
|
-
return Promise.resolve(
|
|
10578
|
-
return c.shouldUseNativeValidation &&
|
|
10267
|
+
return Promise.resolve(o2["sync" === u.mode ? "parse" : "parseAsync"](n3, a2)).then(function(e) {
|
|
10268
|
+
return c.shouldUseNativeValidation && o({}, c), { errors: {}, values: u.raw ? Object.assign({}, n3) : e };
|
|
10579
10269
|
});
|
|
10580
10270
|
}, function(r3) {
|
|
10581
10271
|
if ((function(r4) {
|
|
@@ -10589,11 +10279,11 @@ function a(o3, a2, u) {
|
|
|
10589
10279
|
};
|
|
10590
10280
|
if ((function(r3) {
|
|
10591
10281
|
return "_zod" in r3 && "object" == typeof r3._zod;
|
|
10592
|
-
})(
|
|
10282
|
+
})(o2)) return function(s3, c, f) {
|
|
10593
10283
|
try {
|
|
10594
10284
|
return Promise.resolve(t(function() {
|
|
10595
|
-
return Promise.resolve(("sync" === u.mode ? parse : parseAsync)(
|
|
10596
|
-
return f.shouldUseNativeValidation &&
|
|
10285
|
+
return Promise.resolve(("sync" === u.mode ? parse : parseAsync)(o2, s3, a2)).then(function(e) {
|
|
10286
|
+
return f.shouldUseNativeValidation && o({}, f), { errors: {}, values: u.raw ? Object.assign({}, s3) : e };
|
|
10597
10287
|
});
|
|
10598
10288
|
}, function(r3) {
|
|
10599
10289
|
if ((function(r4) {
|
|
@@ -11118,13 +10808,13 @@ var kt = Object.getOwnPropertyDescriptors;
|
|
|
11118
10808
|
var Y = Object.getOwnPropertySymbols;
|
|
11119
10809
|
var gt = Object.prototype.hasOwnProperty;
|
|
11120
10810
|
var Et = Object.prototype.propertyIsEnumerable;
|
|
11121
|
-
var
|
|
10811
|
+
var vt = (r3, s3, e) => s3 in r3 ? Bt(r3, s3, { enumerable: true, configurable: true, writable: true, value: e }) : r3[s3] = e;
|
|
11122
10812
|
var St = (r3, s3) => {
|
|
11123
|
-
for (var e in s3 || (s3 = {})) gt.call(s3, e) &&
|
|
11124
|
-
if (Y) for (var e of Y(s3)) Et.call(s3, e) &&
|
|
10813
|
+
for (var e in s3 || (s3 = {})) gt.call(s3, e) && vt(r3, e, s3[e]);
|
|
10814
|
+
if (Y) for (var e of Y(s3)) Et.call(s3, e) && vt(r3, e, s3[e]);
|
|
11125
10815
|
return r3;
|
|
11126
10816
|
};
|
|
11127
|
-
var
|
|
10817
|
+
var bt = (r3, s3) => At(r3, kt(s3));
|
|
11128
10818
|
var Pt = (r3, s3) => {
|
|
11129
10819
|
var e = {};
|
|
11130
10820
|
for (var u in r3) gt.call(r3, u) && s3.indexOf(u) < 0 && (e[u] = r3[u]);
|
|
@@ -11135,29 +10825,29 @@ function ht(r3) {
|
|
|
11135
10825
|
let s3 = setTimeout(r3, 0), e = setTimeout(r3, 10), u = setTimeout(r3, 50);
|
|
11136
10826
|
return [s3, e, u];
|
|
11137
10827
|
}
|
|
11138
|
-
function
|
|
10828
|
+
function _t(r3) {
|
|
11139
10829
|
let s3 = U.useRef();
|
|
11140
10830
|
return U.useEffect(() => {
|
|
11141
10831
|
s3.current = r3;
|
|
11142
10832
|
}), s3.current;
|
|
11143
10833
|
}
|
|
11144
|
-
var
|
|
11145
|
-
var
|
|
11146
|
-
var Gt = `${
|
|
11147
|
-
var
|
|
10834
|
+
var Ot = 18;
|
|
10835
|
+
var wt = 40;
|
|
10836
|
+
var Gt = `${wt}px`;
|
|
10837
|
+
var xt = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
|
|
11148
10838
|
function Tt({ containerRef: r3, inputRef: s3, pushPasswordManagerStrategy: e, isFocused: u }) {
|
|
11149
10839
|
let [P, D] = S.useState(false), [G, H] = S.useState(false), [F, W] = S.useState(false), Z = S.useMemo(() => e === "none" ? false : (e === "increase-width" || e === "experimental-no-flickering") && P && G, [P, G, e]), T = S.useCallback(() => {
|
|
11150
10840
|
let f = r3.current, h = s3.current;
|
|
11151
10841
|
if (!f || !h || F || e === "none") return;
|
|
11152
|
-
let a2 = f, B = a2.getBoundingClientRect().left + a2.offsetWidth, A = a2.getBoundingClientRect().top + a2.offsetHeight / 2, z = B -
|
|
11153
|
-
document.querySelectorAll(
|
|
10842
|
+
let a2 = f, B = a2.getBoundingClientRect().left + a2.offsetWidth, A = a2.getBoundingClientRect().top + a2.offsetHeight / 2, z = B - Ot, q = A;
|
|
10843
|
+
document.querySelectorAll(xt).length === 0 && document.elementFromPoint(z, q) === f || (D(true), W(true));
|
|
11154
10844
|
}, [r3, s3, F, e]);
|
|
11155
10845
|
return S.useEffect(() => {
|
|
11156
10846
|
let f = r3.current;
|
|
11157
10847
|
if (!f || e === "none") return;
|
|
11158
10848
|
function h() {
|
|
11159
10849
|
let A = window.innerWidth - f.getBoundingClientRect().right;
|
|
11160
|
-
H(A >=
|
|
10850
|
+
H(A >= wt);
|
|
11161
10851
|
}
|
|
11162
10852
|
h();
|
|
11163
10853
|
let a2 = setInterval(h, 1e3);
|
|
@@ -11175,43 +10865,43 @@ function Tt({ containerRef: r3, inputRef: s3, pushPasswordManagerStrategy: e, is
|
|
|
11175
10865
|
};
|
|
11176
10866
|
}, [s3, u, e, T]), { hasPWMBadge: P, willPushPWMBadge: Z, PWM_BADGE_SPACE_WIDTH: Gt };
|
|
11177
10867
|
}
|
|
11178
|
-
var
|
|
10868
|
+
var jt = n2.createContext({});
|
|
11179
10869
|
var Lt = n2.forwardRef((A, B) => {
|
|
11180
10870
|
var z = A, { value: r3, onChange: s3, maxLength: e, textAlign: u = "left", pattern: P, placeholder: D, inputMode: G = "numeric", onComplete: H, pushPasswordManagerStrategy: F = "increase-width", pasteTransformer: W, containerClassName: Z, noScriptCSSFallback: T = Nt, render: f, children: h } = z, a2 = Pt(z, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]);
|
|
11181
10871
|
var X, lt, ut, dt, ft;
|
|
11182
|
-
let [q, nt] = n2.useState(typeof a2.defaultValue == "string" ? a2.defaultValue : ""), i3 = r3 != null ? r3 : q, I =
|
|
10872
|
+
let [q, nt] = n2.useState(typeof a2.defaultValue == "string" ? a2.defaultValue : ""), i3 = r3 != null ? r3 : q, I = _t(i3), x = n2.useCallback((t2) => {
|
|
11183
10873
|
s3 == null || s3(t2), nt(t2);
|
|
11184
10874
|
}, [s3]), m = n2.useMemo(() => P ? typeof P == "string" ? new RegExp(P) : P : null, [P]), l = n2.useRef(null), K = n2.useRef(null), J = n2.useRef({ value: i3, onChange: x, isIOS: typeof window != "undefined" && ((lt = (X = window == null ? void 0 : window.CSS) == null ? void 0 : X.supports) == null ? void 0 : lt.call(X, "-webkit-touch-callout", "none")) }), V = n2.useRef({ prev: [(ut = l.current) == null ? void 0 : ut.selectionStart, (dt = l.current) == null ? void 0 : dt.selectionEnd, (ft = l.current) == null ? void 0 : ft.selectionDirection] });
|
|
11185
10875
|
n2.useImperativeHandle(B, () => l.current, []), n2.useEffect(() => {
|
|
11186
|
-
let t2 = l.current,
|
|
11187
|
-
if (!t2 || !
|
|
10876
|
+
let t2 = l.current, o2 = K.current;
|
|
10877
|
+
if (!t2 || !o2) return;
|
|
11188
10878
|
J.current.value !== t2.value && J.current.onChange(t2.value), V.current.prev = [t2.selectionStart, t2.selectionEnd, t2.selectionDirection];
|
|
11189
10879
|
function d() {
|
|
11190
10880
|
if (document.activeElement !== t2) {
|
|
11191
10881
|
L(null), N(null);
|
|
11192
10882
|
return;
|
|
11193
10883
|
}
|
|
11194
|
-
let c = t2.selectionStart, b = t2.selectionEnd, mt = t2.selectionDirection,
|
|
10884
|
+
let c = t2.selectionStart, b = t2.selectionEnd, mt = t2.selectionDirection, v = t2.maxLength, C = t2.value, _ = V.current.prev, g = -1, E = -1, w;
|
|
11195
10885
|
if (C.length !== 0 && c !== null && b !== null) {
|
|
11196
|
-
let Dt = c === b, Ht = c === C.length && C.length <
|
|
10886
|
+
let Dt = c === b, Ht = c === C.length && C.length < v;
|
|
11197
10887
|
if (Dt && !Ht) {
|
|
11198
10888
|
let y = c;
|
|
11199
|
-
if (y === 0) g = 0,
|
|
11200
|
-
else if (y ===
|
|
11201
|
-
else if (
|
|
10889
|
+
if (y === 0) g = 0, E = 1, w = "forward";
|
|
10890
|
+
else if (y === v) g = y - 1, E = y, w = "backward";
|
|
10891
|
+
else if (v > 1 && C.length > 1) {
|
|
11202
10892
|
let et = 0;
|
|
11203
10893
|
if (_[0] !== null && _[1] !== null) {
|
|
11204
10894
|
w = y < _[1] ? "backward" : "forward";
|
|
11205
|
-
let
|
|
11206
|
-
w === "backward" && !
|
|
10895
|
+
let Wt = _[0] === _[1] && _[0] < v;
|
|
10896
|
+
w === "backward" && !Wt && (et = -1);
|
|
11207
10897
|
}
|
|
11208
|
-
g = et + y,
|
|
10898
|
+
g = et + y, E = et + y + 1;
|
|
11209
10899
|
}
|
|
11210
10900
|
}
|
|
11211
|
-
g !== -1 &&
|
|
10901
|
+
g !== -1 && E !== -1 && g !== E && l.current.setSelectionRange(g, E, w);
|
|
11212
10902
|
}
|
|
11213
|
-
let pt = g !== -1 ? g : c, Rt =
|
|
11214
|
-
L(pt), N(Rt), V.current.prev = [pt, Rt,
|
|
10903
|
+
let pt = g !== -1 ? g : c, Rt = E !== -1 ? E : b, yt = w != null ? w : mt;
|
|
10904
|
+
L(pt), N(Rt), V.current.prev = [pt, Rt, yt];
|
|
11215
10905
|
}
|
|
11216
10906
|
if (document.addEventListener("selectionchange", d, { capture: true }), d(), document.activeElement === t2 && Q(true), !document.getElementById("input-otp-style")) {
|
|
11217
10907
|
let c = document.createElement("style");
|
|
@@ -11221,7 +10911,7 @@ var Lt = n2.forwardRef((A, B) => {
|
|
|
11221
10911
|
}
|
|
11222
10912
|
}
|
|
11223
10913
|
let R = () => {
|
|
11224
|
-
|
|
10914
|
+
o2 && o2.style.setProperty("--root-height", `${t2.clientHeight}px`);
|
|
11225
10915
|
};
|
|
11226
10916
|
R();
|
|
11227
10917
|
let p = new ResizeObserver(R);
|
|
@@ -11229,62 +10919,62 @@ var Lt = n2.forwardRef((A, B) => {
|
|
|
11229
10919
|
document.removeEventListener("selectionchange", d, { capture: true }), p.disconnect();
|
|
11230
10920
|
};
|
|
11231
10921
|
}, []);
|
|
11232
|
-
let [ot, rt] = n2.useState(false), [j, Q] = n2.useState(false), [
|
|
10922
|
+
let [ot, rt] = n2.useState(false), [j, Q] = n2.useState(false), [M, L] = n2.useState(null), [k, N] = n2.useState(null);
|
|
11233
10923
|
n2.useEffect(() => {
|
|
11234
10924
|
ht(() => {
|
|
11235
10925
|
var R, p, c, b;
|
|
11236
10926
|
(R = l.current) == null || R.dispatchEvent(new Event("input"));
|
|
11237
|
-
let t2 = (p = l.current) == null ? void 0 : p.selectionStart,
|
|
11238
|
-
t2 !== null &&
|
|
10927
|
+
let t2 = (p = l.current) == null ? void 0 : p.selectionStart, o2 = (c = l.current) == null ? void 0 : c.selectionEnd, d = (b = l.current) == null ? void 0 : b.selectionDirection;
|
|
10928
|
+
t2 !== null && o2 !== null && (L(t2), N(o2), V.current.prev = [t2, o2, d]);
|
|
11239
10929
|
});
|
|
11240
10930
|
}, [i3, j]), n2.useEffect(() => {
|
|
11241
10931
|
I !== void 0 && i3 !== I && I.length < e && i3.length === e && (H == null || H(i3));
|
|
11242
10932
|
}, [e, H, I, i3]);
|
|
11243
10933
|
let O = Tt({ containerRef: K, inputRef: l, pushPasswordManagerStrategy: F, isFocused: j }), st = n2.useCallback((t2) => {
|
|
11244
|
-
let
|
|
11245
|
-
if (
|
|
10934
|
+
let o2 = t2.currentTarget.value.slice(0, e);
|
|
10935
|
+
if (o2.length > 0 && m && !m.test(o2)) {
|
|
11246
10936
|
t2.preventDefault();
|
|
11247
10937
|
return;
|
|
11248
10938
|
}
|
|
11249
|
-
typeof I == "string" &&
|
|
10939
|
+
typeof I == "string" && o2.length < I.length && document.dispatchEvent(new Event("selectionchange")), x(o2);
|
|
11250
10940
|
}, [e, x, I, m]), at = n2.useCallback(() => {
|
|
11251
10941
|
var t2;
|
|
11252
10942
|
if (l.current) {
|
|
11253
|
-
let
|
|
11254
|
-
(t2 = l.current) == null || t2.setSelectionRange(
|
|
10943
|
+
let o2 = Math.min(l.current.value.length, e - 1), d = l.current.value.length;
|
|
10944
|
+
(t2 = l.current) == null || t2.setSelectionRange(o2, d), L(o2), N(d);
|
|
11255
10945
|
}
|
|
11256
10946
|
Q(true);
|
|
11257
10947
|
}, [e]), ct = n2.useCallback((t2) => {
|
|
11258
|
-
var g,
|
|
11259
|
-
let
|
|
11260
|
-
if (!W && (!J.current.isIOS || !t2.clipboardData || !
|
|
10948
|
+
var g, E;
|
|
10949
|
+
let o2 = l.current;
|
|
10950
|
+
if (!W && (!J.current.isIOS || !t2.clipboardData || !o2)) return;
|
|
11261
10951
|
let d = t2.clipboardData.getData("text/plain"), R = W ? W(d) : d;
|
|
11262
10952
|
t2.preventDefault();
|
|
11263
|
-
let p = (g = l.current) == null ? void 0 : g.selectionStart, c = (
|
|
11264
|
-
if (
|
|
11265
|
-
|
|
11266
|
-
let C = Math.min(
|
|
11267
|
-
|
|
11268
|
-
}, [e, x, m, i3]), It = n2.useMemo(() => ({ position: "relative", cursor: a2.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [a2.disabled]), it = n2.useMemo(() => ({ position: "absolute", inset: 0, width: O.willPushPWMBadge ? `calc(100% + ${O.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: O.willPushPWMBadge ? `inset(0 ${O.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: u, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [O.PWM_BADGE_SPACE_WIDTH, O.willPushPWMBadge, u]), Mt = n2.useMemo(() => n2.createElement("input",
|
|
11269
|
-
var
|
|
11270
|
-
ct(t2), (
|
|
10953
|
+
let p = (g = l.current) == null ? void 0 : g.selectionStart, c = (E = l.current) == null ? void 0 : E.selectionEnd, v = (p !== c ? i3.slice(0, p) + R + i3.slice(c) : i3.slice(0, p) + R + i3.slice(p)).slice(0, e);
|
|
10954
|
+
if (v.length > 0 && m && !m.test(v)) return;
|
|
10955
|
+
o2.value = v, x(v);
|
|
10956
|
+
let C = Math.min(v.length, e - 1), _ = v.length;
|
|
10957
|
+
o2.setSelectionRange(C, _), L(C), N(_);
|
|
10958
|
+
}, [e, x, m, i3]), It = n2.useMemo(() => ({ position: "relative", cursor: a2.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [a2.disabled]), it = n2.useMemo(() => ({ position: "absolute", inset: 0, width: O.willPushPWMBadge ? `calc(100% + ${O.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: O.willPushPWMBadge ? `inset(0 ${O.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: u, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [O.PWM_BADGE_SPACE_WIDTH, O.willPushPWMBadge, u]), Mt = n2.useMemo(() => n2.createElement("input", bt(St({ autoComplete: a2.autoComplete || "one-time-code" }, a2), { "data-input-otp": true, "data-input-otp-placeholder-shown": i3.length === 0 || void 0, "data-input-otp-mss": M, "data-input-otp-mse": k, inputMode: G, pattern: m == null ? void 0 : m.source, "aria-placeholder": D, style: it, maxLength: e, value: i3, ref: l, onPaste: (t2) => {
|
|
10959
|
+
var o2;
|
|
10960
|
+
ct(t2), (o2 = a2.onPaste) == null || o2.call(a2, t2);
|
|
11271
10961
|
}, onChange: st, onMouseOver: (t2) => {
|
|
11272
|
-
var
|
|
11273
|
-
rt(true), (
|
|
10962
|
+
var o2;
|
|
10963
|
+
rt(true), (o2 = a2.onMouseOver) == null || o2.call(a2, t2);
|
|
11274
10964
|
}, onMouseLeave: (t2) => {
|
|
11275
|
-
var
|
|
11276
|
-
rt(false), (
|
|
10965
|
+
var o2;
|
|
10966
|
+
rt(false), (o2 = a2.onMouseLeave) == null || o2.call(a2, t2);
|
|
11277
10967
|
}, onFocus: (t2) => {
|
|
11278
|
-
var
|
|
11279
|
-
at(), (
|
|
10968
|
+
var o2;
|
|
10969
|
+
at(), (o2 = a2.onFocus) == null || o2.call(a2, t2);
|
|
11280
10970
|
}, onBlur: (t2) => {
|
|
11281
|
-
var
|
|
11282
|
-
Q(false), (
|
|
11283
|
-
} })), [st, at, ct, G, it, e, k,
|
|
10971
|
+
var o2;
|
|
10972
|
+
Q(false), (o2 = a2.onBlur) == null || o2.call(a2, t2);
|
|
10973
|
+
} })), [st, at, ct, G, it, e, k, M, a2, m == null ? void 0 : m.source, i3]), tt = n2.useMemo(() => ({ slots: Array.from({ length: e }).map((t2, o2) => {
|
|
11284
10974
|
var c;
|
|
11285
|
-
let d = j &&
|
|
10975
|
+
let d = j && M !== null && k !== null && (M === k && o2 === M || o2 >= M && o2 < k), R = i3[o2] !== void 0 ? i3[o2] : null, p = i3[0] !== void 0 ? null : (c = D == null ? void 0 : D[o2]) != null ? c : null;
|
|
11286
10976
|
return { char: R, placeholderChar: p, isActive: d, hasFakeCaret: d && R === null };
|
|
11287
|
-
}), isFocused: j, isHovering: !a2.disabled && ot }), [j, ot, e, k,
|
|
10977
|
+
}), isFocused: j, isHovering: !a2.disabled && ot }), [j, ot, e, k, M, a2.disabled, i3]), Ct = n2.useMemo(() => f ? f(tt) : n2.createElement(jt.Provider, { value: tt }, h), [h, tt, f]);
|
|
11288
10978
|
return n2.createElement(n2.Fragment, null, T !== null && n2.createElement("noscript", null, n2.createElement("style", null, T)), n2.createElement("div", { ref: K, "data-input-otp-container": true, style: It, className: Z }, Ct, n2.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Mt)));
|
|
11289
10979
|
});
|
|
11290
10980
|
Lt.displayName = "Input";
|
|
@@ -11351,7 +11041,7 @@ function InputOTPSlot({
|
|
|
11351
11041
|
className,
|
|
11352
11042
|
...props
|
|
11353
11043
|
}) {
|
|
11354
|
-
const inputOTPContext = React4.useContext(
|
|
11044
|
+
const inputOTPContext = React4.useContext(jt);
|
|
11355
11045
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
11356
11046
|
return /* @__PURE__ */ jsxs5(
|
|
11357
11047
|
"div",
|
|
@@ -12582,13 +12272,15 @@ function SignInForm({
|
|
|
12582
12272
|
} catch (error) {
|
|
12583
12273
|
form.resetField("password");
|
|
12584
12274
|
resetCaptcha();
|
|
12275
|
+
const errorMessage = getLocalizedError({
|
|
12276
|
+
error,
|
|
12277
|
+
localization,
|
|
12278
|
+
localizeErrors
|
|
12279
|
+
});
|
|
12280
|
+
form.setError("root", { message: errorMessage });
|
|
12585
12281
|
toast({
|
|
12586
12282
|
variant: "error",
|
|
12587
|
-
message:
|
|
12588
|
-
error,
|
|
12589
|
-
localization,
|
|
12590
|
-
localizeErrors
|
|
12591
|
-
})
|
|
12283
|
+
message: errorMessage
|
|
12592
12284
|
});
|
|
12593
12285
|
if (emailVerification?.otp && error?.error?.code === "EMAIL_NOT_VERIFIED") {
|
|
12594
12286
|
navigate(
|
|
@@ -12686,6 +12378,7 @@ function SignInForm({
|
|
|
12686
12378
|
action: "/sign-in/email"
|
|
12687
12379
|
}
|
|
12688
12380
|
),
|
|
12381
|
+
form.formState.errors.root && /* @__PURE__ */ jsx21("div", { className: "rounded-md bg-destructive/10 p-3 text-sm text-destructive", children: form.formState.errors.root.message }),
|
|
12689
12382
|
/* @__PURE__ */ jsx21(
|
|
12690
12383
|
Button,
|
|
12691
12384
|
{
|
|
@@ -13159,13 +12852,15 @@ function SignUpForm({
|
|
|
13159
12852
|
});
|
|
13160
12853
|
}
|
|
13161
12854
|
} catch (error) {
|
|
12855
|
+
const errorMessage = getLocalizedError({
|
|
12856
|
+
error,
|
|
12857
|
+
localization,
|
|
12858
|
+
localizeErrors
|
|
12859
|
+
});
|
|
12860
|
+
form.setError("root", { message: errorMessage });
|
|
13162
12861
|
toast({
|
|
13163
12862
|
variant: "error",
|
|
13164
|
-
message:
|
|
13165
|
-
error,
|
|
13166
|
-
localization,
|
|
13167
|
-
localizeErrors
|
|
13168
|
-
})
|
|
12863
|
+
message: errorMessage
|
|
13169
12864
|
});
|
|
13170
12865
|
form.resetField("password");
|
|
13171
12866
|
form.resetField("confirmPassword");
|
|
@@ -13477,6 +13172,7 @@ function SignUpForm({
|
|
|
13477
13172
|
action: "/sign-up/email"
|
|
13478
13173
|
}
|
|
13479
13174
|
),
|
|
13175
|
+
form.formState.errors.root && /* @__PURE__ */ jsx25("div", { className: "rounded-md bg-destructive/10 p-3 text-sm text-destructive", children: form.formState.errors.root.message }),
|
|
13480
13176
|
/* @__PURE__ */ jsx25(
|
|
13481
13177
|
Button,
|
|
13482
13178
|
{
|
|
@@ -14030,7 +13726,7 @@ function AuthForm({
|
|
|
14030
13726
|
}
|
|
14031
13727
|
|
|
14032
13728
|
// src/ui/components/auth/auth-view.tsx
|
|
14033
|
-
import { useContext as useContext28, useEffect as useEffect22, useState as
|
|
13729
|
+
import { useContext as useContext28, useEffect as useEffect22, useState as useState15 } from "react";
|
|
14034
13730
|
|
|
14035
13731
|
// src/ui/components/provider-icons.tsx
|
|
14036
13732
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -14905,7 +14601,7 @@ function PasskeyButton({
|
|
|
14905
14601
|
}
|
|
14906
14602
|
|
|
14907
14603
|
// src/ui/components/auth/provider-button.tsx
|
|
14908
|
-
import { useCallback as useCallback7, useContext as useContext27 } from "react";
|
|
14604
|
+
import { useCallback as useCallback7, useContext as useContext27, useState as useState14 } from "react";
|
|
14909
14605
|
import { jsx as jsx35, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
14910
14606
|
function ProviderButton({
|
|
14911
14607
|
className,
|
|
@@ -14931,6 +14627,7 @@ function ProviderButton({
|
|
|
14931
14627
|
toast,
|
|
14932
14628
|
localizeErrors
|
|
14933
14629
|
} = useContext27(AuthUIContext);
|
|
14630
|
+
const [error, setError] = useState14(null);
|
|
14934
14631
|
const getRedirectTo = useCallback7(
|
|
14935
14632
|
() => redirectToProp || getSearchParam("redirectTo") || contextRedirectTo,
|
|
14936
14633
|
[redirectToProp, contextRedirectTo]
|
|
@@ -14978,38 +14675,47 @@ function ProviderButton({
|
|
|
14978
14675
|
await authClient.signIn.social(socialParams);
|
|
14979
14676
|
}
|
|
14980
14677
|
}
|
|
14981
|
-
} catch (
|
|
14678
|
+
} catch (error2) {
|
|
14679
|
+
const errorMessage = getLocalizedError({
|
|
14680
|
+
error: error2,
|
|
14681
|
+
localization,
|
|
14682
|
+
localizeErrors
|
|
14683
|
+
});
|
|
14684
|
+
setError(errorMessage);
|
|
14982
14685
|
toast({
|
|
14983
14686
|
variant: "error",
|
|
14984
|
-
message:
|
|
14985
|
-
error,
|
|
14986
|
-
localization,
|
|
14987
|
-
localizeErrors
|
|
14988
|
-
})
|
|
14687
|
+
message: errorMessage
|
|
14989
14688
|
});
|
|
14990
14689
|
setIsSubmitting(false);
|
|
14991
14690
|
}
|
|
14992
14691
|
};
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
14692
|
+
const handleClick = () => {
|
|
14693
|
+
setError(null);
|
|
14694
|
+
doSignInSocial();
|
|
14695
|
+
};
|
|
14696
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn(socialLayout === "vertical" ? "w-full" : "grow", "flex flex-col gap-2"), children: [
|
|
14697
|
+
/* @__PURE__ */ jsxs22(
|
|
14698
|
+
Button,
|
|
14699
|
+
{
|
|
14700
|
+
className: cn(
|
|
14701
|
+
"w-full",
|
|
14702
|
+
className,
|
|
14703
|
+
classNames?.form?.button,
|
|
14704
|
+
classNames?.form?.outlineButton,
|
|
14705
|
+
classNames?.form?.providerButton
|
|
14706
|
+
),
|
|
14707
|
+
disabled: isSubmitting,
|
|
14708
|
+
variant: "outline",
|
|
14709
|
+
onClick: handleClick,
|
|
14710
|
+
children: [
|
|
14711
|
+
provider.icon && /* @__PURE__ */ jsx35(provider.icon, { className: classNames?.form?.icon }),
|
|
14712
|
+
socialLayout === "grid" && provider.name,
|
|
14713
|
+
socialLayout === "vertical" && `${localization.SIGN_IN_WITH} ${provider.name}`
|
|
14714
|
+
]
|
|
14715
|
+
}
|
|
14716
|
+
),
|
|
14717
|
+
error && /* @__PURE__ */ jsx35("div", { className: "rounded-md bg-destructive/10 p-2 text-xs text-destructive", children: error })
|
|
14718
|
+
] });
|
|
15013
14719
|
}
|
|
15014
14720
|
|
|
15015
14721
|
// src/ui/components/auth/auth-view.tsx
|
|
@@ -15050,7 +14756,7 @@ function AuthView({
|
|
|
15050
14756
|
}
|
|
15051
14757
|
const path = pathProp ?? pathname?.split("/").pop();
|
|
15052
14758
|
const view = viewProp || getViewByPath(viewPaths, path) || "SIGN_IN";
|
|
15053
|
-
const [isSubmitting, setIsSubmitting] =
|
|
14759
|
+
const [isSubmitting, setIsSubmitting] = useState15(false);
|
|
15054
14760
|
useEffect22(() => {
|
|
15055
14761
|
const handlePageHide = () => setIsSubmitting(false);
|
|
15056
14762
|
window.addEventListener("pagehide", handlePageHide);
|