import{c as O,x as Ln,j as n,T as Ce,i as be,k as ye,l as _e,m as Fn,n as ke,A as Se,r as s,B as $n,C as Z,p as U,q as x,D as Gn,E as Kn,P as L,F as Ie,G as Un,H as Ee,I as Bn,J as zn,K as Vn,M as Hn,o as Xn,v as je,a as D,f as Yn,t as ae,L as Ne}from"./index-D5aSL5Lk.js";import{C as Wn,a as qn}from"./card-Xe3d9dhi.js";import{B as Pe}from"./Footer-B625QnUy.js";import{O as Zn}from"./OptimizedImage-BDiwQDT8.js";import{C as Jn}from"./checkbox-CzTzIcmO.js";import{C as ie}from"./check-DCNsCDBV.js";import{u as Qn}from"./index-CeP29QIk.js";import{h as et,u as nt,F as tt,R as ot}from"./Header-CQ-hRMFy.js";import{c as Te,R as rt,I as at}from"./index-CL0xAu-I.js";import{C as st}from"./chevron-right-Dnq_A__P.js";import{g as ct}from"./seoHelpers-DphZaCAd.js";import{E as it}from"./external-link-RH3nu8XI.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dt=O("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lt=O("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ut=O("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pt=O("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Re=O("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ft=O("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]),mt=({productId:e,variant:o="default",className:t=""})=>{const{comparisonIds:r,addToComparison:a,removeFromComparison:c,isInComparison:l}=Ln(),d=l(e),u=!d&&r.length>=4,h=()=>{d?c(e):a(e)};return o==="button"?n.jsx(Ce,{children:n.jsxs(be,{children:[n.jsx(ye,{asChild:!0,children:n.jsx("button",{onClick:h,disabled:u,className:`flex items-center gap-2 px-4 py-2 rounded-md border transition-colors ${d?"bg-primary text-primary-foreground border-primary":u?"bg-muted text-muted-foreground border-muted cursor-not-allowed":"bg-background hover:bg-accent border-input"} ${t}`,children:d?n.jsxs(n.Fragment,{children:[n.jsx(ie,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm font-medium",children:"În comparație"})]}):n.jsx("span",{className:"text-sm font-medium",children:"Adaugă la comparație"})})}),u&&n.jsx(_e,{children:n.jsx("p",{children:"Maxim 4 produse pot fi comparate"})})]})}):n.jsx(Ce,{children:n.jsxs(be,{children:[n.jsx(ye,{asChild:!0,children:n.jsxs("div",{className:`flex items-center gap-2 ${t}`,children:[n.jsx(Jn,{id:`compare-${e}`,checked:d,onCheckedChange:h,disabled:u}),n.jsx("label",{htmlFor:`compare-${e}`,className:`text-sm cursor-pointer select-none ${u?"text-muted-foreground":""}`,children:d?"În comparație":"Compară"})]})}),u&&n.jsx(_e,{children:n.jsx("p",{children:"Maxim 4 produse pot fi comparate"})})]})})};var se=["Enter"," "],ht=["ArrowDown","PageUp","Home"],Ae=["ArrowUp","PageDown","End"],xt=[...ht,...Ae],wt={ltr:[...se,"ArrowRight"],rtl:[...se,"ArrowLeft"]},gt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},B="Menu",[G,vt,Mt]=Fn(B),[S,Oe]=ke(B,[Mt,Se,Te]),J=Se(),Le=Te(),[Ct,I]=S(B),[bt,z]=S(B),Fe=e=>{const{__scopeMenu:o,open:t=!1,children:r,dir:a,onOpenChange:c,modal:l=!0}=e,d=J(o),[u,h]=s.useState(null),p=s.useRef(!1),i=Ie(c),m=Qn(a);return s.useEffect(()=>{const w=()=>{p.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>p.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),n.jsx(Hn,{...d,children:n.jsx(Ct,{scope:o,open:t,onOpenChange:i,content:u,onContentChange:h,children:n.jsx(bt,{scope:o,onClose:s.useCallback(()=>i(!1),[i]),isUsingKeyboardRef:p,dir:m,modal:l,children:r})})})};Fe.displayName=B;var yt="MenuAnchor",de=s.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e,a=J(t);return n.jsx($n,{...a,...r,ref:o})});de.displayName=yt;var le="MenuPortal",[_t,$e]=S(le,{forceMount:void 0}),Ge=e=>{const{__scopeMenu:o,forceMount:t,children:r,container:a}=e,c=I(le,o);return n.jsx(_t,{scope:o,forceMount:t,children:n.jsx(Z,{present:t||c.open,children:n.jsx(zn,{asChild:!0,container:a,children:r})})})};Ge.displayName=le;var b="MenuContent",[jt,ue]=S(b),Ke=s.forwardRef((e,o)=>{const t=$e(b,e.__scopeMenu),{forceMount:r=t.forceMount,...a}=e,c=I(b,e.__scopeMenu),l=z(b,e.__scopeMenu);return n.jsx(G.Provider,{scope:e.__scopeMenu,children:n.jsx(Z,{present:r||c.open,children:n.jsx(G.Slot,{scope:e.__scopeMenu,children:l.modal?n.jsx(Nt,{...a,ref:o}):n.jsx(Rt,{...a,ref:o})})})})}),Nt=s.forwardRef((e,o)=>{const t=I(b,e.__scopeMenu),r=s.useRef(null),a=U(o,r);return s.useEffect(()=>{const c=r.current;if(c)return et(c)},[]),n.jsx(pe,{...e,ref:a,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:x(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Rt=s.forwardRef((e,o)=>{const t=I(b,e.__scopeMenu);return n.jsx(pe,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Dt=Vn("MenuContent.ScrollLock"),pe=s.forwardRef((e,o)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:l,disableOutsidePointerEvents:d,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:i,onInteractOutside:m,onDismiss:w,disableOutsideScroll:g,..._}=e,M=I(b,t),N=z(b,t),k=J(t),E=Le(t),V=vt(t),[In,xe]=s.useState(null),H=s.useRef(null),En=U(o,H,M.onContentChange),X=s.useRef(0),Y=s.useRef(""),Pn=s.useRef(0),ne=s.useRef(null),we=s.useRef("right"),te=s.useRef(0),Tn=g?ot:s.Fragment,An=g?{as:Dt,allowPinchZoom:!0}:void 0,On=f=>{var T,ve;const C=Y.current+f,y=V().filter(j=>!j.disabled),R=document.activeElement,oe=(T=y.find(j=>j.ref.current===R))==null?void 0:T.textValue,re=y.map(j=>j.textValue),ge=Gt(re,C,oe),F=(ve=y.find(j=>j.textValue===ge))==null?void 0:ve.ref.current;(function j(Me){Y.current=Me,window.clearTimeout(X.current),Me!==""&&(X.current=window.setTimeout(()=>j(""),1e3))})(C),F&&setTimeout(()=>F.focus())};s.useEffect(()=>()=>window.clearTimeout(X.current),[]),nt();const P=s.useCallback(f=>{var y,R;return we.current===((y=ne.current)==null?void 0:y.side)&&Ut(f,(R=ne.current)==null?void 0:R.area)},[]);return n.jsx(jt,{scope:t,searchRef:Y,onItemEnter:s.useCallback(f=>{P(f)&&f.preventDefault()},[P]),onItemLeave:s.useCallback(f=>{var C;P(f)||((C=H.current)==null||C.focus(),xe(null))},[P]),onTriggerLeave:s.useCallback(f=>{P(f)&&f.preventDefault()},[P]),pointerGraceTimerRef:Pn,onPointerGraceIntentChange:s.useCallback(f=>{ne.current=f},[]),children:n.jsx(Tn,{...An,children:n.jsx(tt,{asChild:!0,trapped:a,onMountAutoFocus:x(c,f=>{var C;f.preventDefault(),(C=H.current)==null||C.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:n.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:i,onInteractOutside:m,onDismiss:w,children:n.jsx(rt,{asChild:!0,...E,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:In,onCurrentTabStopIdChange:xe,onEntryFocus:x(u,f=>{N.isUsingKeyboardRef.current||f.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(Kn,{role:"menu","aria-orientation":"vertical","data-state":on(M.open),"data-radix-menu-content":"",dir:N.dir,...k,..._,ref:En,style:{outline:"none",..._.style},onKeyDown:x(_.onKeyDown,f=>{const y=f.target.closest("[data-radix-menu-content]")===f.currentTarget,R=f.ctrlKey||f.altKey||f.metaKey,oe=f.key.length===1;y&&(f.key==="Tab"&&f.preventDefault(),!R&&oe&&On(f.key));const re=H.current;if(f.target!==re||!xt.includes(f.key))return;f.preventDefault();const F=V().filter(T=>!T.disabled).map(T=>T.ref.current);Ae.includes(f.key)&&F.reverse(),Ft(F)}),onBlur:x(e.onBlur,f=>{f.currentTarget.contains(f.target)||(window.clearTimeout(X.current),Y.current="")}),onPointerMove:x(e.onPointerMove,K(f=>{const C=f.target,y=te.current!==f.clientX;if(f.currentTarget.contains(C)&&y){const R=f.clientX>te.current?"right":"left";we.current=R,te.current=f.clientX}}))})})})})})})});Ke.displayName=b;var kt="MenuGroup",fe=s.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx(L.div,{role:"group",...r,ref:o})});fe.displayName=kt;var St="MenuLabel",Ue=s.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx(L.div,{...r,ref:o})});Ue.displayName=St;var W="MenuItem",De="menu.itemSelect",Q=s.forwardRef((e,o)=>{const{disabled:t=!1,onSelect:r,...a}=e,c=s.useRef(null),l=z(W,e.__scopeMenu),d=ue(W,e.__scopeMenu),u=U(o,c),h=s.useRef(!1),p=()=>{const i=c.current;if(!t&&i){const m=new CustomEvent(De,{bubbles:!0,cancelable:!0});i.addEventListener(De,w=>r==null?void 0:r(w),{once:!0}),Bn(i,m),m.defaultPrevented?h.current=!1:l.onClose()}};return n.jsx(Be,{...a,ref:u,disabled:t,onClick:x(e.onClick,p),onPointerDown:i=>{var m;(m=e.onPointerDown)==null||m.call(e,i),h.current=!0},onPointerUp:x(e.onPointerUp,i=>{var m;h.current||(m=i.currentTarget)==null||m.click()}),onKeyDown:x(e.onKeyDown,i=>{const m=d.searchRef.current!=="";t||m&&i.key===" "||se.includes(i.key)&&(i.currentTarget.click(),i.preventDefault())})})});Q.displayName=W;var Be=s.forwardRef((e,o)=>{const{__scopeMenu:t,disabled:r=!1,textValue:a,...c}=e,l=ue(W,t),d=Le(t),u=s.useRef(null),h=U(o,u),[p,i]=s.useState(!1),[m,w]=s.useState("");return s.useEffect(()=>{const g=u.current;g&&w((g.textContent??"").trim())},[c.children]),n.jsx(G.ItemSlot,{scope:t,disabled:r,textValue:a??m,children:n.jsx(at,{asChild:!0,...d,focusable:!r,children:n.jsx(L.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:h,onPointerMove:x(e.onPointerMove,K(g=>{r?l.onItemLeave(g):(l.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:x(e.onPointerLeave,K(g=>l.onItemLeave(g))),onFocus:x(e.onFocus,()=>i(!0)),onBlur:x(e.onBlur,()=>i(!1))})})})}),It="MenuCheckboxItem",ze=s.forwardRef((e,o)=>{const{checked:t=!1,onCheckedChange:r,...a}=e;return n.jsx(We,{scope:e.__scopeMenu,checked:t,children:n.jsx(Q,{role:"menuitemcheckbox","aria-checked":q(t)?"mixed":t,...a,ref:o,"data-state":he(t),onSelect:x(a.onSelect,()=>r==null?void 0:r(q(t)?!0:!t),{checkForDefaultPrevented:!1})})})});ze.displayName=It;var Ve="MenuRadioGroup",[Et,Pt]=S(Ve,{value:void 0,onValueChange:()=>{}}),He=s.forwardRef((e,o)=>{const{value:t,onValueChange:r,...a}=e,c=Ie(r);return n.jsx(Et,{scope:e.__scopeMenu,value:t,onValueChange:c,children:n.jsx(fe,{...a,ref:o})})});He.displayName=Ve;var Xe="MenuRadioItem",Ye=s.forwardRef((e,o)=>{const{value:t,...r}=e,a=Pt(Xe,e.__scopeMenu),c=t===a.value;return n.jsx(We,{scope:e.__scopeMenu,checked:c,children:n.jsx(Q,{role:"menuitemradio","aria-checked":c,...r,ref:o,"data-state":he(c),onSelect:x(r.onSelect,()=>{var l;return(l=a.onValueChange)==null?void 0:l.call(a,t)},{checkForDefaultPrevented:!1})})})});Ye.displayName=Xe;var me="MenuItemIndicator",[We,Tt]=S(me,{checked:!1}),qe=s.forwardRef((e,o)=>{const{__scopeMenu:t,forceMount:r,...a}=e,c=Tt(me,t);return n.jsx(Z,{present:r||q(c.checked)||c.checked===!0,children:n.jsx(L.span,{...a,ref:o,"data-state":he(c.checked)})})});qe.displayName=me;var At="MenuSeparator",Ze=s.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e;return n.jsx(L.div,{role:"separator","aria-orientation":"horizontal",...r,ref:o})});Ze.displayName=At;var Ot="MenuArrow",Je=s.forwardRef((e,o)=>{const{__scopeMenu:t,...r}=e,a=J(t);return n.jsx(Un,{...a,...r,ref:o})});Je.displayName=Ot;var Lt="MenuSub",[Vo,Qe]=S(Lt),$="MenuSubTrigger",en=s.forwardRef((e,o)=>{const t=I($,e.__scopeMenu),r=z($,e.__scopeMenu),a=Qe($,e.__scopeMenu),c=ue($,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=c,h={__scopeMenu:e.__scopeMenu},p=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>p,[p]),s.useEffect(()=>{const i=d.current;return()=>{window.clearTimeout(i),u(null)}},[d,u]),n.jsx(de,{asChild:!0,...h,children:n.jsx(Be,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":a.contentId,"data-state":on(t.open),...e,ref:Ee(o,a.onTriggerChange),onClick:i=>{var m;(m=e.onClick)==null||m.call(e,i),!(e.disabled||i.defaultPrevented)&&(i.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:x(e.onPointerMove,K(i=>{c.onItemEnter(i),!i.defaultPrevented&&!e.disabled&&!t.open&&!l.current&&(c.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{t.onOpenChange(!0),p()},100))})),onPointerLeave:x(e.onPointerLeave,K(i=>{var w,g;p();const m=(w=t.content)==null?void 0:w.getBoundingClientRect();if(m){const _=(g=t.content)==null?void 0:g.dataset.side,M=_==="right",N=M?-5:5,k=m[M?"left":"right"],E=m[M?"right":"left"];c.onPointerGraceIntentChange({area:[{x:i.clientX+N,y:i.clientY},{x:k,y:m.top},{x:E,y:m.top},{x:E,y:m.bottom},{x:k,y:m.bottom}],side:_}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(i),i.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:x(e.onKeyDown,i=>{var w;const m=c.searchRef.current!=="";e.disabled||m&&i.key===" "||wt[r.dir].includes(i.key)&&(t.onOpenChange(!0),(w=t.content)==null||w.focus(),i.preventDefault())})})})});en.displayName=$;var nn="MenuSubContent",tn=s.forwardRef((e,o)=>{const t=$e(b,e.__scopeMenu),{forceMount:r=t.forceMount,...a}=e,c=I(b,e.__scopeMenu),l=z(b,e.__scopeMenu),d=Qe(nn,e.__scopeMenu),u=s.useRef(null),h=U(o,u);return n.jsx(G.Provider,{scope:e.__scopeMenu,children:n.jsx(Z,{present:r||c.open,children:n.jsx(G.Slot,{scope:e.__scopeMenu,children:n.jsx(pe,{id:d.contentId,"aria-labelledby":d.triggerId,...a,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var i;l.isUsingKeyboardRef.current&&((i=u.current)==null||i.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:x(e.onFocusOutside,p=>{p.target!==d.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:x(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:x(e.onKeyDown,p=>{var w;const i=p.currentTarget.contains(p.target),m=gt[l.dir].includes(p.key);i&&m&&(c.onOpenChange(!1),(w=d.trigger)==null||w.focus(),p.preventDefault())})})})})})});tn.displayName=nn;function on(e){return e?"open":"closed"}function q(e){return e==="indeterminate"}function he(e){return q(e)?"indeterminate":e?"checked":"unchecked"}function Ft(e){const o=document.activeElement;for(const t of e)if(t===o||(t.focus(),document.activeElement!==o))return}function $t(e,o){return e.map((t,r)=>e[(o+r)%e.length])}function Gt(e,o,t){const a=o.length>1&&Array.from(o).every(h=>h===o[0])?o[0]:o,c=t?e.indexOf(t):-1;let l=$t(e,Math.max(c,0));a.length===1&&(l=l.filter(h=>h!==t));const u=l.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return u!==t?u:void 0}function Kt(e,o){const{x:t,y:r}=e;let a=!1;for(let c=0,l=o.length-1;c<o.length;l=c++){const d=o[c],u=o[l],h=d.x,p=d.y,i=u.x,m=u.y;p>r!=m>r&&t<(i-h)*(r-p)/(m-p)+h&&(a=!a)}return a}function Ut(e,o){if(!o)return!1;const t={x:e.clientX,y:e.clientY};return Kt(t,o)}function K(e){return o=>o.pointerType==="mouse"?e(o):void 0}var Bt=Fe,zt=de,Vt=Ge,Ht=Ke,Xt=fe,Yt=Ue,Wt=Q,qt=ze,Zt=He,Jt=Ye,Qt=qe,eo=Ze,no=Je,to=en,oo=tn,ee="DropdownMenu",[ro,Ho]=ke(ee,[Oe]),v=Oe(),[ao,rn]=ro(ee),an=e=>{const{__scopeDropdownMenu:o,children:t,dir:r,open:a,defaultOpen:c,onOpenChange:l,modal:d=!0}=e,u=v(o),h=s.useRef(null),[p,i]=Xn({prop:a,defaultProp:c??!1,onChange:l,caller:ee});return n.jsx(ao,{scope:o,triggerId:je(),triggerRef:h,contentId:je(),open:p,onOpenChange:i,onOpenToggle:s.useCallback(()=>i(m=>!m),[i]),modal:d,children:n.jsx(Bt,{...u,open:p,onOpenChange:i,dir:r,modal:d,children:t})})};an.displayName=ee;var sn="DropdownMenuTrigger",cn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...a}=e,c=rn(sn,t),l=v(t);return n.jsx(zt,{asChild:!0,...l,children:n.jsx(L.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Ee(o,c.triggerRef),onPointerDown:x(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(c.onOpenToggle(),c.open||d.preventDefault())}),onKeyDown:x(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&c.onOpenToggle(),d.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});cn.displayName=sn;var so="DropdownMenuPortal",dn=e=>{const{__scopeDropdownMenu:o,...t}=e,r=v(o);return n.jsx(Vt,{...r,...t})};dn.displayName=so;var ln="DropdownMenuContent",un=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=rn(ln,t),c=v(t),l=s.useRef(!1);return n.jsx(Ht,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...r,ref:o,onCloseAutoFocus:x(e.onCloseAutoFocus,d=>{var u;l.current||(u=a.triggerRef.current)==null||u.focus(),l.current=!1,d.preventDefault()}),onInteractOutside:x(e.onInteractOutside,d=>{const u=d.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,p=u.button===2||h;(!a.modal||p)&&(l.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)"}})});un.displayName=ln;var co="DropdownMenuGroup",io=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Xt,{...a,...r,ref:o})});io.displayName=co;var lo="DropdownMenuLabel",pn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Yt,{...a,...r,ref:o})});pn.displayName=lo;var uo="DropdownMenuItem",fn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Wt,{...a,...r,ref:o})});fn.displayName=uo;var po="DropdownMenuCheckboxItem",mn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(qt,{...a,...r,ref:o})});mn.displayName=po;var fo="DropdownMenuRadioGroup",mo=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Zt,{...a,...r,ref:o})});mo.displayName=fo;var ho="DropdownMenuRadioItem",hn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Jt,{...a,...r,ref:o})});hn.displayName=ho;var xo="DropdownMenuItemIndicator",xn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(Qt,{...a,...r,ref:o})});xn.displayName=xo;var wo="DropdownMenuSeparator",wn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(eo,{...a,...r,ref:o})});wn.displayName=wo;var go="DropdownMenuArrow",vo=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(no,{...a,...r,ref:o})});vo.displayName=go;var Mo="DropdownMenuSubTrigger",gn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(to,{...a,...r,ref:o})});gn.displayName=Mo;var Co="DropdownMenuSubContent",vn=s.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...r}=e,a=v(t);return n.jsx(oo,{...a,...r,ref:o,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)"}})});vn.displayName=Co;var bo=an,yo=cn,_o=dn,Mn=un,Cn=pn,bn=fn,yn=mn,_n=hn,jn=xn,Nn=wn,Rn=gn,Dn=vn;const jo=bo,No=yo,Ro=s.forwardRef(({className:e,inset:o,children:t,...r},a)=>n.jsxs(Rn,{ref:a,className:D("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",o&&"pl-8",e),...r,children:[t,n.jsx(st,{className:"ml-auto h-4 w-4"})]}));Ro.displayName=Rn.displayName;const Do=s.forwardRef(({className:e,...o},t)=>n.jsx(Dn,{ref:t,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...o}));Do.displayName=Dn.displayName;const kn=s.forwardRef(({className:e,sideOffset:o=4,...t},r)=>n.jsx(_o,{children:n.jsx(Mn,{ref:r,sideOffset:o,className:D("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",e),...t})}));kn.displayName=Mn.displayName;const A=s.forwardRef(({className:e,inset:o,...t},r)=>n.jsx(bn,{ref:r,className:D("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",o&&"pl-8",e),...t}));A.displayName=bn.displayName;const ko=s.forwardRef(({className:e,children:o,checked:t,...r},a)=>n.jsxs(yn,{ref:a,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:t,...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(jn,{children:n.jsx(ie,{className:"h-4 w-4"})})}),o]}));ko.displayName=yn.displayName;const So=s.forwardRef(({className:e,children:o,...t},r)=>n.jsxs(_n,{ref:r,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...t,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(jn,{children:n.jsx(dt,{className:"h-2 w-2 fill-current"})})}),o]}));So.displayName=_n.displayName;const Io=s.forwardRef(({className:e,inset:o,...t},r)=>n.jsx(Cn,{ref:r,className:D("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",e),...t}));Io.displayName=Cn.displayName;const ce=s.forwardRef(({className:e,...o},t)=>n.jsx(Nn,{ref:t,className:D("-mx-1 my-1 h-px bg-muted",e),...o}));ce.displayName=Nn.displayName;const Eo=({url:e,title:o,description:t,price:r,variant:a="outline",size:c="default"})=>{const{toast:l}=Yn(),[d,u]=s.useState(!1),h=r?`${o} - doar ${r.toFixed(2)} RON! 🛍️`:o,p=encodeURIComponent(e),i=encodeURIComponent(h),m={facebook:`https://www.facebook.com/sharer/sharer.php?u=${p}&quote=${i}`,twitter:`https://twitter.com/intent/tweet?text=${i}&url=${p}`,whatsapp:`https://wa.me/?text=${i}%20${p}`},w=M=>{ae("share",{method:M,content_type:"product",item_id:e});const N=600,k=500,E=window.innerWidth/2-N/2,V=window.innerHeight/2-k/2;window.open(m[M],`share-${M}`,`width=${N},height=${k},left=${E},top=${V},toolbar=0,location=0,menubar=0`)},g=async()=>{try{await navigator.clipboard.writeText(e),u(!0),ae("share",{method:"copy_link",content_type:"product",item_id:e}),l({title:"Link copiat!",description:"Linkul a fost copiat în clipboard"}),setTimeout(()=>u(!1),2e3)}catch{l({title:"Eroare",description:"Nu s-a putut copia linkul",variant:"destructive"})}},_=async()=>{if(navigator.share)try{await navigator.share({title:h,text:t,url:e}),ae("share",{method:"native",content_type:"product",item_id:e})}catch(M){M.name!=="AbortError"&&console.error("Share failed:",M)}};return n.jsxs(jo,{children:[n.jsx(No,{asChild:!0,children:n.jsxs(Pe,{variant:a,size:c,children:[n.jsx(Re,{className:"h-4 w-4"}),c!=="icon"&&n.jsx("span",{className:"ml-2",children:"Distribuie"})]})}),n.jsxs(kn,{align:"end",className:"w-56",children:[n.jsx(A,{onClick:()=>w("facebook"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1877F2] flex items-center justify-center mr-3",children:n.jsx(ut,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"Facebook"})]})}),n.jsx(A,{onClick:()=>w("twitter"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1DA1F2] flex items-center justify-center mr-3",children:n.jsx(ft,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"Twitter"})]})}),n.jsx(A,{onClick:()=>w("whatsapp"),children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#25D366] flex items-center justify-center mr-3",children:n.jsx(pt,{className:"h-4 w-4 text-white",fill:"currentColor"})}),n.jsx("span",{children:"WhatsApp"})]})}),navigator.share&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{}),n.jsx(A,{onClick:_,children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center mr-3",children:n.jsx(Re,{className:"h-4 w-4"})}),n.jsx("span",{children:"Mai multe opțiuni..."})]})})]}),n.jsx(ce,{}),n.jsx(A,{onClick:g,children:n.jsxs("div",{className:"flex items-center w-full",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center mr-3",children:d?n.jsx(ie,{className:"h-4 w-4 text-green-600"}):n.jsx(lt,{className:"h-4 w-4"})}),n.jsx("span",{children:d?"Copiat!":"Copiază linkul"})]})})]})]})},Sn=({product:e,compact:o=!1,priority:t=!1})=>{const r=s.useCallback(a=>{window._affiliateClickTracker||(window._affiliateClickTracker=new Map);const c=Date.now(),l=window._affiliateClickTracker.get(e.id);if(l&&c-l<5e3)return console.log("🚫 Blocked duplicate click for:",e.id,e.name),a.preventDefault(),a.stopPropagation(),!1;window._affiliateClickTracker.set(e.id,c),console.log("✅ Allowed click for:",e.id,e.name);for(const[d,u]of window._affiliateClickTracker.entries())c-u>1e4&&window._affiliateClickTracker.delete(d)},[e.id,e.name]);return n.jsx(Wn,{className:"hover:shadow-lg transition-shadow h-full group",children:n.jsxs(qn,{className:o?"p-3":"p-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx(Ne,{to:`/product/${e.slug||e.id}`,className:"block",children:n.jsx("div",{className:"aspect-square bg-muted rounded mb-4 overflow-hidden",children:n.jsx(Zn,{src:e.image_url||"/placeholder.svg",alt:ct({name:e.name,brand:e.brand,category:e.category,store:e.store_name,price:e.price}),className:"w-full h-full group-hover:scale-105 transition-transform duration-300",objectFit:"contain",loading:t?"eager":"lazy",priority:t,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw"})})}),n.jsxs("div",{className:"absolute top-2 right-2 flex gap-2",children:[n.jsx("div",{className:"bg-background/80 backdrop-blur-sm rounded",children:n.jsx(Eo,{url:`https://clyper.ro/product/${e.slug||e.id}`,title:e.name,price:e.price,variant:"ghost",size:"icon"})}),n.jsx("div",{className:"bg-background/80 backdrop-blur-sm rounded px-2 py-1",children:n.jsx(mt,{productId:e.id})})]})]}),n.jsxs(Ne,{to:`/product/${e.slug||e.id}`,className:"block",children:[n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:e.store_name||"N/A"}),n.jsx("h3",{className:"font-medium mb-3 line-clamp-2 group-hover:text-primary transition-colors text-sm min-h-[2.5rem]",children:e.name})]}),n.jsx("div",{className:"flex items-center justify-between mb-4",children:n.jsxs("p",{className:"text-2xl font-bold",children:[e.price.toFixed(2)," ",n.jsx("span",{className:"text-sm",children:"RON"})]})}),n.jsx(Pe,{asChild:!0,className:"w-full bg-danger hover:bg-danger/90 text-danger-foreground",children:n.jsxs("a",{href:e.affiliate_link,target:"_blank",rel:"noopener",onClick:r,children:["Cumpără acum",n.jsx(it,{className:"ml-2 h-4 w-4"})]})})]})})};Sn.displayName="ProductCard";const Xo=s.memo(Sn);export{mt as C,Xo as P,Eo as S};