import{n as m,t as I,i as O,a as _,b as R,c as S,d as z}from"./_bd5lRB8.js";import{H as C,r as b,ac as W,af as D,d as y,a2 as E,ak as V,U as H,ab as L}from"./CWtpRkXC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bd60a692-d107-49d3-a4d4-ffeae190a183",e._sentryDebugIdIdentifier="sentry-dbid-bd60a692-d107-49d3-a4d4-ffeae190a183")}catch{}})();function F(e,n,r){let c;C(r)?c={evaluating:r}:c=r||{};const{lazy:d=!1,evaluating:i=void 0,shallow:l=!0,onError:s=m}=c,u=b(!d),a=l?W(n):b(n);let o=0;return D(async t=>{if(!u.value)return;o++;const f=o;let h=!1;i&&Promise.resolve().then(()=>{i.value=!0});try{const v=await e(w=>{t(()=>{i&&(i.value=!1),h||w()})});f===o&&(a.value=v)}catch(v){s(v)}finally{i&&f===o&&(i.value=!1),h=!0}}),d?y(()=>(u.value=!0,a.value)):a}function p(e){var n;const r=I(e);return(n=r==null?void 0:r.$el)!=null?n:r}const A=z?window:void 0;function G(...e){let n,r,c,d;if(typeof e[0]=="string"||Array.isArray(e[0])?([r,c,d]=e,n=A):[n,r,c,d]=e,!n)return m;Array.isArray(r)||(r=[r]),Array.isArray(c)||(c=[c]);const i=[],l=()=>{i.forEach(o=>o()),i.length=0},s=(o,t,f,h)=>(o.addEventListener(t,f,h),()=>o.removeEventListener(t,f,h)),u=E(()=>[p(n),I(d)],([o,t])=>{if(l(),!o)return;const f=O(t)?{...t}:t;i.push(...r.flatMap(h=>c.map(v=>s(o,h,v,f))))},{immediate:!0,flush:"post"}),a=()=>{u(),l()};return _(a),a}function P(){const e=b(!1),n=L();return n&&H(()=>{e.value=!0},n),e}function M(e){const n=P();return y(()=>(n.value,!!e()))}function T(e,n,r={}){const{window:c=A,...d}=r;let i;const l=M(()=>c&&"ResizeObserver"in c),s=()=>{i&&(i.disconnect(),i=void 0)},u=y(()=>Array.isArray(e)?e.map(t=>p(t)):[p(e)]),a=E(u,t=>{if(s(),l.value&&c){i=new ResizeObserver(n);for(const f of t)f&&i.observe(f,d)}},{immediate:!0,flush:"post"}),o=()=>{s(),a()};return _(o),{isSupported:l,stop:o}}function N(e,n={width:0,height:0},r={}){const{window:c=A,box:d="content-box"}=r,i=y(()=>{var t,f;return(f=(t=p(e))==null?void 0:t.namespaceURI)==null?void 0:f.includes("svg")}),l=b(n.width),s=b(n.height),{stop:u}=T(e,([t])=>{const f=d==="border-box"?t.borderBoxSize:d==="content-box"?t.contentBoxSize:t.devicePixelContentBoxSize;if(c&&i.value){const h=p(e);if(h){const v=h.getBoundingClientRect();l.value=v.width,s.value=v.height}}else if(f){const h=Array.isArray(f)?f:[f];l.value=h.reduce((v,{inlineSize:w})=>v+w,0),s.value=h.reduce((v,{blockSize:w})=>v+w,0)}else l.value=t.contentRect.width,s.value=t.contentRect.height},r);R(()=>{const t=p(e);t&&(l.value="offsetWidth"in t?t.offsetWidth:n.width,s.value="offsetHeight"in t?t.offsetHeight:n.height)});const a=E(()=>p(e),t=>{l.value=t?n.width:0,s.value=t?n.height:0});function o(){u(),a()}return{width:l,height:s,stop:o}}function U(e,n,r={}){const{root:c,rootMargin:d="0px",threshold:i=.1,window:l=A,immediate:s=!0}=r,u=M(()=>l&&"IntersectionObserver"in l),a=y(()=>{const v=I(e);return(Array.isArray(v)?v:[v]).map(p).filter(S)});let o=m;const t=b(s),f=u.value?E(()=>[a.value,p(c),t.value],([v,w])=>{if(o(),!t.value||!v.length)return;const x=new IntersectionObserver(n,{root:p(w),rootMargin:d,threshold:i});v.forEach(B=>B&&x.observe(B)),o=()=>{x.disconnect(),o=m}},{immediate:s,flush:"post"}):m,h=()=>{o(),f(),t.value=!1};return _(h),{isSupported:u,isActive:t,pause(){o(),t.value=!1},resume(){t.value=!0},stop:h}}function q(e,n={}){const{window:r=A,scrollTarget:c,threshold:d=0}=n,i=b(!1);return U(e,l=>{let s=i.value,u=0;for(const a of l)a.time>=u&&(u=a.time,s=a.isIntersecting);i.value=s},{root:c,window:r,threshold:d}),i}const g=new Map;function J(e){const n=V();function r(s){var u;const a=g.get(e)||new Set;a.add(s),g.set(e,a);const o=()=>d(s);return(u=n==null?void 0:n.cleanups)==null||u.push(o),o}function c(s){function u(...a){d(u),s(...a)}return r(u)}function d(s){const u=g.get(e);u&&(u.delete(s),u.size||i())}function i(){g.delete(e)}function l(s,u){var a;(a=g.get(e))==null||a.forEach(o=>o(s,u))}return{on:r,once:c,off:d,emit:l,reset:i}}export{J as a,G as b,F as c,N as d,q as e,p as u};
