PageSourceSearch

https://slide.com.ai/_nuxt/C7L_hLwH.js

js slide.com.ai collected 2026-10-05 14:17:07 UTC 4,966 bytes, 1 lines download raw bytes

vendor: 4,966 bytes, line 1
1import{a as e,F as t,o as n,E as o,G as s,b as a,u as r,at as u,n as c,K as d}from"./93pZSGFa.js";import{o as i}from"./DOqa5cws.js";import{b5 as l,aM as f,aw as p}from"./DsnCtUVf.js";const v="focus-trap.focus-after-trapped",m="focus-trap.focus-after-released",E={cancelable:!0,bubbles:!1},w={cancelable:!0,bubbles:!1},y="focusAfterTrapped",L="focusAfterReleased",b=Symbol("elFocusTrap"),T=e(),h=e(0),F=e(0);let R=0;const K=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},N=(e,t)=>{for(const n of e)if(!P(n,t))return n},P=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},S=(e,t)=>{if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),F.value=window.performance.now(),e!==n&&(e=>e instanceof HTMLInputElement&&"select"in e)(e)&&t&&e.select()}};function g(e,t){const n=[...e],o=e.indexOf(t);return-1!==o&&n.splice(o,1),n}const k=(()=>{let e=[];return{push:t=>{const n=e[0];n&&t!==n&&n.pause(),e=g(e,t),e.unshift(t)},remove:t=>{var n,o;e=g(e,t),null==(o=null==(n=e[0])?void 0:n.resume)||o.call(n)}}})(),I=()=>{T.value="pointer",h.value=window.performance.now()},C=()=>{T.value="keyboard",h.value=window.performance.now()},_=e=>new CustomEvent("focus-trap.focusout-prevented",{...w,detail:e});var j=i(o({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[y,L,"focusin","focusout","focusout-prevented","release-requested"],setup(o,{emit:u}){const i=e();let w,P;const{focusReason:g}=(t((()=>{0===R&&(document.addEventListener("mousedown",I),document.addEventListener("touchstart",I),document.addEventListener("keydown",C)),R++})),n((()=>{R--,R<=0&&(document.removeEventListener("mousedown",I),document.removeEventListener("touchstart",I),document.removeEventListener("keydown",C))})),{focusReason:T,lastUserFocusTimestamp:h,lastAutomatedFocusTimestamp:F});l((e=>{o.trapped&&!j.paused&&u("release-requested",e)}));const j={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},A=e=>{if(!o.loop&&!o.trapped)return;if(j.paused)return;const{key:t,altKey:n,ctrlKey:s,metaKey:a,currentTarget:r,shiftKey:c}=e,{loop:d}=o,i=t===p.tab&&!n&&!s&&!a,l=document.activeElement;if(i&&l){const t=r,[n,o]=(e=>{const t=K(e);return[N(t,e),N(t.reverse(),e)]})(t);if(n&&o)if(c||l!==o){if(c&&[n,t].includes(l)){const t=_({focusReason:g.value});u("focusout-prevented",t),t.defaultPrevented||(e.preventDefault(),d&&S(o,!0))}}else{const t=_({focusReason:g.value});u("focusout-prevented",t),t.defaultPrevented||(e.preventDefault(),d&&S(n,!0))}else if(l===t){const t=_({focusReason:g.value});u("focusout-prevented",t),t.defaultPrevented||e.preventDefault()}}};s(b,{focusTrapRef:i,onKeydown:A}),a((()=>o.focusTrapEl),(e=>{e&&(i.value=e)}),{immediate:!0}),a([i],(([e],[t])=>{e&&(e.addEventListener("keydown",A),e.addEventListener("focusin",D),e.addEventListener("focusout",M)),t&&(t.removeEventListener("keydown",A),t.removeEventListener("focusin",D),t.removeEventListener("focusout",M))}));const x=e=>{u(y,e)},O=e=>u(L,e),D=e=>{const t=r(i);if(!t)return;const n=e.target,s=e.relatedTarget,a=n&&t.contains(n);if(!o.trapped){s&&t.contains(s)||(w=s)}a&&u("focusin",e),j.paused||o.trapped&&(a?P=n:S(P,!0))},M=e=>{const t=r(i);if(!j.paused&&t)if(o.trapped){const n=e.relatedTarget;f(n)||t.contains(n)||setTimeout((()=>{if(!j.paused&&o.trapped){const e=_({focusReason:g.value});u("focusout-prevented",e),e.defaultPrevented||S(P,!0)}}),0)}else{const n=e.target;n&&t.contains(n)||u("focusout",e)}};async function q(){await c();const e=r(i);if(e){k.push(j);const t=e.contains(document.activeElement)?w:document.activeElement;w=t;if(!e.contains(t)){const n=new Event(v,E);e.addEventListener(v,x),e.dispatchEvent(n),n.defaultPrevented||c((()=>{let n=o.focusStartEl;d(n)||(S(n),document.activeElement!==n&&(n="first")),"first"===n&&((e,t=!1)=>{const n=document.activeElement;for(const o of e)if(S(o,t),document.activeElement!==n)return})(K(e),!0),document.activeElement!==t&&"container"!==n||S(e)}))}}}function B(){const e=r(i);if(e){e.removeEventListener(v,x);const t=new CustomEvent(m,{...E,detail:{focusReason:g.value}});e.addEventListener(m,O),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=g.value&&h.value>F.value&&!e.contains(document.activeElement)||S(null!=w?w:document.body),e.removeEventListener(m,O),k.remove(j)}}return t((()=>{o.trapped&&q(),a((()=>o.trapped),(e=>{e?q():B()}))})),n((()=>{o.trapped&&B()})),{onKeydown:A}}}),[["render",function(e,t,n,o,s,a){return u(e.$slots,"default",{handleKeydown:e.onKeydown})}],["__file","focus-trap.vue"]]);export{j as E,b as F};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.