1import{r as s,p as g}from"./chunk-KNED5TY2-6IudgIT3.js";import{j as P}from"./jsx-runtime-C-_spy54.js";import{r as C}from"./index-Ct28za8n.js";import{c as y,u as M}from"./index-BNYfIyEn.js";function W(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}function F(t,e){const n=s.createContext(e),r=i=>{const{children:c,...f}=i,u=s.useMemo(()=>f,Object.values(f));return P.jsx(n.Provider,{value:u,children:c})};r.displayName=t+"Provider";function o(i){const c=s.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,o]}function k(t,e=[]){let n=[];function r(i,c){const f=s.createContext(c),u=n.length;n=[...n,c];const a=d=>{const{scope:p,children:l,...v}=d,S=p?.[t]?.[u]||f,h=s.useMemo(()=>v,Object.values(v));return P.jsx(S.Provider,{value:h,children:l})};a.displayName=i+"Provider";function m(d,p){const l=p?.[t]?.[u]||f,v=s.useContext(l);if(v)return v;if(c!==void 0)return c;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[a,m]}const o=()=>{const i=n.map(c=>s.createContext(c));return function(f){const u=f?.[t]||i;return s.useMemo(()=>({[`__scope${t}`]:{...f,[t]:u}}),[f,u])}};return o.scopeName=t,[r,w(o,...e)]}function w(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((f,{useScope:u,scopeName:a})=>{const d=u(i)[`__scope${a}`];return{...f,...d}},{});return s.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function E(t){const e=s.useRef(t);return s.useEffect(()=>{e.current=t}),s.useMemo(()=>(...n)=>e.current?.(...n),[])}function H({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=A({defaultProp:e,onChange:n}),i=t!==void 0,c=i?t:r,f=E(n),u=s.useCallback(a=>
1{if(i){const d=typeof a=="function"?a(t):a;d!==t&&f(d)}else o(a)},[i,t,o,f]);return[c,u]}function A({defaultProp:t,onChange:e}){const n=s.useState(t),[r]=n,o=s.useRef(r),i=E(e);return s.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],B=R.reduce((t,e)=>{const n=y(`Primitive.${e}`),r=s.forwardRef((o,i)=>{const{asChild:c,...f}=o,u=c?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...f,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function q(t,e){t&&C.flushSync(()=>t.dispatchEvent(e))}var x=globalThis?.document?s.useLayoutEffect:()=>{},O=g[" useId ".trim().toString()]||(()=>{}),b=0;function z(t){const[e,n]=s.useState(O());return x(()=>{n(r=>r??String(b++))},[t]),e?`radix-${e}`:""}function T(t,e){return s.useReducer((n,r)=>e[n][r]??n,t)}var I=t=>{const{present:e,children:n}=t,r=U(e),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=M(r.ref,_(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};I.displayName="Presence";function U(t){const[e,n]=s.useState(),r=s.useRef({}),o=s.useRef(t),i=s.useRef("none"),c=t?"mounted":"unmounted",[f,u]=T(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const a=N(r.current);i.current=f==="mounted"?a:"none"},[f]),x(()=>{const a=r.current,m=o.current;if(m!==t){const p=i.current,l=N(a);t?u("MOUNT"):l==="none"||a?.display==="none"?u("UNMOUNT"):u(m&&p!==l?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),x(()=>{if(e){let a;const m=e.ownerDocument.defaultView??window,d=l=>{const S=N(r.current).includes(l.animationName);if(l.target===e&&S&&(u("ANIMATION_END"),!o.current)){const h=e.style.animationFillMode;e.style.animationFillMode="forwards",a=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=h)})}},p=l=>{l.target===e&&(i.current=N(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{m.clearTimeout(a),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:s.useCallback(a=>{a&&(r.current=getComputedStyle(a)),n(a)},[])}}function N(t){return t?.animationName||"none"}function _(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}export{B as P,W as a,z as b,k as c,E as d,H as e,I as f,F as g,q as h,x 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.