@moontra/moonui-pro 3.3.28 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/index.css +1 -1
- package/dist/cdn/index.css.map +1 -1
- package/dist/cdn/index.global.js +218 -218
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.mjs +1096 -655
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -212,7 +212,7 @@ var require_core = __commonJS({
|
|
|
212
212
|
const pieces = name.split(".");
|
|
213
213
|
return [
|
|
214
214
|
`${prefix}${pieces.shift()}`,
|
|
215
|
-
...pieces.map((
|
|
215
|
+
...pieces.map((x2, i) => `${x2}${"_".repeat(i + 1)}`)
|
|
216
216
|
].join(" ");
|
|
217
217
|
}
|
|
218
218
|
return `${prefix}${name}`;
|
|
@@ -410,7 +410,7 @@ var require_core = __commonJS({
|
|
|
410
410
|
return concat2("(?:", re, ")?");
|
|
411
411
|
}
|
|
412
412
|
function concat2(...args) {
|
|
413
|
-
const joined = args.map((
|
|
413
|
+
const joined = args.map((x2) => source2(x2)).join("");
|
|
414
414
|
return joined;
|
|
415
415
|
}
|
|
416
416
|
function stripOptionsFromArgs2(args) {
|
|
@@ -424,7 +424,7 @@ var require_core = __commonJS({
|
|
|
424
424
|
}
|
|
425
425
|
function either2(...args) {
|
|
426
426
|
const opts = stripOptionsFromArgs2(args);
|
|
427
|
-
const joined = "(" + (opts.capture ? "" : "?:") + args.map((
|
|
427
|
+
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x2) => source2(x2)).join("|") + ")";
|
|
428
428
|
return joined;
|
|
429
429
|
}
|
|
430
430
|
function countMatchGroups(re) {
|
|
@@ -765,7 +765,7 @@ var require_core = __commonJS({
|
|
|
765
765
|
return compiledKeywords;
|
|
766
766
|
function compileList(scopeName2, keywordList) {
|
|
767
767
|
if (caseInsensitive) {
|
|
768
|
-
keywordList = keywordList.map((
|
|
768
|
+
keywordList = keywordList.map((x2) => x2.toLowerCase());
|
|
769
769
|
}
|
|
770
770
|
keywordList.forEach(function(keyword) {
|
|
771
771
|
const pair = keyword.split("|");
|
|
@@ -4626,7 +4626,7 @@ function Calendar({
|
|
|
4626
4626
|
)) }),
|
|
4627
4627
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
4628
4628
|
numberOfMonths > 1 && "flex flex-col sm:flex-row gap-2 sm:gap-4"
|
|
4629
|
-
), children: Array.from({ length: numberOfMonths }).map((
|
|
4629
|
+
), children: Array.from({ length: numberOfMonths }).map((_2, i) => /* @__PURE__ */ jsx("div", { className: "flex-1", children: renderCalendar(i) }, i)) })
|
|
4630
4630
|
] });
|
|
4631
4631
|
}
|
|
4632
4632
|
Calendar.displayName = "Calendar";
|
|
@@ -4825,9 +4825,9 @@ var MoonUICardPro = React71.forwardRef(
|
|
|
4825
4825
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
4826
4826
|
const centerX = rect.left + rect.width / 2;
|
|
4827
4827
|
const centerY = rect.top + rect.height / 2;
|
|
4828
|
-
const
|
|
4828
|
+
const x2 = (e.clientX - centerX) / (rect.width / 2);
|
|
4829
4829
|
const y = (e.clientY - centerY) / (rect.height / 2);
|
|
4830
|
-
setMousePos({ x, y });
|
|
4830
|
+
setMousePos({ x: x2, y });
|
|
4831
4831
|
};
|
|
4832
4832
|
const handleMouseEnter = () => setIsHovered(true);
|
|
4833
4833
|
const handleMouseLeave2 = () => {
|
|
@@ -9950,7 +9950,7 @@ var reducer = (state, action) => {
|
|
|
9950
9950
|
return {
|
|
9951
9951
|
...state,
|
|
9952
9952
|
toasts: state.toasts.map(
|
|
9953
|
-
(
|
|
9953
|
+
(t2) => t2.id === action.toast.id ? { ...t2, ...action.toast } : t2
|
|
9954
9954
|
)
|
|
9955
9955
|
};
|
|
9956
9956
|
case "DISMISS_TOAST": {
|
|
@@ -9965,10 +9965,10 @@ var reducer = (state, action) => {
|
|
|
9965
9965
|
return {
|
|
9966
9966
|
...state,
|
|
9967
9967
|
toasts: state.toasts.map(
|
|
9968
|
-
(
|
|
9969
|
-
...
|
|
9968
|
+
(t2) => t2.id === toastId || toastId === void 0 ? {
|
|
9969
|
+
...t2,
|
|
9970
9970
|
open: false
|
|
9971
|
-
} :
|
|
9971
|
+
} : t2
|
|
9972
9972
|
)
|
|
9973
9973
|
};
|
|
9974
9974
|
}
|
|
@@ -9981,7 +9981,7 @@ var reducer = (state, action) => {
|
|
|
9981
9981
|
}
|
|
9982
9982
|
return {
|
|
9983
9983
|
...state,
|
|
9984
|
-
toasts: state.toasts.filter((
|
|
9984
|
+
toasts: state.toasts.filter((t2) => t2.id !== action.toastId)
|
|
9985
9985
|
};
|
|
9986
9986
|
default:
|
|
9987
9987
|
return state;
|
|
@@ -10455,7 +10455,7 @@ function getPaddingObject(padding) {
|
|
|
10455
10455
|
}
|
|
10456
10456
|
function rectToClientRect(rect) {
|
|
10457
10457
|
const {
|
|
10458
|
-
x,
|
|
10458
|
+
x: x2,
|
|
10459
10459
|
y,
|
|
10460
10460
|
width,
|
|
10461
10461
|
height
|
|
@@ -10464,10 +10464,10 @@ function rectToClientRect(rect) {
|
|
|
10464
10464
|
width,
|
|
10465
10465
|
height,
|
|
10466
10466
|
top: y,
|
|
10467
|
-
left:
|
|
10468
|
-
right:
|
|
10467
|
+
left: x2,
|
|
10468
|
+
right: x2 + width,
|
|
10469
10469
|
bottom: y + height,
|
|
10470
|
-
x,
|
|
10470
|
+
x: x2,
|
|
10471
10471
|
y
|
|
10472
10472
|
};
|
|
10473
10473
|
}
|
|
@@ -10543,7 +10543,7 @@ var computePosition = async (reference, floating, config) => {
|
|
|
10543
10543
|
strategy
|
|
10544
10544
|
});
|
|
10545
10545
|
let {
|
|
10546
|
-
x,
|
|
10546
|
+
x: x2,
|
|
10547
10547
|
y
|
|
10548
10548
|
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
10549
10549
|
let statefulPlacement = placement;
|
|
@@ -10560,7 +10560,7 @@ var computePosition = async (reference, floating, config) => {
|
|
|
10560
10560
|
data,
|
|
10561
10561
|
reset: reset2
|
|
10562
10562
|
} = await fn({
|
|
10563
|
-
x,
|
|
10563
|
+
x: x2,
|
|
10564
10564
|
y,
|
|
10565
10565
|
initialPlacement: placement,
|
|
10566
10566
|
placement: statefulPlacement,
|
|
@@ -10573,7 +10573,7 @@ var computePosition = async (reference, floating, config) => {
|
|
|
10573
10573
|
floating
|
|
10574
10574
|
}
|
|
10575
10575
|
});
|
|
10576
|
-
|
|
10576
|
+
x2 = nextX != null ? nextX : x2;
|
|
10577
10577
|
y = nextY != null ? nextY : y;
|
|
10578
10578
|
middlewareData = {
|
|
10579
10579
|
...middlewareData,
|
|
@@ -10596,7 +10596,7 @@ var computePosition = async (reference, floating, config) => {
|
|
|
10596
10596
|
}) : reset2.rects;
|
|
10597
10597
|
}
|
|
10598
10598
|
({
|
|
10599
|
-
x,
|
|
10599
|
+
x: x2,
|
|
10600
10600
|
y
|
|
10601
10601
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
10602
10602
|
}
|
|
@@ -10604,7 +10604,7 @@ var computePosition = async (reference, floating, config) => {
|
|
|
10604
10604
|
}
|
|
10605
10605
|
}
|
|
10606
10606
|
return {
|
|
10607
|
-
x,
|
|
10607
|
+
x: x2,
|
|
10608
10608
|
y,
|
|
10609
10609
|
placement: statefulPlacement,
|
|
10610
10610
|
strategy,
|
|
@@ -10617,7 +10617,7 @@ async function detectOverflow(state, options) {
|
|
|
10617
10617
|
options = {};
|
|
10618
10618
|
}
|
|
10619
10619
|
const {
|
|
10620
|
-
x,
|
|
10620
|
+
x: x2,
|
|
10621
10621
|
y,
|
|
10622
10622
|
platform: platform2,
|
|
10623
10623
|
rects,
|
|
@@ -10641,7 +10641,7 @@ async function detectOverflow(state, options) {
|
|
|
10641
10641
|
strategy
|
|
10642
10642
|
}));
|
|
10643
10643
|
const rect = elementContext === "floating" ? {
|
|
10644
|
-
x,
|
|
10644
|
+
x: x2,
|
|
10645
10645
|
y,
|
|
10646
10646
|
width: rects.floating.width,
|
|
10647
10647
|
height: rects.floating.height
|
|
@@ -10672,7 +10672,7 @@ var arrow = (options) => ({
|
|
|
10672
10672
|
options,
|
|
10673
10673
|
async fn(state) {
|
|
10674
10674
|
const {
|
|
10675
|
-
x,
|
|
10675
|
+
x: x2,
|
|
10676
10676
|
y,
|
|
10677
10677
|
placement,
|
|
10678
10678
|
rects,
|
|
@@ -10689,7 +10689,7 @@ var arrow = (options) => ({
|
|
|
10689
10689
|
}
|
|
10690
10690
|
const paddingObject = getPaddingObject(padding);
|
|
10691
10691
|
const coords = {
|
|
10692
|
-
x,
|
|
10692
|
+
x: x2,
|
|
10693
10693
|
y
|
|
10694
10694
|
};
|
|
10695
10695
|
const axis = getAlignmentAxis(placement);
|
|
@@ -10946,7 +10946,7 @@ var offset = function(options) {
|
|
|
10946
10946
|
async fn(state) {
|
|
10947
10947
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
10948
10948
|
const {
|
|
10949
|
-
x,
|
|
10949
|
+
x: x2,
|
|
10950
10950
|
y,
|
|
10951
10951
|
placement,
|
|
10952
10952
|
middlewareData
|
|
@@ -10956,7 +10956,7 @@ var offset = function(options) {
|
|
|
10956
10956
|
return {};
|
|
10957
10957
|
}
|
|
10958
10958
|
return {
|
|
10959
|
-
x:
|
|
10959
|
+
x: x2 + diffCoords.x,
|
|
10960
10960
|
y: y + diffCoords.y,
|
|
10961
10961
|
data: {
|
|
10962
10962
|
...diffCoords,
|
|
@@ -10975,7 +10975,7 @@ var shift = function(options) {
|
|
|
10975
10975
|
options,
|
|
10976
10976
|
async fn(state) {
|
|
10977
10977
|
const {
|
|
10978
|
-
x,
|
|
10978
|
+
x: x2,
|
|
10979
10979
|
y,
|
|
10980
10980
|
placement
|
|
10981
10981
|
} = state;
|
|
@@ -10985,11 +10985,11 @@ var shift = function(options) {
|
|
|
10985
10985
|
limiter = {
|
|
10986
10986
|
fn: (_ref) => {
|
|
10987
10987
|
let {
|
|
10988
|
-
x:
|
|
10988
|
+
x: x3,
|
|
10989
10989
|
y: y2
|
|
10990
10990
|
} = _ref;
|
|
10991
10991
|
return {
|
|
10992
|
-
x:
|
|
10992
|
+
x: x3,
|
|
10993
10993
|
y: y2
|
|
10994
10994
|
};
|
|
10995
10995
|
}
|
|
@@ -10997,7 +10997,7 @@ var shift = function(options) {
|
|
|
10997
10997
|
...detectOverflowOptions
|
|
10998
10998
|
} = evaluate(options, state);
|
|
10999
10999
|
const coords = {
|
|
11000
|
-
x,
|
|
11000
|
+
x: x2,
|
|
11001
11001
|
y
|
|
11002
11002
|
};
|
|
11003
11003
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
@@ -11027,7 +11027,7 @@ var shift = function(options) {
|
|
|
11027
11027
|
return {
|
|
11028
11028
|
...limitedCoords,
|
|
11029
11029
|
data: {
|
|
11030
|
-
x: limitedCoords.x -
|
|
11030
|
+
x: limitedCoords.x - x2,
|
|
11031
11031
|
y: limitedCoords.y - y,
|
|
11032
11032
|
enabled: {
|
|
11033
11033
|
[mainAxis]: checkMainAxis,
|
|
@@ -11046,7 +11046,7 @@ var limitShift = function(options) {
|
|
|
11046
11046
|
options,
|
|
11047
11047
|
fn(state) {
|
|
11048
11048
|
const {
|
|
11049
|
-
x,
|
|
11049
|
+
x: x2,
|
|
11050
11050
|
y,
|
|
11051
11051
|
placement,
|
|
11052
11052
|
rects,
|
|
@@ -11058,7 +11058,7 @@ var limitShift = function(options) {
|
|
|
11058
11058
|
crossAxis: checkCrossAxis = true
|
|
11059
11059
|
} = evaluate(options, state);
|
|
11060
11060
|
const coords = {
|
|
11061
|
-
x,
|
|
11061
|
+
x: x2,
|
|
11062
11062
|
y
|
|
11063
11063
|
};
|
|
11064
11064
|
const crossAxis = getSideAxis(placement);
|
|
@@ -11369,16 +11369,16 @@ function getScale(element) {
|
|
|
11369
11369
|
height,
|
|
11370
11370
|
$
|
|
11371
11371
|
} = getCssDimensions(domElement);
|
|
11372
|
-
let
|
|
11372
|
+
let x2 = ($ ? round(rect.width) : rect.width) / width;
|
|
11373
11373
|
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
11374
|
-
if (!
|
|
11375
|
-
|
|
11374
|
+
if (!x2 || !Number.isFinite(x2)) {
|
|
11375
|
+
x2 = 1;
|
|
11376
11376
|
}
|
|
11377
11377
|
if (!y || !Number.isFinite(y)) {
|
|
11378
11378
|
y = 1;
|
|
11379
11379
|
}
|
|
11380
11380
|
return {
|
|
11381
|
-
x,
|
|
11381
|
+
x: x2,
|
|
11382
11382
|
y
|
|
11383
11383
|
};
|
|
11384
11384
|
}
|
|
@@ -11422,7 +11422,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
11422
11422
|
}
|
|
11423
11423
|
}
|
|
11424
11424
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
11425
|
-
let
|
|
11425
|
+
let x2 = (clientRect2.left + visualOffsets.x) / scale.x;
|
|
11426
11426
|
let y = (clientRect2.top + visualOffsets.y) / scale.y;
|
|
11427
11427
|
let width = clientRect2.width / scale.x;
|
|
11428
11428
|
let height = clientRect2.height / scale.y;
|
|
@@ -11437,11 +11437,11 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
11437
11437
|
const css2 = getComputedStyle2(currentIFrame);
|
|
11438
11438
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
|
|
11439
11439
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
|
|
11440
|
-
|
|
11440
|
+
x2 *= iframeScale.x;
|
|
11441
11441
|
y *= iframeScale.y;
|
|
11442
11442
|
width *= iframeScale.x;
|
|
11443
11443
|
height *= iframeScale.y;
|
|
11444
|
-
|
|
11444
|
+
x2 += left;
|
|
11445
11445
|
y += top;
|
|
11446
11446
|
currentWin = getWindow(currentIFrame);
|
|
11447
11447
|
currentIFrame = getFrameElement(currentWin);
|
|
@@ -11450,7 +11450,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
11450
11450
|
return rectToClientRect({
|
|
11451
11451
|
width,
|
|
11452
11452
|
height,
|
|
11453
|
-
x,
|
|
11453
|
+
x: x2,
|
|
11454
11454
|
y
|
|
11455
11455
|
});
|
|
11456
11456
|
}
|
|
@@ -11463,10 +11463,10 @@ function getWindowScrollBarX(element, rect) {
|
|
|
11463
11463
|
}
|
|
11464
11464
|
function getHTMLOffset(documentElement, scroll) {
|
|
11465
11465
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
11466
|
-
const
|
|
11466
|
+
const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
11467
11467
|
const y = htmlRect.top + scroll.scrollTop;
|
|
11468
11468
|
return {
|
|
11469
|
-
x,
|
|
11469
|
+
x: x2,
|
|
11470
11470
|
y
|
|
11471
11471
|
};
|
|
11472
11472
|
}
|
|
@@ -11518,15 +11518,15 @@ function getDocumentRect(element) {
|
|
|
11518
11518
|
const body = element.ownerDocument.body;
|
|
11519
11519
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
11520
11520
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
11521
|
-
let
|
|
11521
|
+
let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
11522
11522
|
const y = -scroll.scrollTop;
|
|
11523
11523
|
if (getComputedStyle2(body).direction === "rtl") {
|
|
11524
|
-
|
|
11524
|
+
x2 += max(html.clientWidth, body.clientWidth) - width;
|
|
11525
11525
|
}
|
|
11526
11526
|
return {
|
|
11527
11527
|
width,
|
|
11528
11528
|
height,
|
|
11529
|
-
x,
|
|
11529
|
+
x: x2,
|
|
11530
11530
|
y
|
|
11531
11531
|
};
|
|
11532
11532
|
}
|
|
@@ -11537,14 +11537,14 @@ function getViewportRect(element, strategy) {
|
|
|
11537
11537
|
const visualViewport = win.visualViewport;
|
|
11538
11538
|
let width = html.clientWidth;
|
|
11539
11539
|
let height = html.clientHeight;
|
|
11540
|
-
let
|
|
11540
|
+
let x2 = 0;
|
|
11541
11541
|
let y = 0;
|
|
11542
11542
|
if (visualViewport) {
|
|
11543
11543
|
width = visualViewport.width;
|
|
11544
11544
|
height = visualViewport.height;
|
|
11545
11545
|
const visualViewportBased = isWebKit();
|
|
11546
11546
|
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
11547
|
-
|
|
11547
|
+
x2 = visualViewport.offsetLeft;
|
|
11548
11548
|
y = visualViewport.offsetTop;
|
|
11549
11549
|
}
|
|
11550
11550
|
}
|
|
@@ -11564,7 +11564,7 @@ function getViewportRect(element, strategy) {
|
|
|
11564
11564
|
return {
|
|
11565
11565
|
width,
|
|
11566
11566
|
height,
|
|
11567
|
-
x,
|
|
11567
|
+
x: x2,
|
|
11568
11568
|
y
|
|
11569
11569
|
};
|
|
11570
11570
|
}
|
|
@@ -11576,12 +11576,12 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
11576
11576
|
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
11577
11577
|
const width = element.clientWidth * scale.x;
|
|
11578
11578
|
const height = element.clientHeight * scale.y;
|
|
11579
|
-
const
|
|
11579
|
+
const x2 = left * scale.x;
|
|
11580
11580
|
const y = top * scale.y;
|
|
11581
11581
|
return {
|
|
11582
11582
|
width,
|
|
11583
11583
|
height,
|
|
11584
|
-
x,
|
|
11584
|
+
x: x2,
|
|
11585
11585
|
y
|
|
11586
11586
|
};
|
|
11587
11587
|
}
|
|
@@ -11701,10 +11701,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
11701
11701
|
setLeftRTLScrollbarOffset();
|
|
11702
11702
|
}
|
|
11703
11703
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
11704
|
-
const
|
|
11704
|
+
const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
11705
11705
|
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
11706
11706
|
return {
|
|
11707
|
-
x,
|
|
11707
|
+
x: x2,
|
|
11708
11708
|
y,
|
|
11709
11709
|
width: rect.width,
|
|
11710
11710
|
height: rect.height
|
|
@@ -12144,12 +12144,12 @@ function useFloating(options) {
|
|
|
12144
12144
|
if (!elements.floating) {
|
|
12145
12145
|
return initialStyles;
|
|
12146
12146
|
}
|
|
12147
|
-
const
|
|
12147
|
+
const x2 = roundByDPR(elements.floating, data.x);
|
|
12148
12148
|
const y = roundByDPR(elements.floating, data.y);
|
|
12149
12149
|
if (transform) {
|
|
12150
12150
|
return {
|
|
12151
12151
|
...initialStyles,
|
|
12152
|
-
transform: "translate(" +
|
|
12152
|
+
transform: "translate(" + x2 + "px, " + y + "px)",
|
|
12153
12153
|
...getDPR(elements.floating) >= 1.5 && {
|
|
12154
12154
|
willChange: "transform"
|
|
12155
12155
|
}
|
|
@@ -12157,7 +12157,7 @@ function useFloating(options) {
|
|
|
12157
12157
|
}
|
|
12158
12158
|
return {
|
|
12159
12159
|
position: strategy,
|
|
12160
|
-
left:
|
|
12160
|
+
left: x2,
|
|
12161
12161
|
top: y
|
|
12162
12162
|
};
|
|
12163
12163
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
@@ -12531,22 +12531,22 @@ var transformOrigin = (options) => ({
|
|
|
12531
12531
|
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
12532
12532
|
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
12533
12533
|
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
12534
|
-
let
|
|
12534
|
+
let x2 = "";
|
|
12535
12535
|
let y = "";
|
|
12536
12536
|
if (placedSide === "bottom") {
|
|
12537
|
-
|
|
12537
|
+
x2 = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
12538
12538
|
y = `${-arrowHeight}px`;
|
|
12539
12539
|
} else if (placedSide === "top") {
|
|
12540
|
-
|
|
12540
|
+
x2 = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
12541
12541
|
y = `${rects.floating.height + arrowHeight}px`;
|
|
12542
12542
|
} else if (placedSide === "right") {
|
|
12543
|
-
|
|
12543
|
+
x2 = `${-arrowHeight}px`;
|
|
12544
12544
|
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
12545
12545
|
} else if (placedSide === "left") {
|
|
12546
|
-
|
|
12546
|
+
x2 = `${rects.floating.width + arrowHeight}px`;
|
|
12547
12547
|
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
12548
12548
|
}
|
|
12549
|
-
return { data: { x, y } };
|
|
12549
|
+
return { data: { x: x2, y } };
|
|
12550
12550
|
}
|
|
12551
12551
|
});
|
|
12552
12552
|
function getSideAndAlignFromPlacement(placement) {
|
|
@@ -14288,9 +14288,9 @@ var MoonUIGestureDrawerProComponent = React71__default.forwardRef(({
|
|
|
14288
14288
|
const isVertical = position === "bottom" || position === "top";
|
|
14289
14289
|
useAnimation();
|
|
14290
14290
|
useAnimation();
|
|
14291
|
-
const
|
|
14291
|
+
const x2 = useMotionValue(0);
|
|
14292
14292
|
const y = useMotionValue(0);
|
|
14293
|
-
const motionValue = isVertical ? y :
|
|
14293
|
+
const motionValue = isVertical ? y : x2;
|
|
14294
14294
|
const [currentSnapPoint, setCurrentSnapPoint] = useState(
|
|
14295
14295
|
defaultSnapPoint || (snapPoints.length > 0 ? snapPoints[0] : 50)
|
|
14296
14296
|
);
|
|
@@ -15137,9 +15137,9 @@ var MagneticButtonInternal = React71.forwardRef(
|
|
|
15137
15137
|
(e) => {
|
|
15138
15138
|
if (enableRipple && buttonRef.current) {
|
|
15139
15139
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
15140
|
-
const
|
|
15140
|
+
const x2 = e.clientX - rect.left;
|
|
15141
15141
|
const y = e.clientY - rect.top;
|
|
15142
|
-
const newRipple = { id: Date.now(), x, y };
|
|
15142
|
+
const newRipple = { id: Date.now(), x: x2, y };
|
|
15143
15143
|
setRipples((prevRipples) => [...prevRipples, newRipple]);
|
|
15144
15144
|
setTimeout(() => {
|
|
15145
15145
|
setRipples((prevRipples) => prevRipples.filter((r2) => r2.id !== newRipple.id));
|
|
@@ -15659,7 +15659,7 @@ var MoonUIMediaGalleryPro = React71.forwardRef(({
|
|
|
15659
15659
|
className
|
|
15660
15660
|
),
|
|
15661
15661
|
style: layout === "masonry" ? { columnGap: "1rem" } : void 0,
|
|
15662
|
-
children: loadingState ? /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: skeletonCount }).map((
|
|
15662
|
+
children: loadingState ? /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: skeletonCount }).map((_2, i) => /* @__PURE__ */ jsx(React71.Fragment, { children: renderSkeleton() }, i)) }) : sortedItems.length > 0 ? sortedItems.map((item, index2) => renderGalleryItem(item, index2)) : emptyState || /* @__PURE__ */ jsxs("div", { className: "col-span-full flex flex-col items-center justify-center py-12 text-center", children: [
|
|
15663
15663
|
/* @__PURE__ */ jsx(Image$1, { className: "h-12 w-12 text-muted-foreground mb-4" }),
|
|
15664
15664
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "No media items found" })
|
|
15665
15665
|
] })
|
|
@@ -16265,16 +16265,16 @@ var GlowCardInternal = forwardRef(
|
|
|
16265
16265
|
if (!cardRef.current)
|
|
16266
16266
|
return;
|
|
16267
16267
|
const rect = cardRef.current.getBoundingClientRect();
|
|
16268
|
-
const
|
|
16268
|
+
const x2 = e.clientX - rect.left;
|
|
16269
16269
|
const y = e.clientY - rect.top;
|
|
16270
16270
|
if (mouseTrack) {
|
|
16271
|
-
setMousePosition({ x, y });
|
|
16271
|
+
setMousePosition({ x: x2, y });
|
|
16272
16272
|
}
|
|
16273
16273
|
if (tilt && !disableAnimations) {
|
|
16274
16274
|
const centerX = rect.width / 2;
|
|
16275
16275
|
const centerY = rect.height / 2;
|
|
16276
16276
|
const rotateX = (y - centerY) / centerY * tiltAngle;
|
|
16277
|
-
const rotateY = (
|
|
16277
|
+
const rotateY = (x2 - centerX) / centerX * -tiltAngle;
|
|
16278
16278
|
setTiltStyle({
|
|
16279
16279
|
transform: `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale3d(1.02, 1.02, 1.02)`,
|
|
16280
16280
|
transformStyle: "preserve-3d"
|
|
@@ -16477,10 +16477,10 @@ var MoonUIAnimatedButtonProInternal = React71__default.forwardRef(
|
|
|
16477
16477
|
return;
|
|
16478
16478
|
if (ripple) {
|
|
16479
16479
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
16480
|
-
const
|
|
16480
|
+
const x2 = e.clientX - rect.left;
|
|
16481
16481
|
const y = e.clientY - rect.top;
|
|
16482
16482
|
const id = Date.now();
|
|
16483
|
-
setRipples([...ripples, { x, y, id }]);
|
|
16483
|
+
setRipples([...ripples, { x: x2, y, id }]);
|
|
16484
16484
|
setTimeout(() => {
|
|
16485
16485
|
setRipples((prev) => prev.filter((r2) => r2.id !== id));
|
|
16486
16486
|
}, 600);
|
|
@@ -17437,7 +17437,7 @@ var SplashCursorComponent = ({
|
|
|
17437
17437
|
const cleanupSplash = useCallback((splashId) => {
|
|
17438
17438
|
setSplashes((prev) => prev.filter((splash) => splash.id !== splashId));
|
|
17439
17439
|
}, []);
|
|
17440
|
-
const createSplash = useCallback((
|
|
17440
|
+
const createSplash = useCallback((x2, y) => {
|
|
17441
17441
|
const now = Date.now();
|
|
17442
17442
|
if (now - lastSplashTimeRef.current < 16) {
|
|
17443
17443
|
return;
|
|
@@ -17445,7 +17445,7 @@ var SplashCursorComponent = ({
|
|
|
17445
17445
|
lastSplashTimeRef.current = now;
|
|
17446
17446
|
const newSplash = {
|
|
17447
17447
|
id: now + Math.random(),
|
|
17448
|
-
x,
|
|
17448
|
+
x: x2,
|
|
17449
17449
|
y,
|
|
17450
17450
|
timestamp: now
|
|
17451
17451
|
};
|
|
@@ -17474,13 +17474,13 @@ var SplashCursorComponent = ({
|
|
|
17474
17474
|
return;
|
|
17475
17475
|
rafIdRef.current = requestAnimationFrame(() => {
|
|
17476
17476
|
const container = containerRef?.current;
|
|
17477
|
-
let
|
|
17477
|
+
let x2 = e.clientX;
|
|
17478
17478
|
let y = e.clientY;
|
|
17479
17479
|
if (container) {
|
|
17480
17480
|
const rect = container.getBoundingClientRect();
|
|
17481
|
-
|
|
17481
|
+
x2 = e.clientX - rect.left;
|
|
17482
17482
|
y = e.clientY - rect.top;
|
|
17483
|
-
if (
|
|
17483
|
+
if (x2 < 0 || y < 0 || x2 > rect.width || y > rect.height) {
|
|
17484
17484
|
rafIdRef.current = null;
|
|
17485
17485
|
return;
|
|
17486
17486
|
}
|
|
@@ -17491,7 +17491,7 @@ var SplashCursorComponent = ({
|
|
|
17491
17491
|
const distance = calculateDistance(
|
|
17492
17492
|
lastPosRef.current.x,
|
|
17493
17493
|
lastPosRef.current.y,
|
|
17494
|
-
|
|
17494
|
+
x2,
|
|
17495
17495
|
y
|
|
17496
17496
|
);
|
|
17497
17497
|
const speed = distance / timeDiff;
|
|
@@ -17499,37 +17499,37 @@ var SplashCursorComponent = ({
|
|
|
17499
17499
|
if (targetSelector) {
|
|
17500
17500
|
const target = e.target;
|
|
17501
17501
|
if (target?.closest(targetSelector)) {
|
|
17502
|
-
createSplash(
|
|
17502
|
+
createSplash(x2, y);
|
|
17503
17503
|
}
|
|
17504
17504
|
} else {
|
|
17505
|
-
createSplash(
|
|
17505
|
+
createSplash(x2, y);
|
|
17506
17506
|
}
|
|
17507
17507
|
}
|
|
17508
17508
|
}
|
|
17509
|
-
lastPosRef.current = { x, y };
|
|
17509
|
+
lastPosRef.current = { x: x2, y };
|
|
17510
17510
|
lastMoveTimeRef.current = now;
|
|
17511
17511
|
rafIdRef.current = null;
|
|
17512
17512
|
});
|
|
17513
17513
|
}, [threshold, targetSelector, createSplash, containerRef]);
|
|
17514
17514
|
const handleClick2 = useCallback((e) => {
|
|
17515
17515
|
const container = containerRef?.current;
|
|
17516
|
-
let
|
|
17516
|
+
let x2 = e.clientX;
|
|
17517
17517
|
let y = e.clientY;
|
|
17518
17518
|
if (container) {
|
|
17519
17519
|
const rect = container.getBoundingClientRect();
|
|
17520
|
-
|
|
17520
|
+
x2 = e.clientX - rect.left;
|
|
17521
17521
|
y = e.clientY - rect.top;
|
|
17522
|
-
if (
|
|
17522
|
+
if (x2 < 0 || y < 0 || x2 > rect.width || y > rect.height) {
|
|
17523
17523
|
return;
|
|
17524
17524
|
}
|
|
17525
17525
|
}
|
|
17526
17526
|
if (targetSelector) {
|
|
17527
17527
|
const target = e.target;
|
|
17528
17528
|
if (target?.closest(targetSelector)) {
|
|
17529
|
-
createSplash(
|
|
17529
|
+
createSplash(x2, y);
|
|
17530
17530
|
}
|
|
17531
17531
|
} else {
|
|
17532
|
-
createSplash(
|
|
17532
|
+
createSplash(x2, y);
|
|
17533
17533
|
}
|
|
17534
17534
|
}, [targetSelector, createSplash, containerRef]);
|
|
17535
17535
|
useEffect(() => {
|
|
@@ -17588,7 +17588,7 @@ var SplashCursorComponent = ({
|
|
|
17588
17588
|
const particleAngles = useMemo(() => {
|
|
17589
17589
|
if (!showParticles)
|
|
17590
17590
|
return [];
|
|
17591
|
-
return Array.from({ length: particleCount }).map((
|
|
17591
|
+
return Array.from({ length: particleCount }).map((_2, i) => {
|
|
17592
17592
|
const angle = 360 / particleCount * i;
|
|
17593
17593
|
const radian = angle * Math.PI / 180;
|
|
17594
17594
|
return {
|
|
@@ -17815,7 +17815,7 @@ var MarqueeInternal = ({
|
|
|
17815
17815
|
!isPlaying && "animation-paused",
|
|
17816
17816
|
className
|
|
17817
17817
|
),
|
|
17818
|
-
children: Array.from({ length: repeatCount }).map((
|
|
17818
|
+
children: Array.from({ length: repeatCount }).map((_2, i) => /* @__PURE__ */ jsx(
|
|
17819
17819
|
"div",
|
|
17820
17820
|
{
|
|
17821
17821
|
ref: i === 0 ? marqueeRef : void 0,
|
|
@@ -18344,9 +18344,9 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18344
18344
|
const [isFocused, setIsFocused] = useState(false);
|
|
18345
18345
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
|
|
18346
18346
|
const rotation = mergedProps.maxRotation || rotationIntensity || 15;
|
|
18347
|
-
const
|
|
18347
|
+
const x2 = useMotionValue(0);
|
|
18348
18348
|
const y = useMotionValue(0);
|
|
18349
|
-
const springX = useSpring(
|
|
18349
|
+
const springX = useSpring(x2, {
|
|
18350
18350
|
...mergedProps.springConfig,
|
|
18351
18351
|
stiffness: mergedProps.springConfig.stiffness * animationSpeed,
|
|
18352
18352
|
damping: mergedProps.springConfig.damping / animationSpeed
|
|
@@ -18384,7 +18384,7 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18384
18384
|
}
|
|
18385
18385
|
const rotateXValue = (clientY - centerY) / (rect.height / 2);
|
|
18386
18386
|
const rotateYValue = (clientX - centerX) / (rect.width / 2);
|
|
18387
|
-
|
|
18387
|
+
x2.set(rotateYValue);
|
|
18388
18388
|
y.set(rotateXValue);
|
|
18389
18389
|
if (mergedProps.enableShine) {
|
|
18390
18390
|
const normalizedX = (clientX - rect.left) / rect.width;
|
|
@@ -18394,22 +18394,22 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18394
18394
|
if (onRotationChange) {
|
|
18395
18395
|
onRotationChange(rotateX.get(), rotateY.get());
|
|
18396
18396
|
}
|
|
18397
|
-
}, [enableTouch,
|
|
18397
|
+
}, [enableTouch, x2, y, rotateX, rotateY, onRotationChange, mergedProps.enableShine]);
|
|
18398
18398
|
const handleMouseEnter = useCallback(() => {
|
|
18399
18399
|
setIsHovered(true);
|
|
18400
18400
|
onHoverStart?.();
|
|
18401
18401
|
}, [onHoverStart]);
|
|
18402
18402
|
const handleMouseLeave2 = useCallback(() => {
|
|
18403
18403
|
setIsHovered(false);
|
|
18404
|
-
|
|
18404
|
+
x2.set(0);
|
|
18405
18405
|
y.set(0);
|
|
18406
18406
|
onHoverEnd?.();
|
|
18407
|
-
}, [
|
|
18407
|
+
}, [x2, y, onHoverEnd]);
|
|
18408
18408
|
const handleKeyDown3 = useCallback((e) => {
|
|
18409
18409
|
if (!enableKeyboard || !isFocused)
|
|
18410
18410
|
return;
|
|
18411
18411
|
const step = 0.1;
|
|
18412
|
-
let newX =
|
|
18412
|
+
let newX = x2.get();
|
|
18413
18413
|
let newY = y.get();
|
|
18414
18414
|
switch (e.key) {
|
|
18415
18415
|
case "ArrowUp":
|
|
@@ -18424,12 +18424,12 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18424
18424
|
break;
|
|
18425
18425
|
case "ArrowLeft":
|
|
18426
18426
|
newX = Math.max(-0.5, newX - step);
|
|
18427
|
-
|
|
18427
|
+
x2.set(newX);
|
|
18428
18428
|
e.preventDefault();
|
|
18429
18429
|
break;
|
|
18430
18430
|
case "ArrowRight":
|
|
18431
18431
|
newX = Math.min(0.5, newX + step);
|
|
18432
|
-
|
|
18432
|
+
x2.set(newX);
|
|
18433
18433
|
e.preventDefault();
|
|
18434
18434
|
break;
|
|
18435
18435
|
case "Enter":
|
|
@@ -18443,7 +18443,7 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18443
18443
|
e.preventDefault();
|
|
18444
18444
|
break;
|
|
18445
18445
|
case "Escape":
|
|
18446
|
-
|
|
18446
|
+
x2.set(0);
|
|
18447
18447
|
y.set(0);
|
|
18448
18448
|
setIsHovered(false);
|
|
18449
18449
|
onHoverEnd?.();
|
|
@@ -18453,7 +18453,7 @@ var HoverCard3DInternal = React71__default.forwardRef(
|
|
|
18453
18453
|
if (onRotationChange) {
|
|
18454
18454
|
onRotationChange(rotateX.get(), rotateY.get());
|
|
18455
18455
|
}
|
|
18456
|
-
}, [enableKeyboard, isFocused,
|
|
18456
|
+
}, [enableKeyboard, isFocused, x2, y, isHovered, onHoverStart, onHoverEnd, rotateX, rotateY, onRotationChange]);
|
|
18457
18457
|
useEffect(() => {
|
|
18458
18458
|
if (autoFocus && cardRef.current) {
|
|
18459
18459
|
cardRef.current.focus();
|
|
@@ -18708,7 +18708,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18708
18708
|
const [isHovered, setIsHovered] = useState(false);
|
|
18709
18709
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
18710
18710
|
const scale = useMotionValue(initialZoom);
|
|
18711
|
-
const
|
|
18711
|
+
const x2 = useMotionValue(0);
|
|
18712
18712
|
const y = useMotionValue(0);
|
|
18713
18713
|
const constrainedScale = useTransform(scale, (value) => {
|
|
18714
18714
|
return Math.min(Math.max(value, minZoom), maxZoom);
|
|
@@ -18760,15 +18760,15 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18760
18760
|
const centerX = (event.clientX - rect.left) / rect.width - 0.5;
|
|
18761
18761
|
const centerY = (event.clientY - rect.top) / rect.height - 0.5;
|
|
18762
18762
|
const scaleDiff = newScale - currentScale;
|
|
18763
|
-
const currentX =
|
|
18763
|
+
const currentX = x2.get();
|
|
18764
18764
|
const currentY = y.get();
|
|
18765
18765
|
const newX = currentX - centerX * rect.width * scaleDiff;
|
|
18766
18766
|
const newY = currentY - centerY * rect.height * scaleDiff;
|
|
18767
18767
|
if (smoothZoom) {
|
|
18768
|
-
animate(
|
|
18768
|
+
animate(x2, newX, { duration: 0.2 });
|
|
18769
18769
|
animate(y, newY, { duration: 0.2 });
|
|
18770
18770
|
} else {
|
|
18771
|
-
|
|
18771
|
+
x2.set(newX);
|
|
18772
18772
|
y.set(newY);
|
|
18773
18773
|
}
|
|
18774
18774
|
}
|
|
@@ -18782,7 +18782,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18782
18782
|
setShowZoomIndicator(true);
|
|
18783
18783
|
setTimeout(() => setShowZoomIndicator(false), 1500);
|
|
18784
18784
|
}
|
|
18785
|
-
}, [scale,
|
|
18785
|
+
}, [scale, x2, y, minZoom, maxZoom, onZoomChange, wheelScaling, smoothZoom, showIndicator]);
|
|
18786
18786
|
const handleDoubleClick2 = useCallback((event) => {
|
|
18787
18787
|
event.preventDefault();
|
|
18788
18788
|
const currentScale = scale.get();
|
|
@@ -18797,7 +18797,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18797
18797
|
const centerY = (event.clientY - rect.top) / rect.height - 0.5;
|
|
18798
18798
|
const targetX = -centerX * rect.width * (newScale - 1);
|
|
18799
18799
|
const targetY = -centerY * rect.height * (newScale - 1);
|
|
18800
|
-
animate(
|
|
18800
|
+
animate(x2, targetX, {
|
|
18801
18801
|
duration: 0.3,
|
|
18802
18802
|
type: "spring",
|
|
18803
18803
|
stiffness: 300
|
|
@@ -18815,7 +18815,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18815
18815
|
stiffness: 300
|
|
18816
18816
|
});
|
|
18817
18817
|
if (newScale === 1 || doubleTapBehavior === "reset") {
|
|
18818
|
-
animate(
|
|
18818
|
+
animate(x2, 0, { duration: 0.3 });
|
|
18819
18819
|
animate(y, 0, { duration: 0.3 });
|
|
18820
18820
|
}
|
|
18821
18821
|
onZoomChange?.(newScale);
|
|
@@ -18823,7 +18823,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18823
18823
|
setShowZoomIndicator(true);
|
|
18824
18824
|
setTimeout(() => setShowZoomIndicator(false), 1500);
|
|
18825
18825
|
}
|
|
18826
|
-
}, [scale,
|
|
18826
|
+
}, [scale, x2, y, minZoom, maxZoom, initialZoom, onZoomChange, doubleTapBehavior, showIndicator]);
|
|
18827
18827
|
const handleTouchEnd = useCallback((event) => {
|
|
18828
18828
|
const now = Date.now();
|
|
18829
18829
|
const timeSinceLastTap = now - lastTap;
|
|
@@ -18845,7 +18845,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18845
18845
|
type: "spring",
|
|
18846
18846
|
stiffness: 300
|
|
18847
18847
|
});
|
|
18848
|
-
animate(
|
|
18848
|
+
animate(x2, 0, {
|
|
18849
18849
|
duration: 0.3,
|
|
18850
18850
|
type: "spring",
|
|
18851
18851
|
stiffness: 300
|
|
@@ -18856,7 +18856,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18856
18856
|
stiffness: 300
|
|
18857
18857
|
});
|
|
18858
18858
|
onZoomChange?.(initialZoom);
|
|
18859
|
-
}, [scale,
|
|
18859
|
+
}, [scale, x2, y, initialZoom, onZoomChange]);
|
|
18860
18860
|
const zoomIn = useCallback(() => {
|
|
18861
18861
|
const currentScale = scale.get();
|
|
18862
18862
|
const newScale = Math.min(currentScale + zoomStep, maxZoom);
|
|
@@ -18881,10 +18881,10 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18881
18881
|
});
|
|
18882
18882
|
if (newScale < scale.get()) {
|
|
18883
18883
|
const constraints = calculateConstraints();
|
|
18884
|
-
const currentX =
|
|
18884
|
+
const currentX = x2.get();
|
|
18885
18885
|
const currentY = y.get();
|
|
18886
18886
|
if (currentX < constraints.left || currentX > constraints.right) {
|
|
18887
|
-
animate(
|
|
18887
|
+
animate(x2, 0, { duration: 0.3 });
|
|
18888
18888
|
}
|
|
18889
18889
|
if (currentY < constraints.top || currentY > constraints.bottom) {
|
|
18890
18890
|
animate(y, 0, { duration: 0.3 });
|
|
@@ -18895,7 +18895,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18895
18895
|
setShowZoomIndicator(true);
|
|
18896
18896
|
setTimeout(() => setShowZoomIndicator(false), 1500);
|
|
18897
18897
|
}
|
|
18898
|
-
}, [scale, minZoom, zoomStep,
|
|
18898
|
+
}, [scale, minZoom, zoomStep, x2, y, calculateConstraints, onZoomChange, showIndicator]);
|
|
18899
18899
|
useCallback(() => {
|
|
18900
18900
|
resetZoom();
|
|
18901
18901
|
}, [resetZoom]);
|
|
@@ -18957,11 +18957,11 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18957
18957
|
useEffect(() => {
|
|
18958
18958
|
const unsubscribe = scale.onChange(() => {
|
|
18959
18959
|
const constraints = calculateConstraints();
|
|
18960
|
-
const currentX =
|
|
18960
|
+
const currentX = x2.get();
|
|
18961
18961
|
const currentY = y.get();
|
|
18962
18962
|
if (boundaryConstraints) {
|
|
18963
18963
|
if (currentX < constraints.left || currentX > constraints.right) {
|
|
18964
|
-
animate(
|
|
18964
|
+
animate(x2, Math.max(constraints.left, Math.min(constraints.right, currentX)), { duration: 0.2 });
|
|
18965
18965
|
}
|
|
18966
18966
|
if (currentY < constraints.top || currentY > constraints.bottom) {
|
|
18967
18967
|
animate(y, Math.max(constraints.top, Math.min(constraints.bottom, currentY)), { duration: 0.2 });
|
|
@@ -18969,7 +18969,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18969
18969
|
}
|
|
18970
18970
|
});
|
|
18971
18971
|
return unsubscribe;
|
|
18972
|
-
}, [scale,
|
|
18972
|
+
}, [scale, x2, y, calculateConstraints, boundaryConstraints]);
|
|
18973
18973
|
return /* @__PURE__ */ jsxs(
|
|
18974
18974
|
"div",
|
|
18975
18975
|
{
|
|
@@ -18999,7 +18999,7 @@ var PinchZoomInternal = React71__default.forwardRef(
|
|
|
18999
18999
|
onDragEnd: () => setIsDragging(false),
|
|
19000
19000
|
style: {
|
|
19001
19001
|
scale: constrainedScale,
|
|
19002
|
-
x,
|
|
19002
|
+
x: x2,
|
|
19003
19003
|
y
|
|
19004
19004
|
},
|
|
19005
19005
|
className: cn(
|
|
@@ -19240,7 +19240,7 @@ function EventDialog({
|
|
|
19240
19240
|
}
|
|
19241
19241
|
};
|
|
19242
19242
|
const handleTypeChange = (type) => {
|
|
19243
|
-
const selectedType = EVENT_TYPES.find((
|
|
19243
|
+
const selectedType = EVENT_TYPES.find((t2) => t2.value === type);
|
|
19244
19244
|
setFormData((prev) => ({
|
|
19245
19245
|
...prev,
|
|
19246
19246
|
type,
|
|
@@ -19754,7 +19754,7 @@ function CalendarInternal({
|
|
|
19754
19754
|
return dayOfWeek !== 0 && dayOfWeek !== 6;
|
|
19755
19755
|
});
|
|
19756
19756
|
const orderedDaysOfWeek = [...DAYS_OF_WEEK.slice(firstDayOfWeek), ...DAYS_OF_WEEK.slice(0, firstDayOfWeek)];
|
|
19757
|
-
const visibleDaysOfWeek = showWeekends ? orderedDaysOfWeek : orderedDaysOfWeek.filter((
|
|
19757
|
+
const visibleDaysOfWeek = showWeekends ? orderedDaysOfWeek : orderedDaysOfWeek.filter((_2, index2) => {
|
|
19758
19758
|
const actualDay = (index2 + firstDayOfWeek) % 7;
|
|
19759
19759
|
return actualDay !== 0 && actualDay !== 6;
|
|
19760
19760
|
});
|
|
@@ -19796,7 +19796,7 @@ function CalendarInternal({
|
|
|
19796
19796
|
] }),
|
|
19797
19797
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-1 text-xs", children: [
|
|
19798
19798
|
["S", "M", "T", "W", "T", "F", "S"].map((day, index2) => /* @__PURE__ */ jsx("div", { className: "text-center text-muted-foreground", children: day }, `mini-day-${index2}`)),
|
|
19799
|
-
Array.from({ length: 35 }, (
|
|
19799
|
+
Array.from({ length: 35 }, (_2, i) => {
|
|
19800
19800
|
const date = new Date(miniCalendarDate.getFullYear(), miniCalendarDate.getMonth(), i - new Date(miniCalendarDate.getFullYear(), miniCalendarDate.getMonth(), 1).getDay() + 1);
|
|
19801
19801
|
const isCurrentMonth2 = date.getMonth() === miniCalendarDate.getMonth();
|
|
19802
19802
|
const isToday3 = date.toDateString() === today.toDateString();
|
|
@@ -20041,7 +20041,7 @@ function CalendarInternal({
|
|
|
20041
20041
|
view === "week" && /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col space-y-4", children: [
|
|
20042
20042
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8 gap-2", children: [
|
|
20043
20043
|
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-muted-foreground", children: "Time" }),
|
|
20044
|
-
Array.from({ length: 7 }, (
|
|
20044
|
+
Array.from({ length: 7 }, (_2, i) => {
|
|
20045
20045
|
const date = new Date(currentDate);
|
|
20046
20046
|
date.setDate(date.getDate() - date.getDay() + i);
|
|
20047
20047
|
return /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
@@ -20053,9 +20053,9 @@ function CalendarInternal({
|
|
|
20053
20053
|
] }, i);
|
|
20054
20054
|
})
|
|
20055
20055
|
] }),
|
|
20056
|
-
/* @__PURE__ */ jsx("div", { className: "border rounded-lg overflow-hidden flex-1 flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: Array.from({ length: 24 }, (
|
|
20056
|
+
/* @__PURE__ */ jsx("div", { className: "border rounded-lg overflow-hidden flex-1 flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: Array.from({ length: 24 }, (_2, hour) => /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-8 border-b last:border-b-0", children: [
|
|
20057
20057
|
/* @__PURE__ */ jsx("div", { className: "p-2 text-xs text-muted-foreground border-r", children: formatTime2(`${hour.toString().padStart(2, "0")}:00`) }),
|
|
20058
|
-
Array.from({ length: 7 }, (
|
|
20058
|
+
Array.from({ length: 7 }, (_3, dayIndex) => {
|
|
20059
20059
|
const date = new Date(currentDate);
|
|
20060
20060
|
date.setDate(date.getDate() - date.getDay() + dayIndex);
|
|
20061
20061
|
const hourEvents = getEventsForDate(date).filter((event) => {
|
|
@@ -20100,7 +20100,7 @@ function CalendarInternal({
|
|
|
20100
20100
|
month: "long",
|
|
20101
20101
|
day: "numeric"
|
|
20102
20102
|
}) }) }),
|
|
20103
|
-
/* @__PURE__ */ jsx("div", { className: "border rounded-lg overflow-hidden flex-1 flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: Array.from({ length: 24 }, (
|
|
20103
|
+
/* @__PURE__ */ jsx("div", { className: "border rounded-lg overflow-hidden flex-1 flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: Array.from({ length: 24 }, (_2, hour) => {
|
|
20104
20104
|
const hourEvents = getEventsForDate(currentDate).filter((event) => {
|
|
20105
20105
|
if (!event.startTime)
|
|
20106
20106
|
return false;
|
|
@@ -20163,7 +20163,7 @@ function CalendarInternal({
|
|
|
20163
20163
|
] }, hour);
|
|
20164
20164
|
}) }) })
|
|
20165
20165
|
] }),
|
|
20166
|
-
view === "agenda" && /* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col space-y-4", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto space-y-4", children: Array.from({ length: 30 }, (
|
|
20166
|
+
view === "agenda" && /* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col space-y-4", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto space-y-4", children: Array.from({ length: 30 }, (_2, i) => {
|
|
20167
20167
|
const date = new Date(currentDate);
|
|
20168
20168
|
date.setDate(date.getDate() + i);
|
|
20169
20169
|
const dayEvents = getEventsForDate(date);
|
|
@@ -21045,7 +21045,7 @@ function AddCardModal({
|
|
|
21045
21045
|
setTagInput("");
|
|
21046
21046
|
}
|
|
21047
21047
|
};
|
|
21048
|
-
[...CARD_TEMPLATES.map((
|
|
21048
|
+
[...CARD_TEMPLATES.map((t2) => ({ ...t2.template, name: t2.name, icon: t2.icon })), ...templates];
|
|
21049
21049
|
return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-2xl", children: [
|
|
21050
21050
|
/* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { children: [
|
|
21051
21051
|
"Add Card to ",
|
|
@@ -21264,7 +21264,7 @@ function AddCardModal({
|
|
|
21264
21264
|
{
|
|
21265
21265
|
variant: "secondary",
|
|
21266
21266
|
className: "cursor-pointer",
|
|
21267
|
-
onClick: () => setTags(tags.filter((
|
|
21267
|
+
onClick: () => setTags(tags.filter((t2) => t2 !== tag)),
|
|
21268
21268
|
children: [
|
|
21269
21269
|
tag,
|
|
21270
21270
|
/* @__PURE__ */ jsx("span", { className: "ml-1 hover:text-destructive", children: "\xD7" })
|
|
@@ -21522,7 +21522,7 @@ var KanbanCardComponent = ({
|
|
|
21522
21522
|
"dark:shadow-[2px_0_10px_rgba(139,92,246,0.3)]"
|
|
21523
21523
|
),
|
|
21524
21524
|
onPointerDown: (e) => dragControls.start(e),
|
|
21525
|
-
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-1/2 -translate-x-1/2 flex flex-col justify-center gap-1 opacity-60", children: [...Array(3)].map((
|
|
21525
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-1/2 -translate-x-1/2 flex flex-col justify-center gap-1 opacity-60", children: [...Array(3)].map((_2, i) => /* @__PURE__ */ jsx("div", { className: "w-0.5 h-0.5 rounded-full bg-primary" }, i)) })
|
|
21526
21526
|
}
|
|
21527
21527
|
),
|
|
21528
21528
|
cardShowCoverImage && card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
|
|
@@ -21857,10 +21857,10 @@ function KanbanInternal({
|
|
|
21857
21857
|
if (!container)
|
|
21858
21858
|
return;
|
|
21859
21859
|
const rect = container.getBoundingClientRect();
|
|
21860
|
-
const
|
|
21861
|
-
if (
|
|
21860
|
+
const x2 = e.clientX;
|
|
21861
|
+
if (x2 < rect.left + 100) {
|
|
21862
21862
|
startAutoScroll("left");
|
|
21863
|
-
} else if (
|
|
21863
|
+
} else if (x2 > rect.right - 100) {
|
|
21864
21864
|
startAutoScroll("right");
|
|
21865
21865
|
} else {
|
|
21866
21866
|
stopAutoScroll();
|
|
@@ -23310,7 +23310,7 @@ var Mark = class {
|
|
|
23310
23310
|
*/
|
|
23311
23311
|
toJSON() {
|
|
23312
23312
|
let obj = { type: this.type.name };
|
|
23313
|
-
for (let
|
|
23313
|
+
for (let _2 in this.attrs) {
|
|
23314
23314
|
obj.attrs = this.attrs;
|
|
23315
23315
|
break;
|
|
23316
23316
|
}
|
|
@@ -24258,7 +24258,7 @@ var Node2 = class {
|
|
|
24258
24258
|
*/
|
|
24259
24259
|
toJSON() {
|
|
24260
24260
|
let obj = { type: this.type.name };
|
|
24261
|
-
for (let
|
|
24261
|
+
for (let _2 in this.attrs) {
|
|
24262
24262
|
obj.attrs = this.attrs;
|
|
24263
24263
|
break;
|
|
24264
24264
|
}
|
|
@@ -24987,7 +24987,7 @@ var NodeType = class {
|
|
|
24987
24987
|
throw new RangeError("Schema is missing its top node type ('" + topType + "')");
|
|
24988
24988
|
if (!result.text)
|
|
24989
24989
|
throw new RangeError("Every schema needs a 'text' type");
|
|
24990
|
-
for (let
|
|
24990
|
+
for (let _2 in result.text.attrs)
|
|
24991
24991
|
throw new RangeError("The text node type should not have attributes");
|
|
24992
24992
|
return result;
|
|
24993
24993
|
}
|
|
@@ -28473,7 +28473,7 @@ var Transaction = class extends Transform {
|
|
|
28473
28473
|
and can thus safely be extended.
|
|
28474
28474
|
*/
|
|
28475
28475
|
get isGeneric() {
|
|
28476
|
-
for (let
|
|
28476
|
+
for (let _2 in this.meta)
|
|
28477
28477
|
return false;
|
|
28478
28478
|
return true;
|
|
28479
28479
|
}
|
|
@@ -28914,17 +28914,17 @@ function deepActiveElement(doc3) {
|
|
|
28914
28914
|
elt = elt.shadowRoot.activeElement;
|
|
28915
28915
|
return elt;
|
|
28916
28916
|
}
|
|
28917
|
-
function caretFromPoint(doc3,
|
|
28917
|
+
function caretFromPoint(doc3, x2, y) {
|
|
28918
28918
|
if (doc3.caretPositionFromPoint) {
|
|
28919
28919
|
try {
|
|
28920
|
-
let pos = doc3.caretPositionFromPoint(
|
|
28920
|
+
let pos = doc3.caretPositionFromPoint(x2, y);
|
|
28921
28921
|
if (pos)
|
|
28922
28922
|
return { node: pos.offsetNode, offset: Math.min(nodeSize(pos.offsetNode), pos.offset) };
|
|
28923
|
-
} catch (
|
|
28923
|
+
} catch (_2) {
|
|
28924
28924
|
}
|
|
28925
28925
|
}
|
|
28926
28926
|
if (doc3.caretRangeFromPoint) {
|
|
28927
|
-
let range = doc3.caretRangeFromPoint(
|
|
28927
|
+
let range = doc3.caretRangeFromPoint(x2, y);
|
|
28928
28928
|
if (range)
|
|
28929
28929
|
return { node: range.startContainer, offset: Math.min(nodeSize(range.startContainer), range.startOffset) };
|
|
28930
28930
|
}
|
|
@@ -29023,8 +29023,8 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
29023
29023
|
function storeScrollPos(view) {
|
|
29024
29024
|
let rect = view.dom.getBoundingClientRect(), startY = Math.max(0, rect.top);
|
|
29025
29025
|
let refDOM, refTop;
|
|
29026
|
-
for (let
|
|
29027
|
-
let dom = view.root.elementFromPoint(
|
|
29026
|
+
for (let x2 = (rect.left + rect.right) / 2, y = startY + 1; y < Math.min(innerHeight, rect.bottom); y += 5) {
|
|
29027
|
+
let dom = view.root.elementFromPoint(x2, y);
|
|
29028
29028
|
if (!dom || dom == view.dom || !view.dom.contains(dom))
|
|
29029
29029
|
continue;
|
|
29030
29030
|
let localRect = dom.getBoundingClientRect();
|
|
@@ -29320,8 +29320,8 @@ function coordsAtPos(view, pos, side) {
|
|
|
29320
29320
|
function flattenV(rect, left) {
|
|
29321
29321
|
if (rect.width == 0)
|
|
29322
29322
|
return rect;
|
|
29323
|
-
let
|
|
29324
|
-
return { top: rect.top, bottom: rect.bottom, left:
|
|
29323
|
+
let x2 = left ? rect.left : rect.right;
|
|
29324
|
+
return { top: rect.top, bottom: rect.bottom, left: x2, right: x2 };
|
|
29325
29325
|
}
|
|
29326
29326
|
function flattenH(rect, top) {
|
|
29327
29327
|
if (rect.height == 0)
|
|
@@ -29399,7 +29399,7 @@ function endOfTextblockHorizontal(view, state, dir) {
|
|
|
29399
29399
|
sel.collapse(anchorNode, anchorOffset);
|
|
29400
29400
|
if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend)
|
|
29401
29401
|
sel.extend(oldNode, oldOff);
|
|
29402
|
-
} catch (
|
|
29402
|
+
} catch (_2) {
|
|
29403
29403
|
}
|
|
29404
29404
|
if (oldBidiLevel != null)
|
|
29405
29405
|
sel.caretBidiLevel = oldBidiLevel;
|
|
@@ -29740,7 +29740,7 @@ var ViewDesc = class {
|
|
|
29740
29740
|
if (anchor != head)
|
|
29741
29741
|
domSel.extend(headDOM.node, headDOM.offset);
|
|
29742
29742
|
domSelExtended = true;
|
|
29743
|
-
} catch (
|
|
29743
|
+
} catch (_2) {
|
|
29744
29744
|
}
|
|
29745
29745
|
}
|
|
29746
29746
|
if (!domSelExtended) {
|
|
@@ -30942,7 +30942,7 @@ function hasSelection(view) {
|
|
|
30942
30942
|
return false;
|
|
30943
30943
|
try {
|
|
30944
30944
|
return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) && (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode));
|
|
30945
|
-
} catch (
|
|
30945
|
+
} catch (_2) {
|
|
30946
30946
|
return false;
|
|
30947
30947
|
}
|
|
30948
30948
|
}
|
|
@@ -32119,7 +32119,7 @@ handlers.dragend = (view) => {
|
|
|
32119
32119
|
view.dragging = null;
|
|
32120
32120
|
}, 50);
|
|
32121
32121
|
};
|
|
32122
|
-
editHandlers.dragover = editHandlers.dragenter = (
|
|
32122
|
+
editHandlers.dragover = editHandlers.dragenter = (_2, e) => e.preventDefault();
|
|
32123
32123
|
editHandlers.drop = (view, _event) => {
|
|
32124
32124
|
let event = _event;
|
|
32125
32125
|
let dragging = view.dragging;
|
|
@@ -32263,7 +32263,7 @@ var InlineType = class {
|
|
|
32263
32263
|
let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset4;
|
|
32264
32264
|
return from2 >= to ? null : new Decoration(from2, to, this);
|
|
32265
32265
|
}
|
|
32266
|
-
valid(
|
|
32266
|
+
valid(_2, span) {
|
|
32267
32267
|
return span.from < span.to;
|
|
32268
32268
|
}
|
|
32269
32269
|
eq(other) {
|
|
@@ -33946,7 +33946,7 @@ function changedNodeViews(a, b) {
|
|
|
33946
33946
|
return true;
|
|
33947
33947
|
nA++;
|
|
33948
33948
|
}
|
|
33949
|
-
for (let
|
|
33949
|
+
for (let _2 in b)
|
|
33950
33950
|
nB++;
|
|
33951
33951
|
return nA != nB;
|
|
33952
33952
|
}
|
|
@@ -35556,7 +35556,7 @@ function removeDuplicates(array, by = JSON.stringify) {
|
|
|
35556
35556
|
function simplifyChangedRanges(changes) {
|
|
35557
35557
|
const uniqueChanges = removeDuplicates(changes);
|
|
35558
35558
|
return uniqueChanges.length === 1 ? uniqueChanges : uniqueChanges.filter((change, index2) => {
|
|
35559
|
-
const rest = uniqueChanges.filter((
|
|
35559
|
+
const rest = uniqueChanges.filter((_2, i) => i !== index2);
|
|
35560
35560
|
return !rest.some((otherChange) => {
|
|
35561
35561
|
return change.oldRange.from >= otherChange.oldRange.from && change.oldRange.to <= otherChange.oldRange.to && change.newRange.from >= otherChange.newRange.from && change.newRange.to <= otherChange.newRange.to;
|
|
35562
35562
|
});
|
|
@@ -38001,7 +38001,7 @@ var Drop = Extension.create({
|
|
|
38001
38001
|
new Plugin({
|
|
38002
38002
|
key: new PluginKey("tiptapDrop"),
|
|
38003
38003
|
props: {
|
|
38004
|
-
handleDrop: (
|
|
38004
|
+
handleDrop: (_2, e, slice2, moved) => {
|
|
38005
38005
|
this.editor.emit("drop", {
|
|
38006
38006
|
editor: this.editor,
|
|
38007
38007
|
event: e,
|
|
@@ -40543,7 +40543,7 @@ function registerGroup(name, groups) {
|
|
|
40543
40543
|
}
|
|
40544
40544
|
return groups[name];
|
|
40545
40545
|
}
|
|
40546
|
-
function addToGroups(
|
|
40546
|
+
function addToGroups(t2, flags, groups) {
|
|
40547
40547
|
if (flags[numeric]) {
|
|
40548
40548
|
flags[asciinumeric] = true;
|
|
40549
40549
|
flags[alphanumeric] = true;
|
|
@@ -40566,15 +40566,15 @@ function addToGroups(t, flags, groups) {
|
|
|
40566
40566
|
}
|
|
40567
40567
|
for (const k in flags) {
|
|
40568
40568
|
const group = registerGroup(k, groups);
|
|
40569
|
-
if (group.indexOf(
|
|
40570
|
-
group.push(
|
|
40569
|
+
if (group.indexOf(t2) < 0) {
|
|
40570
|
+
group.push(t2);
|
|
40571
40571
|
}
|
|
40572
40572
|
}
|
|
40573
40573
|
}
|
|
40574
|
-
function flagsForToken(
|
|
40574
|
+
function flagsForToken(t2, groups) {
|
|
40575
40575
|
const result = {};
|
|
40576
40576
|
for (const c2 in groups) {
|
|
40577
|
-
if (groups[c2].indexOf(
|
|
40577
|
+
if (groups[c2].indexOf(t2) >= 0) {
|
|
40578
40578
|
result[c2] = true;
|
|
40579
40579
|
}
|
|
40580
40580
|
}
|
|
@@ -40712,7 +40712,7 @@ State.prototype = {
|
|
|
40712
40712
|
state.j[input] = next;
|
|
40713
40713
|
return next;
|
|
40714
40714
|
}
|
|
40715
|
-
const
|
|
40715
|
+
const t2 = next;
|
|
40716
40716
|
let nextState, templateState = state.go(input);
|
|
40717
40717
|
if (templateState) {
|
|
40718
40718
|
nextState = new State();
|
|
@@ -40723,16 +40723,16 @@ State.prototype = {
|
|
|
40723
40723
|
} else {
|
|
40724
40724
|
nextState = new State();
|
|
40725
40725
|
}
|
|
40726
|
-
if (
|
|
40726
|
+
if (t2) {
|
|
40727
40727
|
if (groups) {
|
|
40728
40728
|
if (nextState.t && typeof nextState.t === "string") {
|
|
40729
40729
|
const allFlags = Object.assign(flagsForToken(nextState.t, groups), flags);
|
|
40730
|
-
addToGroups(
|
|
40730
|
+
addToGroups(t2, allFlags, groups);
|
|
40731
40731
|
} else if (flags) {
|
|
40732
|
-
addToGroups(
|
|
40732
|
+
addToGroups(t2, flags, groups);
|
|
40733
40733
|
}
|
|
40734
40734
|
}
|
|
40735
|
-
nextState.t =
|
|
40735
|
+
nextState.t = t2;
|
|
40736
40736
|
}
|
|
40737
40737
|
state.j[input] = nextState;
|
|
40738
40738
|
return nextState;
|
|
@@ -41087,7 +41087,7 @@ function stringToArray(str) {
|
|
|
41087
41087
|
}
|
|
41088
41088
|
return result;
|
|
41089
41089
|
}
|
|
41090
|
-
function fastts(state, input,
|
|
41090
|
+
function fastts(state, input, t2, defaultt, jr) {
|
|
41091
41091
|
let next;
|
|
41092
41092
|
const len = input.length;
|
|
41093
41093
|
for (let i = 0; i < len - 1; i++) {
|
|
@@ -41101,7 +41101,7 @@ function fastts(state, input, t, defaultt, jr) {
|
|
|
41101
41101
|
}
|
|
41102
41102
|
state = next;
|
|
41103
41103
|
}
|
|
41104
|
-
next = new State(
|
|
41104
|
+
next = new State(t2);
|
|
41105
41105
|
next.jr = jr.slice();
|
|
41106
41106
|
state.j[input[len - 1]] = next;
|
|
41107
41107
|
return next;
|
|
@@ -41729,7 +41729,7 @@ function autolink(options) {
|
|
|
41729
41729
|
if (!lastWordBeforeSpace) {
|
|
41730
41730
|
return false;
|
|
41731
41731
|
}
|
|
41732
|
-
const linksBeforeSpace = tokenize(lastWordBeforeSpace).map((
|
|
41732
|
+
const linksBeforeSpace = tokenize(lastWordBeforeSpace).map((t2) => t2.toObject(options.defaultProtocol));
|
|
41733
41733
|
if (!isValidLinkStructure(linksBeforeSpace)) {
|
|
41734
41734
|
return false;
|
|
41735
41735
|
}
|
|
@@ -43989,7 +43989,7 @@ var TrailingNode = Extension.create({
|
|
|
43989
43989
|
return [
|
|
43990
43990
|
new Plugin({
|
|
43991
43991
|
key: plugin,
|
|
43992
|
-
appendTransaction: (
|
|
43992
|
+
appendTransaction: (_2, __, state) => {
|
|
43993
43993
|
const { doc: doc3, tr: tr2, schema } = state;
|
|
43994
43994
|
const shouldInsertNodeAtEnd = plugin.getState(state);
|
|
43995
43995
|
const endPosition = doc3.content.size;
|
|
@@ -44000,7 +44000,7 @@ var TrailingNode = Extension.create({
|
|
|
44000
44000
|
return tr2.insert(endPosition, type.create());
|
|
44001
44001
|
},
|
|
44002
44002
|
state: {
|
|
44003
|
-
init: (
|
|
44003
|
+
init: (_2, state) => {
|
|
44004
44004
|
const lastNode = state.tr.doc.lastChild;
|
|
44005
44005
|
return !nodeEqualsType({ node: lastNode, types: disabledNodes });
|
|
44006
44006
|
},
|
|
@@ -46074,7 +46074,7 @@ function handleTripleClick2(view, pos) {
|
|
|
46074
46074
|
view.dispatch(view.state.tr.setSelection(new CellSelection($cell)));
|
|
46075
46075
|
return true;
|
|
46076
46076
|
}
|
|
46077
|
-
function handlePaste(view,
|
|
46077
|
+
function handlePaste(view, _2, slice2) {
|
|
46078
46078
|
if (!isInTable(view.state))
|
|
46079
46079
|
return false;
|
|
46080
46080
|
let cells = pastedCells(slice2);
|
|
@@ -46289,7 +46289,7 @@ function columnResizing({
|
|
|
46289
46289
|
const plugin = new Plugin({
|
|
46290
46290
|
key: columnResizingPluginKey,
|
|
46291
46291
|
state: {
|
|
46292
|
-
init(
|
|
46292
|
+
init(_2, state) {
|
|
46293
46293
|
var _a2, _b;
|
|
46294
46294
|
const nodeViews = (_b = (_a2 = plugin.spec) == null ? void 0 : _a2.props) == null ? void 0 : _b.nodeViews;
|
|
46295
46295
|
const tableName = tableNodeTypes(state.schema).table.name;
|
|
@@ -46607,7 +46607,7 @@ function tableEditing({
|
|
|
46607
46607
|
handleKeyDown: handleKeyDown2,
|
|
46608
46608
|
handlePaste
|
|
46609
46609
|
},
|
|
46610
|
-
appendTransaction(
|
|
46610
|
+
appendTransaction(_2, oldState, state) {
|
|
46611
46611
|
return normalizeSelection(
|
|
46612
46612
|
state,
|
|
46613
46613
|
fixTables(state, oldState),
|
|
@@ -47642,7 +47642,7 @@ function LowlightPlugin({
|
|
|
47642
47642
|
const lowlightPlugin = new Plugin({
|
|
47643
47643
|
key: new PluginKey("lowlight"),
|
|
47644
47644
|
state: {
|
|
47645
|
-
init: (
|
|
47645
|
+
init: (_2, { doc: doc3 }) => getDecorations({
|
|
47646
47646
|
doc: doc3,
|
|
47647
47647
|
name,
|
|
47648
47648
|
lowlight: lowlight2,
|
|
@@ -51643,7 +51643,7 @@ var NUMERIC = {
|
|
|
51643
51643
|
function recurRegex(re, substitution, depth) {
|
|
51644
51644
|
if (depth === -1)
|
|
51645
51645
|
return "";
|
|
51646
|
-
return re.replace(substitution, (
|
|
51646
|
+
return re.replace(substitution, (_2) => {
|
|
51647
51647
|
return recurRegex(re, substitution, depth - 1);
|
|
51648
51648
|
});
|
|
51649
51649
|
}
|
|
@@ -52357,7 +52357,7 @@ function javascript(hljs) {
|
|
|
52357
52357
|
...BUILT_IN_GLOBALS,
|
|
52358
52358
|
"super",
|
|
52359
52359
|
"import"
|
|
52360
|
-
].map((
|
|
52360
|
+
].map((x2) => `${x2}\\s*\\(`)),
|
|
52361
52361
|
IDENT_RE$1,
|
|
52362
52362
|
regex.lookahead(/\s*\(/)
|
|
52363
52363
|
),
|
|
@@ -58576,7 +58576,7 @@ function sql(hljs) {
|
|
|
58576
58576
|
illegal: /[{}]|<\//,
|
|
58577
58577
|
keywords: {
|
|
58578
58578
|
$pattern: /\b[\w\.]+/,
|
|
58579
|
-
keyword: reduceRelevancy(KEYWORDS3, { when: (
|
|
58579
|
+
keyword: reduceRelevancy(KEYWORDS3, { when: (x2) => x2.length < 3 }),
|
|
58580
58580
|
literal: LITERALS3,
|
|
58581
58581
|
type: TYPES3,
|
|
58582
58582
|
built_in: POSSIBLE_WITHOUT_PARENS
|
|
@@ -58611,7 +58611,7 @@ function lookahead(re) {
|
|
|
58611
58611
|
return concat("(?=", re, ")");
|
|
58612
58612
|
}
|
|
58613
58613
|
function concat(...args) {
|
|
58614
|
-
const joined = args.map((
|
|
58614
|
+
const joined = args.map((x2) => source(x2)).join("");
|
|
58615
58615
|
return joined;
|
|
58616
58616
|
}
|
|
58617
58617
|
function stripOptionsFromArgs(args) {
|
|
@@ -58625,7 +58625,7 @@ function stripOptionsFromArgs(args) {
|
|
|
58625
58625
|
}
|
|
58626
58626
|
function either(...args) {
|
|
58627
58627
|
const opts = stripOptionsFromArgs(args);
|
|
58628
|
-
const joined = "(" + (opts.capture ? "" : "?:") + args.map((
|
|
58628
|
+
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x2) => source(x2)).join("|") + ")";
|
|
58629
58629
|
return joined;
|
|
58630
58630
|
}
|
|
58631
58631
|
var keywordWrapper = (keyword) => concat(
|
|
@@ -59965,7 +59965,7 @@ function javascript2(hljs) {
|
|
|
59965
59965
|
...BUILT_IN_GLOBALS2,
|
|
59966
59966
|
"super",
|
|
59967
59967
|
"import"
|
|
59968
|
-
].map((
|
|
59968
|
+
].map((x2) => `${x2}\\s*\\(`)),
|
|
59969
59969
|
IDENT_RE$1,
|
|
59970
59970
|
regex.lookahead(/\s*\(/)
|
|
59971
59971
|
),
|
|
@@ -64478,7 +64478,7 @@ function useVirtualList(items, initialConfig = {}) {
|
|
|
64478
64478
|
});
|
|
64479
64479
|
}, []);
|
|
64480
64480
|
const selectAll3 = useCallback(() => {
|
|
64481
|
-
setSelectedItems(new Set(Array.from({ length: items.length }, (
|
|
64481
|
+
setSelectedItems(new Set(Array.from({ length: items.length }, (_2, i) => i)));
|
|
64482
64482
|
}, [items.length]);
|
|
64483
64483
|
const clearSelection = useCallback(() => {
|
|
64484
64484
|
setSelectedItems(/* @__PURE__ */ new Set());
|
|
@@ -64654,10 +64654,10 @@ var SwipeableCardInternal = React71__default.forwardRef(
|
|
|
64654
64654
|
style: style2,
|
|
64655
64655
|
...props
|
|
64656
64656
|
}, ref) => {
|
|
64657
|
-
const
|
|
64658
|
-
const rotate = useTransform(
|
|
64659
|
-
const likeOpacity = useTransform(
|
|
64660
|
-
const nopeOpacity = useTransform(
|
|
64657
|
+
const x2 = useMotionValue(0);
|
|
64658
|
+
const rotate = useTransform(x2, [-200, 200], [-30, 30]);
|
|
64659
|
+
const likeOpacity = useTransform(x2, [0, threshold], [0, 1]);
|
|
64660
|
+
const nopeOpacity = useTransform(x2, [-threshold, 0], [1, 0]);
|
|
64661
64661
|
const handleDragStart = () => {
|
|
64662
64662
|
if (disabled)
|
|
64663
64663
|
return;
|
|
@@ -64670,14 +64670,14 @@ var SwipeableCardInternal = React71__default.forwardRef(
|
|
|
64670
64670
|
if (Math.abs(info.offset.x) > threshold) {
|
|
64671
64671
|
const direction = info.offset.x > 0 ? "right" : "left";
|
|
64672
64672
|
const exitX = info.offset.x > 0 ? 400 : -400;
|
|
64673
|
-
animate(
|
|
64673
|
+
animate(x2, exitX, { duration: 0.3 });
|
|
64674
64674
|
if (direction === "right" && onSwipeRight) {
|
|
64675
64675
|
onSwipeRight();
|
|
64676
64676
|
} else if (direction === "left" && onSwipeLeft) {
|
|
64677
64677
|
onSwipeLeft();
|
|
64678
64678
|
}
|
|
64679
64679
|
} else {
|
|
64680
|
-
animate(
|
|
64680
|
+
animate(x2, 0, { type: "spring", stiffness: 300, damping: 20 });
|
|
64681
64681
|
}
|
|
64682
64682
|
};
|
|
64683
64683
|
return /* @__PURE__ */ jsxs(
|
|
@@ -64686,7 +64686,7 @@ var SwipeableCardInternal = React71__default.forwardRef(
|
|
|
64686
64686
|
ref,
|
|
64687
64687
|
drag: disabled ? false : "x",
|
|
64688
64688
|
dragConstraints: { left: -300, right: 300 },
|
|
64689
|
-
style: { x, rotate, ...style2 },
|
|
64689
|
+
style: { x: x2, rotate, ...style2 },
|
|
64690
64690
|
onDragStart: handleDragStart,
|
|
64691
64691
|
onDragEnd: handleDragEnd,
|
|
64692
64692
|
className: cn(
|
|
@@ -66053,7 +66053,7 @@ var SparklinePreview = ({ data, dataKey, color }) => {
|
|
|
66053
66053
|
}
|
|
66054
66054
|
) });
|
|
66055
66055
|
};
|
|
66056
|
-
var ChartSkeleton = ({ height }) => /* @__PURE__ */ jsx("div", { className: "w-full", style: { height }, children: /* @__PURE__ */ jsx("div", { className: "flex items-end justify-center h-full gap-2 px-8", children: [...Array(8)].map((
|
|
66056
|
+
var ChartSkeleton = ({ height }) => /* @__PURE__ */ jsx("div", { className: "w-full", style: { height }, children: /* @__PURE__ */ jsx("div", { className: "flex items-end justify-center h-full gap-2 px-8", children: [...Array(8)].map((_2, i) => /* @__PURE__ */ jsx(
|
|
66057
66057
|
motion.div,
|
|
66058
66058
|
{
|
|
66059
66059
|
initial: { height: 0 },
|
|
@@ -67056,9 +67056,9 @@ function MetricCard({
|
|
|
67056
67056
|
const min2 = Math.min(...data.sparkline);
|
|
67057
67057
|
const range = max2 - min2 || 1;
|
|
67058
67058
|
const points = data.sparkline.map((value, index2) => {
|
|
67059
|
-
const
|
|
67059
|
+
const x2 = index2 / (data.sparkline.length - 1) * 100;
|
|
67060
67060
|
const y = 100 - (value - min2) / range * 100;
|
|
67061
|
-
return `${
|
|
67061
|
+
return `${x2},${y}`;
|
|
67062
67062
|
}).join(" ");
|
|
67063
67063
|
const gradientId = `gradient-${data.id}`;
|
|
67064
67064
|
return /* @__PURE__ */ jsx(
|
|
@@ -67883,7 +67883,7 @@ function ActivityFeed({
|
|
|
67883
67883
|
animate: { opacity: 1 },
|
|
67884
67884
|
exit: { opacity: 0 },
|
|
67885
67885
|
className: "space-y-3",
|
|
67886
|
-
children: [...Array(5)].map((
|
|
67886
|
+
children: [...Array(5)].map((_2, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
67887
67887
|
/* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-full bg-muted animate-pulse" }),
|
|
67888
67888
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
67889
67889
|
/* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded animate-pulse" }),
|
|
@@ -68895,13 +68895,13 @@ function MapWidget({
|
|
|
68895
68895
|
className: "relative w-full h-full",
|
|
68896
68896
|
style: { transform: `scale(${zoom})` },
|
|
68897
68897
|
children: locations.map((location, index2) => {
|
|
68898
|
-
const
|
|
68898
|
+
const x2 = (location.lng + 180) / 360 * 100;
|
|
68899
68899
|
const y = (90 - location.lat) / 180 * 100;
|
|
68900
68900
|
return /* @__PURE__ */ jsxs(
|
|
68901
68901
|
motion.div,
|
|
68902
68902
|
{
|
|
68903
68903
|
className: "absolute",
|
|
68904
|
-
style: { left: `${
|
|
68904
|
+
style: { left: `${x2}%`, top: `${y}%` },
|
|
68905
68905
|
initial: { scale: 0 },
|
|
68906
68906
|
animate: { scale: 1 },
|
|
68907
68907
|
transition: { delay: index2 * 0.05 },
|
|
@@ -70990,7 +70990,7 @@ var AdvancedFormsInternal = ({
|
|
|
70990
70990
|
[fieldName]: newFiles
|
|
70991
70991
|
};
|
|
70992
70992
|
});
|
|
70993
|
-
setValue(fieldName, uploadedFiles[fieldName]?.filter((
|
|
70993
|
+
setValue(fieldName, uploadedFiles[fieldName]?.filter((_2, i) => i !== index2) || []);
|
|
70994
70994
|
};
|
|
70995
70995
|
const renderField = (field, index2) => {
|
|
70996
70996
|
const error = errors[field.name];
|
|
@@ -72608,7 +72608,7 @@ var GitHubStarsInternal = ({
|
|
|
72608
72608
|
] }),
|
|
72609
72609
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
72610
72610
|
layout === "grid" ? "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-4"
|
|
72611
|
-
), children: Array.from({ length: maxItems || 6 }).map((
|
|
72611
|
+
), children: Array.from({ length: maxItems || 6 }).map((_2, index2) => /* @__PURE__ */ jsx(MoonUICardPro, { children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
72612
72612
|
/* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-5 w-3/4" }),
|
|
72613
72613
|
/* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-4 w-full" }),
|
|
72614
72614
|
/* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-4 w-2/3" }),
|
|
@@ -75339,7 +75339,7 @@ var MoonUIFileUploadPro = React71__default.forwardRef(
|
|
|
75339
75339
|
return `File type ${file.type} is not supported`;
|
|
75340
75340
|
}
|
|
75341
75341
|
if (accept !== "*") {
|
|
75342
|
-
const acceptTypes = accept.split(",").map((
|
|
75342
|
+
const acceptTypes = accept.split(",").map((t2) => t2.trim());
|
|
75343
75343
|
const isAccepted = acceptTypes.some((acceptType) => {
|
|
75344
75344
|
if (acceptType.includes("*")) {
|
|
75345
75345
|
return file.type.startsWith(acceptType.replace("*", ""));
|
|
@@ -76641,7 +76641,7 @@ function DataTableFilterDrawer({
|
|
|
76641
76641
|
setFilters(newFilters);
|
|
76642
76642
|
};
|
|
76643
76643
|
const removeFilter = (index2) => {
|
|
76644
|
-
setFilters(filters.filter((
|
|
76644
|
+
setFilters(filters.filter((_2, i) => i !== index2));
|
|
76645
76645
|
};
|
|
76646
76646
|
const clearAllFilters = () => {
|
|
76647
76647
|
setFilters([]);
|
|
@@ -80384,7 +80384,7 @@ var FormWizardProgress = ({
|
|
|
80384
80384
|
"flex items-center justify-center space-x-2",
|
|
80385
80385
|
className
|
|
80386
80386
|
),
|
|
80387
|
-
children: steps.map((
|
|
80387
|
+
children: steps.map((_2, index2) => {
|
|
80388
80388
|
const isActive2 = index2 === currentStep;
|
|
80389
80389
|
const isCompleted = isStepCompleted(index2);
|
|
80390
80390
|
return /* @__PURE__ */ jsx(
|
|
@@ -81708,7 +81708,7 @@ var MoonUIQuizFormProInternal = React71__default.forwardRef(({
|
|
|
81708
81708
|
animate: { opacity: 1, y: 0 },
|
|
81709
81709
|
className: "space-y-4",
|
|
81710
81710
|
children: [
|
|
81711
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-center gap-2", children: Array.from({ length: maxRating }, (
|
|
81711
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center gap-2", children: Array.from({ length: maxRating }, (_2, i) => i + 1).map((rating) => /* @__PURE__ */ jsx(
|
|
81712
81712
|
"button",
|
|
81713
81713
|
{
|
|
81714
81714
|
onClick: () => saveAnswer(rating),
|
|
@@ -83649,9 +83649,9 @@ function ChartWidget2({
|
|
|
83649
83649
|
const chartWidth = 100 - padding * 2;
|
|
83650
83650
|
const chartHeight = 100 - padding * 2;
|
|
83651
83651
|
const points = values.map((value, index2) => {
|
|
83652
|
-
const
|
|
83652
|
+
const x2 = padding + index2 / (values.length - 1) * chartWidth;
|
|
83653
83653
|
const y = padding + (chartHeight - value / maxValue * chartHeight);
|
|
83654
|
-
return { x, y, value, label: labels[index2] };
|
|
83654
|
+
return { x: x2, y, value, label: labels[index2] };
|
|
83655
83655
|
});
|
|
83656
83656
|
const pathData = points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
|
|
83657
83657
|
return /* @__PURE__ */ jsxs("div", { className: "relative h-full overflow-hidden", children: [
|
|
@@ -85437,20 +85437,29 @@ var roundedClasses = {
|
|
|
85437
85437
|
};
|
|
85438
85438
|
var BentoGridInternal = ({
|
|
85439
85439
|
children,
|
|
85440
|
-
columns =
|
|
85440
|
+
columns = 3,
|
|
85441
|
+
// Changed from 4 to 3 (more common use case)
|
|
85441
85442
|
gap = "md",
|
|
85442
85443
|
className,
|
|
85443
85444
|
responsive = true,
|
|
85444
85445
|
autoFit = false
|
|
85445
85446
|
}) => {
|
|
85447
|
+
const hasCustomGridCols = className?.includes("grid-cols");
|
|
85446
85448
|
const gridClass = cn(
|
|
85447
85449
|
"grid w-full",
|
|
85448
|
-
!autoFit && columnClasses[columns],
|
|
85450
|
+
!autoFit && !hasCustomGridCols && columnClasses[columns],
|
|
85449
85451
|
gapSizes[gap],
|
|
85450
|
-
|
|
85451
|
-
|
|
85452
|
-
|
|
85453
|
-
|
|
85452
|
+
// Only add responsive classes if:
|
|
85453
|
+
// 1. responsive is true
|
|
85454
|
+
// 2. autoFit is false
|
|
85455
|
+
// 3. user hasn't provided custom grid-cols
|
|
85456
|
+
responsive && !autoFit && !hasCustomGridCols && [
|
|
85457
|
+
"grid-cols-1",
|
|
85458
|
+
// Mobile first
|
|
85459
|
+
"sm:grid-cols-2",
|
|
85460
|
+
// Small screens
|
|
85461
|
+
columns === 3 ? "md:grid-cols-3" : `lg:grid-cols-${columns}`
|
|
85462
|
+
// Medium+ screens
|
|
85454
85463
|
],
|
|
85455
85464
|
autoFit && "grid-cols-[repeat(auto-fit,minmax(250px,1fr))]",
|
|
85456
85465
|
className
|
|
@@ -85697,12 +85706,12 @@ var ConfettiButtonInternal = ({
|
|
|
85697
85706
|
}) => {
|
|
85698
85707
|
const handleClick2 = (e) => {
|
|
85699
85708
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
85700
|
-
const
|
|
85709
|
+
const x2 = (rect.left + rect.width / 2) / window.innerWidth;
|
|
85701
85710
|
const y = (rect.top + rect.height / 2) / window.innerHeight;
|
|
85702
85711
|
confetti2({
|
|
85703
85712
|
particleCount: 100,
|
|
85704
85713
|
spread: 70,
|
|
85705
|
-
origin: { x, y },
|
|
85714
|
+
origin: { x: x2, y },
|
|
85706
85715
|
...confettiOptions
|
|
85707
85716
|
});
|
|
85708
85717
|
onClick?.(e);
|
|
@@ -85927,11 +85936,11 @@ var CursorTrailInternal = ({
|
|
|
85927
85936
|
const [trails, setTrails] = useState([]);
|
|
85928
85937
|
const [isVisible, setIsVisible] = useState(false);
|
|
85929
85938
|
const idRef = useRef(0);
|
|
85930
|
-
const addTrailPoint = useCallback((
|
|
85939
|
+
const addTrailPoint = useCallback((x2, y) => {
|
|
85931
85940
|
if (!enabled)
|
|
85932
85941
|
return;
|
|
85933
85942
|
const newPoint = {
|
|
85934
|
-
x,
|
|
85943
|
+
x: x2,
|
|
85935
85944
|
y,
|
|
85936
85945
|
id: idRef.current++,
|
|
85937
85946
|
timestamp: Date.now()
|
|
@@ -86061,7 +86070,7 @@ CursorTrail.displayName = "CursorTrail";
|
|
|
86061
86070
|
var GridPatternInternal = ({
|
|
86062
86071
|
width = 40,
|
|
86063
86072
|
height = 40,
|
|
86064
|
-
x = -1,
|
|
86073
|
+
x: x2 = -1,
|
|
86065
86074
|
y = -1,
|
|
86066
86075
|
squares = [],
|
|
86067
86076
|
strokeDasharray = "0",
|
|
@@ -86216,7 +86225,7 @@ var GridPatternInternal = ({
|
|
|
86216
86225
|
[hexCenterX - hexRadius, hexCenterY],
|
|
86217
86226
|
[hexCenterX - hexRadius / 2, hexCenterY - hexRadius * Math.sqrt(3) / 2],
|
|
86218
86227
|
[hexCenterX + hexRadius / 2, hexCenterY - hexRadius * Math.sqrt(3) / 2]
|
|
86219
|
-
].map(([
|
|
86228
|
+
].map(([x3, y2]) => `${x3},${y2}`).join(" L ");
|
|
86220
86229
|
return /* @__PURE__ */ jsx("path", { d: `M ${hexPath} Z`, ...baseProps });
|
|
86221
86230
|
case "triangle":
|
|
86222
86231
|
const triSize = Math.min(width, height) / 2;
|
|
@@ -86284,7 +86293,7 @@ var GridPatternInternal = ({
|
|
|
86284
86293
|
"pattern",
|
|
86285
86294
|
{
|
|
86286
86295
|
id: patternId,
|
|
86287
|
-
x,
|
|
86296
|
+
x: x2,
|
|
86288
86297
|
y,
|
|
86289
86298
|
width,
|
|
86290
86299
|
height,
|
|
@@ -86308,7 +86317,7 @@ var GridPatternInternal = ({
|
|
|
86308
86317
|
squares.map(([squareX, squareY], index2) => /* @__PURE__ */ jsx(
|
|
86309
86318
|
"rect",
|
|
86310
86319
|
{
|
|
86311
|
-
x: squareX * width +
|
|
86320
|
+
x: squareX * width + x2,
|
|
86312
86321
|
y: squareY * height + y,
|
|
86313
86322
|
width,
|
|
86314
86323
|
height,
|
|
@@ -86611,7 +86620,7 @@ var MeteorsInternal = ({
|
|
|
86611
86620
|
),
|
|
86612
86621
|
children: [
|
|
86613
86622
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children }),
|
|
86614
|
-
autoPlay && meteors.map((
|
|
86623
|
+
autoPlay && meteors.map((_2, idx) => {
|
|
86615
86624
|
const animationDelay = random(0, 5);
|
|
86616
86625
|
const animationDuration = random(duration.min, duration.max) * speedMultiplier;
|
|
86617
86626
|
const meteorOpacity = random(opacity.min, opacity.max);
|
|
@@ -86683,7 +86692,7 @@ var Meteors = (props) => {
|
|
|
86683
86692
|
Meteors.displayName = "Meteors";
|
|
86684
86693
|
|
|
86685
86694
|
// src/components/backgrounds/aurora-background.css
|
|
86686
|
-
styleInject("@keyframes aurora-wave-1 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1);\n }\n 33% {\n transform: translateX(-45%) translateY(-55%) rotate(60deg) scale(1.1);\n }\n 66% {\n transform: translateX(-55%) translateY(-45%) rotate(-60deg) scale(0.9);\n }\n}\n@keyframes aurora-wave-2 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(45deg) scale(1.2);\n }\n 33% {\n transform: translateX(-55%) translateY(-45%) rotate(105deg) scale(1);\n }\n 66% {\n transform: translateX(-45%) translateY(-55%) rotate(-15deg) scale(1.3);\n }\n}\n@keyframes aurora-wave-3 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(-45deg) scale(0.8);\n }\n 33% {\n transform: translateX(-40%) translateY(-50%) rotate(15deg) scale(1.2);\n }\n 66% {\n transform: translateX(-60%) translateY(-50%) rotate(-105deg) scale(1);\n }\n}\n@keyframes aurora-shimmer {\n 0%, 100% {\n opacity: 0.3;\n }\n 50% {\n opacity: 0.8;\n }\n}\n.aurora-layer {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 200%;\n height: 200%;\n filter: blur(80px);\n mix-blend-mode: screen;\n pointer-events: none;\n}\n.aurora-layer-1 {\n background: radial-gradient(ellipse at center, var(--aurora-color-1) 0%, transparent 60%);\n animation: aurora-wave-1 15s ease-in-out infinite;\n}\n.aurora-layer-2 {\n background: radial-gradient(ellipse at center, var(--aurora-color-2) 0%, transparent 50%);\n animation: aurora-wave-2 20s ease-in-out infinite;\n}\n.aurora-layer-3 {\n background: radial-gradient(ellipse at center, var(--aurora-color-3) 0%, transparent 70%);\n animation: aurora-wave-3 25s ease-in-out infinite;\n}\n.aurora-layer-shimmer {\n background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 60%);\n animation: aurora-shimmer 3s ease-in-out infinite;\n}\n.aurora-interactive .aurora-layer {\n transition: transform 0.3s ease-out;\n}\n.aurora-paused .aurora-layer {\n
|
|
86695
|
+
styleInject("@keyframes aurora-wave-1 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1);\n }\n 33% {\n transform: translateX(-45%) translateY(-55%) rotate(60deg) scale(1.1);\n }\n 66% {\n transform: translateX(-55%) translateY(-45%) rotate(-60deg) scale(0.9);\n }\n}\n@keyframes aurora-wave-2 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(45deg) scale(1.2);\n }\n 33% {\n transform: translateX(-55%) translateY(-45%) rotate(105deg) scale(1);\n }\n 66% {\n transform: translateX(-45%) translateY(-55%) rotate(-15deg) scale(1.3);\n }\n}\n@keyframes aurora-wave-3 {\n 0%, 100% {\n transform: translateX(-50%) translateY(-50%) rotate(-45deg) scale(0.8);\n }\n 33% {\n transform: translateX(-40%) translateY(-50%) rotate(15deg) scale(1.2);\n }\n 66% {\n transform: translateX(-60%) translateY(-50%) rotate(-105deg) scale(1);\n }\n}\n@keyframes aurora-shimmer {\n 0%, 100% {\n opacity: 0.3;\n }\n 50% {\n opacity: 0.8;\n }\n}\n.aurora-layer {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 200%;\n height: 200%;\n filter: blur(80px);\n mix-blend-mode: screen;\n pointer-events: none;\n will-change: transform, opacity;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n}\n.aurora-layer-1 {\n background: radial-gradient(ellipse at center, var(--aurora-color-1) 0%, transparent 60%);\n animation: aurora-wave-1 15s ease-in-out infinite;\n}\n.aurora-layer-2 {\n background: radial-gradient(ellipse at center, var(--aurora-color-2) 0%, transparent 50%);\n animation: aurora-wave-2 20s ease-in-out infinite;\n}\n.aurora-layer-3 {\n background: radial-gradient(ellipse at center, var(--aurora-color-3) 0%, transparent 70%);\n animation: aurora-wave-3 25s ease-in-out infinite;\n}\n.aurora-layer-shimmer {\n background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 60%);\n animation: aurora-shimmer 3s ease-in-out infinite;\n}\n.aurora-interactive .aurora-layer {\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n}\n.aurora-paused .aurora-layer {\n opacity: 0;\n transition: opacity 0.3s ease-out;\n}\n");
|
|
86687
86696
|
var AuroraBackgroundInternal = ({
|
|
86688
86697
|
children,
|
|
86689
86698
|
className,
|
|
@@ -86701,12 +86710,13 @@ var AuroraBackgroundInternal = ({
|
|
|
86701
86710
|
blendMode = "screen",
|
|
86702
86711
|
variant = "default",
|
|
86703
86712
|
fixed = false,
|
|
86704
|
-
pauseWhenHidden =
|
|
86713
|
+
pauseWhenHidden = false
|
|
86705
86714
|
}) => {
|
|
86706
86715
|
const [mousePosition, setMousePosition] = useState({ x: 50, y: 50 });
|
|
86707
86716
|
const [isVisible, setIsVisible] = useState(true);
|
|
86708
|
-
const containerRef =
|
|
86709
|
-
const
|
|
86717
|
+
const containerRef = useRef(null);
|
|
86718
|
+
const observerTimeoutRef = useRef(null);
|
|
86719
|
+
const duration = useMemo(() => {
|
|
86710
86720
|
switch (speed) {
|
|
86711
86721
|
case "slow":
|
|
86712
86722
|
return { layer1: "30s", layer2: "40s", layer3: "50s" };
|
|
@@ -86715,8 +86725,8 @@ var AuroraBackgroundInternal = ({
|
|
|
86715
86725
|
default:
|
|
86716
86726
|
return { layer1: "15s", layer2: "20s", layer3: "25s" };
|
|
86717
86727
|
}
|
|
86718
|
-
};
|
|
86719
|
-
const
|
|
86728
|
+
}, [speed]);
|
|
86729
|
+
const variantColors = useMemo(() => {
|
|
86720
86730
|
switch (variant) {
|
|
86721
86731
|
case "subtle":
|
|
86722
86732
|
return {
|
|
@@ -86739,17 +86749,15 @@ var AuroraBackgroundInternal = ({
|
|
|
86739
86749
|
default:
|
|
86740
86750
|
return colors;
|
|
86741
86751
|
}
|
|
86742
|
-
};
|
|
86743
|
-
const handleMouseMove2 = (e) => {
|
|
86752
|
+
}, [variant, colors]);
|
|
86753
|
+
const handleMouseMove2 = useCallback((e) => {
|
|
86744
86754
|
if (!interactive)
|
|
86745
86755
|
return;
|
|
86746
86756
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
86747
|
-
const
|
|
86757
|
+
const x2 = (e.clientX - rect.left) / rect.width * 100;
|
|
86748
86758
|
const y = (e.clientY - rect.top) / rect.height * 100;
|
|
86749
|
-
setMousePosition({ x, y });
|
|
86750
|
-
};
|
|
86751
|
-
const duration = getAnimationDuration();
|
|
86752
|
-
const variantColors = getVariantColors();
|
|
86759
|
+
setMousePosition({ x: x2, y });
|
|
86760
|
+
}, [interactive]);
|
|
86753
86761
|
useEffect(() => {
|
|
86754
86762
|
if (!pauseWhenHidden)
|
|
86755
86763
|
return;
|
|
@@ -86759,19 +86767,60 @@ var AuroraBackgroundInternal = ({
|
|
|
86759
86767
|
const observer = new IntersectionObserver(
|
|
86760
86768
|
(entries) => {
|
|
86761
86769
|
entries.forEach((entry) => {
|
|
86762
|
-
|
|
86770
|
+
if (observerTimeoutRef.current) {
|
|
86771
|
+
clearTimeout(observerTimeoutRef.current);
|
|
86772
|
+
}
|
|
86773
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
86774
|
+
setIsVisible(entry.isIntersecting);
|
|
86775
|
+
}, 150);
|
|
86763
86776
|
});
|
|
86764
86777
|
},
|
|
86765
86778
|
{
|
|
86766
|
-
threshold: 0.
|
|
86767
|
-
|
|
86779
|
+
threshold: 0.5
|
|
86780
|
+
// Component must be 50% visible (was 0.1)
|
|
86781
|
+
// Removed rootMargin to prevent premature triggering
|
|
86768
86782
|
}
|
|
86769
86783
|
);
|
|
86770
86784
|
observer.observe(container);
|
|
86771
86785
|
return () => {
|
|
86772
86786
|
observer.disconnect();
|
|
86787
|
+
if (observerTimeoutRef.current) {
|
|
86788
|
+
clearTimeout(observerTimeoutRef.current);
|
|
86789
|
+
}
|
|
86773
86790
|
};
|
|
86774
86791
|
}, [pauseWhenHidden]);
|
|
86792
|
+
const containerStyle = useMemo(() => ({
|
|
86793
|
+
"--aurora-color-1": variantColors.primary,
|
|
86794
|
+
"--aurora-color-2": variantColors.secondary,
|
|
86795
|
+
"--aurora-color-3": variantColors.tertiary,
|
|
86796
|
+
"--aurora-opacity": opacity.toString(),
|
|
86797
|
+
"--aurora-blur": `${blur2}px`
|
|
86798
|
+
}), [variantColors, opacity, blur2]);
|
|
86799
|
+
const backgroundStyle = useMemo(() => ({
|
|
86800
|
+
background: variant === "dark" ? "linear-gradient(to bottom, #0f172a, #020617)" : "linear-gradient(to bottom, #ffffff, #f8fafc)"
|
|
86801
|
+
}), [variant]);
|
|
86802
|
+
const layer1Style = useMemo(() => ({
|
|
86803
|
+
animationDuration: duration.layer1,
|
|
86804
|
+
filter: `blur(${blur2}px)`,
|
|
86805
|
+
mixBlendMode: blendMode,
|
|
86806
|
+
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.1}%) translateY(${-50 + (mousePosition.y - 50) * 0.1}%) rotate(0deg) scale(1)` : void 0
|
|
86807
|
+
}), [duration.layer1, blur2, blendMode, interactive, mousePosition]);
|
|
86808
|
+
const layer2Style = useMemo(() => ({
|
|
86809
|
+
animationDuration: duration.layer2,
|
|
86810
|
+
filter: `blur(${blur2 * 1.2}px)`,
|
|
86811
|
+
mixBlendMode: blendMode,
|
|
86812
|
+
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.2}%) translateY(${-50 + (mousePosition.y - 50) * 0.2}%) rotate(45deg) scale(1.2)` : void 0
|
|
86813
|
+
}), [duration.layer2, blur2, blendMode, interactive, mousePosition]);
|
|
86814
|
+
const layer3Style = useMemo(() => ({
|
|
86815
|
+
animationDuration: duration.layer3,
|
|
86816
|
+
filter: `blur(${blur2 * 0.8}px)`,
|
|
86817
|
+
mixBlendMode: blendMode,
|
|
86818
|
+
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.15}%) translateY(${-50 + (mousePosition.y - 50) * 0.15}%) rotate(-45deg) scale(0.8)` : void 0
|
|
86819
|
+
}), [duration.layer3, blur2, blendMode, interactive, mousePosition]);
|
|
86820
|
+
const shimmerStyle = useMemo(() => ({
|
|
86821
|
+
filter: `blur(${blur2 * 0.5}px)`,
|
|
86822
|
+
mixBlendMode: "overlay"
|
|
86823
|
+
}), [blur2]);
|
|
86775
86824
|
return /* @__PURE__ */ jsxs(
|
|
86776
86825
|
"div",
|
|
86777
86826
|
{
|
|
@@ -86784,70 +86833,14 @@ var AuroraBackgroundInternal = ({
|
|
|
86784
86833
|
containerClassName
|
|
86785
86834
|
),
|
|
86786
86835
|
onMouseMove: handleMouseMove2,
|
|
86787
|
-
style:
|
|
86788
|
-
"--aurora-color-1": variantColors.primary,
|
|
86789
|
-
"--aurora-color-2": variantColors.secondary,
|
|
86790
|
-
"--aurora-color-3": variantColors.tertiary,
|
|
86791
|
-
"--aurora-opacity": opacity.toString(),
|
|
86792
|
-
"--aurora-blur": `${blur2}px`
|
|
86793
|
-
},
|
|
86836
|
+
style: containerStyle,
|
|
86794
86837
|
children: [
|
|
86795
|
-
/* @__PURE__ */ jsx(
|
|
86796
|
-
"div",
|
|
86797
|
-
{
|
|
86798
|
-
className: "absolute inset-0",
|
|
86799
|
-
style: {
|
|
86800
|
-
background: variant === "dark" ? "linear-gradient(to bottom, #0f172a, #020617)" : "linear-gradient(to bottom, #ffffff, #f8fafc)"
|
|
86801
|
-
}
|
|
86802
|
-
}
|
|
86803
|
-
),
|
|
86838
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0", style: backgroundStyle }),
|
|
86804
86839
|
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0", style: { opacity }, children: [
|
|
86805
|
-
/* @__PURE__ */ jsx(
|
|
86806
|
-
|
|
86807
|
-
|
|
86808
|
-
|
|
86809
|
-
style: {
|
|
86810
|
-
animationDuration: duration.layer1,
|
|
86811
|
-
filter: `blur(${blur2}px)`,
|
|
86812
|
-
mixBlendMode: blendMode,
|
|
86813
|
-
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.1}%) translateY(${-50 + (mousePosition.y - 50) * 0.1}%) rotate(0deg) scale(1)` : void 0
|
|
86814
|
-
}
|
|
86815
|
-
}
|
|
86816
|
-
),
|
|
86817
|
-
/* @__PURE__ */ jsx(
|
|
86818
|
-
"div",
|
|
86819
|
-
{
|
|
86820
|
-
className: "aurora-layer aurora-layer-2",
|
|
86821
|
-
style: {
|
|
86822
|
-
animationDuration: duration.layer2,
|
|
86823
|
-
filter: `blur(${blur2 * 1.2}px)`,
|
|
86824
|
-
mixBlendMode: blendMode,
|
|
86825
|
-
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.2}%) translateY(${-50 + (mousePosition.y - 50) * 0.2}%) rotate(45deg) scale(1.2)` : void 0
|
|
86826
|
-
}
|
|
86827
|
-
}
|
|
86828
|
-
),
|
|
86829
|
-
/* @__PURE__ */ jsx(
|
|
86830
|
-
"div",
|
|
86831
|
-
{
|
|
86832
|
-
className: "aurora-layer aurora-layer-3",
|
|
86833
|
-
style: {
|
|
86834
|
-
animationDuration: duration.layer3,
|
|
86835
|
-
filter: `blur(${blur2 * 0.8}px)`,
|
|
86836
|
-
mixBlendMode: blendMode,
|
|
86837
|
-
transform: interactive ? `translateX(${-50 + (mousePosition.x - 50) * 0.15}%) translateY(${-50 + (mousePosition.y - 50) * 0.15}%) rotate(-45deg) scale(0.8)` : void 0
|
|
86838
|
-
}
|
|
86839
|
-
}
|
|
86840
|
-
),
|
|
86841
|
-
shimmer && /* @__PURE__ */ jsx(
|
|
86842
|
-
"div",
|
|
86843
|
-
{
|
|
86844
|
-
className: "aurora-layer aurora-layer-shimmer",
|
|
86845
|
-
style: {
|
|
86846
|
-
filter: `blur(${blur2 * 0.5}px)`,
|
|
86847
|
-
mixBlendMode: "overlay"
|
|
86848
|
-
}
|
|
86849
|
-
}
|
|
86850
|
-
)
|
|
86840
|
+
/* @__PURE__ */ jsx("div", { className: "aurora-layer aurora-layer-1", style: layer1Style }),
|
|
86841
|
+
/* @__PURE__ */ jsx("div", { className: "aurora-layer aurora-layer-2", style: layer2Style }),
|
|
86842
|
+
/* @__PURE__ */ jsx("div", { className: "aurora-layer aurora-layer-3", style: layer3Style }),
|
|
86843
|
+
shimmer && /* @__PURE__ */ jsx("div", { className: "aurora-layer aurora-layer-shimmer", style: shimmerStyle })
|
|
86851
86844
|
] }),
|
|
86852
86845
|
children && /* @__PURE__ */ jsx("div", { className: cn("relative z-10", className), children })
|
|
86853
86846
|
]
|
|
@@ -86895,15 +86888,19 @@ var ParticlesInternal = ({
|
|
|
86895
86888
|
movement = "random",
|
|
86896
86889
|
gravity = 0.1,
|
|
86897
86890
|
bounce = true,
|
|
86898
|
-
opacity = { min: 0.3, max: 1 }
|
|
86891
|
+
opacity = { min: 0.3, max: 1 },
|
|
86892
|
+
pauseWhenHidden = false
|
|
86899
86893
|
}) => {
|
|
86900
86894
|
const canvasRef = useRef(null);
|
|
86895
|
+
const containerRef = useRef(null);
|
|
86901
86896
|
const animationRef = useRef(void 0);
|
|
86902
86897
|
const particlesRef = useRef([]);
|
|
86903
86898
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
86904
86899
|
const lastFrameTimeRef = useRef(0);
|
|
86905
86900
|
const frameInterval = 1e3 / fps;
|
|
86906
|
-
const
|
|
86901
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
86902
|
+
const observerTimeoutRef = useRef(null);
|
|
86903
|
+
const drawParticle = useCallback((ctx, particle) => {
|
|
86907
86904
|
ctx.save();
|
|
86908
86905
|
ctx.translate(particle.x, particle.y);
|
|
86909
86906
|
if (particle.angle && shape !== "circle") {
|
|
@@ -86937,19 +86934,19 @@ var ParticlesInternal = ({
|
|
|
86937
86934
|
const outerRadius = particle.size;
|
|
86938
86935
|
const innerRadius = particle.size / 2;
|
|
86939
86936
|
let rot = Math.PI / 2 * 3;
|
|
86940
|
-
let
|
|
86937
|
+
let x2 = 0;
|
|
86941
86938
|
let y = 0;
|
|
86942
86939
|
const step = Math.PI / spikes;
|
|
86943
86940
|
ctx.beginPath();
|
|
86944
86941
|
ctx.moveTo(0, -outerRadius);
|
|
86945
86942
|
for (let i = 0; i < spikes; i++) {
|
|
86946
|
-
|
|
86943
|
+
x2 = Math.cos(rot) * outerRadius;
|
|
86947
86944
|
y = Math.sin(rot) * outerRadius;
|
|
86948
|
-
ctx.lineTo(
|
|
86945
|
+
ctx.lineTo(x2, y);
|
|
86949
86946
|
rot += step;
|
|
86950
|
-
|
|
86947
|
+
x2 = Math.cos(rot) * innerRadius;
|
|
86951
86948
|
y = Math.sin(rot) * innerRadius;
|
|
86952
|
-
ctx.lineTo(
|
|
86949
|
+
ctx.lineTo(x2, y);
|
|
86953
86950
|
rot += step;
|
|
86954
86951
|
}
|
|
86955
86952
|
ctx.lineTo(0, -outerRadius);
|
|
@@ -86958,8 +86955,8 @@ var ParticlesInternal = ({
|
|
|
86958
86955
|
break;
|
|
86959
86956
|
}
|
|
86960
86957
|
ctx.restore();
|
|
86961
|
-
};
|
|
86962
|
-
const updateParticle = (particle, canvas) => {
|
|
86958
|
+
}, [shape, glow, performanceMode, glowIntensity]);
|
|
86959
|
+
const updateParticle = useCallback((particle, canvas) => {
|
|
86963
86960
|
switch (movement) {
|
|
86964
86961
|
case "linear":
|
|
86965
86962
|
particle.x += particle.vx;
|
|
@@ -87022,8 +87019,8 @@ var ParticlesInternal = ({
|
|
|
87022
87019
|
particle.life = 0;
|
|
87023
87020
|
}
|
|
87024
87021
|
}
|
|
87025
|
-
};
|
|
87026
|
-
const drawConnections = (ctx) => {
|
|
87022
|
+
}, [movement, speed, gravity, shape, interactive, mouseRadius, bounce]);
|
|
87023
|
+
const drawConnections = useCallback((ctx) => {
|
|
87027
87024
|
const particles = particlesRef.current;
|
|
87028
87025
|
for (let i = 0; i < particles.length; i++) {
|
|
87029
87026
|
for (let j = i + 1; j < particles.length; j++) {
|
|
@@ -87041,7 +87038,7 @@ var ParticlesInternal = ({
|
|
|
87041
87038
|
}
|
|
87042
87039
|
}
|
|
87043
87040
|
}
|
|
87044
|
-
};
|
|
87041
|
+
}, [connectDistance, lineOpacity, lineWidth]);
|
|
87045
87042
|
const animate4 = useCallback((currentTime) => {
|
|
87046
87043
|
const canvas = canvasRef.current;
|
|
87047
87044
|
const ctx = canvas?.getContext("2d", {
|
|
@@ -87057,20 +87054,22 @@ var ParticlesInternal = ({
|
|
|
87057
87054
|
return;
|
|
87058
87055
|
}
|
|
87059
87056
|
lastFrameTimeRef.current = currentTime;
|
|
87060
|
-
|
|
87061
|
-
|
|
87062
|
-
|
|
87063
|
-
|
|
87064
|
-
|
|
87065
|
-
|
|
87057
|
+
if (!pauseWhenHidden || isVisible) {
|
|
87058
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
87059
|
+
if (blur2 > 0) {
|
|
87060
|
+
ctx.filter = `blur(${blur2}px)`;
|
|
87061
|
+
}
|
|
87062
|
+
if (showConnections && !performanceMode) {
|
|
87063
|
+
drawConnections(ctx);
|
|
87064
|
+
}
|
|
87065
|
+
const particles = particlesRef.current;
|
|
87066
|
+
particles.forEach((particle) => {
|
|
87067
|
+
updateParticle(particle, canvas);
|
|
87068
|
+
drawParticle(ctx, particle);
|
|
87069
|
+
});
|
|
87066
87070
|
}
|
|
87067
|
-
const particles = particlesRef.current;
|
|
87068
|
-
particles.forEach((particle) => {
|
|
87069
|
-
updateParticle(particle, canvas);
|
|
87070
|
-
drawParticle(ctx, particle);
|
|
87071
|
-
});
|
|
87072
87071
|
animationRef.current = requestAnimationFrame(animate4);
|
|
87073
|
-
}, [showConnections,
|
|
87072
|
+
}, [showConnections, performanceMode, blur2, frameInterval, drawConnections, updateParticle, drawParticle, pauseWhenHidden, isVisible]);
|
|
87074
87073
|
const handleResize = useCallback(() => {
|
|
87075
87074
|
const canvas = canvasRef.current;
|
|
87076
87075
|
if (!canvas)
|
|
@@ -87107,6 +87106,37 @@ var ParticlesInternal = ({
|
|
|
87107
87106
|
y: e.clientY - rect.top
|
|
87108
87107
|
};
|
|
87109
87108
|
}, []);
|
|
87109
|
+
useEffect(() => {
|
|
87110
|
+
if (!pauseWhenHidden)
|
|
87111
|
+
return;
|
|
87112
|
+
const container = containerRef.current;
|
|
87113
|
+
if (!container)
|
|
87114
|
+
return;
|
|
87115
|
+
const observer = new IntersectionObserver(
|
|
87116
|
+
(entries) => {
|
|
87117
|
+
entries.forEach((entry) => {
|
|
87118
|
+
if (observerTimeoutRef.current) {
|
|
87119
|
+
clearTimeout(observerTimeoutRef.current);
|
|
87120
|
+
}
|
|
87121
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
87122
|
+
setIsVisible(entry.isIntersecting);
|
|
87123
|
+
}, 150);
|
|
87124
|
+
});
|
|
87125
|
+
},
|
|
87126
|
+
{
|
|
87127
|
+
threshold: 0.5
|
|
87128
|
+
// Component must be 50% visible
|
|
87129
|
+
// No rootMargin to prevent premature triggering
|
|
87130
|
+
}
|
|
87131
|
+
);
|
|
87132
|
+
observer.observe(container);
|
|
87133
|
+
return () => {
|
|
87134
|
+
observer.disconnect();
|
|
87135
|
+
if (observerTimeoutRef.current) {
|
|
87136
|
+
clearTimeout(observerTimeoutRef.current);
|
|
87137
|
+
}
|
|
87138
|
+
};
|
|
87139
|
+
}, [pauseWhenHidden]);
|
|
87110
87140
|
useEffect(() => {
|
|
87111
87141
|
const canvas = canvasRef.current;
|
|
87112
87142
|
if (canvas) {
|
|
@@ -87145,9 +87175,17 @@ var ParticlesInternal = ({
|
|
|
87145
87175
|
}
|
|
87146
87176
|
};
|
|
87147
87177
|
}, [handleResize, handleMouseMove2, animate4, interactive, count3, size4, colors, speed, opacity]);
|
|
87178
|
+
const canvasStyle = useMemo(() => ({
|
|
87179
|
+
willChange: "transform",
|
|
87180
|
+
transform: "translate3d(0, 0, 0)",
|
|
87181
|
+
backfaceVisibility: "hidden",
|
|
87182
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
87183
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
87184
|
+
}), [pauseWhenHidden, isVisible]);
|
|
87148
87185
|
return /* @__PURE__ */ jsxs(
|
|
87149
87186
|
"div",
|
|
87150
87187
|
{
|
|
87188
|
+
ref: containerRef,
|
|
87151
87189
|
className: cn(
|
|
87152
87190
|
"relative w-full h-full overflow-hidden",
|
|
87153
87191
|
containerClassName
|
|
@@ -87164,9 +87202,7 @@ var ParticlesInternal = ({
|
|
|
87164
87202
|
"absolute inset-0 w-full h-full",
|
|
87165
87203
|
className
|
|
87166
87204
|
),
|
|
87167
|
-
style:
|
|
87168
|
-
opacity: 1
|
|
87169
|
-
}
|
|
87205
|
+
style: canvasStyle
|
|
87170
87206
|
}
|
|
87171
87207
|
),
|
|
87172
87208
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -87229,7 +87265,8 @@ var StarfieldInternal = ({
|
|
|
87229
87265
|
const needsSortRef = useRef(true);
|
|
87230
87266
|
const sortTimeRef = useRef(0);
|
|
87231
87267
|
const resizeTimeoutRef = useRef(void 0);
|
|
87232
|
-
const
|
|
87268
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
87269
|
+
const observerTimeoutRef = useRef(null);
|
|
87233
87270
|
const containerRef = useRef(null);
|
|
87234
87271
|
const starColors = Array.isArray(starColor) ? starColor : [starColor];
|
|
87235
87272
|
const initializeShootingStars = useCallback(() => {
|
|
@@ -87293,9 +87330,9 @@ var StarfieldInternal = ({
|
|
|
87293
87330
|
rotationRef.current += spiralSpeed;
|
|
87294
87331
|
const cos = Math.cos(rotationRef.current);
|
|
87295
87332
|
const sin = Math.sin(rotationRef.current);
|
|
87296
|
-
const
|
|
87333
|
+
const x2 = star.x * cos - star.y * sin;
|
|
87297
87334
|
const y = star.x * sin + star.y * cos;
|
|
87298
|
-
star.x =
|
|
87335
|
+
star.x = x2;
|
|
87299
87336
|
star.y = y;
|
|
87300
87337
|
star.z -= speed * (star.velocity || 1);
|
|
87301
87338
|
break;
|
|
@@ -87413,7 +87450,7 @@ var StarfieldInternal = ({
|
|
|
87413
87450
|
});
|
|
87414
87451
|
};
|
|
87415
87452
|
const animate4 = useCallback((currentTime) => {
|
|
87416
|
-
if (!
|
|
87453
|
+
if (!isVisible) {
|
|
87417
87454
|
animationRef.current = requestAnimationFrame(animate4);
|
|
87418
87455
|
return;
|
|
87419
87456
|
}
|
|
@@ -87530,17 +87567,26 @@ var StarfieldInternal = ({
|
|
|
87530
87567
|
const observer = new IntersectionObserver(
|
|
87531
87568
|
(entries) => {
|
|
87532
87569
|
entries.forEach((entry) => {
|
|
87533
|
-
|
|
87570
|
+
if (observerTimeoutRef.current) {
|
|
87571
|
+
clearTimeout(observerTimeoutRef.current);
|
|
87572
|
+
}
|
|
87573
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
87574
|
+
setIsVisible(entry.isIntersecting);
|
|
87575
|
+
}, 150);
|
|
87534
87576
|
});
|
|
87535
87577
|
},
|
|
87536
87578
|
{
|
|
87537
|
-
threshold: 0.
|
|
87538
|
-
|
|
87579
|
+
threshold: 0.5
|
|
87580
|
+
// Component must be 50% visible (was 0.1)
|
|
87581
|
+
// Removed rootMargin to prevent premature triggering
|
|
87539
87582
|
}
|
|
87540
87583
|
);
|
|
87541
87584
|
observer.observe(container);
|
|
87542
87585
|
return () => {
|
|
87543
87586
|
observer.disconnect();
|
|
87587
|
+
if (observerTimeoutRef.current) {
|
|
87588
|
+
clearTimeout(observerTimeoutRef.current);
|
|
87589
|
+
}
|
|
87544
87590
|
};
|
|
87545
87591
|
}, []);
|
|
87546
87592
|
useEffect(() => {
|
|
@@ -87585,6 +87631,11 @@ var StarfieldInternal = ({
|
|
|
87585
87631
|
}
|
|
87586
87632
|
};
|
|
87587
87633
|
}, [handleResize, handleMouseMove2, animate4, mouseParallax, initializeShootingStars, starCount, starSize, starColors, twinkleSpeed]);
|
|
87634
|
+
const canvasStyle = useMemo(() => ({
|
|
87635
|
+
willChange: "transform",
|
|
87636
|
+
transform: "translate3d(0, 0, 0)",
|
|
87637
|
+
backfaceVisibility: "hidden"
|
|
87638
|
+
}), []);
|
|
87588
87639
|
return /* @__PURE__ */ jsxs(
|
|
87589
87640
|
"div",
|
|
87590
87641
|
{
|
|
@@ -87602,7 +87653,8 @@ var StarfieldInternal = ({
|
|
|
87602
87653
|
className: cn(
|
|
87603
87654
|
"absolute inset-0 w-full h-full",
|
|
87604
87655
|
className
|
|
87605
|
-
)
|
|
87656
|
+
),
|
|
87657
|
+
style: canvasStyle
|
|
87606
87658
|
}
|
|
87607
87659
|
),
|
|
87608
87660
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -87676,18 +87728,18 @@ var DotPatternInternal = ({
|
|
|
87676
87728
|
case "hex":
|
|
87677
87729
|
for (let row = 0; row < rows; row++) {
|
|
87678
87730
|
for (let col = 0; col < cols; col++) {
|
|
87679
|
-
const
|
|
87731
|
+
const x2 = col * spacing + (row % 2 === 1 ? spacing / 2 : 0);
|
|
87680
87732
|
const y = row * spacing * 0.866;
|
|
87681
|
-
dots.push({ x, y });
|
|
87733
|
+
dots.push({ x: x2, y });
|
|
87682
87734
|
}
|
|
87683
87735
|
}
|
|
87684
87736
|
break;
|
|
87685
87737
|
case "diagonal":
|
|
87686
87738
|
for (let row = 0; row < rows; row++) {
|
|
87687
87739
|
for (let col = 0; col < cols; col++) {
|
|
87688
|
-
const
|
|
87740
|
+
const x2 = col * spacing + row * spacing * 0.5;
|
|
87689
87741
|
const y = row * spacing;
|
|
87690
|
-
dots.push({ x, y });
|
|
87742
|
+
dots.push({ x: x2, y });
|
|
87691
87743
|
}
|
|
87692
87744
|
}
|
|
87693
87745
|
break;
|
|
@@ -87702,9 +87754,9 @@ var DotPatternInternal = ({
|
|
|
87702
87754
|
const dotsInRing = Math.max(1, Math.floor(circumference / spacing));
|
|
87703
87755
|
for (let i = 0; i < dotsInRing; i++) {
|
|
87704
87756
|
const angle = i / dotsInRing * 2 * Math.PI;
|
|
87705
|
-
const
|
|
87757
|
+
const x2 = centerX + radius * Math.cos(angle);
|
|
87706
87758
|
const y = centerY + radius * Math.sin(angle);
|
|
87707
|
-
dots.push({ x, y });
|
|
87759
|
+
dots.push({ x: x2, y });
|
|
87708
87760
|
}
|
|
87709
87761
|
}
|
|
87710
87762
|
break;
|
|
@@ -87732,9 +87784,9 @@ var DotPatternInternal = ({
|
|
|
87732
87784
|
if (patternRef.current) {
|
|
87733
87785
|
const dots = patternRef.current.querySelectorAll("circle");
|
|
87734
87786
|
dots.forEach((dot) => {
|
|
87735
|
-
const
|
|
87787
|
+
const x2 = parseFloat(dot.getAttribute("cx") || "0");
|
|
87736
87788
|
const y = parseFloat(dot.getAttribute("cy") || "0");
|
|
87737
|
-
const dx =
|
|
87789
|
+
const dx = x2 - mouseRef.current.x;
|
|
87738
87790
|
const dy = y - mouseRef.current.y;
|
|
87739
87791
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
87740
87792
|
if (distance < hoverRadius) {
|
|
@@ -88042,19 +88094,20 @@ var GridDistortionInternal = ({
|
|
|
88042
88094
|
const mouseRef = useRef({ x: -1e3, y: -1e3 });
|
|
88043
88095
|
const timeRef = useRef(0);
|
|
88044
88096
|
const lastFrameTimeRef = useRef(0);
|
|
88045
|
-
const
|
|
88097
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
88098
|
+
const observerTimeoutRef = useRef(null);
|
|
88046
88099
|
const frameInterval = 1e3 / fps;
|
|
88047
88100
|
const initializeGrid = useCallback(() => {
|
|
88048
88101
|
const points = [];
|
|
88049
88102
|
for (let row = 0; row <= rows; row++) {
|
|
88050
88103
|
const rowPoints = [];
|
|
88051
88104
|
for (let col = 0; col <= columns; col++) {
|
|
88052
|
-
const
|
|
88105
|
+
const x2 = col / columns;
|
|
88053
88106
|
const y = row / rows;
|
|
88054
88107
|
rowPoints.push({
|
|
88055
|
-
x,
|
|
88108
|
+
x: x2,
|
|
88056
88109
|
y,
|
|
88057
|
-
originalX:
|
|
88110
|
+
originalX: x2,
|
|
88058
88111
|
originalY: y,
|
|
88059
88112
|
offsetX: 0,
|
|
88060
88113
|
offsetY: 0
|
|
@@ -88133,16 +88186,16 @@ var GridDistortionInternal = ({
|
|
|
88133
88186
|
}
|
|
88134
88187
|
}
|
|
88135
88188
|
}, [distortion, distortionType, amplitude, frequency, rows, columns, interactive, mouseRadius, mouseStrength]);
|
|
88136
|
-
const applyPerspective = useCallback((
|
|
88189
|
+
const applyPerspective = useCallback((x2, y, width, height) => {
|
|
88137
88190
|
if (!perspective)
|
|
88138
|
-
return { x, y };
|
|
88191
|
+
return { x: x2, y };
|
|
88139
88192
|
const centerX = width / 2;
|
|
88140
88193
|
const centerY = height / 2;
|
|
88141
88194
|
const cosX = Math.cos(rotateX * Math.PI / 180);
|
|
88142
88195
|
const sinX = Math.sin(rotateX * Math.PI / 180);
|
|
88143
88196
|
const cosY = Math.cos(rotateY * Math.PI / 180);
|
|
88144
88197
|
const sinY = Math.sin(rotateY * Math.PI / 180);
|
|
88145
|
-
let px =
|
|
88198
|
+
let px = x2 - centerX;
|
|
88146
88199
|
let py = y - centerY;
|
|
88147
88200
|
const pz = -px * sinY;
|
|
88148
88201
|
px = px * cosY;
|
|
@@ -88180,9 +88233,9 @@ var GridDistortionInternal = ({
|
|
|
88180
88233
|
for (let row = 0; row <= rows; row++) {
|
|
88181
88234
|
for (let col = 0; col <= columns; col++) {
|
|
88182
88235
|
const point = points[row][col];
|
|
88183
|
-
const
|
|
88236
|
+
const x2 = point.x * width;
|
|
88184
88237
|
const y = point.y * height;
|
|
88185
|
-
const transformed = applyPerspective(
|
|
88238
|
+
const transformed = applyPerspective(x2, y, width, height);
|
|
88186
88239
|
if (col === 0) {
|
|
88187
88240
|
ctx.moveTo(transformed.x, transformed.y);
|
|
88188
88241
|
} else {
|
|
@@ -88193,9 +88246,9 @@ var GridDistortionInternal = ({
|
|
|
88193
88246
|
for (let col = 0; col <= columns; col++) {
|
|
88194
88247
|
for (let row = 0; row <= rows; row++) {
|
|
88195
88248
|
const point = points[row][col];
|
|
88196
|
-
const
|
|
88249
|
+
const x2 = point.x * width;
|
|
88197
88250
|
const y = point.y * height;
|
|
88198
|
-
const transformed = applyPerspective(
|
|
88251
|
+
const transformed = applyPerspective(x2, y, width, height);
|
|
88199
88252
|
if (row === 0) {
|
|
88200
88253
|
ctx.moveTo(transformed.x, transformed.y);
|
|
88201
88254
|
} else {
|
|
@@ -88221,7 +88274,7 @@ var GridDistortionInternal = ({
|
|
|
88221
88274
|
const animate4 = useCallback((timestamp) => {
|
|
88222
88275
|
const canvas = canvasRef.current;
|
|
88223
88276
|
const ctx = canvas?.getContext("2d");
|
|
88224
|
-
if (!canvas || !ctx
|
|
88277
|
+
if (!canvas || !ctx) {
|
|
88225
88278
|
animationRef.current = requestAnimationFrame(animate4);
|
|
88226
88279
|
return;
|
|
88227
88280
|
}
|
|
@@ -88231,11 +88284,13 @@ var GridDistortionInternal = ({
|
|
|
88231
88284
|
return;
|
|
88232
88285
|
}
|
|
88233
88286
|
lastFrameTimeRef.current = timestamp - elapsed % frameInterval;
|
|
88234
|
-
|
|
88235
|
-
|
|
88236
|
-
|
|
88287
|
+
if (isVisible) {
|
|
88288
|
+
timeRef.current += speed * 0.016;
|
|
88289
|
+
applyDistortion(canvas);
|
|
88290
|
+
drawGrid(ctx, canvas);
|
|
88291
|
+
}
|
|
88237
88292
|
animationRef.current = requestAnimationFrame(animate4);
|
|
88238
|
-
}, [applyDistortion, drawGrid, speed, frameInterval]);
|
|
88293
|
+
}, [applyDistortion, drawGrid, speed, frameInterval, isVisible]);
|
|
88239
88294
|
const setupCanvas = useCallback(() => {
|
|
88240
88295
|
const canvas = canvasRef.current;
|
|
88241
88296
|
const container = containerRef.current;
|
|
@@ -88284,13 +88339,25 @@ var GridDistortionInternal = ({
|
|
|
88284
88339
|
if (!container)
|
|
88285
88340
|
return;
|
|
88286
88341
|
const intersectionObserver = new IntersectionObserver(
|
|
88287
|
-
(
|
|
88288
|
-
|
|
88342
|
+
(entries) => {
|
|
88343
|
+
entries.forEach((entry) => {
|
|
88344
|
+
if (observerTimeoutRef.current) {
|
|
88345
|
+
clearTimeout(observerTimeoutRef.current);
|
|
88346
|
+
}
|
|
88347
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
88348
|
+
setIsVisible(entry.isIntersecting);
|
|
88349
|
+
}, 150);
|
|
88350
|
+
});
|
|
88289
88351
|
},
|
|
88290
|
-
{ threshold: 0.
|
|
88352
|
+
{ threshold: 0.5 }
|
|
88291
88353
|
);
|
|
88292
88354
|
intersectionObserver.observe(container);
|
|
88293
|
-
return () =>
|
|
88355
|
+
return () => {
|
|
88356
|
+
intersectionObserver.disconnect();
|
|
88357
|
+
if (observerTimeoutRef.current) {
|
|
88358
|
+
clearTimeout(observerTimeoutRef.current);
|
|
88359
|
+
}
|
|
88360
|
+
};
|
|
88294
88361
|
}, []);
|
|
88295
88362
|
useEffect(() => {
|
|
88296
88363
|
const canvas = canvasRef.current;
|
|
@@ -88313,6 +88380,14 @@ var GridDistortionInternal = ({
|
|
|
88313
88380
|
}
|
|
88314
88381
|
};
|
|
88315
88382
|
}, [setupCanvas, handleMouseMove2, handleMouseLeave2, animate4, interactive]);
|
|
88383
|
+
const canvasStyle = useMemo(() => ({
|
|
88384
|
+
imageRendering: "crisp-edges",
|
|
88385
|
+
willChange: "transform",
|
|
88386
|
+
transform: "translate3d(0, 0, 0)",
|
|
88387
|
+
backfaceVisibility: "hidden",
|
|
88388
|
+
opacity: isVisible ? 1 : 0,
|
|
88389
|
+
transition: "opacity 0.3s ease-out"
|
|
88390
|
+
}), [isVisible]);
|
|
88316
88391
|
return /* @__PURE__ */ jsxs(
|
|
88317
88392
|
"div",
|
|
88318
88393
|
{
|
|
@@ -88333,9 +88408,7 @@ var GridDistortionInternal = ({
|
|
|
88333
88408
|
"absolute inset-0 w-full h-full",
|
|
88334
88409
|
className
|
|
88335
88410
|
),
|
|
88336
|
-
style:
|
|
88337
|
-
imageRendering: "crisp-edges"
|
|
88338
|
-
}
|
|
88411
|
+
style: canvasStyle
|
|
88339
88412
|
}
|
|
88340
88413
|
),
|
|
88341
88414
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -88379,15 +88452,19 @@ var WavesInternal = ({
|
|
|
88379
88452
|
animationType = "continuous",
|
|
88380
88453
|
interactive = false,
|
|
88381
88454
|
mouseRadius = 150,
|
|
88382
|
-
fps = 60
|
|
88455
|
+
fps = 60,
|
|
88456
|
+
pauseWhenHidden = false
|
|
88383
88457
|
}) => {
|
|
88384
88458
|
const canvasRef = useRef(null);
|
|
88459
|
+
const containerRef = useRef(null);
|
|
88385
88460
|
const animationRef = useRef(void 0);
|
|
88386
88461
|
const waveLayersRef = useRef([]);
|
|
88387
88462
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
88388
88463
|
const timeRef = useRef(0);
|
|
88389
88464
|
const lastFrameTimeRef = useRef(0);
|
|
88390
88465
|
const frameInterval = 1e3 / fps;
|
|
88466
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
88467
|
+
const observerTimeoutRef = useRef(null);
|
|
88391
88468
|
const initializeWaves = useCallback(() => {
|
|
88392
88469
|
const waveLayers = [];
|
|
88393
88470
|
for (let i = 0; i < layers; i++) {
|
|
@@ -88402,24 +88479,24 @@ var WavesInternal = ({
|
|
|
88402
88479
|
}
|
|
88403
88480
|
waveLayersRef.current = waveLayers;
|
|
88404
88481
|
}, [layers, amplitude, frequency, speed, parallax, parallaxIntensity, colors]);
|
|
88405
|
-
const calculateWavePoint = (
|
|
88482
|
+
const calculateWavePoint = (x2, layer, time, mouseEffect = 0) => {
|
|
88406
88483
|
let y = 0;
|
|
88407
88484
|
switch (waveStyle) {
|
|
88408
88485
|
case "smooth":
|
|
88409
|
-
y = Math.sin((
|
|
88486
|
+
y = Math.sin((x2 * layer.frequency + time * layer.speed + layer.phase) * 0.01) * layer.amplitude;
|
|
88410
88487
|
break;
|
|
88411
88488
|
case "sharp":
|
|
88412
|
-
const wave = (
|
|
88489
|
+
const wave = (x2 * layer.frequency + time * layer.speed + layer.phase) * 0.01;
|
|
88413
88490
|
y = (Math.sin(wave) > 0 ? 1 : -1) * layer.amplitude;
|
|
88414
88491
|
break;
|
|
88415
88492
|
case "turbulent":
|
|
88416
|
-
y = Math.sin((
|
|
88417
|
-
y += Math.sin((
|
|
88418
|
-
y += Math.sin((
|
|
88493
|
+
y = Math.sin((x2 * layer.frequency + time * layer.speed + layer.phase) * 0.01) * layer.amplitude;
|
|
88494
|
+
y += Math.sin((x2 * layer.frequency * 2.3 + time * layer.speed * 1.5) * 0.01) * layer.amplitude * 0.3;
|
|
88495
|
+
y += Math.sin((x2 * layer.frequency * 3.7 + time * layer.speed * 0.7) * 0.01) * layer.amplitude * 0.2;
|
|
88419
88496
|
break;
|
|
88420
88497
|
case "organic":
|
|
88421
|
-
y = Math.sin((
|
|
88422
|
-
y *= 1 + Math.sin(
|
|
88498
|
+
y = Math.sin((x2 * layer.frequency + time * layer.speed + layer.phase) * 0.01) * layer.amplitude;
|
|
88499
|
+
y *= 1 + Math.sin(x2 * 3e-3 + time * 1e-3) * 0.2;
|
|
88423
88500
|
break;
|
|
88424
88501
|
}
|
|
88425
88502
|
if (interactive && mouseEffect > 0) {
|
|
@@ -88482,8 +88559,8 @@ var WavesInternal = ({
|
|
|
88482
88559
|
ctx.moveTo(0, 0);
|
|
88483
88560
|
for (let y = 0; y <= canvas.height; y += 5) {
|
|
88484
88561
|
const mouseEffect = interactive ? getMouseEffect(canvas.width / 2, y) : 0;
|
|
88485
|
-
const
|
|
88486
|
-
ctx.lineTo(
|
|
88562
|
+
const x2 = canvas.width / 2 + calculateWavePoint(y, layer, time, mouseEffect);
|
|
88563
|
+
ctx.lineTo(x2, y);
|
|
88487
88564
|
}
|
|
88488
88565
|
ctx.lineTo(canvas.width, canvas.height);
|
|
88489
88566
|
ctx.lineTo(canvas.width, 0);
|
|
@@ -88491,20 +88568,20 @@ var WavesInternal = ({
|
|
|
88491
88568
|
const diagonal = Math.sqrt(canvas.width * canvas.width + canvas.height * canvas.height);
|
|
88492
88569
|
ctx.moveTo(0, canvas.height);
|
|
88493
88570
|
for (let d = 0; d <= diagonal; d += 5) {
|
|
88494
|
-
const
|
|
88571
|
+
const x2 = d / diagonal * canvas.width;
|
|
88495
88572
|
const baseY = d / diagonal * canvas.height;
|
|
88496
|
-
const mouseEffect = interactive ? getMouseEffect(
|
|
88573
|
+
const mouseEffect = interactive ? getMouseEffect(x2, baseY) : 0;
|
|
88497
88574
|
const waveY = calculateWavePoint(d, layer, time, mouseEffect);
|
|
88498
|
-
ctx.lineTo(
|
|
88575
|
+
ctx.lineTo(x2, canvas.height - baseY + waveY);
|
|
88499
88576
|
}
|
|
88500
88577
|
ctx.lineTo(canvas.width, 0);
|
|
88501
88578
|
ctx.lineTo(canvas.width, canvas.height);
|
|
88502
88579
|
} else {
|
|
88503
88580
|
ctx.moveTo(0, canvas.height);
|
|
88504
|
-
for (let
|
|
88505
|
-
const mouseEffect = interactive ? getMouseEffect(
|
|
88506
|
-
const y = canvas.height / 2 + calculateWavePoint(
|
|
88507
|
-
ctx.lineTo(
|
|
88581
|
+
for (let x2 = 0; x2 <= canvas.width; x2 += 5) {
|
|
88582
|
+
const mouseEffect = interactive ? getMouseEffect(x2, canvas.height / 2) : 0;
|
|
88583
|
+
const y = canvas.height / 2 + calculateWavePoint(x2, layer, time, mouseEffect);
|
|
88584
|
+
ctx.lineTo(x2, y);
|
|
88508
88585
|
}
|
|
88509
88586
|
ctx.lineTo(canvas.width, canvas.height);
|
|
88510
88587
|
}
|
|
@@ -88512,8 +88589,8 @@ var WavesInternal = ({
|
|
|
88512
88589
|
ctx.fill();
|
|
88513
88590
|
ctx.restore();
|
|
88514
88591
|
};
|
|
88515
|
-
const getMouseEffect = (
|
|
88516
|
-
const dx =
|
|
88592
|
+
const getMouseEffect = (x2, y) => {
|
|
88593
|
+
const dx = x2 - mouseRef.current.x;
|
|
88517
88594
|
const dy = y - mouseRef.current.y;
|
|
88518
88595
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
88519
88596
|
if (distance < mouseRadius) {
|
|
@@ -88537,20 +88614,22 @@ var WavesInternal = ({
|
|
|
88537
88614
|
return;
|
|
88538
88615
|
}
|
|
88539
88616
|
lastFrameTimeRef.current = currentTime;
|
|
88540
|
-
if (
|
|
88541
|
-
|
|
88542
|
-
|
|
88543
|
-
|
|
88544
|
-
|
|
88545
|
-
|
|
88546
|
-
|
|
88547
|
-
|
|
88548
|
-
|
|
88549
|
-
|
|
88550
|
-
|
|
88617
|
+
if (!pauseWhenHidden || isVisible) {
|
|
88618
|
+
if (animationType === "continuous") {
|
|
88619
|
+
timeRef.current += 1;
|
|
88620
|
+
} else if (animationType === "pulse") {
|
|
88621
|
+
timeRef.current += 1 + Math.sin(currentTime * 1e-3) * 0.5;
|
|
88622
|
+
} else if (animationType === "breathe") {
|
|
88623
|
+
timeRef.current += 0.5 + Math.sin(currentTime * 5e-4) * 0.5;
|
|
88624
|
+
}
|
|
88625
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
88626
|
+
const waveLayers = waveLayersRef.current;
|
|
88627
|
+
for (let i = waveLayers.length - 1; i >= 0; i--) {
|
|
88628
|
+
drawWaveLayer(ctx, waveLayers[i], i, canvas);
|
|
88629
|
+
}
|
|
88551
88630
|
}
|
|
88552
88631
|
animationRef.current = requestAnimationFrame(animate4);
|
|
88553
|
-
}, [frameInterval, animationType]);
|
|
88632
|
+
}, [frameInterval, animationType, pauseWhenHidden, isVisible]);
|
|
88554
88633
|
const handleResize = useCallback(() => {
|
|
88555
88634
|
const canvas = canvasRef.current;
|
|
88556
88635
|
if (!canvas)
|
|
@@ -88591,9 +88670,44 @@ var WavesInternal = ({
|
|
|
88591
88670
|
}
|
|
88592
88671
|
};
|
|
88593
88672
|
}, [initializeWaves, handleResize, handleMouseMove2, animate4, interactive]);
|
|
88673
|
+
useEffect(() => {
|
|
88674
|
+
if (!pauseWhenHidden)
|
|
88675
|
+
return;
|
|
88676
|
+
const container = containerRef.current;
|
|
88677
|
+
if (!container)
|
|
88678
|
+
return;
|
|
88679
|
+
const observer = new IntersectionObserver(
|
|
88680
|
+
(entries) => {
|
|
88681
|
+
entries.forEach((entry) => {
|
|
88682
|
+
if (observerTimeoutRef.current) {
|
|
88683
|
+
clearTimeout(observerTimeoutRef.current);
|
|
88684
|
+
}
|
|
88685
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
88686
|
+
setIsVisible(entry.isIntersecting);
|
|
88687
|
+
}, 150);
|
|
88688
|
+
});
|
|
88689
|
+
},
|
|
88690
|
+
{ threshold: 0.5 }
|
|
88691
|
+
);
|
|
88692
|
+
observer.observe(container);
|
|
88693
|
+
return () => {
|
|
88694
|
+
observer.disconnect();
|
|
88695
|
+
if (observerTimeoutRef.current) {
|
|
88696
|
+
clearTimeout(observerTimeoutRef.current);
|
|
88697
|
+
}
|
|
88698
|
+
};
|
|
88699
|
+
}, [pauseWhenHidden]);
|
|
88700
|
+
const canvasStyle = useMemo(() => ({
|
|
88701
|
+
willChange: "transform",
|
|
88702
|
+
transform: "translate3d(0, 0, 0)",
|
|
88703
|
+
backfaceVisibility: "hidden",
|
|
88704
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
88705
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
88706
|
+
}), [pauseWhenHidden, isVisible]);
|
|
88594
88707
|
return /* @__PURE__ */ jsxs(
|
|
88595
88708
|
"div",
|
|
88596
88709
|
{
|
|
88710
|
+
ref: containerRef,
|
|
88597
88711
|
className: cn(
|
|
88598
88712
|
"relative w-full h-full overflow-hidden",
|
|
88599
88713
|
containerClassName
|
|
@@ -88609,7 +88723,8 @@ var WavesInternal = ({
|
|
|
88609
88723
|
className: cn(
|
|
88610
88724
|
"absolute inset-0 w-full h-full",
|
|
88611
88725
|
className
|
|
88612
|
-
)
|
|
88726
|
+
),
|
|
88727
|
+
style: canvasStyle
|
|
88613
88728
|
}
|
|
88614
88729
|
),
|
|
88615
88730
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -88653,15 +88768,19 @@ var GradientFlowInternal = ({
|
|
|
88653
88768
|
scale = 1,
|
|
88654
88769
|
blendMode = "normal",
|
|
88655
88770
|
smooth = true,
|
|
88656
|
-
fps = 60
|
|
88771
|
+
fps = 60,
|
|
88772
|
+
pauseWhenHidden = false
|
|
88657
88773
|
}) => {
|
|
88658
88774
|
const canvasRef = useRef(null);
|
|
88775
|
+
const containerRef = useRef(null);
|
|
88659
88776
|
const animationRef = useRef(void 0);
|
|
88660
88777
|
const gradientPointsRef = useRef([]);
|
|
88661
88778
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
88662
88779
|
const timeRef = useRef(0);
|
|
88663
88780
|
const lastFrameTimeRef = useRef(0);
|
|
88664
88781
|
const frameInterval = 1e3 / fps;
|
|
88782
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
88783
|
+
const observerTimeoutRef = useRef(null);
|
|
88665
88784
|
const initializeGradientPoints = useCallback(() => {
|
|
88666
88785
|
const canvas = canvasRef.current;
|
|
88667
88786
|
if (!canvas)
|
|
@@ -88835,17 +88954,19 @@ var GradientFlowInternal = ({
|
|
|
88835
88954
|
return;
|
|
88836
88955
|
}
|
|
88837
88956
|
lastFrameTimeRef.current = currentTime;
|
|
88838
|
-
|
|
88839
|
-
|
|
88840
|
-
|
|
88841
|
-
|
|
88842
|
-
|
|
88843
|
-
|
|
88844
|
-
|
|
88957
|
+
if (!pauseWhenHidden || isVisible) {
|
|
88958
|
+
timeRef.current += 1;
|
|
88959
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
88960
|
+
if (blur2 > 0) {
|
|
88961
|
+
ctx.filter = `blur(${blur2}px)`;
|
|
88962
|
+
}
|
|
88963
|
+
if (type === "mesh") {
|
|
88964
|
+
updateGradientPoints(canvas);
|
|
88965
|
+
}
|
|
88966
|
+
drawGradient(ctx, canvas);
|
|
88845
88967
|
}
|
|
88846
|
-
drawGradient(ctx, canvas);
|
|
88847
88968
|
animationRef.current = requestAnimationFrame(animate4);
|
|
88848
|
-
}, [frameInterval, smooth, blur2, type, updateGradientPoints, drawGradient]);
|
|
88969
|
+
}, [frameInterval, smooth, blur2, type, updateGradientPoints, drawGradient, pauseWhenHidden, isVisible]);
|
|
88849
88970
|
const handleResize = useCallback(() => {
|
|
88850
88971
|
const canvas = canvasRef.current;
|
|
88851
88972
|
if (!canvas)
|
|
@@ -88904,9 +89025,44 @@ var GradientFlowInternal = ({
|
|
|
88904
89025
|
}
|
|
88905
89026
|
};
|
|
88906
89027
|
}, [type, initializeGradientPoints, handleResize, handleMouseMove2, animate4, interactive]);
|
|
89028
|
+
useEffect(() => {
|
|
89029
|
+
if (!pauseWhenHidden)
|
|
89030
|
+
return;
|
|
89031
|
+
const container = containerRef.current;
|
|
89032
|
+
if (!container)
|
|
89033
|
+
return;
|
|
89034
|
+
const observer = new IntersectionObserver(
|
|
89035
|
+
(entries) => {
|
|
89036
|
+
entries.forEach((entry) => {
|
|
89037
|
+
if (observerTimeoutRef.current) {
|
|
89038
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89039
|
+
}
|
|
89040
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
89041
|
+
setIsVisible(entry.isIntersecting);
|
|
89042
|
+
}, 150);
|
|
89043
|
+
});
|
|
89044
|
+
},
|
|
89045
|
+
{ threshold: 0.5 }
|
|
89046
|
+
);
|
|
89047
|
+
observer.observe(container);
|
|
89048
|
+
return () => {
|
|
89049
|
+
observer.disconnect();
|
|
89050
|
+
if (observerTimeoutRef.current) {
|
|
89051
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89052
|
+
}
|
|
89053
|
+
};
|
|
89054
|
+
}, [pauseWhenHidden]);
|
|
89055
|
+
const canvasStyle = useMemo(() => ({
|
|
89056
|
+
willChange: "transform",
|
|
89057
|
+
transform: "translate3d(0, 0, 0)",
|
|
89058
|
+
backfaceVisibility: "hidden",
|
|
89059
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
89060
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
89061
|
+
}), [pauseWhenHidden, isVisible]);
|
|
88907
89062
|
return /* @__PURE__ */ jsxs(
|
|
88908
89063
|
"div",
|
|
88909
89064
|
{
|
|
89065
|
+
ref: containerRef,
|
|
88910
89066
|
className: cn(
|
|
88911
89067
|
"relative w-full h-full overflow-hidden",
|
|
88912
89068
|
containerClassName
|
|
@@ -88919,7 +89075,8 @@ var GradientFlowInternal = ({
|
|
|
88919
89075
|
className: cn(
|
|
88920
89076
|
"absolute inset-0 w-full h-full",
|
|
88921
89077
|
className
|
|
88922
|
-
)
|
|
89078
|
+
),
|
|
89079
|
+
style: canvasStyle
|
|
88923
89080
|
}
|
|
88924
89081
|
),
|
|
88925
89082
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -88942,17 +89099,52 @@ var GradientFlow = (props) => {
|
|
|
88942
89099
|
return /* @__PURE__ */ jsx(GradientFlowInternal, { ...props });
|
|
88943
89100
|
};
|
|
88944
89101
|
GradientFlow.displayName = "GradientFlow";
|
|
89102
|
+
var M = (e, i, s, u, m, a, l, h2) => {
|
|
89103
|
+
let d = document.documentElement, w = ["light", "dark"];
|
|
89104
|
+
function p(n) {
|
|
89105
|
+
(Array.isArray(e) ? e : [e]).forEach((y) => {
|
|
89106
|
+
let k = y === "class", S = k && a ? m.map((f) => a[f] || f) : m;
|
|
89107
|
+
k ? (d.classList.remove(...S), d.classList.add(a && a[n] ? a[n] : n)) : d.setAttribute(y, n);
|
|
89108
|
+
}), R(n);
|
|
89109
|
+
}
|
|
89110
|
+
function R(n) {
|
|
89111
|
+
h2 && w.includes(n) && (d.style.colorScheme = n);
|
|
89112
|
+
}
|
|
89113
|
+
function c2() {
|
|
89114
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
89115
|
+
}
|
|
89116
|
+
if (u)
|
|
89117
|
+
p(u);
|
|
89118
|
+
else
|
|
89119
|
+
try {
|
|
89120
|
+
let n = localStorage.getItem(i) || s, y = l && n === "system" ? c2() : n;
|
|
89121
|
+
p(y);
|
|
89122
|
+
} catch (n) {
|
|
89123
|
+
}
|
|
89124
|
+
};
|
|
89125
|
+
var x = React71.createContext(void 0);
|
|
89126
|
+
var U = { setTheme: (e) => {
|
|
89127
|
+
}, themes: [] };
|
|
89128
|
+
var z = () => {
|
|
89129
|
+
var e;
|
|
89130
|
+
return (e = React71.useContext(x)) != null ? e : U;
|
|
89131
|
+
};
|
|
89132
|
+
React71.memo(({ forcedTheme: e, storageKey: i, attribute: s, enableSystem: u, enableColorScheme: m, defaultTheme: a, value: l, themes: h2, nonce: d, scriptProps: w }) => {
|
|
89133
|
+
let p = JSON.stringify([s, i, a, e, h2, l, u, m]).slice(1, -1);
|
|
89134
|
+
return React71.createElement("script", { ...w, suppressHydrationWarning: true, nonce: typeof window == "undefined" ? d : "", dangerouslySetInnerHTML: { __html: `(${M.toString()})(${p})` } });
|
|
89135
|
+
});
|
|
88945
89136
|
var MeshGradientInternal = ({
|
|
88946
89137
|
children,
|
|
88947
89138
|
className,
|
|
88948
89139
|
containerClassName,
|
|
88949
|
-
colors
|
|
89140
|
+
colors,
|
|
89141
|
+
themeAware = true,
|
|
88950
89142
|
speed = 0.5,
|
|
88951
89143
|
gridSize = 4,
|
|
88952
89144
|
animate: animate4 = true,
|
|
88953
89145
|
animationType = "wave",
|
|
88954
|
-
opacity
|
|
88955
|
-
blur: blur2
|
|
89146
|
+
opacity,
|
|
89147
|
+
blur: blur2,
|
|
88956
89148
|
interactive = false,
|
|
88957
89149
|
mouseRadius = 200,
|
|
88958
89150
|
blendMode = "normal",
|
|
@@ -88962,9 +89154,45 @@ var MeshGradientInternal = ({
|
|
|
88962
89154
|
grainOpacity = 0.03,
|
|
88963
89155
|
saturation = 1,
|
|
88964
89156
|
brightness = 1,
|
|
88965
|
-
fps = 60
|
|
89157
|
+
fps = 60,
|
|
89158
|
+
pauseWhenHidden = false
|
|
88966
89159
|
}) => {
|
|
89160
|
+
const { theme, resolvedTheme } = z();
|
|
89161
|
+
const currentTheme = theme === "system" ? resolvedTheme : theme;
|
|
89162
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
89163
|
+
const observerTimeoutRef = useRef(null);
|
|
89164
|
+
const defaultLightColors = [
|
|
89165
|
+
"#fce7f3",
|
|
89166
|
+
// Light pink
|
|
89167
|
+
"#e9d5ff",
|
|
89168
|
+
// Light purple
|
|
89169
|
+
"#ddd6fe",
|
|
89170
|
+
// Light violet
|
|
89171
|
+
"#e0e7ff",
|
|
89172
|
+
// Light indigo
|
|
89173
|
+
"#fbcfe8"
|
|
89174
|
+
// Light pink-2
|
|
89175
|
+
];
|
|
89176
|
+
const defaultDarkColors = [
|
|
89177
|
+
"#5b21b6",
|
|
89178
|
+
// Deep purple
|
|
89179
|
+
"#7c3aed",
|
|
89180
|
+
// Purple
|
|
89181
|
+
"#6366f1",
|
|
89182
|
+
// Indigo
|
|
89183
|
+
"#8b5cf6",
|
|
89184
|
+
// Violet
|
|
89185
|
+
"#4c1d95"
|
|
89186
|
+
// Deep purple-dark
|
|
89187
|
+
];
|
|
89188
|
+
const fallbackColors = ["#FF006E", "#FB5607", "#FFBE0B", "#8338EC", "#3A86FF"];
|
|
89189
|
+
const finalColors = colors ? colors : themeAware && currentTheme === "light" ? defaultLightColors : themeAware && currentTheme === "dark" ? defaultDarkColors : fallbackColors;
|
|
89190
|
+
const defaultBlur = themeAware && currentTheme === "light" ? 80 : 60;
|
|
89191
|
+
const defaultOpacity = themeAware && currentTheme === "light" ? 0.25 : 0.35;
|
|
89192
|
+
const finalBlur = blur2 ?? defaultBlur;
|
|
89193
|
+
const finalOpacity = opacity ?? defaultOpacity;
|
|
88967
89194
|
const canvasRef = useRef(null);
|
|
89195
|
+
const containerRef = useRef(null);
|
|
88968
89196
|
const animationRef = useRef(void 0);
|
|
88969
89197
|
const meshPointsRef = useRef([]);
|
|
88970
89198
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
@@ -88987,13 +89215,13 @@ var MeshGradientInternal = ({
|
|
|
88987
89215
|
y: height / 2 + Math.sin(angle) * distance * height,
|
|
88988
89216
|
vx: (Math.random() - 0.5) * speed,
|
|
88989
89217
|
vy: (Math.random() - 0.5) * speed,
|
|
88990
|
-
color:
|
|
89218
|
+
color: finalColors[i % finalColors.length],
|
|
88991
89219
|
radius: Math.max(100, (width + height) / 4),
|
|
88992
89220
|
phase: i / totalPoints * Math.PI * 2
|
|
88993
89221
|
});
|
|
88994
89222
|
}
|
|
88995
89223
|
meshPointsRef.current = points;
|
|
88996
|
-
}, [
|
|
89224
|
+
}, [finalColors, complexity, speed]);
|
|
88997
89225
|
const adjustColor = useCallback((color, alpha2 = 1) => {
|
|
88998
89226
|
const hex = color.replace("#", "");
|
|
88999
89227
|
const r2 = parseInt(hex.substring(0, 2), 16);
|
|
@@ -89076,19 +89304,19 @@ var MeshGradientInternal = ({
|
|
|
89076
89304
|
const points = meshPointsRef.current;
|
|
89077
89305
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
89078
89306
|
ctx.globalCompositeOperation = blendMode;
|
|
89079
|
-
ctx.globalAlpha =
|
|
89080
|
-
if (
|
|
89081
|
-
ctx.filter = `blur(${
|
|
89307
|
+
ctx.globalAlpha = finalOpacity;
|
|
89308
|
+
if (finalBlur > 0) {
|
|
89309
|
+
ctx.filter = `blur(${finalBlur}px)`;
|
|
89082
89310
|
}
|
|
89083
89311
|
points.forEach((point, i) => {
|
|
89084
|
-
const
|
|
89312
|
+
const x2 = isFinite(point.x) ? point.x : canvas.width / 2;
|
|
89085
89313
|
const y = isFinite(point.y) ? point.y : canvas.height / 2;
|
|
89086
89314
|
const radius = isFinite(point.radius) && point.radius > 0 ? point.radius : 100;
|
|
89087
89315
|
const gradient = ctx.createRadialGradient(
|
|
89088
|
-
|
|
89316
|
+
x2,
|
|
89089
89317
|
y,
|
|
89090
89318
|
0,
|
|
89091
|
-
|
|
89319
|
+
x2,
|
|
89092
89320
|
y,
|
|
89093
89321
|
radius
|
|
89094
89322
|
);
|
|
@@ -89123,7 +89351,7 @@ var MeshGradientInternal = ({
|
|
|
89123
89351
|
ctx.globalCompositeOperation = "overlay";
|
|
89124
89352
|
ctx.putImageData(imageData, 0, 0);
|
|
89125
89353
|
}
|
|
89126
|
-
}, [
|
|
89354
|
+
}, [finalOpacity, finalBlur, blendMode, interpolation, grain, grainOpacity, adjustColor]);
|
|
89127
89355
|
const animateLoop = useCallback((currentTime) => {
|
|
89128
89356
|
const canvas = canvasRef.current;
|
|
89129
89357
|
if (!canvas)
|
|
@@ -89140,7 +89368,7 @@ var MeshGradientInternal = ({
|
|
|
89140
89368
|
return;
|
|
89141
89369
|
}
|
|
89142
89370
|
lastFrameTimeRef.current = currentTime;
|
|
89143
|
-
if (animate4) {
|
|
89371
|
+
if (animate4 && (!pauseWhenHidden || isVisible)) {
|
|
89144
89372
|
timeRef.current += speed * 2.5;
|
|
89145
89373
|
}
|
|
89146
89374
|
updateMeshPoints(canvas);
|
|
@@ -89166,6 +89394,37 @@ var MeshGradientInternal = ({
|
|
|
89166
89394
|
y: e.clientY - rect.top
|
|
89167
89395
|
};
|
|
89168
89396
|
}, []);
|
|
89397
|
+
useEffect(() => {
|
|
89398
|
+
if (!pauseWhenHidden)
|
|
89399
|
+
return;
|
|
89400
|
+
const container = containerRef.current;
|
|
89401
|
+
if (!container)
|
|
89402
|
+
return;
|
|
89403
|
+
const observer = new IntersectionObserver(
|
|
89404
|
+
(entries) => {
|
|
89405
|
+
entries.forEach((entry) => {
|
|
89406
|
+
if (observerTimeoutRef.current) {
|
|
89407
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89408
|
+
}
|
|
89409
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
89410
|
+
setIsVisible(entry.isIntersecting);
|
|
89411
|
+
}, 150);
|
|
89412
|
+
});
|
|
89413
|
+
},
|
|
89414
|
+
{
|
|
89415
|
+
threshold: 0.5
|
|
89416
|
+
// Component must be 50% visible
|
|
89417
|
+
// No rootMargin to prevent premature triggering
|
|
89418
|
+
}
|
|
89419
|
+
);
|
|
89420
|
+
observer.observe(container);
|
|
89421
|
+
return () => {
|
|
89422
|
+
observer.disconnect();
|
|
89423
|
+
if (observerTimeoutRef.current) {
|
|
89424
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89425
|
+
}
|
|
89426
|
+
};
|
|
89427
|
+
}, [pauseWhenHidden]);
|
|
89169
89428
|
useEffect(() => {
|
|
89170
89429
|
const canvas = canvasRef.current;
|
|
89171
89430
|
if (!canvas)
|
|
@@ -89194,9 +89453,17 @@ var MeshGradientInternal = ({
|
|
|
89194
89453
|
}
|
|
89195
89454
|
};
|
|
89196
89455
|
}, [initializeMeshPoints, handleResize, handleMouseMove2, animateLoop, drawMeshGradient, interactive, animate4]);
|
|
89456
|
+
const canvasStyle = useMemo(() => ({
|
|
89457
|
+
willChange: "transform",
|
|
89458
|
+
transform: "translate3d(0, 0, 0)",
|
|
89459
|
+
backfaceVisibility: "hidden",
|
|
89460
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
89461
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
89462
|
+
}), [pauseWhenHidden, isVisible]);
|
|
89197
89463
|
return /* @__PURE__ */ jsxs(
|
|
89198
89464
|
"div",
|
|
89199
89465
|
{
|
|
89466
|
+
ref: containerRef,
|
|
89200
89467
|
className: cn(
|
|
89201
89468
|
"relative w-full h-full overflow-hidden",
|
|
89202
89469
|
containerClassName
|
|
@@ -89209,7 +89476,8 @@ var MeshGradientInternal = ({
|
|
|
89209
89476
|
className: cn(
|
|
89210
89477
|
"absolute inset-0 w-full h-full",
|
|
89211
89478
|
className
|
|
89212
|
-
)
|
|
89479
|
+
),
|
|
89480
|
+
style: canvasStyle
|
|
89213
89481
|
}
|
|
89214
89482
|
),
|
|
89215
89483
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10 h-full w-full", children })
|
|
@@ -89252,15 +89520,19 @@ var LiquidBackgroundInternal = ({
|
|
|
89252
89520
|
backgroundColor = "transparent",
|
|
89253
89521
|
animationStyle = "float",
|
|
89254
89522
|
gradientOverlay = false,
|
|
89255
|
-
fps = 60
|
|
89523
|
+
fps = 60,
|
|
89524
|
+
pauseWhenHidden = false
|
|
89256
89525
|
}) => {
|
|
89257
89526
|
const canvasRef = useRef(null);
|
|
89527
|
+
const containerRef = useRef(null);
|
|
89258
89528
|
const animationRef = useRef(void 0);
|
|
89259
89529
|
const blobsRef = useRef([]);
|
|
89260
89530
|
const mouseRef = useRef({ x: 0, y: 0, vx: 0, vy: 0 });
|
|
89261
89531
|
const timeRef = useRef(0);
|
|
89262
89532
|
const lastFrameTimeRef = useRef(0);
|
|
89263
89533
|
const frameInterval = 1e3 / fps;
|
|
89534
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
89535
|
+
const observerTimeoutRef = useRef(null);
|
|
89264
89536
|
const initializeBlobs = useCallback(() => {
|
|
89265
89537
|
const canvas = canvasRef.current;
|
|
89266
89538
|
if (!canvas)
|
|
@@ -89430,11 +89702,13 @@ var LiquidBackgroundInternal = ({
|
|
|
89430
89702
|
return;
|
|
89431
89703
|
}
|
|
89432
89704
|
lastFrameTimeRef.current = currentTime;
|
|
89433
|
-
|
|
89434
|
-
|
|
89435
|
-
|
|
89705
|
+
if (!pauseWhenHidden || isVisible) {
|
|
89706
|
+
timeRef.current += 1;
|
|
89707
|
+
updateBlobs(canvas);
|
|
89708
|
+
drawLiquid(ctx, canvas);
|
|
89709
|
+
}
|
|
89436
89710
|
animationRef.current = requestAnimationFrame(animate4);
|
|
89437
|
-
}, [frameInterval, updateBlobs, drawLiquid]);
|
|
89711
|
+
}, [frameInterval, updateBlobs, drawLiquid, pauseWhenHidden, isVisible]);
|
|
89438
89712
|
const handleResize = useCallback(() => {
|
|
89439
89713
|
const canvas = canvasRef.current;
|
|
89440
89714
|
if (!canvas)
|
|
@@ -89477,9 +89751,44 @@ var LiquidBackgroundInternal = ({
|
|
|
89477
89751
|
}
|
|
89478
89752
|
};
|
|
89479
89753
|
}, [initializeBlobs, handleResize, handleMouseMove2, animate4, interactive]);
|
|
89754
|
+
useEffect(() => {
|
|
89755
|
+
if (!pauseWhenHidden)
|
|
89756
|
+
return;
|
|
89757
|
+
const container = containerRef.current;
|
|
89758
|
+
if (!container)
|
|
89759
|
+
return;
|
|
89760
|
+
const observer = new IntersectionObserver(
|
|
89761
|
+
(entries) => {
|
|
89762
|
+
entries.forEach((entry) => {
|
|
89763
|
+
if (observerTimeoutRef.current) {
|
|
89764
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89765
|
+
}
|
|
89766
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
89767
|
+
setIsVisible(entry.isIntersecting);
|
|
89768
|
+
}, 150);
|
|
89769
|
+
});
|
|
89770
|
+
},
|
|
89771
|
+
{ threshold: 0.5 }
|
|
89772
|
+
);
|
|
89773
|
+
observer.observe(container);
|
|
89774
|
+
return () => {
|
|
89775
|
+
observer.disconnect();
|
|
89776
|
+
if (observerTimeoutRef.current) {
|
|
89777
|
+
clearTimeout(observerTimeoutRef.current);
|
|
89778
|
+
}
|
|
89779
|
+
};
|
|
89780
|
+
}, [pauseWhenHidden]);
|
|
89781
|
+
const canvasStyle = useMemo(() => ({
|
|
89782
|
+
willChange: "transform",
|
|
89783
|
+
transform: "translate3d(0, 0, 0)",
|
|
89784
|
+
backfaceVisibility: "hidden",
|
|
89785
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
89786
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
89787
|
+
}), [pauseWhenHidden, isVisible]);
|
|
89480
89788
|
return /* @__PURE__ */ jsxs(
|
|
89481
89789
|
"div",
|
|
89482
89790
|
{
|
|
89791
|
+
ref: containerRef,
|
|
89483
89792
|
className: cn(
|
|
89484
89793
|
"relative w-full h-full overflow-hidden",
|
|
89485
89794
|
containerClassName
|
|
@@ -89495,7 +89804,8 @@ var LiquidBackgroundInternal = ({
|
|
|
89495
89804
|
className: cn(
|
|
89496
89805
|
"absolute inset-0 w-full h-full",
|
|
89497
89806
|
className
|
|
89498
|
-
)
|
|
89807
|
+
),
|
|
89808
|
+
style: canvasStyle
|
|
89499
89809
|
}
|
|
89500
89810
|
),
|
|
89501
89811
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -89536,14 +89846,18 @@ var MatrixRainInternal = ({
|
|
|
89536
89846
|
fadeLength = 20,
|
|
89537
89847
|
interactive = false,
|
|
89538
89848
|
mouseRadius = 200,
|
|
89539
|
-
fps = 30
|
|
89849
|
+
fps = 30,
|
|
89850
|
+
pauseWhenHidden = false
|
|
89540
89851
|
}) => {
|
|
89541
89852
|
const canvasRef = useRef(null);
|
|
89853
|
+
const containerRef = useRef(null);
|
|
89542
89854
|
const animationRef = useRef(void 0);
|
|
89543
89855
|
const columnsRef = useRef([]);
|
|
89544
89856
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
89545
89857
|
const lastFrameTimeRef = useRef(0);
|
|
89546
89858
|
const frameInterval = 1e3 / fps;
|
|
89859
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
89860
|
+
const observerTimeoutRef = useRef(null);
|
|
89547
89861
|
const getCharacterSet = useCallback(() => {
|
|
89548
89862
|
switch (charSet) {
|
|
89549
89863
|
case "matrix":
|
|
@@ -89673,10 +89987,12 @@ var MatrixRainInternal = ({
|
|
|
89673
89987
|
return;
|
|
89674
89988
|
}
|
|
89675
89989
|
lastFrameTimeRef.current = currentTime;
|
|
89676
|
-
|
|
89677
|
-
|
|
89990
|
+
if (!pauseWhenHidden || isVisible) {
|
|
89991
|
+
updateColumns2(canvas);
|
|
89992
|
+
drawMatrix(ctx, canvas);
|
|
89993
|
+
}
|
|
89678
89994
|
animationRef.current = requestAnimationFrame(animate4);
|
|
89679
|
-
}, [frameInterval, updateColumns2, drawMatrix]);
|
|
89995
|
+
}, [frameInterval, updateColumns2, drawMatrix, pauseWhenHidden, isVisible]);
|
|
89680
89996
|
const handleResize = useCallback(() => {
|
|
89681
89997
|
const canvas = canvasRef.current;
|
|
89682
89998
|
if (!canvas)
|
|
@@ -89717,9 +90033,44 @@ var MatrixRainInternal = ({
|
|
|
89717
90033
|
}
|
|
89718
90034
|
};
|
|
89719
90035
|
}, [initializeColumns, handleResize, handleMouseMove2, animate4, interactive]);
|
|
90036
|
+
useEffect(() => {
|
|
90037
|
+
if (!pauseWhenHidden)
|
|
90038
|
+
return;
|
|
90039
|
+
const container = containerRef.current;
|
|
90040
|
+
if (!container)
|
|
90041
|
+
return;
|
|
90042
|
+
const observer = new IntersectionObserver(
|
|
90043
|
+
(entries) => {
|
|
90044
|
+
entries.forEach((entry) => {
|
|
90045
|
+
if (observerTimeoutRef.current) {
|
|
90046
|
+
clearTimeout(observerTimeoutRef.current);
|
|
90047
|
+
}
|
|
90048
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
90049
|
+
setIsVisible(entry.isIntersecting);
|
|
90050
|
+
}, 150);
|
|
90051
|
+
});
|
|
90052
|
+
},
|
|
90053
|
+
{ threshold: 0.5 }
|
|
90054
|
+
);
|
|
90055
|
+
observer.observe(container);
|
|
90056
|
+
return () => {
|
|
90057
|
+
observer.disconnect();
|
|
90058
|
+
if (observerTimeoutRef.current) {
|
|
90059
|
+
clearTimeout(observerTimeoutRef.current);
|
|
90060
|
+
}
|
|
90061
|
+
};
|
|
90062
|
+
}, [pauseWhenHidden]);
|
|
90063
|
+
const canvasStyle = useMemo(() => ({
|
|
90064
|
+
willChange: "transform",
|
|
90065
|
+
transform: "translate3d(0, 0, 0)",
|
|
90066
|
+
backfaceVisibility: "hidden",
|
|
90067
|
+
opacity: !pauseWhenHidden || isVisible ? backgroundOpacity : 0,
|
|
90068
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
90069
|
+
}), [pauseWhenHidden, isVisible, backgroundOpacity]);
|
|
89720
90070
|
return /* @__PURE__ */ jsxs(
|
|
89721
90071
|
"div",
|
|
89722
90072
|
{
|
|
90073
|
+
ref: containerRef,
|
|
89723
90074
|
className: cn(
|
|
89724
90075
|
"relative w-full h-full overflow-hidden bg-black",
|
|
89725
90076
|
containerClassName
|
|
@@ -89733,9 +90084,7 @@ var MatrixRainInternal = ({
|
|
|
89733
90084
|
"absolute inset-0 w-full h-full",
|
|
89734
90085
|
className
|
|
89735
90086
|
),
|
|
89736
|
-
style:
|
|
89737
|
-
opacity: backgroundOpacity
|
|
89738
|
-
}
|
|
90087
|
+
style: canvasStyle
|
|
89739
90088
|
}
|
|
89740
90089
|
),
|
|
89741
90090
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -89779,9 +90128,11 @@ var GlitchBackgroundInternal = ({
|
|
|
89779
90128
|
speed = 1,
|
|
89780
90129
|
interactive = false,
|
|
89781
90130
|
mouseRadius = 200,
|
|
89782
|
-
fps = 30
|
|
90131
|
+
fps = 30,
|
|
90132
|
+
pauseWhenHidden = false
|
|
89783
90133
|
}) => {
|
|
89784
90134
|
const canvasRef = useRef(null);
|
|
90135
|
+
const containerRef = useRef(null);
|
|
89785
90136
|
const animationRef = useRef(void 0);
|
|
89786
90137
|
const glitchSlicesRef = useRef([]);
|
|
89787
90138
|
const mouseRef = useRef({ x: 0, y: 0 });
|
|
@@ -89789,6 +90140,8 @@ var GlitchBackgroundInternal = ({
|
|
|
89789
90140
|
const frameInterval = 1e3 / fps;
|
|
89790
90141
|
const timeRef = useRef(0);
|
|
89791
90142
|
const isGlitchingRef = useRef(false);
|
|
90143
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
90144
|
+
const observerTimeoutRef = useRef(null);
|
|
89792
90145
|
const generateGlitchSlices = useCallback((canvas) => {
|
|
89793
90146
|
const slices = [];
|
|
89794
90147
|
const sliceCount = Math.floor(Math.random() * 10 * intensity) + 2;
|
|
@@ -89916,31 +90269,33 @@ var GlitchBackgroundInternal = ({
|
|
|
89916
90269
|
return;
|
|
89917
90270
|
}
|
|
89918
90271
|
lastFrameTimeRef.current = currentTime;
|
|
89919
|
-
|
|
89920
|
-
|
|
89921
|
-
|
|
89922
|
-
isGlitchingRef.current
|
|
89923
|
-
|
|
89924
|
-
|
|
89925
|
-
|
|
89926
|
-
|
|
89927
|
-
|
|
89928
|
-
|
|
89929
|
-
|
|
89930
|
-
|
|
89931
|
-
|
|
89932
|
-
|
|
89933
|
-
|
|
89934
|
-
|
|
89935
|
-
|
|
89936
|
-
|
|
89937
|
-
|
|
89938
|
-
|
|
89939
|
-
|
|
90272
|
+
if (!pauseWhenHidden || isVisible) {
|
|
90273
|
+
timeRef.current += speed;
|
|
90274
|
+
const glitchChance = frequency * 0.1;
|
|
90275
|
+
if (!isGlitchingRef.current && Math.random() < glitchChance) {
|
|
90276
|
+
isGlitchingRef.current = true;
|
|
90277
|
+
generateGlitchSlices(canvas);
|
|
90278
|
+
setTimeout(() => {
|
|
90279
|
+
isGlitchingRef.current = false;
|
|
90280
|
+
}, Math.random() * 200 * intensity + 50);
|
|
90281
|
+
}
|
|
90282
|
+
if (interactive) {
|
|
90283
|
+
const dx = canvas.width / 2 - mouseRef.current.x;
|
|
90284
|
+
const dy = canvas.height / 2 - mouseRef.current.y;
|
|
90285
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
90286
|
+
if (distance < mouseRadius && !isGlitchingRef.current) {
|
|
90287
|
+
const triggerChance = (1 - distance / mouseRadius) * frequency;
|
|
90288
|
+
if (Math.random() < triggerChance * 0.05) {
|
|
90289
|
+
isGlitchingRef.current = true;
|
|
90290
|
+
generateGlitchSlices(canvas);
|
|
90291
|
+
setTimeout(() => {
|
|
90292
|
+
isGlitchingRef.current = false;
|
|
90293
|
+
}, Math.random() * 100 + 50);
|
|
90294
|
+
}
|
|
89940
90295
|
}
|
|
89941
90296
|
}
|
|
90297
|
+
drawGlitch(ctx, canvas);
|
|
89942
90298
|
}
|
|
89943
|
-
drawGlitch(ctx, canvas);
|
|
89944
90299
|
animationRef.current = requestAnimationFrame(animate4);
|
|
89945
90300
|
}, [
|
|
89946
90301
|
frameInterval,
|
|
@@ -89950,7 +90305,9 @@ var GlitchBackgroundInternal = ({
|
|
|
89950
90305
|
interactive,
|
|
89951
90306
|
mouseRadius,
|
|
89952
90307
|
generateGlitchSlices,
|
|
89953
|
-
drawGlitch
|
|
90308
|
+
drawGlitch,
|
|
90309
|
+
pauseWhenHidden,
|
|
90310
|
+
isVisible
|
|
89954
90311
|
]);
|
|
89955
90312
|
const handleResize = useCallback(() => {
|
|
89956
90313
|
const canvas = canvasRef.current;
|
|
@@ -90003,9 +90360,45 @@ var GlitchBackgroundInternal = ({
|
|
|
90003
90360
|
}
|
|
90004
90361
|
};
|
|
90005
90362
|
}, [handleResize, handleMouseMove2, animate4, interactive]);
|
|
90363
|
+
useEffect(() => {
|
|
90364
|
+
if (!pauseWhenHidden)
|
|
90365
|
+
return;
|
|
90366
|
+
const container = containerRef.current;
|
|
90367
|
+
if (!container)
|
|
90368
|
+
return;
|
|
90369
|
+
const observer = new IntersectionObserver(
|
|
90370
|
+
(entries) => {
|
|
90371
|
+
entries.forEach((entry) => {
|
|
90372
|
+
if (observerTimeoutRef.current) {
|
|
90373
|
+
clearTimeout(observerTimeoutRef.current);
|
|
90374
|
+
}
|
|
90375
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
90376
|
+
setIsVisible(entry.isIntersecting);
|
|
90377
|
+
}, 150);
|
|
90378
|
+
});
|
|
90379
|
+
},
|
|
90380
|
+
{ threshold: 0.5 }
|
|
90381
|
+
);
|
|
90382
|
+
observer.observe(container);
|
|
90383
|
+
return () => {
|
|
90384
|
+
observer.disconnect();
|
|
90385
|
+
if (observerTimeoutRef.current) {
|
|
90386
|
+
clearTimeout(observerTimeoutRef.current);
|
|
90387
|
+
}
|
|
90388
|
+
};
|
|
90389
|
+
}, [pauseWhenHidden]);
|
|
90390
|
+
const canvasStyle = useMemo(() => ({
|
|
90391
|
+
willChange: "transform",
|
|
90392
|
+
transform: "translate3d(0, 0, 0)",
|
|
90393
|
+
backfaceVisibility: "hidden",
|
|
90394
|
+
zIndex: 1,
|
|
90395
|
+
opacity: !pauseWhenHidden || isVisible ? 1 : 0,
|
|
90396
|
+
transition: pauseWhenHidden ? "opacity 0.3s ease-out" : "none"
|
|
90397
|
+
}), [pauseWhenHidden, isVisible]);
|
|
90006
90398
|
return /* @__PURE__ */ jsxs(
|
|
90007
90399
|
"div",
|
|
90008
90400
|
{
|
|
90401
|
+
ref: containerRef,
|
|
90009
90402
|
className: cn(
|
|
90010
90403
|
"relative w-full h-full overflow-hidden",
|
|
90011
90404
|
containerClassName
|
|
@@ -90022,7 +90415,7 @@ var GlitchBackgroundInternal = ({
|
|
|
90022
90415
|
"absolute inset-0 w-full h-full pointer-events-none",
|
|
90023
90416
|
className
|
|
90024
90417
|
),
|
|
90025
|
-
style:
|
|
90418
|
+
style: canvasStyle
|
|
90026
90419
|
}
|
|
90027
90420
|
),
|
|
90028
90421
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -90134,12 +90527,12 @@ var FloatingElementsInternal = ({
|
|
|
90134
90527
|
ctx.beginPath();
|
|
90135
90528
|
for (let i = 0; i < 6; i++) {
|
|
90136
90529
|
const angle = Math.PI * 2 / 6 * i;
|
|
90137
|
-
const
|
|
90530
|
+
const x2 = Math.cos(angle) * actualSize / 2;
|
|
90138
90531
|
const y = Math.sin(angle) * actualSize / 2;
|
|
90139
90532
|
if (i === 0)
|
|
90140
|
-
ctx.moveTo(
|
|
90533
|
+
ctx.moveTo(x2, y);
|
|
90141
90534
|
else
|
|
90142
|
-
ctx.lineTo(
|
|
90535
|
+
ctx.lineTo(x2, y);
|
|
90143
90536
|
}
|
|
90144
90537
|
ctx.closePath();
|
|
90145
90538
|
ctx.fill();
|
|
@@ -90149,12 +90542,12 @@ var FloatingElementsInternal = ({
|
|
|
90149
90542
|
for (let i = 0; i < 10; i++) {
|
|
90150
90543
|
const radius = i % 2 === 0 ? actualSize / 2 : actualSize / 4;
|
|
90151
90544
|
const angle = Math.PI * 2 / 10 * i - Math.PI / 2;
|
|
90152
|
-
const
|
|
90545
|
+
const x2 = Math.cos(angle) * radius;
|
|
90153
90546
|
const y = Math.sin(angle) * radius;
|
|
90154
90547
|
if (i === 0)
|
|
90155
|
-
ctx.moveTo(
|
|
90548
|
+
ctx.moveTo(x2, y);
|
|
90156
90549
|
else
|
|
90157
|
-
ctx.lineTo(
|
|
90550
|
+
ctx.lineTo(x2, y);
|
|
90158
90551
|
}
|
|
90159
90552
|
ctx.closePath();
|
|
90160
90553
|
ctx.fill();
|
|
@@ -90337,7 +90730,12 @@ var FloatingElementsInternal = ({
|
|
|
90337
90730
|
className: cn(
|
|
90338
90731
|
"absolute inset-0 w-full h-full",
|
|
90339
90732
|
className
|
|
90340
|
-
)
|
|
90733
|
+
),
|
|
90734
|
+
style: {
|
|
90735
|
+
willChange: "transform",
|
|
90736
|
+
transform: "translate3d(0, 0, 0)",
|
|
90737
|
+
backfaceVisibility: "hidden"
|
|
90738
|
+
}
|
|
90341
90739
|
}
|
|
90342
90740
|
),
|
|
90343
90741
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -90413,6 +90811,7 @@ var BubbleBackgroundInternal = ({
|
|
|
90413
90811
|
mergeDistance = 30
|
|
90414
90812
|
}) => {
|
|
90415
90813
|
const canvasRef = useRef(null);
|
|
90814
|
+
const containerRef = useRef(null);
|
|
90416
90815
|
const offscreenCanvasRef = useRef(null);
|
|
90417
90816
|
const animationRef = useRef(void 0);
|
|
90418
90817
|
const bubblesRef = useRef([]);
|
|
@@ -90422,6 +90821,8 @@ var BubbleBackgroundInternal = ({
|
|
|
90422
90821
|
const timeRef = useRef(0);
|
|
90423
90822
|
const gradientCacheRef = useRef(/* @__PURE__ */ new Map());
|
|
90424
90823
|
const performanceConfigRef = useRef(PERFORMANCE_PRESETS.medium);
|
|
90824
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
90825
|
+
const observerTimeoutRef = useRef(null);
|
|
90425
90826
|
const detectPerformance = useCallback(() => {
|
|
90426
90827
|
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
90427
90828
|
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
@@ -90692,37 +91093,39 @@ var BubbleBackgroundInternal = ({
|
|
|
90692
91093
|
return;
|
|
90693
91094
|
}
|
|
90694
91095
|
lastFrameTimeRef.current = currentTime;
|
|
90695
|
-
|
|
90696
|
-
|
|
90697
|
-
|
|
90698
|
-
|
|
90699
|
-
|
|
90700
|
-
|
|
90701
|
-
|
|
90702
|
-
|
|
90703
|
-
|
|
90704
|
-
|
|
90705
|
-
|
|
90706
|
-
|
|
90707
|
-
|
|
90708
|
-
|
|
90709
|
-
|
|
90710
|
-
|
|
90711
|
-
offCtx
|
|
90712
|
-
|
|
90713
|
-
|
|
90714
|
-
|
|
91096
|
+
if (isVisible) {
|
|
91097
|
+
timeRef.current += 1;
|
|
91098
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
91099
|
+
if (backgroundColor !== "transparent") {
|
|
91100
|
+
ctx.fillStyle = backgroundColor;
|
|
91101
|
+
ctx.globalAlpha = backgroundOpacity;
|
|
91102
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
91103
|
+
ctx.globalAlpha = 1;
|
|
91104
|
+
}
|
|
91105
|
+
updateBubbles(canvas, deltaTime);
|
|
91106
|
+
if (glow && performanceConfigRef.current.glow) {
|
|
91107
|
+
ctx.shadowBlur = 20 * glowIntensity;
|
|
91108
|
+
ctx.shadowColor = colors[0];
|
|
91109
|
+
}
|
|
91110
|
+
if (blur2 && performanceConfigRef.current.blur && offscreenCanvasRef.current) {
|
|
91111
|
+
const offCtx = offscreenCanvasRef.current.getContext("2d");
|
|
91112
|
+
if (offCtx) {
|
|
91113
|
+
offCtx.filter = `blur(${blurAmount}px)`;
|
|
91114
|
+
offCtx.clearRect(0, 0, canvas.width, canvas.height);
|
|
91115
|
+
bubblesRef.current.forEach((bubble) => {
|
|
91116
|
+
drawBubble(offCtx, bubble);
|
|
91117
|
+
});
|
|
91118
|
+
ctx.drawImage(offscreenCanvasRef.current, 0, 0);
|
|
91119
|
+
}
|
|
91120
|
+
} else {
|
|
91121
|
+
const bubbles = bubblesRef.current;
|
|
91122
|
+
bubbles.forEach((bubble) => {
|
|
91123
|
+
drawBubble(ctx, bubble);
|
|
90715
91124
|
});
|
|
90716
|
-
ctx.drawImage(offscreenCanvasRef.current, 0, 0);
|
|
90717
91125
|
}
|
|
90718
|
-
|
|
90719
|
-
|
|
90720
|
-
|
|
90721
|
-
drawBubble(ctx, bubble);
|
|
90722
|
-
});
|
|
90723
|
-
}
|
|
90724
|
-
if (glow && performanceConfigRef.current.glow) {
|
|
90725
|
-
ctx.shadowBlur = 0;
|
|
91126
|
+
if (glow && performanceConfigRef.current.glow) {
|
|
91127
|
+
ctx.shadowBlur = 0;
|
|
91128
|
+
}
|
|
90726
91129
|
}
|
|
90727
91130
|
animationRef.current = requestAnimationFrame(animate4);
|
|
90728
91131
|
}, [
|
|
@@ -90735,7 +91138,8 @@ var BubbleBackgroundInternal = ({
|
|
|
90735
91138
|
glowIntensity,
|
|
90736
91139
|
blur2,
|
|
90737
91140
|
blurAmount,
|
|
90738
|
-
colors
|
|
91141
|
+
colors,
|
|
91142
|
+
isVisible
|
|
90739
91143
|
]);
|
|
90740
91144
|
const handleResize = useCallback(() => {
|
|
90741
91145
|
const canvas = canvasRef.current;
|
|
@@ -90769,6 +91173,31 @@ var BubbleBackgroundInternal = ({
|
|
|
90769
91173
|
y: e.clientY - rect.top
|
|
90770
91174
|
};
|
|
90771
91175
|
}, []);
|
|
91176
|
+
useEffect(() => {
|
|
91177
|
+
const container = containerRef.current;
|
|
91178
|
+
if (!container)
|
|
91179
|
+
return;
|
|
91180
|
+
const intersectionObserver = new IntersectionObserver(
|
|
91181
|
+
(entries) => {
|
|
91182
|
+
entries.forEach((entry) => {
|
|
91183
|
+
if (observerTimeoutRef.current) {
|
|
91184
|
+
clearTimeout(observerTimeoutRef.current);
|
|
91185
|
+
}
|
|
91186
|
+
observerTimeoutRef.current = setTimeout(() => {
|
|
91187
|
+
setIsVisible(entry.isIntersecting);
|
|
91188
|
+
}, 150);
|
|
91189
|
+
});
|
|
91190
|
+
},
|
|
91191
|
+
{ threshold: 0.5 }
|
|
91192
|
+
);
|
|
91193
|
+
intersectionObserver.observe(container);
|
|
91194
|
+
return () => {
|
|
91195
|
+
intersectionObserver.disconnect();
|
|
91196
|
+
if (observerTimeoutRef.current) {
|
|
91197
|
+
clearTimeout(observerTimeoutRef.current);
|
|
91198
|
+
}
|
|
91199
|
+
};
|
|
91200
|
+
}, []);
|
|
90772
91201
|
useEffect(() => {
|
|
90773
91202
|
const canvas = canvasRef.current;
|
|
90774
91203
|
if (!canvas)
|
|
@@ -90809,9 +91238,20 @@ var BubbleBackgroundInternal = ({
|
|
|
90809
91238
|
gradientCacheRef.current.clear();
|
|
90810
91239
|
};
|
|
90811
91240
|
}, []);
|
|
91241
|
+
const canvasStyle = useMemo(() => ({
|
|
91242
|
+
width: "100%",
|
|
91243
|
+
height: "100%",
|
|
91244
|
+
touchAction: "none",
|
|
91245
|
+
willChange: "transform",
|
|
91246
|
+
transform: "translate3d(0, 0, 0)",
|
|
91247
|
+
backfaceVisibility: "hidden",
|
|
91248
|
+
opacity: isVisible ? 1 : 0,
|
|
91249
|
+
transition: "opacity 0.3s ease-out"
|
|
91250
|
+
}), [isVisible]);
|
|
90812
91251
|
return /* @__PURE__ */ jsxs(
|
|
90813
91252
|
"div",
|
|
90814
91253
|
{
|
|
91254
|
+
ref: containerRef,
|
|
90815
91255
|
className: cn(
|
|
90816
91256
|
"relative w-full h-full overflow-hidden",
|
|
90817
91257
|
containerClassName
|
|
@@ -90825,11 +91265,7 @@ var BubbleBackgroundInternal = ({
|
|
|
90825
91265
|
"absolute inset-0 w-full h-full",
|
|
90826
91266
|
className
|
|
90827
91267
|
),
|
|
90828
|
-
style:
|
|
90829
|
-
width: "100%",
|
|
90830
|
-
height: "100%",
|
|
90831
|
-
touchAction: "none"
|
|
90832
|
-
}
|
|
91268
|
+
style: canvasStyle
|
|
90833
91269
|
}
|
|
90834
91270
|
),
|
|
90835
91271
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -91000,12 +91436,12 @@ var GeometricPatternsInternal = ({
|
|
|
91000
91436
|
case "hexagons":
|
|
91001
91437
|
for (let i = 0; i < 6; i++) {
|
|
91002
91438
|
const angle = Math.PI * 2 / 6 * i - Math.PI / 2;
|
|
91003
|
-
const
|
|
91439
|
+
const x2 = Math.cos(angle) * size4 / 2;
|
|
91004
91440
|
const y = Math.sin(angle) * size4 / 2;
|
|
91005
91441
|
if (i === 0)
|
|
91006
|
-
path.moveTo(
|
|
91442
|
+
path.moveTo(x2, y);
|
|
91007
91443
|
else
|
|
91008
|
-
path.lineTo(
|
|
91444
|
+
path.lineTo(x2, y);
|
|
91009
91445
|
}
|
|
91010
91446
|
path.closePath();
|
|
91011
91447
|
break;
|
|
@@ -91055,12 +91491,12 @@ var GeometricPatternsInternal = ({
|
|
|
91055
91491
|
if (density < 1 && (row % skipFactor !== 0 || col % skipFactor !== 0)) {
|
|
91056
91492
|
continue;
|
|
91057
91493
|
}
|
|
91058
|
-
let
|
|
91494
|
+
let x2 = col * totalSpacing;
|
|
91059
91495
|
let y = row * totalSpacing;
|
|
91060
91496
|
if (pattern === "hexagons" && row % 2 === 1) {
|
|
91061
|
-
|
|
91497
|
+
x2 += totalSpacing / 2;
|
|
91062
91498
|
}
|
|
91063
|
-
allPositions.push({ x, y });
|
|
91499
|
+
allPositions.push({ x: x2, y });
|
|
91064
91500
|
}
|
|
91065
91501
|
}
|
|
91066
91502
|
for (let i = allPositions.length - 1; i > 0; i--) {
|
|
@@ -91484,7 +91920,12 @@ var GeometricPatternsInternal = ({
|
|
|
91484
91920
|
className: cn(
|
|
91485
91921
|
"absolute inset-0 w-full h-full",
|
|
91486
91922
|
className
|
|
91487
|
-
)
|
|
91923
|
+
),
|
|
91924
|
+
style: {
|
|
91925
|
+
willChange: "transform",
|
|
91926
|
+
transform: "translate3d(0, 0, 0)",
|
|
91927
|
+
backfaceVisibility: "hidden"
|
|
91928
|
+
}
|
|
91488
91929
|
}
|
|
91489
91930
|
),
|
|
91490
91931
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-10", children })
|
|
@@ -91715,7 +92156,7 @@ function CodeSnippets({
|
|
|
91715
92156
|
const allSnippets = useMemo(
|
|
91716
92157
|
() => Array.from(
|
|
91717
92158
|
{ length: multiplier },
|
|
91718
|
-
(
|
|
92159
|
+
(_2, i) => snippets.map((snippet, j) => ({
|
|
91719
92160
|
...snippet,
|
|
91720
92161
|
id: `${i}-${j}-${snippet.language}`
|
|
91721
92162
|
}))
|
|
@@ -91881,7 +92322,7 @@ var BlurFadeInternal = ({
|
|
|
91881
92322
|
return { x: 0, y: 0 };
|
|
91882
92323
|
}
|
|
91883
92324
|
};
|
|
91884
|
-
const { x, y } = getTransformValues();
|
|
92325
|
+
const { x: x2, y } = getTransformValues();
|
|
91885
92326
|
return /* @__PURE__ */ jsxs(
|
|
91886
92327
|
"div",
|
|
91887
92328
|
{
|
|
@@ -91895,7 +92336,7 @@ var BlurFadeInternal = ({
|
|
|
91895
92336
|
["--blur-fade-delay"]: `${delay}ms`,
|
|
91896
92337
|
["--blur-fade-duration"]: `${duration}ms`,
|
|
91897
92338
|
["--blur-fade-blur"]: blur2,
|
|
91898
|
-
["--blur-fade-x"]: `${
|
|
92339
|
+
["--blur-fade-x"]: `${x2}px`,
|
|
91899
92340
|
["--blur-fade-y"]: `${y}px`
|
|
91900
92341
|
},
|
|
91901
92342
|
children: [
|
|
@@ -92227,17 +92668,17 @@ var RippleInternal = (props) => {
|
|
|
92227
92668
|
if (disabled || !containerRef.current)
|
|
92228
92669
|
return;
|
|
92229
92670
|
const rect = containerRef.current.getBoundingClientRect();
|
|
92230
|
-
let
|
|
92671
|
+
let x2, y, force = 1, velocity = 0;
|
|
92231
92672
|
if (customCenter) {
|
|
92232
|
-
|
|
92673
|
+
x2 = customCenter.x;
|
|
92233
92674
|
y = customCenter.y;
|
|
92234
92675
|
} else if (center) {
|
|
92235
|
-
|
|
92676
|
+
x2 = center.x;
|
|
92236
92677
|
y = center.y;
|
|
92237
92678
|
} else if (event) {
|
|
92238
92679
|
if ("touches" in event) {
|
|
92239
92680
|
const touch = event.touches[0];
|
|
92240
|
-
|
|
92681
|
+
x2 = touch.clientX - rect.left;
|
|
92241
92682
|
y = touch.clientY - rect.top;
|
|
92242
92683
|
if (pressureSensitive && "force" in touch) {
|
|
92243
92684
|
force = touch.force || 1;
|
|
@@ -92246,18 +92687,18 @@ var RippleInternal = (props) => {
|
|
|
92246
92687
|
const now = Date.now();
|
|
92247
92688
|
const timeDiff = now - lastTouchTime.current;
|
|
92248
92689
|
const distance = Math.sqrt(
|
|
92249
|
-
Math.pow(
|
|
92690
|
+
Math.pow(x2 - lastTouchPos.current.x, 2) + Math.pow(y - lastTouchPos.current.y, 2)
|
|
92250
92691
|
);
|
|
92251
92692
|
velocity = timeDiff > 0 ? distance / timeDiff : 0;
|
|
92252
92693
|
lastTouchTime.current = now;
|
|
92253
|
-
lastTouchPos.current = { x, y };
|
|
92694
|
+
lastTouchPos.current = { x: x2, y };
|
|
92254
92695
|
}
|
|
92255
92696
|
} else {
|
|
92256
|
-
|
|
92697
|
+
x2 = event.clientX - rect.left;
|
|
92257
92698
|
y = event.clientY - rect.top;
|
|
92258
92699
|
}
|
|
92259
92700
|
} else {
|
|
92260
|
-
|
|
92701
|
+
x2 = rect.width / 2;
|
|
92261
92702
|
y = rect.height / 2;
|
|
92262
92703
|
}
|
|
92263
92704
|
let rippleSize = getRippleSize();
|
|
@@ -92270,7 +92711,7 @@ var RippleInternal = (props) => {
|
|
|
92270
92711
|
}
|
|
92271
92712
|
const baseRipple = {
|
|
92272
92713
|
id: rippleIdRef.current++,
|
|
92273
|
-
x:
|
|
92714
|
+
x: x2 - rippleSize / 2,
|
|
92274
92715
|
y: y - rippleSize / 2,
|
|
92275
92716
|
size: rippleSize,
|
|
92276
92717
|
startTime: Date.now(),
|
|
@@ -92479,7 +92920,7 @@ var SparklesInternal = ({
|
|
|
92479
92920
|
return "0%";
|
|
92480
92921
|
}
|
|
92481
92922
|
};
|
|
92482
|
-
const createSparkle = (
|
|
92923
|
+
const createSparkle = (x2, y) => {
|
|
92483
92924
|
if (!containerRef.current) {
|
|
92484
92925
|
return {
|
|
92485
92926
|
id: sparkleIdRef.current++,
|
|
@@ -92496,7 +92937,7 @@ var SparklesInternal = ({
|
|
|
92496
92937
|
const rect = containerRef.current.getBoundingClientRect();
|
|
92497
92938
|
return {
|
|
92498
92939
|
id: sparkleIdRef.current++,
|
|
92499
|
-
x:
|
|
92940
|
+
x: x2 ?? randomInt(0, rect.width),
|
|
92500
92941
|
y: y ?? randomInt(0, rect.height),
|
|
92501
92942
|
size: random(size4.min, size4.max),
|
|
92502
92943
|
color,
|
|
@@ -92506,10 +92947,10 @@ var SparklesInternal = ({
|
|
|
92506
92947
|
shape: getSparkleShape(shape)
|
|
92507
92948
|
};
|
|
92508
92949
|
};
|
|
92509
|
-
const addSparkle = (
|
|
92950
|
+
const addSparkle = (x2, y) => {
|
|
92510
92951
|
if (!active)
|
|
92511
92952
|
return;
|
|
92512
|
-
const newSparkle = createSparkle(
|
|
92953
|
+
const newSparkle = createSparkle(x2, y);
|
|
92513
92954
|
setSparkles((prev) => {
|
|
92514
92955
|
const updated = [...prev, newSparkle];
|
|
92515
92956
|
if (updated.length > count3) {
|
|
@@ -92549,9 +92990,9 @@ var SparklesInternal = ({
|
|
|
92549
92990
|
if (trigger === "click") {
|
|
92550
92991
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
92551
92992
|
if (rect) {
|
|
92552
|
-
const
|
|
92993
|
+
const x2 = event.clientX - rect.left;
|
|
92553
92994
|
const y = event.clientY - rect.top;
|
|
92554
|
-
addSparkle(
|
|
92995
|
+
addSparkle(x2, y);
|
|
92555
92996
|
}
|
|
92556
92997
|
}
|
|
92557
92998
|
};
|
|
@@ -92559,9 +93000,9 @@ var SparklesInternal = ({
|
|
|
92559
93000
|
if (interactive && trigger === "hover" && isHovered) {
|
|
92560
93001
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
92561
93002
|
if (rect && Math.random() > 0.8) {
|
|
92562
|
-
const
|
|
93003
|
+
const x2 = event.clientX - rect.left;
|
|
92563
93004
|
const y = event.clientY - rect.top;
|
|
92564
|
-
addSparkle(
|
|
93005
|
+
addSparkle(x2, y);
|
|
92565
93006
|
}
|
|
92566
93007
|
}
|
|
92567
93008
|
};
|
|
@@ -92730,9 +93171,9 @@ var SpotlightInternal = ({
|
|
|
92730
93171
|
if (!rect)
|
|
92731
93172
|
return;
|
|
92732
93173
|
const time = Date.now() / autoSpeed;
|
|
92733
|
-
const
|
|
93174
|
+
const x2 = (Math.sin(time) + 1) * 0.5 * rect.width;
|
|
92734
93175
|
const y = (Math.cos(time * 0.7) + 1) * 0.5 * rect.height;
|
|
92735
|
-
setAutoPosition({ x, y });
|
|
93176
|
+
setAutoPosition({ x: x2, y });
|
|
92736
93177
|
autoAnimationRef.current = requestAnimationFrame(animate4);
|
|
92737
93178
|
};
|
|
92738
93179
|
autoAnimationRef.current = requestAnimationFrame(animate4);
|
|
@@ -92832,7 +93273,7 @@ var SpotlightInternal = ({
|
|
|
92832
93273
|
clientX = event.clientX;
|
|
92833
93274
|
clientY = event.clientY;
|
|
92834
93275
|
}
|
|
92835
|
-
let
|
|
93276
|
+
let x2 = clientX - rect.left;
|
|
92836
93277
|
let y = clientY - rect.top;
|
|
92837
93278
|
if (magnetic && magneticElements.length > 0) {
|
|
92838
93279
|
magneticElements.forEach((element) => {
|
|
@@ -92840,28 +93281,28 @@ var SpotlightInternal = ({
|
|
|
92840
93281
|
const elementCenterX = elementRect.left + elementRect.width / 2 - rect.left;
|
|
92841
93282
|
const elementCenterY = elementRect.top + elementRect.height / 2 - rect.top;
|
|
92842
93283
|
const distance = Math.sqrt(
|
|
92843
|
-
Math.pow(
|
|
93284
|
+
Math.pow(x2 - elementCenterX, 2) + Math.pow(y - elementCenterY, 2)
|
|
92844
93285
|
);
|
|
92845
93286
|
if (distance < 100) {
|
|
92846
93287
|
const force = (100 - distance) / 100 * magneticStrength;
|
|
92847
|
-
|
|
93288
|
+
x2 += (elementCenterX - x2) * force;
|
|
92848
93289
|
y += (elementCenterY - y) * force;
|
|
92849
93290
|
}
|
|
92850
93291
|
});
|
|
92851
93292
|
}
|
|
92852
|
-
setMousePosition({ x, y });
|
|
92853
|
-
updatePosition({ x, y });
|
|
93293
|
+
setMousePosition({ x: x2, y });
|
|
93294
|
+
updatePosition({ x: x2, y });
|
|
92854
93295
|
if (spotlights?.some((s) => s.trail) || spotlights?.length === 0 && trailPositions.length > 0) {
|
|
92855
93296
|
const timestamp = Date.now();
|
|
92856
93297
|
setTrailPositions((prev) => {
|
|
92857
|
-
const newTrail = [{ x, y, timestamp }, ...prev];
|
|
93298
|
+
const newTrail = [{ x: x2, y, timestamp }, ...prev];
|
|
92858
93299
|
const maxLength = spotlights?.find((s) => s.trail)?.trail?.length || 10;
|
|
92859
93300
|
return newTrail.slice(0, maxLength);
|
|
92860
93301
|
});
|
|
92861
93302
|
}
|
|
92862
93303
|
if (interactiveZones) {
|
|
92863
93304
|
interactiveZones.forEach((zone, index2) => {
|
|
92864
|
-
const isInZone =
|
|
93305
|
+
const isInZone = x2 >= zone.bounds.x && x2 <= zone.bounds.x + zone.bounds.width && y >= zone.bounds.y && y <= zone.bounds.y + zone.bounds.height;
|
|
92865
93306
|
if (zone.trigger === "proximity" || zone.trigger === "hover") {
|
|
92866
93307
|
setInteractiveState((prev) => ({ ...prev, [index2]: isInZone }));
|
|
92867
93308
|
}
|
|
@@ -92910,13 +93351,13 @@ var SpotlightInternal = ({
|
|
|
92910
93351
|
return autoPosition;
|
|
92911
93352
|
return displayPosition;
|
|
92912
93353
|
};
|
|
92913
|
-
const interpolateHeatMap = (data,
|
|
93354
|
+
const interpolateHeatMap = (data, x2, y) => {
|
|
92914
93355
|
if (!heatMap)
|
|
92915
93356
|
return 0;
|
|
92916
93357
|
let totalWeight = 0;
|
|
92917
93358
|
let weightedIntensity = 0;
|
|
92918
93359
|
data.forEach((point) => {
|
|
92919
|
-
const distance = Math.sqrt(Math.pow(
|
|
93360
|
+
const distance = Math.sqrt(Math.pow(x2 - point.x, 2) + Math.pow(y - point.y, 2));
|
|
92920
93361
|
const weight = 1 / (distance + 1);
|
|
92921
93362
|
totalWeight += weight;
|
|
92922
93363
|
weightedIntensity += point.intensity * weight;
|
|
@@ -92935,20 +93376,20 @@ var SpotlightInternal = ({
|
|
|
92935
93376
|
return shape2;
|
|
92936
93377
|
}
|
|
92937
93378
|
};
|
|
92938
|
-
const createWavePattern = (
|
|
93379
|
+
const createWavePattern = (x2, y) => {
|
|
92939
93380
|
if (!waveAnimation)
|
|
92940
93381
|
return 1;
|
|
92941
93382
|
const { type, frequency, amplitude } = waveAnimation;
|
|
92942
93383
|
const offset4 = waveOffset * 0.01;
|
|
92943
93384
|
switch (type) {
|
|
92944
93385
|
case "ripple":
|
|
92945
|
-
const distance = Math.sqrt(Math.pow(
|
|
93386
|
+
const distance = Math.sqrt(Math.pow(x2 - 400, 2) + Math.pow(y - 300, 2));
|
|
92946
93387
|
return 1 + amplitude * Math.sin(distance * frequency + offset4);
|
|
92947
93388
|
case "sine":
|
|
92948
|
-
return 1 + amplitude * Math.sin(
|
|
93389
|
+
return 1 + amplitude * Math.sin(x2 * frequency + offset4);
|
|
92949
93390
|
case "spiral":
|
|
92950
|
-
const angle = Math.atan2(y - 300,
|
|
92951
|
-
const radius = Math.sqrt(Math.pow(
|
|
93391
|
+
const angle = Math.atan2(y - 300, x2 - 400);
|
|
93392
|
+
const radius = Math.sqrt(Math.pow(x2 - 400, 2) + Math.pow(y - 300, 2));
|
|
92952
93393
|
return 1 + amplitude * Math.sin(radius * frequency + angle * 3 + offset4);
|
|
92953
93394
|
default:
|
|
92954
93395
|
return 1;
|
|
@@ -92956,19 +93397,19 @@ var SpotlightInternal = ({
|
|
|
92956
93397
|
};
|
|
92957
93398
|
const createGradient = (spotlightData, position) => {
|
|
92958
93399
|
const pos = position || getSpotlightPosition();
|
|
92959
|
-
const { x, y } = pos;
|
|
93400
|
+
const { x: x2, y } = pos;
|
|
92960
93401
|
const currentColor = spotlightData?.color || color;
|
|
92961
93402
|
let currentSize = (spotlightData?.size || size4) * pulseScale;
|
|
92962
93403
|
const currentBlur = spotlightData?.blur || blur2;
|
|
92963
93404
|
const currentShape = spotlightData?.shape || shape;
|
|
92964
93405
|
if (waveAnimation) {
|
|
92965
|
-
currentSize *= createWavePattern(
|
|
93406
|
+
currentSize *= createWavePattern(x2, y);
|
|
92966
93407
|
}
|
|
92967
93408
|
if (heatMap) {
|
|
92968
|
-
const heatIntensity = interpolateHeatMap(heatMap.data,
|
|
93409
|
+
const heatIntensity = interpolateHeatMap(heatMap.data, x2, y);
|
|
92969
93410
|
const colorIndex = Math.floor(heatIntensity * (heatMap.colors.length - 1));
|
|
92970
93411
|
const heatColor = heatMap.colors[colorIndex] || currentColor;
|
|
92971
|
-
return `radial-gradient(circle ${currentSize * heatIntensity + currentBlur}px at ${
|
|
93412
|
+
return `radial-gradient(circle ${currentSize * heatIntensity + currentBlur}px at ${x2}px ${y}px, ${heatColor} 0%, transparent 70%)`;
|
|
92972
93413
|
}
|
|
92973
93414
|
const gradientSize = currentSize / 2;
|
|
92974
93415
|
const blurSize = currentBlur;
|
|
@@ -92984,19 +93425,19 @@ var SpotlightInternal = ({
|
|
|
92984
93425
|
(col, idx) => `${col} ${idx / (gradientColors.length - 1) * 70}%`
|
|
92985
93426
|
).join(", ");
|
|
92986
93427
|
if (currentShape === "ellipse") {
|
|
92987
|
-
return `radial-gradient(ellipse ${gradientSize * 1.5}px ${gradientSize}px at ${
|
|
93428
|
+
return `radial-gradient(ellipse ${gradientSize * 1.5}px ${gradientSize}px at ${x2}px ${y}px, ${colorStops}, transparent 70%)`;
|
|
92988
93429
|
}
|
|
92989
|
-
return `radial-gradient(circle ${gradientSize + blurSize}px at ${
|
|
93430
|
+
return `radial-gradient(circle ${gradientSize + blurSize}px at ${x2}px ${y}px, ${colorStops}, transparent 70%)`;
|
|
92990
93431
|
}
|
|
92991
93432
|
if (direction !== void 0) {
|
|
92992
|
-
return `conic-gradient(from ${direction + rotation}deg at ${
|
|
93433
|
+
return `conic-gradient(from ${direction + rotation}deg at ${x2}px ${y}px, transparent 0deg, ${currentColor} 30deg, transparent 60deg)`;
|
|
92993
93434
|
}
|
|
92994
93435
|
if (currentShape === "ellipse") {
|
|
92995
|
-
return `radial-gradient(ellipse ${gradientSize * 1.5}px ${gradientSize}px at ${
|
|
93436
|
+
return `radial-gradient(ellipse ${gradientSize * 1.5}px ${gradientSize}px at ${x2}px ${y}px, ${currentColor} 0%, transparent 50%)`;
|
|
92996
93437
|
} else if (["polygon", "star", "heart"].includes(currentShape)) {
|
|
92997
|
-
return `radial-gradient(circle ${gradientSize + blurSize}px at ${
|
|
93438
|
+
return `radial-gradient(circle ${gradientSize + blurSize}px at ${x2}px ${y}px, ${currentColor} 0%, transparent 70%)`;
|
|
92998
93439
|
}
|
|
92999
|
-
return `radial-gradient(circle ${gradientSize + blurSize}px at ${
|
|
93440
|
+
return `radial-gradient(circle ${gradientSize + blurSize}px at ${x2}px ${y}px, ${currentColor} 0%, transparent 70%)`;
|
|
93000
93441
|
};
|
|
93001
93442
|
const createGridOverlay = () => {
|
|
93002
93443
|
if (!gridOverlay)
|
|
@@ -93451,9 +93892,9 @@ var GlowEffectInternal = ({
|
|
|
93451
93892
|
if (!mouseTracking || !containerRef.current)
|
|
93452
93893
|
return;
|
|
93453
93894
|
const rect = containerRef.current.getBoundingClientRect();
|
|
93454
|
-
const
|
|
93895
|
+
const x2 = e.clientX - rect.left;
|
|
93455
93896
|
const y = e.clientY - rect.top;
|
|
93456
|
-
setMousePosition({ x, y });
|
|
93897
|
+
setMousePosition({ x: x2, y });
|
|
93457
93898
|
}, [mouseTracking]);
|
|
93458
93899
|
const getMouseGlow = () => {
|
|
93459
93900
|
if (!mouseTracking || !shouldApplyEffect())
|
|
@@ -94288,30 +94729,30 @@ var NumberTickerInternal = ({
|
|
|
94288
94729
|
const [hasAnimated, setHasAnimated] = useState(false);
|
|
94289
94730
|
const elementRef = useRef(null);
|
|
94290
94731
|
const animationRef = useRef(null);
|
|
94291
|
-
const getEasingFunction = (
|
|
94732
|
+
const getEasingFunction = (t2) => {
|
|
94292
94733
|
switch (easing) {
|
|
94293
94734
|
case "linear":
|
|
94294
|
-
return
|
|
94735
|
+
return t2;
|
|
94295
94736
|
case "ease-in":
|
|
94296
|
-
return
|
|
94737
|
+
return t2 * t2;
|
|
94297
94738
|
case "ease-out":
|
|
94298
|
-
return 1 - Math.pow(1 -
|
|
94739
|
+
return 1 - Math.pow(1 - t2, 2);
|
|
94299
94740
|
case "ease-in-out":
|
|
94300
|
-
return
|
|
94741
|
+
return t2 < 0.5 ? 2 * t2 * t2 : 1 - Math.pow(-2 * t2 + 2, 2) / 2;
|
|
94301
94742
|
case "bounce":
|
|
94302
94743
|
const n1 = 7.5625;
|
|
94303
94744
|
const d1 = 2.75;
|
|
94304
|
-
if (
|
|
94305
|
-
return n1 *
|
|
94306
|
-
} else if (
|
|
94307
|
-
return n1 * (
|
|
94308
|
-
} else if (
|
|
94309
|
-
return n1 * (
|
|
94745
|
+
if (t2 < 1 / d1) {
|
|
94746
|
+
return n1 * t2 * t2;
|
|
94747
|
+
} else if (t2 < 2 / d1) {
|
|
94748
|
+
return n1 * (t2 -= 1.5 / d1) * t2 + 0.75;
|
|
94749
|
+
} else if (t2 < 2.5 / d1) {
|
|
94750
|
+
return n1 * (t2 -= 2.25 / d1) * t2 + 0.9375;
|
|
94310
94751
|
} else {
|
|
94311
|
-
return n1 * (
|
|
94752
|
+
return n1 * (t2 -= 2.625 / d1) * t2 + 0.984375;
|
|
94312
94753
|
}
|
|
94313
94754
|
default:
|
|
94314
|
-
return
|
|
94755
|
+
return t2;
|
|
94315
94756
|
}
|
|
94316
94757
|
};
|
|
94317
94758
|
const formatNumber2 = (num) => {
|
|
@@ -95420,9 +95861,9 @@ var MouseTrailInternal = ({
|
|
|
95420
95861
|
}
|
|
95421
95862
|
particlesRef.current = particles;
|
|
95422
95863
|
}, [length, size4, colors, lifetime]);
|
|
95423
|
-
const drawShape = useCallback((ctx, particle,
|
|
95864
|
+
const drawShape = useCallback((ctx, particle, x2, y) => {
|
|
95424
95865
|
ctx.save();
|
|
95425
|
-
ctx.translate(
|
|
95866
|
+
ctx.translate(x2, y);
|
|
95426
95867
|
if (rotate) {
|
|
95427
95868
|
ctx.rotate(particle.rotation);
|
|
95428
95869
|
}
|
|
@@ -95660,10 +96101,10 @@ var MouseTrailInternal = ({
|
|
|
95660
96101
|
if (!canvas)
|
|
95661
96102
|
return;
|
|
95662
96103
|
const rect = canvas.getBoundingClientRect();
|
|
95663
|
-
const
|
|
96104
|
+
const x2 = e.clientX - rect.left;
|
|
95664
96105
|
const y = e.clientY - rect.top;
|
|
95665
|
-
if (
|
|
95666
|
-
mouseRef.current = { x, y, active: true };
|
|
96106
|
+
if (x2 >= 0 && x2 <= rect.width && y >= 0 && y <= rect.height) {
|
|
96107
|
+
mouseRef.current = { x: x2, y, active: true };
|
|
95667
96108
|
if (!isActive2) {
|
|
95668
96109
|
setIsActive(true);
|
|
95669
96110
|
}
|
|
@@ -95679,10 +96120,10 @@ var MouseTrailInternal = ({
|
|
|
95679
96120
|
return;
|
|
95680
96121
|
const rect = canvas.getBoundingClientRect();
|
|
95681
96122
|
const touch = e.touches[0];
|
|
95682
|
-
const
|
|
96123
|
+
const x2 = touch.clientX - rect.left;
|
|
95683
96124
|
const y = touch.clientY - rect.top;
|
|
95684
|
-
if (
|
|
95685
|
-
mouseRef.current = { x, y, active: true };
|
|
96125
|
+
if (x2 >= 0 && x2 <= rect.width && y >= 0 && y <= rect.height) {
|
|
96126
|
+
mouseRef.current = { x: x2, y, active: true };
|
|
95686
96127
|
if (!isActive2) {
|
|
95687
96128
|
setIsActive(true);
|
|
95688
96129
|
}
|
|
@@ -96465,40 +96906,40 @@ var BounceEffectInternal = ({
|
|
|
96465
96906
|
const [squash, setSquash] = useState({ x: 1, y: 1 });
|
|
96466
96907
|
useRef({ x: 0, y: 0 });
|
|
96467
96908
|
const startTimeRef = useRef(0);
|
|
96468
|
-
const getEasing = (
|
|
96909
|
+
const getEasing = (t2) => {
|
|
96469
96910
|
switch (easing) {
|
|
96470
96911
|
case "linear":
|
|
96471
|
-
return
|
|
96912
|
+
return t2;
|
|
96472
96913
|
case "ease":
|
|
96473
|
-
return
|
|
96914
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
96474
96915
|
case "ease-in":
|
|
96475
|
-
return
|
|
96916
|
+
return t2 * t2;
|
|
96476
96917
|
case "ease-out":
|
|
96477
|
-
return
|
|
96918
|
+
return t2 * (2 - t2);
|
|
96478
96919
|
case "bounce":
|
|
96479
|
-
if (
|
|
96480
|
-
return 7.5625 *
|
|
96481
|
-
} else if (
|
|
96482
|
-
|
|
96483
|
-
return 7.5625 *
|
|
96484
|
-
} else if (
|
|
96485
|
-
|
|
96486
|
-
return 7.5625 *
|
|
96920
|
+
if (t2 < 0.363636) {
|
|
96921
|
+
return 7.5625 * t2 * t2;
|
|
96922
|
+
} else if (t2 < 0.727272) {
|
|
96923
|
+
t2 -= 0.545454;
|
|
96924
|
+
return 7.5625 * t2 * t2 + 0.75;
|
|
96925
|
+
} else if (t2 < 0.90909) {
|
|
96926
|
+
t2 -= 0.818181;
|
|
96927
|
+
return 7.5625 * t2 * t2 + 0.9375;
|
|
96487
96928
|
} else {
|
|
96488
|
-
|
|
96489
|
-
return 7.5625 *
|
|
96929
|
+
t2 -= 0.954545;
|
|
96930
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
96490
96931
|
}
|
|
96491
96932
|
case "elastic":
|
|
96492
|
-
return
|
|
96933
|
+
return t2 === 0 || t2 === 1 ? t2 : -Math.pow(2, 10 * (t2 - 1)) * Math.sin((t2 - 1.1) * 5 * Math.PI);
|
|
96493
96934
|
default:
|
|
96494
|
-
return
|
|
96935
|
+
return t2;
|
|
96495
96936
|
}
|
|
96496
96937
|
};
|
|
96497
96938
|
const calculateBounce = useCallback((time) => {
|
|
96498
96939
|
const elapsed = time - startTimeRef.current;
|
|
96499
96940
|
const progress = Math.min(elapsed / duration, 1);
|
|
96500
96941
|
const easedProgress = getEasing(progress);
|
|
96501
|
-
let
|
|
96942
|
+
let x2 = 0, y = 0;
|
|
96502
96943
|
switch (direction) {
|
|
96503
96944
|
case "up":
|
|
96504
96945
|
y = -distance * Math.sin(easedProgress * Math.PI * bounces) * Math.pow(elasticity, currentBounce);
|
|
@@ -96509,22 +96950,22 @@ var BounceEffectInternal = ({
|
|
|
96509
96950
|
y -= gravity * elapsed * elapsed / 1e4;
|
|
96510
96951
|
break;
|
|
96511
96952
|
case "left":
|
|
96512
|
-
|
|
96953
|
+
x2 = -distance * Math.sin(easedProgress * Math.PI * bounces) * Math.pow(elasticity, currentBounce);
|
|
96513
96954
|
break;
|
|
96514
96955
|
case "right":
|
|
96515
|
-
|
|
96956
|
+
x2 = distance * Math.sin(easedProgress * Math.PI * bounces) * Math.pow(elasticity, currentBounce);
|
|
96516
96957
|
break;
|
|
96517
96958
|
case "all":
|
|
96518
96959
|
const angle = elapsed * 0.01;
|
|
96519
|
-
|
|
96960
|
+
x2 = distance * Math.cos(angle) * Math.sin(easedProgress * Math.PI * bounces) * Math.pow(elasticity, currentBounce);
|
|
96520
96961
|
y = -Math.abs(distance * Math.sin(easedProgress * Math.PI * bounces) * Math.pow(elasticity, currentBounce));
|
|
96521
96962
|
y += gravity * elapsed * elapsed / 1e4;
|
|
96522
96963
|
break;
|
|
96523
96964
|
}
|
|
96524
|
-
|
|
96965
|
+
x2 *= friction;
|
|
96525
96966
|
y *= friction;
|
|
96526
96967
|
if (shake) {
|
|
96527
|
-
|
|
96968
|
+
x2 += (Math.random() - 0.5) * shakeIntensity * (1 - progress);
|
|
96528
96969
|
y += (Math.random() - 0.5) * shakeIntensity * (1 - progress);
|
|
96529
96970
|
}
|
|
96530
96971
|
if (rotate) {
|
|
@@ -96542,9 +96983,9 @@ var BounceEffectInternal = ({
|
|
|
96542
96983
|
}
|
|
96543
96984
|
if (jelly) {
|
|
96544
96985
|
const jellyOffset = Math.sin(elapsed * 0.02) * jellyIntensity * distance;
|
|
96545
|
-
|
|
96986
|
+
x2 += jellyOffset;
|
|
96546
96987
|
}
|
|
96547
|
-
setPosition({ x, y });
|
|
96988
|
+
setPosition({ x: x2, y });
|
|
96548
96989
|
if (progress >= 1) {
|
|
96549
96990
|
setCurrentBounce((prev) => prev + 1);
|
|
96550
96991
|
if (currentBounce >= bounces - 1) {
|
|
@@ -96671,7 +97112,7 @@ var BounceEffectInternal = ({
|
|
|
96671
97112
|
onMouseEnter: handleMouseEnter,
|
|
96672
97113
|
onClick: handleClick2,
|
|
96673
97114
|
children: [
|
|
96674
|
-
trail && isAnimating && Array.from({ length: trailCount }).map((
|
|
97115
|
+
trail && isAnimating && Array.from({ length: trailCount }).map((_2, i) => /* @__PURE__ */ jsx(
|
|
96675
97116
|
"div",
|
|
96676
97117
|
{
|
|
96677
97118
|
className: "absolute inset-0 pointer-events-none",
|
|
@@ -97210,46 +97651,46 @@ var ElasticAnimationInternal = ({
|
|
|
97210
97651
|
const [morphIndex, setMorphIndex] = useState(0);
|
|
97211
97652
|
const startTimeRef = useRef(0);
|
|
97212
97653
|
const animationPhaseRef = useRef("main");
|
|
97213
|
-
const getEasingValue = (
|
|
97654
|
+
const getEasingValue = (t2) => {
|
|
97214
97655
|
switch (easing) {
|
|
97215
97656
|
case "linear":
|
|
97216
|
-
return
|
|
97657
|
+
return t2;
|
|
97217
97658
|
case "ease-in":
|
|
97218
|
-
return
|
|
97659
|
+
return t2 * t2;
|
|
97219
97660
|
case "ease-out":
|
|
97220
|
-
return
|
|
97661
|
+
return t2 * (2 - t2);
|
|
97221
97662
|
case "ease-in-out":
|
|
97222
|
-
return
|
|
97663
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
97223
97664
|
case "elastic":
|
|
97224
|
-
if (
|
|
97225
|
-
return
|
|
97665
|
+
if (t2 === 0 || t2 === 1)
|
|
97666
|
+
return t2;
|
|
97226
97667
|
const p = 0.3;
|
|
97227
97668
|
const s = p / 4;
|
|
97228
|
-
return Math.pow(2, -10 *
|
|
97669
|
+
return Math.pow(2, -10 * t2) * Math.sin((t2 - s) * (2 * Math.PI) / p) + 1;
|
|
97229
97670
|
case "bounce":
|
|
97230
|
-
if (
|
|
97231
|
-
return 7.5625 *
|
|
97232
|
-
} else if (
|
|
97233
|
-
|
|
97234
|
-
return 7.5625 *
|
|
97235
|
-
} else if (
|
|
97236
|
-
|
|
97237
|
-
return 7.5625 *
|
|
97671
|
+
if (t2 < 0.363636) {
|
|
97672
|
+
return 7.5625 * t2 * t2;
|
|
97673
|
+
} else if (t2 < 0.727272) {
|
|
97674
|
+
t2 -= 0.545454;
|
|
97675
|
+
return 7.5625 * t2 * t2 + 0.75;
|
|
97676
|
+
} else if (t2 < 0.90909) {
|
|
97677
|
+
t2 -= 0.818181;
|
|
97678
|
+
return 7.5625 * t2 * t2 + 0.9375;
|
|
97238
97679
|
} else {
|
|
97239
|
-
|
|
97240
|
-
return 7.5625 *
|
|
97680
|
+
t2 -= 0.954545;
|
|
97681
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
97241
97682
|
}
|
|
97242
97683
|
default:
|
|
97243
|
-
return
|
|
97684
|
+
return t2;
|
|
97244
97685
|
}
|
|
97245
97686
|
};
|
|
97246
97687
|
const calculateElasticMotion = useCallback((progress) => {
|
|
97247
97688
|
const elasticProgress = getEasingValue(progress);
|
|
97248
|
-
let
|
|
97689
|
+
let x2 = 0, y = 0, scale = 1, rotate = 0, skewX = 0, skewY = 0;
|
|
97249
97690
|
if (direction === "horizontal" || direction === "both") {
|
|
97250
|
-
|
|
97691
|
+
x2 = distance * elasticProgress * Math.cos(progress * Math.PI * 2 * oscillationCount);
|
|
97251
97692
|
if (oscillate) {
|
|
97252
|
-
|
|
97693
|
+
x2 *= Math.pow(1 - progress, damping);
|
|
97253
97694
|
}
|
|
97254
97695
|
}
|
|
97255
97696
|
if (direction === "vertical" || direction === "both") {
|
|
@@ -97260,17 +97701,17 @@ var ElasticAnimationInternal = ({
|
|
|
97260
97701
|
}
|
|
97261
97702
|
if (direction === "diagonal") {
|
|
97262
97703
|
const angle = progress * Math.PI * 2 * oscillationCount;
|
|
97263
|
-
|
|
97704
|
+
x2 = distance * elasticProgress * Math.cos(angle);
|
|
97264
97705
|
y = distance * elasticProgress * Math.sin(angle);
|
|
97265
97706
|
if (oscillate) {
|
|
97266
97707
|
const dampingFactor = Math.pow(1 - progress, damping);
|
|
97267
|
-
|
|
97708
|
+
x2 *= dampingFactor;
|
|
97268
97709
|
y *= dampingFactor;
|
|
97269
97710
|
}
|
|
97270
97711
|
}
|
|
97271
97712
|
if (rubberBand) {
|
|
97272
97713
|
const rubberProgress = Math.sin(progress * Math.PI);
|
|
97273
|
-
|
|
97714
|
+
x2 *= 1 + rubberProgress * rubberBandIntensity;
|
|
97274
97715
|
scale = 1 + rubberProgress * 0.1 * rubberBandIntensity;
|
|
97275
97716
|
}
|
|
97276
97717
|
if (jello) {
|
|
@@ -97280,7 +97721,7 @@ var ElasticAnimationInternal = ({
|
|
|
97280
97721
|
}
|
|
97281
97722
|
if (morph && morphTargets.length > 0) {
|
|
97282
97723
|
const target = morphTargets[morphIndex % morphTargets.length];
|
|
97283
|
-
|
|
97724
|
+
x2 += target.x * elasticProgress;
|
|
97284
97725
|
y += target.y * elasticProgress;
|
|
97285
97726
|
if (target.scale)
|
|
97286
97727
|
scale *= target.scale;
|
|
@@ -97295,12 +97736,12 @@ var ElasticAnimationInternal = ({
|
|
|
97295
97736
|
skewX += (stretchX - 1) * 10;
|
|
97296
97737
|
}
|
|
97297
97738
|
if (anticipation && animationPhaseRef.current === "anticipation") {
|
|
97298
|
-
|
|
97739
|
+
x2 -= anticipationDistance * (1 - progress * 4);
|
|
97299
97740
|
scale *= 0.95 + progress * 0.05;
|
|
97300
97741
|
}
|
|
97301
97742
|
if (followThrough && animationPhaseRef.current === "follow-through") {
|
|
97302
97743
|
const overshoot = Math.sin(progress * Math.PI) * followThroughOvershoot;
|
|
97303
|
-
|
|
97744
|
+
x2 *= overshoot;
|
|
97304
97745
|
y *= overshoot;
|
|
97305
97746
|
}
|
|
97306
97747
|
if (arcMotion) {
|
|
@@ -97315,10 +97756,10 @@ var ElasticAnimationInternal = ({
|
|
|
97315
97756
|
scale *= 1 + (pulseScale - 1) * pulseProgress * (1 - progress);
|
|
97316
97757
|
}
|
|
97317
97758
|
if (shake) {
|
|
97318
|
-
|
|
97759
|
+
x2 += (Math.random() - 0.5) * shakeIntensity * (1 - progress);
|
|
97319
97760
|
y += (Math.random() - 0.5) * shakeIntensity * (1 - progress);
|
|
97320
97761
|
}
|
|
97321
|
-
return { x, y, scale, rotate, skewX, skewY };
|
|
97762
|
+
return { x: x2, y, scale, rotate, skewX, skewY };
|
|
97322
97763
|
}, [
|
|
97323
97764
|
direction,
|
|
97324
97765
|
distance,
|
|
@@ -97612,21 +98053,21 @@ var PathAnimationsInternal = ({
|
|
|
97612
98053
|
svgRef.current.removeChild(tempPath);
|
|
97613
98054
|
}
|
|
97614
98055
|
}, [getPathString]);
|
|
97615
|
-
const getEasingValue = (
|
|
98056
|
+
const getEasingValue = (t2) => {
|
|
97616
98057
|
switch (easing) {
|
|
97617
98058
|
case "linear":
|
|
97618
|
-
return
|
|
98059
|
+
return t2;
|
|
97619
98060
|
case "ease-in":
|
|
97620
|
-
return
|
|
98061
|
+
return t2 * t2;
|
|
97621
98062
|
case "ease-out":
|
|
97622
|
-
return
|
|
98063
|
+
return t2 * (2 - t2);
|
|
97623
98064
|
case "ease-in-out":
|
|
97624
|
-
return
|
|
98065
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
97625
98066
|
case "cubic-bezier":
|
|
97626
98067
|
const [x1, y1, x2, y2] = cubicBezier;
|
|
97627
|
-
return
|
|
98068
|
+
return t2 * (3 * (1 - t2) * (1 - t2) * y1 + 3 * (1 - t2) * t2 * y2 + t2 * t2);
|
|
97628
98069
|
default:
|
|
97629
|
-
return
|
|
98070
|
+
return t2;
|
|
97630
98071
|
}
|
|
97631
98072
|
};
|
|
97632
98073
|
const calculatePathPosition = useCallback((progress) => {
|
|
@@ -98047,21 +98488,21 @@ var SVGAnimationsInternal = ({
|
|
|
98047
98488
|
});
|
|
98048
98489
|
}
|
|
98049
98490
|
}, [type, drawOptions.fadeIn]);
|
|
98050
|
-
const getEasingValue = (
|
|
98491
|
+
const getEasingValue = (t2) => {
|
|
98051
98492
|
switch (easing) {
|
|
98052
98493
|
case "linear":
|
|
98053
|
-
return
|
|
98494
|
+
return t2;
|
|
98054
98495
|
case "ease-in":
|
|
98055
|
-
return
|
|
98496
|
+
return t2 * t2;
|
|
98056
98497
|
case "ease-out":
|
|
98057
|
-
return
|
|
98498
|
+
return t2 * (2 - t2);
|
|
98058
98499
|
case "ease-in-out":
|
|
98059
|
-
return
|
|
98500
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
98060
98501
|
case "cubic-bezier":
|
|
98061
98502
|
const [x1, y1, x2, y2] = cubicBezier;
|
|
98062
|
-
return
|
|
98503
|
+
return t2 * (3 * (1 - t2) * (1 - t2) * y1 + 3 * (1 - t2) * t2 * y2 + t2 * t2);
|
|
98063
98504
|
default:
|
|
98064
|
-
return
|
|
98505
|
+
return t2;
|
|
98065
98506
|
}
|
|
98066
98507
|
};
|
|
98067
98508
|
const animateDraw = useCallback((progress) => {
|
|
@@ -98797,10 +99238,10 @@ var TouchGesturesInternal = ({
|
|
|
98797
99238
|
const getAngle = (p1, p2) => {
|
|
98798
99239
|
return Math.atan2(p2.currentY - p1.currentY, p2.currentX - p1.currentX) * 180 / Math.PI;
|
|
98799
99240
|
};
|
|
98800
|
-
const applyBoundaries = useCallback((
|
|
99241
|
+
const applyBoundaries = useCallback((x2, y) => {
|
|
98801
99242
|
if (!panBoundaries)
|
|
98802
|
-
return { x, y };
|
|
98803
|
-
const bounded = { x, y };
|
|
99243
|
+
return { x: x2, y };
|
|
99244
|
+
const bounded = { x: x2, y };
|
|
98804
99245
|
if (panBoundaries.left !== void 0) {
|
|
98805
99246
|
bounded.x = Math.max(panBoundaries.left, bounded.x);
|
|
98806
99247
|
}
|
|
@@ -98881,7 +99322,7 @@ var TouchGesturesInternal = ({
|
|
|
98881
99322
|
cancelAnimationFrame(momentumAnimationRef.current);
|
|
98882
99323
|
}
|
|
98883
99324
|
if (indicators) {
|
|
98884
|
-
setIndicatorPositions(touchArray.map((
|
|
99325
|
+
setIndicatorPositions(touchArray.map((t2) => ({ x: t2.clientX, y: t2.clientY })));
|
|
98885
99326
|
}
|
|
98886
99327
|
};
|
|
98887
99328
|
const handleTouchMove = (e) => {
|
|
@@ -98939,7 +99380,7 @@ var TouchGesturesInternal = ({
|
|
|
98939
99380
|
clearTimeout(longPressTimerRef.current);
|
|
98940
99381
|
}
|
|
98941
99382
|
if (indicators) {
|
|
98942
|
-
setIndicatorPositions(touchArray.map((
|
|
99383
|
+
setIndicatorPositions(touchArray.map((t2) => ({ x: t2.clientX, y: t2.clientY })));
|
|
98943
99384
|
}
|
|
98944
99385
|
};
|
|
98945
99386
|
const handleTouchEnd = (e) => {
|
|
@@ -99681,22 +100122,22 @@ var ClickAnimationsInternal = ({
|
|
|
99681
100122
|
setLongPressTimeout(null);
|
|
99682
100123
|
}
|
|
99683
100124
|
}, [longPressTimeout]);
|
|
99684
|
-
const getEasingFunction = useCallback((type,
|
|
100125
|
+
const getEasingFunction = useCallback((type, t2) => {
|
|
99685
100126
|
switch (type) {
|
|
99686
100127
|
case "ease":
|
|
99687
|
-
return
|
|
100128
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
99688
100129
|
case "ease-in":
|
|
99689
|
-
return
|
|
100130
|
+
return t2 * t2;
|
|
99690
100131
|
case "ease-out":
|
|
99691
|
-
return
|
|
100132
|
+
return t2 * (2 - t2);
|
|
99692
100133
|
case "ease-in-out":
|
|
99693
|
-
return
|
|
100134
|
+
return t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2;
|
|
99694
100135
|
case "bounce":
|
|
99695
|
-
return 1 - Math.pow(1 -
|
|
100136
|
+
return 1 - Math.pow(1 - t2, 3) * Math.cos(t2 * Math.PI * 4);
|
|
99696
100137
|
case "elastic":
|
|
99697
|
-
return
|
|
100138
|
+
return t2 === 0 ? 0 : t2 === 1 ? 1 : -Math.pow(2, 10 * (t2 - 1)) * Math.sin((t2 - 1.1) * 5 * Math.PI);
|
|
99698
100139
|
default:
|
|
99699
|
-
return
|
|
100140
|
+
return t2;
|
|
99700
100141
|
}
|
|
99701
100142
|
}, []);
|
|
99702
100143
|
const getAnimationStyles = useCallback((animation) => {
|