@ionic/core 7.4.2-dev.11695831341.191bdf12 → 7.4.2-dev.11695927273.1323de22
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/data.js +96 -22
- package/components/haptic.js +1 -0
- package/components/ion-content.js +5 -51
- package/components/ion-datetime-button.js +4 -4
- package/components/ion-datetime.js +3 -3
- package/components/ion-nav.js +1 -0
- package/components/ion-router.js +3 -0
- package/components/ion-tab-bar.js +0 -4
- package/components/ion-toast.js +117 -11
- package/components/ios.transition.js +1 -0
- package/components/overlays.js +1 -0
- package/dist/cjs/{button-active-32f15660.js → button-active-19cc8cae.js} +1 -1
- package/dist/cjs/{data-db832785.js → data-c8d21093.js} +96 -22
- package/dist/cjs/{haptic-c5f6b4d5.js → haptic-678abc9f.js} +1 -0
- package/dist/cjs/{index-b183138a.js → index-77d4b2e7.js} +2 -2
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/ion-action-sheet.cjs.entry.js +3 -3
- package/dist/cjs/ion-alert.cjs.entry.js +3 -3
- package/dist/cjs/ion-app_8.cjs.entry.js +4 -50
- package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -4
- package/dist/cjs/ion-datetime_3.cjs.entry.js +5 -5
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +2 -2
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -1
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-route_4.cjs.entry.js +3 -0
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +0 -4
- package/dist/cjs/ion-toast.cjs.entry.js +136 -32
- package/dist/cjs/ion-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-4b93903d.js → ios.transition-458ee399.js} +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{md.transition-79f3a215.js → md.transition-3423dd44.js} +1 -1
- package/dist/cjs/{overlays-d3a13e61.js → overlays-817dca17.js} +1 -0
- package/dist/collection/components/content/content.js +10 -50
- package/dist/collection/components/datetime/datetime.js +12 -6
- package/dist/collection/components/datetime/test/hour-cycle/datetime.e2e.js +14 -0
- package/dist/collection/components/datetime/utils/data.js +33 -7
- package/dist/collection/components/datetime/utils/format.js +27 -10
- package/dist/collection/components/datetime/utils/helpers.js +37 -5
- package/dist/collection/components/datetime-button/datetime-button.js +4 -4
- package/dist/collection/components/nav/nav.js +1 -0
- package/dist/collection/components/router/router.js +2 -0
- package/dist/collection/components/router/utils/path.js +1 -0
- package/dist/collection/components/tab-bar/tab-bar.js +0 -21
- package/dist/collection/components/toast/animations/ios.enter.js +40 -3
- package/dist/collection/components/toast/animations/ios.leave.js +8 -4
- package/dist/collection/components/toast/animations/md.enter.js +41 -3
- package/dist/collection/components/toast/test/position-anchor/toast.e2e.js +45 -0
- package/dist/collection/components/toast/toast.js +61 -6
- package/dist/collection/utils/native/haptic.js +1 -0
- package/dist/collection/utils/overlays.js +1 -0
- package/dist/collection/utils/transition/ios.transition.js +1 -0
- package/dist/docs.json +83 -10
- package/dist/esm/{button-active-513e9fff.js → button-active-d2346892.js} +1 -1
- package/dist/esm/{data-009dbf15.js → data-44d9e816.js} +96 -22
- package/dist/esm/{haptic-6447af60.js → haptic-1243b917.js} +1 -0
- package/dist/esm/{index-87684bba.js → index-dac72b4c.js} +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/ion-action-sheet.entry.js +3 -3
- package/dist/esm/ion-alert.entry.js +3 -3
- package/dist/esm/ion-app_8.entry.js +5 -51
- package/dist/esm/ion-datetime-button.entry.js +4 -4
- package/dist/esm/ion-datetime_3.entry.js +5 -5
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +2 -2
- package/dist/esm/ion-nav_2.entry.js +2 -1
- package/dist/esm/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +2 -2
- package/dist/esm/ion-refresher_2.entry.js +1 -1
- package/dist/esm/ion-reorder_2.entry.js +1 -1
- package/dist/esm/ion-route_4.entry.js +3 -0
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-tab-bar_2.entry.js +0 -4
- package/dist/esm/ion-toast.entry.js +117 -13
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-81e1aed6.js → ios.transition-991c1a56.js} +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{md.transition-5becd8b5.js → md.transition-fb443521.js} +1 -1
- package/dist/esm/{overlays-8fc6656c.js → overlays-e064e499.js} +1 -0
- package/dist/esm-es5/{button-active-513e9fff.js → button-active-d2346892.js} +1 -1
- package/dist/esm-es5/data-44d9e816.js +4 -0
- package/dist/esm-es5/{index-87684bba.js → index-dac72b4c.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-tab-bar_2.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/{ios.transition-81e1aed6.js → ios.transition-991c1a56.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{md.transition-5becd8b5.js → md.transition-fb443521.js} +1 -1
- package/dist/html.html-data.json +11 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-37456282.system.entry.js → p-06116432.system.entry.js} +1 -1
- package/dist/ionic/{p-270aa06b.entry.js → p-14dec15f.entry.js} +1 -1
- package/dist/ionic/{p-60838ce3.system.entry.js → p-161a6465.system.entry.js} +1 -1
- package/dist/ionic/p-17240d90.js +4 -0
- package/dist/ionic/{p-a6d8476b.system.entry.js → p-17e6836b.system.entry.js} +1 -1
- package/dist/ionic/p-1f448082.system.entry.js +4 -0
- package/dist/ionic/{p-972763df.js → p-2b70878e.js} +1 -1
- package/dist/ionic/{p-13a91505.entry.js → p-2d74ee51.entry.js} +1 -1
- package/dist/ionic/{p-bf9b1560.entry.js → p-2dac36bf.entry.js} +1 -1
- package/dist/ionic/{p-c5729044.system.entry.js → p-2df840d9.system.entry.js} +1 -1
- package/dist/ionic/{p-de676d36.system.entry.js → p-2ffbf4bc.system.entry.js} +1 -1
- package/dist/ionic/{p-4616f20a.system.entry.js → p-30bd5385.system.entry.js} +1 -1
- package/dist/ionic/{p-00aed720.system.js → p-315dd3f8.system.js} +1 -1
- package/dist/ionic/{p-b098f738.system.js → p-35d1c3bb.system.js} +1 -1
- package/dist/ionic/p-3ae2faf0.entry.js +4 -0
- package/dist/ionic/{p-08c5b9f4.system.entry.js → p-3b1a8994.system.entry.js} +1 -1
- package/dist/ionic/p-419b8565.entry.js +4 -0
- package/dist/ionic/{p-82da795c.system.entry.js → p-420da334.system.entry.js} +1 -1
- package/dist/ionic/{p-73f50e29.system.js → p-48393630.system.js} +1 -1
- package/dist/ionic/{p-918d5f19.system.js → p-4cf29e23.system.js} +1 -1
- package/dist/ionic/p-50b11c2b.system.entry.js +4 -0
- package/dist/ionic/{p-53bbd357.system.entry.js → p-5d522814.system.entry.js} +1 -1
- package/dist/ionic/p-5e84b718.system.entry.js +4 -0
- package/dist/ionic/{p-3730f493.entry.js → p-62f05fd2.entry.js} +1 -1
- package/dist/ionic/p-674e6f0c.js +4 -0
- package/dist/ionic/p-6edbc09b.system.js +1 -1
- package/dist/ionic/{p-5e2dc8e0.js → p-716fbba9.js} +1 -1
- package/dist/ionic/{p-f920f5ca.entry.js → p-7779d376.entry.js} +1 -1
- package/dist/ionic/{p-a720dc73.entry.js → p-78f204ee.entry.js} +1 -1
- package/dist/ionic/{p-6bc9c436.system.entry.js → p-86e73df8.system.entry.js} +1 -1
- package/dist/ionic/{p-7129d04e.entry.js → p-8a26eaba.entry.js} +1 -1
- package/dist/ionic/{p-d8b2c214.entry.js → p-974cbc3a.entry.js} +1 -1
- package/dist/ionic/{p-90d892fd.entry.js → p-990aaa2f.entry.js} +1 -1
- package/dist/ionic/{p-8fdd4a2f.system.js → p-9eb5455c.system.js} +1 -1
- package/dist/ionic/{p-4912b933.entry.js → p-a27a6256.entry.js} +1 -1
- package/dist/ionic/{p-b95fd3c6.entry.js → p-b61cf76c.entry.js} +1 -1
- package/dist/ionic/{p-ee6d9730.entry.js → p-b7dad585.entry.js} +1 -1
- package/dist/ionic/p-b8c3f071.system.js +4 -0
- package/dist/ionic/{p-40e16caa.system.entry.js → p-be337735.system.entry.js} +1 -1
- package/dist/ionic/p-c44645f2.entry.js +4 -0
- package/dist/ionic/{p-c7fca267.entry.js → p-c8251e8c.entry.js} +1 -1
- package/dist/ionic/p-d6dcbd7c.js +4 -0
- package/dist/ionic/{p-65a4c12f.system.entry.js → p-ec3fa33b.system.entry.js} +1 -1
- package/dist/ionic/{p-7e46b6ab.entry.js → p-f180d2b6.entry.js} +1 -1
- package/dist/ionic/{p-4a1ac160.system.entry.js → p-f767d6b4.system.entry.js} +1 -1
- package/dist/ionic/{p-63a73b69.system.entry.js → p-f7f6af24.system.entry.js} +1 -1
- package/dist/types/components/content/content.d.ts +1 -2
- package/dist/types/components/datetime/datetime-interface.d.ts +1 -0
- package/dist/types/components/datetime/datetime.d.ts +2 -2
- package/dist/types/components/datetime/utils/data.d.ts +3 -3
- package/dist/types/components/datetime/utils/format.d.ts +3 -3
- package/dist/types/components/datetime/utils/helpers.d.ts +15 -1
- package/dist/types/components/tab-bar/tab-bar.d.ts +0 -8
- package/dist/types/components/toast/animations/ios.enter.d.ts +2 -1
- package/dist/types/components/toast/animations/md.enter.d.ts +2 -1
- package/dist/types/components/toast/toast-interface.d.ts +6 -0
- package/dist/types/components/toast/toast.d.ts +9 -1
- package/dist/types/components.d.ts +16 -8
- package/hydrate/index.js +227 -91
- package/package.json +4 -5
- package/dist/esm-es5/data-009dbf15.js +0 -4
- package/dist/ionic/p-1a36bf45.system.entry.js +0 -4
- package/dist/ionic/p-1f6ac05b.system.entry.js +0 -4
- package/dist/ionic/p-27614d55.entry.js +0 -4
- package/dist/ionic/p-36bfb18c.system.entry.js +0 -4
- package/dist/ionic/p-44ef7224.system.js +0 -4
- package/dist/ionic/p-67c441fa.entry.js +0 -4
- package/dist/ionic/p-72a1cbc7.js +0 -4
- package/dist/ionic/p-78a293a5.js +0 -4
- package/dist/ionic/p-7cfd253c.js +0 -4
- package/dist/ionic/p-ec78a7bf.entry.js +0 -4
- /package/dist/esm-es5/{haptic-6447af60.js → haptic-1243b917.js} +0 -0
- /package/dist/esm-es5/{overlays-8fc6656c.js → overlays-e064e499.js} +0 -0
- /package/dist/ionic/{p-f9015336.js → p-3faf56ab.js} +0 -0
- /package/dist/ionic/{p-7a3caa4e.system.js → p-40bd36f3.system.js} +0 -0
- /package/dist/ionic/{p-14d7b7e2.system.js → p-b4b4bb29.system.js} +0 -0
- /package/dist/ionic/{p-bb6f38ed.js → p-b923f3d7.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{d as doc}from"./index-7a14ecec.js";import{G as GESTURE_CONTROLLER}from"./gesture-controller-0fa396c4.js";import{p as isEndSide,i as inheritAriaAttributes,o as assert,l as clamp}from"./helpers-3379ba19.js";import{m as menuController}from"./index-61bddc90.js";import{q as getPresentedOverlay}from"./overlays-8fc6656c.js";import{c as config,b as getIonMode}from"./ionic-global-b3fc28dd.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{u as menuOutline,v as menuSharp}from"./index-ecfc2c9f.js";import"./hardware-back-button-39299f84.js";import"./animation-a1d9e088.js";import"./framework-delegate-aa433dea.js";import"./index-595d62c9.js";var menuIosCss=":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;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);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}:host(.menu-pane-visible) ion-backdrop{display:hidden !important;}:host(.menu-type-push){z-index:1000}:host(.menu-type-push) .show-backdrop{display:block}";var menuMdCss=":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;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);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}:host(.menu-pane-visible) ion-backdrop{display:hidden !important;}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18);box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18)}";var iosEasing="cubic-bezier(0.32,0.72,0,1)";var mdEasing="cubic-bezier(0.0,0.0,0.2,1)";var iosEasingReverse="cubic-bezier(1, 0, 0.68, 0.28)";var mdEasingReverse="cubic-bezier(0.4, 0, 0.6, 1)";var focusableQueryString='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])';var Menu=function(){function t(t){var e=this;registerInstance(this,t);this.ionWillOpen=createEvent(this,"ionWillOpen",7);this.ionWillClose=createEvent(this,"ionWillClose",7);this.ionDidOpen=createEvent(this,"ionDidOpen",7);this.ionDidClose=createEvent(this,"ionDidClose",7);this.ionMenuChange=createEvent(this,"ionMenuChange",7);this.lastOnEnd=0;this.blocker=GESTURE_CONTROLLER.createBlocker({disableScroll:true});this.didLoad=false;this.isAnimating=false;this._isOpen=false;this.inheritedAttributes={};this.handleFocus=function(t){var n=getPresentedOverlay(document);if(n&&!n.contains(e.el)){return}e.trapKeyboardFocus(t,document)};this.isPaneVisible=false;this.isEndSide=false;this.contentId=undefined;this.menuId=undefined;this.type=undefined;this.disabled=false;this.side="start";this.swipeGesture=true;this.maxEdgeStart=50}t.prototype.typeChanged=function(t,e){var n=this.contentEl;if(n){if(e!==undefined){n.classList.remove("menu-content-".concat(e))}n.classList.add("menu-content-".concat(t));n.removeAttribute("style")}if(this.menuInnerEl){this.menuInnerEl.removeAttribute("style")}this.animation=undefined};t.prototype.disabledChanged=function(){this.updateState();this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})};t.prototype.sideChanged=function(){this.isEndSide=isEndSide(this.side);this.animation=undefined};t.prototype.swipeGestureChanged=function(){this.updateState()};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var n=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(typeof customElements!=="undefined"&&customElements!=null))return[3,2];return[4,customElements.whenDefined("ion-menu")];case 1:i.sent();i.label=2;case 2:if(this.type===undefined){this.type=config.get("menuType","overlay")}t=this.contentId!==undefined?document.getElementById(this.contentId):null;if(t===null){console.error('Menu: must have a "content" element to listen for drag events on.');return[2]}if(this.el.contains(t)){console.error('Menu: "contentId" should refer to the main view\'s ion-content, not the ion-content inside of the ion-menu.')}this.contentEl=t;t.classList.add("menu-content");this.typeChanged(this.type,undefined);this.sideChanged();menuController._register(this);this.menuChanged();e=this;return[4,import("./index-ff313b19.js")];case 3:e.gesture=i.sent().createGesture({el:document,gestureName:"menu-swipe",gesturePriority:30,threshold:10,blurOnStart:true,canStart:function(t){return n.canStart(t)},onWillStart:function(){return n.onWillStart()},onStart:function(){return n.onStart()},onMove:function(t){return n.onMove(t)},onEnd:function(t){return n.onEnd(t)}});this.updateState();return[2]}}))}))};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.didLoad=true;this.menuChanged();this.updateState();return[2]}))}))};t.prototype.menuChanged=function(){if(this.didLoad){this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})}};t.prototype.disconnectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.close(false)];case 1:t.sent();this.blocker.destroy();menuController._unregister(this);if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy();this.gesture=undefined}this.animation=undefined;this.contentEl=undefined;return[2]}}))}))};t.prototype.onSplitPaneChanged=function(t){this.isPaneVisible=t.detail.isPane(this.el);this.updateState()};t.prototype.onBackdropClick=function(t){if(this._isOpen&&this.lastOnEnd<t.timeStamp-100){var e=t.composedPath?!t.composedPath().includes(this.menuInnerEl):false;if(e){t.preventDefault();t.stopPropagation();this.close()}}};t.prototype.onKeydown=function(t){if(t.key==="Escape"){this.close()}};t.prototype.isOpen=function(){return Promise.resolve(this._isOpen)};t.prototype.isActive=function(){return Promise.resolve(this._isActive())};t.prototype.open=function(t){if(t===void 0){t=true}return this.setOpen(true,t)};t.prototype.close=function(t){if(t===void 0){t=true}return this.setOpen(false,t)};t.prototype.toggle=function(t){if(t===void 0){t=true}return this.setOpen(!this._isOpen,t)};t.prototype.setOpen=function(t,e){if(e===void 0){e=true}return menuController._setOpen(this,t,e)};t.prototype.focusFirstDescendant=function(){var t=this.el;var e=t.querySelector(focusableQueryString);if(e){e.focus()}else{t.focus()}};t.prototype.focusLastDescendant=function(){var t=this.el;var e=Array.from(t.querySelectorAll(focusableQueryString));var n=e.length>0?e[e.length-1]:null;if(n){n.focus()}else{t.focus()}};t.prototype.trapKeyboardFocus=function(t,e){var n=t.target;if(!n){return}if(this.el.contains(n)){this.lastFocus=n}else{this.focusFirstDescendant();if(this.lastFocus===e.activeElement){this.focusLastDescendant()}}};t.prototype._setOpen=function(t,e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(!this._isActive()||this.isAnimating||t===this._isOpen){return[2,false]}this.beforeAnimation(t);return[4,this.loadAnimation()];case 1:n.sent();return[4,this.startAnimation(t,e)];case 2:n.sent();this.afterAnimation(t);return[2,true]}}))}))};t.prototype.loadAnimation=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){switch(i.label){case 0:t=this.menuInnerEl.offsetWidth;e=isEndSide(this.side);if(t===this.width&&this.animation!==undefined&&e===this.isEndSide){return[2]}this.width=t;this.isEndSide=e;if(this.animation){this.animation.destroy();this.animation=undefined}n=this;return[4,menuController._createAnimation(this.type,this)];case 1:n.animation=i.sent();if(!config.getBoolean("animated",true)){this.animation.duration(0)}this.animation.fill("both");return[2]}}))}))};t.prototype.startAnimation=function(t,e){return __awaiter(this,void 0,void 0,(function(){var n,i,o,r,s;return __generator(this,(function(a){switch(a.label){case 0:n=!t;i=getIonMode(this);o=i==="ios"?iosEasing:mdEasing;r=i==="ios"?iosEasingReverse:mdEasingReverse;s=this.animation.direction(n?"reverse":"normal").easing(n?r:o).onFinish((function(){if(s.getDirection()==="reverse"){s.direction("normal")}}));if(!e)return[3,2];return[4,s.play()];case 1:a.sent();return[3,3];case 2:s.play({sync:true});a.label=3;case 3:return[2]}}))}))};t.prototype._isActive=function(){return!this.disabled&&!this.isPaneVisible};t.prototype.canSwipe=function(){return this.swipeGesture&&!this.isAnimating&&this._isActive()};t.prototype.canStart=function(t){var e=!!document.querySelector("ion-modal.show-modal");if(e||!this.canSwipe()){return false}if(this._isOpen){return true}else if(menuController._getOpenSync()){return false}return checkEdgeSide(window,t.currentX,this.isEndSide,this.maxEdgeStart)};t.prototype.onWillStart=function(){this.beforeAnimation(!this._isOpen);return this.loadAnimation()};t.prototype.onStart=function(){if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}this.animation.progressStart(true,this._isOpen?1:0)};t.prototype.onMove=function(t){if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}var e=computeDelta(t.deltaX,this._isOpen,this.isEndSide);var n=e/this.width;this.animation.progressStep(this._isOpen?1-n:n)};t.prototype.onEnd=function(t){var e=this;if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}var n=this._isOpen;var i=this.isEndSide;var o=computeDelta(t.deltaX,n,i);var r=this.width;var s=o/r;var a=t.velocityX;var u=r/2;var d=a>=0&&(a>.2||t.deltaX>u);var l=a<=0&&(a<-.2||t.deltaX<-u);var h=n?i?d:l:i?l:d;var c=!n&&h;if(n&&!h){c=true}this.lastOnEnd=t.currentTime;var p=h?.001:-.001;var m=s<0?.01:s;p+=getTimeGivenProgression([0,0],[.4,0],[.6,1],[1,1],clamp(0,m,.9999))[0]||0;var f=this._isOpen?!h:h;this.animation.easing("cubic-bezier(0.4, 0.0, 0.6, 1)").onFinish((function(){return e.afterAnimation(c)}),{oneTimeCallback:true}).progressEnd(f?1:0,this._isOpen?1-p:p,300)};t.prototype.beforeAnimation=function(t){assert(!this.isAnimating,"_before() should not be called while animating");this.el.classList.add(SHOW_MENU);this.el.setAttribute("tabindex","0");if(this.backdropEl){this.backdropEl.classList.add(SHOW_BACKDROP)}if(this.contentEl){this.contentEl.classList.add(MENU_CONTENT_OPEN);this.contentEl.setAttribute("aria-hidden","true")}this.blocker.block();this.isAnimating=true;if(t){this.ionWillOpen.emit()}else{this.ionWillClose.emit()}};t.prototype.afterAnimation=function(t){var e;assert(this.isAnimating,"_before() should be called while animating");this._isOpen=t;this.isAnimating=false;if(!this._isOpen){this.blocker.unblock()}if(t){this.ionDidOpen.emit();var n=(e=document.activeElement)===null||e===void 0?void 0:e.closest("ion-menu");if(n!==this.el){this.el.focus()}document.addEventListener("focus",this.handleFocus,true)}else{this.el.classList.remove(SHOW_MENU);this.el.removeAttribute("tabindex");if(this.contentEl){this.contentEl.classList.remove(MENU_CONTENT_OPEN);this.contentEl.removeAttribute("aria-hidden")}if(this.backdropEl){this.backdropEl.classList.remove(SHOW_BACKDROP)}if(this.animation){this.animation.stop()}this.ionDidClose.emit();document.removeEventListener("focus",this.handleFocus,true)}};t.prototype.updateState=function(){var t=this._isActive();if(this.gesture){this.gesture.enable(t&&this.swipeGesture)}if(!t&&this._isOpen){this.forceClosing()}if(doc===null||doc===void 0?void 0:doc.contains(this.el)){if(!this.disabled){menuController._setActiveMenu(this)}}assert(!this.isAnimating,"can not be animating")};t.prototype.forceClosing=function(){assert(this._isOpen,"menu cannot be closed");this.isAnimating=true;var t=this.animation.direction("reverse");t.play({sync:true});this.afterAnimation(false)};t.prototype.render=function(){var t;var e=this;var n=this,i=n.type,o=n.disabled,r=n.isPaneVisible,s=n.inheritedAttributes,a=n.side;var u=getIonMode(this);return h(Host,{role:"navigation","aria-label":s["aria-label"]||"menu",class:(t={},t[u]=true,t["menu-type-".concat(i)]=true,t["menu-enabled"]=!o,t["menu-side-".concat(a)]=true,t["menu-pane-visible"]=r,t)},h("div",{class:"menu-inner",part:"container",ref:function(t){return e.menuInnerEl=t}},h("slot",null)),h("ion-backdrop",{ref:function(t){return e.backdropEl=t},class:"menu-backdrop",tappable:false,stopPropagation:false,part:"backdrop"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{type:["typeChanged"],disabled:["disabledChanged"],side:["sideChanged"],swipeGesture:["swipeGestureChanged"]}},enumerable:false,configurable:true});return t}();var computeDelta=function(t,e,n){return Math.max(0,e!==n?-t:t)};var checkEdgeSide=function(t,e,n,i){if(n){return e>=t.innerWidth-i}else{return e<=i}};var SHOW_MENU="show-menu";var SHOW_BACKDROP="show-backdrop";var MENU_CONTENT_OPEN="menu-content-open";Menu.style={ios:menuIosCss,md:menuMdCss};var updateVisibility=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,menuController.get(t)];case 1:e=i.sent();n=e;if(!n)return[3,3];return[4,e.isActive()];case 2:n=i.sent();i.label=3;case 3:return[2,!!n]}}))}))};var menuButtonIosCss=':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}:host(.ion-activated){opacity:0.4}@media (any-hover: hover){:host(:hover){opacity:0.6}}';var menuButtonMdCss=':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused)::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}';var MenuButton=function(){function t(t){var e=this;registerInstance(this,t);this.inheritedAttributes={};this.onClick=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){return[2,menuController.toggle(this.menu)]}))}))};this.visible=false;this.color=undefined;this.disabled=false;this.menu=undefined;this.autoHide=true;this.type="button"}t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.componentDidLoad=function(){this.visibilityChanged()};t.prototype.visibilityChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,updateVisibility(this.menu)];case 1:t.visible=e.sent();return[2]}}))}))};t.prototype.render=function(){var t;var e=this,n=e.color,i=e.disabled,o=e.inheritedAttributes;var r=getIonMode(this);var s=config.get("menuIcon",r==="ios"?menuOutline:menuSharp);var a=this.autoHide&&!this.visible;var u={type:this.type};var d=o["aria-label"]||"menu";return h(Host,{onClick:this.onClick,"aria-disabled":i?"true":null,"aria-hidden":a?"true":null,class:createColorClasses(n,(t={},t[r]=true,t.button=true,t["menu-button-hidden"]=a,t["menu-button-disabled"]=i,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["ion-activatable"]=true,t["ion-focusable"]=true,t))},h("button",Object.assign({},u,{disabled:i,class:"button-native",part:"native","aria-label":d}),h("span",{class:"button-inner"},h("slot",null,h("ion-icon",{part:"icon",icon:s,mode:r,lazy:false,"aria-hidden":"true"}))),r==="md"&&h("ion-ripple-effect",{type:"unbounded"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();MenuButton.style={ios:menuButtonIosCss,md:menuButtonMdCss};var menuToggleCss=":host(.menu-toggle-hidden){display:none}";var MenuToggle=function(){function t(t){var e=this;registerInstance(this,t);this.onClick=function(){return menuController.toggle(e.menu)};this.visible=false;this.menu=undefined;this.autoHide=true}t.prototype.connectedCallback=function(){this.visibilityChanged()};t.prototype.visibilityChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,updateVisibility(this.menu)];case 1:t.visible=e.sent();return[2]}}))}))};t.prototype.render=function(){var t;var e=getIonMode(this);var n=this.autoHide&&!this.visible;return h(Host,{onClick:this.onClick,"aria-hidden":n?"true":null,class:(t={},t[e]=true,t["menu-toggle-hidden"]=n,t)},h("slot",null))};return t}();MenuToggle.style=menuToggleCss;export{Menu as ion_menu,MenuButton as ion_menu_button,MenuToggle as ion_menu_toggle};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{d as doc}from"./index-7a14ecec.js";import{G as GESTURE_CONTROLLER}from"./gesture-controller-0fa396c4.js";import{p as isEndSide,i as inheritAriaAttributes,o as assert,l as clamp}from"./helpers-3379ba19.js";import{m as menuController}from"./index-61bddc90.js";import{q as getPresentedOverlay}from"./overlays-e064e499.js";import{c as config,b as getIonMode}from"./ionic-global-b3fc28dd.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{u as menuOutline,v as menuSharp}from"./index-ecfc2c9f.js";import"./hardware-back-button-39299f84.js";import"./animation-a1d9e088.js";import"./framework-delegate-aa433dea.js";import"./index-595d62c9.js";var menuIosCss=":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;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);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}:host(.menu-pane-visible) ion-backdrop{display:hidden !important;}:host(.menu-type-push){z-index:1000}:host(.menu-type-push) .show-backdrop{display:block}";var menuMdCss=":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;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);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start) .menu-inner:dir(rtl){--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end) .menu-inner:dir(rtl){--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}:host(.menu-pane-visible) ion-backdrop{display:hidden !important;}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18);box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18)}";var iosEasing="cubic-bezier(0.32,0.72,0,1)";var mdEasing="cubic-bezier(0.0,0.0,0.2,1)";var iosEasingReverse="cubic-bezier(1, 0, 0.68, 0.28)";var mdEasingReverse="cubic-bezier(0.4, 0, 0.6, 1)";var focusableQueryString='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])';var Menu=function(){function t(t){var e=this;registerInstance(this,t);this.ionWillOpen=createEvent(this,"ionWillOpen",7);this.ionWillClose=createEvent(this,"ionWillClose",7);this.ionDidOpen=createEvent(this,"ionDidOpen",7);this.ionDidClose=createEvent(this,"ionDidClose",7);this.ionMenuChange=createEvent(this,"ionMenuChange",7);this.lastOnEnd=0;this.blocker=GESTURE_CONTROLLER.createBlocker({disableScroll:true});this.didLoad=false;this.isAnimating=false;this._isOpen=false;this.inheritedAttributes={};this.handleFocus=function(t){var n=getPresentedOverlay(document);if(n&&!n.contains(e.el)){return}e.trapKeyboardFocus(t,document)};this.isPaneVisible=false;this.isEndSide=false;this.contentId=undefined;this.menuId=undefined;this.type=undefined;this.disabled=false;this.side="start";this.swipeGesture=true;this.maxEdgeStart=50}t.prototype.typeChanged=function(t,e){var n=this.contentEl;if(n){if(e!==undefined){n.classList.remove("menu-content-".concat(e))}n.classList.add("menu-content-".concat(t));n.removeAttribute("style")}if(this.menuInnerEl){this.menuInnerEl.removeAttribute("style")}this.animation=undefined};t.prototype.disabledChanged=function(){this.updateState();this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})};t.prototype.sideChanged=function(){this.isEndSide=isEndSide(this.side);this.animation=undefined};t.prototype.swipeGestureChanged=function(){this.updateState()};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var n=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(typeof customElements!=="undefined"&&customElements!=null))return[3,2];return[4,customElements.whenDefined("ion-menu")];case 1:i.sent();i.label=2;case 2:if(this.type===undefined){this.type=config.get("menuType","overlay")}t=this.contentId!==undefined?document.getElementById(this.contentId):null;if(t===null){console.error('Menu: must have a "content" element to listen for drag events on.');return[2]}if(this.el.contains(t)){console.error('Menu: "contentId" should refer to the main view\'s ion-content, not the ion-content inside of the ion-menu.')}this.contentEl=t;t.classList.add("menu-content");this.typeChanged(this.type,undefined);this.sideChanged();menuController._register(this);this.menuChanged();e=this;return[4,import("./index-ff313b19.js")];case 3:e.gesture=i.sent().createGesture({el:document,gestureName:"menu-swipe",gesturePriority:30,threshold:10,blurOnStart:true,canStart:function(t){return n.canStart(t)},onWillStart:function(){return n.onWillStart()},onStart:function(){return n.onStart()},onMove:function(t){return n.onMove(t)},onEnd:function(t){return n.onEnd(t)}});this.updateState();return[2]}}))}))};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.didLoad=true;this.menuChanged();this.updateState();return[2]}))}))};t.prototype.menuChanged=function(){if(this.didLoad){this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})}};t.prototype.disconnectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.close(false)];case 1:t.sent();this.blocker.destroy();menuController._unregister(this);if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy();this.gesture=undefined}this.animation=undefined;this.contentEl=undefined;return[2]}}))}))};t.prototype.onSplitPaneChanged=function(t){this.isPaneVisible=t.detail.isPane(this.el);this.updateState()};t.prototype.onBackdropClick=function(t){if(this._isOpen&&this.lastOnEnd<t.timeStamp-100){var e=t.composedPath?!t.composedPath().includes(this.menuInnerEl):false;if(e){t.preventDefault();t.stopPropagation();this.close()}}};t.prototype.onKeydown=function(t){if(t.key==="Escape"){this.close()}};t.prototype.isOpen=function(){return Promise.resolve(this._isOpen)};t.prototype.isActive=function(){return Promise.resolve(this._isActive())};t.prototype.open=function(t){if(t===void 0){t=true}return this.setOpen(true,t)};t.prototype.close=function(t){if(t===void 0){t=true}return this.setOpen(false,t)};t.prototype.toggle=function(t){if(t===void 0){t=true}return this.setOpen(!this._isOpen,t)};t.prototype.setOpen=function(t,e){if(e===void 0){e=true}return menuController._setOpen(this,t,e)};t.prototype.focusFirstDescendant=function(){var t=this.el;var e=t.querySelector(focusableQueryString);if(e){e.focus()}else{t.focus()}};t.prototype.focusLastDescendant=function(){var t=this.el;var e=Array.from(t.querySelectorAll(focusableQueryString));var n=e.length>0?e[e.length-1]:null;if(n){n.focus()}else{t.focus()}};t.prototype.trapKeyboardFocus=function(t,e){var n=t.target;if(!n){return}if(this.el.contains(n)){this.lastFocus=n}else{this.focusFirstDescendant();if(this.lastFocus===e.activeElement){this.focusLastDescendant()}}};t.prototype._setOpen=function(t,e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(!this._isActive()||this.isAnimating||t===this._isOpen){return[2,false]}this.beforeAnimation(t);return[4,this.loadAnimation()];case 1:n.sent();return[4,this.startAnimation(t,e)];case 2:n.sent();this.afterAnimation(t);return[2,true]}}))}))};t.prototype.loadAnimation=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,n;return __generator(this,(function(i){switch(i.label){case 0:t=this.menuInnerEl.offsetWidth;e=isEndSide(this.side);if(t===this.width&&this.animation!==undefined&&e===this.isEndSide){return[2]}this.width=t;this.isEndSide=e;if(this.animation){this.animation.destroy();this.animation=undefined}n=this;return[4,menuController._createAnimation(this.type,this)];case 1:n.animation=i.sent();if(!config.getBoolean("animated",true)){this.animation.duration(0)}this.animation.fill("both");return[2]}}))}))};t.prototype.startAnimation=function(t,e){return __awaiter(this,void 0,void 0,(function(){var n,i,o,r,s;return __generator(this,(function(a){switch(a.label){case 0:n=!t;i=getIonMode(this);o=i==="ios"?iosEasing:mdEasing;r=i==="ios"?iosEasingReverse:mdEasingReverse;s=this.animation.direction(n?"reverse":"normal").easing(n?r:o).onFinish((function(){if(s.getDirection()==="reverse"){s.direction("normal")}}));if(!e)return[3,2];return[4,s.play()];case 1:a.sent();return[3,3];case 2:s.play({sync:true});a.label=3;case 3:return[2]}}))}))};t.prototype._isActive=function(){return!this.disabled&&!this.isPaneVisible};t.prototype.canSwipe=function(){return this.swipeGesture&&!this.isAnimating&&this._isActive()};t.prototype.canStart=function(t){var e=!!document.querySelector("ion-modal.show-modal");if(e||!this.canSwipe()){return false}if(this._isOpen){return true}else if(menuController._getOpenSync()){return false}return checkEdgeSide(window,t.currentX,this.isEndSide,this.maxEdgeStart)};t.prototype.onWillStart=function(){this.beforeAnimation(!this._isOpen);return this.loadAnimation()};t.prototype.onStart=function(){if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}this.animation.progressStart(true,this._isOpen?1:0)};t.prototype.onMove=function(t){if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}var e=computeDelta(t.deltaX,this._isOpen,this.isEndSide);var n=e/this.width;this.animation.progressStep(this._isOpen?1-n:n)};t.prototype.onEnd=function(t){var e=this;if(!this.isAnimating||!this.animation){assert(false,"isAnimating has to be true");return}var n=this._isOpen;var i=this.isEndSide;var o=computeDelta(t.deltaX,n,i);var r=this.width;var s=o/r;var a=t.velocityX;var u=r/2;var d=a>=0&&(a>.2||t.deltaX>u);var l=a<=0&&(a<-.2||t.deltaX<-u);var h=n?i?d:l:i?l:d;var c=!n&&h;if(n&&!h){c=true}this.lastOnEnd=t.currentTime;var p=h?.001:-.001;var m=s<0?.01:s;p+=getTimeGivenProgression([0,0],[.4,0],[.6,1],[1,1],clamp(0,m,.9999))[0]||0;var f=this._isOpen?!h:h;this.animation.easing("cubic-bezier(0.4, 0.0, 0.6, 1)").onFinish((function(){return e.afterAnimation(c)}),{oneTimeCallback:true}).progressEnd(f?1:0,this._isOpen?1-p:p,300)};t.prototype.beforeAnimation=function(t){assert(!this.isAnimating,"_before() should not be called while animating");this.el.classList.add(SHOW_MENU);this.el.setAttribute("tabindex","0");if(this.backdropEl){this.backdropEl.classList.add(SHOW_BACKDROP)}if(this.contentEl){this.contentEl.classList.add(MENU_CONTENT_OPEN);this.contentEl.setAttribute("aria-hidden","true")}this.blocker.block();this.isAnimating=true;if(t){this.ionWillOpen.emit()}else{this.ionWillClose.emit()}};t.prototype.afterAnimation=function(t){var e;assert(this.isAnimating,"_before() should be called while animating");this._isOpen=t;this.isAnimating=false;if(!this._isOpen){this.blocker.unblock()}if(t){this.ionDidOpen.emit();var n=(e=document.activeElement)===null||e===void 0?void 0:e.closest("ion-menu");if(n!==this.el){this.el.focus()}document.addEventListener("focus",this.handleFocus,true)}else{this.el.classList.remove(SHOW_MENU);this.el.removeAttribute("tabindex");if(this.contentEl){this.contentEl.classList.remove(MENU_CONTENT_OPEN);this.contentEl.removeAttribute("aria-hidden")}if(this.backdropEl){this.backdropEl.classList.remove(SHOW_BACKDROP)}if(this.animation){this.animation.stop()}this.ionDidClose.emit();document.removeEventListener("focus",this.handleFocus,true)}};t.prototype.updateState=function(){var t=this._isActive();if(this.gesture){this.gesture.enable(t&&this.swipeGesture)}if(!t&&this._isOpen){this.forceClosing()}if(doc===null||doc===void 0?void 0:doc.contains(this.el)){if(!this.disabled){menuController._setActiveMenu(this)}}assert(!this.isAnimating,"can not be animating")};t.prototype.forceClosing=function(){assert(this._isOpen,"menu cannot be closed");this.isAnimating=true;var t=this.animation.direction("reverse");t.play({sync:true});this.afterAnimation(false)};t.prototype.render=function(){var t;var e=this;var n=this,i=n.type,o=n.disabled,r=n.isPaneVisible,s=n.inheritedAttributes,a=n.side;var u=getIonMode(this);return h(Host,{role:"navigation","aria-label":s["aria-label"]||"menu",class:(t={},t[u]=true,t["menu-type-".concat(i)]=true,t["menu-enabled"]=!o,t["menu-side-".concat(a)]=true,t["menu-pane-visible"]=r,t)},h("div",{class:"menu-inner",part:"container",ref:function(t){return e.menuInnerEl=t}},h("slot",null)),h("ion-backdrop",{ref:function(t){return e.backdropEl=t},class:"menu-backdrop",tappable:false,stopPropagation:false,part:"backdrop"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{type:["typeChanged"],disabled:["disabledChanged"],side:["sideChanged"],swipeGesture:["swipeGestureChanged"]}},enumerable:false,configurable:true});return t}();var computeDelta=function(t,e,n){return Math.max(0,e!==n?-t:t)};var checkEdgeSide=function(t,e,n,i){if(n){return e>=t.innerWidth-i}else{return e<=i}};var SHOW_MENU="show-menu";var SHOW_BACKDROP="show-backdrop";var MENU_CONTENT_OPEN="menu-content-open";Menu.style={ios:menuIosCss,md:menuMdCss};var updateVisibility=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,menuController.get(t)];case 1:e=i.sent();n=e;if(!n)return[3,3];return[4,e.isActive()];case 2:n=i.sent();i.label=3;case 3:return[2,!!n]}}))}))};var menuButtonIosCss=':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}:host(.ion-activated){opacity:0.4}@media (any-hover: hover){:host(:hover){opacity:0.6}}';var menuButtonMdCss=':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused)::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}';var MenuButton=function(){function t(t){var e=this;registerInstance(this,t);this.inheritedAttributes={};this.onClick=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){return[2,menuController.toggle(this.menu)]}))}))};this.visible=false;this.color=undefined;this.disabled=false;this.menu=undefined;this.autoHide=true;this.type="button"}t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.componentDidLoad=function(){this.visibilityChanged()};t.prototype.visibilityChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,updateVisibility(this.menu)];case 1:t.visible=e.sent();return[2]}}))}))};t.prototype.render=function(){var t;var e=this,n=e.color,i=e.disabled,o=e.inheritedAttributes;var r=getIonMode(this);var s=config.get("menuIcon",r==="ios"?menuOutline:menuSharp);var a=this.autoHide&&!this.visible;var u={type:this.type};var d=o["aria-label"]||"menu";return h(Host,{onClick:this.onClick,"aria-disabled":i?"true":null,"aria-hidden":a?"true":null,class:createColorClasses(n,(t={},t[r]=true,t.button=true,t["menu-button-hidden"]=a,t["menu-button-disabled"]=i,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["ion-activatable"]=true,t["ion-focusable"]=true,t))},h("button",Object.assign({},u,{disabled:i,class:"button-native",part:"native","aria-label":d}),h("span",{class:"button-inner"},h("slot",null,h("ion-icon",{part:"icon",icon:s,mode:r,lazy:false,"aria-hidden":"true"}))),r==="md"&&h("ion-ripple-effect",{type:"unbounded"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();MenuButton.style={ios:menuButtonIosCss,md:menuButtonMdCss};var menuToggleCss=":host(.menu-toggle-hidden){display:none}";var MenuToggle=function(){function t(t){var e=this;registerInstance(this,t);this.onClick=function(){return menuController.toggle(e.menu)};this.visible=false;this.menu=undefined;this.autoHide=true}t.prototype.connectedCallback=function(){this.visibilityChanged()};t.prototype.visibilityChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,updateVisibility(this.menu)];case 1:t.visible=e.sent();return[2]}}))}))};t.prototype.render=function(){var t;var e=getIonMode(this);var n=this.autoHide&&!this.visible;return h(Host,{onClick:this.onClick,"aria-hidden":n?"true":null,class:(t={},t[e]=true,t["menu-toggle-hidden"]=n,t)},h("slot",null))};return t}();MenuToggle.style=menuToggleCss;export{Menu as ion_menu,MenuButton as ion_menu_button,MenuToggle as ion_menu_toggle};
|
|
@@ -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,d as createEvent,w as writeTask,h,H as Host,f as getElement}from"./index-2d388930.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-746a238e.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-aa433dea.js";import{g as getElementRoot,l as clamp,r as raf,k as inheritAttributes,m as hasLazyBuild}from"./helpers-3379ba19.js";import{c as createLockController}from"./lock-controller-e8c6c051.js";import{p as printIonWarning}from"./index-595d62c9.js";import{g as getCapacitor}from"./capacitor-b4979570.js";import{G as GESTURE,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,n as activeAnimations,g as dismiss,h as eventMethod}from"./overlays-8fc6656c.js";import{g as getClassMap}from"./theme-17531cdf.js";import{e as deepReady,w as waitForMount}from"./index-87684bba.js";import{b as getIonMode,c as config}from"./ionic-global-b3fc28dd.js";import{KEYBOARD_DID_OPEN}from"./keyboard-b551279d.js";import{c as createAnimation}from"./animation-a1d9e088.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{createGesture}from"./index-ff313b19.js";import{w as win}from"./index-7a14ecec.js";import"./hardware-back-button-39299f84.js";import"./keyboard-b063f012.js";import"./gesture-controller-0fa396c4.js";var Style;(function(e){e["Dark"]="DARK";e["Light"]="LIGHT";e["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var e=getCapacitor();if(e===null||e===void 0?void 0:e.isPluginAvailable("StatusBar")){return e.Plugins.StatusBar}return undefined},supportsDefaultStatusBarStyle:function(){var e=getCapacitor();return!!(e===null||e===void 0?void 0:e.PluginHeaders)},setStyle:function(e){var t=this.getEngine();if(!t){return}t.setStyle(e)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=this.getEngine();if(!e){return[2,Style.Default]}return[4,e.getInfo()];case 1:t=r.sent().style;return[2,t]}}))}))}};var getBackdropValueForSheet=function(e,t){if(t===1){return 0}var r=1/(1-t);var a=-(t*r);return e*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(e){if(e===void 0){e=Style.Default}if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:e})};var handleCanDismiss=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof e.canDismiss!=="function"){return[2]}return[4,e.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(t.isRunning()){t.onFinish((function(){e.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{e.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(e){return.00255275*Math.pow(2.71828,-14.9619*e)-1.00255*Math.pow(2.71828,-.0380968*e)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.93};var createSwipeToCloseGesture=function(e,t,r,a){var n=.5;var i=e.offsetHeight;var o=false;var s=false;var d=null;var l=null;var c=.2;var p=true;var u=0;var f=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var h=function(e){var t=e.event.target;if(t===null||!t.closest){return true}d=findClosestIonContent(t);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=t.closest("ion-footer");if(n===null){return true}return false};var m=function(r){var a=r.deltaY;p=f();s=e.canDismiss!==undefined&&e.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}t.progressStart(true,o?1:0)};var v=function(e){var a=e.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=e.deltaY/i;var l=o>=0&&s;var p=l?c:.9999;var f=l?calculateSpringStep(o/p):o;var h=clamp(1e-4,f,p);t.progressStep(h);if(h>=n&&u<n){setCardStatusBarDefault(r)}else if(h<n&&u>=n){setCardStatusBarDark()}u=h};var b=function(r){var l=r.velocityY;var u=r.deltaY/i;var f=u>=0&&s;var h=f?c:.9999;var m=f?calculateSpringStep(u/h):u;var v=clamp(1e-4,m,h);var b=(r.deltaY+l*1e3)/i;var y=!f&&b>=n;var k=y?-.001:.001;if(!y){t.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],v)[0]}else{t.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],v)[0]}var w=y?computeDuration(u*i,l):computeDuration((1-v)*i,l);o=y;g.enable(false);if(d){resetContentScrollY(d,p)}t.onFinish((function(){if(!y){g.enable(true)}})).progressEnd(y?1:0,k,w);if(f&&v>h/4){handleCanDismiss(e,t)}else if(y){a()}};var g=createGesture({el:e,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:h,onStart:m,onMove:v,onEnd:b});return g};var computeDuration=function(e,t){return clamp(400,e/Math.abs(t*1.1),500)};var createSheetEnterAnimation=function(e){var t=e.currentBreakpoint,r=e.backdropBreakpoint;var a=r===undefined||r<t;var n=a?"calc(var(--backdrop-opacity) * ".concat(t,")"):"0";var i=createAnimation("backdropAnimation").fromTo("opacity",0,n);if(a){i.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var o=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-t*100,"%)")}]);return{wrapperAnimation:o,backdropAnimation:i}};var createSheetLeaveAnimation=function(e){var t=e.currentBreakpoint,r=e.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(t,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-t*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var e=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var t=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:e,wrapperAnimation:t}};var iosEnterAnimation=function(e,t){var r=t.presentingEl,a=t.currentBreakpoint;var n=getElementRoot(e);var i=a!==undefined?createSheetEnterAnimation(t):createEnterAnimation$1(),o=i.wrapperAnimation,s=i.backdropAnimation;s.addElement(n.querySelector("ion-backdrop"));o.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var d=createAnimation("entering-base").addElement(e).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(o);if(r){var l=window.innerWidth<768;var c=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var p=getElementRoot(r);var u=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var f=document.body;if(l){var h=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var m=c?"-10px":h;var v=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var b="translateY(".concat(m,") scale(").concat(v,")");u.afterStyles({transform:b}).beforeAddWrite((function(){return f.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:b,borderRadius:"10px 10px 0 0"}]);d.addAnimation(u)}else{d.addAnimation(s);if(!c){o.fromTo("opacity","0","1")}else{var v=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var b="translateY(-10px) scale(".concat(v,")");u.afterStyles({transform:b}).addElement(p.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:b}]);var g=createAnimation().afterStyles({transform:b}).addElement(p.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:b}]);d.addAnimation([u,g])}}}else{d.addAnimation(s)}return d};var createLeaveAnimation$1=function(){var e=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var t=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:e,wrapperAnimation:t}};var iosLeaveAnimation=function(e,t,r){if(r===void 0){r=500}var a=t.presentingEl,n=t.currentBreakpoint;var i=getElementRoot(e);var o=n!==undefined?createSheetLeaveAnimation(t):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(e).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(s);if(a){var c=window.innerWidth<768;var p=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var f=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(e){if(e!==1){return}a.style.setProperty("overflow","");var t=Array.from(h.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(e){return e.presentingElement!==undefined})).length;if(t<=1){h.style.setProperty("background-color","")}}));var h=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var v=p?"-10px":m;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var g="translateY(".concat(v,") scale(").concat(b,")");f.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(f)}else{l.addAnimation(d);if(!p){s.fromTo("opacity","1","0")}else{var b=p?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var g="translateY(-10px) scale(".concat(b,")");f.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 y=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([f,y])}}}else{l.addAnimation(d)}return l};var createEnterAnimation=function(){var e=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var t=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:e,wrapperAnimation:t}};var mdEnterAnimation=function(e,t){var r=t.currentBreakpoint;var a=getElementRoot(e);var n=r!==undefined?createSheetEnterAnimation(t):createEnterAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));return createAnimation().addElement(e).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([o,i])};var createLeaveAnimation=function(){var e=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var t=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:e,wrapperAnimation:t}};var mdLeaveAnimation=function(e,t){var r=t.currentBreakpoint;var a=getElementRoot(e);var n=r!==undefined?createSheetLeaveAnimation(t):createLeaveAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));return createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,i])};var createSheetGesture=function(e,t,r,a,n,i,o,s,d,l){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var p=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-n,opacity:0},{offset:1,opacity:0}];var u={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:n!==0?p:c};var f=e.querySelector("ion-content");var h=r.clientHeight;var m=a;var v=0;var b=false;var g=.95;var y=i.childAnimations.find((function(e){return e.id==="wrapperAnimation"}));var k=i.childAnimations.find((function(e){return e.id==="backdropAnimation"}));var w=o[o.length-1];var x=o[0];var S=function(){e.style.setProperty("pointer-events","auto");t.style.setProperty("pointer-events","auto");e.classList.remove("ion-disable-focus-trap")};var A=function(){e.style.setProperty("pointer-events","none");t.style.setProperty("pointer-events","none");e.classList.add("ion-disable-focus-trap")};if(y&&k){y.keyframes(__spreadArray([],u.WRAPPER_KEYFRAMES,true));k.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));i.progressStart(true,1-m);var E=m>n;if(E){S()}else{A()}}if(f&&m!==w){f.scrollY=false}var C=function(e){var t=e.event.target.closest("ion-content");m=s();if(m===1&&t){return false}return true};var D=function(){b=e.canDismiss!==undefined&&e.canDismiss!==true&&x===0;if(f){f.scrollY=false}raf((function(){e.focus()}));i.progressStart(true,1-m)};var B=function(e){var t=1-m;var r=o.length>1?1-o[1]:undefined;var a=t+e.deltaY/h;var n=r!==undefined&&a>=r&&b;var s=n?g:.9999;var d=n&&r!==undefined?r+calculateSpringStep((a-r)/(s-r)):a;v=clamp(1e-4,d,s);i.progressStep(v)};var _=function(e){var t=e.velocityY;var r=(e.deltaY+t*350)/h;var a=m-r;var n=o.reduce((function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e}));M({breakpoint:n,breakpointOffset:v,canDismiss:b,animated:true})};var M=function(t){var r=t.breakpoint,a=t.canDismiss,s=t.breakpointOffset,c=t.animated;var p=a&&r===0;var h=p?m:r;var v=h!==0;m=0;if(y&&k){y.keyframes([{offset:0,transform:"translateY(".concat(s*100,"%)")},{offset:1,transform:"translateY(".concat((1-h)*100,"%)")}]);k.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-s,n),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(h,n),")")}]);i.progressStep(0)}Y.enable(false);if(p){handleCanDismiss(e,i)}else if(!v){d()}return new Promise((function(e){i.onFinish((function(){if(v){if(y&&k){raf((function(){y.keyframes(__spreadArray([],u.WRAPPER_KEYFRAMES,true));k.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));i.progressStart(true,1-h);m=h;l(m);if(f&&m===o[o.length-1]){f.scrollY=true}var t=m>n;if(t){S()}else{A()}Y.enable(true);e()}))}else{Y.enable(true);e()}}else{e()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var Y=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:D,onMove:B,onEnd:_});return{gesture:Y,moveSheetToBreakpoint:M}};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, #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{--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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-card) .modal-wrapper:dir(rtl){border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-sheet) .modal-wrapper:dir(rtl){border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}}';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, #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{--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 Modal=function(){function e(e){var t=this;registerInstance(this,e);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 e=t,r=e.sheetTransition,a=e.handleBehavior;if(a!=="cycle"||r!==undefined){return}t.moveToNextBreakpoint()};this.onBackdropTap=function(){var e=t.sheetTransition;if(e!==undefined){return}t.dismiss(undefined,BACKDROP)};this.onLifecycle=function(e){var r=t.usersElement;var a=LIFECYCLE_MAP[e.type];if(r&&a){var n=new CustomEvent(a,{bubbles:false,cancelable:false,detail:e.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.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.canDismiss=true}e.prototype.onIsOpenChange=function(e,t){if(e===true&&t===false){this.present()}else if(e===false&&t===true){this.dismiss()}};e.prototype.triggerChanged=function(){var e=this,t=e.trigger,r=e.el,a=e.triggerController;if(t){a.addClickListener(r,t)}};e.prototype.breakpointsChanged=function(e){if(e!==undefined){this.sortedBreakpoints=e.sort((function(e,t){return e-t}))}};e.prototype.connectedCallback=function(){var e=this.el;prepareOverlay(e);this.triggerChanged()};e.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};e.prototype.componentWillLoad=function(){var e=this,t=e.breakpoints,r=e.initialBreakpoint,a=e.el;var n=this.isSheetModal=t!==undefined&&r!==undefined;this.inheritedAttributes=inheritAttributes(a,["aria-label","role"]);if(n){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&r!==undefined&&!t.includes(r)){printIonWarning("Your breakpoints array must include the initialBreakpoint value.")}setOverlayId(a)};e.prototype.componentDidLoad=function(){var e=this;if(this.isOpen===true){raf((function(){return e.present()}))}this.breakpointsChanged(this.breakpoints)};e.prototype.getDelegate=function(e){if(e===void 0){e=false}if(this.workingDelegate&&!e){return{delegate:this.workingDelegate,inline:this.inline}}var t=this.el.parentNode;var r=this.inline=t!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};e.prototype.checkCanDismiss=function(e,t){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(e,t)]}return[2,r]}))}))};e.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,a,n,i,o,s,d,l;var c=this;return __generator(this,(function(p){switch(p.label){case 0:return[4,this.lockController.lock()];case 1:e=p.sent();if(this.presented){e();return[2]}t=this,r=t.presentingElement,a=t.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=p.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:p.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:p.sent();p.label=6;case 6:writeTask((function(){return c.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=p.sent();setCardStatusBarDark();p.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 9:p.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(c.gesture){c.gesture.enable(false);raf((function(){if(c.gesture){c.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}e();return[2]}}))}))};e.prototype.initSwipeToClose=function(){var e=this;var t;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});var i=findIonContent(r);if(!i){printIonContentErrorMsg(r);return}var o=(t=this.statusBarStyle)!==null&&t!==void 0?t:Style.Default;this.gesture=createSwipeToCloseGesture(r,n,o,(function(){e.gestureAnimationDismissing=true;setCardStatusBarDefault(e.statusBarStyle);e.animation.onFinish((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:e.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};e.prototype.initSheetGesture=function(){var e=this;var t=this,r=t.wrapperEl,a=t.initialBreakpoint,n=t.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});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,n,o,this.sortedBreakpoints,(function(){var t;return(t=e.currentBreakpoint)!==null&&t!==void 0?t:0}),(function(){return e.sheetOnDismiss()}),(function(t){if(e.currentBreakpoint!==t){e.currentBreakpoint=t;e.ionBreakpointDidChange.emit({breakpoint:t})}})),d=s.gesture,l=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=l;this.gesture.enable(true)};e.prototype.sheetOnDismiss=function(){var e=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:e.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};e.prototype.dismiss=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,d,l;var c=this;return __generator(this,(function(p){switch(p.label){case 0:if(this.gestureAnimationDismissing&&t!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=p.sent();n=t!=="handler";if(!n)return[3,3];return[4,this.checkCanDismiss(e,t)];case 2:n=!p.sent();p.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}s=activeAnimations.get(this)||[];return[4,dismiss(this,e,t,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:i,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 4:d=p.sent();if(!d)return[3,6];l=this.getDelegate().delegate;return[4,detachComponent(l,this.usersElement)];case 5:p.sent();writeTask((function(){return c.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}s.forEach((function(e){return e.destroy()}));p.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,d]}}))}))};e.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};e.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};e.prototype.setCurrentBreakpoint=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(e)){printIonWarning("Attempted to set invalid breakpoint value ".concat(e,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}t=this,r=t.currentBreakpoint,a=t.moveSheetToBreakpoint,n=t.canDismiss,i=t.breakpoints,o=t.animated;if(r===e){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:e,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]}}))}))};e.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.currentBreakpoint]}))}))};e.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:e=this,t=e.breakpoints,r=e.currentBreakpoint;if(!t||r==null){return[2,false]}a=t.filter((function(e){return e!==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]}}))}))};e.prototype.render=function(){var e;var t=this;var r=this,a=r.handle,n=r.isSheetModal,i=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes;var l=a!==false&&n;var c=getIonMode(this);var p=i!==undefined&&c==="ios";var u=s==="cycle";return h(Host,Object.assign({"no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((e={},e[c]=true,e["modal-default"]=!p&&!n,e["modal-card"]=p,e["modal-sheet"]=n,e["overlay-hidden"]=true,e),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{ref:function(e){return t.backdropEl=e},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),c==="ios"&&h("div",{class:"modal-shadow"}),h("div",Object.assign({role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(e){return t.wrapperEl=e}}),l&&h("button",{class:"modal-handle",tabIndex:!u?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:u?this.onHandleClick:undefined,part:"handle"}),h("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return e}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:modalIosCss,md:modalMdCss};export{Modal as ion_modal};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,w as writeTask,h,H as Host,f as getElement}from"./index-2d388930.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-746a238e.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-aa433dea.js";import{g as getElementRoot,l as clamp,r as raf,k as inheritAttributes,m as hasLazyBuild}from"./helpers-3379ba19.js";import{c as createLockController}from"./lock-controller-e8c6c051.js";import{p as printIonWarning}from"./index-595d62c9.js";import{g as getCapacitor}from"./capacitor-b4979570.js";import{G as GESTURE,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,n as activeAnimations,g as dismiss,h as eventMethod}from"./overlays-e064e499.js";import{g as getClassMap}from"./theme-17531cdf.js";import{e as deepReady,w as waitForMount}from"./index-dac72b4c.js";import{b as getIonMode,c as config}from"./ionic-global-b3fc28dd.js";import{KEYBOARD_DID_OPEN}from"./keyboard-b551279d.js";import{c as createAnimation}from"./animation-a1d9e088.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{createGesture}from"./index-ff313b19.js";import{w as win}from"./index-7a14ecec.js";import"./hardware-back-button-39299f84.js";import"./keyboard-b063f012.js";import"./gesture-controller-0fa396c4.js";var Style;(function(e){e["Dark"]="DARK";e["Light"]="LIGHT";e["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var e=getCapacitor();if(e===null||e===void 0?void 0:e.isPluginAvailable("StatusBar")){return e.Plugins.StatusBar}return undefined},supportsDefaultStatusBarStyle:function(){var e=getCapacitor();return!!(e===null||e===void 0?void 0:e.PluginHeaders)},setStyle:function(e){var t=this.getEngine();if(!t){return}t.setStyle(e)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=this.getEngine();if(!e){return[2,Style.Default]}return[4,e.getInfo()];case 1:t=r.sent().style;return[2,t]}}))}))}};var getBackdropValueForSheet=function(e,t){if(t===1){return 0}var r=1/(1-t);var a=-(t*r);return e*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(e){if(e===void 0){e=Style.Default}if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:e})};var handleCanDismiss=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof e.canDismiss!=="function"){return[2]}return[4,e.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(t.isRunning()){t.onFinish((function(){e.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{e.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(e){return.00255275*Math.pow(2.71828,-14.9619*e)-1.00255*Math.pow(2.71828,-.0380968*e)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.93};var createSwipeToCloseGesture=function(e,t,r,a){var n=.5;var i=e.offsetHeight;var o=false;var s=false;var d=null;var l=null;var c=.2;var p=true;var u=0;var f=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var h=function(e){var t=e.event.target;if(t===null||!t.closest){return true}d=findClosestIonContent(t);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=t.closest("ion-footer");if(n===null){return true}return false};var m=function(r){var a=r.deltaY;p=f();s=e.canDismiss!==undefined&&e.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}t.progressStart(true,o?1:0)};var v=function(e){var a=e.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=e.deltaY/i;var l=o>=0&&s;var p=l?c:.9999;var f=l?calculateSpringStep(o/p):o;var h=clamp(1e-4,f,p);t.progressStep(h);if(h>=n&&u<n){setCardStatusBarDefault(r)}else if(h<n&&u>=n){setCardStatusBarDark()}u=h};var b=function(r){var l=r.velocityY;var u=r.deltaY/i;var f=u>=0&&s;var h=f?c:.9999;var m=f?calculateSpringStep(u/h):u;var v=clamp(1e-4,m,h);var b=(r.deltaY+l*1e3)/i;var y=!f&&b>=n;var k=y?-.001:.001;if(!y){t.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],v)[0]}else{t.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],v)[0]}var w=y?computeDuration(u*i,l):computeDuration((1-v)*i,l);o=y;g.enable(false);if(d){resetContentScrollY(d,p)}t.onFinish((function(){if(!y){g.enable(true)}})).progressEnd(y?1:0,k,w);if(f&&v>h/4){handleCanDismiss(e,t)}else if(y){a()}};var g=createGesture({el:e,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:h,onStart:m,onMove:v,onEnd:b});return g};var computeDuration=function(e,t){return clamp(400,e/Math.abs(t*1.1),500)};var createSheetEnterAnimation=function(e){var t=e.currentBreakpoint,r=e.backdropBreakpoint;var a=r===undefined||r<t;var n=a?"calc(var(--backdrop-opacity) * ".concat(t,")"):"0";var i=createAnimation("backdropAnimation").fromTo("opacity",0,n);if(a){i.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var o=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-t*100,"%)")}]);return{wrapperAnimation:o,backdropAnimation:i}};var createSheetLeaveAnimation=function(e){var t=e.currentBreakpoint,r=e.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(t,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-t*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var e=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var t=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:e,wrapperAnimation:t}};var iosEnterAnimation=function(e,t){var r=t.presentingEl,a=t.currentBreakpoint;var n=getElementRoot(e);var i=a!==undefined?createSheetEnterAnimation(t):createEnterAnimation$1(),o=i.wrapperAnimation,s=i.backdropAnimation;s.addElement(n.querySelector("ion-backdrop"));o.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var d=createAnimation("entering-base").addElement(e).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(o);if(r){var l=window.innerWidth<768;var c=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var p=getElementRoot(r);var u=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var f=document.body;if(l){var h=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var m=c?"-10px":h;var v=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var b="translateY(".concat(m,") scale(").concat(v,")");u.afterStyles({transform:b}).beforeAddWrite((function(){return f.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:b,borderRadius:"10px 10px 0 0"}]);d.addAnimation(u)}else{d.addAnimation(s);if(!c){o.fromTo("opacity","0","1")}else{var v=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var b="translateY(-10px) scale(".concat(v,")");u.afterStyles({transform:b}).addElement(p.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:b}]);var g=createAnimation().afterStyles({transform:b}).addElement(p.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:b}]);d.addAnimation([u,g])}}}else{d.addAnimation(s)}return d};var createLeaveAnimation$1=function(){var e=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var t=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:e,wrapperAnimation:t}};var iosLeaveAnimation=function(e,t,r){if(r===void 0){r=500}var a=t.presentingEl,n=t.currentBreakpoint;var i=getElementRoot(e);var o=n!==undefined?createSheetLeaveAnimation(t):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(e).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(s);if(a){var c=window.innerWidth<768;var p=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var f=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(e){if(e!==1){return}a.style.setProperty("overflow","");var t=Array.from(h.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(e){return e.presentingElement!==undefined})).length;if(t<=1){h.style.setProperty("background-color","")}}));var h=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var v=p?"-10px":m;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var g="translateY(".concat(v,") scale(").concat(b,")");f.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(f)}else{l.addAnimation(d);if(!p){s.fromTo("opacity","1","0")}else{var b=p?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var g="translateY(-10px) scale(".concat(b,")");f.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 y=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([f,y])}}}else{l.addAnimation(d)}return l};var createEnterAnimation=function(){var e=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var t=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:e,wrapperAnimation:t}};var mdEnterAnimation=function(e,t){var r=t.currentBreakpoint;var a=getElementRoot(e);var n=r!==undefined?createSheetEnterAnimation(t):createEnterAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));return createAnimation().addElement(e).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([o,i])};var createLeaveAnimation=function(){var e=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var t=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:e,wrapperAnimation:t}};var mdLeaveAnimation=function(e,t){var r=t.currentBreakpoint;var a=getElementRoot(e);var n=r!==undefined?createSheetLeaveAnimation(t):createLeaveAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));return createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,i])};var createSheetGesture=function(e,t,r,a,n,i,o,s,d,l){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var p=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-n,opacity:0},{offset:1,opacity:0}];var u={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:n!==0?p:c};var f=e.querySelector("ion-content");var h=r.clientHeight;var m=a;var v=0;var b=false;var g=.95;var y=i.childAnimations.find((function(e){return e.id==="wrapperAnimation"}));var k=i.childAnimations.find((function(e){return e.id==="backdropAnimation"}));var w=o[o.length-1];var x=o[0];var S=function(){e.style.setProperty("pointer-events","auto");t.style.setProperty("pointer-events","auto");e.classList.remove("ion-disable-focus-trap")};var A=function(){e.style.setProperty("pointer-events","none");t.style.setProperty("pointer-events","none");e.classList.add("ion-disable-focus-trap")};if(y&&k){y.keyframes(__spreadArray([],u.WRAPPER_KEYFRAMES,true));k.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));i.progressStart(true,1-m);var E=m>n;if(E){S()}else{A()}}if(f&&m!==w){f.scrollY=false}var C=function(e){var t=e.event.target.closest("ion-content");m=s();if(m===1&&t){return false}return true};var D=function(){b=e.canDismiss!==undefined&&e.canDismiss!==true&&x===0;if(f){f.scrollY=false}raf((function(){e.focus()}));i.progressStart(true,1-m)};var B=function(e){var t=1-m;var r=o.length>1?1-o[1]:undefined;var a=t+e.deltaY/h;var n=r!==undefined&&a>=r&&b;var s=n?g:.9999;var d=n&&r!==undefined?r+calculateSpringStep((a-r)/(s-r)):a;v=clamp(1e-4,d,s);i.progressStep(v)};var _=function(e){var t=e.velocityY;var r=(e.deltaY+t*350)/h;var a=m-r;var n=o.reduce((function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e}));M({breakpoint:n,breakpointOffset:v,canDismiss:b,animated:true})};var M=function(t){var r=t.breakpoint,a=t.canDismiss,s=t.breakpointOffset,c=t.animated;var p=a&&r===0;var h=p?m:r;var v=h!==0;m=0;if(y&&k){y.keyframes([{offset:0,transform:"translateY(".concat(s*100,"%)")},{offset:1,transform:"translateY(".concat((1-h)*100,"%)")}]);k.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-s,n),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(h,n),")")}]);i.progressStep(0)}Y.enable(false);if(p){handleCanDismiss(e,i)}else if(!v){d()}return new Promise((function(e){i.onFinish((function(){if(v){if(y&&k){raf((function(){y.keyframes(__spreadArray([],u.WRAPPER_KEYFRAMES,true));k.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));i.progressStart(true,1-h);m=h;l(m);if(f&&m===o[o.length-1]){f.scrollY=true}var t=m>n;if(t){S()}else{A()}Y.enable(true);e()}))}else{Y.enable(true);e()}}else{e()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var Y=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:D,onMove:B,onEnd:_});return{gesture:Y,moveSheetToBreakpoint:M}};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, #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{--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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-card) .modal-wrapper:dir(rtl){border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-sheet) .modal-wrapper:dir(rtl){border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}}';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, #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{--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 Modal=function(){function e(e){var t=this;registerInstance(this,e);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 e=t,r=e.sheetTransition,a=e.handleBehavior;if(a!=="cycle"||r!==undefined){return}t.moveToNextBreakpoint()};this.onBackdropTap=function(){var e=t.sheetTransition;if(e!==undefined){return}t.dismiss(undefined,BACKDROP)};this.onLifecycle=function(e){var r=t.usersElement;var a=LIFECYCLE_MAP[e.type];if(r&&a){var n=new CustomEvent(a,{bubbles:false,cancelable:false,detail:e.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.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.canDismiss=true}e.prototype.onIsOpenChange=function(e,t){if(e===true&&t===false){this.present()}else if(e===false&&t===true){this.dismiss()}};e.prototype.triggerChanged=function(){var e=this,t=e.trigger,r=e.el,a=e.triggerController;if(t){a.addClickListener(r,t)}};e.prototype.breakpointsChanged=function(e){if(e!==undefined){this.sortedBreakpoints=e.sort((function(e,t){return e-t}))}};e.prototype.connectedCallback=function(){var e=this.el;prepareOverlay(e);this.triggerChanged()};e.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};e.prototype.componentWillLoad=function(){var e=this,t=e.breakpoints,r=e.initialBreakpoint,a=e.el;var n=this.isSheetModal=t!==undefined&&r!==undefined;this.inheritedAttributes=inheritAttributes(a,["aria-label","role"]);if(n){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&r!==undefined&&!t.includes(r)){printIonWarning("Your breakpoints array must include the initialBreakpoint value.")}setOverlayId(a)};e.prototype.componentDidLoad=function(){var e=this;if(this.isOpen===true){raf((function(){return e.present()}))}this.breakpointsChanged(this.breakpoints)};e.prototype.getDelegate=function(e){if(e===void 0){e=false}if(this.workingDelegate&&!e){return{delegate:this.workingDelegate,inline:this.inline}}var t=this.el.parentNode;var r=this.inline=t!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};e.prototype.checkCanDismiss=function(e,t){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(e,t)]}return[2,r]}))}))};e.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,a,n,i,o,s,d,l;var c=this;return __generator(this,(function(p){switch(p.label){case 0:return[4,this.lockController.lock()];case 1:e=p.sent();if(this.presented){e();return[2]}t=this,r=t.presentingElement,a=t.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=p.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:p.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:p.sent();p.label=6;case 6:writeTask((function(){return c.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=p.sent();setCardStatusBarDark();p.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 9:p.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(c.gesture){c.gesture.enable(false);raf((function(){if(c.gesture){c.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}e();return[2]}}))}))};e.prototype.initSwipeToClose=function(){var e=this;var t;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});var i=findIonContent(r);if(!i){printIonContentErrorMsg(r);return}var o=(t=this.statusBarStyle)!==null&&t!==void 0?t:Style.Default;this.gesture=createSwipeToCloseGesture(r,n,o,(function(){e.gestureAnimationDismissing=true;setCardStatusBarDefault(e.statusBarStyle);e.animation.onFinish((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:e.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};e.prototype.initSheetGesture=function(){var e=this;var t=this,r=t.wrapperEl,a=t.initialBreakpoint,n=t.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});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,n,o,this.sortedBreakpoints,(function(){var t;return(t=e.currentBreakpoint)!==null&&t!==void 0?t:0}),(function(){return e.sheetOnDismiss()}),(function(t){if(e.currentBreakpoint!==t){e.currentBreakpoint=t;e.ionBreakpointDidChange.emit({breakpoint:t})}})),d=s.gesture,l=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=l;this.gesture.enable(true)};e.prototype.sheetOnDismiss=function(){var e=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:e.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};e.prototype.dismiss=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,d,l;var c=this;return __generator(this,(function(p){switch(p.label){case 0:if(this.gestureAnimationDismissing&&t!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=p.sent();n=t!=="handler";if(!n)return[3,3];return[4,this.checkCanDismiss(e,t)];case 2:n=!p.sent();p.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}s=activeAnimations.get(this)||[];return[4,dismiss(this,e,t,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:i,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 4:d=p.sent();if(!d)return[3,6];l=this.getDelegate().delegate;return[4,detachComponent(l,this.usersElement)];case 5:p.sent();writeTask((function(){return c.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}s.forEach((function(e){return e.destroy()}));p.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,d]}}))}))};e.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};e.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};e.prototype.setCurrentBreakpoint=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(e)){printIonWarning("Attempted to set invalid breakpoint value ".concat(e,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}t=this,r=t.currentBreakpoint,a=t.moveSheetToBreakpoint,n=t.canDismiss,i=t.breakpoints,o=t.animated;if(r===e){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:e,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]}}))}))};e.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.currentBreakpoint]}))}))};e.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:e=this,t=e.breakpoints,r=e.currentBreakpoint;if(!t||r==null){return[2,false]}a=t.filter((function(e){return e!==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]}}))}))};e.prototype.render=function(){var e;var t=this;var r=this,a=r.handle,n=r.isSheetModal,i=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes;var l=a!==false&&n;var c=getIonMode(this);var p=i!==undefined&&c==="ios";var u=s==="cycle";return h(Host,Object.assign({"no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((e={},e[c]=true,e["modal-default"]=!p&&!n,e["modal-card"]=p,e["modal-sheet"]=n,e["overlay-hidden"]=true,e),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{ref:function(e){return t.backdropEl=e},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),c==="ios"&&h("div",{class:"modal-shadow"}),h("div",Object.assign({role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(e){return t.wrapperEl=e}}),l&&h("button",{class:"modal-handle",tabIndex:!u?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:u?this.onHandleClick:undefined,part:"handle"}),h("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return e}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:modalIosCss,md:modalMdCss};export{Modal as ion_modal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,d as createEvent,h,f as getElement,H as Host}from"./index-2d388930.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{o as assert,s as shallowEqualStringMap}from"./helpers-3379ba19.js";import{l as lifecycle,t as transition,s as setPageHidden,d as LIFECYCLE_WILL_UNLOAD,b as LIFECYCLE_WILL_LEAVE,c as LIFECYCLE_DID_LEAVE}from"./index-87684bba.js";import{b as getIonMode,c as config}from"./ionic-global-b3fc28dd.js";import{a as attachComponent}from"./framework-delegate-aa433dea.js";var VIEW_STATE_NEW=1;var VIEW_STATE_ATTACHED=2;var VIEW_STATE_DESTROYED=3;var ViewController=function(){function e(e,t){this.component=e;this.params=t;this.state=VIEW_STATE_NEW}e.prototype.init=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:this.state=VIEW_STATE_ATTACHED;if(!!this.element)return[3,2];t=this.component;n=this;return[4,attachComponent(this.delegate,e,t,["ion-page","ion-page-invisible"],this.params)];case 1:n.element=i.sent();i.label=2;case 2:return[2]}}))}))};e.prototype._destroy=function(){assert(this.state!==VIEW_STATE_DESTROYED,"view state must be ATTACHED");var e=this.element;if(e){if(this.delegate){this.delegate.removeViewFromDom(e.parentElement,e)}else{e.remove()}}this.nav=undefined;this.state=VIEW_STATE_DESTROYED};return e}();var matches=function(e,t,n){if(!e){return false}if(e.component!==t){return false}return shallowEqualStringMap(e.params,n)};var convertToView=function(e,t){if(!e){return null}if(e instanceof ViewController){return e}return new ViewController(e,t)};var convertToViews=function(e){return e.map((function(e){if(e instanceof ViewController){return e}if("component"in e){return convertToView(e.component,e.componentProps===null?undefined:e.componentProps)}return convertToView(e,undefined)})).filter((function(e){return e!==null}))};var navCss=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}";var Nav=function(){function e(e){registerInstance(this,e);this.ionNavWillLoad=createEvent(this,"ionNavWillLoad",7);this.ionNavWillChange=createEvent(this,"ionNavWillChange",3);this.ionNavDidChange=createEvent(this,"ionNavDidChange",3);this.transInstr=[];this.gestureOrAnimationInProgress=false;this.useRouter=false;this.isTransitioning=false;this.destroyed=false;this.views=[];this.didLoad=false;this.delegate=undefined;this.swipeGesture=undefined;this.animated=true;this.animation=undefined;this.rootParams=undefined;this.root=undefined}e.prototype.swipeGestureChanged=function(){if(this.gesture){this.gesture.enable(this.swipeGesture===true)}};e.prototype.rootChanged=function(){if(this.root===undefined){return}if(this.didLoad===false){return}if(!this.useRouter){if(this.root!==undefined){this.setRoot(this.root,this.rootParams)}}};e.prototype.componentWillLoad=function(){this.useRouter=document.querySelector("ion-router")!==null&&this.el.closest("[no-router]")===null;if(this.swipeGesture===undefined){var e=getIonMode(this);this.swipeGesture=config.getBoolean("swipeBackEnabled",e==="ios")}this.ionNavWillLoad.emit()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.didLoad=true;this.rootChanged();e=this;return[4,import("./swipe-back-6d4c0a4e.js")];case 1:e.gesture=t.sent().createSwipeBackGesture(this.el,this.canStart.bind(this),this.onStart.bind(this),this.onMove.bind(this),this.onEnd.bind(this));this.swipeGestureChanged();return[2]}}))}))};e.prototype.connectedCallback=function(){this.destroyed=false};e.prototype.disconnectedCallback=function(){for(var e=0,t=this.views;e<t.length;e++){var n=t[e];lifecycle(n.element,LIFECYCLE_WILL_UNLOAD);n._destroy()}if(this.gesture){this.gesture.destroy();this.gesture=undefined}this.transInstr.length=0;this.views.length=0;this.destroyed=true};e.prototype.push=function(e,t,n,i){return this.insert(-1,e,t,n,i)};e.prototype.insert=function(e,t,n,i,r){return this.insertPages(e,[{component:t,componentProps:n}],i,r)};e.prototype.insertPages=function(e,t,n,i){return this.queueTrns({insertStart:e,insertViews:t,opts:n},i)};e.prototype.pop=function(e,t){return this.removeIndex(-1,1,e,t)};e.prototype.popTo=function(e,t,n){var i={removeStart:-1,removeCount:-1,opts:t};if(typeof e==="object"&&e.component){i.removeView=e;i.removeStart=1}else if(typeof e==="number"){i.removeStart=e+1}return this.queueTrns(i,n)};e.prototype.popToRoot=function(e,t){return this.removeIndex(1,-1,e,t)};e.prototype.removeIndex=function(e,t,n,i){if(t===void 0){t=1}return this.queueTrns({removeStart:e,removeCount:t,opts:n},i)};e.prototype.setRoot=function(e,t,n,i){return this.setPages([{component:e,componentProps:t}],n,i)};e.prototype.setPages=function(e,t,n){t!==null&&t!==void 0?t:t={};if(t.animated!==true){t.animated=false}return this.queueTrns({insertStart:0,insertViews:e,removeStart:0,removeCount:-1,opts:t},n)};e.prototype.setRouteId=function(e,t,n,i){var r=this;var o=this.getActiveSync();if(matches(o,e,t)){return Promise.resolve({changed:false,element:o.element})}var s;var a=new Promise((function(e){return s=e}));var u;var c={updateURL:false,viewIsReady:function(e){var t;var n=new Promise((function(e){return t=e}));s({changed:true,element:e,markVisible:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:t();return[4,u];case 1:e.sent();return[2]}}))}))}});return n}};if(n==="root"){u=this.setRoot(e,t,c)}else{var f=this.views.find((function(n){return matches(n,e,t)}));if(f){u=this.popTo(f,Object.assign(Object.assign({},c),{direction:"back",animationBuilder:i}))}else if(n==="forward"){u=this.push(e,t,Object.assign(Object.assign({},c),{animationBuilder:i}))}else if(n==="back"){u=this.setRoot(e,t,Object.assign(Object.assign({},c),{direction:"back",animated:true,animationBuilder:i}))}}return a};e.prototype.getRouteId=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.getActiveSync();if(e){return[2,{id:e.element.tagName,params:e.params,element:e.element}]}return[2,undefined]}))}))};e.prototype.getActive=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.getActiveSync()]}))}))};e.prototype.getByIndex=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.views[e]]}))}))};e.prototype.canGoBack=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.canGoBackSync(e)]}))}))};e.prototype.getPrevious=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.getPreviousSync(e)]}))}))};e.prototype.getLength=function(){return this.views.length};e.prototype.getActiveSync=function(){return this.views[this.views.length-1]};e.prototype.canGoBackSync=function(e){if(e===void 0){e=this.getActiveSync()}return!!(e&&this.getPreviousSync(e))};e.prototype.getPreviousSync=function(e){if(e===void 0){e=this.getActiveSync()}if(!e){return undefined}var t=this.views;var n=t.indexOf(e);return n>0?t[n-1]:undefined};e.prototype.queueTrns=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,s;return __generator(this,(function(a){switch(a.label){case 0:if(this.isTransitioning&&((n=e.opts)===null||n===void 0?void 0:n.skipIfBusy)){return[2,false]}r=new Promise((function(t,n){e.resolve=t;e.reject=n}));e.done=t;if(!(e.opts&&e.opts.updateURL!==false&&this.useRouter))return[3,2];o=document.querySelector("ion-router");if(!o)return[3,2];return[4,o.canTransition()];case 1:s=a.sent();if(s===false){return[2,false]}if(typeof s==="string"){o.push(s,e.opts.direction||"back");return[2,false]}a.label=2;case 2:if(((i=e.insertViews)===null||i===void 0?void 0:i.length)===0){e.insertViews=undefined}this.transInstr.push(e);this.nextTrns();return[2,r]}}))}))};e.prototype.success=function(e,t){if(this.destroyed){this.fireError("nav controller was destroyed",t);return}if(t.done){t.done(e.hasCompleted,e.requiresTransition,e.enteringView,e.leavingView,e.direction)}t.resolve(e.hasCompleted);if(t.opts.updateURL!==false&&this.useRouter){var n=document.querySelector("ion-router");if(n){var i=e.direction==="back"?"back":"forward";n.navChanged(i)}}};e.prototype.failed=function(e,t){if(this.destroyed){this.fireError("nav controller was destroyed",t);return}this.transInstr.length=0;this.fireError(e,t)};e.prototype.fireError=function(e,t){if(t.done){t.done(false,false,e)}if(t.reject&&!this.destroyed){t.reject(e)}else{t.resolve(false)}};e.prototype.nextTrns=function(){if(this.isTransitioning){return false}var e=this.transInstr.shift();if(!e){return false}this.runTransition(e);return true};e.prototype.runTransition=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i,r,o,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);this.ionNavWillChange.emit();this.isTransitioning=true;this.prepareTI(e);t=this.getActiveSync();n=this.getEnteringView(e,t);if(!t&&!n){throw new Error("no views in the stack to be removed")}if(!(n&&n.state===VIEW_STATE_NEW))return[3,2];return[4,n.init(this.el)];case 1:a.sent();a.label=2;case 2:this.postViewInit(n,t,e);i=(e.enteringRequiresTransition||e.leavingRequiresTransition)&&n!==t;if(i&&e.opts&&t){r=e.opts.direction==="back";if(r){e.opts.animationBuilder=e.opts.animationBuilder||(n===null||n===void 0?void 0:n.animationBuilder)}t.animationBuilder=e.opts.animationBuilder}o=void 0;if(!i)return[3,4];return[4,this.transition(n,t,e)];case 3:o=a.sent();return[3,5];case 4:o={hasCompleted:true,requiresTransition:false};a.label=5;case 5:this.success(o,e);this.ionNavDidChange.emit();return[3,7];case 6:s=a.sent();this.failed(s,e);return[3,7];case 7:this.isTransitioning=false;this.nextTrns();return[2]}}))}))};e.prototype.prepareTI=function(e){var t,n;var i;var r=this.views.length;(t=e.opts)!==null&&t!==void 0?t:e.opts={};(n=(i=e.opts).delegate)!==null&&n!==void 0?n:i.delegate=this.delegate;if(e.removeView!==undefined){assert(e.removeStart!==undefined,"removeView needs removeStart");assert(e.removeCount!==undefined,"removeView needs removeCount");var o=this.views.indexOf(e.removeView);if(o<0){throw new Error("removeView was not found")}e.removeStart+=o}if(e.removeStart!==undefined){if(e.removeStart<0){e.removeStart=r-1}if(e.removeCount<0){e.removeCount=r-e.removeStart}e.leavingRequiresTransition=e.removeCount>0&&e.removeStart+e.removeCount===r}if(e.insertViews){if(e.insertStart<0||e.insertStart>r){e.insertStart=r}e.enteringRequiresTransition=e.insertStart===r}var s=e.insertViews;if(!s){return}assert(s.length>0,"length can not be zero");var a=convertToViews(s);if(a.length===0){throw new Error("invalid views to insert")}for(var u=0,c=a;u<c.length;u++){var f=c[u];f.delegate=e.opts.delegate;var l=f.nav;if(l&&l!==this){throw new Error("inserted view was already inserted")}if(f.state===VIEW_STATE_DESTROYED){throw new Error("inserted view was already destroyed")}}e.insertViews=a};e.prototype.getEnteringView=function(e,t){var n=e.insertViews;if(n!==undefined){return n[n.length-1]}var i=e.removeStart;if(i!==undefined){var r=this.views;var o=i+e.removeCount;for(var s=r.length-1;s>=0;s--){var a=r[s];if((s<i||s>=o)&&a!==t){return a}}}return undefined};e.prototype.postViewInit=function(e,t,n){var i,r,o;assert(t||e,"Both leavingView and enteringView are null");assert(n.resolve,"resolve must be valid");assert(n.reject,"reject must be valid");var s=n.opts;var a=n.insertViews,u=n.removeStart,c=n.removeCount;var f;if(u!==undefined&&c!==undefined){assert(u>=0,"removeStart can not be negative");assert(c>=0,"removeCount can not be negative");f=[];for(var l=u;l<u+c;l++){var d=this.views[l];if(d!==undefined&&d!==e&&d!==t){f.push(d)}}(i=s.direction)!==null&&i!==void 0?i:s.direction="back"}var h=this.views.length+((r=a===null||a===void 0?void 0:a.length)!==null&&r!==void 0?r:0)-(c!==null&&c!==void 0?c:0);assert(h>=0,"final balance can not be negative");if(h===0){console.warn("You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.",this,this.el);throw new Error("navigation stack needs at least one root page")}if(a){var v=n.insertStart;for(var p=0,g=a;p<g.length;p++){var d=g[p];this.insertViewAt(d,v);v++}if(n.enteringRequiresTransition){(o=s.direction)!==null&&o!==void 0?o:s.direction="forward"}}if(f&&f.length>0){for(var m=0,w=f;m<w.length;m++){var d=w[m];lifecycle(d.element,LIFECYCLE_WILL_LEAVE);lifecycle(d.element,LIFECYCLE_DID_LEAVE);lifecycle(d.element,LIFECYCLE_WILL_UNLOAD)}for(var y=0,E=f;y<E.length;y++){var d=E[y];this.destroyView(d)}}};e.prototype.transition=function(e,t,n){return __awaiter(this,void 0,void 0,(function(){var i,r,o,s,a,u,c;var f=this;return __generator(this,(function(l){switch(l.label){case 0:i=n.opts;r=i.progressAnimation?function(e){if(e!==undefined&&!f.gestureOrAnimationInProgress){f.gestureOrAnimationInProgress=true;e.onFinish((function(){f.gestureOrAnimationInProgress=false}),{oneTimeCallback:true});e.progressEnd(0,0,0)}else{f.sbAni=e}}:undefined;o=getIonMode(this);s=e.element;a=t&&t.element;u=Object.assign(Object.assign({mode:o,showGoBack:this.canGoBackSync(e),baseEl:this.el,progressCallback:r,animated:this.animated&&config.getBoolean("animated",true),enteringEl:s,leavingEl:a},i),{animationBuilder:i.animationBuilder||this.animation||config.get("navAnimation")});return[4,transition(u)];case 1:c=l.sent().hasCompleted;return[2,this.transitionFinish(c,e,t,i)]}}))}))};e.prototype.transitionFinish=function(e,t,n,i){var r=e?t:n;if(r){this.unmountInactiveViews(r)}return{hasCompleted:e,requiresTransition:true,enteringView:t,leavingView:n,direction:i.direction}};e.prototype.insertViewAt=function(e,t){var n=this.views;var i=n.indexOf(e);if(i>-1){assert(e.nav===this,"view is not part of the nav");n.splice(i,1);n.splice(t,0,e)}else{assert(!e.nav,"nav is used");e.nav=this;n.splice(t,0,e)}};e.prototype.removeView=function(e){assert(e.state===VIEW_STATE_ATTACHED||e.state===VIEW_STATE_DESTROYED,"view state should be loaded or destroyed");var t=this.views;var n=t.indexOf(e);assert(n>-1,"view must be part of the stack");if(n>=0){t.splice(n,1)}};e.prototype.destroyView=function(e){e._destroy();this.removeView(e)};e.prototype.unmountInactiveViews=function(e){if(this.destroyed){return}var t=this.views;var n=t.indexOf(e);for(var i=t.length-1;i>=0;i--){var r=t[i];var o=r.element;if(o){if(i>n){lifecycle(o,LIFECYCLE_WILL_UNLOAD);this.destroyView(r)}else if(i<n){setPageHidden(o,true)}}}};e.prototype.canStart=function(){return!this.gestureOrAnimationInProgress&&!!this.swipeGesture&&!this.isTransitioning&&this.transInstr.length===0&&this.canGoBackSync()};e.prototype.onStart=function(){this.gestureOrAnimationInProgress=true;this.pop({direction:"back",progressAnimation:true})};e.prototype.onMove=function(e){if(this.sbAni){this.sbAni.progressStep(e)}};e.prototype.onEnd=function(e,t,n){var i=this;if(this.sbAni){this.sbAni.onFinish((function(){i.gestureOrAnimationInProgress=false}),{oneTimeCallback:true});var r=e?-.001:.001;if(!e){this.sbAni.easing("cubic-bezier(1, 0, 0.68, 0.28)");r+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],t)[0]}else{r+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],t)[0]}this.sbAni.progressEnd(e?1:0,r,n)}else{this.gestureOrAnimationInProgress=false}};e.prototype.render=function(){return h("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{swipeGesture:["swipeGestureChanged"],root:["rootChanged"]}},enumerable:false,configurable:true});return e}();Nav.style=navCss;var navLink=function(e,t,n,i,r){var o=e.closest("ion-nav");if(o){if(t==="forward"){if(n!==undefined){return o.push(n,i,{skipIfBusy:true,animationBuilder:r})}}else if(t==="root"){if(n!==undefined){return o.setRoot(n,i,{skipIfBusy:true,animationBuilder:r})}}else if(t==="back"){return o.pop({skipIfBusy:true,animationBuilder:r})}}return Promise.resolve(false)};var NavLink=function(){function e(e){var t=this;registerInstance(this,e);this.onClick=function(){return navLink(t.el,t.routerDirection,t.component,t.componentProps,t.routerAnimation)};this.component=undefined;this.componentProps=undefined;this.routerDirection="forward";this.routerAnimation=undefined}e.prototype.render=function(){return h(Host,{onClick:this.onClick})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{Nav as ion_nav,NavLink as ion_nav_link};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,f as getElement,H as Host}from"./index-2d388930.js";import{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";import{o as assert,s as shallowEqualStringMap}from"./helpers-3379ba19.js";import{l as lifecycle,t as transition,s as setPageHidden,d as LIFECYCLE_WILL_UNLOAD,b as LIFECYCLE_WILL_LEAVE,c as LIFECYCLE_DID_LEAVE}from"./index-dac72b4c.js";import{b as getIonMode,c as config}from"./ionic-global-b3fc28dd.js";import{a as attachComponent}from"./framework-delegate-aa433dea.js";var VIEW_STATE_NEW=1;var VIEW_STATE_ATTACHED=2;var VIEW_STATE_DESTROYED=3;var ViewController=function(){function e(e,t){this.component=e;this.params=t;this.state=VIEW_STATE_NEW}e.prototype.init=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:this.state=VIEW_STATE_ATTACHED;if(!!this.element)return[3,2];t=this.component;n=this;return[4,attachComponent(this.delegate,e,t,["ion-page","ion-page-invisible"],this.params)];case 1:n.element=i.sent();i.label=2;case 2:return[2]}}))}))};e.prototype._destroy=function(){assert(this.state!==VIEW_STATE_DESTROYED,"view state must be ATTACHED");var e=this.element;if(e){if(this.delegate){this.delegate.removeViewFromDom(e.parentElement,e)}else{e.remove()}}this.nav=undefined;this.state=VIEW_STATE_DESTROYED};return e}();var matches=function(e,t,n){if(!e){return false}if(e.component!==t){return false}return shallowEqualStringMap(e.params,n)};var convertToView=function(e,t){if(!e){return null}if(e instanceof ViewController){return e}return new ViewController(e,t)};var convertToViews=function(e){return e.map((function(e){if(e instanceof ViewController){return e}if("component"in e){return convertToView(e.component,e.componentProps===null?undefined:e.componentProps)}return convertToView(e,undefined)})).filter((function(e){return e!==null}))};var navCss=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}";var Nav=function(){function e(e){registerInstance(this,e);this.ionNavWillLoad=createEvent(this,"ionNavWillLoad",7);this.ionNavWillChange=createEvent(this,"ionNavWillChange",3);this.ionNavDidChange=createEvent(this,"ionNavDidChange",3);this.transInstr=[];this.gestureOrAnimationInProgress=false;this.useRouter=false;this.isTransitioning=false;this.destroyed=false;this.views=[];this.didLoad=false;this.delegate=undefined;this.swipeGesture=undefined;this.animated=true;this.animation=undefined;this.rootParams=undefined;this.root=undefined}e.prototype.swipeGestureChanged=function(){if(this.gesture){this.gesture.enable(this.swipeGesture===true)}};e.prototype.rootChanged=function(){if(this.root===undefined){return}if(this.didLoad===false){return}if(!this.useRouter){if(this.root!==undefined){this.setRoot(this.root,this.rootParams)}}};e.prototype.componentWillLoad=function(){this.useRouter=document.querySelector("ion-router")!==null&&this.el.closest("[no-router]")===null;if(this.swipeGesture===undefined){var e=getIonMode(this);this.swipeGesture=config.getBoolean("swipeBackEnabled",e==="ios")}this.ionNavWillLoad.emit()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.didLoad=true;this.rootChanged();e=this;return[4,import("./swipe-back-6d4c0a4e.js")];case 1:e.gesture=t.sent().createSwipeBackGesture(this.el,this.canStart.bind(this),this.onStart.bind(this),this.onMove.bind(this),this.onEnd.bind(this));this.swipeGestureChanged();return[2]}}))}))};e.prototype.connectedCallback=function(){this.destroyed=false};e.prototype.disconnectedCallback=function(){for(var e=0,t=this.views;e<t.length;e++){var n=t[e];lifecycle(n.element,LIFECYCLE_WILL_UNLOAD);n._destroy()}if(this.gesture){this.gesture.destroy();this.gesture=undefined}this.transInstr.length=0;this.views.length=0;this.destroyed=true};e.prototype.push=function(e,t,n,i){return this.insert(-1,e,t,n,i)};e.prototype.insert=function(e,t,n,i,r){return this.insertPages(e,[{component:t,componentProps:n}],i,r)};e.prototype.insertPages=function(e,t,n,i){return this.queueTrns({insertStart:e,insertViews:t,opts:n},i)};e.prototype.pop=function(e,t){return this.removeIndex(-1,1,e,t)};e.prototype.popTo=function(e,t,n){var i={removeStart:-1,removeCount:-1,opts:t};if(typeof e==="object"&&e.component){i.removeView=e;i.removeStart=1}else if(typeof e==="number"){i.removeStart=e+1}return this.queueTrns(i,n)};e.prototype.popToRoot=function(e,t){return this.removeIndex(1,-1,e,t)};e.prototype.removeIndex=function(e,t,n,i){if(t===void 0){t=1}return this.queueTrns({removeStart:e,removeCount:t,opts:n},i)};e.prototype.setRoot=function(e,t,n,i){return this.setPages([{component:e,componentProps:t}],n,i)};e.prototype.setPages=function(e,t,n){t!==null&&t!==void 0?t:t={};if(t.animated!==true){t.animated=false}return this.queueTrns({insertStart:0,insertViews:e,removeStart:0,removeCount:-1,opts:t},n)};e.prototype.setRouteId=function(e,t,n,i){var r=this;var o=this.getActiveSync();if(matches(o,e,t)){return Promise.resolve({changed:false,element:o.element})}var s;var a=new Promise((function(e){return s=e}));var u;var c={updateURL:false,viewIsReady:function(e){var t;var n=new Promise((function(e){return t=e}));s({changed:true,element:e,markVisible:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:t();return[4,u];case 1:e.sent();return[2]}}))}))}});return n}};if(n==="root"){u=this.setRoot(e,t,c)}else{var f=this.views.find((function(n){return matches(n,e,t)}));if(f){u=this.popTo(f,Object.assign(Object.assign({},c),{direction:"back",animationBuilder:i}))}else if(n==="forward"){u=this.push(e,t,Object.assign(Object.assign({},c),{animationBuilder:i}))}else if(n==="back"){u=this.setRoot(e,t,Object.assign(Object.assign({},c),{direction:"back",animated:true,animationBuilder:i}))}}return a};e.prototype.getRouteId=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.getActiveSync();if(e){return[2,{id:e.element.tagName,params:e.params,element:e.element}]}return[2,undefined]}))}))};e.prototype.getActive=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.getActiveSync()]}))}))};e.prototype.getByIndex=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.views[e]]}))}))};e.prototype.canGoBack=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.canGoBackSync(e)]}))}))};e.prototype.getPrevious=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.getPreviousSync(e)]}))}))};e.prototype.getLength=function(){return this.views.length};e.prototype.getActiveSync=function(){return this.views[this.views.length-1]};e.prototype.canGoBackSync=function(e){if(e===void 0){e=this.getActiveSync()}return!!(e&&this.getPreviousSync(e))};e.prototype.getPreviousSync=function(e){if(e===void 0){e=this.getActiveSync()}if(!e){return undefined}var t=this.views;var n=t.indexOf(e);return n>0?t[n-1]:undefined};e.prototype.queueTrns=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,i,r,o,s;return __generator(this,(function(a){switch(a.label){case 0:if(this.isTransitioning&&((n=e.opts)===null||n===void 0?void 0:n.skipIfBusy)){return[2,false]}r=new Promise((function(t,n){e.resolve=t;e.reject=n}));e.done=t;if(!(e.opts&&e.opts.updateURL!==false&&this.useRouter))return[3,2];o=document.querySelector("ion-router");if(!o)return[3,2];return[4,o.canTransition()];case 1:s=a.sent();if(s===false){return[2,false]}if(typeof s==="string"){o.push(s,e.opts.direction||"back");return[2,false]}a.label=2;case 2:if(((i=e.insertViews)===null||i===void 0?void 0:i.length)===0){e.insertViews=undefined}this.transInstr.push(e);this.nextTrns();return[2,r]}}))}))};e.prototype.success=function(e,t){if(this.destroyed){this.fireError("nav controller was destroyed",t);return}if(t.done){t.done(e.hasCompleted,e.requiresTransition,e.enteringView,e.leavingView,e.direction)}t.resolve(e.hasCompleted);if(t.opts.updateURL!==false&&this.useRouter){var n=document.querySelector("ion-router");if(n){var i=e.direction==="back"?"back":"forward";n.navChanged(i)}}};e.prototype.failed=function(e,t){if(this.destroyed){this.fireError("nav controller was destroyed",t);return}this.transInstr.length=0;this.fireError(e,t)};e.prototype.fireError=function(e,t){if(t.done){t.done(false,false,e)}if(t.reject&&!this.destroyed){t.reject(e)}else{t.resolve(false)}};e.prototype.nextTrns=function(){if(this.isTransitioning){return false}var e=this.transInstr.shift();if(!e){return false}this.runTransition(e);return true};e.prototype.runTransition=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,i,r,o,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);this.ionNavWillChange.emit();this.isTransitioning=true;this.prepareTI(e);t=this.getActiveSync();n=this.getEnteringView(e,t);if(!t&&!n){throw new Error("no views in the stack to be removed")}if(!(n&&n.state===VIEW_STATE_NEW))return[3,2];return[4,n.init(this.el)];case 1:a.sent();a.label=2;case 2:this.postViewInit(n,t,e);i=(e.enteringRequiresTransition||e.leavingRequiresTransition)&&n!==t;if(i&&e.opts&&t){r=e.opts.direction==="back";if(r){e.opts.animationBuilder=e.opts.animationBuilder||(n===null||n===void 0?void 0:n.animationBuilder)}t.animationBuilder=e.opts.animationBuilder}o=void 0;if(!i)return[3,4];return[4,this.transition(n,t,e)];case 3:o=a.sent();return[3,5];case 4:o={hasCompleted:true,requiresTransition:false};a.label=5;case 5:this.success(o,e);this.ionNavDidChange.emit();return[3,7];case 6:s=a.sent();this.failed(s,e);return[3,7];case 7:this.isTransitioning=false;this.nextTrns();return[2]}}))}))};e.prototype.prepareTI=function(e){var t,n;var i;var r=this.views.length;(t=e.opts)!==null&&t!==void 0?t:e.opts={};(n=(i=e.opts).delegate)!==null&&n!==void 0?n:i.delegate=this.delegate;if(e.removeView!==undefined){assert(e.removeStart!==undefined,"removeView needs removeStart");assert(e.removeCount!==undefined,"removeView needs removeCount");var o=this.views.indexOf(e.removeView);if(o<0){throw new Error("removeView was not found")}e.removeStart+=o}if(e.removeStart!==undefined){if(e.removeStart<0){e.removeStart=r-1}if(e.removeCount<0){e.removeCount=r-e.removeStart}e.leavingRequiresTransition=e.removeCount>0&&e.removeStart+e.removeCount===r}if(e.insertViews){if(e.insertStart<0||e.insertStart>r){e.insertStart=r}e.enteringRequiresTransition=e.insertStart===r}var s=e.insertViews;if(!s){return}assert(s.length>0,"length can not be zero");var a=convertToViews(s);if(a.length===0){throw new Error("invalid views to insert")}for(var u=0,c=a;u<c.length;u++){var f=c[u];f.delegate=e.opts.delegate;var l=f.nav;if(l&&l!==this){throw new Error("inserted view was already inserted")}if(f.state===VIEW_STATE_DESTROYED){throw new Error("inserted view was already destroyed")}}e.insertViews=a};e.prototype.getEnteringView=function(e,t){var n=e.insertViews;if(n!==undefined){return n[n.length-1]}var i=e.removeStart;if(i!==undefined){var r=this.views;var o=i+e.removeCount;for(var s=r.length-1;s>=0;s--){var a=r[s];if((s<i||s>=o)&&a!==t){return a}}}return undefined};e.prototype.postViewInit=function(e,t,n){var i,r,o;assert(t||e,"Both leavingView and enteringView are null");assert(n.resolve,"resolve must be valid");assert(n.reject,"reject must be valid");var s=n.opts;var a=n.insertViews,u=n.removeStart,c=n.removeCount;var f;if(u!==undefined&&c!==undefined){assert(u>=0,"removeStart can not be negative");assert(c>=0,"removeCount can not be negative");f=[];for(var l=u;l<u+c;l++){var d=this.views[l];if(d!==undefined&&d!==e&&d!==t){f.push(d)}}(i=s.direction)!==null&&i!==void 0?i:s.direction="back"}var h=this.views.length+((r=a===null||a===void 0?void 0:a.length)!==null&&r!==void 0?r:0)-(c!==null&&c!==void 0?c:0);assert(h>=0,"final balance can not be negative");if(h===0){console.warn("You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.",this,this.el);throw new Error("navigation stack needs at least one root page")}if(a){var v=n.insertStart;for(var p=0,g=a;p<g.length;p++){var d=g[p];this.insertViewAt(d,v);v++}if(n.enteringRequiresTransition){(o=s.direction)!==null&&o!==void 0?o:s.direction="forward"}}if(f&&f.length>0){for(var m=0,w=f;m<w.length;m++){var d=w[m];lifecycle(d.element,LIFECYCLE_WILL_LEAVE);lifecycle(d.element,LIFECYCLE_DID_LEAVE);lifecycle(d.element,LIFECYCLE_WILL_UNLOAD)}for(var y=0,E=f;y<E.length;y++){var d=E[y];this.destroyView(d)}}};e.prototype.transition=function(e,t,n){return __awaiter(this,void 0,void 0,(function(){var i,r,o,s,a,u,c;var f=this;return __generator(this,(function(l){switch(l.label){case 0:i=n.opts;r=i.progressAnimation?function(e){if(e!==undefined&&!f.gestureOrAnimationInProgress){f.gestureOrAnimationInProgress=true;e.onFinish((function(){f.gestureOrAnimationInProgress=false}),{oneTimeCallback:true});e.progressEnd(0,0,0)}else{f.sbAni=e}}:undefined;o=getIonMode(this);s=e.element;a=t&&t.element;u=Object.assign(Object.assign({mode:o,showGoBack:this.canGoBackSync(e),baseEl:this.el,progressCallback:r,animated:this.animated&&config.getBoolean("animated",true),enteringEl:s,leavingEl:a},i),{animationBuilder:i.animationBuilder||this.animation||config.get("navAnimation")});return[4,transition(u)];case 1:c=l.sent().hasCompleted;return[2,this.transitionFinish(c,e,t,i)]}}))}))};e.prototype.transitionFinish=function(e,t,n,i){var r=e?t:n;if(r){this.unmountInactiveViews(r)}return{hasCompleted:e,requiresTransition:true,enteringView:t,leavingView:n,direction:i.direction}};e.prototype.insertViewAt=function(e,t){var n=this.views;var i=n.indexOf(e);if(i>-1){assert(e.nav===this,"view is not part of the nav");n.splice(i,1);n.splice(t,0,e)}else{assert(!e.nav,"nav is used");e.nav=this;n.splice(t,0,e)}};e.prototype.removeView=function(e){assert(e.state===VIEW_STATE_ATTACHED||e.state===VIEW_STATE_DESTROYED,"view state should be loaded or destroyed");var t=this.views;var n=t.indexOf(e);assert(n>-1,"view must be part of the stack");if(n>=0){t.splice(n,1)}};e.prototype.destroyView=function(e){e._destroy();this.removeView(e)};e.prototype.unmountInactiveViews=function(e){if(this.destroyed){return}var t=this.views;var n=t.indexOf(e);for(var i=t.length-1;i>=0;i--){var r=t[i];var o=r.element;if(o){if(i>n){lifecycle(o,LIFECYCLE_WILL_UNLOAD);this.destroyView(r)}else if(i<n){setPageHidden(o,true)}}}};e.prototype.canStart=function(){return!this.gestureOrAnimationInProgress&&!!this.swipeGesture&&!this.isTransitioning&&this.transInstr.length===0&&this.canGoBackSync()};e.prototype.onStart=function(){this.gestureOrAnimationInProgress=true;this.pop({direction:"back",progressAnimation:true})};e.prototype.onMove=function(e){if(this.sbAni){this.sbAni.progressStep(e)}};e.prototype.onEnd=function(e,t,n){var i=this;if(this.sbAni){this.sbAni.onFinish((function(){i.gestureOrAnimationInProgress=false}),{oneTimeCallback:true});var r=e?-.001:.001;if(!e){this.sbAni.easing("cubic-bezier(1, 0, 0.68, 0.28)");r+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],t)[0]}else{r+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],t)[0]}this.sbAni.progressEnd(e?1:0,r,n)}else{this.gestureOrAnimationInProgress=false}};e.prototype.render=function(){return h("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{swipeGesture:["swipeGestureChanged"],root:["rootChanged"]}},enumerable:false,configurable:true});return e}();Nav.style=navCss;var navLink=function(e,t,n,i,r){var o=e.closest("ion-nav");if(o){if(t==="forward"){if(n!==undefined){return o.push(n,i,{skipIfBusy:true,animationBuilder:r})}}else if(t==="root"){if(n!==undefined){return o.setRoot(n,i,{skipIfBusy:true,animationBuilder:r})}}else if(t==="back"){return o.pop({skipIfBusy:true,animationBuilder:r})}}return Promise.resolve(false)};var NavLink=function(){function e(e){var t=this;registerInstance(this,e);this.onClick=function(){return navLink(t.el,t.routerDirection,t.component,t.componentProps,t.routerAnimation)};this.component=undefined;this.componentProps=undefined;this.routerDirection="forward";this.routerAnimation=undefined}e.prototype.render=function(){return h(Host,{onClick:this.onClick})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{Nav as ion_nav,NavLink as ion_nav_link};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{r as raf,g as getElementRoot}from"./helpers-3379ba19.js";import{a as hapticSelectionStart,b as hapticSelectionChanged,h as hapticSelectionEnd}from"./haptic-
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{r as raf,g as getElementRoot}from"./helpers-3379ba19.js";import{a as hapticSelectionStart,b as hapticSelectionChanged,h as hapticSelectionEnd}from"./haptic-1243b917.js";import{a as isPlatform,b as getIonMode}from"./ionic-global-b3fc28dd.js";import{c as createColorClasses}from"./theme-17531cdf.js";import"./capacitor-b4979570.js";import"./index-7a14ecec.js";var pickerColumnInternalIosCss=":host{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;height:200px;outline:none;font-size:22px;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none;text-align:center}:host::-webkit-scrollbar{display:none}:host .picker-item{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;scroll-snap-align:center}:host .picker-item-empty,:host .picker-item.picker-item-disabled{scroll-snap-align:none;cursor:default}:host .picker-item.picker-item-disabled{opacity:0.4}:host(.picker-column-active) .picker-item.picker-item-active{color:var(--ion-color-base)}@media (any-hover: hover){:host(:focus){outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}";var pickerColumnInternalMdCss=":host{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;height:200px;outline:none;font-size:22px;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none;text-align:center}:host::-webkit-scrollbar{display:none}:host .picker-item{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;scroll-snap-align:center}:host .picker-item-empty,:host .picker-item.picker-item-disabled{scroll-snap-align:none;cursor:default}:host .picker-item.picker-item-disabled{opacity:0.4}:host(.picker-column-active) .picker-item.picker-item-active{color:var(--ion-color-base)}@media (any-hover: hover){:host(:focus){outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}:host .picker-item-active{color:var(--ion-color-base)}";var PickerColumnInternal=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.isScrolling=false;this.isColumnVisible=false;this.canExitInputMode=true;this.centerPickerItemInView=function(e,i,n){if(i===void 0){i=true}if(n===void 0){n=true}var r=t,o=r.el,a=r.isColumnVisible;if(a){var l=e.offsetTop-3*e.clientHeight+e.clientHeight/2;if(o.scrollTop!==l){t.canExitInputMode=n;o.scroll({top:l,left:0,behavior:i?"smooth":undefined})}}};this.setPickerItemActiveState=function(e,t){if(t){e.classList.add(PICKER_ITEM_ACTIVE_CLASS);e.part.add(PICKER_ITEM_ACTIVE_PART)}else{e.classList.remove(PICKER_ITEM_ACTIVE_CLASS);e.part.remove(PICKER_ITEM_ACTIVE_PART)}};this.inputModeChange=function(e){if(!t.numericInput){return}var i=e.detail,n=i.useInputMode,r=i.inputModeColumn;var o=r===undefined||r===t.el;if(!n||!o){t.setInputModeActive(false);return}t.setInputModeActive(true)};this.setInputModeActive=function(e){if(t.isScrolling){t.scrollEndCallback=function(){t.isActive=e};return}t.isActive=e};this.initializeScrollListener=function(){var e=isPlatform("ios");var i=t.el;var n;var r=t.activeItem;var o=function(){raf((function(){if(n){clearTimeout(n);n=undefined}if(!t.isScrolling){e&&hapticSelectionStart();t.isScrolling=true}var o=i.getBoundingClientRect();var a=o.x+o.width/2;var l=o.y+o.height/2;var s=i.shadowRoot.elementFromPoint(a,l);if(r!==null){t.setPickerItemActiveState(r,false)}if(s===null||s.disabled){return}if(s!==r){e&&hapticSelectionChanged();if(t.canExitInputMode){t.exitInputMode()}}r=s;t.setPickerItemActiveState(s,true);n=setTimeout((function(){t.isScrolling=false;e&&hapticSelectionEnd();var i=t.scrollEndCallback;if(i){i();t.scrollEndCallback=undefined}t.canExitInputMode=true;var n=s.getAttribute("data-index");if(n===null){return}var r=parseInt(n,10);var o=t.items[r];if(o.value!==t.value){t.setValue(o.value)}}),250)}))};raf((function(){i.addEventListener("scroll",o);t.destroyScrollListener=function(){i.removeEventListener("scroll",o)}}))};this.exitInputMode=function(){var e=t.parentEl;if(e==null)return;e.exitInputMode();t.el.classList.remove("picker-column-active")};this.isActive=false;this.items=[];this.value=undefined;this.color="primary";this.numericInput=false}e.prototype.valueChange=function(){if(this.isColumnVisible){this.scrollActiveItemIntoView()}};e.prototype.componentWillLoad=function(){var e=this;var t=function(t){var i=t[0];if(i.isIntersecting){var n=e,r=n.activeItem,o=n.el;e.isColumnVisible=true;var a=getElementRoot(o).querySelector(".".concat(PICKER_ITEM_ACTIVE_CLASS));if(a){e.setPickerItemActiveState(a,false)}e.scrollActiveItemIntoView();if(r){e.setPickerItemActiveState(r,true)}e.initializeScrollListener()}else{e.isColumnVisible=false;if(e.destroyScrollListener){e.destroyScrollListener();e.destroyScrollListener=undefined}}};new IntersectionObserver(t,{threshold:.001}).observe(this.el);var i=this.parentEl=this.el.closest("ion-picker-internal");if(i!==null){i.addEventListener("ionInputModeChange",(function(t){return e.inputModeChange(t)}))}};e.prototype.componentDidRender=function(){var e;var t=this,i=t.activeItem,n=t.items,r=t.isColumnVisible,o=t.value;if(r){if(i){this.scrollActiveItemIntoView()}else if(((e=n[0])===null||e===void 0?void 0:e.value)!==o){this.setValue(n[0].value)}}};e.prototype.scrollActiveItemIntoView=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.activeItem;if(e){this.centerPickerItemInView(e,false,false)}return[2]}))}))};e.prototype.setValue=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){t=this.items;this.value=e;i=t.find((function(t){return t.value===e&&t.disabled!==true}));if(i){this.ionChange.emit(i)}return[2]}))}))};Object.defineProperty(e.prototype,"activeItem",{get:function(){return getElementRoot(this.el).querySelector('.picker-item[data-value="'.concat(this.value,'"]:not([disabled])'))},enumerable:false,configurable:true});e.prototype.render=function(){var e;var t=this;var i=this,n=i.items,r=i.color,o=i.isActive,a=i.numericInput;var l=getIonMode(this);return h(Host,{exportparts:"".concat(PICKER_ITEM_PART,", ").concat(PICKER_ITEM_ACTIVE_PART),tabindex:0,class:createColorClasses(r,(e={},e[l]=true,e["picker-column-active"]=o,e["picker-column-numeric-input"]=a,e))},h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),n.map((function(e,i){return h("button",{tabindex:"-1",class:{"picker-item":true,"picker-item-disabled":e.disabled||false},"data-value":e.value,"data-index":i,onClick:function(e){t.centerPickerItemInView(e.target,true)},disabled:e.disabled,part:PICKER_ITEM_PART},e.text)})),h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),h("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChange"]}},enumerable:false,configurable:true});return e}();var PICKER_ITEM_ACTIVE_CLASS="picker-item-active";var PICKER_ITEM_PART="wheel-item";var PICKER_ITEM_ACTIVE_PART="active";PickerColumnInternal.style={ios:pickerColumnInternalIosCss,md:pickerColumnInternalMdCss};export{PickerColumnInternal as ion_picker_column_internal};
|