@tempots/beatui 0.82.0 → 0.82.1

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.
Files changed (173) hide show
  1. package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
  2. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +63 -1351
  5. package/dist/auth-divider-BqZPH1-z.cjs +1 -0
  6. package/dist/auth-divider-Wr-S16kF.js +1355 -0
  7. package/dist/beatui.css +1347 -0
  8. package/dist/beatui.tailwind.css +1347 -0
  9. package/dist/better-auth/index.cjs.js +1 -0
  10. package/dist/better-auth/index.es.js +754 -0
  11. package/dist/{deep-merge-CiOwVWn8.js → deep-merge-BYm0y62g.js} +34 -33
  12. package/dist/deep-merge-d7sf0xmN.cjs +1 -0
  13. package/dist/duration-input-B9UNmUCh.cjs +1 -0
  14. package/dist/{duration-input-B3vnnwBZ.js → duration-input-DqcJbxKD.js} +23 -22
  15. package/dist/editor-toolbar-group--a-xgsJw.cjs +1 -0
  16. package/dist/editor-toolbar-group-CVpl5mxF.js +31 -0
  17. package/dist/{hls.light.min-Bhrf47iR.cjs → hls.light.min-C6xKDzRR.cjs} +1 -1
  18. package/dist/{hls.light.min-C6VwviEa.js → hls.light.min-hEMf_E8u.js} +1 -1
  19. package/dist/{index-C5YCCgnn.cjs → index-05UbKOYe.cjs} +1 -1
  20. package/dist/{index-ChsRjiIp.cjs → index-Bt7FYl80.cjs} +19 -19
  21. package/dist/{index-DT6-HMMz.js → index-C2Lq1m45.js} +1432 -1462
  22. package/dist/{index-CiAVfKIZ.js → index-lYhXnu6I.js} +1 -1
  23. package/dist/index.cjs.js +4 -4
  24. package/dist/index.es.js +2326 -2680
  25. package/dist/input-container-C6qEIjcA.cjs +1 -0
  26. package/dist/input-container-DiCjOzR2.js +247 -0
  27. package/dist/json-schema/index.cjs.js +1 -1
  28. package/dist/json-schema/index.es.js +33 -32
  29. package/dist/json-schema-display/index.cjs.js +1 -1
  30. package/dist/json-schema-display/index.es.js +1 -1
  31. package/dist/json-structure/index.cjs.js +1 -1
  32. package/dist/json-structure/index.es.js +542 -700
  33. package/dist/lexical/index.cjs.js +46 -0
  34. package/dist/lexical/index.es.js +21370 -0
  35. package/dist/lexical.css +1124 -0
  36. package/dist/menu-CZzRsQP_.js +372 -0
  37. package/dist/menu-ClrU72xH.cjs +1 -0
  38. package/dist/modal-I5srcntN.cjs +1 -0
  39. package/dist/modal-v3u2Fpnd.js +488 -0
  40. package/dist/{notice-CZHWWwOQ.js → notice-BuZvdvZh.js} +48 -47
  41. package/dist/notice-CLDdy1MW.cjs +1 -0
  42. package/dist/{oneof-branch-detection-C8g3eWnx.cjs → oneof-branch-detection-DsM1K5xc.cjs} +1 -1
  43. package/dist/{oneof-branch-detection-BVNoKU9d.js → oneof-branch-detection-Dt8ss9lc.js} +1 -1
  44. package/dist/prosemirror/index.cjs.js +1 -1
  45. package/dist/prosemirror/index.es.js +1 -1
  46. package/dist/session-id-3KiilioY.js +8 -0
  47. package/dist/session-id-B5lJMzbB.cjs +1 -0
  48. package/dist/styles-url-B2dzXrYt.cjs +1 -0
  49. package/dist/styles-url-Cw_mxshe.js +4 -0
  50. package/dist/text-input-B3VBat1k.js +44 -0
  51. package/dist/text-input-Ds8e7Z1G.cjs +1 -0
  52. package/dist/{toolbar-DR2Zd4Oo.js → toolbar-D994_E_s.js} +4 -4
  53. package/dist/toolbar-x0_8lmKu.cjs +1 -0
  54. package/dist/types/better-auth/bridge.d.ts +2 -0
  55. package/dist/types/better-auth/callbacks.d.ts +6 -0
  56. package/dist/types/better-auth/components/authenticated.d.ts +4 -0
  57. package/dist/types/better-auth/components/better-auth-container.d.ts +4 -0
  58. package/dist/types/better-auth/components/better-auth-modal.d.ts +4 -0
  59. package/dist/types/better-auth/components/magic-link-form.d.ts +7 -0
  60. package/dist/types/better-auth/components/passkey-management.d.ts +6 -0
  61. package/dist/types/better-auth/components/passkey-signin.d.ts +12 -0
  62. package/dist/types/better-auth/components/two-factor-setup.d.ts +8 -0
  63. package/dist/types/better-auth/components/two-factor-verify.d.ts +10 -0
  64. package/dist/types/better-auth/i18n/default.d.ts +29 -0
  65. package/dist/types/better-auth/i18n/locales/en.d.ts +28 -0
  66. package/dist/types/better-auth/i18n/translations.d.ts +27 -0
  67. package/dist/types/better-auth/index.d.ts +22 -0
  68. package/dist/types/better-auth/provider.d.ts +6 -0
  69. package/dist/types/better-auth/session.d.ts +14 -0
  70. package/dist/types/better-auth/social-mapping.d.ts +2 -0
  71. package/dist/types/better-auth/types.d.ts +164 -0
  72. package/dist/types/components/auth/auth-container.d.ts +1 -1
  73. package/dist/types/components/auth/social-providers.d.ts +1 -1
  74. package/dist/types/components/auth/types.d.ts +2 -0
  75. package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +16 -0
  76. package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +9 -0
  77. package/dist/types/components/editor-toolbar/index.d.ts +2 -0
  78. package/dist/types/components/json-structure/controls/control-utils.d.ts +19 -0
  79. package/dist/types/components/json-structure/controls/index.d.ts +1 -0
  80. package/dist/types/components/lexical/bare-editor.d.ts +29 -0
  81. package/dist/types/components/lexical/code/index.d.ts +1 -0
  82. package/dist/types/components/lexical/code/language-selector.d.ts +13 -0
  83. package/dist/types/components/lexical/contextual-editor.d.ts +22 -0
  84. package/dist/types/components/lexical/docked-editor.d.ts +23 -0
  85. package/dist/types/components/lexical/floating/block-handle.d.ts +16 -0
  86. package/dist/types/components/lexical/floating/floating-toolbar.d.ts +12 -0
  87. package/dist/types/components/lexical/floating/index.d.ts +6 -0
  88. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +20 -0
  89. package/dist/types/components/lexical/index.d.ts +8 -0
  90. package/dist/types/components/lexical/lexical-editor-input.d.ts +30 -0
  91. package/dist/types/components/lexical/table/index.d.ts +1 -0
  92. package/dist/types/components/lexical/table/table-controls.d.ts +12 -0
  93. package/dist/types/components/lexical/toolbar/index.d.ts +6 -0
  94. package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +12 -0
  95. package/dist/types/components/lexical/toolbar/toolbar-button.d.ts +1 -0
  96. package/dist/types/components/lexical/toolbar/toolbar-group.d.ts +1 -0
  97. package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +30 -0
  98. package/dist/types/components/prosemirror/etoolbar-button.d.ts +1 -11
  99. package/dist/types/components/prosemirror/etoolbar-group.d.ts +1 -4
  100. package/dist/types/lexical/commands/index.d.ts +17 -0
  101. package/dist/types/lexical/headless.d.ts +39 -0
  102. package/dist/types/lexical/horizontal-rule-node.d.ts +20 -0
  103. package/dist/types/lexical/index.d.ts +20 -0
  104. package/dist/types/lexical/lazy-loader.d.ts +35 -0
  105. package/dist/types/lexical/nodes.d.ts +29 -0
  106. package/dist/types/lexical/plugins/auto-link.d.ts +7 -0
  107. package/dist/types/lexical/plugins/clipboard.d.ts +11 -0
  108. package/dist/types/lexical/plugins/code-shiki.d.ts +11 -0
  109. package/dist/types/lexical/plugins/code.d.ts +7 -0
  110. package/dist/types/lexical/plugins/dragon.d.ts +6 -0
  111. package/dist/types/lexical/plugins/file-io.d.ts +10 -0
  112. package/dist/types/lexical/plugins/hashtag.d.ts +7 -0
  113. package/dist/types/lexical/plugins/history.d.ts +7 -0
  114. package/dist/types/lexical/plugins/horizontal-rule.d.ts +12 -0
  115. package/dist/types/lexical/plugins/html-io.d.ts +9 -0
  116. package/dist/types/lexical/plugins/index.d.ts +24 -0
  117. package/dist/types/lexical/plugins/link.d.ts +6 -0
  118. package/dist/types/lexical/plugins/list.d.ts +6 -0
  119. package/dist/types/lexical/plugins/mark.d.ts +15 -0
  120. package/dist/types/lexical/plugins/markdown-io.d.ts +13 -0
  121. package/dist/types/lexical/plugins/offset.d.ts +6 -0
  122. package/dist/types/lexical/plugins/overflow.d.ts +7 -0
  123. package/dist/types/lexical/plugins/plain-text.d.ts +6 -0
  124. package/dist/types/lexical/plugins/rich-text.d.ts +6 -0
  125. package/dist/types/lexical/plugins/selection.d.ts +6 -0
  126. package/dist/types/lexical/plugins/slash-commands.d.ts +26 -0
  127. package/dist/types/lexical/plugins/table.d.ts +11 -0
  128. package/dist/types/lexical/plugins/text.d.ts +13 -0
  129. package/dist/types/lexical/plugins/yjs.d.ts +9 -0
  130. package/dist/types/lexical/styles-url.d.ts +2 -0
  131. package/dist/types/lexical/styles.d.ts +2 -0
  132. package/dist/types/lexical/types.d.ts +634 -0
  133. package/dist/types/lexical-i18n/default.d.ts +92 -0
  134. package/dist/types/lexical-i18n/index.d.ts +21 -0
  135. package/dist/types/lexical-i18n/locales/ar.d.ts +91 -0
  136. package/dist/types/lexical-i18n/locales/de.d.ts +91 -0
  137. package/dist/types/lexical-i18n/locales/en.d.ts +91 -0
  138. package/dist/types/lexical-i18n/locales/es.d.ts +91 -0
  139. package/dist/types/lexical-i18n/locales/fa.d.ts +91 -0
  140. package/dist/types/lexical-i18n/locales/fr.d.ts +91 -0
  141. package/dist/types/lexical-i18n/locales/he.d.ts +91 -0
  142. package/dist/types/lexical-i18n/locales/hi.d.ts +91 -0
  143. package/dist/types/lexical-i18n/locales/it.d.ts +91 -0
  144. package/dist/types/lexical-i18n/locales/ja.d.ts +91 -0
  145. package/dist/types/lexical-i18n/locales/ko.d.ts +91 -0
  146. package/dist/types/lexical-i18n/locales/nl.d.ts +91 -0
  147. package/dist/types/lexical-i18n/locales/pl.d.ts +91 -0
  148. package/dist/types/lexical-i18n/locales/pt.d.ts +91 -0
  149. package/dist/types/lexical-i18n/locales/ru.d.ts +91 -0
  150. package/dist/types/lexical-i18n/locales/tr.d.ts +91 -0
  151. package/dist/types/lexical-i18n/locales/ur.d.ts +91 -0
  152. package/dist/types/lexical-i18n/locales/vi.d.ts +91 -0
  153. package/dist/types/lexical-i18n/locales/zh.d.ts +91 -0
  154. package/dist/types/lexical-i18n/translations.d.ts +21 -0
  155. package/dist/use-animated-toggle-ChycsEoj.js +175 -0
  156. package/dist/use-animated-toggle-DR6CyMac.cjs +1 -0
  157. package/dist/{use-form-CgZyrACX.js → use-form-B56E_x5Y.js} +83 -88
  158. package/dist/use-form-Cnp3XQ5X.cjs +2 -0
  159. package/dist/widget-customization-Dk7XcVly.cjs +1 -0
  160. package/dist/{widget-customization-DRA7E9Zf.js → widget-customization-Ds9sicAg.js} +106 -105
  161. package/package.json +48 -3
  162. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  163. package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
  164. package/dist/deep-merge-DxZqCkE5.cjs +0 -1
  165. package/dist/duration-input-Dg5SX3lM.cjs +0 -1
  166. package/dist/modal-D2xE47kr.cjs +0 -1
  167. package/dist/modal-hkQD1bqZ.js +0 -655
  168. package/dist/notice-C0SmlheE.cjs +0 -1
  169. package/dist/text-input-CByq5OIo.cjs +0 -1
  170. package/dist/text-input-CFJntP7G.js +0 -287
  171. package/dist/toolbar-TPWYzoiF.cjs +0 -1
  172. package/dist/use-form-JjeKCINk.cjs +0 -2
  173. package/dist/widget-customization-G-QLB1rw.cjs +0 -1
@@ -1,1353 +1,65 @@
1
- import { localStorageProp as ie, prop as V, Use as x, html as i, attr as t, on as z, When as b, coalesce as h, Ensure as D, computedOf as g, Fragment as C, bind as ce, ForEach as le, Value as ee, OneOfValue as me } from "@tempots/dom";
2
- import { i as oe, S as $ } from "../stack-BJgsPJ9A.js";
3
- import { t as ue, u as W, a as se, b as T } from "../use-form-CgZyrACX.js";
4
- import { s as A, o as G, b as N, M as pe } from "../modal-hkQD1bqZ.js";
5
- import { AuthI18n as q } from "../translations-DPr6c05Z.js";
6
- import { P as R, E as H, N as j } from "../notice-CZHWWwOQ.js";
7
- import { B as F, T as de } from "../text-input-CFJntP7G.js";
8
- import { I as he } from "../translations-Cq8bUKJP.js";
9
- import { classes as ge } from "@tempots/ui";
10
- const X = {
11
- google: { name: "Google", icon: "logos:google-icon", color: "#4285f4" },
12
- github: { name: "GitHub", icon: "logos:github-icon", color: "#333" },
13
- apple: { name: "Apple", icon: "logos:apple", color: "#000" },
14
- facebook: { name: "Facebook", icon: "logos:facebook", color: "#1877f2" },
15
- twitter: { name: "Twitter", icon: "logos:twitter", color: "#1da1f2" },
16
- microsoft: {
17
- name: "Microsoft",
18
- icon: "logos:microsoft-icon",
19
- color: "#00a4ef"
20
- },
21
- discord: { name: "Discord", icon: "logos:discord-icon", color: "#5865f2" },
22
- linkedin: { name: "LinkedIn", icon: "logos:linkedin-icon", color: "#0077b5" },
23
- instagram: {
24
- name: "Instagram",
25
- icon: "logos:instagram-icon",
26
- color: "#e4405f"
27
- },
28
- tiktok: { name: "TikTok", icon: "logos:tiktok-icon", color: "#000" },
29
- snapchat: { name: "Snapchat", icon: "logos:snapchat-icon", color: "#fffc00" },
30
- reddit: { name: "Reddit", icon: "logos:reddit-icon", color: "#ff4500" },
31
- pinterest: {
32
- name: "Pinterest",
33
- icon: "logos:pinterest-icon",
34
- color: "#bd081c"
35
- },
36
- twitch: { name: "Twitch", icon: "logos:twitch", color: "#9146ff" },
37
- steam: { name: "Steam", icon: "logos:steam-icon", color: "#000" },
38
- epic: {
39
- name: "Epic Games",
40
- icon: "simple-icons:epicgames",
41
- color: "#313131"
42
- },
43
- playstation: {
44
- name: "PlayStation",
45
- icon: "logos:playstation-icon",
46
- color: "#003791"
47
- },
48
- xbox: { name: "Xbox", icon: "logos:xbox-icon", color: "#107c10" },
49
- whatsapp: { name: "WhatsApp", icon: "logos:whatsapp-icon", color: "#25d366" },
50
- wechat: { name: "WeChat", icon: "logos:wechat-icon", color: "#1aad19" },
51
- amazon: { name: "Amazon", icon: "logos:amazon-icon", color: "#ff9900" },
52
- yahoo: { name: "Yahoo", icon: "logos:yahoo-icon", color: "#720e9e" },
53
- paypal: { name: "PayPal", icon: "logos:paypal", color: "#0070ba" },
54
- x: { name: "X", icon: "simple-icons:x", color: "#000" }
55
- };
56
- function fe(e) {
57
- return X[e]?.name || e;
58
- }
59
- function Ce(e) {
60
- return X[e]?.icon || "mdi:account";
61
- }
62
- function ze(e) {
63
- return X[e]?.color || "#666";
64
- }
65
- function Ee(e, o = "Continue with {provider}") {
66
- return o.replace("{provider}", fe(e));
67
- }
68
- const I = {
69
- minLength: 8,
70
- requireUppercase: !0,
71
- requireLowercase: !0,
72
- requireNumbers: !0,
73
- requireSymbols: !1
74
- };
75
- function Ue(e) {
76
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
77
- }
78
- function be(e = 32) {
79
- const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
80
- let c = "";
81
- for (let m = 0; m < e; m++)
82
- c += o.charAt(Math.floor(Math.random() * o.length));
83
- return c;
84
- }
85
- function Ve(e, o, c, m = [], l = {}) {
86
- const s = {
87
- google: "https://accounts.google.com/oauth/authorize",
88
- github: "https://github.com/login/oauth/authorize",
89
- apple: "https://appleid.apple.com/auth/authorize",
90
- facebook: "https://www.facebook.com/v18.0/dialog/oauth",
91
- twitter: "https://twitter.com/i/oauth2/authorize",
92
- microsoft: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
93
- discord: "https://discord.com/api/oauth2/authorize",
94
- linkedin: "https://www.linkedin.com/oauth/v2/authorization",
95
- instagram: "https://api.instagram.com/oauth/authorize",
96
- tiktok: "https://www.tiktok.com/v2/auth/authorize",
97
- snapchat: "https://accounts.snapchat.com/accounts/oauth2/authorize",
98
- reddit: "https://www.reddit.com/api/v1/authorize",
99
- pinterest: "https://api.pinterest.com/oauth/",
100
- twitch: "https://id.twitch.tv/oauth2/authorize",
101
- steam: "https://steamcommunity.com/oauth/authorize",
102
- epic: "https://auth.epicgames.com/authorize",
103
- playstation: "https://auth.api.sonyentertainmentnetwork.com/oauth/authorize",
104
- xbox: "https://login.live.com/oauth20_authorize.srf",
105
- whatsapp: "https://web.whatsapp.com/oauth/authorize",
106
- wechat: "https://open.weixin.qq.com/connect/qrconnect",
107
- amazon: "https://www.amazon.com/ap/oa",
108
- yahoo: "https://api.login.yahoo.com/oauth2/request_auth",
109
- paypal: "https://www.paypal.com/signin/authorize",
110
- x: "https://api.twitter.com/oauth2/authorize"
111
- }, u = {
112
- google: ["openid", "email", "profile"],
113
- github: ["user:email"],
114
- apple: ["email", "name"],
115
- facebook: ["email"],
116
- twitter: ["users.read"],
117
- microsoft: ["openid", "email", "profile"],
118
- discord: ["identify", "email"],
119
- linkedin: ["r_liteprofile", "r_emailaddress"],
120
- instagram: ["user_profile", "user_media"],
121
- tiktok: ["user.info.basic", "user.external.id"],
122
- snapchat: ["user.info.basic", "user.external.id"],
123
- reddit: ["identity", "email"],
124
- pinterest: ["read_public", "read_relationships"],
125
- twitch: ["openid", "email", "profile"],
126
- steam: ["openid", "email", "profile"],
127
- epic: ["openid", "email", "profile"],
128
- playstation: ["openid", "email", "profile"],
129
- xbox: ["openid", "email", "profile"],
130
- whatsapp: ["openid", "email", "profile"],
131
- wechat: ["openid", "email", "profile"],
132
- amazon: ["openid", "email", "profile"],
133
- yahoo: ["openid", "email", "profile"],
134
- paypal: ["openid", "email", "profile"],
135
- x: ["openid", "email", "profile"]
136
- }, n = s[e];
137
- if (!n)
138
- throw new Error(`Unsupported provider: ${e}`);
139
- const r = m.length > 0 ? m : u[e], a = be(), f = new URLSearchParams({
140
- client_id: o,
141
- redirect_uri: c,
142
- scope: r.join(" "),
143
- state: a,
144
- response_type: "code",
145
- ...l
146
- });
147
- return `${n}?${f.toString()}`;
148
- }
149
- function Fe(e, o, c, m) {
150
- const l = window.open(
151
- e,
152
- `${o}_login`,
153
- "width=500,height=600,scrollbars=yes,resizable=yes"
154
- );
155
- if (!l) {
156
- m?.(new Error("Failed to open popup window"));
157
- return;
158
- }
159
- const s = setInterval(() => {
160
- l.closed && (clearInterval(s), m?.(new Error("Login cancelled")));
161
- }, 1e3), u = (n) => {
162
- n.origin === window.location.origin && (n.data.type === "SOCIAL_LOGIN_SUCCESS" ? (clearInterval(s), l.close(), window.removeEventListener("message", u), c?.(n.data.result)) : n.data.type === "SOCIAL_LOGIN_ERROR" && (clearInterval(s), l.close(), window.removeEventListener("message", u), m?.(new Error(n.data.error))));
163
- };
164
- window.addEventListener("message", u);
165
- }
166
- function Me(e) {
167
- return e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e ? String(e.message) : "An unexpected error occurred";
168
- }
169
- function Oe() {
170
- return typeof window < "u" && typeof document < "u";
171
- }
172
- function Y({
173
- task: e,
174
- message: o,
175
- onStart: c,
176
- onEnd: m
177
- }) {
178
- return async (l) => {
179
- c?.();
180
- const s = await ue({
181
- task: e != null ? () => e(l) : async () => null,
182
- errorMessage: o,
183
- errorPath: ["root"],
184
- validation: (u) => u != null ? oe.invalid({ message: u }) : oe.valid
185
- });
186
- return m?.(), s;
187
- };
188
- }
189
- function Z(e = I) {
190
- let o = A();
191
- return e.minLength && (o = o.min(
192
- e.minLength,
193
- `Password must be at least ${e.minLength} characters`
194
- )), e.requireUppercase && (o = o.regex(
195
- /[A-Z]/,
196
- "Password must contain at least one uppercase letter"
197
- )), e.requireLowercase && (o = o.regex(
198
- /[a-z]/,
199
- "Password must contain at least one lowercase letter"
200
- )), e.requireNumbers && (o = o.regex(
201
- /[0-9]/,
202
- "Password must contain at least one number"
203
- )), e.requireSymbols && (o = o.regex(
204
- /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,
205
- "Password must contain at least one special character"
206
- )), e.customValidation && (o = o.refine((c) => e.customValidation(c))), o;
207
- }
208
- const M = A().min(1, "Email is required").email("Please enter a valid email address");
209
- function J(e) {
210
- const o = e ? Z(e) : A().refine(
211
- (c) => c.length > 0 ? null : "Password is required"
212
- );
213
- return G({
214
- email: M,
215
- password: o,
216
- rememberMe: N().default(!1)
217
- }).schema();
218
- }
219
- function K(e = I, o) {
220
- const c = Z(e), m = o?.showNameField !== !1, l = o?.showConfirmPassword !== !1, s = o?.showAcceptTermsAndConditions !== !1, u = {
221
- name: m ? A().min(1, "Name is required").optional() : A().optional(),
222
- email: M,
223
- password: c,
224
- // Always require confirmPassword as string to match SignUpData interface
225
- // When not shown, it should accept any value (including empty string)
226
- confirmPassword: l ? A().min(1, "Please confirm your password") : A(),
227
- // Accept any string value when not shown
228
- acceptTerms: s ? N().refine(
229
- (r) => r === !0,
230
- "You must accept the terms and conditions"
231
- ) : N().default(!0)
232
- // Default to true when not shown
233
- }, n = G(u);
234
- return l ? n.refine(
235
- (r) => r.password === r.confirmPassword ? null : "Passwords don't match",
236
- { path: ["confirmPassword"] }
237
- ).schema() : n.schema();
238
- }
239
- const ae = G({
240
- email: M
241
- }).schema(), Ne = J(), Re = K(), De = {
242
- signIn: J,
243
- signUp: K,
244
- resetPassword: () => ae
245
- };
246
- function We(e) {
247
- const o = M.validate(e);
248
- return o.success ? null : o.errors[0]?.message || "Invalid email";
249
- }
250
- function Ge(e, o = I) {
251
- const m = Z(o).validate(e);
252
- return m.success ? null : m.errors[0]?.message || "Invalid password";
253
- }
254
- function Q(e, o = I) {
255
- const c = {
256
- length: e.length >= (o.minLength || 8),
257
- uppercase: /[A-Z]/.test(e),
258
- lowercase: /[a-z]/.test(e),
259
- numbers: /[0-9]/.test(e),
260
- symbols: /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(e),
261
- custom: o.customValidation ? o.customValidation(e) === null : e.length > 0
262
- // For consistency, fail if password is empty
263
- }, m = [
264
- !0,
265
- // length is always enabled
266
- o.requireUppercase,
267
- o.requireLowercase,
268
- o.requireNumbers,
269
- o.requireSymbols,
270
- !!o.customValidation
271
- ].filter(Boolean).length, l = [
272
- c.length,
273
- o.requireUppercase ? c.uppercase : null,
274
- o.requireLowercase ? c.lowercase : null,
275
- o.requireNumbers ? c.numbers : null,
276
- o.requireSymbols ? c.symbols : null,
277
- o.customValidation ? c.custom : null
278
- ].filter((n) => n === !0).length, s = m > 0 ? Math.round(l / m * 100) : 0;
279
- let u;
280
- return s < 40 ? u = "weak" : s < 60 ? u = "fair" : s < 80 ? u = "good" : u = "strong", { strength: u, score: s, checks: c };
281
- }
282
- const re = () => ie({
283
- key: "bui_auth_email",
284
- defaultValue: null
285
- });
286
- function we({
287
- onSignIn: e,
288
- passwordRules: o,
289
- labels: c,
290
- showRememberMe: m
291
- }) {
292
- const l = V(!1), s = re(), u = J(o), n = W({
293
- schema: u,
294
- onSubmit: Y({
295
- task: e,
296
- message: "Reset password failed",
297
- onStart: () => {
298
- l.set(!0), n.controller.disable();
299
- },
300
- onEnd: () => {
301
- l.set(!1), n.controller.enable();
302
- }
303
- }),
304
- initialValue: {
305
- email: "",
306
- password: ""
307
- }
308
- }), { controller: r, submit: a } = n;
309
- l.on(r.setDisabled);
310
- const f = r.field("email"), w = r.field("password");
311
- return s.on((_) => {
312
- _ != null && f.change(_);
313
- }), f.signal.on((_) => {
314
- s.value != null && (s.value = _);
315
- }), x(
316
- q,
317
- (_) => (
318
- // Email/Password form
319
- i.form(
320
- t.class("bc-auth-form__form"),
321
- z.submit(a),
322
- $(
323
- t.class("bc-auth-form__fields"),
324
- D(
325
- r.error,
326
- (k) => j(
327
- { variant: "danger", tone: "prominent", role: "alert" },
328
- i.div(k)
329
- )
330
- ),
331
- // Email field
332
- T(H, {
333
- controller: f,
334
- label: h(c?.emailLabel, _.$.emailLabel)
335
- }),
336
- // Password field
337
- T(R, {
338
- controller: w,
339
- label: h(c?.passwordLabel, _.$.passwordLabel)
340
- }),
341
- // Remember me checkbox
342
- b(
343
- m ?? !0,
344
- () => i.div(
345
- t.class("bc-auth-form__remember-me"),
346
- i.label(
347
- t.class("bc-auth-form__checkbox-label"),
348
- se({
349
- value: s.map((k) => k != null),
350
- after: i.span(
351
- h(c?.rememberMeLabel, _.$.rememberMeLabel)
352
- ),
353
- onChange: (k) => {
354
- k ? s.value = f.signal.value ?? "" : s.value = null;
355
- }
356
- })
357
- )
358
- )
359
- )
360
- ),
361
- // Submit button
362
- F(
363
- {
364
- type: "submit",
365
- variant: "filled",
366
- color: "primary",
367
- loading: l,
368
- disabled: r.disabledOrHasErrors
369
- },
370
- t.class("bc-auth-form__submit"),
371
- h(c?.signInButton, _.$.signInButton)
372
- )
373
- )
374
- )
375
- );
376
- }
377
- function _e({
378
- password: e,
379
- rules: o = I,
380
- showLabel: c = !0,
381
- className: m
382
- }) {
383
- const l = g(e)((a) => !a || a.length === 0 ? {
384
- strength: "weak",
385
- score: 0,
386
- checks: {
387
- length: !1,
388
- uppercase: !1,
389
- lowercase: !1,
390
- numbers: !1,
391
- symbols: !1,
392
- custom: !1
393
- }
394
- } : Q(a, o)), s = l.map((a) => a.strength), u = l.map((a) => a.score), n = l.map((a) => a.checks), r = g(
395
- s,
396
- m
397
- )((a, f) => [
398
- "bc-password-strength",
399
- `bc-password-strength--${a}`,
400
- f
401
- ].filter(Boolean).join(" "));
402
- return i.div(
403
- t.class(r),
404
- // Strength bar
405
- i.div(
406
- t.class("bc-password-strength__bar"),
407
- i.div(
408
- t.class("bc-password-strength__fill"),
409
- t.style(u.map((a) => `width: ${a}%`))
410
- )
411
- ),
412
- // Strength label (optional)
413
- b(
414
- c,
415
- () => x(
416
- q,
417
- (a) => i.div(
418
- t.class("bc-password-strength__label"),
419
- g(
420
- s,
421
- a
422
- )((f, w) => {
423
- switch (f) {
424
- case "weak":
425
- return w.passwordStrengthWeak;
426
- case "fair":
427
- return w.passwordStrengthFair;
428
- case "good":
429
- return w.passwordStrengthGood;
430
- case "strong":
431
- return w.passwordStrengthStrong;
432
- default:
433
- return w.passwordStrengthWeak;
434
- }
435
- })
436
- )
437
- )
438
- ),
439
- // Requirements checklist
440
- i.div(
441
- t.class("bc-password-strength__requirements"),
442
- // Length requirement
443
- b(
444
- o.minLength !== void 0,
445
- () => i.div(
446
- t.class("bc-password-strength__requirement"),
447
- t.class(
448
- g(n)(
449
- (a) => a.length ? "bc-password-strength__requirement--met" : ""
450
- )
451
- ),
452
- i.span(
453
- t.class("bc-password-strength__requirement-icon"),
454
- g(n)((a) => a.length ? "✓" : "○")
455
- ),
456
- i.span(
457
- t.class("bc-password-strength__requirement-text"),
458
- `At least ${o.minLength} characters`
459
- )
460
- )
461
- ),
462
- // Uppercase requirement
463
- b(
464
- o.requireUppercase === !0,
465
- () => i.div(
466
- t.class("bc-password-strength__requirement"),
467
- t.class(
468
- g(n)(
469
- (a) => a.uppercase ? "bc-password-strength__requirement--met" : ""
470
- )
471
- ),
472
- i.span(
473
- t.class("bc-password-strength__requirement-icon"),
474
- g(n)((a) => a.uppercase ? "✓" : "○")
475
- ),
476
- i.span(
477
- t.class("bc-password-strength__requirement-text"),
478
- "One uppercase letter"
479
- )
480
- )
481
- ),
482
- // Lowercase requirement
483
- b(
484
- o.requireLowercase === !0,
485
- () => i.div(
486
- t.class("bc-password-strength__requirement"),
487
- t.class(
488
- g(n)(
489
- (a) => a.lowercase ? "bc-password-strength__requirement--met" : ""
490
- )
491
- ),
492
- i.span(
493
- t.class("bc-password-strength__requirement-icon"),
494
- g(n)((a) => a.lowercase ? "✓" : "○")
495
- ),
496
- i.span(
497
- t.class("bc-password-strength__requirement-text"),
498
- "One lowercase letter"
499
- )
500
- )
501
- ),
502
- // Numbers requirement
503
- b(
504
- o.requireNumbers === !0,
505
- () => i.div(
506
- t.class("bc-password-strength__requirement"),
507
- t.class(
508
- g(n)(
509
- (a) => a.numbers ? "bc-password-strength__requirement--met" : ""
510
- )
511
- ),
512
- i.span(
513
- t.class("bc-password-strength__requirement-icon"),
514
- g(n)((a) => a.numbers ? "✓" : "○")
515
- ),
516
- i.span(
517
- t.class("bc-password-strength__requirement-text"),
518
- "One number"
519
- )
520
- )
521
- ),
522
- // Symbols requirement
523
- b(
524
- o.requireSymbols === !0,
525
- () => i.div(
526
- t.class("bc-password-strength__requirement"),
527
- t.class(
528
- g(n)(
529
- (a) => a.symbols ? "bc-password-strength__requirement--met" : ""
530
- )
531
- ),
532
- i.span(
533
- t.class("bc-password-strength__requirement-icon"),
534
- g(n)((a) => a.symbols ? "✓" : "○")
535
- ),
536
- i.span(
537
- t.class("bc-password-strength__requirement-text"),
538
- "One special character"
539
- )
540
- )
541
- )
542
- )
543
- );
544
- }
545
- function He({
546
- password: e,
547
- rules: o = I,
548
- className: c
549
- }) {
550
- const m = g(e)((n) => !n || n.length === 0 ? { strength: "weak", score: 0 } : Q(n, o)), l = m.map((n) => n.strength), s = m.map((n) => n.score), u = g(
551
- l,
552
- c
553
- )((n, r) => [
554
- "bc-password-strength-bar",
555
- `bc-password-strength-bar--${n}`,
556
- r
557
- ].filter(Boolean).join(" "));
558
- return i.div(
559
- t.class(u),
560
- i.div(
561
- t.class("bc-password-strength-bar__fill"),
562
- t.style(s.map((n) => `width: ${n}%`))
563
- )
564
- );
565
- }
566
- function je({
567
- password: e,
568
- rules: o = I,
569
- className: c
570
- }) {
571
- const m = g(e)((s) => !s || s.length === 0 ? "weak" : Q(s, o).strength), l = g(
572
- m,
573
- c
574
- )((s, u) => [
575
- "bc-password-strength-text",
576
- `bc-password-strength-text--${s}`,
577
- u
578
- ].filter(Boolean).join(" "));
579
- return C(
580
- x(
581
- q,
582
- (s) => i.span(
583
- t.class(l),
584
- g(
585
- m,
586
- s
587
- )((u, n) => {
588
- switch (u) {
589
- case "weak":
590
- return n.passwordStrengthWeak;
591
- case "fair":
592
- return n.passwordStrengthFair;
593
- case "good":
594
- return n.passwordStrengthGood;
595
- case "strong":
596
- return n.passwordStrengthStrong;
597
- default:
598
- return n.passwordStrengthWeak;
599
- }
600
- })
601
- )
602
- )
603
- );
604
- }
605
- function Le({
606
- passwordRules: e,
607
- labels: o,
608
- initialEmail: c,
609
- initialName: m,
610
- showPasswordStrength: l,
611
- onSignUp: s,
612
- showNameField: u,
613
- showConfirmPassword: n,
614
- showAcceptTermsAndConditions: r,
615
- termsAndConditions: a
616
- }) {
617
- const f = V(!1), w = e || I, _ = K(w, {
618
- showNameField: u !== !1,
619
- showConfirmPassword: n !== !1,
620
- showAcceptTermsAndConditions: r !== !1
621
- }), k = W({
622
- schema: _,
623
- onSubmit: Y({
624
- task: s != null ? (v) => s({
625
- email: v.email,
626
- password: v.password,
627
- name: v.name,
628
- acceptTerms: v.acceptTerms
629
- }) : void 0,
630
- message: "Reset password failed",
631
- onStart: () => {
632
- f.set(!0), k.controller.disable();
633
- },
634
- onEnd: () => {
635
- f.set(!1), k.controller.enable();
636
- }
637
- }),
638
- initialValue: {
639
- name: m ?? "",
640
- email: c ?? "",
641
- password: "",
642
- confirmPassword: "",
643
- acceptTerms: !1
644
- }
645
- }), { controller: y, submit: B } = k;
646
- f.on(y.setDisabled);
647
- const S = y.field("name"), E = y.field("email"), U = y.field("password"), O = y.field("confirmPassword"), P = y.field("acceptTerms");
648
- return x(
649
- q,
650
- (v) => (
651
- // Registration form
652
- i.form(
653
- t.class("bc-auth-form__form"),
654
- z.submit(B),
655
- $(
656
- t.class("bc-auth-form__fields"),
657
- D(
658
- y.error,
659
- (L) => j(
660
- { variant: "danger", tone: "prominent", role: "alert" },
661
- i.div(L)
662
- )
663
- ),
664
- // Name field (optional)
665
- b(
666
- u !== !1,
667
- () => T(de, {
668
- controller: S.transform(
669
- (L) => L ?? "",
670
- (L) => L === "" ? void 0 : L
671
- ),
672
- label: h(o?.nameLabel, v.$.nameLabel)
673
- })
674
- ),
675
- // Email field
676
- T(H, {
677
- controller: E,
678
- label: h(o?.emailLabel, v.$.emailLabel)
679
- }),
680
- // Password field
681
- T(R, {
682
- controller: U,
683
- label: h(o?.passwordLabel, v.$.passwordLabel)
684
- }),
685
- // Password strength indicator
686
- b(
687
- l ?? !1,
688
- () => _e({
689
- password: U.signal,
690
- rules: w,
691
- showLabel: !0
692
- })
693
- ),
694
- // Confirm password field
695
- b(
696
- n ?? !1,
697
- () => T(R, {
698
- controller: O,
699
- label: h(
700
- o?.confirmPasswordLabel,
701
- v.$.confirmPasswordLabel
702
- )
703
- })
704
- ),
705
- // Terms acceptance checkbox
706
- b(
707
- r ?? !1,
708
- () => i.div(
709
- t.class("bc-auth-form__terms"),
710
- i.label(
711
- t.class("bc-auth-form__checkbox-label"),
712
- se({
713
- value: P.signal.map((L) => L ?? !1),
714
- onChange: (L) => P.change(L)
715
- }),
716
- i.span(
717
- a || h(o?.acceptTermsLabel, v.$.acceptTermsLabel)
718
- )
719
- ),
720
- b(
721
- P.errorVisible,
722
- () => i.div(
723
- t.class("bc-auth-form__field-error"),
724
- P.error.map((L) => L || "")
725
- )
726
- )
727
- )
728
- )
729
- ),
730
- // Submit button
731
- F(
732
- {
733
- type: "submit",
734
- variant: "filled",
735
- color: "primary",
736
- loading: f,
737
- disabled: y.disabledOrHasErrors
738
- },
739
- t.class("bc-auth-form__submit"),
740
- h(o?.signUpButton, v.$.signUpButton)
741
- )
742
- )
743
- )
744
- );
745
- }
746
- function ke({
747
- onResetPassword: e,
748
- labels: o = {}
749
- }) {
750
- const c = re(), m = V(!1), l = W({
751
- schema: ae,
752
- onSubmit: Y({
753
- task: e,
754
- message: "Reset password failed",
755
- onStart: () => {
756
- m.set(!0), l.controller.disable();
757
- },
758
- onEnd: () => {
759
- m.set(!1), l.controller.enable();
760
- }
761
- }),
762
- initialValue: {
763
- email: ""
764
- }
765
- }), { controller: s, submit: u } = l;
766
- m.on(s.setDisabled);
767
- const n = s.field("email");
768
- return c.on((r) => {
769
- r != null && n.change(r);
770
- }), x(
771
- q,
772
- (r) => (
773
- // Reset password form
774
- i.form(
775
- t.class("bc-auth-form__form"),
776
- D(
777
- s.error,
778
- (a) => j(
779
- { variant: "danger", tone: "prominent", role: "alert" },
780
- i.div(a)
781
- )
782
- ),
783
- // Description
784
- i.p(
785
- t.class("bc-auth-form__description"),
786
- h(o?.resetPasswordDescription, r.$.resetPasswordDescription)
787
- ),
788
- z.submit(u),
789
- $(
790
- t.class("bc-auth-form__fields"),
791
- // Email field
792
- T(H, {
793
- controller: n,
794
- label: h(o?.emailLabel, r.$.emailLabel)
795
- })
796
- ),
797
- // Submit button
798
- F(
799
- {
800
- loading: m,
801
- type: "submit",
802
- variant: "filled",
803
- color: "primary",
804
- disabled: s.disabledOrHasErrors
805
- },
806
- t.class("bc-auth-form__submit"),
807
- h(o?.resetPasswordButton, r.$.resetPasswordButton)
808
- )
809
- )
810
- )
811
- );
812
- }
813
- function d({
814
- provider: e,
815
- onClick: o,
816
- size: c = "md",
817
- name: m,
818
- icon: l,
819
- color: s,
820
- flow: u,
821
- labels: n
822
- }) {
823
- return F(
824
- {
825
- type: "button",
826
- variant: "filled",
827
- size: c,
828
- color: s,
829
- onClick: async () => {
830
- if (o)
831
- try {
832
- u === "popup" ? await o() : await o();
833
- } catch (a) {
834
- console.error(
835
- `Social login error for ${e} (${u || "redirect"} flow):`,
836
- a
837
- );
838
- }
839
- },
840
- roundedness: "full"
841
- },
842
- t.class("bc-social-login-button"),
843
- t.class(
844
- g(e)((a) => `bc-social-login-button--${a}`)
845
- ),
846
- i.span(
847
- t.class("bc-social-login-button__inner"),
848
- i.span(
849
- t.class("bc-social-login-button__icon"),
850
- he({ icon: l, size: c }, t.class("bc-social-login-button__icon-inner"))
851
- ),
852
- x(
853
- q,
854
- (a) => i.span(
855
- t.class("bc-social-login-button__label"),
856
- ce(
857
- h(n?.continueWithProvider, a.$.continueWithProvider)
858
- )(m)
859
- )
860
- )
861
- )
862
- );
863
- }
864
- function ve({
865
- providers: e,
866
- onProviderClick: o,
867
- size: c = "md",
868
- className: m
869
- }) {
870
- return $(
871
- t.class("bc-social-login-buttons"),
872
- t.class(m),
873
- le(
874
- e,
875
- (l) => d({
876
- provider: l.$.provider,
877
- flow: l.$.flow,
878
- color: l.map(
879
- ({ provider: s }) => p[s].color
880
- ),
881
- name: l.map(({ provider: s }) => p[s].name),
882
- icon: l.map(({ provider: s }) => p[s].icon),
883
- onClick: async () => {
884
- o && await o(l.$.provider.value);
885
- },
886
- size: c
887
- })
888
- )
889
- );
890
- }
891
- const p = {
892
- // Core
893
- google: {
894
- name: "Google",
895
- icon: "logos:google-icon",
896
- color: "red"
897
- },
898
- github: {
899
- name: "GitHub",
900
- icon: "logos:github-icon",
901
- color: "black"
902
- },
903
- apple: {
904
- name: "Apple",
905
- icon: "logos:apple",
906
- color: "stone"
907
- // using stone to differentiate from GitHub/X
908
- },
909
- facebook: {
910
- name: "Facebook",
911
- icon: "logos:facebook",
912
- color: "blue"
913
- },
914
- twitter: {
915
- name: "Twitter",
916
- icon: "logos:twitter",
917
- color: "sky"
918
- },
919
- x: {
920
- name: "X",
921
- icon: "logos:x",
922
- color: "zinc"
923
- // avoids duplicate black
924
- },
925
- microsoft: {
926
- name: "Microsoft",
927
- icon: "logos:microsoft-icon",
928
- color: "amber"
929
- },
930
- discord: {
931
- name: "Discord",
932
- icon: "logos:discord-icon",
933
- color: "indigo"
934
- },
935
- linkedin: {
936
- name: "LinkedIn",
937
- icon: "logos:linkedin-icon",
938
- color: "cyan"
939
- },
940
- // Social / Media
941
- instagram: {
942
- name: "Instagram",
943
- icon: "logos:instagram-icon",
944
- color: "fuchsia"
945
- },
946
- tiktok: {
947
- name: "TikTok",
948
- icon: "logos:tiktok-icon",
949
- color: "teal"
950
- },
951
- snapchat: {
952
- name: "Snapchat",
953
- icon: "simple-icons:snapchat",
954
- color: "yellow"
955
- },
956
- reddit: {
957
- name: "Reddit",
958
- icon: "logos:reddit-icon",
959
- color: "orange"
960
- },
961
- pinterest: {
962
- name: "Pinterest",
963
- icon: "logos:pinterest",
964
- color: "rose"
965
- },
966
- // Gaming / Entertainment
967
- twitch: {
968
- name: "Twitch",
969
- icon: "logos:twitch",
970
- color: "purple"
971
- },
972
- steam: {
973
- name: "Steam",
974
- icon: "logos:steam",
975
- color: "slate"
976
- },
977
- epic: {
978
- name: "Epic Games",
979
- icon: "simple-icons:epicgames",
980
- color: "neutral"
981
- },
982
- playstation: {
983
- name: "PlayStation",
984
- icon: "simple-icons:playstation",
985
- color: "violet"
986
- },
987
- xbox: {
988
- name: "Xbox",
989
- icon: "simple-icons:xbox",
990
- color: "green"
991
- },
992
- // Messaging
993
- whatsapp: {
994
- name: "WhatsApp",
995
- icon: "logos:whatsapp-icon",
996
- color: "emerald"
997
- },
998
- wechat: {
999
- name: "WeChat",
1000
- icon: "simple-icons:wechat",
1001
- color: "lime"
1002
- },
1003
- // Other Identity
1004
- amazon: {
1005
- name: "Amazon",
1006
- icon: "simple-icons:amazon",
1007
- color: "red"
1008
- // distinct warm tone (not used elsewhere here)
1009
- },
1010
- yahoo: {
1011
- name: "Yahoo",
1012
- icon: "logos:yahoo",
1013
- color: "rose"
1014
- // unique variation for Yahoo
1015
- },
1016
- paypal: {
1017
- name: "PayPal",
1018
- icon: "logos:paypal",
1019
- color: "blue"
1020
- // distinct deep blue tone (not Facebook’s exact blue)
1021
- }
1022
- }, Xe = (e) => d({
1023
- ...e,
1024
- ...p.google,
1025
- provider: "google"
1026
- }), Ye = (e) => d({
1027
- ...e,
1028
- ...p.github,
1029
- provider: "github"
1030
- }), Ze = (e) => d({
1031
- ...e,
1032
- ...p.apple,
1033
- provider: "apple"
1034
- }), Je = (e) => d({
1035
- ...e,
1036
- ...p.facebook,
1037
- provider: "facebook"
1038
- }), Ke = (e) => d({
1039
- ...e,
1040
- ...p.x,
1041
- provider: "x"
1042
- }), Qe = (e) => d({
1043
- ...e,
1044
- ...p.twitter,
1045
- provider: "twitter"
1046
- }), eo = (e) => d({
1047
- ...e,
1048
- ...p.microsoft,
1049
- provider: "microsoft"
1050
- }), oo = (e) => d({
1051
- ...e,
1052
- ...p.discord,
1053
- provider: "discord"
1054
- }), to = (e) => d({
1055
- ...e,
1056
- ...p.linkedin,
1057
- provider: "linkedin"
1058
- }), no = (e) => d({
1059
- ...e,
1060
- ...p.instagram,
1061
- provider: "instagram"
1062
- }), so = (e) => d({
1063
- ...e,
1064
- ...p.tiktok,
1065
- provider: "tiktok"
1066
- }), ao = (e) => d({
1067
- ...e,
1068
- ...p.snapchat,
1069
- provider: "snapchat"
1070
- }), ro = (e) => d({
1071
- ...e,
1072
- ...p.reddit,
1073
- provider: "reddit"
1074
- }), io = (e) => d({
1075
- ...e,
1076
- ...p.pinterest,
1077
- provider: "pinterest"
1078
- }), co = (e) => d({
1079
- ...e,
1080
- ...p.twitch,
1081
- provider: "twitch"
1082
- }), lo = (e) => d({
1083
- ...e,
1084
- ...p.steam,
1085
- provider: "steam"
1086
- }), mo = (e) => d({
1087
- ...e,
1088
- ...p.epic,
1089
- provider: "epic"
1090
- }), uo = (e) => d({
1091
- ...e,
1092
- ...p.playstation,
1093
- provider: "playstation"
1094
- }), po = (e) => d({
1095
- ...e,
1096
- ...p.xbox,
1097
- provider: "xbox"
1098
- }), ho = (e) => d({
1099
- ...e,
1100
- ...p.whatsapp,
1101
- provider: "whatsapp"
1102
- }), go = (e) => d({
1103
- ...e,
1104
- ...p.wechat,
1105
- provider: "wechat"
1106
- }), fo = (e) => d({
1107
- ...e,
1108
- ...p.amazon,
1109
- provider: "amazon"
1110
- }), bo = (e) => d({
1111
- ...e,
1112
- ...p.yahoo,
1113
- provider: "yahoo"
1114
- }), wo = (e) => d({
1115
- ...e,
1116
- ...p.paypal,
1117
- provider: "paypal"
1118
- });
1119
- function te({ providers: e }) {
1120
- return $(
1121
- ve({
1122
- providers: e
1123
- })
1124
- );
1125
- }
1126
- function ye({
1127
- mode: e,
1128
- socialProviders: o,
1129
- initialName: c,
1130
- initialEmail: m,
1131
- passwordRules: l,
1132
- showRememberMe: s,
1133
- showSocialDivider: u,
1134
- showPasswordStrength: n,
1135
- labels: r,
1136
- onSignIn: a,
1137
- onSignUp: f,
1138
- onResetPassword: w,
1139
- onModeChange: _,
1140
- // onSocialLogin,
1141
- showContainer: k
1142
- }, ...y) {
1143
- const B = e != null ? ee.deriveProp(e) : V("signin");
1144
- return B.on((S) => _?.(S)), x(q, (S) => {
1145
- function E() {
1146
- const P = h(r?.hasAccountLink, S.$.hasAccountLink);
1147
- return i.button(
1148
- t.type("button"),
1149
- t.class("bc-auth-form__link"),
1150
- z.click(() => B.set("signin")),
1151
- P
1152
- );
1153
- }
1154
- function U() {
1155
- return i.button(
1156
- t.type("button"),
1157
- t.class("bc-auth-form__link"),
1158
- z.click(() => B.set("signup")),
1159
- h(r?.noAccountLink, S.$.noAccountLink)
1160
- );
1161
- }
1162
- function O() {
1163
- return i.button(
1164
- t.type("button"),
1165
- t.class("bc-auth-form__link"),
1166
- z.click(() => B.set("reset-password")),
1167
- h(r?.forgotPasswordLink, S.$.forgotPasswordLink)
1168
- );
1169
- }
1170
- return i.div(
1171
- ge({
1172
- "bc-auth-container": !0,
1173
- "bc-auth-container--styled": ee.map(k ?? !0, (P) => P)
1174
- }),
1175
- t.class(B.map((P) => `bc-auth-container--${P}`)),
1176
- t.class("bc-auth-form"),
1177
- me(B, {
1178
- signin: () => C(
1179
- i.h2(
1180
- t.class("bc-auth-form__title"),
1181
- h(r?.signInTitle, S.$.signInTitle)
1182
- ),
1183
- o != null ? C(
1184
- te({ providers: o }),
1185
- b(u ?? !1, ne)
1186
- ) : null,
1187
- we({
1188
- onSignIn: a,
1189
- showRememberMe: s,
1190
- passwordRules: l,
1191
- labels: {
1192
- emailLabel: r?.emailLabel,
1193
- passwordLabel: r?.passwordLabel,
1194
- rememberMeLabel: r?.rememberMeLabel,
1195
- signInButton: r?.signInButton,
1196
- forgotPasswordLink: r?.forgotPasswordLink,
1197
- noAccountLink: r?.noAccountLink
1198
- }
1199
- }),
1200
- $(
1201
- t.class("bc-auth-form__footer"),
1202
- U(),
1203
- O()
1204
- )
1205
- ),
1206
- signup: () => C(
1207
- i.h2(
1208
- t.class("bc-auth-form__title"),
1209
- h(r?.signUpTitle, S.$.signUpTitle)
1210
- ),
1211
- o != null ? C(
1212
- te({ providers: o }),
1213
- b(u ?? !1, ne)
1214
- ) : null,
1215
- Le({
1216
- labels: {
1217
- nameLabel: r?.nameLabel,
1218
- emailLabel: r?.emailLabel,
1219
- passwordLabel: r?.passwordLabel,
1220
- confirmPasswordLabel: r?.confirmPasswordLabel,
1221
- acceptTermsLabel: r?.acceptTermsLabel,
1222
- signUpButton: r?.signUpButton,
1223
- hasAccountLink: r?.hasAccountLink
1224
- },
1225
- initialEmail: m,
1226
- initialName: c,
1227
- onSignUp: f,
1228
- passwordRules: l,
1229
- showPasswordStrength: n
1230
- }),
1231
- $(t.class("bc-auth-form__footer"), E())
1232
- ),
1233
- "reset-password": () => C(
1234
- i.h2(
1235
- t.class("bc-auth-form__title"),
1236
- h(r?.resetPasswordTitle, S.$.resetPasswordTitle)
1237
- ),
1238
- ke({
1239
- labels: {
1240
- backToSignInLink: r?.backToSignInLink,
1241
- emailLabel: r?.emailLabel,
1242
- resetPasswordButton: r?.resetPasswordButton,
1243
- resetPasswordDescription: r?.resetPasswordDescription
1244
- },
1245
- onResetPassword: w
1246
- }),
1247
- $(t.class("bc-auth-form__footer"), E())
1248
- )
1249
- }),
1250
- ...y
1251
- );
1252
- });
1253
- }
1254
- function _o(e) {
1255
- return pe(
1256
- {
1257
- size: "sm",
1258
- dismissable: !0,
1259
- showCloseButton: !0
1260
- },
1261
- (o, c) => e(
1262
- (m) => o({
1263
- body: ye({ showContainer: !1, ...m }),
1264
- header: x(
1265
- q,
1266
- (l) => h(m.modalTitle, l.$.authenticationTitle)
1267
- )
1268
- })
1269
- )
1270
- );
1271
- }
1272
- function ne({
1273
- labels: e,
1274
- className: o
1275
- } = {}) {
1276
- return i.div(
1277
- t.class("bc-auth-divider"),
1278
- t.class(o),
1279
- i.div(t.class("bc-auth-divider__line")),
1280
- x(
1281
- q,
1282
- (c) => i.span(
1283
- t.class("bc-auth-divider__text"),
1284
- h(e?.text, c.$.orDivider)
1285
- )
1286
- ),
1287
- i.div(t.class("bc-auth-divider__line"))
1288
- );
1289
- }
1
+ import { N as t, t as s, A as n, b as i, a as e, D as r, E as g, F as u, q as d, G as l, I as L, L as c, M as B, c as S, P as m, d as h, O as P, z as p, H as w, y as f, R as v, S as I, n as A, x as T, o as E, p as k, Q as x, C, w as F, B as R, T as U, K as b, W as y, X as D, J as G, Y as M, k as V, m as W, e as X, g as q, h as z, a3 as H, a0 as N, i as Y, j, f as J, a5 as K, V as O, $ as Q, a2 as Z, _, Z as $, a6 as aa, a1 as oa, a4 as ta, U as sa, a7 as na, r as ia, s as ea, u as ra, v as ga, l as ua } from "../auth-divider-Wr-S16kF.js";
1290
2
  export {
1291
- fo as AmazonLoginButton,
1292
- Ze as AppleLoginButton,
1293
- ye as AuthContainer,
1294
- ne as AuthDivider,
1295
- _o as AuthModal,
1296
- oo as DiscordLoginButton,
1297
- mo as EpicLoginButton,
1298
- Je as FacebookLoginButton,
1299
- Ye as GitHubLoginButton,
1300
- Xe as GoogleLoginButton,
1301
- no as InstagramLoginButton,
1302
- to as LinkedInLoginButton,
1303
- eo as MicrosoftLoginButton,
1304
- He as PasswordStrengthBar,
1305
- _e as PasswordStrengthIndicator,
1306
- je as PasswordStrengthText,
1307
- wo as PayPalLoginButton,
1308
- io as PinterestLoginButton,
1309
- uo as PlayStationLoginButton,
1310
- ro as RedditLoginButton,
1311
- ke as ResetPasswordForm,
1312
- we as SignInForm,
1313
- Le as SignUpForm,
1314
- ao as SnapchatLoginButton,
1315
- d as SocialLoginButton,
1316
- ve as SocialLoginButtons,
1317
- te as SocialProviders,
1318
- lo as SteamLoginButton,
1319
- so as TiktokLoginButton,
1320
- co as TwitchLoginButton,
1321
- Qe as TwitterLoginButton,
1322
- go as WeChatLoginButton,
1323
- ho as WhatsAppLoginButton,
1324
- Ke as XLoginButtin,
1325
- po as XboxLoginButton,
1326
- bo as YahooLoginButton,
1327
- De as authSchemas,
1328
- Q as calculatePasswordStrength,
1329
- Z as createPasswordSchema,
1330
- J as createSignInSchema,
1331
- K as createSignUpSchema,
1332
- Ve as createSocialLoginUrl,
1333
- I as defaultPasswordRules,
1334
- Ne as defaultSignInSchema,
1335
- Re as defaultSignUpSchema,
1336
- M as emailSchema,
1337
- Me as formatAuthError,
1338
- fe as formatProviderName,
1339
- Ee as formatSocialLoginText,
1340
- be as generateRandomString,
1341
- ze as getProviderColor,
1342
- Ce as getProviderIcon,
1343
- Oe as isBrowser,
1344
- Ue as isValidEmail,
1345
- Fe as openSocialLoginPopup,
1346
- X as providerInfo,
1347
- Y as requestToControllerValidation,
1348
- ae as resetPasswordSchema,
1349
- p as socialProviderInfo,
1350
- re as useAuthEmailProp,
1351
- We as validateEmail,
1352
- Ge as validatePassword
3
+ t as AmazonLoginButton,
4
+ s as AppleLoginButton,
5
+ n as AuthContainer,
6
+ i as AuthDivider,
7
+ e as AuthModal,
8
+ r as DiscordLoginButton,
9
+ g as EpicLoginButton,
10
+ u as FacebookLoginButton,
11
+ d as GitHubLoginButton,
12
+ l as GoogleLoginButton,
13
+ L as InstagramLoginButton,
14
+ c as LinkedInLoginButton,
15
+ B as MicrosoftLoginButton,
16
+ S as PasswordStrengthBar,
17
+ m as PasswordStrengthIndicator,
18
+ h as PasswordStrengthText,
19
+ P as PayPalLoginButton,
20
+ p as PinterestLoginButton,
21
+ w as PlayStationLoginButton,
22
+ f as RedditLoginButton,
23
+ v as ResetPasswordForm,
24
+ I as SignInForm,
25
+ A as SignUpForm,
26
+ T as SnapchatLoginButton,
27
+ E as SocialLoginButton,
28
+ k as SocialLoginButtons,
29
+ x as SocialProviders,
30
+ C as SteamLoginButton,
31
+ F as TiktokLoginButton,
32
+ R as TwitchLoginButton,
33
+ U as TwitterLoginButton,
34
+ b as WeChatLoginButton,
35
+ y as WhatsAppLoginButton,
36
+ D as XLoginButtin,
37
+ G as XboxLoginButton,
38
+ M as YahooLoginButton,
39
+ V as authSchemas,
40
+ W as calculatePasswordStrength,
41
+ X as createPasswordSchema,
42
+ q as createSignInSchema,
43
+ z as createSignUpSchema,
44
+ H as createSocialLoginUrl,
45
+ N as defaultPasswordRules,
46
+ Y as defaultSignInSchema,
47
+ j as defaultSignUpSchema,
48
+ J as emailSchema,
49
+ K as formatAuthError,
50
+ O as formatProviderName,
51
+ Q as formatSocialLoginText,
52
+ Z as generateRandomString,
53
+ _ as getProviderColor,
54
+ $ as getProviderIcon,
55
+ aa as isBrowser,
56
+ oa as isValidEmail,
57
+ ta as openSocialLoginPopup,
58
+ sa as providerInfo,
59
+ na as requestToControllerValidation,
60
+ ia as resetPasswordSchema,
61
+ ea as socialProviderInfo,
62
+ ra as useAuthEmailProp,
63
+ ga as validateEmail,
64
+ ua as validatePassword
1353
65
  };