import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{d as t,n,t as r}from"./jsx-runtime-UY3v_sjn.js";import{a as i,i as a,n as o,r as s,t as c}from"./dist-D79fvq5v.js";import{a as l}from"./dist-CpbhN_cU.js";import{t as u}from"./dist-CMaNrZHo.js";import{o as d}from"./es2015-CEhw2WdQ.js";import{t as f}from"./createLucideIcon-BeHZXpLp.js";var p=f(`ShoppingBag`,[[`path`,{d:`M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z`,key:`hou9p0`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M16 10a4 4 0 0 1-8 0`,key:`1ltviw`}]]),m=n(),h=e(t(),1),g=r(),_=Object.defineProperty,v=(e,t)=>_(e,`name`,{value:t,configurable:!0}),y=`Collapsible`,[b,x]=a(y),[S,C]=b(y),w=h.forwardRef(v(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[l,f]=c({prop:r,defaultProp:i??!1,onChange:o,caller:y});return(0,g.jsx)(S,{scope:n,disabled:a,contentId:d(),open:l,onOpenToggle:h.useCallback(()=>f(e=>!e),[f]),children:(0,g.jsx)(u.div,{"data-state":A(l),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),T=`CollapsibleTrigger`,E=h.forwardRef(v(function(e,t){let{__scopeCollapsible:n,...r}=e,a=C(T,n);return(0,g.jsx)(u.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":A(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...r,ref:t,onClick:i(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),D=`CollapsibleContent`,O=h.forwardRef(v(function(e,t){let{forceMount:n,...r}=e,i=C(D,e.__scopeCollapsible);return(0,g.jsx)(o,{present:n||i.open,children:({present:e})=>(0,g.jsx)(k,{...r,ref:t,present:e})})},`CollapsibleContent`)),k=h.forwardRef(v(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=C(D,n),[c,d]=h.useState(r),f=h.useRef(null),p=l(t,f),m=h.useRef(0),_=m.current,v=h.useRef(0),y=v.current,b=o.open||c,x=h.useRef(b),S=h.useRef(void 0);return h.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),s(()=>{let e=f.current;if(e){S.current=S.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();m.current=t.height,v.current=t.width,x.current||(e.style.transitionDuration=S.current.transitionDuration,e.style.animationName=S.current.animationName),d(r)}},[o.open,r]),(0,g.jsx)(u.div,{"data-state":A(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!b,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:b&&i})},`CollapsibleContentImpl`));function A(e){return e?`open`:`closed`}v(A,`getState`);var j=w;function M(e){let t=(0,m.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,g.jsx)(j,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function N(e){let t=(0,m.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,g.jsx)(E,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function P(e){let t=(0,m.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,g.jsx)(O,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}export{p as i,P as n,N as r,M as t};