import{L as n}from"./p-dcc98162.js";var t;function e(n,t,e){if(!n)return null;let r=n.parentElement||n.getRootNode().host,i=null;for(;r;){if(r.matches(t)&&(i=r,!(null==e?void 0:e.outerMost)))return i;r=r.parentElement||r.getRootNode().host}return i}!function(n){n.TABLET="tablet",n.MOBILE="mobile",n.DESKTOP="desktop"}(t||(t={}));const r=()=>{const n=navigator.userAgent;return/(tablet|ipad|playbook|silk|Macintosh)|(android(?!.*mobi))/i.test(n)&&navigator.maxTouchPoints>0?t.TABLET:/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(n)?t.MOBILE:t.DESKTOP},i=n=>n?n.filter((n=>n)).join(" "):"";function o(n,t){return!(!n||!t)&&(n===t||o(n.parentElement||n.getRootNode().host,t))}function a(n,t){n.scrollTop=t.offsetTop}function u(n){return n.getBoundingClientRect().height>0}function s(n){if(n){const t=n.replace(/\D/g,"");return""===t?null:Number(t)}return null}function c(n){n=l(n);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function f(n){if(!n.includes("rgb"))return null;const t=n.match(/\d+/g);return t&&3===t.length?`#${t.map((n=>{const t=Number(n).toString(16);return 1===t.length?"0"+t:t})).join("")}`:null}function l(n){return n||(n=""),n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(n,t,e,r){return"#"+t+t+e+e+r+r}))}function d(t){const e=parseFloat(b(t,"line-height"));return isNaN(e)?(n.warn("The line height of this element is not obtained"),!1):t.clientHeight>e}function b(n,t){return window.getComputedStyle(n).getPropertyValue(t)}function h(n=document,t=!1){const e=n.activeElement;return!e&&t&&"host"in n?n.host:e&&e.shadowRoot?h(e.shadowRoot,t):e}function m(n){return n&&n.nodeType===Node.ELEMENT_NODE}function p(n){if(0===n.detail)return!0;const t=n.composedPath()[0].getBoundingClientRect();if(0===t.width&&0===t.height)return!1;const e=Math.floor(t.x+t.width/2),r=Math.floor(t.y+t.height/2),i=n.clientY;return 1===n.detail&&Math.abs(e-n.clientX)<=1&&Math.abs(r-i)<=1}const M=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed",'[contenteditable="true"]','[contenteditable=""]',"[tabindex]"].join(",");function g(n){return!!n.matches(M)&&!n.hasAttribute("disabled")&&!n.hasAttribute("inert")&&"true"!==n.getAttribute("aria-hidden")&&!(n instanceof HTMLInputElement&&"hidden"===n.type)&&n.tabIndex>=0}function k(n){const t=n=>{if(n instanceof HTMLElement&&g(n))return n;const e=Array.from(n.querySelectorAll("*"));for(const n of e){if(g(n))return n;if(n.shadowRoot){const e=t(n.shadowRoot);if(e)return e}}return null};return n instanceof HTMLElement&&n.shadowRoot?g(n)?n:t(n)||t(n.shadowRoot):t(n)}export{t as D,i as a,o as b,l as c,u as d,h as e,e as f,r as g,c as h,m as i,d as j,b as k,p as l,k as m,s as n,a as o,f as r}