import{ag as _,ah as V,B as D,X as z}from"./app-CPb3bToC.js";import{v as G,a as h,b as U,d as C}from"./chunk-DfTn_VfD.js";import{m as X,w as M,O as j,y as q,g as H,P as I,l as A,$ as R,a as L}from"./chunk-DhYw-kuD.js";function ae(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),_.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const re={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},ue=["beforeShow","show","beforeHide","hide"];function ce({showing:e,canShow:t,hideOnRouteChange:o,handleShow:l,handleHide:i,processOnMount:r}){const a=X(),{props:s,emit:u,proxy:g}=a;let c;function m(n){e.value===!0?P(n):p(n)}function p(n){if(s.disable===!0||n!==void 0&&n.qAnchorHandled===!0||t!==void 0&&t(n)!==!0)return;const f=s["onUpdate:modelValue"]!==void 0;f===!0&&(u("update:modelValue",!0),c=n,q(()=>{c===n&&(c=void 0)})),(s.modelValue===null||f===!1)&&$(n)}function $(n){e.value!==!0&&(e.value=!0,u("beforeShow",n),l!==void 0?l(n):u("show",n))}function P(n){if(s.disable===!0)return;const f=s["onUpdate:modelValue"]!==void 0;f===!0&&(u("update:modelValue",!1),c=n,q(()=>{c===n&&(c=void 0)})),(s.modelValue===null||f===!1)&&E(n)}function E(n){e.value!==!1&&(e.value=!1,u("beforeHide",n),i!==void 0?i(n):u("hide",n))}function y(n){s.disable===!0&&n===!0?s["onUpdate:modelValue"]!==void 0&&u("update:modelValue",!1):n===!0!==e.value&&(n===!0?$:E)(c)}M(()=>s.modelValue,y),o!==void 0&&G(a)===!0&&M(()=>g.$route.fullPath,()=>{o.value===!0&&e.value===!0&&P()}),r===!0&&j(()=>{y(s.modelValue)});const F={show:p,hide:P,toggle:m};return Object.assign(g,F),F}let d=[],w=[];function O(e){w=w.filter(t=>t!==e)}function Y(e){O(e),w.push(e)}function N(e){O(e),w.length===0&&d.length!==0&&(d[d.length-1](),d=[])}function de(e){w.length===0?e():d.push(e)}function fe(e){d=d.filter(t=>t!==e)}let k=1,x=document.body;function B(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${k++}`:e,V.globalNodes!==void 0){const l=V.globalNodes.class;l!==void 0&&(o.className=l)}return x.appendChild(o),o}function J(e){e.remove()}const b=[];function me(e){return b.find(t=>t.contentEl!==null&&t.contentEl.contains(e))}function K(e,t){do{if(e.$options.name==="QMenu"){if(e.hide(t),e.$props.separateClosePopup===!0)return h(e)}else if(e.__qPortal===!0){const o=h(e);return o!==void 0&&o.$options.name==="QPopupProxy"?(e.hide(t),o):e}e=h(e)}while(e!=null)}function pe(e,t,o){for(;o!==0&&e!==void 0&&e!==null;){if(e.__qPortal===!0){if(o--,e.$options.name==="QMenu"){e=K(e,t);continue}e.hide(t)}e=h(e)}}const Z=D({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function ee(e){for(e=e.parent;e!=null;){if(e.type.name==="QGlobalDialog")return!0;if(e.type.name==="QDialog"||e.type.name==="QMenu")return!1;e=e.parent}return!1}function we(e,t,o,l){const i=H(!1),r=H(!1);let a=null;const s={},u=l==="dialog"&&ee(e);function g(m){if(m===!0){N(s),r.value=!0;return}r.value=!1,i.value===!1&&(u===!1&&a===null&&(a=B(!1,l)),i.value=!0,b.push(e.proxy),Y(s))}function c(m){if(r.value=!1,m!==!0)return;N(s),i.value=!1;const p=b.indexOf(e.proxy);p!==-1&&b.splice(p,1),a!==null&&(J(a),a=null)}return I(()=>{c(!0)}),e.proxy.__qPortal=!0,z(e.proxy,"contentEl",()=>t.value),{showPortal:g,hidePortal:c,portalIsActive:i,portalIsAccessible:r,renderPortal:()=>u===!0?o():i.value===!0?[A(R,{to:a},A(Z,o))]:void 0}}const ge={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function ve(e,t=()=>{},o=()=>{}){return{transitionProps:L(()=>{const l=`q-transition--${e.transitionShow||t()}`,i=`q-transition--${e.transitionHide||o()}`;return{appear:!0,enterFromClass:`${l}-enter-from`,enterActiveClass:`${l}-enter-active`,enterToClass:`${l}-enter-to`,leaveFromClass:`${i}-leave-from`,leaveActiveClass:`${i}-leave-active`,leaveToClass:`${i}-leave-to`}}),transitionStyle:L(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}const he=[Element,String],te=[null,document,document.body,document.scrollingElement,document.documentElement];function be(e,t){let o=U(t);if(o===void 0){if(e==null)return window;o=e.closest(".scroll,.scroll-y,.overflow-auto")}return te.includes(o)?window:o}function oe(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function ne(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function Q(e,t,o=0){const l=arguments[3]===void 0?performance.now():arguments[3],i=oe(e);if(o<=0){i!==t&&S(e,t);return}requestAnimationFrame(r=>{const a=r-l,s=i+(t-i)/Math.max(a,o)*a;S(e,s),s!==t&&Q(e,t,o-a,r)})}function W(e,t,o=0){const l=arguments[3]===void 0?performance.now():arguments[3],i=ne(e);if(o<=0){i!==t&&T(e,t);return}requestAnimationFrame(r=>{const a=r-l,s=i+(t-i)/Math.max(a,o)*a;T(e,s),s!==t&&W(e,t,o-a,r)})}function S(e,t){if(e===window){window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,t);return}e.scrollTop=t}function T(e,t){if(e===window){window.scrollTo(t,window.pageYOffset||window.scrollY||document.body.scrollTop||0);return}e.scrollLeft=t}function Pe(e,t,o){if(o){Q(e,t,o);return}S(e,t)}function Se(e,t,o){if(o){W(e,t,o);return}T(e,t)}let v;function Te(){if(v!==void 0)return v;const e=document.createElement("p"),t=document.createElement("div");C(e,{width:"100%",height:"200px"}),C(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const o=e.offsetWidth;t.style.overflow="scroll";let l=e.offsetWidth;return o===l&&(l=t.clientWidth),t.remove(),v=o-l,v}function $e(e,t=!0){return!e||e.nodeType!==Node.ELEMENT_NODE?!1:t?e.scrollHeight>e.clientHeight&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-y"])):e.scrollWidth>e.clientWidth&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-x"]))}export{ue as a,ce as b,ge as c,ve as d,we as e,ae as f,be as g,K as h,de as i,Te as j,oe as k,ne as l,Se as m,Pe as n,me as o,b as p,pe as q,fe as r,he as s,$e as t,re as u};