PageSourceSearch

https://myhairstyle.app/assets/getPseudoElementBounds-DKtdtjGP.js

js myhairstyle.app collected 2026-10-04 11:27:01 UTC 37,923 bytes, 1 lines download raw bytes

vendor: 4,100 bytes, line 1
1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,n,r}from"./framework-DJH1pfSr.js";import{A as i,C as a,D as o,E as s,I as c,L as l,M as u,O as d,P as f,R as p,S as m,T as h,b as g,c as _,g as v,j as y,k as b,m as x,r as S,v as C,w,x as T,y as E}from"./useRenderElement-CatmHi4d.js";import{A as D,O,U as k,V as A,_ as j,b as M,j as N,k as P,l as ee,o as F,t as te,v as ne,w as re,y as ie}from"./createBaseUIEventDetails-BVvLmedW.js";import{At as I,Ct as L,Dt as R,Et as z,Ft as B,I as ae,M as oe,Nt as se,Ot as V,Pt as ce,Rt as H,St as U,Tt as W,V as le,_t as G,at as ue,bt as de,ct as K,dt as fe,ft as q,gt as J,ht as Y,it as pe,j as me,jt as he,kt as X,lt as ge,mt as Z,nt as _e,ot as ve,p as ye,pt as Q,rt as be,st as xe,ut as Se,v as Ce,vt as we,wt as Te,xt as Ee,yt as De}from"./useOpenInteractionType-BU1GNlNn.js";var $=e(t(),1);function Oe(e,t,n){let{reference:r,floating:i}=e,a=z(t),o=G(t),s=De(o),c=W(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(J(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 ke(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}=Z(t,e),p=Te(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=X(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=X(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 Ae=50,je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ke},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oe(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<Ae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Me=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}=Z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=W(r),_=z(o),v=W(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[L(o)]:de(o)),x=p!==`none`;!d&&x&&b.push(...U(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=we(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`&&_!==z(t))||T.every(e=>z(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)=>
vendor: 4,375 bytes, line 1
1e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=z(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 Ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return he.some(t=>e[t]>=0)}var Fe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Z(e,t);switch(i){case`referenceHidden`:{let e=Ne(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case`escaped`:{let e=Ne(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},Ie=new Set([`left`,`top`]);async function Le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=W(n),s=J(n),c=z(n)===`y`,l=Ie.has(o)?-1:1,u=a&&c?-1:1,d=Z(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 Re=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 Le(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}}}}},ze=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}=Z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=z(W(i)),p=Ee(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=q(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=q(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}}}}}},Be=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Z(e,t),u={x:n,y:r},d=z(i),f=Ee(d),p=u[f],m=u[d],h=Z(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ie.has(W(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ve=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}=Z(e,t),u=await o.detectOverflow(t,l),d=W(i),f=J(i),p=z(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=V(h-u[g],v),x=V(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=R(u.left,0),t=R(u.right,0),n=R(u.top,0),r=R(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:R(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:R(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 He(e){let t=g(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=I(n)!==a||I(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ue(e){return i(e)?e:e.contextElement}function We(e){let t=Ue(e);if(!y(t))return Q(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=He(t),o=(a?I(n.width):n.width)/r,s=(a?I(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ge=Q(0);function Ke(e){let t=d(e);
vendor: 5,679 bytes, line 1
1return!p()||!t.visualViewport?Ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==d(e)?!1:t}function Je(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=Ue(e),c=Q(1);t&&(r?i(r)&&(c=We(r)):c=We(e));let l=qe(s,n,r)?Ke(s):Q(0),u=(o.left+l.x)/c.x,f=(o.top+l.y)/c.y,p=o.width/c.x,m=o.height/c.y;if(s){let e=d(s),t=r&&i(r)?d(r):r,n=e,o=a(n);for(;o&&r&&t!==n;){let e=We(o),t=o.getBoundingClientRect(),r=g(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,f*=e.y,p*=e.x,m*=e.y,u+=i,f+=s,n=d(o),o=a(n)}}return X({width:p,height:m,x:u,y:f})}function Ye(e,t){let n=h(e).scrollLeft;return t?t.left+n:Je(m(e)).left+n}function Xe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ye(e,n),y:n.top+t.scrollTop}}function Ze(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=m(r),s=t?l(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Q(1),d=Q(0),p=y(r);if((p||!p&&!a)&&((w(r)!==`body`||f(o))&&(c=h(r)),p)){let e=Je(r);u=We(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let g=o&&!p&&!a?Xe(o,c):Q(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-c.scrollTop*u.y+d.y+g.y}}function Qe(e){return Array.from(e.getClientRects())}function $e(e){let t=m(e),n=h(e),r=e.ownerDocument.body,i=R(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=R(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ye(e),s=-n.scrollTop;return g(r).direction===`rtl`&&(o+=R(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var et=25;function tt(e,t){let n=d(e),r=m(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=p();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ye(r);if(l<=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<=et&&(a-=o)}else l<=et&&(a+=l);return{width:a,height:o,x:s,y:c}}function nt(e,t){let n=Je(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y(e)?We(e):Q(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function rt(e,t,n){let r;if(t===`viewport`)r=tt(e,n);else if(t===`document`)r=$e(m(e));else if(i(t))r=nt(t,n);else{let n=Ke(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return X(r)}function it(e,t){let n=o(e);return n===t||!i(n)||u(n)?!1:g(n).position===`fixed`||it(n,t)}function at(e,t){let n=t.get(e);if(n)return n;let r=s(e,[],!1).filter(e=>i(e)&&w(e)!==`body`),a=null,c=g(e).position===`fixed`,l=c?o(e):e;for(;i(l)&&!u(l);){let t=g(l),n=b(l);!n&&t.position===`fixed`&&(a=null),(c?!n&&!a:!n&&t.position===`static`&&a&&(a.position===`absolute`||a.position===`fixed`)||f(l)&&!n&&it(e,l))?r=r.filter(e=>e!==l):a=t,l=o(l)}return t.set(e,r),r}function ot(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?l(t)?[]:at(t,this._c):[].concat(n),r],o=rt(t,a[0],i),s=o.top,c=o.right,u=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=rt(t,a[e],i);s=R(n.top,s),c=V(n.right,c),u=V(n.bottom,u),d=R(n.left,d)}return{width:c-d,height:u-s,x:d,y:s}}function st(e){let{width:t,height:n}=He(e);return{width:t,height:n}}function ct(e,t,n){let r=y(t),i=m(t),a=n===`fixed`,o=Je(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Q(0);function l(){c.x=Ye(i)}if(r||!r&&!a)if((w(t)!==`body`||f(i))&&(s=h(t)),r){let e=Je(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Xe(i,s):Q(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function lt(e){return g(e).position===`static`}function ut(e,t){if(!y(e)||g(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return m(e)===n&&(n=n.ownerDocument.body),n}function dt(e,t){let n=d(e);if(l(e))return n;if(!y(e)){let t=o(e);for(;t&&!u(t);){if(i(t)&&!lt(t))return t;t=o(t)}return n}let r=ut(e,t);for(;r&&c(r)&&lt(r);)r=ut(r,t);return r&&u(r)&&lt(r)&&!b(r)?n:r||T(e)||n}var ft=async function(e){let t=this.getOffsetParent||dt,n=this.getDimensions,r=await n(e.floating);return{reference:ct(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pt(e){return g(e).direction===`rtl`}var mt={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:m,getClippingRect:ot,getOffsetParent:dt,getElementRects:ft,getClientRects:Qe,getDimensions:st,getScale:We,isElement:i,isRTL:pt};function ht(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gt(e,t){let n=null,r,i=m(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=Y(d),h=Y(i.clientWidth-(u+f)),g=Y(i.clientHeight-(d+p)),_=Y(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:R(0,V(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&&!ht(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 _t(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:c=typeof IntersectionObserver==`function`,animationFrame:l=!1}=r,u=Ue(e),d=i||a?[...u?s(u):[],...t?s(t):[]]:[];
vendor: 3,462 bytes, line 1
1d.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let f=u&&c?gt(u,n):null,p=-1,m=null;o&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let h,g=l?Je(e):null;l&&_();function _(){let t=Je(e);g&&!ht(g,t)&&n(),g=t,h=requestAnimationFrame(_)}return n(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),f?.(),(e=m)==null||e.disconnect(),m=null,l&&cancelAnimationFrame(h)}}var vt=Re,yt=ze,bt=Me,xt=Ve,St=Fe,Ct=Be,wt=(e,t,n)=>{let r=new Map,i={platform:mt,...n},a={...i.platform,_c:r};return je(e,t,{...i,platform:a})},Tt=e(n(),1),Et=typeof document<`u`?$.useLayoutEffect:function(){};function Dt(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(!Dt(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)&&!Dt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ot(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kt(e,t){let n=Ot(e);return Math.round(t*n)/n}function At(e){let t=$.useRef(e);return Et(()=>{t.current=e}),t}function jt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=$.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=$.useState(r);Dt(f,r)||p(r);let[m,h]=$.useState(null),[g,_]=$.useState(null),v=$.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=$.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=$.useRef(null),C=$.useRef(null),w=$.useRef(u),T=c!=null,E=At(c),D=At(i),O=At(l),k=$.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),wt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Dt(w.current,t)&&(w.current=t,Tt.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Et(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=$.useRef(!1);Et(()=>(A.current=!0,()=>{A.current=!1}),[]),Et(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=$.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=$.useMemo(()=>({reference:b,floating:x}),[b,x]),N=$.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=kt(M.floating,u.x),r=kt(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ot(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Mt=(e,t)=>{let n=vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nt=(e,t)=>{let n=yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pt=(e,t)=>({fn:Ct(e).fn,options:[e,t]}),Ft=(e,t)=>{let n=bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},It=(e,t)=>
1{let n=xt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lt=(e,t)=>{let n=St(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Rt(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,a=k(),o=me()!=null,s=E(()=>new Ce({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ye,floatingId:a,nested:o,noEmit:!1})).current;return v(()=>{let e={open:t,floatingId:a};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=i(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),s.update(e)},[t,a,r.reference,r.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s.context.noEmit=!1,s}function zt(e={}){let{nodeId:t,externalTree:n}=e,r=Rt(e),a=e.rootContext||r,o={reference:a.useState(`referenceElement`),floating:a.useState(`floatingElement`),domReference:a.useState(`domReferenceElement`)},[s,c]=$.useState(null),l=$.useRef(null),u=oe(n);v(()=>{o.domReference&&(l.current=o.domReference)},[o.domReference]);let d=jt({...e,elements:{...o,...s&&{reference:s}}}),f=$.useCallback(e=>{let t=i(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),d.refs.setReference(t)},[d.refs]),[p,m]=$.useState(null),[h,g]=$.useState(null);a.useSyncedValue(`referenceElement`,p),a.useSyncedValue(`domReferenceElement`,i(p)?p:null),a.useSyncedValue(`floatingElement`,h);let _=$.useCallback(e=>{(i(e)||e===null)&&(l.current=e,m(e)),(i(d.refs.reference.current)||d.refs.reference.current===null||e!==null&&!i(e))&&d.refs.setReference(e)},[d.refs,m]),y=$.useCallback(e=>{g(e),d.refs.setFloating(e)},[d.refs]),b=$.useMemo(()=>({...d.refs,setReference:_,setFloating:y,setPositionReference:f,domReference:l}),[d.refs,_,y,f]),x=$.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),S=a.useState(`open`),C=a.useState(`floatingId`),w=$.useMemo(()=>({...d,dataRef:a.context.dataRef,open:S,onOpenChange:a.setOpen,events:a.context.events,floatingId:C,refs:b,elements:x,nodeId:t,rootStore:a}),[d,b,x,t,a,S,C]);return v(()=>{a.context.dataRef.current.floatingContext=w;let e=u?.nodesRef.current.find(e=>e.id===t);e&&(e.context=w)}),$.useMemo(()=>({...d,context:w,refs:b,elements:x,rootStore:a}),[d,b,x,w,a])}var Bt=`Escape`;function Vt(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Ht(e,t){return Vt(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Ut(e,t,n){return Vt(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Wt(e,t,n){return Vt(t,n?e===P:e===D,e===O)}function Gt(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Bt:Vt(t,n?e===D:e===P,e===N)}function Kt(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:S=void 0,orientation:w=`vertical`,parentOrientation:T,cols:E=1,id:D,resetOnPointerLeave:O=!0,externalTree:k}=t,N=le(ie(i)),P=me(),I=oe(k);v(()=>{o.current.orientation=w},[o,w]);let L=re(a),R=$.useRef(_),z=$.useRef(d??-1),V=$.useRef(null),H=$.useRef(!0),U=C(e=>{l(z.current===-1?null:z.current,e)}),W=$.useRef(U),G=$.useRef(!!i),de=$.useRef(r),q=$.useRef(!1),J=$.useRef(!1),Y=le(S),he=le(r),X=le(d),ge=le(O),Z=C(()=>{function e(e){g?I?.events.emit(`virtualfocus`,e):ae(e,{sync:q.current,preventScroll:!0})}let t=s.current[z.current],n=J.current;t&&e(t),(q.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[z.current]||t;r&&(t||e(r),Q&&(n||!H.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});v(()=>{u&&(r&&i?(z.current=d??-1,R.current&&d!=null&&(J.current=!0,U())):G.current&&(z.current=-1,W.current()))},[u,r,i,d,U]),v(()=>{if(u){if(!r){q.current=!1;return}if(i)if(c==null){if(q.current=!1,X.current!=null)return;if(G.current&&(z.current=-1,Z()),(!de.current||!G.current)&&R.current&&(V.current!=null||R.current===!0&&V.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(z.current=V.current==null||Ut(V.current,w,h)||m?K(s):xe(s),V.current=null,U())};t()}}else Se(s,c)||(z.current=c,Z(),J.current=!1)}},[u,r,i,c,X,m,s,w,h,U,Z,Y]),v(()=>{if(!u||i||!I||g||!G.current)return;let e=I.nodesRef.current,t=e.find(e=>e.id===P)?.context?.elements.floating,n=j(A(i)),r=e.some(e=>e.context&&ne(e.context.elements.floating,n));t&&!r&&H.current&&t.focus({preventScroll:!0})},[u,i,I,P,g]),v(()=>{W.current=U,de.current=r,G.current=!!i}),v(()=>{r||(V.current=null,R.current=_)},[r,_]);let ye=c!=null,Q=$.useMemo(()=>{function e(e){if(!he.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&z.current!==t&&(z.current=t,U(e))}return{onFocus(t){q.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){q.current=!0,J.current=!1,b&&e(t)},onPointerLeave(e){if(!he.current||!H.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(!(!b||s.current.includes(t))&&ge.current&&(ae(null,{sync:!0}),z.current=-1,U(e),!g)){let e=N.current,t=j(A(e));e&&ne(e,t)&&e.focus({preventScroll:!0})}}}},[he,N,b,s,U,ge,g]),Ce=$.useCallback(()=>T??I?.nodesRef.current.find(e=>e.id===P)?.context?.dataRef?.current.orientation,[P,I,T]),we=C(e=>{if(H.current=!1,q.current=!0,e.which===229||!he.current&&e.currentTarget===N.current)return;if(m&&Gt(e.key,w,h,E)){Ht(e.key,Ce())||B(e),n.setOpen(!1,te(ee,e.nativeEvent)),y(a)&&(g?I?.events.emit(`virtualfocus`,a):a.focus());return}let t=z.current,i=K(s,S),o=xe(s,S);if(L||(e.key===`Home`&&(B(e),z.current=i,U(e)),e.key===`End`&&(B(e),z.current=o,U(e))),E>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=_e(t,E,!1),r=n.findIndex(e=>
1e!=null&&!fe(s,e,S)),a=n.reduce((e,t,n)=>t!=null&&!fe(s,t,S)?n:e,-1),c=n[ve({current:n.map(e=>e==null?null:s.current[e])},{event:e,orientation:w,loopFocus:p,rtl:h,cols:E,disabledIndices:ue([...(typeof S==`function`?null:S)||s.current.map((e,t)=>fe(s,t,S)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:pe(z.current>o?i:z.current,t,n,E,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(z.current=c,U(e)),w===`both`)return}if(Ht(e.key,w)){if(B(e),r&&!g&&j(e.currentTarget.ownerDocument)===e.currentTarget){z.current=Ut(e.key,w,h)?i:o,U(e);return}Ut(e.key,w,h)?p?t>=o?f&&t!==s.current.length?z.current=-1:(q.current=!1,z.current=i):z.current=be(s,{startingIndex:t,disabledIndices:S}):z.current=Math.min(o,be(s,{startingIndex:t,disabledIndices:S})):p?t<=i?f&&t!==-1?z.current=s.current.length:(q.current=!1,z.current=o):z.current=be(s,{startingIndex:t,decrement:!0,disabledIndices:S}):z.current=Math.max(i,be(s,{startingIndex:t,decrement:!0,disabledIndices:S})),Se(s,z.current)&&(z.current=-1),U(e)}}),Te=$.useMemo(()=>g&&r&&ye&&{"aria-activedescendant":`${D}-${c}`},[g,r,ye,D,c]),Ee=$.useMemo(()=>({"aria-orientation":w===`both`?void 0:w,...L?{}:Te,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=M(e.nativeEvent);if(t&&!ne(N.current,t))return;B(e),n.setOpen(!1,te(F,e.nativeEvent)),y(a)&&a.focus();return}we(e)},onPointerMove(){H.current=!0}}),[Te,we,N,w,L,n,r,g,a]),De=$.useMemo(()=>{function e(e){_===`auto`&&se(e.nativeEvent)&&(R.current=!g)}function t(e){R.current=_,_===`auto`&&ce(e.nativeEvent)&&(R.current=!0)}return{onKeyDown(e){let t=n.select(`open`);H.current=!1;let r=e.key.startsWith(`Arrow`),i=Wt(e.key,Ce(),h),a=Ht(e.key,w),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return we(e);if(!(!t&&!x&&r)){if(o){let t=Ht(e.key,Ce());V.current=m&&t?null:e.key}if(m){i&&(B(e),t?(z.current=K(s,Y.current),U(e)):n.setOpen(!0,te(ee,e.nativeEvent,e.currentTarget)));return}a&&(X.current!=null&&(z.current=X.current),B(e),!t&&x?n.setOpen(!0,te(ee,e.nativeEvent,e.currentTarget)):we(e),t&&U(e))}},onFocus(e){n.select(`open`)&&!g&&(z.current=-1,U(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[we,Y,_,s,m,U,n,x,w,Ce,h,X,g]),Oe=$.useMemo(()=>({...Te,...De}),[Te,De]);return $.useMemo(()=>u?{reference:Oe,floating:Ee,item:Q,trigger:De}:{},[u,Oe,Ee,De,Q])}function qt(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,elementsRef:o,activeIndex:s,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=H(),m=$.useRef(``),h=$.useRef(f??s??-1),g=$.useRef(null);v(()=>{!i&&f!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[i,f,p]),v(()=>{i&&m.current===``&&(h.current=f??s??-1)},[i,f,s]);let _=C(e=>{e?r.current.typing||(r.current.typing=e,l?.(e)):r.current.typing&&(r.current.typing=e,l?.(e))}),y=C(e=>{function t(e){let t=o?.current[e];return!t||ge(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=a.current;if(m.current.length>0&&e.key===` `&&(B(e),_(!0)),m.current.length>0&&m.current[0]!==` `&&n(r,m.current)===-1&&e.key!==` `&&_(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(B(e),_(!0));let l=m.current===``;l&&(h.current=f??s??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(d,()=>{m.current=``,h.current=g.current,_(!1)});let u=((l?f??s??-1:h.current)??0)+1,v=n(r,m.current,u);v===-1?e.key!==` `&&(m.current=``,_(!1)):(c?.(v),g.current=v)}),b=C(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=ne(r,t),o=ne(i,t);a||o||(p.clear(),m.current=``,h.current=g.current,_(!1))}),x=$.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]),S=$.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return $.useMemo(()=>u?{reference:x,floating:S}:{},[u,x,S])}var Jt=$.createContext(void 0);function Yt(){return $.useContext(Jt)?.direction??`ltr`}var Xt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Z(e,t)||{};if(l==null)return{};let f=Te(u),p={x:n,y:r},m=G(i),h=De(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=q(k,j,A),N=!c.arrow&&J(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Zt=(e,t)=>
1({...Xt(e),options:[e,t]}),Qt={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Lt().fn(e)).data?.referenceHidden||a}}}},$t={sideX:`left`,sideY:`top`},en={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=d(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:$t};let u=await a.getOffsetParent?.(i),f={width:0,height:0};if(o===`fixed`&&c?.visualViewport)f={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=A(i);f={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(f=await a.getDimensions(u));let p=W(s),m=t,h=n;p===`left`&&(m=f.width-(t+r.width)),p===`top`&&(h=f.height-(n+r.height));let g=p===`left`?`right`:$t.sideX,_=p===`top`?`bottom`:$t.sideY;return{x:m,y:h,data:{sideX:g,sideY:_}}}};function tn(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function nn(e,t,n){let{rects:r,placement:i}=e;return{side:tn(t,W(i),n),align:J(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function rn(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,w]=$.useState(null);!m&&S!==null&&w(null);let T=h.side||`flip`,E=h.align||`flip`,D=h.fallbackAxisSide||`end`,O=typeof t==`function`?t:void 0,k=C(O),j=O?k:t,M=le(t),N=Yt()===`rtl`,P=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[r],ee=a===`center`?P:`${P}-${a}`,F=c,te=+(r===`bottom`),ne=+(r===`top`),re=+(r===`right`),ie=+(r===`left`);typeof F==`number`?F={top:F+te,right:F+ie,bottom:F+ne,left:F+re}:F&&={top:(F.top||0)+te,right:(F.right||0)+ie,bottom:(F.bottom||0)+ne,left:(F.left||0)+re};let I={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:F},L=$.useRef(null),R=le(i),B=le(o),ae=[Mt(e=>{let t=nn(e,r,N),n=typeof R.current==`function`?R.current(t):R.current,i=typeof B.current==`function`?B.current(t):B.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,N,r])],oe=E===`none`&&T!==`shift`,se=!oe&&(l||g||T===`shift`),V=T===`none`?null:Ft({...I,padding:{top:F.top+1,right:F.right+1,bottom:F.bottom+1,left:F.left+1},mainAxis:!g&&T===`flip`,crossAxis:E===`flip`?`alignment`:!1,fallbackAxisSideDirection:D}),ce=oe?null:Nt(e=>{let t=A(e.elements.floating).documentElement;return{...I,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:E!==`none`,crossAxis:se,limiter:l||g?void 0:Pt(e=>{if(!L.current)return{};let{width:t,height:n}=L.current.getBoundingClientRect(),r=z(W(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})}},[I,l,g,F,E]);T===`shift`||E===`shift`||a===`center`?ae.push(ce,V):ae.push(V,ce),ae.push(It({...I,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Zt(()=>({element:L.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=W(a),l=z(c),u=L.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(nn(e,r,N)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,se&&l===`y`&&b?S:x),{}}},Qt,y),v(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let H=$.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:U,elements:G,x:ue,y:de,middlewareData:K,update:fe,placement:q,context:Y,isPositioned:pe,floatingStyles:me}=zt({rootContext:p,placement:ee,middleware:ae,strategy:n,whileElementsMounted:f?void 0:(...e)=>_t(...e,H),nodeId:_,externalTree:x}),{sideX:he,sideY:X}=K.adaptiveOrigin||$t,ge=pe?n:`fixed`,Z=$.useMemo(()=>{let e=y?{position:ge,[he]:ue,[X]:de}:{position:ge,...me};return pe||(e.opacity=0),e},[y,ge,he,ue,X,de,me,pe]),_e=$.useRef(null);v(()=>{if(!m)return;let e=M.current,t=typeof e==`function`?e():e,n=(an(t)?t.current:t)||null;n!==_e.current&&(U.setPositionReference(n),_e.current=n)},[m,U,j,M]),$.useEffect(()=>{if(!m)return;let e=M.current;typeof e!=`function`&&an(e)&&e.current!==_e.current&&(U.setPositionReference(e.current),_e.current=e.current)},[m,U,j,M]),$.useEffect(()=>{if(f&&m&&G.domReference&&G.floating)return _t(G.domReference,G.floating,fe,H)},[f,m,G,fe,H]);let ve=W(q),ye=tn(r,ve,N),Q=J(q)||`center`,be=!!K.hide?.referenceHidden;v(()=>{b&&m&&pe&&w(ve)},[b,m,pe,ve]);let xe=$.useMemo(()=>
1({position:`absolute`,top:K.arrow?.y,left:K.arrow?.x}),[K.arrow]),Se=K.arrow?.centerOffset!==0;return $.useMemo(()=>({positionerStyles:Z,arrowStyles:xe,arrowRef:L,arrowUncentered:Se,side:ye,align:Q,physicalSide:ve,anchorHidden:be,refs:U,context:Y,isPositioned:pe,update:fe}),[Z,xe,L,Se,ye,Q,ve,be,U,Y,pe,fe])}function an(e){return e!=null&&`current`in e}function on(e){return e===`starting`?S:_}var sn=$.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function cn(){return $.useContext(sn)}var ln=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function un(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=cn(),f=$.useRef(-1),[p,m]=$.useState(a??(i===ln.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=$.useRef(null),g=$.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return v(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),v(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),$.useMemo(()=>({ref:g,index:p}),[p,g])}var dn=$.createContext(void 0);function fn(e){let t=$.useContext(dn);if(t===void 0&&!e)throw Error(x(69));return t}var pn=r();function mn(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=C(i),o=$.useRef(0),s=E(gn).current,c=E(hn).current,[l,u]=$.useState(0),d=$.useRef(l),f=C((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=C(e=>{c.delete(e),d.current+=1,u(d.current)}),m=$.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(_n).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);v(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),v(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),v(()=>()=>{n.current=[]},[n]),v(()=>()=>{r&&(r.current=[])},[r]);let h=C(e=>(s.add(e),()=>{s.delete(e)}));v(()=>{s.forEach(e=>e(m))},[s,m]);let g=$.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,pn.jsx)(sn.Provider,{value:g,children:t})}function hn(){return new Map}function gn(){return new Set}function _n(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function vn(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}export{un as a,en as c,Kt as d,Rt as f,ln as i,Yt as l,mn as n,on as o,mt as p,fn as r,rn as s,vn as t,qt as u};

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.