@ionic/core 8.8.20-dev.11791394441.17aeb6fc → 8.8.20-dev.11791579113.1f843ab0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/hydrate/index.js CHANGED
@@ -28436,6 +28436,21 @@ const mdLeaveAnimation$2 = (baseEl, opts) => {
28436
28436
  return baseAnimation;
28437
28437
  };
28438
28438
 
28439
+ /** Gesture velocity arrives in pixels per millisecond; the thresholds below are per second. */
28440
+ const MILLISECONDS_PER_SECOND = 1000;
28441
+ /**
28442
+ * Flick speeds for the ionic theme's physics-based gesture, in pixels per
28443
+ * second. Both are magnitudes. Y grows downwards, so the upward threshold is
28444
+ * negated where it is compared.
28445
+ */
28446
+ const FLICK_DOWN_VELOCITY = 500;
28447
+ /**
28448
+ * How far below its starting breakpoint a slow drag has to end to dismiss the
28449
+ * sheet. 0.4 means the user dragged 40% of the way down from where they started.
28450
+ */
28451
+ const DISMISS_PROGRESS_RATIO = 0.4;
28452
+ /** How far ahead, in milliseconds, a drag's velocity is projected when snapping. */
28453
+ const FLICK_PROJECTION_MS = 350;
28439
28454
  const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, usePhysicsBasedGesture, onDragStart, onDragMove, onDragEnd) => {
28440
28455
  var _a;
28441
28456
  // Defaults for the sheet swipe animation
@@ -28462,6 +28477,11 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28462
28477
  const contentEl = baseEl.querySelector('ion-content');
28463
28478
  // Cache the initial value so the gesture restores it instead of forcing scrolling on.
28464
28479
  const initialContentScrollY = (_a = contentEl === null || contentEl === void 0 ? void 0 : contentEl.scrollY) !== null && _a !== void 0 ? _a : true;
28480
+ /**
28481
+ * The height of the sheet the user actually sees. This comes from the wrapper
28482
+ * rather than the host element, which is stretched to the full viewport no
28483
+ * matter how tall the sheet itself is.
28484
+ */
28465
28485
  const height = wrapperEl.clientHeight;
28466
28486
  let currentBreakpoint = initialBreakpoint;
28467
28487
  let offset = 0;
@@ -28760,27 +28780,23 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28760
28780
  : step;
28761
28781
  offset = clamp(0.0001, processedStep, maxStep);
28762
28782
  animation.progressStep(offset);
28763
- const snapBreakpoint = usePhysicsBasedGesture
28764
- ? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
28765
- : calculatePositionSnapBreakpoint(detail.deltaY);
28783
+ const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
28766
28784
  const eventDetail = {
28767
28785
  currentY: detail.currentY,
28768
28786
  deltaY: detail.deltaY,
28769
28787
  velocityY: detail.velocityY,
28770
- progress: calculateProgress(detail.currentY),
28788
+ progress: calculateEventProgress(detail.deltaY),
28771
28789
  snapBreakpoint: snapBreakpoint,
28772
28790
  };
28773
28791
  onDragMove(eventDetail);
28774
28792
  };
28775
28793
  const onEnd = (detail) => {
28776
- const snapBreakpoint = usePhysicsBasedGesture
28777
- ? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
28778
- : calculatePositionSnapBreakpoint(detail.deltaY);
28794
+ const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
28779
28795
  const eventDetail = {
28780
28796
  currentY: detail.currentY,
28781
28797
  deltaY: detail.deltaY,
28782
28798
  velocityY: detail.velocityY,
28783
- progress: calculateProgress(detail.currentY),
28799
+ progress: calculateEventProgress(detail.deltaY),
28784
28800
  snapBreakpoint,
28785
28801
  };
28786
28802
  /**
@@ -28968,6 +28984,20 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28968
28984
  .progressEnd(1, 0, animated ? duration : 0);
28969
28985
  });
28970
28986
  };
28987
+ /**
28988
+ * Decides which breakpoint the sheet should settle on for the current drag.
28989
+ *
28990
+ * @param deltaY The change in Y position since the gesture started
28991
+ * @param velocityY The velocity in pixels per millisecond
28992
+ * @returns The snap breakpoint value
28993
+ */
28994
+ const calculateSnapBreakpoint = (deltaY, velocityY) => {
28995
+ if (usePhysicsBasedGesture) {
28996
+ return calculateVelocitySnapBreakpoint(deltaY, velocityY);
28997
+ }
28998
+ // Project the drag forward so a quick flick counts.
28999
+ return calculatePositionSnapBreakpoint(deltaY + velocityY * FLICK_PROJECTION_MS);
29000
+ };
28971
29001
  /**
28972
29002
  * Calculates the breakpoint based on the current deltaY.
28973
29003
  * This determines where the sheet should snap to when the user releases the
@@ -28977,16 +29007,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28977
29007
  * @returns The snap breakpoint value.
28978
29008
  */
28979
29009
  const calculatePositionSnapBreakpoint = (deltaY) => {
28980
- /**
28981
- * Calculates the real-time vertical position of the modal.
28982
- * We combine the wrapper's current bounding box position with the
28983
- * gesture's deltaY to account for the physical movement during the drag.
28984
- */
28985
- const currentY = wrapperEl.getBoundingClientRect().top + deltaY;
28986
- /**
28987
- * Convert that pixel position back into a 0 to 1 progress value.
28988
- */
28989
- const currentProgress = calculateProgress(currentY);
29010
+ const currentProgress = calculateProgress(deltaY);
28990
29011
  /**
28991
29012
  * Find and return the defined breakpoint that is closest to the
28992
29013
  * current progress.
@@ -29008,16 +29029,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29008
29029
  *
29009
29030
  * @param deltaY The change in Y position since gesture started
29010
29031
  * @param velocityY The velocity in pixels per millisecond
29011
- * @param currentY The current Y position of the gesture
29012
29032
  * @returns The snap breakpoint value
29013
29033
  */
29014
- const calculateVelocitySnapBreakpoint = (deltaY, velocityY, currentY) => {
29034
+ const calculateVelocitySnapBreakpoint = (deltaY, velocityY) => {
29015
29035
  // Convert velocity from px/ms to px/s for easier threshold comparison
29016
- const velocityYPerSecond = velocityY * 1000;
29036
+ const velocityYPerSecond = velocityY * MILLISECONDS_PER_SECOND;
29017
29037
  // Calculate current progress (0 = fully closed, 1 = fully expanded)
29018
- const currentProgress = calculateProgress(currentY);
29038
+ const currentProgress = calculateProgress(deltaY);
29019
29039
  // Rule 1: Fast downward flick always dismisses
29020
- if (velocityYPerSecond > 500) {
29040
+ if (velocityYPerSecond > FLICK_DOWN_VELOCITY) {
29021
29041
  return minBreakpoint;
29022
29042
  }
29023
29043
  // Rule 2: Fast upward flick moves to next breakpoint above
@@ -29032,8 +29052,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29032
29052
  // Calculate how far we've moved below the current snap point
29033
29053
  const distanceBelowSnap = currentBreakpoint - currentProgress;
29034
29054
  const percentageBelowSnap = distanceBelowSnap / currentBreakpoint;
29035
- // If dragged more than 40% below and not flicking up, dismiss
29036
- if (percentageBelowSnap > 0.4 && velocityYPerSecond <= 400) {
29055
+ if (percentageBelowSnap > DISMISS_PROGRESS_RATIO) {
29037
29056
  return 0;
29038
29057
  }
29039
29058
  }
@@ -29041,74 +29060,26 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29041
29060
  return calculatePositionSnapBreakpoint(deltaY);
29042
29061
  };
29043
29062
  /**
29044
- * Calculates the progress of the swipe gesture.
29045
- *
29046
- * The progress is a value between 0 and 1 that represents how far
29047
- * the swipe has progressed towards closing the modal.
29063
+ * Calculates how open the sheet is part way through a gesture, on the same
29064
+ * 0 to 1 scale as the breakpoints: 1 is fully open and 0 is fully closed.
29048
29065
  *
29049
- * A value closer to 1 means the modal is closer to being opened,
29050
- * while a value closer to 0 means the modal is closer to being closed.
29051
- *
29052
- * @param currentY The current Y position of the gesture
29066
+ * @param deltaY The change in Y position since the gesture started
29053
29067
  * @returns The progress of the sheet gesture
29054
29068
  */
29055
- const calculateProgress = (currentY) => {
29056
- const minBreakpoint = breakpoints[0];
29057
- const maxBreakpoint = breakpoints[breakpoints.length - 1];
29058
- /**
29059
- * The lowest point the sheet can be dragged to aka the point at which
29060
- * the sheet is fully closed.
29061
- */
29062
- const maxY = convertBreakpointToY(minBreakpoint);
29063
- /**
29064
- * The highest point the sheet can be dragged to aka the point at which
29065
- * the sheet is fully open.
29066
- */
29067
- const minY = convertBreakpointToY(maxBreakpoint);
29068
- // The total distance between the fully open and fully closed positions.
29069
- const totalDistance = maxY - minY;
29070
- // The distance from the current position to the fully closed position.
29071
- const distanceFromBottom = maxY - currentY;
29072
- /**
29073
- * The progress represents how far the sheet is from the bottom relative
29074
- * to the total distance. When the user starts swiping up, the progress
29075
- * should be close to 1, and when the user has swiped all the way down,
29076
- * the progress should be close to 0.
29077
- */
29078
- const progress = distanceFromBottom / totalDistance;
29069
+ const calculateProgress = (deltaY) => {
29070
+ // Mirrors the animation step in onMove, so the snap matches where the sheet is drawn.
29071
+ const progress = currentBreakpoint - deltaY / height;
29079
29072
  // Round to the nearest thousandth to avoid returning very small decimal
29080
29073
  const roundedProgress = Math.round(progress * 1000) / 1000;
29081
- return Math.max(0, Math.min(1, roundedProgress));
29074
+ return clamp(0, roundedProgress, 1);
29082
29075
  };
29083
29076
  /**
29084
- * Converts a breakpoint value (0 to 1) into a pixel Y coordinate
29085
- * on the screen.
29086
- *
29087
- * @param breakpoint The breakpoint value (e.g., 0.5 for half-open)
29088
- * @returns The pixel Y coordinate on the screen
29077
+ * Scales the progress from the lowest to the highest breakpoint, so the
29078
+ * drag events report 0 at the lowest breakpoint and 1 at the highest.
29089
29079
  */
29090
- const convertBreakpointToY = (breakpoint) => {
29091
- const rect = baseEl.getBoundingClientRect();
29092
- const modalHeight = rect.height;
29093
- // The bottom of the screen.
29094
- const viewportBottom = window.innerHeight;
29095
- /**
29096
- * The active height is how much of the modal is actually showing
29097
- * on the screen for this specific breakpoint.
29098
- */
29099
- const activeHeight = modalHeight * breakpoint;
29100
- /**
29101
- * To find the Y coordinate, start at the bottom of the screen
29102
- * and move up by the active height of the modal.
29103
- *
29104
- * A breakpoint of 1.0 means the active height is the full modal height
29105
- * (fully open). A breakpoint of 0.0 means the active height is 0
29106
- * (fully closed).
29107
- *
29108
- * Since screen Y coordinates get smaller as you go up, we subtract the
29109
- * active height from the viewport bottom.
29110
- */
29111
- return viewportBottom - activeHeight;
29080
+ const calculateEventProgress = (deltaY) => {
29081
+ const progress = (calculateProgress(deltaY) - minBreakpoint) / (maxBreakpoint - minBreakpoint);
29082
+ return clamp(0, progress, 1);
29112
29083
  };
29113
29084
  const gesture = createGesture({
29114
29085
  el: wrapperEl,
package/hydrate/index.mjs CHANGED
@@ -28434,6 +28434,21 @@ const mdLeaveAnimation$2 = (baseEl, opts) => {
28434
28434
  return baseAnimation;
28435
28435
  };
28436
28436
 
28437
+ /** Gesture velocity arrives in pixels per millisecond; the thresholds below are per second. */
28438
+ const MILLISECONDS_PER_SECOND = 1000;
28439
+ /**
28440
+ * Flick speeds for the ionic theme's physics-based gesture, in pixels per
28441
+ * second. Both are magnitudes. Y grows downwards, so the upward threshold is
28442
+ * negated where it is compared.
28443
+ */
28444
+ const FLICK_DOWN_VELOCITY = 500;
28445
+ /**
28446
+ * How far below its starting breakpoint a slow drag has to end to dismiss the
28447
+ * sheet. 0.4 means the user dragged 40% of the way down from where they started.
28448
+ */
28449
+ const DISMISS_PROGRESS_RATIO = 0.4;
28450
+ /** How far ahead, in milliseconds, a drag's velocity is projected when snapping. */
28451
+ const FLICK_PROJECTION_MS = 350;
28437
28452
  const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, usePhysicsBasedGesture, onDragStart, onDragMove, onDragEnd) => {
28438
28453
  var _a;
28439
28454
  // Defaults for the sheet swipe animation
@@ -28460,6 +28475,11 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28460
28475
  const contentEl = baseEl.querySelector('ion-content');
28461
28476
  // Cache the initial value so the gesture restores it instead of forcing scrolling on.
28462
28477
  const initialContentScrollY = (_a = contentEl === null || contentEl === void 0 ? void 0 : contentEl.scrollY) !== null && _a !== void 0 ? _a : true;
28478
+ /**
28479
+ * The height of the sheet the user actually sees. This comes from the wrapper
28480
+ * rather than the host element, which is stretched to the full viewport no
28481
+ * matter how tall the sheet itself is.
28482
+ */
28463
28483
  const height = wrapperEl.clientHeight;
28464
28484
  let currentBreakpoint = initialBreakpoint;
28465
28485
  let offset = 0;
@@ -28758,27 +28778,23 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28758
28778
  : step;
28759
28779
  offset = clamp(0.0001, processedStep, maxStep);
28760
28780
  animation.progressStep(offset);
28761
- const snapBreakpoint = usePhysicsBasedGesture
28762
- ? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
28763
- : calculatePositionSnapBreakpoint(detail.deltaY);
28781
+ const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
28764
28782
  const eventDetail = {
28765
28783
  currentY: detail.currentY,
28766
28784
  deltaY: detail.deltaY,
28767
28785
  velocityY: detail.velocityY,
28768
- progress: calculateProgress(detail.currentY),
28786
+ progress: calculateEventProgress(detail.deltaY),
28769
28787
  snapBreakpoint: snapBreakpoint,
28770
28788
  };
28771
28789
  onDragMove(eventDetail);
28772
28790
  };
28773
28791
  const onEnd = (detail) => {
28774
- const snapBreakpoint = usePhysicsBasedGesture
28775
- ? calculateVelocitySnapBreakpoint(detail.deltaY, detail.velocityY, detail.currentY)
28776
- : calculatePositionSnapBreakpoint(detail.deltaY);
28792
+ const snapBreakpoint = calculateSnapBreakpoint(detail.deltaY, detail.velocityY);
28777
28793
  const eventDetail = {
28778
28794
  currentY: detail.currentY,
28779
28795
  deltaY: detail.deltaY,
28780
28796
  velocityY: detail.velocityY,
28781
- progress: calculateProgress(detail.currentY),
28797
+ progress: calculateEventProgress(detail.deltaY),
28782
28798
  snapBreakpoint,
28783
28799
  };
28784
28800
  /**
@@ -28966,6 +28982,20 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28966
28982
  .progressEnd(1, 0, animated ? duration : 0);
28967
28983
  });
28968
28984
  };
28985
+ /**
28986
+ * Decides which breakpoint the sheet should settle on for the current drag.
28987
+ *
28988
+ * @param deltaY The change in Y position since the gesture started
28989
+ * @param velocityY The velocity in pixels per millisecond
28990
+ * @returns The snap breakpoint value
28991
+ */
28992
+ const calculateSnapBreakpoint = (deltaY, velocityY) => {
28993
+ if (usePhysicsBasedGesture) {
28994
+ return calculateVelocitySnapBreakpoint(deltaY, velocityY);
28995
+ }
28996
+ // Project the drag forward so a quick flick counts.
28997
+ return calculatePositionSnapBreakpoint(deltaY + velocityY * FLICK_PROJECTION_MS);
28998
+ };
28969
28999
  /**
28970
29000
  * Calculates the breakpoint based on the current deltaY.
28971
29001
  * This determines where the sheet should snap to when the user releases the
@@ -28975,16 +29005,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
28975
29005
  * @returns The snap breakpoint value.
28976
29006
  */
28977
29007
  const calculatePositionSnapBreakpoint = (deltaY) => {
28978
- /**
28979
- * Calculates the real-time vertical position of the modal.
28980
- * We combine the wrapper's current bounding box position with the
28981
- * gesture's deltaY to account for the physical movement during the drag.
28982
- */
28983
- const currentY = wrapperEl.getBoundingClientRect().top + deltaY;
28984
- /**
28985
- * Convert that pixel position back into a 0 to 1 progress value.
28986
- */
28987
- const currentProgress = calculateProgress(currentY);
29008
+ const currentProgress = calculateProgress(deltaY);
28988
29009
  /**
28989
29010
  * Find and return the defined breakpoint that is closest to the
28990
29011
  * current progress.
@@ -29006,16 +29027,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29006
29027
  *
29007
29028
  * @param deltaY The change in Y position since gesture started
29008
29029
  * @param velocityY The velocity in pixels per millisecond
29009
- * @param currentY The current Y position of the gesture
29010
29030
  * @returns The snap breakpoint value
29011
29031
  */
29012
- const calculateVelocitySnapBreakpoint = (deltaY, velocityY, currentY) => {
29032
+ const calculateVelocitySnapBreakpoint = (deltaY, velocityY) => {
29013
29033
  // Convert velocity from px/ms to px/s for easier threshold comparison
29014
- const velocityYPerSecond = velocityY * 1000;
29034
+ const velocityYPerSecond = velocityY * MILLISECONDS_PER_SECOND;
29015
29035
  // Calculate current progress (0 = fully closed, 1 = fully expanded)
29016
- const currentProgress = calculateProgress(currentY);
29036
+ const currentProgress = calculateProgress(deltaY);
29017
29037
  // Rule 1: Fast downward flick always dismisses
29018
- if (velocityYPerSecond > 500) {
29038
+ if (velocityYPerSecond > FLICK_DOWN_VELOCITY) {
29019
29039
  return minBreakpoint;
29020
29040
  }
29021
29041
  // Rule 2: Fast upward flick moves to next breakpoint above
@@ -29030,8 +29050,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29030
29050
  // Calculate how far we've moved below the current snap point
29031
29051
  const distanceBelowSnap = currentBreakpoint - currentProgress;
29032
29052
  const percentageBelowSnap = distanceBelowSnap / currentBreakpoint;
29033
- // If dragged more than 40% below and not flicking up, dismiss
29034
- if (percentageBelowSnap > 0.4 && velocityYPerSecond <= 400) {
29053
+ if (percentageBelowSnap > DISMISS_PROGRESS_RATIO) {
29035
29054
  return 0;
29036
29055
  }
29037
29056
  }
@@ -29039,74 +29058,26 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
29039
29058
  return calculatePositionSnapBreakpoint(deltaY);
29040
29059
  };
29041
29060
  /**
29042
- * Calculates the progress of the swipe gesture.
29043
- *
29044
- * The progress is a value between 0 and 1 that represents how far
29045
- * the swipe has progressed towards closing the modal.
29061
+ * Calculates how open the sheet is part way through a gesture, on the same
29062
+ * 0 to 1 scale as the breakpoints: 1 is fully open and 0 is fully closed.
29046
29063
  *
29047
- * A value closer to 1 means the modal is closer to being opened,
29048
- * while a value closer to 0 means the modal is closer to being closed.
29049
- *
29050
- * @param currentY The current Y position of the gesture
29064
+ * @param deltaY The change in Y position since the gesture started
29051
29065
  * @returns The progress of the sheet gesture
29052
29066
  */
29053
- const calculateProgress = (currentY) => {
29054
- const minBreakpoint = breakpoints[0];
29055
- const maxBreakpoint = breakpoints[breakpoints.length - 1];
29056
- /**
29057
- * The lowest point the sheet can be dragged to aka the point at which
29058
- * the sheet is fully closed.
29059
- */
29060
- const maxY = convertBreakpointToY(minBreakpoint);
29061
- /**
29062
- * The highest point the sheet can be dragged to aka the point at which
29063
- * the sheet is fully open.
29064
- */
29065
- const minY = convertBreakpointToY(maxBreakpoint);
29066
- // The total distance between the fully open and fully closed positions.
29067
- const totalDistance = maxY - minY;
29068
- // The distance from the current position to the fully closed position.
29069
- const distanceFromBottom = maxY - currentY;
29070
- /**
29071
- * The progress represents how far the sheet is from the bottom relative
29072
- * to the total distance. When the user starts swiping up, the progress
29073
- * should be close to 1, and when the user has swiped all the way down,
29074
- * the progress should be close to 0.
29075
- */
29076
- const progress = distanceFromBottom / totalDistance;
29067
+ const calculateProgress = (deltaY) => {
29068
+ // Mirrors the animation step in onMove, so the snap matches where the sheet is drawn.
29069
+ const progress = currentBreakpoint - deltaY / height;
29077
29070
  // Round to the nearest thousandth to avoid returning very small decimal
29078
29071
  const roundedProgress = Math.round(progress * 1000) / 1000;
29079
- return Math.max(0, Math.min(1, roundedProgress));
29072
+ return clamp(0, roundedProgress, 1);
29080
29073
  };
29081
29074
  /**
29082
- * Converts a breakpoint value (0 to 1) into a pixel Y coordinate
29083
- * on the screen.
29084
- *
29085
- * @param breakpoint The breakpoint value (e.g., 0.5 for half-open)
29086
- * @returns The pixel Y coordinate on the screen
29075
+ * Scales the progress from the lowest to the highest breakpoint, so the
29076
+ * drag events report 0 at the lowest breakpoint and 1 at the highest.
29087
29077
  */
29088
- const convertBreakpointToY = (breakpoint) => {
29089
- const rect = baseEl.getBoundingClientRect();
29090
- const modalHeight = rect.height;
29091
- // The bottom of the screen.
29092
- const viewportBottom = window.innerHeight;
29093
- /**
29094
- * The active height is how much of the modal is actually showing
29095
- * on the screen for this specific breakpoint.
29096
- */
29097
- const activeHeight = modalHeight * breakpoint;
29098
- /**
29099
- * To find the Y coordinate, start at the bottom of the screen
29100
- * and move up by the active height of the modal.
29101
- *
29102
- * A breakpoint of 1.0 means the active height is the full modal height
29103
- * (fully open). A breakpoint of 0.0 means the active height is 0
29104
- * (fully closed).
29105
- *
29106
- * Since screen Y coordinates get smaller as you go up, we subtract the
29107
- * active height from the viewport bottom.
29108
- */
29109
- return viewportBottom - activeHeight;
29078
+ const calculateEventProgress = (deltaY) => {
29079
+ const progress = (calculateProgress(deltaY) - minBreakpoint) / (maxBreakpoint - minBreakpoint);
29080
+ return clamp(0, progress, 1);
29110
29081
  };
29111
29082
  const gesture = createGesture({
29112
29083
  el: wrapperEl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "8.8.20-dev.11791394441.17aeb6fc",
3
+ "version": "8.8.20-dev.11791579113.1f843ab0",
4
4
  "description": "Base components for Ionic",
5
5
  "engines": {
6
6
  "node": ">= 16"
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{p as t,H as o,e,f as a,w as i,c as r,h as n,d as s,t as d}from"./p-D0Iqw6OZ.js";import{i as l,b as h,a as p,d as c,r as m,f,p as u}from"./p-Di8NbWfs.js";import{C as b,a as v,d as x}from"./p-DHvfufkW.js";import{g as w,f as g,r as k,d as y,k as A}from"./p-Df6AAcu8.js";import{c as Y}from"./p-B-hirT0v.js";import{g as O}from"./p-CstXr-x9.js";import{G as S,O as D,F as E,e as B,B as C,j as M,k as T,f as P,g as R,h as I}from"./p-B4GJERAm.js";import{g as N}from"./p-DaJxRxSQ.js";import{e as j,w as z}from"./p-dLA3JnNJ.js";import{w as $,c as L,b as W}from"./p-BU8Blvqg.js";import{KEYBOARD_DID_OPEN as F}from"./p-BwzRqsq1.js";import{c as H}from"./p-DRUGmlKi.js";import{g as V}from"./p-hHmYLOfE.js";import{createGesture as Z}from"./p-BYRVyMu9.js";import{d as K}from"./p-DPBeQeU3.js";var U;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(U||(U={}));const G={getEngine(){const t=O();if(null==t?void 0:t.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const o=this.getEngine();o&&o.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return U.Default;const{style:o}=await t.getInfo();return o}},q=(t,o)=>{if(1===o)return 0;const e=1/(1-o);return t*e+-o*e},J=()=>{!$||$.innerWidth>=768||G.setStyle({style:U.Dark})},_=(t=U.Default)=>{!$||$.innerWidth>=768||G.setStyle({style:t})},Q=t=>{const{currentBreakpoint:o,backdropBreakpoint:e,expandToScroll:a,staticBackdropOpacity:i}=t,r=void 0===e||e<o;let n="0";i?n="calc(var(--backdrop-opacity)":r&&(n=`calc(var(--backdrop-opacity) * ${o})`);const s=H("backdropAnimation").fromTo("opacity",0,n);return r&&s.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:H("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*o}%)`}]),backdropAnimation:s,contentAnimation:a?void 0:H("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-o)+"%"},{offset:1,opacity:1,maxHeight:100*o+"%"}])}},X=t=>{const{currentBreakpoint:o,backdropBreakpoint:e}=t,a=`calc(var(--backdrop-opacity) * ${q(o,e)})`,i=[{offset:0,opacity:a},{offset:1,opacity:0}],r=[{offset:0,opacity:a},{offset:e,opacity:0},{offset:1,opacity:0}],n=H("backdropAnimation").keyframes(0!==e?r:i);return{wrapperAnimation:H("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*o}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:n}},tt=(t,o)=>{const{currentBreakpoint:e,expandToScroll:a}=o,i=w(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:s}=void 0!==e?Q(o):{backdropAnimation:H().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:H().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};n.addElement(i.querySelector("ion-backdrop")),r.addElement(i.querySelector(".modal-wrapper")),!a&&(null==s||s.addElement(t.querySelector(".ion-page"))),n.duration(300).easing("ease-out"),r.duration(400).easing("cubic-bezier(0.32, 0.68, 0, 1)"),null==s||s.duration(400).easing("cubic-bezier(0.32, 0.68, 0, 1)");const d=H().addElement(t).addAnimation([n,r]);return s&&d.addAnimation(s),d},ot=t=>{const o=l(t)?w(t).querySelector(".inner-scroll"):t;return!h(t)&&0===o.scrollTop},et=async(t,o)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,S)&&(o.isRunning()?o.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},at=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,it=.915,rt=(t,o)=>g(400,t/Math.abs(1.1*o),500),nt=(t,o)=>{const e=window.innerHeight,a=t.getBoundingClientRect().top,i=Math.round(1e3*(1-o/(e-a)))/1e3;return Math.max(0,Math.min(1,i))},st=(t,o)=>{const{presentingEl:e,currentBreakpoint:a,expandToScroll:i}=o,r=w(t),{wrapperAnimation:n,backdropAnimation:s,contentAnimation:d}=void 0!==a?Q(o):{backdropAnimation:H().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:H().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};s.addElement(r.querySelector("ion-backdrop")),n.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!i&&(null==d||d.addElement(t.querySelector(".ion-page")));const l=H("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([n]);if(d&&l.addAnimation(d),e){const t=window.innerWidth<768,o="ION-MODAL"===e.tagName&&void 0!==e.presentingElement,a=w(e),i=H().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${o?"-10px":t}) scale(0.915)`;i.afterStyles({transform:a}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).addElement(e).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),l.addAnimation(i)}else if(l.addAnimation(s),o){const t=`translateY(-10px) scale(${o?it:1})`;i.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const e=H().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);l.addAnimation([i,e])}else n.fromTo("opacity","0","1")}else l.addAnimation(s);return l},dt=(t,o,e=500)=>{const{presentingEl:a,currentBreakpoint:i}=o,r=w(t),{wrapperAnimation:n,backdropAnimation:s}=void 0!==i?X(o):{backdropAnimation:H().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:H().fromTo("transform","translateY(0vh)","translateY(100vh)")};s.addElement(r.querySelector("ion-backdrop")),n.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=H("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(e).addAnimation(n);if(a){const t=window.innerWidth<768,o="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,e=w(a),i=H().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(r.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&r.style.setProperty("background-color",""))})),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",e=`translateY(${o?"-10px":t}) scale(0.915)`;i.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:e,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(i)}else if(d.addAnimation(s),o){const t=`translateY(-10px) scale(${o?it:1})`;i.addElement(e.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=H().addElement(e.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([i,a])}else n.fromTo("opacity","1","0")}else d.addAnimation(s);return d},lt=(t,o)=>{const{currentBreakpoint:e,expandToScroll:a}=o,i=w(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:s}=void 0!==e?Q(o):{backdropAnimation:H().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:H().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};n.addElement(i.querySelector("ion-backdrop")),r.addElement(i.querySelector(".modal-wrapper")),!a&&(null==s||s.addElement(t.querySelector(".ion-page")));const d=H().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([n,r]);return s&&d.addAnimation(s),d},ht=(t,o)=>{const{currentBreakpoint:e}=o,a=w(t),{wrapperAnimation:i,backdropAnimation:r}=void 0!==e?X(o):{backdropAnimation:H().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:H().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return r.addElement(a.querySelector("ion-backdrop")),i.addElement(a.querySelector(".modal-wrapper")),H().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([r,i])},pt=new Set(["","100%","100vw","100vh","100dvw","100dvh","100svw","100svh"]);let ct=null,mt=!1;const ft=()=>{if(null!==ct)return ct;const t=null==$?void 0:$.document;if(!(null==t?void 0:t.body))return 0;const o=t.createElement("div");o.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);",t.body.appendChild(o);const e=parseFloat(getComputedStyle(o).paddingTop)||0;return o.remove(),ct=e,mt||(mt=!0,k((()=>{ct=null,mt=!1}))),e},ut=t=>{const o=getComputedStyle(t),e=o.getPropertyValue("--width").trim(),a=o.getPropertyValue("--height").trim();return!pt.has(e)&&!pt.has(a)},bt=(t,o)=>{t.style.setProperty("--ion-safe-area-top",o.top),t.style.setProperty("--ion-safe-area-bottom",o.bottom),t.style.setProperty("--ion-safe-area-left",o.left),t.style.setProperty("--ion-safe-area-right",o.right)},vt=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.didPresent=e(this,"ionModalDidPresent",7),this.willPresent=e(this,"ionModalWillPresent",7),this.willDismiss=e(this,"ionModalWillDismiss",7),this.didDismiss=e(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=e(this,"ionBreakpointDidChange",7),this.didPresentShorthand=e(this,"didPresent",7),this.willPresentShorthand=e(this,"willPresent",7),this.willDismissShorthand=e(this,"willDismiss",7),this.didDismissShorthand=e(this,"didDismiss",7),this.ionMount=e(this,"ionMount",7),this.ionDragStart=e(this,"ionDragStart",7),this.ionDragMove=e(this,"ionDragMove",7),this.ionDragEnd=e(this,"ionDragEnd",7),this.lockController=Y(),this.triggerController=B(),this.coreDelegate=b(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="none",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:o}=this;"cycle"===o&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,C)},this.onLifecycle=t=>{const o=this.usersElement,e=xt[t.type];if(o&&e){const a=new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t.detail});o.dispatchEvent(a)}},this.onModalFocus=t=>{var o;const{dragHandleEl:e,el:a}=this;t.target===a&&null==(null===(o=a.shadowRoot)||void 0===o?void 0:o.activeElement)&&e&&-1!==e.tabIndex&&e.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:e}=this;t&&e.addClickListener(o,t)}onWindowResize(){this.presented&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{const t=this.getSafeAreaContext();if(!t.isCardModal||this.enterAnimation||this.leaveAnimation||this.handleViewTransition(),t.isSheetModal&&this.updateSheetOffsetTop(),!t.isSheetModal&&!t.isCardModal){this.updateSafeAreaOverrides();const{contentEl:t,hasFooter:o}=this.findContentAndFooter();this.clearContentSafeAreaPadding(t),this.applyFullscreenSafeAreaTo(t,o)}}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,o)=>t-o)))}connectedCallback(){const{el:t}=this;M(t),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides()}componentWillLoad(){var t;const{breakpoints:o,initialBreakpoint:e,el:i,htmlAttributes:r}=this,n=this.isSheetModal=void 0!==o&&void 0!==e,s=["aria-label","role"];this.inheritedAttributes=y(i,s),i.parentNode&&(this.cachedOriginalParent=i.parentNode),void 0!==r&&s.forEach((t=>{r[t]&&(this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:r[t]}),delete r[t])})),n&&(this.currentBreakpoint=this.initialBreakpoint),void 0===o||void 0===e||o.includes(e)||a("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||T(this.el)}componentDidLoad(){!0===this.isOpen&&k((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const o=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:o,delegate:this.workingDelegate=o?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,o){const{canDismiss:e}=this;return"function"==typeof e?e(t,o):e}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:o,el:e}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:a,delegate:r}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await v(r,e,this.component,["ion-page"],this.componentProps,a),A(e)?await j(this.usersElement):this.keepContentsMounted||await z(),i((()=>this.el.classList.add("show-modal"))),this.isSheetModal=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint,this.setInitialSafeAreaOverrides();const n=void 0!==o;n&&"ios"===L(this)&&(this.statusBarStyle=await G.getStyle(),J()),await P(this,"modalEnter",st,lt,tt,{presentingEl:o,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll,staticBackdropOpacity:"ionic"===W(this)}),this.updateSafeAreaOverrides(),this.applyFullscreenSafeArea(),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),k((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(F,this.keyboardOpenCallback)),this.isSheetModal?this.initSheetGesture():n&&this.initSwipeToClose(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){var t;if("ios"!==L(this))return;const{el:o}=this,e=this.leaveAnimation||r.get("modalLeave",dt),a=this.animation=e(o,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});if(!f(o))return void u(o);const i=null!==(t=this.statusBarStyle)&&void 0!==t?t:U.Default;this.gesture=((t,o,e,a,i,r,n)=>{const s=.5,d=t.offsetHeight;let h=!1,f=!1,u=null,b=!0,v=0;const x=Z({el:t,gestureName:"modalSwipeToClose",gesturePriority:D,direction:"y",threshold:10,canStart:t=>{const o=t.event.target;return null===o||!o.closest||(u=p(o),u?ot(u):null===o.closest("ion-footer"))},onStart:e=>{var a;const{deltaY:r}=e;null===(a=window.getSelection())||void 0===a||a.removeAllRanges(),b=!u||!l(u)||u.scrollY,f=void 0!==t.canDismiss&&!0!==t.canDismiss,r>0&&u&&c(u),o.progressStart(!0,h?1:0),i()},onMove:a=>{const{deltaY:i}=a;i>0&&u&&c(u);const n=a.deltaY/d,l=n>=0&&f,h=l?.2:.9999,p=l?at(n/h):n,m=g(1e-4,p,h);o.progressStep(m),m>=s&&v<s?_(e):m<s&&v>=s&&J(),v=m;const b={currentY:a.currentY,deltaY:a.deltaY,velocityY:a.velocityY,progress:nt(t,a.deltaY)};r(b)},onEnd:e=>{const i=e.velocityY,r=e.deltaY/d,l=r>=0&&f,p=l?.2:.9999,c=l?at(r/p):r,v=g(1e-4,c,p),w=!l&&(e.deltaY+1e3*i)/d>=s;let k=w?-.001:.001;w?(o.easing("cubic-bezier(0.32, 0.72, 0, 1)"),k+=V([0,0],[.32,.72],[0,1],[1,1],v)[0]):(o.easing("cubic-bezier(1, 0, 0.68, 0.28)"),k+=V([0,0],[1,0],[.68,.28],[1,1],v)[0]);const y=rt(w?r*d:(1-v)*d,i);h=w,x.enable(!1),u&&m(u,b),o.onFinish((()=>{w||x.enable(!0)})).progressEnd(w?1:0,k,y),l&&v>p/4?et(t,o):w&&a();const A={currentY:e.currentY,deltaY:e.deltaY,velocityY:e.velocityY,progress:nt(t,e.deltaY)};n(A)}});return x})(o,a,i,(()=>this.cardOnDismiss()),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t))),this.gesture.enable(!0)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:o,backdropBreakpoint:e}=this;if(!t||void 0===o)return;const a=this.enterAnimation||r.get("modalEnter",st),i=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:o,backdropBreakpoint:e,expandToScroll:this.expandToScroll,staticBackdropOpacity:"ionic"===W(this)});i.progressStart(!0,1);const{gesture:n,moveSheetToBreakpoint:s,resetContentScroll:d}=((t,o,e,a,i,r,n=[],s,d,h,c,m,f,u,b)=>{var v;const x={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==i?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-i,opacity:m?"var(--backdrop-opacity)":0},{offset:1,opacity:m?"var(--backdrop-opacity)":0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:m?"var(--backdrop-opacity)":.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},y=t.querySelector("ion-content"),A=null===(v=null==y?void 0:y.scrollY)||void 0===v||v,Y=e.clientHeight;let O=a,S=0,D=!1,B=null,C=null,M=null,T=null;const P=n[n.length-1],R=n[0],I=r.childAnimations.find((t=>"wrapperAnimation"===t.id)),N=r.childAnimations.find((t=>"backdropAnimation"===t.id)),j=r.childAnimations.find((t=>"contentAnimation"===t.id)),z=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),o.style.setProperty("pointer-events","auto"),t.classList.remove(E))},$=()=>{t.style.setProperty("pointer-events","none"),o.style.setProperty("pointer-events","none"),t.classList.add(E)},L=o=>{if(!C&&(C=Array.from(t.querySelectorAll("ion-footer")),!C.length))return;const e=t.querySelector(".ion-page");if(T=o,"stationary"===o)C.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),null==e||e.style.removeProperty("padding-bottom"),null==e||e.appendChild(t)}));else{let o=0;C.forEach(((e,a)=>{const i=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();o+=e.clientHeight;const n=i.top-r.top,s=i.left-r.left;if(e.style.setProperty("--pinned-width",`${e.clientWidth}px`),e.style.setProperty("--pinned-height",`${e.clientHeight}px`),e.style.setProperty("--pinned-top",`${n}px`),e.style.setProperty("--pinned-left",`${s}px`),0===a){M=n;const o=t.querySelector("ion-header");o&&(M-=o.clientHeight)}})),C.forEach((t=>{null==e||e.style.setProperty("padding-bottom",`${o}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};I&&N&&(I.keyframes([...x.WRAPPER_KEYFRAMES]),N.keyframes([...x.BACKDROP_KEYFRAMES]),null==j||j.keyframes([...x.CONTENT_KEYFRAMES]),r.progressStart(!0,1-O),O>i&&!1!==t.focusTrap&&!1!==t.showBackdrop?z():$()),y&&O!==P&&s&&(y.scrollY=!1);const W=o=>{const{breakpoint:e,canDismiss:a,breakpointOffset:d,animated:l}=o,p=a&&0===e,f=p?O:e,u=f===O,b=m?u?300:400:500,v=u?"cubic-bezier(0.34, 1.4, 0.64, 1)":"cubic-bezier(0.32, 0.68, 0, 1)",w=0!==f;return O=0,I&&N&&(I.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-f)}%)`}]),N.keyframes([{offset:0,opacity:m?"var(--backdrop-opacity)":`calc(var(--backdrop-opacity) * ${q(1-d,i)})`},{offset:1,opacity:m?"var(--backdrop-opacity)":`calc(var(--backdrop-opacity) * ${q(f,i)})`}]),j&&j.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*f+"%"}]),r.progressStep(0)),m&&r.easing(v),U.enable(!1),p?et(t,r):w||h(),!y||f!==n[n.length-1]&&s||(y.scrollY=A),s||0!==f||L("stationary"),new Promise((o=>{r.onFinish((()=>{w?(s||L("stationary"),I&&N?k((()=>{I.keyframes([...x.WRAPPER_KEYFRAMES]),N.keyframes([...x.BACKDROP_KEYFRAMES]),null==j||j.keyframes([...x.CONTENT_KEYFRAMES]),r.progressStart(!0,1-f),O=f,c(O),O>i&&!1!==t.focusTrap&&!1!==t.showBackdrop?z():$(),U.enable(!0),o()})):(U.enable(!0),o())):o()}),{oneTimeCallback:!0}).progressEnd(1,0,l?b:0)}))},F=t=>{const o=e.getBoundingClientRect().top+t,a=V(o);return n.reduce(((t,o)=>Math.abs(o-a)<Math.abs(t-a)?o:t))},H=(t,o,e)=>{const a=1e3*o,i=V(e);if(a>500)return R;if(a<-400){const t=n.find((t=>t>i));return null!=t?t:P}return 0===R&&O>0&&(O-i)/O>.4&&a<=400?0:F(t)},V=t=>{const o=n[n.length-1],e=K(n[0]),a=K(o),i=Math.round((e-t)/(e-a)*1e3)/1e3;return Math.max(0,Math.min(1,i))},K=o=>{const e=t.getBoundingClientRect();return window.innerHeight-e.height*o},U=Z({el:e,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const o=p(t.event.target);return O=d(),!(o&&(!s||1===O))||ot(o)},onStart:o=>{var e;if(null===(e=window.getSelection())||void 0===e||e.removeAllRanges(),D=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===R,!s){const t=p(o.event.target);B=t&&l(t)?w(t).querySelector(".inner-scroll"):t}s||L("moving"),o.deltaY>0&&y&&(y.scrollY=!1),k((()=>{t.focus()})),r.progressStart(!0,1-O),f()},onMove:t=>{if(s||null===M||null===T||(t.currentY>=M&&"moving"===T?L("stationary"):t.currentY<M&&"stationary"===T&&L("moving")),!s&&t.deltaY<=0&&B)return;t.deltaY>0&&y&&(y.scrollY=!1);const o=n.length>1?1-n[1]:void 0,e=1-O+t.deltaY/Y,a=void 0!==o&&e>=o&&D,i=a?.95:.9999,d=a&&void 0!==o?o+at((e-o)/(i-o)):e;S=g(1e-4,d,i),r.progressStep(S);const l=m?H(t.deltaY,t.velocityY,t.currentY):F(t.deltaY),h={currentY:t.currentY,deltaY:t.deltaY,velocityY:t.velocityY,progress:V(t.currentY),snapBreakpoint:l};u(h)},onEnd:t=>{const o=m?H(t.deltaY,t.velocityY,t.currentY):F(t.deltaY),e={currentY:t.currentY,deltaY:t.deltaY,velocityY:t.velocityY,progress:V(t.currentY),snapBreakpoint:o};if(!s&&t.deltaY<=0&&B&&B.scrollTop>0)return L("stationary"),void b(e);W({breakpoint:o,breakpointOffset:S,canDismiss:D,animated:!0}),b(e)}});return{gesture:U,moveSheetToBreakpoint:W,resetContentScroll:()=>{y&&(y.scrollY=A)}}})(this.el,this.backdropEl,t,o,e,i,this.sortedBreakpoints,this.expandToScroll,(()=>{var t;return null!==(t=this.currentBreakpoint)&&void 0!==t?t:0}),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}),"ionic"===W(this),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t)));this.gesture=n,this.moveSheetToBreakpoint=s,this.resetSheetContentScroll=d,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||e>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){var t;this.cachedPageParent=this.getOriginalPageParent();const e=this.cachedPageParent;if(!e||"ION-APP"===e.tagName)return;const a=Array.from(e.children).some((t=>{var e;return!(t===this.el||t instanceof o&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!(null===(e=t.textContent)||void 0===e?void 0:e.trim()))}));if(a)return;e.classList.add("ion-page-overlay-passthrough");const i=e.parentElement;"ION-ROUTER-OUTLET"===(null==i?void 0:i.tagName)&&"ION-APP"!==(null===(t=i.parentElement)||void 0===t?void 0:t.tagName)&&(i.style.setProperty("pointer-events","none"),i.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const o=t.parentElement;(null==o?void 0:o.hasAttribute("data-overlay-passthrough"))&&(o.style.removeProperty("pointer-events"),o.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,S),this.gestureAnimationDismissing=!1}))}cardOnDismiss(){this.gestureAnimationDismissing=!0,_(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,S),this.gestureAnimationDismissing=!1}))}async dismiss(t,o){var e,a;if(this.gestureAnimationDismissing&&o!==S)return!1;clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0;const r=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==o&&!await this.checkCanDismiss(t,o))return r(),!1;const{presentingElement:n}=this;void 0!==n&&"ios"===L(this)&&_(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(F,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await R(this,t,o,"modalLeave",dt,ht,{presentingEl:n,currentBreakpoint:null!==(e=this.currentBreakpoint)&&void 0!==e?e:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await x(t,this.usersElement),i((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),null===(a=this.resetSheetContentScroll)||void 0===a||a.call(this),this.resetSheetContentScroll=void 0,this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.cleanupChildRoutePassthrough()}return this.currentBreakpoint=void 0,this.animation=void 0,r(),s}onDidDismiss(){return I(this.el,"ionModalDidDismiss")}onWillDismiss(){return I(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void a("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void a(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:o,moveSheetToBreakpoint:e,canDismiss:i,breakpoints:r,animated:n}=this;o!==t&&e&&(this.sheetTransition=e({breakpoint:t,breakpointOffset:1-o,canDismiss:void 0!==i&&!0!==i&&0===r[0],animated:n}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:o}=this;if(!t||null==o)return!1;const e=t.filter((t=>0!==t)),a=e.indexOf(o),i=e[(a+1)%e.length];return await this.setCurrentBreakpoint(i),!0}getShape(){const t=W(this),{shape:o}=this;if("ionic"===t)return void 0===o?"round":o}initViewTransitionListener(){"ios"!==L(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:o}=this;if(!o)return;let e;e=this.currentViewIsPortrait&&!t?((t,o,e=300)=>{const{presentingEl:a}=o;if(!a)return H("portrait-to-landscape-transition");const i="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,r=w(a),n=document.body,s=H("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(e),d=H().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(i){const t="translateY(-10px) scale(0.915)",o="translateY(0px) scale(1)";d.addElement(a).afterStyles({transform:o}).fromTo("transform",t,o).fromTo("filter","contrast(0.85)","contrast(1)");const e=H().addElement(r.querySelector(".modal-shadow")).afterStyles({transform:o,opacity:"0"}).fromTo("transform",t,o);s.addAnimation([d,e])}else{const o=w(t),e=H().addElement(o.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),i=H().addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),r=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>n.style.setProperty("background-color",""))).fromTo("transform",r,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),s.addAnimation([d,e,i])}return s})(this.el,{presentingEl:o}):((t,o,e=300)=>{const{presentingEl:a}=o;if(!a)return H("landscape-to-portrait-transition");const i="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,r=w(a),n=document.body,s=H("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(e),d=H().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(i){const t="translateY(-10px) scale(0.915)",o="translateY(0) scale(1)";d.addElement(a).afterStyles({transform:o}).fromTo("transform",t,o);const e=H().addElement(r.querySelector(".modal-shadow")).afterStyles({transform:o,opacity:"0"}).fromTo("transform",t,o);s.addAnimation([d,e])}else{const o=w(t),e=H().addElement(o.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),i=H().addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),r=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:r}).beforeAddWrite((()=>n.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:r,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),s.addAnimation([d,e,i])}return s})(this.el,{presentingEl:o}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=e,e.play().then((()=>{this.viewTransitionAnimation=void 0,k((()=>this.updateSafeAreaOverrides())),this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===L(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),k((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:o}=this,e=w(t).querySelector(".modal-wrapper");if(e&&(e.style.transform="translateY(0vh)",e.style.opacity="1"),"ION-MODAL"===(null==o?void 0:o.tagName))if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";o.style.transform=`translateY(${t}) scale(0.915)`}else o.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);null==t||t.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{var o,e;const a=t===this.cachedOriginalParent,i=!!this.cachedOriginalParent&&(null===(e=(o=t).contains)||void 0===e?void 0:e.call(o,this.cachedOriginalParent));return a||i}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){var t;null===(t=this.parentRemovalObserver)||void 0===t||t.disconnect(),this.parentRemovalObserver=void 0}onDragStart(){this.ionDragStart.emit()}onDragMove(t){this.ionDragMove.emit(t)}onDragEnd(t){this.ionDragEnd.emit(t)}getSafeAreaContext(){return{isSheetModal:this.isSheetModal,isCardModal:void 0!==this.presentingElement&&"ios"===L(this),presentingElement:this.presentingElement,breakpoints:this.breakpoints,currentBreakpoint:this.currentBreakpoint}}setInitialSafeAreaOverrides(){const t=Object.assign(Object.assign({},this.getSafeAreaContext()),{hasCustomDimensions:ut(this.el)}),o=(t=>{const{isSheetModal:o,isCardModal:e}=t;return o?{top:"0px",bottom:"inherit",left:"0px",right:"0px"}:e?{top:"inherit",bottom:"inherit",left:"0px",right:"0px"}:$&&$.matchMedia("(min-width: 768px) and (min-height: 600px)").matches||t.hasCustomDimensions?{top:"0px",bottom:"0px",left:"0px",right:"0px"}:{top:"inherit",bottom:"inherit",left:"inherit",right:"inherit"}})(t);bt(this.el,o),t.isSheetModal&&(this.updateSheetOffsetTop(),this.unsubscribeRootSafeAreaTop=(t=>{const o=null==$?void 0:$.document;if(!(null==o?void 0:o.body)||"undefined"==typeof ResizeObserver)return()=>{};const e=o.createElement("div");e.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;width:0;height:var(--ion-safe-area-top,0px);",o.body.appendChild(e);let a=ft();const i=new ResizeObserver((o=>{const{height:e}=o[0].contentRect;e!==a&&(a=e,t(e))}));return i.observe(e),()=>{i.disconnect(),e.remove()}})((t=>this.updateSheetOffsetTop(t))))}updateSheetOffsetTop(t){const o=null!=t?t:ft();this.el.style.setProperty("--ion-modal-offset-top",`${o}px`)}updateSafeAreaOverrides(){const{wrapperEl:t,el:o}=this,e=this.getSafeAreaContext();if(e.isSheetModal)return;if(e.isCardModal)return;if(!t)return;const a=(t=>{var o,e;const a=t.getBoundingClientRect(),i=null!==(o=null==$?void 0:$.innerHeight)&&void 0!==o?o:0,r=null!==(e=null==$?void 0:$.innerWidth)&&void 0!==e?e:0;return{top:a.top<=5?"inherit":"0px",bottom:a.bottom>=i-5?"inherit":"0px",left:a.left<=5?"inherit":"0px",right:a.right>=r-5?"inherit":"0px"}})(t);bt(o,a)}applyFullscreenSafeArea(){const t=this.getSafeAreaContext();if(t.isSheetModal||t.isCardModal)return;const{contentEl:o,hasFooter:e}=this.findContentAndFooter();this.applyFullscreenSafeAreaTo(o,e)}applyFullscreenSafeAreaTo(t,o){t&&!o&&t.style.setProperty("--internal-content-safe-area-padding-bottom","var(--ion-safe-area-bottom, 0px)")}clearContentSafeAreaPadding(t){t&&t.style.removeProperty("--internal-content-safe-area-padding-bottom")}findContentAndFooter(){let t=null,o=!1;for(const e of Array.from(this.el.children)){"ION-CONTENT"===e.tagName&&(t=e),"ION-FOOTER"===e.tagName&&(o=!0);for(const a of Array.from(e.children))"ION-CONTENT"!==a.tagName||t||(t=a),"ION-FOOTER"===a.tagName&&(o=!0)}return{contentEl:t,hasFooter:o}}cleanupSafeAreaOverrides(){var t,o;(o=this.el).style.removeProperty("--ion-safe-area-top"),o.style.removeProperty("--ion-safe-area-bottom"),o.style.removeProperty("--ion-safe-area-left"),o.style.removeProperty("--ion-safe-area-right"),null===(t=this.unsubscribeRootSafeAreaTop)||void 0===t||t.call(this),this.unsubscribeRootSafeAreaTop=void 0,this.el.style.removeProperty("--ion-modal-offset-top");const{contentEl:e}=this.findContentAndFooter();this.clearContentSafeAreaPadding(e)}render(){const{handle:t,isSheetModal:o,presentingElement:e,htmlAttributes:a,handleBehavior:i,inheritedAttributes:r,focusTrap:d,expandToScroll:l}=this,h=!1!==t&&o,p=W(this),c=void 0!==e&&"ios"===p,m="cycle"===i,f=this.getShape();return n(s,Object.assign({key:"d38744e448224ea65c04edacd038f4226b13f4d6","no-router":!0,tabIndex:m&&o&&h?0:-1},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[p]:!0,"modal-default":!c&&!o,"modal-card":c,"modal-sheet":o,[`modal-${f}`]:void 0!==f,"modal-no-expand-scroll":o&&!l,"overlay-hidden":!0,[E]:!1===d},N(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus}),n("ion-backdrop",{key:"292c61796d71ef63a68a8f48e35bd2a75bb54c27",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===p&&n("div",{key:"3e33304213a627aae63f884a07f1c2db0ea8dab9",class:"modal-shadow"}),n("div",Object.assign({key:"ee5791d964e1d06b8a77f0e90b2402676be8c166",role:"dialog"},r,{"aria-modal":"true",tabIndex:-1,class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t}),h&&n("button",{key:"d7be6afa0dc0db1003c28f90c584ebe47e05fb99",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle","data-focus-order":"1",ref:t=>this.dragHandleEl=t}),n("slot",{key:"dde62a1eb46ebf12e0b11b0076972eb5b401a255",onSlotchange:this.onSlotChange})))}get el(){return this}static get watchers(){return{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}}static get style(){return{ionic:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-width:0;--border-style:none;--border-color:transparent;--box-shadow:none;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-wrapper{outline:none}.modal-shadow{position:absolute;background:transparent}.modal-handle{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;cursor:pointer;z-index:11}.modal-handle::before{position:absolute;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--background:var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));--box-shadow:var(--token-elevation-3, var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-6, 6px) var(--token-shadow-blur-32, 32px) var(--token-shadow-spread-0, 0px) var(--token-shadow-6, rgba(0, 0, 0, 0.16)), var(--token-shadow-offset-0, 0px) var(--token-shadow-offset-2, 2px) var(--token-shadow-blur-7, 7px) var(--token-shadow-spread-0, 0px) var(--token-shadow-2, rgba(0, 0, 0, 0.05)));--backdrop-opacity:0.7;color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528))}:host(.modal-round){--border-radius:var(--token-border-radius-1000, var(--token-scale-1000, 40px))}:host(.modal-soft){--border-radius:var(--token-border-radius-400, var(--token-scale-400, 16px))}:host(.modal-rectangular){--border-radius:var(--token-border-radius-0, var(--token-scale-0, 0px))}:host(.select-modal.modal-default){--max-height:45%;--max-width:calc(100% - (var(--token-space-400, var(--token-scale-400, 16px)) * 2));--min-height:340px}.modal-handle{right:0px;left:0px;top:var(--token-space-300, var(--token-scale-300, 12px));border-radius:var(--token-border-radius-100, var(--token-scale-100, 4px));width:var(--token-scale-1100, 44px);height:var(--token-scale-100, 4px);background-color:var(--token-primitives-neutral-300, #e6eaee)}.modal-handle::before{-webkit-padding-start:var(--token-space-100, var(--token-scale-100, 4px));padding-inline-start:var(--token-space-100, var(--token-scale-100, 4px));-webkit-padding-end:var(--token-space-100, var(--token-scale-100, 4px));padding-inline-end:var(--token-space-100, var(--token-scale-100, 4px));padding-top:var(--token-space-100, var(--token-scale-100, 4px));padding-bottom:var(--token-space-100, var(--token-scale-100, 4px))}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + var(--token-scale-250, 10px)))}',ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-width:0;--border-style:none;--border-color:transparent;--box-shadow:none;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-wrapper{outline:none}.modal-shadow{position:absolute;background:transparent}.modal-handle{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;cursor:pointer;z-index:11}.modal-handle::before{position:absolute;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--background:var(--ion-background-color, #fff);--border-radius:0;--backdrop-opacity:0;color:var(--ion-text-color, #000)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{right:0px;left:0px;top:5px;border-radius:8px;width:36px;height:5px;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be))}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;width:36px;height:5px}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-width:0;--border-style:none;--border-color:transparent;--box-shadow:none;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-wrapper{outline:none}.modal-shadow{position:absolute;background:transparent}.modal-handle{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;cursor:pointer;z-index:11}.modal-handle::before{position:absolute;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--background:var(--ion-background-color, #fff);--border-radius:0;--backdrop-opacity:0;color:var(--ion-text-color, #000)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{right:0px;left:0px;top:5px;border-radius:8px;width:36px;height:5px;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be))}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;width:36px;height:5px}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'}}},[289,"ion-modal",{hasController:[4,"has-controller"],overlayIndex:[2,"overlay-index"],delegate:[16],keyboardClose:[4,"keyboard-close"],enterAnimation:[16],leaveAnimation:[16],breakpoints:[16],expandToScroll:[4,"expand-to-scroll"],initialBreakpoint:[2,"initial-breakpoint"],backdropBreakpoint:[2,"backdrop-breakpoint"],handle:[4],handleBehavior:[1,"handle-behavior"],component:[1],componentProps:[16],cssClass:[1,"css-class"],backdropDismiss:[4,"backdrop-dismiss"],showBackdrop:[4,"show-backdrop"],animated:[4],presentingElement:[16],htmlAttributes:[16],isOpen:[4,"is-open"],trigger:[1],keepContentsMounted:[4,"keep-contents-mounted"],focusTrap:[4,"focus-trap"],canDismiss:[4,"can-dismiss"],shape:[1],isSheetModal:[32],presented:[32],present:[64],dismiss:[64],onDidDismiss:[64],onWillDismiss:[64],setCurrentBreakpoint:[64],getCurrentBreakpoint:[64]},[[9,"resize","onWindowResize"]],{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}]),xt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};function wt(){"undefined"!=typeof customElements&&["ion-modal","ion-backdrop"].forEach((t=>{switch(t){case"ion-modal":customElements.get(d(t))||customElements.define(d(t),vt);break;case"ion-backdrop":customElements.get(d(t))||K()}}))}export{vt as M,wt as d}