PageSourceSearch

https://app.insomnia.rest/assets/useFocusRing-ZWDRAqPW.js

js insomnia.rest collected 2026-09-24 07:46:55 UTC 28,328 bytes, 8 lines download raw bytes

1import{r as f,a as z}from"./jsx-runtime-Dt5Dsy05.js";import{g as X,o as pt,e as ie,i as $t,j as vt}from"./utils-BB8Ot9oC.js";import"./index-NZOc2LSb.js";const m=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},S=e=>e&&"window"in e&&e.window===e?e:m(e).defaultView||window;function gt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function yt(e){return gt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Et=!1,ht=!1;function En(){return Et}function Te(){return ht}function P(e,t){if(!Te())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:yt(n)?n=n.host:n=n.parentNode}return!1}const A=(e=document)=>{var t;if(!Te())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function $(e){if(Te()&&e.target instanceof Element&&e.target.shadowRoot){var t,n;if("composedPath"in e)return(t=e.composedPath()[0])!==null&&t!==void 0?t:null;if("composedPath"in e.nativeEvent)return(n=e.nativeEvent.composedPath()[0])!==null&&n!==void 0?n:null}return e.target}function hn(e){if(!e)return!1;let t=e.getRootNode(),n=S(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}const mt=new Set(["id"]),Tt=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Pt=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),wt=new Set(["dir","lang","hidden","inert","translate"]),Ie=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),Lt=/^(data-.*)$/;function mn(e,t={}){let{labelable:n,isLink:r,global:i,events:l=i,propNames:u}=t,s={};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(mt.has(c)||n&&Tt.has(c)||r&&Pt.has(c)||i&&wt.has(c)||l&&(Ie.has(c)||c.endsWith("Capture")&&Ie.has(c.slice(0,-7)))||u!=null&&u.has(c)||Lt.test(c))&&(s[c]=e[c]);return s}function G(e){if(xt())e.focus({preventScroll:!0});else{let t=St(e);e.focus(),kt(t)}}let Z=null;function xt(){if(Z==null){Z=!1;try{document.createElement("div").focus({get preventScroll(){return Z=!0,!0}})}catch{}}return Z}function St(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function kt(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function ue(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function Pe(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function F(e){let t=null;return()=>(t==null&&(t=e()),t)}const V=F(function(){return Pe(/^Mac/i)}),Ct=F(function(){return Pe(/^iPhone/i)}),je=F(function(){return Pe(/^iPad/i)||V()&&navigator.maxTouchPoints>1}),we=F(function(){return Ct()||je()}),Tn=F(function(){return V()||we()}),Ft=F(function(){return ue(/AppleWebKit/i)&&!Mt()}),Mt=F(function(){return ue(/Chrome/i)}),Ye=F(function(){return ue(/Android/i)}),At=F(function(){return ue(/Firefox/i)}),Dt=f.createContext({isNative:!0,open:It,useHref:e=>e});function ze(){return f.useContext(Dt)}function Kt(e,t){let n=e.getAttribute("target");return(!n||n==="_self")&&e.origin===location.origin&&!e.hasAttribute("download")&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function D(e,t,n=!0){var r,i;let{metaKey:l,ctrlKey:u,altKey:s,shiftKey:c}=t;At()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(V()?l=!0:u=!0);let p=Ft()&&V()&&!je()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:l,ctrlKey:u,altKey:s,shiftKey:c}):new MouseEvent("click",{metaKey:l,ctrlKey:u,altKey:s,shiftKey:c,detail:1,bubbles:!0,cancelable:!0});D.isOpening=n,G(e),e.dispatchEvent(p),D.isOpening=!1}D.isOpening=!1;function Ht(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function It(e,t){Ht(e,n=>D(n,t))}function Pn(e){let t=ze();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function wn(e){let t=ze();var n;const r=t.useHref((n=e==null?void 0:e.href)!==null&&n!==void 0?n:"");return{href:e!=null&&e.href?r:void 0,target:e==null?void 0:e.target,rel:e==null?void 0:e.rel,download:e==null?void 0:e.download,ping:e==null?void 0:e.ping,referrerPolicy:e==null?void 0:e.referrerPolicy}}function Ln(e,t,n,r){!t.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&Kt(e.currentTarget,e)&&n&&(e.preventDefault(),t.open(e.currentTarget,e,n,r))}let M=new Map,ge=new Set;function Oe(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{let i=$(r);if(!e(r)||!i)return;let l=M.get(i);l||(l=new Set,M.set(i,l),i.addEventListener("transitioncancel",n,{once:!0})),l.add(r.propertyName)},n=r=>{let i=$(r);if(!e(r)||!i)return;let l=M.get(i);if(l&&(l.delete(r.propertyName),l.size===0&&(i.removeEventListener("transitioncancel",n),M.delete(i)),M.size===0)){for(let u of ge)u();ge.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Oe():document.addEventListener("DOMContentLoaded",Oe));function Ot(){for(const[e]of M)"isConnected"in e&&!e.isConnected&&M.delete(e)}function Xe(e){requestAnimationFrame(()=>{Ot(),M.size===0?e():ge.add(e)})}function Le(){let e=f.useRef(new Map),t=f.useCallback((i,l,u,s)=>{let c=s!=null&&s.once?(...p)=>{e.current.delete(u),u(...p)}:u;e.current.set(u,{type:l,eventTarget:i,fn:c,options:s}),i.addEventListener(l,c,s)},[]),n=f.useCallback((i,l,u,s)=>{var c;let p=((c=e.current.get(u))===null||c===void 0?void 0:c.fn)||u;i.removeEventListener(l,p,s),e.current.delete(u)},[]),r=f.useCallback(()=>{e.current.forEach((i,l)=>{n(i.eventTarget,i.type,l,i.options)})},[n]);return f.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}var $e;const _t=($e=z.useInsertionEffect)!==null&&$e!==void 0?$e:X;function ee(e){const t=f.useRef(null);return _t(()=>{t.current=e},[e]),f.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}function qe(e,t){X(()=>
1{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Je(e){return e.pointerType===""&&e.isTrusted?!0:Ye()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rt(e){return!Ye()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}const Nt=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ut(e){const t=S(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:l}=e.ownerDocument.defaultView;let{display:u,visibility:s}=l(e);i=u!=="none"&&s!=="hidden"&&s!=="collapse"}return i}function Wt(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function xe(e,t){return Nt?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ut(e)&&Wt(e,t)&&(!e.parentElement||xe(e.parentElement,e))}const Se=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Gt=Se.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Se.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Vt=Se.join(':not([hidden]):not([tabindex="-1"]),');function Bt(e){return e.matches(Gt)&&xe(e)&&!Qe(e)}function xn(e){return e.matches(Vt)&&xe(e)&&!Qe(e)}function Qe(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function jt(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yt(e,t,n){jt(e,t),t.set(e,n)}function ke(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ze(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function et(e){let t=f.useRef({isFocused:!1,observer:null});return X(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),f.useCallback(n=>{let r=$(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r,l=u=>{if(t.current.isFocused=!1,i.disabled){let s=ke(u);e==null||e(s)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",l,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var u;(u=t.current.observer)===null||u===void 0||u.disconnect();let s=i===A()?null:A();i.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let ae=!1;function zt(e){for(;e&&!Bt(e);)e=e.parentElement;let t=S(e),n=t.document.activeElement;if(!n||n===e)return;ae=!0;let r=!1,i=y=>{($(y)===n||r)&&y.stopImmediatePropagation()},l=y=>{($(y)===n||r)&&(y.stopImmediatePropagation(),!e&&!r&&(r=!0,G(n),c()))},u=y=>{($(y)===e||r)&&y.stopImmediatePropagation()},s=y=>{($(y)===e||r)&&(y.stopImmediatePropagation(),r||(r=!0,G(n),c()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",l,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",u,!0);let c=()=>{cancelAnimationFrame(p),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",l,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",u,!0),ae=!1,r=!1},p=requestAnimationFrame(c);return c}let U="default",ye="",oe=new WeakMap;function Xt(e){if(we()){if(U==="default"){const t=m(e);ye=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}U="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";oe.set(e,e.style[t]),e.style[t]="none"}}function _e(e){if(we()){if(U!=="disabled")return;U="restoring",setTimeout(()=>{Xe(()=>{if(U==="restoring"){const t=m(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=ye||""),ye="",U="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&oe.has(e)){let t=
1oe.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),oe.delete(e)}}const tt=z.createContext({register:()=>{}});tt.displayName="PressResponderContext";function qt(e,t){return t.get?t.get.call(e):t.value}function nt(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Jt(e,t){var n=nt(e,t,"get");return qt(e,n)}function Qt(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function Re(e,t,n){var r=nt(e,t,"set");return Qt(e,r,n),n}function Zt(e){let t=f.useContext(tt);if(t){let{register:n,ref:r,...i}=t;e=ie(i,e),n()}return qe(t,e.ref),e}var te=new WeakMap;class ne{continuePropagation(){Re(this,te,!1)}get shouldStopPropagation(){return Jt(this,te)}constructor(t,n,r,i){Yt(this,te,{writable:!0,value:void 0}),Re(this,te,!0);var l;let u=(l=i==null?void 0:i.target)!==null&&l!==void 0?l:r.currentTarget;const s=u==null?void 0:u.getBoundingClientRect();let c,p=0,y,g=null;r.clientX!=null&&r.clientY!=null&&(y=r.clientX,g=r.clientY),s&&(y!=null&&g!=null?(c=y-s.left,p=g-s.top):(c=s.width/2,p=s.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=c,this.y=p,this.key=r.key}}const Ne=Symbol("linkClicked"),Ue="react-aria-pressable-style",We="data-react-aria-pressable";function Sn(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:l,onClick:u,isDisabled:s,isPressed:c,preventFocusOnPress:p,shouldCancelOnPointerExit:y,allowTextSelectionOnPress:g,ref:k,...L}=Zt(e),[K,h]=f.useState(!1),T=f.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:w,removeAllGlobalListeners:x,removeGlobalListener:H}=Le(),B=f.useCallback((o,d)=>{let a=T.current;if(s||a.didFirePressStart)return!1;let b=!0;if(a.isTriggeringEvent=!0,r){let E=new ne("pressstart",d,o);r(E),b=E.shouldStopPropagation}return n&&n(!0),a.isTriggeringEvent=!1,a.didFirePressStart=!0,h(!0),b},[s,r,n]),I=f.useCallback((o,d,a=!0)=>{let b=T.current;if(!b.didFirePressStart)return!1;b.didFirePressStart=!1,b.isTriggeringEvent=!0;let E=!0;if(i){let v=new ne("pressend",d,o);i(v),E=v.shouldStopPropagation}if(n&&n(!1),h(!1),t&&a&&!s){let v=new ne("press",d,o);t(v),E&&(E=v.shouldStopPropagation)}return b.isTriggeringEvent=!1,E},[s,i,n,t]),ct=ee(I),j=f.useCallback((o,d)=>{let a=T.current;if(s)return!1;if(l){a.isTriggeringEvent=!0;let b=new ne("pressup",d,o);return l(b),a.isTriggeringEvent=!1,b.shouldStopPropagation}return!0},[s,l]),ft=ee(j),N=f.useCallback(o=>{let d=T.current;if(d.isPressed&&d.target){d.didFirePressStart&&d.pointerType!=null&&I(_(d.target,o),d.pointerType,!1),d.isPressed=!1,He(null),d.isOverTarget=!1,d.activePointerId=null,d.pointerType=null,x(),g||_e(d.target);for(let a of d.disposables)a();d.disposables=[]}},[g,x,I]),fe=ee(N),Fe=f.useCallback(o=>{y&&N(o)},[y,N]),de=f.useCallback(o=>{s||u==null||u(o)},[s,u]),Me=f.useCallback((o,d)=>{if(!s&&u){let a=new MouseEvent("click",o);Ze(a,d),u(ke(a))}},[s,u]),dt=ee(Me),[Ae,De]=f.useState(!1);X(()=>{let o=T.current;if(Ae){let d=v=>{var O;if(o.isPressed&&o.target&&ve(v,o.target)){var be;Ge($(v),v.key)&&v.preventDefault();let J=$(v),Q=P(o.target,J);ct(_(o.target,v),"keyboard",Q),Q&&dt(v,o.target),x(),v.key!=="Enter"&&Ce(o.target)&&P(o.target,J)&&!v[Ne]&&(v[Ne]=!0,D(o.target,v,!1)),o.isPressed=!1,De(!1),(be=o.metaKeyEvents)===null||be===void 0||be.delete(v.key)}else if(v.key==="Meta"&&(!((O=o.metaKeyEvents)===null||O===void 0)&&O.size)){var pe;let J=o.metaKeyEvents;o.metaKeyEvents=void 0;for(let Q of J.values())(pe=o.target)===null||pe===void 0||pe.dispatchEvent(new KeyboardEvent("keyup",Q))}},a=o.target,E=pt(v=>{a&&ve(v,a)&&!v.repeat&&P(a,$(v))&&o.target&&ft(_(o.target,v),"keyboard")},d);return w(m(o.target),"keyup",E,!0),()=>{H(m(o.target),"keyup",E,!0)}}},[Ae,w,x,H]);let[Ke,He]=f.useState(null);X(()=>{let o=T.current;if(Ke==="pointer"){let d=b=>{if(b.pointerId===o.activePointerId&&o.isPressed&&b.button===0&&o.target){if(P(o.target,$(b))&&o.pointerType!=null){let E=!1,v=setTimeout(()=>{o.isPressed&&o.target instanceof HTMLElement&&(E?fe(b):(G(o.target),o.target.click()))},80);b.currentTarget&&w(b.currentTarget,"click",()=>E=!0,!0),o.disposables.push(()=>clearTimeout(v))}else fe(b);o.isOverTarget=!1}},a=b=>{fe(b)};return w(m(o.target),"pointerup",d,!1),w(m(o.target),"pointercancel",a,!1),()=>{H(m(o.target),"pointerup",d,!1),H(m(o.target),"pointercancel",a,!1)}}},[Ke,w,H]);let bt=f.useMemo(()=>{let o=T.current,d={onKeyDown(a){if(ve(a.nativeEvent,a.currentTarget)&&P(a.currentTarget,$(a))){var b;Ge($(a),a.key)&&a.preventDefault();let E=!0;!o.isPressed&&!a.repeat&&(o.target=a.currentTarget,o.isPressed=!0,De(!0),o.pointerType="keyboard",E=B(a,"keyboard")),E&&a.stopPropagation(),a.metaKey&&V()&&((b=o.metaKeyEvents)===null||b===void 0||b.set(a.key,a.nativeEvent))}else a.key==="Meta"&&(o.metaKeyEvents=new Map)}
1,onClick(a){if(!(a&&!P(a.currentTarget,$(a)))&&a&&a.button===0&&!o.isTriggeringEvent&&!D.isOpening){let b=!0;if(s&&a.preventDefault(),!o.ignoreEmulatedMouseEvents&&!o.isPressed&&(o.pointerType==="virtual"||Je(a.nativeEvent))){let E=B(a,"virtual"),v=j(a,"virtual"),O=I(a,"virtual");de(a),b=E&&v&&O}else if(o.isPressed&&o.pointerType!=="keyboard"){let E=o.pointerType||a.nativeEvent.pointerType||"virtual",v=j(_(a.currentTarget,a),E),O=I(_(a.currentTarget,a),E,!0);b=v&&O,o.isOverTarget=!1,de(a),N(a)}o.ignoreEmulatedMouseEvents=!1,b&&a.stopPropagation()}}};return typeof PointerEvent<"u"&&(d.onPointerDown=a=>{if(a.button!==0||!P(a.currentTarget,$(a)))return;if(Rt(a.nativeEvent)){o.pointerType="virtual";return}o.pointerType=a.pointerType;let b=!0;if(!o.isPressed){o.isPressed=!0,He("pointer"),o.isOverTarget=!0,o.activePointerId=a.pointerId,o.target=a.currentTarget,g||Xt(o.target),b=B(a,o.pointerType);let E=$(a);"releasePointerCapture"in E&&("hasPointerCapture"in E?E.hasPointerCapture(a.pointerId)&&E.releasePointerCapture(a.pointerId):E.releasePointerCapture(a.pointerId))}b&&a.stopPropagation()},d.onMouseDown=a=>{if(P(a.currentTarget,$(a))&&a.button===0){if(p){let b=zt(a.target);b&&o.disposables.push(b)}a.stopPropagation()}},d.onPointerUp=a=>{!P(a.currentTarget,$(a))||o.pointerType==="virtual"||a.button===0&&!o.isPressed&&j(a,o.pointerType||a.pointerType)},d.onPointerEnter=a=>{a.pointerId===o.activePointerId&&o.target&&!o.isOverTarget&&o.pointerType!=null&&(o.isOverTarget=!0,B(_(o.target,a),o.pointerType))},d.onPointerLeave=a=>{a.pointerId===o.activePointerId&&o.target&&o.isOverTarget&&o.pointerType!=null&&(o.isOverTarget=!1,I(_(o.target,a),o.pointerType,!1),Fe(a))},d.onDragStart=a=>{P(a.currentTarget,$(a))&&N(a)}),d},[s,p,x,g,N,Fe,I,B,j,de,Me]);return f.useEffect(()=>{if(!k)return;const o=m(k.current);if(!o||!o.head||o.getElementById(Ue))return;const d=o.createElement("style");d.id=Ue,d.textContent=`
2@layer {
3  [${We}] {
4    touch-action: pan-x pan-y pinch-zoom;
5  }
6}
7    `.trim(),o.head.prepend(d)},[k]),f.useEffect(()=>{let o=T.current;return()=>{var d;g||_e((d=o.target)!==null&&d!==void 0?d:void 0);for(let a of o.disposables)a();o.disposables=[]}},[g]),{isPressed:c||K,pressProps:ie(L,bt,{[We]:!0})}}function Ce(e){return e.tagName==="A"&&e.hasAttribute("href")}function ve(e,t){const{key:n,code:r}=e,i=t,l=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof S(i).HTMLInputElement&&!rt(i,n)||i instanceof S(i).HTMLTextAreaElement||i.isContentEditable)&&!((l==="link"||!l&&Ce(i))&&n!=="Enter")}function _(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function en(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Ce(e)}function Ge(e,t){return e instanceof HTMLInputElement?!rt(e,t):en(e)}const tn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function rt(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":tn.has(e.type)}let C=null;const q=new Set;let Y=new Map,R=!1,Ee=!1;const nn={Tab:!0,Escape:!0};function ce(e,t){for(let n of q)n(e,t)}function rn(e){return!(e.metaKey||!V()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function se(e){R=!0,!D.isOpening&&rn(e)&&(C="keyboard",ce("keyboard",e))}function W(e){C="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(R=!0,ce("pointer",e))}function ot(e){!D.isOpening&&Je(e)&&(R=!0,C="virtual")}function it(e){$(e)===window||$(e)===document||ae||!e.isTrusted||(!R&&!Ee&&(C="virtual",ce("virtual",e)),R=!1,Ee=!1)}function at(){ae||(R=!1,Ee=!0)}function le(e){if(typeof window>"u"||typeof document>"u"||Y.get(S(e)))return;const t=S(e),n=m(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){R=!0,r.apply(this,arguments)},n.addEventListener("keydown",se,!0),n.addEventListener("keyup",se,!0),n.addEventListener("click",ot,!0),t.addEventListener("focus",it,!0),t.addEventListener("blur",at,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",W,!0),n.addEventListener("pointermove",W,!0),n.addEventListener("pointerup",W,!0)),t.addEventListener("beforeunload",()=>{st(e)},{once:!0}),Y.set(t,{focus:r})}const st=(e,t)=>
7{const n=S(e),r=m(e);t&&r.removeEventListener("DOMContentLoaded",t),Y.has(n)&&(n.HTMLElement.prototype.focus=Y.get(n).focus,r.removeEventListener("keydown",se,!0),r.removeEventListener("keyup",se,!0),r.removeEventListener("click",ot,!0),n.removeEventListener("focus",it,!0),n.removeEventListener("blur",at,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",W,!0),r.removeEventListener("pointermove",W,!0),r.removeEventListener("pointerup",W,!0)),Y.delete(n))};function on(e){const t=m(e);let n;return t.readyState!=="loading"?le(e):(n=()=>{le(e)},t.addEventListener("DOMContentLoaded",n)),()=>st(e,n)}typeof document<"u"&&on();function he(){return C!=="pointer"}function an(){return C}function kn(e){C=e,ce(e,null)}function Cn(){le();let[e,t]=f.useState(C);return f.useEffect(()=>{let n=()=>{t(C)};return q.add(n),()=>{q.delete(n)}},[]),$t()?null:e}const sn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ln(e,t,n){let r=m(n?$(n):void 0),i=n?$(n):void 0;const l=typeof window<"u"?S(i).HTMLInputElement:HTMLInputElement,u=typeof window<"u"?S(i).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?S(i).HTMLElement:HTMLElement,c=typeof window<"u"?S(i).KeyboardEvent:KeyboardEvent;let p=A(r);return e=e||p instanceof l&&!sn.has(p.type)||p instanceof u||p instanceof s&&p.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!nn[n.key])}function un(e,t,n){le(),f.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(i,l)=>{ln(!!(n!=null&&n.isTextInput),i,l)&&e(he())};return q.add(r),()=>{q.delete(r)}},t)}function cn(e){if(!e.isConnected)return;const t=m(e);if(an()==="virtual"){let n=A(t);Xe(()=>{const r=A(t);(r===n||r===t.body)&&e.isConnected&&G(e)})}else G(e)}function lt(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const l=f.useCallback(c=>{if($(c)===c.currentTarget)return r&&r(c),i&&i(!1),!0},[r,i]),u=et(l),s=f.useCallback(c=>{let p=$(c);const y=m(p),g=y?A(y):A();p===c.currentTarget&&p===g&&(n&&n(c),i&&i(!0),u(c))},[i,n,u]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?l:void 0}}}function Ve(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function fn(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Ve(e.onKeyDown),onKeyUp:Ve(e.onKeyUp)}}}let ut=z.createContext(null);function dn(e){let t=f.useContext(ut)||{};qe(t,e);let{ref:n,...r}=t;return r}const Fn=z.forwardRef(function(t,n){let{children:r,...i}=t,l=vt(n),u={...i,ref:l};return z.createElement(ut.Provider,{value:u},r)});function Mn(e,t){let{focusProps:n}=lt(e),{keyboardProps:r}=fn(e),i=ie(n,r),l=dn(t),u=e.isDisabled?{}:l,s=f.useRef(e.autoFocus);f.useEffect(()=>{s.current&&t.current&&cn(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:ie({...i,tabIndex:c},u)}}function bn(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,l=f.useRef({isFocusWithin:!1}),{addGlobalListener:u,removeAllGlobalListeners:s}=Le(),c=f.useCallback(g=>{P(g.currentTarget,$(g))&&l.current.isFocusWithin&&!P(g.currentTarget,g.relatedTarget)&&(l.current.isFocusWithin=!1,s(),n&&n(g),i&&i(!1))},[n,i,l,s]),p=et(c),y=f.useCallback(g=>{if(!P(g.currentTarget,$(g)))return;let k=$(g);const L=m(k),K=A(L);if(!l.current.isFocusWithin&&K===k){r&&r(g),i&&i(!0),l.current.isFocusWithin=!0,p(g);let h=g.currentTarget;u(L,"focus",T=>{let w=$(T);if(l.current.isFocusWithin&&!P(h,w)){let x=new L.defaultView.FocusEvent("blur",{relatedTarget:w});Ze(x,h);let H=ke(x);c(H)}},{capture:!0})}},[r,i,p,u,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:y,onBlur:c}}}let me=!1,re=0;function pn(){me=!0,setTimeout(()=>{me=!1},50)}function Be(e){e.pointerType==="touch"&&pn()}function $n(){if(!(typeof document>"u"))return re===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",Be),re++,()=>{re--,!(re>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",Be)}}function An(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[l,u]=f.useState(!1),s=f.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;f.useEffect($n,[]);let{addGlobalListener:c,removeAllGlobalListeners:p}=Le(),{hoverProps:y,triggerHoverEnd:g}=f.useMemo(()=>{let k=(h,T)=>{if(s.pointerType=T,i||T==="touch"||s.isHovered||!P(h.currentTarget,$(h)))return;s.isHovered=!0;let w=h.currentTarget;s.target=w,c(m($(h)),"pointerover",x=>{s.isHovered&&s.target&&!P(s.target,$(x))&&L(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:w,pointerType:T}),n&&n(!0),u(!0)},L=(h,T)=>{let w=s.target;s.pointerType="",s.target=null,!(T==="touch"||!s.isHovered||!w)&&(s.isHovered=!1,p(),r&&r({type:"hoverend",target:w,pointerType:T}),n&&n(!1),u(!1))},K={};return typeof PointerEvent<"u"&&(K.onPointerEnter=h=>{me&&h.pointerType==="mouse"||k(h,h.pointerType)},K.onPointerLeave=h=>{!i&&P(h.currentTarget,$(h))&&L(h,h.pointerType)}),{hoverProps:K,triggerHoverEnd:L}},[t,n,r,i,s,c,p]);return f.useEffect(()=>{i&&g({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:y,isHovered:l}}function Dn(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=f.useRef({isFocused:!1,isFocusVisible:t||he()}),[l,u]=f.useState(!1),[s,c]=f.useState(()=>i.current.isFocused&&i.current.isFocusVisible),p=f.useCallback(()=>
7c(i.current.isFocused&&i.current.isFocusVisible),[]),y=f.useCallback(L=>{i.current.isFocused=L,i.current.isFocusVisible=he(),u(L),p()},[p]);un(L=>{i.current.isFocusVisible=L,p()},[n,l],{enabled:l,isTextInput:n});let{focusProps:g}=lt({isDisabled:r,onFocusChange:y}),{focusWithinProps:k}=bn({isDisabled:!r,onFocusWithinChange:y});return{isFocused:l,isFocusVisible:s,focusProps:r?k:g}}export{Fn as $,Le as A,m as B,G as C,Tn as D,xn as E,D as F,Cn as G,Pn as H,En as I,Ye as J,Te as K,tt as L,qe as M,Bt as N,Ct as O,mn as a,bn as b,ee as c,Sn as d,Mn as e,$ as f,ze as g,wn as h,Ln as i,An as j,Dn as k,an as l,hn as m,cn as n,kn as o,we as p,A as q,he as r,S as s,P as t,Ft as u,V as v,fn as w,lt as x,ut as y,Mt as z};
8//# sourceMappingURL=useFocusRing-ZWDRAqPW.js.map

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.