@stackframe/dashboard-ui-components 2.8.80 → 2.8.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/cursor-blast-effect.js +1 -0
- package/dist/components/cursor-blast-effect.js.map +1 -1
- package/dist/dashboard-ui-components.global.js +6 -254
- package/dist/dashboard-ui-components.global.js.map +2 -2
- package/dist/esm/components/cursor-blast-effect.js +1 -0
- package/dist/esm/components/cursor-blast-effect.js.map +1 -1
- package/package.json +3 -3
|
@@ -67,6 +67,7 @@ function CursorBlastEffect({ blastLifetimeMs = DEFAULT_BLAST_LIFETIME_MS, maxAct
|
|
|
67
67
|
timeoutIdsRef.current.set(nextId, timeoutId);
|
|
68
68
|
};
|
|
69
69
|
const onClick = (event) => {
|
|
70
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
70
71
|
const cfg = configRef.current;
|
|
71
72
|
const now = performance.now();
|
|
72
73
|
let x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-blast-effect.js","names":[],"sources":["../../src/components/cursor-blast-effect.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ntype Blast = {\n id: number,\n x: number,\n y: number,\n size: number,\n hue: number,\n};\n\nconst DEFAULT_BLAST_LIFETIME_MS = 720;\nconst DEFAULT_MAX_ACTIVE_BLASTS = 18;\n\n/** Minimum rapid clicks in the time window to count as a rage click */\nconst DEFAULT_RAGE_CLICK_THRESHOLD = 3;\n/** Time window (ms) in which clicks must occur to be considered rage clicking */\nconst DEFAULT_RAGE_CLICK_WINDOW_MS = 600;\n/** Max distance (px) between clicks to still count as same-spot rage clicking */\nconst DEFAULT_RAGE_CLICK_RADIUS_PX = 60;\n\ntype RecentClick = {\n time: number,\n x: number,\n y: number,\n};\n\nexport type CursorBlastEffectProps = {\n /** Lifetime of each blast animation in ms. Default: 720 */\n blastLifetimeMs?: number,\n /** Maximum number of concurrent active blasts. Default: 18 */\n maxActiveBlasts?: number,\n /** Minimum rapid clicks in the time window to trigger a blast. Default: 3 */\n rageClickThreshold?: number,\n /** Time window (ms) for counting rage clicks. Default: 600 */\n rageClickWindowMs?: number,\n /** Max distance (px) between clicks to count as same-spot rage clicking. Default: 60 */\n rageClickRadiusPx?: number,\n /**\n * When provided, the blast effect is scoped to this container element.\n * Clicks are only detected within the container and blasts are positioned\n * relative to the container rather than the viewport.\n */\n containerRef?: React.RefObject<HTMLElement | null>,\n};\n\nexport function CursorBlastEffect({\n blastLifetimeMs = DEFAULT_BLAST_LIFETIME_MS,\n maxActiveBlasts = DEFAULT_MAX_ACTIVE_BLASTS,\n rageClickThreshold = DEFAULT_RAGE_CLICK_THRESHOLD,\n rageClickWindowMs = DEFAULT_RAGE_CLICK_WINDOW_MS,\n rageClickRadiusPx = DEFAULT_RAGE_CLICK_RADIUS_PX,\n containerRef,\n}: CursorBlastEffectProps = {}) {\n const [blasts, setBlasts] = useState<Blast[]>([]);\n const [mounted, setMounted] = useState(false);\n const idCounterRef = useRef(0);\n const timeoutIdsRef = useRef<Map<number, number>>(new Map());\n const recentClicksRef = useRef<RecentClick[]>([]);\n\n // Store latest config in refs so the effect callback always reads current values\n const configRef = useRef({\n blastLifetimeMs,\n maxActiveBlasts,\n rageClickThreshold,\n rageClickWindowMs,\n rageClickRadiusPx,\n });\n configRef.current = {\n blastLifetimeMs,\n maxActiveBlasts,\n rageClickThreshold,\n rageClickWindowMs,\n rageClickRadiusPx,\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n const removeBlast = (id: number) => {\n setBlasts((prev) => prev.filter((blast) => blast.id !== id));\n const timeoutId = timeoutIdsRef.current.get(id);\n if (timeoutId !== undefined) {\n window.clearTimeout(timeoutId);\n timeoutIdsRef.current.delete(id);\n }\n };\n\n const spawnBlast = (x: number, y: number) => {\n const cfg = configRef.current;\n const nextId = idCounterRef.current;\n idCounterRef.current += 1;\n\n const nextBlast: Blast = {\n id: nextId,\n x,\n y,\n size: 44 + Math.random() * 20,\n hue: 185 + Math.random() * 35,\n };\n\n setBlasts((prev) => {\n const next = [...prev, nextBlast];\n if (next.length <= cfg.maxActiveBlasts) {\n return next;\n }\n return next.slice(next.length - cfg.maxActiveBlasts);\n });\n\n const timeoutId = window.setTimeout(() => removeBlast(nextId), cfg.blastLifetimeMs);\n timeoutIdsRef.current.set(nextId, timeoutId);\n };\n\n const onClick = (event: MouseEvent) => {\n const cfg = configRef.current;\n const now = performance.now();\n\n let x: number;\n let y: number;\n\n if (containerRef?.current) {\n const rect = containerRef.current.getBoundingClientRect();\n x = event.clientX - rect.left;\n y = event.clientY - rect.top;\n } else {\n x = event.clientX;\n y = event.clientY;\n }\n\n // Prune clicks outside the time window\n recentClicksRef.current = recentClicksRef.current.filter(\n (click) => now - click.time < cfg.rageClickWindowMs,\n );\n\n recentClicksRef.current.push({ time: now, x, y });\n\n // Count how many recent clicks are within the radius of the current click\n const nearbyCount = recentClicksRef.current.filter((click) => {\n const dx = click.x - x;\n const dy = click.y - y;\n return Math.sqrt(dx * dx + dy * dy) <= cfg.rageClickRadiusPx;\n }).length;\n\n if (nearbyCount >= cfg.rageClickThreshold) {\n spawnBlast(x, y);\n }\n };\n\n const target = containerRef?.current ?? window;\n const timeoutIds = timeoutIdsRef.current;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- EventTarget union requires cast\n (target as EventTarget).addEventListener(\"click\", onClick as EventListener);\n return () => {\n (target as EventTarget).removeEventListener(\"click\", onClick as EventListener);\n for (const timeoutId of timeoutIds.values()) {\n window.clearTimeout(timeoutId);\n }\n timeoutIds.clear();\n };\n }, [containerRef]);\n\n if (!mounted) {\n return null;\n }\n\n const blastElements = (\n <>\n {blasts.map((blast) => (\n <div\n key={blast.id}\n style={{\n position: \"absolute\",\n left: blast.x,\n top: blast.y,\n width: blast.size,\n height: blast.size,\n transform: \"translate(-50%, -50%)\",\n willChange: \"transform, opacity\",\n filter: `hue-rotate(${blast.hue}deg)`,\n }}\n >\n <span className=\"cursor-blast-ring\" />\n <span className=\"cursor-blast-core\" />\n {Array.from({ length: 10 }).map((_, index) => {\n const angle = (360 / 10) * index;\n return (\n <span\n key={`${blast.id}-${index}`}\n className=\"cursor-blast-shard-wrap\"\n style={{\n transform: `translate(-50%, -50%) rotate(${angle}deg)`,\n animationDelay: `${index * 16}ms`,\n }}\n >\n <span className=\"cursor-blast-shard\" />\n </span>\n );\n })}\n </div>\n ))}\n <style dangerouslySetInnerHTML={{ __html: `\n .cursor-blast-ring {\n position: absolute;\n inset: 0;\n border-radius: 999px;\n border: 2px solid hsl(197 98% 67% / 0.9);\n box-shadow:\n 0 0 22px hsl(191 100% 72% / 0.6),\n inset 0 0 12px hsl(204 100% 77% / 0.65);\n animation: blast-ring 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n\n .cursor-blast-core {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 10px;\n height: 10px;\n border-radius: 999px;\n transform: translate(-50%, -50%);\n background: hsl(196 100% 85%);\n box-shadow:\n 0 0 26px hsl(193 100% 72% / 0.9),\n 0 0 10px hsl(201 100% 85% / 0.9);\n animation: blast-core 420ms ease-out forwards;\n }\n\n .cursor-blast-shard-wrap {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 0;\n height: 0;\n }\n\n .cursor-blast-shard {\n position: absolute;\n left: 0;\n top: -1.5px;\n width: 12px;\n height: 3px;\n border-radius: 999px;\n background: linear-gradient(90deg, hsl(190 100% 84%), hsl(197 98% 67%));\n box-shadow: 0 0 12px hsl(195 100% 70% / 0.8);\n animation: blast-shard 680ms cubic-bezier(0.22, 1, 0.36, 1) forwards;\n }\n\n @keyframes blast-ring {\n 0% {\n transform: scale(0.2);\n opacity: 0.95;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n }\n\n @keyframes blast-core {\n 0% {\n transform: translate(-50%, -50%) scale(0.5);\n opacity: 1;\n }\n 100% {\n transform: translate(-50%, -50%) scale(2.2);\n opacity: 0;\n }\n }\n\n @keyframes blast-shard {\n 0% {\n transform: translateX(0) scaleX(0.7);\n opacity: 1;\n }\n 100% {\n transform: translateX(46px) scaleX(1.1);\n opacity: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cursor-blast-ring,\n .cursor-blast-core,\n .cursor-blast-shard {\n animation-duration: 1ms;\n }\n }\n ` }} />\n </>\n );\n\n // When scoped to a container, render inline (the container must have position: relative)\n if (containerRef) {\n return (\n <div\n aria-hidden\n style={{\n position: \"absolute\",\n inset: 0,\n zIndex: 2147483647,\n pointerEvents: \"none\",\n overflow: \"hidden\",\n borderRadius: \"inherit\",\n }}\n >\n {blastElements}\n </div>\n );\n }\n\n // Default: portal to body with fixed positioning (original behaviour)\n return createPortal(\n <div\n aria-hidden\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 2147483647,\n pointerEvents: \"none\",\n }}\n >\n {blastElements}\n </div>,\n document.body,\n );\n}\n"],"mappings":";;;;;;;;;AAaA,MAAM,4BAA4B;AAClC,MAAM,4BAA4B;;AAGlC,MAAM,+BAA+B;;AAErC,MAAM,+BAA+B;;AAErC,MAAM,+BAA+B;AA2BrC,SAAgB,kBAAkB,EAChC,kBAAkB,2BAClB,kBAAkB,2BAClB,qBAAqB,8BACrB,oBAAoB,8BACpB,oBAAoB,8BACpB,iBAC0B,EAAE,EAAE;CAC9B,MAAM,CAAC,QAAQ,iCAA+B,EAAE,CAAC;CACjD,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAC7C,MAAM,iCAAsB,EAAE;CAC9B,MAAM,kDAA4C,IAAI,KAAK,CAAC;CAC5D,MAAM,oCAAwC,EAAE,CAAC;CAGjD,MAAM,8BAAmB;EACvB;EACA;EACA;EACA;EACA;EACD,CAAC;AACF,WAAU,UAAU;EAClB;EACA;EACA;EACA;EACA;EACD;AAED,4BAAgB;AACd,aAAW,KAAK;IACf,EAAE,CAAC;AAEN,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;YAEA;GACG;AAKV,oCACE,2CAAC;EACC;EACA,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,eAAe;GAChB;YAEA;GACG,EACN,SAAS,KACV"}
|
|
1
|
+
{"version":3,"file":"cursor-blast-effect.js","names":[],"sources":["../../src/components/cursor-blast-effect.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ntype Blast = {\n id: number,\n x: number,\n y: number,\n size: number,\n hue: number,\n};\n\nconst DEFAULT_BLAST_LIFETIME_MS = 720;\nconst DEFAULT_MAX_ACTIVE_BLASTS = 18;\n\n/** Minimum rapid clicks in the time window to count as a rage click */\nconst DEFAULT_RAGE_CLICK_THRESHOLD = 3;\n/** Time window (ms) in which clicks must occur to be considered rage clicking */\nconst DEFAULT_RAGE_CLICK_WINDOW_MS = 600;\n/** Max distance (px) between clicks to still count as same-spot rage clicking */\nconst DEFAULT_RAGE_CLICK_RADIUS_PX = 60;\n\ntype RecentClick = {\n time: number,\n x: number,\n y: number,\n};\n\nexport type CursorBlastEffectProps = {\n /** Lifetime of each blast animation in ms. Default: 720 */\n blastLifetimeMs?: number,\n /** Maximum number of concurrent active blasts. Default: 18 */\n maxActiveBlasts?: number,\n /** Minimum rapid clicks in the time window to trigger a blast. Default: 3 */\n rageClickThreshold?: number,\n /** Time window (ms) for counting rage clicks. Default: 600 */\n rageClickWindowMs?: number,\n /** Max distance (px) between clicks to count as same-spot rage clicking. Default: 60 */\n rageClickRadiusPx?: number,\n /**\n * When provided, the blast effect is scoped to this container element.\n * Clicks are only detected within the container and blasts are positioned\n * relative to the container rather than the viewport.\n */\n containerRef?: React.RefObject<HTMLElement | null>,\n};\n\nexport function CursorBlastEffect({\n blastLifetimeMs = DEFAULT_BLAST_LIFETIME_MS,\n maxActiveBlasts = DEFAULT_MAX_ACTIVE_BLASTS,\n rageClickThreshold = DEFAULT_RAGE_CLICK_THRESHOLD,\n rageClickWindowMs = DEFAULT_RAGE_CLICK_WINDOW_MS,\n rageClickRadiusPx = DEFAULT_RAGE_CLICK_RADIUS_PX,\n containerRef,\n}: CursorBlastEffectProps = {}) {\n const [blasts, setBlasts] = useState<Blast[]>([]);\n const [mounted, setMounted] = useState(false);\n const idCounterRef = useRef(0);\n const timeoutIdsRef = useRef<Map<number, number>>(new Map());\n const recentClicksRef = useRef<RecentClick[]>([]);\n\n // Store latest config in refs so the effect callback always reads current values\n const configRef = useRef({\n blastLifetimeMs,\n maxActiveBlasts,\n rageClickThreshold,\n rageClickWindowMs,\n rageClickRadiusPx,\n });\n configRef.current = {\n blastLifetimeMs,\n maxActiveBlasts,\n rageClickThreshold,\n rageClickWindowMs,\n rageClickRadiusPx,\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n const removeBlast = (id: number) => {\n setBlasts((prev) => prev.filter((blast) => blast.id !== id));\n const timeoutId = timeoutIdsRef.current.get(id);\n if (timeoutId !== undefined) {\n window.clearTimeout(timeoutId);\n timeoutIdsRef.current.delete(id);\n }\n };\n\n const spawnBlast = (x: number, y: number) => {\n const cfg = configRef.current;\n const nextId = idCounterRef.current;\n idCounterRef.current += 1;\n\n const nextBlast: Blast = {\n id: nextId,\n x,\n y,\n size: 44 + Math.random() * 20,\n hue: 185 + Math.random() * 35,\n };\n\n setBlasts((prev) => {\n const next = [...prev, nextBlast];\n if (next.length <= cfg.maxActiveBlasts) {\n return next;\n }\n return next.slice(next.length - cfg.maxActiveBlasts);\n });\n\n const timeoutId = window.setTimeout(() => removeBlast(nextId), cfg.blastLifetimeMs);\n timeoutIdsRef.current.set(nextId, timeoutId);\n };\n\n const onClick = (event: MouseEvent) => {\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n return;\n }\n\n const cfg = configRef.current;\n const now = performance.now();\n\n let x: number;\n let y: number;\n\n if (containerRef?.current) {\n const rect = containerRef.current.getBoundingClientRect();\n x = event.clientX - rect.left;\n y = event.clientY - rect.top;\n } else {\n x = event.clientX;\n y = event.clientY;\n }\n\n // Prune clicks outside the time window\n recentClicksRef.current = recentClicksRef.current.filter(\n (click) => now - click.time < cfg.rageClickWindowMs,\n );\n\n recentClicksRef.current.push({ time: now, x, y });\n\n // Count how many recent clicks are within the radius of the current click\n const nearbyCount = recentClicksRef.current.filter((click) => {\n const dx = click.x - x;\n const dy = click.y - y;\n return Math.sqrt(dx * dx + dy * dy) <= cfg.rageClickRadiusPx;\n }).length;\n\n if (nearbyCount >= cfg.rageClickThreshold) {\n spawnBlast(x, y);\n }\n };\n\n const target = containerRef?.current ?? window;\n const timeoutIds = timeoutIdsRef.current;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- EventTarget union requires cast\n (target as EventTarget).addEventListener(\"click\", onClick as EventListener);\n return () => {\n (target as EventTarget).removeEventListener(\"click\", onClick as EventListener);\n for (const timeoutId of timeoutIds.values()) {\n window.clearTimeout(timeoutId);\n }\n timeoutIds.clear();\n };\n }, [containerRef]);\n\n if (!mounted) {\n return null;\n }\n\n const blastElements = (\n <>\n {blasts.map((blast) => (\n <div\n key={blast.id}\n style={{\n position: \"absolute\",\n left: blast.x,\n top: blast.y,\n width: blast.size,\n height: blast.size,\n transform: \"translate(-50%, -50%)\",\n willChange: \"transform, opacity\",\n filter: `hue-rotate(${blast.hue}deg)`,\n }}\n >\n <span className=\"cursor-blast-ring\" />\n <span className=\"cursor-blast-core\" />\n {Array.from({ length: 10 }).map((_, index) => {\n const angle = (360 / 10) * index;\n return (\n <span\n key={`${blast.id}-${index}`}\n className=\"cursor-blast-shard-wrap\"\n style={{\n transform: `translate(-50%, -50%) rotate(${angle}deg)`,\n animationDelay: `${index * 16}ms`,\n }}\n >\n <span className=\"cursor-blast-shard\" />\n </span>\n );\n })}\n </div>\n ))}\n <style dangerouslySetInnerHTML={{ __html: `\n .cursor-blast-ring {\n position: absolute;\n inset: 0;\n border-radius: 999px;\n border: 2px solid hsl(197 98% 67% / 0.9);\n box-shadow:\n 0 0 22px hsl(191 100% 72% / 0.6),\n inset 0 0 12px hsl(204 100% 77% / 0.65);\n animation: blast-ring 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n\n .cursor-blast-core {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 10px;\n height: 10px;\n border-radius: 999px;\n transform: translate(-50%, -50%);\n background: hsl(196 100% 85%);\n box-shadow:\n 0 0 26px hsl(193 100% 72% / 0.9),\n 0 0 10px hsl(201 100% 85% / 0.9);\n animation: blast-core 420ms ease-out forwards;\n }\n\n .cursor-blast-shard-wrap {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 0;\n height: 0;\n }\n\n .cursor-blast-shard {\n position: absolute;\n left: 0;\n top: -1.5px;\n width: 12px;\n height: 3px;\n border-radius: 999px;\n background: linear-gradient(90deg, hsl(190 100% 84%), hsl(197 98% 67%));\n box-shadow: 0 0 12px hsl(195 100% 70% / 0.8);\n animation: blast-shard 680ms cubic-bezier(0.22, 1, 0.36, 1) forwards;\n }\n\n @keyframes blast-ring {\n 0% {\n transform: scale(0.2);\n opacity: 0.95;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n }\n\n @keyframes blast-core {\n 0% {\n transform: translate(-50%, -50%) scale(0.5);\n opacity: 1;\n }\n 100% {\n transform: translate(-50%, -50%) scale(2.2);\n opacity: 0;\n }\n }\n\n @keyframes blast-shard {\n 0% {\n transform: translateX(0) scaleX(0.7);\n opacity: 1;\n }\n 100% {\n transform: translateX(46px) scaleX(1.1);\n opacity: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cursor-blast-ring,\n .cursor-blast-core,\n .cursor-blast-shard {\n animation-duration: 1ms;\n }\n }\n ` }} />\n </>\n );\n\n // When scoped to a container, render inline (the container must have position: relative)\n if (containerRef) {\n return (\n <div\n aria-hidden\n style={{\n position: \"absolute\",\n inset: 0,\n zIndex: 2147483647,\n pointerEvents: \"none\",\n overflow: \"hidden\",\n borderRadius: \"inherit\",\n }}\n >\n {blastElements}\n </div>\n );\n }\n\n // Default: portal to body with fixed positioning (original behaviour)\n return createPortal(\n <div\n aria-hidden\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 2147483647,\n pointerEvents: \"none\",\n }}\n >\n {blastElements}\n </div>,\n document.body,\n );\n}\n"],"mappings":";;;;;;;;;AAaA,MAAM,4BAA4B;AAClC,MAAM,4BAA4B;;AAGlC,MAAM,+BAA+B;;AAErC,MAAM,+BAA+B;;AAErC,MAAM,+BAA+B;AA2BrC,SAAgB,kBAAkB,EAChC,kBAAkB,2BAClB,kBAAkB,2BAClB,qBAAqB,8BACrB,oBAAoB,8BACpB,oBAAoB,8BACpB,iBAC0B,EAAE,EAAE;CAC9B,MAAM,CAAC,QAAQ,iCAA+B,EAAE,CAAC;CACjD,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAC7C,MAAM,iCAAsB,EAAE;CAC9B,MAAM,kDAA4C,IAAI,KAAK,CAAC;CAC5D,MAAM,oCAAwC,EAAE,CAAC;CAGjD,MAAM,8BAAmB;EACvB;EACA;EACA;EACA;EACA;EACD,CAAC;AACF,WAAU,UAAU;EAClB;EACA;EACA;EACA;EACA;EACD;AAED,4BAAgB;AACd,aAAW,KAAK;IACf,EAAE,CAAC;AAEN,4BAAgB;EACd,MAAM,eAAe,OAAe;AAClC,cAAW,SAAS,KAAK,QAAQ,UAAU,MAAM,OAAO,GAAG,CAAC;GAC5D,MAAM,YAAY,cAAc,QAAQ,IAAI,GAAG;AAC/C,OAAI,cAAc,QAAW;AAC3B,WAAO,aAAa,UAAU;AAC9B,kBAAc,QAAQ,OAAO,GAAG;;;EAIpC,MAAM,cAAc,GAAW,MAAc;GAC3C,MAAM,MAAM,UAAU;GACtB,MAAM,SAAS,aAAa;AAC5B,gBAAa,WAAW;GAExB,MAAM,YAAmB;IACvB,IAAI;IACJ;IACA;IACA,MAAM,KAAK,KAAK,QAAQ,GAAG;IAC3B,KAAK,MAAM,KAAK,QAAQ,GAAG;IAC5B;AAED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AM,gBACJ,qFACG,OAAO,KAAK,UACX,4CAAC;EAEC,OAAO;GACL,UAAU;GACV,MAAM,MAAM;GACZ,KAAK,MAAM;GACX,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,WAAW;GACX,YAAY;GACZ,QAAQ,cAAc,MAAM,IAAI;GACjC;;GAED,2CAAC,UAAK,WAAU,sBAAsB;GACtC,2CAAC,UAAK,WAAU,sBAAsB;GACrC,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAAU;AAE5C,WACE,2CAAC;KAEC,WAAU;KACV,OAAO;MACL,WAAW,gCANF,MAAM,KAAM,MAM4B;MACjD,gBAAgB,GAAG,QAAQ,GAAG;MAC/B;eAED,2CAAC,UAAK,WAAU,uBAAuB;OAPlC,GAAG,MAAM,GAAG,GAAG,QAQf;KAET;;IA5BG,MAAM,GA6BP,CACN,EACF,2CAAC,WAAM,yBAAyB,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAuFvC,GAAI,IACN;AAIL,KAAI,aACF,QACE,2CAAC;EACC;EACA,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,eAAe;GACf,UAAU;GACV,cAAc;GACf;YAEA;GACG;AAKV,oCACE,2CAAC;EACC;EACA,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,eAAe;GAChB;YAEA;GACG,EACN,SAAS,KACV"}
|
|
@@ -6814,263 +6814,12 @@ attempted value: ${formattedValue}
|
|
|
6814
6814
|
var allProviders = standardProviders;
|
|
6815
6815
|
|
|
6816
6816
|
// ../stack-shared/dist/esm/utils/country-codes.js
|
|
6817
|
-
var ISO_3166_ALPHA_2_COUNTRY_CODES = [
|
|
6818
|
-
"AD",
|
|
6819
|
-
"AE",
|
|
6820
|
-
"AF",
|
|
6821
|
-
"AG",
|
|
6822
|
-
"AI",
|
|
6823
|
-
"AL",
|
|
6824
|
-
"AM",
|
|
6825
|
-
"AO",
|
|
6826
|
-
"AQ",
|
|
6827
|
-
"AR",
|
|
6828
|
-
"AS",
|
|
6829
|
-
"AT",
|
|
6830
|
-
"AU",
|
|
6831
|
-
"AW",
|
|
6832
|
-
"AX",
|
|
6833
|
-
"AZ",
|
|
6834
|
-
"BA",
|
|
6835
|
-
"BB",
|
|
6836
|
-
"BD",
|
|
6837
|
-
"BE",
|
|
6838
|
-
"BF",
|
|
6839
|
-
"BG",
|
|
6840
|
-
"BH",
|
|
6841
|
-
"BI",
|
|
6842
|
-
"BJ",
|
|
6843
|
-
"BL",
|
|
6844
|
-
"BM",
|
|
6845
|
-
"BN",
|
|
6846
|
-
"BO",
|
|
6847
|
-
"BQ",
|
|
6848
|
-
"BR",
|
|
6849
|
-
"BS",
|
|
6850
|
-
"BT",
|
|
6851
|
-
"BV",
|
|
6852
|
-
"BW",
|
|
6853
|
-
"BY",
|
|
6854
|
-
"BZ",
|
|
6855
|
-
"CA",
|
|
6856
|
-
"CC",
|
|
6857
|
-
"CD",
|
|
6858
|
-
"CF",
|
|
6859
|
-
"CG",
|
|
6860
|
-
"CH",
|
|
6861
|
-
"CI",
|
|
6862
|
-
"CK",
|
|
6863
|
-
"CL",
|
|
6864
|
-
"CM",
|
|
6865
|
-
"CN",
|
|
6866
|
-
"CO",
|
|
6867
|
-
"CR",
|
|
6868
|
-
"CU",
|
|
6869
|
-
"CV",
|
|
6870
|
-
"CW",
|
|
6871
|
-
"CX",
|
|
6872
|
-
"CY",
|
|
6873
|
-
"CZ",
|
|
6874
|
-
"DE",
|
|
6875
|
-
"DJ",
|
|
6876
|
-
"DK",
|
|
6877
|
-
"DM",
|
|
6878
|
-
"DO",
|
|
6879
|
-
"DZ",
|
|
6880
|
-
"EC",
|
|
6881
|
-
"EE",
|
|
6882
|
-
"EG",
|
|
6883
|
-
"EH",
|
|
6884
|
-
"ER",
|
|
6885
|
-
"ES",
|
|
6886
|
-
"ET",
|
|
6887
|
-
"FI",
|
|
6888
|
-
"FJ",
|
|
6889
|
-
"FK",
|
|
6890
|
-
"FM",
|
|
6891
|
-
"FO",
|
|
6892
|
-
"FR",
|
|
6893
|
-
"GA",
|
|
6894
|
-
"GB",
|
|
6895
|
-
"GD",
|
|
6896
|
-
"GE",
|
|
6897
|
-
"GF",
|
|
6898
|
-
"GG",
|
|
6899
|
-
"GH",
|
|
6900
|
-
"GI",
|
|
6901
|
-
"GL",
|
|
6902
|
-
"GM",
|
|
6903
|
-
"GN",
|
|
6904
|
-
"GP",
|
|
6905
|
-
"GQ",
|
|
6906
|
-
"GR",
|
|
6907
|
-
"GS",
|
|
6908
|
-
"GT",
|
|
6909
|
-
"GU",
|
|
6910
|
-
"GW",
|
|
6911
|
-
"GY",
|
|
6912
|
-
"HK",
|
|
6913
|
-
"HM",
|
|
6914
|
-
"HN",
|
|
6915
|
-
"HR",
|
|
6916
|
-
"HT",
|
|
6917
|
-
"HU",
|
|
6918
|
-
"ID",
|
|
6919
|
-
"IE",
|
|
6920
|
-
"IL",
|
|
6921
|
-
"IM",
|
|
6922
|
-
"IN",
|
|
6923
|
-
"IO",
|
|
6924
|
-
"IQ",
|
|
6925
|
-
"IR",
|
|
6926
|
-
"IS",
|
|
6927
|
-
"IT",
|
|
6928
|
-
"JE",
|
|
6929
|
-
"JM",
|
|
6930
|
-
"JO",
|
|
6931
|
-
"JP",
|
|
6932
|
-
"KE",
|
|
6933
|
-
"KG",
|
|
6934
|
-
"KH",
|
|
6935
|
-
"KI",
|
|
6936
|
-
"KM",
|
|
6937
|
-
"KN",
|
|
6938
|
-
"KP",
|
|
6939
|
-
"KR",
|
|
6940
|
-
"KW",
|
|
6941
|
-
"KY",
|
|
6942
|
-
"KZ",
|
|
6943
|
-
"LA",
|
|
6944
|
-
"LB",
|
|
6945
|
-
"LC",
|
|
6946
|
-
"LI",
|
|
6947
|
-
"LK",
|
|
6948
|
-
"LR",
|
|
6949
|
-
"LS",
|
|
6950
|
-
"LT",
|
|
6951
|
-
"LU",
|
|
6952
|
-
"LV",
|
|
6953
|
-
"LY",
|
|
6954
|
-
"MA",
|
|
6955
|
-
"MC",
|
|
6956
|
-
"MD",
|
|
6957
|
-
"ME",
|
|
6958
|
-
"MF",
|
|
6959
|
-
"MG",
|
|
6960
|
-
"MH",
|
|
6961
|
-
"MK",
|
|
6962
|
-
"ML",
|
|
6963
|
-
"MM",
|
|
6964
|
-
"MN",
|
|
6965
|
-
"MO",
|
|
6966
|
-
"MP",
|
|
6967
|
-
"MQ",
|
|
6968
|
-
"MR",
|
|
6969
|
-
"MS",
|
|
6970
|
-
"MT",
|
|
6971
|
-
"MU",
|
|
6972
|
-
"MV",
|
|
6973
|
-
"MW",
|
|
6974
|
-
"MX",
|
|
6975
|
-
"MY",
|
|
6976
|
-
"MZ",
|
|
6977
|
-
"NA",
|
|
6978
|
-
"NC",
|
|
6979
|
-
"NE",
|
|
6980
|
-
"NF",
|
|
6981
|
-
"NG",
|
|
6982
|
-
"NI",
|
|
6983
|
-
"NL",
|
|
6984
|
-
"NO",
|
|
6985
|
-
"NP",
|
|
6986
|
-
"NR",
|
|
6987
|
-
"NU",
|
|
6988
|
-
"NZ",
|
|
6989
|
-
"OM",
|
|
6990
|
-
"PA",
|
|
6991
|
-
"PE",
|
|
6992
|
-
"PF",
|
|
6993
|
-
"PG",
|
|
6994
|
-
"PH",
|
|
6995
|
-
"PK",
|
|
6996
|
-
"PL",
|
|
6997
|
-
"PM",
|
|
6998
|
-
"PN",
|
|
6999
|
-
"PR",
|
|
7000
|
-
"PS",
|
|
7001
|
-
"PT",
|
|
7002
|
-
"PW",
|
|
7003
|
-
"PY",
|
|
7004
|
-
"QA",
|
|
7005
|
-
"RE",
|
|
7006
|
-
"RO",
|
|
7007
|
-
"RS",
|
|
7008
|
-
"RU",
|
|
7009
|
-
"RW",
|
|
7010
|
-
"SA",
|
|
7011
|
-
"SB",
|
|
7012
|
-
"SC",
|
|
7013
|
-
"SD",
|
|
7014
|
-
"SE",
|
|
7015
|
-
"SG",
|
|
7016
|
-
"SH",
|
|
7017
|
-
"SI",
|
|
7018
|
-
"SJ",
|
|
7019
|
-
"SK",
|
|
7020
|
-
"SL",
|
|
7021
|
-
"SM",
|
|
7022
|
-
"SN",
|
|
7023
|
-
"SO",
|
|
7024
|
-
"SR",
|
|
7025
|
-
"SS",
|
|
7026
|
-
"ST",
|
|
7027
|
-
"SV",
|
|
7028
|
-
"SX",
|
|
7029
|
-
"SY",
|
|
7030
|
-
"SZ",
|
|
7031
|
-
"TC",
|
|
7032
|
-
"TD",
|
|
7033
|
-
"TF",
|
|
7034
|
-
"TG",
|
|
7035
|
-
"TH",
|
|
7036
|
-
"TJ",
|
|
7037
|
-
"TK",
|
|
7038
|
-
"TL",
|
|
7039
|
-
"TM",
|
|
7040
|
-
"TN",
|
|
7041
|
-
"TO",
|
|
7042
|
-
"TR",
|
|
7043
|
-
"TT",
|
|
7044
|
-
"TV",
|
|
7045
|
-
"TW",
|
|
7046
|
-
"TZ",
|
|
7047
|
-
"UA",
|
|
7048
|
-
"UG",
|
|
7049
|
-
"UM",
|
|
7050
|
-
"US",
|
|
7051
|
-
"UY",
|
|
7052
|
-
"UZ",
|
|
7053
|
-
"VA",
|
|
7054
|
-
"VC",
|
|
7055
|
-
"VE",
|
|
7056
|
-
"VG",
|
|
7057
|
-
"VI",
|
|
7058
|
-
"VN",
|
|
7059
|
-
"VU",
|
|
7060
|
-
"WF",
|
|
7061
|
-
"WS",
|
|
7062
|
-
"YE",
|
|
7063
|
-
"YT",
|
|
7064
|
-
"ZA",
|
|
7065
|
-
"ZM",
|
|
7066
|
-
"ZW"
|
|
7067
|
-
];
|
|
7068
|
-
var validCountryCodeSet = new Set(ISO_3166_ALPHA_2_COUNTRY_CODES);
|
|
7069
6817
|
function normalizeCountryCode(countryCode) {
|
|
7070
6818
|
return countryCode.trim().toUpperCase();
|
|
7071
6819
|
}
|
|
7072
6820
|
function isValidCountryCode(countryCode) {
|
|
7073
|
-
|
|
6821
|
+
const normalized = normalizeCountryCode(countryCode);
|
|
6822
|
+
return /^[A-Z]{2}$/.test(normalized);
|
|
7074
6823
|
}
|
|
7075
6824
|
|
|
7076
6825
|
// ../stack-shared/dist/esm/utils/uuids.js
|
|
@@ -7330,7 +7079,7 @@ attempted value: ${formattedValue}
|
|
|
7330
7079
|
var passwordSchema = yupString().max(70);
|
|
7331
7080
|
var countryCodeSchema = yupString().transform((value) => typeof value === "string" ? normalizeCountryCode(value) : value).test({
|
|
7332
7081
|
name: "country-code",
|
|
7333
|
-
message: (params) => `${params.path} must be a
|
|
7082
|
+
message: (params) => `${params.path} must be a 2-letter country code`,
|
|
7334
7083
|
test: (value) => value == null || isValidCountryCode(value)
|
|
7335
7084
|
});
|
|
7336
7085
|
var intervalSchema = yupTuple([yupNumber().min(0).integer().defined(), yupString().oneOf([
|
|
@@ -12588,6 +12337,9 @@ ${error}`);
|
|
|
12588
12337
|
timeoutIdsRef.current.set(nextId, timeoutId);
|
|
12589
12338
|
};
|
|
12590
12339
|
const onClick = (event) => {
|
|
12340
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
12341
|
+
return;
|
|
12342
|
+
}
|
|
12591
12343
|
const cfg = configRef.current;
|
|
12592
12344
|
const now = performance.now();
|
|
12593
12345
|
let x;
|