react-md
Version:
This is the full react-md library bundled together for convenience.
7 lines • 364 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self).ReactMD={},e.React,e.ReactDOM)}(this,(function(e,t,n){"use strict";var r="default"in t?t.default:t,o="default"in n?n.default:n;function i(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var a=i((function(e){
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var a=n.apply(null,o);a&&e.push(a)}else if("object"===i)for(var l in o)t.call(o,l)&&o[l]&&e.push(l)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}));function l(e){var r=e.into,o=e.intoId,i=e.children,a=t.useState(null),l=a[0],s=a[1];return t.useEffect((function(){var e=function(e,t){if("undefined"==typeof document)return null;var n=null;return void 0===e&&void 0===t?n=document.body:"string"==typeof t?n=document.getElementById(t):"string"==typeof e?n=document.querySelector(e):"function"==typeof e?n=e():e&&(n=e),n}(r,o);l!==e&&s(e)}),[r,o,l]),l?n.createPortal(i,l):null}try{var s=require("prop-types");l.propTypes={into:s.oneOfType([s.string,s.func,s.object]),intoId:s.string,children:s.node}}catch(e){}function c(e){var t=e.portal,n=e.portalInto,o=e.portalIntoId,i=e.children;return t||n||o?r.createElement(l,{into:n,intoId:o},i):i}try{var d=require("prop-types");c.propTypes={portal:d.bool,portalInto:d.oneOfType([d.string,d.func,d.object]),portalIntoId:d.string,children:d.node}}catch(e){}var u=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function f(e){if(!u.test(e)&&!p.test(e))throw new TypeError("Invalid color string.");var t=(e=e.replace(u,(function(e,t,n,r){return""+t+t+n+n+r+r}))).match(p)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}function m(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function b(e){var t=f(e),n=t[0],r=t[1],o=t[2];return.2126*m(n)+.7152*m(r)+.0722*m(o)}function v(e,t){var n=b(e)+.05,r=b(t)+.05;return Math.max(n,r)/Math.min(n,r)}var y=function(){},h=!1;function g(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",y,t),window.removeEventListener("testSupportsPassive",y,t),h=e,e}g();var O=Object.freeze({__proto__:null,update:g,get isSupported(){return h}}),E=[];function w(e,t,n,r){void 0===t&&(t=window),void 0===n&&(n=!1);var o=[],i=function(e,t){var n=!1,r=function(e){return function(){for(var r=0;r<t.length;r+=1)t[r](e);n=!1}};return function(t){e?n||(n=!0,window.requestAnimationFrame(r(t))):r(t)()}}(n,o);return{add:function(n){o.length||t.addEventListener(e,i,r),-1===o.indexOf(n)&&o.push(n)},remove:function(n){var a=o.indexOf(n);a>=0&&(o.splice(a,1),o.length||t.removeEventListener(e,i,r))}}}function x(e,t,n,r){void 0===t&&(t=window),void 0===n&&(n="resize"===e||"scroll"===e);var o=E.findIndex((function(o){return o.type===e&&o.target===t&&o.options===r&&o.throttle===n}));return-1===o&&(E.push({type:e,target:t,options:r,throttle:n,handler:w(e,t,n,r)}),o=E.length-1),E[o].handler}var C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function T(e,t,n,r,o,i){void 0===o&&(o=!1),t[(e?"add":"remove")+"EventListener"]("touch"+n,r,h?C({passive:!0,capture:o},i):o)}function N(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e})),n}function j(e){var n=e.enabled,r=void 0===n||n,o=e.onScroll,i=e.element,a=e.options,l=void 0===a?!!h&&{passive:!0}:a,s=N(o);t.useEffect((function(){if(r){var e=x("scroll",i||window,!0,l),t=function(e){return s.current(e)};return e.add(t),function(){e.remove(t)}}}),[r,i,l])}function P(e){var n=t.useState(e),r=n[0],o=n[1],i=N(r);return[r,t.useCallback((function(){i.current||o(!0)}),[]),t.useCallback((function(){i.current&&o(!1)}),[]),t.useCallback((function(){o((function(e){return!e}))}),[]),o]}function S(){var e=function(e){void 0===e&&(e=1200);var n=t.useState(0),r=n[0],o=n[1],i=N(r),a=t.useRef(!1),l=t.useCallback((function(){o(Date.now()),a.current=!1}),[]),s=t.useCallback((function(){var t=i.current;a.current||Date.now()-t<e?a.current=!1:o(0)}),[e]);return t.useEffect((function(){return window.addEventListener("touchstart",l,!0),function(){window.removeEventListener("touchstart",l,!0)}}),[l]),t.useEffect((function(){if(0!==r){var e=function(){a.current=!0};return window.addEventListener("mousemove",s,!0),window.addEventListener("contextmenu",e,!0),function(){window.removeEventListener("mousemove",s,!0),window.removeEventListener("contextmenu",e,!0)}}a.current=!1}),[r,s]),0!==r}(),n=function(){var e=P(!1),n=e[0],r=e[1],o=e[2];return t.useEffect((function(){if(!n)return window.addEventListener("keydown",r,!0),function(){window.removeEventListener("keydown",r,!0)}}),[n,r]),t.useEffect((function(){if(n)return window.addEventListener("mousedown",o,!0),window.addEventListener("touchstart",o,!0),function(){window.removeEventListener("mousedown",o,!0),window.removeEventListener("touchstart",o,!0)}}),[n,o]),n}();return e?"touch":n?"keyboard":"mouse"}var I=t.createContext("mouse"),A=t.createContext(!1);function R(){return t.useContext(I)}function k(e){return R()===e}function M(e){var n=e.children;if(t.useContext(A))throw new Error("Nested `InteractionModeListener` components");var o=S();return function(e){t.useEffect((function(){var t="rmd-utils--"+e;return document.body.classList.add(t),function(){document.body.classList.remove(t)}}),[e])}(o),r.createElement(I.Provider,{value:o},r.createElement(A.Provider,{value:!0},n))}try{var D=require("prop-types");M.propTypes={children:D.node.isRequired}}catch(e){}function L(e,t){if(!t)return e;var n=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(r,o){return n.call(t,o)&&t[o]&&(r=r+" "+e+"--"+o),r}),e)}function _(e){if(!e)throw new Error("bem requires a base block class but none were provided.");return function(t,n){if("string"!=typeof t&&n)throw new TypeError("bem does not support having two modifier arguments.");return t?"string"!=typeof t?L(e,t):L(e+"__"+t,n):e}}function q(e,n,r,o){void 0===r&&(r=!1),void 0===o&&(o="undefined"!=typeof window);var i=t.useState((function(){return void 0!==n?n:!(r||!o||"undefined"==typeof window)&&window.matchMedia(e).matches})),a=i[0],l=i[1];return t.useEffect((function(){if("undefined"!=typeof window&&!r){var t=window.matchMedia(e),n=function(e){var t=e.matches;return l(t)};return t.addListener(n),t.matches!==a&&l(t.matches),function(){return t.removeListener(n)}}}),[r,a,e]),a}var F=function(e,t){var n=typeof e;return"undefined"===n?"":"("+t+"-width: "+("number"===n?e+"px":e)+")"};function K(e){var n=e.min,r=e.max;return q(t.useMemo((function(){return"screen and "+[F(n,"min"),F(r,"max")].filter(Boolean).join(" and ")}),[n,r]))}var H=function(){var e,t=null===(e=window.screen.orientation)||void 0===e?void 0:e.type;if("string"==typeof t)return t;var n=window.screen;return n.availHeight>n.availWidth?"portrait-primary":"landscape-primary"};function W(e){var n=t.useState((function(){return e||("undefined"!=typeof window?H():"landscape-primary")})),r=n[0],o=n[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){o(H())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),r}var B={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};var z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},U=t.createContext(z(z({},B),{__initialized:!1}));function Y(){var e=t.useContext(U),n=e.__initialized,r=V(e,["__initialized"]);if(!n)throw new Error("Attempted to use the current `AppSizeContext` without mounting the `AppSizeListener` component beforehand.");return r}var X=function(){return(X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},G=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},$=_("rmd-grid"),Q=t.forwardRef((function(e,n){var o,i,l,s,c,d,u,p=e.style,f=e.className,m=e.clone,b=e.children,v=e.colSpan,y=e.colStart,h=e.colEnd,g=e.rowSpan,O=e.rowStart,E=e.rowEnd,w=e.phone,x=e.tablet,C=e.desktop,T=e.largeDesktop,N=G(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),j=Y(),P=j.isPhone,S=j.isTablet,I=j.isDesktop,A=j.isLargeDesktop,R=v,k=y,M=h,D=g,L=O,_=E,q=P&&w||S&&x||I&&C||A&&T;q&&(D=void 0===(o=q.rowSpan)?g:o,L=void 0===(i=q.rowStart)?O:i,_=void 0===(l=q.rowEnd)?E:l,R=void 0===(s=q.colSpan)?v:s,k=void 0===(c=q.colStart)?y:c,M=void 0===(d=q.colEnd)?h:d);var F=X({gridColumnStart:k,gridColumnEnd:M,gridRowStart:L,gridRowEnd:D?"span "+D:_},p),K=a($("cell",((u={})[""+R]=R,u)),f);if(m&&t.isValidElement(b)){var H=t.Children.only(b);return t.cloneElement(H,{style:X(X({},H.props.style),F),className:a(K,H.props.className)})}return r.createElement("div",X({},N,{ref:n,style:F,className:K}),b)}));try{var J=require("prop-types"),Z=J.shape({rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string])});Q.propTypes={style:J.object,className:J.string,clone:J.bool,rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string]),phone:Z,tablet:Z,desktop:Z,largeDesktop:Z,children:J.node}}catch(e){}var ee=function(){return(ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},te=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ne=_("rmd-grid"),re=t.forwardRef((function(e,n){var o,i=e.style,l=e.className,s=e.children,c=e.clone,d=void 0!==c&&c,u=e.wrapOnly,p=void 0!==u&&u,f=e.columns,m=e.phoneColumns,b=e.tabletColumns,v=e.desktopColumns,y=e.largeDesktopColumns,h=e.padding,g=e.gutter,O=e.minCellWidth,E=te(e,["style","className","children","clone","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),w=Y(),x=w.isPhone,C=w.isTablet,T=w.isDesktop,N=w.isLargeDesktop,j=ee(ee({padding:0!==h&&h||void 0,gridTemplateColumns:O?"repeat(auto-fill, minmax("+O+", 1fr))":void 0},i),((o={})["--rmd-grid-cols"]=x&&m||C&&b||N&&y||T&&v||f,o["--rmd-grid-gutter"]=g,o)),P=s;return(d||p)&&(P=t.Children.map(s,(function(e){return e&&r.createElement(Q,{clone:d},e)}))),r.createElement("div",ee({},E,{ref:n,style:j,className:a(ne({"no-padding":0===h}),l)}),P)}));try{var oe=require("prop-types");re.propTypes={style:oe.object,className:oe.string,clone:oe.bool,wrapOnly:oe.bool,columns:oe.number,phoneColumns:oe.number,tabletColumns:oe.number,desktopColumns:oe.number,largeDesktopColumns:oe.number,padding:oe.oneOfType([oe.number,oe.string]),gutter:oe.string,children:oe.node,minCellWidth:oe.string}}catch(e){}function ie(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}var ae=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),le="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,se="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),ce="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(se):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var de=["top","right","bottom","left","width","height","size","weight"],ue="undefined"!=typeof MutationObserver,pe=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&l()}function a(){ce(i)}function l(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=e}return l}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){le&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ue?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){le&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;de.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),fe=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},me=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||se},be=Ee(0,0,0,0);function ve(e){return parseFloat(e)||0}function ye(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ve(e["border-"+n+"-width"])}),0)}function he(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return be;var r=me(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=ve(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,l=ve(r.width),s=ve(r.height);if("border-box"===r.boxSizing&&(Math.round(l+i)!==t&&(l-=ye(r,"left","right")+i),Math.round(s+a)!==n&&(s-=ye(r,"top","bottom")+a)),!function(e){return e===me(e).document.documentElement}(e)){var c=Math.round(l+i)-t,d=Math.round(s+a)-n;1!==Math.abs(c)&&(l-=c),1!==Math.abs(d)&&(s-=d)}return Ee(o.left,o.top,l,s)}var ge="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof me(e).SVGGraphicsElement}:function(e){return e instanceof me(e).SVGElement&&"function"==typeof e.getBBox};function Oe(e){return le?ge(e)?function(e){var t=e.getBBox();return Ee(0,0,t.width,t.height)}(e):he(e):be}function Ee(e,t,n,r){return{x:e,y:t,width:n,height:r}}var we=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ee(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Oe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),xe=function(e,t){var n,r,o,i,a,l,s,c=(r=(n=t).x,o=n.y,i=n.width,a=n.height,l="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(l.prototype),fe(s,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),s);fe(this,{target:e,contentRect:c})},Ce=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new ae,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof me(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new we(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof me(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new xe(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Te="undefined"!=typeof WeakMap?new WeakMap:new ae,Ne=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=pe.getInstance(),r=new Ce(t,n,this);Te.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Ne.prototype[e]=function(){var t;return(t=Te.get(this))[e].apply(t,arguments)}}));var je=void 0!==se.ResizeObserver?se.ResizeObserver:Ne,Pe=function(){return(Pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Se(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function Ie(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Ae(e){var n=e.disableHeight,r=void 0!==n&&n,o=e.disableWidth,i=void 0!==o&&o,a=e.onResize,l=e.target;t.useEffect((function(){if(!r||!i){var e=function(e){return function(e){return!!e&&void 0!==e.current}(e)?e.current:function(e){return"function"==typeof e}(e)?e():"string"==typeof e?document.querySelector(e):e}(l);if(e){var t,n=new je((function(e){for(var n=0;n<e.length;n+=1){var o=e[n],l=o.target,s=o.contentRect,c={height:s.height,width:s.width,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},d=Se(t,c),u=Ie(t,c);t=c,(d&&!r||u&&!i)&&a(Pe(Pe({},c),{element:l}))}}));return n.observe(e),function(){n.disconnect()}}}}),[l,a,r,i])}var Re=function(){return(Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Me=_("rmd-grid-list"),De=t.forwardRef((function(e,n){var o=e.className,i=e.children,l=e.square,s=void 0!==l&&l,c=e.clone,d=void 0!==c&&c,u=ke(e,["className","children","square","clone"]),p=a(Me("cell",{square:s}),o);if(d&&t.isValidElement(i)){var f=t.Children.only(i);return t.cloneElement(f,{className:a(p,f.props.className)})}return r.createElement("div",Re({},u,{ref:n,className:p}),i)}));try{var Le=require("prop-types");De.propTypes={clone:Le.bool,square:Le.bool,className:Le.string,children:Le.node}}catch(e){}var _e={height:void 0,width:void 0};function qe(e,t){if(void 0===e&&(e="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var n=_e[e];if(!t&&"number"==typeof n)return n;var r=document.createElement("div");r.style.visibility="hidden",r.style.overflow="scroll",document.body.appendChild(r);var o=document.createElement("div");r.appendChild(o);var i="width"===e?"offsetWidth":"offsetHeight";return n=r[i]-o[i],_e[e]=n,document.body.removeChild(r),n}var Fe=function(){return(Fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},He=_("rmd-grid-list"),We=t.forwardRef((function(e,n){var o,i=e.style,l=e.className,s=e.children,c=e.clone,d=void 0!==c&&c,u=e.wrapOnly,p=void 0!==u&&u,f=e.cellMargin,m=e.defaultSize,b=e.maxCellSize,v=void 0===b?150:b,y=e.containerPadding,h=void 0===y?16:y,g=e.disableHeightObserver,O=void 0!==g&&g,E=e.disableWidthObserver,w=void 0!==E&&E,x=Ke(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),C=t.useState(m||{columns:-1,cellWidth:v}),T=C[0],N=C[1],j=t.useRef(null),P=t.useCallback((function(){if(j.current){var e=j.current.getBoundingClientRect().width;e-=h,j.current.offsetHeight<j.current.scrollHeight&&(e-=qe("width"));var t=Math.ceil(e/v);N({cellWidth:e/t,columns:t})}}),[v,h]),S=t.useCallback((function(e){ie(e,n),j.current=e,e&&P()}),[n,P]);Ae({disableHeight:O,disableWidth:w,onResize:P,target:j});var I=Fe(Fe({},i),((o={})["--rmd-cell-size"]=T.cellWidth+"px",o["--rmd-cell-margin"]=f||void 0,o)),A=null;return A=function(e){return"function"==typeof e}(s)?s(T):d||p?t.Children.map(s,(function(e){return e&&r.createElement(De,{clone:d},e)})):s,r.createElement("div",Fe({},x,{ref:S,style:I,className:a(He(),l)}),A)}));try{var Be=require("prop-types");We.propTypes={style:Be.object,clone:Be.bool,wrapOnly:Be.bool,className:Be.string,children:Be.oneOfType([Be.func,Be.node]),cellMargin:Be.string,maxCellSize:Be.number,defaultSize:Be.oneOfType([Be.shape({columns:Be.number.isRequired,cellWidth:Be.number.isRequired}),Be.func]),containerPadding:Be.number,disableHeightObserver:Be.bool,disableWidthObserver:Be.bool}}catch(e){}function ze(e,t,n,r){e=e.toUpperCase();for(var o=n;o<r;o+=1){if(0===t[o].toUpperCase().indexOf(e))return o}return-1}function Ve(e,t,n,r){void 0===r&&(r=!0);var o=ze(e,t,n+1,t.length);-1===o&&(o=ze(e,t,0,n+(r?1:0)));return o}var Ue=function(){return(Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ye(e,t){return Object.keys(t).reduce((function(e,n){return void 0===e[n]&&(e[n]=t[n]),e}),Ue({},e))}function Xe(e,t,n,r){return void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===r&&(r=!1),t&&(e=e.toLowerCase()),r?e=e.replace(/\s/g,""):n&&(e=e.trim()),e}function Ge(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return Ge(e(),t);case"object":return e?Ge(e[t],t):"";default:return""}}var $e=Ge,Qe={getItemValue:$e,valueKey:"value",trim:!0,ignoreWhitespace:!1};function Je(e,t,n){void 0===n&&(n={});var r=Ye(n,Qe),o=r.getItemValue,i=r.valueKey,a=r.trim,l=r.ignoreWhitespace,s=r.startsWith,c=void 0!==s&&s;return(e=Xe(e,!0,a,l))&&t.length?t.filter((function(t){var n=Xe(o(t,i),!0,a,l);return c?0===n.indexOf(e):-1!==n.indexOf(e)})):t}function Ze(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function et(e,t,n){void 0===n&&(n={});var r=Ye(n,Qe),o=r.getItemValue,i=r.valueKey,a=r.trim,l=r.ignoreWhitespace;if(e=Xe(e,!1,a,l),!t.length||!e)return t;var s=Ze(e);return t.filter((function(e){var t=Xe(o(e,i),!1,a,l);return t.length&&t.match(s)}))}function tt(e,n){void 0===n&&(n=500);var r=t.useRef(e),o=t.useRef(),i=t.useCallback((function(){window.clearTimeout(o.current),r.current=e}),[e]),a=t.useCallback((function(e){r.current=e,window.clearTimeout(o.current),o.current=window.setTimeout(i,n)}),[n,i]);return[r,a,i]}function nt(e){var n=e.items,r=e.onChange,o=e.onKeyDown,i=e.resetTime,a=void 0===i?500:i,l=e.searchIndex,s=e.valueKey,c=void 0===s?"value":s,d=e.getItemValue,u=void 0===d?$e:d,p=e.findMatchIndex,f=void 0===p?Ve:p,m=tt("",a),b=m[0],v=m[1],y=t.useMemo((function(){return n.map((function(e){return u(e,c)}))}),[n,u,c]);return t.useCallback((function(e){o&&o(e);var t=e.key,i=e.altKey,a=e.ctrlKey,s=e.metaKey;if(!(i||a||s||t.length>1||!b.current&&" "===t)){var c=t;b.current!==t&&(c=""+b.current+t),v(c);var d=f(c,y,l,!0);if(d!==l&&-1!==d){var u={index:d,item:n[d],items:n,query:c,target:e.currentTarget};r(u)}}}),[l,f,n,r,o,v,b,y])}var rt=function(){return(rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ot(e){var n=e.children,o=e.onChange,i=e.phoneMaxWidth,a=void 0===i?"47.9375em":i,l=e.tabletMinWidth,s=void 0===l?"48em":l,c=e.tabletMaxWidth,d=void 0===c?"64em":c,u=e.desktopMinWidth,p=void 0===u?"64.0625em":u,f=e.desktopLargeMinWidth,m=void 0===f?"80em":f,b=e.defaultSize,v=void 0===b?B:b,y=function(e){var n=void 0===e?{}:e,r=n.phoneMaxWidth,o=void 0===r?"47.9375em":r,i=n.tabletMinWidth,a=void 0===i?"48em":i,l=n.tabletMaxWidth,s=void 0===l?"64em":l,c=n.desktopMinWidth,d=void 0===c?"64.0625em":c,u=n.desktopLargeMinWidth,p=void 0===u?"80em":u,f=n.defaultSize,m=void 0===f?B:f;if("undefined"==typeof window)return m;var b=K({min:d}),v=K({min:p}),y=K({min:a,max:s}),h=K({max:o}),g=b,O=!b&&y,E=!O&&!g&&h,w=W().includes("landscape"),x=v,C=t.useState(m),T=C[0],N=C[1];return t.useEffect((function(){T.isPhone===E&&T.isTablet===O&&T.isDesktop===g&&T.isLargeDesktop===x&&T.isLandscape===w||(E||O||g||x)&&N({isPhone:E,isTablet:O,isDesktop:g,isLargeDesktop:x,isLandscape:w})}),[E,O,g,x,w,T]),T}({phoneMaxWidth:a,tabletMaxWidth:d,tabletMinWidth:s,desktopMinWidth:p,desktopLargeMinWidth:m,defaultSize:v}),h=t.useRef(y);t.useEffect((function(){!o||v.isPhone===y.isPhone&&v.isTablet===y.isTablet&&v.isDesktop===y.isDesktop&&v.isLargeDesktop===y.isLargeDesktop&&v.isLandscape===y.isLandscape||o(y,v)}),[]),t.useEffect((function(){h.current!==y&&(o&&o(y,h.current),h.current=y)}));var g=t.useMemo((function(){return rt(rt({},y),{__initialized:!0})}),[y]);return r.createElement(U.Provider,{value:g},n)}try{var it=require("prop-types"),at=it.oneOfType([it.string,it.number]);ot.propTypes={children:it.node.isRequired,onChange:it.func,phoneMaxWidth:at,tabletMinWidth:at,tabletMaxWidth:at,desktopMinWidth:at,desktopLargeMinWidth:at,defaultSize:it.shape({isPhone:it.bool.isRequired,isTablet:it.bool.isRequired,isDesktop:it.bool.isRequired,isLargeDesktop:it.bool.isRequired,isLandscape:it.bool.isRequired})}}catch(e){}function lt(e){var n=e.disableHeight,o=void 0!==n&&n,i=e.disableWidth,a=void 0!==i&&i,l=e.className,s=e.component,c=void 0===s?"span":s,d=e.target,u=e.onResize,p=t.useState(null),f=p[0],m=p[1];Ae({disableHeight:o,disableWidth:a,target:d||f,onResize:u});var b=t.useCallback((function(e){m(e?e.parentElement:null)}),[]);return null===d||d?null:r.createElement(c,{className:l,"aria-hidden":"true",ref:b})}try{var st=require("prop-types");lt.propTypes={disableHeight:st.bool,disableWidth:st.bool,className:st.string,component:st.oneOfType([st.string]),target:st.oneOfType([st.string,st.func,st.object])}}catch(e){}function ct(e){var n=e.onResize,r=e.options,o=e.immediate,i=e.enabled,a=void 0===i||i,l=N(n);t.useEffect((function(){if(a){var e=x("resize",window,!0,r),t=function(e){return l.current(e)};return e.add(t),o&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[r,a])}function dt(e){var t=e.onResize,n=e.options,r=e.immediate;return ct({onResize:t,options:n,immediate:void 0===r?"undefined"!=typeof window:r,enabled:!0}),null}try{var ut=require("prop-types");dt.propTypes={onResize:ut.func.isRequired,options:ut.object,immediate:ut.bool}}catch(e){}var pt=function(e){var t=e,n=t.children,r=t.fallback,o=Y(),i=o.isPhone,a=o.isTablet;return i||a?n:r},ft=function(e){var t=e,n=t.children,r=t.fallback;return Y().isPhone?n:r},mt=function(e){var t=e,n=t.children,r=t.fallback;return Y().isTablet?n:r},bt=function(e){var t=e,n=t.children,r=t.fallback;return Y().isDesktop?n:r},vt={fallback:null};function yt(e){if(!e)return null;if(/(tree|list)item/.test(e.getAttribute("role")||"")){if(r=e.querySelector(".rmd-tree-item__content, .rmd-item-text"))return r}else if("file"===e.getAttribute("type")){var t=document.querySelector('[for="'+e.id+'"]');if(t)return t}var n=e.getAttribute("data-sizing-selector");if(n){var r;if(r=e.querySelector(n))return r;throw new Error("Unable to find a child element using the `data-sizing-selector`")}return e}function ht(e){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===e?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function gt(e){return"number"==typeof e?e+"px":""}function Ot(e,t){void 0===t&&(t={});var n=e.cloneNode(!0);n.removeAttribute("id"),n.removeAttribute("role"),n.style.position="fixed",n.style.visibility="hidden",n.style.left=gt(t.left),n.style.top=gt(t.top),n.style.right=gt(t.right),n.style.bottom=gt(t.bottom),n.style.webkitTransform="none",n.style.transform="none";var r=e.parentElement||document.body;r.appendChild(n);var o=n.getBoundingClientRect();return r.removeChild(n),o}function Et(e){var t=e.xMargin,n=e.elWidth,r=e.initialX,o=e.containerRect;return(null!=r?r:o.left)-n-t}function wt(e){var t=e.xMargin,n=e.initialX,r=e.containerRect;return(null!=n?n:r.left)+t}function xt(e){var t=e.xMargin,n=e.elWidth,r=e.initialX,o=e.containerRect;return(null!=r?r:o.left+o.width)-n-t}function Ct(e){var t=e.xMargin,n=e.initialX,r=e.containerRect;return(null!=n?n:r.left+r.width)+t}function Tt(e){var t=e.yMargin,n=e.initialY,r=e.elHeight,o=e.containerRect;return(null!=n?n:o.top)-r-t}function Nt(e){var t=e.yMargin,n=e.initialY,r=e.containerRect;return(null!=n?n:r.top)+t}function jt(e){var t=e.yMargin,n=e.initialY,r=e.elHeight,o=e.containerRect;return(null!=n?n:o.top+o.height)-r-t}function Pt(e){var t=e.yMargin,n=e.initialY,r=e.containerRect;return(null!=n?n:r.top+r.height)+t}function St(e){var t=e.x,n=e.vw,r=e.vwMargin,o=e.xMargin,i=e.width,a=e.elWidth,l=e.initialX,s=e.containerRect,c=e.disableSwapping;if("min"===i||"equal"===i)return function(e){var t,n,r=e.x,o=e.vw,i=e.elWidth,a=e.xMargin,l=e.vwMargin,s=e.initialX,c=e.containerRect,d=e.isMinWidth,u=null!=s?s:c.left+a,p=c.width-2*a;return d&&(t=p,p=void 0,u+i>o-l&&(n=l)),{left:u,right:n,width:p,minWidth:t,actualX:r}}({x:t,vw:n,vwMargin:r,xMargin:o,elWidth:a,initialX:l,containerRect:s,isMinWidth:"min"===i});if(a>n-2*r)return{left:r,right:r,actualX:t};var d={vwMargin:r,xMargin:o,elWidth:a,initialX:l,screenRight:n-r,containerRect:s,disableSwapping:c};switch(t){case"left":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=e.disableSwapping,i=Et(e),a="left";if(i>=t)return{actualX:a,left:i};var l=Ct(e);return o||l+r>n?i=t:(i=l,a="right"),{actualX:a,left:i}}(d);case"inner-left":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=e.disableSwapping,i=wt(e),a="inner-left";if(i+r<=n)return{actualX:a,left:i};var l=xt(e);return o||l<t?i=t:(i=l,a="inner-right"),{actualX:a,left:i}}(d);case"center":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=function(e){var t=e.elWidth,n=e.initialX,r=e.containerRect,o=r.width/2,i=t/2;return(null!=n?n:r.left+o)-i}(e);return o<t?o=t:(o+r>n||o<t)&&(o=n-r),{actualX:"center",left:o}}(d);case"inner-right":return function(e){var t=e.screenRight,n=e.vwMargin,r=e.elWidth,o=e.disableSwapping,i=xt(e),a="inner-right";if(i>=n)return{actualX:a,left:i};var l=wt(e);return o||l+r>t?i=t-r:(i=l,a="inner-left"),{actualX:a,left:i}}(d);case"right":return function(e){var t=e.screenRight,n=e.vwMargin,r=e.elWidth,o=e.disableSwapping,i=Ct(e),a="right";if(i+r<=t)return{actualX:a,left:i};var l=Et(e);return o||l<n?i=t-r:(i=l,a="left"),{actualX:a,left:i}}(d);default:throw new Error("This should never happen")}}function It(e){var t=e.y,n=e.vh,r=e.vhMargin,o=e.yMargin,i=e.elHeight,a=e.initialY,l=e.containerRect,s=e.disableSwapping,c=e.preventOverlap,d=e.disableVHBounds;if(!d&&!c&&i>n-2*r)return{top:r,bottom:r,actualY:"center"};var u={vhMargin:r,yMargin:o,elHeight:i,initialY:a,containerRect:l,screenBottom:n-r,preventOverlap:c,disableSwapping:s,disableVHBounds:d};switch(t){case"above":return function(e){var t=e.yMargin,n=e.vhMargin,r=e.screenBottom,o=e.elHeight,i=e.containerRect,a=e.preventOverlap,l=e.disableSwapping,s=e.disableVHBounds,c=Tt(e),d="above";if(s)return{actualY:d,top:Math.max(0,c)};if(c>n)return{actualY:d,top:c};var u,p=Pt(e);return l||p+o>r?c=n:(d="below",c=p),a&&"above"===d&&c+o>i.top&&(u=window.innerHeight-i.top+t),{actualY:d,top:c,bottom:u}}(u);case"top":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableSwapping,i=e.disableVHBounds,a=Nt(e),l="top";if(i||a+r<=n)return{actualY:l,top:a};var s=jt(e);return o||s<t?a=t:(l="bottom",a=s),{actualY:l,top:a}}(u);case"center":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableVHBounds,i=function(e){var t=e.elHeight,n=e.initialY,r=e.containerRect,o=r.height/2,i=t/2;return(null!=n?n:r.top+o)-i}(e);return o?{actualY:"center",top:Math.max(0,i)}:((i=Math.max(t,i))+r>n&&(i=n-r),{actualY:"center",top:i})}(u);case"bottom":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableSwapping,i=e.disableVHBounds,a=jt(e),l="bottom";if(i||a>t)return{actualY:l,top:a};var s=Nt(e);return o||s+r>n?a=n-r:(l="top",a=s),{actualY:l,top:a}}(u);case"below":return function(e){var t=e.yMargin,n=e.vhMargin,r=e.elHeight,o=e.screenBottom,i=e.containerRect,a=e.preventOverlap,l=e.disableSwapping,s=e.disableVHBounds,c=Pt(e),d="below";if(s||c+r<=o)return{actualY:d,top:c};if(a){var u=i.top-t;return l||u<o-c?{actualY:d,top:c,bottom:n}:{actualY:"above",top:Math.max(n,u-r),bottom:ht("height")-u}}var p=Tt(e);return l||p<n?c=o-r:(d="above",c=p),{actualY:d,top:c}}(u);default:throw new Error("This should never happen")}}function At(e){var t="0";switch(e.x){case"right":case"inner-left":t="0";break;case"center":t="50%";break;case"left":case"inner-right":t="100%";break;default:t="0"}var n="0";switch(e.y){case"above":case"bottom":n="100%";break;case"center":n="50%";break;case"below":case"top":n="0";break;default:n="0"}return t+" "+n}function Rt(e){var t=e.container,n=e.element,r=e.anchor,o=void 0===r?{}:r,i=e.initialX,a=e.initialY,l=e.vwMargin,s=void 0===l?16:l,c=e.vhMargin,d=void 0===c?16:c,u=e.xMargin,p=void 0===u?0:u,f=e.yMargin,m=void 0===f?0:f,b=e.width,v=void 0===b?"auto":b,y=e.preventOverlap,h=void 0!==y&&y,g=e.transformOrigin,O=void 0!==g&&g,E=e.disableSwapping,w=void 0!==E&&E,x=e.disableVHBounds,C=void 0!==x&&x;t=yt(t);var T={x:o.x||"center",y:o.y||"below"};if("auto"!==v&&"center"!==T.x)throw new Error('Unable to use a calculated width when the horizontal anchor is not `"center"`.');if(h&&"above"!==T.y&&"below"!==T.y)throw new Error('Unable to prevent overlap when the vertical anchor is not `"above"` or `"below"`');if(!t||!n)return{actualX:T.x,actualY:T.y};var N=t.getBoundingClientRect(),j=ht("height"),P=ht("width"),S=Ot(n),I=S.height,A=S.width;C&&(n.closest("[role='dialog']")||(a=(null!=a?a:0)+window.scrollY));var R=St({x:T.x,vw:P,vwMargin:s,xMargin:p,width:v,elWidth:A,initialX:i,containerRect:N,disableSwapping:w}),k=R.left,M=R.right,D=R.width,L=R.minWidth,_=R.actualX,q=It({y:T.y,vh:j,vhMargin:d,yMargin:m,initialY:a,elHeight:I,containerRect:N,disableSwapping:w,preventOverlap:h,disableVHBounds:C}),F=q.top,K=q.bottom,H=q.actualY;return{actualX:_,actualY:H,style:{left:k,top:F,right:M,bottom:K,width:D,minWidth:L,position:C?"absolute":"fixed",transformOrigin:O?At({x:_,y:H}):void 0}}}pt.defaultProps=vt,ft.defaultProps=vt,mt.defaultProps=vt,bt.defaultProps=vt;var kt={x:"inner-left",y:"top"},Mt={x:"inner-right",y:"top"},Dt={x:"right",y:"top"},Lt={x:"center",y:"center"},_t={x:"center",y:"below"},qt={x:"inner-right",y:"below"},Ft=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",Kt=Ft+':not([tabindex="-1"])';function Ht(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?Ft:Kt))}function Wt(e,t){if(t=yt(t),e&&t){var n=t.offsetTop;t.offsetParent!==e&&(n-=e.offsetTop);var r=n+t.offsetHeight;r>e.offsetHeight+e.scrollTop?e.scrollTop=r-e.offsetHeight:n<e.scrollTop&&(e.scrollTop=n)}}function Bt(e,t,n,r,o){var i;switch(void 0===n&&(n=!1),void 0===r&&(r=!1),o&&o.length||(o=Ht(e,n)),t){case"first":i=o[0];break;case"last":i=o[o.length-1];break;default:i=e.querySelector(t)}if(!i)throw new Error("Unable to find a focusable element");i.focus({preventScroll:r}),r||e===document||Wt(e,i)}function zt(e,n,r,o,i){void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=!1),t.useEffect((function(){if(!i){var t=window.requestAnimationFrame((function(){var t=function(e){var t=null;return e&&(t=e instanceof HTMLElement?e:e.current),t}(e);t&&(t.focus({preventScroll:r}),Bt(t,n,o,r))}));return function(){window.cancelAnimationFrame(t)}}}),[n,i,e,o,r])}function Vt(e,n,r){void 0===n&&(n=void 0),void 0===r&&(r=null);var o=t.useRef({disabled:e,fallback:n});t.useEffect((function(){o.current={disabled:e,fallback:n}})),t.useEffect((function(){if(!e){var t=r||document.activeElement,n=t.closest('[role="menu"]'),i=null;if(n&&!(i=document.getElementById(n.id.replace(/-menu$/,"")))){var a=(n.getAttribute("aria-labelledby")||"").split(" ").map((function(e){return"#"+e+"[tabindex]"})).join(",");i=a?document.querySelector(a):null}return function(){var e=o.current,a=e.fallback;if(!e.disabled)if(!n||!i||r||a||document.contains(t)||!document.contains(i)){var l=t;if(document.contains(l)||(l=r&&document.contains(r)?r:null),!l&&a)switch(typeof a){case"string":l=document.querySelector(a);break;case"function":l=a();break;default:l=a}l&&!document.contains(l)&&(l=null),l&&l.focus()}else i.focus()}}}),[])}var Ut,Yt,Xt=function(){return(Xt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Gt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},$t=t.forwardRef((function(e,n){var o=e.children,i=e.onKeyDown,a=e.component,l=void 0===a?"div":a,s=e.defaultFocus,c=void 0===s?"first":s,d=e.disableFocusCache,u=void 0!==d&&d,p=e.disableFocusOnMount,f=void 0!==p&&p,m=e.disableFocusOnMountScroll,b=void 0!==m&&m,v=e.disableFocusOnUnmount,y=void 0!==v&&v,h=e.disableTabFocusWrap,g=void 0!==h&&h,O=e.unmountFocusFallback,E=void 0===O?"":O,w=Gt(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),x=t.useRef(null),C=t.useCallback((function(e){ie(e,n),x.current=e}),[n]);Vt(y,E),zt(x,c,b,!1,f);var T=function(e){var n=e.disabled,r=void 0!==n&&n,o=e.disableFocusCache,i=void 0!==o&&o,a=e.onKeyDown,l=t.useRef([]),s=t.useCallback((function(e){if(a&&a(e),"Tab"===e.key){!i&&l.current.length||(l.current=Ht(e.currentTarget));var t=l.current,n=t.length;0!==n&&(1===n?e.preventDefault():t[0]===e.target&&e.shiftKey?(e.preventDefault(),t[n-1].focus()):t[n-1]!==e.target||e.shiftKey||(e.preventDefault(),t[0].focus()))}}),[a,i]);return r?a:s}({disabled:g,disableFocusCache:u,onKeyDown:i});return r.createElement(l,Xt({},w,{onKeyDown:T,ref:C}),o)}));try{var Qt=require("prop-types");$t.propTypes={disableFocusCache:Qt.bool,disableFocusOnMount:Qt.bool,disableFocusOnUnmount:Qt.bool,disableTabFocusWrap:Qt.bool,defaultFocus:Qt.oneOfType([Qt.oneOf(["first","last"]),Qt.string]),component:Qt.oneOfType([Qt.string,Qt.func,Qt.object]),unmountFocusFallback:Qt.oneOfType([Qt.string,Qt.func,Qt.object]),children:Qt.node,onKeyDown:Qt.func,disableFocusOnMountScroll:Qt.bool}}catch(e){}(Ut=e.IncrementMovementKey||(e.IncrementMovementKey={})).ArrowUp="ArrowUp",Ut.ArrowDown="ArrowDown",Ut.ArrowLeft="ArrowLeft",Ut.ArrowRight="ArrowRight",Ut.PageDown="PageDown",Ut.PageUp="PageUp",Ut.ShiftArrowUp="Shift+ArrowUp",Ut.ShiftArrowDown="Shift+ArrowDown",Ut.ShiftArrowLeft="Shift+ArrowLeft",Ut.ShiftArrowRight="Shift+ArrowRight",Ut.AltArrowDown="Alt+ArrowDown",Ut.AltArrowUp="Alt+ArrowUp",Ut.AltArrowLeft="Alt+ArrowLeft",Ut.AltArrowRight="Alt+ArrowRight",Ut.AltPageDown="Alt+PageDown",Ut.AltPageUp="Alt+PageUp",Ut.ControlArrowDown="Control+ArrowDown",Ut.ControlArrowUp="Control+ArrowUp",(Yt=e.JumpMovementKey||(e.JumpMovementKey={})).Home="Home",Yt.End="End",Yt.AltHome="Alt+Home",Yt.AltEnd="Alt+End",Yt.ControlHome="Control+Home",Yt.ControlEnd="Control+End",Yt.ControlShiftHome="Control+Shift+Home",Yt.ControlShiftEnd="Control+Shift+End";var Jt=function(){return(Jt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zt={loopable:!0,searchable:!0,incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End]},en=Jt(Jt({},Zt),{incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft]}),tn=Jt(Jt({},Zt),{loopable:!1}),nn=Jt(Jt({},en),{loopable:!1}),rn={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},on={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},an={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},ln={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},sn={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},cn={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},dn=Object.freeze({__proto__:null,VERTICAL_MENU:Zt,HORIZONTAL_MENU:en,VERTICAL_LISTBOX:tn,HORIZONTAL_LISTBOX:nn,VERTICAL_COMBOBOX:rn,HORIZONTAL_COMBOBOX:on,VERTICAL_TREE:an,HORIZONTAL_TREE:ln,HORIZONTAL_TABS:sn,VERTICAL_TABS:cn});function un(e,t,n,r){void 0===r&&(r=!1);var o=e+(n?1:-1);return r?o=Math.min(t,Math.max(0,o)):o>t?o=0:o<0&&(o=t),o}function pn(e,t){if(!e)throw new Error("The id must be a string with a length greater than 0");if(t<0)throw new RangeError("The provided index must be greater than 0");return e+"-item-"+(t+1)}function fn(e,t){return e.map((function(e){return{shiftKey:e.includes("Shift+"),metaKey:e.includes("Meta+"),ctrlKey:e.includes("Control+"),altKey:e.includes("Alt+"),key:e.replace(/(Shift|Meta|Alt|Control)\+/g,""),type:t}}))}function mn(e){var t=e.key,n=e.altKey,r=e.ctrlKey,o=e.metaKey,i=e.shiftKey;return e.type+"-"+[o&&"Meta",r&&"Control",i&&"Shift",n&&"Alt",t].filter(Boolean).join("+")}var bn=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r};function vn(e){var n=e.onKeyDown,r=e.incrementKeys,o=e.decrementKeys,i=e.jumpToFirstKeys,a=e.jumpToLastKeys,l=e.stopPropagation,s=void 0===l||l,c=e.onChange,d=e.items,u=e.resetTime,p=e.findMatchIndex,f=e.focusedIndex,m=e.loopable,b=void 0===m||m,v=e.searchable,y=void 0===v||v,h=e.valueKey,g=void 0===h?"value":h,O=e.getItemValue,E=void 0===O?$e:O,w=t.useMemo((function(){return bn(fn(r,"increment"),fn(o,"decrement"),fn(i,"first"),fn(a,"last"))}),[r,o,i,a]),x=t.useMemo((function(){return Array.from(d,(function(){return{current:null}}))}),[d]),C=nt({items:d,valueKey:g,getItemValue:E,onChange:function(e){c(e,x)},searchIndex:f,resetTime:u,findMatchIndex:p}),T=t.useCallback((function(e){y&&C(e),n&&n(e);var t=e.target,r=function(e,t){var n=e.key,r=e.altKey,o=e.ctrlKey,i=e.metaKey,a=e.shiftKey;return t.find((function(e){return e.key===n&&e.altKey===r&&e.ctrlKey===o&&e.metaKey===i&&e.shiftKey===a}))||null}(e,w);if(r&&t){e.preventDefault(),s&&e.stopPropagation();var o,i=r.type,a=d.length-1;switch(i){case"first":o=0;break;case"last":o=a;break;default:o=un(f,a,"increment"===i,!b)}if(o!==f){var l={index:o,item:d[o],items:d,query:mn(r),target:e.currentTarget};c(l,x)}}}),[n,s,f,w,d,C,b,y,c,x]);return[x,T]}var yn=function(){return(yn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},hn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function gn(e){var n=e.baseId,r=e.getId,o=void 0===r?pn:r,i=e.defaultFocusedIndex,a=void 0===i?-1:i,l=e.items,s=e.onChange,c=e.getItemValue,d=void 0===c?$e:c,u=e.valueKey,p=void 0===u?"value":u,f=e.onKeyDown,m=e.onEnter,b=e.onSpace,v=hn(e,["baseId","getId","defaultFocusedIndex","items","onChange","getItemValue","valueKey","onKeyDown","onEnter","onSpace"]),y=t.useState(a),h=y[0],g=y[1],O=-1!==h?o(n,h):"",E=vn(yn(yn({},v),{valueKey:p,getItemValue:d,focusedIndex:h,items:l,onChange:function(e,t){s&&s(e,t);var n=e.index,r=e.target,o=t[n]&&t[n].current;o&&r&&r.scrollHeight>r.offsetHeight&&Wt(r,o),g(n)},onKeyDown:function(e){f&&f(e);var t=w[h]&&w[h].current||null;m&&"Enter"===e.key?m(h,t):b&&" "===e.key&&(e.preventDefault(),b(h,t))}})),w=E[0],x=E[1];return{activeId:O,itemRefs:w,onKeyDown:x,focusedIndex:h,setFocusedIndex:g}}var On=function(){return(On=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},E