import{w as b,$ as x,o as M,g as S,n as y,a0 as L,a1 as T,k as W,a2 as C}from"./index.451d5b69.js";const U={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},A=["before-show","show","before-hide","hide"];function R({showing:e,canShow:t,hideOnRouteChange:l,handleShow:u,handleHide:c,processOnMount:V}){const f=S(),{props:i,emit:n,proxy:m}=f;let s;function E(o){e.value===!0?d(o):p(o)}function p(o){if(i.disable===!0||o!==void 0&&o.qAnchorHandled===!0||t!==void 0&&t(o)!==!0)return;const r=i["onUpdate:modelValue"]!==void 0;r===!0&&(n("update:modelValue",!0),s=o,y(()=>{s===o&&(s=void 0)})),(i.modelValue===null||r===!1)&&w(o)}function w(o){e.value!==!0&&(e.value=!0,n("before-show",o),u!==void 0?u(o):n("show",o))}function d(o){if(i.disable===!0)return;const r=i["onUpdate:modelValue"]!==void 0;r===!0&&(n("update:modelValue",!1),s=o,y(()=>{s===o&&(s=void 0)})),(i.modelValue===null||r===!1)&&g(o)}function g(o){e.value!==!1&&(e.value=!1,n("before-hide",o),c!==void 0?c(o):n("hide",o))}function h(o){i.disable===!0&&o===!0?i["onUpdate:modelValue"]!==void 0&&n("update:modelValue",!1):o===!0!==e.value&&(o===!0?w:g)(s)}b(()=>i.modelValue,h),l!==void 0&&x(f)===!0&&b(()=>m.$route.fullPath,()=>{l.value===!0&&e.value===!0&&d()}),V===!0&&M(()=>{h(i.modelValue)});const v={show:p,hide:d,toggle:E};return Object.assign(m,v),v}const H=[null,document,document.body,document.scrollingElement,document.documentElement];function N(e,t){let l=L(t);if(l===void 0){if(e==null)return window;l=e.closest(".scroll,.scroll-y,.overflow-auto")}return H.includes(l)?window:l}function O(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function j(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let a;function k(){if(a!==void 0)return a;const e=document.createElement("p"),t=document.createElement("div");T(e,{width:"100%",height:"200px"}),T(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const l=e.offsetWidth;t.style.overflow="scroll";let u=e.offsetWidth;return l===u&&(u=t.clientWidth),t.remove(),a=l-u,a}function z(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"]))}function B(){let e;return W(()=>{clearTimeout(e)}),{registerTimeout(t,l){clearTimeout(e),e=setTimeout(t,l)},removeTimeout(){clearTimeout(e)}}}function X(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),C.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}function Y(e,t,l){return l<=t?t:Math.min(l,Math.max(t,e))}export{O as a,A as b,X as c,B as d,R as e,Y as f,j as g,z as h,N as i,k as j,U as u};
