"use strict"; !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0a7ea3e0-87a6-57e9-be7c-3b3313c0e679")}catch(e){}}(); (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6829],{86829:(e,t,n)=>{n.r(t),n.d(t,{createFocusTrap:()=>G});var r=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],a=r.join(","),o="undefined"==typeof Element,i=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,c=!o&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},u=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(a));return t&&i.call(e,a)&&r.unshift(e),r=r.filter(n)},s=function e(t,n,r){for(var o=[],c=Array.from(t);c.length;){var u=c.shift();if("SLOT"===u.tagName){var s=u.assignedElements(),l=e(s.length?s:u.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:u,candidates:l})}else{i.call(u,a)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var d=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),f=!r.shadowRootFilter||r.shadowRootFilter(u);if(d&&f){var p=e(!0===d?u.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:u,candidates:p})}else c.unshift.apply(c,u.children)}}return o},l=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},d=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},f=function(e){return"INPUT"===e.tagName},p=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(i.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return h(e)}else{if("function"==typeof r){for(var o=e;e;){var u=e.parentElement,s=c(e);if(u&&!u.shadowRoot&&!0===r(u))return h(e);e=e.assignedSlot?e.assignedSlot:u||s===e.ownerDocument?u:s.host}e=o}if(v(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},y=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;nl(t))&&!!g(e,t)},E=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||t>=0},N=function e(t){var n=[],r=[];return t.forEach(function(t,a){var o=!!t.scopeParent,i=o?t.scopeParent:t,c=l(i,o),u=o?e(t.candidates):i;0===c?o?n.push.apply(n,u):n.push(i):r.push({documentOrder:a,tabIndex:c,item:t,isScope:o,content:u})}),r.sort(d).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},O=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==i.call(e,a)&&w(t,e)},S=r.concat("iframe").join(","),T=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==i.call(e,S)&&g(t,e)};function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function F(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},C=function(e){return setTimeout(e,0)},I=function(e,t){var n=-1;return e.every(function(e,r){return!t(e)||(n=r,!1)}),n},P=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?n-1:0),i=1;i=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||d("fallbackFocus")}}if(!e)throw Error("Your focus-trap needs to have at least one focusable element");return e},p=function(){if(i.containerGroups=i.containers.map(function(e){var t,n,r,a,i=(t=e,N((n=(n=o.tabbableOptions)||{}).getShadowRoot?s([t],n.includeContainer,{filter:w.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:E}):u(t,n.includeContainer,w.bind(null,n)))),c=(r=e,(a=(a=o.tabbableOptions)||{}).getShadowRoot?s([r],a.includeContainer,{filter:g.bind(null,a),flatten:!0,getShadowRoot:a.getShadowRoot}):u(r,a.includeContainer,g.bind(null,a)));return{container:e,tabbableNodes:i,focusableNodes:c,firstTabbableNode:i.length>0?i[0]:null,lastTabbableNode:i.length>0?i[i.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=c.findIndex(function(t){return t===e});return n<0?void 0:t?c.slice(n+1).find(function(e){return O(e,o.tabbableOptions)}):c.slice(0,n).reverse().find(function(e){return O(e,o.tabbableOptions)})}}}),i.tabbableGroups=i.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!d("fallbackFocus"))throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},b=function e(t){if(!1!==t&&t!==r.activeElement){if(!t||!t.focus){e(f());return}t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select&&t.select()}},v=function(e){var t=d("setReturnFocus",e);return t||!1!==t&&e},h=function(e){var t=A(e);if(!(l(t)>=0)){if(P(o.clickOutsideDeactivates,e)){n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!T(t,o.tabbableOptions)});return}P(o.allowOutsideClick,e)||e.preventDefault()}},m=function(e){var t=A(e),n=l(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),b(i.mostRecentlyFocusedNode||f()))},y=function(e){var t=A(e);p();var n=null;if(i.tabbableGroups.length>0){var r=l(t),a=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=I(i.tabbableGroups,function(e){return t===e.firstTabbableNode});if(c<0&&(a.container===t||T(t,o.tabbableOptions)&&!O(t,o.tabbableOptions)&&!a.nextTabbableNode(t,!1))&&(c=r),c>=0){var u=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[u].lastTabbableNode}}else{var s=I(i.tabbableGroups,function(e){return t===e.lastTabbableNode});if(s<0&&(a.container===t||T(t,o.tabbableOptions)&&!O(t,o.tabbableOptions)&&!a.nextTabbableNode(t))&&(s=r),s>=0){var f=s===i.tabbableGroups.length-1?0:s+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=d("fallbackFocus");n&&(e.preventDefault(),b(n))},S=function(e){if(("Escape"===e.key||"Esc"===e.key||27===e.keyCode)&&!1!==P(o.escapeDeactivates,e)){e.preventDefault(),n.deactivate();return}if("Tab"===e.key||9===e.keyCode){y(e);return}},D=function(e){l(A(e))>=0||P(o.clickOutsideDeactivates,e)||P(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},G=function(){if(i.active)return R.activateTrap(a,n),i.delayInitialFocusTimer=o.delayInitialFocus?C(function(){b(f())}):b(f()),r.addEventListener("focusin",m,!0),r.addEventListener("mousedown",h,{capture:!0,passive:!1}),r.addEventListener("touchstart",h,{capture:!0,passive:!1}),r.addEventListener("click",D,{capture:!0,passive:!1}),r.addEventListener("keydown",S,{capture:!0,passive:!1}),n},x=function(){if(i.active)return r.removeEventListener("focusin",m,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",D,!0),r.removeEventListener("keydown",S,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=c(e,"onActivate"),n=c(e,"onPostActivate"),a=c(e,"checkCanFocusTrap");a||p(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var o=function(){a&&p(),G(),n&&n()};return a?a(i.containers.concat()).then(o,o):o(),this},deactivate:function(e){if(!i.active)return this;var t=F({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,x(),i.active=!1,i.paused=!1,R.deactivateTrap(a,n);var r=c(t,"onDeactivate"),u=c(t,"onPostDeactivate"),s=c(t,"checkCanReturnFocus"),l=c(t,"returnFocus","returnFocusOnDeactivate");r&&r();var d=function(){C(function(){l&&b(v(i.nodeFocusedBeforeActivation)),u&&u()})};return l&&s?s(v(i.nodeFocusedBeforeActivation)).then(d,d):d(),this},pause:function(){return i.paused||!i.active||(i.paused=!0,x()),this},unpause:function(){return i.paused&&i.active&&(i.paused=!1,p(),G()),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),i.active&&p(),this}}).updateContainerElements(e),n}}}]); //# debugId=0a7ea3e0-87a6-57e9-be7c-3b3313c0e679