import{c as V,r as c,a as pe,b as ae,u as we,d as $e,j as n,e as ze,f as A,A as Se,P as I,g,h as L,i as He,k as Ge,D as Ue,C as Ke,l as Ar,m as Dr,n as F,o as pt,s as ft,t as ht,v as mt,F as vt,B,T as Ir,w as st,X as Or,x as kr,y as xt,z as W,E as gt,I as Lr,G as Fr,H as $r,J as wt,K as zr,L as Hr,M as ct,N as Gr,O as it,p as H,S as Ur,U as Kr,V as Br,W as Wr}from"./product-modal-fHk1ypXV.js";import{r as Vr}from"./app-DrgD6EWn.js";/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xr=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Yr=V("chevron-left",Xr);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qr=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zr=V("chevron-right",qr);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jr=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],Qr=V("door-open",Jr);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eo=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],to=V("ellipsis",eo);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ro=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bt=V("eye-off",ro);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oo=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ct=V("eye",oo);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const no=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ao=V("search",no);/**
 * @license lucide-react v0.540.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const so=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],co=V("square-pen",so);var[_e,Ba]=pe("Tooltip",[ae]),Re=ae(),yt="TooltipProvider",io=700,ke="tooltip.open",[lo,Be]=_e(yt),Pt=e=>{const{__scopeTooltip:r,delayDuration:t=io,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,i=c.useRef(!0),u=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),n.jsx(lo,{scope:r,isOpenDelayedRef:i,delayDuration:t,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:u,onPointerInTransitChange:c.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};Pt.displayName=yt;var le="Tooltip",[uo,fe]=_e(le),St=e=>{const{__scopeTooltip:r,children:t,open:a,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:u}=e,l=Be(le,e.__scopeTooltip),f=Re(r),[d,p]=c.useState(null),h=we(),m=c.useRef(0),x=i??l.disableHoverableContent,C=u??l.delayDuration,b=c.useRef(!1),[S,R]=$e({prop:a,defaultProp:o??!1,onChange:j=>{j?(l.onOpen(),document.dispatchEvent(new CustomEvent(ke))):l.onClose(),s?.(j)},caller:le}),N=c.useMemo(()=>S?b.current?"delayed-open":"instant-open":"closed",[S]),v=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,R(!0)},[R]),P=c.useCallback(()=>{window.clearTimeout(m.current),m.current=0,R(!1)},[R]),y=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,R(!0),m.current=0},C)},[C,R]);return c.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),n.jsx(ze,{...f,children:n.jsx(uo,{scope:r,contentId:h,open:S,stateAttribute:N,trigger:d,onTriggerChange:p,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?y():v()},[l.isOpenDelayedRef,y,v]),onTriggerLeave:c.useCallback(()=>{x?P():(window.clearTimeout(m.current),m.current=0)},[P,x]),onOpen:v,onClose:P,disableHoverableContent:x,children:t})})};St.displayName=le;var Le="TooltipTrigger",_t=c.forwardRef((e,r)=>{const{__scopeTooltip:t,...a}=e,o=fe(Le,t),s=Be(Le,t),i=Re(t),u=c.useRef(null),l=A(r,u,o.onTriggerChange),f=c.useRef(!1),d=c.useRef(!1),p=c.useCallback(()=>f.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),n.jsx(Se,{asChild:!0,...i,children:n.jsx(I.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:l,onPointerMove:g(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:g(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:g(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:g(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:g(e.onBlur,o.onClose),onClick:g(e.onClick,o.onClose)})})});_t.displayName=Le;var We="TooltipPortal",[po,fo]=_e(We,{forceMount:void 0}),Rt=e=>{const{__scopeTooltip:r,forceMount:t,children:a,container:o}=e,s=fe(We,r);return n.jsx(po,{scope:r,forceMount:t,children:n.jsx(L,{present:t||s.open,children:n.jsx(He,{asChild:!0,container:o,children:a})})})};Rt.displayName=We;var re="TooltipContent",Mt=c.forwardRef((e,r)=>{const t=fo(re,e.__scopeTooltip),{forceMount:a=t.forceMount,side:o="top",...s}=e,i=fe(re,e.__scopeTooltip);return n.jsx(L,{present:a||i.open,children:i.disableHoverableContent?n.jsx(Tt,{side:o,...s,ref:r}):n.jsx(ho,{side:o,...s,ref:r})})}),ho=c.forwardRef((e,r)=>{const t=fe(re,e.__scopeTooltip),a=Be(re,e.__scopeTooltip),o=c.useRef(null),s=A(r,o),[i,u]=c.useState(null),{trigger:l,onClose:f}=t,d=o.current,{onPointerInTransitChange:p}=a,h=c.useCallback(()=>{u(null),p(!1)},[p]),m=c.useCallback((x,C)=>{const b=x.currentTarget,S={x:x.clientX,y:x.clientY},R=go(S,b.getBoundingClientRect()),N=wo(S,R),v=bo(C.getBoundingClientRect()),P=yo([...N,...v]);u(P),p(!0)},[p]);return c.useEffect(()=>()=>h(),[h]),c.useEffect(()=>{if(l&&d){const x=b=>m(b,d),C=b=>m(b,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",C),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",C)}}},[l,d,m,h]),c.useEffect(()=>{if(i){const x=C=>{const b=C.target,S={x:C.clientX,y:C.clientY},R=l?.contains(b)||d?.contains(b),N=!Co(S,i);R?h():N&&(h(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,i,f,h]),n.jsx(Tt,{...e,ref:s})}),[mo,vo]=_e(le,{isInside:!1}),xo=Ar("TooltipContent"),Tt=c.forwardRef((e,r)=>{const{__scopeTooltip:t,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...u}=e,l=fe(re,t),f=Re(t),{onClose:d}=l;return c.useEffect(()=>(document.addEventListener(ke,d),()=>document.removeEventListener(ke,d)),[d]),c.useEffect(()=>{if(l.trigger){const p=h=>{h.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,d]),n.jsx(Ue,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:n.jsxs(Ke,{"data-state":l.stateAttribute,...f,...u,ref:r,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[n.jsx(xo,{children:a}),n.jsx(mo,{scope:t,isInside:!0,children:n.jsx(Dr,{id:l.contentId,role:"tooltip",children:o||a})})]})})});Mt.displayName=re;var jt="TooltipArrow",Et=c.forwardRef((e,r)=>{const{__scopeTooltip:t,...a}=e,o=Re(t);return vo(jt,t).isInside?null:n.jsx(Ge,{...o,...a,ref:r})});Et.displayName=jt;function go(e,r){const t=Math.abs(r.top-e.y),a=Math.abs(r.bottom-e.y),o=Math.abs(r.right-e.x),s=Math.abs(r.left-e.x);switch(Math.min(t,a,o,s)){case s:return"left";case o:return"right";case t:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function wo(e,r,t=5){const a=[];switch(r){case"top":a.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":a.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":a.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":a.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return a}function bo(e){const{top:r,right:t,bottom:a,left:o}=e;return[{x:o,y:r},{x:t,y:r},{x:t,y:a},{x:o,y:a}]}function Co(e,r){const{x:t,y:a}=e;let o=!1;for(let s=0,i=r.length-1;s<r.length;i=s++){const u=r[s],l=r[i],f=u.x,d=u.y,p=l.x,h=l.y;d>a!=h>a&&t<(p-f)*(a-d)/(h-d)+f&&(o=!o)}return o}function yo(e){const r=e.slice();return r.sort((t,a)=>t.x<a.x?-1:t.x>a.x?1:t.y<a.y?-1:t.y>a.y?1:0),Po(r)}function Po(e){if(e.length<=1)return e.slice();const r=[];for(let a=0;a<e.length;a++){const o=e[a];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}r.pop();const t=[];for(let a=e.length-1;a>=0;a--){const o=e[a];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}return t.pop(),r.length===1&&t.length===1&&r[0].x===t[0].x&&r[0].y===t[0].y?r:r.concat(t)}var So=Pt,_o=St,Ro=_t,Mo=Rt,To=Mt,jo=Et;function Eo({delayDuration:e=0,...r}){return n.jsx(So,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function No({...e}){return n.jsx(Eo,{children:n.jsx(_o,{"data-slot":"tooltip",...e})})}function Ao({...e}){return n.jsx(Ro,{"data-slot":"tooltip-trigger",...e})}function Do({className:e,sideOffset:r=0,children:t,...a}){return n.jsx(Mo,{children:n.jsxs(To,{"data-slot":"tooltip-content",sideOffset:r,className:F("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[t,n.jsx(jo,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var Me="Popover",[Nt,Wa]=pe(Me,[ae]),he=ae(),[Io,X]=Nt(Me),At=e=>{const{__scopePopover:r,children:t,open:a,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,u=he(r),l=c.useRef(null),[f,d]=c.useState(!1),[p,h]=$e({prop:a,defaultProp:o??!1,onChange:s,caller:Me});return n.jsx(ze,{...u,children:n.jsx(Io,{scope:r,contentId:we(),triggerRef:l,open:p,onOpenChange:h,onOpenToggle:c.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:f,onCustomAnchorAdd:c.useCallback(()=>d(!0),[]),onCustomAnchorRemove:c.useCallback(()=>d(!1),[]),modal:i,children:t})})};At.displayName=Me;var Dt="PopoverAnchor",Oo=c.forwardRef((e,r)=>{const{__scopePopover:t,...a}=e,o=X(Dt,t),s=he(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:u}=o;return c.useEffect(()=>(i(),()=>u()),[i,u]),n.jsx(Se,{...s,...a,ref:r})});Oo.displayName=Dt;var It="PopoverTrigger",Ot=c.forwardRef((e,r)=>{const{__scopePopover:t,...a}=e,o=X(It,t),s=he(t),i=A(r,o.triggerRef),u=n.jsx(I.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":zt(o.open),...a,ref:i,onClick:g(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:n.jsx(Se,{asChild:!0,...s,children:u})});Ot.displayName=It;var Ve="PopoverPortal",[ko,Lo]=Nt(Ve,{forceMount:void 0}),kt=e=>{const{__scopePopover:r,forceMount:t,children:a,container:o}=e,s=X(Ve,r);return n.jsx(ko,{scope:r,forceMount:t,children:n.jsx(L,{present:t||s.open,children:n.jsx(He,{asChild:!0,container:o,children:a})})})};kt.displayName=Ve;var oe="PopoverContent",Lt=c.forwardRef((e,r)=>{const t=Lo(oe,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,s=X(oe,e.__scopePopover);return n.jsx(L,{present:a||s.open,children:s.modal?n.jsx($o,{...o,ref:r}):n.jsx(zo,{...o,ref:r})})});Lt.displayName=oe;var Fo=ht("PopoverContent.RemoveScroll"),$o=c.forwardRef((e,r)=>{const t=X(oe,e.__scopePopover),a=c.useRef(null),o=A(r,a),s=c.useRef(!1);return c.useEffect(()=>{const i=a.current;if(i)return pt(i)},[]),n.jsx(ft,{as:Fo,allowPinchZoom:!0,children:n.jsx(Ft,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||t.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,i=>{const u=i.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;s.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:g(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),zo=c.forwardRef((e,r)=>{const t=X(oe,e.__scopePopover),a=c.useRef(!1),o=c.useRef(!1);return n.jsx(Ft,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(a.current||t.triggerRef.current?.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;t.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ft=c.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:d,...p}=e,h=X(oe,t),m=he(t);return mt(),n.jsx(vt,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:n.jsx(Ue,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:f,onDismiss:()=>h.onOpenChange(!1),children:n.jsx(Ke,{"data-state":zt(h.open),role:"dialog",id:h.contentId,...m,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),$t="PopoverClose",Ho=c.forwardRef((e,r)=>{const{__scopePopover:t,...a}=e,o=X($t,t);return n.jsx(I.button,{type:"button",...a,ref:r,onClick:g(e.onClick,()=>o.onOpenChange(!1))})});Ho.displayName=$t;var Go="PopoverArrow",Uo=c.forwardRef((e,r)=>{const{__scopePopover:t,...a}=e,o=he(t);return n.jsx(Ge,{...o,...a,ref:r})});Uo.displayName=Go;function zt(e){return e?"open":"closed"}var Ko=At,Bo=Ot,Wo=kt,Vo=Lt;function Xo({...e}){return n.jsx(Ko,{"data-slot":"popover",...e})}function Yo({...e}){return n.jsx(Bo,{"data-slot":"popover-trigger",...e})}function qo({className:e,align:r="center",sideOffset:t=4,...a}){return n.jsx(Wo,{children:n.jsx(Vo,{"data-slot":"popover-content",align:r,sideOffset:t,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}function Zo(){return n.jsxs(No,{children:[n.jsx(Ao,{asChild:!0,children:n.jsx(Yo,{asChild:!0,children:n.jsx(B,{size:"icon",children:n.jsx(Qr,{})})})}),n.jsx(Do,{children:n.jsx("p",{children:"Add to library"})})]})}function Jo({filter:e,setFilter:r,activeFiltersCount:t,clearFilters:a}){return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs(Ir,{size:"sm",type:"single",value:e.statusFilter||"",onValueChange:o=>r({statusFilter:o||""}),className:"flex items-center gap-1 p-1 bg-muted rounded-lg",children:[n.jsxs(st,{size:"sm",value:"listed","aria-label":"Hiển thị công khai",className:"flex items-center gap-2 px-3 py-2 rounded-md data-[state=on]:bg-green-100 data-[state=on]:text-green-700 data-[state=on]:border-green-200 hover:bg-green-50 transition-colors",children:[n.jsx(Ct,{className:"h-2 w-2"}),n.jsx("span",{className:"text-sm font-medium",children:"Listed"})]}),n.jsxs(st,{size:"sm",value:"unlisted","aria-label":"Ẩn khỏi danh sách",className:"flex items-center gap-2 px-3 py-2 rounded-md data-[state=on]:bg-orange-100 data-[state=on]:text-orange-700 data-[state=on]:border-orange-200 hover:bg-orange-50 transition-colors",children:[n.jsx(bt,{className:"h-2 w-2"}),n.jsx("span",{className:"text-sm font-medium",children:"Unlisted"})]})]}),t>0&&n.jsxs(B,{variant:"outline",size:"sm",onClick:a,className:"flex items-center gap-2 text-muted-foreground hover:text-foreground bg-transparent","aria-label":"clear",children:[n.jsx(Or,{className:"h-2 w-2"}),n.jsx("span",{className:"text-sm",children:"Clear"})]})]})}var Fe=["Enter"," "],Qo=["ArrowDown","PageUp","Home"],Ht=["ArrowUp","PageDown","End"],en=[...Qo,...Ht],tn={ltr:[...Fe,"ArrowRight"],rtl:[...Fe,"ArrowLeft"]},rn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},me="Menu",[ue,on,nn]=kr(me),[q,Gt]=pe(me,[nn,ae,xt]),Te=ae(),Ut=xt(),[an,Z]=q(me),[sn,ve]=q(me),Kt=e=>{const{__scopeMenu:r,open:t=!1,children:a,dir:o,onOpenChange:s,modal:i=!0}=e,u=Te(r),[l,f]=c.useState(null),d=c.useRef(!1),p=W(s),h=gt(o);return c.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),n.jsx(ze,{...u,children:n.jsx(an,{scope:r,open:t,onOpenChange:p,content:l,onContentChange:f,children:n.jsx(sn,{scope:r,onClose:c.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:h,modal:i,children:a})})})};Kt.displayName=me;var cn="MenuAnchor",Xe=c.forwardRef((e,r)=>{const{__scopeMenu:t,...a}=e,o=Te(t);return n.jsx(Se,{...o,...a,ref:r})});Xe.displayName=cn;var Ye="MenuPortal",[ln,Bt]=q(Ye,{forceMount:void 0}),Wt=e=>{const{__scopeMenu:r,forceMount:t,children:a,container:o}=e,s=Z(Ye,r);return n.jsx(ln,{scope:r,forceMount:t,children:n.jsx(L,{present:t||s.open,children:n.jsx(He,{asChild:!0,container:o,children:a})})})};Wt.displayName=Ye;var k="MenuContent",[un,qe]=q(k),Vt=c.forwardRef((e,r)=>{const t=Bt(k,e.__scopeMenu),{forceMount:a=t.forceMount,...o}=e,s=Z(k,e.__scopeMenu),i=ve(k,e.__scopeMenu);return n.jsx(ue.Provider,{scope:e.__scopeMenu,children:n.jsx(L,{present:a||s.open,children:n.jsx(ue.Slot,{scope:e.__scopeMenu,children:i.modal?n.jsx(dn,{...o,ref:r}):n.jsx(pn,{...o,ref:r})})})})}),dn=c.forwardRef((e,r)=>{const t=Z(k,e.__scopeMenu),a=c.useRef(null),o=A(r,a);return c.useEffect(()=>{const s=a.current;if(s)return pt(s)},[]),n.jsx(Ze,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:g(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),pn=c.forwardRef((e,r)=>{const t=Z(k,e.__scopeMenu);return n.jsx(Ze,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),fn=ht("MenuContent.ScrollLock"),Ze=c.forwardRef((e,r)=>{const{__scopeMenu:t,loop:a=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:u,onEntryFocus:l,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:x,...C}=e,b=Z(k,t),S=ve(k,t),R=Te(t),N=Ut(t),v=on(t),[P,y]=c.useState(null),j=c.useRef(null),U=A(r,j,b.onContentChange),_=c.useRef(0),M=c.useRef(""),z=c.useRef(0),K=c.useRef(null),T=c.useRef("right"),E=c.useRef(0),J=x?ft:c.Fragment,De=x?{as:fn,allowPinchZoom:!0}:void 0,Nr=w=>{const ee=M.current+w,Y=v().filter(O=>!O.disabled),se=document.activeElement,Ie=Y.find(O=>O.ref.current===se)?.textValue,Oe=Y.map(O=>O.textValue),nt=_n(Oe,ee,Ie),ce=Y.find(O=>O.textValue===nt)?.ref.current;(function O(at){M.current=at,window.clearTimeout(_.current),at!==""&&(_.current=window.setTimeout(()=>O(""),1e3))})(ee),ce&&setTimeout(()=>ce.focus())};c.useEffect(()=>()=>window.clearTimeout(_.current),[]),mt();const Q=c.useCallback(w=>T.current===K.current?.side&&Mn(w,K.current?.area),[]);return n.jsx(un,{scope:t,searchRef:M,onItemEnter:c.useCallback(w=>{Q(w)&&w.preventDefault()},[Q]),onItemLeave:c.useCallback(w=>{Q(w)||(j.current?.focus(),y(null))},[Q]),onTriggerLeave:c.useCallback(w=>{Q(w)&&w.preventDefault()},[Q]),pointerGraceTimerRef:z,onPointerGraceIntentChange:c.useCallback(w=>{K.current=w},[]),children:n.jsx(J,{...De,children:n.jsx(vt,{asChild:!0,trapped:o,onMountAutoFocus:g(s,w=>{w.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:n.jsx(Ue,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:n.jsx($r,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:a,currentTabStopId:P,onCurrentTabStopIdChange:y,onEntryFocus:g(l,w=>{S.isUsingKeyboardRef.current||w.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(Ke,{role:"menu","aria-orientation":"vertical","data-state":lr(b.open),"data-radix-menu-content":"",dir:S.dir,...R,...C,ref:U,style:{outline:"none",...C.style},onKeyDown:g(C.onKeyDown,w=>{const Y=w.target.closest("[data-radix-menu-content]")===w.currentTarget,se=w.ctrlKey||w.altKey||w.metaKey,Ie=w.key.length===1;Y&&(w.key==="Tab"&&w.preventDefault(),!se&&Ie&&Nr(w.key));const Oe=j.current;if(w.target!==Oe||!en.includes(w.key))return;w.preventDefault();const ce=v().filter(O=>!O.disabled).map(O=>O.ref.current);Ht.includes(w.key)&&ce.reverse(),Pn(ce)}),onBlur:g(e.onBlur,w=>{w.currentTarget.contains(w.target)||(window.clearTimeout(_.current),M.current="")}),onPointerMove:g(e.onPointerMove,de(w=>{const ee=w.target,Y=E.current!==w.clientX;if(w.currentTarget.contains(ee)&&Y){const se=w.clientX>E.current?"right":"left";T.current=se,E.current=w.clientX}}))})})})})})})});Vt.displayName=k;var hn="MenuGroup",Je=c.forwardRef((e,r)=>{const{__scopeMenu:t,...a}=e;return n.jsx(I.div,{role:"group",...a,ref:r})});Je.displayName=hn;var mn="MenuLabel",Xt=c.forwardRef((e,r)=>{const{__scopeMenu:t,...a}=e;return n.jsx(I.div,{...a,ref:r})});Xt.displayName=mn;var be="MenuItem",lt="menu.itemSelect",je=c.forwardRef((e,r)=>{const{disabled:t=!1,onSelect:a,...o}=e,s=c.useRef(null),i=ve(be,e.__scopeMenu),u=qe(be,e.__scopeMenu),l=A(r,s),f=c.useRef(!1),d=()=>{const p=s.current;if(!t&&p){const h=new CustomEvent(lt,{bubbles:!0,cancelable:!0});p.addEventListener(lt,m=>a?.(m),{once:!0}),Fr(p,h),h.defaultPrevented?f.current=!1:i.onClose()}};return n.jsx(Yt,{...o,ref:l,disabled:t,onClick:g(e.onClick,d),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:g(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:g(e.onKeyDown,p=>{const h=u.searchRef.current!=="";t||h&&p.key===" "||Fe.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});je.displayName=be;var Yt=c.forwardRef((e,r)=>{const{__scopeMenu:t,disabled:a=!1,textValue:o,...s}=e,i=qe(be,t),u=Ut(t),l=c.useRef(null),f=A(r,l),[d,p]=c.useState(!1),[h,m]=c.useState("");return c.useEffect(()=>{const x=l.current;x&&m((x.textContent??"").trim())},[s.children]),n.jsx(ue.ItemSlot,{scope:t,disabled:a,textValue:o??h,children:n.jsx(Lr,{asChild:!0,...u,focusable:!a,children:n.jsx(I.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:f,onPointerMove:g(e.onPointerMove,de(x=>{a?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:g(e.onPointerLeave,de(x=>i.onItemLeave(x))),onFocus:g(e.onFocus,()=>p(!0)),onBlur:g(e.onBlur,()=>p(!1))})})})}),vn="MenuCheckboxItem",qt=c.forwardRef((e,r)=>{const{checked:t=!1,onCheckedChange:a,...o}=e;return n.jsx(tr,{scope:e.__scopeMenu,checked:t,children:n.jsx(je,{role:"menuitemcheckbox","aria-checked":Ce(t)?"mixed":t,...o,ref:r,"data-state":et(t),onSelect:g(o.onSelect,()=>a?.(Ce(t)?!0:!t),{checkForDefaultPrevented:!1})})})});qt.displayName=vn;var Zt="MenuRadioGroup",[xn,gn]=q(Zt,{value:void 0,onValueChange:()=>{}}),Jt=c.forwardRef((e,r)=>{const{value:t,onValueChange:a,...o}=e,s=W(a);return n.jsx(xn,{scope:e.__scopeMenu,value:t,onValueChange:s,children:n.jsx(Je,{...o,ref:r})})});Jt.displayName=Zt;var Qt="MenuRadioItem",er=c.forwardRef((e,r)=>{const{value:t,...a}=e,o=gn(Qt,e.__scopeMenu),s=t===o.value;return n.jsx(tr,{scope:e.__scopeMenu,checked:s,children:n.jsx(je,{role:"menuitemradio","aria-checked":s,...a,ref:r,"data-state":et(s),onSelect:g(a.onSelect,()=>o.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});er.displayName=Qt;var Qe="MenuItemIndicator",[tr,wn]=q(Qe,{checked:!1}),rr=c.forwardRef((e,r)=>{const{__scopeMenu:t,forceMount:a,...o}=e,s=wn(Qe,t);return n.jsx(L,{present:a||Ce(s.checked)||s.checked===!0,children:n.jsx(I.span,{...o,ref:r,"data-state":et(s.checked)})})});rr.displayName=Qe;var bn="MenuSeparator",or=c.forwardRef((e,r)=>{const{__scopeMenu:t,...a}=e;return n.jsx(I.div,{role:"separator","aria-orientation":"horizontal",...a,ref:r})});or.displayName=bn;var Cn="MenuArrow",nr=c.forwardRef((e,r)=>{const{__scopeMenu:t,...a}=e,o=Te(t);return n.jsx(Ge,{...o,...a,ref:r})});nr.displayName=Cn;var yn="MenuSub",[Va,ar]=q(yn),ie="MenuSubTrigger",sr=c.forwardRef((e,r)=>{const t=Z(ie,e.__scopeMenu),a=ve(ie,e.__scopeMenu),o=ar(ie,e.__scopeMenu),s=qe(ie,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:l}=s,f={__scopeMenu:e.__scopeMenu},d=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>d,[d]),c.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),l(null)}},[u,l]),n.jsx(Xe,{asChild:!0,...f,children:n.jsx(Yt,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":o.contentId,"data-state":lr(t.open),...e,ref:wt(r,o.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:g(e.onPointerMove,de(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!t.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{t.onOpenChange(!0),d()},100))})),onPointerLeave:g(e.onPointerLeave,de(p=>{d();const h=t.content?.getBoundingClientRect();if(h){const m=t.content?.dataset.side,x=m==="right",C=x?-5:5,b=h[x?"left":"right"],S=h[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+C,y:p.clientY},{x:b,y:h.top},{x:S,y:h.top},{x:S,y:h.bottom},{x:b,y:h.bottom}],side:m}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:g(e.onKeyDown,p=>{const h=s.searchRef.current!=="";e.disabled||h&&p.key===" "||tn[a.dir].includes(p.key)&&(t.onOpenChange(!0),t.content?.focus(),p.preventDefault())})})})});sr.displayName=ie;var cr="MenuSubContent",ir=c.forwardRef((e,r)=>{const t=Bt(k,e.__scopeMenu),{forceMount:a=t.forceMount,...o}=e,s=Z(k,e.__scopeMenu),i=ve(k,e.__scopeMenu),u=ar(cr,e.__scopeMenu),l=c.useRef(null),f=A(r,l);return n.jsx(ue.Provider,{scope:e.__scopeMenu,children:n.jsx(L,{present:a||s.open,children:n.jsx(ue.Slot,{scope:e.__scopeMenu,children:n.jsx(Ze,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:g(e.onFocusOutside,d=>{d.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:g(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:g(e.onKeyDown,d=>{const p=d.currentTarget.contains(d.target),h=rn[i.dir].includes(d.key);p&&h&&(s.onOpenChange(!1),u.trigger?.focus(),d.preventDefault())})})})})})});ir.displayName=cr;function lr(e){return e?"open":"closed"}function Ce(e){return e==="indeterminate"}function et(e){return Ce(e)?"indeterminate":e?"checked":"unchecked"}function Pn(e){const r=document.activeElement;for(const t of e)if(t===r||(t.focus(),document.activeElement!==r))return}function Sn(e,r){return e.map((t,a)=>e[(r+a)%e.length])}function _n(e,r,t){const o=r.length>1&&Array.from(r).every(f=>f===r[0])?r[0]:r,s=t?e.indexOf(t):-1;let i=Sn(e,Math.max(s,0));o.length===1&&(i=i.filter(f=>f!==t));const l=i.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return l!==t?l:void 0}function Rn(e,r){const{x:t,y:a}=e;let o=!1;for(let s=0,i=r.length-1;s<r.length;i=s++){const u=r[s],l=r[i],f=u.x,d=u.y,p=l.x,h=l.y;d>a!=h>a&&t<(p-f)*(a-d)/(h-d)+f&&(o=!o)}return o}function Mn(e,r){if(!r)return!1;const t={x:e.clientX,y:e.clientY};return Rn(t,r)}function de(e){return r=>r.pointerType==="mouse"?e(r):void 0}var Tn=Kt,jn=Xe,En=Wt,Nn=Vt,An=Je,Dn=Xt,In=je,On=qt,kn=Jt,Ln=er,Fn=rr,$n=or,zn=nr,Hn=sr,Gn=ir,Ee="DropdownMenu",[Un,Xa]=pe(Ee,[Gt]),D=Gt(),[Kn,ur]=Un(Ee),dr=e=>{const{__scopeDropdownMenu:r,children:t,dir:a,open:o,defaultOpen:s,onOpenChange:i,modal:u=!0}=e,l=D(r),f=c.useRef(null),[d,p]=$e({prop:o,defaultProp:s??!1,onChange:i,caller:Ee});return n.jsx(Kn,{scope:r,triggerId:we(),triggerRef:f,contentId:we(),open:d,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(h=>!h),[p]),modal:u,children:n.jsx(Tn,{...l,open:d,onOpenChange:p,dir:a,modal:u,children:t})})};dr.displayName=Ee;var pr="DropdownMenuTrigger",fr=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,disabled:a=!1,...o}=e,s=ur(pr,t),i=D(t);return n.jsx(jn,{asChild:!0,...i,children:n.jsx(I.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...o,ref:wt(r,s.triggerRef),onPointerDown:g(e.onPointerDown,u=>{!a&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:g(e.onKeyDown,u=>{a||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});fr.displayName=pr;var Bn="DropdownMenuPortal",hr=e=>{const{__scopeDropdownMenu:r,...t}=e,a=D(r);return n.jsx(En,{...a,...t})};hr.displayName=Bn;var mr="DropdownMenuContent",vr=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=ur(mr,t),s=D(t),i=c.useRef(!1);return n.jsx(Nn,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...a,ref:r,onCloseAutoFocus:g(e.onCloseAutoFocus,u=>{i.current||o.triggerRef.current?.focus(),i.current=!1,u.preventDefault()}),onInteractOutside:g(e.onInteractOutside,u=>{const l=u.detail.originalEvent,f=l.button===0&&l.ctrlKey===!0,d=l.button===2||f;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vr.displayName=mr;var Wn="DropdownMenuGroup",Vn=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(An,{...o,...a,ref:r})});Vn.displayName=Wn;var Xn="DropdownMenuLabel",Yn=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(Dn,{...o,...a,ref:r})});Yn.displayName=Xn;var qn="DropdownMenuItem",xr=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(In,{...o,...a,ref:r})});xr.displayName=qn;var Zn="DropdownMenuCheckboxItem",Jn=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(On,{...o,...a,ref:r})});Jn.displayName=Zn;var Qn="DropdownMenuRadioGroup",ea=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(kn,{...o,...a,ref:r})});ea.displayName=Qn;var ta="DropdownMenuRadioItem",ra=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(Ln,{...o,...a,ref:r})});ra.displayName=ta;var oa="DropdownMenuItemIndicator",na=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(Fn,{...o,...a,ref:r})});na.displayName=oa;var aa="DropdownMenuSeparator",sa=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx($n,{...o,...a,ref:r})});sa.displayName=aa;var ca="DropdownMenuArrow",ia=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(zn,{...o,...a,ref:r})});ia.displayName=ca;var la="DropdownMenuSubTrigger",ua=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(Hn,{...o,...a,ref:r})});ua.displayName=la;var da="DropdownMenuSubContent",pa=c.forwardRef((e,r)=>{const{__scopeDropdownMenu:t,...a}=e,o=D(t);return n.jsx(Gn,{...o,...a,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pa.displayName=da;var fa=dr,ha=fr,ma=hr,va=vr,xa=xr;function ga({...e}){return n.jsx(fa,{"data-slot":"dropdown-menu",...e})}function wa({...e}){return n.jsx(ha,{"data-slot":"dropdown-menu-trigger",...e})}function ba({className:e,sideOffset:r=4,...t}){return n.jsx(ma,{children:n.jsx(va,{"data-slot":"dropdown-menu-content",sideOffset:r,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function ut({className:e,inset:r,variant:t="default",...a}){return n.jsx(xa,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":t,className:F("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a})}function Ca(e,r){return c.useReducer((t,a)=>r[t][a]??t,e)}var tt="ScrollArea",[gr,Ya]=pe(tt),[ya,$]=gr(tt),wr=c.forwardRef((e,r)=>{const{__scopeScrollArea:t,type:a="hover",dir:o,scrollHideDelay:s=600,...i}=e,[u,l]=c.useState(null),[f,d]=c.useState(null),[p,h]=c.useState(null),[m,x]=c.useState(null),[C,b]=c.useState(null),[S,R]=c.useState(0),[N,v]=c.useState(0),[P,y]=c.useState(!1),[j,U]=c.useState(!1),_=A(r,z=>l(z)),M=gt(o);return n.jsx(ya,{scope:t,type:a,dir:M,scrollHideDelay:s,scrollArea:u,viewport:f,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:P,onScrollbarXEnabledChange:y,scrollbarY:C,onScrollbarYChange:b,scrollbarYEnabled:j,onScrollbarYEnabledChange:U,onCornerWidthChange:R,onCornerHeightChange:v,children:n.jsx(I.div,{dir:M,...i,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});wr.displayName=tt;var br="ScrollAreaViewport",Cr=c.forwardRef((e,r)=>{const{__scopeScrollArea:t,children:a,nonce:o,...s}=e,i=$(br,t),u=c.useRef(null),l=A(r,u,i.onViewportChange);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),n.jsx(I.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:n.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Cr.displayName=br;var G="ScrollAreaScrollbar",yr=c.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=$(G,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,u=e.orientation==="horizontal";return c.useEffect(()=>(u?s(!0):i(!0),()=>{u?s(!1):i(!1)}),[u,s,i]),o.type==="hover"?n.jsx(Pa,{...a,ref:r,forceMount:t}):o.type==="scroll"?n.jsx(Sa,{...a,ref:r,forceMount:t}):o.type==="auto"?n.jsx(Pr,{...a,ref:r,forceMount:t}):o.type==="always"?n.jsx(rt,{...a,ref:r}):null});yr.displayName=G;var Pa=c.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=$(G,e.__scopeScrollArea),[s,i]=c.useState(!1);return c.useEffect(()=>{const u=o.scrollArea;let l=0;if(u){const f=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),n.jsx(L,{present:t||s,children:n.jsx(Pr,{"data-state":s?"visible":"hidden",...a,ref:r})})}),Sa=c.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=$(G,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Ae(()=>l("SCROLL_END"),100),[u,l]=Ca("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return c.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,o.scrollHideDelay,l]),c.useEffect(()=>{const f=o.viewport,d=s?"scrollLeft":"scrollTop";if(f){let p=f[d];const h=()=>{const m=f[d];p!==m&&(l("SCROLL"),i()),p=m};return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,s,l,i]),n.jsx(L,{present:t||u!=="hidden",children:n.jsx(rt,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:r,onPointerEnter:g(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:g(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Pr=c.forwardRef((e,r)=>{const t=$(G,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,i]=c.useState(!1),u=e.orientation==="horizontal",l=Ae(()=>{if(t.viewport){const f=t.viewport.offsetWidth<t.viewport.scrollWidth,d=t.viewport.offsetHeight<t.viewport.scrollHeight;i(u?f:d)}},10);return ne(t.viewport,l),ne(t.content,l),n.jsx(L,{present:a||s,children:n.jsx(rt,{"data-state":s?"visible":"hidden",...o,ref:r})})}),rt=c.forwardRef((e,r)=>{const{orientation:t="vertical",...a}=e,o=$(G,e.__scopeScrollArea),s=c.useRef(null),i=c.useRef(0),[u,l]=c.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Tr(u.viewport,u.content),d={...a,sizes:u,onSizesChange:l,hasThumb:f>0&&f<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function p(h,m){return Ea(h,i.current,u,m)}return t==="horizontal"?n.jsx(_a,{...d,ref:r,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollLeft,m=dt(h,u,o.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}}):t==="vertical"?n.jsx(Ra,{...d,ref:r,onThumbPositionChange:()=>{if(o.viewport&&s.current){const h=o.viewport.scrollTop,m=dt(h,u);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}}):null}),_a=c.forwardRef((e,r)=>{const{sizes:t,onSizesChange:a,...o}=e,s=$(G,e.__scopeScrollArea),[i,u]=c.useState(),l=c.useRef(null),f=A(r,l,s.onScrollbarXChange);return c.useEffect(()=>{l.current&&u(getComputedStyle(l.current))},[l]),n.jsx(_r,{"data-orientation":"horizontal",...o,ref:f,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ne(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Er(h,p)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Pe(i.paddingLeft),paddingEnd:Pe(i.paddingRight)}})}})}),Ra=c.forwardRef((e,r)=>{const{sizes:t,onSizesChange:a,...o}=e,s=$(G,e.__scopeScrollArea),[i,u]=c.useState(),l=c.useRef(null),f=A(r,l,s.onScrollbarYChange);return c.useEffect(()=>{l.current&&u(getComputedStyle(l.current))},[l]),n.jsx(_r,{"data-orientation":"vertical",...o,ref:f,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ne(t)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Er(h,p)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Pe(i.paddingTop),paddingEnd:Pe(i.paddingBottom)}})}})}),[Ma,Sr]=gr(G),_r=c.forwardRef((e,r)=>{const{__scopeScrollArea:t,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:u,onThumbPositionChange:l,onDragScroll:f,onWheelScroll:d,onResize:p,...h}=e,m=$(G,t),[x,C]=c.useState(null),b=A(r,_=>C(_)),S=c.useRef(null),R=c.useRef(""),N=m.viewport,v=a.content-a.viewport,P=W(d),y=W(l),j=Ae(p,10);function U(_){if(S.current){const M=_.clientX-S.current.left,z=_.clientY-S.current.top;f({x:M,y:z})}}return c.useEffect(()=>{const _=M=>{const z=M.target;x?.contains(z)&&P(M,v)};return document.addEventListener("wheel",_,{passive:!1}),()=>document.removeEventListener("wheel",_,{passive:!1})},[N,x,v,P]),c.useEffect(y,[a,y]),ne(x,j),ne(m.content,j),n.jsx(Ma,{scope:t,scrollbar:x,hasThumb:o,onThumbChange:W(s),onThumbPointerUp:W(i),onThumbPositionChange:y,onThumbPointerDown:W(u),children:n.jsx(I.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:g(e.onPointerDown,_=>{_.button===0&&(_.target.setPointerCapture(_.pointerId),S.current=x.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),U(_))}),onPointerMove:g(e.onPointerMove,U),onPointerUp:g(e.onPointerUp,_=>{const M=_.target;M.hasPointerCapture(_.pointerId)&&M.releasePointerCapture(_.pointerId),document.body.style.webkitUserSelect=R.current,m.viewport&&(m.viewport.style.scrollBehavior=""),S.current=null})})})}),ye="ScrollAreaThumb",Rr=c.forwardRef((e,r)=>{const{forceMount:t,...a}=e,o=Sr(ye,e.__scopeScrollArea);return n.jsx(L,{present:t||o.hasThumb,children:n.jsx(Ta,{ref:r,...a})})}),Ta=c.forwardRef((e,r)=>{const{__scopeScrollArea:t,style:a,...o}=e,s=$(ye,t),i=Sr(ye,t),{onThumbPositionChange:u}=i,l=A(r,p=>i.onThumbChange(p)),f=c.useRef(void 0),d=Ae(()=>{f.current&&(f.current(),f.current=void 0)},100);return c.useEffect(()=>{const p=s.viewport;if(p){const h=()=>{if(d(),!f.current){const m=Na(p,u);f.current=m,u()}};return u(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[s.viewport,d,u]),n.jsx(I.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:g(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),x=p.clientX-m.left,C=p.clientY-m.top;i.onThumbPointerDown({x,y:C})}),onPointerUp:g(e.onPointerUp,i.onThumbPointerUp)})});Rr.displayName=ye;var ot="ScrollAreaCorner",Mr=c.forwardRef((e,r)=>{const t=$(ot,e.__scopeScrollArea),a=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&a?n.jsx(ja,{...e,ref:r}):null});Mr.displayName=ot;var ja=c.forwardRef((e,r)=>{const{__scopeScrollArea:t,...a}=e,o=$(ot,t),[s,i]=c.useState(0),[u,l]=c.useState(0),f=!!(s&&u);return ne(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),ne(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),i(d)}),f?n.jsx(I.div,{...a,ref:r,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Pe(e){return e?parseInt(e,10):0}function Tr(e,r){const t=e/r;return isNaN(t)?0:t}function Ne(e){const r=Tr(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-t)*r;return Math.max(a,18)}function Ea(e,r,t,a="ltr"){const o=Ne(t),s=o/2,i=r||s,u=o-i,l=t.scrollbar.paddingStart+i,f=t.scrollbar.size-t.scrollbar.paddingEnd-u,d=t.content-t.viewport,p=a==="ltr"?[0,d]:[d*-1,0];return jr([l,f],p)(e)}function dt(e,r,t="ltr"){const a=Ne(r),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,s=r.scrollbar.size-o,i=r.content-r.viewport,u=s-a,l=t==="ltr"?[0,i]:[i*-1,0],f=Hr(e,l);return jr([0,i],[0,u])(f)}function jr(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const a=(r[1]-r[0])/(e[1]-e[0]);return r[0]+a*(t-e[0])}}function Er(e,r){return e>0&&e<r}var Na=(e,r=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},a=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=t.left!==s.left,u=t.top!==s.top;(i||u)&&r(),t=s,a=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(a)};function Ae(e,r){const t=W(e),a=c.useRef(0);return c.useEffect(()=>()=>window.clearTimeout(a.current),[]),c.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(t,r)},[t,r])}function ne(e,r){const t=W(r);zr(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(t)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,t])}var Aa=wr,Da=Cr,Ia=Mr;function Oa({className:e,children:r,...t}){return n.jsxs(Aa,{"data-slot":"scroll-area",className:F("relative",e),...t,children:[n.jsx(Da,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:r}),n.jsx(ka,{}),n.jsx(Ia,{})]})}function ka({className:e,orientation:r="vertical",...t}){return n.jsx(yr,{"data-slot":"scroll-area-scrollbar",orientation:r,className:F("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...t,children:n.jsx(Rr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function La({className:e,...r}){return n.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:n.jsx("table",{"data-slot":"table",className:F("w-full caption-bottom text-sm",e),...r})})}function Fa({className:e,...r}){return n.jsx("thead",{"data-slot":"table-header",className:F("[&_tr]:border-b",e),...r})}function $a({className:e,...r}){return n.jsx("tbody",{"data-slot":"table-body",className:F("[&_tr:last-child]:border-0",e),...r})}function xe({className:e,...r}){return n.jsx("tr",{"data-slot":"table-row",className:F("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function ge({className:e,...r}){return n.jsx("th",{"data-slot":"table-head",className:F("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function te({className:e,...r}){return n.jsx("td",{"data-slot":"table-cell",className:F("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function za(e,r,t,a){var o=this,s=c.useRef(null),i=c.useRef(0),u=c.useRef(0),l=c.useRef(null),f=c.useRef([]),d=c.useRef(),p=c.useRef(),h=c.useRef(e),m=c.useRef(!0);h.current=e;var x=typeof window<"u",C=!r&&r!==0&&x;if(typeof e!="function")throw new TypeError("Expected a function");r=+r||0;var b=!!(t=t||{}).leading,S=!("trailing"in t)||!!t.trailing,R="maxWait"in t,N="debounceOnServer"in t&&!!t.debounceOnServer,v=R?Math.max(+t.maxWait||0,r):null;c.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var P=c.useMemo(function(){var y=function(T){var E=f.current,J=d.current;return f.current=d.current=null,i.current=T,u.current=u.current||T,p.current=h.current.apply(J,E)},j=function(T,E){C&&cancelAnimationFrame(l.current),l.current=C?requestAnimationFrame(T):setTimeout(T,E)},U=function(T){if(!m.current)return!1;var E=T-s.current;return!s.current||E>=r||E<0||R&&T-i.current>=v},_=function(T){return l.current=null,S&&f.current?y(T):(f.current=d.current=null,p.current)},M=function T(){var E=Date.now();if(b&&u.current===i.current&&z(),U(E))return _(E);if(m.current){var J=r-(E-s.current),De=R?Math.min(J,v-(E-i.current)):J;j(T,De)}},z=function(){a&&a({})},K=function(){if(x||N){var T=Date.now(),E=U(T);if(f.current=[].slice.call(arguments),d.current=o,s.current=T,E){if(!l.current&&m.current)return i.current=s.current,j(M,r),b?y(s.current):p.current;if(R)return j(M,r),y(s.current)}return l.current||j(M,r),p.current}};return K.cancel=function(){l.current&&(C?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,f.current=s.current=d.current=l.current=null},K.isPending=function(){return!!l.current},K.flush=function(){return l.current?_(Date.now()):p.current},K},[b,R,r,v,S,C,x,N,a]);return P}function Ha(e,r){return e===r}function Ga(e,r,t){var a=Ha,o=c.useRef(e),s=c.useState({})[1],i=za(c.useCallback(function(l){o.current=l,s({})},[s]),r,t,s),u=c.useRef(e);return a(u.current,e)||(i(e),u.current=e),[o.current,i]}function qa(){const[e,r]=c.useState(""),[t,a]=c.useState({}),[o,s]=c.useState(1),[i]=Ga(e,400),u=c.useMemo(()=>["products",{currentPage:o,search:i,filter:t}],[o,i,t]),{data:l,isFetching:f}=ct({queryKey:u,queryFn:async()=>await H.apiRequest("index",Vr({skip:(o-1)*H.item_per_page,where:{productModelCode:e,status_listing:t?.statusFilter==="all"?void 0:t.statusFilter}}))}),{data:d}=ct({queryKey:["publised-products"],queryFn:async()=>await H.apiRequest("getPublistedProducts",{})??[],staleTime:0,refetchOnMount:"always"}),p=Gr({mutationKey:["action-mutaions"],mutationFn:async v=>{if(v.status)return H.apiRequest("unlist",v);const P=await H.apiRequest("get",v);if(!(!P||!P?.data))return H.apiRequest("publist",{...v,images:it({...P?.data}).images})}}),h=c.useMemo(()=>!l||!l?.data?[]:l?.data.map(v=>it(v)),[l]),m=v=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(v),x=()=>{r(""),a({statusFilter:""}),s(1)},C=[t.statusFilter,e!==""].filter(Boolean).length,b=c.useMemo(()=>l?.total?Math.ceil(l.total/H.item_per_page):0,[l?.total,H.item_per_page]),S=c.useMemo(()=>(o-1)*H.item_per_page+1,[o]),R=c.useMemo(()=>Math.min(o*H.item_per_page,l?.total??0),[o,l]),N=async v=>{console.log({post:v}),p.mutate(v)};return n.jsxs(Xo,{children:[n.jsx(Zo,{}),n.jsx(qo,{side:"left",align:"end",className:"w-auto",children:n.jsxs("div",{className:"space-y-4 h-[78vh] min-w-[638px]",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(ao,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),n.jsx(Ur,{placeholder:"Search...",value:e,onChange:v=>r(v.target.value),className:"pl-10"})]}),n.jsx(Jo,{filter:t,setFilter:a,activeFiltersCount:C,clearFilters:x})]}),n.jsxs("div",{className:"flex items-center justify-between w-full gap-8",children:[n.jsxs("span",{children:["Showing ",S,"-",R," of ",l?.total??0," products"]}),b>1&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(B,{variant:"outline",size:"xs",onClick:()=>s(v=>Math.max(1,v-1)),disabled:o===1,children:[n.jsx(Yr,{}),"Previous"]}),n.jsx("div",{className:"flex items-center gap-1",children:b<=7?Array.from({length:b},(v,P)=>n.jsx(B,{variant:o===P+1?"default":"outline",size:"xs",onClick:()=>s(P+1),children:P+1},P+1)):n.jsxs(n.Fragment,{children:[n.jsx(B,{variant:o===1?"default":"outline",size:"xs",onClick:()=>s(1),children:"1"}),o>4&&n.jsx("span",{className:"px-2 text-muted-foreground",children:"..."}),Array.from({length:3},(v,P)=>{let y;return o<=4?y=P+2:o>=b-3?y=b-4+P:y=o-1+P,y>1&&y<b?n.jsx(B,{variant:o===y?"default":"outline",size:"xs",onClick:()=>s(y),children:y},y):null}).filter(Boolean),o<b-3&&n.jsx("span",{className:"px-2 text-muted-foreground",children:"..."}),n.jsx(B,{variant:o===b?"default":"outline",size:"xs",onClick:()=>s(b),children:b})]})}),n.jsxs(B,{variant:"outline",size:"xs",onClick:()=>s(v=>Math.min(b,v+1)),disabled:o===b,children:["Next",n.jsx(Zr,{})]})]})]}),n.jsx("div",{className:"rounded-md border overflow-x-auto relative",children:n.jsx(Oa,{className:"h-[66vh] w-full",children:n.jsxs(La,{className:"h-fit",children:[n.jsx(Fa,{children:n.jsxs(xe,{children:[n.jsx(ge,{className:"min-w-[200px]",children:"Name"}),n.jsx(ge,{className:"w-[80px]",children:"Price"}),n.jsx(ge,{className:"w-[80px]",children:"Status"}),n.jsx(ge,{className:"w-[80px] text-center sticky right-0 bg-background border-l shadow-[-4px_0_8px_rgba(0,0,0,0.1)]",children:"Actions"})]})}),n.jsxs($a,{className:"relative",children:[f&&n.jsx(xe,{children:n.jsx(te,{colSpan:10,className:"text-center py-8 text-muted-foreground ",children:n.jsx("div",{className:"h-full flex items-center justify-center w-full",children:n.jsx(Kr,{})})})}),h.length===0&&!f?n.jsx(xe,{children:n.jsx(te,{colSpan:10,className:"text-center py-8 text-muted-foreground",children:n.jsx("div",{className:"h-full flex items-center justify-center w-full",children:n.jsx("span",{children:" No products found"})})})}):h.map(v=>{const P=d?.some(y=>y.title.includes(v.sku));return v.status=P,n.jsxs(xe,{children:[n.jsxs(te,{className:"font-medium",children:[n.jsx("div",{className:"truncate max-w-[340px] w-fit",title:v.title,children:v.title}),n.jsx("div",{className:"text-sm text-muted-foreground truncate max-w-[340px]",title:v.description,children:v.description})]}),n.jsx(te,{className:"font-semibold",children:m(v.price)}),n.jsx(te,{children:n.jsx(Br,{variant:"secondary",children:v?.status?"Listed":"Unlisted"})}),n.jsx(te,{className:"text-center sticky right-0 bg-background border-l shadow-[-4px_0_8px_rgba(0,0,0,0.1)]",children:n.jsxs(ga,{children:[n.jsx(wa,{asChild:!0,children:n.jsx("div",{className:"w-full flex items-center justify-center",children:n.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 mx-auto",children:n.jsx(to,{className:"h-4 w-4"})})})}),n.jsxs(ba,{align:"end",children:[n.jsx(Wr,{data:v,children:n.jsxs(ut,{onSelect:y=>{y.preventDefault(),y.stopPropagation()},children:[n.jsx(co,{className:"h-4 w-4 mr-2"})," Review"]})}),n.jsxs(ut,{onClick:()=>N(v),children:[v.status?n.jsx(bt,{className:"h-4 w-4 mr-2"}):n.jsx(Ct,{className:"h-4 w-4 mr-2"}),v.status?"Unlist":"List"]})]})]})})]},v.id)})]})]})})})]})})]})}export{qa as P};
