(()=>{var _=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],G=_.join(","),C=typeof Element=="undefined"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,M=function(e,t,a){var u=Array.prototype.slice.apply(e.querySelectorAll(G));return t&&C.call(e,G)&&u.unshift(e),u=u.filter(a),u},Z=function(e){return e.contentEditable==="true"},q=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?Z(e)||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t},$=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},L=function(e){return e.tagName==="INPUT"},ee=function(e){return L(e)&&e.type==="hidden"},te=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(a){return a.tagName==="SUMMARY"});return t},re=function(e,t){for(var a=0;asummary:first-of-type"),u=a?e.parentElement:e;if(C.call(u,"details:not([open]) *"))return!0;if(!t||t==="full")for(;e;){if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}else if(t==="non-zero-area"){var r=e.getBoundingClientRect(),s=r.width,l=r.height;return s===0&&l===0}return!1},oe=function(e){if(L(e)||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.tagName==="BUTTON")for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var a=0;a0){var a=i[i.length-1];a!==t&&a.pause()}var u=i.indexOf(t);u===-1||i.splice(u,1),i.push(t)},deactivateTrap:function(t){var a=i.indexOf(t);a!==-1&&i.splice(a,1),i.length>0&&i[i.length-1].unpause()}}}(),de=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},be=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},ve=function(e){return e.key==="Tab"||e.keyCode===9},K=function(e){return setTimeout(e,0)},x=function(e,t){var a=-1;return e.every(function(u,r){return t(u)?(a=r,!1):!0}),a},A=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),u=1;u0)return{container:n,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1]}}).filter(function(n){return!!n}),r.tabbableGroups.length<=0&&!b("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},m=function f(n){if(n!==!1&&n!==a.activeElement){if(!n||!n.focus){f(v());return}n.focus({preventScroll:!!u.preventScroll}),r.mostRecentlyFocusedNode=n,de(n)&&n.select()}},S=function(n){var o=b("setReturnFocus");return o||n},g=function(n){if(!p(n.target)){if(A(u.clickOutsideDeactivates,n)){s.deactivate({returnFocus:u.returnFocusOnDeactivate&&!O(n.target)});return}A(u.allowOutsideClick,n)||n.preventDefault()}},w=function(n){var o=p(n.target);o||n.target instanceof Document?o&&(r.mostRecentlyFocusedNode=n.target):(n.stopImmediatePropagation(),m(r.mostRecentlyFocusedNode||v()))},k=function(n){h();var o=null;if(r.tabbableGroups.length>0){var c=x(r.tabbableGroups,function(N){var D=N.container;return D.contains(n.target)});if(c<0)n.shiftKey?o=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:o=r.tabbableGroups[0].firstTabbableNode;else if(n.shiftKey){var d=x(r.tabbableGroups,function(N){var D=N.firstTabbableNode;return n.target===D});if(d<0&&r.tabbableGroups[c].container===n.target&&(d=c),d>=0){var y=d===0?r.tabbableGroups.length-1:d-1,F=r.tabbableGroups[y];o=F.lastTabbableNode}}else{var T=x(r.tabbableGroups,function(N){var D=N.lastTabbableNode;return n.target===D});if(T<0&&r.tabbableGroups[c].container===n.target&&(T=c),T>=0){var X=T===r.tabbableGroups.length-1?0:T+1,J=r.tabbableGroups[X];o=J.firstTabbableNode}}}else o=b("fallbackFocus");o&&(n.preventDefault(),m(o))},E=function(n){if(be(n)&&A(u.escapeDeactivates)!==!1){n.preventDefault(),s.deactivate();return}if(ve(n)){k(n);return}},I=function(n){A(u.clickOutsideDeactivates,n)||p(n.target)||A(u.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},P=function(){if(!!r.active)return U.activateTrap(s),r.delayInitialFocusTimer=u.delayInitialFocus?K(function(){m(v())}):m(v()),a.addEventListener("focusin",w,!0),a.addEventListener("mousedown",g,{capture:!0,passive:!1}),a.addEventListener("touchstart",g,{capture:!0,passive:!1}),a.addEventListener("click",I,{capture:!0,passive:!1}),a.addEventListener("keydown",E,{capture:!0,passive:!1}),s},j=function(){if(!!r.active)return a.removeEventListener("focusin",w,!0),a.removeEventListener("mousedown",g,!0),a.removeEventListener("touchstart",g,!0),a.removeEventListener("click",I,!0),a.removeEventListener("keydown",E,!0),s};return s={activate:function(n){if(r.active)return this;var o=l(n,"onActivate"),c=l(n,"onPostActivate"),d=l(n,"checkCanFocusTrap");d||h(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=a.activeElement,o&&o();var y=function(){d&&h(),P(),c&&c()};return d?(d(r.containers.concat()).then(y,y),this):(y(),this)},deactivate:function(n){if(!r.active)return this;clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,j(),r.active=!1,r.paused=!1,U.deactivateTrap(s);var o=l(n,"onDeactivate"),c=l(n,"onPostDeactivate"),d=l(n,"checkCanReturnFocus");o&&o();var y=l(n,"returnFocus","returnFocusOnDeactivate"),F=function(){K(function(){y&&m(S(r.nodeFocusedBeforeActivation)),c&&c()})};return y&&d?(d(S(r.nodeFocusedBeforeActivation)).then(F,F),this):(F(),this)},pause:function(){return r.paused||!r.active?this:(r.paused=!0,j(),this)},unpause:function(){return!r.paused||!r.active?this:(r.paused=!1,h(),P(),this)},updateContainerElements:function(n){var o=[].concat(n).filter(Boolean);return r.containers=o.map(function(c){return typeof c=="string"?a.querySelector(c):c}),r.active&&h(),this}},s.updateContainerElements(e),s};function z(i){let e,t;window.addEventListener("focusin",()=>{e=t,t=document.activeElement}),i.magic("focus",a=>{let u=a;return{__noscroll:!1,__wrapAround:!1,within(r){return u=r,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(r){return O(r)},previouslyFocused(){return e},lastFocused(){return e},focused(){return t},focusables(){return Array.isArray(u)?u:B(u,{displayCheck:"none"})},all(){return this.focusables()},isFirst(r){let s=this.all();return s[0]&&s[0].isSameNode(r)},isLast(r){let s=this.all();return s.length&&s.slice(-1)[0].isSameNode(r)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===r.length-1?r[0]:r[r.indexOf(s)+1]},getPrevious(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===0?r.slice(-1)[0]:r[r.indexOf(s)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(r){!r||setTimeout(()=>{r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.focus({preventScroll:this._noscroll})})}}}),i.directive("trap",i.skipDuringClone((a,{expression:u,modifiers:r},{effect:s,evaluateLater:l,cleanup:p})=>{let b=l(u),v=!1,h={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>a},m=a.querySelector("[autofocus]");m&&(h.initialFocus=m);let S=V(a,h),g=()=>{},w=()=>{},k=()=>{g(),g=()=>{},w(),w=()=>{},S.deactivate({returnFocus:!r.includes("noreturn")})};s(()=>b(E=>{v!==E&&(E&&!v&&setTimeout(()=>{r.includes("inert")&&(g=Y(a)),r.includes("noscroll")&&(w=pe()),S.activate()}),!E&&v&&k(),v=!!E)})),p(k)},(a,{expression:u,modifiers:r},{evaluate:s})=>{r.includes("inert")&&s(u)&&Y(a)}))}function Y(i){let e=[];return Q(i,t=>{let a=t.hasAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),e.push(()=>a||t.removeAttribute("aria-hidden"))}),()=>{for(;e.length;)e.pop()()}}function Q(i,e){i.isSameNode(document.body)||!i.parentNode||Array.from(i.parentNode.children).forEach(t=>{t.isSameNode(i)?Q(i.parentNode,e):e(t)})}function pe(){let i=document.documentElement.style.overflow,e=document.documentElement.style.paddingRight,t=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${t}px`,()=>{document.documentElement.style.overflow=i,document.documentElement.style.paddingRight=e}}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(z)});})(); /*! * focus-trap 6.6.1 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE */ /*! * tabbable 5.2.1 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */