PageSourceSearch

https://channel-affinity-internal-3a96e02c2095.herokuapp.com/static/js/useFloatingOverlay.DKo8T0mQ.js

js channel-affinity-internal-3a96e02c2095.herokuapp.com collected 2026-10-03 08:15:48 UTC 42,086 bytes, 1 lines download raw bytes

vendor: 4,102 bytes, line 1
1import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{_ as n}from"./emotion-styled.browser.esm.DmHEQgFq.js";import{t as r}from"./react-dom.DmpKrvBr.js";var i=e(t(),1);function a(){return typeof window<`u`}function o(e){return l(e)?(e.nodeName||``).toLowerCase():`#document`}function s(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function c(e){return((l(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function l(e){return a()?e instanceof Node||e instanceof s(e).Node:!1}function u(e){return a()?e instanceof Element||e instanceof s(e).Element:!1}function d(e){return a()?e instanceof HTMLElement||e instanceof s(e).HTMLElement:!1}function f(e){return!a()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof s(e).ShadowRoot}function p(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=w(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function m(e){return/^(table|td|th)$/.test(o(e))}function h(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var g=/transform|translate|scale|rotate|perspective|filter/,_=/paint|layout|strict|content/,v=e=>!!e&&e!==`none`,y;function b(e){let t=u(e)?w(e):e;return v(t.transform)||v(t.translate)||v(t.scale)||v(t.rotate)||v(t.perspective)||!S()&&(v(t.backdropFilter)||v(t.filter))||g.test(t.willChange||``)||_.test(t.contain||``)}function x(e){let t=E(e);for(;d(t)&&!C(t);){if(b(t))return t;if(h(t))return null;t=E(t)}return null}function S(){return y??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),y}function C(e){return/^(html|body|#document)$/.test(o(e))}function w(e){return s(e).getComputedStyle(e)}function T(e){return u(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E(e){if(o(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||f(e)&&e.host||c(e);return f(t)?t.host:t}function D(e){let t=E(e);return C(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&p(t)?t:D(t)}function O(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=D(e),i=r===e.ownerDocument?.body,a=s(r);if(i){let e=k(a);return t.concat(a,a.visualViewport||[],p(r)?r:[],e&&n?O(e):[])}else return t.concat(r,O(r,[],n))}function k(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var A=[`top`,`right`,`bottom`,`left`],j=Math.min,M=Math.max,N=Math.round,P=Math.floor,F=e=>({x:e,y:e}),I={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ee(e,t,n){return M(e,j(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function V(e){return e===`y`?`height`:`width`}function H(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function te(e){return B(H(e))}function ne(e,t,n){n===void 0&&(n=!1);let r=z(e),i=te(e),a=V(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=de(o)),[o,de(o)]}function re(e){let t=de(e);return[ie(e),t,ie(t)]}function ie(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ae=[`left`,`right`],oe=[`right`,`left`],se=[`top`,`bottom`],ce=[`bottom`,`top`];function le(e,t,n){switch(e){case`top`:case`bottom`:return n?t?oe:ae:t?ae:oe;case`left`:case`right`:return t?se:ce;default:return[]}}function ue(e,t,n,r){let i=z(e),a=le(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ie)))),a}function de(e){let t=R(e);return I[t]+e.slice(t.length)}function fe(e){return{top:0,right:0,bottom:0,left:0,...e}}function pe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:fe(e)}function me(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var he=[`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
1(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] *)`].join(`,`),ge=typeof Element>`u`,U=ge?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_e=!ge&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},ve=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):ve(e.parentNode))},ye=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},be=function(e,t,n){if(ve(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(he));return t&&U.call(e,he)&&r.unshift(e),r=r.filter(n),r},xe=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!ve(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=xe(o.length?o:a.children,!0,n);
1n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{U.call(a,he)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!ve(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=xe(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Se=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Ce=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ye(e))&&!Se(e)?0:e.tabIndex},we=function(e,t){var n=Ce(e);return n<0&&t&&!Se(e)?0:n},Te=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return e.tagName===`INPUT`},De=function(e){return Ee(e)&&e.type===`hidden`},Oe=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},ke=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||_e(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){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`,e.message),!1}var i=ke(r,e.form);return!i||i===e},je=function(e){return Ee(e)&&e.type===`radio`},Me=function(e){return je(e)&&!Ae(e)},Ne=function(e){var t=e&&_e(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=_e(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Pe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Fe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=U.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(U.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=_e(e);if(o&&!o.shadowRoot&&r(o)===!0)return Pe(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Ne(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Pe(e);return!1},Ie=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 r=t.children.item(n);if(r.tagName===`LEGEND`)return U.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Le=function(e,t){return!(t.disabled||De(t)||Fe(t,e)||Oe(t)||Ie(t))},Re=function(e,t){return!(Me(t)||Ce(t)<0||!Le(e,t))},ze=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Be=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=we(a,i),s=i?Be(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Te).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ve=function(e,t){return t||={},Be(t.getShadowRoot?xe([e],t.includeContainer,{filter:Re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ze}):be(e,t.includeContainer,Re.bind(null,t)))},He=function(e,t){return t||={},t.getShadowRoot?xe([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):be(e,t.includeContainer,Le.bind(null,t))},Ue=function(e,t){if(t||={},!e)throw Error(`No node provided`);return U.call(e,he)===!1?!1:Re(t,e)};function We(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ge(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function Ke(){return/apple/i.test(navigator.vendor)}function qe(){let e=/android/i;return e.test(We())||e.test(Ge())}function Je(){return Ge().includes(`jsdom/`)}var Ye=`data-floating-ui-focusable`,Xe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function W(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function G(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;
1if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ze(e){return`composedPath`in e?e.composedPath()[0]:e.target}function K(e){return e?.ownerDocument||document}function Qe(e){return d(e)&&e.matches(Xe)}function $e(e){return e?e.getAttribute(`role`)===`combobox`&&Qe(e):!1}function et(e){return e?e.hasAttribute(Ye)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function tt(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...tt(e,t.id,n)])}function nt(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function rt(e){e.preventDefault(),e.stopPropagation()}function it(e){return e.mozInputSource===0&&e.isTrusted?!0:qe()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function at(e){return Je()?!1:!qe()&&e.width===0&&e.height===0||qe()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}var q=typeof document<`u`?i.useLayoutEffect:function(){},ot={...i};function st(e){let t=i.useRef(e);return q(()=>{t.current=e}),t}var ct=ot.useInsertionEffect||(e=>e());function lt(e){let t=i.useRef(()=>{});return ct(()=>{t.current=e}),i.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var ut=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function dt(e,t){let n=Ve(e,ut()),r=n.length;if(r===0)return;let i=W(K(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ft(e){return dt(K(e).body,1)||e}function pt(e){return dt(K(e).body,-1)||e}function mt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!G(n,r)}function ht(e){Ve(e,ut()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function gt(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var J=e(n(),1),_t=e(r(),1);function vt(e,t,n){let{reference:r,floating:i}=e,a=H(t),o=te(t),s=V(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(z(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function yt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=L(t,e),p=pe(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=me(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=me(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var bt=50,xt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<bt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}
vendor: 4,479 bytes, line 1
1):x.rects),{x:u,y:d}=vt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},St=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=H(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[de(o)]:re(o)),x=p!==`none`;!d&&x&&b.push(...ue(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ne(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==H(t))||T.every(e=>H(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=H(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wt(e){return A.some(t=>e[t]>=0)}var Tt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ct(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wt(e)}}}case`escaped`:{let e=Ct(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wt(e)}}}default:return{}}}}},Et=new Set([`left`,`top`]);async function Dt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=H(n)===`y`,l=Et.has(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ot=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Dt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=H(R(i)),p=B(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ee(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ee(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},At=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=L(e,t),u=await o.detectOverflow(t,l),d=R(i),f=z(i),p=H(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=j(h-u[g],v),x=j(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=M(u.left,0),t=M(u.right,0),n=M(u.top,0),r=M(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:M(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:M(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function jt(e){let t=w(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=d(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=N(n)!==a||N(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Mt(e){return u(e)?e:e.contextElement}function Y(e){let t=Mt(e);
vendor: 3,921 bytes, line 1
1if(!d(t))return F(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=jt(t),o=(a?N(n.width):n.width)/r,s=(a?N(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nt=F(0);function Pt(e){let t=s(e);return!S()||!t.visualViewport?Nt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ft(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==s(e)?!1:t}function X(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Mt(e),o=F(1);t&&(r?u(r)&&(o=Y(r)):o=Y(e));let c=Ft(a,n,r)?Pt(a):F(0),l=(i.left+c.x)/o.x,d=(i.top+c.y)/o.y,f=i.width/o.x,p=i.height/o.y;if(a){let e=s(a),t=r&&u(r)?s(r):r,n=e,i=k(n);for(;i&&r&&t!==n;){let e=Y(i),t=i.getBoundingClientRect(),r=w(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,d*=e.y,f*=e.x,p*=e.y,l+=a,d+=o,n=s(i),i=k(n)}}return me({width:f,height:p,x:l,y:d})}function It(e,t){let n=T(e).scrollLeft;return t?t.left+n:X(c(e)).left+n}function Lt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}function Rt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,s=c(r),l=t?h(t.floating):!1;if(r===s||l&&a)return n;let u={scrollLeft:0,scrollTop:0},f=F(1),m=F(0),g=d(r);if((g||!g&&!a)&&((o(r)!==`body`||p(s))&&(u=T(r)),g)){let e=X(r);f=Y(r),m.x=e.x+r.clientLeft,m.y=e.y+r.clientTop}let _=s&&!g&&!a?Lt(s,u):F(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+m.x+_.x,y:n.y*f.y-u.scrollTop*f.y+m.y+_.y}}function zt(e){return Array.from(e.getClientRects())}function Bt(e){let t=c(e),n=T(e),r=e.ownerDocument.body,i=M(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=M(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+It(e),s=-n.scrollTop;return w(r).direction===`rtl`&&(o+=M(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Vt=25;function Ht(e,t){let n=s(e),r=c(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,u=0;if(i){a=i.width,o=i.height;let e=S();(!e||e&&t===`fixed`)&&(l=i.offsetLeft,u=i.offsetTop)}let d=It(r);if(d<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Vt&&(a-=o)}else d<=Vt&&(a+=d);return{width:a,height:o,x:l,y:u}}function Ut(e,t){let n=X(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=d(e)?Y(e):F(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Wt(e,t,n){let r;if(t===`viewport`)r=Ht(e,n);else if(t===`document`)r=Bt(c(e));else if(u(t))r=Ut(t,n);else{let n=Pt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return me(r)}function Gt(e,t){let n=E(e);return n===t||!u(n)||C(n)?!1:w(n).position===`fixed`||Gt(n,t)}function Kt(e,t){let n=t.get(e);if(n)return n;let r=O(e,[],!1).filter(e=>u(e)&&o(e)!==`body`),i=null,a=w(e).position===`fixed`,s=a?E(e):e;for(;u(s)&&!C(s);){let t=w(s),n=b(s);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||p(s)&&!n&&Gt(e,s))?r=r.filter(e=>e!==s):i=t,s=E(s)}return t.set(e,r),r}function qt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?h(t)?[]:Kt(t,this._c):[].concat(n),r],o=Wt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Wt(t,a[e],i);s=M(n.top,s),c=j(n.right,c),l=j(n.bottom,l),u=M(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jt(e){let{width:t,height:n}=jt(e);return{width:t,height:n}}function Yt(e,t,n){let r=d(t),i=c(t),a=n===`fixed`,s=X(e,!0,a,t),l={scrollLeft:0,scrollTop:0},u=F(0);function f(){u.x=It(i)}if(r||!r&&!a)if((o(t)!==`body`||p(i))&&(l=T(t)),r){let e=X(t,!0,a,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else i&&f();a&&!r&&i&&f();let m=i&&!r&&!a?Lt(i,l):F(0);
vendor: 4,151 bytes, line 1
1return{x:s.left+l.scrollLeft-u.x-m.x,y:s.top+l.scrollTop-u.y-m.y,width:s.width,height:s.height}}function Xt(e){return w(e).position===`static`}function Zt(e,t){if(!d(e)||w(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return c(e)===n&&(n=n.ownerDocument.body),n}function Qt(e,t){let n=s(e);if(h(e))return n;if(!d(e)){let t=E(e);for(;t&&!C(t);){if(u(t)&&!Xt(t))return t;t=E(t)}return n}let r=Zt(e,t);for(;r&&m(r)&&Xt(r);)r=Zt(r,t);return r&&C(r)&&Xt(r)&&!b(r)?n:r||x(e)||n}var $t=async function(e){let t=this.getOffsetParent||Qt,n=this.getDimensions,r=await n(e.floating);return{reference:Yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function en(e){return w(e).direction===`rtl`}var tn={convertOffsetParentRelativeRectToViewportRelativeRect:Rt,getDocumentElement:c,getClippingRect:qt,getOffsetParent:Qt,getElementRects:$t,getClientRects:zt,getDimensions:Jt,getScale:Y,isElement:u,isRTL:en};function nn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rn(e,t){let n=null,r,i=c(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=P(d),h=P(i.clientWidth-(u+f)),g=P(i.clientHeight-(d+p)),_=P(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:M(0,j(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!nn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function an(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Mt(e),u=i||a?[...l?O(l):[],...t?O(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?rn(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?X(e):null;c&&g();function g(){let t=X(e);h&&!nn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var on=Ot,sn=kt,cn=St,ln=At,un=Tt,dn=(e,t,n)=>{let r=new Map,i={platform:tn,...n},a={...i.platform,_c:r};return xt(e,t,{...i,platform:a})},fn=typeof document<`u`?i.useLayoutEffect:function(){};function pn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){let n=mn(e);return Math.round(t*n)/n}function gn(e){let t=i.useRef(e);return fn(()=>{t.current=e}),t}function _n(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);pn(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),E=l!=null,D=gn(l),O=gn(a),k=gn(u),A=i.useCallback(()=>
1{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),dn(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!pn(T.current,t)&&(T.current=t,_t.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);fn(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=i.useRef(!1);fn(()=>(j.current=!0,()=>{j.current=!1}),[]),fn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=i.useMemo(()=>({reference:x,floating:S}),[x,S]),P=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=hn(N.floating,d.x),r=hn(N.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mn(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,N.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var vn=(e,t)=>{let n=on(e);return{name:n.name,fn:n.fn,options:[e,t]}},yn=(e,t)=>{let n=sn(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{let n=cn(e);return{name:n.name,fn:n.fn,options:[e,t]}},xn=(e,t)=>{let n=ln(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sn=(e,t)=>{let n=un(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cn=`ArrowLeft`,wn=`ArrowRight`,Tn=`ArrowUp`,En=`ArrowDown`,Dn=[Cn,wn],On=[Tn,En];[...Dn,...On];var kn={...i},An=!1,jn=0,Mn=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+jn++;function Nn(){let[e,t]=i.useState(()=>An?Mn():void 0);return q(()=>{e??t(Mn())},[]),i.useEffect(()=>{An=!0},[]),e}var Pn=kn.useId||Nn;function Fn(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var In=i.createContext(null),Ln=i.createContext(null),Rn=()=>i.useContext(In)?.id||null,zn=()=>i.useContext(Ln);function Bn(e){return`data-floating-ui-`+e}function Vn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Hn=0;function Z(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Hn);let a=()=>e?.focus({preventScroll:n});i?a():Hn=requestAnimationFrame(a)}function Un(e){return e?.ownerDocument||document}var Q={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Wn(e){return e===`inert`?Q.inert:e===`aria-hidden`?Q[`aria-hidden`]:Q.none}var Gn=new WeakSet,Kn={},qn=0,Jn=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function Yn(e){return e?f(e)?e.host:Yn(e.parentNode):null}var Xn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Yn(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Zn(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,s=Xn(t,e),c=new Set,l=new Set(s),u=[];Kn[i]||(Kn[i]=new WeakMap);let d=Kn[i];s.forEach(f),p(t),c.clear();function f(e){!e||c.has(e)||(c.add(e),e.parentNode&&f(e.parentNode))}function p(e){!e||l.has(e)||[].forEach.call(e.children,e=>{if(o(e)!==`script`)if(c.has(e))p(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Wn(a),o=(r.get(e)||0)+1,s=(d.get(e)||0)+1;r.set(e,o),d.set(e,s),u.push(e),o===1&&n&&Gn.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return qn++,()=>{u.forEach(e=>{let t=Wn(a),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Gn.has(e)&&a&&e.removeAttribute(a),Gn.delete(e)),r||e.removeAttribute(i)}),qn--,qn||(Q.inert=new WeakMap,Q[`aria-hidden`]=new WeakMap,Q.none=new WeakMap,Gn=new WeakSet,Kn={})}}function Qn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Un(e[0]).body;return Zn(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var $n={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},er=i.forwardRef(function(e,t){let[n,r]=i.useState();q(()=>{Ke()&&r(`button`)},[]);let a={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[Bn(`focus-guard`)]:``,style:$n};return(0,J.jsx)(`span`,{...e,...a})}),tr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},nr=i.createContext(null),rr=Bn(`portal`);function ir(e){e===void 0&&(e={});let{id:t,root:n}=e,r=Pn(),a=or(),[o,s]=i.useState(null),c=i.useRef(null);return q(()=>()=>{o?.remove(),queueMicrotask(()=>{c.current=null})},[o]),q(()=>{if(!r||c.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(rr,``),e.appendChild(n),c.current=n,s(n)},[t,r]),q(()=>{if(n===null||!r||c.current)return;let e=n||a?.portalNode;
1e&&!l(e)&&(e=e.current),e||=document.body;let i=null;t&&(i=document.createElement(`div`),i.id=t,e.appendChild(i));let o=document.createElement(`div`);o.id=r,o.setAttribute(rr,``),e=i||e,e.appendChild(o),c.current=o,s(o)},[t,n,r,a]),o}function ar(e){let{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,o=ir({id:n,root:r}),[s,c]=i.useState(null),l=i.useRef(null),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),p=s?.modal,m=s?.open,h=!!s&&!s.modal&&s.open&&a&&!!(r||o);return i.useEffect(()=>{if(!o||!a||p)return;function e(e){o&&mt(e)&&(e.type===`focusin`?gt:ht)(o)}return o.addEventListener(`focusin`,e,!0),o.addEventListener(`focusout`,e,!0),()=>{o.removeEventListener(`focusin`,e,!0),o.removeEventListener(`focusout`,e,!0)}},[o,a,p]),i.useEffect(()=>{o&&(m||gt(o))},[m,o]),(0,J.jsxs)(nr.Provider,{value:i.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:o,setFocusManagerState:c}),[a,o]),children:[h&&o&&(0,J.jsx)(er,{"data-type":`outside`,ref:l,onFocus:e=>{if(mt(e,o)){var t;(t=d.current)==null||t.focus()}else pt(s?s.domReference:null)?.focus()}}),h&&o&&(0,J.jsx)(`span`,{"aria-owns":o.id,style:tr}),o&&_t.createPortal(t,o),h&&o&&(0,J.jsx)(er,{"data-type":`outside`,ref:u,onFocus:e=>{if(mt(e,o)){var t;(t=f.current)==null||t.focus()}else ft(s?s.domReference:null)?.focus(),s!=null&&s.closeOnFocusOut&&s?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var or=()=>i.useContext(nr);function sr(e){return i.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var cr=20,$=[];function lr(){$=$.filter(e=>e.deref()?.isConnected)}function ur(e){lr(),e&&o(e)!==`body`&&($.push(new WeakRef(e)),$.length>cr&&($=$.slice(-20)))}function dr(){return lr(),$[$.length-1]?.deref()}function fr(e){let t=ut();return Ue(e,t)?e:Ve(e,t)[0]||e}function pr(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=ut(),i=He(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Ue(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var mr=i.forwardRef(function(e,t){return(0,J.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:$n})});
1function hr(e){let{context:t,children:n,disabled:r=!1,order:a=[`content`],guards:o=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0,outsideElementsInert:m=!1,getInsideElements:h=()=>[]}=e,{open:g,onOpenChange:_,events:v,dataRef:y,elements:{domReference:b,floating:x}}=t,S=lt(()=>y.current.floatingContext?.nodeId),C=lt(h),w=typeof s==`number`&&s<0,T=$e(b)&&w,E=Jn(),D=E?o:!0,O=!D||E&&m,k=st(a),A=st(s),j=st(c),M=zn(),N=or(),P=i.useRef(null),F=i.useRef(null),I=i.useRef(!1),ee=i.useRef(!1),L=i.useRef(-1),R=i.useRef(-1),z=N!=null,B=et(x),V=lt(function(e){return e===void 0&&(e=B),e?Ve(e,ut()):[]}),H=lt(e=>{let t=V(e);return k.current.map(e=>b&&e===`reference`?b:B&&e===`floating`?B:t).filter(Boolean).flat()});i.useEffect(()=>{if(r||!u)return;function e(e){if(e.key===`Tab`){G(B,W(K(B)))&&V().length===0&&!T&&rt(e);let t=H(),n=Ze(e);k.current[0]===`reference`&&n===b&&(rt(e),e.shiftKey?Z(t[t.length-1]):Z(t[1])),k.current[1]===`floating`&&n===B&&e.shiftKey&&(rt(e),Z(t[0]))}}let t=K(B);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,b,B,u,k,T,V,H]),i.useEffect(()=>{if(r||!x)return;function e(e){let t=Ze(e),n=V().indexOf(t);n!==-1&&(L.current=n)}return x.addEventListener(`focusin`,e),()=>{x.removeEventListener(`focusin`,e)}},[r,x,V]),i.useEffect(()=>{if(r||!p)return;function e(){ee.current=!0,setTimeout(()=>{ee.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Ze(e);queueMicrotask(()=>{let i=S(),a=!(G(b,t)||G(x,t)||G(t,x)||G(N?.portalNode,t)||t!=null&&t.hasAttribute(Bn(`focus-guard`))||M&&(tt(M.nodesRef.current,i).find(e=>G(e.context?.elements.floating,t)||G(e.context?.elements.domReference,t))||nt(M.nodesRef.current,i).find(e=>[e.context?.elements.floating,et(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===b&&B&&pr(B,k),l&&n!==b&&!(r!=null&&r.isConnected)&&W(K(B))===K(B).body){d(B)&&B.focus();let e=L.current,t=V(),n=t[e]||t[t.length-1]||B;d(n)&&n.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(T||!u)&&t&&a&&!ee.current&&t!==dr()&&(I.current=!0,_(!1,e,`focus-out`))})}let n=!!(!M&&N);function i(){Vn(R),y.current.insideReactTree=!0,R.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(x&&d(b))return b.addEventListener(`focusout`,t),b.addEventListener(`pointerdown`,e),x.addEventListener(`focusout`,t),n&&x.addEventListener(`focusout`,i,!0),()=>{b.removeEventListener(`focusout`,t),b.removeEventListener(`pointerdown`,e),x.removeEventListener(`focusout`,t),n&&x.removeEventListener(`focusout`,i,!0)}},[r,b,x,B,u,M,N,_,p,l,V,T,S,k,y]);let te=i.useRef(null),ne=i.useRef(null),re=sr([te,N?.beforeInsideRef]),ie=sr([ne,N?.afterInsideRef]);i.useEffect(()=>{var e,t;if(r||!x)return;let n=Array.from((N==null||(e=N.portalNode)==null?void 0:e.querySelectorAll(`[`+Bn(`portal`)+`]`))||[]),i=[x,(t=(M?nt(M.nodesRef.current,S()):[]).find(e=>$e(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,...n,...C(),P.current,F.current,te.current,ne.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,k.current.includes(`reference`)||T?b:null].filter(e=>e!=null),a=u||T?Qn(i,!O,O):Qn(i);return()=>{a()}},[r,b,x,u,k,N,T,D,O,M,S,C]),q(()=>{if(r||!d(B))return;let e=W(K(B));queueMicrotask(()=>{let t=H(B),n=A.current,r=(typeof n==`number`?t[n]:n.current)||B,i=G(B,e);!w&&!i&&g&&Z(r,{preventScroll:r===B})})},[r,g,B,w,H,A]),q(()=>{if(r||!B)return;let e=K(B);ur(W(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(I.current=!0),t===`outside-press`)if(r)I.current=!1;else if(it(n)||at(n))I.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?I.current=!1:I.current=!0}}v.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,$n),z&&b&&b.insertAdjacentElement(`afterend`,n);function i(){if(typeof j.current==`boolean`){let e=b||dr();return e&&e.isConnected?e:n}return j.current.current||n}return()=>{v.off(`openchange`,t);let r=W(e),a=G(x,r)||M&&tt(M.nodesRef.current,S(),!1).some(e=>G(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>
1{let t=fr(o);j.current&&!I.current&&d(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,x,B,j,y,v,M,z,b,S]),i.useEffect(()=>(queueMicrotask(()=>{I.current=!1}),()=>{queueMicrotask(lr)}),[r]),q(()=>{if(!r&&N)return N.setFocusManagerState({modal:u,closeOnFocusOut:p,open:g,onOpenChange:_,domReference:b}),()=>{N.setFocusManagerState(null)}},[r,N,u,g,_,p,b]),q(()=>{r||B&&pr(B,k)},[r,B,k]);function ae(e){return r||!f||!u?null:(0,J.jsx)(mr,{ref:e===`start`?P:F,onClick:e=>_(!1,e.nativeEvent),children:typeof f==`string`?f:`Dismiss`})}let oe=!r&&D&&(u?!T:!0)&&(z||u);return(0,J.jsxs)(J.Fragment,{children:[oe&&(0,J.jsx)(er,{"data-type":`inside`,ref:re,onFocus:e=>{if(u){let e=H();Z(a[0]===`reference`?e[0]:e[e.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(I.current=!1,mt(e,N.portalNode))ft(b)?.focus();else{var t;(t=N.beforeOutsideRef.current)==null||t.focus()}}}),!T&&ae(`start`),n,ae(`end`),oe&&(0,J.jsx)(er,{"data-type":`inside`,ref:ie,onFocus:e=>{if(u)Z(H()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(p&&(I.current=!0),mt(e,N.portalNode))pt(b)?.focus();else{var t;(t=N.afterOutsideRef.current)==null||t.focus()}}})]})}function gr(e){let{open:t=!1,onOpenChange:n,elements:r}=e,a=Pn(),o=i.useRef({}),[s]=i.useState(()=>Fn()),c=Rn()!=null,[l,u]=i.useState(r.reference),d=lt((e,t,r)=>{o.current.openEvent=e?t:void 0,s.emit(`openchange`,{open:e,event:t,reason:r,nested:c}),n?.(e,t,r)}),f=i.useMemo(()=>({setPositionReference:u}),[]),p=i.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return i.useMemo(()=>({dataRef:o,open:t,onOpenChange:d,elements:p,events:s,floatingId:a,refs:f}),[t,d,p,s,a,f])}function _r(e){e===void 0&&(e={});let{nodeId:t}=e,n=gr({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,s]=i.useState(null),[c,l]=i.useState(null),d=a?.domReference||o,f=i.useRef(null),p=zn();q(()=>{d&&(f.current=d)},[d]);let m=_n({...e,elements:{...a,...c&&{reference:c}}}),h=i.useCallback(e=>{let t=u(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),m.refs.setReference(t)},[m.refs]),g=i.useCallback(e=>{(u(e)||e===null)&&(f.current=e,s(e)),(u(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!u(e))&&m.refs.setReference(e)},[m.refs]),_=i.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=i.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=i.useMemo(()=>({...m,...r,refs:_,elements:v,nodeId:t}),[m,_,v,t,r]);return q(()=>{r.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),i.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}var vr=8,yr=[];function br(e){let{open:t,onOpenChange:n,placement:r=`bottom-start`,offsetPx:i=0,flipOptions:a,shiftOptions:o,matchTriggerWidth:s,extraMiddleware:c=yr}=e;return _r({open:t,onOpenChange:n,placement:r,strategy:`fixed`,whileElementsMounted:an,middleware:[vn(i),a!==!1&&bn(typeof a==`object`?a:void 0),o!==!1&&yn(typeof o==`object`?o:{padding:vr}),s&&xn({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}}),...c].filter(Boolean)})}export{an as a,Sn as i,hr as n,ar as r,br as t};

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.