import{r as t,d as o,w as e,h as i,H as a,e as s}from"./p-03169580.js";import{g as r,c as n}from"./p-4cb16df5.js";import{a as d,i as c,d as h,r as l,f as p,p as f}from"./p-5e38ef53.js";import{C as m,a as u,d as b}from"./p-ca7b7028.js";import{l as w,a as g,r as x}from"./p-7cbdb4ea.js";import{KEYBOARD_DID_OPEN as k}from"./p-7e7ce516.js";import{b as v}from"./p-b5cdbd99.js";import{B as y,a as D,b as A,c as Y,d as B,e as C}from"./p-c5cf028c.js";import{g as M}from"./p-0e4de1d0.js";import{d as E}from"./p-cd2253e7.js";import{c as j}from"./p-d5da637d.js";import{g as S}from"./p-4d4077ea.js";import{createGesture as T}from"./p-e9431eeb.js";import"./p-076f0239.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const I=async(t,o)=>{if(typeof t.canDismiss!=="function"){return}const e=await t.canDismiss();if(!e){return}if(o.isRunning()){o.onFinish((()=>{t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}};const $=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1;
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const O={MIN_PRESENTING_SCALE:.93};const P=(t,o,e)=>{const i=t.offsetHeight;let a=false;let s=false;let r=null;let n=null;const p=.2;let f=true;const m=()=>{if(r&&c(r)){return r.scrollY}else{return true}};const u=t=>{const o=t.event.target;if(o===null||!o.closest){return true}r=d(o);if(r){if(c(r)){const t=w(r);n=t.querySelector(".inner-scroll")}else{n=r}const t=!!r.querySelector("ion-refresher");return!t&&n.scrollTop===0}const e=o.closest("ion-footer");if(e===null){return true}return false};const b=e=>{const{deltaY:i}=e;f=m();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(i>0&&r){h(r)}o.progressStart(true,a?1:0)};const x=t=>{const{deltaY:e}=t;if(e>0&&r){h(r)}const a=t.deltaY/i;const n=a>=0&&s;const d=n?p:.9999;const c=n?$(a/d):a;const l=g(1e-4,c,d);o.progressStep(l)};const k=n=>{const d=n.velocityY;const c=n.deltaY/i;const h=c>=0&&s;const m=h?p:.9999;const u=h?$(c/m):c;const b=g(1e-4,u,m);const w=(n.deltaY+d*1e3)/i;const x=!h&&w>=.5;let k=x?-.001:.001;if(!x){o.easing("cubic-bezier(1, 0, 0.68, 0.28)");k+=S([0,0],[1,0],[.68,.28],[1,1],b)[0]}else{o.easing("cubic-bezier(0.32, 0.72, 0, 1)");k+=S([0,0],[.32,.72],[0,1],[1,1],b)[0]}const y=x?W(c*i,d):W((1-b)*i,d);a=x;v.enable(false);if(r){l(r,f)}o.onFinish((()=>{if(!x){v.enable(true)}})).progressEnd(x?1:0,k,y);if(h&&b>m/4){I(t,o)}else if(x){e()}};const v=T({el:t,gestureName:"modalSwipeToClose",gesturePriority:39,direction:"y",threshold:10,canStart:u,onStart:b,onMove:x,onEnd:k});return v};const W=(t,o)=>g(400,t/Math.abs(o*1.1),500);
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const z=(t,o)=>{const e=1/(1-o);const i=-(o*e);return t*e+i};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const R=t=>{const{currentBreakpoint:o,backdropBreakpoint:e}=t;const i=e===undefined||e<o;const a=i?`calc(var(--backdrop-opacity) * ${o})`:"0";const s=j("backdropAnimation").fromTo("opacity",0,a);if(i){s.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}const r=j("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-o*100}%)`}]);return{wrapperAnimation:r,backdropAnimation:s}};const L=t=>{const{currentBreakpoint:o,backdropBreakpoint:e}=t;const i=`calc(var(--backdrop-opacity) * ${z(o,e)})`;const a=[{offset:0,opacity:i},{offset:1,opacity:0}];const s=[{offset:0,opacity:i},{offset:e,opacity:0},{offset:1,opacity:0}];const r=j("backdropAnimation").keyframes(e!==0?s:a);const n=j("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-o*100}%)`},{offset:1,opacity:1,transform:`translateY(100%)`}]);return{wrapperAnimation:n,backdropAnimation:r}};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const N=()=>{const t=j().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const o=j().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:o}};const _=(t,o)=>{const{presentingEl:e,currentBreakpoint:i}=o;const a=w(t);const{wrapperAnimation:s,backdropAnimation:r}=i!==undefined?R(o):N();r.addElement(a.querySelector("ion-backdrop"));s.addElement(a.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const n=j("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(s);if(e){const t=window.innerWidth<768;const o=e.tagName==="ION-MODAL"&&e.presentingElement!==undefined;const i=w(e);const a=j().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});const d=document.body;if(t){const t=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";const i=o?"-10px":t;const s=O.MIN_PRESENTING_SCALE;const r=`translateY(${i}) scale(${s})`;a.afterStyles({transform:r}).beforeAddWrite((()=>d.style.setProperty("background-color","black"))).addElement(e).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:r,borderRadius:"10px 10px 0 0"}]);n.addAnimation(a)}else{n.addAnimation(r);if(!o){s.fromTo("opacity","0","1")}else{const t=o?O.MIN_PRESENTING_SCALE:1;const e=`translateY(-10px) scale(${t})`;a.afterStyles({transform:e}).addElement(i.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:e}]);const s=j().afterStyles({transform:e}).addElement(i.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:e}]);n.addAnimation([a,s])}}}else{n.addAnimation(r)}return n};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const V=()=>{const t=j().fromTo("opacity","var(--backdrop-opacity)",0);const o=j().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:o}};const K=(t,o,e=500)=>{const{presentingEl:i,currentBreakpoint:a}=o;const s=w(t);const{wrapperAnimation:r,backdropAnimation:n}=a!==undefined?L(o):V();n.addElement(s.querySelector("ion-backdrop"));r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=j("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(e).addAnimation(r);if(i){const t=window.innerWidth<768;const o=i.tagName==="ION-MODAL"&&i.presentingElement!==undefined;const e=w(i);const a=j().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{if(t!==1){return}i.style.setProperty("overflow","");const o=Array.from(s.querySelectorAll("ion-modal")).filter((t=>t.presentingElement!==undefined)).length;if(o<=1){s.style.setProperty("background-color","")}}));const s=document.body;if(t){const t=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";const e=o?"-10px":t;const s=O.MIN_PRESENTING_SCALE;const r=`translateY(${e}) scale(${s})`;a.addElement(i).keyframes([{offset:0,filter:"contrast(0.85)",transform:r,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);d.addAnimation(a)}else{d.addAnimation(n);if(!o){r.fromTo("opacity","1","0")}else{const t=o?O.MIN_PRESENTING_SCALE:1;const i=`translateY(-10px) scale(${t})`;a.addElement(e.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:i},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const s=j().addElement(e.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:i},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([a,s])}}}else{d.addAnimation(n)}return d};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const F=()=>{const t=j().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);const o=j().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:`translateY(0px)`}]);return{backdropAnimation:t,wrapperAnimation:o}};const G=(t,o)=>{const{currentBreakpoint:e}=o;const i=w(t);const{wrapperAnimation:a,backdropAnimation:s}=e!==undefined?R(o):F();s.addElement(i.querySelector("ion-backdrop"));a.addElement(i.querySelector(".modal-wrapper"));return j().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,a])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const Z=()=>{const t=j().fromTo("opacity","var(--backdrop-opacity)",0);const o=j().keyframes([{offset:0,opacity:.99,transform:`translateY(0px)`},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:o}};const H=(t,o)=>{const{currentBreakpoint:e}=o;const i=w(t);const{wrapperAnimation:a,backdropAnimation:s}=e!==undefined?L(o):Z();s.addElement(i.querySelector("ion-backdrop"));a.addElement(i.querySelector(".modal-wrapper"));return j().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,a])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const q=(t,o,e,i,a,s,r=[],n,d,c)=>{const h=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];const l=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-a,opacity:0},{offset:1,opacity:0}];const p={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:a!==0?l:h};const f=t.querySelector("ion-content");const m=e.clientHeight;let u=i;let b=0;let w=false;const k=.95;const v=s.childAnimations.find((t=>t.id==="wrapperAnimation"));const y=s.childAnimations.find((t=>t.id==="backdropAnimation"));const D=r[r.length-1];const A=r[0];const Y=()=>{t.style.setProperty("pointer-events","auto");o.style.setProperty("pointer-events","auto");t.classList.remove("ion-disable-focus-trap")};const B=()=>{t.style.setProperty("pointer-events","none");o.style.setProperty("pointer-events","none");t.classList.add("ion-disable-focus-trap")};if(v&&y){v.keyframes([...p.WRAPPER_KEYFRAMES]);y.keyframes([...p.BACKDROP_KEYFRAMES]);s.progressStart(true,1-u);const t=u>a;if(t){Y()}else{B()}}if(f&&u!==D){f.scrollY=false}const C=t=>{const o=t.event.target.closest("ion-content");u=n();if(u===1&&o){return false}return true};const M=()=>{w=t.canDismiss!==undefined&&t.canDismiss!==true&&A===0;if(f){f.scrollY=false}x((()=>{t.focus()}));s.progressStart(true,1-u)};const E=t=>{const o=1-u;const e=r.length>1?1-r[1]:undefined;const i=o+t.deltaY/m;const a=e!==undefined&&i>=e&&w;const n=a?k:.9999;const d=a&&e!==undefined?e+$((i-e)/(n-e)):i;b=g(1e-4,d,n);s.progressStep(b)};const j=t=>{const o=t.velocityY;const e=(t.deltaY+o*100)/m;const i=u-e;const a=r.reduce(((t,o)=>Math.abs(o-i)<Math.abs(t-i)?o:t));S({breakpoint:a,breakpointOffset:b,canDismiss:w})};const S=o=>{const{breakpoint:e,canDismiss:i,breakpointOffset:n}=o;const h=i&&e===0;const l=h?u:e;const m=l!==0;u=0;if(v&&y){v.keyframes([{offset:0,transform:`translateY(${n*100}%)`},{offset:1,transform:`translateY(${(1-l)*100}%)`}]);y.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${z(1-n,a)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${z(l,a)})`}]);s.progressStep(0)}O.enable(false);s.onFinish((()=>{if(m){if(v&&y){x((()=>{v.keyframes([...p.WRAPPER_KEYFRAMES]);y.keyframes([...p.BACKDROP_KEYFRAMES]);s.progressStart(true,1-l);u=l;c(u);if(f&&u===r[r.length-1]){f.scrollY=true}const t=u>a;if(t){Y()}else{B()}O.enable(true)}))}else{O.enable(true)}}}),{oneTimeCallback:true}).progressEnd(1,0,500);if(h){I(t,s)}else if(!m){d()}};const O=T({el:e,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:M,onMove:E,onEnd:j});return{gesture:O,moveSheetToBreakpoint:S}};const J=":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);background:var(--ion-color-step-350, #c0c0be);z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{transform:translate3d(0,  100%,  0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;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);transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{box-shadow:none}:host(.modal-card) .modal-shadow{box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}";const Q=":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);background:var(--ion-color-step-350, #c0c0be);z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{transform:translate3d(0,  40px,  0);opacity:0.01}";let U=class{constructor(e){t(this,e);this.didPresent=o(this,"ionModalDidPresent",7);this.willPresent=o(this,"ionModalWillPresent",7);this.willDismiss=o(this,"ionModalWillDismiss",7);this.didDismiss=o(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=o(this,"ionBreakpointDidChange",7);this.didPresentShorthand=o(this,"didPresent",7);this.willPresentShorthand=o(this,"willPresent",7);this.willDismissShorthand=o(this,"willDismiss",7);this.didDismissShorthand=o(this,"didDismiss",7);this.modalIndex=tt++;this.coreDelegate=m();this.isSheetModal=false;this.inline=false;this.gestureAnimationDismissing=false;this.presented=false;this.hasController=false;this.keyboardClose=true;this.backdropBreakpoint=0;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.swipeToClose=false;this.isOpen=false;this.configureTriggerInteraction=()=>{const{trigger:t,el:o,destroyTriggerInteraction:e}=this;if(e){e()}const i=t!==undefined?document.getElementById(t):null;if(!i){return}const a=(t,o)=>{const e=()=>{o.present()};t.addEventListener("click",e);return()=>{t.removeEventListener("click",e)}};this.destroyTriggerInteraction=a(i,o)};this.onBackdropTap=()=>{this.dismiss(undefined,y)};this.onLifecycle=t=>{const o=this.usersElement;const e=X[t.type];if(o&&e){const i=new CustomEvent(e,{bubbles:false,cancelable:false,detail:t.detail});o.dispatchEvent(i)}}}onIsOpenChange(t,o){if(t===true&&o===false){this.present()}else if(t===false&&o===true){this.dismiss()}}onTriggerChange(){this.configureTriggerInteraction()}async swipeToCloseChanged(t){if(this.gesture){this.gesture.enable(t)}else if(t){await this.initSwipeToClose()}}breakpointsChanged(t){if(t!==undefined){this.sortedBreakpoints=t.sort(((t,o)=>t-o))}}connectedCallback(){D(this.el)}componentWillLoad(){const{breakpoints:t,initialBreakpoint:o,swipeToClose:e}=this;this.modalId=this.el.hasAttribute("id")?this.el.getAttribute("id"):`ion-modal-${this.modalIndex}`;const i=this.isSheetModal=t!==undefined&&o!==undefined;if(i){this.currentBreakpoint=this.initialBreakpoint}if(t!==undefined&&o!==undefined&&!t.includes(o)){v("Your breakpoints array must include the initialBreakpoint value.")}if(e){v("swipeToClose has been deprecated in favor of canDismiss.\n\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.")}}componentDidLoad(){if(this.isOpen===true){x((()=>this.present()))}this.breakpointsChanged(this.breakpoints);this.configureTriggerInteraction()}getDelegate(t=false){if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}const o=this.el.parentNode;const e=this.inline=o!==null&&!this.hasController;const i=this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate;return{inline:e,delegate:i}}async checkCanDismiss(){const{canDismiss:t}=this;if(t===undefined){return true}if(typeof t==="function"){return t()}return t}async present(){if(this.presented){return}if(this.currentTransition!==undefined){await this.currentTransition}this.currentBreakpoint=this.initialBreakpoint;const t=Object.assign(Object.assign({},this.componentProps),{modal:this.el});const{inline:o,delegate:i}=this.getDelegate(true);this.usersElement=await u(i,this.el,this.component,["ion-page"],t,o);await E(this.usersElement);e((()=>this.el.classList.add("show-modal")));this.currentTransition=A(this,"modalEnter",_,G,{presentingEl:this.presentingElement,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});await this.currentTransition;if(this.isSheetModal){this.initSheetGesture()}else if(this.swipeToClose||this.canDismiss!==undefined&&this.presentingElement!==undefined){await this.initSwipeToClose()}if(typeof window!=="undefined"){this.keyboardOpenCallback=()=>{if(this.gesture){this.gesture.enable(false);x((()=>{if(this.gesture){this.gesture.enable(true)}}))}};window.addEventListener(k,this.keyboardOpenCallback)}this.currentTransition=undefined}initSwipeToClose(){if(r(this)!=="ios"){return}const{el:t}=this;const o=this.leaveAnimation||n.get("modalLeave",K);const e=this.animation=o(t,{presentingEl:this.presentingElement});const i=p(t);if(!i){f(t);return}this.gesture=P(t,e,(()=>{this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{await this.dismiss(undefined,"gesture");this.gestureAnimationDismissing=false}))}));this.gesture.enable(true)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:o,backdropBreakpoint:e}=this;if(!t||o===undefined){return}const i=this.enterAnimation||n.get("modalEnter",_);const a=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:o,backdropBreakpoint:e});a.progressStart(true,1);const{gesture:s,moveSheetToBreakpoint:r}=q(this.el,this.backdropEl,t,o,e,a,this.sortedBreakpoints,(()=>{var t;return(t=this.currentBreakpoint)!==null&&t!==void 0?t:0}),(()=>this.sheetOnDismiss()),(t=>{if(this.currentBreakpoint!==t){this.currentBreakpoint=t;this.ionBreakpointDidChange.emit({breakpoint:t})}}));this.gesture=s;this.moveSheetToBreakpoint=r;this.gesture.enable(true)}sheetOnDismiss(){this.gestureAnimationDismissing=true;this.animation.onFinish((async()=>{this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});await this.dismiss(undefined,"gesture");this.gestureAnimationDismissing=false}))}async dismiss(t,o){if(this.gestureAnimationDismissing&&o!=="gesture"){return false}if(o!=="handler"&&!await this.checkCanDismiss()){return false}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(k,this.keyboardOpenCallback)}if(this.currentTransition!==undefined){await this.currentTransition}const i=Y.get(this)||[];this.currentTransition=B(this,t,o,"modalLeave",K,H,{presentingEl:this.presentingElement,currentBreakpoint:this.currentBreakpoint||this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint});const a=await this.currentTransition;if(a){const{delegate:t}=this.getDelegate();await b(t,this.usersElement);e((()=>this.el.classList.remove("show-modal")));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}i.forEach((t=>t.destroy()))}this.currentBreakpoint=undefined;this.currentTransition=undefined;this.animation=undefined;return a}onDidDismiss(){return C(this.el,"ionModalDidDismiss")}onWillDismiss(){return C(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal){v("setCurrentBreakpoint is only supported on sheet modals.");return}if(!this.breakpoints.includes(t)){v(`Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);return}const{currentBreakpoint:o,moveSheetToBreakpoint:e,canDismiss:i,breakpoints:a}=this;if(o===t){return}if(e){e({breakpoint:t,breakpointOffset:1-o,canDismiss:i!==undefined&&i!==true&&a[0]===0})}}async getCurrentBreakpoint(){return this.currentBreakpoint}render(){const{handle:t,isSheetModal:o,presentingElement:e,htmlAttributes:s}=this;const n=t!==false&&o;const d=r(this);const{modalId:c}=this;const h=e!==undefined&&d==="ios";return i(a,Object.assign({"no-router":true,"aria-modal":"true",tabindex:"-1"},s,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[d]:true,["modal-default"]:!h&&!o,[`modal-card`]:h,[`modal-sheet`]:o,"overlay-hidden":true},M(this.cssClass)),id:c,onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),i("ion-backdrop",{ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),d==="ios"&&i("div",{class:"modal-shadow"}),i("div",{role:"dialog",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t},n&&i("div",{class:"modal-handle",part:"handle"}),i("slot",null)))}get el(){return s(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["onTriggerChange"],swipeToClose:["swipeToCloseChanged"]}}};const X={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};let tt=0;U.style={ios:J,md:Q};export{U as ion_modal};
//# sourceMappingURL=p-39e3da14.entry.js.map