@ionic/core 8.5.7 → 8.5.8-dev.11748374591.17686118
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/components/modal.js +68 -159
- package/css/core.css +1 -1
- package/css/core.css.map +1 -1
- package/css/ionic.bundle.css +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +68 -159
- package/dist/collection/components/modal/animations/ios.enter.js +1 -41
- package/dist/collection/components/modal/animations/ios.leave.js +2 -24
- package/dist/collection/components/modal/animations/md.enter.js +1 -41
- package/dist/collection/components/modal/animations/md.leave.js +2 -24
- package/dist/collection/components/modal/gestures/sheet.js +62 -29
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +68 -159
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-b7242f55.entry.js +4 -0
- package/dist/ionic/p-db06d822.system.entry.js +4 -0
- package/dist/ionic/p-f725bf9e.system.js +1 -1
- package/hydrate/index.js +68 -159
- package/hydrate/index.mjs +68 -159
- package/package.json +1 -1
- package/dist/ionic/p-12914457.entry.js +0 -4
- package/dist/ionic/p-cec902a0.system.entry.js +0 -4
|
@@ -584,47 +584,7 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
|
584
584
|
.addElement(baseEl)
|
|
585
585
|
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
586
586
|
.duration(500)
|
|
587
|
-
.addAnimation([wrapperAnimation])
|
|
588
|
-
.beforeAddWrite(() => {
|
|
589
|
-
if (expandToScroll) {
|
|
590
|
-
// Scroll can only be done when the modal is fully expanded.
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* There are some browsers that causes flickering when
|
|
595
|
-
* dragging the content when scroll is enabled at every
|
|
596
|
-
* breakpoint. This is due to the wrapper element being
|
|
597
|
-
* transformed off the screen and having a snap animation.
|
|
598
|
-
*
|
|
599
|
-
* A workaround is to clone the footer element and append
|
|
600
|
-
* it outside of the wrapper element. This way, the footer
|
|
601
|
-
* is still visible and the drag can be done without
|
|
602
|
-
* flickering. The original footer is hidden until the modal
|
|
603
|
-
* is dismissed. This maintains the animation of the footer
|
|
604
|
-
* when the modal is dismissed.
|
|
605
|
-
*
|
|
606
|
-
* The workaround needs to be done before the animation starts
|
|
607
|
-
* so there are no flickering issues.
|
|
608
|
-
*/
|
|
609
|
-
const ionFooter = baseEl.querySelector('ion-footer');
|
|
610
|
-
/**
|
|
611
|
-
* This check is needed to prevent more than one footer
|
|
612
|
-
* from being appended to the shadow root.
|
|
613
|
-
* Otherwise, iOS and MD enter animations would append
|
|
614
|
-
* the footer twice.
|
|
615
|
-
*/
|
|
616
|
-
const ionFooterAlreadyAppended = baseEl.shadowRoot.querySelector('ion-footer');
|
|
617
|
-
if (ionFooter && !ionFooterAlreadyAppended) {
|
|
618
|
-
const footerHeight = ionFooter.clientHeight;
|
|
619
|
-
const clonedFooter = ionFooter.cloneNode(true);
|
|
620
|
-
baseEl.shadowRoot.appendChild(clonedFooter);
|
|
621
|
-
ionFooter.style.setProperty('display', 'none');
|
|
622
|
-
ionFooter.setAttribute('aria-hidden', 'true');
|
|
623
|
-
// Padding is added to prevent some content from being hidden.
|
|
624
|
-
const page = baseEl.querySelector('.ion-page');
|
|
625
|
-
page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
626
|
-
}
|
|
627
|
-
});
|
|
587
|
+
.addAnimation([wrapperAnimation]);
|
|
628
588
|
if (contentAnimation) {
|
|
629
589
|
baseAnimation.addAnimation(contentAnimation);
|
|
630
590
|
}
|
|
@@ -705,7 +665,7 @@ const createLeaveAnimation$1 = () => {
|
|
|
705
665
|
* iOS Modal Leave Animation
|
|
706
666
|
*/
|
|
707
667
|
const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
708
|
-
const { presentingEl, currentBreakpoint
|
|
668
|
+
const { presentingEl, currentBreakpoint } = opts;
|
|
709
669
|
const root = getElementRoot(baseEl);
|
|
710
670
|
const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation$1();
|
|
711
671
|
backdropAnimation.addElement(root.querySelector('ion-backdrop'));
|
|
@@ -714,29 +674,7 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
|
714
674
|
.addElement(baseEl)
|
|
715
675
|
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
716
676
|
.duration(duration)
|
|
717
|
-
.addAnimation(wrapperAnimation)
|
|
718
|
-
.beforeAddWrite(() => {
|
|
719
|
-
if (expandToScroll) {
|
|
720
|
-
// Scroll can only be done when the modal is fully expanded.
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* If expandToScroll is disabled, we need to swap
|
|
725
|
-
* the visibility to the original, so the footer
|
|
726
|
-
* dismisses with the modal and doesn't stay
|
|
727
|
-
* until the modal is removed from the DOM.
|
|
728
|
-
*/
|
|
729
|
-
const ionFooter = baseEl.querySelector('ion-footer');
|
|
730
|
-
if (ionFooter) {
|
|
731
|
-
const clonedFooter = baseEl.shadowRoot.querySelector('ion-footer');
|
|
732
|
-
ionFooter.style.removeProperty('display');
|
|
733
|
-
ionFooter.removeAttribute('aria-hidden');
|
|
734
|
-
clonedFooter.style.setProperty('display', 'none');
|
|
735
|
-
clonedFooter.setAttribute('aria-hidden', 'true');
|
|
736
|
-
const page = baseEl.querySelector('.ion-page');
|
|
737
|
-
page.style.removeProperty('padding-bottom');
|
|
738
|
-
}
|
|
739
|
-
});
|
|
677
|
+
.addAnimation(wrapperAnimation);
|
|
740
678
|
if (presentingEl) {
|
|
741
679
|
const isMobile = window.innerWidth < 768;
|
|
742
680
|
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
@@ -832,47 +770,7 @@ const mdEnterAnimation = (baseEl, opts) => {
|
|
|
832
770
|
.addElement(baseEl)
|
|
833
771
|
.easing('cubic-bezier(0.36,0.66,0.04,1)')
|
|
834
772
|
.duration(280)
|
|
835
|
-
.addAnimation([backdropAnimation, wrapperAnimation])
|
|
836
|
-
.beforeAddWrite(() => {
|
|
837
|
-
if (expandToScroll) {
|
|
838
|
-
// Scroll can only be done when the modal is fully expanded.
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
/**
|
|
842
|
-
* There are some browsers that causes flickering when
|
|
843
|
-
* dragging the content when scroll is enabled at every
|
|
844
|
-
* breakpoint. This is due to the wrapper element being
|
|
845
|
-
* transformed off the screen and having a snap animation.
|
|
846
|
-
*
|
|
847
|
-
* A workaround is to clone the footer element and append
|
|
848
|
-
* it outside of the wrapper element. This way, the footer
|
|
849
|
-
* is still visible and the drag can be done without
|
|
850
|
-
* flickering. The original footer is hidden until the modal
|
|
851
|
-
* is dismissed. This maintains the animation of the footer
|
|
852
|
-
* when the modal is dismissed.
|
|
853
|
-
*
|
|
854
|
-
* The workaround needs to be done before the animation starts
|
|
855
|
-
* so there are no flickering issues.
|
|
856
|
-
*/
|
|
857
|
-
const ionFooter = baseEl.querySelector('ion-footer');
|
|
858
|
-
/**
|
|
859
|
-
* This check is needed to prevent more than one footer
|
|
860
|
-
* from being appended to the shadow root.
|
|
861
|
-
* Otherwise, iOS and MD enter animations would append
|
|
862
|
-
* the footer twice.
|
|
863
|
-
*/
|
|
864
|
-
const ionFooterAlreadyAppended = baseEl.shadowRoot.querySelector('ion-footer');
|
|
865
|
-
if (ionFooter && !ionFooterAlreadyAppended) {
|
|
866
|
-
const footerHeight = ionFooter.clientHeight;
|
|
867
|
-
const clonedFooter = ionFooter.cloneNode(true);
|
|
868
|
-
baseEl.shadowRoot.appendChild(clonedFooter);
|
|
869
|
-
ionFooter.style.setProperty('display', 'none');
|
|
870
|
-
ionFooter.setAttribute('aria-hidden', 'true');
|
|
871
|
-
// Padding is added to prevent some content from being hidden.
|
|
872
|
-
const page = baseEl.querySelector('.ion-page');
|
|
873
|
-
page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
874
|
-
}
|
|
875
|
-
});
|
|
773
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
876
774
|
if (contentAnimation) {
|
|
877
775
|
baseAnimation.addAnimation(contentAnimation);
|
|
878
776
|
}
|
|
@@ -891,7 +789,7 @@ const createLeaveAnimation = () => {
|
|
|
891
789
|
* Md Modal Leave Animation
|
|
892
790
|
*/
|
|
893
791
|
const mdLeaveAnimation = (baseEl, opts) => {
|
|
894
|
-
const { currentBreakpoint
|
|
792
|
+
const { currentBreakpoint } = opts;
|
|
895
793
|
const root = getElementRoot(baseEl);
|
|
896
794
|
const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation();
|
|
897
795
|
backdropAnimation.addElement(root.querySelector('ion-backdrop'));
|
|
@@ -899,29 +797,7 @@ const mdLeaveAnimation = (baseEl, opts) => {
|
|
|
899
797
|
const baseAnimation = createAnimation()
|
|
900
798
|
.easing('cubic-bezier(0.47,0,0.745,0.715)')
|
|
901
799
|
.duration(200)
|
|
902
|
-
.addAnimation([backdropAnimation, wrapperAnimation])
|
|
903
|
-
.beforeAddWrite(() => {
|
|
904
|
-
if (expandToScroll) {
|
|
905
|
-
// Scroll can only be done when the modal is fully expanded.
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* If expandToScroll is disabled, we need to swap
|
|
910
|
-
* the visibility to the original, so the footer
|
|
911
|
-
* dismisses with the modal and doesn't stay
|
|
912
|
-
* until the modal is removed from the DOM.
|
|
913
|
-
*/
|
|
914
|
-
const ionFooter = baseEl.querySelector('ion-footer');
|
|
915
|
-
if (ionFooter) {
|
|
916
|
-
const clonedFooter = baseEl.shadowRoot.querySelector('ion-footer');
|
|
917
|
-
ionFooter.style.removeProperty('display');
|
|
918
|
-
ionFooter.removeAttribute('aria-hidden');
|
|
919
|
-
clonedFooter.style.setProperty('display', 'none');
|
|
920
|
-
clonedFooter.setAttribute('aria-hidden', 'true');
|
|
921
|
-
const page = baseEl.querySelector('.ion-page');
|
|
922
|
-
page.style.removeProperty('padding-bottom');
|
|
923
|
-
}
|
|
924
|
-
});
|
|
800
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
925
801
|
return baseAnimation;
|
|
926
802
|
};
|
|
927
803
|
|
|
@@ -953,6 +829,9 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
953
829
|
let offset = 0;
|
|
954
830
|
let canDismissBlocksGesture = false;
|
|
955
831
|
let cachedScrollEl = null;
|
|
832
|
+
let cachedFooterEl = null;
|
|
833
|
+
let cachedFooterYPosition = null;
|
|
834
|
+
let currentFooterState = null;
|
|
956
835
|
const canDismissMaxStep = 0.95;
|
|
957
836
|
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
|
958
837
|
const minBreakpoint = breakpoints[0];
|
|
@@ -982,29 +861,45 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
982
861
|
baseEl.classList.add(FOCUS_TRAP_DISABLE_CLASS);
|
|
983
862
|
};
|
|
984
863
|
/**
|
|
985
|
-
* Toggles the
|
|
986
|
-
*
|
|
864
|
+
* Toggles the footer to an absolute position while moving to prevent
|
|
865
|
+
* it from shaking while the sheet is being dragged.
|
|
866
|
+
* @param footer Whether the footer is in a moving or stationary position.
|
|
987
867
|
*/
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
868
|
+
const swapFooterPosition = (newPosition) => {
|
|
869
|
+
if (!cachedFooterEl) {
|
|
870
|
+
cachedFooterEl = baseEl.querySelector('ion-footer');
|
|
871
|
+
if (!cachedFooterEl) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
992
874
|
}
|
|
993
|
-
const clonedFooter = wrapperEl.nextElementSibling;
|
|
994
|
-
const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
|
|
995
|
-
const footerToShow = footer === 'original' ? originalFooter : clonedFooter;
|
|
996
|
-
footerToShow.style.removeProperty('display');
|
|
997
|
-
footerToShow.removeAttribute('aria-hidden');
|
|
998
875
|
const page = baseEl.querySelector('.ion-page');
|
|
999
|
-
|
|
1000
|
-
|
|
876
|
+
currentFooterState = newPosition;
|
|
877
|
+
if (newPosition === 'stationary') {
|
|
878
|
+
// Reset positioning styles to allow normal document flow
|
|
879
|
+
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
880
|
+
cachedFooterEl.style.removeProperty('position');
|
|
881
|
+
cachedFooterEl.style.removeProperty('bottom');
|
|
882
|
+
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
883
|
+
// Move to page
|
|
884
|
+
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
1001
885
|
}
|
|
1002
886
|
else {
|
|
1003
|
-
|
|
1004
|
-
|
|
887
|
+
// Add padding to the parent element to prevent content from being hidden
|
|
888
|
+
// when the footer is positioned absolutely. This has to be done before we
|
|
889
|
+
// make the footer absolutely positioned or we may accidentally cause the
|
|
890
|
+
// sheet to scroll.
|
|
891
|
+
const footerHeight = cachedFooterEl.clientHeight;
|
|
892
|
+
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
893
|
+
// Apply positioning styles to keep footer at bottom
|
|
894
|
+
cachedFooterEl.classList.add('modal-footer-moving');
|
|
895
|
+
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
896
|
+
cachedFooterEl.style.setProperty('bottom', '0');
|
|
897
|
+
// Also cache the footer Y position, which we use to determine if the
|
|
898
|
+
// sheet has been moved below the footer. When that happens, we need to swap
|
|
899
|
+
// the position back so it will collapse correctly.
|
|
900
|
+
cachedFooterYPosition = cachedFooterEl.getBoundingClientRect().top + window.scrollY;
|
|
901
|
+
document.body.appendChild(cachedFooterEl);
|
|
1005
902
|
}
|
|
1006
|
-
footerToHide.style.setProperty('display', 'none');
|
|
1007
|
-
footerToHide.setAttribute('aria-hidden', 'true');
|
|
1008
903
|
};
|
|
1009
904
|
/**
|
|
1010
905
|
* After the entering animation completes,
|
|
@@ -1098,12 +993,11 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1098
993
|
}
|
|
1099
994
|
/**
|
|
1100
995
|
* If expandToScroll is disabled, we need to swap
|
|
1101
|
-
* the footer
|
|
1102
|
-
*
|
|
1103
|
-
* and doesn't stay on the screen after the modal is gone.
|
|
996
|
+
* the footer position to moving so that it doesn't shake
|
|
997
|
+
* while the sheet is being dragged.
|
|
1104
998
|
*/
|
|
1105
999
|
if (!expandToScroll) {
|
|
1106
|
-
|
|
1000
|
+
swapFooterPosition('moving');
|
|
1107
1001
|
}
|
|
1108
1002
|
/**
|
|
1109
1003
|
* If we are pulling down, then it is possible we are pulling on the content.
|
|
@@ -1122,6 +1016,21 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1122
1016
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
1123
1017
|
};
|
|
1124
1018
|
const onMove = (detail) => {
|
|
1019
|
+
/**
|
|
1020
|
+
* If `expandToScroll` is disabled, we need to see if we're currently below
|
|
1021
|
+
* the footer element and the footer is in a stationary position. If so,
|
|
1022
|
+
* we need to make the stationary the original position so that the footer
|
|
1023
|
+
* collapses with the sheet.
|
|
1024
|
+
*/
|
|
1025
|
+
if (!expandToScroll && cachedFooterYPosition !== null && currentFooterState !== null) {
|
|
1026
|
+
// Check if we need to swap the footer position
|
|
1027
|
+
if (detail.currentY >= cachedFooterYPosition && currentFooterState === 'moving') {
|
|
1028
|
+
swapFooterPosition('stationary');
|
|
1029
|
+
}
|
|
1030
|
+
else if (detail.currentY < cachedFooterYPosition && currentFooterState === 'stationary') {
|
|
1031
|
+
swapFooterPosition('moving');
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1125
1034
|
/**
|
|
1126
1035
|
* If `expandToScroll` is disabled, and an upwards swipe gesture is done within
|
|
1127
1036
|
* the scrollable content, we should not allow the swipe gesture to continue.
|
|
@@ -1255,14 +1164,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1255
1164
|
* snapping animation completes.
|
|
1256
1165
|
*/
|
|
1257
1166
|
gesture.enable(false);
|
|
1258
|
-
/**
|
|
1259
|
-
* If expandToScroll is disabled, we need to swap
|
|
1260
|
-
* the footer visibility to the cloned one so the footer
|
|
1261
|
-
* doesn't flicker when the sheet's height is animated.
|
|
1262
|
-
*/
|
|
1263
|
-
if (!expandToScroll && shouldRemainOpen) {
|
|
1264
|
-
swapFooterVisibility('cloned');
|
|
1265
|
-
}
|
|
1266
1167
|
if (shouldPreventDismiss) {
|
|
1267
1168
|
handleCanDismiss(baseEl, animation);
|
|
1268
1169
|
}
|
|
@@ -1283,6 +1184,14 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1283
1184
|
animation
|
|
1284
1185
|
.onFinish(() => {
|
|
1285
1186
|
if (shouldRemainOpen) {
|
|
1187
|
+
/**
|
|
1188
|
+
* If expandToScroll is disabled, we need to swap
|
|
1189
|
+
* the footer position to stationary so that it
|
|
1190
|
+
* will act as it would by default
|
|
1191
|
+
*/
|
|
1192
|
+
if (!expandToScroll) {
|
|
1193
|
+
swapFooterPosition('stationary');
|
|
1194
|
+
}
|
|
1286
1195
|
/**
|
|
1287
1196
|
* Once the snapping animation completes,
|
|
1288
1197
|
* we need to reset the animation to go
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator,__spreadArray}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,w as writeTask,h,e as Host,f as getElement}from"./index-527b9e34.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-9a17db3d.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-56b467ad.js";import{g as getElementRoot,j as clamp,r as raf,h as inheritAttributes,k as hasLazyBuild}from"./helpers-d94bc8ad.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning,c as config}from"./index-cfd9c1f2.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,F as FOCUS_TRAP_DISABLE_CLASS,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-d99dcb0a.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-68c0d151.js";import{b as getIonMode}from"./ionic-global-b26f573e.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-8b25e105.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-39782642.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-a7eb8233.js";import"./gesture-controller-314a54f6.js";import"./keyboard-73175e24.js";var Style;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var t=getCapacitor();if(t===null||t===void 0?void 0:t.isPluginAvailable("StatusBar")){return t.Plugins.StatusBar}return undefined},setStyle:function(t){var e=this.getEngine();if(!e){return}e.setStyle(t)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:t=this.getEngine();if(!t){return[2,Style.Default]}return[4,t.getInfo()];case 1:e=r.sent().style;return[2,e]}}))}))}};var getBackdropValueForSheet=function(t,e){if(e===1){return 0}var r=1/(1-e);var a=-(e*r);return t*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:t})};var handleCanDismiss=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof t.canDismiss!=="function"){return[2]}return[4,t.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(e.isRunning()){e.onFinish((function(){t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(t){return.00255275*Math.pow(2.71828,-14.9619*t)-1.00255*Math.pow(2.71828,-.0380968*t)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.915};var createSwipeToCloseGesture=function(t,e,r,a){var i=.5;var n=t.offsetHeight;var o=false;var s=false;var d=null;var f=null;var l=.2;var c=true;var u=0;var h=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var p=function(t){var e=t.event.target;if(e===null||!e.closest){return true}d=findClosestIonContent(e);if(d){if(isIonContent(d)){var r=getElementRoot(d);f=r.querySelector(".inner-scroll")}else{f=d}var a=!!d.querySelector("ion-refresher");return!a&&f.scrollTop===0}var i=e.closest("ion-footer");if(i===null){return true}return false};var v=function(r){var a=r.deltaY;c=h();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}e.progressStart(true,o?1:0)};var m=function(t){var a=t.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=t.deltaY/n;var f=o>=0&&s;var c=f?l:.9999;var h=f?calculateSpringStep(o/c):o;var p=clamp(1e-4,h,c);e.progressStep(p);if(p>=i&&u<i){setCardStatusBarDefault(r)}else if(p<i&&u>=i){setCardStatusBarDark()}u=p};var b=function(r){var f=r.velocityY;var u=r.deltaY/n;var h=u>=0&&s;var p=h?l:.9999;var v=h?calculateSpringStep(u/p):u;var m=clamp(1e-4,v,p);var b=(r.deltaY+f*1e3)/n;var w=!h&&b>=i;var x=w?-.001:.001;if(!w){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");x+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],m)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");x+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],m)[0]}var y=w?computeDuration(u*n,f):computeDuration((1-m)*n,f);o=w;g.enable(false);if(d){resetContentScrollY(d,c)}e.onFinish((function(){if(!w){g.enable(true)}})).progressEnd(w?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(w){a()}};var g=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return g};var computeDuration=function(t,e){return clamp(400,t/Math.abs(e*1.1),500)};var createSheetEnterAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint,a=t.expandToScroll;var i=r===undefined||r<e;var n=i?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var o=createAnimation("backdropAnimation").fromTo("opacity",0,n);if(i){o.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);var d=!a?createAnimation("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:"".concat((1-e)*100,"%")},{offset:1,opacity:1,maxHeight:"".concat(e*100,"%")}]):undefined;return{wrapperAnimation:s,backdropAnimation:o,contentAnimation:d}};var createSheetLeaveAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(e,r),")");var i=[{offset:0,opacity:a},{offset:1,opacity:0}];var n=[{offset:0,opacity:a},{offset:r,opacity:0},{offset:1,opacity:0}];var o=createAnimation("backdropAnimation").keyframes(r!==0?n:i);var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(".concat(100-e*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint,i=e.expandToScroll;var n=getElementRoot(t);var o=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation,f=o.contentAnimation;d.addElement(n.querySelector("ion-backdrop"));s.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});!i&&(f===null||f===void 0?void 0:f.addElement(t.querySelector(".ion-page")));var l=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([s]).beforeAddWrite((function(){if(i){return}var e=t.querySelector("ion-footer");var r=t.shadowRoot.querySelector("ion-footer");if(e&&!r){var a=e.clientHeight;var n=e.cloneNode(true);t.shadowRoot.appendChild(n);e.style.setProperty("display","none");e.setAttribute("aria-hidden","true");var o=t.querySelector(".ion-page");o.style.setProperty("padding-bottom","".concat(a,"px"))}}));if(f){l.addAnimation(f)}if(r){var c=window.innerWidth<768;var u=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var h=getElementRoot(r);var p=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var v=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var b=u?"-10px":m;var g=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(b,") scale(").concat(g,")");p.afterStyles({transform:w}).beforeAddWrite((function(){return v.style.setProperty("background-color","black")})).addElement(r).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:w,borderRadius:"10px 10px 0 0"}]);l.addAnimation(p)}else{l.addAnimation(d);if(!u){s.fromTo("opacity","0","1")}else{var g=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(g,")");p.afterStyles({transform:w}).addElement(h.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:w}]);var x=createAnimation().afterStyles({transform:w}).addElement(h.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:w}]);l.addAnimation([p,x])}}}else{l.addAnimation(d)}return l};var createLeaveAnimation$1=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};var iosLeaveAnimation=function(t,e,r){if(r===void 0){r=500}var a=e.presentingEl,i=e.currentBreakpoint,n=e.expandToScroll;var o=getElementRoot(t);var s=i!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation$1(),d=s.wrapperAnimation,f=s.backdropAnimation;f.addElement(o.querySelector("ion-backdrop"));d.addElement(o.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var l=createAnimation("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(d).beforeAddWrite((function(){if(n){return}var e=t.querySelector("ion-footer");if(e){var r=t.shadowRoot.querySelector("ion-footer");e.style.removeProperty("display");e.removeAttribute("aria-hidden");r.style.setProperty("display","none");r.setAttribute("aria-hidden","true");var a=t.querySelector(".ion-page");a.style.removeProperty("padding-bottom")}}));if(a){var c=window.innerWidth<768;var u=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var h=getElementRoot(a);var p=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(t){if(t!==1){return}a.style.setProperty("overflow","");var e=Array.from(v.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(t){return t.presentingElement!==undefined})).length;if(e<=1){v.style.setProperty("background-color","")}}));var v=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var b=u?"-10px":m;var g=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(b,") scale(").concat(g,")");p.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:w,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);l.addAnimation(p)}else{l.addAnimation(f);if(!u){d.fromTo("opacity","1","0")}else{var g=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(g,")");p.addElement(h.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:w},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var x=createAnimation().addElement(h.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:w},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([p,x])}}}else{l.addAnimation(f)}return l};var createEnterAnimation=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint,a=e.expandToScroll;var i=getElementRoot(t);var n=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),o=n.wrapperAnimation,s=n.backdropAnimation,d=n.contentAnimation;s.addElement(i.querySelector("ion-backdrop"));o.addElement(i.querySelector(".modal-wrapper"));a&&(d===null||d===void 0?void 0:d.addElement(t.querySelector(".ion-page")));var f=createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,o]).beforeAddWrite((function(){if(a){return}var e=t.querySelector("ion-footer");var r=t.shadowRoot.querySelector("ion-footer");if(e&&!r){var i=e.clientHeight;var n=e.cloneNode(true);t.shadowRoot.appendChild(n);e.style.setProperty("display","none");e.setAttribute("aria-hidden","true");var o=t.querySelector(".ion-page");o.style.setProperty("padding-bottom","".concat(i,"px"))}}));if(d){f.addAnimation(d)}return f};var createLeaveAnimation=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};var mdLeaveAnimation=function(t,e){var r=e.currentBreakpoint,a=e.expandToScroll;var i=getElementRoot(t);var n=r!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation(),o=n.wrapperAnimation,s=n.backdropAnimation;s.addElement(i.querySelector("ion-backdrop"));o.addElement(i.querySelector(".modal-wrapper"));var d=createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,o]).beforeAddWrite((function(){if(a){return}var e=t.querySelector("ion-footer");if(e){var r=t.shadowRoot.querySelector("ion-footer");e.style.removeProperty("display");e.removeAttribute("aria-hidden");r.style.setProperty("display","none");r.setAttribute("aria-hidden","true");var i=t.querySelector(".ion-page");i.style.removeProperty("padding-bottom")}}));return d};var createSheetGesture=function(t,e,r,a,i,n,o,s,d,f,l){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var u=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-i,opacity:0},{offset:1,opacity:0}];var h={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:i!==0?u:c,CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]};var p=t.querySelector("ion-content");var v=r.clientHeight;var m=a;var b=0;var g=false;var w=null;var x=.95;var y=o[o.length-1];var k=o[0];var A=n.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var S=n.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var E=n.childAnimations.find((function(t){return t.id==="contentAnimation"}));var _=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove(FOCUS_TRAP_DISABLE_CLASS)};var C=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add(FOCUS_TRAP_DISABLE_CLASS)};var D=function(e){var a=t.querySelector("ion-footer");if(!a){return}var i=r.nextElementSibling;var n=e==="original"?i:a;var o=e==="original"?a:i;o.style.removeProperty("display");o.removeAttribute("aria-hidden");var s=t.querySelector(".ion-page");if(e==="original"){s.style.removeProperty("padding-bottom")}else{var d=o.clientHeight;s.style.setProperty("padding-bottom","".concat(d,"px"))}n.style.setProperty("display","none");n.setAttribute("aria-hidden","true")};if(A&&S){A.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));S.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));E===null||E===void 0?void 0:E.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));n.progressStart(true,1-m);var I=m>i;if(I){_()}else{C()}}if(p&&m!==y&&s){p.scrollY=false}var M=function(t){var e=findClosestIonContent(t.event.target);m=d();if(!s&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;return r.scrollTop===0}if(m===1&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;var a=!!e.querySelector("ion-refresher");return!a&&r.scrollTop===0}return true};var R=function(e){g=t.canDismiss!==undefined&&t.canDismiss!==true&&k===0;if(!s){var r=findClosestIonContent(e.event.target);w=r&&isIonContent(r)?getElementRoot(r).querySelector(".inner-scroll"):r}if(!s){D("original")}if(e.deltaY>0&&p){p.scrollY=false}raf((function(){t.focus()}));n.progressStart(true,1-m)};var Y=function(t){if(!s&&t.deltaY<=0&&w){return}if(t.deltaY>0&&p){p.scrollY=false}var e=1-m;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/v;var i=r!==undefined&&a>=r&&g;var d=i?x:.9999;var f=i&&r!==undefined?r+calculateSpringStep((a-r)/(d-r)):a;b=clamp(1e-4,f,d);n.progressStep(b)};var T=function(t){if(!s&&t.deltaY<=0&&w&&w.scrollTop>0){return}var e=t.velocityY;var r=(t.deltaY+e*350)/v;var a=m-r;var i=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));B({breakpoint:i,breakpointOffset:b,canDismiss:g,animated:true})};var B=function(e){var r=e.breakpoint,a=e.canDismiss,d=e.breakpointOffset,c=e.animated;var u=a&&r===0;var v=u?m:r;var b=v!==0;m=0;if(A&&S){A.keyframes([{offset:0,transform:"translateY(".concat(d*100,"%)")},{offset:1,transform:"translateY(".concat((1-v)*100,"%)")}]);S.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-d,i),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(v,i),")")}]);if(E){E.keyframes([{offset:0,maxHeight:"".concat((1-d)*100,"%")},{offset:1,maxHeight:"".concat(v*100,"%")}])}n.progressStep(0)}L.enable(false);if(!s&&b){D("cloned")}if(u){handleCanDismiss(t,n)}else if(!b){f()}if(p&&(v===o[o.length-1]||!s)){p.scrollY=true}return new Promise((function(t){n.onFinish((function(){if(b){if(A&&S){raf((function(){A.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));S.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));E===null||E===void 0?void 0:E.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));n.progressStart(true,1-v);m=v;l(m);var e=m>i;if(e){_()}else{C()}L.enable(true);t()}))}else{L.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var L=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:M,onStart:R,onMove:Y,onEnd:T});return{gesture:L,moveSheetToBreakpoint:B}};var modalIosCss=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right: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;color:var(--ion-text-color, #000);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-shadow{position:absolute;background:transparent}@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{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.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;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}: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{--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}:host(.modal-sheet.modal-no-expand-scroll) ion-footer ion-toolbar:first-of-type{padding-top:6px}';var IonModalIosStyle0=modalIosCss;var modalMdCss=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right: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;color:var(--ion-text-color, #000);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-shadow{position:absolute;background:transparent}@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{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.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;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}: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{--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}';var IonModalMdStyle0=modalMdCss;var Modal=function(){function t(t){var e=this;registerInstance(this,t);this.didPresent=createEvent(this,"ionModalDidPresent",7);this.willPresent=createEvent(this,"ionModalWillPresent",7);this.willDismiss=createEvent(this,"ionModalWillDismiss",7);this.didDismiss=createEvent(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=createEvent(this,"ionBreakpointDidChange",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.lockController=createLockController();this.triggerController=createTriggerController();this.coreDelegate=CoreDelegate();this.isSheetModal=false;this.inheritedAttributes={};this.inline=false;this.gestureAnimationDismissing=false;this.onHandleClick=function(){var t=e,r=t.sheetTransition,a=t.handleBehavior;if(a!=="cycle"||r!==undefined){return}e.moveToNextBreakpoint()};this.onBackdropTap=function(){var t=e.sheetTransition;if(t!==undefined){return}e.dismiss(undefined,BACKDROP)};this.onLifecycle=function(t){var r=e.usersElement;var a=LIFECYCLE_MAP[t.type];if(r&&a){var i=new CustomEvent(a,{bubbles:false,cancelable:false,detail:t.detail});r.dispatchEvent(i)}};this.presented=false;this.hasController=false;this.overlayIndex=undefined;this.delegate=undefined;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.breakpoints=undefined;this.expandToScroll=true;this.initialBreakpoint=undefined;this.backdropBreakpoint=0;this.handle=undefined;this.handleBehavior="none";this.component=undefined;this.componentProps=undefined;this.cssClass=undefined;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.presentingElement=undefined;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined;this.keepContentsMounted=false;this.focusTrap=true;this.canDismiss=true}t.prototype.onIsOpenChange=function(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}};t.prototype.triggerChanged=function(){var t=this,e=t.trigger,r=t.el,a=t.triggerController;if(e){a.addClickListener(r,e)}};t.prototype.breakpointsChanged=function(t){if(t!==undefined){this.sortedBreakpoints=t.sort((function(t,e){return t-e}))}};t.prototype.connectedCallback=function(){var t=this.el;prepareOverlay(t);this.triggerChanged()};t.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};t.prototype.componentWillLoad=function(){var t=this;var e;var r=this,a=r.breakpoints,i=r.initialBreakpoint,n=r.el,o=r.htmlAttributes;var s=this.isSheetModal=a!==undefined&&i!==undefined;var d=["aria-label","role"];this.inheritedAttributes=inheritAttributes(n,d);if(o!==undefined){d.forEach((function(e){var r;var a=o[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=o[e],r));delete o[e]}}))}if(s){this.currentBreakpoint=this.initialBreakpoint}if(a!==undefined&&i!==undefined&&!a.includes(i)){printIonWarning("[ion-modal] - Your breakpoints array must include the initialBreakpoint value.")}if(!((e=this.htmlAttributes)===null||e===void 0?void 0:e.id)){setOverlayId(this.el)}};t.prototype.componentDidLoad=function(){var t=this;if(this.isOpen===true){raf((function(){return t.present()}))}this.breakpointsChanged(this.breakpoints);this.triggerChanged()};t.prototype.getDelegate=function(t){if(t===void 0){t=false}if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}var e=this.el.parentNode;var r=this.inline=e!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};t.prototype.checkCanDismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(a){r=this.canDismiss;if(typeof r==="function"){return[2,r(t,e)]}return[2,r]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,i,n,o,s,d,f;var l=this;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:t=c.sent();if(this.presented){t();return[2]}e=this,r=e.presentingElement,a=e.el;this.currentBreakpoint=this.initialBreakpoint;i=this.getDelegate(true),n=i.inline,o=i.delegate;this.ionMount.emit();s=this;return[4,attachComponent(o,a,this.component,["ion-page"],this.componentProps,n)];case 2:s.usersElement=c.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:c.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:c.sent();c.label=6;case 6:writeTask((function(){return l.el.classList.add("show-modal")}));d=r!==undefined;if(!(d&&getIonMode(this)==="ios"))return[3,8];f=this;return[4,StatusBar.getStyle()];case 7:f.statusBarStyle=c.sent();setCardStatusBarDark();c.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 9:c.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(l.gesture){l.gesture.enable(false);raf((function(){if(l.gesture){l.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}t();return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e;if(getIonMode(this)!=="ios"){return}var r=this.el;var a=this.leaveAnimation||config.get("modalLeave",iosLeaveAnimation);var i=this.animation=a(r,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});var n=findIonContent(r);if(!n){printIonContentErrorMsg(r);return}var o=(e=this.statusBarStyle)!==null&&e!==void 0?e:Style.Default;this.gesture=createSwipeToCloseGesture(r,i,o,(function(){t.gestureAnimationDismissing=true;setCardStatusBarDefault(t.statusBarStyle);t.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};t.prototype.initSheetGesture=function(){var t=this;var e=this,r=e.wrapperEl,a=e.initialBreakpoint,i=e.backdropBreakpoint;if(!r||a===undefined){return}var n=this.enterAnimation||config.get("modalEnter",iosEnterAnimation);var o=this.animation=n(this.el,{presentingEl:this.presentingElement,currentBreakpoint:a,backdropBreakpoint:i,expandToScroll:this.expandToScroll});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,i,o,this.sortedBreakpoints,this.expandToScroll,(function(){var e;return(e=t.currentBreakpoint)!==null&&e!==void 0?e:0}),(function(){return t.sheetOnDismiss()}),(function(e){if(t.currentBreakpoint!==e){t.currentBreakpoint=e;t.ionBreakpointDidChange.emit({breakpoint:e})}})),d=s.gesture,f=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=f;this.gesture.enable(true)};t.prototype.sheetOnDismiss=function(){var t=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};t.prototype.dismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,a,i,n,o,s,d;var f=this;return __generator(this,(function(l){switch(l.label){case 0:if(this.gestureAnimationDismissing&&e!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=l.sent();i=e!=="handler";if(!i)return[3,3];return[4,this.checkCanDismiss(t,e)];case 2:i=!l.sent();l.label=3;case 3:if(i){a();return[2,false]}n=this.presentingElement;o=n!==undefined;if(o&&getIonMode(this)==="ios"){setCardStatusBarDefault(this.statusBarStyle)}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback);this.keyboardOpenCallback=undefined}return[4,dismiss(this,t,e,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:n,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 4:s=l.sent();if(!s)return[3,6];d=this.getDelegate().delegate;return[4,detachComponent(d,this.usersElement)];case 5:l.sent();writeTask((function(){return f.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}l.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,s]}}))}))};t.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};t.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};t.prototype.setCurrentBreakpoint=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,a,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("[ion-modal] - Attempted to set invalid breakpoint value ".concat(t,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}e=this,r=e.currentBreakpoint,a=e.moveSheetToBreakpoint,i=e.canDismiss,n=e.breakpoints,o=e.animated;if(r===t){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:t,breakpointOffset:1-r,canDismiss:i!==undefined&&i!==true&&n[0]===0,animated:o});return[4,this.sheetTransition];case 1:s.sent();this.sheetTransition=undefined;s.label=2;case 2:return[2]}}))}))};t.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.currentBreakpoint]}))}))};t.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:t=this,e=t.breakpoints,r=t.currentBreakpoint;if(!e||r==null){return[2,false]}a=e.filter((function(t){return t!==0}));i=a.indexOf(r);n=(i+1)%a.length;o=a[n];return[4,this.setCurrentBreakpoint(o)];case 1:s.sent();return[2,true]}}))}))};t.prototype.render=function(){var t;var e=this;var r=this,a=r.handle,i=r.isSheetModal,n=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes,f=r.focusTrap,l=r.expandToScroll;var c=a!==false&&i;var u=getIonMode(this);var p=n!==undefined&&u==="ios";var v=s==="cycle";return h(Host,Object.assign({key:"0991b2e4e32da511e59fb1463b47e4ac1b86d1ca","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[u]=true,t["modal-default"]=!p&&!i,t["modal-card"]=p,t["modal-sheet"]=i,t["modal-no-expand-scroll"]=i&&!l,t["overlay-hidden"]=true,t[FOCUS_TRAP_DISABLE_CLASS]=f===false,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"ca9453ffe1021fb252ad9460676cfabb5633f00f",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),u==="ios"&&h("div",{key:"9f8da446a7b0f3b26aec856e13f6d6d131a7e37b",class:"modal-shadow"}),h("div",Object.assign({key:"9d08bf600571849c97b58f66df40b496a358d1e1",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),c&&h("button",{key:"f8bf0d1126e5376519101225d9965727121ee042",class:"modal-handle",tabIndex:!v?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:v?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"6d52849df98f2c6c8fbc03996a931ea6a39a512b"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return t}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:IonModalIosStyle0,md:IonModalMdStyle0};export{Modal as ion_modal};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,w as writeTask,h,e as Host,f as getElement}from"./index-527b9e34.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-9a17db3d.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-56b467ad.js";import{g as getElementRoot,j as clamp,r as raf,h as inheritAttributes,k as hasLazyBuild}from"./helpers-d94bc8ad.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning,c as config}from"./index-cfd9c1f2.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,F as FOCUS_TRAP_DISABLE_CLASS,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-d99dcb0a.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-68c0d151.js";import{b as getIonMode}from"./ionic-global-b26f573e.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-8b25e105.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-39782642.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-a7eb8233.js";import"./gesture-controller-314a54f6.js";import"./keyboard-73175e24.js";var Style;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var t=getCapacitor();if(t===null||t===void 0?void 0:t.isPluginAvailable("StatusBar")){return t.Plugins.StatusBar}return undefined},setStyle:function(t){var e=this.getEngine();if(!e){return}e.setStyle(t)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:t=this.getEngine();if(!t){return[2,Style.Default]}return[4,t.getInfo()];case 1:e=r.sent().style;return[2,e]}}))}))}};var getBackdropValueForSheet=function(t,e){if(e===1){return 0}var r=1/(1-e);var a=-(e*r);return t*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:t})};var handleCanDismiss=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof t.canDismiss!=="function"){return[2]}return[4,t.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(e.isRunning()){e.onFinish((function(){t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(t){return.00255275*Math.pow(2.71828,-14.9619*t)-1.00255*Math.pow(2.71828,-.0380968*t)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.915};var createSwipeToCloseGesture=function(t,e,r,a){var n=.5;var i=t.offsetHeight;var o=false;var s=false;var d=null;var l=null;var f=.2;var c=true;var u=0;var h=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var p=function(t){var e=t.event.target;if(e===null||!e.closest){return true}d=findClosestIonContent(e);if(d){if(isIonContent(d)){var r=getElementRoot(d);l=r.querySelector(".inner-scroll")}else{l=d}var a=!!d.querySelector("ion-refresher");return!a&&l.scrollTop===0}var n=e.closest("ion-footer");if(n===null){return true}return false};var v=function(r){var a=r.deltaY;c=h();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}e.progressStart(true,o?1:0)};var m=function(t){var a=t.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=t.deltaY/i;var l=o>=0&&s;var c=l?f:.9999;var h=l?calculateSpringStep(o/c):o;var p=clamp(1e-4,h,c);e.progressStep(p);if(p>=n&&u<n){setCardStatusBarDefault(r)}else if(p<n&&u>=n){setCardStatusBarDark()}u=p};var b=function(r){var l=r.velocityY;var u=r.deltaY/i;var h=u>=0&&s;var p=h?f:.9999;var v=h?calculateSpringStep(u/p):u;var m=clamp(1e-4,v,p);var b=(r.deltaY+l*1e3)/i;var w=!h&&b>=n;var x=w?-.001:.001;if(!w){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");x+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],m)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");x+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],m)[0]}var y=w?computeDuration(u*i,l):computeDuration((1-m)*i,l);o=w;g.enable(false);if(d){resetContentScrollY(d,c)}e.onFinish((function(){if(!w){g.enable(true)}})).progressEnd(w?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(w){a()}};var g=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return g};var computeDuration=function(t,e){return clamp(400,t/Math.abs(e*1.1),500)};var createSheetEnterAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint,a=t.expandToScroll;var n=r===undefined||r<e;var i=n?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var o=createAnimation("backdropAnimation").fromTo("opacity",0,i);if(n){o.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);var d=!a?createAnimation("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:"".concat((1-e)*100,"%")},{offset:1,opacity:1,maxHeight:"".concat(e*100,"%")}]):undefined;return{wrapperAnimation:s,backdropAnimation:o,contentAnimation:d}};var createSheetLeaveAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(e,r),")");var n=[{offset:0,opacity:a},{offset:1,opacity:0}];var i=[{offset:0,opacity:a},{offset:r,opacity:0},{offset:1,opacity:0}];var o=createAnimation("backdropAnimation").keyframes(r!==0?i:n);var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(".concat(100-e*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint,n=e.expandToScroll;var i=getElementRoot(t);var o=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation,l=o.contentAnimation;d.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});!n&&(l===null||l===void 0?void 0:l.addElement(t.querySelector(".ion-page")));var f=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([s]);if(l){f.addAnimation(l)}if(r){var c=window.innerWidth<768;var u=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var h=getElementRoot(r);var p=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var v=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var b=u?"-10px":m;var g=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(b,") scale(").concat(g,")");p.afterStyles({transform:w}).beforeAddWrite((function(){return v.style.setProperty("background-color","black")})).addElement(r).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:w,borderRadius:"10px 10px 0 0"}]);f.addAnimation(p)}else{f.addAnimation(d);if(!u){s.fromTo("opacity","0","1")}else{var g=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(g,")");p.afterStyles({transform:w}).addElement(h.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:w}]);var x=createAnimation().afterStyles({transform:w}).addElement(h.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:w}]);f.addAnimation([p,x])}}}else{f.addAnimation(d)}return f};var createLeaveAnimation$1=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};var iosLeaveAnimation=function(t,e,r){if(r===void 0){r=500}var a=e.presentingEl,n=e.currentBreakpoint;var i=getElementRoot(t);var o=n!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation;d.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var l=createAnimation("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(s);if(a){var f=window.innerWidth<768;var c=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var h=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(t){if(t!==1){return}a.style.setProperty("overflow","");var e=Array.from(p.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(t){return t.presentingElement!==undefined})).length;if(e<=1){p.style.setProperty("background-color","")}}));var p=document.body;if(f){var v=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var m=c?"-10px":v;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var g="translateY(".concat(m,") scale(").concat(b,")");h.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:g,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);l.addAnimation(h)}else{l.addAnimation(d);if(!c){s.fromTo("opacity","1","0")}else{var b=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var g="translateY(-10px) scale(".concat(b,")");h.addElement(u.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:g},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var w=createAnimation().addElement(u.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:g},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([h,w])}}}else{l.addAnimation(d)}return l};var createEnterAnimation=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint,a=e.expandToScroll;var n=getElementRoot(t);var i=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),o=i.wrapperAnimation,s=i.backdropAnimation,d=i.contentAnimation;s.addElement(n.querySelector("ion-backdrop"));o.addElement(n.querySelector(".modal-wrapper"));a&&(d===null||d===void 0?void 0:d.addElement(t.querySelector(".ion-page")));var l=createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,o]);if(d){l.addAnimation(d)}return l};var createLeaveAnimation=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};var mdLeaveAnimation=function(t,e){var r=e.currentBreakpoint;var a=getElementRoot(t);var n=r!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));var s=createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,i]);return s};var createSheetGesture=function(t,e,r,a,n,i,o,s,d,l,f){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var u=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-n,opacity:0},{offset:1,opacity:0}];var h={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:n!==0?u:c,CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]};var p=t.querySelector("ion-content");var v=r.clientHeight;var m=a;var b=0;var g=false;var w=null;var x=null;var y=null;var k=null;var A=.95;var S=o[o.length-1];var E=o[0];var _=i.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var C=i.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var D=i.childAnimations.find((function(t){return t.id==="contentAnimation"}));var I=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove(FOCUS_TRAP_DISABLE_CLASS)};var M=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add(FOCUS_TRAP_DISABLE_CLASS)};var R=function(e){if(!x){x=t.querySelector("ion-footer");if(!x){return}}var r=t.querySelector(".ion-page");k=e;if(e==="stationary"){x.classList.remove("modal-footer-moving");x.style.removeProperty("position");x.style.removeProperty("bottom");r===null||r===void 0?void 0:r.style.removeProperty("padding-bottom");r===null||r===void 0?void 0:r.appendChild(x)}else{var a=x.clientHeight;r===null||r===void 0?void 0:r.style.setProperty("padding-bottom","".concat(a,"px"));x.classList.add("modal-footer-moving");x.style.setProperty("position","absolute");x.style.setProperty("bottom","0");y=x.getBoundingClientRect().top+window.scrollY;document.body.appendChild(x)}};if(_&&C){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));i.progressStart(true,1-m);var Y=m>n;if(Y){I()}else{M()}}if(p&&m!==S&&s){p.scrollY=false}var T=function(t){var e=findClosestIonContent(t.event.target);m=d();if(!s&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;return r.scrollTop===0}if(m===1&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;var a=!!e.querySelector("ion-refresher");return!a&&r.scrollTop===0}return true};var B=function(e){g=t.canDismiss!==undefined&&t.canDismiss!==true&&E===0;if(!s){var r=findClosestIonContent(e.event.target);w=r&&isIonContent(r)?getElementRoot(r).querySelector(".inner-scroll"):r}if(!s){R("moving")}if(e.deltaY>0&&p){p.scrollY=false}raf((function(){t.focus()}));i.progressStart(true,1-m)};var L=function(t){if(!s&&y!==null&&k!==null){if(t.currentY>=y&&k==="moving"){R("stationary")}else if(t.currentY<y&&k==="stationary"){R("moving")}}if(!s&&t.deltaY<=0&&w){return}if(t.deltaY>0&&p){p.scrollY=false}var e=1-m;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/v;var n=r!==undefined&&a>=r&&g;var d=n?A:.9999;var l=n&&r!==undefined?r+calculateSpringStep((a-r)/(d-r)):a;b=clamp(1e-4,l,d);i.progressStep(b)};var O=function(t){if(!s&&t.deltaY<=0&&w&&w.scrollTop>0){return}var e=t.velocityY;var r=(t.deltaY+e*350)/v;var a=m-r;var n=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));P({breakpoint:n,breakpointOffset:b,canDismiss:g,animated:true})};var P=function(e){var r=e.breakpoint,a=e.canDismiss,d=e.breakpointOffset,c=e.animated;var u=a&&r===0;var v=u?m:r;var b=v!==0;m=0;if(_&&C){_.keyframes([{offset:0,transform:"translateY(".concat(d*100,"%)")},{offset:1,transform:"translateY(".concat((1-v)*100,"%)")}]);C.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-d,n),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(v,n),")")}]);if(D){D.keyframes([{offset:0,maxHeight:"".concat((1-d)*100,"%")},{offset:1,maxHeight:"".concat(v*100,"%")}])}i.progressStep(0)}j.enable(false);if(u){handleCanDismiss(t,i)}else if(!b){l()}if(p&&(v===o[o.length-1]||!s)){p.scrollY=true}return new Promise((function(t){i.onFinish((function(){if(b){if(!s){R("stationary")}if(_&&C){raf((function(){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));i.progressStart(true,1-v);m=v;f(m);var e=m>n;if(e){I()}else{M()}j.enable(true);t()}))}else{j.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var j=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:T,onStart:B,onMove:L,onEnd:O});return{gesture:j,moveSheetToBreakpoint:P}};var modalIosCss=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right: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;color:var(--ion-text-color, #000);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-shadow{position:absolute;background:transparent}@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{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.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;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}: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{--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}:host(.modal-sheet.modal-no-expand-scroll) ion-footer ion-toolbar:first-of-type{padding-top:6px}';var IonModalIosStyle0=modalIosCss;var modalMdCss=':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right: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;color:var(--ion-text-color, #000);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-shadow{position:absolute;background:transparent}@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{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.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;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}: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{--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}';var IonModalMdStyle0=modalMdCss;var Modal=function(){function t(t){var e=this;registerInstance(this,t);this.didPresent=createEvent(this,"ionModalDidPresent",7);this.willPresent=createEvent(this,"ionModalWillPresent",7);this.willDismiss=createEvent(this,"ionModalWillDismiss",7);this.didDismiss=createEvent(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=createEvent(this,"ionBreakpointDidChange",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.lockController=createLockController();this.triggerController=createTriggerController();this.coreDelegate=CoreDelegate();this.isSheetModal=false;this.inheritedAttributes={};this.inline=false;this.gestureAnimationDismissing=false;this.onHandleClick=function(){var t=e,r=t.sheetTransition,a=t.handleBehavior;if(a!=="cycle"||r!==undefined){return}e.moveToNextBreakpoint()};this.onBackdropTap=function(){var t=e.sheetTransition;if(t!==undefined){return}e.dismiss(undefined,BACKDROP)};this.onLifecycle=function(t){var r=e.usersElement;var a=LIFECYCLE_MAP[t.type];if(r&&a){var n=new CustomEvent(a,{bubbles:false,cancelable:false,detail:t.detail});r.dispatchEvent(n)}};this.presented=false;this.hasController=false;this.overlayIndex=undefined;this.delegate=undefined;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.breakpoints=undefined;this.expandToScroll=true;this.initialBreakpoint=undefined;this.backdropBreakpoint=0;this.handle=undefined;this.handleBehavior="none";this.component=undefined;this.componentProps=undefined;this.cssClass=undefined;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.presentingElement=undefined;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined;this.keepContentsMounted=false;this.focusTrap=true;this.canDismiss=true}t.prototype.onIsOpenChange=function(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}};t.prototype.triggerChanged=function(){var t=this,e=t.trigger,r=t.el,a=t.triggerController;if(e){a.addClickListener(r,e)}};t.prototype.breakpointsChanged=function(t){if(t!==undefined){this.sortedBreakpoints=t.sort((function(t,e){return t-e}))}};t.prototype.connectedCallback=function(){var t=this.el;prepareOverlay(t);this.triggerChanged()};t.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};t.prototype.componentWillLoad=function(){var t=this;var e;var r=this,a=r.breakpoints,n=r.initialBreakpoint,i=r.el,o=r.htmlAttributes;var s=this.isSheetModal=a!==undefined&&n!==undefined;var d=["aria-label","role"];this.inheritedAttributes=inheritAttributes(i,d);if(o!==undefined){d.forEach((function(e){var r;var a=o[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=o[e],r));delete o[e]}}))}if(s){this.currentBreakpoint=this.initialBreakpoint}if(a!==undefined&&n!==undefined&&!a.includes(n)){printIonWarning("[ion-modal] - Your breakpoints array must include the initialBreakpoint value.")}if(!((e=this.htmlAttributes)===null||e===void 0?void 0:e.id)){setOverlayId(this.el)}};t.prototype.componentDidLoad=function(){var t=this;if(this.isOpen===true){raf((function(){return t.present()}))}this.breakpointsChanged(this.breakpoints);this.triggerChanged()};t.prototype.getDelegate=function(t){if(t===void 0){t=false}if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}var e=this.el.parentNode;var r=this.inline=e!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};t.prototype.checkCanDismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(a){r=this.canDismiss;if(typeof r==="function"){return[2,r(t,e)]}return[2,r]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,n,i,o,s,d,l;var f=this;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:t=c.sent();if(this.presented){t();return[2]}e=this,r=e.presentingElement,a=e.el;this.currentBreakpoint=this.initialBreakpoint;n=this.getDelegate(true),i=n.inline,o=n.delegate;this.ionMount.emit();s=this;return[4,attachComponent(o,a,this.component,["ion-page"],this.componentProps,i)];case 2:s.usersElement=c.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:c.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:c.sent();c.label=6;case 6:writeTask((function(){return f.el.classList.add("show-modal")}));d=r!==undefined;if(!(d&&getIonMode(this)==="ios"))return[3,8];l=this;return[4,StatusBar.getStyle()];case 7:l.statusBarStyle=c.sent();setCardStatusBarDark();c.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 9:c.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(f.gesture){f.gesture.enable(false);raf((function(){if(f.gesture){f.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}t();return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e;if(getIonMode(this)!=="ios"){return}var r=this.el;var a=this.leaveAnimation||config.get("modalLeave",iosLeaveAnimation);var n=this.animation=a(r,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});var i=findIonContent(r);if(!i){printIonContentErrorMsg(r);return}var o=(e=this.statusBarStyle)!==null&&e!==void 0?e:Style.Default;this.gesture=createSwipeToCloseGesture(r,n,o,(function(){t.gestureAnimationDismissing=true;setCardStatusBarDefault(t.statusBarStyle);t.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};t.prototype.initSheetGesture=function(){var t=this;var e=this,r=e.wrapperEl,a=e.initialBreakpoint,n=e.backdropBreakpoint;if(!r||a===undefined){return}var i=this.enterAnimation||config.get("modalEnter",iosEnterAnimation);var o=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:a,backdropBreakpoint:n,expandToScroll:this.expandToScroll});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,n,o,this.sortedBreakpoints,this.expandToScroll,(function(){var e;return(e=t.currentBreakpoint)!==null&&e!==void 0?e:0}),(function(){return t.sheetOnDismiss()}),(function(e){if(t.currentBreakpoint!==e){t.currentBreakpoint=e;t.ionBreakpointDidChange.emit({breakpoint:e})}})),d=s.gesture,l=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=l;this.gesture.enable(true)};t.prototype.sheetOnDismiss=function(){var t=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};t.prototype.dismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,d;var l=this;return __generator(this,(function(f){switch(f.label){case 0:if(this.gestureAnimationDismissing&&e!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=f.sent();n=e!=="handler";if(!n)return[3,3];return[4,this.checkCanDismiss(t,e)];case 2:n=!f.sent();f.label=3;case 3:if(n){a();return[2,false]}i=this.presentingElement;o=i!==undefined;if(o&&getIonMode(this)==="ios"){setCardStatusBarDefault(this.statusBarStyle)}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback);this.keyboardOpenCallback=undefined}return[4,dismiss(this,t,e,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:i,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 4:s=f.sent();if(!s)return[3,6];d=this.getDelegate().delegate;return[4,detachComponent(d,this.usersElement)];case 5:f.sent();writeTask((function(){return l.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}f.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,s]}}))}))};t.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};t.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};t.prototype.setCurrentBreakpoint=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("[ion-modal] - Attempted to set invalid breakpoint value ".concat(t,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}e=this,r=e.currentBreakpoint,a=e.moveSheetToBreakpoint,n=e.canDismiss,i=e.breakpoints,o=e.animated;if(r===t){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:t,breakpointOffset:1-r,canDismiss:n!==undefined&&n!==true&&i[0]===0,animated:o});return[4,this.sheetTransition];case 1:s.sent();this.sheetTransition=undefined;s.label=2;case 2:return[2]}}))}))};t.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.currentBreakpoint]}))}))};t.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:t=this,e=t.breakpoints,r=t.currentBreakpoint;if(!e||r==null){return[2,false]}a=e.filter((function(t){return t!==0}));n=a.indexOf(r);i=(n+1)%a.length;o=a[i];return[4,this.setCurrentBreakpoint(o)];case 1:s.sent();return[2,true]}}))}))};t.prototype.render=function(){var t;var e=this;var r=this,a=r.handle,n=r.isSheetModal,i=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes,l=r.focusTrap,f=r.expandToScroll;var c=a!==false&&n;var u=getIonMode(this);var p=i!==undefined&&u==="ios";var v=s==="cycle";return h(Host,Object.assign({key:"0991b2e4e32da511e59fb1463b47e4ac1b86d1ca","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[u]=true,t["modal-default"]=!p&&!n,t["modal-card"]=p,t["modal-sheet"]=n,t["modal-no-expand-scroll"]=n&&!f,t["overlay-hidden"]=true,t[FOCUS_TRAP_DISABLE_CLASS]=l===false,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"ca9453ffe1021fb252ad9460676cfabb5633f00f",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),u==="ios"&&h("div",{key:"9f8da446a7b0f3b26aec856e13f6d6d131a7e37b",class:"modal-shadow"}),h("div",Object.assign({key:"9d08bf600571849c97b58f66df40b496a358d1e1",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),c&&h("button",{key:"f8bf0d1126e5376519101225d9965727121ee042",class:"modal-handle",tabIndex:!v?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:v?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"6d52849df98f2c6c8fbc03996a931ea6a39a512b"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return t}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:IonModalIosStyle0,md:IonModalMdStyle0};export{Modal as ion_modal};
|