@ionic/core 9.0.7-dev.11791381676.118a7a15 → 9.0.7-dev.11791478996.1b854592
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/index.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/p-Bd8hg9FK.js +4 -0
- package/components/{p-BG2lMobd.js → p-CJdQ1u7W.js} +1 -1
- package/components/{p-D64Tyi-z.js → p-CQKWzUsE.js} +1 -1
- package/components/{p-Dvyv9SMk.js → p-D0nwlsl_.js} +1 -1
- package/components/p-DfDIY2oP.js +4 -0
- package/dist/cjs/{index-DUiuw_fH.js → index-DCfr5hz-.js} +14 -2
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-app_8.cjs.entry.js +31 -3
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-nav_2.cjs.entry.js +24 -2
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/{ios.transition-D85_rHf5.js → ios.transition-Ca6XODo9.js} +1 -1
- package/dist/cjs/{md.transition-Ce9X1WXr.js → md.transition-D8SfNYEp.js} +1 -1
- package/dist/collection/components/nav/nav.js +24 -2
- package/dist/collection/components/router-outlet/router-outlet.js +31 -3
- package/dist/collection/utils/transition/index.js +11 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{index-BBASprVu.js → index-z9vdZN7I.js} +14 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-app_8.entry.js +31 -3
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-nav_2.entry.js +24 -2
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/{ios.transition-B8netzsb.js → ios.transition-BkUGiDUz.js} +1 -1
- package/dist/esm/{md.transition-DNCSSiXk.js → md.transition-B6hlrWjR.js} +1 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-52a16f94.entry.js +4 -0
- package/dist/ionic/{p-Bppj2PE0.js → p-BZTgGzGK.js} +1 -1
- package/dist/ionic/{p-Bnc1L7Rk.js → p-CgcGX08t.js} +1 -1
- package/dist/ionic/p-Dk4Mdaru.js +4 -0
- package/dist/ionic/{p-f6fcd4f8.entry.js → p-c97e4c00.entry.js} +1 -1
- package/dist/ionic/{p-2124fd4f.entry.js → p-d2406889.entry.js} +1 -1
- package/dist/ionic/{p-af56702e.entry.js → p-f2116a54.entry.js} +1 -1
- package/dist/types/components/nav/nav.d.ts +1 -0
- package/dist/types/components/router-outlet/router-outlet.d.ts +1 -0
- package/dist/types/utils/transition/index.d.ts +6 -0
- package/hydrate/index.js +64 -3
- package/hydrate/index.mjs +64 -3
- package/package.json +1 -1
- package/components/p-C7r5Gja6.js +0 -4
- package/components/p-Uk13YgEc.js +0 -4
- package/dist/ionic/p-DQXtveHv.js +0 -4
- package/dist/ionic/p-fcb04fb5.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,d as i,a as o,w as a,i as e,h as s,f as r,g as n}from"./p-BpRUsN_W.js";import{i as d,f as h,a as p,d as l,r as c,b as m,p as f}from"./p-CXs4J83x.js";import{C as u,a as b,d as x}from"./p-nCAPr1Ah.js";import{w as v,o as w,g,e as y,r as k,b as A,h as Y}from"./p-Co7eql8D.js";import{c as S}from"./p-B-hirT0v.js";import{g as D}from"./p-C2LaBx3E.js";import{G as E,O,F as C,n as M,d as T,B,h as P,r as N,j as I,k as j,e as R,f as $,g as L}from"./p-C1WYZOZj.js";import{g as z}from"./p-byZM6qHV.js";import{e as F,w as W}from"./p-DQXtveHv.js";import{b as H}from"./p-SEecsUh7.js";import{KEYBOARD_DID_OPEN as V}from"./p-DXXGkPA8.js";import{c as Z}from"./p-7l6ENjIV.js";import{g as _}from"./p-hHmYLOfE.js";import{createGesture as K}from"./p-D0YpjgON.js";import"./p-Dojwmvde.js";import"./p-B_gJaBk0.js";import"./p-BY4FwwBp.js";var U;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(U||(U={}));const G={getEngine(){const t=D();if(t?.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const i=this.getEngine();i&&i.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return U.Default;const{style:i}=await t.getInfo();return i}},X=(t,i)=>{if(1===i)return 0;const o=1/(1-i);return t*o+-i*o},q=()=>{!v||v.innerWidth>=768||G.setStyle({style:U.Dark})},J=(t=U.Default)=>{!v||v.innerWidth>=768||G.setStyle({style:t})},Q=t=>{const i=d(t)?g(t).querySelector(".inner-scroll"):t;return!h(t)&&0===i.scrollTop},tt=async(t,i)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,E)&&(i.isRunning()?i.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},it=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,ot=.915,at=(t,i)=>y(400,t/Math.abs(1.1*i),500),et=(t,i)=>{const o=window.innerHeight,a=t.getBoundingClientRect().top,e=Math.round(1e3*(1-i/(o-a)))/1e3;return Math.max(0,Math.min(1,e))},st=t=>{const{currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:a}=t,e=void 0===o||o<i,s=e?`calc(var(--backdrop-opacity) * ${i})`:"0",r=Z("backdropAnimation").fromTo("opacity",0,s);return e&&r.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*i}%)`}]),backdropAnimation:r,contentAnimation:a?void 0:Z("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-i)+"%"},{offset:1,opacity:1,maxHeight:100*i+"%"}])}},rt=t=>{const{currentBreakpoint:i,backdropBreakpoint:o}=t,a=`calc(var(--backdrop-opacity) * ${X(i,o)})`,e=[{offset:0,opacity:a},{offset:1,opacity:0}],s=[{offset:0,opacity:a},{offset:o,opacity:0},{offset:1,opacity:0}],r=Z("backdropAnimation").keyframes(0!==o?s:e);return{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*i}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:r}},nt=(t,i)=>{const{presentingEl:o,currentBreakpoint:a,expandToScroll:e}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:d}=void 0!==a?st(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!e&&d?.addElement(t.querySelector(".ion-page"));const h=Z("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([r]);if(d&&h.addAnimation(d),o){const t=window.innerWidth<768,i="ION-MODAL"===o.tagName&&void 0!==o.presentingElement,a=g(o),e=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${i?"-10px":t}) scale(0.915)`;e.afterStyles({transform:a}).beforeAddWrite((()=>s.style.setProperty("background-color","black"))).addElement(o).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),h.addAnimation(e)}else if(h.addAnimation(n),i){const t=`translateY(-10px) scale(${i?ot:1})`;e.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const o=Z().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([e,o])}else r.fromTo("opacity","0","1")}else h.addAnimation(n);return h},dt=(t,i,o=500)=>{const{presentingEl:a,currentBreakpoint:e}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n}=void 0!==e?rt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().fromTo("transform","translateY(0vh)","translateY(100vh)")};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=Z("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(r);if(a){const t=window.innerWidth<768,i="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,o=g(a),e=Z().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(s.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&s.style.setProperty("background-color",""))})),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",o=`translateY(${i?"-10px":t}) scale(0.915)`;e.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:o,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(e)}else if(d.addAnimation(n),i){const t=`translateY(-10px) scale(${i?ot:1})`;e.addElement(o.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=Z().addElement(o.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([e,a])}else r.fromTo("opacity","1","0")}else d.addAnimation(n);return d},ht=(t,i)=>{const{currentBreakpoint:o,expandToScroll:a}=i,e=g(t),{wrapperAnimation:s,backdropAnimation:r,contentAnimation:n}=void 0!==o?st(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};r.addElement(e.querySelector("ion-backdrop")),s.addElement(e.querySelector(".modal-wrapper")),!a&&n?.addElement(t.querySelector(".ion-page"));const d=Z().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([r,s]);return n&&d.addAnimation(n),d},pt=(t,i)=>{const{currentBreakpoint:o}=i,a=g(t),{wrapperAnimation:e,backdropAnimation:s}=void 0!==o?rt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return s.addElement(a.querySelector("ion-backdrop")),e.addElement(a.querySelector(".modal-wrapper")),Z().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,e])};let lt=null,ct=!1;const mt=()=>{if(null!==lt)return lt;const t=v?.document;if(!t?.body)return 0;const i=t.createElement("div");i.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);",t.body.appendChild(i);const o=parseFloat(getComputedStyle(i).paddingTop)||0;return i.remove(),lt=o,ct||(ct=!0,k((()=>{lt=null,ct=!1}))),o},ft=t=>{const i=getComputedStyle(t),o=M(i.getPropertyValue("--width")),a=M(i.getPropertyValue("--height"));return"fullscreen"===o&&"fullscreen"===a?{vertical:!0,horizontal:!0}:ut(t)},ut=t=>{const i=t.shadowRoot?.querySelector(".modal-wrapper");if(null==i||void 0===v)return{vertical:!1,horizontal:!1};const o=t.classList.contains("overlay-hidden");o&&t.classList.remove("overlay-hidden");const{width:a,height:e}=i.getBoundingClientRect();return o&&t.classList.add("overlay-hidden"),{vertical:e>=v.innerHeight-5,horizontal:a>=v.innerWidth-5}},bt=(t,i)=>{t.style.setProperty("--ion-safe-area-top",i.top),t.style.setProperty("--ion-safe-area-bottom",i.bottom),t.style.setProperty("--ion-safe-area-left",i.left),t.style.setProperty("--ion-safe-area-right",i.right)},xt=class{constructor(o){t(this,o),this.didPresent=i(this,"ionModalDidPresent",7),this.willPresent=i(this,"ionModalWillPresent",7),this.willDismiss=i(this,"ionModalWillDismiss",7),this.didDismiss=i(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=i(this,"ionBreakpointDidChange",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.ionMount=i(this,"ionMount",7),this.ionDragStart=i(this,"ionDragStart",7),this.ionDragMove=i(this,"ionDragMove",7),this.ionDragEnd=i(this,"ionDragEnd",7),this.lockController=S(),this.triggerController=T(),this.coreDelegate=u(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.isPresenting=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="cycle",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:i}=this;"cycle"===i&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,B)},this.onLifecycle=t=>{const i=this.usersElement,o=vt[t.type];if(i&&o){const a=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});i.dispatchEvent(a)}},this.onModalFocus=t=>{const{dragHandleEl:i,el:o}=this;t.target===o&&null==o.shadowRoot?.activeElement&&i&&-1!==i.tabIndex&&i.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,i){!0===t&&!1===i?this.present():!1===t&&!0===i&&this.dismiss()}triggerChanged(){const{trigger:t,el:i,triggerController:o}=this;t&&o.addClickListener(i,t)}onWindowResize(){this.presented&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{const t=this.getSafeAreaContext();if(!t.isCardModal||this.enterAnimation||this.leaveAnimation||this.handleViewTransition(),t.isSheetModal&&this.updateSheetOffsetTop(),!t.isSheetModal&&!t.isCardModal){this.updateSafeAreaOverrides();const{contentEl:t,hasFooter:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(t),this.applyFullscreenSafeAreaTo(t,i)}}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,i)=>t-i)))}connectedCallback(){const{el:t}=this;P(t),this.triggerChanged(),(this.presented||this.isPresenting)&&this.restoreSafeAreaOverrides(),this.presented&&(N(t),this.initParentRemovalObserver())}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.presented&&I()}componentWillLoad(){const{breakpoints:t,initialBreakpoint:i,el:a,htmlAttributes:e}=this,s=this.isSheetModal=void 0!==t&&void 0!==i,r=["aria-label","role"];this.inheritedAttributes=A(a,r),a.parentNode&&(this.cachedOriginalParent=a.parentNode),void 0!==e&&r.forEach((t=>{e[t]&&(this.inheritedAttributes={...this.inheritedAttributes,[t]:e[t]},delete e[t])})),s&&(this.currentBreakpoint=this.initialBreakpoint),void 0===t||void 0===i||t.includes(i)||o("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),this.htmlAttributes?.id||j(this.el)}componentDidLoad(){!0===this.isOpen&&k((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const i=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:i,delegate:this.workingDelegate=i?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,i){const{canDismiss:o}=this;return"function"==typeof o?o(t,i):o}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:i,el:o}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:e,delegate:s}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await b(s,o,this.component,["ion-page"],this.componentProps,e),Y(o)?await F(this.usersElement):this.keepContentsMounted||await W(),a((()=>this.el.classList.add("show-modal"))),this.isSheetModal=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint,this.isPresenting=!0;const r=void 0!==i;try{this.setInitialSafeAreaOverrides(),r&&"ios"===H(this)&&(this.statusBarStyle=await G.getStyle(),q()),await R(this,"modalEnter",nt,ht,{presentingEl:i,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})}finally{this.isPresenting=!1}this.updateSafeAreaOverrides(),this.applyFullscreenSafeArea(),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),k((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(V,this.keyboardOpenCallback)),this.isSheetModal?this.initSheetGesture():r&&this.initSwipeToClose(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){if("ios"!==H(this))return;const{el:t}=this,i=this.leaveAnimation||e.get("modalLeave",dt),o=this.animation=i(t,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});m(t)?(this.gesture=((t,i,o,a,e,s,r)=>{const n=.5,h=t.offsetHeight;let m=!1,f=!1,u=null,b=!0,x=0;const v=K({el:t,gestureName:"modalSwipeToClose",gesturePriority:O,direction:"y",threshold:10,canStart:t=>{const i=t.event.target;return null===i||!i.closest||(u=p(i),u?Q(u):null===i.closest("ion-footer"))},onStart:o=>{const{deltaY:a}=o;window.getSelection()?.removeAllRanges(),b=!u||!d(u)||u.scrollY,f=void 0!==t.canDismiss&&!0!==t.canDismiss,a>0&&u&&l(u),i.progressStart(!0,m?1:0),e()},onMove:a=>{const{deltaY:e}=a;e>0&&u&&l(u);const r=a.deltaY/h,d=r>=0&&f,p=d?.2:.9999,c=d?it(r/p):r,m=y(1e-4,c,p);i.progressStep(m),m>=n&&x<n?J(o):m<n&&x>=n&&q(),x=m;const b={currentY:a.currentY,deltaY:a.deltaY,velocityY:a.velocityY,progress:et(t,a.deltaY)};s(b)},onEnd:o=>{const e=o.velocityY,s=o.deltaY/h,d=s>=0&&f,p=d?.2:.9999,l=d?it(s/p):s,x=y(1e-4,l,p),w=!d&&(o.deltaY+1e3*e)/h>=n;let g=w?-.001:.001;w?(i.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=_([0,0],[.32,.72],[0,1],[1,1],x)[0]):(i.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=_([0,0],[1,0],[.68,.28],[1,1],x)[0]);const k=at(w?s*h:(1-x)*h,e);m=w,v.enable(!1),u&&c(u,b),i.onFinish((()=>{w||v.enable(!0)})).progressEnd(w?1:0,g,k);const A=d&&x>p/4;A?tt(t,i):w&&a();const Y=d?A&&"function"==typeof t.canDismiss:w,S={currentY:o.currentY,deltaY:o.deltaY,velocityY:o.velocityY,progress:et(t,o.deltaY),isDismissing:Y};r(S)}});return v})(t,o,this.statusBarStyle??U.Default,(()=>this.cardOnDismiss()),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t))),this.gesture.enable(!0)):f(t)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:i,backdropBreakpoint:o}=this;if(!t||void 0===i)return;const a=this.enterAnimation||e.get("modalEnter",nt),s=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:this.expandToScroll});s.progressStart(!0,1);const{gesture:r,moveSheetToBreakpoint:n,resetContentScroll:h}=((t,i,o,a,e,s,r=[],n,h,l,c,m,f,u)=>{const b={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==e?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-e,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},x=t.querySelector("ion-content"),v=x?.scrollY??!0,w=o.clientHeight;let A=a,Y=0,S=!1,D=null,E=null,O=null,M=null;const T=r[r.length-1],B=r[0],P=s.childAnimations.find((t=>"wrapperAnimation"===t.id)),N=s.childAnimations.find((t=>"backdropAnimation"===t.id)),I=s.childAnimations.find((t=>"contentAnimation"===t.id)),j=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),i.style.setProperty("pointer-events","auto"),t.classList.remove(C))},R=()=>{t.style.setProperty("pointer-events","none"),i.style.setProperty("pointer-events","none"),t.classList.add(C)},$=i=>{if(!E&&(E=Array.from(t.querySelectorAll("ion-footer")),!E.length))return;const o=t.querySelector(".ion-page");if(M=i,"stationary"===i)E.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),o?.style.removeProperty("padding-bottom"),o?.appendChild(t)}));else{let i=0;E.forEach(((o,a)=>{const e=o.getBoundingClientRect(),s=document.body.getBoundingClientRect();i+=o.clientHeight;const r=e.top-s.top,n=e.left-s.left;if(o.style.setProperty("--pinned-width",`${o.clientWidth}px`),o.style.setProperty("--pinned-height",`${o.clientHeight}px`),o.style.setProperty("--pinned-top",`${r}px`),o.style.setProperty("--pinned-left",`${n}px`),0===a){O=r;const i=t.querySelector("ion-header");i&&(O-=i.clientHeight)}})),E.forEach((t=>{o?.style.setProperty("padding-bottom",`${i}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};P&&N&&(P.keyframes([...b.WRAPPER_KEYFRAMES]),N.keyframes([...b.BACKDROP_KEYFRAMES]),I?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-A),A>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R()),x&&A!==T&&n&&(x.scrollY=!1);const L=i=>{const{breakpoint:o,canDismiss:a,breakpointOffset:d,animated:h}=i,p=a&&0===o,m=p?A:o,f=0!==m;return A=0,P&&N&&(P.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-m)}%)`}]),N.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${X(1-d,e)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${X(m,e)})`}]),I&&I.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*m+"%"}]),s.progressStep(0)),H.enable(!1),p?tt(t,s):f||l(),!x||m!==r[r.length-1]&&n||(x.scrollY=v),n||0!==m||$("stationary"),new Promise((i=>{s.onFinish((()=>{f?(n||$("stationary"),P&&N?k((()=>{P.keyframes([...b.WRAPPER_KEYFRAMES]),N.keyframes([...b.BACKDROP_KEYFRAMES]),I?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-m),A=m,c(A),A>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R(),H.enable(!0),i()})):(H.enable(!0),i())):i()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},z=t=>{const i=o.getBoundingClientRect().top+t,a=F(i);return r.reduce(((t,i)=>Math.abs(i-a)<Math.abs(t-a)?i:t))},F=t=>{const i=r[r.length-1],o=W(r[0]),a=W(i),e=Math.round((o-t)/(o-a)*1e3)/1e3;return Math.max(0,Math.min(1,e))},W=i=>{const o=t.getBoundingClientRect();return window.innerHeight-o.height*i},H=K({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const i=p(t.event.target);return A=h(),!(i&&(!n||1===A))||Q(i)},onStart:i=>{if(window.getSelection()?.removeAllRanges(),S=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===B,!n){const t=p(i.event.target);D=t&&d(t)?g(t).querySelector(".inner-scroll"):t}n||$("moving"),i.deltaY>0&&x&&(x.scrollY=!1),k((()=>{t.focus()})),s.progressStart(!0,1-A),m()},onMove:t=>{if(n||null===O||null===M||(t.currentY>=O&&"moving"===M?$("stationary"):t.currentY<O&&"stationary"===M&&$("moving")),!n&&t.deltaY<=0&&D)return;t.deltaY>0&&x&&(x.scrollY=!1);const i=r.length>1?1-r[1]:void 0,o=1-A+t.deltaY/w,a=void 0!==i&&o>=i&&S,e=a?.95:.9999,d=a&&void 0!==i?i+it((o-i)/(e-i)):o;Y=y(1e-4,d,e),s.progressStep(Y);const h=z(t.deltaY),p={currentY:t.currentY,deltaY:t.deltaY,velocityY:t.velocityY,progress:F(t.currentY),snapBreakpoint:h};f(p)},onEnd:i=>{const o=z(i.deltaY),a=S&&0===o?"function"==typeof t.canDismiss:0===o,e={currentY:i.currentY,deltaY:i.deltaY,velocityY:i.velocityY,progress:F(i.currentY),snapBreakpoint:o,isDismissing:a};if(!n&&i.deltaY<=0&&D&&D.scrollTop>0)return $("stationary"),void u({...e,isDismissing:!1});L({breakpoint:o,breakpointOffset:Y,canDismiss:S,animated:!0}),u(e)}});return{gesture:H,moveSheetToBreakpoint:L,resetContentScroll:()=>{x&&(x.scrollY=v)}}})(this.el,this.backdropEl,t,i,o,s,this.sortedBreakpoints,this.expandToScroll,(()=>this.currentBreakpoint??0),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t)));this.gesture=r,this.moveSheetToBreakpoint=n,this.resetSheetContentScroll=h,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||o>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){this.cachedPageParent=this.getOriginalPageParent();const t=this.cachedPageParent;if(!t||"ION-APP"===t.tagName)return;if(Array.from(t.children).some((t=>!(t===this.el||t instanceof HTMLElement&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!t.textContent?.trim()))))return;t.classList.add("ion-page-overlay-passthrough");const i=t.parentElement;"ION-ROUTER-OUTLET"===i?.tagName&&"ION-APP"!==i.parentElement?.tagName&&(i.style.setProperty("pointer-events","none"),i.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const i=t.parentElement;i?.hasAttribute("data-overlay-passthrough")&&(i.style.removeProperty("pointer-events"),i.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,E),this.gestureAnimationDismissing=!1}))}cardOnDismiss(){this.gestureAnimationDismissing=!0,J(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,E),this.gestureAnimationDismissing=!1}))}async dismiss(t,i){if(this.gestureAnimationDismissing&&i!==E)return!1;clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0;const o=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==i&&!await this.checkCanDismiss(t,i))return o(),!1;const{presentingElement:e}=this;void 0!==e&&"ios"===H(this)&&J(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(V,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await $(this,t,i,"modalLeave",dt,pt,{presentingEl:e,currentBreakpoint:this.currentBreakpoint??this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await x(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),this.resetSheetContentScroll?.(),this.resetSheetContentScroll=void 0,this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.cleanupChildRoutePassthrough()}return this.currentBreakpoint=void 0,this.animation=void 0,o(),s}onDidDismiss(){return L(this.el,"ionModalDidDismiss")}onWillDismiss(){return L(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void o("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void o(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:i,moveSheetToBreakpoint:a,canDismiss:e,breakpoints:s,animated:r}=this;i!==t&&a&&(this.sheetTransition=a({breakpoint:t,breakpointOffset:1-i,canDismiss:void 0!==e&&!0!==e&&0===s[0],animated:r}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:i}=this;if(!t||null==i)return!1;const o=t.filter((t=>0!==t)),a=o.indexOf(i),e=o[(a+1)%o.length];return await this.setCurrentBreakpoint(e),!0}initViewTransitionListener(){"ios"!==H(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:i}=this;if(!i)return;let o;o=this.currentViewIsPortrait&&!t?((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return Z("portrait-to-landscape-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=g(a),r=document.body,n=Z("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0px) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i).fromTo("filter","contrast(0.85)","contrast(1)");const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>r.style.setProperty("background-color",""))).fromTo("transform",s,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}):((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return Z("landscape-to-portrait-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=g(a),r=document.body,n=Z("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i);const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:s}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:s,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=o,o.play().then((()=>{this.viewTransitionAnimation=void 0,k((()=>this.updateSafeAreaOverrides())),this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===H(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),k((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:i}=this,o=g(t).querySelector(".modal-wrapper");if(o&&(o.style.transform="translateY(0vh)",o.style.opacity="1"),"ION-MODAL"===i?.tagName)if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";i.style.transform=`translateY(${t}) scale(0.915)`}else i.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);t?.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.cleanupParentRemovalObserver(),this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{const i=t===this.cachedOriginalParent,o=!!this.cachedOriginalParent&&t.contains?.(this.cachedOriginalParent);return i||o}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){this.parentRemovalObserver?.disconnect(),this.parentRemovalObserver=void 0}onDragStart(){this.ionDragStart.emit()}onDragMove(t){this.ionDragMove.emit(t)}onDragEnd(t){this.ionDragEnd.emit(t)}getSafeAreaContext(){return{isSheetModal:this.isSheetModal,isCardModal:void 0!==this.presentingElement&&"ios"===H(this),presentingElement:this.presentingElement,breakpoints:this.breakpoints,currentBreakpoint:this.currentBreakpoint}}watchHeightForContent(){var t;this.isSheetModal||(this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=(t=()=>{this.el.querySelectorAll("ion-content").forEach((t=>t.recalculateDimensions()))},w(this.el,"--height",(()=>t()))))}setInitialSafeAreaOverrides(){const t={...this.getSafeAreaContext(),coveredAxes:ft(this.el)},i=(t=>{const{isSheetModal:i,isCardModal:o}=t;if(i)return{top:"0px",bottom:"inherit",left:"0px",right:"0px"};if(o)return{top:"inherit",bottom:"inherit",left:"0px",right:"0px"};const{vertical:a,horizontal:e}=t.coveredAxes??{vertical:!0,horizontal:!0};return{top:a?"inherit":"0px",bottom:a?"inherit":"0px",left:e?"inherit":"0px",right:e?"inherit":"0px"}})(t);var o;bt(this.el,i),this.watchHeightForContent(),t.isSheetModal&&(this.updateSheetOffsetTop(),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=(o=t=>this.updateSheetOffsetTop(t),w(v?.document?.body,"--ion-safe-area-top",o,mt())))}updateSheetOffsetTop(t){const i=t??mt();this.el.style.setProperty("--ion-modal-offset-top",`${i}px`)}updateSafeAreaOverrides(){const{wrapperEl:t,el:i}=this,o=this.getSafeAreaContext();if(o.isSheetModal)return;if(o.isCardModal)return;if(!t)return;const a=(t=>{const i=t.getBoundingClientRect();return{top:i.top<=5?"inherit":"0px",bottom:i.bottom>=(v?.innerHeight??0)-5?"inherit":"0px",left:i.left<=5?"inherit":"0px",right:i.right>=(v?.innerWidth??0)-5?"inherit":"0px"}})(t);bt(i,a)}applyFullscreenSafeArea(){const t=this.getSafeAreaContext();if(t.isSheetModal||t.isCardModal)return;const{contentEl:i,hasFooter:o}=this.findContentAndFooter();this.applyFullscreenSafeAreaTo(i,o)}applyFullscreenSafeAreaTo(t,i){t&&!i&&t.style.setProperty("--internal-content-safe-area-padding-bottom","var(--ion-safe-area-bottom, 0px)")}clearContentSafeAreaPadding(t){t&&t.style.removeProperty("--internal-content-safe-area-padding-bottom")}findContentAndFooter(){let t=null,i=!1;for(const o of Array.from(this.el.children)){"ION-CONTENT"===o.tagName&&(t=o),"ION-FOOTER"===o.tagName&&(i=!0);for(const a of Array.from(o.children))"ION-CONTENT"!==a.tagName||t||(t=a),"ION-FOOTER"===a.tagName&&(i=!0)}return{contentEl:t,hasFooter:i}}cleanupSafeAreaOverrides(){var t;(t=this.el).style.removeProperty("--ion-safe-area-top"),t.style.removeProperty("--ion-safe-area-bottom"),t.style.removeProperty("--ion-safe-area-left"),t.style.removeProperty("--ion-safe-area-right"),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=void 0,this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=void 0,this.el.style.removeProperty("--ion-modal-offset-top");const{contentEl:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(i)}restoreSafeAreaOverrides(){this.setInitialSafeAreaOverrides(),this.applyFullscreenSafeArea(),k((()=>{if(!this.presented||!this.el.isConnected||this.isPresenting)return;const{width:t,height:i}=this.el.getBoundingClientRect();0===t&&0===i||this.updateSafeAreaOverrides()}))}render(){const{handle:t,isSheetModal:i,presentingElement:o,htmlAttributes:a,handleBehavior:e,inheritedAttributes:n,focusTrap:d,expandToScroll:h}=this,p=!1!==t&&i,l=H(this),c=void 0!==o&&"ios"===l,m="cycle"===e;return s(r,{key:"17a95bd7722bac2344bea041aff97db17f55c0cf","no-router":!0,tabIndex:m&&i&&p?0:-1,...a,style:{zIndex:`${2e4+this.overlayIndex}`},class:{[l]:!0,"modal-default":!c&&!i,"modal-card":c,"modal-sheet":i,"modal-no-expand-scroll":i&&!h,"overlay-hidden":!0,[C]:!1===d,...z(this.cssClass)},onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus},s("ion-backdrop",{key:"9dab1ef4771c0d847ba2be8672afbaa2748517f3",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===l&&s("div",{key:"64af7ed1c5f552b61fc4b9387b926acc76c8a99a",class:"modal-shadow"}),s("div",{key:"7e76d77d5b2e8f0467bb793facf5aa86f8d01bbe",role:"dialog",...n,"aria-modal":"true",tabIndex:-1,class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},p&&s("button",{key:"5efc0bb0a59adcc594ac48da9fd90e57908a7ffb",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),s("slot",{key:"6175fcd0b39c086b4e9eb9e96c4d631c2a86774b",onSlotchange:this.onSlotChange})))}get el(){return n(this)}static get watchers(){return{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}}},vt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};xt.style={ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--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-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--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-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'};export{xt as ion_modal}
|
|
4
|
+
import{r as t,d as i,a as o,w as a,i as e,h as s,f as r,g as n}from"./p-BpRUsN_W.js";import{i as d,f as h,a as p,d as l,r as c,b as m,p as f}from"./p-CXs4J83x.js";import{C as u,a as b,d as x}from"./p-nCAPr1Ah.js";import{w as v,o as w,g,e as y,r as k,b as A,h as Y}from"./p-Co7eql8D.js";import{c as S}from"./p-B-hirT0v.js";import{g as D}from"./p-C2LaBx3E.js";import{G as E,O,F as C,n as M,d as T,B,h as P,r as N,j as I,k as j,e as R,f as $,g as L}from"./p-C1WYZOZj.js";import{g as z}from"./p-byZM6qHV.js";import{e as F,w as W}from"./p-Dk4Mdaru.js";import{b as H}from"./p-SEecsUh7.js";import{KEYBOARD_DID_OPEN as V}from"./p-DXXGkPA8.js";import{c as Z}from"./p-7l6ENjIV.js";import{g as _}from"./p-hHmYLOfE.js";import{createGesture as K}from"./p-D0YpjgON.js";import"./p-Dojwmvde.js";import"./p-B_gJaBk0.js";import"./p-BY4FwwBp.js";var U;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(U||(U={}));const G={getEngine(){const t=D();if(t?.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const i=this.getEngine();i&&i.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return U.Default;const{style:i}=await t.getInfo();return i}},X=(t,i)=>{if(1===i)return 0;const o=1/(1-i);return t*o+-i*o},q=()=>{!v||v.innerWidth>=768||G.setStyle({style:U.Dark})},J=(t=U.Default)=>{!v||v.innerWidth>=768||G.setStyle({style:t})},Q=t=>{const i=d(t)?g(t).querySelector(".inner-scroll"):t;return!h(t)&&0===i.scrollTop},tt=async(t,i)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,E)&&(i.isRunning()?i.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},it=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,ot=.915,at=(t,i)=>y(400,t/Math.abs(1.1*i),500),et=(t,i)=>{const o=window.innerHeight,a=t.getBoundingClientRect().top,e=Math.round(1e3*(1-i/(o-a)))/1e3;return Math.max(0,Math.min(1,e))},st=t=>{const{currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:a}=t,e=void 0===o||o<i,s=e?`calc(var(--backdrop-opacity) * ${i})`:"0",r=Z("backdropAnimation").fromTo("opacity",0,s);return e&&r.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*i}%)`}]),backdropAnimation:r,contentAnimation:a?void 0:Z("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-i)+"%"},{offset:1,opacity:1,maxHeight:100*i+"%"}])}},rt=t=>{const{currentBreakpoint:i,backdropBreakpoint:o}=t,a=`calc(var(--backdrop-opacity) * ${X(i,o)})`,e=[{offset:0,opacity:a},{offset:1,opacity:0}],s=[{offset:0,opacity:a},{offset:o,opacity:0},{offset:1,opacity:0}],r=Z("backdropAnimation").keyframes(0!==o?s:e);return{wrapperAnimation:Z("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*i}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:r}},nt=(t,i)=>{const{presentingEl:o,currentBreakpoint:a,expandToScroll:e}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:d}=void 0!==a?st(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!e&&d?.addElement(t.querySelector(".ion-page"));const h=Z("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([r]);if(d&&h.addAnimation(d),o){const t=window.innerWidth<768,i="ION-MODAL"===o.tagName&&void 0!==o.presentingElement,a=g(o),e=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${i?"-10px":t}) scale(0.915)`;e.afterStyles({transform:a}).beforeAddWrite((()=>s.style.setProperty("background-color","black"))).addElement(o).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),h.addAnimation(e)}else if(h.addAnimation(n),i){const t=`translateY(-10px) scale(${i?ot:1})`;e.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const o=Z().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([e,o])}else r.fromTo("opacity","0","1")}else h.addAnimation(n);return h},dt=(t,i,o=500)=>{const{presentingEl:a,currentBreakpoint:e}=i,s=g(t),{wrapperAnimation:r,backdropAnimation:n}=void 0!==e?rt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().fromTo("transform","translateY(0vh)","translateY(100vh)")};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=Z("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(r);if(a){const t=window.innerWidth<768,i="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,o=g(a),e=Z().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(s.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&s.style.setProperty("background-color",""))})),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",o=`translateY(${i?"-10px":t}) scale(0.915)`;e.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:o,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(e)}else if(d.addAnimation(n),i){const t=`translateY(-10px) scale(${i?ot:1})`;e.addElement(o.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=Z().addElement(o.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([e,a])}else r.fromTo("opacity","1","0")}else d.addAnimation(n);return d},ht=(t,i)=>{const{currentBreakpoint:o,expandToScroll:a}=i,e=g(t),{wrapperAnimation:s,backdropAnimation:r,contentAnimation:n}=void 0!==o?st(i):{backdropAnimation:Z().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:Z().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};r.addElement(e.querySelector("ion-backdrop")),s.addElement(e.querySelector(".modal-wrapper")),!a&&n?.addElement(t.querySelector(".ion-page"));const d=Z().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([r,s]);return n&&d.addAnimation(n),d},pt=(t,i)=>{const{currentBreakpoint:o}=i,a=g(t),{wrapperAnimation:e,backdropAnimation:s}=void 0!==o?rt(i):{backdropAnimation:Z().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:Z().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return s.addElement(a.querySelector("ion-backdrop")),e.addElement(a.querySelector(".modal-wrapper")),Z().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,e])};let lt=null,ct=!1;const mt=()=>{if(null!==lt)return lt;const t=v?.document;if(!t?.body)return 0;const i=t.createElement("div");i.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);",t.body.appendChild(i);const o=parseFloat(getComputedStyle(i).paddingTop)||0;return i.remove(),lt=o,ct||(ct=!0,k((()=>{lt=null,ct=!1}))),o},ft=t=>{const i=getComputedStyle(t),o=M(i.getPropertyValue("--width")),a=M(i.getPropertyValue("--height"));return"fullscreen"===o&&"fullscreen"===a?{vertical:!0,horizontal:!0}:ut(t)},ut=t=>{const i=t.shadowRoot?.querySelector(".modal-wrapper");if(null==i||void 0===v)return{vertical:!1,horizontal:!1};const o=t.classList.contains("overlay-hidden");o&&t.classList.remove("overlay-hidden");const{width:a,height:e}=i.getBoundingClientRect();return o&&t.classList.add("overlay-hidden"),{vertical:e>=v.innerHeight-5,horizontal:a>=v.innerWidth-5}},bt=(t,i)=>{t.style.setProperty("--ion-safe-area-top",i.top),t.style.setProperty("--ion-safe-area-bottom",i.bottom),t.style.setProperty("--ion-safe-area-left",i.left),t.style.setProperty("--ion-safe-area-right",i.right)},xt=class{constructor(o){t(this,o),this.didPresent=i(this,"ionModalDidPresent",7),this.willPresent=i(this,"ionModalWillPresent",7),this.willDismiss=i(this,"ionModalWillDismiss",7),this.didDismiss=i(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=i(this,"ionBreakpointDidChange",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.ionMount=i(this,"ionMount",7),this.ionDragStart=i(this,"ionDragStart",7),this.ionDragMove=i(this,"ionDragMove",7),this.ionDragEnd=i(this,"ionDragEnd",7),this.lockController=S(),this.triggerController=T(),this.coreDelegate=u(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.isPresenting=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="cycle",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:i}=this;"cycle"===i&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,B)},this.onLifecycle=t=>{const i=this.usersElement,o=vt[t.type];if(i&&o){const a=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});i.dispatchEvent(a)}},this.onModalFocus=t=>{const{dragHandleEl:i,el:o}=this;t.target===o&&null==o.shadowRoot?.activeElement&&i&&-1!==i.tabIndex&&i.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,i){!0===t&&!1===i?this.present():!1===t&&!0===i&&this.dismiss()}triggerChanged(){const{trigger:t,el:i,triggerController:o}=this;t&&o.addClickListener(i,t)}onWindowResize(){this.presented&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{const t=this.getSafeAreaContext();if(!t.isCardModal||this.enterAnimation||this.leaveAnimation||this.handleViewTransition(),t.isSheetModal&&this.updateSheetOffsetTop(),!t.isSheetModal&&!t.isCardModal){this.updateSafeAreaOverrides();const{contentEl:t,hasFooter:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(t),this.applyFullscreenSafeAreaTo(t,i)}}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,i)=>t-i)))}connectedCallback(){const{el:t}=this;P(t),this.triggerChanged(),(this.presented||this.isPresenting)&&this.restoreSafeAreaOverrides(),this.presented&&(N(t),this.initParentRemovalObserver())}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.presented&&I()}componentWillLoad(){const{breakpoints:t,initialBreakpoint:i,el:a,htmlAttributes:e}=this,s=this.isSheetModal=void 0!==t&&void 0!==i,r=["aria-label","role"];this.inheritedAttributes=A(a,r),a.parentNode&&(this.cachedOriginalParent=a.parentNode),void 0!==e&&r.forEach((t=>{e[t]&&(this.inheritedAttributes={...this.inheritedAttributes,[t]:e[t]},delete e[t])})),s&&(this.currentBreakpoint=this.initialBreakpoint),void 0===t||void 0===i||t.includes(i)||o("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),this.htmlAttributes?.id||j(this.el)}componentDidLoad(){!0===this.isOpen&&k((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const i=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:i,delegate:this.workingDelegate=i?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,i){const{canDismiss:o}=this;return"function"==typeof o?o(t,i):o}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:i,el:o}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:e,delegate:s}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await b(s,o,this.component,["ion-page"],this.componentProps,e),Y(o)?await F(this.usersElement):this.keepContentsMounted||await W(),a((()=>this.el.classList.add("show-modal"))),this.isSheetModal=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint,this.isPresenting=!0;const r=void 0!==i;try{this.setInitialSafeAreaOverrides(),r&&"ios"===H(this)&&(this.statusBarStyle=await G.getStyle(),q()),await R(this,"modalEnter",nt,ht,{presentingEl:i,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})}finally{this.isPresenting=!1}this.updateSafeAreaOverrides(),this.applyFullscreenSafeArea(),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),k((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(V,this.keyboardOpenCallback)),this.isSheetModal?this.initSheetGesture():r&&this.initSwipeToClose(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){if("ios"!==H(this))return;const{el:t}=this,i=this.leaveAnimation||e.get("modalLeave",dt),o=this.animation=i(t,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});m(t)?(this.gesture=((t,i,o,a,e,s,r)=>{const n=.5,h=t.offsetHeight;let m=!1,f=!1,u=null,b=!0,x=0;const v=K({el:t,gestureName:"modalSwipeToClose",gesturePriority:O,direction:"y",threshold:10,canStart:t=>{const i=t.event.target;return null===i||!i.closest||(u=p(i),u?Q(u):null===i.closest("ion-footer"))},onStart:o=>{const{deltaY:a}=o;window.getSelection()?.removeAllRanges(),b=!u||!d(u)||u.scrollY,f=void 0!==t.canDismiss&&!0!==t.canDismiss,a>0&&u&&l(u),i.progressStart(!0,m?1:0),e()},onMove:a=>{const{deltaY:e}=a;e>0&&u&&l(u);const r=a.deltaY/h,d=r>=0&&f,p=d?.2:.9999,c=d?it(r/p):r,m=y(1e-4,c,p);i.progressStep(m),m>=n&&x<n?J(o):m<n&&x>=n&&q(),x=m;const b={currentY:a.currentY,deltaY:a.deltaY,velocityY:a.velocityY,progress:et(t,a.deltaY)};s(b)},onEnd:o=>{const e=o.velocityY,s=o.deltaY/h,d=s>=0&&f,p=d?.2:.9999,l=d?it(s/p):s,x=y(1e-4,l,p),w=!d&&(o.deltaY+1e3*e)/h>=n;let g=w?-.001:.001;w?(i.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=_([0,0],[.32,.72],[0,1],[1,1],x)[0]):(i.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=_([0,0],[1,0],[.68,.28],[1,1],x)[0]);const k=at(w?s*h:(1-x)*h,e);m=w,v.enable(!1),u&&c(u,b),i.onFinish((()=>{w||v.enable(!0)})).progressEnd(w?1:0,g,k);const A=d&&x>p/4;A?tt(t,i):w&&a();const Y=d?A&&"function"==typeof t.canDismiss:w,S={currentY:o.currentY,deltaY:o.deltaY,velocityY:o.velocityY,progress:et(t,o.deltaY),isDismissing:Y};r(S)}});return v})(t,o,this.statusBarStyle??U.Default,(()=>this.cardOnDismiss()),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t))),this.gesture.enable(!0)):f(t)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:i,backdropBreakpoint:o}=this;if(!t||void 0===i)return;const a=this.enterAnimation||e.get("modalEnter",nt),s=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:this.expandToScroll});s.progressStart(!0,1);const{gesture:r,moveSheetToBreakpoint:n,resetContentScroll:h}=((t,i,o,a,e,s,r=[],n,h,l,c,m,f,u)=>{const b={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==e?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-e,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},x=t.querySelector("ion-content"),v=x?.scrollY??!0,w=o.clientHeight;let A=a,Y=0,S=!1,D=null,E=null,O=null,M=null;const T=r[r.length-1],B=r[0],P=s.childAnimations.find((t=>"wrapperAnimation"===t.id)),N=s.childAnimations.find((t=>"backdropAnimation"===t.id)),I=s.childAnimations.find((t=>"contentAnimation"===t.id)),j=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),i.style.setProperty("pointer-events","auto"),t.classList.remove(C))},R=()=>{t.style.setProperty("pointer-events","none"),i.style.setProperty("pointer-events","none"),t.classList.add(C)},$=i=>{if(!E&&(E=Array.from(t.querySelectorAll("ion-footer")),!E.length))return;const o=t.querySelector(".ion-page");if(M=i,"stationary"===i)E.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),o?.style.removeProperty("padding-bottom"),o?.appendChild(t)}));else{let i=0;E.forEach(((o,a)=>{const e=o.getBoundingClientRect(),s=document.body.getBoundingClientRect();i+=o.clientHeight;const r=e.top-s.top,n=e.left-s.left;if(o.style.setProperty("--pinned-width",`${o.clientWidth}px`),o.style.setProperty("--pinned-height",`${o.clientHeight}px`),o.style.setProperty("--pinned-top",`${r}px`),o.style.setProperty("--pinned-left",`${n}px`),0===a){O=r;const i=t.querySelector("ion-header");i&&(O-=i.clientHeight)}})),E.forEach((t=>{o?.style.setProperty("padding-bottom",`${i}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};P&&N&&(P.keyframes([...b.WRAPPER_KEYFRAMES]),N.keyframes([...b.BACKDROP_KEYFRAMES]),I?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-A),A>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R()),x&&A!==T&&n&&(x.scrollY=!1);const L=i=>{const{breakpoint:o,canDismiss:a,breakpointOffset:d,animated:h}=i,p=a&&0===o,m=p?A:o,f=0!==m;return A=0,P&&N&&(P.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-m)}%)`}]),N.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${X(1-d,e)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${X(m,e)})`}]),I&&I.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*m+"%"}]),s.progressStep(0)),H.enable(!1),p?tt(t,s):f||l(),!x||m!==r[r.length-1]&&n||(x.scrollY=v),n||0!==m||$("stationary"),new Promise((i=>{s.onFinish((()=>{f?(n||$("stationary"),P&&N?k((()=>{P.keyframes([...b.WRAPPER_KEYFRAMES]),N.keyframes([...b.BACKDROP_KEYFRAMES]),I?.keyframes([...b.CONTENT_KEYFRAMES]),s.progressStart(!0,1-m),A=m,c(A),A>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?j():R(),H.enable(!0),i()})):(H.enable(!0),i())):i()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},z=t=>{const i=o.getBoundingClientRect().top+t,a=F(i);return r.reduce(((t,i)=>Math.abs(i-a)<Math.abs(t-a)?i:t))},F=t=>{const i=r[r.length-1],o=W(r[0]),a=W(i),e=Math.round((o-t)/(o-a)*1e3)/1e3;return Math.max(0,Math.min(1,e))},W=i=>{const o=t.getBoundingClientRect();return window.innerHeight-o.height*i},H=K({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const i=p(t.event.target);return A=h(),!(i&&(!n||1===A))||Q(i)},onStart:i=>{if(window.getSelection()?.removeAllRanges(),S=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===B,!n){const t=p(i.event.target);D=t&&d(t)?g(t).querySelector(".inner-scroll"):t}n||$("moving"),i.deltaY>0&&x&&(x.scrollY=!1),k((()=>{t.focus()})),s.progressStart(!0,1-A),m()},onMove:t=>{if(n||null===O||null===M||(t.currentY>=O&&"moving"===M?$("stationary"):t.currentY<O&&"stationary"===M&&$("moving")),!n&&t.deltaY<=0&&D)return;t.deltaY>0&&x&&(x.scrollY=!1);const i=r.length>1?1-r[1]:void 0,o=1-A+t.deltaY/w,a=void 0!==i&&o>=i&&S,e=a?.95:.9999,d=a&&void 0!==i?i+it((o-i)/(e-i)):o;Y=y(1e-4,d,e),s.progressStep(Y);const h=z(t.deltaY),p={currentY:t.currentY,deltaY:t.deltaY,velocityY:t.velocityY,progress:F(t.currentY),snapBreakpoint:h};f(p)},onEnd:i=>{const o=z(i.deltaY),a=S&&0===o?"function"==typeof t.canDismiss:0===o,e={currentY:i.currentY,deltaY:i.deltaY,velocityY:i.velocityY,progress:F(i.currentY),snapBreakpoint:o,isDismissing:a};if(!n&&i.deltaY<=0&&D&&D.scrollTop>0)return $("stationary"),void u({...e,isDismissing:!1});L({breakpoint:o,breakpointOffset:Y,canDismiss:S,animated:!0}),u(e)}});return{gesture:H,moveSheetToBreakpoint:L,resetContentScroll:()=>{x&&(x.scrollY=v)}}})(this.el,this.backdropEl,t,i,o,s,this.sortedBreakpoints,this.expandToScroll,(()=>this.currentBreakpoint??0),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}),(()=>this.onDragStart()),(t=>this.onDragMove(t)),(t=>this.onDragEnd(t)));this.gesture=r,this.moveSheetToBreakpoint=n,this.resetSheetContentScroll=h,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||o>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){this.cachedPageParent=this.getOriginalPageParent();const t=this.cachedPageParent;if(!t||"ION-APP"===t.tagName)return;if(Array.from(t.children).some((t=>!(t===this.el||t instanceof HTMLElement&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!t.textContent?.trim()))))return;t.classList.add("ion-page-overlay-passthrough");const i=t.parentElement;"ION-ROUTER-OUTLET"===i?.tagName&&"ION-APP"!==i.parentElement?.tagName&&(i.style.setProperty("pointer-events","none"),i.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const i=t.parentElement;i?.hasAttribute("data-overlay-passthrough")&&(i.style.removeProperty("pointer-events"),i.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,E),this.gestureAnimationDismissing=!1}))}cardOnDismiss(){this.gestureAnimationDismissing=!0,J(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,E),this.gestureAnimationDismissing=!1}))}async dismiss(t,i){if(this.gestureAnimationDismissing&&i!==E)return!1;clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0;const o=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==i&&!await this.checkCanDismiss(t,i))return o(),!1;const{presentingElement:e}=this;void 0!==e&&"ios"===H(this)&&J(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(V,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await $(this,t,i,"modalLeave",dt,pt,{presentingEl:e,currentBreakpoint:this.currentBreakpoint??this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await x(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),this.resetSheetContentScroll?.(),this.resetSheetContentScroll=void 0,this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupSafeAreaOverrides(),this.cleanupChildRoutePassthrough()}return this.currentBreakpoint=void 0,this.animation=void 0,o(),s}onDidDismiss(){return L(this.el,"ionModalDidDismiss")}onWillDismiss(){return L(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void o("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void o(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:i,moveSheetToBreakpoint:a,canDismiss:e,breakpoints:s,animated:r}=this;i!==t&&a&&(this.sheetTransition=a({breakpoint:t,breakpointOffset:1-i,canDismiss:void 0!==e&&!0!==e&&0===s[0],animated:r}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:i}=this;if(!t||null==i)return!1;const o=t.filter((t=>0!==t)),a=o.indexOf(i),e=o[(a+1)%o.length];return await this.setCurrentBreakpoint(e),!0}initViewTransitionListener(){"ios"!==H(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:i}=this;if(!i)return;let o;o=this.currentViewIsPortrait&&!t?((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return Z("portrait-to-landscape-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=g(a),r=document.body,n=Z("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0px) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i).fromTo("filter","contrast(0.85)","contrast(1)");const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>r.style.setProperty("background-color",""))).fromTo("transform",s,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}):((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return Z("landscape-to-portrait-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=g(a),r=document.body,n=Z("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=Z().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i);const o=Z().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=g(t),o=Z().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=Z().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:s}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:s,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=o,o.play().then((()=>{this.viewTransitionAnimation=void 0,k((()=>this.updateSafeAreaOverrides())),this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===H(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),k((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:i}=this,o=g(t).querySelector(".modal-wrapper");if(o&&(o.style.transform="translateY(0vh)",o.style.opacity="1"),"ION-MODAL"===i?.tagName)if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";i.style.transform=`translateY(${t}) scale(0.915)`}else i.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);t?.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.cleanupParentRemovalObserver(),this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{const i=t===this.cachedOriginalParent,o=!!this.cachedOriginalParent&&t.contains?.(this.cachedOriginalParent);return i||o}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){this.parentRemovalObserver?.disconnect(),this.parentRemovalObserver=void 0}onDragStart(){this.ionDragStart.emit()}onDragMove(t){this.ionDragMove.emit(t)}onDragEnd(t){this.ionDragEnd.emit(t)}getSafeAreaContext(){return{isSheetModal:this.isSheetModal,isCardModal:void 0!==this.presentingElement&&"ios"===H(this),presentingElement:this.presentingElement,breakpoints:this.breakpoints,currentBreakpoint:this.currentBreakpoint}}watchHeightForContent(){var t;this.isSheetModal||(this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=(t=()=>{this.el.querySelectorAll("ion-content").forEach((t=>t.recalculateDimensions()))},w(this.el,"--height",(()=>t()))))}setInitialSafeAreaOverrides(){const t={...this.getSafeAreaContext(),coveredAxes:ft(this.el)},i=(t=>{const{isSheetModal:i,isCardModal:o}=t;if(i)return{top:"0px",bottom:"inherit",left:"0px",right:"0px"};if(o)return{top:"inherit",bottom:"inherit",left:"0px",right:"0px"};const{vertical:a,horizontal:e}=t.coveredAxes??{vertical:!0,horizontal:!0};return{top:a?"inherit":"0px",bottom:a?"inherit":"0px",left:e?"inherit":"0px",right:e?"inherit":"0px"}})(t);var o;bt(this.el,i),this.watchHeightForContent(),t.isSheetModal&&(this.updateSheetOffsetTop(),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=(o=t=>this.updateSheetOffsetTop(t),w(v?.document?.body,"--ion-safe-area-top",o,mt())))}updateSheetOffsetTop(t){const i=t??mt();this.el.style.setProperty("--ion-modal-offset-top",`${i}px`)}updateSafeAreaOverrides(){const{wrapperEl:t,el:i}=this,o=this.getSafeAreaContext();if(o.isSheetModal)return;if(o.isCardModal)return;if(!t)return;const a=(t=>{const i=t.getBoundingClientRect();return{top:i.top<=5?"inherit":"0px",bottom:i.bottom>=(v?.innerHeight??0)-5?"inherit":"0px",left:i.left<=5?"inherit":"0px",right:i.right>=(v?.innerWidth??0)-5?"inherit":"0px"}})(t);bt(i,a)}applyFullscreenSafeArea(){const t=this.getSafeAreaContext();if(t.isSheetModal||t.isCardModal)return;const{contentEl:i,hasFooter:o}=this.findContentAndFooter();this.applyFullscreenSafeAreaTo(i,o)}applyFullscreenSafeAreaTo(t,i){t&&!i&&t.style.setProperty("--internal-content-safe-area-padding-bottom","var(--ion-safe-area-bottom, 0px)")}clearContentSafeAreaPadding(t){t&&t.style.removeProperty("--internal-content-safe-area-padding-bottom")}findContentAndFooter(){let t=null,i=!1;for(const o of Array.from(this.el.children)){"ION-CONTENT"===o.tagName&&(t=o),"ION-FOOTER"===o.tagName&&(i=!0);for(const a of Array.from(o.children))"ION-CONTENT"!==a.tagName||t||(t=a),"ION-FOOTER"===a.tagName&&(i=!0)}return{contentEl:t,hasFooter:i}}cleanupSafeAreaOverrides(){var t;(t=this.el).style.removeProperty("--ion-safe-area-top"),t.style.removeProperty("--ion-safe-area-bottom"),t.style.removeProperty("--ion-safe-area-left"),t.style.removeProperty("--ion-safe-area-right"),this.unsubscribeRootSafeAreaTop?.(),this.unsubscribeRootSafeAreaTop=void 0,this.unsubscribeHeightChange?.(),this.unsubscribeHeightChange=void 0,this.el.style.removeProperty("--ion-modal-offset-top");const{contentEl:i}=this.findContentAndFooter();this.clearContentSafeAreaPadding(i)}restoreSafeAreaOverrides(){this.setInitialSafeAreaOverrides(),this.applyFullscreenSafeArea(),k((()=>{if(!this.presented||!this.el.isConnected||this.isPresenting)return;const{width:t,height:i}=this.el.getBoundingClientRect();0===t&&0===i||this.updateSafeAreaOverrides()}))}render(){const{handle:t,isSheetModal:i,presentingElement:o,htmlAttributes:a,handleBehavior:e,inheritedAttributes:n,focusTrap:d,expandToScroll:h}=this,p=!1!==t&&i,l=H(this),c=void 0!==o&&"ios"===l,m="cycle"===e;return s(r,{key:"17a95bd7722bac2344bea041aff97db17f55c0cf","no-router":!0,tabIndex:m&&i&&p?0:-1,...a,style:{zIndex:`${2e4+this.overlayIndex}`},class:{[l]:!0,"modal-default":!c&&!i,"modal-card":c,"modal-sheet":i,"modal-no-expand-scroll":i&&!h,"overlay-hidden":!0,[C]:!1===d,...z(this.cssClass)},onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus},s("ion-backdrop",{key:"9dab1ef4771c0d847ba2be8672afbaa2748517f3",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===l&&s("div",{key:"64af7ed1c5f552b61fc4b9387b926acc76c8a99a",class:"modal-shadow"}),s("div",{key:"7e76d77d5b2e8f0467bb793facf5aa86f8d01bbe",role:"dialog",...n,"aria-modal":"true",tabIndex:-1,class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},p&&s("button",{key:"5efc0bb0a59adcc594ac48da9fd90e57908a7ffb",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),s("slot",{key:"6175fcd0b39c086b4e9eb9e96c4d631c2a86774b",onSlotchange:this.onSlotChange})))}get el(){return n(this)}static get watchers(){return{isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}],breakpoints:[{breakpointsChanged:0}]}}},vt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};xt.style={ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--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-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:100%;--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-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;outline:none}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-modal-offset-top, 0px) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'};export{xt as ion_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,d as i,i as s,a as e,h as o,g as n,f as r}from"./p-BpRUsN_W.js";import{g as h}from"./p-hHmYLOfE.js";import{l as a}from"./p-Co7eql8D.js";import{l as c,t as d,s as l,d as u,b as v,c as f}from"./p-DQXtveHv.js";import{b as m}from"./p-SEecsUh7.js";import{a as p}from"./p-nCAPr1Ah.js";import"./p-Dojwmvde.js";class w{constructor(t,i){this.component=t,this.params=i,this.state=1}async init(t){if(this.state=2,!this.element){const i=this.component;this.element=await p(this.delegate,t,i,["ion-page","ion-page-invisible"],this.params)}}_destroy(){a(3!==this.state,"view state must be ATTACHED");const t=this.element;t&&(this.delegate?this.delegate.removeViewFromDom(t.parentElement,t):t.remove()),this.nav=void 0,this.state=3}}const g=(t,i)=>t?t instanceof w?t:new w(t,i):null,b=class{constructor(s){t(this,s),this.ionNavWillLoad=i(this,"ionNavWillLoad",7),this.ionNavWillChange=i(this,"ionNavWillChange",3),this.ionNavDidChange=i(this,"ionNavDidChange",3),this.transInstr=[],this.gestureOrAnimationInProgress=!1,this.isTransitioning=!1,this.destroyed=!1,this.views=[],this.didLoad=!1,this.animated=!0}swipeGestureChanged(){this.gesture&&this.gesture.enable(!0===this.swipeGesture)}rootChanged(){void 0!==this.root&&!1!==this.didLoad&&this.setRoot(this.root,this.rootParams)}componentWillLoad(){if(void 0===this.swipeGesture){const t=m(this);this.swipeGesture=s.getBoolean("swipeBackEnabled","ios"===t)}this.ionNavWillLoad.emit()}async componentDidLoad(){this.didLoad=!0,this.rootChanged(),this.gesture=(await import("./p-CngfKMRU.js")).createSwipeBackGesture(this.el,this.canStart.bind(this),this.onStart.bind(this),this.onMove.bind(this),this.onEnd.bind(this)),this.swipeGestureChanged()}connectedCallback(){this.destroyed=!1}disconnectedCallback(){for(const t of this.views)c(t.element,u),t._destroy();this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.transInstr.length=0,this.views.length=0,this.destroyed=!0}push(t,i,s,e){return this.insert(-1,t,i,s,e)}insert(t,i,s,e,o){return this.insertPages(t,[{component:i,componentProps:s}],e,o)}insertPages(t,i,s,e){return this.queueTrns({insertStart:t,insertViews:i,opts:s},e)}pop(t,i){return this.removeIndex(-1,1,t,i)}popTo(t,i,s){const e={removeStart:-1,removeCount:-1,opts:i};return"object"==typeof t&&t.component?(e.removeView=t,e.removeStart=1):"number"==typeof t&&(e.removeStart=t+1),this.queueTrns(e,s)}popToRoot(t,i){return this.removeIndex(1,-1,t,i)}removeIndex(t,i=1,s,e){return this.queueTrns({removeStart:t,removeCount:i,opts:s},e)}setRoot(t,i,s,e){return this.setPages([{component:t,componentProps:i}],s,e)}setPages(t,i,s){return i??={},!0!==i.animated&&(i.animated=!1),this.queueTrns({insertStart:0,insertViews:t,removeStart:0,removeCount:-1,opts:i},s)}async getActive(){return this.getActiveSync()}async getByIndex(t){return this.views[t]}async canGoBack(t){return this.canGoBackSync(t)}async getPrevious(t){return this.getPreviousSync(t)}async getLength(){return Promise.resolve(this.views.length)}getActiveSync(){return this.views[this.views.length-1]}canGoBackSync(t=this.getActiveSync()){return!(!t||!this.getPreviousSync(t))}getPreviousSync(t=this.getActiveSync()){if(!t)return;const i=this.views,s=i.indexOf(t);return s>0?i[s-1]:void 0}async queueTrns(t,i){if(this.isTransitioning&&t.opts?.skipIfBusy)return!1;const s=new Promise(((i,s)=>{t.resolve=i,t.reject=s}));return t.done=i,0===t.insertViews?.length&&(t.insertViews=void 0),this.transInstr.push(t),this.nextTrns(),s}success(t,i){this.destroyed?this.fireError("nav controller was destroyed",i):(i.done&&i.done(t.hasCompleted,t.requiresTransition,t.enteringView,t.leavingView,t.direction),i.resolve(t.hasCompleted))}failed(t,i){this.destroyed?this.fireError("nav controller was destroyed",i):(this.transInstr.length=0,this.fireError(t,i))}fireError(t,i){i.done&&i.done(!1,!1,t),i.reject&&!this.destroyed?i.reject(t):i.resolve(!1)}nextTrns(){if(this.isTransitioning)return!1;const t=this.transInstr.shift();return!!t&&(this.runTransition(t),!0)}async runTransition(t){try{this.ionNavWillChange.emit(),this.isTransitioning=!0,this.prepareTI(t);const i=this.getActiveSync(),s=this.getEnteringView(t,i);if(!i&&!s)throw new Error("no views in the stack to be removed");s&&1===s.state&&await s.init(this.el),this.postViewInit(s,i,t);const e=(t.enteringRequiresTransition||t.leavingRequiresTransition)&&s!==i;let o;e&&t.opts&&i&&("back"===t.opts.direction&&(t.opts.animationBuilder=t.opts.animationBuilder||s?.animationBuilder),i.animationBuilder=t.opts.animationBuilder),o=e?await this.transition(s,i,t):{hasCompleted:!0,requiresTransition:!1},this.success(o,t),this.ionNavDidChange.emit()}catch(i){this.failed(i,t)}this.isTransitioning=!1,this.nextTrns()}prepareTI(t){const i=this.views.length;if(t.opts??={},t.opts.delegate??=this.delegate,void 0!==t.removeView){a(void 0!==t.removeStart,"removeView needs removeStart"),a(void 0!==t.removeCount,"removeView needs removeCount");const i=this.views.indexOf(t.removeView);if(i<0)throw new Error("removeView was not found");t.removeStart+=i}void 0!==t.removeStart&&(t.removeStart<0&&(t.removeStart=i-1),t.removeCount<0&&(t.removeCount=i-t.removeStart),t.leavingRequiresTransition=t.removeCount>0&&t.removeStart+t.removeCount===i),t.insertViews&&((t.insertStart<0||t.insertStart>i)&&(t.insertStart=i),t.enteringRequiresTransition=t.insertStart===i);const s=t.insertViews;if(!s)return;a(s.length>0,"length can not be zero");const e=s.map((t=>t instanceof w?t:"component"in t?g(t.component,null===t.componentProps?void 0:t.componentProps):g(t,void 0))).filter((t=>null!==t));if(0===e.length)throw new Error("invalid views to insert");for(const i of e){i.delegate=t.opts.delegate;const s=i.nav;if(s&&s!==this)throw new Error("inserted view was already inserted");if(3===i.state)throw new Error("inserted view was already destroyed")}t.insertViews=e}getEnteringView(t,i){const s=t.insertViews;if(void 0!==s)return s[s.length-1];const e=t.removeStart;if(void 0!==e){const s=this.views,o=e+t.removeCount;for(let t=s.length-1;t>=0;t--){const n=s[t];if((t<e||t>=o)&&n!==i)return n}}}postViewInit(t,i,s){a(i||t,"Both leavingView and enteringView are null"),a(s.resolve,"resolve must be valid"),a(s.reject,"reject must be valid");const o=s.opts,{insertViews:n,removeStart:r,removeCount:h}=s;let d;if(void 0!==r&&void 0!==h){a(r>=0,"removeStart can not be negative"),a(h>=0,"removeCount can not be negative"),d=[];for(let s=r;s<r+h;s++){const e=this.views[s];void 0!==e&&e!==t&&e!==i&&d.push(e)}o.direction??="back"}const l=this.views.length+(n?.length??0)-(h??0);if(a(l>=0,"final balance can not be negative"),0===l)throw e("[ion-nav] - You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.",this,this.el),new Error("navigation stack needs at least one root page");if(n){let t=s.insertStart;for(const i of n)this.insertViewAt(i,t),t++;s.enteringRequiresTransition&&(o.direction??="forward")}if(d&&d.length>0){for(const t of d)c(t.element,v),c(t.element,f),c(t.element,u);for(const t of d)this.destroyView(t)}}async transition(t,i,e){const o=e.opts,n=o.progressAnimation?t=>{void 0===t||this.gestureOrAnimationInProgress?this.sbAni=t:(this.gestureOrAnimationInProgress=!0,t.onFinish((()=>{this.gestureOrAnimationInProgress=!1}),{oneTimeCallback:!0}),t.progressEnd(0,0,0))}:void 0,r=m(this),h=t.element,a=i&&i.element,c={mode:r,showGoBack:this.canGoBackSync(t),baseEl:this.el,progressCallback:n,animated:this.animated&&s.getBoolean("animated",!0),enteringEl:h,leavingEl:a,...o,animationBuilder:o.animationBuilder||this.animation||s.get("navAnimation")},{hasCompleted:l}=await d(c);return this.transitionFinish(l,t,i,o)}transitionFinish(t,i,s,e){const o=t?i:s;return o&&this.unmountInactiveViews(o),{hasCompleted:t,requiresTransition:!0,enteringView:i,leavingView:s,direction:e.direction}}insertViewAt(t,i){const s=this.views,e=s.indexOf(t);e>-1?(a(t.nav===this,"view is not part of the nav"),s.splice(e,1),s.splice(i,0,t)):(a(!t.nav,"nav is used"),t.nav=this,s.splice(i,0,t))}removeView(t){a(2===t.state||3===t.state,"view state should be loaded or destroyed");const i=this.views,s=i.indexOf(t);a(s>-1,"view must be part of the stack"),s>=0&&i.splice(s,1)}destroyView(t){t._destroy(),this.removeView(t)}unmountInactiveViews(t){if(this.destroyed)return;const i=this.views,s=i.indexOf(t);for(let t=i.length-1;t>=0;t--){const e=i[t],o=e.element;o&&(t>s?(c(o,u),this.destroyView(e)):t<s&&l(o,!0))}}canStart(){return!this.gestureOrAnimationInProgress&&!!this.swipeGesture&&!this.isTransitioning&&0===this.transInstr.length&&this.canGoBackSync()}onStart(){this.gestureOrAnimationInProgress=!0,this.pop({direction:"back",progressAnimation:!0})}onMove(t){this.sbAni&&this.sbAni.progressStep(t)}onEnd(t,i,s){if(this.sbAni){this.sbAni.onFinish((()=>{this.gestureOrAnimationInProgress=!1}),{oneTimeCallback:!0});let e=t?-.001:.001;t?e+=h([0,0],[.32,.72],[0,1],[1,1],i)[0]:(this.sbAni.easing("cubic-bezier(1, 0, 0.68, 0.28)"),e+=h([0,0],[1,0],[.68,.28],[1,1],i)[0]),this.sbAni.progressEnd(t?1:0,e,s)}else this.gestureOrAnimationInProgress=!1}render(){return o("slot",{key:"1886154d3c2fa8511af4d641d269aaa4c0f45c05"})}get el(){return n(this)}static get watchers(){return{swipeGesture:[{swipeGestureChanged:0}],root:[{rootChanged:0}]}}};b.style=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;z-index:0}";const y=class{constructor(i){t(this,i),this.routerDirection="forward",this.onClick=()=>((t,i,s,e,o)=>{const n=this.el.closest("ion-nav");if(n)if("forward"===i){if(void 0!==s)return n.push(s,e,{skipIfBusy:!0,animationBuilder:o})}else if("root"===i){if(void 0!==s)return n.setRoot(s,e,{skipIfBusy:!0,animationBuilder:o})}else if("back"===i)return n.pop({skipIfBusy:!0,animationBuilder:o});return Promise.resolve(!1)})(0,this.routerDirection,this.component,this.componentProps,this.routerAnimation)}render(){return o(r,{key:"4bcaa74015462824b3f19253b04a77ce83389ca0",onClick:this.onClick})}get el(){return n(this)}};export{b as ion_nav,y as ion_nav_link}
|
|
4
|
+
import{r as t,d as i,i as s,a as e,h as o,g as n,f as r}from"./p-BpRUsN_W.js";import{g as h}from"./p-hHmYLOfE.js";import{l as a}from"./p-Co7eql8D.js";import{l as c,t as d,s as l,f as u,d as v,b as f,c as m}from"./p-Dk4Mdaru.js";import{b as p}from"./p-SEecsUh7.js";import{a as w}from"./p-nCAPr1Ah.js";import"./p-Dojwmvde.js";class g{constructor(t,i){this.component=t,this.params=i,this.state=1}async init(t){if(this.state=2,!this.element){const i=this.component;this.element=await w(this.delegate,t,i,["ion-page","ion-page-invisible"],this.params)}}_destroy(){a(3!==this.state,"view state must be ATTACHED");const t=this.element;t&&(this.delegate?this.delegate.removeViewFromDom(t.parentElement,t):t.remove()),this.nav=void 0,this.state=3}}const b=(t,i)=>t?t instanceof g?t:new g(t,i):null,y=class{constructor(s){t(this,s),this.ionNavWillLoad=i(this,"ionNavWillLoad",7),this.ionNavWillChange=i(this,"ionNavWillChange",3),this.ionNavDidChange=i(this,"ionNavDidChange",3),this.transInstr=[],this.gestureOrAnimationInProgress=!1,this.isTransitioning=!1,this.destroyed=!1,this.views=[],this.didLoad=!1,this.animated=!0}swipeGestureChanged(){this.gesture&&this.gesture.enable(!0===this.swipeGesture)}rootChanged(){void 0!==this.root&&!1!==this.didLoad&&this.setRoot(this.root,this.rootParams)}componentWillLoad(){if(void 0===this.swipeGesture){const t=p(this);this.swipeGesture=s.getBoolean("swipeBackEnabled","ios"===t)}this.ionNavWillLoad.emit()}async componentDidLoad(){this.didLoad=!0,this.rootChanged(),this.gesture=(await import("./p-CngfKMRU.js")).createSwipeBackGesture(this.el,this.canStart.bind(this),this.onStart.bind(this),this.onMove.bind(this),this.onEnd.bind(this)),this.swipeGestureChanged()}connectedCallback(){this.destroyed=!1}disconnectedCallback(){for(const t of this.views)c(t.element,v),t._destroy();this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.unblockSwipeClicks&&(this.unblockSwipeClicks(),this.unblockSwipeClicks=void 0,this.gestureOrAnimationInProgress=!1),this.transInstr.length=0,this.views.length=0,this.destroyed=!0}push(t,i,s,e){return this.insert(-1,t,i,s,e)}insert(t,i,s,e,o){return this.insertPages(t,[{component:i,componentProps:s}],e,o)}insertPages(t,i,s,e){return this.queueTrns({insertStart:t,insertViews:i,opts:s},e)}pop(t,i){return this.removeIndex(-1,1,t,i)}popTo(t,i,s){const e={removeStart:-1,removeCount:-1,opts:i};return"object"==typeof t&&t.component?(e.removeView=t,e.removeStart=1):"number"==typeof t&&(e.removeStart=t+1),this.queueTrns(e,s)}popToRoot(t,i){return this.removeIndex(1,-1,t,i)}removeIndex(t,i=1,s,e){return this.queueTrns({removeStart:t,removeCount:i,opts:s},e)}setRoot(t,i,s,e){return this.setPages([{component:t,componentProps:i}],s,e)}setPages(t,i,s){return i??={},!0!==i.animated&&(i.animated=!1),this.queueTrns({insertStart:0,insertViews:t,removeStart:0,removeCount:-1,opts:i},s)}async getActive(){return this.getActiveSync()}async getByIndex(t){return this.views[t]}async canGoBack(t){return this.canGoBackSync(t)}async getPrevious(t){return this.getPreviousSync(t)}async getLength(){return Promise.resolve(this.views.length)}getActiveSync(){return this.views[this.views.length-1]}canGoBackSync(t=this.getActiveSync()){return!(!t||!this.getPreviousSync(t))}getPreviousSync(t=this.getActiveSync()){if(!t)return;const i=this.views,s=i.indexOf(t);return s>0?i[s-1]:void 0}async queueTrns(t,i){if(this.isTransitioning&&t.opts?.skipIfBusy)return!1;const s=new Promise(((i,s)=>{t.resolve=i,t.reject=s}));return t.done=i,0===t.insertViews?.length&&(t.insertViews=void 0),this.transInstr.push(t),this.nextTrns(),s}success(t,i){this.destroyed?this.fireError("nav controller was destroyed",i):(i.done&&i.done(t.hasCompleted,t.requiresTransition,t.enteringView,t.leavingView,t.direction),i.resolve(t.hasCompleted))}failed(t,i){this.destroyed?this.fireError("nav controller was destroyed",i):(this.transInstr.length=0,this.fireError(t,i))}fireError(t,i){i.done&&i.done(!1,!1,t),i.reject&&!this.destroyed?i.reject(t):i.resolve(!1)}nextTrns(){if(this.isTransitioning)return!1;const t=this.transInstr.shift();return!!t&&(this.runTransition(t),!0)}async runTransition(t){try{this.ionNavWillChange.emit(),this.isTransitioning=!0,this.prepareTI(t);const i=this.getActiveSync(),s=this.getEnteringView(t,i);if(!i&&!s)throw new Error("no views in the stack to be removed");s&&1===s.state&&await s.init(this.el),this.postViewInit(s,i,t);const e=(t.enteringRequiresTransition||t.leavingRequiresTransition)&&s!==i;let o;e&&t.opts&&i&&("back"===t.opts.direction&&(t.opts.animationBuilder=t.opts.animationBuilder||s?.animationBuilder),i.animationBuilder=t.opts.animationBuilder),o=e?await this.transition(s,i,t):{hasCompleted:!0,requiresTransition:!1},this.success(o,t),this.ionNavDidChange.emit()}catch(i){this.failed(i,t)}this.isTransitioning=!1,this.nextTrns()}prepareTI(t){const i=this.views.length;if(t.opts??={},t.opts.delegate??=this.delegate,void 0!==t.removeView){a(void 0!==t.removeStart,"removeView needs removeStart"),a(void 0!==t.removeCount,"removeView needs removeCount");const i=this.views.indexOf(t.removeView);if(i<0)throw new Error("removeView was not found");t.removeStart+=i}void 0!==t.removeStart&&(t.removeStart<0&&(t.removeStart=i-1),t.removeCount<0&&(t.removeCount=i-t.removeStart),t.leavingRequiresTransition=t.removeCount>0&&t.removeStart+t.removeCount===i),t.insertViews&&((t.insertStart<0||t.insertStart>i)&&(t.insertStart=i),t.enteringRequiresTransition=t.insertStart===i);const s=t.insertViews;if(!s)return;a(s.length>0,"length can not be zero");const e=s.map((t=>t instanceof g?t:"component"in t?b(t.component,null===t.componentProps?void 0:t.componentProps):b(t,void 0))).filter((t=>null!==t));if(0===e.length)throw new Error("invalid views to insert");for(const i of e){i.delegate=t.opts.delegate;const s=i.nav;if(s&&s!==this)throw new Error("inserted view was already inserted");if(3===i.state)throw new Error("inserted view was already destroyed")}t.insertViews=e}getEnteringView(t,i){const s=t.insertViews;if(void 0!==s)return s[s.length-1];const e=t.removeStart;if(void 0!==e){const s=this.views,o=e+t.removeCount;for(let t=s.length-1;t>=0;t--){const n=s[t];if((t<e||t>=o)&&n!==i)return n}}}postViewInit(t,i,s){a(i||t,"Both leavingView and enteringView are null"),a(s.resolve,"resolve must be valid"),a(s.reject,"reject must be valid");const o=s.opts,{insertViews:n,removeStart:r,removeCount:h}=s;let d;if(void 0!==r&&void 0!==h){a(r>=0,"removeStart can not be negative"),a(h>=0,"removeCount can not be negative"),d=[];for(let s=r;s<r+h;s++){const e=this.views[s];void 0!==e&&e!==t&&e!==i&&d.push(e)}o.direction??="back"}const l=this.views.length+(n?.length??0)-(h??0);if(a(l>=0,"final balance can not be negative"),0===l)throw e("[ion-nav] - You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.",this,this.el),new Error("navigation stack needs at least one root page");if(n){let t=s.insertStart;for(const i of n)this.insertViewAt(i,t),t++;s.enteringRequiresTransition&&(o.direction??="forward")}if(d&&d.length>0){for(const t of d)c(t.element,f),c(t.element,m),c(t.element,v);for(const t of d)this.destroyView(t)}}async transition(t,i,e){const o=e.opts,n=o.progressAnimation?t=>{void 0===t||this.gestureOrAnimationInProgress?this.sbAni=t:(this.gestureOrAnimationInProgress=!0,t.onFinish((()=>{this.gestureOrAnimationInProgress=!1}),{oneTimeCallback:!0}),t.progressEnd(0,0,0))}:void 0,r=p(this),h=t.element,a=i&&i.element,c={mode:r,showGoBack:this.canGoBackSync(t),baseEl:this.el,progressCallback:n,animated:this.animated&&s.getBoolean("animated",!0),enteringEl:h,leavingEl:a,...o,animationBuilder:o.animationBuilder||this.animation||s.get("navAnimation")},{hasCompleted:l}=await d(c);return this.transitionFinish(l,t,i,o)}transitionFinish(t,i,s,e){const o=t?i:s;return o&&this.unmountInactiveViews(o),{hasCompleted:t,requiresTransition:!0,enteringView:i,leavingView:s,direction:e.direction}}insertViewAt(t,i){const s=this.views,e=s.indexOf(t);e>-1?(a(t.nav===this,"view is not part of the nav"),s.splice(e,1),s.splice(i,0,t)):(a(!t.nav,"nav is used"),t.nav=this,s.splice(i,0,t))}removeView(t){a(2===t.state||3===t.state,"view state should be loaded or destroyed");const i=this.views,s=i.indexOf(t);a(s>-1,"view must be part of the stack"),s>=0&&i.splice(s,1)}destroyView(t){t._destroy(),this.removeView(t)}unmountInactiveViews(t){if(this.destroyed)return;const i=this.views,s=i.indexOf(t);for(let t=i.length-1;t>=0;t--){const e=i[t],o=e.element;o&&(t>s?(c(o,v),this.destroyView(e)):t<s&&l(o,!0))}}canStart(){return!this.gestureOrAnimationInProgress&&!!this.swipeGesture&&!this.isTransitioning&&0===this.transInstr.length&&this.canGoBackSync()}onStart(){this.gestureOrAnimationInProgress=!0,this.animated&&s.getBoolean("animated",!0)?this.pop({direction:"back",progressAnimation:!0}):this.unblockSwipeClicks=u(this.el)}onMove(t){this.sbAni&&this.sbAni.progressStep(t)}onEnd(t,i,s){if(this.sbAni){this.sbAni.onFinish((()=>{this.gestureOrAnimationInProgress=!1}),{oneTimeCallback:!0});let e=t?-.001:.001;t?e+=h([0,0],[.32,.72],[0,1],[1,1],i)[0]:(this.sbAni.easing("cubic-bezier(1, 0, 0.68, 0.28)"),e+=h([0,0],[1,0],[.68,.28],[1,1],i)[0]),this.sbAni.progressEnd(t?1:0,e,s)}else{this.gestureOrAnimationInProgress=!1;const{unblockSwipeClicks:i}=this;i&&(this.unblockSwipeClicks=void 0,t&&this.pop({direction:"back"}),i())}}render(){return o("slot",{key:"0aea554c0cf00dd3829757ec74c3855eccf1e068"})}get el(){return n(this)}static get watchers(){return{swipeGesture:[{swipeGestureChanged:0}],root:[{rootChanged:0}]}}};y.style=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;z-index:0}";const k=class{constructor(i){t(this,i),this.routerDirection="forward",this.onClick=()=>((t,i,s,e,o)=>{const n=this.el.closest("ion-nav");if(n)if("forward"===i){if(void 0!==s)return n.push(s,e,{skipIfBusy:!0,animationBuilder:o})}else if("root"===i){if(void 0!==s)return n.setRoot(s,e,{skipIfBusy:!0,animationBuilder:o})}else if("back"===i)return n.pop({skipIfBusy:!0,animationBuilder:o});return Promise.resolve(!1)})(0,this.routerDirection,this.component,this.componentProps,this.routerAnimation)}render(){return o(r,{key:"4bcaa74015462824b3f19253b04a77ce83389ca0",onClick:this.onClick})}get el(){return n(this)}};export{y as ion_nav,k as ion_nav_link}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,d as e,a as o,h as r,f as i,g as s}from"./p-BpRUsN_W.js";import{B as a,h as n,r as p,j as c,k as d,e as h,o as l,f as v,g as f,F as g}from"./p-C1WYZOZj.js";import{C as m,a as x,d as b}from"./p-nCAPr1Ah.js";import{g as w,r as u,f as k,h as y}from"./p-Co7eql8D.js";import{c as P}from"./p-B-hirT0v.js";import{b as D,a as T}from"./p-SEecsUh7.js";import{g as $}from"./p-byZM6qHV.js";import{e as A,w as I}from"./p-DQXtveHv.js";import{c as W}from"./p-7l6ENjIV.js";import"./p-B_gJaBk0.js";import"./p-Dojwmvde.js";let C=null,N=!1;const L=t=>{if(null!==C)return C;if(null===t.body)return{top:0,bottom:0,left:0,right:0};const e=t.createElement("div");e.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);padding-bottom:var(--ion-safe-area-bottom,0px);padding-left:var(--ion-safe-area-left,0px);padding-right:var(--ion-safe-area-right,0px);",t.body.appendChild(e);const o=getComputedStyle(e),r={top:parseFloat(o.paddingTop)||0,bottom:parseFloat(o.paddingBottom)||0,left:parseFloat(o.paddingLeft)||0,right:parseFloat(o.paddingRight)||0};return e.remove(),C=r,N||(N=!0,u((()=>{C=null,N=!1}))),r},j=t=>{if(!t)return 1;const e=t.currentCSSZoom;if("number"==typeof e&&e>0)return e;const{width:o}=t.getBoundingClientRect(),{offsetWidth:r}=t;if(r>0&&o>0){const t=o/r;return Math.abs(t-1)<.01?1:t}return 1},O=(t,e,o,r=1)=>{const i=e.getBoundingClientRect(),s=i.height/r;let a=i.width/r;return"cover"===t&&o&&(a=o.getBoundingClientRect().width/r),{contentWidth:a,contentHeight:s}},S=(t,e)=>e&&"ION-ITEM"===e.tagName?t.findIndex((t=>t===e)):-1,z=t=>{const e=w(t).querySelector("button");e&&u((()=>e.focus()))},X=(t,e,o,r,i,s,a,n,p,c,d,h=1)=>{let l={top:0,left:0,width:0,height:0};if("event"===s){if(!d)return p;l={top:d.clientY/h,left:d.clientX/h,width:1,height:1}}else{const t=d,e=c||t?.detail?.ionShadowTarget||t?.target;if(!e)return p;const o=e.getBoundingClientRect();l={top:o.top/h,left:o.left/h,width:o.width/h,height:o.height/h}}const v=H(a,l,e,o,r,i,t),f=R(n,a,l,e,o),g=v.top+f.top,m=v.left+f.left,{arrowTop:x,arrowLeft:b}=M(a,r,i,g,m,e,o,t),{originX:w,originY:u}=Y(a,n,t);return{top:g,left:m,referenceCoordinates:l,arrowTop:x,arrowLeft:b,originX:w,originY:u}},Y=(t,e,o)=>{switch(t){case"top":return{originX:E(e),originY:"bottom"};case"bottom":return{originX:E(e),originY:"top"};case"left":return{originX:"right",originY:B(e)};case"right":return{originX:"left",originY:B(e)};case"start":return{originX:o?"left":"right",originY:B(e)};case"end":return{originX:o?"right":"left",originY:B(e)}}},E=t=>{switch(t){case"start":return"left";case"center":return"center";case"end":return"right"}},B=t=>{switch(t){case"start":return"top";case"center":return"center";case"end":return"bottom"}},M=(t,e,o,r,i,s,a,n)=>{const p={arrowTop:r+a/2-e/2,arrowLeft:i+s-e/2},c={arrowTop:r+a/2-e/2,arrowLeft:i-1.5*e};switch(t){case"top":return{arrowTop:r+a,arrowLeft:i+s/2-e/2};case"bottom":return{arrowTop:r-o,arrowLeft:i+s/2-e/2};case"left":return p;case"right":return c;case"start":return n?c:p;case"end":return n?p:c;default:return{arrowTop:0,arrowLeft:0}}},H=(t,e,o,r,i,s,a)=>{const n={top:e.top,left:e.left-o-i},p={top:e.top,left:e.left+e.width+i};switch(t){case"top":return{top:e.top-r-s,left:e.left};case"right":return p;case"bottom":return{top:e.top+e.height+s,left:e.left};case"left":return n;case"start":return a?p:n;case"end":return a?n:p}},R=(t,e,o,r,i)=>{switch(t){case"center":return F(e,o,r,i);case"end":return V(e,o,r,i);default:return{top:0,left:0}}},V=(t,e,o,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r-e.height),left:0};default:return{top:0,left:-(o-e.width)}}},F=(t,e,o,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r/2-e.height/2),left:0};default:return{top:0,left:-(o/2-e.width/2)}}},U=(t,e,o,r,i,s,a,n,p,c,d,h,l=0,v=0,f=0)=>{let g,m=l,x=o,b=e,w=c,u=d,k=!1,y=!1,P=!1,D=!1;const T=h?h.top+h.height:s/2-n/2,$=h?h.height:0;let A=!1;if(x<r+p.left?(x=r,k=!0,w="left"):a+r+x+p.right>i&&(y=!0,x=i-a-r,w="right"),T+$+n>s-p.bottom&&("top"===t||"bottom"===t)){const t=T-n-$-(f-1);t>=p.top+r?(b=t,m=b+n,u="bottom",A=!0):(g=r,D=!0,b>=s-p.bottom-r&&(b=p.top+r,P=!0))}return{top:b,left:x,bottom:g,originX:w,originY:u,checkSafeAreaLeft:k,checkSafeAreaRight:y,checkSafeAreaTop:P,checkSafeAreaBottom:D,arrowTop:m,arrowLeft:v,addPopoverBottomClass:A,hideArrow:!1}},Z=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:a,align:n}=e,p=t.ownerDocument,c="rtl"===p.dir,d=w(t),h=d.querySelector(".popover-content"),l=d.querySelector(".popover-arrow"),v=j(h),f=p.defaultView.innerWidth/v,g=p.defaultView.innerHeight/v,m=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:x,contentHeight:b}=O(r,h,m,v),{arrowWidth:u,arrowHeight:k}=((t,e=1)=>{if(!t)return{arrowWidth:0,arrowHeight:0};const{width:o,height:r}=t.getBoundingClientRect();return{arrowWidth:o/e,arrowHeight:r/e}})(l,v),y=X(c,x,b,u,k,s,a,n,{top:g/2-b/2,left:f/2-x/2,originX:c?"right":"left",originY:"top"},i,o,v),P="cover"===r?0:5,D=L(p),T="cover"===r?{top:0,bottom:0,left:0,right:0}:{top:Math.max(D.top,25),bottom:Math.max(D.bottom,25),left:Math.max(D.left,25),right:Math.max(D.right,25)},{originX:$,originY:A,top:I,left:C,bottom:N,checkSafeAreaLeft:S,checkSafeAreaRight:z,checkSafeAreaTop:Y,checkSafeAreaBottom:E,arrowTop:B,arrowLeft:M,addPopoverBottomClass:H}=U(a,y.top,y.left,P,f,g,x,b,T,y.originX,y.originY,y.referenceCoordinates,y.arrowTop,y.arrowLeft,k),R=W(),V=W(),F=W();return V.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),F.addElement(d.querySelector(".popover-arrow")).addElement(d.querySelector(".popover-content")).fromTo("opacity",.01,1),R.easing("ease").duration(100).beforeAddWrite((()=>{if("cover"===r&&t.style.setProperty("--width",`${x}px`),H&&t.classList.add("popover-bottom"),void 0!==N){let t=`${N}px`;E&&(t=`${N}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}let e=`${C}px`;S&&(e=`${C}px + var(--ion-safe-area-left, 0px)`),z&&(e=`${C}px - var(--ion-safe-area-right, 0px)`);let s=`${I}px`;if(Y&&(s=`${I}px + var(--ion-safe-area-top, 0px)`),h.style.setProperty("top",`calc(${s} + var(--offset-y, 0))`),h.style.setProperty("left",`calc(${e} + var(--offset-x, 0))`),h.style.setProperty("transform-origin",`${A} ${$}`),null!==l){const t=((t,e=!1,o,r)=>!(!o&&!r||"top"!==t&&"bottom"!==t&&e))(a,y.top!==I||y.left!==C,o,i);t?(l.style.setProperty("top",`calc(${B}px + var(--offset-y, 0))`),l.style.setProperty("left",`calc(${M}px + var(--offset-x, 0))`)):l.style.setProperty("display","none")}})).addAnimation([V,F])},_=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=e.querySelector(".popover-arrow"),i=W(),s=W(),a=W();return s.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),a.addElement(e.querySelector(".popover-arrow")).addElement(e.querySelector(".popover-content")).fromTo("opacity",.99,0),i.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin"),r&&(r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("display"))})).duration(300).addAnimation([s,a])},q=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:a,align:n}=e,p=t.ownerDocument,c="rtl"===p.dir,d=w(t),h=d.querySelector(".popover-content"),l=j(h),v=p.defaultView.innerWidth/l,f=p.defaultView.innerHeight/l,g=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:m,contentHeight:x}=O(r,h,g,l),b=X(c,m,x,0,0,s,a,n,{top:f/2-x/2,left:v/2-m/2,originX:c?"right":"left",originY:"top"},i,o,l),u="cover"===r?0:12,k="cover"===r?{top:0,bottom:0,left:0,right:0}:L(p),{originX:y,originY:P,top:D,left:T,bottom:$,checkSafeAreaLeft:A,checkSafeAreaRight:I,checkSafeAreaTop:C,checkSafeAreaBottom:N,addPopoverBottomClass:S}=U(a,b.top,b.left,u,v,f,m,x,k,b.originX,b.originY,b.referenceCoordinates);let z=`${T}px`;A&&(z=`${T}px + var(--ion-safe-area-left, 0px)`),I&&(z=`${T}px - var(--ion-safe-area-right, 0px)`);let Y=`${D}px`;C&&(Y=`${D}px + var(--ion-safe-area-top, 0px)`);const E=W(),B=W(),M=W(),H=W(),R=W();return B.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),M.addElement(d.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1),H.addElement(h).beforeStyles({top:`calc(${Y} + var(--offset-y, 0px))`,left:`calc(${z} + var(--offset-x, 0px))`,"transform-origin":`${P} ${y}`}).beforeAddWrite((()=>{if(void 0!==$){let t=`${$}px`;N&&(t=`${$}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}})).fromTo("transform","scale(0.8)","scale(1)"),R.addElement(d.querySelector(".popover-viewport")).fromTo("opacity",.01,1),E.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((()=>{"cover"===r&&t.style.setProperty("--width",`${m}px`),S&&t.classList.add("popover-bottom")})).addAnimation([B,M,H,R])},K=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=W(),i=W(),s=W();return i.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),s.addElement(e.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),r.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin")})).duration(150).addAnimation([i,s])},J=class{constructor(r){t(this,r),this.didPresent=e(this,"ionPopoverDidPresent",7),this.willPresent=e(this,"ionPopoverWillPresent",7),this.willDismiss=e(this,"ionPopoverWillDismiss",7),this.didDismiss=e(this,"ionPopoverDidDismiss",7),this.didPresentShorthand=e(this,"didPresent",7),this.willPresentShorthand=e(this,"willPresent",7),this.willDismissShorthand=e(this,"willDismiss",7),this.didDismissShorthand=e(this,"didDismiss",7),this.ionMount=e(this,"ionMount",7),this.parentPopover=null,this.coreDelegate=m(),this.lockController=P(),this.inline=!1,this.focusDescendantOnPresent=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.backdropDismiss=!0,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.triggerAction="click",this.size="auto",this.dismissOnSelect=!1,this.reference="trigger",this.side="bottom",this.arrow=!0,this.isOpen=!1,this.keyboardEvents=!1,this.focusTrap=!0,this.keepContentsMounted=!1,this.onBackdropTap=()=>{this.dismiss(void 0,a)},this.onLifecycle=t=>{const e=this.usersElement,o=Q[t.type];if(e&&o){const r=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});e.dispatchEvent(r)}},this.configureTriggerInteraction=()=>{const{trigger:t,triggerAction:e,el:r,destroyTriggerInteraction:i}=this;if(i&&i(),void 0===t)return;const s=this.triggerEl=void 0!==t?document.getElementById(t):null;s?this.destroyTriggerInteraction=((t,e,o)=>{let r=[];switch(e){case"hover":let t;r=[{eventName:"mouseenter",callback:async e=>{e.stopPropagation(),t&&clearTimeout(t),t=setTimeout((()=>{u((()=>{o.presentFromTrigger(e),t=void 0}))}),100)}},{eventName:"mouseleave",callback:e=>{t&&clearTimeout(t);const r=e.relatedTarget;r&&r.closest("ion-popover")!==o&&o.dismiss(void 0,void 0,!1)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;case"context-menu":r=[{eventName:"contextmenu",callback:t=>{t.preventDefault(),o.presentFromTrigger(t)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;default:r=[{eventName:"click",callback:t=>o.presentFromTrigger(t)},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}]}return r.forEach((({eventName:e,callback:o})=>t.addEventListener(e,o))),t.setAttribute("data-ion-popover-trigger","true"),()=>{r.forEach((({eventName:e,callback:o})=>t.removeEventListener(e,o))),t.removeAttribute("data-ion-popover-trigger")}})(s,e,r):o(`[ion-popover] - A trigger element with the ID "${t}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.`,this.el)},this.configureKeyboardInteraction=()=>{const{destroyKeyboardInteraction:t,el:e}=this;t&&t(),this.destroyKeyboardInteraction=(t=>{const e=async e=>{const o=document.activeElement;let r=[];const i=e.target?.tagName;if("ION-POPOVER"===i||"ION-ITEM"===i){try{r=Array.from(t.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch{}switch(e.key){case"ArrowLeft":await t.getParentPopover()&&t.dismiss(void 0,void 0,!1);break;case"ArrowDown":e.preventDefault();const i=((t,e)=>t[S(t,e)+1])(r,o);void 0!==i&&z(i);break;case"ArrowUp":e.preventDefault();const s=((t,e)=>t[S(t,e)-1])(r,o);void 0!==s&&z(s);break;case"Home":e.preventDefault();const a=r[0];void 0!==a&&z(a);break;case"End":e.preventDefault();const n=r[r.length-1];void 0!==n&&z(n);break;case"ArrowRight":case" ":case"Enter":if(o&&o.hasAttribute("data-ion-popover-trigger")){const t=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(t)}}}};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)})(e)},this.configureDismissInteraction=()=>{const{destroyDismissInteraction:t,parentPopover:e,triggerAction:o,triggerEl:r,el:i}=this;e&&r&&(t&&t(),this.destroyDismissInteraction=((t,e,o,r)=>{let i=[];const s=w(r).querySelector(".popover-content");return i="hover"===e?[{eventName:"mouseenter",callback:e=>{document.elementFromPoint(e.clientX,e.clientY)!==t&&o.dismiss(void 0,void 0,!1)}}]:[{eventName:"click",callback:e=>{e.target.closest("[data-ion-popover-trigger]")!==t?o.dismiss(void 0,void 0,!1):e.stopPropagation()}}],i.forEach((({eventName:t,callback:e})=>s.addEventListener(t,e))),()=>{i.forEach((({eventName:t,callback:e})=>s.removeEventListener(t,e)))}})(r,o,i,e))}}onTriggerChange(){this.configureTriggerInteraction()}onIsOpenChange(t,e){!0===t&&!1===e?this.present():!1===t&&!0===e&&this.dismiss()}connectedCallback(){const{configureTriggerInteraction:t,el:e}=this;n(e),t(),this.presented&&(p(e),this.recalculateContentOnHeaderReady())}disconnectedCallback(){const{destroyTriggerInteraction:t}=this;t&&t(),this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.presented&&c()}componentWillLoad(){const{el:t}=this,e=this.htmlAttributes?.id??d(t);this.parentPopover=t.closest(`ion-popover:not(#${e})`),void 0===this.alignment&&(this.alignment="ios"===D(this)?"center":"start")}componentDidLoad(){const{parentPopover:t,isOpen:e}=this;!0===e&&u((()=>this.present())),t&&k(t,"ionPopoverWillDismiss",(()=>{this.dismiss(void 0,void 0,!1)})),this.configureTriggerInteraction()}async presentFromTrigger(t,e=!1){this.focusDescendantOnPresent=e,await this.present(t),this.focusDescendantOnPresent=!1}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const e=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:e,delegate:this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate}}async present(t){const e=await this.lockController.lock();if(this.presented)return void e();const{el:o}=this,{inline:r,delegate:i}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await x(i,o,this.component,["popover-viewport"],this.componentProps,r),this.recalculateContentOnHeaderReady(),this.keyboardEvents||this.configureKeyboardInteraction(),this.configureDismissInteraction(),y(o)?await A(this.usersElement):this.keepContentsMounted||await I(),await h(this,"popoverEnter",Z,q,{event:t||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment}),this.focusDescendantOnPresent&&l(o),e()}recalculateContentOnHeaderReady(){const t=this.el.shadowRoot?.querySelector(".popover-content");if(!t)return;const e=this.usersElement||t,o=e.querySelector("ion-header"),r=e.querySelectorAll("ion-content");o&&0!==r.length&&(this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.headerResizeObserver=new ResizeObserver((async()=>{if(o.offsetHeight>0){this.headerResizeObserver?.disconnect(),this.headerResizeObserver=void 0;for(const t of r)await t.recalculateDimensions()}})),this.headerResizeObserver.observe(o))}async dismiss(t,e,o=!0){const r=await this.lockController.lock(),{destroyKeyboardInteraction:i,destroyDismissInteraction:s}=this;o&&this.parentPopover&&this.parentPopover.dismiss(t,e,o);const a=await v(this,t,e,"popoverLeave",_,K,this.event);if(a){i&&(i(),this.destroyKeyboardInteraction=void 0),s&&(s(),this.destroyDismissInteraction=void 0);const{delegate:t}=this.getDelegate();await b(t,this.usersElement)}return r(),a}async getParentPopover(){return this.parentPopover}onDidDismiss(){return f(this.el,"ionPopoverDidDismiss")}onWillDismiss(){return f(this.el,"ionPopoverWillDismiss")}render(){const t=D(this),{onLifecycle:e,parentPopover:o,dismissOnSelect:s,side:a,arrow:n,htmlAttributes:p,focusTrap:c}=this,d=T("desktop"),h=n&&!o;return r(i,{key:"b5e9c788f58397203976d5f8302dfb89e916efe1","aria-modal":"true","no-router":!0,tabindex:"-1",...p,style:{zIndex:`${2e4+this.overlayIndex}`},class:{...$(this.cssClass),[t]:!0,"popover-translucent":this.translucent,"overlay-hidden":!0,"popover-desktop":d,[`popover-side-${a}`]:!0,[g]:!1===c,"popover-nested":!!o},onIonPopoverDidPresent:e,onIonPopoverWillPresent:e,onIonPopoverWillDismiss:e,onIonPopoverDidDismiss:e,onIonBackdropTap:this.onBackdropTap},!o&&r("ion-backdrop",{key:"f3977833c5b2c0087c286ee54363b478d69eb115",tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),r("div",{key:"1059893d6fd2932ca8adcdf8d45a5d66f4794727",class:"popover-wrapper ion-overlay-wrapper",onClick:s?()=>this.dismiss():void 0},h&&r("div",{key:"24d7988bdd95882ad77fcaa7112aeda55878bee4",class:"popover-arrow",part:"arrow"}),r("div",{key:"4d6992e0a9d629f11763045f9199f9a77fa521ab",class:"popover-content",part:"content"},r("slot",{key:"b29747419620a01a6c34e9e846cd529b0b210145"}))))}get el(){return s(this)}static get watchers(){return{trigger:[{onTriggerChange:0}],triggerAction:[{onTriggerChange:0}],isOpen:[{onIsOpenChange:0}]}}},Q={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};J.style={ios:':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden;z-index:11}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}.popover-arrow::after{inset-inline-start:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start:dir(rtl)) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end:dir(rtl)) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}',md:":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}"};export{J as ion_popover}
|
|
4
|
+
import{r as t,d as e,a as o,h as r,f as i,g as s}from"./p-BpRUsN_W.js";import{B as a,h as n,r as p,j as c,k as d,e as h,o as l,f as v,g as f,F as g}from"./p-C1WYZOZj.js";import{C as m,a as x,d as b}from"./p-nCAPr1Ah.js";import{g as w,r as u,f as k,h as y}from"./p-Co7eql8D.js";import{c as P}from"./p-B-hirT0v.js";import{b as D,a as T}from"./p-SEecsUh7.js";import{g as $}from"./p-byZM6qHV.js";import{e as A,w as I}from"./p-Dk4Mdaru.js";import{c as W}from"./p-7l6ENjIV.js";import"./p-B_gJaBk0.js";import"./p-Dojwmvde.js";let C=null,N=!1;const L=t=>{if(null!==C)return C;if(null===t.body)return{top:0,bottom:0,left:0,right:0};const e=t.createElement("div");e.style.cssText="position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding-top:var(--ion-safe-area-top,0px);padding-bottom:var(--ion-safe-area-bottom,0px);padding-left:var(--ion-safe-area-left,0px);padding-right:var(--ion-safe-area-right,0px);",t.body.appendChild(e);const o=getComputedStyle(e),r={top:parseFloat(o.paddingTop)||0,bottom:parseFloat(o.paddingBottom)||0,left:parseFloat(o.paddingLeft)||0,right:parseFloat(o.paddingRight)||0};return e.remove(),C=r,N||(N=!0,u((()=>{C=null,N=!1}))),r},j=t=>{if(!t)return 1;const e=t.currentCSSZoom;if("number"==typeof e&&e>0)return e;const{width:o}=t.getBoundingClientRect(),{offsetWidth:r}=t;if(r>0&&o>0){const t=o/r;return Math.abs(t-1)<.01?1:t}return 1},O=(t,e,o,r=1)=>{const i=e.getBoundingClientRect(),s=i.height/r;let a=i.width/r;return"cover"===t&&o&&(a=o.getBoundingClientRect().width/r),{contentWidth:a,contentHeight:s}},S=(t,e)=>e&&"ION-ITEM"===e.tagName?t.findIndex((t=>t===e)):-1,z=t=>{const e=w(t).querySelector("button");e&&u((()=>e.focus()))},Y=(t,e,o,r,i,s,a,n,p,c,d,h=1)=>{let l={top:0,left:0,width:0,height:0};if("event"===s){if(!d)return p;l={top:d.clientY/h,left:d.clientX/h,width:1,height:1}}else{const t=d,e=c||t?.detail?.ionShadowTarget||t?.target;if(!e)return p;const o=e.getBoundingClientRect();l={top:o.top/h,left:o.left/h,width:o.width/h,height:o.height/h}}const v=H(a,l,e,o,r,i,t),f=R(n,a,l,e,o),g=v.top+f.top,m=v.left+f.left,{arrowTop:x,arrowLeft:b}=M(a,r,i,g,m,e,o,t),{originX:w,originY:u}=E(a,n,t);return{top:g,left:m,referenceCoordinates:l,arrowTop:x,arrowLeft:b,originX:w,originY:u}},E=(t,e,o)=>{switch(t){case"top":return{originX:X(e),originY:"bottom"};case"bottom":return{originX:X(e),originY:"top"};case"left":return{originX:"right",originY:B(e)};case"right":return{originX:"left",originY:B(e)};case"start":return{originX:o?"left":"right",originY:B(e)};case"end":return{originX:o?"right":"left",originY:B(e)}}},X=t=>{switch(t){case"start":return"left";case"center":return"center";case"end":return"right"}},B=t=>{switch(t){case"start":return"top";case"center":return"center";case"end":return"bottom"}},M=(t,e,o,r,i,s,a,n)=>{const p={arrowTop:r+a/2-e/2,arrowLeft:i+s-e/2},c={arrowTop:r+a/2-e/2,arrowLeft:i-1.5*e};switch(t){case"top":return{arrowTop:r+a,arrowLeft:i+s/2-e/2};case"bottom":return{arrowTop:r-o,arrowLeft:i+s/2-e/2};case"left":return p;case"right":return c;case"start":return n?c:p;case"end":return n?p:c;default:return{arrowTop:0,arrowLeft:0}}},H=(t,e,o,r,i,s,a)=>{const n={top:e.top,left:e.left-o-i},p={top:e.top,left:e.left+e.width+i};switch(t){case"top":return{top:e.top-r-s,left:e.left};case"right":return p;case"bottom":return{top:e.top+e.height+s,left:e.left};case"left":return n;case"start":return a?p:n;case"end":return a?n:p}},R=(t,e,o,r,i)=>{switch(t){case"center":return F(e,o,r,i);case"end":return V(e,o,r,i);default:return{top:0,left:0}}},V=(t,e,o,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r-e.height),left:0};default:return{top:0,left:-(o-e.width)}}},F=(t,e,o,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r/2-e.height/2),left:0};default:return{top:0,left:-(o/2-e.width/2)}}},U=(t,e,o,r,i,s,a,n,p,c,d,h,l=0,v=0,f=0)=>{let g,m=l,x=o,b=e,w=c,u=d,k=!1,y=!1,P=!1,D=!1;const T=h?h.top+h.height:s/2-n/2,$=h?h.height:0;let A=!1;if(x<r+p.left?(x=r,k=!0,w="left"):a+r+x+p.right>i&&(y=!0,x=i-a-r,w="right"),T+$+n>s-p.bottom&&("top"===t||"bottom"===t)){const t=T-n-$-(f-1);t>=p.top+r?(b=t,m=b+n,u="bottom",A=!0):(g=r,D=!0,b>=s-p.bottom-r&&(b=p.top+r,P=!0))}return{top:b,left:x,bottom:g,originX:w,originY:u,checkSafeAreaLeft:k,checkSafeAreaRight:y,checkSafeAreaTop:P,checkSafeAreaBottom:D,arrowTop:m,arrowLeft:v,addPopoverBottomClass:A,hideArrow:!1}},Z=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:a,align:n}=e,p=t.ownerDocument,c="rtl"===p.dir,d=w(t),h=d.querySelector(".popover-content"),l=d.querySelector(".popover-arrow"),v=j(h),f=p.defaultView.innerWidth/v,g=p.defaultView.innerHeight/v,m=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:x,contentHeight:b}=O(r,h,m,v),{arrowWidth:u,arrowHeight:k}=((t,e=1)=>{if(!t)return{arrowWidth:0,arrowHeight:0};const{width:o,height:r}=t.getBoundingClientRect();return{arrowWidth:o/e,arrowHeight:r/e}})(l,v),y=Y(c,x,b,u,k,s,a,n,{top:g/2-b/2,left:f/2-x/2,originX:c?"right":"left",originY:"top"},i,o,v),P="cover"===r?0:5,D=L(p),T="cover"===r?{top:0,bottom:0,left:0,right:0}:{top:Math.max(D.top,25),bottom:Math.max(D.bottom,25),left:Math.max(D.left,25),right:Math.max(D.right,25)},{originX:$,originY:A,top:I,left:C,bottom:N,checkSafeAreaLeft:S,checkSafeAreaRight:z,checkSafeAreaTop:E,checkSafeAreaBottom:X,arrowTop:B,arrowLeft:M,addPopoverBottomClass:H}=U(a,y.top,y.left,P,f,g,x,b,T,y.originX,y.originY,y.referenceCoordinates,y.arrowTop,y.arrowLeft,k),R=W(),V=W(),F=W();return V.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),F.addElement(d.querySelector(".popover-arrow")).addElement(d.querySelector(".popover-content")).fromTo("opacity",.01,1),R.easing("ease").duration(100).beforeAddWrite((()=>{if("cover"===r&&t.style.setProperty("--width",`${x}px`),H&&t.classList.add("popover-bottom"),void 0!==N){let t=`${N}px`;X&&(t=`${N}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}let e=`${C}px`;S&&(e=`${C}px + var(--ion-safe-area-left, 0px)`),z&&(e=`${C}px - var(--ion-safe-area-right, 0px)`);let s=`${I}px`;if(E&&(s=`${I}px + var(--ion-safe-area-top, 0px)`),h.style.setProperty("top",`calc(${s} + var(--offset-y, 0))`),h.style.setProperty("left",`calc(${e} + var(--offset-x, 0))`),h.style.setProperty("transform-origin",`${A} ${$}`),null!==l){const t=((t,e=!1,o,r)=>!(!o&&!r||"top"!==t&&"bottom"!==t&&e))(a,y.top!==I||y.left!==C,o,i);t?(l.style.setProperty("top",`calc(${B}px + var(--offset-y, 0))`),l.style.setProperty("left",`calc(${M}px + var(--offset-x, 0))`)):l.style.setProperty("display","none")}})).addAnimation([V,F])},_=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=e.querySelector(".popover-arrow"),i=W(),s=W(),a=W();return s.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),a.addElement(e.querySelector(".popover-arrow")).addElement(e.querySelector(".popover-content")).fromTo("opacity",.99,0),i.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin"),r&&(r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("display"))})).duration(300).addAnimation([s,a])},q=(t,e)=>{const{event:o,size:r,trigger:i,reference:s,side:a,align:n}=e,p=t.ownerDocument,c="rtl"===p.dir,d=w(t),h=d.querySelector(".popover-content"),l=j(h),v=p.defaultView.innerWidth/l,f=p.defaultView.innerHeight/l,g=i||o?.detail?.ionShadowTarget||o?.target,{contentWidth:m,contentHeight:x}=O(r,h,g,l),b=Y(c,m,x,0,0,s,a,n,{top:f/2-x/2,left:v/2-m/2,originX:c?"right":"left",originY:"top"},i,o,l),u="cover"===r?0:12,k="cover"===r?{top:0,bottom:0,left:0,right:0}:L(p),{originX:y,originY:P,top:D,left:T,bottom:$,checkSafeAreaLeft:A,checkSafeAreaRight:I,checkSafeAreaTop:C,checkSafeAreaBottom:N,addPopoverBottomClass:S}=U(a,b.top,b.left,u,v,f,m,x,k,b.originX,b.originY,b.referenceCoordinates);let z=`${T}px`;A&&(z=`${T}px + var(--ion-safe-area-left, 0px)`),I&&(z=`${T}px - var(--ion-safe-area-right, 0px)`);let E=`${D}px`;C&&(E=`${D}px + var(--ion-safe-area-top, 0px)`);const X=W(),B=W(),M=W(),H=W(),R=W();return B.addElement(d.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),M.addElement(d.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1),H.addElement(h).beforeStyles({top:`calc(${E} + var(--offset-y, 0px))`,left:`calc(${z} + var(--offset-x, 0px))`,"transform-origin":`${P} ${y}`}).beforeAddWrite((()=>{if(void 0!==$){let t=`${$}px`;N&&(t=`${$}px + var(--ion-safe-area-bottom, 0px)`),h.style.setProperty("bottom",`calc(${t})`)}})).fromTo("transform","scale(0.8)","scale(1)"),R.addElement(d.querySelector(".popover-viewport")).fromTo("opacity",.01,1),X.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((()=>{"cover"===r&&t.style.setProperty("--width",`${m}px`),S&&t.classList.add("popover-bottom")})).addAnimation([B,M,H,R])},K=t=>{const e=w(t),o=e.querySelector(".popover-content"),r=W(),i=W(),s=W();return i.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),s.addElement(e.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),r.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("bottom"),o.style.removeProperty("transform-origin")})).duration(150).addAnimation([i,s])},J=class{constructor(r){t(this,r),this.didPresent=e(this,"ionPopoverDidPresent",7),this.willPresent=e(this,"ionPopoverWillPresent",7),this.willDismiss=e(this,"ionPopoverWillDismiss",7),this.didDismiss=e(this,"ionPopoverDidDismiss",7),this.didPresentShorthand=e(this,"didPresent",7),this.willPresentShorthand=e(this,"willPresent",7),this.willDismissShorthand=e(this,"willDismiss",7),this.didDismissShorthand=e(this,"didDismiss",7),this.ionMount=e(this,"ionMount",7),this.parentPopover=null,this.coreDelegate=m(),this.lockController=P(),this.inline=!1,this.focusDescendantOnPresent=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.backdropDismiss=!0,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.triggerAction="click",this.size="auto",this.dismissOnSelect=!1,this.reference="trigger",this.side="bottom",this.arrow=!0,this.isOpen=!1,this.keyboardEvents=!1,this.focusTrap=!0,this.keepContentsMounted=!1,this.onBackdropTap=()=>{this.dismiss(void 0,a)},this.onLifecycle=t=>{const e=this.usersElement,o=G[t.type];if(e&&o){const r=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});e.dispatchEvent(r)}},this.configureTriggerInteraction=()=>{const{trigger:t,triggerAction:e,el:r,destroyTriggerInteraction:i}=this;if(i&&i(),void 0===t)return;const s=this.triggerEl=void 0!==t?document.getElementById(t):null;s?this.destroyTriggerInteraction=((t,e,o)=>{let r=[];switch(e){case"hover":let t;r=[{eventName:"mouseenter",callback:async e=>{e.stopPropagation(),t&&clearTimeout(t),t=setTimeout((()=>{u((()=>{o.presentFromTrigger(e),t=void 0}))}),100)}},{eventName:"mouseleave",callback:e=>{t&&clearTimeout(t);const r=e.relatedTarget;r&&r.closest("ion-popover")!==o&&o.dismiss(void 0,void 0,!1)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;case"context-menu":r=[{eventName:"contextmenu",callback:t=>{t.preventDefault(),o.presentFromTrigger(t)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}];break;default:r=[{eventName:"click",callback:t=>o.presentFromTrigger(t)},{eventName:"ionPopoverActivateTrigger",callback:t=>o.presentFromTrigger(t,!0)}]}return r.forEach((({eventName:e,callback:o})=>t.addEventListener(e,o))),t.setAttribute("data-ion-popover-trigger","true"),()=>{r.forEach((({eventName:e,callback:o})=>t.removeEventListener(e,o))),t.removeAttribute("data-ion-popover-trigger")}})(s,e,r):o(`[ion-popover] - A trigger element with the ID "${t}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.`,this.el)},this.configureKeyboardInteraction=()=>{const{destroyKeyboardInteraction:t,el:e}=this;t&&t(),this.destroyKeyboardInteraction=(t=>{const e=async e=>{const o=document.activeElement;let r=[];const i=e.target?.tagName;if("ION-POPOVER"===i||"ION-ITEM"===i){try{r=Array.from(t.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch{}switch(e.key){case"ArrowLeft":await t.getParentPopover()&&t.dismiss(void 0,void 0,!1);break;case"ArrowDown":e.preventDefault();const i=((t,e)=>t[S(t,e)+1])(r,o);void 0!==i&&z(i);break;case"ArrowUp":e.preventDefault();const s=((t,e)=>t[S(t,e)-1])(r,o);void 0!==s&&z(s);break;case"Home":e.preventDefault();const a=r[0];void 0!==a&&z(a);break;case"End":e.preventDefault();const n=r[r.length-1];void 0!==n&&z(n);break;case"ArrowRight":case" ":case"Enter":if(o&&o.hasAttribute("data-ion-popover-trigger")){const t=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(t)}}}};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)})(e)},this.configureDismissInteraction=()=>{const{destroyDismissInteraction:t,parentPopover:e,triggerAction:o,triggerEl:r,el:i}=this;e&&r&&(t&&t(),this.destroyDismissInteraction=((t,e,o,r)=>{let i=[];const s=w(r).querySelector(".popover-content");return i="hover"===e?[{eventName:"mouseenter",callback:e=>{document.elementFromPoint(e.clientX,e.clientY)!==t&&o.dismiss(void 0,void 0,!1)}}]:[{eventName:"click",callback:e=>{e.target.closest("[data-ion-popover-trigger]")!==t?o.dismiss(void 0,void 0,!1):e.stopPropagation()}}],i.forEach((({eventName:t,callback:e})=>s.addEventListener(t,e))),()=>{i.forEach((({eventName:t,callback:e})=>s.removeEventListener(t,e)))}})(r,o,i,e))}}onTriggerChange(){this.configureTriggerInteraction()}onIsOpenChange(t,e){!0===t&&!1===e?this.present():!1===t&&!0===e&&this.dismiss()}connectedCallback(){const{configureTriggerInteraction:t,el:e}=this;n(e),t(),this.presented&&(p(e),this.recalculateContentOnHeaderReady())}disconnectedCallback(){const{destroyTriggerInteraction:t}=this;t&&t(),this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.presented&&c()}componentWillLoad(){const{el:t}=this,e=this.htmlAttributes?.id??d(t);this.parentPopover=t.closest(`ion-popover:not(#${e})`),void 0===this.alignment&&(this.alignment="ios"===D(this)?"center":"start")}componentDidLoad(){const{parentPopover:t,isOpen:e}=this;!0===e&&u((()=>this.present())),t&&k(t,"ionPopoverWillDismiss",(()=>{this.dismiss(void 0,void 0,!1)})),this.configureTriggerInteraction()}async presentFromTrigger(t,e=!1){this.focusDescendantOnPresent=e,await this.present(t),this.focusDescendantOnPresent=!1}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const e=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:e,delegate:this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate}}async present(t){const e=await this.lockController.lock();if(this.presented)return void e();const{el:o}=this,{inline:r,delegate:i}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await x(i,o,this.component,["popover-viewport"],this.componentProps,r),this.recalculateContentOnHeaderReady(),this.keyboardEvents||this.configureKeyboardInteraction(),this.configureDismissInteraction(),y(o)?await A(this.usersElement):this.keepContentsMounted||await I(),await h(this,"popoverEnter",Z,q,{event:t||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment}),this.focusDescendantOnPresent&&l(o),e()}recalculateContentOnHeaderReady(){const t=this.el.shadowRoot?.querySelector(".popover-content");if(!t)return;const e=this.usersElement||t,o=e.querySelector("ion-header"),r=e.querySelectorAll("ion-content");o&&0!==r.length&&(this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0),this.headerResizeObserver=new ResizeObserver((async()=>{if(o.offsetHeight>0){this.headerResizeObserver?.disconnect(),this.headerResizeObserver=void 0;for(const t of r)await t.recalculateDimensions()}})),this.headerResizeObserver.observe(o))}async dismiss(t,e,o=!0){const r=await this.lockController.lock(),{destroyKeyboardInteraction:i,destroyDismissInteraction:s}=this;o&&this.parentPopover&&this.parentPopover.dismiss(t,e,o);const a=await v(this,t,e,"popoverLeave",_,K,this.event);if(a){i&&(i(),this.destroyKeyboardInteraction=void 0),s&&(s(),this.destroyDismissInteraction=void 0);const{delegate:t}=this.getDelegate();await b(t,this.usersElement)}return r(),a}async getParentPopover(){return this.parentPopover}onDidDismiss(){return f(this.el,"ionPopoverDidDismiss")}onWillDismiss(){return f(this.el,"ionPopoverWillDismiss")}render(){const t=D(this),{onLifecycle:e,parentPopover:o,dismissOnSelect:s,side:a,arrow:n,htmlAttributes:p,focusTrap:c}=this,d=T("desktop"),h=n&&!o;return r(i,{key:"b5e9c788f58397203976d5f8302dfb89e916efe1","aria-modal":"true","no-router":!0,tabindex:"-1",...p,style:{zIndex:`${2e4+this.overlayIndex}`},class:{...$(this.cssClass),[t]:!0,"popover-translucent":this.translucent,"overlay-hidden":!0,"popover-desktop":d,[`popover-side-${a}`]:!0,[g]:!1===c,"popover-nested":!!o},onIonPopoverDidPresent:e,onIonPopoverWillPresent:e,onIonPopoverWillDismiss:e,onIonPopoverDidDismiss:e,onIonBackdropTap:this.onBackdropTap},!o&&r("ion-backdrop",{key:"f3977833c5b2c0087c286ee54363b478d69eb115",tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),r("div",{key:"1059893d6fd2932ca8adcdf8d45a5d66f4794727",class:"popover-wrapper ion-overlay-wrapper",onClick:s?()=>this.dismiss():void 0},h&&r("div",{key:"24d7988bdd95882ad77fcaa7112aeda55878bee4",class:"popover-arrow",part:"arrow"}),r("div",{key:"4d6992e0a9d629f11763045f9199f9a77fa521ab",class:"popover-content",part:"content"},r("slot",{key:"b29747419620a01a6c34e9e846cd529b0b210145"}))))}get el(){return s(this)}static get watchers(){return{trigger:[{onTriggerChange:0}],triggerAction:[{onTriggerChange:0}],isOpen:[{onIsOpenChange:0}]}}},G={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};J.style={ios:':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden;z-index:11}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}.popover-arrow::after{inset-inline-start:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start:dir(rtl)) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end:dir(rtl)) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}',md:":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host(.select-popover-rich-content){--width:clamp(250px, calc(100vw - 40px), 400px)}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}"};export{J as ion_popover}
|
|
@@ -5,6 +5,7 @@ import type { ViewController } from './view-controller';
|
|
|
5
5
|
export declare class Nav implements ComponentInterface {
|
|
6
6
|
private transInstr;
|
|
7
7
|
private sbAni?;
|
|
8
|
+
private unblockSwipeClicks?;
|
|
8
9
|
private gestureOrAnimationInProgress;
|
|
9
10
|
private isTransitioning;
|
|
10
11
|
private destroyed;
|
|
@@ -27,6 +27,12 @@ export declare const lifecycle: (el: HTMLElement | undefined, eventName: string)
|
|
|
27
27
|
export declare const waitForMount: () => Promise<void>;
|
|
28
28
|
export declare const deepReady: (el: any | undefined) => Promise<void>;
|
|
29
29
|
export declare const setPageHidden: (el: HTMLElement, hidden: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Blocks clicks on `el` during a swipe to go back without animations,
|
|
32
|
+
* so releasing the pointer doesn't click whatever is under it. Returns
|
|
33
|
+
* a function that unblocks it after the release click.
|
|
34
|
+
*/
|
|
35
|
+
export declare const blockSwipeClicks: (el: HTMLElement) => () => void;
|
|
30
36
|
export declare const getIonPageElement: (element: HTMLElement) => Element;
|
|
31
37
|
export interface TransitionOptions extends NavOptions {
|
|
32
38
|
progressCallback?: (ani: Animation | undefined) => void;
|
package/hydrate/index.js
CHANGED
|
@@ -25307,6 +25307,17 @@ const setPageHidden = (el, hidden) => {
|
|
|
25307
25307
|
el.classList.remove('ion-page-hidden');
|
|
25308
25308
|
}
|
|
25309
25309
|
};
|
|
25310
|
+
/**
|
|
25311
|
+
* Blocks clicks on `el` during a swipe to go back without animations,
|
|
25312
|
+
* so releasing the pointer doesn't click whatever is under it. Returns
|
|
25313
|
+
* a function that unblocks it after the release click.
|
|
25314
|
+
*/
|
|
25315
|
+
const blockSwipeClicks = (el) => {
|
|
25316
|
+
el.style.setProperty('pointer-events', 'none');
|
|
25317
|
+
return () => {
|
|
25318
|
+
setTimeout(() => el.style.removeProperty('pointer-events'));
|
|
25319
|
+
};
|
|
25320
|
+
};
|
|
25310
25321
|
const setZIndex = (enteringEl, leavingEl, direction) => {
|
|
25311
25322
|
if (enteringEl !== undefined) {
|
|
25312
25323
|
enteringEl.style.zIndex = direction === 'back' ? '99' : '101';
|
|
@@ -28657,6 +28668,12 @@ class Nav {
|
|
|
28657
28668
|
this.gesture.destroy();
|
|
28658
28669
|
this.gesture = undefined;
|
|
28659
28670
|
}
|
|
28671
|
+
// Destroying the gesture skips onEnd, so end a deferred swipe here.
|
|
28672
|
+
if (this.unblockSwipeClicks) {
|
|
28673
|
+
this.unblockSwipeClicks();
|
|
28674
|
+
this.unblockSwipeClicks = undefined;
|
|
28675
|
+
this.gestureOrAnimationInProgress = false;
|
|
28676
|
+
}
|
|
28660
28677
|
this.transInstr.length = 0;
|
|
28661
28678
|
this.views.length = 0;
|
|
28662
28679
|
this.destroyed = true;
|
|
@@ -29277,6 +29294,14 @@ class Nav {
|
|
|
29277
29294
|
}
|
|
29278
29295
|
onStart() {
|
|
29279
29296
|
this.gestureOrAnimationInProgress = true;
|
|
29297
|
+
/**
|
|
29298
|
+
* Without animations there's nothing for the swipe to drive, so
|
|
29299
|
+
* wait until the gesture ends to decide whether to go back.
|
|
29300
|
+
*/
|
|
29301
|
+
if (!(this.animated && config.getBoolean('animated', true))) {
|
|
29302
|
+
this.unblockSwipeClicks = blockSwipeClicks(this.el);
|
|
29303
|
+
return;
|
|
29304
|
+
}
|
|
29280
29305
|
this.pop({ direction: 'back', progressAnimation: true });
|
|
29281
29306
|
}
|
|
29282
29307
|
onMove(stepValue) {
|
|
@@ -29310,10 +29335,18 @@ class Nav {
|
|
|
29310
29335
|
}
|
|
29311
29336
|
else {
|
|
29312
29337
|
this.gestureOrAnimationInProgress = false;
|
|
29338
|
+
const { unblockSwipeClicks } = this;
|
|
29339
|
+
if (unblockSwipeClicks) {
|
|
29340
|
+
this.unblockSwipeClicks = undefined;
|
|
29341
|
+
if (shouldComplete) {
|
|
29342
|
+
this.pop({ direction: 'back' });
|
|
29343
|
+
}
|
|
29344
|
+
unblockSwipeClicks();
|
|
29345
|
+
}
|
|
29313
29346
|
}
|
|
29314
29347
|
}
|
|
29315
29348
|
render() {
|
|
29316
|
-
return hAsync("slot", { key: '
|
|
29349
|
+
return hAsync("slot", { key: '0aea554c0cf00dd3829757ec74c3855eccf1e068' });
|
|
29317
29350
|
}
|
|
29318
29351
|
get el() { return getElement(this); }
|
|
29319
29352
|
static get watchers() { return {
|
|
@@ -36804,6 +36837,14 @@ class RouterOutlet {
|
|
|
36804
36837
|
async connectedCallback() {
|
|
36805
36838
|
const onStart = () => {
|
|
36806
36839
|
this.gestureOrAnimationInProgress = true;
|
|
36840
|
+
/**
|
|
36841
|
+
* Without animations there's nothing for the swipe to drive, so
|
|
36842
|
+
* wait until the gesture ends to decide whether to go back.
|
|
36843
|
+
*/
|
|
36844
|
+
if (!(this.animated && config.getBoolean('animated', true))) {
|
|
36845
|
+
this.unblockSwipeClicks = blockSwipeClicks(this.el);
|
|
36846
|
+
return;
|
|
36847
|
+
}
|
|
36807
36848
|
if (this.swipeHandler) {
|
|
36808
36849
|
this.swipeHandler.onStart();
|
|
36809
36850
|
}
|
|
@@ -36836,7 +36877,21 @@ class RouterOutlet {
|
|
|
36836
36877
|
this.ani.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);
|
|
36837
36878
|
}
|
|
36838
36879
|
else {
|
|
36839
|
-
|
|
36880
|
+
const { swipeHandler, unblockSwipeClicks: unblock } = this;
|
|
36881
|
+
this.unblockSwipeClicks = undefined;
|
|
36882
|
+
// The stack can change during the swipe, so check that going back is still possible.
|
|
36883
|
+
if (unblock && shouldComplete && swipeHandler?.canStart()) {
|
|
36884
|
+
new Promise((resolve) => resolve(swipeHandler.onStart()))
|
|
36885
|
+
.then(() => swipeHandler.onEnd(true))
|
|
36886
|
+
.finally(() => {
|
|
36887
|
+
this.gestureOrAnimationInProgress = false;
|
|
36888
|
+
unblock();
|
|
36889
|
+
});
|
|
36890
|
+
}
|
|
36891
|
+
else {
|
|
36892
|
+
this.gestureOrAnimationInProgress = false;
|
|
36893
|
+
unblock?.();
|
|
36894
|
+
}
|
|
36840
36895
|
}
|
|
36841
36896
|
});
|
|
36842
36897
|
if (this.swipeGesture === undefined) {
|
|
@@ -36859,6 +36914,12 @@ class RouterOutlet {
|
|
|
36859
36914
|
this.gesture.destroy();
|
|
36860
36915
|
this.gesture = undefined;
|
|
36861
36916
|
}
|
|
36917
|
+
// Destroying the gesture skips onEnd, so end a deferred swipe here.
|
|
36918
|
+
if (this.unblockSwipeClicks) {
|
|
36919
|
+
this.unblockSwipeClicks();
|
|
36920
|
+
this.unblockSwipeClicks = undefined;
|
|
36921
|
+
this.gestureOrAnimationInProgress = false;
|
|
36922
|
+
}
|
|
36862
36923
|
}
|
|
36863
36924
|
/** @internal */
|
|
36864
36925
|
async commit(enteringEl, leavingEl, opts) {
|
|
@@ -36970,7 +37031,7 @@ class RouterOutlet {
|
|
|
36970
37031
|
return true;
|
|
36971
37032
|
}
|
|
36972
37033
|
render() {
|
|
36973
|
-
return hAsync("slot", { key: '
|
|
37034
|
+
return hAsync("slot", { key: '078cdc7a63b98570746409fc08c4af80f8d7da4d' });
|
|
36974
37035
|
}
|
|
36975
37036
|
get el() { return getElement(this); }
|
|
36976
37037
|
static get watchers() { return {
|