iccandle-widget-fully 0.1.1 → 0.1.2
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/entries/suite/dist/widget-suite.js +194 -185
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode('.icc-auth{--icc-primary: #00dfb9;--icc-bg: #ffffff;--icc-border: #e5e7eb;--icc-text: #0b0b0b;--icc-muted: #6b7280;display:flex;height:100%;width:100%;align-items:center;justify-content:center;padding:16px;font-family:Inter Tight,ui-sans-serif,system-ui,sans-serif;color:var(--icc-text)}.iccandle-dark .icc-auth,.icc-auth.icc-dark{--icc-bg: #1a1a1a;--icc-border: rgba(255, 255, 255, .14);--icc-text: #ffffff;--icc-muted: #9ca3af}.icc-auth__stack{display:flex;flex-direction:column;align-items:center;gap:20px;width:100%;max-width:520px}.icc-auth__logo{display:flex;align-items:center;gap:10px}.icc-auth__logo-text{font-size:26px;font-weight:600;letter-spacing:.5px}.icc-auth__tagline{text-align:center;font-size:28px;line-height:1.15;font-weight:700;margin:0;max-width:380px;background:linear-gradient(90deg,#34d3b0,#4fd1c5);-webkit-background-clip:text;background-clip:text;color:transparent}.icc-auth__card{width:100%;max-width:520px;border:1px solid var(--icc-border);border-radius:16px;background:var(--icc-bg);overflow:hidden}.icc-auth__section{padding:16px}.icc-auth__turnstile{margin-bottom:14px}.icc-auth__btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;height:40px;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:background-color .15s ease}.icc-auth__btn--outline{border:1px solid var(--icc-border);background:var(--icc-bg);color:var(--icc-text)}.icc-auth__btn--outline:hover{background:color-mix(in srgb,var(--icc-text) 6%,transparent)}.icc-auth__btn--primary{border:1px solid color-mix(in srgb,var(--icc-primary) 50%,transparent);background:color-mix(in srgb,var(--icc-primary) 12%,transparent);color:var(--icc-text)}.icc-auth__btn--primary:hover{background:color-mix(in srgb,var(--icc-primary) 22%,transparent)}.icc-auth__btn:disabled{opacity:.5;cursor:not-allowed}.icc-auth__divider{display:flex;align-items:center;gap:12px;padding:0 16px}.icc-auth__divider:before,.icc-auth__divider:after{content:"";height:1px;flex:1;background:var(--icc-border)}.icc-auth__divider span{font-weight:600;color:var(--icc-muted);font-size:13px}.icc-auth__field{margin-bottom:14px}.icc-auth__label{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:500;margin-bottom:6px}.icc-auth__input-wrap{position:relative}.icc-auth__input{width:100%;height:40px;border-radius:6px;border:1px solid var(--icc-border);background:var(--icc-bg);color:var(--icc-text);padding:8px 12px;font-size:14px;box-sizing:border-box;outline:none}.icc-auth__input:focus{border-color:var(--icc-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--icc-primary) 25%,transparent)}.icc-auth__eye{position:absolute;top:9px;right:10px;cursor:pointer;color:var(--icc-muted);background:none;border:none;padding:0;font-size:12px}.icc-auth__link{color:var(--icc-primary);text-decoration:underline;cursor:pointer;font-weight:600;background:none;border:none;padding:0;font-size:inherit}.icc-auth__foot{text-align:center;color:var(--icc-muted);padding-bottom:16px;font-size:14px}.icc-auth__msg{padding:0 16px 8px;font-size:12px;color:var(--icc-muted)}.icc-auth__msg--error{color:#ef4444}')),document.head.appendChild(i)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
import { jsx as e, jsxs as n, Fragment as ie } from "react/jsx-runtime";
|
|
3
|
-
import he, { useState as _, useEffect as se } from "react";
|
|
4
|
-
import { SelectorWidget as
|
|
5
|
-
import { PatternTrackerWidget as
|
|
6
|
-
import { NewsWidget as
|
|
7
|
-
import { useIccandleAuth as ne, IccandleAuthProvider as
|
|
8
|
-
import { useBilling as
|
|
9
|
-
function
|
|
3
|
+
import he, { useState as _, useEffect as se, useMemo as ge } from "react";
|
|
4
|
+
import { SelectorWidget as be, PatternView as me } from "iccandle-widget-fully/selector";
|
|
5
|
+
import { PatternTrackerWidget as ye } from "iccandle-widget-fully/pattern-tracker";
|
|
6
|
+
import { NewsWidget as ve } from "iccandle-widget-fully/news";
|
|
7
|
+
import { useIccandleAuth as ne, IccandleAuthProvider as _e, decodeJwtPayload as xe } from "iccandle-widget-fully/auth";
|
|
8
|
+
import { useBilling as we } from "iccandle-widget-fully/payment";
|
|
9
|
+
function Se(t) {
|
|
10
10
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (le) return
|
|
12
|
+
var k = {}, le;
|
|
13
|
+
function ke() {
|
|
14
|
+
if (le) return k;
|
|
15
15
|
le = 1;
|
|
16
|
-
var t =
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
(!
|
|
20
|
-
return l[
|
|
21
|
-
} }), Object.defineProperty(i,
|
|
22
|
-
}) : (function(i, l,
|
|
23
|
-
|
|
24
|
-
})), r =
|
|
16
|
+
var t = k && k.__createBinding || (Object.create ? (function(i, l, f, h) {
|
|
17
|
+
h === void 0 && (h = f);
|
|
18
|
+
var y = Object.getOwnPropertyDescriptor(l, f);
|
|
19
|
+
(!y || ("get" in y ? !l.__esModule : y.writable || y.configurable)) && (y = { enumerable: !0, get: function() {
|
|
20
|
+
return l[f];
|
|
21
|
+
} }), Object.defineProperty(i, h, y);
|
|
22
|
+
}) : (function(i, l, f, h) {
|
|
23
|
+
h === void 0 && (h = f), i[h] = l[f];
|
|
24
|
+
})), r = k && k.__setModuleDefault || (Object.create ? (function(i, l) {
|
|
25
25
|
Object.defineProperty(i, "default", { enumerable: !0, value: l });
|
|
26
26
|
}) : function(i, l) {
|
|
27
27
|
i.default = l;
|
|
28
|
-
}), a =
|
|
28
|
+
}), a = k && k.__importStar || function(i) {
|
|
29
29
|
if (i && i.__esModule) return i;
|
|
30
30
|
var l = {};
|
|
31
|
-
if (i != null) for (var
|
|
31
|
+
if (i != null) for (var f in i) f !== "default" && Object.prototype.hasOwnProperty.call(i, f) && t(l, i, f);
|
|
32
32
|
return r(l, i), l;
|
|
33
33
|
};
|
|
34
|
-
Object.defineProperty(
|
|
34
|
+
Object.defineProperty(k, "__esModule", { value: !0 }), k.useTurnstile = k.Turnstile = void 0;
|
|
35
35
|
const d = a(he), u = typeof globalThis < "u" ? globalThis : window;
|
|
36
36
|
let c = typeof u.turnstile < "u" ? "ready" : "unloaded", o, x;
|
|
37
37
|
const b = new Promise((i, l) => {
|
|
@@ -44,15 +44,15 @@ function we() {
|
|
|
44
44
|
c = "loading", u[i] = () => {
|
|
45
45
|
x.resolve(), c = "ready", delete u[i];
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const f = `${l}?onload=${i}&render=explicit`, h = document.createElement("script");
|
|
48
|
+
h.src = f, h.async = !0, h.addEventListener("error", () => {
|
|
49
49
|
x.reject("Failed to load Turnstile."), delete u[i];
|
|
50
|
-
}), document.head.appendChild(
|
|
50
|
+
}), document.head.appendChild(h);
|
|
51
51
|
}
|
|
52
52
|
return b;
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function m({ id: i, className: l, style: f, sitekey: h, action: y, cData: B, theme: T, language: A, tabIndex: N, responseField: I, responseFieldName: C, size: v, fixedSize: D, retry: z, retryInterval: P, refreshExpired: $, appearance: g, execution: j, userRef: L, onVerify: U, onSuccess: H, onLoad: G, onError: Z, onExpire: K, onTimeout: V, onAfterInteractive: q, onBeforeInteractive: Q, onUnsupported: Y }) {
|
|
56
56
|
const ue = (0, d.useRef)(null), s = (0, d.useState)({
|
|
57
57
|
onVerify: U,
|
|
58
58
|
onSuccess: H,
|
|
@@ -63,15 +63,15 @@ function we() {
|
|
|
63
63
|
onAfterInteractive: q,
|
|
64
64
|
onBeforeInteractive: Q,
|
|
65
65
|
onUnsupported: Y
|
|
66
|
-
})[0], M =
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
69
|
-
...
|
|
70
|
-
} :
|
|
66
|
+
})[0], M = L ?? ue, pe = D ? {
|
|
67
|
+
width: v === "compact" ? "130px" : v === "flexible" ? "100%" : "300px",
|
|
68
|
+
height: v === "compact" ? "120px" : "65px",
|
|
69
|
+
...f
|
|
70
|
+
} : f;
|
|
71
71
|
return (0, d.useEffect)(() => {
|
|
72
72
|
if (!M.current)
|
|
73
73
|
return;
|
|
74
|
-
let ae = !1,
|
|
74
|
+
let ae = !1, W = "";
|
|
75
75
|
return (async () => {
|
|
76
76
|
var X, J;
|
|
77
77
|
if (c !== "ready")
|
|
@@ -85,31 +85,31 @@ function we() {
|
|
|
85
85
|
return;
|
|
86
86
|
let F;
|
|
87
87
|
const fe = {
|
|
88
|
-
sitekey:
|
|
89
|
-
action:
|
|
90
|
-
cData:
|
|
91
|
-
theme:
|
|
92
|
-
language:
|
|
93
|
-
tabindex:
|
|
94
|
-
"response-field":
|
|
95
|
-
"response-field-name":
|
|
96
|
-
size:
|
|
88
|
+
sitekey: h,
|
|
89
|
+
action: y,
|
|
90
|
+
cData: B,
|
|
91
|
+
theme: T,
|
|
92
|
+
language: A,
|
|
93
|
+
tabindex: N,
|
|
94
|
+
"response-field": I,
|
|
95
|
+
"response-field-name": C,
|
|
96
|
+
size: v,
|
|
97
97
|
retry: z,
|
|
98
|
-
"retry-interval":
|
|
98
|
+
"retry-interval": P,
|
|
99
99
|
"refresh-expired": $,
|
|
100
100
|
appearance: g,
|
|
101
101
|
execution: j,
|
|
102
|
-
callback: (p,
|
|
102
|
+
callback: (p, E) => {
|
|
103
103
|
var ee, te;
|
|
104
|
-
(ee = s.onVerify) === null || ee === void 0 || ee.call(s, p, F), (te = s.onSuccess) === null || te === void 0 || te.call(s, p,
|
|
104
|
+
(ee = s.onVerify) === null || ee === void 0 || ee.call(s, p, F), (te = s.onSuccess) === null || te === void 0 || te.call(s, p, E, F);
|
|
105
105
|
},
|
|
106
106
|
"error-callback": (p) => {
|
|
107
|
-
var
|
|
108
|
-
return (
|
|
107
|
+
var E;
|
|
108
|
+
return (E = s.onError) === null || E === void 0 ? void 0 : E.call(s, p, F);
|
|
109
109
|
},
|
|
110
110
|
"expired-callback": (p) => {
|
|
111
|
-
var
|
|
112
|
-
return (
|
|
111
|
+
var E;
|
|
112
|
+
return (E = s.onExpire) === null || E === void 0 ? void 0 : E.call(s, p, F);
|
|
113
113
|
},
|
|
114
114
|
"timeout-callback": () => {
|
|
115
115
|
var p;
|
|
@@ -128,22 +128,22 @@ function we() {
|
|
|
128
128
|
return (p = s.onUnsupported) === null || p === void 0 ? void 0 : p.call(s, F);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
W = window.turnstile.render(M.current, fe), F = S(W), (J = s.onLoad) === null || J === void 0 || J.call(s, W, F);
|
|
132
132
|
})(), () => {
|
|
133
|
-
ae = !0,
|
|
133
|
+
ae = !0, W && window.turnstile.remove(W);
|
|
134
134
|
};
|
|
135
135
|
}, [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
N,
|
|
139
|
-
E,
|
|
140
|
-
k,
|
|
141
|
-
T,
|
|
142
|
-
W,
|
|
136
|
+
h,
|
|
137
|
+
y,
|
|
143
138
|
B,
|
|
139
|
+
T,
|
|
140
|
+
A,
|
|
141
|
+
N,
|
|
142
|
+
I,
|
|
144
143
|
C,
|
|
144
|
+
v,
|
|
145
145
|
z,
|
|
146
|
-
|
|
146
|
+
P,
|
|
147
147
|
$,
|
|
148
148
|
g,
|
|
149
149
|
j
|
|
@@ -161,8 +161,8 @@ function we() {
|
|
|
161
161
|
Y
|
|
162
162
|
]), d.default.createElement("div", { ref: M, id: i, className: l, style: pe });
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
function
|
|
164
|
+
k.Turnstile = m, k.default = m;
|
|
165
|
+
function S(i) {
|
|
166
166
|
return {
|
|
167
167
|
execute: (l) => window.turnstile.execute(i, l),
|
|
168
168
|
reset: () => window.turnstile.reset(i),
|
|
@@ -170,17 +170,17 @@ function we() {
|
|
|
170
170
|
isExpired: () => window.turnstile.isExpired(i)
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function w() {
|
|
174
174
|
const [i, l] = (0, d.useState)(c);
|
|
175
175
|
return (0, d.useEffect)(() => {
|
|
176
176
|
c !== "ready" && b.then(() => l(c));
|
|
177
177
|
}, []), u.turnstile;
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return k.useTurnstile = w, k;
|
|
180
180
|
}
|
|
181
|
-
var
|
|
182
|
-
const
|
|
183
|
-
function
|
|
181
|
+
var Ce = ke();
|
|
182
|
+
const Te = /* @__PURE__ */ Se(Ce), Fe = "0x4AAAAAAA6sL3ZLXFrjySJ8", Ae = "Designed for Traders Who Value Insight Over Noise";
|
|
183
|
+
function Ne() {
|
|
184
184
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 48 48", "aria-hidden": !0, children: [
|
|
185
185
|
/* @__PURE__ */ e("path", { fill: "#EA4335", d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" }),
|
|
186
186
|
/* @__PURE__ */ e("path", { fill: "#4285F4", d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" }),
|
|
@@ -188,7 +188,7 @@ function Fe() {
|
|
|
188
188
|
/* @__PURE__ */ e("path", { fill: "#34A853", d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" })
|
|
189
189
|
] });
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ee({ dark: t }) {
|
|
192
192
|
return /* @__PURE__ */ e("div", { className: "icc-auth__logo", children: /* @__PURE__ */ e(
|
|
193
193
|
"img",
|
|
194
194
|
{
|
|
@@ -198,39 +198,39 @@ function Ae({ dark: t }) {
|
|
|
198
198
|
}
|
|
199
199
|
) });
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const { signIn: r, signUp: a, confirm: d, signInWithGoogle: u, loading: c } = ne(), [o, x] = _("signIn"), [b,
|
|
203
|
-
|
|
201
|
+
function Be({ dark: t = !1 }) {
|
|
202
|
+
const { signIn: r, signUp: a, confirm: d, signInWithGoogle: u, loading: c } = ne(), [o, x] = _("signIn"), [b, m] = _(""), [S, w] = _(""), [i, l] = _(""), [f, h] = _(""), [y, B] = _(!1), [T, A] = _(!1), [N, I] = _(""), [C, v] = _(null), D = async (g, j) => {
|
|
203
|
+
v(null);
|
|
204
204
|
try {
|
|
205
|
-
await g(),
|
|
206
|
-
} catch (
|
|
207
|
-
|
|
205
|
+
await g(), v({ text: j });
|
|
206
|
+
} catch (L) {
|
|
207
|
+
v({ text: L?.message ?? "Something went wrong", error: !0 });
|
|
208
208
|
}
|
|
209
209
|
}, z = (g) => {
|
|
210
210
|
if (g.preventDefault(), o === "signIn") {
|
|
211
|
-
if (!
|
|
212
|
-
|
|
211
|
+
if (!T) {
|
|
212
|
+
A(!0);
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
|
-
D(() => r(b,
|
|
215
|
+
D(() => r(b, S, N), "Signed in.");
|
|
216
216
|
} else if (o === "signUp") {
|
|
217
|
-
if (
|
|
218
|
-
|
|
217
|
+
if (S !== i) {
|
|
218
|
+
v({ text: "Passwords must match", error: !0 });
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
D(async () => {
|
|
222
|
-
await a(b,
|
|
222
|
+
await a(b, S, N), x("confirm");
|
|
223
223
|
}, "Check your email for the confirmation code.");
|
|
224
224
|
} else
|
|
225
225
|
D(async () => {
|
|
226
|
-
await d(b,
|
|
226
|
+
await d(b, f, N), x("signIn"), A(!0);
|
|
227
227
|
}, "Confirmed — you can sign in now.");
|
|
228
|
-
},
|
|
229
|
-
x(g),
|
|
228
|
+
}, P = (g) => {
|
|
229
|
+
x(g), A(!1), v(null);
|
|
230
230
|
};
|
|
231
231
|
return /* @__PURE__ */ e("div", { className: `icc-auth${t ? " icc-dark" : ""}`, children: /* @__PURE__ */ n("div", { className: "icc-auth__stack", children: [
|
|
232
|
-
/* @__PURE__ */ e(
|
|
233
|
-
/* @__PURE__ */ e("p", { className: "icc-auth__tagline", children:
|
|
232
|
+
/* @__PURE__ */ e(Ee, { dark: t }),
|
|
233
|
+
/* @__PURE__ */ e("p", { className: "icc-auth__tagline", children: Ae }),
|
|
234
234
|
/* @__PURE__ */ n("div", { className: "icc-auth__card", children: [
|
|
235
235
|
/* @__PURE__ */ e("div", { className: "icc-auth__section", children: /* @__PURE__ */ n(
|
|
236
236
|
"button",
|
|
@@ -239,7 +239,7 @@ function Ne({ dark: t = !1 }) {
|
|
|
239
239
|
className: "icc-auth__btn icc-auth__btn--outline",
|
|
240
240
|
onClick: u,
|
|
241
241
|
children: [
|
|
242
|
-
/* @__PURE__ */ e(
|
|
242
|
+
/* @__PURE__ */ e(Ne, {}),
|
|
243
243
|
" Continue with Google"
|
|
244
244
|
]
|
|
245
245
|
}
|
|
@@ -254,11 +254,11 @@ function Ne({ dark: t = !1 }) {
|
|
|
254
254
|
placeholder: "Enter your personal or work email",
|
|
255
255
|
autoComplete: "username",
|
|
256
256
|
value: b,
|
|
257
|
-
onChange: (g) =>
|
|
257
|
+
onChange: (g) => m(g.target.value),
|
|
258
258
|
required: !0
|
|
259
259
|
}
|
|
260
260
|
) }) }),
|
|
261
|
-
o !== "confirm" && (
|
|
261
|
+
o !== "confirm" && (T || o === "signUp") && /* @__PURE__ */ n("div", { className: "icc-auth__field", children: [
|
|
262
262
|
/* @__PURE__ */ n("div", { className: "icc-auth__label", children: [
|
|
263
263
|
/* @__PURE__ */ e("span", { children: "Password" }),
|
|
264
264
|
o === "signIn" && /* @__PURE__ */ e(
|
|
@@ -267,7 +267,7 @@ function Ne({ dark: t = !1 }) {
|
|
|
267
267
|
type: "button",
|
|
268
268
|
className: "icc-auth__link",
|
|
269
269
|
style: { fontSize: 12 },
|
|
270
|
-
onClick: () =>
|
|
270
|
+
onClick: () => v({ text: "Password recovery is available on app.iccandle.ai" }),
|
|
271
271
|
children: "Forgot password?"
|
|
272
272
|
}
|
|
273
273
|
)
|
|
@@ -277,11 +277,11 @@ function Ne({ dark: t = !1 }) {
|
|
|
277
277
|
"input",
|
|
278
278
|
{
|
|
279
279
|
className: "icc-auth__input",
|
|
280
|
-
type:
|
|
280
|
+
type: y ? "text" : "password",
|
|
281
281
|
placeholder: "********",
|
|
282
282
|
autoComplete: o === "signIn" ? "current-password" : "new-password",
|
|
283
|
-
value:
|
|
284
|
-
onChange: (g) =>
|
|
283
|
+
value: S,
|
|
284
|
+
onChange: (g) => w(g.target.value),
|
|
285
285
|
required: !0
|
|
286
286
|
}
|
|
287
287
|
),
|
|
@@ -290,8 +290,8 @@ function Ne({ dark: t = !1 }) {
|
|
|
290
290
|
{
|
|
291
291
|
type: "button",
|
|
292
292
|
className: "icc-auth__eye",
|
|
293
|
-
onClick: () =>
|
|
294
|
-
children:
|
|
293
|
+
onClick: () => B((g) => !g),
|
|
294
|
+
children: y ? "Hide" : "Show"
|
|
295
295
|
}
|
|
296
296
|
)
|
|
297
297
|
] })
|
|
@@ -302,7 +302,7 @@ function Ne({ dark: t = !1 }) {
|
|
|
302
302
|
"input",
|
|
303
303
|
{
|
|
304
304
|
className: "icc-auth__input",
|
|
305
|
-
type:
|
|
305
|
+
type: y ? "text" : "password",
|
|
306
306
|
placeholder: "********",
|
|
307
307
|
autoComplete: "new-password",
|
|
308
308
|
value: i,
|
|
@@ -318,38 +318,38 @@ function Ne({ dark: t = !1 }) {
|
|
|
318
318
|
{
|
|
319
319
|
className: "icc-auth__input",
|
|
320
320
|
placeholder: "Code from your email",
|
|
321
|
-
value:
|
|
322
|
-
onChange: (g) =>
|
|
321
|
+
value: f,
|
|
322
|
+
onChange: (g) => h(g.target.value),
|
|
323
323
|
required: !0
|
|
324
324
|
}
|
|
325
325
|
) })
|
|
326
326
|
] }),
|
|
327
327
|
/* @__PURE__ */ e("div", { className: "icc-auth__turnstile", children: /* @__PURE__ */ e(
|
|
328
|
-
|
|
328
|
+
Te,
|
|
329
329
|
{
|
|
330
|
-
sitekey:
|
|
330
|
+
sitekey: Fe,
|
|
331
331
|
size: "flexible",
|
|
332
332
|
theme: t ? "dark" : "light",
|
|
333
|
-
onVerify: (g) =>
|
|
333
|
+
onVerify: (g) => I(g)
|
|
334
334
|
}
|
|
335
335
|
) }),
|
|
336
336
|
/* @__PURE__ */ e("button", { type: "submit", className: "icc-auth__btn icc-auth__btn--primary", disabled: c, children: c ? "…" : o === "signUp" ? "Create account" : o === "confirm" ? "Confirm" : "Continue with email" })
|
|
337
337
|
] }),
|
|
338
|
-
|
|
338
|
+
C && /* @__PURE__ */ e("p", { className: `icc-auth__msg${C.error ? " icc-auth__msg--error" : ""}`, children: C.text }),
|
|
339
339
|
/* @__PURE__ */ e("p", { className: "icc-auth__foot", children: o === "signIn" ? /* @__PURE__ */ n(ie, { children: [
|
|
340
340
|
"Don't have an account?",
|
|
341
341
|
" ",
|
|
342
|
-
/* @__PURE__ */ e("button", { type: "button", className: "icc-auth__link", onClick: () =>
|
|
342
|
+
/* @__PURE__ */ e("button", { type: "button", className: "icc-auth__link", onClick: () => P("signUp"), children: "Sign up" })
|
|
343
343
|
] }) : /* @__PURE__ */ n(ie, { children: [
|
|
344
344
|
"Already have an account?",
|
|
345
345
|
" ",
|
|
346
|
-
/* @__PURE__ */ e("button", { type: "button", className: "icc-auth__link", onClick: () =>
|
|
346
|
+
/* @__PURE__ */ e("button", { type: "button", className: "icc-auth__link", onClick: () => P("signIn"), children: "Sign in" })
|
|
347
347
|
] }) })
|
|
348
348
|
] })
|
|
349
349
|
] }) });
|
|
350
350
|
}
|
|
351
|
-
const
|
|
352
|
-
function
|
|
351
|
+
const Ie = "https://api.iccandle.ai";
|
|
352
|
+
function Re(t) {
|
|
353
353
|
const [r, a] = _(null), [d, u] = _(!1);
|
|
354
354
|
return se(() => {
|
|
355
355
|
if (!t) {
|
|
@@ -357,7 +357,7 @@ function Be(t) {
|
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
let c = !1;
|
|
360
|
-
return u(!0), fetch(`${
|
|
360
|
+
return u(!0), fetch(`${Ie}/credits/v1/me`, {
|
|
361
361
|
headers: { Authorization: `Bearer ${t}` }
|
|
362
362
|
}).then((o) => o.ok ? o.json() : null).then((o) => {
|
|
363
363
|
c || a(o);
|
|
@@ -374,17 +374,17 @@ const R = {
|
|
|
374
374
|
standard: { yearly: "price_1Su8TwQcDufIB3EhIDjPpP7A", monthly: "price_1SohFOQcDufIB3EhCZj741Hc" },
|
|
375
375
|
pro: { yearly: "price_1Su8VoQcDufIB3Ehi8I6Mrgw", monthly: "price_1SrttvQcDufIB3EhrbVPNR3w" },
|
|
376
376
|
expert: { yearly: "price_1Su8Y9QcDufIB3Ehvjj1QT0B", monthly: "price_1SrtlJQcDufIB3EhWM5BSUl4" }
|
|
377
|
-
},
|
|
377
|
+
}, De = {
|
|
378
378
|
free: "Free",
|
|
379
379
|
standard: "Standard",
|
|
380
380
|
pro: "Pro",
|
|
381
381
|
expert: "Expert"
|
|
382
|
-
},
|
|
383
|
-
function
|
|
382
|
+
}, Pe = { free: 0, standard: 1, pro: 2, expert: 3 };
|
|
383
|
+
function Le(t) {
|
|
384
384
|
const r = (t ?? "free").toLowerCase();
|
|
385
385
|
return r === "standard" || r === "pro" || r === "expert" ? r : "free";
|
|
386
386
|
}
|
|
387
|
-
const
|
|
387
|
+
const We = {
|
|
388
388
|
free: {
|
|
389
389
|
news: { limit_daily: 1, rpm: 1 },
|
|
390
390
|
pattern: { limit: 0, webhook: 0 },
|
|
@@ -409,14 +409,14 @@ const Pe = {
|
|
|
409
409
|
search: { candle_limit: 3e4, limit_daily: 300, tabs: 15, available_resolutions: "Unlimited", results_limit: 200, rpm: 30, symbols: "all" },
|
|
410
410
|
chat: { limit_daily: 350, rpm: 20 }
|
|
411
411
|
}
|
|
412
|
-
},
|
|
412
|
+
}, ze = {
|
|
413
413
|
free: { patternSelector: 1, patternTracker: 0, newsImpact: 1, scanResults: 10, activeTabs: 7 },
|
|
414
414
|
standard: { patternSelector: 17, patternTracker: 15, newsImpact: 17, scanResults: 30, activeTabs: 20 },
|
|
415
415
|
pro: { patternSelector: 33, patternTracker: 50, newsImpact: 33, scanResults: 50, activeTabs: 67 },
|
|
416
416
|
expert: { patternSelector: 100, patternTracker: 100, newsImpact: 100, scanResults: 100, activeTabs: 100 }
|
|
417
417
|
};
|
|
418
418
|
function O(t) {
|
|
419
|
-
const r =
|
|
419
|
+
const r = We[t], a = ze[t];
|
|
420
420
|
return [
|
|
421
421
|
{ label: "Pattern Selector", value: `${r.search.limit_daily} scans per day`, progress: a.patternSelector, isZero: a.patternSelector === 0, showProgress: !0 },
|
|
422
422
|
{ label: "Pattern Tracker", value: `${r.pattern.limit}`, progress: a.patternTracker, isZero: a.patternTracker === 0, showProgress: !0 },
|
|
@@ -427,7 +427,7 @@ function O(t) {
|
|
|
427
427
|
{ label: "Webhook", value: r.pattern.webhook > 0 ? "Enabled" : "Disabled", progress: null, isZero: r.pattern.webhook === 0, showProgress: !1 }
|
|
428
428
|
];
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function je(t) {
|
|
431
431
|
const r = (a, d) => `$${t ? a : d}`;
|
|
432
432
|
return [
|
|
433
433
|
{ title: "Free", subtitle: "Explore and try", badgeText: "Free", price: "$0", priceSuffix: "Free for everyone", isFree: !0, isBest: !1, plan: "free", tier: 0, features: O("free") },
|
|
@@ -436,53 +436,53 @@ function We(t) {
|
|
|
436
436
|
{ title: "Expert", subtitle: "Analyze without limits", badgeText: "Maximum Access", price: r(127, 159), priceSuffix: "USD/month", isFree: !1, isBest: !1, plan: "expert", tier: 3, productKey: t ? R.expert.yearly : R.expert.monthly, features: O("expert") }
|
|
437
437
|
];
|
|
438
438
|
}
|
|
439
|
-
const
|
|
439
|
+
const Me = "#00DFB9", Oe = "#FFB84D", re = "#ffffff", oe = "#808080", ce = "linear-gradient(to bottom, #171717 0%, #0A0A0A 100%)", de = "#262626", $e = "#2c2c2c", Ue = "#2a2a2a", He = "#E0E0E0", Ge = "#0d0d0d", Ze = {
|
|
440
440
|
free: { border: "1px solid rgba(255,255,255,0.2)", background: "rgba(255,255,255,0.1)", color: "#fff" },
|
|
441
441
|
standard: { background: "#00BFA5", color: "#fff" },
|
|
442
442
|
pro: { background: "linear-gradient(to right, #FFB42D, #007964)", color: "#fff" },
|
|
443
443
|
expert: { background: "linear-gradient(to right, #ffb84d, #ff8c00)", color: "#fff" }
|
|
444
444
|
};
|
|
445
|
-
function
|
|
446
|
-
return t === "pro" ? { background: "linear-gradient(90deg, #FFB42D 41.35%, #00DFB9 100%)", WebkitBackgroundClip: "text", backgroundClip: "text", color: "transparent", fontWeight: 600 } : t === "expert" ? { color:
|
|
445
|
+
function Ke(t) {
|
|
446
|
+
return t === "pro" ? { background: "linear-gradient(90deg, #FFB42D 41.35%, #00DFB9 100%)", WebkitBackgroundClip: "text", backgroundClip: "text", color: "transparent", fontWeight: 600 } : t === "expert" ? { color: Oe, fontWeight: 600 } : t === "standard" ? { color: Me, fontWeight: 600 } : { color: re, fontWeight: 600 };
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Ve() {
|
|
449
449
|
return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { marginTop: 2, flexShrink: 0 }, children: /* @__PURE__ */ e("path", { d: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" }) });
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function qe() {
|
|
452
452
|
return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { marginTop: 2, flexShrink: 0 }, children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Qe({ f: t }) {
|
|
455
455
|
return /* @__PURE__ */ n("li", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
456
456
|
/* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
|
|
457
|
-
t.isZero ? /* @__PURE__ */ e(
|
|
457
|
+
t.isZero ? /* @__PURE__ */ e(qe, {}) : /* @__PURE__ */ e(Ve, {}),
|
|
458
458
|
/* @__PURE__ */ n("div", { style: { display: "flex", flex: 1, justifyContent: "space-between", gap: 2, fontSize: 14, lineHeight: 1.375 }, children: [
|
|
459
459
|
/* @__PURE__ */ e("span", { style: { color: re }, children: t.label }),
|
|
460
460
|
t.value && /* @__PURE__ */ e("span", { style: { color: re, letterSpacing: "-0.02em", fontVariantNumeric: "tabular-nums" }, children: t.value })
|
|
461
461
|
] })
|
|
462
462
|
] }),
|
|
463
|
-
t.showProgress && t.progress !== null && /* @__PURE__ */ e("div", { style: { paddingLeft: 26 }, children: /* @__PURE__ */ e("div", { style: { height: 4, borderRadius: 999, overflow: "hidden", background:
|
|
463
|
+
t.showProgress && t.progress !== null && /* @__PURE__ */ e("div", { style: { paddingLeft: 26 }, children: /* @__PURE__ */ e("div", { style: { height: 4, borderRadius: 999, overflow: "hidden", background: Ue }, children: /* @__PURE__ */ e("div", { style: { height: "100%", width: `${t.progress}%`, background: "#fff", borderRadius: 999, transition: "width 0.3s ease" } }) }) })
|
|
464
464
|
] });
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Ye({
|
|
467
467
|
plan: t,
|
|
468
468
|
currentPlan: r,
|
|
469
469
|
onSelect: a,
|
|
470
470
|
onManageBilling: d
|
|
471
471
|
}) {
|
|
472
|
-
const [u, c] = _(!1), o = r === t.plan, x = t.tier <
|
|
473
|
-
let b,
|
|
474
|
-
o ? (b = "Current Plan",
|
|
475
|
-
const i =
|
|
472
|
+
const [u, c] = _(!1), o = r === t.plan, x = t.tier < Pe[r];
|
|
473
|
+
let b, m = !1, S, w = !1;
|
|
474
|
+
o ? (b = "Current Plan", m = !0) : t.isFree ? (b = "Switch to Free", S = d, w = !0) : (b = `${x ? "Switch to" : "Get"} ${t.title}`, S = () => a(t));
|
|
475
|
+
const i = w ? { height: 44, width: "100%", borderRadius: 12, border: "1px solid #fff", background: "transparent", color: "#fff", fontSize: 14, fontWeight: 700, cursor: "pointer" } : {
|
|
476
476
|
height: 44,
|
|
477
477
|
width: "100%",
|
|
478
478
|
borderRadius: 12,
|
|
479
479
|
border: 0,
|
|
480
|
-
background:
|
|
481
|
-
color:
|
|
480
|
+
background: He,
|
|
481
|
+
color: Ge,
|
|
482
482
|
fontSize: 14,
|
|
483
483
|
fontWeight: 600,
|
|
484
|
-
cursor:
|
|
485
|
-
opacity:
|
|
484
|
+
cursor: m ? "default" : "pointer",
|
|
485
|
+
opacity: m ? 0.5 : 1
|
|
486
486
|
};
|
|
487
487
|
return /* @__PURE__ */ n(
|
|
488
488
|
"div",
|
|
@@ -515,21 +515,21 @@ function qe({
|
|
|
515
515
|
/* @__PURE__ */ e("span", { style: { fontSize: 18, fontWeight: 600, letterSpacing: "-0.02em", color: "#fff" }, children: t.title }),
|
|
516
516
|
/* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 500, color: oe }, children: t.subtitle })
|
|
517
517
|
] }),
|
|
518
|
-
/* @__PURE__ */ e("span", { style: { ...
|
|
518
|
+
/* @__PURE__ */ e("span", { style: { ...Ze[t.plan], borderRadius: 999, padding: "4px 12px", fontSize: 12, whiteSpace: "nowrap", flexShrink: 0 }, children: t.badgeText })
|
|
519
519
|
] }),
|
|
520
520
|
/* @__PURE__ */ n("div", { style: { padding: "0 16px", display: "flex", alignItems: "baseline", gap: 8 }, children: [
|
|
521
521
|
/* @__PURE__ */ e("span", { style: { fontSize: 30, fontWeight: 600, letterSpacing: "-0.02em", color: "#fff" }, children: t.price }),
|
|
522
522
|
/* @__PURE__ */ e("span", { style: { fontSize: 16, color: oe, fontWeight: t.isFree ? 400 : 500 }, children: t.priceSuffix })
|
|
523
523
|
] }),
|
|
524
|
-
/* @__PURE__ */ e("div", { style: { padding: "0 16px" }, children: /* @__PURE__ */ e("button", { type: "button", disabled:
|
|
524
|
+
/* @__PURE__ */ e("div", { style: { padding: "0 16px" }, children: /* @__PURE__ */ e("button", { type: "button", disabled: m, onClick: S, style: i, children: b }) }),
|
|
525
525
|
/* @__PURE__ */ n("div", { style: { padding: "0 16px" }, children: [
|
|
526
526
|
/* @__PURE__ */ n("p", { style: { margin: 0, fontSize: 15, color: "#fff" }, children: [
|
|
527
527
|
"Everything in ",
|
|
528
|
-
/* @__PURE__ */ e("span", { style:
|
|
528
|
+
/* @__PURE__ */ e("span", { style: Ke(t.plan), children: t.title }),
|
|
529
529
|
" plan"
|
|
530
530
|
] }),
|
|
531
|
-
/* @__PURE__ */ e("div", { style: { height: 1, background:
|
|
532
|
-
/* @__PURE__ */ e("ul", { style: { listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: 16 }, children: t.features.map((l) => /* @__PURE__ */ e(
|
|
531
|
+
/* @__PURE__ */ e("div", { style: { height: 1, background: $e, margin: "12px 0" } }),
|
|
532
|
+
/* @__PURE__ */ e("ul", { style: { listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: 16 }, children: t.features.map((l) => /* @__PURE__ */ e(Qe, { f: l }, l.label)) })
|
|
533
533
|
] })
|
|
534
534
|
]
|
|
535
535
|
}
|
|
@@ -538,7 +538,7 @@ function qe({
|
|
|
538
538
|
}
|
|
539
539
|
);
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Xe({ isAnnual: t, setIsAnnual: r }) {
|
|
542
542
|
const a = {
|
|
543
543
|
position: "relative",
|
|
544
544
|
zIndex: 1,
|
|
@@ -581,12 +581,12 @@ function Qe({ isAnnual: t, setIsAnnual: r }) {
|
|
|
581
581
|
] })
|
|
582
582
|
] });
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Je({
|
|
585
585
|
currentPlan: t,
|
|
586
586
|
onSelect: r,
|
|
587
587
|
onManageBilling: a
|
|
588
588
|
}) {
|
|
589
|
-
const [d, u] = _(!0), c =
|
|
589
|
+
const [d, u] = _(!0), c = je(d);
|
|
590
590
|
return /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 40, width: "100%", maxWidth: 1120, margin: "0 auto" }, children: [
|
|
591
591
|
/* @__PURE__ */ n("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "flex-end", justifyContent: "space-between", gap: 20 }, children: [
|
|
592
592
|
/* @__PURE__ */ n("div", { children: [
|
|
@@ -598,12 +598,12 @@ function Ye({
|
|
|
598
598
|
/* @__PURE__ */ e("p", { style: { margin: "12px 0 0", fontSize: 16, fontWeight: 300, color: "#fff", whiteSpace: "pre-line" }, children: `Get more than 2 months for free
|
|
599
599
|
by subscribing annually` })
|
|
600
600
|
] }),
|
|
601
|
-
/* @__PURE__ */ e(
|
|
601
|
+
/* @__PURE__ */ e(Xe, { isAnnual: d, setIsAnnual: u })
|
|
602
602
|
] }),
|
|
603
|
-
/* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 16, alignItems: "stretch" }, children: c.map((o) => /* @__PURE__ */ e(
|
|
603
|
+
/* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 16, alignItems: "stretch" }, children: c.map((o) => /* @__PURE__ */ e(Ye, { plan: o, currentPlan: t, onSelect: r, onManageBilling: a }, o.plan)) })
|
|
604
604
|
] });
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function et({
|
|
607
607
|
open: t,
|
|
608
608
|
onClose: r,
|
|
609
609
|
currentPlan: a,
|
|
@@ -645,11 +645,11 @@ function Xe({
|
|
|
645
645
|
children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
646
646
|
}
|
|
647
647
|
),
|
|
648
|
-
/* @__PURE__ */ e("div", { style: { position: "absolute", inset: 0, overflowY: "auto", WebkitOverflowScrolling: "touch" }, children: /* @__PURE__ */ e("div", { style: { padding: "56px 20px 64px" }, children: /* @__PURE__ */ e(
|
|
648
|
+
/* @__PURE__ */ e("div", { style: { position: "absolute", inset: 0, overflowY: "auto", WebkitOverflowScrolling: "touch" }, children: /* @__PURE__ */ e("div", { style: { padding: "56px 20px 64px" }, children: /* @__PURE__ */ e(Je, { currentPlan: a, onSelect: d, onManageBilling: u }) }) })
|
|
649
649
|
] })
|
|
650
650
|
) : null;
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const tt = {
|
|
653
653
|
free: {
|
|
654
654
|
outer: { background: "linear-gradient(270deg, rgba(0,0,0,0.6) 0%, rgba(0,125,101,0.6) 100%)" },
|
|
655
655
|
inner: { background: "#000" },
|
|
@@ -675,8 +675,8 @@ const Je = {
|
|
|
675
675
|
label: { color: "#FAFAFA" }
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
function
|
|
679
|
-
const u =
|
|
678
|
+
function it({ plan: t, initial: r, title: a, onClick: d }) {
|
|
679
|
+
const u = tt[t];
|
|
680
680
|
return /* @__PURE__ */ e(
|
|
681
681
|
"button",
|
|
682
682
|
{
|
|
@@ -691,11 +691,11 @@ function et({ plan: t, initial: r, title: a, onClick: d }) {
|
|
|
691
691
|
}
|
|
692
692
|
);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
const { email: r, token: a, signOut: d } = ne(), { subscribe: u, manageBilling: c } =
|
|
694
|
+
function rt({ dark: t = !1 }) {
|
|
695
|
+
const { email: r, token: a, signOut: d } = ne(), { subscribe: u, manageBilling: c } = we(a), { data: o } = Re(a), [x, b] = _(!1), m = Le(o?.user_credit?.plan), S = (r?.trim()?.[0] ?? "U").toUpperCase(), w = t ? "rgba(255,255,255,0.12)" : "rgba(128,128,128,0.25)", i = {
|
|
696
696
|
cursor: "pointer",
|
|
697
697
|
borderRadius: 8,
|
|
698
|
-
border: `1px solid ${
|
|
698
|
+
border: `1px solid ${w}`,
|
|
699
699
|
background: "transparent",
|
|
700
700
|
color: t ? "#e5e5e5" : "#444",
|
|
701
701
|
fontSize: 12,
|
|
@@ -712,17 +712,17 @@ function tt({ dark: t = !1 }) {
|
|
|
712
712
|
justifyContent: "space-between",
|
|
713
713
|
gap: 12,
|
|
714
714
|
padding: "10px 14px",
|
|
715
|
-
borderTop: `1px solid ${
|
|
715
|
+
borderTop: `1px solid ${w}`
|
|
716
716
|
},
|
|
717
717
|
children: [
|
|
718
|
-
/* @__PURE__ */ e(
|
|
718
|
+
/* @__PURE__ */ e(it, { plan: m, initial: S, title: De[m], onClick: () => b(!0) }),
|
|
719
719
|
/* @__PURE__ */ e("button", { type: "button", style: i, onClick: d, children: "Sign out" }),
|
|
720
720
|
/* @__PURE__ */ e(
|
|
721
|
-
|
|
721
|
+
et,
|
|
722
722
|
{
|
|
723
723
|
open: x,
|
|
724
724
|
onClose: () => b(!1),
|
|
725
|
-
currentPlan:
|
|
725
|
+
currentPlan: m,
|
|
726
726
|
onSelect: (l) => {
|
|
727
727
|
l.productKey && u(l.productKey);
|
|
728
728
|
},
|
|
@@ -733,18 +733,18 @@ function tt({ dark: t = !1 }) {
|
|
|
733
733
|
}
|
|
734
734
|
);
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const nt = ["selector", "pattern", "news"], at = {
|
|
737
737
|
selector: "Selector",
|
|
738
738
|
pattern: "Pattern",
|
|
739
739
|
news: "News"
|
|
740
740
|
};
|
|
741
|
-
function
|
|
742
|
-
return /* @__PURE__ */ e(
|
|
741
|
+
function ht(t) {
|
|
742
|
+
return /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(lt, { ...t }) });
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function lt({
|
|
745
745
|
children: t,
|
|
746
746
|
defaultTab: r,
|
|
747
|
-
tabs: a =
|
|
747
|
+
tabs: a = nt,
|
|
748
748
|
labels: d,
|
|
749
749
|
className: u,
|
|
750
750
|
style: c,
|
|
@@ -752,12 +752,19 @@ function nt({
|
|
|
752
752
|
pattern: x,
|
|
753
753
|
news: b
|
|
754
754
|
}) {
|
|
755
|
-
const { token:
|
|
755
|
+
const { token: m, email: S } = ne(), [w, i] = _(
|
|
756
756
|
r ?? a[0] ?? "selector"
|
|
757
|
-
),
|
|
757
|
+
), l = (o?.theme ?? x?.theme ?? b?.theme) === "dark", f = !!m, h = m ?? "", y = ge(() => {
|
|
758
|
+
if (!m) return "";
|
|
759
|
+
try {
|
|
760
|
+
return String(xe(m).sub ?? "");
|
|
761
|
+
} catch {
|
|
762
|
+
return "";
|
|
763
|
+
}
|
|
764
|
+
}, [m]), B = S ?? "", [T, A] = _(null), N = o ? {
|
|
758
765
|
...o,
|
|
759
|
-
onScanResults:
|
|
760
|
-
} : void 0,
|
|
766
|
+
onScanResults: A
|
|
767
|
+
} : void 0, I = {
|
|
761
768
|
display: "flex",
|
|
762
769
|
flex: 1,
|
|
763
770
|
minHeight: 0,
|
|
@@ -768,7 +775,7 @@ function nt({
|
|
|
768
775
|
{
|
|
769
776
|
className: `iccandle-widget-suite ${u ?? ""}`,
|
|
770
777
|
style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, width: "100%", ...c },
|
|
771
|
-
children: /* @__PURE__ */ n("div", { className: "iccandle-widget-suite__main", style:
|
|
778
|
+
children: /* @__PURE__ */ n("div", { className: "iccandle-widget-suite__main", style: I, children: [
|
|
772
779
|
/* @__PURE__ */ n(
|
|
773
780
|
"div",
|
|
774
781
|
{
|
|
@@ -776,12 +783,12 @@ function nt({
|
|
|
776
783
|
style: { position: "relative", flex: 1, minWidth: 0, minHeight: 0 },
|
|
777
784
|
children: [
|
|
778
785
|
t,
|
|
779
|
-
|
|
786
|
+
f && w === "selector" && N && /* @__PURE__ */ e(
|
|
780
787
|
"div",
|
|
781
788
|
{
|
|
782
789
|
className: "iccandle-widget-suite__chart-overlay",
|
|
783
790
|
style: { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 50 },
|
|
784
|
-
children: /* @__PURE__ */ e(
|
|
791
|
+
children: /* @__PURE__ */ e(be, { token: h, ...N, userId: y, children: null }, "selector")
|
|
785
792
|
}
|
|
786
793
|
)
|
|
787
794
|
]
|
|
@@ -802,7 +809,7 @@ function nt({
|
|
|
802
809
|
// to the SDK panel (right column) so it never covers the broker's chart.
|
|
803
810
|
position: "relative"
|
|
804
811
|
},
|
|
805
|
-
children:
|
|
812
|
+
children: f ? /* @__PURE__ */ n(ie, { children: [
|
|
806
813
|
/* @__PURE__ */ e(
|
|
807
814
|
"div",
|
|
808
815
|
{
|
|
@@ -818,16 +825,16 @@ function nt({
|
|
|
818
825
|
background: "var(--iccandle-secondary, rgba(128,128,128,0.12))",
|
|
819
826
|
border: "1px solid var(--iccandle-border, rgba(128,128,128,0.2))"
|
|
820
827
|
},
|
|
821
|
-
children: a.map((
|
|
822
|
-
const
|
|
828
|
+
children: a.map((C) => {
|
|
829
|
+
const v = w === C;
|
|
823
830
|
return /* @__PURE__ */ e(
|
|
824
831
|
"button",
|
|
825
832
|
{
|
|
826
833
|
type: "button",
|
|
827
834
|
role: "tab",
|
|
828
|
-
"aria-selected":
|
|
829
|
-
onClick: () =>
|
|
830
|
-
className: `iccandle-widget-suite__tab${
|
|
835
|
+
"aria-selected": v,
|
|
836
|
+
onClick: () => i(C),
|
|
837
|
+
className: `iccandle-widget-suite__tab${v ? " iccandle-widget-suite__tab--active" : ""}`,
|
|
831
838
|
style: {
|
|
832
839
|
flex: 1,
|
|
833
840
|
cursor: "pointer",
|
|
@@ -837,13 +844,13 @@ function nt({
|
|
|
837
844
|
fontSize: 13,
|
|
838
845
|
fontWeight: 600,
|
|
839
846
|
transition: "background 0.15s, color 0.15s",
|
|
840
|
-
background:
|
|
841
|
-
color:
|
|
847
|
+
background: v ? "#262626" : "transparent",
|
|
848
|
+
color: v ? "#FFFFFF" : "var(--iccandle-text, #888)",
|
|
842
849
|
textTransform: "capitalize"
|
|
843
850
|
},
|
|
844
|
-
children: d?.[
|
|
851
|
+
children: d?.[C] ?? at[C]
|
|
845
852
|
},
|
|
846
|
-
|
|
853
|
+
C
|
|
847
854
|
);
|
|
848
855
|
})
|
|
849
856
|
}
|
|
@@ -854,23 +861,25 @@ function nt({
|
|
|
854
861
|
className: "iccandle-widget-suite__body",
|
|
855
862
|
style: { position: "relative", flex: 1, minHeight: 0 },
|
|
856
863
|
children: [
|
|
857
|
-
|
|
858
|
-
|
|
864
|
+
w === "pattern" && x && /* @__PURE__ */ e(
|
|
865
|
+
ye,
|
|
859
866
|
{
|
|
860
867
|
token: h,
|
|
861
868
|
...x,
|
|
862
|
-
|
|
869
|
+
userId: y,
|
|
870
|
+
email: B,
|
|
871
|
+
onGoToScan: a.includes("selector") ? () => i("selector") : void 0,
|
|
863
872
|
children: null
|
|
864
873
|
},
|
|
865
874
|
"pattern"
|
|
866
875
|
),
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
876
|
+
w === "news" && b && /* @__PURE__ */ e(ve, { token: h, ...b, userId: y, children: null }, "news"),
|
|
877
|
+
w === "selector" && (T && (T.isLoading || T.scanResult.matches.length > 0) ? /* @__PURE__ */ e(
|
|
878
|
+
me,
|
|
870
879
|
{
|
|
871
|
-
scanResult:
|
|
872
|
-
isLoading:
|
|
873
|
-
hideLayout: () =>
|
|
880
|
+
scanResult: T.scanResult,
|
|
881
|
+
isLoading: T.isLoading,
|
|
882
|
+
hideLayout: () => A(null)
|
|
874
883
|
}
|
|
875
884
|
) : /* @__PURE__ */ n(
|
|
876
885
|
"div",
|
|
@@ -890,7 +899,7 @@ function nt({
|
|
|
890
899
|
"img",
|
|
891
900
|
{
|
|
892
901
|
loading: "eager",
|
|
893
|
-
src: `https://app.iccandle.ai/images/no-data-${
|
|
902
|
+
src: `https://app.iccandle.ai/images/no-data-${l ? "white" : "black"}.png`,
|
|
894
903
|
alt: "No scan yet",
|
|
895
904
|
style: { width: "100%", maxWidth: 200, height: "auto" }
|
|
896
905
|
}
|
|
@@ -903,8 +912,8 @@ function nt({
|
|
|
903
912
|
]
|
|
904
913
|
}
|
|
905
914
|
),
|
|
906
|
-
/* @__PURE__ */ e(
|
|
907
|
-
] }) : /* @__PURE__ */ e(
|
|
915
|
+
/* @__PURE__ */ e(rt, { dark: l })
|
|
916
|
+
] }) : /* @__PURE__ */ e(Be, { dark: l })
|
|
908
917
|
}
|
|
909
918
|
)
|
|
910
919
|
] })
|
|
@@ -912,5 +921,5 @@ function nt({
|
|
|
912
921
|
);
|
|
913
922
|
}
|
|
914
923
|
export {
|
|
915
|
-
|
|
924
|
+
ht as WidgetSuite
|
|
916
925
|
};
|