import{r as o,b as m,j as b}from"./app-BAHAOwU3.js";import{c as h,a as E}from"./button-T-Jxhehc.js";function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function x(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function u(...e){return t=>e.forEach(n=>x(n,t))}function D(...e){return o.useCallback(u(...e),e)}const p=o.forwardRef((e,t)=>{const{children:n,...r}=e,l=o.Children.toArray(n),a=l.find(y);if(a){const c=a.props.children,s=l.map(d=>d===a?o.Children.count(c)>1?o.Children.only(null):o.isValidElement(c)?c.props.children:null:d);return o.createElement(f,i({},r,{ref:t}),o.isValidElement(c)?o.cloneElement(c,void 0,s):null)}return o.createElement(f,i({},r,{ref:t}),n)});p.displayName="Slot";const f=o.forwardRef((e,t)=>{const{children:n,...r}=e;return o.isValidElement(n)?o.cloneElement(n,{...w(r,n.props),ref:t?u(t,n.ref):n.ref}):o.Children.count(n)>1?o.Children.only(null):null});f.displayName="SlotClone";const v=({children:e})=>o.createElement(o.Fragment,null,e);function y(e){return o.isValidElement(e)&&e.type===v}function w(e,t){const n={...t};for(const r in t){const l=e[r],a=t[r];/^on[A-Z]/.test(r)?l&&a?n[r]=(...s)=>{a(...s),l(...s)}:l&&(n[r]=l):r==="style"?n[r]={...l,...a}:r==="className"&&(n[r]=[l,a].filter(Boolean).join(" "))}return{...e,...n}}const C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],N=C.reduce((e,t)=>{const n=o.forwardRef((r,l)=>{const{asChild:a,...c}=r,s=a?p:t;return o.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),o.createElement(s,i({},c,{ref:l}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function O(e,t){e&&m.flushSync(()=>e.dispatchEvent(t))}const g=o.forwardRef((e,t)=>o.createElement(N.label,i({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),$=g,j=E("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),P=o.forwardRef(({className:e,...t},n)=>b.jsx($,{ref:n,className:h(j(),e),...t}));P.displayName=$.displayName;export{D as $,P as L,i as _,N as a,O as b,u as c};
