unframer 3.2.0 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +4 -4
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +106 -7
  4. package/dist/cli.js.map +1 -1
  5. package/dist/css.d.ts +5 -0
  6. package/dist/css.d.ts.map +1 -1
  7. package/dist/css.js +25 -0
  8. package/dist/css.js.map +1 -1
  9. package/dist/exporter.d.ts.map +1 -1
  10. package/dist/exporter.js +38 -4
  11. package/dist/exporter.js.map +1 -1
  12. package/dist/framer-chunks/chunk-VUHWYTYT.d.ts +15 -0
  13. package/dist/framer-chunks/chunk-VUHWYTYT.d.ts.map +1 -0
  14. package/dist/framer-chunks/chunk-VUHWYTYT.js +111 -0
  15. package/dist/framer-chunks/chunk-VUHWYTYT.js.map +1 -0
  16. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts +634 -0
  17. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts.map +1 -0
  18. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +8 -0
  19. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js.map +1 -0
  20. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts +115 -0
  21. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts.map +1 -0
  22. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +8 -0
  23. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js.map +1 -0
  24. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts +781 -0
  25. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts.map +1 -0
  26. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +8 -0
  27. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js.map +1 -0
  28. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts +18 -0
  29. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts.map +1 -0
  30. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +8 -0
  31. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js.map +1 -0
  32. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts +1566 -0
  33. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts.map +1 -0
  34. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.js +8 -0
  35. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.js.map +1 -0
  36. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts +3588 -0
  37. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts.map +1 -0
  38. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +8 -0
  39. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.js.map +1 -0
  40. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts +10293 -0
  41. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts.map +1 -0
  42. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +8 -0
  43. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.js.map +1 -0
  44. package/dist/framer.js +1480 -907
  45. package/dist/generated/api-client.d.ts +1 -1
  46. package/dist/generated/api-client.d.ts.map +1 -1
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +6 -1
  50. package/dist/index.js.map +1 -1
  51. package/dist/package-manager.d.ts +1 -1
  52. package/dist/package-manager.d.ts.map +1 -1
  53. package/dist/package-manager.js.map +1 -1
  54. package/dist/stackblitz.d.ts +9 -0
  55. package/dist/stackblitz.d.ts.map +1 -0
  56. package/dist/stackblitz.js +182 -0
  57. package/dist/stackblitz.js.map +1 -0
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/esm/cli.d.ts.map +1 -1
  61. package/esm/cli.js +108 -9
  62. package/esm/cli.js.map +1 -1
  63. package/esm/css.d.ts +5 -0
  64. package/esm/css.d.ts.map +1 -1
  65. package/esm/css.js +24 -0
  66. package/esm/css.js.map +1 -1
  67. package/esm/exporter.d.ts.map +1 -1
  68. package/esm/exporter.js +38 -4
  69. package/esm/exporter.js.map +1 -1
  70. package/esm/framer-chunks/chunk-VUHWYTYT.d.ts +15 -0
  71. package/esm/framer-chunks/chunk-VUHWYTYT.d.ts.map +1 -0
  72. package/esm/framer-chunks/chunk-VUHWYTYT.js +96 -0
  73. package/esm/framer-chunks/chunk-VUHWYTYT.js.map +1 -0
  74. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts +634 -0
  75. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts.map +1 -0
  76. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +5 -0
  77. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js.map +1 -0
  78. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts +115 -0
  79. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts.map +1 -0
  80. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +5 -0
  81. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js.map +1 -0
  82. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts +781 -0
  83. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts.map +1 -0
  84. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +5 -0
  85. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js.map +1 -0
  86. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts +18 -0
  87. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts.map +1 -0
  88. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +5 -0
  89. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js.map +1 -0
  90. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts +1566 -0
  91. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts.map +1 -0
  92. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.js +5 -0
  93. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.js.map +1 -0
  94. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts +3588 -0
  95. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts.map +1 -0
  96. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +5 -0
  97. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.js.map +1 -0
  98. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts +10293 -0
  99. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts.map +1 -0
  100. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +5 -0
  101. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.js.map +1 -0
  102. package/esm/framer.js +1217 -647
  103. package/esm/index.d.ts +3 -0
  104. package/esm/index.d.ts.map +1 -1
  105. package/esm/index.js +4 -0
  106. package/esm/index.js.map +1 -1
  107. package/esm/package-manager.d.ts +1 -1
  108. package/esm/package-manager.d.ts.map +1 -1
  109. package/esm/package-manager.js.map +1 -1
  110. package/esm/stackblitz.d.ts +9 -0
  111. package/esm/stackblitz.d.ts.map +1 -0
  112. package/esm/stackblitz.js +179 -0
  113. package/esm/stackblitz.js.map +1 -0
  114. package/esm/version.d.ts +1 -1
  115. package/esm/version.js +1 -1
  116. package/package.json +3 -3
  117. package/src/cli.ts +122 -11
  118. package/src/{css.ts → css.tsx} +38 -0
  119. package/src/exporter.ts +45 -4
  120. package/src/framer-chunks/chunk-VUHWYTYT.js +105 -0
  121. package/src/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +7 -0
  122. package/src/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +7 -0
  123. package/src/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +7 -0
  124. package/src/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +7 -0
  125. package/src/framer-chunks/google-63PUBKA6-AMAUIPXM.js +7 -0
  126. package/src/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +7 -0
  127. package/src/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +7 -0
  128. package/src/framer.js +1210 -632
  129. package/src/index.ts +6 -0
  130. package/src/package-manager.ts +2 -4
  131. package/src/stackblitz.ts +193 -0
  132. package/src/styles/framer.css +24 -0
  133. package/src/version.ts +1 -1
package/src/framer.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  __toESM,
14
14
  } from './framer-chunks/chunk-A2PMVMFI.js';
15
15
 
16
- // /:https://app.framerstatic.com/chunk-BLFSVU7M.mjs
16
+ // /:https://app.framerstatic.com/chunk-VDW2YK33.mjs
17
17
  import { createContext, } from 'react';
18
18
  import { useEffect, useLayoutEffect, } from 'react';
19
19
  import { useCallback, useContext, useId, } from 'react';
@@ -343,7 +343,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
343
343
  isProcessing: false,
344
344
  };
345
345
  const flagRunNextFrame = () => runNextFrame = true;
346
- const steps2 = stepsOrder.reduce((acc, key7,) => {
346
+ const steps22 = stepsOrder.reduce((acc, key7,) => {
347
347
  acc[key7] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key7 : void 0,);
348
348
  return acc;
349
349
  }, {},);
@@ -356,7 +356,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
356
356
  preRender,
357
357
  render,
358
358
  postRender,
359
- } = steps2;
359
+ } = steps22;
360
360
  const processBatch = () => {
361
361
  const timestamp = MotionGlobalConfig.useManualTiming ? state.timestamp : performance.now();
362
362
  runNextFrame = false;
@@ -387,7 +387,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
387
387
  }
388
388
  };
389
389
  const schedule = stepsOrder.reduce((acc, key7,) => {
390
- const step2 = steps2[key7];
390
+ const step2 = steps22[key7];
391
391
  acc[key7] = (process2, keepAlive = false, immediate = false,) => {
392
392
  if (!runNextFrame) wake();
393
393
  return step2.schedule(process2, keepAlive, immediate,);
@@ -396,14 +396,14 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
396
396
  }, {},);
397
397
  const cancel = (process2) => {
398
398
  for (let i = 0; i < stepsOrder.length; i++) {
399
- steps2[stepsOrder[i]].cancel(process2,);
399
+ steps22[stepsOrder[i]].cancel(process2,);
400
400
  }
401
401
  };
402
402
  return {
403
403
  schedule,
404
404
  cancel,
405
405
  state,
406
- steps: steps2,
406
+ steps: steps22,
407
407
  };
408
408
  }
409
409
  var {
@@ -569,6 +569,11 @@ var color = {
569
569
  transform: (v) => {
570
570
  return typeof v === 'string' ? v : v.hasOwnProperty('red',) ? rgba.transform(v,) : hsla.transform(v,);
571
571
  },
572
+ getAnimatableNone: (v) => {
573
+ const parsed = color.parse(v,);
574
+ parsed.alpha = 0;
575
+ return color.transform(parsed,);
576
+ },
572
577
  };
573
578
  var colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
574
579
  function test(v,) {
@@ -646,7 +651,7 @@ function createTransformer(source,) {
646
651
  return output;
647
652
  };
648
653
  }
649
- var convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v;
654
+ var convertNumbersToZero = (v) => typeof v === 'number' ? 0 : color.test(v,) ? color.getAnimatableNone(v,) : v;
650
655
  function getAnimatableNone(v,) {
651
656
  const parsed = parseComplexValue(v,);
652
657
  const transformer = createTransformer(v,);
@@ -833,7 +838,7 @@ var generateLinearEasing = (easing, duration, resolution = 10,) => {
833
838
  let points = '';
834
839
  const numPoints = Math.max(Math.round(duration / resolution,), 2,);
835
840
  for (let i = 0; i < numPoints; i++) {
836
- points += easing(i / (numPoints - 1),) + ', ';
841
+ points += Math.round(easing(i / (numPoints - 1),) * 1e4,) / 1e4 + ', ';
837
842
  }
838
843
  return `linear(${points.substring(0, points.length - 2,)})`;
839
844
  };
@@ -4064,7 +4069,7 @@ function addToQueue(builder,) {
4064
4069
  }
4065
4070
  var ViewTransitionBuilder = class {
4066
4071
  constructor(update, options = {},) {
4067
- this.currentTarget = 'root';
4072
+ this.currentSubject = 'root';
4068
4073
  this.targets = /* @__PURE__ */ new Map();
4069
4074
  this.notifyReady = noop;
4070
4075
  this.readyPromise = new Promise((resolve) => {
@@ -4077,8 +4082,8 @@ var ViewTransitionBuilder = class {
4077
4082
  };
4078
4083
  addToQueue(this,);
4079
4084
  }
4080
- get(selector,) {
4081
- this.currentTarget = selector;
4085
+ get(subject,) {
4086
+ this.currentSubject = subject;
4082
4087
  return this;
4083
4088
  }
4084
4089
  layout(keyframes2, options,) {
@@ -4112,13 +4117,13 @@ var ViewTransitionBuilder = class {
4112
4117
  }
4113
4118
  updateTarget(target, keyframes2, options = {},) {
4114
4119
  const {
4115
- currentTarget,
4120
+ currentSubject,
4116
4121
  targets,
4117
4122
  } = this;
4118
- if (!targets.has(currentTarget,)) {
4119
- targets.set(currentTarget, {},);
4123
+ if (!targets.has(currentSubject,)) {
4124
+ targets.set(currentSubject, {},);
4120
4125
  }
4121
- const targetData = targets.get(currentTarget,);
4126
+ const targetData = targets.get(currentSubject,);
4122
4127
  targetData[target] = {
4123
4128
  keyframes: keyframes2,
4124
4129
  options,
@@ -4198,6 +4203,7 @@ function PopChild({
4198
4203
  children,
4199
4204
  isPresent: isPresent2,
4200
4205
  anchorX,
4206
+ root,
4201
4207
  },) {
4202
4208
  const id4 = useId();
4203
4209
  const ref = useRef3(null,);
@@ -4224,7 +4230,8 @@ function PopChild({
4224
4230
  ref.current.dataset.motionPopId = id4;
4225
4231
  const style2 = document.createElement('style',);
4226
4232
  if (nonce) style2.nonce = nonce;
4227
- document.head.appendChild(style2,);
4233
+ const parent = root ?? document.head;
4234
+ parent.appendChild(style2,);
4228
4235
  if (style2.sheet) {
4229
4236
  style2.sheet.insertRule(`
4230
4237
  [data-motion-pop-id="${id4}"] {
@@ -4237,8 +4244,9 @@ function PopChild({
4237
4244
  `,);
4238
4245
  }
4239
4246
  return () => {
4240
- if (document.head.contains(style2,)) {
4241
- document.head.removeChild(style2,);
4247
+ parent.removeChild(style2,);
4248
+ if (parent.contains(style2,)) {
4249
+ parent.removeChild(style2,);
4242
4250
  }
4243
4251
  };
4244
4252
  }, [isPresent2,],);
@@ -4260,6 +4268,7 @@ var PresenceChild = ({
4260
4268
  presenceAffectsLayout,
4261
4269
  mode,
4262
4270
  anchorX,
4271
+ root,
4263
4272
  },) => {
4264
4273
  const presenceChildren = useConstant(newChildrenMap,);
4265
4274
  const id4 = useId();
@@ -4299,6 +4308,7 @@ var PresenceChild = ({
4299
4308
  children = jsx3(PopChild, {
4300
4309
  isPresent: isPresent2,
4301
4310
  anchorX,
4311
+ root,
4302
4312
  children,
4303
4313
  },);
4304
4314
  }
@@ -4327,6 +4337,7 @@ var AnimatePresence = ({
4327
4337
  mode = 'sync',
4328
4338
  propagate = false,
4329
4339
  anchorX = 'left',
4340
+ root,
4330
4341
  },) => {
4331
4342
  const [isParentPresent, safeToRemove,] = usePresence(propagate,);
4332
4343
  const presentChildren = useMemo2(() => onlyElements(children,), [children,],);
@@ -4403,6 +4414,7 @@ var AnimatePresence = ({
4403
4414
  custom,
4404
4415
  presenceAffectsLayout,
4405
4416
  mode,
4417
+ root,
4406
4418
  onExitComplete: isPresent2 ? void 0 : onExit,
4407
4419
  anchorX,
4408
4420
  children: child,
@@ -4586,7 +4598,7 @@ function isValidMotionProp(key7,) {
4586
4598
  }
4587
4599
  var shouldForward = (key7) => !isValidMotionProp(key7,);
4588
4600
  function loadExternalIsValidProp(isValidProp,) {
4589
- if (!isValidProp) return;
4601
+ if (typeof isValidProp !== 'function') return;
4590
4602
  shouldForward = (key7) => key7.startsWith('on',) ? !isValidMotionProp(key7,) : isValidProp(key7,);
4591
4603
  }
4592
4604
  try {
@@ -7979,6 +7991,7 @@ function createProjectionNode2({
7979
7991
  constructor(latestValues = {}, parent = defaultParent == null ? void 0 : defaultParent(),) {
7980
7992
  this.id = id2++;
7981
7993
  this.animationId = 0;
7994
+ this.animationCommitId = 0;
7982
7995
  this.children = /* @__PURE__ */ new Set();
7983
7996
  this.options = {};
7984
7997
  this.isTreeAnimating = false;
@@ -8211,9 +8224,14 @@ function createProjectionNode2({
8211
8224
  this.nodes.forEach(clearMeasurements,);
8212
8225
  return;
8213
8226
  }
8227
+ if (this.animationId <= this.animationCommitId) {
8228
+ this.nodes.forEach(clearIsLayoutDirty,);
8229
+ return;
8230
+ }
8214
8231
  if (!this.isUpdating) {
8215
8232
  this.nodes.forEach(clearIsLayoutDirty,);
8216
8233
  }
8234
+ this.animationCommitId = this.animationId;
8217
8235
  this.isUpdating = false;
8218
8236
  this.nodes.forEach(resetTransformStyle,);
8219
8237
  this.nodes.forEach(updateLayout,);
@@ -10190,6 +10208,8 @@ function calcNextTime(current2, next2, prev, labels,) {
10190
10208
  return Math.max(0, current2 + parseFloat(next2,),);
10191
10209
  } else if (next2 === '<') {
10192
10210
  return prev;
10211
+ } else if (next2.startsWith('<',)) {
10212
+ return Math.max(0, prev + parseFloat(next2.slice(1,),),);
10193
10213
  } else {
10194
10214
  return labels.get(next2,) ?? current2;
10195
10215
  }
@@ -10277,7 +10297,7 @@ function createAnimationsFromSequence(
10277
10297
  } = valueTransition;
10278
10298
  const calculatedDelay = typeof delay2 === 'function' ? delay2(elementIndex, numSubjects,) : delay2;
10279
10299
  const numKeyframes = valueKeyframesAsList.length;
10280
- const createGenerator = isGenerator(type,) ? type : generators == null ? void 0 : generators[type];
10300
+ const createGenerator = isGenerator(type,) ? type : generators == null ? void 0 : generators[type || 'keyframes'];
10281
10301
  if (numKeyframes <= 2 && createGenerator) {
10282
10302
  let absoluteDelta = 100;
10283
10303
  if (numKeyframes === 2 && isNumberKeyframesArray(valueKeyframesAsList,)) {
@@ -10553,6 +10573,9 @@ function createScopedAnimate(scope,) {
10553
10573
  const animation = new GroupAnimationWithThen(animations2,);
10554
10574
  if (scope) {
10555
10575
  scope.animations.push(animation,);
10576
+ animation.finished.then(() => {
10577
+ removeItem(scope.animations, animation,);
10578
+ },);
10556
10579
  }
10557
10580
  return animation;
10558
10581
  }
@@ -10568,6 +10591,7 @@ function useAnimate() {
10568
10591
  const animate22 = useConstant(() => createScopedAnimate(scope,));
10569
10592
  useUnmountEffect(() => {
10570
10593
  scope.animations.forEach((animation) => animation.stop());
10594
+ scope.animations.length = 0;
10571
10595
  },);
10572
10596
  return [scope, animate22,];
10573
10597
  }
@@ -10841,6 +10865,20 @@ function useInstantTransition() {
10841
10865
  function disableInstantTransitions() {
10842
10866
  MotionGlobalConfig.instantAnimations = false;
10843
10867
  }
10868
+ function usePageInView() {
10869
+ const [isInView, setIsInView,] = useState(true,);
10870
+ useEffect(() => {
10871
+ const handleVisibilityChange = () => setIsInView(!document.hidden,);
10872
+ if (document.hidden) {
10873
+ handleVisibilityChange();
10874
+ }
10875
+ document.addEventListener('visibilitychange', handleVisibilityChange,);
10876
+ return () => {
10877
+ document.removeEventListener('visibilitychange', handleVisibilityChange,);
10878
+ };
10879
+ }, [],);
10880
+ return isInView;
10881
+ }
10844
10882
  var appearAnimationStore = /* @__PURE__ */ new Map();
10845
10883
  var appearComplete = /* @__PURE__ */ new Map();
10846
10884
  var appearStoreId = (elementId, valueName,) => {
@@ -11214,15 +11252,17 @@ function stagger(duration = 0.1, {
11214
11252
  };
11215
11253
  }
11216
11254
 
11217
- // /:https://app.framerstatic.com/framer.UWLYDHV3.mjs
11218
- import { lazy as ReactLazy, } from 'react';
11255
+ // /:https://app.framerstatic.com/framer.L7DRXRFF.mjs
11256
+
11219
11257
  import React4 from 'react';
11220
11258
  import { startTransition as startTransition2, } from 'react';
11221
11259
  import { Suspense as Suspense2, } from 'react';
11222
11260
  import { memo as memo2, } from 'react';
11223
11261
  import ReactDOM from 'react-dom';
11262
+ import { useSyncExternalStore, } from 'react';
11224
11263
  import { createRef, } from 'react';
11225
11264
  import { useTransition, } from 'react';
11265
+ import { createPortal, } from 'react-dom';
11226
11266
  import { cloneElement as cloneElement32, } from 'react';
11227
11267
  var __unframerNavigator2 = typeof window !== 'undefined' ? navigator : void 0;
11228
11268
  var require_hsluv = __commonJS({
@@ -12150,37 +12190,46 @@ var preloadKey = 'preload';
12150
12190
  function isLazyComponentType(componentType,) {
12151
12191
  return typeof componentType === 'object' && componentType !== null && !isValidElement(componentType,) && preloadKey in componentType;
12152
12192
  }
12153
- function lazy(factory,) {
12154
- const LazyComponent = ReactLazy(factory,);
12193
+ function lazy(factory, moduleName = 'default',) {
12155
12194
  let factoryPromise;
12156
12195
  let LoadedComponent;
12157
12196
  let hasRendered = false;
12158
- const Component17 = forwardRef(function LazyWithPreload(props, ref,) {
12159
- useEffect(() => {
12160
- hasRendered = true;
12161
- }, [],);
12162
- const Comp = LoadedComponent ?? LazyComponent;
12163
- return /* @__PURE__ */ jsx3(Comp, {
12164
- ref,
12165
- ...props,
12166
- },);
12167
- },);
12168
- Component17.preload = () => {
12197
+ let error;
12198
+ const load = () => {
12169
12199
  if (!factoryPromise) {
12170
12200
  factoryPromise = factory().then((module) => {
12171
- LoadedComponent = module.default;
12201
+ if (!(moduleName in module)) throw new Error(`Module does not contain export '${moduleName}'`,);
12202
+ LoadedComponent = module[moduleName];
12172
12203
  return LoadedComponent;
12204
+ },).catch((err) => {
12205
+ error = err;
12173
12206
  },);
12174
12207
  }
12175
12208
  return factoryPromise;
12176
12209
  };
12177
- Component17.getStatus = () => {
12210
+ const Component18 = forwardRef(function LazyWithPreload(props, ref,) {
12211
+ useEffect(() => {
12212
+ hasRendered = true;
12213
+ }, [],);
12214
+ if (error) {
12215
+ throw error;
12216
+ }
12217
+ if (!LoadedComponent) {
12218
+ throw load();
12219
+ }
12220
+ return /* @__PURE__ */ jsx3(LoadedComponent, {
12221
+ ref,
12222
+ ...props,
12223
+ },);
12224
+ },);
12225
+ Component18.preload = load;
12226
+ Component18.getStatus = () => {
12178
12227
  return {
12179
12228
  hasLoaded: LoadedComponent !== void 0,
12180
12229
  hasRendered,
12181
12230
  };
12182
12231
  };
12183
- return Component17;
12232
+ return Component18;
12184
12233
  }
12185
12234
  var objectKeys = Object.keys;
12186
12235
  function hasProp(o, prop,) {
@@ -12842,23 +12891,26 @@ function forwardCurrentQueryParams(href,) {
12842
12891
  }
12843
12892
  return forwardQueryParams(queryParamsString, href,);
12844
12893
  }
12894
+ var FRAMER_VARIANT_KEY = 'framer_variant';
12845
12895
  function forwardQueryParams(queryParamsString, href,) {
12846
12896
  const startOfHash = href.indexOf('#',);
12847
12897
  const hrefWithoutHash = startOfHash === -1 ? href : href.substring(0, startOfHash,);
12848
12898
  const hash2 = startOfHash === -1 ? '' : href.substring(startOfHash,);
12849
12899
  const startOfSearch = hrefWithoutHash.indexOf('?',);
12850
- if (startOfSearch === -1) {
12851
- return hrefWithoutHash + queryParamsString + hash2;
12852
- }
12900
+ const baseUrl = startOfSearch === -1 ? hrefWithoutHash : hrefWithoutHash.substring(0, startOfSearch,);
12901
+ const searchString = startOfSearch === -1 ? '' : hrefWithoutHash.substring(startOfSearch,);
12902
+ const newSearchParams = new URLSearchParams(searchString,);
12853
12903
  const currentSearchParams = new URLSearchParams(queryParamsString,);
12854
- const newSearchString = hrefWithoutHash.substring(startOfSearch + 1,);
12855
- const newSearchParams = new URLSearchParams(newSearchString,);
12856
12904
  for (const [key7, value,] of currentSearchParams) {
12857
- if (!newSearchParams.has(key7,)) {
12858
- newSearchParams.append(key7, value,);
12859
- }
12905
+ if (newSearchParams.has(key7,)) continue;
12906
+ if (key7 === FRAMER_VARIANT_KEY) continue;
12907
+ newSearchParams.append(key7, value,);
12908
+ }
12909
+ const newSearchString = newSearchParams.toString();
12910
+ if (newSearchString === '') {
12911
+ return hrefWithoutHash + hash2;
12860
12912
  }
12861
- return hrefWithoutHash.substring(0, startOfSearch + 1,) + newSearchParams.toString() + hash2;
12913
+ return baseUrl + '?' + newSearchString + hash2;
12862
12914
  }
12863
12915
  async function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils,) {
12864
12916
  var _a;
@@ -20331,8 +20383,38 @@ var inputIconCSSDeclaration = {
20331
20383
  function createRGBVariableFallbacks(variables, fallback,) {
20332
20384
  return css2.variable(...variables.flatMap((variable) => [`${variable}-rgb`, variable,]), fallback,);
20333
20385
  }
20386
+ var defaultRichTextContainerStyle = {
20387
+ display: 'flex',
20388
+ flexDirection: 'column',
20389
+ justifyContent: 'flex-start',
20390
+ };
20391
+ var defaultTextFillStyle = {
20392
+ display: 'inline-block',
20393
+ };
20394
+ var defaultImageStyle = {
20395
+ display: 'block',
20396
+ };
20334
20397
  var richTextCSSRules = /* @__PURE__ */ (() => [
20398
+ /**
20399
+ * RichTextContainer styles can get overridden by other static or inline styles collected in
20400
+ * style collectors, as well as styles defined directly in the @link{RichText.tsx} component.
20401
+ *
20402
+ * NOTE: `display: flex` can get overridden with `display: -webkit-box` in
20403
+ * @link{collectTextTruncation.ts} if the text is truncated. In this case, the flex-specific
20404
+ * properties are not supported, e.g. `justify-content`. This is ok because truncated text has
20405
+ * auto height and doesn't support vertical alignment. In any case, keep this in mind when
20406
+ * using other flex-specific properties.
20407
+ */
20335
20408
  /* css */
20409
+ `
20410
+ [data-framer-component-type="RichTextContainer"] {
20411
+ display: ${defaultRichTextContainerStyle.display};
20412
+ flex-direction: ${defaultRichTextContainerStyle.flexDirection};
20413
+ justify-content: ${defaultRichTextContainerStyle.justifyContent};
20414
+ outline: none;
20415
+ flex-shrink: 0;
20416
+ }
20417
+ `, /* css */
20336
20418
  `
20337
20419
  p.framer-text,
20338
20420
  div.framer-text,
@@ -20499,7 +20581,7 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20499
20581
  /* css */
20500
20582
  `
20501
20583
  .framer-text[data-text-fill] {
20502
- display: inline-block;
20584
+ display: ${defaultTextFillStyle.display};
20503
20585
  background-clip: text;
20504
20586
  -webkit-background-clip: text;
20505
20587
  /* make this a transparent color if you want to visualise the clipping */
@@ -20869,7 +20951,7 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20869
20951
  `, /* css */
20870
20952
  `
20871
20953
  .framer-image.framer-text {
20872
- display: block;
20954
+ display: ${defaultImageStyle.display};
20873
20955
  max-width: 100%;
20874
20956
  height: auto;
20875
20957
  }
@@ -21027,6 +21109,42 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
21027
21109
  }
21028
21110
  `,
21029
21111
  ])();
21112
+ var textTruncationDisplayInlineVariableForSafari16 = '--text-truncation-display-inline-for-safari-16';
21113
+ var textTruncationDisplayNoneVariableForSafari16 = '--text-truncation-display-none-for-safari-16';
21114
+ var textTruncationLineBreakVariableForSafari16 = '--text-truncation-line-break-for-safari-16';
21115
+ var blockLikeElementSelectors = [
21116
+ 'div.framer-text',
21117
+ 'p.framer-text',
21118
+ 'h1.framer-text',
21119
+ 'h2.framer-text',
21120
+ 'h3.framer-text',
21121
+ 'h4.framer-text',
21122
+ 'h5.framer-text',
21123
+ 'h6.framer-text',
21124
+ 'ol.framer-text',
21125
+ 'ul.framer-text',
21126
+ 'li.framer-text',
21127
+ 'blockquote.framer-text',
21128
+ '.framer-text.framer-image',
21129
+ ];
21130
+ var anySafariVersion = '(background: -webkit-named-image(i))';
21131
+ var safari17OrGreater = '(contain-intrinsic-size: inherit)';
21132
+ var safari16TextTruncationFix = /* @__PURE__ */ (() => [`@supports ${anySafariVersion} and (not ${safari17OrGreater}) {
21133
+ /* Render block-like elements inline when text is truncated, otherwise default to user agent (revert) */
21134
+ ${blockLikeElementSelectors.join(', ',)} { display: var(${textTruncationDisplayInlineVariableForSafari16}, revert) }
21135
+
21136
+ /* Add a line break after each block-like element that we render inline, to resemble the block-like behavior */
21137
+ ${
21138
+ blockLikeElementSelectors.map((selector) => `${selector}::after`).join(', ',)
21139
+ } { content: var(${textTruncationLineBreakVariableForSafari16}); white-space: pre; }
21140
+
21141
+ /* Don't render modules (e.g. videos, code-blocks), or tables when text is truncated, because often these can't be truncated and their children might be block elements */
21142
+ .framer-text.framer-text-module,
21143
+ .framer-text.framer-table-wrapper { display: var(${textTruncationDisplayNoneVariableForSafari16}, revert) }
21144
+
21145
+ /* Render text-fill elements inline when text is truncated, otherwise default to their default value (e.g. inline-block) */
21146
+ p.framer-text[data-text-fill] { display: var(${textTruncationDisplayInlineVariableForSafari16}, ${defaultTextFillStyle.display}) }
21147
+ }`,])();
21030
21148
  var defaultCache = /* @__PURE__ */ new Set();
21031
21149
  var defaultSheet;
21032
21150
  function injectCSSRule(cssRule, sheet, cache2 = defaultCache,) {
@@ -21301,6 +21419,7 @@ var pageContentWrapperWrapperCSSRules = [
21301
21419
  `[data-framer-component-type="PageContentWrapper"] > *, [data-framer-component-type="PageContentWrapper"] > [data-framer-component-type] { position: relative; }`,
21302
21420
  ];
21303
21421
  var presenceCSS = [`[data-is-present="false"], [data-is-present="false"] * { pointer-events: none !important; }`,];
21422
+ var lightboxCSS = [`.framer-lightbox-container { opacity: 1 !important; pointer-events: auto !important; }`,];
21304
21423
  var cursorCSS = [
21305
21424
  `[data-framer-cursor="pointer"] { cursor: pointer; }`,
21306
21425
  `[data-framer-cursor="grab"] { cursor: grab; }`,
@@ -21333,13 +21452,13 @@ var hideScrollbars = [
21333
21452
  ];
21334
21453
  var willChangeOverrideCSSVariable = '--framer-will-change-override';
21335
21454
  var willChangeEffectOverrideCSSVariable = '--framer-will-change-effect-override';
21336
- var anySafariVersion = '(background: -webkit-named-image(i))';
21455
+ var anySafariVersion2 = '(background: -webkit-named-image(i))';
21337
21456
  var safari16OrGreater = '(grid-template-rows: subgrid)';
21338
21457
  var willChangeTransformRules = (isPreview) =>
21339
21458
  isPreview
21340
21459
  ? [
21341
21460
  `body { ${willChangeOverrideCSSVariable}: none; }`,
21342
- `@supports ${anySafariVersion} and (not ${safari16OrGreater}) { body { ${willChangeOverrideCSSVariable}: transform; } }`,
21461
+ `@supports ${anySafariVersion2} and (not ${safari16OrGreater}) { body { ${willChangeOverrideCSSVariable}: transform; } }`,
21343
21462
  ]
21344
21463
  : [`body { ${willChangeOverrideCSSVariable}: none; ${willChangeEffectOverrideCSSVariable}: none; }`,];
21345
21464
  var frameCSSRules = (isPreview) => {
@@ -21370,6 +21489,8 @@ var combineCSSRules =
21370
21489
  ...resetCSS,
21371
21490
  ...hideScrollbars,
21372
21491
  ...overflowClipFallbackCSSRules,
21492
+ ...lightboxCSS,
21493
+ ...safari16TextTruncationFix,
21373
21494
  ];
21374
21495
  export var combinedCSSRules = /* @__PURE__ */ combineCSSRules(false,);
21375
21496
  var combinedCSSRulesForPreview = /* @__PURE__ */ combineCSSRules(true,);
@@ -23199,23 +23320,45 @@ function getImageStyle(image,) {
23199
23320
  objectFit: cssObjectFit(image.fit,),
23200
23321
  };
23201
23322
  }
23323
+ function useDecodingAttribute(avoidAsyncDecoding,) {
23324
+ const currentDecoding = React4.useRef(avoidAsyncDecoding ? 'auto' : 'async',);
23325
+ const switchDecodingToAuto = useCallback((node) => {
23326
+ currentDecoding.current = 'auto';
23327
+ node.decoding = 'auto';
23328
+ }, [],);
23329
+ const onImageLoad = useCallback((event) => {
23330
+ switchDecodingToAuto(event.currentTarget,);
23331
+ }, [switchDecodingToAuto,],);
23332
+ const onImageMount = useCallback((node) => {
23333
+ if (node == null ? void 0 : node.complete) switchDecodingToAuto(node,);
23334
+ }, [switchDecodingToAuto,],);
23335
+ return {
23336
+ decoding: currentDecoding.current,
23337
+ onImageLoad,
23338
+ onImageMount,
23339
+ };
23340
+ }
23202
23341
  function StaticImage({
23203
23342
  image,
23204
23343
  containerSize,
23205
23344
  nodeId,
23206
23345
  alt,
23207
23346
  draggable,
23208
- syncDecoding,
23347
+ avoidAsyncDecoding,
23209
23348
  },) {
23210
23349
  const source = runtime.useImageSource(image, containerSize, nodeId,);
23211
23350
  const imageStyle = getImageStyle(image,);
23212
- const imageRef = React4.useRef(null,);
23351
+ const {
23352
+ decoding,
23353
+ onImageLoad,
23354
+ onImageMount,
23355
+ } = useDecodingAttribute(avoidAsyncDecoding,);
23213
23356
  return (
23214
23357
  // eslint-disable-next-line framer-studio/require-async-decoding -- we conditionally apply it
23215
23358
  /* @__PURE__ */
23216
23359
  jsx3('img', {
23217
- ref: imageRef,
23218
- decoding: syncDecoding ? 'sync' : 'async',
23360
+ ref: onImageMount,
23361
+ decoding,
23219
23362
  fetchPriority: image.fetchPriority,
23220
23363
  loading: image.loading,
23221
23364
  width: image.pixelWidth,
@@ -23223,6 +23366,7 @@ function StaticImage({
23223
23366
  sizes: image.sizes,
23224
23367
  srcSet: image.srcSet,
23225
23368
  src: source,
23369
+ onLoad: onImageLoad,
23226
23370
  alt: alt ?? image.alt ?? '',
23227
23371
  style: imageStyle,
23228
23372
  draggable,
@@ -23312,7 +23456,7 @@ function BackgroundImageComponent({
23312
23456
  } else if (RenderTarget.current() !== RenderTarget.canvas) {
23313
23457
  imageNode = /* @__PURE__ */ jsx3(StaticImage, {
23314
23458
  image,
23315
- syncDecoding: RenderTarget.current() === RenderTarget.export,
23459
+ avoidAsyncDecoding: RenderTarget.current() === RenderTarget.export,
23316
23460
  ...props,
23317
23461
  },);
23318
23462
  } else if (
@@ -23466,17 +23610,10 @@ function getIntrinsicSizeForBackgroundImage(background,) {
23466
23610
  height: background.pixelHeight,
23467
23611
  };
23468
23612
  }
23469
- return parseImageSizeFromSrc(background.src,);
23470
- }
23471
- function parseImageSizeFromSrc(src,) {
23472
- if (!src) return void 0;
23473
- const url = new URL(src,);
23474
- const width = url.searchParams.get('width',);
23475
- const height = url.searchParams.get('height',);
23476
- if (width && height) {
23613
+ if (background.src === void 0) {
23477
23614
  return {
23478
- width: parseInt(width,),
23479
- height: parseInt(height,),
23615
+ width: 1,
23616
+ height: 1,
23480
23617
  };
23481
23618
  }
23482
23619
  return void 0;
@@ -23774,7 +23911,7 @@ function useMeasuredSize(ref,) {
23774
23911
  return size.current;
23775
23912
  }
23776
23913
  var SIZE_COMPATIBILITY_WRAPPER_ATTRIBUTE = 'data-framer-size-compatibility-wrapper';
23777
- var withMeasuredSize = (Component17) => (props) => {
23914
+ var withMeasuredSize = (Component18) => (props) => {
23778
23915
  const ref = React4.useRef(null,);
23779
23916
  const size = useMeasuredSize(ref,);
23780
23917
  const dataProps = {
@@ -23791,7 +23928,7 @@ var withMeasuredSize = (Component17) => (props) => {
23791
23928
  },
23792
23929
  ref,
23793
23930
  ...dataProps,
23794
- children: shouldRender && /* @__PURE__ */ jsx3(Component17, {
23931
+ children: shouldRender && /* @__PURE__ */ jsx3(Component18, {
23795
23932
  ...props,
23796
23933
  width: (size == null ? void 0 : size.width) ?? fallbackWidth,
23797
23934
  height: (size == null ? void 0 : size.height) ?? fallbackHeight,
@@ -26771,7 +26908,7 @@ var clamp2 = (value, a, b,) => {
26771
26908
  var DraggingContext = /* @__PURE__ */ React4.createContext({
26772
26909
  dragging: false,
26773
26910
  },);
26774
- function WithDragging(Component17,) {
26911
+ function WithDragging(Component18,) {
26775
26912
  const _WithDraggingHOC = class _WithDraggingHOC2 extends React4.Component {
26776
26913
  constructor(props, defaultProps,) {
26777
26914
  super(props, defaultProps,);
@@ -27392,7 +27529,7 @@ function WithDragging(Component17,) {
27392
27529
  value: {
27393
27530
  dragging: this.state.isDragging,
27394
27531
  },
27395
- children: /* @__PURE__ */ jsx3(Component17, {
27532
+ children: /* @__PURE__ */ jsx3(Component18, {
27396
27533
  ...originalProps,
27397
27534
  },),
27398
27535
  },);
@@ -27429,10 +27566,10 @@ function WithDragging(Component17,) {
27429
27566
  constraints: {},
27430
27567
  mouseWheel: false,
27431
27568
  },);
27432
- __publicField(_WithDraggingHOC, 'defaultProps', Object.assign({}, Component17.defaultProps, _WithDraggingHOC.draggingDefaultProps,),);
27569
+ __publicField(_WithDraggingHOC, 'defaultProps', Object.assign({}, Component18.defaultProps, _WithDraggingHOC.draggingDefaultProps,),);
27433
27570
  let WithDraggingHOC = _WithDraggingHOC;
27434
27571
  const withDragging = WithDraggingHOC;
27435
- (0, import_hoist_non_react_statics2.default)(withDragging, Component17,);
27572
+ (0, import_hoist_non_react_statics2.default)(withDragging, Component18,);
27436
27573
  return withDragging;
27437
27574
  }
27438
27575
  var hoverProps = {
@@ -28683,7 +28820,7 @@ function useInfiniteScroll({
28683
28820
  enabled: paginationInfo.currentPage < paginationInfo.totalPages,
28684
28821
  },);
28685
28822
  }
28686
- function withInfiniteScroll(Component17,) {
28823
+ function withInfiniteScroll(Component18,) {
28687
28824
  return React4.forwardRef(({
28688
28825
  __paginationInfo,
28689
28826
  __loadMore,
@@ -28696,7 +28833,7 @@ function withInfiniteScroll(Component17,) {
28696
28833
  ref: infiniteScrollRef,
28697
28834
  paginationInfo: __paginationInfo,
28698
28835
  },);
28699
- return /* @__PURE__ */ jsx3(Component17, {
28836
+ return /* @__PURE__ */ jsx3(Component18, {
28700
28837
  ...props,
28701
28838
  ref: infiniteScrollRef,
28702
28839
  },);
@@ -31603,7 +31740,7 @@ function convertColorProps(props,) {
31603
31740
  }
31604
31741
  return props;
31605
31742
  }
31606
- function WithOverride(Component17, override,) {
31743
+ function WithOverride(Component18, override,) {
31607
31744
  const useOverride = typeof override === 'function' ? (props) => override(convertColorProps(props,),) : () => convertColorProps(override,);
31608
31745
  const ComponentWithOverride = function (props,) {
31609
31746
  useContext(DataObserverContext,);
@@ -31612,14 +31749,14 @@ function WithOverride(Component17, override,) {
31612
31749
  style: style2,
31613
31750
  ...rest
31614
31751
  } = props;
31615
- return /* @__PURE__ */ jsx3(Component17, {
31752
+ return /* @__PURE__ */ jsx3(Component18, {
31616
31753
  ...rest,
31617
31754
  ...overrideProps,
31618
31755
  _initialStyle: style2,
31619
31756
  },);
31620
31757
  };
31621
- (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component17,);
31622
- ComponentWithOverride['displayName'] = `WithOverride(${Component17.displayName || Component17.name})`;
31758
+ (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component18,);
31759
+ ComponentWithOverride['displayName'] = `WithOverride(${Component18.displayName || Component18.name})`;
31623
31760
  return ComponentWithOverride;
31624
31761
  }
31625
31762
  var prefix = '__framer__';
@@ -31758,7 +31895,7 @@ var componentsWithServerRenderedStyles = /* @__PURE__ */ (() => {
31758
31895
  return new Set(componentsWithSSRStylesAttr.split(' ',),);
31759
31896
  })();
31760
31897
  var framerCSSMarker = 'data-framer-css-ssr';
31761
- var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31898
+ var withCSS = (Component18, escapedCSS, componentSerializationId,) =>
31762
31899
  React4.forwardRef((props, ref,) => {
31763
31900
  const {
31764
31901
  sheet,
@@ -31768,23 +31905,7 @@ var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31768
31905
  if (!isBrowser2()) {
31769
31906
  if (isFunction(escapedCSS,)) escapedCSS = escapedCSS(RenderTarget.current(),);
31770
31907
  const concatenatedCSS = Array.isArray(escapedCSS,) ? escapedCSS.join('\n',) : escapedCSS;
31771
- return /* @__PURE__ */ jsxs(Fragment, {
31772
- children: [
31773
- /* @__PURE__ */ jsx3('style', {
31774
- ...{
31775
- [framerCSSMarker]: true,
31776
- },
31777
- 'data-framer-component': id3,
31778
- dangerouslySetInnerHTML: {
31779
- __html: concatenatedCSS,
31780
- },
31781
- },),
31782
- /* @__PURE__ */ jsx3(Component17, {
31783
- ...props,
31784
- ref,
31785
- },),
31786
- ],
31787
- },);
31908
+ cssCollector.add(concatenatedCSS, id3,);
31788
31909
  }
31789
31910
  useInsertionEffect(() => {
31790
31911
  if (id3 && componentsWithServerRenderedStyles.has(id3,)) return;
@@ -31795,11 +31916,32 @@ var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31795
31916
  : escapedCSS.split('\n',);
31796
31917
  css22.forEach((rule) => rule && injectCSSRule(rule, sheet, cache2,));
31797
31918
  }, [],);
31798
- return /* @__PURE__ */ jsx3(Component17, {
31919
+ return /* @__PURE__ */ jsx3(Component18, {
31799
31920
  ...props,
31800
31921
  ref,
31801
31922
  },);
31802
31923
  },);
31924
+ var CSSCollector = class {
31925
+ constructor() {
31926
+ __publicField(this, 'styles', /* @__PURE__ */ new Set(),);
31927
+ __publicField(this, 'componentIds', /* @__PURE__ */ new Set(),);
31928
+ }
31929
+ add(css22, componentId,) {
31930
+ this.styles.add(css22,);
31931
+ if (componentId) this.componentIds.add(componentId,);
31932
+ }
31933
+ getStyles() {
31934
+ return this.styles;
31935
+ }
31936
+ getComponentIds() {
31937
+ return this.componentIds;
31938
+ }
31939
+ clear() {
31940
+ this.styles.clear();
31941
+ this.componentIds.clear();
31942
+ }
31943
+ };
31944
+ var cssCollector = /* @__PURE__ */ new CSSCollector();
31803
31945
  var SSRParentVariantsContext = /* @__PURE__ */ React4.createContext(void 0,);
31804
31946
  var SSRVariantClassName = 'ssr-variant';
31805
31947
  function renderBranchedChildrenFromPropertyOverrides(
@@ -32083,7 +32225,7 @@ var AnimationCollector = class {
32083
32225
  };
32084
32226
  _variantHashes = /* @__PURE__ */ new WeakMap();
32085
32227
  var framerAppearEffects = /* @__PURE__ */ new AnimationCollector();
32086
- function withOptimizedAppearEffect(Component17,) {
32228
+ function withOptimizedAppearEffect(Component18,) {
32087
32229
  return React4.forwardRef(({
32088
32230
  optimized,
32089
32231
  ...props
@@ -32106,7 +32248,7 @@ function withOptimizedAppearEffect(Component17,) {
32106
32248
  );
32107
32249
  }
32108
32250
  const disabledProps = getDisabledFXPropsInStaticRenderer(props,);
32109
- return /* @__PURE__ */ jsx3(Component17, {
32251
+ return /* @__PURE__ */ jsx3(Component18, {
32110
32252
  ref,
32111
32253
  ...props,
32112
32254
  ...disabledProps,
@@ -32402,8 +32544,11 @@ function useParallax(options, ref, visibilityStyle,) {
32402
32544
  : effectDisabledStyle,
32403
32545
  };
32404
32546
  }
32547
+ function isTargetAndTransition(value,) {
32548
+ return typeof value === 'object' && value !== null;
32549
+ }
32405
32550
  function getTransition(value,) {
32406
- if (isString(value,) || !isObject2(value,)) return void 0;
32551
+ if (!isTargetAndTransition(value,)) return void 0;
32407
32552
  return value == null ? void 0 : value.transition;
32408
32553
  }
32409
32554
  function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, instant,) {
@@ -32413,7 +32558,9 @@ function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, i
32413
32558
  if (shouldReduceMotion && key7 !== 'opacity') return resolve();
32414
32559
  const motionValue2 = effect.values[key7];
32415
32560
  motionValue2.stop();
32416
- let value = !isObject2(target,) ? defaultFXValues[key7] : (target == null ? void 0 : target[key7]) ?? defaultFXValues[key7];
32561
+ let value = !isTargetAndTransition(target,)
32562
+ ? defaultFXValues[key7]
32563
+ : (target == null ? void 0 : target[key7]) ?? defaultFXValues[key7];
32417
32564
  if (isMotionValue(value,)) value = value.get();
32418
32565
  if (!isNumber2(value,)) return resolve();
32419
32566
  const visualElement = visualElementStore.get(ref.current,);
@@ -33060,11 +33207,11 @@ function addMotionValueStyle(style2, values,) {
33060
33207
  function isVariantOrVariantList2(value,) {
33061
33208
  return isString(value,) || Array.isArray(value,);
33062
33209
  }
33063
- var withFX = (Component17) =>
33210
+ var withFX = (Component18) =>
33064
33211
  React4.forwardRef((props, forwardedRef,) => {
33065
33212
  var _a;
33066
33213
  if (props.__withFX) {
33067
- return /* @__PURE__ */ jsx3(Component17, {
33214
+ return /* @__PURE__ */ jsx3(Component18, {
33068
33215
  ...props,
33069
33216
  animate: void 0,
33070
33217
  initial: void 0,
@@ -33074,7 +33221,7 @@ var withFX = (Component17) =>
33074
33221
  }
33075
33222
  const disabledProps = getDisabledFXPropsInStaticRenderer(props,);
33076
33223
  if (disabledProps) {
33077
- return /* @__PURE__ */ jsx3(Component17, {
33224
+ return /* @__PURE__ */ jsx3(Component18, {
33078
33225
  ...props,
33079
33226
  ...disabledProps,
33080
33227
  ref: forwardedRef,
@@ -33169,7 +33316,7 @@ var withFX = (Component17) =>
33169
33316
  exit,
33170
33317
  }
33171
33318
  : {};
33172
- return /* @__PURE__ */ jsx3(Component17, {
33319
+ return /* @__PURE__ */ jsx3(Component18, {
33173
33320
  ...forwardedProps,
33174
33321
  ...motionGestures,
33175
33322
  __withFX: true,
@@ -33234,10 +33381,10 @@ var ComponentViewportProvider = /* @__PURE__ */ React4.forwardRef(function Compo
33234
33381
  children: cloneWithPropsAndRef(children, rest,),
33235
33382
  },);
33236
33383
  },);
33237
- var withGeneratedLayoutId = (Component17) =>
33384
+ var withGeneratedLayoutId = (Component18) =>
33238
33385
  React4.forwardRef((props, ref,) => {
33239
33386
  const layoutId = useLayoutId2(props,);
33240
- return /* @__PURE__ */ jsx3(Component17, {
33387
+ return /* @__PURE__ */ jsx3(Component18, {
33241
33388
  layoutId,
33242
33389
  ...props,
33243
33390
  layoutIdKey: void 0,
@@ -33271,7 +33418,7 @@ var SynchronousSuspenseErrorBoundary = class extends Component2 {
33271
33418
  error,
33272
33419
  '\n\nComponent stack:\n',
33273
33420
  componentStack,
33274
- '\n\nThis error indicates a state update wasn\u2019t wrapped with startTransition. Some of the UI might flash as a result. If you are the author of this website, check recently added custom code, and if the issue persists, report it to the Framer team via https://www.framer.com/contact/.',
33421
+ '\n\nThis error indicates a state update wasn\u2019t wrapped with `startTransition`. Some of the UI might flash as a result. If you are the author of this website, update external components and check recently added custom code or code overrides. In case the issue persists, report it to the Framer team via https://www.framer.com/contact/.',
33275
33422
  );
33276
33423
  const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : void 0;
33277
33424
  sendTrackingEvent('published_site_load_recoverable_error', {
@@ -33650,10 +33797,10 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33650
33797
  );
33651
33798
  const tagName = props.as ?? 'div';
33652
33799
  if (props.rendersWithMotion) {
33653
- const Component17 = htmlElementAsMotionComponent(tagName,);
33800
+ const Component18 = htmlElementAsMotionComponent(tagName,);
33654
33801
  return /* @__PURE__ */ jsx3(NodeIdContext.Provider, {
33655
33802
  value: nodeId ?? null,
33656
- children: /* @__PURE__ */ jsx3(Component17, {
33803
+ children: /* @__PURE__ */ jsx3(Component18, {
33657
33804
  ...otherProps,
33658
33805
  ref,
33659
33806
  style: props.style,
@@ -33661,7 +33808,7 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33661
33808
  },),
33662
33809
  },);
33663
33810
  } else {
33664
- const Component17 = tagName;
33811
+ const Component18 = tagName;
33665
33812
  const {
33666
33813
  layoutId,
33667
33814
  layoutDependency,
@@ -33669,7 +33816,7 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33669
33816
  } = otherProps;
33670
33817
  return /* @__PURE__ */ jsx3(NodeIdContext.Provider, {
33671
33818
  value: nodeId ?? null,
33672
- children: /* @__PURE__ */ jsx3(Component17, {
33819
+ children: /* @__PURE__ */ jsx3(Component18, {
33673
33820
  ...plainHTMLRenderableProps,
33674
33821
  ref,
33675
33822
  style: props.style,
@@ -33962,6 +34109,336 @@ function useCustomCursors(webPageCursors,) {
33962
34109
  return registerCursors(cursors, id3,);
33963
34110
  }, [registerCursors, id3,],);
33964
34111
  }
34112
+ var linkKey = 'webPageId';
34113
+ function isLinkToWebPage(link,) {
34114
+ return Boolean(link && typeof link === 'object' && linkKey in link,);
34115
+ }
34116
+ function linkInfoKey(link,) {
34117
+ var _a, _b;
34118
+ return `${link.scopeId}:${link.nodeId}:${(_a = link.furthestExternalComponent) == null ? void 0 : _a.scopeId}:${
34119
+ (_b = link.furthestExternalComponent) == null ? void 0 : _b.nodeId
34120
+ }`;
34121
+ }
34122
+ var NestedLinksCollector = class {
34123
+ constructor() {
34124
+ __publicField(this, 'collectedLinks', /* @__PURE__ */ new Map(),);
34125
+ __publicField(this, 'nestingInfo', /* @__PURE__ */ new Map(),);
34126
+ }
34127
+ clear() {
34128
+ this.collectedLinks.clear();
34129
+ this.nestingInfo.clear();
34130
+ }
34131
+ /**
34132
+ * Returns a Map of outer links to their inner links.
34133
+ *
34134
+ * NOTE: This function is called in the SSG renderer sandbox (<root>/src/ssg/src/ssg-sandbox-renderer/sandbox/worker/renderer.ts)
34135
+ */
34136
+ getLinks() {
34137
+ const result = /* @__PURE__ */ new Map();
34138
+ for (const [outerLinkKey, innerLinkKeys,] of this.nestingInfo) {
34139
+ const outerLinkInfo = this.collectedLinks.get(outerLinkKey,);
34140
+ assert(outerLinkInfo, `Outer link not found: ${outerLinkKey}`,);
34141
+ const links = Array.from(innerLinkKeys,).map((innerLinkKey) => {
34142
+ const innerLinkInfo = this.collectedLinks.get(innerLinkKey,);
34143
+ assert(innerLinkInfo, `Inner link not found: ${innerLinkKey}`,);
34144
+ return innerLinkInfo;
34145
+ },);
34146
+ result.set(outerLinkInfo, links,);
34147
+ }
34148
+ return result;
34149
+ }
34150
+ collectNestedLink(outerLink, innerLink,) {
34151
+ if (isWindow && !isTest() || !outerLink.nodeId || !innerLink.nodeId) {
34152
+ return;
34153
+ }
34154
+ this.collectedLinks.set(linkInfoKey(outerLink,), outerLink,);
34155
+ this.collectedLinks.set(linkInfoKey(innerLink,), innerLink,);
34156
+ const outerLinkNestingInfo = this.nestingInfo.get(linkInfoKey(outerLink,),) ?? /* @__PURE__ */ new Set();
34157
+ outerLinkNestingInfo.add(linkInfoKey(innerLink,),);
34158
+ this.nestingInfo.set(linkInfoKey(outerLink,), outerLinkNestingInfo,);
34159
+ }
34160
+ };
34161
+ var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector();
34162
+ function useIsOnFramerCanvas() {
34163
+ return RenderTarget.current() === RenderTarget.canvas;
34164
+ }
34165
+ function isInternalURL(href,) {
34166
+ if (href === void 0) return false;
34167
+ if (href.startsWith('#',) || href.startsWith('/',) || href.startsWith('.',)) return true;
34168
+ return false;
34169
+ }
34170
+ function isValidURL(href, isInternal,) {
34171
+ try {
34172
+ const url = new URL(href,);
34173
+ return Boolean(url.protocol,);
34174
+ } catch {}
34175
+ return isInternal;
34176
+ }
34177
+ function getRouteFromPageLink(pageLink, router, currentRoute,) {
34178
+ var _a;
34179
+ if (isString(pageLink,)) {
34180
+ const isInternal = isInternalURL(pageLink,);
34181
+ if (!router.routes || !router.getRoute || !currentRoute || !isInternal) {
34182
+ return;
34183
+ }
34184
+ const [pathnameWithQueryParams,] = pageLink.split('#', 2,);
34185
+ if (pathnameWithQueryParams === void 0) return;
34186
+ const [pathname,] = pathnameWithQueryParams.split('?', 2,);
34187
+ if (pathname === void 0) return;
34188
+ const {
34189
+ routeId,
34190
+ } = inferInitialRouteFromPath(router.routes, pathname,);
34191
+ return router.getRoute(routeId,);
34192
+ }
34193
+ const {
34194
+ webPageId,
34195
+ } = pageLink;
34196
+ return (_a = router.getRoute) == null ? void 0 : _a.call(router, webPageId,);
34197
+ }
34198
+ var elementKey = 'element';
34199
+ var collectionKey = 'collection';
34200
+ var collectionItemIdKey = 'collectionItemId';
34201
+ var pathVariablesKey = 'pathVariables';
34202
+ var mediaType = 'framer/page-link,';
34203
+ function isFramerPageLink(value,) {
34204
+ return isString(value,) && value.startsWith(`data:${mediaType}`,);
34205
+ }
34206
+ function createFramerPageLink(targetId = null, options = {},) {
34207
+ const target = targetId ? targetId : 'none';
34208
+ const link = new URL(`data:${mediaType}${target}`,);
34209
+ if (options.element) {
34210
+ link.searchParams.append(elementKey, options.element,);
34211
+ }
34212
+ if (options.collectionItem) {
34213
+ link.searchParams.append(collectionKey, options.collectionItem.collection,);
34214
+ link.searchParams.append(collectionItemIdKey, options.collectionItem.collectionItemId,);
34215
+ link.searchParams.append(pathVariablesKey, new URLSearchParams(options.collectionItem.pathVariables,).toString(),);
34216
+ }
34217
+ return link.href;
34218
+ }
34219
+ function parseFramerPageLink(link,) {
34220
+ if (!isFramerPageLink(link,)) return;
34221
+ try {
34222
+ const url = new URL(link,);
34223
+ const target = url.pathname.substring(mediaType.length,);
34224
+ const searchParams = url.searchParams;
34225
+ const element = searchParams.has(elementKey,) ? searchParams.get(elementKey,) : void 0;
34226
+ let collectionItem;
34227
+ const collection = searchParams.get(collectionKey,);
34228
+ const collectionItemId = searchParams.get(collectionItemIdKey,);
34229
+ const pathVariablesValue = searchParams.get(pathVariablesKey,);
34230
+ if (collection && collectionItemId && pathVariablesValue) {
34231
+ const pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesValue,).entries(),);
34232
+ collectionItem = {
34233
+ collection,
34234
+ collectionItemId,
34235
+ pathVariables,
34236
+ };
34237
+ }
34238
+ return {
34239
+ target: target === 'none' ? null : target,
34240
+ /**
34241
+ * For historical reason we used to set "element=none" into the
34242
+ * datalink, we no longer do that today, but we still keep this code
34243
+ * so we could parse legacy links correctly.
34244
+ */
34245
+ element: element === 'none' ? void 0 : element,
34246
+ collectionItem,
34247
+ };
34248
+ } catch {
34249
+ return;
34250
+ }
34251
+ }
34252
+ function shouldOpenLinkInNewTab(link,) {
34253
+ return !isFramerPageLink(link,);
34254
+ }
34255
+ function navigateFromAttributes(navigate, element, implicitPathVariables,) {
34256
+ var _a;
34257
+ let routeId = element.getAttribute('data-framer-page-link-target',/* Page */
34258
+ );
34259
+ let elementId;
34260
+ let pathVariables;
34261
+ if (routeId) {
34262
+ elementId = element.getAttribute('data-framer-page-link-element',/* Element */
34263
+ ) ?? void 0;
34264
+ const pathVariablesRaw = element.getAttribute('data-framer-page-link-path-variables',/* PathVariables */
34265
+ );
34266
+ if (pathVariablesRaw) {
34267
+ pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesRaw,).entries(),);
34268
+ }
34269
+ } else {
34270
+ const href = element.getAttribute('href',);
34271
+ if (!href) return false;
34272
+ const link = parseFramerPageLink(href,);
34273
+ if (!link || !link.target) return false;
34274
+ routeId = link.target;
34275
+ elementId = link.element ?? void 0;
34276
+ pathVariables = (_a = link.collectionItem) == null ? void 0 : _a.pathVariables;
34277
+ }
34278
+ const smoothScroll = elementId ? element.dataset.framerSmoothScroll !== void 0 : void 0;
34279
+ navigate(routeId, elementId, Object.assign({}, implicitPathVariables, pathVariables,), smoothScroll,);
34280
+ return true;
34281
+ }
34282
+ function linkFromFramerPageLink(link,) {
34283
+ if (!isFramerPageLink(link,)) return link;
34284
+ const parsed = parseFramerPageLink(link,);
34285
+ if (!parsed) return void 0;
34286
+ const {
34287
+ target,
34288
+ element,
34289
+ collectionItem,
34290
+ } = parsed;
34291
+ if (!target) return void 0;
34292
+ return {
34293
+ webPageId: target,
34294
+ hash: element ?? void 0,
34295
+ pathVariables: createVariablesFromPageLinkCollectionItem(collectionItem,),
34296
+ };
34297
+ }
34298
+ function createVariablesFromPageLinkCollectionItem(collectionItem,) {
34299
+ if (!collectionItem) return void 0;
34300
+ const variables = {};
34301
+ for (const pathVariablesKey2 in collectionItem.pathVariables) {
34302
+ const value = collectionItem.pathVariables[pathVariablesKey2];
34303
+ if (value) variables[pathVariablesKey2] = value;
34304
+ }
34305
+ return variables;
34306
+ }
34307
+ var OuterLinkContext = /* @__PURE__ */ createContext(void 0,);
34308
+ function ResetOuterLinkContext({
34309
+ children,
34310
+ },) {
34311
+ return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
34312
+ value: void 0,
34313
+ children,
34314
+ },);
34315
+ }
34316
+ function useReplaceNestedLinks(children, scopeId, nodeId, href, propsAddedByLink, observerRef,) {
34317
+ const outerLink = useContext(OuterLinkContext,);
34318
+ const furthestExternalComponent = useFurthestExternalComponent();
34319
+ const innerLink = useMemo2(() => ({
34320
+ scopeId,
34321
+ nodeId,
34322
+ furthestExternalComponent,
34323
+ }), [scopeId, nodeId, furthestExternalComponent,],);
34324
+ const router = useRouter();
34325
+ const currentRoute = useCurrentRoute();
34326
+ const route = useMemo2(() => {
34327
+ const pageLink = isLinkToWebPage(href,) ? href : linkFromFramerPageLink(href,);
34328
+ if (!pageLink) return;
34329
+ return getRouteFromPageLink(pageLink, router, currentRoute,);
34330
+ }, [currentRoute, href, router,],);
34331
+ const isOnFramerCanvas = useIsOnFramerCanvas();
34332
+ const shouldReplaceLink = Boolean(!isOnFramerCanvas && (outerLink == null ? void 0 : outerLink.nodeId) && innerLink.nodeId,);
34333
+ const onClick = useCallback((event) => {
34334
+ var _a;
34335
+ if (!propsAddedByLink.href) return;
34336
+ event.preventDefault();
34337
+ event.stopPropagation();
34338
+ const isAppleDevice = /Mac|iPod|iPhone|iPad/u.test(__unframerNavigator2.userAgent,);
34339
+ if (isAppleDevice ? event.metaKey : event.ctrlKey) {
34340
+ openExternalLink(propsAddedByLink.href, '', '_blank',);
34341
+ return;
34342
+ }
34343
+ if (route) {
34344
+ (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
34345
+ } else {
34346
+ openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
34347
+ }
34348
+ }, [propsAddedByLink, route,],);
34349
+ const onAuxClick = useCallback((event) => {
34350
+ if (!propsAddedByLink.href) return;
34351
+ event.preventDefault();
34352
+ event.stopPropagation();
34353
+ openExternalLink(propsAddedByLink.href, '', '_blank',);
34354
+ }, [propsAddedByLink,],);
34355
+ const onKeyDown = useCallback((event) => {
34356
+ var _a;
34357
+ if (!propsAddedByLink.href) return;
34358
+ if (event.key !== 'Enter') return;
34359
+ event.preventDefault();
34360
+ event.stopPropagation();
34361
+ if (route) {
34362
+ (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
34363
+ } else {
34364
+ openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
34365
+ }
34366
+ }, [propsAddedByLink, route,],);
34367
+ useRefEffect(observerRef, (node) => {
34368
+ if (node === null) return;
34369
+ if (!shouldReplaceLink) return;
34370
+ node.dataset.hydrated = 'true';
34371
+ }, [shouldReplaceLink,],);
34372
+ let replacedChildren = children;
34373
+ if (shouldReplaceLink) {
34374
+ Children.forEach(children, (child) => {
34375
+ if (!isChildReplaceable(child,)) return;
34376
+ assert(
34377
+ linkInfoIsCollectable(outerLink,),
34378
+ 'outerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
34379
+ );
34380
+ assert(
34381
+ linkInfoIsCollectable(innerLink,),
34382
+ 'innerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
34383
+ );
34384
+ nestedLinksCollector.collectNestedLink(outerLink, innerLink,);
34385
+ },);
34386
+ replacedChildren = Children.map(children, (child) => {
34387
+ if (!isChildReplaceable(child,)) return child;
34388
+ const tag = maybeReplaceAnchorWithSpan(child.type,);
34389
+ const {
34390
+ children: childChildren,
34391
+ ...childProps
34392
+ } = child.props;
34393
+ const props = {
34394
+ ...childProps,
34395
+ // This attribute is used in `ssg/src/ssg-sandbox-renderer/worker/nestedLinks.ts` to handle the nested links clicks
34396
+ 'data-nested-link': true,
34397
+ role: 'link',
34398
+ tabIndex: 0,
34399
+ onClick,
34400
+ onAuxClick,
34401
+ onKeyDown,
34402
+ as: childProps.as && maybeReplaceAnchorWithSpan(childProps.as,),
34403
+ };
34404
+ const ref = 'ref' in child ? child.ref : void 0;
34405
+ return createElement(tag, // We need to pass the ref here again, otherwise it will be lost
34406
+ {
34407
+ ...props,
34408
+ ref,
34409
+ }, childChildren,);
34410
+ },);
34411
+ }
34412
+ return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
34413
+ value: innerLink,
34414
+ children: replacedChildren,
34415
+ },);
34416
+ }
34417
+ function linkInfoIsCollectable(linkInfo,) {
34418
+ return !isUndefined(linkInfo == null ? void 0 : linkInfo.nodeId,);
34419
+ }
34420
+ function isChildReplaceable(child,) {
34421
+ return isValidElement(child,) &&
34422
+ (maybeReplaceAnchorWithSpan(child.type,) !== child.type || maybeReplaceAnchorWithSpan(child.props.as,) !== child.props.as);
34423
+ }
34424
+ function openExternalLink(href, rel, target,) {
34425
+ const link = document.createElement('a',);
34426
+ link.href = href;
34427
+ if (rel) {
34428
+ link.rel = rel;
34429
+ }
34430
+ if (target) {
34431
+ link.target = target;
34432
+ }
34433
+ document.body.appendChild(link,);
34434
+ link.click();
34435
+ link.remove();
34436
+ }
34437
+ function maybeReplaceAnchorWithSpan(component,) {
34438
+ if (component === 'a') return 'span';
34439
+ if (isMotionComponent(component,) && unwrapMotionComponent(component,) === 'a') return motion.span;
34440
+ return component;
34441
+ }
33965
34442
  var Polygon = {
33966
34443
  /**
33967
34444
  * Determine if the vertices are ordered clockwise or counter-clockwise. This works for simple
@@ -34487,19 +34964,31 @@ function Floating({
34487
34964
  x: offsetX ?? 0,
34488
34965
  y: offsetY ?? 0,
34489
34966
  };
34490
- let getSafePlacementRect;
34491
- let position;
34492
34967
  let cleanup;
34493
34968
  let cleanupHasRun = false;
34494
34969
  let initialUpdateHasRun = false;
34495
34970
  let anchorRect;
34496
- let elementRect;
34497
34971
  let safePlacement;
34498
34972
  let calculatedRect;
34499
34973
  let latestEvent;
34500
34974
  let updateSafeArea;
34501
34975
  let scrollX = 0;
34502
34976
  let scrollY = 0;
34977
+ const ancestorInfo = domReadGetAncestorInfo(anchorRef,);
34978
+ const position = ancestorInfo.position;
34979
+ const elementRect = contentRef.current.getBoundingClientRect();
34980
+ const getSafePlacementRect = makeGetSafePlacementFloatingPositionRect({
34981
+ placement,
34982
+ alignment,
34983
+ offset,
34984
+ collisionDetectionSize: collisionDetection
34985
+ ? {
34986
+ width: safeWindow.innerWidth,
34987
+ height: safeWindow.innerHeight,
34988
+ }
34989
+ : void 0,
34990
+ collisionDetectionPadding,
34991
+ },);
34503
34992
  const onRender = () => {
34504
34993
  if (cleanupHasRun) return;
34505
34994
  domWriteUpdatePosition(floatingPositionRef, position, calculatedRect, scrollX, scrollY,);
@@ -34533,29 +35022,12 @@ function Floating({
34533
35022
  safePlacement = safePlacementAndRect[0];
34534
35023
  calculatedRect = safePlacementAndRect[1];
34535
35024
  };
34536
- frame.read(() => {
34537
- if (cleanupHasRun || !contentRef.current) return;
34538
- const ancestorInfo = domReadGetAncestorInfo(anchorRef,);
34539
- position = ancestorInfo.position;
34540
- elementRect = contentRef.current.getBoundingClientRect();
34541
- getSafePlacementRect = makeGetSafePlacementFloatingPositionRect({
34542
- placement,
34543
- alignment,
34544
- offset,
34545
- collisionDetectionSize: collisionDetection
34546
- ? {
34547
- width: safeWindow.innerWidth,
34548
- height: safeWindow.innerHeight,
34549
- }
34550
- : void 0,
34551
- collisionDetectionPadding,
34552
- },);
34553
- domReadUpdateSafePlacementAndRect();
34554
- frame.update(onUpdate,);
34555
- frame.render(initialRender,);
34556
- if (!ancestorInfo.scrolls) return;
35025
+ domReadUpdateSafePlacementAndRect();
35026
+ onUpdate();
35027
+ initialRender();
35028
+ if (ancestorInfo.scrolls) {
34557
35029
  cleanup = domReadStartAnimationFrameLoop(domReadUpdateSafePlacementAndRect,);
34558
- },);
35030
+ }
34559
35031
  if (!safeArea) {
34560
35032
  return () => {
34561
35033
  cleanup == null ? void 0 : cleanup();
@@ -34620,9 +35092,11 @@ function Floating({
34620
35092
  },),
34621
35093
  /* @__PURE__ */ jsx3(FloatingStackingContext.Provider, {
34622
35094
  value: descendantContext,
34623
- children: /* @__PURE__ */ jsx3('div', {
34624
- ref: contentRef,
34625
- children: childrenWithOrigin(children, origin,),
35095
+ children: /* @__PURE__ */ jsx3(ResetOuterLinkContext, {
35096
+ children: /* @__PURE__ */ jsx3('div', {
35097
+ ref: contentRef,
35098
+ children: childrenWithOrigin(children, origin,),
35099
+ },),
34626
35100
  },),
34627
35101
  },),
34628
35102
  ],
@@ -34631,11 +35105,11 @@ function Floating({
34631
35105
  );
34632
35106
  }
34633
35107
  var Instance = /* @__PURE__ */ React4.forwardRef(function Instance2({
34634
- Component: Component17,
35108
+ Component: Component18,
34635
35109
  ...props
34636
35110
  }, ref,) {
34637
- return Component17
34638
- ? /* @__PURE__ */ jsx3(Component17, {
35111
+ return Component18
35112
+ ? /* @__PURE__ */ jsx3(Component18, {
34639
35113
  ...props,
34640
35114
  ref,
34641
35115
  },)
@@ -34796,20 +35270,16 @@ function ChildrenCanSuspend({
34796
35270
  children,
34797
35271
  },);
34798
35272
  }
34799
- function withChildrenCanSuspend(Component17,) {
35273
+ function withChildrenCanSuspend(Component18,) {
34800
35274
  return forwardRef(function withChildrenCanSuspendInner(props, ref,) {
34801
35275
  return /* @__PURE__ */ jsx3(ChildrenCanSuspend, {
34802
- children: /* @__PURE__ */ jsx3(Component17, {
35276
+ children: /* @__PURE__ */ jsx3(Component18, {
34803
35277
  ...props,
34804
35278
  ref,
34805
35279
  },),
34806
35280
  },);
34807
35281
  },);
34808
35282
  }
34809
- var linkKey = 'webPageId';
34810
- function isLinkToWebPage(link,) {
34811
- return Boolean(link && typeof link === 'object' && linkKey in link,);
34812
- }
34813
35283
  var PRELOAD_AFTER_MS = 500;
34814
35284
  var OBSERVER_THRESHOLD = 0.9;
34815
35285
  var LOW_MEMORY_THRESHOLD = 1.7;
@@ -34983,18 +35453,6 @@ function resolveSlugsWithSuspense(unresolvedPathSlugs, unresolvedHashSlugs, coll
34983
35453
  }
34984
35454
  return result;
34985
35455
  }
34986
- function isInternalURL(href,) {
34987
- if (href === void 0) return false;
34988
- if (href.startsWith('#',) || href.startsWith('/',) || href.startsWith('.',)) return true;
34989
- return false;
34990
- }
34991
- function isValidURL(href, isInternal,) {
34992
- try {
34993
- const url = new URL(href,);
34994
- return Boolean(url.protocol,);
34995
- } catch {}
34996
- return isInternal;
34997
- }
34998
35456
  async function findMatchingRouteAttributesForWebPageLink(router, currentRoute, pageLink, activeLocale, implicitPathVariables,) {
34999
35457
  const {
35000
35458
  webPageId,
@@ -35082,136 +35540,6 @@ function getRouteAttributes(router, currentRoute, routeId, hash2, implicitPathVa
35082
35540
  pathVariables: combinedPathVariables,
35083
35541
  };
35084
35542
  }
35085
- function getRouteFromPageLink(pageLink, router, currentRoute,) {
35086
- var _a;
35087
- if (isString(pageLink,)) {
35088
- const isInternal = isInternalURL(pageLink,);
35089
- if (!router.routes || !router.getRoute || !currentRoute || !isInternal) {
35090
- return;
35091
- }
35092
- const [pathnameWithQueryParams,] = pageLink.split('#', 2,);
35093
- if (pathnameWithQueryParams === void 0) return;
35094
- const [pathname,] = pathnameWithQueryParams.split('?', 2,);
35095
- if (pathname === void 0) return;
35096
- const {
35097
- routeId,
35098
- } = inferInitialRouteFromPath(router.routes, pathname,);
35099
- return router.getRoute(routeId,);
35100
- }
35101
- const {
35102
- webPageId,
35103
- } = pageLink;
35104
- return (_a = router.getRoute) == null ? void 0 : _a.call(router, webPageId,);
35105
- }
35106
- var elementKey = 'element';
35107
- var collectionKey = 'collection';
35108
- var collectionItemIdKey = 'collectionItemId';
35109
- var pathVariablesKey = 'pathVariables';
35110
- var mediaType = 'framer/page-link,';
35111
- function isFramerPageLink(value,) {
35112
- return isString(value,) && value.startsWith(`data:${mediaType}`,);
35113
- }
35114
- function createFramerPageLink(targetId = null, options = {},) {
35115
- const target = targetId ? targetId : 'none';
35116
- const link = new URL(`data:${mediaType}${target}`,);
35117
- if (options.element) {
35118
- link.searchParams.append(elementKey, options.element,);
35119
- }
35120
- if (options.collectionItem) {
35121
- link.searchParams.append(collectionKey, options.collectionItem.collection,);
35122
- link.searchParams.append(collectionItemIdKey, options.collectionItem.collectionItemId,);
35123
- link.searchParams.append(pathVariablesKey, new URLSearchParams(options.collectionItem.pathVariables,).toString(),);
35124
- }
35125
- return link.href;
35126
- }
35127
- function parseFramerPageLink(link,) {
35128
- if (!isFramerPageLink(link,)) return;
35129
- try {
35130
- const url = new URL(link,);
35131
- const target = url.pathname.substring(mediaType.length,);
35132
- const searchParams = url.searchParams;
35133
- const element = searchParams.has(elementKey,) ? searchParams.get(elementKey,) : void 0;
35134
- let collectionItem;
35135
- const collection = searchParams.get(collectionKey,);
35136
- const collectionItemId = searchParams.get(collectionItemIdKey,);
35137
- const pathVariablesValue = searchParams.get(pathVariablesKey,);
35138
- if (collection && collectionItemId && pathVariablesValue) {
35139
- const pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesValue,).entries(),);
35140
- collectionItem = {
35141
- collection,
35142
- collectionItemId,
35143
- pathVariables,
35144
- };
35145
- }
35146
- return {
35147
- target: target === 'none' ? null : target,
35148
- /**
35149
- * For historical reason we used to set "element=none" into the
35150
- * datalink, we no longer do that today, but we still keep this code
35151
- * so we could parse legacy links correctly.
35152
- */
35153
- element: element === 'none' ? void 0 : element,
35154
- collectionItem,
35155
- };
35156
- } catch {
35157
- return;
35158
- }
35159
- }
35160
- function shouldOpenLinkInNewTab(link,) {
35161
- return !isFramerPageLink(link,);
35162
- }
35163
- function navigateFromAttributes(navigate, element, implicitPathVariables,) {
35164
- var _a;
35165
- let routeId = element.getAttribute('data-framer-page-link-target',/* Page */
35166
- );
35167
- let elementId;
35168
- let pathVariables;
35169
- if (routeId) {
35170
- elementId = element.getAttribute('data-framer-page-link-element',/* Element */
35171
- ) ?? void 0;
35172
- const pathVariablesRaw = element.getAttribute('data-framer-page-link-path-variables',/* PathVariables */
35173
- );
35174
- if (pathVariablesRaw) {
35175
- pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesRaw,).entries(),);
35176
- }
35177
- } else {
35178
- const href = element.getAttribute('href',);
35179
- if (!href) return false;
35180
- const link = parseFramerPageLink(href,);
35181
- if (!link || !link.target) return false;
35182
- routeId = link.target;
35183
- elementId = link.element ?? void 0;
35184
- pathVariables = (_a = link.collectionItem) == null ? void 0 : _a.pathVariables;
35185
- }
35186
- const smoothScroll = elementId ? element.dataset.framerSmoothScroll !== void 0 : void 0;
35187
- navigate(routeId, elementId, Object.assign({}, implicitPathVariables, pathVariables,), smoothScroll,);
35188
- return true;
35189
- }
35190
- function linkFromFramerPageLink(link,) {
35191
- if (!isFramerPageLink(link,)) return link;
35192
- const parsed = parseFramerPageLink(link,);
35193
- if (!parsed) return void 0;
35194
- const {
35195
- target,
35196
- element,
35197
- collectionItem,
35198
- } = parsed;
35199
- if (!target) return void 0;
35200
- return {
35201
- webPageId: target,
35202
- hash: element ?? void 0,
35203
- pathVariables: createVariablesFromPageLinkCollectionItem(collectionItem,),
35204
- };
35205
- }
35206
- function createVariablesFromPageLinkCollectionItem(collectionItem,) {
35207
- if (!collectionItem) return void 0;
35208
- const variables = {};
35209
- for (const pathVariablesKey2 in collectionItem.pathVariables) {
35210
- const value = collectionItem.pathVariables[pathVariablesKey2];
35211
- if (value) variables[pathVariablesKey2] = value;
35212
- }
35213
- return variables;
35214
- }
35215
35543
  var pathVariablesRegExp2 = /:([a-z]\w*)/gi;
35216
35544
  var PathVariablesContext = /* @__PURE__ */ createContext(void 0,);
35217
35545
  function useImplicitPathVariables() {
@@ -35281,187 +35609,6 @@ function combineRels(rel, otherRel,) {
35281
35609
  if (rel && otherRel) return `${rel} ${otherRel}`;
35282
35610
  return void 0;
35283
35611
  }
35284
- function linkInfoKey(link,) {
35285
- var _a, _b;
35286
- return `${link.scopeId}:${link.nodeId}:${(_a = link.furthestExternalComponent) == null ? void 0 : _a.scopeId}:${
35287
- (_b = link.furthestExternalComponent) == null ? void 0 : _b.nodeId
35288
- }`;
35289
- }
35290
- var NestedLinksCollector = class {
35291
- constructor() {
35292
- __publicField(this, 'collectedLinks', /* @__PURE__ */ new Map(),);
35293
- __publicField(this, 'nestingInfo', /* @__PURE__ */ new Map(),);
35294
- }
35295
- clear() {
35296
- this.collectedLinks.clear();
35297
- this.nestingInfo.clear();
35298
- }
35299
- /**
35300
- * Returns a Map of outer links to their inner links.
35301
- *
35302
- * NOTE: This function is called in the SSG renderer sandbox (<root>/src/ssg/src/ssg-sandbox-renderer/sandbox/worker/renderer.ts)
35303
- */
35304
- getLinks() {
35305
- const result = /* @__PURE__ */ new Map();
35306
- for (const [outerLinkKey, innerLinkKeys,] of this.nestingInfo) {
35307
- const outerLinkInfo = this.collectedLinks.get(outerLinkKey,);
35308
- assert(outerLinkInfo, `Outer link not found: ${outerLinkKey}`,);
35309
- const links = Array.from(innerLinkKeys,).map((innerLinkKey) => {
35310
- const innerLinkInfo = this.collectedLinks.get(innerLinkKey,);
35311
- assert(innerLinkInfo, `Inner link not found: ${innerLinkKey}`,);
35312
- return innerLinkInfo;
35313
- },);
35314
- result.set(outerLinkInfo, links,);
35315
- }
35316
- return result;
35317
- }
35318
- collectNestedLink(outerLink, innerLink,) {
35319
- if (isWindow && !isTest() || !outerLink.nodeId || !innerLink.nodeId) {
35320
- return;
35321
- }
35322
- this.collectedLinks.set(linkInfoKey(outerLink,), outerLink,);
35323
- this.collectedLinks.set(linkInfoKey(innerLink,), innerLink,);
35324
- const outerLinkNestingInfo = this.nestingInfo.get(linkInfoKey(outerLink,),) ?? /* @__PURE__ */ new Set();
35325
- outerLinkNestingInfo.add(linkInfoKey(innerLink,),);
35326
- this.nestingInfo.set(linkInfoKey(outerLink,), outerLinkNestingInfo,);
35327
- }
35328
- };
35329
- var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector();
35330
- function useIsOnFramerCanvas() {
35331
- return RenderTarget.current() === RenderTarget.canvas;
35332
- }
35333
- var OuterLinkContext = /* @__PURE__ */ createContext(void 0,);
35334
- function useReplaceNestedLinks(children, scopeId, nodeId, href, propsAddedByLink, observerRef,) {
35335
- const outerLink = useContext(OuterLinkContext,);
35336
- const furthestExternalComponent = useFurthestExternalComponent();
35337
- const innerLink = useMemo2(() => ({
35338
- scopeId,
35339
- nodeId,
35340
- furthestExternalComponent,
35341
- }), [scopeId, nodeId, furthestExternalComponent,],);
35342
- const router = useRouter();
35343
- const currentRoute = useCurrentRoute();
35344
- const route = useMemo2(() => {
35345
- const pageLink = isLinkToWebPage(href,) ? href : linkFromFramerPageLink(href,);
35346
- if (!pageLink) return;
35347
- return getRouteFromPageLink(pageLink, router, currentRoute,);
35348
- }, [currentRoute, href, router,],);
35349
- const {
35350
- replaceNestedLinks,
35351
- } = useLibraryFeatures();
35352
- const isOnFramerCanvas = useIsOnFramerCanvas();
35353
- const shouldReplaceLink = Boolean(
35354
- replaceNestedLinks && !isOnFramerCanvas && (outerLink == null ? void 0 : outerLink.nodeId) && innerLink.nodeId,
35355
- );
35356
- const onClick = useCallback((event) => {
35357
- var _a;
35358
- if (!propsAddedByLink.href) return;
35359
- event.preventDefault();
35360
- event.stopPropagation();
35361
- const isAppleDevice = /Mac|iPod|iPhone|iPad/u.test(__unframerNavigator2.userAgent,);
35362
- if (isAppleDevice ? event.metaKey : event.ctrlKey) {
35363
- openExternalLink(propsAddedByLink.href, '', '_blank',);
35364
- return;
35365
- }
35366
- if (route) {
35367
- (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
35368
- } else {
35369
- openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
35370
- }
35371
- }, [propsAddedByLink, route,],);
35372
- const onAuxClick = useCallback((event) => {
35373
- if (!propsAddedByLink.href) return;
35374
- event.preventDefault();
35375
- event.stopPropagation();
35376
- openExternalLink(propsAddedByLink.href, '', '_blank',);
35377
- }, [propsAddedByLink,],);
35378
- const onKeyDown = useCallback((event) => {
35379
- var _a;
35380
- if (!propsAddedByLink.href) return;
35381
- if (event.key !== 'Enter') return;
35382
- event.preventDefault();
35383
- event.stopPropagation();
35384
- if (route) {
35385
- (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
35386
- } else {
35387
- openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
35388
- }
35389
- }, [propsAddedByLink, route,],);
35390
- useRefEffect(observerRef, (node) => {
35391
- if (node === null) return;
35392
- if (!shouldReplaceLink) return;
35393
- node.dataset.hydrated = 'true';
35394
- }, [shouldReplaceLink,],);
35395
- let replacedChildren = children;
35396
- if (shouldReplaceLink) {
35397
- Children.forEach(children, (child) => {
35398
- if (!isChildReplaceable(child,)) return;
35399
- assert(
35400
- linkInfoIsCollectable(outerLink,),
35401
- 'outerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
35402
- );
35403
- assert(
35404
- linkInfoIsCollectable(innerLink,),
35405
- 'innerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
35406
- );
35407
- nestedLinksCollector.collectNestedLink(outerLink, innerLink,);
35408
- },);
35409
- replacedChildren = Children.map(children, (child) => {
35410
- if (!isChildReplaceable(child,)) return child;
35411
- const tag = maybeReplaceAnchorWithSpan(child.type,);
35412
- const {
35413
- children: childChildren,
35414
- ...childProps
35415
- } = child.props;
35416
- const props = {
35417
- ...childProps,
35418
- // This attribute is used in `ssg/src/ssg-sandbox-renderer/worker/nestedLinks.ts` to handle the nested links clicks
35419
- 'data-nested-link': true,
35420
- role: 'link',
35421
- tabIndex: 0,
35422
- onClick,
35423
- onAuxClick,
35424
- onKeyDown,
35425
- as: childProps.as && maybeReplaceAnchorWithSpan(childProps.as,),
35426
- };
35427
- const ref = 'ref' in child ? child.ref : void 0;
35428
- return createElement(tag, // We need to pass the ref here again, otherwise it will be lost
35429
- {
35430
- ...props,
35431
- ref,
35432
- }, childChildren,);
35433
- },);
35434
- }
35435
- return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
35436
- value: innerLink,
35437
- children: replacedChildren,
35438
- },);
35439
- }
35440
- function linkInfoIsCollectable(linkInfo,) {
35441
- return !isUndefined(linkInfo == null ? void 0 : linkInfo.nodeId,);
35442
- }
35443
- function isChildReplaceable(child,) {
35444
- return isValidElement(child,) &&
35445
- (maybeReplaceAnchorWithSpan(child.type,) !== child.type || maybeReplaceAnchorWithSpan(child.props.as,) !== child.props.as);
35446
- }
35447
- function openExternalLink(href, rel, target,) {
35448
- const link = document.createElement('a',);
35449
- link.href = href;
35450
- if (rel) {
35451
- link.rel = rel;
35452
- }
35453
- if (target) {
35454
- link.target = target;
35455
- }
35456
- document.body.appendChild(link,);
35457
- link.click();
35458
- link.remove();
35459
- }
35460
- function maybeReplaceAnchorWithSpan(component,) {
35461
- if (component === 'a') return 'span';
35462
- if (isMotionComponent(component,) && unwrapMotionComponent(component,) === 'a') return motion.span;
35463
- return component;
35464
- }
35465
35612
  function useTrackLinkClick({
35466
35613
  nodeId,
35467
35614
  clickTrackingId,
@@ -35804,23 +35951,6 @@ function resolvePageScope(pageLink, router,) {
35804
35951
  siteCanonicalURL: void 0,
35805
35952
  },);
35806
35953
  }
35807
- var IgnoreErrors = class extends Component2 {
35808
- constructor() {
35809
- super(...arguments,);
35810
- __publicField(this, 'state', {
35811
- error: void 0,
35812
- },);
35813
- }
35814
- static getDerivedStateFromError(error,) {
35815
- return {
35816
- error,
35817
- };
35818
- }
35819
- render() {
35820
- if (this.state.error) return null;
35821
- return this.props.children;
35822
- }
35823
- };
35824
35954
  var salt = 'framer';
35825
35955
  var difficulty = 3;
35826
35956
  var tokenLength = 30;
@@ -36033,6 +36163,7 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36033
36163
  onError,
36034
36164
  onLoading,
36035
36165
  };
36166
+ const submissionInProgressRef = React4.useRef(false,);
36036
36167
  async function redirectTo(link,) {
36037
36168
  var _a, _b;
36038
36169
  if (isString(link,)) {
@@ -36061,15 +36192,18 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36061
36192
  const handleSubmit = async (event) => {
36062
36193
  var _a, _b, _c, _d, _e, _f;
36063
36194
  event.preventDefault();
36064
- if (!action || !projectHash) return;
36065
- dispatch({
36066
- type: 'submit',
36067
- },);
36195
+ if (!action || !projectHash || submissionInProgressRef.current) return;
36196
+ submissionInProgressRef.current = true;
36068
36197
  const data2 = new FormData(event.currentTarget,);
36069
36198
  await yieldToMain({
36070
- priority: 'user-blocking',
36199
+ priority: 'user-visible',
36071
36200
  continueAfter: 'paint',
36072
36201
  },);
36202
+ startTransition2(() =>
36203
+ dispatch({
36204
+ type: 'submit',
36205
+ },)
36206
+ );
36073
36207
  addUTMTagsToFormData(data2, safeWindow.document,);
36074
36208
  for (const [key7, value,] of data2) {
36075
36209
  if (value instanceof File) data2.delete(key7,);
@@ -36101,6 +36235,7 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36101
36235
  (_f = (_e = callbacks.current).onError) == null ? void 0 : _f.call(_e,);
36102
36236
  console.error(error,);
36103
36237
  }
36238
+ submissionInProgressRef.current = false;
36104
36239
  };
36105
36240
  const handleKeyDown = (event) => {
36106
36241
  const {
@@ -36177,6 +36312,61 @@ function responseHasError(response,) {
36177
36312
  return typeof response === 'object' && response !== null && 'error' in response && isObject2(response.error,) &&
36178
36313
  'message' in response.error && typeof response.error.message === 'string';
36179
36314
  }
36315
+ var FORCE_SHOW_EDITORBAR_LOCALSTORAGE_KEY = '__framer_force_showing_editorbar_since';
36316
+ var IgnoreErrors = class extends Component2 {
36317
+ constructor() {
36318
+ super(...arguments,);
36319
+ __publicField(this, 'state', {
36320
+ error: void 0,
36321
+ },);
36322
+ }
36323
+ static getDerivedStateFromError(error,) {
36324
+ return {
36325
+ error,
36326
+ };
36327
+ }
36328
+ render() {
36329
+ if (this.state.error) return null;
36330
+ return this.props.children;
36331
+ }
36332
+ };
36333
+ var isPrioritized = () => {
36334
+ try {
36335
+ return !!localStorage[FORCE_SHOW_EDITORBAR_LOCALSTORAGE_KEY];
36336
+ } catch (e) {
36337
+ return false;
36338
+ }
36339
+ };
36340
+ var isntPrioritized = () => !isPrioritized();
36341
+ var getServerSnapshot = () => false;
36342
+ var noOpSubscribe = () => () => {};
36343
+ function EditorBarLauncher({
36344
+ EditorBar,
36345
+ fast = false,
36346
+ },) {
36347
+ const libraryFeatures = useLibraryFeatures();
36348
+ const framerSiteId = useContext(FormContext,);
36349
+ const enabled = useSyncExternalStore(noOpSubscribe, fast ? isPrioritized : isntPrioritized, getServerSnapshot,);
36350
+ const editorBarFeatures = useMemo2(() => {
36351
+ const features = {};
36352
+ let key7;
36353
+ for (key7 in libraryFeatures) {
36354
+ if (libraryFeatures.hasOwnProperty(key7,) && key7.startsWith('editorBar',)) {
36355
+ features[key7] = libraryFeatures[key7];
36356
+ }
36357
+ }
36358
+ return features;
36359
+ }, [libraryFeatures,],);
36360
+ if (!EditorBar || !framerSiteId || !enabled) return null;
36361
+ return /* @__PURE__ */ jsx3(IgnoreErrors, {
36362
+ children: /* @__PURE__ */ jsx3(Suspense2, {
36363
+ children: /* @__PURE__ */ jsx3(EditorBar, {
36364
+ framerSiteId,
36365
+ features: editorBarFeatures,
36366
+ },),
36367
+ },),
36368
+ },);
36369
+ }
36180
36370
  function isSamePage(a, b,) {
36181
36371
  if (a.routeId !== b.routeId) return false;
36182
36372
  if (a.pathVariables === b.pathVariables) return true;
@@ -36351,7 +36541,7 @@ function Router({
36351
36541
  locales = EMPTY_ARRAY,
36352
36542
  preserveQueryParams = false,
36353
36543
  LayoutTemplate,
36354
- editorBar,
36544
+ EditorBar,
36355
36545
  siteCanonicalURL,
36356
36546
  },) {
36357
36547
  useMarkRouterEffects();
@@ -36648,38 +36838,46 @@ function Router({
36648
36838
  }));
36649
36839
  return /* @__PURE__ */ jsx3(RouterAPIProvider, {
36650
36840
  api,
36651
- children: /* @__PURE__ */ jsx3(LocaleInfoContext.Provider, {
36841
+ children: /* @__PURE__ */ jsxs(LocaleInfoContext.Provider, {
36652
36842
  value: localeInfo,
36653
- children: /* @__PURE__ */ jsx3(SynchronousSuspenseErrorBoundary, {
36654
- children: /* @__PURE__ */ jsxs(SuspenseThatPreservesDom, {
36655
- children: [
36656
- /* @__PURE__ */ jsxs(NotFoundErrorBoundary, {
36657
- notFoundPage,
36658
- defaultPageStyle,
36659
- forceUpdateKey: dep,
36660
- children: [
36661
- /* @__PURE__ */ jsx3(MarkSuspenseEffects.Start, {},),
36662
- /* @__PURE__ */ jsx3(WithLayoutTemplate, {
36663
- LayoutTemplate,
36664
- routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36665
- style: defaultPageStyle,
36666
- children: (inLayoutTemplate) => {
36667
- return /* @__PURE__ */ jsx3(Fragment, {
36668
- children: pageExistsInCurrentLocale
36669
- ? renderPage(currentRoute.page, inLayoutTemplate ? templatePageStyle : defaultPageStyle,)
36670
- : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
36671
- notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
36672
- }, remountKey,);
36673
- },
36674
- },),
36675
- ],
36676
- },),
36677
- editorBar,
36678
- /* @__PURE__ */ jsx3(TurnOnReactEventHandling, {},),
36679
- /* @__PURE__ */ jsx3(MarkSuspenseEffects.End, {},),
36680
- ],
36843
+ children: [
36844
+ EditorBar && /* @__PURE__ */ jsx3(EditorBarLauncher, {
36845
+ EditorBar,
36846
+ fast: true,
36681
36847
  },),
36682
- },),
36848
+ /* @__PURE__ */ jsx3(SynchronousSuspenseErrorBoundary, {
36849
+ children: /* @__PURE__ */ jsxs(SuspenseThatPreservesDom, {
36850
+ children: [
36851
+ /* @__PURE__ */ jsxs(NotFoundErrorBoundary, {
36852
+ notFoundPage,
36853
+ defaultPageStyle,
36854
+ forceUpdateKey: dep,
36855
+ children: [
36856
+ /* @__PURE__ */ jsx3(MarkSuspenseEffects.Start, {},),
36857
+ /* @__PURE__ */ jsx3(WithLayoutTemplate, {
36858
+ LayoutTemplate,
36859
+ routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36860
+ style: defaultPageStyle,
36861
+ children: (inLayoutTemplate) => {
36862
+ return /* @__PURE__ */ jsx3(Fragment, {
36863
+ children: pageExistsInCurrentLocale
36864
+ ? renderPage(currentRoute.page, inLayoutTemplate ? templatePageStyle : defaultPageStyle,)
36865
+ : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
36866
+ notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
36867
+ }, remountKey,);
36868
+ },
36869
+ },),
36870
+ ],
36871
+ },),
36872
+ EditorBar && /* @__PURE__ */ jsx3(EditorBarLauncher, {
36873
+ EditorBar,
36874
+ },),
36875
+ /* @__PURE__ */ jsx3(TurnOnReactEventHandling, {},),
36876
+ /* @__PURE__ */ jsx3(MarkSuspenseEffects.End, {},),
36877
+ ],
36878
+ },),
36879
+ },),
36880
+ ],
36683
36881
  },),
36684
36882
  },);
36685
36883
  }
@@ -36781,20 +36979,12 @@ function resolveFetchDataValue(result, request,) {
36781
36979
  }
36782
36980
  return resolvedValue;
36783
36981
  }
36982
+ var minimumCacheDurationMs = 5e3;
36784
36983
  function isCacheExpired(insertionTimestamp, cacheDuration,) {
36785
36984
  if (RenderTarget.current() === RenderTarget.canvas) {
36786
36985
  return false;
36787
36986
  }
36788
- const cacheDurationMs = cacheDuration === 0
36789
- ? // When the cache is set to 0 seconds we set use a 500ms cache delay
36790
- // to avoid triggering refetching when a variant switches from
36791
- // preloading to rendering the component (and
36792
- // resubscribing to the fetch client). When another component
36793
- // relying on the same endpoint (eg another page) is mounted again
36794
- // and the cache time is set to 0, the the data will be fetched
36795
- // again.
36796
- 500
36797
- : cacheDuration * 1e3;
36987
+ const cacheDurationMs = Math.max(cacheDuration * 1e3, minimumCacheDurationMs,);
36798
36988
  const currentTimestamp = Date.now();
36799
36989
  const expirationTimestamp = insertionTimestamp + cacheDurationMs;
36800
36990
  return currentTimestamp >= expirationTimestamp;
@@ -37234,9 +37424,7 @@ function PageRoot({
37234
37424
  width: 'auto',
37235
37425
  },
37236
37426
  preserveQueryParams,
37237
- editorBar: /* @__PURE__ */ jsx3(EditorBarLauncher, {
37238
- EditorBar,
37239
- },),
37427
+ EditorBar,
37240
37428
  disableHistory,
37241
37429
  LayoutTemplate,
37242
37430
  siteCanonicalURL,
@@ -37264,37 +37452,6 @@ function PageRoot({
37264
37452
  },);
37265
37453
  }
37266
37454
  }
37267
- function EditorBarLauncher({
37268
- EditorBar,
37269
- },) {
37270
- const libraryFeatures = useLibraryFeatures();
37271
- const [mounted, setMounted,] = useState(false,);
37272
- const framerSiteId = useContext(FormContext,);
37273
- const editorBarFeatures = useMemo2(() => {
37274
- const features = {};
37275
- let key7;
37276
- for (key7 in libraryFeatures) {
37277
- if (libraryFeatures.hasOwnProperty(key7,) && key7.startsWith('editorBar',)) {
37278
- features[key7] = libraryFeatures[key7];
37279
- }
37280
- }
37281
- return features;
37282
- }, [libraryFeatures,],);
37283
- useEffect(() => {
37284
- startTransition2(() => {
37285
- setMounted(true,);
37286
- },);
37287
- }, [],);
37288
- if (!EditorBar || !framerSiteId || !mounted) return null;
37289
- return /* @__PURE__ */ jsx3(IgnoreErrors, {
37290
- children: /* @__PURE__ */ jsx3(Suspense2, {
37291
- children: /* @__PURE__ */ jsx3(EditorBar, {
37292
- framerSiteId,
37293
- features: editorBarFeatures,
37294
- },),
37295
- },),
37296
- },);
37297
- }
37298
37455
  var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ forwardRef(function ResolveLinksInner({
37299
37456
  links,
37300
37457
  children,
@@ -42541,12 +42698,12 @@ function usePrototypeNavigate({
42541
42698
  navigation.goBack();
42542
42699
  return false;
42543
42700
  }
42544
- const Component17 = typeof target === 'string'
42701
+ const Component18 = typeof target === 'string'
42545
42702
  ? await componentForRoute(getRoute == null ? void 0 : getRoute(target,),).catch(() => {},)
42546
42703
  : React4.isValidElement(target,)
42547
42704
  ? target
42548
42705
  : null;
42549
- if (!Component17) return;
42706
+ if (!Component18) return;
42550
42707
  const {
42551
42708
  appearsFrom,
42552
42709
  backdropColor,
@@ -42555,40 +42712,40 @@ function usePrototypeNavigate({
42555
42712
  const transitionType = options.transition || 'instant';
42556
42713
  switch (transitionType) {
42557
42714
  case 'instant':
42558
- navigation.instant(Component17,);
42715
+ navigation.instant(Component18,);
42559
42716
  break;
42560
42717
  case 'fade':
42561
- navigation.fade(Component17, {
42718
+ navigation.fade(Component18, {
42562
42719
  animation,
42563
42720
  },);
42564
42721
  break;
42565
42722
  case 'push':
42566
- navigation.push(Component17, {
42723
+ navigation.push(Component18, {
42567
42724
  appearsFrom,
42568
42725
  animation,
42569
42726
  },);
42570
42727
  break;
42571
42728
  case 'flip':
42572
- navigation.flip(Component17, {
42729
+ navigation.flip(Component18, {
42573
42730
  appearsFrom,
42574
42731
  animation,
42575
42732
  },);
42576
42733
  break;
42577
42734
  case 'magicMotion':
42578
- navigation.magicMotion(Component17, {
42735
+ navigation.magicMotion(Component18, {
42579
42736
  animation,
42580
42737
  },);
42581
42738
  break;
42582
42739
  // Overlay stack navigation doesn't support updating the browser's
42583
42740
  // path.
42584
42741
  case 'modal':
42585
- navigation.modal(Component17, {
42742
+ navigation.modal(Component18, {
42586
42743
  backdropColor,
42587
42744
  animation,
42588
42745
  },);
42589
42746
  break;
42590
42747
  case 'overlay':
42591
- navigation.overlay(Component17, {
42748
+ navigation.overlay(Component18, {
42592
42749
  appearsFrom,
42593
42750
  backdropColor,
42594
42751
  animation,
@@ -43126,16 +43283,16 @@ function safeCSSValue(value,) {
43126
43283
  if (reUnsafeCharacters.test(value,)) return 'none';
43127
43284
  return value;
43128
43285
  }
43129
- function withCodeBoundaryForOverrides(Component17, {
43286
+ function withCodeBoundaryForOverrides(Component18, {
43130
43287
  scopeId,
43131
43288
  nodeId,
43132
43289
  override,
43133
43290
  inComponentSlot,
43134
43291
  },) {
43135
43292
  if (!shouldEnableCodeBoundaries()) {
43136
- return override(Component17,);
43293
+ return override(Component18,);
43137
43294
  }
43138
- const appliedOverride = tryToApplyOverride(Component17, override,);
43295
+ const appliedOverride = tryToApplyOverride(Component18, override,);
43139
43296
  let hasErrorBeenLogged = false;
43140
43297
  function CodeBoundaryForOverrides(props, ref,) {
43141
43298
  const nearestExternalComponent = useNearestExternalComponent();
@@ -43151,7 +43308,7 @@ function withCodeBoundaryForOverrides(Component17, {
43151
43308
  value: nodeId,
43152
43309
  children: /* @__PURE__ */ jsx3(CodeComponentBoundary, {
43153
43310
  getErrorMessage: getErrorMessageForOverride.bind(null, scopeId, nodeId,),
43154
- fallback: /* @__PURE__ */ jsx3(Component17, {
43311
+ fallback: /* @__PURE__ */ jsx3(Component18, {
43155
43312
  ...props,
43156
43313
  ref,
43157
43314
  },),
@@ -43168,7 +43325,7 @@ function withCodeBoundaryForOverrides(Component17, {
43168
43325
  collectErrorToAnalytics(appliedOverride.error,);
43169
43326
  hasErrorBeenLogged = true;
43170
43327
  }
43171
- return /* @__PURE__ */ jsx3(Component17, {
43328
+ return /* @__PURE__ */ jsx3(Component18, {
43172
43329
  ...props,
43173
43330
  ref,
43174
43331
  },);
@@ -43189,9 +43346,9 @@ function withCodeBoundaryForOverrides(Component17, {
43189
43346
  }
43190
43347
  return React4.forwardRef(CodeBoundaryForOverrides,);
43191
43348
  }
43192
- function tryToApplyOverride(Component17, override,) {
43349
+ function tryToApplyOverride(Component18, override,) {
43193
43350
  try {
43194
- const ComponentWithOverrides = override(Component17,);
43351
+ const ComponentWithOverrides = override(Component18,);
43195
43352
  return {
43196
43353
  status: 'success',
43197
43354
  Component: ComponentWithOverrides,
@@ -43211,7 +43368,7 @@ function singleFrame() {
43211
43368
  frame.postRender(() => resolve());
43212
43369
  },);
43213
43370
  }
43214
- var withV1StrokeFX = (Component17) =>
43371
+ var withV1StrokeFX = (Component18) =>
43215
43372
  forwardRef((props, forwardedRef,) => {
43216
43373
  const {
43217
43374
  strokeEffectLength,
@@ -43264,7 +43421,7 @@ var withV1StrokeFX = (Component17) =>
43264
43421
  strokeDashoffset: value,
43265
43422
  }
43266
43423
  : void 0;
43267
- return /* @__PURE__ */ jsx3(Component17, {
43424
+ return /* @__PURE__ */ jsx3(Component18, {
43268
43425
  ...restProps,
43269
43426
  ...effect,
43270
43427
  ref: forwardedRef,
@@ -43280,14 +43437,14 @@ function extractMappingFromInfo(info,) {
43280
43437
  return void 0;
43281
43438
  }
43282
43439
  }
43283
- function withMappedReactProps(Component17, info,) {
43440
+ function withMappedReactProps(Component18, info,) {
43284
43441
  return (rawProps) => {
43285
43442
  const props = {};
43286
43443
  const mapping = extractMappingFromInfo(info,);
43287
43444
  for (const key7 in rawProps) {
43288
43445
  asRecord(props,)[(mapping == null ? void 0 : mapping[key7]) ?? key7] = rawProps[key7];
43289
43446
  }
43290
- return /* @__PURE__ */ jsx3(Component17, {
43447
+ return /* @__PURE__ */ jsx3(Component18, {
43291
43448
  ...props,
43292
43449
  },);
43293
43450
  };
@@ -43328,10 +43485,10 @@ function createInputOutputRanges2(transformTargets, threshold, exitTarget,) {
43328
43485
  outputRange: [-1, -1, ...outputRange,],
43329
43486
  };
43330
43487
  }
43331
- var withVariantAppearEffect = (Component17) =>
43488
+ var withVariantAppearEffect = (Component18) =>
43332
43489
  React4.forwardRef((props, forwardedRef,) => {
43333
43490
  if (RenderTarget.current() === RenderTarget.canvas) {
43334
- return /* @__PURE__ */ jsx3(Component17, {
43491
+ return /* @__PURE__ */ jsx3(Component18, {
43335
43492
  ...props,
43336
43493
  ref: forwardedRef,
43337
43494
  },);
@@ -43403,18 +43560,18 @@ var withVariantAppearEffect = (Component17) =>
43403
43560
  startTransition2(() => setVariant(target,));
43404
43561
  },);
43405
43562
  if (!('variantAppearEffectEnabled' in options) || variantAppearEffectEnabled === true) {
43406
- return /* @__PURE__ */ jsx3(Component17, {
43563
+ return /* @__PURE__ */ jsx3(Component18, {
43407
43564
  ...rest,
43408
43565
  variant: activeVariant ?? props.variant,
43409
43566
  ref: observerRef,
43410
43567
  },);
43411
43568
  } else {
43412
- return /* @__PURE__ */ jsx3(Component17, {
43569
+ return /* @__PURE__ */ jsx3(Component18, {
43413
43570
  ...rest,
43414
43571
  },);
43415
43572
  }
43416
43573
  },);
43417
- var withVariantFX = (Component17) =>
43574
+ var withVariantFX = (Component18) =>
43418
43575
  React4.forwardRef(({
43419
43576
  initial,
43420
43577
  animate: animate3,
@@ -43431,7 +43588,7 @@ var withVariantFX = (Component17) =>
43431
43588
  observerRef,
43432
43589
  true,
43433
43590
  );
43434
- return /* @__PURE__ */ jsx3(Component17, {
43591
+ return /* @__PURE__ */ jsx3(Component18, {
43435
43592
  ...props,
43436
43593
  style: {
43437
43594
  ...(props == null ? void 0 : props.style),
@@ -44189,6 +44346,27 @@ function createVariantName(weight, style2,) {
44189
44346
  }
44190
44347
  return `${fontWeightNames[weight]}`;
44191
44348
  }
44349
+ var MapWithHash = class extends Map {
44350
+ constructor() {
44351
+ super(...arguments,);
44352
+ __publicField(this, '_hash', 0,);
44353
+ }
44354
+ get hash() {
44355
+ return this._hash;
44356
+ }
44357
+ set(key7, value,) {
44358
+ this._hash++;
44359
+ return super.set(key7, value,);
44360
+ }
44361
+ delete(key7,) {
44362
+ this._hash++;
44363
+ return super.delete(key7,);
44364
+ }
44365
+ clear() {
44366
+ this._hash++;
44367
+ return super.clear();
44368
+ }
44369
+ };
44192
44370
  function isVariableFont(font,) {
44193
44371
  return Boolean(font.variationAxes,);
44194
44372
  }
@@ -44705,8 +44883,10 @@ var Mixed = Symbol('Mixed',);
44705
44883
  var DEPENDENCIES_MODULE_NAME = 'dependencies';
44706
44884
  var DEPENDENCIES_MODULE_TYPE = 'config';
44707
44885
  var DEPENDENCIES_MODULE_TYPE_SLASH_NAME = `${DEPENDENCIES_MODULE_TYPE}/${DEPENDENCIES_MODULE_NAME}`;
44708
- var IMPORT_MAP_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/importMap.json`;
44709
- var DEPENDENCIES_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/dependencies.json`;
44886
+ var IMPORT_MAP_FILE_NAME = 'importMap.json';
44887
+ var DEPENDENCIES_FILE_NAME = 'dependencies.json';
44888
+ var IMPORT_MAP_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/${IMPORT_MAP_FILE_NAME}`;
44889
+ var DEPENDENCIES_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/${DEPENDENCIES_FILE_NAME}`;
44710
44890
  var USE_FREEZE = false;
44711
44891
  var List;
44712
44892
  ((List2) => {
@@ -46135,7 +46315,7 @@ function isValidVariationAxes(data2,) {
46135
46315
  var FontStore = class {
46136
46316
  constructor() {
46137
46317
  __publicField(this, 'enabled', false,);
46138
- __publicField(this, 'bySelector', /* @__PURE__ */ new Map(),);
46318
+ __publicField(this, 'bySelector', new MapWithHash(),);
46139
46319
  __publicField(this, 'loadedSelectors', /* @__PURE__ */ new Set(),);
46140
46320
  __publicField(this, 'getGoogleFontsListPromise',);
46141
46321
  __publicField(this, 'getFontshareFontsListPromise',);
@@ -46153,20 +46333,29 @@ var FontStore = class {
46153
46333
  __publicField(this, 'builtIn',);
46154
46334
  __publicField(this, 'framer',);
46155
46335
  __publicField(this, 'custom',);
46336
+ __publicField(this, 'bySelectorValuesCache',);
46156
46337
  this.local = new LocalFontSource();
46157
46338
  this.google = new GoogleFontSource();
46158
46339
  this.fontshare = new FontshareSource();
46159
46340
  this.framer = new FramerFontSource();
46160
46341
  this.custom = new CustomFontSource();
46161
46342
  this.builtIn = new BuiltInFontSource();
46162
- this.bySelector = /* @__PURE__ */ new Map();
46163
46343
  this.importLocalFonts();
46164
46344
  }
46345
+ get hash() {
46346
+ return this.bySelector.hash;
46347
+ }
46165
46348
  addFont(font,) {
46166
46349
  this.bySelector.set(font.selector, font,);
46167
46350
  }
46168
46351
  getAvailableFonts() {
46169
- return Array.from(this.bySelector.values(),);
46352
+ if (!this.bySelectorValuesCache || this.bySelectorValuesCache.hash !== this.bySelector.hash) {
46353
+ this.bySelectorValuesCache = {
46354
+ result: Array.from(this.bySelector.values(),),
46355
+ hash: this.bySelector.hash,
46356
+ };
46357
+ }
46358
+ return this.bySelectorValuesCache.result;
46170
46359
  }
46171
46360
  importLocalFonts() {
46172
46361
  for (const font of this.local.importFonts()) {
@@ -47196,7 +47385,367 @@ var styles3 = /* @__PURE__ */ (() => [
47196
47385
  },),
47197
47386
  ])();
47198
47387
  var FormSelect = /* @__PURE__ */ withCSS(Select, styles3, 'framer-lib-form-select',);
47199
- var Image2 = /* @__PURE__ */ React4.forwardRef(function Image3(props, ref,) {
47388
+ function useEscToClose(isOpen, close,) {
47389
+ useEffect(() => {
47390
+ function handleKeyDown(e,) {
47391
+ if (e.key === 'Escape' && isOpen) {
47392
+ e.preventDefault();
47393
+ e.stopPropagation();
47394
+ close();
47395
+ }
47396
+ }
47397
+ window.addEventListener('keyup', handleKeyDown,);
47398
+ return () => window.removeEventListener('keyup', handleKeyDown,);
47399
+ }, [isOpen, close,],);
47400
+ }
47401
+ var steps2 = [512, 1024, 2048, 4096,];
47402
+ function calculateImageWidth(aspectRatio2, maxWidth, totalHorizontalPadding, totalVerticalPadding,) {
47403
+ const availableHeight = window.innerHeight - totalVerticalPadding;
47404
+ const availableWidth = Math.min(window.innerWidth - totalHorizontalPadding, maxWidth,);
47405
+ const maxWidthBasedOnHeight = availableHeight / aspectRatio2;
47406
+ return Math.min(availableWidth, maxWidthBasedOnHeight,);
47407
+ }
47408
+ function optimisticallyDecodeImage(image, {
47409
+ width,
47410
+ height,
47411
+ },) {
47412
+ if (!image.src || !image.srcSet) return;
47413
+ const i = new window.Image();
47414
+ i.src = image.src;
47415
+ i.srcset = image.srcSet;
47416
+ i.width = width;
47417
+ i.height = height;
47418
+ return i.decode();
47419
+ }
47420
+ function getPortalContainer2() {
47421
+ return document.getElementById(templateOverlayContainerId,) ?? document.getElementById(overlayContainerId,) ?? document.body;
47422
+ }
47423
+ function getSidePadding(value, padding,) {
47424
+ if (isNumber2(value,)) return value;
47425
+ return padding ?? 0;
47426
+ }
47427
+ function getTotalVerticalPadding(lightbox,) {
47428
+ return getSidePadding(lightbox == null ? void 0 : lightbox.paddingTop, lightbox == null ? void 0 : lightbox.padding,) +
47429
+ getSidePadding(lightbox == null ? void 0 : lightbox.paddingBottom, lightbox == null ? void 0 : lightbox.padding,);
47430
+ }
47431
+ function getTotalHorizontalPadding(lightbox,) {
47432
+ return getSidePadding(lightbox == null ? void 0 : lightbox.paddingLeft, lightbox == null ? void 0 : lightbox.padding,) +
47433
+ getSidePadding(lightbox == null ? void 0 : lightbox.paddingRight, lightbox == null ? void 0 : lightbox.padding,);
47434
+ }
47435
+ function useStableCallback(callback,) {
47436
+ const latest = useRef3(callback,);
47437
+ latest.current = callback;
47438
+ return useCallback((...args) => latest.current(...args,), [],);
47439
+ }
47440
+ function createImageWithSrcSet(lightbox, background,) {
47441
+ if (!lightbox || !background || !background.src) return background;
47442
+ const base = new URL(background.src,);
47443
+ base.searchParams.delete('scale-down-to',);
47444
+ base.searchParams.delete('lossless',);
47445
+ return {
47446
+ ...background,
47447
+ sizes: `min(100vw, ${lightbox.maxWidth - getTotalHorizontalPadding(lightbox,)}px)`,
47448
+ // Use all steps since the lightbox can scale up and down with the viewport.
47449
+ srcSet: steps2.map((size) => {
47450
+ const src = new URL(base,);
47451
+ src.searchParams.set('scale-down-to', size.toString(),);
47452
+ return `${src.toString()} ${size}w`;
47453
+ },).join(', ',),
47454
+ };
47455
+ }
47456
+ var distortionTransforms = /* @__PURE__ */ (() => ({
47457
+ x: void 0,
47458
+ y: void 0,
47459
+ z: 0,
47460
+ translateX: void 0,
47461
+ translateY: void 0,
47462
+ translateZ: 0,
47463
+ rotate: void 0,
47464
+ rotateX: 0,
47465
+ rotateY: 0,
47466
+ rotateZ: void 0,
47467
+ scale: 1,
47468
+ scaleX: 1,
47469
+ scaleY: 1,
47470
+ scaleZ: 1,
47471
+ skew: 0,
47472
+ skewX: 0,
47473
+ skewY: 0,
47474
+ originX: void 0,
47475
+ originY: void 0,
47476
+ originZ: void 0,
47477
+ perspective: 0,
47478
+ transformPerspective: 0,
47479
+ }))();
47480
+ function isDistortionTransform(values,) {
47481
+ if (!values) return false;
47482
+ for (const k in values) {
47483
+ if (!(k in distortionTransforms)) continue;
47484
+ const identityValue = distortionTransforms[k];
47485
+ const value = values[k];
47486
+ if (!isNumber2(identityValue,) || !isNumber2(value,)) continue;
47487
+ if (identityValue === value) continue;
47488
+ return true;
47489
+ }
47490
+ return false;
47491
+ }
47492
+ function isDistorted(ref,) {
47493
+ var _a, _b;
47494
+ const element = visualElementStore.get(ref.current,);
47495
+ if (!element) return false;
47496
+ if (isDistortionTransform((_a = element.projection) == null ? void 0 : _a.latestValues,)) return true;
47497
+ const path = (_b = element.projection) == null ? void 0 : _b.path;
47498
+ if (!path || path.length === 0) return false;
47499
+ for (const p of path) {
47500
+ if (isDistortionTransform(p.latestValues,)) return true;
47501
+ }
47502
+ return false;
47503
+ }
47504
+ var enterExitBackdropAnimation = {
47505
+ opacity: 0,
47506
+ };
47507
+ var targetBackdropAnimation = {
47508
+ opacity: 1,
47509
+ };
47510
+ function withLightboxEffect(Component18,) {
47511
+ return forwardRef(function LightboxEffect({
47512
+ lightbox,
47513
+ lightboxClassName,
47514
+ onClick,
47515
+ ...props
47516
+ }, forwardedRef,) {
47517
+ const config = useContext(MotionConfigContext,);
47518
+ const fallbackRef = useRef3(null,);
47519
+ const ref = forwardedRef ?? fallbackRef;
47520
+ const decodePromiseRef = useRef3();
47521
+ const image = useMemo2(() => createImageWithSrcSet(lightbox, props.background,), [lightbox, props.background,],);
47522
+ const [open, setOpen,] = useState(false,);
47523
+ const [openOverrides, setOpenOverrides,] = useState();
47524
+ const onOpen = useCallback(() => {
47525
+ if (!lightbox) return;
47526
+ if (open) {
47527
+ startTransition2(() => {
47528
+ setOpen(true,);
47529
+ },);
47530
+ return;
47531
+ }
47532
+ frame.read(() => {
47533
+ if (!ref.current) return;
47534
+ const style22 = getComputedStyle(ref.current,);
47535
+ const hasBorder = ref.current.getAttribute('data-border',) === 'true';
47536
+ const borderStyle2 = hasBorder ? getComputedStyle(ref.current, '::after',) : void 0;
47537
+ const width = ref.current.offsetWidth ?? 1;
47538
+ const height = ref.current.offsetHeight ?? 1;
47539
+ const transition2 = isDistorted(ref,)
47540
+ ? {
47541
+ duration: 0,
47542
+ }
47543
+ : lightbox.transition;
47544
+ startTransition2(() => {
47545
+ setOpenOverrides({
47546
+ borderRadius: style22.borderRadius,
47547
+ aspectRatio: width / (height || 1),
47548
+ borderTop: borderStyle2 == null ? void 0 : borderStyle2.borderTopWidth,
47549
+ borderRight: borderStyle2 == null ? void 0 : borderStyle2.borderRightWidth,
47550
+ borderBottom: borderStyle2 == null ? void 0 : borderStyle2.borderBottomWidth,
47551
+ borderLeft: borderStyle2 == null ? void 0 : borderStyle2.borderLeftWidth,
47552
+ borderStyle: borderStyle2 == null ? void 0 : borderStyle2.borderStyle,
47553
+ borderColor: borderStyle2 == null ? void 0 : borderStyle2.borderColor,
47554
+ transition: transition2,
47555
+ imageRendering: style22.imageRendering,
47556
+ filter: style22.filter,
47557
+ },);
47558
+ setOpen(true,);
47559
+ },);
47560
+ },);
47561
+ }, [lightbox, open, ref,],);
47562
+ const aspectRatio2 = (openOverrides == null ? void 0 : openOverrides.aspectRatio) ?? 1;
47563
+ const decode = useStableCallback(() => {
47564
+ var _a;
47565
+ if (!lightbox || !image || !image.src) return;
47566
+ const srcDecodePromise = (_a = decodePromiseRef.current) == null ? void 0 : _a[image.src];
47567
+ if (srcDecodePromise) return srcDecodePromise;
47568
+ const width = calculateImageWidth(
47569
+ aspectRatio2,
47570
+ lightbox.maxWidth,
47571
+ getTotalHorizontalPadding(lightbox,),
47572
+ getTotalVerticalPadding(lightbox,),
47573
+ );
47574
+ const promise = optimisticallyDecodeImage(image, {
47575
+ width,
47576
+ height: width * aspectRatio2,
47577
+ },);
47578
+ decodePromiseRef.current = {
47579
+ [image.src]: promise,
47580
+ };
47581
+ return promise;
47582
+ },);
47583
+ const handleClick = useCallback(async (e) => {
47584
+ onClick == null ? void 0 : onClick(e,);
47585
+ if (open || !lightbox || !image) return;
47586
+ await decode();
47587
+ onOpen();
47588
+ }, [onClick, onOpen, open, image, lightbox, decode,],);
47589
+ const onClose = useCallback((e) => {
47590
+ e == null ? void 0 : e.stopPropagation();
47591
+ startTransition2(() => {
47592
+ setOpen(false,);
47593
+ },);
47594
+ }, [],);
47595
+ useEscToClose(open, onClose,);
47596
+ useEffect(() => {
47597
+ if (!lightbox) return;
47598
+ let timer;
47599
+ function enter() {
47600
+ timer = setTimeout(() => {
47601
+ void decode();
47602
+ }, 50,);
47603
+ }
47604
+ function clear() {
47605
+ clearTimeout(timer,);
47606
+ }
47607
+ const currentRef = ref.current;
47608
+ currentRef == null ? void 0 : currentRef.addEventListener('mouseenter', enter,);
47609
+ currentRef == null ? void 0 : currentRef.addEventListener('mouseleave', clear,);
47610
+ currentRef == null ? void 0 : currentRef.addEventListener('pointerdown', decode,);
47611
+ return () => {
47612
+ clear();
47613
+ currentRef == null ? void 0 : currentRef.removeEventListener('mouseenter', enter,);
47614
+ currentRef == null ? void 0 : currentRef.removeEventListener('mouseleave', clear,);
47615
+ currentRef == null ? void 0 : currentRef.removeEventListener('pointerdown', decode,);
47616
+ };
47617
+ }, [decode, ref, lightbox,],);
47618
+ const fallbackLayoutId = useId();
47619
+ const transition = (openOverrides == null ? void 0 : openOverrides.transition) ?? props.transition ?? config.transition;
47620
+ const borderRadius2 = openOverrides == null ? void 0 : openOverrides.borderRadius;
47621
+ const imageRendering = openOverrides == null ? void 0 : openOverrides.imageRendering;
47622
+ const filter2 = openOverrides == null ? void 0 : openOverrides.filter;
47623
+ const borderTop = openOverrides == null ? void 0 : openOverrides.borderTop;
47624
+ const borderRight = openOverrides == null ? void 0 : openOverrides.borderRight;
47625
+ const borderBottom = openOverrides == null ? void 0 : openOverrides.borderBottom;
47626
+ const borderLeft = openOverrides == null ? void 0 : openOverrides.borderLeft;
47627
+ const borderStyle = openOverrides == null ? void 0 : openOverrides.borderStyle;
47628
+ const borderColor = openOverrides == null ? void 0 : openOverrides.borderColor;
47629
+ const hasAnyBorder = Boolean(borderTop || borderRight || borderBottom || borderLeft || borderStyle || borderColor,);
47630
+ const border = hasAnyBorder
47631
+ ? {
47632
+ '--border-top-width': borderTop,
47633
+ '--border-right-width': borderRight,
47634
+ '--border-bottom-width': borderBottom,
47635
+ '--border-left-width': borderLeft,
47636
+ '--border-style': borderStyle,
47637
+ '--border-color': borderColor,
47638
+ }
47639
+ : void 0;
47640
+ const portalProps = {
47641
+ [portalIdAttribute]: props.id,
47642
+ };
47643
+ const paddingTop = getSidePadding(lightbox == null ? void 0 : lightbox.paddingTop, lightbox == null ? void 0 : lightbox.padding,);
47644
+ const paddingBottom = getSidePadding(lightbox == null ? void 0 : lightbox.paddingBottom, lightbox == null ? void 0 : lightbox.padding,);
47645
+ const paddingLeft = getSidePadding(lightbox == null ? void 0 : lightbox.paddingLeft, lightbox == null ? void 0 : lightbox.padding,);
47646
+ const paddingRight = getSidePadding(lightbox == null ? void 0 : lightbox.paddingRight, lightbox == null ? void 0 : lightbox.padding,);
47647
+ const style2 = (openOverrides == null ? void 0 : openOverrides.borderRadius)
47648
+ ? {
47649
+ ...props.style,
47650
+ borderRadius: openOverrides.borderRadius,
47651
+ }
47652
+ : props.style;
47653
+ const layoutDependency = open ? props.layoutDependency ? `${props.layoutDependency}-open` : 'open' : props.layoutDependency;
47654
+ return /* @__PURE__ */ jsxs(Fragment, {
47655
+ children: [
47656
+ /* @__PURE__ */ jsx3(Component18, {
47657
+ ...props,
47658
+ style: style2,
47659
+ onClick: handleClick,
47660
+ layoutId: props.layoutId ?? (lightbox ? fallbackLayoutId : void 0),
47661
+ ref,
47662
+ layoutDependency,
47663
+ transition,
47664
+ },),
47665
+ /* @__PURE__ */ jsx3(AnimatePresence, {
47666
+ children: open && lightbox && image && /* @__PURE__ */ jsx3(Fragment, {
47667
+ children: createPortal(
47668
+ /* @__PURE__ */ jsxs(Fragment, {
47669
+ children: [
47670
+ /* @__PURE__ */ jsx3(motion.div, {
47671
+ ...portalProps,
47672
+ className: lightboxClassName,
47673
+ onClick: onClose,
47674
+ style: {
47675
+ position: 'fixed',
47676
+ inset: 0,
47677
+ zIndex: lightbox.zIndex,
47678
+ backgroundColor: lightbox.backdrop ?? 'transparent',
47679
+ },
47680
+ transition,
47681
+ initial: enterExitBackdropAnimation,
47682
+ animate: targetBackdropAnimation,
47683
+ exit: enterExitBackdropAnimation,
47684
+ onTransitionEnd: () => {
47685
+ startTransition2(() => {
47686
+ setOpenOverrides(void 0,);
47687
+ },);
47688
+ },
47689
+ },),
47690
+ /* @__PURE__ */ jsx3('div', {
47691
+ ...portalProps,
47692
+ className: lightboxClassName,
47693
+ style: {
47694
+ alignItems: 'center',
47695
+ display: 'flex',
47696
+ inset: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
47697
+ justifyContent: 'center',
47698
+ pointerEvents: 'none',
47699
+ position: 'fixed',
47700
+ zIndex: lightbox.zIndex,
47701
+ },
47702
+ children: /* @__PURE__ */ jsx3('div', {
47703
+ style: {
47704
+ alignItems: 'center',
47705
+ aspectRatio: aspectRatio2,
47706
+ display: 'flex',
47707
+ justifyContent: 'center',
47708
+ maxHeight: '100%',
47709
+ position: 'relative',
47710
+ width: '100%',
47711
+ maxWidth: lightbox.maxWidth,
47712
+ },
47713
+ children: /* @__PURE__ */ jsx3(motion.div, {
47714
+ layoutId: props.layoutId ?? fallbackLayoutId,
47715
+ transition,
47716
+ onClick: onOpen,
47717
+ className: 'framer-lightbox-container',
47718
+ 'data-border': hasAnyBorder,
47719
+ style: {
47720
+ aspectRatio: aspectRatio2,
47721
+ borderRadius: borderRadius2,
47722
+ bottom: 0,
47723
+ position: 'absolute',
47724
+ top: 0,
47725
+ userSelect: 'none',
47726
+ imageRendering,
47727
+ filter: filter2,
47728
+ ...border,
47729
+ },
47730
+ children: /* @__PURE__ */ jsx3(BackgroundImageComponent, {
47731
+ image,
47732
+ alt: image.alt,
47733
+ draggable: props.draggable,
47734
+ },),
47735
+ },),
47736
+ },),
47737
+ },),
47738
+ ],
47739
+ },),
47740
+ getPortalContainer2(),
47741
+ ),
47742
+ }, 'backdrop',),
47743
+ },),
47744
+ ],
47745
+ },);
47746
+ },);
47747
+ }
47748
+ var Component16 = /* @__PURE__ */ React4.forwardRef(function Image2(props, ref,) {
47200
47749
  const {
47201
47750
  background,
47202
47751
  children,
@@ -47249,6 +47798,7 @@ var Image2 = /* @__PURE__ */ React4.forwardRef(function Image3(props, ref,) {
47249
47798
  ],
47250
47799
  },);
47251
47800
  },);
47801
+ var Image3 = /* @__PURE__ */ withLightboxEffect(Component16,);
47252
47802
  var frameFromElement = (element) => {
47253
47803
  const frame2 = Rect.fromRect(element.getBoundingClientRect(),);
47254
47804
  frame2.x = frame2.x + safeWindow.scrollX;
@@ -47620,13 +48170,14 @@ var defaultValues2 = {
47620
48170
  function isEffectKey(key7,) {
47621
48171
  return key7 in defaultValues2;
47622
48172
  }
47623
- function createKeyframes(effect,) {
48173
+ function createKeyframes(effect, shouldReduceMotion,) {
47624
48174
  const out = {};
47625
48175
  for (const key7 in effect) {
47626
48176
  if (!isEffectKey(key7,)) continue;
47627
48177
  const effectValue = effect[key7];
47628
48178
  const defaultValue = defaultValues2[key7];
47629
48179
  if (isUndefined(effectValue,) || isUndefined(defaultValue,)) continue;
48180
+ if (shouldReduceMotion && key7 !== 'opacity') continue;
47630
48181
  out[key7] = [effectValue, defaultValue,];
47631
48182
  }
47632
48183
  return out;
@@ -47637,7 +48188,16 @@ var emojiSplitRe = /* @__PURE__ */ (() => {
47637
48188
  'gu',
47638
48189
  );
47639
48190
  })();
47640
- function tokenizeText(text, tokenization = 'character', elements, style2,) {
48191
+ function tokenizeText(text, tokenization = 'character', elements, shouldReduceMotion, style2,) {
48192
+ if (shouldReduceMotion) {
48193
+ const ref = newOverrideableRef();
48194
+ elements.add(ref,);
48195
+ return /* @__PURE__ */ jsx3('span', {
48196
+ ref,
48197
+ style: style2,
48198
+ children: text,
48199
+ },);
48200
+ }
47641
48201
  switch (tokenization) {
47642
48202
  case 'character':
47643
48203
  // When we want to animate "lines" that aren't split by newlines, but
@@ -47723,7 +48283,7 @@ function transformString(effect,) {
47723
48283
  if (isNumber2(effect.skewY,)) transforms.push(`skewY(${effect.skewY}deg)`,);
47724
48284
  return transforms.join(' ',);
47725
48285
  }
47726
- function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
48286
+ function getInitialEffectStyle(canPlay, canAnimate2, effect, shouldReduceMotion,) {
47727
48287
  if (!effect || !effect.effect) return void 0;
47728
48288
  const type = effect.type;
47729
48289
  switch (type) {
@@ -47733,8 +48293,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
47733
48293
  if (!canPlay || !canAnimate2) return void 0;
47734
48294
  return {
47735
48295
  opacity: effect.effect.opacity,
47736
- filter: effect.effect.filter,
47737
- transform: transformString(effect.effect,),
48296
+ filter: shouldReduceMotion ? void 0 : effect.effect.filter,
48297
+ transform: shouldReduceMotion ? void 0 : transformString(effect.effect,),
47738
48298
  };
47739
48299
  case 'line':
47740
48300
  case 'word':
@@ -47748,8 +48308,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
47748
48308
  return {
47749
48309
  display: 'inline-block',
47750
48310
  opacity: effect.effect.opacity,
47751
- filter: effect.effect.filter,
47752
- transform: transformString(effect.effect,),
48311
+ filter: shouldReduceMotion ? void 0 : effect.effect.filter,
48312
+ transform: shouldReduceMotion ? void 0 : transformString(effect.effect,),
47753
48313
  };
47754
48314
  }
47755
48315
  default:
@@ -47760,6 +48320,7 @@ function useTextEffect(config, ref, preview,) {
47760
48320
  const elements = useConstant2(() => /* @__PURE__ */ new Set());
47761
48321
  const isRenderingStaticContent = isStaticRenderer();
47762
48322
  const canPlay = preview || !isRenderingStaticContent;
48323
+ const shouldReduceMotion = useReducedMotionConfig();
47763
48324
  const state = React2.useRef({
47764
48325
  hasMounted: false,
47765
48326
  hasAnimatedOnce: false,
@@ -47796,7 +48357,7 @@ function useTextEffect(config, ref, preview,) {
47796
48357
  const cleanupRef = {
47797
48358
  current: void 0,
47798
48359
  };
47799
- void runAppearEffect(tokenization2, effect.effect, elements, transition, startDelay, repeat, () => {
48360
+ void runAppearEffect(tokenization2, effect.effect, elements, transition, startDelay, repeat, shouldReduceMotion, () => {
47800
48361
  Object.assign(state.current, {
47801
48362
  isAnimating: false,
47802
48363
  },);
@@ -47852,9 +48413,10 @@ function useTextEffect(config, ref, preview,) {
47852
48413
  canPlay,
47853
48414
  preview || mayAnimate(hasMounted, hasAnimatedOnce, effect,),
47854
48415
  state.current.effect,
48416
+ shouldReduceMotion,
47855
48417
  );
47856
48418
  return {
47857
- text: (text) => tokenizeText(text, tokenization, elements, effectStyle,),
48419
+ text: (text) => tokenizeText(text, tokenization, elements, shouldReduceMotion, effectStyle,),
47858
48420
  props: (style2) => {
47859
48421
  if ((effect == null ? void 0 : effect.tokenization) !== 'element') return void 0;
47860
48422
  const r = newOverrideableRef();
@@ -47881,7 +48443,7 @@ function useTextEffect(config, ref, preview,) {
47881
48443
  transition,
47882
48444
  startDelay,
47883
48445
  } = effect;
47884
- void runAppearEffect(tokenization, effect.effect, elements, transition, startDelay,);
48446
+ void runAppearEffect(tokenization, effect.effect, elements, transition, startDelay, false, shouldReduceMotion,);
47885
48447
  break;
47886
48448
  }
47887
48449
  default:
@@ -47909,10 +48471,11 @@ async function runAppearEffect(
47909
48471
  transition,
47910
48472
  startDelay = 0,
47911
48473
  repeat = false,
48474
+ shouldReduceMotion,
47912
48475
  callback,
47913
48476
  cleanupRef,
47914
48477
  ) {
47915
- const enter = createKeyframes(effect,);
48478
+ const enter = createKeyframes(effect, shouldReduceMotion,);
47916
48479
  const controller = new AbortController();
47917
48480
  if (cleanupRef) cleanupRef.current = () => controller.abort();
47918
48481
  switch (tokenization) {
@@ -47929,14 +48492,20 @@ async function runAppearEffect(
47929
48492
  },),
47930
48493
  },).then(() => callback == null ? void 0 : callback());
47931
48494
  if (!repeat || !cleanupRef) return;
47932
- cleanupRef.current = () =>
47933
- void animate(list, effect, {
48495
+ cleanupRef.current = () => {
48496
+ const actualEffect = shouldReduceMotion
48497
+ ? {
48498
+ opacity: effect.opacity,
48499
+ }
48500
+ : effect;
48501
+ void animate(list, actualEffect, {
47934
48502
  ...transition,
47935
48503
  restDelta: 1e-3,
47936
48504
  delay: stagger((transition == null ? void 0 : transition.delay) ?? 0, {
47937
48505
  startDelay,
47938
48506
  },),
47939
48507
  },);
48508
+ };
47940
48509
  return;
47941
48510
  }
47942
48511
  case 'line': {
@@ -47969,8 +48538,13 @@ async function runAppearEffect(
47969
48538
  if (!repeat || !cleanupRef) return;
47970
48539
  cleanupRef.current = () => {
47971
48540
  if (list.length === 0) return;
48541
+ const actualEffect = shouldReduceMotion
48542
+ ? {
48543
+ opacity: effect.opacity,
48544
+ }
48545
+ : effect;
47972
48546
  list.forEach((group, i,) => {
47973
- void animate(group, effect, {
48547
+ void animate(group, actualEffect, {
47974
48548
  ...transition,
47975
48549
  restDelta: 1e-3,
47976
48550
  delay: startDelay + i * ((transition == null ? void 0 : transition.delay) ?? 0),
@@ -48110,13 +48684,12 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48110
48684
  if (!visible) return null;
48111
48685
  const isHidden = isEditable && environment2() === RenderTarget.canvas;
48112
48686
  const containerStyle = {
48113
- outline: 'none',
48114
- display: 'flex',
48115
- flexDirection: 'column',
48116
- justifyContent: convertVerticalAlignment(verticalAlignment,),
48117
48687
  opacity: isHidden ? 0 : opacity,
48118
- flexShrink: 0,
48119
48688
  };
48689
+ const justifyContent = convertVerticalAlignment(verticalAlignment,);
48690
+ if (justifyContent !== defaultRichTextContainerStyle.justifyContent) {
48691
+ containerStyle.justifyContent = justifyContent;
48692
+ }
48120
48693
  const positionStyle = {};
48121
48694
  const restrictedRenderTarget = RenderTarget.hasRestrictions();
48122
48695
  const frame2 = calculateRect(props, parentSize || 0, false,);
@@ -48160,11 +48733,11 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48160
48733
  if (layoutId) {
48161
48734
  rest.layout = 'preserve-aspect';
48162
48735
  }
48163
- const Component17 = htmlElementAsMotionComponent(props.as,);
48736
+ const Component18 = htmlElementAsMotionComponent(props.as,);
48164
48737
  const dataFramerName = rest['data-framer-name'] ?? name;
48165
48738
  if (isString(props.viewBox,)) {
48166
48739
  if (props.as !== void 0) {
48167
- return /* @__PURE__ */ jsx3(Component17, {
48740
+ return /* @__PURE__ */ jsx3(Component18, {
48168
48741
  ...rest,
48169
48742
  ref: containerRef,
48170
48743
  style: containerStyle,
@@ -48197,7 +48770,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48197
48770
  },);
48198
48771
  }
48199
48772
  }
48200
- return /* @__PURE__ */ jsx3(Component17, {
48773
+ return /* @__PURE__ */ jsx3(Component18, {
48201
48774
  ...rest,
48202
48775
  ref: containerRef,
48203
48776
  style: containerStyle,
@@ -50688,10 +51261,13 @@ function initialRouteComponent(component,) {
50688
51261
  function useInitialRouteComponent(routes, homeNodeId,) {
50689
51262
  var _a;
50690
51263
  const InitialRouteComponent = (_a = routes[homeNodeId]) == null ? void 0 : _a.page;
50691
- const [RouteComponent, setRouteComponent,] = useState(initialRouteComponent(InitialRouteComponent,),);
51264
+ const [RouteComponent, setRouteComponent,] = useState(() => initialRouteComponent(InitialRouteComponent,));
50692
51265
  useEffect(() => {
50693
51266
  if (withPreload(InitialRouteComponent,)) {
50694
- void InitialRouteComponent.preload().then(setRouteComponent,);
51267
+ void (async () => {
51268
+ await InitialRouteComponent.preload();
51269
+ setRouteComponent(InitialRouteComponent,);
51270
+ })();
50695
51271
  }
50696
51272
  }, [],);
50697
51273
  return RouteComponent;
@@ -50728,12 +51304,12 @@ var package_default = {
50728
51304
  '@types/dom-navigation': '^1.0.5',
50729
51305
  '@types/fontfaceobserver': '2.1',
50730
51306
  '@types/google.fonts': '1.0',
50731
- '@types/node': '22.16',
51307
+ '@types/node': '22.18',
50732
51308
  '@types/react': '18.2',
50733
51309
  '@types/react-dom': '18.2',
50734
51310
  '@types/yargs': '^17.0.33',
50735
- '@typescript-eslint/eslint-plugin': '^8.36.0',
50736
- '@typescript-eslint/parser': '^8.36.0',
51311
+ '@typescript-eslint/eslint-plugin': '^8.40.0',
51312
+ '@typescript-eslint/parser': '^8.40.0',
50737
51313
  chalk: '^4.1.2',
50738
51314
  eslint: '^8.57.1',
50739
51315
  'eslint-plugin-framer-studio': 'workspace:*',
@@ -50742,15 +51318,14 @@ var package_default = {
50742
51318
  'jest-diff': '^29.3.1',
50743
51319
  'jest-environment-jsdom': '^29.3.1',
50744
51320
  'jest-environment-jsdom-global': '^4.0.0',
50745
- 'jest-junit': '^15.0.0',
50746
51321
  react: '^18.2.0',
50747
51322
  'react-dom': '^18.2.0',
50748
51323
  semver: '^7.7.1',
50749
- typescript: '^5.8.3',
51324
+ typescript: '^5.9.2',
50750
51325
  yargs: '^17.7.2',
50751
51326
  },
50752
51327
  peerDependencies: {
50753
- 'framer-motion': '>=12.14.0',
51328
+ 'framer-motion': '12.20.2',
50754
51329
  react: '^18.2.0',
50755
51330
  'react-dom': '^18.2.0',
50756
51331
  },
@@ -50854,6 +51429,7 @@ export {
50854
51429
  createRendererMotionComponent,
50855
51430
  createScopedAnimate,
50856
51431
  cssBackgroundSize,
51432
+ cssCollector,
50857
51433
  cubicBezier,
50858
51434
  cubicBezierAsString,
50859
51435
  CustomCursorHost,
@@ -50965,7 +51541,7 @@ export {
50965
51541
  hover,
50966
51542
  hsla,
50967
51543
  hslaToRgba,
50968
- Image2 as Image,
51544
+ Image3 as Image,
50969
51545
  imagePatternPropsForFill,
50970
51546
  imageUrlForAsset,
50971
51547
  inertia,
@@ -51120,6 +51696,7 @@ export {
51120
51696
  removeHiddenBreakpointLayersV2,
51121
51697
  removeItem,
51122
51698
  RenderTarget,
51699
+ ResetOuterLinkContext,
51123
51700
  resize,
51124
51701
  resolveElements,
51125
51702
  resolveLink,
@@ -51246,6 +51823,7 @@ export {
51246
51823
  useOnVariantChange,
51247
51824
  useOverlayState,
51248
51825
  usePageEffects,
51826
+ usePageInView,
51249
51827
  usePrefetch,
51250
51828
  usePreloadQuery,
51251
51829
  usePresence,