You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
8.4 KiB
2 lines
8.4 KiB
3 years ago
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";function n(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function o(t){return n(t).getComputedStyle(t)}function i(t){return s(t)?(t.nodeName||"").toLowerCase():""}let r;function l(){if(r)return r;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(r=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),r):navigator.userAgent}function c(t){return t instanceof n(t).HTMLElement}function f(t){return t instanceof n(t).Element}function s(t){return t instanceof n(t).Node}function u(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof n(t).ShadowRoot||t instanceof ShadowRoot}function a(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=o(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function d(t){return["table","td","th"].includes(i(t))}function h(t){const e=/firefox/i.test(l()),n=o(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function p(){return!/^((?!chrome|android).)*safari/i.test(l())}function g(t){return["html","body","#document"].includes(i(t))}const m=Math.min,y=Math.max,b=Math.round;function w(t){const e=o(t);let n=parseFloat(e.width),i=parseFloat(e.height);const r=t.offsetWidth,l=t.offsetHeight,c=b(n)!==r||b(i)!==l;return c&&(n=r,i=l),{width:n,height:i,fallback:c}}function x(t){return f(t)?t:t.contextElement}const v={x:1,y:1};function L(t){const e=x(t);if(!c(e))return v;const n=e.getBoundingClientRect(),{width:o,height:i,fallback:r}=w(e);let l=(r?b(n.width):n.width)/o,f=(r?b(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),f&&Number.isFinite(f)||(f=1),{x:l,y:f}}function T(t,e,o,i){var r,l;void 0===e&&(e=!1),void 0===o&&(o=!1);const c=t.getBoundingClientRect(),s=x(t);let u=v;e&&(i?f(i)&&(u=L(i)):u=L(t));const a=s?n(s):window,d=!p()&&o;let h=(c.left+(d&&(null==(r=a.visualViewport)?void 0:r.offsetLeft)||0))/u.x,g=(c.top+(d&&(null==(l=a.visualViewport)?void 0:l.offsetTop)||0))/u.y,m=c.width/u.x,y=c.height/u.y;if(s){const t=n(s),e=i&&f(i)?n(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=L(o),e=o.getBoundingClientRect(),i=getComputedStyle(o);e.x+=(o.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(o.clientTop+parseFloat(i.paddingTop))*t.y,h*=t.x,g*=t.y,m*=t.x,y*=t.y,h+=e.x,g+=e.y,o=n(o).frameElement}}return{width:m,height:y,top:g,right:h+m,bottom:g+y,left:h,x:h,y:g}}function O(t){return((s(t)?t.ownerDocument:t.document)||window.document).documentElement}function P(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function R(t){return T(O(t)).left+P(t).scrollLeft}function E(t,e,n){const o=c(e),r=O(e),l=T(t,!0,"fixed"===n,e);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==i(e)||a(r))&&(f=P(e)),c(e)){const t=T(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else r&&(s.x=R(r));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function C(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||(u(t)?t.host:null)||O(t);return u(e)?e.host:e}function j(t){return c(t)&&"fixed"!==o(t).position?t.offsetParent:null}function F(t){const e=n(t);let r=j(t);for(;r&&d(r)&&"static"===o(r).position;)r=j(r);return r&&("html"===i(r)||"body"===i(r)&&"static"===o(r).position&&!h(r))?e:r||function(t){let e=C(t);for(;c(e)&&!g(e);){if(h(e))return e;e=C(e)}return null}(t)||e}function D(t){const e=C(t);return g(e)?t.ownerDocument.body:c(e)&&a(e)?e:D(e)}function S(t,e){var o;void 0===e&&(e=[]);const
|