@clerk/ui 0.1.9 → 0.1.10

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.
@@ -1,66 +1,22 @@
1
- import { ExclamationOctagonSm, ExclamationTriangleSm, useAppearance, Alert, Icon } from './chunk-RVVUA25B.mjs';
2
- import { useClerk, useOptionsContext } from '@clerk/shared/react';
3
- import * as React2 from 'react';
4
- import React2__default, { forwardRef, useMemo, cloneElement } from 'react';
5
- import { fastDeepMergeAndReplace, titleize, normalizeDate } from '@clerk/shared';
6
- import { cx, cva } from 'cva';
7
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { createContextAndHook, useClerk, useOptionsContext, useDeepEqualMemo } from '@clerk/shared/react';
2
+ import * as Common from '@clerk/elements/common';
8
3
  import { OAUTH_PROVIDERS, WEB3_PROVIDERS } from '@clerk/types';
9
- import * as Common2 from '@clerk/elements/common';
10
- import { GlobalError as GlobalError$1 } from '@clerk/elements/common';
11
- import { useAutoAnimate } from '@formkit/auto-animate/react';
12
- import { Slot } from '@radix-ui/react-slot';
13
- import { Command } from 'cmdk';
14
- import { DialogTrigger, Button as Button$1, Popover, Dialog, ToggleButton } from 'react-aria-components';
15
-
16
- // src/constants/localizations.ts
17
- var LOCALIZATION_NEEDED = {
18
- formFieldAccessibleLabel__emailOrUsernameOrPhone: "Toggle between email or username, and phone.",
19
- formFieldAccessibleLabel__phoneOrUsername: "Toggle between phone and username.",
20
- developmentMode: "Development mode"
21
- };
22
- function useDisplayConfig() {
23
- var _a;
24
- const clerk = useClerk();
25
- const displayConfig = (_a = clerk == null ? void 0 : clerk.__unstable__environment) == null ? void 0 : _a.displayConfig;
26
- return displayConfig;
27
- }
4
+ import { fastDeepMergeAndReplace, titleize, normalizeDate } from '@clerk/shared';
5
+ import * as React5 from 'react';
6
+ import { forwardRef } from 'react';
7
+ import { cx as cx$1 } from 'cva';
8
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
28
9
 
29
- // src/hooks/use-card.ts
30
- function useCard() {
31
- const { options } = useAppearance().parsedAppearance;
32
- const { applicationName, branded, logoImageUrl, homeUrl } = useDisplayConfig();
33
- const logoProps = (options == null ? void 0 : options.logoVisibility) === "visible" ? {
34
- href: (options == null ? void 0 : options.logoLinkUrl) || homeUrl,
35
- src: (options == null ? void 0 : options.logoImageUrl) || logoImageUrl,
36
- alt: applicationName
37
- } : null;
38
- const footerProps = {
39
- branded,
40
- helpPageUrl: options == null ? void 0 : options.helpPageUrl,
41
- privacyPageUrl: options == null ? void 0 : options.privacyPageUrl,
42
- termsPageUrl: options == null ? void 0 : options.termsPageUrl
43
- };
44
- return {
45
- logoProps,
46
- footerProps
47
- };
48
- }
49
- function useEnvironment() {
10
+ // src/contexts/AppearanceContext.tsx
11
+ function useEnabledConnections() {
50
12
  const clerk = useClerk();
51
- return clerk == null ? void 0 : clerk.__unstable__environment;
52
- }
53
- function useDevModeWarning() {
54
- const { displayConfig, isDevelopmentOrStaging } = useEnvironment();
55
- const isDevelopment = isDevelopmentOrStaging();
56
- const { options } = useAppearance().parsedAppearance;
57
- const unsafeDisabled = (options == null ? void 0 : options.unsafe_disableDevelopmentModeWarnings) || false;
58
- const developmentUiDisabled = isDevelopment && unsafeDisabled;
59
- const showDevModeWarning = useMemo(
60
- () => !developmentUiDisabled && displayConfig.showDevModeWarning,
61
- [developmentUiDisabled, displayConfig]
62
- );
63
- return showDevModeWarning;
13
+ const { socialProviderStrategies, web3FirstFactors, authenticatableSocialStrategies } = (clerk == null ? void 0 : clerk.__unstable__environment).userSettings;
14
+ const enabledConnections = /* @__PURE__ */ new Set([
15
+ ...socialProviderStrategies,
16
+ ...web3FirstFactors,
17
+ ...authenticatableSocialStrategies
18
+ ]);
19
+ return [...OAUTH_PROVIDERS, ...WEB3_PROVIDERS].filter((provider) => enabledConnections.has(provider.strategy));
64
20
  }
65
21
 
66
22
  // ../localizations/dist/index.mjs
@@ -559,9 +515,22 @@ var enUS = {
559
515
  title: "Create your account"
560
516
  },
561
517
  restrictedAccess: {
562
- title: "Restricted access",
563
- subtitle: "Access to this app is limited, and an invitation is required to sign up.",
564
- actionLink: "Back to sign in"
518
+ title: "Access restricted",
519
+ subtitle: "Sign ups are currently disabled. If you believe you should have access, please contact support.",
520
+ actionLink: "Sign in",
521
+ actionText: "Already have an account?",
522
+ blockButton__emailSupport: "Email support"
523
+ },
524
+ __experimental_legalConsent: {
525
+ continue: {
526
+ subtitle: "Please read and accept the terms to continue",
527
+ title: "Legal consent"
528
+ },
529
+ checkbox: {
530
+ label__termsOfServiceAndPrivacyPolicy: 'I agree to the {{ termsOfServiceLink || link("Terms of Service") }} and {{ privacyPolicyLink || link("Privacy Policy") }}',
531
+ label__onlyTermsOfService: 'I agree to the {{ termsOfServiceLink || link("Terms of Service") }}',
532
+ label__onlyPrivacyPolicy: 'I agree to the {{ privacyPolicyLink || link("Privacy Policy") }}'
533
+ }
565
534
  }
566
535
  },
567
536
  socialButtonsBlockButton: "Continue with {{provider|titleize}}",
@@ -1168,478 +1137,139 @@ function useLocalizations() {
1168
1137
  const { t, translateError } = makeLocalizeable(parsedLocalization || enUS);
1169
1138
  return { t, translateError, locale: (parsedLocalization == null ? void 0 : parsedLocalization.locale) || "en-US" };
1170
1139
  }
1171
- var ClerkLogo = () => /* @__PURE__ */ jsxs(
1172
- "svg",
1173
- {
1174
- className: "cl-2a836795",
1175
- fill: "none",
1176
- xmlns: "http://www.w3.org/2000/svg",
1177
- viewBox: "0 0 50 14",
1178
- children: [
1179
- /* @__PURE__ */ jsx(
1180
- "ellipse",
1181
- {
1182
- cx: "7.889",
1183
- cy: "7",
1184
- rx: "2.187",
1185
- ry: "2.188",
1186
- fill: "currentColor"
1187
- }
1188
- ),
1189
- /* @__PURE__ */ jsx(
1190
- "path",
1191
- {
1192
- d: "M11.83 12.18a.415.415 0 0 1-.05.64A6.967 6.967 0 0 1 7.888 14a6.967 6.967 0 0 1-3.891-1.18.415.415 0 0 1-.051-.64l1.598-1.6a.473.473 0 0 1 .55-.074 3.92 3.92 0 0 0 1.794.431 3.92 3.92 0 0 0 1.792-.43.473.473 0 0 1 .551.074l1.599 1.598Z",
1193
- fill: "currentColor"
1194
- }
1195
- ),
1196
- /* @__PURE__ */ jsx(
1197
- "path",
1198
- {
1199
- opacity: "0.5",
1200
- d: "M11.78 1.18a.415.415 0 0 1 .05.64l-1.598 1.6a.473.473 0 0 1-.55.073 3.937 3.937 0 0 0-5.3 5.3.473.473 0 0 1-.074.55L2.71 10.942a.415.415 0 0 1-.641-.051 7 7 0 0 1 9.71-9.71Z",
1201
- fill: "currentColor"
1202
- }
1203
- ),
1204
- /* @__PURE__ */ jsx(
1205
- "path",
1206
- {
1207
- fillRule: "evenodd",
1208
- clipRule: "evenodd",
1209
- d: "M23.748 1.422c0-.06.05-.11.11-.11h1.64c.06 0 .11.05.11.11v11.156a.11.11 0 0 1-.11.11h-1.64a.11.11 0 0 1-.11-.11V1.422Zm-2.315 8.9a.112.112 0 0 0-.15.004 2.88 2.88 0 0 1-.884.569c-.36.148-.747.222-1.137.219-.33.01-.658-.047-.965-.166a2.422 2.422 0 0 1-.817-.527c-.424-.432-.668-1.05-.668-1.785 0-1.473.98-2.48 2.45-2.48.394-.005.785.074 1.144.234.325.144.617.35.86.607.04.044.11.049.155.01l1.108-.959a.107.107 0 0 0 .01-.152c-.832-.93-2.138-1.412-3.379-1.412-2.499 0-4.27 1.686-4.27 4.166 0 1.227.44 2.26 1.182 2.99.743.728 1.801 1.157 3.022 1.157 1.53 0 2.763-.587 3.485-1.34a.107.107 0 0 0-.009-.155l-1.137-.98Zm13.212-1.14a.108.108 0 0 1-.107.096H28.79a.106.106 0 0 0-.104.132c.286 1.06 1.138 1.701 2.302 1.701a2.59 2.59 0 0 0 1.136-.236 2.55 2.55 0 0 0 .862-.645.08.08 0 0 1 .112-.01l1.155 1.006c.044.039.05.105.013.15-.698.823-1.828 1.42-3.38 1.42-2.386 0-4.185-1.651-4.185-4.162 0-1.232.424-2.264 1.13-2.994.373-.375.82-.67 1.314-.87a3.968 3.968 0 0 1 1.557-.285c2.419 0 3.983 1.701 3.983 4.05a6.737 6.737 0 0 1-.04.647Zm-5.924-1.524a.104.104 0 0 0 .103.133h3.821c.07 0 .123-.066.103-.134-.26-.901-.921-1.503-1.947-1.503a2.13 2.13 0 0 0-.88.16 2.1 2.1 0 0 0-.733.507 2.242 2.242 0 0 0-.467.837Zm11.651-3.172c.061-.001.11.048.11.109v1.837a.11.11 0 0 1-.117.109 7.17 7.17 0 0 0-.455-.024c-1.43 0-2.27 1.007-2.27 2.329v3.732a.11.11 0 0 1-.11.11h-1.64a.11.11 0 0 1-.11-.11v-7.87c0-.06.049-.109.11-.109h1.64c.06 0 .11.05.11.11v1.104a.011.011 0 0 0 .02.007c.64-.857 1.587-1.333 2.587-1.333l.125-.001Zm4.444 4.81a.035.035 0 0 1 .056.006l2.075 3.334a.11.11 0 0 0 .093.052h1.865a.11.11 0 0 0 .093-.168L46.152 7.93a.11.11 0 0 1 .012-.131l2.742-3.026a.11.11 0 0 0-.081-.183h-1.946a.11.11 0 0 0-.08.036l-3.173 3.458a.11.11 0 0 1-.19-.074V1.422a.11.11 0 0 0-.11-.11h-1.64a.11.11 0 0 0-.11.11v11.156c0 .06.05.11.11.11h1.64a.11.11 0 0 0 .11-.11v-1.755a.11.11 0 0 1 .03-.075l1.35-1.452Z",
1210
- fill: "currentColor"
1211
- }
1212
- )
1213
- ]
1214
- }
1215
- );
1216
1140
 
1217
- // src/utils/validators.ts
1218
- function isValidUrl(val) {
1219
- if (!val) {
1220
- return false;
1221
- }
1222
- try {
1223
- new URL(val);
1224
- return true;
1225
- } catch (e) {
1226
- return false;
1227
- }
1141
+ // ../../node_modules/clsx/dist/clsx.mjs
1142
+ function r(e) {
1143
+ var t, f, n = "";
1144
+ if ("string" == typeof e || "number" == typeof e) n += e;
1145
+ else if ("object" == typeof e) if (Array.isArray(e)) {
1146
+ var o = e.length;
1147
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
1148
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
1149
+ return n;
1150
+ }
1151
+ function clsx() {
1152
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
1153
+ return n;
1154
+ }
1155
+ var clsx_default = clsx;
1156
+
1157
+ // src/utils/dva.ts
1158
+ var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
1159
+ var defineConfig = (options) => {
1160
+ const cx4 = (...inputs) => {
1161
+ var _a, _b;
1162
+ if (typeof ((_a = void 0 ) == null ? void 0 : _a["cx:done"]) !== "undefined") {
1163
+ return void 0 ;
1164
+ }
1165
+ if (typeof ((_b = void 0 ) == null ? void 0 : _b.onComplete) !== "undefined") {
1166
+ return void 0 ;
1167
+ }
1168
+ return clsx(inputs);
1169
+ };
1170
+ const dva2 = (config) => (props) => {
1171
+ var _a;
1172
+ if ((config == null ? void 0 : config.variants) == null) {
1173
+ return cx4(config == null ? void 0 : config.base, props == null ? void 0 : props.descriptor);
1174
+ }
1175
+ const { variants, defaultVariants } = config;
1176
+ const getVariantClassNames = Object.keys(variants).map((variant) => {
1177
+ const variantProp = props == null ? void 0 : props[variant];
1178
+ const defaultVariantProp = defaultVariants == null ? void 0 : defaultVariants[variant];
1179
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
1180
+ return variants[variant][variantKey];
1181
+ });
1182
+ const defaultsAndProps = {
1183
+ ...defaultVariants,
1184
+ // remove `undefined` props
1185
+ ...props && Object.entries(props).reduce(
1186
+ (acc, [key, value]) => typeof value === "undefined" ? acc : { ...acc, [key]: value },
1187
+ {}
1188
+ )
1189
+ };
1190
+ const getCompoundVariantClassNames = (_a = config == null ? void 0 : config.compoundVariants) == null ? void 0 : _a.reduce(
1191
+ (acc, { descriptor, ...cvConfig }) => Object.entries(cvConfig).every(([cvKey, cvSelector]) => {
1192
+ const selector = defaultsAndProps[cvKey];
1193
+ return Array.isArray(cvSelector) ? cvSelector.includes(selector) : selector === cvSelector;
1194
+ }) ? [...acc, descriptor] : acc,
1195
+ []
1196
+ );
1197
+ return cx4(config == null ? void 0 : config.base, getVariantClassNames, getCompoundVariantClassNames, props == null ? void 0 : props.descriptor);
1198
+ };
1199
+ const compose2 = (...components) => (props) => {
1200
+ const propsWithoutDescriptor = Object.fromEntries(
1201
+ Object.entries(props || {}).filter(([key]) => !["descriptor"].includes(key))
1202
+ );
1203
+ return cx4(components.map((component) => component(propsWithoutDescriptor)), props == null ? void 0 : props.descriptor);
1204
+ };
1205
+ return {
1206
+ compose: compose2,
1207
+ dva: dva2,
1208
+ cx: cx4
1209
+ };
1210
+ };
1211
+ var { compose, dva, cx } = defineConfig();
1212
+ function getDescriptors(elements, descriptorList) {
1213
+ const descriptors = descriptorList.split(" ");
1214
+ return descriptors.map((d) => {
1215
+ const value = elements[d];
1216
+ if (!value) {
1217
+ console.warn(`Clerk: unable to access style configuration for descriptor: ${d}`);
1218
+ }
1219
+ return value;
1220
+ });
1228
1221
  }
1229
- function isDataUri(val) {
1230
- if (!isValidUrl(val)) {
1231
- return false;
1232
- }
1233
- return new URL(val).protocol === "data:";
1222
+ function applyDescriptors(elements, descriptorList) {
1223
+ const descriptors = getDescriptors(elements, descriptorList);
1224
+ return mergeDescriptors(...descriptors);
1234
1225
  }
1235
- var CLERK_IMAGE_URL_BASES = ["https://img.clerk.com/", "https://img.clerkstage.dev/", "https://img.lclclerk.com/"];
1236
- var isClerkImage = (src) => {
1237
- return !!CLERK_IMAGE_URL_BASES.some((base) => src == null ? void 0 : src.includes(base));
1238
- };
1239
-
1240
- // src/utils/images.ts
1241
- var generateSrcSet = ({ src, width }) => {
1242
- if (!src) {
1243
- return "";
1226
+ var SIZE = 16;
1227
+ var layoutStyle = {
1228
+ spinner: {
1229
+ className: "cl-26207fa4"
1244
1230
  }
1245
- return generateSrc({ src, width });
1246
1231
  };
1247
- var generateSrc = ({ src, width }) => {
1248
- if (!isValidUrl(src) || isDataUri(src)) {
1249
- return src;
1250
- }
1251
- const newSrc = new URL(src);
1252
- if (width) {
1253
- newSrc.searchParams.append("width", width == null ? void 0 : width.toString());
1232
+ var visualStyle = {
1233
+ spinner: {
1234
+ className: "cl-9feebad9"
1254
1235
  }
1255
- return newSrc.href;
1256
1236
  };
1257
- var BASE_IMAGE_WIDTH = 80;
1258
- var Image = React2.forwardRef(function Image2({
1259
- src,
1260
- size = BASE_IMAGE_WIDTH,
1261
- ...props
1262
- }, forwardedRef) {
1263
- const shouldOptimize = isClerkImage(src);
1264
- return /* @__PURE__ */ jsx(
1265
- "img",
1266
- {
1267
- ref: forwardedRef,
1268
- "data-image": "",
1269
- crossOrigin: "anonymous",
1270
- srcSet: shouldOptimize ? generateSrcSet({ src, width: size }) : void 0,
1271
- src: shouldOptimize ? generateSrc({ src, width: size * 2 }) : src,
1272
- alt: props.alt,
1273
- ...props
1274
- }
1275
- );
1237
+ var spinner = dva({
1238
+ base: "spinner"
1276
1239
  });
1277
- var RootDefaultElement = "div";
1278
- var Root = React2.forwardRef(
1279
- function CardRoot({ as, banner, children, className, ...props }, forwardedRef) {
1280
- const Element = as || RootDefaultElement;
1281
- return /* @__PURE__ */ jsxs(
1282
- Element,
1283
- {
1284
- ref: forwardedRef,
1285
- "data-card-root": "",
1286
- ...props,
1287
- className: cx(
1288
- "cl-a6922c72",
1289
- "cl-5e44c334",
1290
- "cl-c4324dd6",
1291
- "cl-3fbacce1",
1292
- "cl-7ea85c83",
1293
- banner ? [
1294
- "cl-a52b4c3f",
1295
- "cl-5af1449f"
1296
- ] : "cl-bc4a783b",
1297
- className
1298
- ),
1299
- children: [
1300
- banner && /* @__PURE__ */ jsx(
1301
- "div",
1302
- {
1303
- "data-card-root-banner": "",
1304
- className: cx(
1305
- "cl-7817f2f2",
1306
- className
1307
- ),
1308
- children: /* @__PURE__ */ jsx(
1309
- "p",
1240
+ var Spinner = forwardRef(function Spinner2({
1241
+ children,
1242
+ descriptor
1243
+ }, ref) {
1244
+ const { elements } = useAppearance().parsedAppearance;
1245
+ return /* @__PURE__ */ jsxs(
1246
+ "span",
1247
+ {
1248
+ ref,
1249
+ ...applyDescriptors(elements, spinner({ descriptor })),
1250
+ children: [
1251
+ /* @__PURE__ */ jsx("span", { className: "cl-32fb0905", children }),
1252
+ /* @__PURE__ */ jsxs(
1253
+ "svg",
1254
+ {
1255
+ viewBox: [0, 0, SIZE, SIZE].join(" "),
1256
+ fill: "none",
1257
+ xmlns: "http://www.w3.org/2000/svg",
1258
+ className: "cl-4f43603c",
1259
+ style: {
1260
+ ["--spinner-origin"]: Array.from({ length: 2 }).fill(`${16 / SIZE / 2}rem`).join(" ")
1261
+ },
1262
+ "aria-hidden": true,
1263
+ children: [
1264
+ /* @__PURE__ */ jsxs(
1265
+ "g",
1310
1266
  {
1311
- className: cx(
1312
- "cl-03e68f06",
1313
- className
1314
- ),
1315
- ...props,
1316
- children: banner
1317
- }
1318
- )
1319
- }
1320
- ),
1321
- children && /* @__PURE__ */ jsx(
1322
- "div",
1323
- {
1324
- "data-card-root-inner": "",
1325
- className: cx("cl-9c68c093", className),
1326
- children
1327
- }
1328
- )
1329
- ]
1330
- }
1331
- );
1332
- }
1333
- );
1334
- var Content = React2.forwardRef(function CardContent({ children, className, ...props }, forwardedRef) {
1335
- return /* @__PURE__ */ jsx(
1336
- "div",
1337
- {
1338
- ref: forwardedRef,
1339
- "data-card-content": "",
1340
- ...props,
1341
- className: cx(
1342
- "cl-85f9b607",
1343
- "cl-1c01a9d7",
1344
- className
1345
- ),
1346
- children
1347
- }
1348
- );
1349
- });
1350
- var Header = React2.forwardRef(function CardHeader({ children, className, ...props }, forwardedRef) {
1351
- return /* @__PURE__ */ jsx(
1352
- "div",
1353
- {
1354
- ref: forwardedRef,
1355
- "data-card-header": "",
1356
- ...props,
1357
- className: cx("cl-c757ad0c", className),
1358
- children
1359
- }
1360
- );
1361
- });
1362
- var Logo = React2.forwardRef(function CardLogo({
1363
- className,
1364
- href,
1365
- src,
1366
- ...props
1367
- }, forwardedRef) {
1368
- if (!src) {
1369
- return null;
1370
- }
1371
- const img = /* @__PURE__ */ jsx(
1372
- Image,
1373
- {
1374
- ref: forwardedRef,
1375
- "data-card-logo": "",
1376
- src,
1377
- size: 200,
1378
- ...props,
1379
- className: cx("cl-deefc87a", className)
1380
- }
1381
- );
1382
- return /* @__PURE__ */ jsx("div", { className: "cl-4f5262b8", children: href ? /* @__PURE__ */ jsx(
1383
- "a",
1384
- {
1385
- href,
1386
- className: "cl-33c167b1",
1387
- children: img
1388
- }
1389
- ) : img });
1390
- });
1391
- var Title = React2.forwardRef(function CardTitle({ children, className, ...props }, forwardedRef) {
1392
- return /* @__PURE__ */ jsx(
1393
- "h2",
1394
- {
1395
- ref: forwardedRef,
1396
- "data-card-title": "",
1397
- ...props,
1398
- className: cx("cl-f29e36a7", className),
1399
- children
1400
- }
1401
- );
1402
- });
1403
- var Description = React2.forwardRef(
1404
- function CardDescription({ children, className, ...props }, forwardedRef) {
1405
- return /* @__PURE__ */ jsx(
1406
- "p",
1407
- {
1408
- ref: forwardedRef,
1409
- ...props,
1410
- className: cx("cl-5c413d88", className),
1411
- children
1412
- }
1413
- );
1414
- }
1415
- );
1416
- var Body = React2.forwardRef(function CardBody({ children, className, ...props }, forwardedRef) {
1417
- return /* @__PURE__ */ jsx(
1418
- "div",
1419
- {
1420
- ref: forwardedRef,
1421
- "data-card-body": "",
1422
- ...props,
1423
- className: cx("cl-5eebf917", className),
1424
- children
1425
- }
1426
- );
1427
- });
1428
- var Actions = React2.forwardRef(function CardActions({ children, className, ...props }, forwardedRef) {
1429
- return /* @__PURE__ */ jsx(
1430
- "div",
1431
- {
1432
- ref: forwardedRef,
1433
- "data-card-actions": "",
1434
- ...props,
1435
- className: cx(
1436
- "cl-cc1fa4d3",
1437
- // Note:
1438
- // Prevents underline interractions triggering outside of the link text
1439
- // https://linear.app/clerk/issue/SDKI-192/#comment-ebf943b0
1440
- "cl-04c8fa73",
1441
- className
1442
- ),
1443
- children
1444
- }
1445
- );
1446
- });
1447
- React2.forwardRef(function CardBanner({ children, className, ...props }, forwardedRef) {
1448
- return /* @__PURE__ */ jsx(
1449
- "div",
1450
- {
1451
- "data-card-banner": "",
1452
- className: cx("cl-b4e3cd77", className),
1453
- children: /* @__PURE__ */ jsx(
1454
- "p",
1455
- {
1456
- ref: forwardedRef,
1457
- className: cx("cl-fb5351c6", className),
1458
- ...props,
1459
- children
1460
- }
1461
- )
1462
- }
1463
- );
1464
- });
1465
- var Footer = React2.forwardRef(function CardFooter({
1466
- branded = true,
1467
- helpPageUrl,
1468
- privacyPageUrl,
1469
- termsPageUrl,
1470
- children,
1471
- className,
1472
- ...props
1473
- }, forwardedRef) {
1474
- const hasPageLinks = helpPageUrl || privacyPageUrl || termsPageUrl;
1475
- const renderFooter = branded || hasPageLinks || children;
1476
- const renderSubFooter = branded || hasPageLinks;
1477
- const hasBrandingAndPageLinks = branded && hasPageLinks;
1478
- return renderFooter ? /* @__PURE__ */ jsxs(
1479
- "div",
1480
- {
1481
- ref: forwardedRef,
1482
- "data-card-footer": "",
1483
- ...props,
1484
- className: cx("cl-0f2a693e", className),
1485
- children: [
1486
- children,
1487
- renderSubFooter ? /* @__PURE__ */ jsxs(
1488
- "div",
1489
- {
1490
- className: cx("cl-10ec6412", hasBrandingAndPageLinks ? "cl-32c92bb1" : "cl-a503dd37"),
1491
- children: [
1492
- branded ? /* @__PURE__ */ jsxs(
1493
- "p",
1494
- {
1495
- className: "cl-286d6459",
1496
- children: [
1497
- "Secured by",
1498
- " ",
1499
- /* @__PURE__ */ jsx(
1500
- "a",
1501
- {
1502
- "aria-label": "Clerk logo",
1503
- href: "https://www.clerk.com?utm_source=clerk&utm_medium=components",
1504
- target: "_blank",
1505
- rel: "noopener",
1506
- className: "cl-e9dc1e80",
1507
- children: /* @__PURE__ */ jsx(ClerkLogo, {})
1508
- }
1509
- )
1510
- ]
1511
- }
1512
- ) : null,
1513
- hasPageLinks ? /* @__PURE__ */ jsxs("div", { className: "cl-c354e22d", children: [
1514
- helpPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: helpPageUrl, children: "Help" }) : null,
1515
- privacyPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: privacyPageUrl, children: "Privacy" }) : null,
1516
- termsPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: termsPageUrl, children: "Terms" }) : null
1517
- ] }) : null
1518
- ]
1519
- }
1520
- ) : null
1521
- ]
1522
- }
1523
- ) : null;
1524
- });
1525
- var FooterAction = React2.forwardRef(
1526
- function CardFooterAction({ children, className, ...props }, forwardedRef) {
1527
- return /* @__PURE__ */ jsx(
1528
- "div",
1529
- {
1530
- ref: forwardedRef,
1531
- "data-card-footer-action": "",
1532
- ...props,
1533
- className: cx("cl-9f2b45b5", className),
1534
- children
1535
- }
1536
- );
1537
- }
1538
- );
1539
- var FooterActionText = React2.forwardRef(
1540
- function CardFooterActionText({ children, className, ...props }, forwardedRef) {
1541
- return /* @__PURE__ */ jsx(
1542
- "p",
1543
- {
1544
- ref: forwardedRef,
1545
- "data-card-footer-action-text": "",
1546
- ...props,
1547
- className: cx("cl-8e9f71ce", className),
1548
- children
1549
- }
1550
- );
1551
- }
1552
- );
1553
- var footerActionButton = cva({
1554
- base: "cl-812d8d14"
1555
- });
1556
- var FooterActionButton = React2.forwardRef(
1557
- function CardFooterActionButton({ children, className, type = "button", ...props }, forwardedRef) {
1558
- return /* @__PURE__ */ jsx(
1559
- "button",
1560
- {
1561
- ref: forwardedRef,
1562
- "data-card-footer-action-button": "",
1563
- type,
1564
- className: footerActionButton({ className }),
1565
- ...props,
1566
- children
1567
- }
1568
- );
1569
- }
1570
- );
1571
- var FooterActionLink = React2.forwardRef(
1572
- function CardFooterActionLink({ children, className, ...props }, forwardedRef) {
1573
- return /* @__PURE__ */ jsx(
1574
- "a",
1575
- {
1576
- ref: forwardedRef,
1577
- "data-card-footer-action-link": "",
1578
- ...props,
1579
- className: footerActionButton({ className }),
1580
- children
1581
- }
1582
- );
1583
- }
1584
- );
1585
- var FooterPageLink = React2.forwardRef(
1586
- function CardFooterPageLink({ children, className, ...props }, forwardedRef) {
1587
- return /* @__PURE__ */ jsx(
1588
- "a",
1589
- {
1590
- ref: forwardedRef,
1591
- ...props,
1592
- target: "_blank",
1593
- rel: "noopener",
1594
- className: cx("cl-a53e0ec1", className),
1595
- children
1596
- }
1597
- );
1598
- }
1599
- );
1600
- function useEnabledConnections() {
1601
- const clerk = useClerk();
1602
- const { socialProviderStrategies, web3FirstFactors, authenticatableSocialStrategies } = (clerk == null ? void 0 : clerk.__unstable__environment).userSettings;
1603
- const enabledConnections = /* @__PURE__ */ new Set([
1604
- ...socialProviderStrategies,
1605
- ...web3FirstFactors,
1606
- ...authenticatableSocialStrategies
1607
- ]);
1608
- return [...OAUTH_PROVIDERS, ...WEB3_PROVIDERS].filter((provider) => enabledConnections.has(provider.strategy));
1609
- }
1610
- var SIZE = 16;
1611
- var Spinner = forwardRef(function Spinner2({
1612
- children,
1613
- className
1614
- }, ref) {
1615
- return /* @__PURE__ */ jsxs(
1616
- "span",
1617
- {
1618
- ref,
1619
- className: cx("cl-114ff405", className),
1620
- children: [
1621
- /* @__PURE__ */ jsx("span", { className: "cl-32fb0905", children }),
1622
- /* @__PURE__ */ jsxs(
1623
- "svg",
1624
- {
1625
- viewBox: [0, 0, SIZE, SIZE].join(" "),
1626
- fill: "none",
1627
- xmlns: "http://www.w3.org/2000/svg",
1628
- className: "cl-4f43603c",
1629
- style: {
1630
- ["--spinner-origin"]: Array.from({ length: 2 }).fill(`${16 / SIZE / 2}rem`).join(" ")
1631
- },
1632
- "aria-hidden": true,
1633
- children: [
1634
- /* @__PURE__ */ jsxs(
1635
- "g",
1636
- {
1637
- className: cx(
1638
- "cl-bfbc36b1",
1639
- "cl-22c1b7ea",
1640
- "cl-45bbc6bf",
1641
- "cl-e5d7b81e",
1642
- "cl-4bd15f3b"
1267
+ className: cx$1(
1268
+ "cl-bfbc36b1",
1269
+ "cl-22c1b7ea",
1270
+ "cl-45bbc6bf",
1271
+ "cl-e5d7b81e",
1272
+ "cl-4bd15f3b"
1643
1273
  ),
1644
1274
  fill: "currentColor",
1645
1275
  opacity: 0.5,
@@ -1716,7 +1346,7 @@ var Spinner = forwardRef(function Spinner2({
1716
1346
  /* @__PURE__ */ jsx(
1717
1347
  "circle",
1718
1348
  {
1719
- className: cx(
1349
+ className: cx$1(
1720
1350
  "cl-4f43603c",
1721
1351
  "cl-bfbc36b1",
1722
1352
  "cl-22c1b7ea",
@@ -1742,46 +1372,91 @@ var Spinner = forwardRef(function Spinner2({
1742
1372
  }
1743
1373
  );
1744
1374
  });
1745
- var button = cva({
1746
- base: [
1747
- "cl-16a914bc",
1748
- // 16px
1749
- "cl-da41fb98",
1750
- "cl-f5aee1d0",
1751
- "cl-c8dc0199",
1752
- "cl-ff9d26a5",
1753
- "cl-ce4a8aff",
1754
- "cl-b55f0528",
1755
- "cl-d9cf47b8",
1756
- "cl-b30fc560",
1757
- "cl-8a3782da"
1758
- ],
1375
+ var layoutStyle2 = {
1376
+ button: {
1377
+ className: [
1378
+ "cl-16a914bc",
1379
+ // 16px
1380
+ "cl-da41fb98",
1381
+ "cl-f5aee1d0",
1382
+ "cl-c8dc0199",
1383
+ "cl-ff9d26a5",
1384
+ "cl-ce4a8aff",
1385
+ "cl-8a3782da"
1386
+ ].join(" ")
1387
+ },
1388
+ buttonIcon: {
1389
+ className: "cl-27ead27a"
1390
+ },
1391
+ buttonSpinner: {
1392
+ className: "cl-27ead27a"
1393
+ }
1394
+ };
1395
+ var visualStyle2 = {
1396
+ button: {
1397
+ className: ["cl-b55f0528", "cl-d9cf47b8", "cl-b30fc560"].join(" ")
1398
+ },
1399
+ buttonPrimary: {
1400
+ className: [
1401
+ "cl-a98b2d0f",
1402
+ "cl-e7b4a4f3",
1403
+ "cl-93e9de3b",
1404
+ "cl-cb1d8f85",
1405
+ "cl-2b39a966",
1406
+ "cl-5d812cb6"
1407
+ ].join(" ")
1408
+ },
1409
+ buttonSecondary: {
1410
+ className: [
1411
+ "cl-947a937d",
1412
+ "cl-2031c7be",
1413
+ "cl-97c9b979",
1414
+ "cl-aa729509"
1415
+ ].join(" ")
1416
+ },
1417
+ buttonConnection: {
1418
+ className: [
1419
+ "cl-947a937d",
1420
+ "cl-2031c7be",
1421
+ "cl-97c9b979",
1422
+ "cl-aa729509"
1423
+ ].join(" ")
1424
+ },
1425
+ buttonPrimaryDefault: {
1426
+ className: "cl-dd1ec9c5"
1427
+ },
1428
+ buttonSecondaryDefault: {
1429
+ className: "cl-9b31bb43"
1430
+ },
1431
+ buttonConnectionDefault: {
1432
+ className: "cl-9b31bb43"
1433
+ },
1434
+ buttonDisabled: {
1435
+ className: "cl-d4e2e313"
1436
+ },
1437
+ buttonBusy: {
1438
+ className: "cl-d6edf6f5"
1439
+ },
1440
+ buttonText: {
1441
+ className: "cl-63a1f595"
1442
+ },
1443
+ buttonTextVisuallyHidden: {
1444
+ className: "cl-32fb0905"
1445
+ },
1446
+ buttonIcon: {
1447
+ className: "cl-2e5aed0f"
1448
+ },
1449
+ buttonSpinner: {
1450
+ className: "cl-291bc932"
1451
+ }
1452
+ };
1453
+ var button = dva({
1454
+ base: "button",
1759
1455
  variants: {
1760
1456
  intent: {
1761
- primary: [
1762
- "cl-a98b2d0f",
1763
- "cl-e7b4a4f3",
1764
- "cl-93e9de3b",
1765
- "cl-cb1d8f85",
1766
- "cl-2b39a966",
1767
- "cl-5d812cb6"
1768
- ],
1769
- secondary: [
1770
- "cl-947a937d",
1771
- "cl-2031c7be",
1772
- "cl-97c9b979",
1773
- "cl-aa729509"
1774
- ],
1775
- // Note:
1776
- // This currently looks the same as `secondary`, but we've intentfully
1777
- // kept this as a separate variant for now, due to its nuances in `busy`
1778
- // behavior
1779
- connection: [
1780
- "cl-947a937d",
1781
- "cl-2031c7be",
1782
- "cl-97c9b979",
1783
- "cl-aa729509"
1784
- ]
1457
+ primary: "buttonPrimary",
1458
+ secondary: "buttonSecondary",
1459
+ connection: "buttonConnection"
1785
1460
  },
1786
1461
  busy: {
1787
1462
  false: null,
@@ -1793,17 +1468,17 @@ var button = cva({
1793
1468
  }
1794
1469
  },
1795
1470
  compoundVariants: [
1796
- { busy: false, disabled: false, intent: "primary", className: "cl-dd1ec9c5" },
1797
- { busy: false, disabled: false, intent: "secondary", className: "cl-9b31bb43" },
1798
- { busy: false, disabled: false, intent: "connection", className: "cl-9b31bb43" },
1799
- { busy: false, disabled: true, className: "cl-d4e2e313" },
1800
- { busy: true, disabled: false, className: "cl-d6edf6f5" }
1471
+ { busy: false, disabled: false, intent: "primary", descriptor: "buttonPrimaryDefault" },
1472
+ { busy: false, disabled: false, intent: "secondary", descriptor: "buttonSecondaryDefault" },
1473
+ { busy: false, disabled: false, intent: "connection", descriptor: "buttonConnectionDefault" },
1474
+ { busy: false, disabled: true, descriptor: "buttonDisabled" },
1475
+ { busy: true, disabled: false, descriptor: "buttonBusy" }
1801
1476
  ]
1802
1477
  });
1803
- var Button = React2.forwardRef(function Button2({
1478
+ var Button = React5.forwardRef(function Button2({
1804
1479
  busy = false,
1805
1480
  children,
1806
- className,
1481
+ descriptor,
1807
1482
  disabled = false,
1808
1483
  iconStart,
1809
1484
  iconEnd,
@@ -1812,38 +1487,86 @@ var Button = React2.forwardRef(function Button2({
1812
1487
  textVisuallyHidden,
1813
1488
  ...props
1814
1489
  }, forwardedRef) {
1815
- const spinner = /* @__PURE__ */ jsx(Spinner, { className: "cl-c5cd4d02", children: "Loading\u2026" });
1490
+ const { elements } = useAppearance().parsedAppearance;
1491
+ const spinner2 = /* @__PURE__ */ jsx(Spinner, { descriptor: "buttonSpinner", children: "Loading\u2026" });
1816
1492
  return /* @__PURE__ */ jsx(
1817
1493
  "button",
1818
1494
  {
1819
- "data-button": "",
1820
1495
  ref: forwardedRef,
1821
- className: button({ busy, disabled, intent, className }),
1496
+ ...applyDescriptors(elements, button({ busy, disabled, intent, descriptor })),
1822
1497
  disabled: busy || disabled,
1823
1498
  type,
1824
1499
  ...props,
1825
- children: busy && intent === "primary" ? spinner : /* @__PURE__ */ jsxs(Fragment, { children: [
1826
- iconStart ? busy && intent === "connection" ? spinner : /* @__PURE__ */ jsx(
1827
- "span",
1828
- {
1829
- "data-button-icon": "",
1830
- className: "cl-6237331a",
1831
- children: iconStart
1832
- }
1833
- ) : null,
1834
- children ? /* @__PURE__ */ jsx("span", { className: cx("cl-63a1f595", textVisuallyHidden && "cl-32fb0905"), children }) : null,
1835
- iconEnd ? /* @__PURE__ */ jsx(
1836
- "span",
1837
- {
1838
- "data-button-icon": "",
1839
- className: "cl-6237331a",
1840
- children: iconEnd
1841
- }
1842
- ) : null
1500
+ children: busy && intent === "primary" ? spinner2 : /* @__PURE__ */ jsxs(Fragment, { children: [
1501
+ iconStart ? busy && intent === "connection" ? spinner2 : /* @__PURE__ */ jsx("span", { ...applyDescriptors(elements, "buttonIcon buttonIconStart"), children: iconStart }) : null,
1502
+ children ? /* @__PURE__ */ jsx("span", { ...mergeDescriptors(elements.buttonText, !!textVisuallyHidden && elements.buttonTextVisuallyHidden), children }) : null,
1503
+ iconEnd ? /* @__PURE__ */ jsx("span", { ...applyDescriptors(elements, "buttonIcon buttonIconEnd"), children: iconEnd }) : null
1843
1504
  ] })
1844
1505
  }
1845
1506
  );
1846
1507
  });
1508
+ var $bdb11010cef70236$var$idsUpdaterMap = /* @__PURE__ */ new Map();
1509
+ function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
1510
+ if (idA === idB) return idA;
1511
+ let setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
1512
+ if (setIdA) {
1513
+ setIdA(idB);
1514
+ return idB;
1515
+ }
1516
+ let setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
1517
+ if (setIdB) {
1518
+ setIdB(idA);
1519
+ return idA;
1520
+ }
1521
+ return idB;
1522
+ }
1523
+
1524
+ // ../../node_modules/@react-aria/utils/dist/chain.mjs
1525
+ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
1526
+ return (...args) => {
1527
+ for (let callback of callbacks) if (typeof callback === "function") callback(...args);
1528
+ };
1529
+ }
1530
+
1531
+ // ../../node_modules/@react-aria/utils/dist/mergeProps.mjs
1532
+ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
1533
+ let result = {
1534
+ ...args[0]
1535
+ };
1536
+ for (let i = 1; i < args.length; i++) {
1537
+ let props = args[i];
1538
+ for (let key in props) {
1539
+ let a = result[key];
1540
+ let b = props[key];
1541
+ if (typeof a === "function" && typeof b === "function" && // This is a lot faster than a regex.
1542
+ key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
1543
+ 65 && key.charCodeAt(2) <= /* 'Z' */
1544
+ 90) result[key] = ($ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
1545
+ else if ((key === "className" || key === "UNSAFE_className") && typeof a === "string" && typeof b === "string") result[key] = (clsx_default)(a, b);
1546
+ else if (key === "id" && a && b) result.id = ($bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
1547
+ else result[key] = b !== void 0 ? b : a;
1548
+ }
1549
+ }
1550
+ return result;
1551
+ }
1552
+
1553
+ // src/primitives/icons/icon.tsx
1554
+ var Icon = React5.forwardRef(
1555
+ function Icon2(props, ref) {
1556
+ const { children, "aria-label": ariaLabel, "aria-hidden": ariaHidden, ...restProps } = props;
1557
+ return React5.cloneElement(children, {
1558
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(children.props, restProps),
1559
+ ref,
1560
+ width: "1em",
1561
+ height: "1em",
1562
+ fill: "none",
1563
+ focusable: "false",
1564
+ "aria-label": ariaLabel,
1565
+ "aria-hidden": ariaLabel ? ariaHidden || void 0 : true,
1566
+ role: "img"
1567
+ });
1568
+ }
1569
+ );
1847
1570
  function Apple(props) {
1848
1571
  return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx(
1849
1572
  "path",
@@ -3130,10 +2853,20 @@ function getColumnCount({ length, max }) {
3130
2853
  const numRows = Math.ceil(length / max);
3131
2854
  return Math.ceil(length / numRows);
3132
2855
  }
2856
+ var layoutStyle3 = {
2857
+ connectionList: {
2858
+ className: "cl-519e344c"
2859
+ },
2860
+ connectionListItem: {
2861
+ className: "cl-b9a44166"
2862
+ }
2863
+ };
2864
+ var visualStyle3 = {};
3133
2865
  function Connections(props) {
3134
2866
  const { t } = useLocalizations();
3135
2867
  const enabledConnections = useEnabledConnections();
3136
- const { options } = useAppearance().parsedAppearance;
2868
+ const { options, elements } = useAppearance().parsedAppearance;
2869
+ const connectionListDescriptors = applyDescriptors(elements, "connectionList");
3137
2870
  const hasConnection = enabledConnections.length > 0;
3138
2871
  const textVisuallyHidden = typeof (props == null ? void 0 : props.textVisuallyHidden) !== "undefined" ? props.textVisuallyHidden : enabledConnections.length > 2 || (options == null ? void 0 : options.socialButtonsVariant) === "iconButton";
3139
2872
  const columns = getColumnCount({ length: enabledConnections.length, max: (props == null ? void 0 : props.columns) || 6 });
@@ -3141,22 +2874,23 @@ function Connections(props) {
3141
2874
  return hasConnection ? /* @__PURE__ */ jsx(
3142
2875
  "ul",
3143
2876
  {
3144
- className: "cl-519e344c",
3145
- style: { "--cl-connection-columns": columns },
2877
+ className: connectionListDescriptors.className,
2878
+ style: { ...connectionListDescriptors.style, "--cl-connection-columns": columns },
3146
2879
  children: enabledConnections.map((c) => {
3147
2880
  return /* @__PURE__ */ jsx(
3148
2881
  "li",
3149
2882
  {
3150
- className: "cl-b9a44166",
3151
- children: /* @__PURE__ */ jsx(Common2.Loading, { scope: `provider:${c.provider}`, children: (isConnectionLoading) => {
2883
+ ...applyDescriptors(elements, "connectionListItem"),
2884
+ children: /* @__PURE__ */ jsx(Common.Loading, { scope: `provider:${c.provider}`, children: (isConnectionLoading) => {
3152
2885
  return /* @__PURE__ */ jsx(
3153
- Common2.Connection,
2886
+ Common.Connection,
3154
2887
  {
3155
2888
  name: c.provider,
3156
2889
  asChild: true,
3157
2890
  children: /* @__PURE__ */ jsx(
3158
2891
  Button,
3159
2892
  {
2893
+ descriptor: `buttonConnection__${c.provider}`,
3160
2894
  intent: "connection",
3161
2895
  busy: isConnectionLoading,
3162
2896
  disabled: (props == null ? void 0 : props.disabled) || isConnectionLoading,
@@ -3177,109 +2911,22 @@ function Connections(props) {
3177
2911
  }
3178
2912
  ) : null;
3179
2913
  }
3180
- function GlobalError() {
3181
- const { translateError } = useLocalizations();
3182
- return /* @__PURE__ */ jsx(GlobalError$1, { children: ({ message, code }) => {
3183
- return /* @__PURE__ */ jsx(Alert, { children: translateError({ message, code }) });
3184
- } });
3185
- }
3186
- var link = cva({
3187
- base: "cl-dc2a2420",
3188
- variants: {
3189
- busy: {
3190
- false: null,
3191
- true: "cl-5efab14d"
3192
- },
3193
- disabled: {
3194
- false: null,
3195
- true: "cl-d4e2e313"
3196
- },
3197
- // Override native behaviour for third-party packages
3198
- // e.g. react-aria-components
3199
- focusVisible: {
3200
- native: "cl-b13d8727",
3201
- "data-attribute": "cl-e6143e08"
3202
- },
3203
- size: {
3204
- sm: "cl-c74ab393",
3205
- base: "cl-757071a1"
3206
- }
3207
- },
3208
- compoundVariants: [
3209
- {
3210
- busy: false,
3211
- disabled: false,
3212
- className: "cl-b5672060"
3213
- }
3214
- ],
3215
- defaultVariants: {
3216
- busy: false,
3217
- disabled: false,
3218
- focusVisible: "native",
3219
- size: "base"
3220
- }
3221
- });
3222
- var LinkButton = React2.forwardRef(function LinkButton2({
3223
- busy,
3224
- children,
3225
- className,
3226
- disabled,
3227
- size,
3228
- ...props
3229
- }, forwardedRef) {
3230
- return (
3231
- // eslint-disable-next-line react/button-has-type
2914
+ function ExclamationOctagonSm(props) {
2915
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
3232
2916
  /* @__PURE__ */ jsx(
3233
- "button",
2917
+ "path",
3234
2918
  {
3235
- ref: forwardedRef,
3236
- "data-link": true,
3237
- className: link({ busy, disabled, size, className }),
3238
- disabled: busy || disabled,
3239
- ...props,
3240
- children
2919
+ d: "M8 5.75V7.25",
2920
+ stroke: "currentColor",
2921
+ strokeWidth: "1.5",
2922
+ strokeLinecap: "round",
2923
+ strokeLinejoin: "round"
3241
2924
  }
3242
- )
3243
- );
3244
- });
3245
- function CaretRightLegacySm(props) {
3246
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx(
3247
- "svg",
3248
- {
3249
- viewBox: "0 0 16 16",
3250
- className: "cl-36b12e83",
3251
- children: /* @__PURE__ */ jsx(
3252
- "path",
3253
- {
3254
- d: "M10 8.25L6.5 6V10.5L10 8.25Z",
3255
- fill: "currentColor",
3256
- stroke: "currentColor",
3257
- strokeWidth: "1.5",
3258
- strokeLinecap: "round",
3259
- strokeLinejoin: "round"
3260
- }
3261
- )
3262
- }
3263
- ) });
3264
- }
3265
- var Animated = (props) => {
3266
- const { children, asChild } = props;
3267
- const { animations } = useAppearance().parsedAppearance.options;
3268
- const [parent] = useAutoAnimate();
3269
- const ref = animations !== false ? parent : null;
3270
- if (asChild) {
3271
- return cloneElement(children, { ref });
3272
- }
3273
- return /* @__PURE__ */ jsx("div", { ref, children });
3274
- };
3275
- function CheckmarkCircleSm(props) {
3276
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
2925
+ ),
3277
2926
  /* @__PURE__ */ jsx(
3278
- "circle",
2927
+ "path",
3279
2928
  {
3280
- cx: "8",
3281
- cy: "8",
3282
- r: "5.25",
2929
+ d: "M8 10V10.01",
3283
2930
  stroke: "currentColor",
3284
2931
  strokeWidth: "1.5",
3285
2932
  strokeLinecap: "round",
@@ -3289,7 +2936,7 @@ function CheckmarkCircleSm(props) {
3289
2936
  /* @__PURE__ */ jsx(
3290
2937
  "path",
3291
2938
  {
3292
- d: "M6.25 8.35L7.65 9.75L9.75 6.25",
2939
+ d: "M10.25 2.75H5.75L2.75 5.75V10.25L5.75 13.25H10.25L13.25 10.25V5.75L10.25 2.75Z",
3293
2940
  stroke: "currentColor",
3294
2941
  strokeWidth: "1.5",
3295
2942
  strokeLinecap: "round",
@@ -3298,14 +2945,12 @@ function CheckmarkCircleSm(props) {
3298
2945
  )
3299
2946
  ] }) });
3300
2947
  }
3301
- function InformationCircleSm(props) {
2948
+ function ExclamationTriangleSm(props) {
3302
2949
  return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
3303
2950
  /* @__PURE__ */ jsx(
3304
- "circle",
2951
+ "path",
3305
2952
  {
3306
- cx: "8",
3307
- cy: "8",
3308
- r: "5.25",
2953
+ d: "M8 6.75V8.25",
3309
2954
  stroke: "currentColor",
3310
2955
  strokeWidth: "1.5",
3311
2956
  strokeLinecap: "round",
@@ -3315,7 +2960,7 @@ function InformationCircleSm(props) {
3315
2960
  /* @__PURE__ */ jsx(
3316
2961
  "path",
3317
2962
  {
3318
- d: "M8 8.75V10.25",
2963
+ d: "M8 10.5V10.51",
3319
2964
  stroke: "currentColor",
3320
2965
  strokeWidth: "1.5",
3321
2966
  strokeLinecap: "round",
@@ -3325,7 +2970,7 @@ function InformationCircleSm(props) {
3325
2970
  /* @__PURE__ */ jsx(
3326
2971
  "path",
3327
2972
  {
3328
- d: "M8 6.25024V6.26024",
2973
+ d: "M2.95652 10.4518L6.27146 3.8188C6.98366 2.39373 9.01635 2.39373 9.72855 3.81881L13.0435 10.4518C13.686 11.7374 12.7516 13.25 11.3149 13.25H4.68506C3.24842 13.25 2.31404 11.7374 2.95652 10.4518Z",
3329
2974
  stroke: "currentColor",
3330
2975
  strokeWidth: "1.5",
3331
2976
  strokeLinecap: "round",
@@ -3334,1565 +2979,824 @@ function InformationCircleSm(props) {
3334
2979
  )
3335
2980
  ] }) });
3336
2981
  }
3337
- var Root2 = React2.forwardRef(function FieldRoot({ children, className, ...props }, forwardedRef) {
3338
- return /* @__PURE__ */ jsx(
2982
+ var layoutStyle4 = {
2983
+ alert: {
2984
+ className: "cl-fbddaa7d"
2985
+ },
2986
+ alertIcon: {
2987
+ className: "cl-af4e251c"
2988
+ }
2989
+ };
2990
+ var visualStyle4 = {
2991
+ alert: {
2992
+ className: "cl-15c02a47"
2993
+ },
2994
+ alert__warning: {
2995
+ className: "cl-a992fcfc"
2996
+ },
2997
+ alert__error: {
2998
+ className: "cl-66ef3405"
2999
+ }
3000
+ };
3001
+ var Alert = React5.forwardRef(function Alert2({ children, descriptors, intent = "error", ...props }, forwardedRef) {
3002
+ const { elements } = useAppearance().parsedAppearance;
3003
+ return /* @__PURE__ */ jsxs(
3339
3004
  "div",
3340
3005
  {
3341
- "data-field-root": "",
3342
3006
  ref: forwardedRef,
3343
3007
  ...props,
3344
- className: cx(
3345
- "cl-dcb655e4",
3346
- "cl-03811a40",
3347
- "cl-81d1ec5b",
3348
- "cl-3a46e0d4",
3349
- "cl-4636b1d3",
3350
- "cl-3da4a9c6",
3351
- "cl-7c5144aa",
3352
- className
3008
+ ...mergeDescriptors(
3009
+ elements.alert,
3010
+ intent === "error" && elements.alert__error,
3011
+ intent === "warning" && elements.alert__warning,
3012
+ ...descriptors != null ? descriptors : []
3353
3013
  ),
3354
- children
3014
+ children: [
3015
+ {
3016
+ error: /* @__PURE__ */ jsx(ExclamationOctagonSm, { ...mergeDescriptors(elements.alertIcon) }),
3017
+ warning: /* @__PURE__ */ jsx(ExclamationTriangleSm, { ...mergeDescriptors(elements.alertIcon) })
3018
+ }[intent],
3019
+ children
3020
+ ]
3355
3021
  }
3356
3022
  );
3357
3023
  });
3358
- var Label = React2.forwardRef(function FieldLabel({
3359
- className,
3360
- children,
3361
- visuallyHidden,
3024
+ var ClerkLogo = () => /* @__PURE__ */ jsxs(
3025
+ "svg",
3026
+ {
3027
+ className: "cl-2a836795",
3028
+ fill: "none",
3029
+ xmlns: "http://www.w3.org/2000/svg",
3030
+ viewBox: "0 0 50 14",
3031
+ children: [
3032
+ /* @__PURE__ */ jsx(
3033
+ "ellipse",
3034
+ {
3035
+ cx: "7.889",
3036
+ cy: "7",
3037
+ rx: "2.187",
3038
+ ry: "2.188",
3039
+ fill: "currentColor"
3040
+ }
3041
+ ),
3042
+ /* @__PURE__ */ jsx(
3043
+ "path",
3044
+ {
3045
+ d: "M11.83 12.18a.415.415 0 0 1-.05.64A6.967 6.967 0 0 1 7.888 14a6.967 6.967 0 0 1-3.891-1.18.415.415 0 0 1-.051-.64l1.598-1.6a.473.473 0 0 1 .55-.074 3.92 3.92 0 0 0 1.794.431 3.92 3.92 0 0 0 1.792-.43.473.473 0 0 1 .551.074l1.599 1.598Z",
3046
+ fill: "currentColor"
3047
+ }
3048
+ ),
3049
+ /* @__PURE__ */ jsx(
3050
+ "path",
3051
+ {
3052
+ opacity: "0.5",
3053
+ d: "M11.78 1.18a.415.415 0 0 1 .05.64l-1.598 1.6a.473.473 0 0 1-.55.073 3.937 3.937 0 0 0-5.3 5.3.473.473 0 0 1-.074.55L2.71 10.942a.415.415 0 0 1-.641-.051 7 7 0 0 1 9.71-9.71Z",
3054
+ fill: "currentColor"
3055
+ }
3056
+ ),
3057
+ /* @__PURE__ */ jsx(
3058
+ "path",
3059
+ {
3060
+ fillRule: "evenodd",
3061
+ clipRule: "evenodd",
3062
+ d: "M23.748 1.422c0-.06.05-.11.11-.11h1.64c.06 0 .11.05.11.11v11.156a.11.11 0 0 1-.11.11h-1.64a.11.11 0 0 1-.11-.11V1.422Zm-2.315 8.9a.112.112 0 0 0-.15.004 2.88 2.88 0 0 1-.884.569c-.36.148-.747.222-1.137.219-.33.01-.658-.047-.965-.166a2.422 2.422 0 0 1-.817-.527c-.424-.432-.668-1.05-.668-1.785 0-1.473.98-2.48 2.45-2.48.394-.005.785.074 1.144.234.325.144.617.35.86.607.04.044.11.049.155.01l1.108-.959a.107.107 0 0 0 .01-.152c-.832-.93-2.138-1.412-3.379-1.412-2.499 0-4.27 1.686-4.27 4.166 0 1.227.44 2.26 1.182 2.99.743.728 1.801 1.157 3.022 1.157 1.53 0 2.763-.587 3.485-1.34a.107.107 0 0 0-.009-.155l-1.137-.98Zm13.212-1.14a.108.108 0 0 1-.107.096H28.79a.106.106 0 0 0-.104.132c.286 1.06 1.138 1.701 2.302 1.701a2.59 2.59 0 0 0 1.136-.236 2.55 2.55 0 0 0 .862-.645.08.08 0 0 1 .112-.01l1.155 1.006c.044.039.05.105.013.15-.698.823-1.828 1.42-3.38 1.42-2.386 0-4.185-1.651-4.185-4.162 0-1.232.424-2.264 1.13-2.994.373-.375.82-.67 1.314-.87a3.968 3.968 0 0 1 1.557-.285c2.419 0 3.983 1.701 3.983 4.05a6.737 6.737 0 0 1-.04.647Zm-5.924-1.524a.104.104 0 0 0 .103.133h3.821c.07 0 .123-.066.103-.134-.26-.901-.921-1.503-1.947-1.503a2.13 2.13 0 0 0-.88.16 2.1 2.1 0 0 0-.733.507 2.242 2.242 0 0 0-.467.837Zm11.651-3.172c.061-.001.11.048.11.109v1.837a.11.11 0 0 1-.117.109 7.17 7.17 0 0 0-.455-.024c-1.43 0-2.27 1.007-2.27 2.329v3.732a.11.11 0 0 1-.11.11h-1.64a.11.11 0 0 1-.11-.11v-7.87c0-.06.049-.109.11-.109h1.64c.06 0 .11.05.11.11v1.104a.011.011 0 0 0 .02.007c.64-.857 1.587-1.333 2.587-1.333l.125-.001Zm4.444 4.81a.035.035 0 0 1 .056.006l2.075 3.334a.11.11 0 0 0 .093.052h1.865a.11.11 0 0 0 .093-.168L46.152 7.93a.11.11 0 0 1 .012-.131l2.742-3.026a.11.11 0 0 0-.081-.183h-1.946a.11.11 0 0 0-.08.036l-3.173 3.458a.11.11 0 0 1-.19-.074V1.422a.11.11 0 0 0-.11-.11h-1.64a.11.11 0 0 0-.11.11v11.156c0 .06.05.11.11.11h1.64a.11.11 0 0 0 .11-.11v-1.755a.11.11 0 0 1 .03-.075l1.35-1.452Z",
3063
+ fill: "currentColor"
3064
+ }
3065
+ )
3066
+ ]
3067
+ }
3068
+ );
3069
+
3070
+ // src/utils/validators.ts
3071
+ function isValidUrl(val) {
3072
+ if (!val) {
3073
+ return false;
3074
+ }
3075
+ try {
3076
+ new URL(val);
3077
+ return true;
3078
+ } catch (e) {
3079
+ return false;
3080
+ }
3081
+ }
3082
+ function isDataUri(val) {
3083
+ if (!isValidUrl(val)) {
3084
+ return false;
3085
+ }
3086
+ return new URL(val).protocol === "data:";
3087
+ }
3088
+ var CLERK_IMAGE_URL_BASES = ["https://img.clerk.com/", "https://img.clerkstage.dev/", "https://img.lclclerk.com/"];
3089
+ var isClerkImage = (src) => {
3090
+ return !!CLERK_IMAGE_URL_BASES.some((base) => src == null ? void 0 : src.includes(base));
3091
+ };
3092
+
3093
+ // src/utils/images.ts
3094
+ var generateSrcSet = ({ src, width }) => {
3095
+ if (!src) {
3096
+ return "";
3097
+ }
3098
+ return generateSrc({ src, width });
3099
+ };
3100
+ var generateSrc = ({ src, width }) => {
3101
+ if (!isValidUrl(src) || isDataUri(src)) {
3102
+ return src;
3103
+ }
3104
+ const newSrc = new URL(src);
3105
+ if (width) {
3106
+ newSrc.searchParams.append("width", width == null ? void 0 : width.toString());
3107
+ }
3108
+ return newSrc.href;
3109
+ };
3110
+ var BASE_IMAGE_WIDTH = 80;
3111
+ var Image = React5.forwardRef(function Image2({
3112
+ src,
3113
+ size = BASE_IMAGE_WIDTH,
3362
3114
  ...props
3363
3115
  }, forwardedRef) {
3116
+ const shouldOptimize = isClerkImage(src);
3364
3117
  return /* @__PURE__ */ jsx(
3365
- "label",
3118
+ "img",
3366
3119
  {
3367
- "data-field-label": "",
3368
3120
  ref: forwardedRef,
3369
- ...props,
3370
- className: cx(
3371
- visuallyHidden ? "cl-32fb0905" : [
3372
- "cl-e0435440",
3373
- "cl-b830f807"
3374
- ],
3375
- className
3376
- ),
3377
- children
3121
+ "data-image": "",
3122
+ crossOrigin: "anonymous",
3123
+ srcSet: shouldOptimize ? generateSrcSet({ src, width: size }) : void 0,
3124
+ src: shouldOptimize ? generateSrc({ src, width: size * 2 }) : src,
3125
+ alt: props.alt,
3126
+ ...props
3378
3127
  }
3379
3128
  );
3380
3129
  });
3381
- var LabelEnd = React2.forwardRef(function FieldLabelEnd({ className, children, ...props }, forwardedRef) {
3130
+ var RootDefaultElement = "div";
3131
+ var cardRootLayoutStyle = {
3132
+ cardRoot: {
3133
+ className: [
3134
+ "cl-a6922c72",
3135
+ "cl-5e44c334",
3136
+ "cl-c4324dd6",
3137
+ "cl-3fbacce1",
3138
+ "cl-89a8e890"
3139
+ ].join(" ")
3140
+ }
3141
+ };
3142
+ var cardRootVisualStyle = {
3143
+ cardRoot: {
3144
+ className: "cl-86f06b43"
3145
+ },
3146
+ cardRootDefault: {
3147
+ className: "cl-bc4a783b"
3148
+ },
3149
+ cardRootInner: {
3150
+ className: "cl-9c68c093"
3151
+ }
3152
+ };
3153
+ var Root = React5.forwardRef(
3154
+ function CardRoot({ as, banner, children, ...props }, forwardedRef) {
3155
+ const { elements } = useAppearance().parsedAppearance;
3156
+ const Element = as || RootDefaultElement;
3157
+ const cardRootDescriptors = applyDescriptors(elements, "cardRoot");
3158
+ const cardRootDefaultDescriptors = applyDescriptors(elements, "cardRootDefault");
3159
+ return /* @__PURE__ */ jsxs(
3160
+ Element,
3161
+ {
3162
+ ref: forwardedRef,
3163
+ ...props,
3164
+ className: cx$1(
3165
+ cardRootDescriptors.className,
3166
+ banner ? [
3167
+ "cl-a52b4c3f",
3168
+ "cl-5af1449f"
3169
+ ] : cardRootDefaultDescriptors.className
3170
+ ),
3171
+ children: [
3172
+ banner && /* @__PURE__ */ jsx(
3173
+ "div",
3174
+ {
3175
+ className: cx$1(
3176
+ "cl-7817f2f2"
3177
+ ),
3178
+ children: /* @__PURE__ */ jsx(
3179
+ "p",
3180
+ {
3181
+ className: cx$1(
3182
+ "cl-03e68f06"
3183
+ ),
3184
+ ...props,
3185
+ children: banner
3186
+ }
3187
+ )
3188
+ }
3189
+ ),
3190
+ children && /* @__PURE__ */ jsx("div", { ...mergeDescriptors(elements.cardRootInner), children })
3191
+ ]
3192
+ }
3193
+ );
3194
+ }
3195
+ );
3196
+ var cardContentLayoutStyle = {
3197
+ cardContent: {
3198
+ className: "cl-8baa595e"
3199
+ }
3200
+ };
3201
+ var cardContentVisualStyle = {
3202
+ cardContent: {
3203
+ className: [
3204
+ "cl-c99cd8b4",
3205
+ "cl-1c01a9d7"
3206
+ ].join(" ")
3207
+ }
3208
+ };
3209
+ var Content = React5.forwardRef(function CardContent({ children, className, ...props }, forwardedRef) {
3210
+ const { elements } = useAppearance().parsedAppearance;
3382
3211
  return /* @__PURE__ */ jsx(
3383
- "span",
3212
+ "div",
3384
3213
  {
3385
- "data-field-label-end": "",
3386
3214
  ref: forwardedRef,
3387
3215
  ...props,
3388
- className: cx("cl-43770a6e", className),
3216
+ ...mergeDescriptors(elements.cardContent),
3389
3217
  children
3390
3218
  }
3391
3219
  );
3392
3220
  });
3393
- var Hint = React2.forwardRef(function FieldHint({ className, children, ...props }, forwardedRef) {
3221
+ var cardHeaderLayoutStyle = {
3222
+ cardHeader: {
3223
+ className: "cl-c757ad0c"
3224
+ }
3225
+ };
3226
+ var cardHeaderVisualStyle = {};
3227
+ var Header = React5.forwardRef(function CardHeader({ children, className, ...props }, forwardedRef) {
3228
+ const { elements } = useAppearance().parsedAppearance;
3394
3229
  return /* @__PURE__ */ jsx(
3395
- LabelEnd,
3230
+ "div",
3396
3231
  {
3397
- "data-field-hint": "",
3398
3232
  ref: forwardedRef,
3399
3233
  ...props,
3400
- className: cx("cl-275d380b", className),
3234
+ ...mergeDescriptors(elements.cardHeader),
3401
3235
  children
3402
3236
  }
3403
3237
  );
3404
3238
  });
3405
- var Checkbox = React2.forwardRef(function FieldCheckbox(props, forwardedRef) {
3406
- return /* @__PURE__ */ jsx(
3407
- "input",
3239
+ var cardLogoLayoutStyle = {
3240
+ cardLogoBox: {
3241
+ className: "cl-4f5262b8"
3242
+ },
3243
+ cardLogoLink: {
3244
+ className: "cl-33c167b1"
3245
+ },
3246
+ cardLogoImage: {
3247
+ className: "cl-deefc87a"
3248
+ }
3249
+ };
3250
+ var cardLogoVisualStyle = {};
3251
+ var Logo = React5.forwardRef(function CardLogo({
3252
+ href,
3253
+ src,
3254
+ ...props
3255
+ }, forwardedRef) {
3256
+ const { elements } = useAppearance().parsedAppearance;
3257
+ if (!src) {
3258
+ return null;
3259
+ }
3260
+ const img = /* @__PURE__ */ jsx(
3261
+ Image,
3408
3262
  {
3409
- "data-field-checkbox": "",
3410
3263
  ref: forwardedRef,
3411
- type: "checkbox",
3412
- className: cx("cl-833ca99c"),
3413
- ...props
3264
+ src,
3265
+ size: 200,
3266
+ ...props,
3267
+ ...mergeDescriptors(elements.cardLogoImage)
3414
3268
  }
3415
3269
  );
3270
+ return /* @__PURE__ */ jsx("div", { ...mergeDescriptors(elements.cardLogoBox), children: href ? /* @__PURE__ */ jsx(
3271
+ "a",
3272
+ {
3273
+ href,
3274
+ ...mergeDescriptors(elements.cardLogoLink),
3275
+ children: img
3276
+ }
3277
+ ) : img });
3416
3278
  });
3417
- var InputGroup = React2.forwardRef(function FieldInputGroup({ className, ...props }, ref) {
3279
+ var cardTitleLayoutStyle = {};
3280
+ var cardTitleVisualStyle = {
3281
+ cardTitle: {
3282
+ className: "cl-f29e36a7"
3283
+ }
3284
+ };
3285
+ var Title = React5.forwardRef(function CardTitle({ children, className, ...props }, forwardedRef) {
3286
+ const { elements } = useAppearance().parsedAppearance;
3418
3287
  return /* @__PURE__ */ jsx(
3419
- "div",
3288
+ "h2",
3420
3289
  {
3421
- "data-field-input-group": "",
3422
- ref,
3423
- className: cx(
3424
- "cl-ddaf1b10",
3425
- "cl-d2d9e1f1",
3426
- className
3427
- ),
3428
- ...props
3290
+ ref: forwardedRef,
3291
+ ...props,
3292
+ ...mergeDescriptors(elements.cardTitle),
3293
+ children
3429
3294
  }
3430
3295
  );
3431
3296
  });
3432
- var InputGroupEnd = React2.forwardRef(function FieldInputGroupEnd({ className, ...props }, ref) {
3297
+ var cardDescriptionLayoutStyle = {};
3298
+ var cardDescriptionVisualStyle = {
3299
+ cardDescription: {
3300
+ className: "cl-5c413d88"
3301
+ }
3302
+ };
3303
+ var Description = React5.forwardRef(
3304
+ function CardDescription({ children, className, ...props }, forwardedRef) {
3305
+ const { elements } = useAppearance().parsedAppearance;
3306
+ return /* @__PURE__ */ jsx(
3307
+ "p",
3308
+ {
3309
+ ref: forwardedRef,
3310
+ ...props,
3311
+ ...mergeDescriptors(elements.cardDescription),
3312
+ children
3313
+ }
3314
+ );
3315
+ }
3316
+ );
3317
+ var cardBodyLayoutStyle = {
3318
+ cardBody: {
3319
+ className: "cl-5eebf917"
3320
+ }
3321
+ };
3322
+ var cardBodyVisualStyle = {};
3323
+ var Body = React5.forwardRef(function CardBody({ children, className, ...props }, forwardedRef) {
3324
+ const { elements } = useAppearance().parsedAppearance;
3433
3325
  return /* @__PURE__ */ jsx(
3434
3326
  "div",
3435
3327
  {
3436
- "data-field-input-group-end": "",
3437
- ref,
3438
- className: cx("cl-4e1b09eb", className),
3439
- ...props
3328
+ ref: forwardedRef,
3329
+ ...props,
3330
+ ...mergeDescriptors(elements.cardBody),
3331
+ children
3440
3332
  }
3441
3333
  );
3442
3334
  });
3443
- var Input = React2.forwardRef(function FieldInput({
3444
- asChild,
3445
- className,
3446
- intent = "idle",
3447
- state = "native",
3448
- variant = "default",
3449
- ...props
3450
- }, forwardedRef) {
3451
- const Comp = asChild ? Slot : "input";
3335
+ var cardActionsLayoutStyle = {
3336
+ cardActions: {
3337
+ className: [
3338
+ "cl-cc1fa4d3",
3339
+ // Note:
3340
+ // Prevents underline interractions triggering outside of the link text
3341
+ // https://linear.app/clerk/issue/SDKI-192/#comment-ebf943b0
3342
+ "cl-04c8fa73"
3343
+ ].join(" ")
3344
+ }
3345
+ };
3346
+ var cardActionsVisualStyle = {};
3347
+ var Actions = React5.forwardRef(function CardActions({ children, className, ...props }, forwardedRef) {
3348
+ const { elements } = useAppearance().parsedAppearance;
3452
3349
  return /* @__PURE__ */ jsx(
3453
- Comp,
3350
+ "div",
3454
3351
  {
3455
- "data-field-input": "",
3456
3352
  ref: forwardedRef,
3457
- className: cx(
3458
- "cl-43ccb14c",
3459
- "cl-f18c4e82",
3460
- // If an `InputGroup` exists, use the `pe` value, or fallback to the
3461
- // standard input `px` value
3462
- "cl-983f1668",
3463
- "cl-ed751b03",
3464
- "cl-2aeea0c3",
3465
- "cl-d4e2e313",
3466
- "cl-ed4ed5cf",
3467
- // variant
3468
- {
3469
- default: "cl-f6005322",
3470
- "otp-digit": "cl-cb0ccd68"
3471
- }[variant],
3472
- // state
3473
- {
3474
- native: "cl-0290fbc4",
3475
- hover: "cl-8d0f1e66",
3476
- "focus-visible": "cl-e88ce474"
3477
- }[state],
3478
- // intent
3479
- {
3480
- idle: [
3481
- "cl-cac18779",
3482
- "cl-03c582dd"
3483
- ],
3484
- info: [
3485
- "cl-fa487ffe",
3486
- "cl-03c582dd"
3487
- ],
3488
- error: [
3489
- "cl-cffb481b",
3490
- "cl-776840f6",
3491
- "cl-1e334ea3"
3492
- ],
3493
- success: [
3494
- "cl-90c7848a",
3495
- "cl-204cd4cf",
3496
- "cl-0810e01c"
3497
- // (optically adjusted ring to 25 opacity)
3498
- ],
3499
- warning: [
3500
- "cl-d250e2b7",
3501
- "cl-8cae7b37",
3502
- "cl-43888e8c"
3503
- ]
3504
- }[intent],
3505
- className
3506
- ),
3507
- ...props
3353
+ ...props,
3354
+ ...mergeDescriptors(elements.cardActions),
3355
+ children
3508
3356
  }
3509
3357
  );
3510
3358
  });
3511
- var Message = React2.forwardRef(function FieldMessage({ className, children, justify = "start", intent = "idle", ...props }, forwardedRef) {
3512
- return /* @__PURE__ */ jsxs(
3513
- "p",
3359
+ var cardFooterLayoutStyle = {
3360
+ cardFooter: {
3361
+ className: "cl-0f2a693e"
3362
+ },
3363
+ cardFooterAction: {
3364
+ className: "cl-0c81043e"
3365
+ }
3366
+ };
3367
+ var cardFooterVisualStyle = {
3368
+ cardFooterAction: {
3369
+ className: "cl-e7659ac7"
3370
+ },
3371
+ cardFooterActionText: {
3372
+ className: "cl-8e9f71ce"
3373
+ },
3374
+ cardFooterActionLink: {
3375
+ className: "cl-812d8d14"
3376
+ },
3377
+ cardFooterActionButton: {
3378
+ className: "cl-812d8d14"
3379
+ },
3380
+ cardFooterActionPageLink: {
3381
+ className: "cl-39faa7ab"
3382
+ }
3383
+ };
3384
+ var Footer = React5.forwardRef(function CardFooter({
3385
+ branded = true,
3386
+ helpPageUrl,
3387
+ privacyPageUrl,
3388
+ termsPageUrl,
3389
+ children,
3390
+ className,
3391
+ ...props
3392
+ }, forwardedRef) {
3393
+ const { elements } = useAppearance().parsedAppearance;
3394
+ const hasPageLinks = helpPageUrl || privacyPageUrl || termsPageUrl;
3395
+ const renderFooter = branded || hasPageLinks || children;
3396
+ const renderSubFooter = branded || hasPageLinks;
3397
+ const hasBrandingAndPageLinks = branded && hasPageLinks;
3398
+ return renderFooter ? /* @__PURE__ */ jsxs(
3399
+ "div",
3514
3400
  {
3515
- "data-field-message": "",
3516
3401
  ref: forwardedRef,
3517
3402
  ...props,
3518
- className: cx(
3519
- "cl-12c39ca4",
3520
- {
3521
- start: "cl-c62ec162",
3522
- center: "cl-a503dd37",
3523
- end: "cl-307644c3"
3524
- }[justify],
3525
- {
3526
- idle: "cl-de621653",
3527
- info: "cl-de621653",
3528
- error: "cl-e5cd1f02",
3529
- success: "cl-e8e05e0c",
3530
- warning: "cl-d794f084"
3531
- }[intent],
3532
- className
3533
- ),
3403
+ ...mergeDescriptors(elements.cardFooter),
3534
3404
  children: [
3535
- intent !== "idle" && /* @__PURE__ */ jsx("span", { className: "cl-eb8de575", children: {
3536
- error: /* @__PURE__ */ jsx(ExclamationOctagonSm, {}),
3537
- info: /* @__PURE__ */ jsx(InformationCircleSm, {}),
3538
- success: /* @__PURE__ */ jsx(CheckmarkCircleSm, {}),
3539
- warning: /* @__PURE__ */ jsx(ExclamationTriangleSm, {})
3540
- }[intent] }),
3541
- children
3405
+ children,
3406
+ renderSubFooter ? /* @__PURE__ */ jsxs(
3407
+ "div",
3408
+ {
3409
+ className: cx$1("cl-10ec6412", hasBrandingAndPageLinks ? "cl-32c92bb1" : "cl-a503dd37"),
3410
+ children: [
3411
+ branded ? /* @__PURE__ */ jsxs(
3412
+ "p",
3413
+ {
3414
+ className: "cl-286d6459",
3415
+ children: [
3416
+ "Secured by",
3417
+ " ",
3418
+ /* @__PURE__ */ jsx(
3419
+ "a",
3420
+ {
3421
+ "aria-label": "Clerk logo",
3422
+ href: "https://www.clerk.com?utm_source=clerk&utm_medium=components",
3423
+ target: "_blank",
3424
+ rel: "noopener",
3425
+ className: "cl-e9dc1e80",
3426
+ children: /* @__PURE__ */ jsx(ClerkLogo, {})
3427
+ }
3428
+ )
3429
+ ]
3430
+ }
3431
+ ) : null,
3432
+ hasPageLinks ? /* @__PURE__ */ jsxs("div", { className: "cl-c354e22d", children: [
3433
+ helpPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: helpPageUrl, children: "Help" }) : null,
3434
+ privacyPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: privacyPageUrl, children: "Privacy" }) : null,
3435
+ termsPageUrl ? /* @__PURE__ */ jsx(FooterPageLink, { href: termsPageUrl, children: "Terms" }) : null
3436
+ ] }) : null
3437
+ ]
3438
+ }
3439
+ ) : null
3542
3440
  ]
3543
3441
  }
3544
- );
3442
+ ) : null;
3545
3443
  });
3546
- function EyeSlashSm(props) {
3547
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
3548
- /* @__PURE__ */ jsx(
3549
- "path",
3444
+ var FooterAction = React5.forwardRef(
3445
+ function CardFooterAction({ children, className, ...props }, forwardedRef) {
3446
+ const { elements } = useAppearance().parsedAppearance;
3447
+ return /* @__PURE__ */ jsx(
3448
+ "div",
3550
3449
  {
3551
- d: "M2.949 7C2.80739 7.40946 2.75 7.76622 2.75 8C2.75 9 3.8 12.25 8 12.25C8.35547 12.25 8.68838 12.2267 9 12.1835M11.5 11.1743C12.8384 10.134 13.25 8.62607 13.25 8C13.25 7 12.2 3.75 8 3.75C6.7199 3.75 5.73242 4.05191 4.97809 4.5",
3552
- stroke: "currentColor",
3553
- strokeWidth: "1.5",
3554
- strokeLinecap: "round",
3555
- strokeLinejoin: "round"
3450
+ ref: forwardedRef,
3451
+ ...props,
3452
+ ...mergeDescriptors(elements.cardFooterAction),
3453
+ children
3556
3454
  }
3557
- ),
3558
- /* @__PURE__ */ jsx(
3559
- "path",
3455
+ );
3456
+ }
3457
+ );
3458
+ var FooterActionText = React5.forwardRef(
3459
+ function CardFooterActionText({ children, className, ...props }, forwardedRef) {
3460
+ const { elements } = useAppearance().parsedAppearance;
3461
+ return /* @__PURE__ */ jsx(
3462
+ "p",
3560
3463
  {
3561
- d: "M8.88388 8.88388C9.37204 8.39573 9.37204 7.60427 8.88388 7.11612C8.39573 6.62796 7.60427 6.62796 7.11612 7.11612",
3562
- stroke: "currentColor",
3563
- strokeWidth: "1.5",
3564
- strokeLinecap: "round",
3565
- strokeLinejoin: "round"
3464
+ ref: forwardedRef,
3465
+ ...props,
3466
+ ...mergeDescriptors(elements.cardFooterActionText),
3467
+ children
3566
3468
  }
3567
- ),
3568
- /* @__PURE__ */ jsx(
3569
- "path",
3469
+ );
3470
+ }
3471
+ );
3472
+ var FooterActionButton = React5.forwardRef(
3473
+ function CardFooterActionButton({ children, className, type = "button", ...props }, forwardedRef) {
3474
+ const { elements } = useAppearance().parsedAppearance;
3475
+ return /* @__PURE__ */ jsx(
3476
+ "button",
3570
3477
  {
3571
- d: "M3 3L13 13",
3572
- stroke: "currentColor",
3573
- strokeWidth: "1.5",
3574
- strokeLinecap: "round",
3575
- strokeLinejoin: "round"
3478
+ ref: forwardedRef,
3479
+ type,
3480
+ ...props,
3481
+ ...mergeDescriptors(elements.cardFooterActionButton),
3482
+ children
3576
3483
  }
3577
- )
3578
- ] }) });
3579
- }
3580
- function EyeSm(props) {
3581
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
3582
- /* @__PURE__ */ jsx(
3583
- "path",
3484
+ );
3485
+ }
3486
+ );
3487
+ var FooterActionLink = React5.forwardRef(
3488
+ function CardFooterActionLink({ children, className, ...props }, forwardedRef) {
3489
+ const { elements } = useAppearance().parsedAppearance;
3490
+ return /* @__PURE__ */ jsx(
3491
+ "a",
3584
3492
  {
3585
- d: "M13.25 8C13.25 9 12.2 12.25 8 12.25C3.8 12.25 2.75 9 2.75 8C2.75 7 3.8 3.75 8 3.75C12.2 3.75 13.25 7 13.25 8Z",
3586
- stroke: "currentColor",
3587
- strokeWidth: "1.5",
3588
- strokeLinecap: "round",
3589
- strokeLinejoin: "round"
3493
+ ref: forwardedRef,
3494
+ ...props,
3495
+ ...mergeDescriptors(elements.cardFooterActionLink),
3496
+ children
3590
3497
  }
3591
- ),
3592
- /* @__PURE__ */ jsx(
3593
- "circle",
3498
+ );
3499
+ }
3500
+ );
3501
+ var FooterPageLink = React5.forwardRef(
3502
+ function CardFooterPageLink({ children, className, ...props }, forwardedRef) {
3503
+ const { elements } = useAppearance().parsedAppearance;
3504
+ return /* @__PURE__ */ jsx(
3505
+ "a",
3594
3506
  {
3595
- cx: "8",
3596
- cy: "8",
3597
- r: "1.25",
3598
- stroke: "currentColor",
3599
- strokeWidth: "1.5",
3600
- strokeLinecap: "round",
3601
- strokeLinejoin: "round"
3507
+ ref: forwardedRef,
3508
+ ...props,
3509
+ target: "_blank",
3510
+ rel: "noopener",
3511
+ ...mergeDescriptors(elements.cardFooterActionPageLink),
3512
+ children
3602
3513
  }
3603
- )
3604
- ] }) });
3605
- }
3606
- function PasswordField({
3607
- alternativeFieldTrigger,
3608
- className,
3609
- label,
3610
- name = "password",
3611
- ...props
3612
- }) {
3613
- const [type, setType] = React2__default.useState("password");
3614
- const id = React2__default.useId();
3615
- const { t, locale } = useLocalizations();
3616
- return /* @__PURE__ */ jsx(
3617
- Common2.Field,
3618
- {
3619
- name,
3620
- asChild: true,
3621
- children: /* @__PURE__ */ jsxs(Root2, { children: [
3622
- /* @__PURE__ */ jsx(Common2.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { children: [
3623
- label,
3624
- alternativeFieldTrigger ? /* @__PURE__ */ jsx(LabelEnd, { children: alternativeFieldTrigger }) : null
3625
- ] }) }),
3626
- /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state }) => {
3627
- return /* @__PURE__ */ jsxs(InputGroup, { children: [
3628
- /* @__PURE__ */ jsx(
3629
- Common2.Input,
3630
- {
3631
- type,
3632
- className: cx("cl-ba16e610", className),
3633
- ...props,
3634
- "aria-describedby": props.validatePassword && state !== "idle" ? id : void 0,
3635
- asChild: true,
3636
- children: /* @__PURE__ */ jsx(Input, { intent: state })
3637
- }
3638
- ),
3639
- /* @__PURE__ */ jsx(InputGroupEnd, { children: /* @__PURE__ */ jsxs(
3640
- "button",
3641
- {
3642
- type: "button",
3643
- className: cx(
3644
- // Note:
3645
- // We set to `1.375rem` (22px) here for a hairline border
3646
- // around the focus ring to keep it distinct from the
3647
- // "surrounding" input
3648
- "cl-f739d7d3",
3649
- "cl-35c8e0b5",
3650
- "cl-c93b25fd"
3651
- ),
3652
- onClick: () => setType((prev2) => prev2 === "password" ? "text" : "password"),
3653
- title: [type === "password" ? "Show" : "Hide", "password"].join(" "),
3654
- disabled: props.disabled,
3655
- children: [
3656
- /* @__PURE__ */ jsx("span", { className: "cl-32fb0905", children: [type === "password" ? "Show" : "Hide", "password"].join(" ") }),
3657
- type === "password" ? /* @__PURE__ */ jsx(EyeSlashSm, {}) : /* @__PURE__ */ jsx(EyeSm, {})
3658
- ]
3659
- }
3660
- ) })
3661
- ] });
3662
- } }),
3663
- /* @__PURE__ */ jsx(Animated, { children: props.validatePassword ? /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state, codes }) => {
3664
- if (state === "idle") {
3665
- return;
3666
- }
3667
- if (state === "success") {
3668
- return /* @__PURE__ */ jsx(
3669
- Message,
3670
- {
3671
- id,
3672
- intent: "success",
3673
- children: t("unstable__errors.zxcvbn.goodPassword")
3674
- }
3675
- );
3676
- }
3677
- if (typeof codes === "undefined") {
3678
- return;
3679
- }
3680
- return /* @__PURE__ */ jsx(
3681
- Message,
3682
- {
3683
- id,
3684
- intent: state,
3685
- children: translatePasswordError({ codes, locale, t })
3686
- }
3687
- );
3688
- } }) : /* @__PURE__ */ jsx(Common2.FieldError, { asChild: true, children: ({ message }) => {
3689
- return /* @__PURE__ */ jsx(Message, { intent: "error", children: message });
3690
- } }) })
3691
- ] })
3692
- }
3693
- );
3694
- }
3695
-
3696
- // src/hooks/use-attributes.ts
3697
- function useAttributes(attribute) {
3698
- const environment = useEnvironment();
3699
- const userSettingsAttributes = environment.userSettings.attributes;
3700
- return userSettingsAttributes[attribute];
3701
- }
3702
- function useSignUpAttributes(attribute) {
3703
- const attr = useAttributes(attribute);
3704
- const { options } = useAppearance().parsedAppearance;
3705
- const { showOptionalFields } = options;
3706
- return {
3707
- ...attr,
3708
- show: (showOptionalFields || attr.required) && attr.enabled
3709
- };
3710
- }
3711
- var DEFAULT_FIELD_NAME = "emailAddress";
3712
- var EmailField = React2__default.forwardRef(function EmailField2({
3713
- alternativeFieldTrigger,
3714
- name = DEFAULT_FIELD_NAME,
3715
- enabled,
3716
- required,
3717
- ...props
3718
- }, forwardedRef) {
3719
- const { t, translateError } = useLocalizations();
3720
- const { enabled: attributeEnabled, required: attributeRequired } = useAttributes("email_address");
3721
- const isEnabled = enabled !== void 0 ? enabled : attributeEnabled;
3722
- const isRequired = required !== void 0 ? required : attributeRequired;
3723
- if (!isEnabled) {
3724
- return null;
3514
+ );
3515
+ }
3516
+ );
3517
+ var layoutStyle5 = {
3518
+ ...cardRootLayoutStyle,
3519
+ ...cardHeaderLayoutStyle,
3520
+ ...cardContentLayoutStyle,
3521
+ ...cardTitleLayoutStyle,
3522
+ ...cardDescriptionLayoutStyle,
3523
+ ...cardBodyLayoutStyle,
3524
+ ...cardActionsLayoutStyle,
3525
+ ...cardFooterLayoutStyle,
3526
+ ...cardLogoLayoutStyle
3527
+ };
3528
+ var visualStyle5 = {
3529
+ ...cardRootVisualStyle,
3530
+ ...cardHeaderVisualStyle,
3531
+ ...cardContentVisualStyle,
3532
+ ...cardTitleVisualStyle,
3533
+ ...cardDescriptionVisualStyle,
3534
+ ...cardBodyVisualStyle,
3535
+ ...cardActionsVisualStyle,
3536
+ ...cardFooterVisualStyle,
3537
+ ...cardLogoVisualStyle
3538
+ };
3539
+ var layoutStyle6 = {
3540
+ separator: {
3541
+ className: "cl-c53048bf"
3725
3542
  }
3543
+ };
3544
+ var visualStyle6 = {
3545
+ separator: {
3546
+ className: "cl-77b14b2e"
3547
+ }
3548
+ };
3549
+ var Separator = React5.forwardRef(function Separator2({ children, descriptors, ...props }, forwardedRef) {
3550
+ const { elements } = useAppearance().parsedAppearance;
3726
3551
  return /* @__PURE__ */ jsx(
3727
- Common2.Field,
3552
+ "div",
3728
3553
  {
3729
- name,
3730
- asChild: true,
3731
- children: /* @__PURE__ */ jsxs(Root2, { children: [
3732
- /* @__PURE__ */ jsx(Common2.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { children: [
3733
- t("formFieldLabel__emailAddress"),
3734
- alternativeFieldTrigger ? /* @__PURE__ */ jsx(LabelEnd, { children: alternativeFieldTrigger }) : !isRequired ? /* @__PURE__ */ jsx(Hint, { children: t("formFieldHintText__optional") }) : null
3735
- ] }) }),
3736
- /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state }) => {
3737
- return /* @__PURE__ */ jsx(
3738
- Common2.Input,
3739
- {
3740
- ref: forwardedRef,
3741
- type: "email",
3742
- ...props,
3743
- required: isRequired,
3744
- asChild: true,
3745
- children: /* @__PURE__ */ jsx(Input, { intent: state })
3746
- }
3747
- );
3748
- } }),
3749
- /* @__PURE__ */ jsx(Animated, { children: /* @__PURE__ */ jsx(Common2.FieldError, { asChild: true, children: ({ message, code }) => {
3750
- return /* @__PURE__ */ jsx(Message, { intent: "error", children: translateError({ message, code, name: "email_address" }) });
3751
- } }) })
3752
- ] })
3554
+ ref: forwardedRef,
3555
+ ...props,
3556
+ ...mergeDescriptors(elements.separator, ...descriptors != null ? descriptors : []),
3557
+ children
3753
3558
  }
3754
3559
  );
3755
3560
  });
3756
-
3757
- // src/constants/phone-number.ts
3758
- var data = [
3759
- ["United States", "us", "1", "(...) ...-....", 100],
3760
- ["United Kingdom", "gb", "44", ".... ......", 100],
3761
- ["India", "in", "91", ".....-.....", 100],
3762
- ["Canada", "ca", "1", "(...) ...-....", 100],
3763
- ["Germany", "de", "49", "... .......", 100],
3764
- ["France", "fr", "33", ". .. .. .. ..", 100],
3765
- ["Russia", "ru", "7", "... ...-..-..", 100],
3766
- ["Afghanistan", "af", "93"],
3767
- ["Albania", "al", "355"],
3768
- ["Algeria ", "dz", "213"],
3769
- ["American Samoa", "as", "1684"],
3770
- ["Andorra", "ad", "376"],
3771
- ["Angola", "ao", "244"],
3772
- ["Anguilla", "ai", "1264"],
3773
- ["Antigua and Barbuda", "ag", "1268"],
3774
- ["Argentina", "ar", "54"],
3775
- ["Armenia", "am", "374"],
3776
- ["Aruba", "aw", "297"],
3777
- ["Australia", "au", "61", "... ... ..."],
3778
- ["Austria", "at", "43"],
3779
- ["Azerbaijan", "az", "994"],
3780
- ["Bahamas", "bs", "1242"],
3781
- ["Bahrain", "bh", "973"],
3782
- ["Bangladesh", "bd", "880"],
3783
- ["Barbados", "bb", "1246"],
3784
- ["Belarus", "by", "375"],
3785
- ["Belgium", "be", "32", "... .. .. .."],
3786
- ["Belize", "bz", "501"],
3787
- ["Benin", "bj", "229"],
3788
- ["Bermuda", "bm", "1441"],
3789
- ["Bhutan", "bt", "975"],
3790
- ["Bolivia", "bo", "591"],
3791
- ["Bosnia and Herzegovina", "ba", "387"],
3792
- ["Botswana", "bw", "267"],
3793
- ["Brazil", "br", "55"],
3794
- ["British Indian Ocean Territory", "io", "246"],
3795
- ["British Virgin Islands", "vg", "1284"],
3796
- ["Brunei", "bn", "673"],
3797
- ["Bulgaria", "bg", "359"],
3798
- ["Burkina Faso", "bf", "226"],
3799
- ["Burundi", "bi", "257"],
3800
- ["Cambodia", "kh", "855"],
3801
- ["Cameroon", "cm", "237"],
3802
- ["Cape Verde", "cv", "238"],
3803
- ["Caribbean Netherlands", "bq", "599"],
3804
- ["Cayman Islands", "ky", "1345"],
3805
- ["Central African Republic", "cf", "236"],
3806
- ["Chad", "td", "235"],
3807
- ["Chile", "cl", "56"],
3808
- ["China", "cn", "86", "...-....-...."],
3809
- ["Colombia", "co", "57"],
3810
- ["Comoros", "km", "269"],
3811
- ["Congo", "cd", "243"],
3812
- ["Congo", "cg", "242"],
3813
- ["Cook Islands", "ck", "682"],
3814
- ["Costa Rica", "cr", "506", "....-...."],
3815
- ["C\xF4te d\u2019Ivoire", "ci", "225"],
3816
- ["Croatia", "hr", "385"],
3817
- ["Cuba", "cu", "53"],
3818
- ["Cura\xE7ao", "cw", "599"],
3819
- ["Cyprus", "cy", "357"],
3820
- ["Czech Republic", "cz", "420"],
3821
- ["Denmark", "dk", "45", ".. .. .. .."],
3822
- ["Djibouti", "dj", "253"],
3823
- ["Dominica", "dm", "1767"],
3824
- ["Dominican Republic", "do", "1"],
3825
- ["Ecuador", "ec", "593"],
3826
- ["Egypt", "eg", "20"],
3827
- ["El Salvador", "sv", "503", "....-...."],
3828
- ["Equatorial Guinea", "gq", "240"],
3829
- ["Eritrea", "er", "291"],
3830
- ["Estonia", "ee", "372"],
3831
- ["Ethiopia", "et", "251"],
3832
- ["Falkland Islands", "fk", "500"],
3833
- ["Faroe Islands", "fo", "298"],
3834
- ["Fiji", "fj", "679"],
3835
- ["Finland", "fi", "358", ".. ... .. .."],
3836
- ["French Guiana", "gf", "594"],
3837
- ["French Polynesia", "pf", "689"],
3838
- ["Gabon", "ga", "241"],
3839
- ["Gambia", "gm", "220"],
3840
- ["Georgia", "ge", "995"],
3841
- ["Ghana", "gh", "233"],
3842
- ["Gibraltar", "gi", "350"],
3843
- ["Greece", "gr", "30", "... ......."],
3844
- ["Greenland", "gl", "299"],
3845
- ["Grenada", "gd", "1473"],
3846
- ["Guadeloupe", "gp", "590"],
3847
- ["Guam", "gu", "1671"],
3848
- ["Guatemala", "gt", "502", "....-...."],
3849
- ["Guinea", "gn", "224"],
3850
- ["Guinea-Bissau", "gw", "245"],
3851
- ["Guyana", "gy", "592"],
3852
- ["Haiti", "ht", "509", "....-...."],
3853
- ["Honduras", "hn", "504"],
3854
- ["Hong Kong", "hk", "852", ".... ...."],
3855
- ["Hungary", "hu", "36"],
3856
- ["Iceland", "is", "354", "... ...."],
3857
- ["Indonesia", "id", "62"],
3858
- ["Iran", "ir", "98"],
3859
- ["Iraq", "iq", "964"],
3860
- ["Ireland", "ie", "353", ".. ......."],
3861
- ["Israel", "il", "972"],
3862
- ["Italy", "it", "39", "... ......"],
3863
- ["Jamaica", "jm", "1876"],
3864
- ["Japan", "jp", "81", "... .. ...."],
3865
- ["Jordan", "jo", "962"],
3866
- ["Kazakhstan", "kz", "7", "... ...-..-.."],
3867
- ["Kenya", "ke", "254"],
3868
- ["Kiribati", "ki", "686"],
3869
- ["Kuwait", "kw", "965"],
3870
- ["Kyrgyzstan", "kg", "996"],
3871
- ["Laos", "la", "856"],
3872
- ["Latvia", "lv", "371"],
3873
- ["Lebanon", "lb", "961"],
3874
- ["Lesotho", "ls", "266"],
3875
- ["Liberia", "lr", "231"],
3876
- ["Libya", "ly", "218"],
3877
- ["Liechtenstein", "li", "423"],
3878
- ["Lithuania", "lt", "370"],
3879
- ["Luxembourg", "lu", "352"],
3880
- ["Macau", "mo", "853"],
3881
- ["Macedonia", "mk", "389"],
3882
- ["Madagascar", "mg", "261"],
3883
- ["Malawi", "mw", "265"],
3884
- ["Malaysia", "my", "60", "..-....-...."],
3885
- ["Maldives", "mv", "960"],
3886
- ["Mali", "ml", "223"],
3887
- ["Malta", "mt", "356"],
3888
- ["Marshall Islands", "mh", "692"],
3889
- ["Martinique", "mq", "596"],
3890
- ["Mauritania", "mr", "222"],
3891
- ["Mauritius", "mu", "230"],
3892
- ["Mexico", "mx", "52"],
3893
- ["Micronesia", "fm", "691"],
3894
- ["Moldova", "md", "373"],
3895
- ["Monaco", "mc", "377"],
3896
- ["Mongolia", "mn", "976"],
3897
- ["Montenegro", "me", "382"],
3898
- ["Montserrat", "ms", "1664"],
3899
- ["Morocco", "ma", "212"],
3900
- ["Mozambique", "mz", "258"],
3901
- ["Myanmar", "mm", "95"],
3902
- ["Namibia", "na", "264"],
3903
- ["Nauru", "nr", "674"],
3904
- ["Nepal", "np", "977"],
3905
- ["Netherlands", "nl", "31", ".. ........"],
3906
- ["New Caledonia", "nc", "687"],
3907
- ["New Zealand", "nz", "64", "...-...-...."],
3908
- ["Nicaragua", "ni", "505"],
3909
- ["Niger", "ne", "227"],
3910
- ["Nigeria", "ng", "234"],
3911
- ["Niue", "nu", "683"],
3912
- ["Norfolk Island", "nf", "672"],
3913
- ["North Korea", "kp", "850"],
3914
- ["Northern Mariana Islands", "mp", "1670"],
3915
- ["Norway", "no", "47", "... .. ..."],
3916
- ["Oman", "om", "968"],
3917
- ["Pakistan", "pk", "92", "...-......."],
3918
- ["Palau", "pw", "680"],
3919
- ["Palestine", "ps", "970"],
3920
- ["Panama", "pa", "507"],
3921
- ["Papua New Guinea", "pg", "675"],
3922
- ["Paraguay", "py", "595"],
3923
- ["Peru", "pe", "51"],
3924
- ["Philippines", "ph", "63", "... ...."],
3925
- ["Poland", "pl", "48", "...-...-..."],
3926
- ["Portugal", "pt", "351"],
3927
- ["Puerto Rico", "pr", "1"],
3928
- ["Qatar", "qa", "974"],
3929
- ["R\xE9union", "re", "262"],
3930
- ["Romania", "ro", "40"],
3931
- ["Rwanda", "rw", "250"],
3932
- ["Saint Barth\xE9lemy", "bl", "590"],
3933
- ["Saint Helena", "sh", "290"],
3934
- ["Saint Kitts and Nevis", "kn", "1869"],
3935
- ["Saint Lucia", "lc", "1758"],
3936
- ["Saint Martin", "mf", "590"],
3937
- ["Saint Pierre and Miquelon", "pm", "508"],
3938
- ["Saint Vincent and the Grenadines", "vc", "1784"],
3939
- ["Samoa", "ws", "685"],
3940
- ["San Marino", "sm", "378"],
3941
- ["S\xE3o Tom\xE9 and Pr\xEDncipe", "st", "239"],
3942
- ["Saudi Arabia", "sa", "966"],
3943
- ["Senegal", "sn", "221"],
3944
- ["Serbia", "rs", "381"],
3945
- ["Seychelles", "sc", "248"],
3946
- ["Sierra Leone", "sl", "232"],
3947
- ["Singapore", "sg", "65", "....-...."],
3948
- ["Sint Maarten", "sx", "1721"],
3949
- ["Slovakia", "sk", "421"],
3950
- ["Slovenia", "si", "386"],
3951
- ["Solomon Islands", "sb", "677"],
3952
- ["Somalia", "so", "252"],
3953
- ["South Africa", "za", "27"],
3954
- ["South Korea", "kr", "82"],
3955
- ["South Sudan", "ss", "211"],
3956
- ["Spain", "es", "34", "... ... ..."],
3957
- ["Sri Lanka", "lk", "94"],
3958
- ["Sudan", "sd", "249"],
3959
- ["Suriname", "sr", "597"],
3960
- ["Swaziland", "sz", "268"],
3961
- ["Sweden", "se", "46", ".. ... .. .."],
3962
- ["Switzerland", "ch", "41", ".. ... .. .."],
3963
- ["Syria", "sy", "963"],
3964
- ["Taiwan", "tw", "886"],
3965
- ["Tajikistan", "tj", "992"],
3966
- ["Tanzania", "tz", "255"],
3967
- ["Thailand", "th", "66"],
3968
- ["Timor-Leste", "tl", "670"],
3969
- ["Togo", "tg", "228"],
3970
- ["Tokelau", "tk", "690"],
3971
- ["Tonga", "to", "676"],
3972
- ["Trinidad and Tobago", "tt", "1868"],
3973
- ["Tunisia", "tn", "216"],
3974
- ["Turkey", "tr", "90", "... ... .. .."],
3975
- ["Turkmenistan", "tm", "993"],
3976
- ["Turks and Caicos Islands", "tc", "1649"],
3977
- ["Tuvalu", "tv", "688"],
3978
- ["U.S. Virgin Islands", "vi", "1340"],
3979
- ["Uganda", "ug", "256"],
3980
- ["Ukraine", "ua", "380"],
3981
- ["United Arab Emirates", "ae", "971"],
3982
- ["Uruguay", "uy", "598"],
3983
- ["Uzbekistan", "uz", "998"],
3984
- ["Vanuatu", "vu", "678"],
3985
- ["Vatican City", "va", "39", ".. .... ...."],
3986
- ["Venezuela", "ve", "58"],
3987
- ["Vietnam", "vn", "84"],
3988
- ["Wallis and Futuna", "wf", "681"],
3989
- ["Yemen", "ye", "967"],
3990
- ["Zambia", "zm", "260"],
3991
- ["Zimbabwe", "zw", "263"]
3561
+ var DESCRIPTORS = [
3562
+ // Alert
3563
+ "alert",
3564
+ "alert__error",
3565
+ "alert__warning",
3566
+ "alertIcon",
3567
+ // Button
3568
+ "button",
3569
+ "buttonPrimary",
3570
+ "buttonSecondary",
3571
+ "buttonConnection",
3572
+ "buttonPrimaryDefault",
3573
+ "buttonSecondaryDefault",
3574
+ "buttonConnectionDefault",
3575
+ "buttonDisabled",
3576
+ "buttonBusy",
3577
+ "buttonText",
3578
+ "buttonTextVisuallyHidden",
3579
+ "buttonIcon",
3580
+ "buttonIconStart",
3581
+ "buttonIconEnd",
3582
+ "buttonSpinner",
3583
+ ...[...OAUTH_PROVIDERS, ...WEB3_PROVIDERS].map(({ provider }) => `buttonConnection__${provider}`),
3584
+ // Connection
3585
+ "connectionList",
3586
+ "connectionListItem",
3587
+ // Separator
3588
+ "separator",
3589
+ // Spinner
3590
+ "spinner",
3591
+ // Card
3592
+ "cardRoot",
3593
+ "cardRootDefault",
3594
+ "cardRootInner",
3595
+ "cardHeader",
3596
+ "cardContent",
3597
+ "cardTitle",
3598
+ "cardDescription",
3599
+ "cardBody",
3600
+ "cardActions",
3601
+ "cardFooter",
3602
+ "cardFooterAction",
3603
+ "cardFooterActionText",
3604
+ "cardFooterActionLink",
3605
+ "cardFooterActionButton",
3606
+ "cardFooterActionPageLink",
3607
+ "cardLogoBox",
3608
+ "cardLogoLink",
3609
+ "cardLogoImage"
3992
3610
  ];
3993
- var UnitedStatesSubAreasSet = /* @__PURE__ */ new Set([
3994
- "907",
3995
- "205",
3996
- "251",
3997
- "256",
3998
- "334",
3999
- "479",
4000
- "501",
4001
- "870",
4002
- "480",
4003
- "520",
4004
- "602",
4005
- "623",
4006
- "928",
4007
- "209",
4008
- "213",
4009
- "310",
4010
- "323",
4011
- "408",
4012
- "415",
4013
- "510",
4014
- "530",
4015
- "559",
4016
- "562",
4017
- "619",
4018
- "626",
4019
- "650",
4020
- "661",
4021
- "707",
4022
- "714",
4023
- "760",
4024
- "805",
4025
- "818",
4026
- "831",
4027
- "858",
4028
- "909",
4029
- "916",
4030
- "925",
4031
- "949",
4032
- "951",
4033
- "303",
4034
- "719",
4035
- "970",
4036
- "203",
4037
- "860",
4038
- "202",
4039
- "302",
4040
- "239",
4041
- "305",
4042
- "321",
4043
- "352",
4044
- "386",
4045
- "407",
4046
- "561",
4047
- "727",
4048
- "772",
4049
- "813",
4050
- "850",
4051
- "863",
4052
- "904",
4053
- "941",
4054
- "954",
4055
- "229",
4056
- "404",
4057
- "478",
4058
- "706",
4059
- "770",
4060
- "912",
4061
- "808",
4062
- "319",
4063
- "515",
4064
- "563",
4065
- "641",
4066
- "712",
4067
- "208",
4068
- "217",
4069
- "309",
4070
- "312",
4071
- "618",
4072
- "630",
4073
- "708",
4074
- "773",
4075
- "815",
4076
- "847",
4077
- "219",
4078
- "260",
4079
- "317",
4080
- "574",
4081
- "765",
4082
- "812",
4083
- "316",
4084
- "620",
4085
- "785",
4086
- "913",
4087
- "270",
4088
- "502",
4089
- "606",
4090
- "859",
4091
- "225",
4092
- "318",
4093
- "337",
4094
- "504",
4095
- "985",
4096
- "413",
4097
- "508",
4098
- "617",
4099
- "781",
4100
- "978",
4101
- "301",
4102
- "410",
4103
- "207",
4104
- "231",
4105
- "248",
4106
- "269",
4107
- "313",
4108
- "517",
4109
- "586",
4110
- "616",
4111
- "734",
4112
- "810",
4113
- "906",
4114
- "989",
4115
- "218",
4116
- "320",
4117
- "507",
4118
- "612",
4119
- "651",
4120
- "763",
4121
- "952",
4122
- "314",
4123
- "417",
4124
- "573",
4125
- "636",
4126
- "660",
4127
- "816",
4128
- "228",
4129
- "601",
4130
- "662",
4131
- "406",
4132
- "252",
4133
- "336",
4134
- "704",
4135
- "828",
4136
- "910",
4137
- "919",
4138
- "701",
4139
- "308",
4140
- "402",
4141
- "603",
4142
- "201",
4143
- "609",
4144
- "732",
4145
- "856",
4146
- "908",
4147
- "973",
4148
- "505",
4149
- "575",
4150
- "702",
4151
- "775",
4152
- "212",
4153
- "315",
4154
- "516",
4155
- "518",
4156
- "585",
4157
- "607",
4158
- "631",
4159
- "716",
4160
- "718",
4161
- "845",
4162
- "914",
4163
- "216",
4164
- "330",
4165
- "419",
4166
- "440",
4167
- "513",
4168
- "614",
4169
- "740",
4170
- "937",
4171
- "405",
4172
- "580",
4173
- "918",
4174
- "503",
4175
- "541",
4176
- "215",
4177
- "412",
4178
- "570",
4179
- "610",
4180
- "717",
4181
- "724",
4182
- "814",
4183
- "401",
4184
- "803",
4185
- "843",
4186
- "864",
4187
- "605",
4188
- "423",
4189
- "615",
4190
- "731",
4191
- "865",
4192
- "901",
4193
- "931",
4194
- "210",
4195
- "214",
4196
- "254",
4197
- "281",
4198
- "325",
4199
- "361",
4200
- "409",
4201
- "432",
4202
- "512",
4203
- "713",
4204
- "806",
4205
- "817",
4206
- "830",
4207
- "903",
4208
- "915",
4209
- "936",
4210
- "940",
4211
- "956",
4212
- "972",
4213
- "979",
4214
- "435",
4215
- "801",
4216
- "276",
4217
- "434",
4218
- "540",
4219
- "703",
4220
- "757",
4221
- "804",
4222
- "802",
4223
- "206",
4224
- "253",
4225
- "360",
4226
- "425",
4227
- "509",
4228
- "262",
4229
- "414",
4230
- "608",
4231
- "715",
4232
- "920",
4233
- "304",
4234
- "307"
4235
- ]);
4236
- var CanadaSubAreaSet = /* @__PURE__ */ new Set([
4237
- "204",
4238
- "226",
4239
- "236",
4240
- "249",
4241
- "250",
4242
- "289",
4243
- "306",
4244
- "343",
4245
- "365",
4246
- "387",
4247
- "403",
4248
- "416",
4249
- "418",
4250
- "431",
4251
- "437",
4252
- "438",
4253
- "450",
4254
- "506",
4255
- "514",
4256
- "519",
4257
- "548",
4258
- "579",
4259
- "581",
4260
- "587",
4261
- "604",
4262
- "613",
4263
- "639",
4264
- "647",
4265
- "672",
4266
- "705",
4267
- "709",
4268
- "742",
4269
- "778",
4270
- "780",
4271
- "782",
4272
- "807",
4273
- "819",
4274
- "825",
4275
- "867",
4276
- "873",
4277
- "902",
4278
- "905"
4279
- ]);
4280
- var SubAreaCodeSets = {
4281
- us: UnitedStatesSubAreasSet,
4282
- ca: CanadaSubAreaSet
4283
- };
4284
- var createEntry = ([
4285
- name,
4286
- iso,
4287
- code,
4288
- pattern = "",
4289
- priority = 0
4290
- ]) => ({
4291
- name,
4292
- iso,
4293
- code,
4294
- pattern,
4295
- priority
4296
- });
4297
- var IsoToCountryMap = data.reduce(
4298
- (acc, cur) => acc.set(cur[1], createEntry(cur)),
4299
- /* @__PURE__ */ new Map()
4300
- );
4301
- var CodeToCountriesMap = data.reduce((acc, cur) => {
4302
- const code = cur[2];
4303
- const country = createEntry(cur);
4304
- acc.get(code) ? acc.get(code).push(country) : acc.set(code, [country]);
4305
- return acc;
4306
- }, /* @__PURE__ */ new Map());
4307
3611
 
4308
- // src/utils/phone-number.ts
4309
- function getCountryIsoFromFormattedNumber(formattedNumber, fallbackIso = "us") {
4310
- const number = extractDigits(formattedNumber);
4311
- if (!number || number.length < 4) {
4312
- return fallbackIso;
4313
- }
4314
- if (number.startsWith("1") && phoneNumberBelongsTo("us", number)) {
4315
- return "us";
4316
- }
4317
- if (number.startsWith("1") && phoneNumberBelongsTo("ca", number)) {
4318
- return "ca";
4319
- }
4320
- return getCountryFromPhoneString(number).country.iso;
4321
- }
4322
- function formatPhoneNumber(phoneNumber, pattern, countryCode) {
4323
- if (!phoneNumber || !pattern) {
4324
- return phoneNumber;
4325
- }
4326
- const digits = [...extractDigits(phoneNumber)].slice(0, maxE164CompliantLength(countryCode));
4327
- if (digits.length <= 3) {
4328
- return digits.join("");
4329
- }
4330
- let res = "";
4331
- for (let i = 0; digits.length > 0; i++) {
4332
- if (i > pattern.length - 1) {
4333
- res += digits.shift();
4334
- } else {
4335
- res += pattern[i] === "." ? digits.shift() : pattern[i];
3612
+ // src/themes/buildTheme.ts
3613
+ function buildTheme(p) {
3614
+ const theme = {};
3615
+ DESCRIPTORS.forEach((descriptor) => {
3616
+ theme[descriptor] = {
3617
+ descriptor: `cl-${descriptor}`,
3618
+ className: "",
3619
+ style: {}
3620
+ };
3621
+ });
3622
+ for (const descriptor in p) {
3623
+ const key = descriptor;
3624
+ if (p[key]) {
3625
+ if (!(key in theme)) {
3626
+ console.warn(`Clerk: Unknown descriptor: ${descriptor}`);
3627
+ continue;
3628
+ }
3629
+ const { className, style } = p[key];
3630
+ if (className) {
3631
+ theme[key].className = className;
3632
+ }
3633
+ if (style) {
3634
+ theme[key].style = style;
3635
+ }
4336
3636
  }
4337
3637
  }
4338
- return res;
4339
- }
4340
- function extractDigits(formattedPhone) {
4341
- return (formattedPhone || "").replace(/[^\d]/g, "");
4342
- }
4343
- function phoneNumberBelongsTo(iso, phoneWithCode) {
4344
- var _a, _b;
4345
- if (!iso || !IsoToCountryMap.get(iso) || !phoneWithCode) {
4346
- return false;
3638
+ return theme;
3639
+ }
3640
+ function mergeTheme(a, b) {
3641
+ const mergedTheme = { ...a };
3642
+ for (const d in mergedTheme) {
3643
+ const descriptor = d;
3644
+ mergedTheme[descriptor].className = [mergedTheme[descriptor].className, b[descriptor].className].join(" ");
3645
+ mergedTheme[descriptor].style = { ...mergedTheme[descriptor].style, ...b[descriptor].style };
4347
3646
  }
4348
- const code = phoneWithCode[0];
4349
- const subArea = phoneWithCode.substring(1, 4);
4350
- return code === ((_a = IsoToCountryMap.get(iso)) == null ? void 0 : _a.code) && phoneWithCode.length - 1 === maxDigitCountForPattern(((_b = IsoToCountryMap.get(iso)) == null ? void 0 : _b.pattern) || "") && SubAreaCodeSets[iso].has(subArea);
4351
- }
4352
- function maxDigitCountForPattern(pattern) {
4353
- return (pattern.match(/\./g) || []).length;
3647
+ return mergedTheme;
4354
3648
  }
4355
- var MAX_PHONE_NUMBER_LENGTH = 15;
4356
- function maxE164CompliantLength(countryCode) {
4357
- const usCountryCode = "1";
4358
- countryCode = countryCode || usCountryCode;
4359
- const codeWithPrefix = countryCode.includes("+") ? countryCode : "+" + countryCode;
4360
- return MAX_PHONE_NUMBER_LENGTH - codeWithPrefix.length;
4361
- }
4362
- function parsePhoneString(str) {
4363
- var _a, _b;
4364
- const digits = extractDigits(str);
4365
- const iso = getCountryIsoFromFormattedNumber(digits);
4366
- const pattern = ((_a = IsoToCountryMap.get(iso)) == null ? void 0 : _a.pattern) || "";
4367
- const code = ((_b = IsoToCountryMap.get(iso)) == null ? void 0 : _b.code) || "";
4368
- const number = digits.slice(code.length);
4369
- const formattedNumberWithCode = `+${code} ${formatPhoneNumber(number, pattern, code)}`;
4370
- return { iso, pattern, code, number, formattedNumberWithCode };
4371
- }
4372
- function stringToFormattedPhoneString(str) {
4373
- const parsed = parsePhoneString(str);
4374
- return `+${parsed.code} ${formatPhoneNumber(parsed.number, parsed.pattern, parsed.code)}`;
3649
+
3650
+ // src/themes/layout.ts
3651
+ var layoutTheme = buildTheme({
3652
+ ...layoutStyle4,
3653
+ ...layoutStyle2,
3654
+ ...layoutStyle5,
3655
+ ...layoutStyle3,
3656
+ ...layoutStyle6,
3657
+ ...layoutStyle
3658
+ });
3659
+
3660
+ // src/themes/full.ts
3661
+ var visualTheme = buildTheme({
3662
+ ...visualStyle4,
3663
+ ...visualStyle2,
3664
+ ...visualStyle5,
3665
+ ...visualStyle3,
3666
+ ...visualStyle6,
3667
+ ...visualStyle
3668
+ });
3669
+ var fullTheme = mergeTheme(layoutTheme, visualTheme);
3670
+ function mergeDescriptors(...descriptors) {
3671
+ return descriptors.reduce(
3672
+ (acc, el) => {
3673
+ if (typeof el === "boolean") {
3674
+ return acc;
3675
+ }
3676
+ acc.className = [el.descriptor, acc.className, el.className].join(" ");
3677
+ acc.style = { ...acc.style, ...el.style };
3678
+ return acc;
3679
+ },
3680
+ { className: "", style: {} }
3681
+ );
4375
3682
  }
4376
- var byPriority = (a, b) => {
4377
- return b.priority - a.priority;
4378
- };
4379
- function getCountryFromPhoneString(phone) {
4380
- const phoneWithCode = extractDigits(phone);
4381
- const matchingCountries = [];
4382
- for (const i of [4, 3, 2, 1]) {
4383
- const potentialCode = phoneWithCode.substring(0, i);
4384
- const countries = CodeToCountriesMap.get(potentialCode) || [];
4385
- if (countries.length) {
4386
- matchingCountries.push(...countries);
3683
+ function mergeElementsAppearanceConfig(a, b) {
3684
+ let result;
3685
+ if (typeof a === "string" && typeof b === "string") {
3686
+ result = [a, b].join(" ");
3687
+ } else if (typeof a === "string" && typeof b === "object") {
3688
+ result = { ...b };
3689
+ result.className = [result.className, a].join(" ");
3690
+ } else if (typeof a === "object" && typeof b === "string") {
3691
+ result = { ...a };
3692
+ result.className = [result.className, b].join(" ");
3693
+ } else if (typeof a === "object" && typeof b === "object") {
3694
+ result = {
3695
+ ...a,
3696
+ ...b
3697
+ };
3698
+ if (a.className || b.className) {
3699
+ result.className = [a.className, b.className].filter(Boolean).join(" ");
4387
3700
  }
4388
3701
  }
4389
- const fallbackCountry = IsoToCountryMap.get("us");
4390
- const country = matchingCountries.sort(byPriority)[0] || fallbackCountry;
4391
- const number = phoneWithCode.slice((country == null ? void 0 : country.code.length) || 0);
4392
- return { number, country };
3702
+ if (!result) {
3703
+ throw new Error(`Unable to merge ElementsAppearanceConfigs: ${JSON.stringify(a)} and ${JSON.stringify(b)}`);
3704
+ }
3705
+ return result;
4393
3706
  }
4394
- function useFocusInput() {
4395
- const ref = React2.useRef(null);
4396
- const setFocus = React2.useCallback(() => {
4397
- requestAnimationFrame(() => {
4398
- if (ref.current) {
4399
- ref.current.focus();
3707
+ function mergeAppearance(a, b) {
3708
+ if (!a && !b) {
3709
+ return null;
3710
+ }
3711
+ if (!a) {
3712
+ return b;
3713
+ }
3714
+ if (!b) {
3715
+ return a;
3716
+ }
3717
+ const result = { ...a, options: { ...a.options, ...b.options } };
3718
+ if (b.theme) {
3719
+ result.theme = b.theme;
3720
+ }
3721
+ if (!result.elements && b.elements) {
3722
+ result.elements = { ...b.elements };
3723
+ } else if (result.elements && b.elements) {
3724
+ Object.entries(b.elements).forEach(([element, config]) => {
3725
+ const el = element;
3726
+ if (el in result.elements) {
3727
+ result.elements[el] = mergeElementsAppearanceConfig(result.elements[el], config);
3728
+ } else {
3729
+ result.elements[el] = config;
4400
3730
  }
4401
3731
  });
4402
- }, [ref]);
4403
- return [ref, setFocus];
4404
- }
4405
- function CheckmarkSm(props) {
4406
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
4407
- "path",
4408
- {
4409
- d: "M4.25 8.75L7.25 11.75L11.75 4.25",
4410
- stroke: "currentColor",
4411
- strokeWidth: "1.5",
4412
- strokeLinecap: "round",
4413
- strokeLinejoin: "round"
4414
- }
4415
- ) }) });
4416
- }
4417
- function ChevronUpDownSm(props) {
4418
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
4419
- /* @__PURE__ */ jsx(
4420
- "path",
4421
- {
4422
- d: "M5.75 5.25L8 2.75L10.25 5.25",
4423
- stroke: "currentColor",
4424
- strokeWidth: "1.5",
4425
- strokeLinecap: "round",
4426
- strokeLinejoin: "round"
4427
- }
4428
- ),
4429
- /* @__PURE__ */ jsx(
4430
- "path",
4431
- {
4432
- d: "M5.75 10.75L8 13.25L10.25 10.75",
4433
- stroke: "currentColor",
4434
- strokeWidth: "1.5",
4435
- strokeLinecap: "round",
4436
- strokeLinejoin: "round"
4437
- }
4438
- )
4439
- ] }) });
3732
+ }
3733
+ return result;
4440
3734
  }
4441
-
4442
- // src/utils/merge-refs.ts
4443
- function mergeRefs(refs) {
4444
- return (value) => {
4445
- refs.forEach((ref) => {
4446
- if (typeof ref === "function") {
4447
- ref(value);
4448
- } else if (ref != null) {
4449
- ref.current = value;
3735
+ function applyTheme(theme, appearance) {
3736
+ const baseTheme = theme != null ? theme : fullTheme;
3737
+ if (!appearance) {
3738
+ return { theme: baseTheme, elements: structuredClone(baseTheme), options: defaultAppearance.options };
3739
+ }
3740
+ const result = {
3741
+ theme: baseTheme,
3742
+ // because we're going to perform modifications to deeply nested objects, we need to create a structuredClone of
3743
+ // the theme or else subsequent usage of the baseTheme will contain our merged changes.
3744
+ elements: structuredClone(baseTheme),
3745
+ options: { ...defaultAppearance.options, ...appearance.options }
3746
+ };
3747
+ if (appearance.elements) {
3748
+ Object.entries(appearance.elements).forEach(([element, config]) => {
3749
+ const el = element;
3750
+ if (el in appearance.elements) {
3751
+ if (typeof config === "string") {
3752
+ result.elements[el].className = [result.elements[el].className, config].join(" ");
3753
+ } else {
3754
+ const { className, ...style } = config;
3755
+ if (className) {
3756
+ result.elements[el].className = [result.elements[el].className, className].join(" ");
3757
+ }
3758
+ result.elements[el].style = { ...result.elements[el].style, ...style };
3759
+ }
4450
3760
  }
4451
3761
  });
4452
- };
4453
- }
4454
- var format = (str, iso) => {
4455
- if (!str) {
4456
- return "";
4457
3762
  }
4458
- const country = IsoToCountryMap.get(iso);
4459
- return formatPhoneNumber(str, country == null ? void 0 : country.pattern, country == null ? void 0 : country.code);
3763
+ return result;
3764
+ }
3765
+ var defaultAppearance = {
3766
+ theme: fullTheme,
3767
+ elements: fullTheme,
3768
+ options: {
3769
+ logoVisibility: "visible",
3770
+ socialButtonsPlacement: "top",
3771
+ socialButtonsVariant: "auto",
3772
+ logoImageUrl: "",
3773
+ logoLinkUrl: "",
3774
+ showOptionalFields: true,
3775
+ helpPageUrl: "",
3776
+ privacyPageUrl: "",
3777
+ termsPageUrl: "",
3778
+ shimmer: true,
3779
+ animations: true,
3780
+ unsafe_disableDevelopmentModeWarnings: false
3781
+ }
4460
3782
  };
4461
- var useFormattedPhoneNumber = (props) => {
4462
- const [number, setNumber] = React2.useState(() => {
4463
- const { number: number2 } = parsePhoneString(props.initPhoneWithCode || "");
4464
- return number2;
4465
- });
4466
- const [iso, setIso] = React2.useState(
4467
- parsePhoneString(props.initPhoneWithCode || "").number ? parsePhoneString(props.initPhoneWithCode || "").iso : props.locationBasedCountryIso || "us"
4468
- );
4469
- React2.useEffect(() => {
4470
- setNumber(extractDigits(number));
4471
- }, [iso, number]);
4472
- const numberWithCode = React2.useMemo(() => {
4473
- var _a;
4474
- if (!number) {
4475
- return "";
4476
- }
4477
- const dialCode = ((_a = IsoToCountryMap.get(iso)) == null ? void 0 : _a.code) || "1";
4478
- return "+" + extractDigits(`${dialCode}${number}`);
4479
- }, [iso, number]);
4480
- const formattedNumber = React2.useMemo(() => {
4481
- return format(number, iso);
4482
- }, [iso, number]);
4483
- const setNumberAndIso = React2.useCallback((str) => {
4484
- const { iso: iso2, number: number2 } = parsePhoneString(str);
4485
- setNumber(number2);
4486
- setIso(iso2);
4487
- }, []);
4488
- return {
4489
- setNumber,
4490
- setIso,
4491
- setNumberAndIso,
4492
- iso,
4493
- number,
4494
- numberWithCode,
4495
- formattedNumber
4496
- };
3783
+ var [AppearanceContext, useAppearance, usePartialAppearance] = createContextAndHook("AppearanceContext");
3784
+ var AppearanceProvider = (props) => {
3785
+ const {
3786
+ parsedAppearance: globalAppearance,
3787
+ themelessAppearance: globalThemelessAppearance,
3788
+ theme: globalTheme
3789
+ } = usePartialAppearance();
3790
+ const ctxValue = useDeepEqualMemo(() => {
3791
+ var _a, _b;
3792
+ const theme = (_a = props.theme) != null ? _a : globalTheme;
3793
+ const themelessAppearance = mergeAppearance(globalThemelessAppearance, props.appearance);
3794
+ const parsedAppearance = applyTheme(theme, themelessAppearance);
3795
+ return { value: { parsedAppearance, themelessAppearance, theme: (_b = props.theme) != null ? _b : globalTheme } };
3796
+ }, [props.appearance, props.theme, globalAppearance, globalThemelessAppearance, globalTheme]);
3797
+ return /* @__PURE__ */ jsx(AppearanceContext.Provider, { value: ctxValue, children: props.children });
4497
3798
  };
4498
- var countryOptions = Array.from(IsoToCountryMap.values()).map((country) => {
4499
- return {
4500
- ...country
4501
- };
4502
- });
4503
- var PhoneNumberField = React2.forwardRef(function PhoneNumberField2({
4504
- alternativeFieldTrigger,
4505
- name = "phoneNumber",
4506
- initPhoneWithCode = "",
4507
- onChange,
4508
- ...props
4509
- }, forwardedRef) {
4510
- var _a, _b;
4511
- const clerk = useClerk();
4512
- const locationBasedCountryIso = clerk.__internal_country;
4513
- const { t, translateError } = useLocalizations();
4514
- const [isOpen, setOpen] = React2.useState(false);
4515
- const [selectedCountry, setSelectedCountry] = React2.useState(countryOptions[0]);
4516
- const id = React2.useId();
4517
- const containerRef = React2.useRef(null);
4518
- const commandListRef = React2.useRef(null);
4519
- const commandInputRef = React2.useRef(null);
4520
- const contentWidth = ((_b = (_a = containerRef.current) == null ? void 0 : _a.getBoundingClientRect()) == null ? void 0 : _b.width) || 0;
4521
- const [inputRef, setInputFocus] = useFocusInput();
4522
- const { setNumber, setIso, setNumberAndIso, numberWithCode, formattedNumber, iso } = useFormattedPhoneNumber({
4523
- initPhoneWithCode,
4524
- locationBasedCountryIso
4525
- });
4526
- const handlePaste = (e) => {
4527
- e.preventDefault();
4528
- const inputValue = e.clipboardData.getData("text");
4529
- if (inputValue.includes("+")) {
4530
- setNumberAndIso(inputValue);
4531
- } else {
4532
- setNumber(inputValue);
4533
- }
4534
- };
4535
- const handlePhoneNumberChange = (e) => {
4536
- const inputValue = e.target.value;
4537
- if (inputValue.includes("+")) {
4538
- setNumberAndIso(inputValue);
4539
- } else {
4540
- setNumber(inputValue);
4541
- }
4542
- };
4543
- React2.useEffect(
4544
- function syncSelectedCountry() {
4545
- setSelectedCountry(countryOptions.find((c) => c.iso === iso) || countryOptions[0]);
4546
- },
4547
- [iso]
4548
- );
4549
- React2.useEffect(
4550
- function scrollActiveCommandItemIntoView() {
4551
- var _a2;
4552
- if (isOpen) {
4553
- (_a2 = commandInputRef.current) == null ? void 0 : _a2.focus();
4554
- setTimeout(() => {
4555
- var _a3, _b2;
4556
- (_b2 = (_a3 = commandListRef.current) == null ? void 0 : _a3.querySelector("[data-checked=true]")) == null ? void 0 : _b2.scrollIntoView({ block: "start" });
4557
- }, 0);
4558
- }
4559
- },
4560
- [isOpen]
4561
- );
4562
- return /* @__PURE__ */ jsx(
4563
- Common2.Field,
4564
- {
4565
- name,
4566
- asChild: true,
4567
- children: /* @__PURE__ */ jsxs(Root2, { children: [
4568
- /* @__PURE__ */ jsx(Common2.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { htmlFor: id, children: [
4569
- t("formFieldLabel__phoneNumber"),
4570
- " ",
4571
- alternativeFieldTrigger ? /* @__PURE__ */ jsx(LabelEnd, { children: alternativeFieldTrigger }) : !(props == null ? void 0 : props.required) ? /* @__PURE__ */ jsx(Hint, { children: t("formFieldHintText__optional") }) : null
4572
- ] }) }),
4573
- /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state: intent }) => {
4574
- return /* @__PURE__ */ jsxs(
4575
- "div",
4576
- {
4577
- ref: containerRef,
4578
- className: cx(
4579
- // Note:
4580
- // - To create the overlapping border/shadow effect"
4581
- // - `ring` – "focus ring"
4582
- // - `ring-offset` - border
4583
- "cl-deb747c5",
4584
- "cl-d9213aa4",
4585
- "cl-929952e4",
4586
- "cl-000b8592",
4587
- "cl-2aeea0c3",
4588
- "cl-b8d3fb9a",
4589
- // hover
4590
- "cl-31e80f10",
4591
- // focus
4592
- "cl-f3ff9abd",
4593
- "cl-2d93da67",
4594
- // intent
4595
- {
4596
- idle: [
4597
- "cl-60b2eb1d",
4598
- "cl-9722ed3e"
4599
- ],
4600
- info: [
4601
- "cl-d0aba580",
4602
- "cl-9722ed3e"
4603
- ],
4604
- error: [
4605
- "cl-5a239b6d",
4606
- "cl-16f89e98",
4607
- "cl-a0f5bec1"
4608
- ],
4609
- success: [
4610
- "cl-903d9684",
4611
- "cl-9ee10a6a",
4612
- "cl-7df25448"
4613
- // (optically adjusted ring to 25 opacity)
4614
- ],
4615
- warning: [
4616
- "cl-e6adb1a7",
4617
- "cl-9b871c1b",
4618
- "cl-08105371"
4619
- ]
4620
- }[intent]
4621
- ),
4622
- children: [
4623
- /* @__PURE__ */ jsxs(DialogTrigger, { children: [
4624
- /* @__PURE__ */ jsxs(
4625
- Button$1,
4626
- {
4627
- onPress: () => setOpen(true),
4628
- isDisabled: props.disabled,
4629
- className: "cl-b2ddee5e",
4630
- children: [
4631
- /* @__PURE__ */ jsx("span", { className: "cl-6f75bc57", children: selectedCountry.iso }),
4632
- /* @__PURE__ */ jsx(ChevronUpDownSm, { className: "cl-f6142057" })
4633
- ]
4634
- }
4635
- ),
4636
- /* @__PURE__ */ jsx(
4637
- Popover,
4638
- {
4639
- isOpen,
4640
- onOpenChange: setOpen,
4641
- placement: "bottom start",
4642
- crossOffset: -1,
4643
- children: /* @__PURE__ */ jsx(
4644
- Dialog,
4645
- {
4646
- className: "cl-b30fc560",
4647
- style: {
4648
- width: contentWidth
4649
- },
4650
- children: /* @__PURE__ */ jsxs(Command, { className: "cl-dc1d9f19", children: [
4651
- /* @__PURE__ */ jsx("div", { className: "cl-1c0d9e31", children: /* @__PURE__ */ jsx(
4652
- Command.Input,
4653
- {
4654
- ref: commandInputRef,
4655
- placeholder: "Search country or code",
4656
- className: "cl-54426bd8"
4657
- }
4658
- ) }),
4659
- /* @__PURE__ */ jsxs(
4660
- Command.List,
4661
- {
4662
- ref: commandListRef,
4663
- className: "cl-6bc50823",
4664
- children: [
4665
- /* @__PURE__ */ jsx(Command.Empty, { className: "cl-1facd79b", children: "No countries found" }),
4666
- countryOptions.map(({ name: name2, iso: iso2, code }, index) => {
4667
- return /* @__PURE__ */ jsxs(
4668
- Command.Item,
4669
- {
4670
- onSelect: () => {
4671
- setIso(iso2);
4672
- setOpen(false);
4673
- setInputFocus();
4674
- },
4675
- "data-checked": selectedCountry === countryOptions[index],
4676
- className: "cl-ba59b9a7",
4677
- children: [
4678
- /* @__PURE__ */ jsx("span", { className: "cl-4128a507", children: selectedCountry === countryOptions[index] && /* @__PURE__ */ jsx(CheckmarkSm, { className: "cl-100c22d5" }) }),
4679
- /* @__PURE__ */ jsx("span", { className: "cl-2bcc5e30", children: name2 }),
4680
- /* @__PURE__ */ jsxs("span", { className: "cl-00c77415", children: [
4681
- "+",
4682
- code
4683
- ] })
4684
- ]
4685
- },
4686
- iso2
4687
- );
4688
- })
4689
- ]
4690
- }
4691
- )
4692
- ] })
4693
- }
4694
- )
4695
- }
4696
- )
4697
- ] }),
4698
- /* @__PURE__ */ jsxs(
4699
- "button",
4700
- {
4701
- type: "button",
4702
- tabIndex: -1,
4703
- className: "cl-59bd566c",
4704
- onClick: () => setInputFocus(),
4705
- disabled: props.disabled,
4706
- children: [
4707
- "+",
4708
- selectedCountry.code
4709
- ]
4710
- }
4711
- ),
4712
- /* @__PURE__ */ jsx(
4713
- Common2.Input,
4714
- {
4715
- value: numberWithCode,
4716
- className: "cl-e564b408"
4717
- }
4718
- ),
4719
- /* @__PURE__ */ jsx(
4720
- "input",
4721
- {
4722
- ref: mergeRefs([forwardedRef, inputRef]),
4723
- type: "tel",
4724
- id,
4725
- maxLength: 25,
4726
- value: formattedNumber,
4727
- onPaste: handlePaste,
4728
- onChange: handlePhoneNumberChange,
4729
- ...props,
4730
- className: "cl-4a741be6",
4731
- "data-field-input": true
4732
- }
4733
- )
4734
- ]
4735
- }
4736
- );
4737
- } }),
4738
- /* @__PURE__ */ jsx(Animated, { children: /* @__PURE__ */ jsx(Common2.FieldError, { asChild: true, children: ({ message, code }) => {
4739
- return /* @__PURE__ */ jsx(Message, { intent: "error", children: translateError({ message, code, name: "phone_number" }) });
4740
- } }) })
4741
- ] })
4742
- }
4743
- );
4744
- });
4745
- function EmailOrPhoneNumberField({
4746
- className,
4747
- name = void 0,
4748
- toggleLabelEmail,
4749
- toggleLabelPhoneNumber,
4750
- ...props
4751
- }) {
4752
- const [showPhoneNumberField, setShowPhoneNumberField] = React2.useState(false);
4753
- const [inputRef, setInputFocus] = useFocusInput();
4754
- const toggle = /* @__PURE__ */ jsx(
4755
- ToggleButton,
4756
- {
4757
- isSelected: showPhoneNumberField,
4758
- onChange: (isSelected) => {
4759
- setShowPhoneNumberField(isSelected);
4760
- setInputFocus();
4761
- },
4762
- className: link({ size: "sm", disabled: props.disabled }),
4763
- children: showPhoneNumberField ? toggleLabelEmail : toggleLabelPhoneNumber
4764
- }
4765
- );
4766
- return showPhoneNumberField ? /* @__PURE__ */ jsx(
4767
- PhoneNumberField,
4768
- {
4769
- alternativeFieldTrigger: toggle,
4770
- name,
4771
- ...props,
4772
- ref: inputRef
4773
- }
4774
- ) : /* @__PURE__ */ jsx(
4775
- EmailField,
4776
- {
4777
- ...props,
4778
- name,
4779
- alternativeFieldTrigger: toggle,
4780
- ref: inputRef
4781
- }
4782
- );
4783
- }
4784
- function UsernameField({
4785
- alternativeFieldTrigger,
4786
- name = "username",
4787
- ...props
4788
- }) {
4789
- const { t, translateError } = useLocalizations();
4790
- return /* @__PURE__ */ jsx(
4791
- Common2.Field,
4792
- {
4793
- name,
4794
- asChild: true,
4795
- children: /* @__PURE__ */ jsxs(Root2, { children: [
4796
- /* @__PURE__ */ jsx(Common2.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { children: [
4797
- t("formFieldLabel__username"),
4798
- " ",
4799
- alternativeFieldTrigger ? /* @__PURE__ */ jsx(LabelEnd, { children: alternativeFieldTrigger }) : !(props == null ? void 0 : props.required) ? /* @__PURE__ */ jsx(Hint, { children: t("formFieldHintText__optional") }) : null
4800
- ] }) }),
4801
- /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state }) => {
4802
- return /* @__PURE__ */ jsx(
4803
- Common2.Input,
4804
- {
4805
- type: "text",
4806
- ...props,
4807
- asChild: true,
4808
- children: /* @__PURE__ */ jsx(Input, { intent: state })
4809
- }
4810
- );
4811
- } }),
4812
- /* @__PURE__ */ jsx(Animated, { children: /* @__PURE__ */ jsx(Common2.FieldError, { asChild: true, children: ({ message, code }) => {
4813
- return /* @__PURE__ */ jsx(Message, { intent: "error", children: translateError({ message, code, name: "username" }) });
4814
- } }) })
4815
- ] })
4816
- }
4817
- );
4818
- }
4819
- function OTPField({
4820
- label,
4821
- resend,
4822
- ...props
4823
- }) {
4824
- return /* @__PURE__ */ jsxs("div", { className: "cl-a8dca104", children: [
4825
- /* @__PURE__ */ jsx(
4826
- Common2.Field,
4827
- {
4828
- asChild: true,
4829
- name: "code",
4830
- children: /* @__PURE__ */ jsxs(Root2, { children: [
4831
- /* @__PURE__ */ jsx(Common2.Label, { asChild: true, children: /* @__PURE__ */ jsx(Label, { visuallyHidden: true, children: label }) }),
4832
- /* @__PURE__ */ jsx(Common2.FieldState, { children: ({ state }) => /* @__PURE__ */ jsx(
4833
- Common2.Input,
4834
- {
4835
- type: "otp",
4836
- autoSubmit: true,
4837
- autoFocus: true,
4838
- className: "cl-6f38a1ba",
4839
- passwordManagerOffset: 24,
4840
- render: ({ value, status }) => /* @__PURE__ */ jsx(
4841
- Input,
4842
- {
4843
- variant: "otp-digit",
4844
- intent: state,
4845
- state: {
4846
- cursor: "focus-visible",
4847
- selected: "focus-visible",
4848
- hovered: "hover",
4849
- none: "native"
4850
- }[status],
4851
- ...props,
4852
- asChild: true,
4853
- children: /* @__PURE__ */ jsxs("span", { children: [
4854
- status === "cursor" && /* @__PURE__ */ jsx(
4855
- "span",
4856
- {
4857
- "data-otp-field-cursor": "",
4858
- className: "cl-0389eded"
4859
- }
4860
- ),
4861
- value
4862
- ] })
4863
- }
4864
- )
4865
- }
4866
- ) }),
4867
- /* @__PURE__ */ jsx(Animated, { children: /* @__PURE__ */ jsx(Common2.FieldError, { asChild: true, children: ({ message }) => {
4868
- return /* @__PURE__ */ jsx(
4869
- Message,
4870
- {
4871
- justify: "center",
4872
- intent: "error",
4873
- children: message
4874
- }
4875
- );
4876
- } }) })
4877
- ] })
4878
- }
4879
- ),
4880
- resend && resend
4881
- ] });
4882
- }
4883
- function PenSm(props) {
4884
- return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
4885
- "path",
4886
- {
4887
- d: "M9.23664 3.44288L4.18161 8.33251C3.90008 8.60483 3.70471 8.95383 3.61974 9.33619L2.75 13.25L6.45529 12.3782C6.81159 12.2943 7.13805 12.1143 7.3991 11.8578L12.6265 6.72023C13.4824 5.78723 13.4537 4.34072 12.5614 3.44288C11.6433 2.51904 10.1547 2.51904 9.23664 3.44288Z",
4888
- stroke: "currentColor",
4889
- strokeWidth: "1.5",
4890
- strokeLinecap: "round",
4891
- strokeLinejoin: "round"
4892
- }
4893
- ) }) });
4894
- }
4895
3799
 
4896
- export { Actions, Animated, Body, Button, CaretRightLegacySm, Checkbox, Connections, Content, Description, EmailField, EmailOrPhoneNumberField, Footer, FooterAction, FooterActionButton, FooterActionLink, FooterActionText, GlobalError, Header, Hint, Input, LOCALIZATION_NEEDED, Label, LinkButton, Logo, Message, OTPField, PasswordField, PenSm, PhoneNumberField, Root, Root2, Title, UsernameField, link, parsePhoneString, stringToFormattedPhoneString, useAttributes, useCard, useDevModeWarning, useDisplayConfig, useEnabledConnections, useEnvironment, useFocusInput, useLocalizations, useOptions, useSignUpAttributes };
3800
+ export { Actions, Alert, AppearanceProvider, Body, Button, Connections, Content, Description, ExclamationOctagonSm, ExclamationTriangleSm, Footer, FooterAction, FooterActionButton, FooterActionLink, FooterActionText, Header, Icon, Logo, Root, Separator, Title, mergeDescriptors, translatePasswordError, useAppearance, useEnabledConnections, useLocalizations, useOptions };
4897
3801
  //# sourceMappingURL=out.js.map
4898
- //# sourceMappingURL=chunk-GJNJVJGS.mjs.map
3802
+ //# sourceMappingURL=chunk-LLOUIL3Z.mjs.map