@kakadu/components 4.0.5 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kakadu/components",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Kakadu components library",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -1,9 +0,0 @@
1
- "use strict";const Fe=require("react");function Se(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function se(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var u=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return r[n]}})}),t}var H={exports:{}};/*!
2
- * tabbable 6.4.0
3
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
- */var be=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],J=be.join(","),he=typeof Element>"u",M=he?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=!he&&Element.prototype.getRootNode?function(r){var e;return r==null||(e=r.getRootNode)===null||e===void 0?void 0:e.call(r)}:function(r){return r==null?void 0:r.ownerDocument},ee=function(e,t){var n;t===void 0&&(t=!0);var u=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert"),l=u===""||u==="true",i=l||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return i},ke=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},ye=function(e,t,n){if(ee(e))return[];var u=Array.prototype.slice.apply(e.querySelectorAll(J));return t&&M.call(e,J)&&u.unshift(e),u=u.filter(n),u},te=function(e,t,n){for(var u=[],l=Array.from(e);l.length;){var i=l.shift();if(!ee(i,!1))if(i.tagName==="SLOT"){var y=i.assignedElements(),w=y.length?y:i.children,F=te(w,!0,n);n.flatten?u.push.apply(u,F):u.push({scopeParent:i,candidates:F})}else{var k=M.call(i,J);k&&n.filter(i)&&(t||!e.includes(i))&&u.push(i);var D=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),R=!ee(D,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(D&&R){var j=te(D===!0?i.children:D.children,!0,n);n.flatten?u.push.apply(u,j):u.push({scopeParent:i,candidates:j})}else l.unshift.apply(l,i.children)}}return u},me=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},L=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ke(e))&&!me(e)?0:e.tabIndex},De=function(e,t){var n=L(e);return n<0&&t&&!me(e)?0:n},Ne=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ge=function(e){return e.tagName==="INPUT"},Re=function(e){return ge(e)&&e.type==="hidden"},Pe=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},Ce=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Ae=function(e){if(!e.name)return!0;var t=e.form||Q(e),n=function(y){return t.querySelectorAll('input[type="radio"][name="'+y+'"]')},u;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")u=n(window.CSS.escape(e.name));else try{u=n(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var l=Ce(u,e.form);return!l||l===e},Ie=function(e){return ge(e)&&e.type==="radio"},je=function(e){return Ie(e)&&!Ae(e)},_e=function(e){var t,n=e&&Q(e),u=(t=n)===null||t===void 0?void 0:t.host,l=!1;if(n&&n!==e){var i,y,w;for(l=!!((i=u)!==null&&i!==void 0&&(y=i.ownerDocument)!==null&&y!==void 0&&y.contains(u)||e!=null&&(w=e.ownerDocument)!==null&&w!==void 0&&w.contains(e));!l&&u;){var F,k,D;n=Q(u),u=(F=n)===null||F===void 0?void 0:F.host,l=!!((k=u)!==null&&k!==void 0&&(D=k.ownerDocument)!==null&&D!==void 0&&D.contains(u))}}return l},ce=function(e){var t=e.getBoundingClientRect(),n=t.width,u=t.height;return n===0&&u===0},xe=function(e,t){var n=t.displayCheck,u=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e){var l=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(e).visibility==="hidden")return!0;var i=M.call(e,"details>summary:first-of-type"),y=i?e.parentElement:e;if(M.call(y,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof u=="function"){for(var w=e;e;){var F=e.parentElement,k=Q(e);if(F&&!F.shadowRoot&&u(F)===!0)return ce(e);e.assignedSlot?e=e.assignedSlot:!F&&k!==e.ownerDocument?e=k.host:e=F}e=w}if(_e(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return ce(e);return!1},Le=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var u=t.children.item(n);if(u.tagName==="LEGEND")return M.call(t,"fieldset[disabled] *")?!0:!u.contains(e)}return!0}t=t.parentElement}return!1},re=function(e,t){return!(t.disabled||Re(t)||xe(t,e)||Pe(t)||Le(t))},oe=function(e,t){return!(je(t)||L(t)<0||!re(e,t))},Be=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Te=function(e){var t=[],n=[];return e.forEach(function(u,l){var i=!!u.scopeParent,y=i?u.scopeParent:u,w=De(y,i),F=i?Te(u.candidates):y;w===0?i?t.push.apply(t,F):t.push(y):n.push({documentOrder:l,tabIndex:w,item:u,isScope:i,content:F})}),n.sort(Ne).reduce(function(u,l){return l.isScope?u.push.apply(u,l.content):u.push(l.content),u},[]).concat(t)},we=function(e,t){t=t||{};var n;return t.getShadowRoot?n=te([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Be}):n=ye(e,t.includeContainer,oe.bind(null,t)),Te(n)},Oe=function(e,t){t=t||{};var n;return t.getShadowRoot?n=te([e],t.includeContainer,{filter:re.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):n=ye(e,t.includeContainer,re.bind(null,t)),n},K=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,J)===!1?!1:oe(t,e)},Ke=be.concat("iframe:not([inert]):not([inert] *)").join(","),X=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,Ke)===!1?!1:re(t,e)};const Me=Object.freeze(Object.defineProperty({__proto__:null,focusable:Oe,getTabIndex:L,isFocusable:X,isTabbable:K,tabbable:we},Symbol.toStringTag,{value:"Module"}));/*!
5
- * focus-trap 7.8.0
6
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7
- */function ue(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function qe(r){if(Array.isArray(r))return ue(r)}function le(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Ee(r))||e){t&&(r=t);var n=0,u=function(){};return{s:u,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(w){throw w},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,i=!0,y=!1;return{s:function(){t=t.call(r)},n:function(){var w=t.next();return i=w.done,w},e:function(w){y=!0,l=w},f:function(){try{i||t.return==null||t.return()}finally{if(y)throw l}}}}function Ve(r,e,t){return(e=ze(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ge(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function $e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(r,u).enumerable})),t.push.apply(t,n)}return t}function de(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(t),!0).forEach(function(n){Ve(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ue(r){return qe(r)||Ge(r)||Ee(r)||$e()}function We(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ze(r){var e=We(r,"string");return typeof e=="symbol"?e:e+""}function Ee(r,e){if(r){if(typeof r=="string")return ue(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ue(r,e):void 0}}var I={getActiveTrap:function(e){return(e==null?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){var n=I.getActiveTrap(e);t!==n&&I.pauseTrap(e);var u=e.indexOf(t);u===-1||e.splice(u,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),I.unpauseTrap(e)},pauseTrap:function(e){var t=I.getActiveTrap(e);t==null||t._setPausedState(!0)},unpauseTrap:function(e){var t=I.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},Ye=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},He=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},$=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Ze=function(e){return $(e)&&!e.shiftKey},Xe=function(e){return $(e)&&e.shiftKey},ve=function(e){return setTimeout(e,0)},G=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),u=1;u<t;u++)n[u-1]=arguments[u];return typeof e=="function"?e.apply(void 0,n):e},Z=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Je=[],Qe=function(e,t){var n=(t==null?void 0:t.document)||document,u=(t==null?void 0:t.trapStack)||Je,l=de({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Ze,isKeyBackward:Xe},t),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},y,w=function(o,a,c){return o&&o[a]!==void 0?o[a]:l[c||a]},F=function(o,a){var c=typeof(a==null?void 0:a.composedPath)=="function"?a.composedPath():void 0;return i.containerGroups.findIndex(function(h){var b=h.container,g=h.tabbableNodes;return b.contains(o)||(c==null?void 0:c.includes(b))||g.find(function(v){return v===o})})},k=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=a.hasFallback,h=c===void 0?!1:c,b=a.params,g=b===void 0?[]:b,v=l[o];if(typeof v=="function"&&(v=v.apply(void 0,Ue(g))),v===!0&&(v=void 0),!v){if(v===void 0||v===!1)return v;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var O=v;if(typeof v=="string"){try{O=n.querySelector(v)}catch(E){throw new Error("`".concat(o,'` appears to be an invalid selector; error="').concat(E.message,'"'))}if(!O&&!h)throw new Error("`".concat(o,"` as selector refers to no known node"))}return O},D=function(){var o=k("initialFocus",{hasFallback:!0});if(o===!1)return!1;if(o===void 0||o&&!X(o,l.tabbableOptions))if(F(n.activeElement)>=0)o=n.activeElement;else{var a=i.tabbableGroups[0],c=a&&a.firstTabbableNode;o=c||k("fallbackFocus")}else o===null&&(o=k("fallbackFocus"));if(!o)throw new Error("Your focus-trap needs to have at least one focusable element");return o},R=function(){if(i.containerGroups=i.containers.map(function(o){var a=we(o,l.tabbableOptions),c=Oe(o,l.tabbableOptions),h=a.length>0?a[0]:void 0,b=a.length>0?a[a.length-1]:void 0,g=c.find(function(E){return K(E)}),v=c.slice().reverse().find(function(E){return K(E)}),O=!!a.find(function(E){return L(E)>0});return{container:o,tabbableNodes:a,focusableNodes:c,posTabIndexesFound:O,firstTabbableNode:h,lastTabbableNode:b,firstDomTabbableNode:g,lastDomTabbableNode:v,nextTabbableNode:function(N){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,C=a.indexOf(N);return C<0?A?c.slice(c.indexOf(N)+1).find(function(B){return K(B)}):c.slice(0,c.indexOf(N)).reverse().find(function(B){return K(B)}):a[C+(A?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(o){return o.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!k("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(o){return o.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(o){var a=o.activeElement;if(a)return a.shadowRoot&&a.shadowRoot.activeElement!==null?j(a.shadowRoot):a},P=function(o){if(o!==!1&&o!==j(document)){if(!o||!o.focus){P(D());return}o.focus({preventScroll:!!l.preventScroll}),i.mostRecentlyFocusedNode=o,Ye(o)&&o.select()}},U=function(o){var a=k("setReturnFocus",{params:[o]});return a||(a===!1?!1:o)},_=function(o){var a=o.target,c=o.event,h=o.isBackward,b=h===void 0?!1:h;a=a||Z(c),R();var g=null;if(i.tabbableGroups.length>0){var v=F(a,c),O=v>=0?i.containerGroups[v]:void 0;if(v<0)b?g=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:g=i.tabbableGroups[0].firstTabbableNode;else if(b){var E=i.tabbableGroups.findIndex(function(ne){var ie=ne.firstTabbableNode;return a===ie});if(E<0&&(O.container===a||X(a,l.tabbableOptions)&&!K(a,l.tabbableOptions)&&!O.nextTabbableNode(a,!1))&&(E=v),E>=0){var N=E===0?i.tabbableGroups.length-1:E-1,A=i.tabbableGroups[N];g=L(a)>=0?A.lastTabbableNode:A.lastDomTabbableNode}else $(c)||(g=O.nextTabbableNode(a,!1))}else{var C=i.tabbableGroups.findIndex(function(ne){var ie=ne.lastTabbableNode;return a===ie});if(C<0&&(O.container===a||X(a,l.tabbableOptions)&&!K(a,l.tabbableOptions)&&!O.nextTabbableNode(a))&&(C=v),C>=0){var B=C===i.tabbableGroups.length-1?0:C+1,x=i.tabbableGroups[B];g=L(a)>=0?x.firstTabbableNode:x.firstDomTabbableNode}else $(c)||(g=O.nextTabbableNode(a))}}else g=k("fallbackFocus");return g},q=function(o){var a=Z(o);if(!(F(a,o)>=0)){if(G(l.clickOutsideDeactivates,o)){y.deactivate({returnFocus:l.returnFocusOnDeactivate});return}G(l.allowOutsideClick,o)||o.preventDefault()}},W=function(o){var a=Z(o),c=F(a,o)>=0;if(c||a instanceof Document)c&&(i.mostRecentlyFocusedNode=a);else{o.stopImmediatePropagation();var h,b=!0;if(i.mostRecentlyFocusedNode)if(L(i.mostRecentlyFocusedNode)>0){var g=F(i.mostRecentlyFocusedNode),v=i.containerGroups[g].tabbableNodes;if(v.length>0){var O=v.findIndex(function(E){return E===i.mostRecentlyFocusedNode});O>=0&&(l.isKeyForward(i.recentNavEvent)?O+1<v.length&&(h=v[O+1],b=!1):O-1>=0&&(h=v[O-1],b=!1))}}else i.containerGroups.some(function(E){return E.tabbableNodes.some(function(N){return L(N)>0})})||(b=!1);else b=!1;b&&(h=_({target:i.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(i.recentNavEvent)})),P(h||i.mostRecentlyFocusedNode||D())}i.recentNavEvent=void 0},ae=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=o;var c=_({event:o,isBackward:a});c&&($(o)&&o.preventDefault(),P(c))},z=function(o){(l.isKeyForward(o)||l.isKeyBackward(o))&&ae(o,l.isKeyBackward(o))},Y=function(o){He(o)&&G(l.escapeDeactivates,o)!==!1&&(o.preventDefault(),y.deactivate())},V=function(o){var a=Z(o);F(a,o)>=0||G(l.clickOutsideDeactivates,o)||G(l.allowOutsideClick,o)||(o.preventDefault(),o.stopImmediatePropagation())},d=function(){if(i.active)return I.activateTrap(u,y),i.delayInitialFocusTimer=l.delayInitialFocus?ve(function(){P(D())}):P(D()),n.addEventListener("focusin",W,!0),n.addEventListener("mousedown",q,{capture:!0,passive:!1}),n.addEventListener("touchstart",q,{capture:!0,passive:!1}),n.addEventListener("click",V,{capture:!0,passive:!1}),n.addEventListener("keydown",z,{capture:!0,passive:!1}),n.addEventListener("keydown",Y),y},f=function(o){i.active&&!i.paused&&y._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var a=new Set,c=new Set,h=le(o),b;try{for(h.s();!(b=h.n()).done;){var g=b.value;a.add(g);for(var v=typeof ShadowRoot<"u"&&g.getRootNode()instanceof ShadowRoot,O=g;O;){a.add(O);var E=O.parentElement,N=[];E?N=E.children:!E&&v&&(N=O.getRootNode().children,E=O.getRootNode().host,v=typeof ShadowRoot<"u"&&E.getRootNode()instanceof ShadowRoot);var A=le(N),C;try{for(A.s();!(C=A.n()).done;){var B=C.value;c.add(B)}}catch(x){A.e(x)}finally{A.f()}O=E}}}catch(x){h.e(x)}finally{h.f()}a.forEach(function(x){c.delete(x)}),i.adjacentElements=c},m=function(){if(i.active)return n.removeEventListener("focusin",W,!0),n.removeEventListener("mousedown",q,!0),n.removeEventListener("touchstart",q,!0),n.removeEventListener("click",V,!0),n.removeEventListener("keydown",z,!0),n.removeEventListener("keydown",Y),y},s=function(o){var a=o.some(function(c){var h=Array.from(c.removedNodes);return h.some(function(b){return b===i.mostRecentlyFocusedNode})});a&&P(D())},T=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(s):void 0,S=function(){T&&(T.disconnect(),i.active&&!i.paused&&i.containers.map(function(o){T.observe(o,{subtree:!0,childList:!0})}))};return y={get active(){return i.active},get paused(){return i.paused},activate:function(o){if(i.active)return this;var a=w(o,"onActivate"),c=w(o,"onPostActivate"),h=w(o,"checkCanFocusTrap"),b=I.getActiveTrap(u),g=!1;if(b&&!b.paused){var v;(v=b._setSubtreeIsolation)===null||v===void 0||v.call(b,!1),g=!0}try{h||R(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=j(n),a==null||a();var O=function(){h&&R(),d(),S(),l.isolateSubtrees&&y._setSubtreeIsolation(!0),c==null||c()};if(h)return h(i.containers.concat()).then(O,O),this;O()}catch(N){if(b===I.getActiveTrap(u)&&g){var E;(E=b._setSubtreeIsolation)===null||E===void 0||E.call(b,!0)}throw N}return this},deactivate:function(o){if(!i.active)return this;var a=de({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},o);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||y._setSubtreeIsolation(!1),i.alreadySilent.clear(),m(),i.active=!1,i.paused=!1,S(),I.deactivateTrap(u,y);var c=w(a,"onDeactivate"),h=w(a,"onPostDeactivate"),b=w(a,"checkCanReturnFocus"),g=w(a,"returnFocus","returnFocusOnDeactivate");c==null||c();var v=function(){ve(function(){g&&P(U(i.nodeFocusedBeforeActivation)),h==null||h()})};return g&&b?(b(U(i.nodeFocusedBeforeActivation)).then(v,v),this):(v(),this)},pause:function(o){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,o)):this},unpause:function(o){return i.active?(i.manuallyPaused=!1,u[u.length-1]!==this?this:this._setPausedState(!1,o)):this},updateContainerElements:function(o){var a=[].concat(o).filter(Boolean);return i.containers=a.map(function(c){return typeof c=="string"?n.querySelector(c):c}),l.isolateSubtrees&&f(i.containers),i.active&&(R(),l.isolateSubtrees&&!i.paused&&y._setSubtreeIsolation(!0)),S(),this}},Object.defineProperties(y,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(o,a){if(i.paused===o)return this;if(i.paused=o,o){var c=w(a,"onPause"),h=w(a,"onPostPause");c==null||c(),m(),S(),y._setSubtreeIsolation(!1),h==null||h()}else{var b=w(a,"onUnpause"),g=w(a,"onPostUnpause");b==null||b(),y._setSubtreeIsolation(!0),R(),d(),S(),g==null||g()}return this}},_setSubtreeIsolation:{value:function(o){l.isolateSubtrees&&i.adjacentElements.forEach(function(a){var c;if(o)switch(l.isolateSubtrees){case"aria-hidden":(a.ariaHidden==="true"||((c=a.getAttribute("aria-hidden"))===null||c===void 0?void 0:c.toLowerCase())==="true")&&i.alreadySilent.add(a),a.setAttribute("aria-hidden","true");break;default:(a.inert||a.hasAttribute("inert"))&&i.alreadySilent.add(a),a.setAttribute("inert",!0);break}else if(!i.alreadySilent.has(a))switch(l.isolateSubtrees){case"aria-hidden":a.removeAttribute("aria-hidden");break;default:a.removeAttribute("inert");break}})}}}),y.updateContainerElements(e),y};const et=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Qe},Symbol.toStringTag,{value:"Module"})),tt=se(et),rt=se(Me);var pe;function at(){if(pe)return H.exports;pe=1;function r(d){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},r(d)}var e,t;function n(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function u(d,f){for(var m=0;m<f.length;m++){var s=f[m];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(d,P(s.key),s)}}function l(d,f,m){return f&&u(d.prototype,f),Object.defineProperty(d,"prototype",{writable:!1}),d}function i(d,f,m){return f=k(f),y(d,F()?Reflect.construct(f,m||[],k(d).constructor):f.apply(d,m))}function y(d,f){if(f&&(r(f)=="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(d)}function w(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function F(){try{var d=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F=function(){return!!d})()}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},k(d)}function D(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),f&&R(d,f)}function R(d,f){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,s){return m.__proto__=s,m},R(d,f)}function j(d,f,m){return(f=P(f))in d?Object.defineProperty(d,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[f]=m,d}function P(d){var f=U(d,"string");return r(f)=="symbol"?f:f+""}function U(d,f){if(r(d)!="object"||!d)return d;var m=d[Symbol.toPrimitive];if(m!==void 0){var s=m.call(d,f);if(r(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}var _=Fe,q=tt,W=q.createFocusTrap,ae=rt,z=ae.isFocusable,Y=parseInt((e=(t=/^(\d+)\./.exec(_.version))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:0,10),V=(function(d){function f(m){var s;n(this,f),s=i(this,f,[m]),j(s,"getNodeForOption",function(p){var o,a=(o=this.internalOptions[p])!==null&&o!==void 0?o:this.originalOptions[p];if(typeof a=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),b=1;b<c;b++)h[b-1]=arguments[b];a=a.apply(void 0,h)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(p,"` was specified but was not a node, or did not return a node"))}var g=a;if(typeof a=="string"){var v;if(g=(v=this.getDocument())===null||v===void 0?void 0:v.querySelector(a),!g)throw new Error("`".concat(p,"` as selector refers to no known node"))}return g}),s.handleDeactivate=s.handleDeactivate.bind(s),s.handlePostDeactivate=s.handlePostDeactivate.bind(s),s.handleClickOutsideDeactivates=s.handleClickOutsideDeactivates.bind(s),s.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:s.handleDeactivate,onPostDeactivate:s.handlePostDeactivate,clickOutsideDeactivates:s.handleClickOutsideDeactivates},s.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var T=m.focusTrapOptions;for(var S in T)if(Object.prototype.hasOwnProperty.call(T,S)){if(S==="returnFocusOnDeactivate"||S==="onDeactivate"||S==="onPostDeactivate"||S==="checkCanReturnFocus"||S==="clickOutsideDeactivates"){s.originalOptions[S]=T[S];continue}s.internalOptions[S]=T[S]}return s.outsideClick=null,s.focusTrapElements=m.containerElements||[],s.updatePreviousElement(),s}return D(f,d),l(f,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var s=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return s||(s===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var s=this.getDocument();s&&(this.previouslyFocusedElement=s.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(s){var T=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,s):this.originalOptions.clickOutsideDeactivates;return T&&(this.outsideClick={target:s.target,allowDeactivation:T}),T}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var s=this,T=function(){var p=s.getReturnFocusNode(),o=!!(s.originalOptions.returnFocusOnDeactivate&&p!==null&&p!==void 0&&p.focus&&(!s.outsideClick||s.outsideClick.allowDeactivation&&!z(s.outsideClick.target,s.internalOptions.tabbableOptions))),a=s.internalOptions.preventScroll,c=a===void 0?!1:a;o&&p.focus({preventScroll:c}),s.originalOptions.onPostDeactivate&&s.originalOptions.onPostDeactivate.call(null),s.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(T,T):T()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var s=this.focusTrapElements.some(Boolean);s&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(s){if(this.focusTrap){s.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var T=!s.active&&this.props.active,S=s.active&&!this.props.active,p=!s.paused&&this.props.paused,o=s.paused&&!this.props.paused;if(T&&(this.updatePreviousElement(),this.focusTrap.activate()),S){this.deactivateTrap();return}p&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else s.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var s=this,T=this.props.children?_.Children.only(this.props.children):void 0;if(T){if(T.type&&T.type===_.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var S=function(a){var c=s.props.containerElements;T&&(Y>=19?typeof T.props.ref=="function"?T.props.ref(a):T.props.ref&&(T.props.ref.current=a):typeof T.ref=="function"?T.ref(a):T.ref&&(T.ref.current=a)),s.focusTrapElements=c||[a]},p=_.cloneElement(T,{ref:S});return p}return null}}])})(_.Component);return V.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:W},H.exports=V,H.exports.FocusTrap=V,H.exports}var nt=at();exports.focusTrapReactExports=nt;exports.getAugmentedNamespace=se;exports.getDefaultExportFromCjs=Se;