Files
chuanggao-website/client/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs

2 lines
9.6 KiB
JavaScript
Raw Normal View History

2026-05-12 16:53:18 +08:00
import{rectToClientRect as t,arrow as e,autoPlacement as n,detectOverflow as o,flip as i,hide as r,inline as c,limitShift as l,offset as s,shift as f,size as u,computePosition as a}from"@floating-ui/core";const h=Math.min,d=Math.max,p=Math.round,g=Math.floor,m=t=>({x:t,y:t});function y(){return"undefined"!=typeof window}function w(t){return b(t)?(t.nodeName||"").toLowerCase():"#document"}function x(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function v(t){var e;return null==(e=(b(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function b(t){return!!y()&&(t instanceof Node||t instanceof x(t).Node)}function L(t){return!!y()&&(t instanceof Element||t instanceof x(t).Element)}function R(t){return!!y()&&(t instanceof HTMLElement||t instanceof x(t).HTMLElement)}function T(t){return!(!y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof x(t).ShadowRoot)}function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function S(t){return/^(table|td|th)$/.test(w(t))}function E(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const F=/transform|translate|scale|rotate|perspective|filter/,D=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let O;function H(t){const e=L(t)?z(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!M()&&(W(e.backdropFilter)||W(e.filter))||F.test(e.willChange||"")||D.test(e.contain||"")}function M(){return null==O&&(O="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O}function P(t){return/^(html|body|#document)$/.test(w(t))}function z(t){return x(t).getComputedStyle(t)}function B(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if("html"===w(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||v(t);return T(e)?e.host:e}function A(t){const e=V(t);return P(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&C(e)?e:A(e)}function N(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=A(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=x(i);if(r){const t=$(c);return e.concat(c,c.visualViewport||[],C(i)?i:[],t&&n?N(t):[])}return e.concat(i,N(i,[],n))}function $(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function k(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function I(t){return L(t)?t:t.contextElement}function q(t){const e=I(t);if(!R(e))return m(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=k(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const X=m(0);function Y(t){const e=x(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function _(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=I(e);let l=m(1);n&&(i?L(i)&&(l=q(i)):l=q(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==x(t))&&e}(c,o,i)?Y(c):m(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,h=r.height/l.y;if(c){const t=x(c),e=i&&L(i)?x(i):i;let n=t,o=$(n);for(;o&&i&&e!==n;){const t=q(o),e=o.getBoundingClientRect(),i=z(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,h*=t.y,f+=r,u+=c,n=x(o),o=$(n)}}return t({width:a,height:h,x:f,y:u})}function j(t,e){const n=B(t).scrollLeft;return e?e.left+n:_(v(t)).left+n}function G(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-j(t,n),y:n.top+e.scrollTop}}function J(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=x(t),o=v(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=M();(!t||t&&"fixed"===e)&&(l