@vervstack/chures 0.0.4 → 0.0.6

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/chures.js CHANGED
@@ -1,56 +1,167 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- import { jsxs as S, jsx as a, Fragment as B } from "react/jsx-runtime";
3
- import { useRef as w, useState as h, useEffect as y } from "react";
4
- import { AnimatePresence as L, motion as x } from "framer-motion";
5
- import { create as R } from "zustand";
6
- const E = "https://oauth.telegram.org/js/telegram-login.js?3";
7
- function b(e) {
8
- const { botId: s, redirectUri: r, requestAccess: o = "write" } = e, i = w(e.onSuccess);
9
- i.current = e.onSuccess;
10
- const t = w(!1), [n, c] = h(!1), [f, u] = h(!1);
11
- y(function() {
12
- if (!s) return;
13
- const p = r ?? window.location.origin;
14
- u(!0), c(!1);
15
- const l = document.createElement("script");
16
- return l.src = E, l.async = !0, l.onload = function() {
17
- const _ = window.Telegram;
18
- _ && (_.Login.init(
19
- { client_id: s, redirect_uri: p },
20
- function(v) {
21
- t.current || (t.current = !0, i.current(v));
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ import { jsx as e, jsxs as f, Fragment as w } from "react/jsx-runtime";
3
+ import { useRef as b, useState as S, useEffect as I } from "react";
4
+ import { AnimatePresence as k, motion as D } from "framer-motion";
5
+ import { create as A } from "zustand";
6
+ function E(o) {
7
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
8
+ }
9
+ var L = { exports: {} };
10
+ var y;
11
+ function B() {
12
+ return y || (y = 1, (function(o) {
13
+ (function() {
14
+ var n = {}.hasOwnProperty;
15
+ function r() {
16
+ for (var t = "", a = 0; a < arguments.length; a++) {
17
+ var c = arguments[a];
18
+ c && (t = i(t, s(c)));
19
+ }
20
+ return t;
21
+ }
22
+ function s(t) {
23
+ if (typeof t == "string" || typeof t == "number")
24
+ return t;
25
+ if (typeof t != "object")
26
+ return "";
27
+ if (Array.isArray(t))
28
+ return r.apply(null, t);
29
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
30
+ return t.toString();
31
+ var a = "";
32
+ for (var c in t)
33
+ n.call(t, c) && t[c] && (a = i(a, c));
34
+ return a;
35
+ }
36
+ function i(t, a) {
37
+ return a ? t ? t + " " + a : t + a : t;
38
+ }
39
+ o.exports ? (r.default = r, o.exports = r) : window.classNames = r;
40
+ })();
41
+ })(L)), L.exports;
42
+ }
43
+ var z = B();
44
+ const u = /* @__PURE__ */ E(z), F = "_LoaderContainer_wa8op_24", j = "_sm_wa8op_31", O = "_md_wa8op_32", $ = "_lg_wa8op_33", q = "_Arc1_wa8op_37", P = "_Arc2_wa8op_38", M = "_Arc3_wa8op_39", U = "_spin_wa8op_1", G = "_Ring1_wa8op_71", V = "_Ring2_wa8op_72", H = "_Ring3_wa8op_73", J = "_ripple_wa8op_1", K = "_Dot1_wa8op_86", Q = "_Dot2_wa8op_87", X = "_Dot3_wa8op_88", Y = "_dotPulse_wa8op_1", Z = "_Wave1_wa8op_105", ee = "_Wave2_wa8op_106", ne = "_Wave3_wa8op_107", te = "_Wave4_wa8op_108", oe = "_Wave5_wa8op_109", re = "_waveBounce_wa8op_1", C = {
45
+ LoaderContainer: F,
46
+ sm: j,
47
+ md: O,
48
+ lg: $,
49
+ Arc1: q,
50
+ Arc2: P,
51
+ Arc3: M,
52
+ spin: U,
53
+ Ring1: G,
54
+ Ring2: V,
55
+ Ring3: H,
56
+ ripple: J,
57
+ Dot1: K,
58
+ Dot2: Q,
59
+ Dot3: X,
60
+ dotPulse: Y,
61
+ Wave1: Z,
62
+ Wave2: ee,
63
+ Wave3: ne,
64
+ Wave4: te,
65
+ Wave5: oe,
66
+ waveBounce: re
67
+ };
68
+ function se(o, n) {
69
+ switch (o) {
70
+ case "ripple":
71
+ return /* @__PURE__ */ f(w, { children: [
72
+ /* @__PURE__ */ e("div", { className: n.Ring1 }),
73
+ /* @__PURE__ */ e("div", { className: n.Ring2 }),
74
+ /* @__PURE__ */ e("div", { className: n.Ring3 })
75
+ ] });
76
+ case "dots":
77
+ return /* @__PURE__ */ f(w, { children: [
78
+ /* @__PURE__ */ e("div", { className: n.Dot1 }),
79
+ /* @__PURE__ */ e("div", { className: n.Dot2 }),
80
+ /* @__PURE__ */ e("div", { className: n.Dot3 })
81
+ ] });
82
+ case "wave":
83
+ return /* @__PURE__ */ f(w, { children: [
84
+ /* @__PURE__ */ e("div", { className: n.Wave1 }),
85
+ /* @__PURE__ */ e("div", { className: n.Wave2 }),
86
+ /* @__PURE__ */ e("div", { className: n.Wave3 }),
87
+ /* @__PURE__ */ e("div", { className: n.Wave4 }),
88
+ /* @__PURE__ */ e("div", { className: n.Wave5 })
89
+ ] });
90
+ default:
91
+ return /* @__PURE__ */ f(w, { children: [
92
+ /* @__PURE__ */ e("div", { className: n.Arc1 }),
93
+ /* @__PURE__ */ e("div", { className: n.Arc2 }),
94
+ /* @__PURE__ */ e("div", { className: n.Arc3 })
95
+ ] });
96
+ }
97
+ }
98
+ function ae({ variant: o = "arcs", size: n = "md", color: r, className: s }) {
99
+ return /* @__PURE__ */ e(
100
+ "div",
101
+ {
102
+ className: u(C.LoaderContainer, C[n], C[o], s),
103
+ role: "status",
104
+ "aria-label": "Loading",
105
+ style: r ? { "--chures-accent": r } : void 0,
106
+ children: se(o, C)
107
+ }
108
+ );
109
+ }
110
+ const ie = "_LoadingWrapperContainer_1q0w7_1", ce = "_SkeletonWrapper_1q0w7_9", W = {
111
+ LoadingWrapperContainer: ie,
112
+ SkeletonWrapper: ce
113
+ };
114
+ function Je({ isLoading: o, children: n, skeleton: r, loaderProps: s, className: i }) {
115
+ return o ? r ? /* @__PURE__ */ e("div", { className: u(W.SkeletonWrapper, i), children: r }) : /* @__PURE__ */ e("div", { className: u(W.LoadingWrapperContainer, i), children: /* @__PURE__ */ e(ae, { ...s }) }) : /* @__PURE__ */ e(w, { children: n });
116
+ }
117
+ const le = "https://oauth.telegram.org/js/telegram-login.js?3";
118
+ function ue(o) {
119
+ const { botId: n, redirectUri: r, requestAccess: s = "write" } = o, i = b(o.onSuccess);
120
+ i.current = o.onSuccess;
121
+ const t = b(!1), [a, c] = S(!1), [d, l] = S(!1);
122
+ I(function() {
123
+ if (!n) return;
124
+ const v = r ?? window.location.origin;
125
+ l(!0), c(!1);
126
+ const m = document.createElement("script");
127
+ return m.src = le, m.async = !0, m.onload = function() {
128
+ const T = window.Telegram;
129
+ T && (T.Login.init(
130
+ { client_id: n, redirect_uri: v },
131
+ function(R) {
132
+ t.current || (t.current = !0, i.current(R));
22
133
  }
23
- ), c(!0)), u(!1);
24
- }, l.onerror = function() {
25
- u(!1);
26
- }, document.head.appendChild(l), function() {
27
- document.head.contains(l) && document.head.removeChild(l), c(!1), u(!1);
134
+ ), c(!0)), l(!1);
135
+ }, m.onerror = function() {
136
+ l(!1);
137
+ }, document.head.appendChild(m), function() {
138
+ document.head.contains(m) && document.head.removeChild(m), c(!1), l(!1);
28
139
  };
29
- }, [s, r]);
30
- function m() {
31
- const p = window.Telegram;
32
- if (!n || !p) return;
140
+ }, [n, r]);
141
+ function g() {
142
+ const v = window.Telegram;
143
+ if (!a || !v) return;
33
144
  t.current = !1;
34
- const l = r ?? window.location.origin;
35
- p.Login.auth(
36
- { client_id: s, redirect_uri: l, request_access: o },
37
- function(_) {
38
- t.current || (t.current = !0, i.current(_));
145
+ const m = r ?? window.location.origin;
146
+ v.Login.auth(
147
+ { client_id: n, redirect_uri: m, request_access: s },
148
+ function(T) {
149
+ t.current || (t.current = !0, i.current(T));
39
150
  }
40
151
  );
41
152
  }
42
- return { login: m, isReady: n, isLoading: f };
153
+ return { login: g, isReady: a, isLoading: d };
43
154
  }
44
- const j = "_TelegramSignInButtonContainer_10wun_1", D = "_FullSize_10wun_46", O = "_Icon_10wun_50", T = {
45
- TelegramSignInButtonContainer: j,
46
- FullSize: D,
47
- Icon: O
48
- }, N = {
155
+ const de = "_TelegramSignInButtonContainer_10wun_1", _e = "_FullSize_10wun_46", me = "_Icon_10wun_50", N = {
156
+ TelegramSignInButtonContainer: de,
157
+ FullSize: _e,
158
+ Icon: me
159
+ }, pe = {
49
160
  en: "Continue with Telegram",
50
161
  ru: "Войти через Telegram"
51
162
  };
52
- function A() {
53
- return /* @__PURE__ */ a(
163
+ function fe() {
164
+ return /* @__PURE__ */ e(
54
165
  "svg",
55
166
  {
56
167
  viewBox: "0 0 24 24",
@@ -58,159 +169,186 @@ function A() {
58
169
  height: "20",
59
170
  fill: "currentColor",
60
171
  "aria-hidden": "true",
61
- className: T.Icon,
62
- children: /* @__PURE__ */ a("path", { d: "M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z" })
172
+ className: N.Icon,
173
+ children: /* @__PURE__ */ e("path", { d: "M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z" })
63
174
  }
64
175
  );
65
176
  }
66
- function F({
67
- onClick: e,
68
- disabled: s,
177
+ function ge({
178
+ onClick: o,
179
+ disabled: n,
69
180
  lang: r = "en",
70
- title: o,
181
+ title: s,
71
182
  label: i,
72
183
  fullSize: t,
73
- className: n
184
+ className: a
74
185
  }) {
75
- y(function() {
76
- const u = "comfortaa-font";
77
- if (document.getElementById(u)) return;
78
- const m = document.createElement("link");
79
- m.id = u, m.rel = "stylesheet", m.href = "https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap", document.head.appendChild(m);
186
+ I(function() {
187
+ const l = "comfortaa-font";
188
+ if (document.getElementById(l)) return;
189
+ const g = document.createElement("link");
190
+ g.id = l, g.rel = "stylesheet", g.href = "https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap", document.head.appendChild(g);
80
191
  }, []);
81
- const c = i ?? o ?? N[r], f = [T.TelegramSignInButtonContainer, t && T.FullSize, n].filter(Boolean).join(" ");
82
- return /* @__PURE__ */ S("button", { type: "button", className: f, onClick: e, disabled: s, children: [
83
- /* @__PURE__ */ a(A, {}),
192
+ const c = i ?? s ?? pe[r], d = [N.TelegramSignInButtonContainer, t && N.FullSize, a].filter(Boolean).join(" ");
193
+ return /* @__PURE__ */ f("button", { type: "button", className: d, onClick: o, disabled: n, children: [
194
+ /* @__PURE__ */ e(fe, {}),
84
195
  c
85
196
  ] });
86
197
  }
87
- function nt({
88
- botId: e,
89
- onSuccess: s,
198
+ function Ke({
199
+ botId: o,
200
+ onSuccess: n,
90
201
  lang: r,
91
- title: o,
202
+ title: s,
92
203
  redirectUri: i,
93
204
  requestAccess: t,
94
- children: n,
205
+ children: a,
95
206
  className: c
96
207
  }) {
97
- const { login: f, isReady: u } = b({ botId: e, onSuccess: s, redirectUri: i, requestAccess: t });
98
- return n ? /* @__PURE__ */ a(B, { children: n({ login: f, isReady: u }) }) : /* @__PURE__ */ a(
99
- F,
208
+ const { login: d, isReady: l } = ue({ botId: o, onSuccess: n, redirectUri: i, requestAccess: t });
209
+ return a ? /* @__PURE__ */ e(w, { children: a({ login: d, isReady: l }) }) : /* @__PURE__ */ e(
210
+ ge,
100
211
  {
101
- onClick: f,
102
- disabled: !u,
212
+ onClick: d,
213
+ disabled: !l,
103
214
  lang: r,
104
- title: o,
215
+ title: s,
105
216
  className: c
106
217
  }
107
218
  );
108
219
  }
109
- function z(e) {
110
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
111
- }
112
- var g = { exports: {} };
113
- var I;
114
- function q() {
115
- return I || (I = 1, (function(e) {
116
- (function() {
117
- var s = {}.hasOwnProperty;
118
- function r() {
119
- for (var t = "", n = 0; n < arguments.length; n++) {
120
- var c = arguments[n];
121
- c && (t = i(t, o(c)));
122
- }
123
- return t;
124
- }
125
- function o(t) {
126
- if (typeof t == "string" || typeof t == "number")
127
- return t;
128
- if (typeof t != "object")
129
- return "";
130
- if (Array.isArray(t))
131
- return r.apply(null, t);
132
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
133
- return t.toString();
134
- var n = "";
135
- for (var c in t)
136
- s.call(t, c) && t[c] && (n = i(n, c));
137
- return n;
138
- }
139
- function i(t, n) {
140
- return n ? t ? t + " " + n : t + n : t;
141
- }
142
- e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
143
- })();
144
- })(g)), g.exports;
145
- }
146
- var P = q();
147
- const k = /* @__PURE__ */ z(P);
148
- let M = 0;
149
- const C = R((e, s) => ({
220
+ let he = 0;
221
+ const x = A((o, n) => ({
150
222
  toasts: [],
151
223
  bake: (r) => {
152
- const o = M++;
153
- e((i) => ({ toasts: [...i.toasts, { ...r, id: o }] })), setTimeout(() => {
154
- s().dismiss(o);
224
+ const s = he++;
225
+ o((i) => ({ toasts: [...i.toasts, { ...r, id: s }] })), setTimeout(() => {
226
+ n().dismiss(s);
155
227
  }, 5e3);
156
228
  },
157
229
  dismiss: (r) => {
158
- e((o) => ({
159
- toasts: o.toasts.filter((i) => i.id !== r)
230
+ o((s) => ({
231
+ toasts: s.toasts.filter((i) => i.id !== r)
160
232
  }));
161
233
  }
162
- })), U = "_ToastContainer_1tme2_1", G = "_Toast_1tme2_1", V = "_error_1tme2_33", W = "_warn_1tme2_41", $ = "_info_1tme2_49", H = "_Description_1tme2_53", J = "_DismissButton_1tme2_59", K = "_slideIn_1tme2_79", Q = "_slideOut_1tme2_83", d = {
163
- ToastContainer: U,
164
- Toast: G,
165
- error: V,
166
- warn: W,
167
- info: $,
168
- Description: H,
169
- DismissButton: J,
170
- slideIn: K,
171
- slideOut: Q
234
+ })), ve = "_ToastContainer_1tme2_1", we = "_Toast_1tme2_1", Te = "_error_1tme2_33", Ce = "_warn_1tme2_41", Se = "_info_1tme2_49", Le = "_Description_1tme2_53", Ne = "_DismissButton_1tme2_59", Ie = "_slideIn_1tme2_79", be = "_slideOut_1tme2_83", p = {
235
+ ToastContainer: ve,
236
+ Toast: we,
237
+ error: Te,
238
+ warn: Ce,
239
+ info: Se,
240
+ Description: Le,
241
+ DismissButton: Ne,
242
+ slideIn: Ie,
243
+ slideOut: be
172
244
  };
173
- function rt() {
174
- const { toasts: e } = C();
175
- return /* @__PURE__ */ a("div", { className: d.ToastContainer, children: /* @__PURE__ */ a(L, { children: e.map((s) => /* @__PURE__ */ a(
176
- x.div,
245
+ function Qe() {
246
+ const { toasts: o } = x();
247
+ return /* @__PURE__ */ e("div", { className: p.ToastContainer, children: /* @__PURE__ */ e(k, { children: o.map((n) => /* @__PURE__ */ e(
248
+ D.div,
177
249
  {
178
250
  layout: !0,
179
251
  initial: { opacity: 0, x: 100, y: 50 },
180
252
  animate: { opacity: 1, x: 0, y: 0 },
181
253
  exit: { opacity: 0, y: -50 },
182
254
  transition: { type: "spring", stiffness: 300, damping: 20 },
183
- children: /* @__PURE__ */ a(X, { ...s })
255
+ children: /* @__PURE__ */ e(ye, { ...n })
184
256
  },
185
- s.id
257
+ n.id
186
258
  )) }) });
187
259
  }
188
- function X({ id: e, title: s, description: r, level: o, isDismissable: i }) {
189
- const [t, n] = h(!1), c = C();
190
- return y(() => () => {
191
- n(!0);
192
- }, []), /* @__PURE__ */ S(
260
+ function ye({ id: o, title: n, description: r, level: s, isDismissable: i }) {
261
+ const [t, a] = S(!1), c = x();
262
+ return I(() => () => {
263
+ a(!0);
264
+ }, []), /* @__PURE__ */ f(
193
265
  "div",
194
266
  {
195
- className: k(d.Toast, {
196
- [d.error]: o === "Error",
197
- [d.warn]: o === "Warn",
198
- [d.info]: o == null || o === "Info",
199
- [d.slideIn]: !t,
200
- [d.slideOut]: t
267
+ className: u(p.Toast, {
268
+ [p.error]: s === "Error",
269
+ [p.warn]: s === "Warn",
270
+ [p.info]: s == null || s === "Info",
271
+ [p.slideIn]: !t,
272
+ [p.slideOut]: t
201
273
  }),
202
274
  children: [
203
- /* @__PURE__ */ a("div", { children: s }),
204
- /* @__PURE__ */ a("div", { className: d.Description, children: r }),
205
- i && e !== void 0 && /* @__PURE__ */ a("div", { className: d.DismissButton, onClick: () => c.dismiss(e), children: "×" })
275
+ /* @__PURE__ */ e("div", { children: n }),
276
+ /* @__PURE__ */ e("div", { className: p.Description, children: r }),
277
+ i && o !== void 0 && /* @__PURE__ */ e("div", { className: p.DismissButton, onClick: () => c.dismiss(o), children: "×" })
206
278
  ]
207
279
  }
208
280
  );
209
281
  }
282
+ const We = "_InputContainer_1a08x_6", xe = "_InputField_1a08x_12", Re = "_hasError_1a08x_30", ke = "_disabled_1a08x_35", De = "_Label_1a08x_40", Ae = "_lifted_1a08x_54", Ee = "_ErrorText_1a08x_65", Be = "_Skeleton_1a08x_73", h = {
283
+ InputContainer: We,
284
+ InputField: xe,
285
+ hasError: Re,
286
+ disabled: ke,
287
+ Label: De,
288
+ lifted: Ae,
289
+ ErrorText: Ee,
290
+ Skeleton: Be
291
+ };
292
+ function Xe({ value: o, setValue: n, label: r, isLoader: s, type: i = "text", disabled: t, error: a, className: c }) {
293
+ const [d, l] = S(!1), g = d || o.length > 0;
294
+ return s ? /* @__PURE__ */ e("div", { className: u(h.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ f("div", { className: u(h.InputContainer, { [h.hasError]: !!a, [h.disabled]: t }, c), children: [
295
+ /* @__PURE__ */ e(
296
+ "input",
297
+ {
298
+ className: h.InputField,
299
+ type: i,
300
+ value: o,
301
+ onChange: (v) => n(v.target.value),
302
+ onFocus: () => l(!0),
303
+ onBlur: () => l(!1),
304
+ disabled: t
305
+ }
306
+ ),
307
+ /* @__PURE__ */ e("label", { className: u(h.Label, { [h.lifted]: g }), children: r }),
308
+ a && /* @__PURE__ */ e("span", { className: h.ErrorText, children: a })
309
+ ] });
310
+ }
311
+ const ze = "_ToggleContainer_im4lz_6", Fe = "_disabled_im4lz_13", je = "_Track_im4lz_18", Oe = "_on_im4lz_31", $e = "_Thumb_im4lz_39", qe = "_Label_im4lz_56", Pe = "_LabelSkeleton_im4lz_62", Me = "_Skeleton_im4lz_77", _ = {
312
+ ToggleContainer: ze,
313
+ disabled: Fe,
314
+ Track: je,
315
+ on: Oe,
316
+ Thumb: $e,
317
+ Label: qe,
318
+ LabelSkeleton: Pe,
319
+ Skeleton: Me
320
+ };
321
+ function Ye({ checked: o, onChange: n, label: r, labelPosition: s = "right", disabled: i, isLoader: t, isLoadingLabel: a, className: c }) {
322
+ const d = !!r || a, l = a ? /* @__PURE__ */ e("span", { className: _.LabelSkeleton, "aria-hidden": "true" }) : r ? /* @__PURE__ */ e("span", { className: _.Label, children: r }) : null;
323
+ return t ? d ? /* @__PURE__ */ f("div", { className: u(_.ToggleContainer, c), children: [
324
+ s === "left" && l,
325
+ /* @__PURE__ */ e("div", { className: _.Skeleton, "aria-hidden": "true" }),
326
+ s === "right" && l
327
+ ] }) : /* @__PURE__ */ e("div", { className: u(_.Skeleton, c), "aria-hidden": "true" }) : /* @__PURE__ */ f("label", { className: u(_.ToggleContainer, { [_.disabled]: i }, c), children: [
328
+ s === "left" && l,
329
+ /* @__PURE__ */ e(
330
+ "button",
331
+ {
332
+ role: "switch",
333
+ "aria-checked": o,
334
+ className: u(_.Track, { [_.on]: o }),
335
+ onClick: () => !i && n(!o),
336
+ disabled: i,
337
+ type: "button",
338
+ children: /* @__PURE__ */ e("span", { className: _.Thumb })
339
+ }
340
+ ),
341
+ s === "right" && l
342
+ ] });
343
+ }
210
344
  export {
211
- nt as TelegramAuth,
212
- F as TelegramSignInButton,
213
- rt as Toaster,
214
- b as useTelegramLogin,
215
- C as useToaster
345
+ Xe as Input,
346
+ ae as Loader,
347
+ Je as LoadingWrapper,
348
+ Ke as TelegramAuth,
349
+ ge as TelegramSignInButton,
350
+ Qe as Toaster,
351
+ Ye as Toggle,
352
+ ue as useTelegramLogin,
353
+ x as useToaster
216
354
  };
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.Chures={},u.ReactJSXRuntime,u.React,u.FramerMotion,u.Zustand))})(this,(function(u,s,m,I,B){"use strict";const L="https://oauth.telegram.org/js/telegram-login.js?3";function w(t){const{botId:o,redirectUri:r,requestAccess:i="write"}=t,c=m.useRef(t.onSuccess);c.current=t.onSuccess;const e=m.useRef(!1),[n,a]=m.useState(!1),[p,l]=m.useState(!1);m.useEffect(function(){if(!o)return;const _=r??window.location.origin;l(!0),a(!1);const f=document.createElement("script");return f.src=L,f.async=!0,f.onload=function(){const h=window.Telegram;h&&(h.Login.init({client_id:o,redirect_uri:_},function(N){e.current||(e.current=!0,c.current(N))}),a(!0)),l(!1)},f.onerror=function(){l(!1)},document.head.appendChild(f),function(){document.head.contains(f)&&document.head.removeChild(f),a(!1),l(!1)}},[o,r]);function g(){const _=window.Telegram;if(!n||!_)return;e.current=!1;const f=r??window.location.origin;_.Login.auth({client_id:o,redirect_uri:f,request_access:i},function(h){e.current||(e.current=!0,c.current(h))})}return{login:g,isReady:n,isLoading:p}}const T={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_10wun_1",FullSize:"_FullSize_10wun_46",Icon:"_Icon_10wun_50"},E={en:"Continue with Telegram",ru:"Войти через Telegram"};function j(){return s.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:T.Icon,children:s.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function C({onClick:t,disabled:o,lang:r="en",title:i,label:c,fullSize:e,className:n}){m.useEffect(function(){const l="comfortaa-font";if(document.getElementById(l))return;const g=document.createElement("link");g.id=l,g.rel="stylesheet",g.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(g)},[]);const a=c??i??E[r],p=[T.TelegramSignInButtonContainer,e&&T.FullSize,n].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:p,onClick:t,disabled:o,children:[s.jsx(j,{}),a]})}function D({botId:t,onSuccess:o,lang:r,title:i,redirectUri:c,requestAccess:e,children:n,className:a}){const{login:p,isReady:l}=w({botId:t,onSuccess:o,redirectUri:c,requestAccess:e});return n?s.jsx(s.Fragment,{children:n({login:p,isReady:l})}):s.jsx(C,{onClick:p,disabled:!l,lang:r,title:i,className:a})}function O(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var y={exports:{}};var v;function x(){return v||(v=1,(function(t){(function(){var o={}.hasOwnProperty;function r(){for(var e="",n=0;n<arguments.length;n++){var a=arguments[n];a&&(e=c(e,i(a)))}return e}function i(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var n="";for(var a in e)o.call(e,a)&&e[a]&&(n=c(n,a));return n}function c(e,n){return n?e?e+" "+n:e+n:e}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(y)),y.exports}var F=x();const b=O(F);let q=0;const S=B.create((t,o)=>({toasts:[],bake:r=>{const i=q++;t(c=>({toasts:[...c.toasts,{...r,id:i}]})),setTimeout(()=>{o().dismiss(i)},5e3)},dismiss:r=>{t(i=>({toasts:i.toasts.filter(c=>c.id!==r)}))}})),d={ToastContainer:"_ToastContainer_1tme2_1",Toast:"_Toast_1tme2_1",error:"_error_1tme2_33",warn:"_warn_1tme2_41",info:"_info_1tme2_49",Description:"_Description_1tme2_53",DismissButton:"_DismissButton_1tme2_59",slideIn:"_slideIn_1tme2_79",slideOut:"_slideOut_1tme2_83"};function z(){const{toasts:t}=S();return s.jsx("div",{className:d.ToastContainer,children:s.jsx(I.AnimatePresence,{children:t.map(o=>s.jsx(I.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:s.jsx(A,{...o})},o.id))})})}function A({id:t,title:o,description:r,level:i,isDismissable:c}){const[e,n]=m.useState(!1),a=S();return m.useEffect(()=>()=>{n(!0)},[]),s.jsxs("div",{className:b(d.Toast,{[d.error]:i==="Error",[d.warn]:i==="Warn",[d.info]:i==null||i==="Info",[d.slideIn]:!e,[d.slideOut]:e}),children:[s.jsx("div",{children:o}),s.jsx("div",{className:d.Description,children:r}),c&&t!==void 0&&s.jsx("div",{className:d.DismissButton,onClick:()=>a.dismiss(t),children:"×"})]})}u.TelegramAuth=D,u.TelegramSignInButton=C,u.Toaster=z,u.useTelegramLogin=w,u.useToaster=S,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--chures-accent: #229ED9;--chures-btn-from: #2AABEE;--chures-btn-to: #229ED9;--chures-error: #ef4444;--chures-warn: #f59e0b;--chures-fg: #ffffff;--chures-fg-muted: #9ca3af;--chures-surface: #000000;--chures-font-sm: .875rem;--chures-font-xs: .75rem;--chures-input-bg: #111111;--chures-input-height: 3rem;--chures-input-radius: .75rem;--chures-skeleton-shine: #1e1e1e;--chures-toggle-width: 2.75rem;--chures-toggle-height: 1.5rem;--chures-toggle-thumb: 1.125rem;--chures-toggle-bg-off: rgb(255 255 255 / 13%);--chures-toggle-bg-on: var(--chures-accent);--chures-toggle-thumb-color: #ffffff;--chures-toggle-label-skeleton-w: 5rem}@keyframes _spin_wa8op_1{to{transform:rotate(360deg)}}@keyframes _ripple_wa8op_1{0%{transform:scale(.08);opacity:.9}to{transform:scale(1);opacity:0}}@keyframes _dotPulse_wa8op_1{0%,to{transform:translate(-50%,-50%) scale(.55);opacity:.3}50%{transform:translate(-50%,calc(-50% - var(--sz) * .1)) scale(1);opacity:1}}@keyframes _waveBounce_wa8op_1{0%,55%,to{transform:translate(-50%,-50%) scale(.8);opacity:.4}27%{transform:translate(-50%,calc(-50% - var(--sz) * .28)) scale(1);opacity:1}}._LoaderContainer_wa8op_24{position:relative;flex-shrink:0}._sm_wa8op_31{width:1.5rem;height:1.5rem;--sz: 1.5rem;--arc-gap: .2rem;--arc-bw: .125rem}._md_wa8op_32{width:2.5rem;height:2.5rem;--sz: 2.5rem;--arc-gap: .35rem;--arc-bw: .1875rem}._lg_wa8op_33{width:4rem;height:4rem;--sz: 4rem;--arc-gap: .55rem;--arc-bw: .25rem}._Arc1_wa8op_37,._Arc2_wa8op_38,._Arc3_wa8op_39{position:absolute;border-radius:50%;border:var(--arc-bw) solid transparent}._Arc1_wa8op_37{inset:0;border-top-color:var(--chures-accent, #229ED9);border-left-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.2s linear infinite;filter:drop-shadow(0 0 .25rem var(--chures-accent, #229ED9))}._Arc2_wa8op_38{inset:var(--arc-gap);border-bottom-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 1.8s linear infinite reverse;opacity:.8}._Arc3_wa8op_39{inset:calc(var(--arc-gap) * 2);border-top-color:var(--chures-accent, #229ED9);border-right-color:var(--chures-accent, #229ED9);animation:_spin_wa8op_1 2.4s linear infinite;opacity:.6}._Ring1_wa8op_71,._Ring2_wa8op_72,._Ring3_wa8op_73{position:absolute;inset:0;border-radius:50%;border:var(--arc-bw) solid var(--chures-accent, #229ED9);animation:_ripple_wa8op_1 1.8s ease-out infinite both}._Ring2_wa8op_72{animation-delay:.6s}._Ring3_wa8op_73{animation-delay:1.2s}._Dot1_wa8op_86,._Dot2_wa8op_87,._Dot3_wa8op_88{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .2);height:calc(var(--sz) * .2);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .14) var(--chures-accent, #229ED9);animation:_dotPulse_wa8op_1 1.1s ease-in-out infinite both}._Dot1_wa8op_86{left:22%}._Dot2_wa8op_87{left:50%;animation-delay:.18s}._Dot3_wa8op_88{left:78%;animation-delay:.36s}._Wave1_wa8op_105,._Wave2_wa8op_106,._Wave3_wa8op_107,._Wave4_wa8op_108,._Wave5_wa8op_109{position:absolute;top:50%;border-radius:50%;width:calc(var(--sz) * .16);height:calc(var(--sz) * .16);background:var(--chures-accent, #229ED9);box-shadow:0 0 calc(var(--sz) * .1) var(--chures-accent, #229ED9);animation:_waveBounce_wa8op_1 1s ease-in-out infinite both}._Wave1_wa8op_105{left:10%}._Wave2_wa8op_106{left:28%;animation-delay:.12s}._Wave3_wa8op_107{left:46%;animation-delay:.24s}._Wave4_wa8op_108{left:64%;animation-delay:.36s}._Wave5_wa8op_109{left:82%;animation-delay:.48s}._LoadingWrapperContainer_1q0w7_1{display:flex;align-items:center;justify-content:center;width:100%;min-height:4rem}._SkeletonWrapper_1q0w7_9{width:100%}._TelegramSignInButtonContainer_10wun_1{display:inline-flex;align-items:center;justify-content:center;gap:.625rem;width:100%;padding:1rem 1.375rem;background:linear-gradient(180deg,var(--chures-btn-from, #2AABEE) 0%,var(--chures-btn-to, #229ED9) 100%);border:0;border-radius:.875rem;color:#fff;font-family:Comfortaa,sans-serif;font-weight:600;font-size:1rem;letter-spacing:-.005em;cursor:pointer;box-shadow:inset 0 .0625rem #ffffff26,0 .75rem 2rem -.75rem #2aabee8c;transition:transform .14s ease,box-shadow .2s ease,filter .16s ease}._TelegramSignInButtonContainer_10wun_1:hover{transform:translateY(-.0625rem);box-shadow:inset 0 .0625rem #ffffff2e,0 1.125rem 2.375rem -.75rem #2aabeea6;filter:brightness(1.05)}._TelegramSignInButtonContainer_10wun_1:active{transform:translateY(0);filter:brightness(.97)}._TelegramSignInButtonContainer_10wun_1:focus-visible{outline:.125rem solid rgba(255,255,255,.8);outline-offset:.125rem}._TelegramSignInButtonContainer_10wun_1:disabled{opacity:.6;cursor:not-allowed}._FullSize_10wun_46{height:100%}._Icon_10wun_50{flex-shrink:0}._ToastContainer_1tme2_1{position:fixed;right:1.5rem;top:1.5rem;width:clamp(25vw,24.5rem,95vw);display:flex;flex-direction:column;gap:1rem;z-index:9999}._Toast_1tme2_1{min-height:4rem;border:var(--chures-accent, #229ED9) 1px solid;border-radius:1rem;padding:1rem;box-sizing:border-box;position:relative;background:var(--chures-surface, #000000);display:flex;flex-direction:column}._Toast_1tme2_1>div:first-child{font-weight:700;font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff)}._Toast_1tme2_1._error_1tme2_33{border-color:var(--chures-error, #ef4444)}._Toast_1tme2_1._error_1tme2_33>div:first-child{color:var(--chures-error, #ef4444)}._Toast_1tme2_1._warn_1tme2_41{border-color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._warn_1tme2_41>div:first-child{color:var(--chures-warn, #f59e0b)}._Toast_1tme2_1._info_1tme2_49{border-color:var(--chures-accent, #229ED9)}._Toast_1tme2_1 ._Description_1tme2_53{color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-xs, .75rem);margin-top:.125rem}._Toast_1tme2_1 ._DismissButton_1tme2_59{position:absolute;width:1rem;height:1rem;display:flex;justify-content:center;align-items:center;top:0;right:1%;cursor:pointer;font-size:1.5rem;color:var(--chures-fg-muted, #9ca3af)}._slideIn_1tme2_79{animation:_slideIn_1tme2_79 .2s ease forwards}._slideOut_1tme2_83{animation:_slideOut_1tme2_83 .2s ease forwards}@keyframes _slideIn_1tme2_79{0%{opacity:0;transform:translate(2rem)}to{opacity:1;transform:translate(0)}}@keyframes _slideOut_1tme2_83{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(2rem)}}@keyframes _shimmer_1a08x_1{0%{background-position:-200% 0}to{background-position:200% 0}}._InputContainer_1a08x_6{position:relative;width:100%;height:var(--chures-input-height, 3rem)}._InputField_1a08x_12{width:100%;height:100%;background:var(--chures-input-bg, #111111);border:.0625rem solid rgb(255 255 255 / 13%);border-radius:var(--chures-input-radius, .75rem);color:var(--chures-fg, #ffffff);font-size:var(--chures-font-sm, .875rem);padding:0 .875rem;outline:none;transition:border-color .18s ease;box-sizing:border-box}._InputField_1a08x_12:focus{border-color:#ffffff59}._hasError_1a08x_30 ._InputField_1a08x_12,._hasError_1a08x_30 ._InputField_1a08x_12:focus{border-color:var(--chures-error, #ef4444)}._disabled_1a08x_35 ._InputField_1a08x_12{opacity:.45;cursor:not-allowed}._Label_1a08x_40{position:absolute;left:.875rem;top:50%;transform:translateY(-50%);transform-origin:left center;color:var(--chures-fg-muted, #9ca3af);font-size:var(--chures-font-sm, .875rem);pointer-events:none;transition:all .18s ease;padding:0 .25rem;border-radius:.1875rem}._Label_1a08x_40._lifted_1a08x_54{top:0;transform:translateY(-50%) scale(.82);background:var(--chures-input-bg, #111111);color:var(--chures-fg-muted, #9ca3af)}._hasError_1a08x_30 ._Label_1a08x_40._lifted_1a08x_54{color:var(--chures-error, #ef4444)}._ErrorText_1a08x_65{display:block;margin-top:.25rem;padding-left:.875rem;font-size:var(--chures-font-xs, .75rem);color:var(--chures-error, #ef4444)}._Skeleton_1a08x_73{width:100%;height:var(--chures-input-height, 3rem);border-radius:var(--chures-input-radius, .75rem);background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_1a08x_1 1.5s ease-in-out infinite}@keyframes _shimmer_im4lz_1{0%{background-position:-200% 0}to{background-position:200% 0}}._ToggleContainer_im4lz_6{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}._disabled_im4lz_13{opacity:.45;cursor:not-allowed}._Track_im4lz_18{position:relative;width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:var(--chures-toggle-bg-off, rgb(255 255 255 / 13%));border:none;padding:0;cursor:pointer;transition:background .2s ease;flex-shrink:0}._Track_im4lz_18._on_im4lz_31{background:var(--chures-toggle-bg-on, var(--chures-accent, #229ED9))}._disabled_im4lz_13 ._Track_im4lz_18{cursor:not-allowed}._Thumb_im4lz_39{position:absolute;top:50%;left:.1875rem;transform:translateY(-50%);width:var(--chures-toggle-thumb, 1.125rem);height:var(--chures-toggle-thumb, 1.125rem);border-radius:50%;background:var(--chures-toggle-thumb-color, #ffffff);transition:left .2s ease;pointer-events:none}._Track_im4lz_18._on_im4lz_31 ._Thumb_im4lz_39{left:calc(var(--chures-toggle-width, 2.75rem) - var(--chures-toggle-thumb, 1.125rem) - .1875rem)}._Label_im4lz_56{font-size:var(--chures-font-sm, .875rem);color:var(--chures-fg, #ffffff);-webkit-user-select:none;user-select:none}._LabelSkeleton_im4lz_62{display:inline-block;width:var(--chures-toggle-label-skeleton-w, 5rem);height:var(--chures-font-sm, .875rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}._Skeleton_im4lz_77{width:var(--chures-toggle-width, 2.75rem);height:var(--chures-toggle-height, 1.5rem);border-radius:624.9375rem;background:linear-gradient(90deg,var(--chures-input-bg, #111111) 25%,var(--chures-skeleton-shine, #1e1e1e) 50%,var(--chures-input-bg, #111111) 75%);background-size:200% 100%;animation:_shimmer_im4lz_1 1.5s ease-in-out infinite}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ (function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("framer-motion"),require("zustand")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","framer-motion","zustand"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.Chures={},l.ReactJSXRuntime,l.React,l.FramerMotion,l.Zustand))})(this,(function(l,e,f,W,A){"use strict";function E(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var C={exports:{}};var b;function B(){return b||(b=1,(function(o){(function(){var n={}.hasOwnProperty;function r(){for(var t="",s=0;s<arguments.length;s++){var c=arguments[s];c&&(t=i(t,a(c)))}return t}function a(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var s="";for(var c in t)n.call(t,c)&&t[c]&&(s=i(s,c));return s}function i(t,s){return s?t?t+" "+s:t+s:t}o.exports?(r.default=r,o.exports=r):window.classNames=r})()})(C)),C.exports}var F=B();const _=E(F),w={LoaderContainer:"_LoaderContainer_wa8op_24",sm:"_sm_wa8op_31",md:"_md_wa8op_32",lg:"_lg_wa8op_33",Arc1:"_Arc1_wa8op_37",Arc2:"_Arc2_wa8op_38",Arc3:"_Arc3_wa8op_39",spin:"_spin_wa8op_1",Ring1:"_Ring1_wa8op_71",Ring2:"_Ring2_wa8op_72",Ring3:"_Ring3_wa8op_73",ripple:"_ripple_wa8op_1",Dot1:"_Dot1_wa8op_86",Dot2:"_Dot2_wa8op_87",Dot3:"_Dot3_wa8op_88",dotPulse:"_dotPulse_wa8op_1",Wave1:"_Wave1_wa8op_105",Wave2:"_Wave2_wa8op_106",Wave3:"_Wave3_wa8op_107",Wave4:"_Wave4_wa8op_108",Wave5:"_Wave5_wa8op_109",waveBounce:"_waveBounce_wa8op_1"};function z(o,n){switch(o){case"ripple":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Ring1}),e.jsx("div",{className:n.Ring2}),e.jsx("div",{className:n.Ring3})]});case"dots":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Dot1}),e.jsx("div",{className:n.Dot2}),e.jsx("div",{className:n.Dot3})]});case"wave":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Wave1}),e.jsx("div",{className:n.Wave2}),e.jsx("div",{className:n.Wave3}),e.jsx("div",{className:n.Wave4}),e.jsx("div",{className:n.Wave5})]});default:return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.Arc1}),e.jsx("div",{className:n.Arc2}),e.jsx("div",{className:n.Arc3})]})}}function y({variant:o="arcs",size:n="md",color:r,className:a}){return e.jsx("div",{className:_(w.LoaderContainer,w[n],w[o],a),role:"status","aria-label":"Loading",style:r?{"--chures-accent":r}:void 0,children:z(o,w)})}const N={LoadingWrapperContainer:"_LoadingWrapperContainer_1q0w7_1",SkeletonWrapper:"_SkeletonWrapper_1q0w7_9"};function x({isLoading:o,children:n,skeleton:r,loaderProps:a,className:i}){return o?r?e.jsx("div",{className:_(N.SkeletonWrapper,i),children:r}):e.jsx("div",{className:_(N.LoadingWrapperContainer,i),children:e.jsx(y,{...a})}):e.jsx(e.Fragment,{children:n})}const O="https://oauth.telegram.org/js/telegram-login.js?3";function k(o){const{botId:n,redirectUri:r,requestAccess:a="write"}=o,i=f.useRef(o.onSuccess);i.current=o.onSuccess;const t=f.useRef(!1),[s,c]=f.useState(!1),[p,d]=f.useState(!1);f.useEffect(function(){if(!n)return;const T=r??window.location.origin;d(!0),c(!1);const m=document.createElement("script");return m.src=O,m.async=!0,m.onload=function(){const S=window.Telegram;S&&(S.Login.init({client_id:n,redirect_uri:T},function(V){t.current||(t.current=!0,i.current(V))}),c(!0)),d(!1)},m.onerror=function(){d(!1)},document.head.appendChild(m),function(){document.head.contains(m)&&document.head.removeChild(m),c(!1),d(!1)}},[n,r]);function v(){const T=window.Telegram;if(!s||!T)return;t.current=!1;const m=r??window.location.origin;T.Login.auth({client_id:n,redirect_uri:m,request_access:a},function(S){t.current||(t.current=!0,i.current(S))})}return{login:v,isReady:s,isLoading:p}}const L={TelegramSignInButtonContainer:"_TelegramSignInButtonContainer_10wun_1",FullSize:"_FullSize_10wun_46",Icon:"_Icon_10wun_50"},$={en:"Continue with Telegram",ru:"Войти через Telegram"};function q(){return e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",className:L.Icon,children:e.jsx("path",{d:"M22 3.5L2.5 11l5 1.7L18 6 9.7 14l-.4 5.5 3.4-3.2 5.5 4c.9.5 1.5.2 1.7-.8L22 4.3c.2-.7-.2-1.1-.9-.8z"})})}function D({onClick:o,disabled:n,lang:r="en",title:a,label:i,fullSize:t,className:s}){f.useEffect(function(){const d="comfortaa-font";if(document.getElementById(d))return;const v=document.createElement("link");v.id=d,v.rel="stylesheet",v.href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@600&display=swap",document.head.appendChild(v)},[]);const c=i??a??$[r],p=[L.TelegramSignInButtonContainer,t&&L.FullSize,s].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:p,onClick:o,disabled:n,children:[e.jsx(q,{}),c]})}function j({botId:o,onSuccess:n,lang:r,title:a,redirectUri:i,requestAccess:t,children:s,className:c}){const{login:p,isReady:d}=k({botId:o,onSuccess:n,redirectUri:i,requestAccess:t});return s?e.jsx(e.Fragment,{children:s({login:p,isReady:d})}):e.jsx(D,{onClick:p,disabled:!d,lang:r,title:a,className:c})}let P=0;const I=A.create((o,n)=>({toasts:[],bake:r=>{const a=P++;o(i=>({toasts:[...i.toasts,{...r,id:a}]})),setTimeout(()=>{n().dismiss(a)},5e3)},dismiss:r=>{o(a=>({toasts:a.toasts.filter(i=>i.id!==r)}))}})),g={ToastContainer:"_ToastContainer_1tme2_1",Toast:"_Toast_1tme2_1",error:"_error_1tme2_33",warn:"_warn_1tme2_41",info:"_info_1tme2_49",Description:"_Description_1tme2_53",DismissButton:"_DismissButton_1tme2_59",slideIn:"_slideIn_1tme2_79",slideOut:"_slideOut_1tme2_83"};function M(){const{toasts:o}=I();return e.jsx("div",{className:g.ToastContainer,children:e.jsx(W.AnimatePresence,{children:o.map(n=>e.jsx(W.motion.div,{layout:!0,initial:{opacity:0,x:100,y:50},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:-50},transition:{type:"spring",stiffness:300,damping:20},children:e.jsx(U,{...n})},n.id))})})}function U({id:o,title:n,description:r,level:a,isDismissable:i}){const[t,s]=f.useState(!1),c=I();return f.useEffect(()=>()=>{s(!0)},[]),e.jsxs("div",{className:_(g.Toast,{[g.error]:a==="Error",[g.warn]:a==="Warn",[g.info]:a==null||a==="Info",[g.slideIn]:!t,[g.slideOut]:t}),children:[e.jsx("div",{children:n}),e.jsx("div",{className:g.Description,children:r}),i&&o!==void 0&&e.jsx("div",{className:g.DismissButton,onClick:()=>c.dismiss(o),children:"×"})]})}const h={InputContainer:"_InputContainer_1a08x_6",InputField:"_InputField_1a08x_12",hasError:"_hasError_1a08x_30",disabled:"_disabled_1a08x_35",Label:"_Label_1a08x_40",lifted:"_lifted_1a08x_54",ErrorText:"_ErrorText_1a08x_65",Skeleton:"_Skeleton_1a08x_73"};function G({value:o,setValue:n,label:r,isLoader:a,type:i="text",disabled:t,error:s,className:c}){const[p,d]=f.useState(!1),v=p||o.length>0;return a?e.jsx("div",{className:_(h.Skeleton,c),"aria-hidden":"true"}):e.jsxs("div",{className:_(h.InputContainer,{[h.hasError]:!!s,[h.disabled]:t},c),children:[e.jsx("input",{className:h.InputField,type:i,value:o,onChange:T=>n(T.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),disabled:t}),e.jsx("label",{className:_(h.Label,{[h.lifted]:v}),children:r}),s&&e.jsx("span",{className:h.ErrorText,children:s})]})}const u={ToggleContainer:"_ToggleContainer_im4lz_6",disabled:"_disabled_im4lz_13",Track:"_Track_im4lz_18",on:"_on_im4lz_31",Thumb:"_Thumb_im4lz_39",Label:"_Label_im4lz_56",LabelSkeleton:"_LabelSkeleton_im4lz_62",Skeleton:"_Skeleton_im4lz_77"};function J({checked:o,onChange:n,label:r,labelPosition:a="right",disabled:i,isLoader:t,isLoadingLabel:s,className:c}){const p=!!r||s,d=s?e.jsx("span",{className:u.LabelSkeleton,"aria-hidden":"true"}):r?e.jsx("span",{className:u.Label,children:r}):null;return t?p?e.jsxs("div",{className:_(u.ToggleContainer,c),children:[a==="left"&&d,e.jsx("div",{className:u.Skeleton,"aria-hidden":"true"}),a==="right"&&d]}):e.jsx("div",{className:_(u.Skeleton,c),"aria-hidden":"true"}):e.jsxs("label",{className:_(u.ToggleContainer,{[u.disabled]:i},c),children:[a==="left"&&d,e.jsx("button",{role:"switch","aria-checked":o,className:_(u.Track,{[u.on]:o}),onClick:()=>!i&&n(!o),disabled:i,type:"button",children:e.jsx("span",{className:u.Thumb})}),a==="right"&&d]})}l.Input=G,l.Loader=y,l.LoadingWrapper=x,l.TelegramAuth=j,l.TelegramSignInButton=D,l.Toaster=M,l.Toggle=J,l.useTelegramLogin=k,l.useToaster=I,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ value: string;
3
+ setValue: (v: string) => void;
4
+ label: string;
5
+ isLoader?: boolean;
6
+ type?: 'text' | 'password' | 'email' | 'number';
7
+ disabled?: boolean;
8
+ error?: string;
9
+ className?: string;
10
+ }
11
+ export type InputProps = Props;
12
+ export declare function Input({ value, setValue, label, isLoader, type, disabled, error, className }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ variant?: 'arcs' | 'ripple' | 'dots' | 'wave';
3
+ size?: 'sm' | 'md' | 'lg';
4
+ color?: string;
5
+ className?: string;
6
+ }
7
+ export type LoaderProps = Props;
8
+ export declare function Loader({ variant, size, color, className }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { LoaderProps } from './Loader';
2
+ interface Props {
3
+ isLoading: boolean;
4
+ children: React.ReactNode;
5
+ skeleton?: React.ReactNode;
6
+ loaderProps?: LoaderProps;
7
+ className?: string;
8
+ }
9
+ export type LoadingWrapperProps = Props;
10
+ export declare function LoadingWrapper({ isLoading, children, skeleton, loaderProps, className }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ interface Props {
2
+ checked: boolean;
3
+ onChange: (checked: boolean) => void;
4
+ label?: string;
5
+ labelPosition?: 'left' | 'right';
6
+ disabled?: boolean;
7
+ isLoader?: boolean;
8
+ isLoadingLabel?: boolean;
9
+ className?: string;
10
+ }
11
+ export type ToggleProps = Props;
12
+ export declare function Toggle({ checked, onChange, label, labelPosition, disabled, isLoader, isLoadingLabel, className }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,7 +1,15 @@
1
+ export { Loader } from './components/Loader';
2
+ export type { LoaderProps } from './components/Loader';
3
+ export { LoadingWrapper } from './components/LoadingWrapper';
4
+ export type { LoadingWrapperProps } from './components/LoadingWrapper';
1
5
  export { TelegramAuth } from './components/TelegramAuth';
2
6
  export { default as Toaster } from './components/notifications/Toaster';
3
7
  export { useToaster } from './hooks/toaster/useToaster';
4
8
  export type { Toast, ToasterStore } from './hooks/toaster/useToaster';
9
+ export { Input } from './components/Input';
10
+ export type { InputProps } from './components/Input';
11
+ export { Toggle } from './components/Toggle';
12
+ export type { ToggleProps } from './components/Toggle';
5
13
  export { TelegramSignInButton } from './components/TelegramSignInButton';
6
14
  export { useTelegramLogin } from './hooks/useTelegramLogin';
7
15
  export type { TelegramAuthProps } from './components/TelegramAuth';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vervstack/chures",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "React components and hooks for Telegram OAuth login and toast notifications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -52,6 +52,7 @@
52
52
  "@types/react-dom": "^19.0.0",
53
53
  "@vitejs/plugin-react": "^4.5.2",
54
54
  "framer-motion": "^12.40.0",
55
+ "react-tooltip": "^6.0.7",
55
56
  "typescript": "~5.8.3",
56
57
  "vite": "^7.3.1",
57
58
  "vite-plugin-css-injected-by-js": "^3.5.2",