@moontra/moonui-pro 3.5.1 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @moontra/moonui-pro v3.5.1 - CDN Build
2
+ * @moontra/moonui-pro v3.5.3 - CDN Build
3
3
  * Premium UI components for MoonUI
4
4
  * (c) 2026 MoonUI. All rights reserved.
5
5
  * @license Commercial - https://moonui.dev/license
@@ -276,7 +276,7 @@ Defaulting to \`null\`.`}var b7=hwe,bwe=vwe;var x7=O(fe(),1),xo=xwe.forwardRef((
276
276
  .animation-paused {
277
277
  animation-play-state: paused;
278
278
  }
279
- `})]})},_K=e=>{let{hasProAccess:t,isLoading:r}=Ee();return!r&&!t?(0,rl.jsx)(Ve,{componentName:"Marquee",compact:!0,className:"inline-block"}):(0,rl.jsx)(_lt,{...e})};_K.displayName="Marquee";var MN=O(be(),1);var ya=O(fe(),1),FK=class extends MN.Component{constructor(r){super(r);this.resetTimeoutId=null;this.previousResetKeys=[];this.resetErrorBoundary=()=>{let{onReset:r}=this.props;r?.(),this.setState({hasError:!1,error:void 0,errorInfo:void 0})};this.state={hasError:!1},this.previousResetKeys=r.resetKeys||[]}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){let{onError:o,isolate:a}=this.props;this.setState({errorInfo:n}),o?.(r,n),console.error(a?"[Isolated ErrorBoundary] caught an error:":"ErrorBoundary caught an error:",r,n)}componentDidUpdate(r){let{resetKeys:n,resetOnPropsChange:o}=this.props,{hasError:a}=this.state;if(a&&n&&n.some((s,l)=>s!==this.previousResetKeys[l])&&(this.previousResetKeys=n,this.resetErrorBoundary()),a&&o&&r!==this.props){let i={...this.props,children:null},s={...r,children:null};JSON.stringify(i)!==JSON.stringify(s)&&this.resetErrorBoundary()}}renderFallback(){let{fallback:r,className:n,showErrorDetails:o}=this.props,{error:a,errorInfo:i}=this.state;return a?r?typeof r=="function"?(0,ya.jsx)(r,{error:a,resetErrorBoundary:this.resetErrorBoundary,errorInfo:i}):r:(0,ya.jsx)("div",{className:M("flex items-center justify-center min-h-[200px] p-4",n),children:(0,ya.jsxs)(Ze,{className:"w-full max-w-md",children:[(0,ya.jsxs)(wr,{className:"text-center",children:[(0,ya.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",children:(0,ya.jsx)(ua,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),(0,ya.jsx)(zr,{children:"Something went wrong"}),(0,ya.jsx)(ts,{children:"An error occurred while rendering this component"})]}),(0,ya.jsxs)(tt,{className:"text-center",children:[o&&!1,(0,ya.jsxs)(we,{onClick:this.resetErrorBoundary,className:"mt-4",children:[(0,ya.jsx)(bo,{className:"mr-2 h-4 w-4"}),"Try again"]})]})]})}):null}render(){let{hasError:r}=this.state,{children:n,isolate:o}=this.props;if(r){if(o)try{return this.renderFallback()}catch(a){return console.error("Error boundary fallback failed:",a),(0,ya.jsx)("div",{className:"p-4 text-center text-red-600",children:"Critical error: Unable to recover"})}return this.renderFallback()}return n}componentWillUnmount(){this.resetTimeoutId&&clearTimeout(this.resetTimeoutId)}};function Flt(e){let{hasProAccess:t,isLoading:r}=Ee(),n=(0,MN.useRef)(e.resetKeys);return(0,MN.useEffect)(()=>{n.current=e.resetKeys},[e.resetKeys]),!r&&!t?(0,ya.jsx)(Ze,{className:M("w-fit",e.className),children:(0,ya.jsx)(tt,{className:"py-6 text-center",children:(0,ya.jsxs)("div",{className:"space-y-4",children:[(0,ya.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,ya.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,ya.jsxs)("div",{children:[(0,ya.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,ya.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Error Boundary is available exclusively to MoonUI Pro subscribers."}),(0,ya.jsx)("a",{href:"/pricing",children:(0,ya.jsxs)(we,{size:"sm",children:[(0,ya.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,ya.jsx)(FK,{...e})}var Blt=Flt;var oI=O(be(),1);var Ua=O(fe(),1),jSe=oI.default.forwardRef(({actions:e=[],position:t="bottom-right",size:r="default",className:n,children:o,onClick:a,...i},s)=>{let[l,c]=(0,oI.useState)(!1),u={sm:"h-10 w-10",default:"h-12 w-12",lg:"h-14 w-14"},d={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},f={"bottom-right":{x:-60,y:0},"bottom-left":{x:60,y:0},"top-right":{x:-60,y:0},"top-left":{x:60,y:0}},p=m=>{e.length>0?c(!l):a&&a(m)};return(0,Ua.jsxs)("div",{className:M("fixed z-50",d[t]),children:[(0,Ua.jsx)(Mt,{children:l&&e.length>0&&(0,Ua.jsx)("div",{className:"absolute",children:e.map((m,h)=>(0,Ua.jsxs)(ve.div,{initial:{scale:0,opacity:0,x:0,y:0},animate:{scale:1,opacity:1,x:f[t].x,y:f[t].y*(h+1)-10},exit:{scale:0,opacity:0,x:0,y:0},transition:{delay:h*.05,type:"spring",stiffness:200,damping:15},className:"absolute flex items-center gap-2",style:{transform:`translate(${t.includes("right"),"0"}, ${t.includes("bottom"),"0"})`},children:[(0,Ua.jsx)(ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{delay:(h+1)*.05},className:M("px-2 py-1 bg-background/90 backdrop-blur-sm text-sm font-medium rounded-md shadow-sm border whitespace-nowrap",t.includes("right")?"mr-2":"ml-2"),children:m.label}),(0,Ua.jsx)("button",{onClick:()=>{m.onClick(),c(!1)},className:M("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r]),children:m.icon})]},h))})}),(0,Ua.jsx)(ve.button,{ref:s,className:M("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r],n),onClick:p,whileHover:{scale:1.1},whileTap:{scale:.9},animate:{rotate:l?45:0},transition:{duration:.2},children:o||(e.length>0?(0,Ua.jsx)(Ci,{className:"h-5 w-5"}):(0,Ua.jsx)(Ci,{className:"h-5 w-5"}))}),(0,Ua.jsx)(Mt,{children:l&&(0,Ua.jsx)(ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[-1]",onClick:()=>c(!1)})})]})});jSe.displayName="FloatingActionButtonInternal";var WSe=oI.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ee();return!o&&!n?(0,Ua.jsx)(Ze,{className:M("w-fit",e),children:(0,Ua.jsx)(tt,{className:"py-6 text-center",children:(0,Ua.jsxs)("div",{className:"space-y-4",children:[(0,Ua.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ua.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ua.jsxs)("div",{children:[(0,Ua.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ua.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Floating Action Button is available exclusively to MoonUI Pro subscribers."}),(0,Ua.jsx)("a",{href:"/pricing",children:(0,Ua.jsxs)(we,{size:"sm",children:[(0,Ua.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ua.jsx)(jSe,{className:e,ref:r,...t})});WSe.displayName="FloatingActionButton";var Ts=O(be(),1);var ii=O(fe(),1),qSe=gt("relative rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 isolate",{variants:{variant:{subtle:"hover:bg-card/95",dramatic:"hover:bg-gradient-to-br hover:from-card hover:to-card/80",gaming:"hover:border-primary/50 hover:shadow-lg hover:shadow-primary/25",elegant:"hover:border-border/50 hover:bg-gradient-to-br hover:from-card hover:via-card/95 hover:to-card/90",neon:"hover:border-primary hover:shadow-[0_0_30px_rgba(var(--primary),0.3)]"},shadowIntensity:{none:"",light:"hover:shadow-md",medium:"hover:shadow-lg",heavy:"hover:shadow-xl",extreme:"hover:shadow-2xl"},glowEffect:{none:"",subtle:"",vibrant:"",neon:""}},defaultVariants:{variant:"subtle",shadowIntensity:"medium",glowEffect:"none"}}),zlt={"product-card":{variant:"elegant",shadowIntensity:"heavy",glowEffect:"subtle",maxRotation:12,scale:1.08,enableShine:!0,shineIntensity:.6,springConfig:{stiffness:150,damping:12}},"profile-card":{variant:"subtle",shadowIntensity:"medium",glowEffect:"none",maxRotation:8,scale:1.03,enableShine:!1,springConfig:{stiffness:180,damping:15}},"game-card":{variant:"gaming",shadowIntensity:"extreme",glowEffect:"vibrant",maxRotation:20,scale:1.1,enableShine:!0,shineIntensity:.8,springConfig:{stiffness:220,damping:10}},"price-card":{variant:"dramatic",shadowIntensity:"heavy",glowEffect:"subtle",maxRotation:10,scale:1.05,enableShine:!0,shineIntensity:.4,springConfig:{stiffness:200,damping:18}},"feature-card":{variant:"neon",shadowIntensity:"extreme",glowEffect:"neon",maxRotation:15,scale:1.06,enableShine:!0,shineIntensity:.7,springConfig:{stiffness:180,damping:12}}},GSe=Ts.default.forwardRef(({children:e,className:t,variant:r,shadowIntensity:n,glowEffect:o,perspective:a=1e3,maxRotation:i=15,rotationIntensity:s,scale:l=1.05,springConfig:c={stiffness:200,damping:15,mass:1,velocity:0},animationSpeed:u=1,overlay:d,overlayAlwaysVisible:f=!1,glowColor:p="rgb(var(--primary))",glowBlur:m=20,glowSpread:h=1.2,enableTouch:g=!0,enableKeyboard:v=!0,onHoverStart:y,onHoverEnd:b,onRotationChange:w,animationDelay:x=0,ariaLabel:C,autoFocus:P=!1,rotateAxes:R={x:!0,y:!0},depthLayers:I,enableShine:z=!1,shineIntensity:A=.5,shineColor:T="rgba(255, 255, 255, 0.1)",glowLayers:$,preset:F,...S},N)=>{let k=(0,Ts.useMemo)(()=>{if(!F)return{variant:r,shadowIntensity:n,glowEffect:o,maxRotation:i,scale:l,springConfig:c,enableShine:z,shineIntensity:A,shineColor:T};let pe=zlt[F];return{variant:r??pe.variant,shadowIntensity:n??pe.shadowIntensity,glowEffect:o??pe.glowEffect,maxRotation:i!==15?i:pe.maxRotation??15,scale:l!==1.05?l:pe.scale??1.05,springConfig:{...pe.springConfig,...c},enableShine:z||pe.enableShine||!1,shineIntensity:A!==.5?A:pe.shineIntensity??.5,shineColor:T}},[F,r,n,o,i,l,c,z,A,T]),{onDrag:L,onDragStart:B,onDragEnd:D,onDragOver:_,onDrop:E,onAnimationStart:q,onAnimationEnd:H,onAnimationIteration:j,...V}=S,W=(0,Ts.useRef)(null),[G,U]=(0,Ts.useState)(!1),[J,ae]=(0,Ts.useState)(!1),[Q,ee]=(0,Ts.useState)({x:0,y:0}),te=k.maxRotation||s||15,X=aa(0),Z=aa(0),ne=jp(X,{...k.springConfig,stiffness:k.springConfig.stiffness*u,damping:k.springConfig.damping/u}),oe=jp(Z,{...k.springConfig,stiffness:k.springConfig.stiffness*u,damping:k.springConfig.damping/u}),se=Td(oe,[-1,1],R.x?[te,-te]:[0,0]),Y=Td(ne,[-1,1],R.y?[-te,te]:[0,0]),K=(0,Ts.useCallback)(pe=>{if(!W.current)return;let de=W.current.getBoundingClientRect(),ge=de.left+de.width/2,Se=de.top+de.height/2,_e,De;if("touches"in pe&&g)_e=pe.touches[0].clientX,De=pe.touches[0].clientY;else if("clientX"in pe)_e=pe.clientX,De=pe.clientY;else return;let Me=(De-Se)/(de.height/2),he=(_e-ge)/(de.width/2);if(X.set(he),Z.set(Me),k.enableShine){let xe=(_e-de.left)/de.width,Ae=(De-de.top)/de.height;ee({x:xe,y:Ae})}w&&w(se.get(),Y.get())},[g,X,Z,se,Y,w,k.enableShine]),le=(0,Ts.useCallback)(()=>{U(!0),y?.()},[y]),me=(0,Ts.useCallback)(()=>{U(!1),X.set(0),Z.set(0),b?.()},[X,Z,b]),re=(0,Ts.useCallback)(pe=>{if(!v||!J)return;let de=.1,ge=X.get(),Se=Z.get();switch(pe.key){case"ArrowUp":Se=Math.max(-.5,Se-de),Z.set(Se),pe.preventDefault();break;case"ArrowDown":Se=Math.min(.5,Se+de),Z.set(Se),pe.preventDefault();break;case"ArrowLeft":ge=Math.max(-.5,ge-de),X.set(ge),pe.preventDefault();break;case"ArrowRight":ge=Math.min(.5,ge+de),X.set(ge),pe.preventDefault();break;case"Enter":case" ":U(!G),G?b?.():y?.(),pe.preventDefault();break;case"Escape":X.set(0),Z.set(0),U(!1),b?.(),pe.preventDefault();break}w&&w(se.get(),Y.get())},[v,J,X,Z,G,y,b,se,Y,w]);(0,Ts.useEffect)(()=>{P&&W.current&&W.current.focus()},[P]);let ue=(0,Ts.useMemo)(()=>d?typeof d=="function"?d({isHovered:G,rotateX:se.get(),rotateY:Y.get()}):d:null,[d,G,se,Y]),ie=(0,Ts.useMemo)(()=>{if(k.glowEffect==="none")return{};let pe=0,de=m,ge=h;switch(k.glowEffect){case"subtle":pe=G?.3:0;break;case"vibrant":pe=G?.6:0,de=m*1.5;break;case"neon":pe=G?.8:0,de=m*2,ge=h*1.3;break}return{opacity:pe,filter:`blur(${de}px)`,scale:ge,backgroundColor:p}},[k.glowEffect,G,m,h,p]);return(0,ii.jsx)("div",{style:{perspective:`${a}px`},children:(0,ii.jsxs)(ve.div,{ref:pe=>{W.current=pe,typeof N=="function"?N(pe):N&&(N.current=pe)},className:M(qSe({variant:k.variant,shadowIntensity:k.shadowIntensity,glowEffect:k.glowEffect}),"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),onMouseMove:K,onMouseEnter:le,onMouseLeave:me,onTouchMove:g?K:void 0,onTouchStart:g?le:void 0,onTouchEnd:g?me:void 0,onKeyDown:re,onFocus:()=>ae(!0),onBlur:()=>ae(!1),style:{transformStyle:"preserve-3d",transformOrigin:"center center",rotateX:G||J?se:0,rotateY:G||J?Y:0,scale:G||J?k.scale:1},transition:{type:"spring",stiffness:k.springConfig.stiffness,damping:k.springConfig.damping,duration:.15*(1/u),delay:x/1e3},tabIndex:v?0:void 0,role:v?"button":void 0,"aria-label":C,...V,children:[(0,ii.jsx)(ve.div,{className:"relative z-10",animate:{z:G||J?20:0},transition:{duration:.2*(1/u)},children:e}),ue&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none z-20",animate:{opacity:f||G||J?1:0},transition:{duration:.3*(1/u)},children:ue}),I&&I.map((pe,de)=>(0,ii.jsx)(ve.div,{className:M("absolute inset-0 pointer-events-none",pe.className),style:{transformStyle:"preserve-3d",transform:`translateZ(${pe.depth}px)`},animate:{x:G||J?Y.get()*pe.depth*.1:0,y:G||J?se.get()*pe.depth*.1:0},transition:{duration:.2*(1/u)},children:pe.element},`depth-layer-${de}`)),k.enableShine&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none overflow-hidden",animate:{opacity:G||J?k.shineIntensity:0},transition:{duration:.3*(1/u)},children:(0,ii.jsx)("div",{className:"absolute w-full h-full",style:{background:`radial-gradient(circle at ${Q.x*100}% ${Q.y*100}%, ${k.shineColor} 0%, transparent 50%)`,transform:"translateZ(1px)"}})}),k.variant!=="subtle"&&(0,ii.jsx)(ve.div,{className:M("absolute inset-0 rounded-lg pointer-events-none",k.variant==="dramatic"&&"bg-gradient-to-br from-white/10 via-transparent to-black/10",k.variant==="gaming"&&"bg-gradient-to-br from-primary/10 via-transparent to-primary/5",k.variant==="elegant"&&"bg-gradient-to-br from-white/5 via-transparent to-black/5",k.variant==="neon"&&"bg-gradient-to-br from-primary/20 via-transparent to-primary/10"),animate:{opacity:G||J?1:0},transition:{duration:.3*(1/u)}}),$&&$.map((pe,de)=>{let ge={};return pe.animation==="pulse"?ge.animation="pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite":pe.animation==="rotate"&&(ge.animation="spin 3s linear infinite"),(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none",style:{...ge,zIndex:-10-de},animate:{opacity:G||J?pe.opacity:0,filter:`blur(${pe.blur}px)`,scale:pe.spread,backgroundColor:pe.color},transition:{duration:.3*(1/u)}},`glow-layer-${de}`)}),k.glowEffect!=="none"&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none -z-10",animate:ie,transition:{duration:.3*(1/u)}})]})})});GSe.displayName="HoverCard3DInternal";var KSe=Ts.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ee();return!n&&!r?(0,ii.jsx)(Ze,{className:M("w-fit",e.className),children:(0,ii.jsx)(tt,{className:"py-6 text-center",children:(0,ii.jsxs)("div",{className:"space-y-4",children:[(0,ii.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,ii.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,ii.jsxs)("div",{children:[(0,ii.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,ii.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"3D Hover Card is available exclusively to MoonUI Pro subscribers."}),(0,ii.jsx)("a",{href:"/pricing",children:(0,ii.jsxs)(we,{size:"sm",children:[(0,ii.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,ii.jsx)(GSe,{...e,ref:t})});KSe.displayName="HoverCard3D";var Xo=O(be(),1);var Gn=O(fe(),1),YSe=Xo.default.forwardRef(({children:e,minZoom:t=.5,maxZoom:r=3,initialZoom:n=1,className:o,contentClassName:a,onZoomChange:i,showControls:s=!0,showIndicator:l=!0,doubleTapBehavior:c="zoom",wheelScaling:u=!0,dragEnabled:d=!0,zoomStep:f=.5,smoothZoom:p=!0,boundaryConstraints:m=!0,...h},g)=>{let v=(0,Xo.useRef)(null),y=(0,Xo.useRef)(null),[b,w]=(0,Xo.useState)(!1),[x,C]=(0,Xo.useState)(!1),[P,R]=(0,Xo.useState)(0),[I,z]=(0,Xo.useState)(!1),[A,T]=(0,Xo.useState)(!1),$=aa(n),F=aa(0),S=aa(0),N=Td($,W=>Math.min(Math.max(W,t),r)),k=Td($,W=>Math.round(W*100)),L=(0,Xo.useCallback)(()=>{if(!v.current||!y.current||!m)return{left:0,right:0,top:0,bottom:0};let W=v.current.getBoundingClientRect(),G=$.get(),U=W.width*G,J=W.height*G,ae=Math.max(0,(U-W.width)/2),Q=Math.max(0,(J-W.height)/2);return{left:-ae,right:ae,top:-Q,bottom:Q}},[$,m]);(0,Xo.useEffect)(()=>{if(!v.current||!u)return;let W=v.current,G=U=>{I&&u&&(U.ctrlKey||U.metaKey)&&U.preventDefault()};return W.addEventListener("wheel",G,{passive:!1}),()=>{W.removeEventListener("wheel",G)}},[I,u]);let B=(0,Xo.useCallback)(W=>{if(!u||!W.ctrlKey&&!W.metaKey)return;W.preventDefault();let G=-W.deltaY/1e3,U=$.get(),J=Math.min(Math.max(U+G,t),r);if(v.current){let ae=v.current.getBoundingClientRect(),Q=(W.clientX-ae.left)/ae.width-.5,ee=(W.clientY-ae.top)/ae.height-.5,te=J-U,X=F.get(),Z=S.get(),ne=X-Q*ae.width*te,oe=Z-ee*ae.height*te;p?(jo(F,ne,{duration:.2}),jo(S,oe,{duration:.2})):(F.set(ne),S.set(oe))}p?jo($,J,{duration:.2}):$.set(J),i?.(J),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,F,S,t,r,i,u,p,l]),D=(0,Xo.useCallback)(W=>{W.preventDefault();let G=$.get(),U;if(c==="reset")U=n;else if(U=G>1?1:2,U>1&&v.current){let J=v.current.getBoundingClientRect(),ae=(W.clientX-J.left)/J.width-.5,Q=(W.clientY-J.top)/J.height-.5,ee=-ae*J.width*(U-1),te=-Q*J.height*(U-1);jo(F,ee,{duration:.3,type:"spring",stiffness:300}),jo(S,te,{duration:.3,type:"spring",stiffness:300})}jo($,Math.min(Math.max(U,t),r),{duration:.3,type:"spring",stiffness:300}),(U===1||c==="reset")&&(jo(F,0,{duration:.3}),jo(S,0,{duration:.3})),i?.(U),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,F,S,t,r,n,i,c,l]),_=(0,Xo.useCallback)(W=>{let G=Date.now(),U=G-P;if(U<300&&U>0){let J=W.changedTouches[0],ae={clientX:J.clientX,clientY:J.clientY,preventDefault:()=>{}};D(ae)}R(G)},[P,D]),E=(0,Xo.useCallback)(()=>{jo($,n,{duration:.3,type:"spring",stiffness:300}),jo(F,0,{duration:.3,type:"spring",stiffness:300}),jo(S,0,{duration:.3,type:"spring",stiffness:300}),i?.(n)},[$,F,S,n,i]),q=(0,Xo.useCallback)(()=>{let W=$.get(),G=Math.min(W+f,r);jo($,G,{duration:.3,type:"spring",stiffness:300}),i?.(G),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,r,f,i,l]),H=(0,Xo.useCallback)(()=>{let W=$.get(),G=Math.max(W-f,t);if(jo($,G,{duration:.3,type:"spring",stiffness:300}),G<$.get()){let U=L(),J=F.get(),ae=S.get();(J<U.left||J>U.right)&&jo(F,0,{duration:.3}),(ae<U.top||ae>U.bottom)&&jo(S,0,{duration:.3})}i?.(G),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,t,f,F,S,L,i,l]),j=(0,Xo.useCallback)(()=>{E()},[E]),V=(0,Xo.useCallback)(()=>{v.current&&(document.fullscreenElement?document.exitFullscreen().then(()=>{T(!1)}).catch(W=>{console.error("Exit fullscreen error:",W)}):(v.current.parentElement||v.current).requestFullscreen().then(()=>{T(!0)}).catch(G=>{console.error("Fullscreen error:",G)}))},[]);return(0,Xo.useEffect)(()=>{let W=()=>{T(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",W),document.addEventListener("webkitfullscreenchange",W),document.addEventListener("mozfullscreenchange",W),document.addEventListener("MSFullscreenChange",W),()=>{document.removeEventListener("fullscreenchange",W),document.removeEventListener("webkitfullscreenchange",W),document.removeEventListener("mozfullscreenchange",W),document.removeEventListener("MSFullscreenChange",W)}},[]),(0,Xo.useEffect)(()=>{if(!I||!u)return;let W=G=>{!G.ctrlKey&&!G.metaKey||(G.key==="+"||G.key==="="?(G.preventDefault(),q()):G.key==="-"||G.key==="_"?(G.preventDefault(),H()):G.key==="0"&&(G.preventDefault(),E()))};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[I,u,q,H,E]),(0,Xo.useEffect)(()=>$.onChange(()=>{let G=L(),U=F.get(),J=S.get();m&&((U<G.left||U>G.right)&&jo(F,Math.max(G.left,Math.min(G.right,U)),{duration:.2}),(J<G.top||J>G.bottom)&&jo(S,Math.max(G.top,Math.min(G.bottom,J)),{duration:.2}))}),[$,F,S,L,m]),(0,Gn.jsxs)("div",{ref:g,className:M("relative overflow-hidden touch-none select-none",d&&"cursor-grab active:cursor-grabbing",A&&"fixed inset-0 z-50 bg-background",o),onWheel:B,onDoubleClick:D,onTouchEnd:_,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),...h,children:[(0,Gn.jsx)("div",{ref:v,className:"w-full h-full",children:(0,Gn.jsx)(ve.div,{ref:y,drag:d,dragElastic:.1,dragMomentum:!1,dragConstraints:m?L():!1,onDragStart:()=>w(!0),onDragEnd:()=>w(!1),style:{scale:N,x:F,y:S},className:M("w-full h-full flex items-center justify-center",b&&"cursor-grabbing",a),children:e})}),(0,Gn.jsx)(Mt,{children:l&&x&&(0,Gn.jsxs)(ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute top-4 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-black/80 dark:bg-white/80 text-white dark:text-black rounded-full text-sm font-medium pointer-events-none",children:[k.get(),"%"]})}),s&&(0,Gn.jsxs)("div",{className:"absolute bottom-4 right-4 flex gap-2",children:[(0,Gn.jsx)("button",{onClick:H,disabled:$.get()<=t,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom out",children:(0,Gn.jsx)(Gd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:q,disabled:$.get()>=r,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom in",children:(0,Gn.jsx)(qd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:E,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":"Reset zoom",children:(0,Gn.jsx)(jx,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:V,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":A?"Exit fullscreen":"Enter fullscreen",children:A?(0,Gn.jsx)($x,{className:"w-4 h-4"}):(0,Gn.jsx)(Wl,{className:"w-4 h-4"})})]}),s&&(0,Gn.jsx)("div",{className:"absolute bottom-4 left-4 px-3 py-1.5 bg-background/80 backdrop-blur-sm border rounded-md text-sm",children:(0,Gn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Gn.jsxs)("span",{children:[Math.round($.get()*100),"%"]}),u&&!x&&(0,Gn.jsx)("span",{className:"text-xs text-muted-foreground",children:"(Ctrl+Scroll to zoom)"})]})})]})});YSe.displayName="PinchZoomInternal";var XSe=Xo.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ee();return!o&&!n?(0,Gn.jsx)(Ze,{className:M("w-fit",e),children:(0,Gn.jsx)(tt,{className:"py-6 text-center",children:(0,Gn.jsxs)("div",{className:"space-y-4",children:[(0,Gn.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gn.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gn.jsxs)("div",{children:[(0,Gn.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gn.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Pinch Zoom is available exclusively to MoonUI Pro subscribers."}),(0,Gn.jsx)("a",{href:"/pricing",children:(0,Gn.jsxs)(we,{size:"sm",children:[(0,Gn.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gn.jsx)(YSe,{className:e,ref:r,...t})});XSe.displayName="PinchZoom";var nl=O(be(),1);var EN=O(be(),1);var lr=O(fe(),1),JSe=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],Ult=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e","#64748b"];function QSe({open:e,onOpenChange:t,event:r,selectedDate:n,onSave:o,onDelete:a,mode:i="create"}){let[s,l]=(0,EN.useState)({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,u]=(0,EN.useState)({}),[d,f]=(0,EN.useState)(!1);(0,EN.useEffect)(()=>{if(i==="edit"&&r)l({title:r.title||"",description:r.description||"",date:r.date.toISOString().split("T")[0],startTime:r.startTime||"",endTime:r.endTime||"",location:r.location||"",type:r.type||"meeting",color:r.color||"#3b82f6",attendees:r.attendees?.join(", ")||""});else if(i==="create"){let v=n?n.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:v,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""})}u({})},[r,n,i,e]);let p=()=>{let v={};return s.title.trim()||(v.title="Title is required"),s.date||(v.date="Date is required"),s.startTime&&s.endTime&&s.startTime>=s.endTime&&(v.endTime="End time must be after start time"),u(v),Object.keys(v).length===0},m=async v=>{if(v.preventDefault(),!!p()){f(!0);try{let y={...i==="edit"&&r?{id:r.id}:{},title:s.title.trim(),description:s.description.trim(),date:new Date(s.date+"T00:00:00"),startTime:s.startTime||void 0,endTime:s.endTime||void 0,location:s.location.trim()||void 0,type:s.type,color:s.color,attendees:s.attendees?s.attendees.split(",").map(b=>b.trim()).filter(Boolean):void 0};await o(y),t(!1)}catch(y){console.error("Error saving event:",y)}finally{f(!1)}}},h=()=>{r&&a&&(a(r.id),t(!1))},g=v=>{let y=JSe.find(b=>b.value===v);l(b=>({...b,type:v,color:y?.color||b.color}))};return(0,lr.jsx)(ha,{open:e,onOpenChange:t,children:(0,lr.jsxs)(Ko,{className:"sm:max-w-[500px]",children:[(0,lr.jsxs)(Ba,{children:[(0,lr.jsxs)(ga,{className:"flex items-center gap-2",children:[(0,lr.jsx)(ei,{className:"w-5 h-5"}),i==="create"?"Create Event":"Edit Event"]}),(0,lr.jsx)(Cl,{children:i==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),(0,lr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"title",children:"Title *"}),(0,lr.jsx)(Zt,{id:"title",value:s.title,onChange:v=>l(y=>({...y,title:v.target.value})),placeholder:"Event title",className:M(c.title&&"border-red-500")}),c.title&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.title})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"description",children:"Description"}),(0,lr.jsx)(lu,{id:"description",value:s.description,onChange:v=>l(y=>({...y,description:v.target.value})),placeholder:"Event description (optional)",rows:3})]}),(0,lr.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"date",children:"Date *"}),(0,lr.jsx)(Zt,{id:"date",type:"date",value:s.date,onChange:v=>l(y=>({...y,date:v.target.value})),className:M(c.date&&"border-red-500")}),c.date&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.date})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"startTime",children:"Start Time"}),(0,lr.jsx)(Zt,{id:"startTime",type:"time",value:s.startTime,onChange:v=>l(y=>({...y,startTime:v.target.value})),placeholder:"09:00"})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"endTime",children:"End Time"}),(0,lr.jsx)(Zt,{id:"endTime",type:"time",value:s.endTime,onChange:v=>l(y=>({...y,endTime:v.target.value})),placeholder:"10:00",className:M(c.endTime&&"border-red-500")}),c.endTime&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{htmlFor:"location",className:"flex items-center gap-2",children:[(0,lr.jsx)(Hf,{className:"w-4 h-4"}),"Location"]}),(0,lr.jsx)(Zt,{id:"location",value:s.location,onChange:v=>l(y=>({...y,location:v.target.value})),placeholder:"Meeting room, address, or link"})]}),(0,lr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{className:"flex items-center gap-2",children:[(0,lr.jsx)(Kx,{className:"w-4 h-4"}),"Type"]}),(0,lr.jsxs)(_o,{value:s.type,onValueChange:g,children:[(0,lr.jsx)(Fo,{children:(0,lr.jsx)(Yo,{})}),(0,lr.jsx)(Bo,{children:JSe.map(v=>(0,lr.jsx)(Ut,{value:v.value,children:(0,lr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lr.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:v.color}}),v.label]})},v.value))})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{className:"flex items-center gap-2",children:[(0,lr.jsx)(Qc,{className:"w-4 h-4"}),"Color"]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lr.jsx)("input",{type:"color",value:s.color,onChange:v=>l(y=>({...y,color:v.target.value})),className:"w-8 h-8 rounded border cursor-pointer flex-shrink-0"}),(0,lr.jsx)("span",{className:"text-sm text-muted-foreground",children:"Custom color"})]}),(0,lr.jsx)("div",{className:"grid grid-cols-8 gap-1",children:Ult.map(v=>(0,lr.jsx)("button",{type:"button",onClick:()=>l(y=>({...y,color:v})),className:M("w-full aspect-square rounded border-2 hover:scale-110 transition-transform",s.color===v?"border-foreground shadow-sm":"border-transparent"),style:{backgroundColor:v},"aria-label":`Select color ${v}`},v))})]})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"attendees",children:"Attendees"}),(0,lr.jsx)(Zt,{id:"attendees",value:s.attendees,onChange:v=>l(y=>({...y,attendees:v.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),(0,lr.jsxs)(dm,{className:"gap-2",children:[i==="edit"&&a&&(0,lr.jsx)(we,{type:"button",variant:"destructive",onClick:h,className:"mr-auto",children:"Delete Event"}),(0,lr.jsx)(we,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:d,children:"Cancel"}),(0,lr.jsx)(we,{type:"submit",disabled:d,children:d?i==="create"?"Creating...":"Saving...":i==="create"?"Create Event":"Save Changes"})]})]})]})})}var Be=O(fe(),1),BK=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZSe=["January","February","March","April","May","June","July","August","September","October","November","December"],TN={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500",birthday:"bg-pink-500",holiday:"bg-orange-500",conference:"bg-indigo-500"},Vlt={low:"border-l-4 border-l-muted-foreground",medium:"border-l-4 border-l-yellow-500",high:"border-l-4 border-l-red-500"},$lt={confirmed:"",tentative:"opacity-70 border-dashed",cancelled:"opacity-50 line-through"};function Hlt({events:e=[],onEventClick:t,onEventAdd:r,onEventEdit:n,onEventDelete:o,onDateChange:a,onViewChange:i,onEventDrop:s,className:l,showWeekends:c=!0,showEventDetails:u=!0,disabled:d=!1,minDate:f,maxDate:p,highlightToday:m=!0,height:h,defaultView:g="month",enableDragDrop:v=!0,enableSearch:y=!0,enableFilters:b=!0,enableExport:w=!0,enableImport:x=!1,enableRecurringEvents:C=!0,enableReminders:P=!0,eventCategories:R,workingHours:I={start:"09:00",end:"18:00"},holidays:z=[],locale:A="en-US",timeFormat:T="12h",firstDayOfWeek:$=0,theme:F="auto",customTheme:S,compactMode:N=!1,showProUpgrade:k=!1}){if(k)return(0,Be.jsx)(Ze,{className:M("w-full",l),children:(0,Be.jsx)(tt,{className:"py-12 text-center",children:(0,Be.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Be.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Be.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Be.jsxs)("div",{children:[(0,Be.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Be.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),(0,Be.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Be.jsx)("a",{href:"/pricing",children:(0,Be.jsxs)(we,{size:"sm",children:[(0,Be.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[L,B]=nl.default.useState(new Date),[D,_]=nl.default.useState(null),[E,q]=nl.default.useState(g),[H,j]=nl.default.useState(!1),[V,W]=nl.default.useState("create"),[G,U]=nl.default.useState(null),[J,ae]=nl.default.useState(null),[Q,ee]=nl.default.useState(null),[te,X]=nl.default.useState(""),[Z,ne]=nl.default.useState("all"),[oe,se]=nl.default.useState("all"),[Y,K]=nl.default.useState(!1),[le,me]=nl.default.useState([]),[re,ue]=nl.default.useState(new Date),[ie,pe]=nl.default.useState(!1),[de,ge]=nl.default.useState(!1),Se=new Date,_e=L.getMonth(),De=L.getFullYear(),Me=new Date(De,_e,1),he=new Date(De,_e+1,0),xe=new Date(Me),Ae=(xe.getDay()-$+7)%7;xe.setDate(xe.getDate()-Ae);let Te=new Date(he),Oe=(6-Te.getDay()+$)%7;Te.setDate(Te.getDate()+Oe);let ct=[],We=new Date(xe);for(;We<=Te;)ct.push(new Date(We)),We.setDate(We.getDate()+1);let bt=nl.default.useMemo(()=>{let Ke=new Set;return e.forEach(ut=>{ut.tags?.forEach(Et=>Ke.add(Et))}),Array.from(Ke)},[e]),It=nl.default.useMemo(()=>e.filter(Ke=>!(te&&!Ke.title.toLowerCase().includes(te.toLowerCase())&&!Ke.description?.toLowerCase().includes(te.toLowerCase())||Z!=="all"&&Ke.type!==Z||oe!=="all"&&Ke.priority!==oe||le.length>0&&(!Ke.tags||!Ke.tags.some(ut=>le.includes(ut))))),[e,te,Z,oe,le]),it=Ke=>It.filter(ut=>{let Et=new Date(ut.date);return ut.recurring?Ft(Ke,ut):Et.toDateString()===Ke.toDateString()}),Ft=(Ke,ut)=>{if(!ut.recurring)return!1;let Et=new Date(ut.date),Dr=Math.floor((Ke.getTime()-Et.getTime())/(1e3*60*60*24));if(Dr<0||ut.recurring.endDate&&Ke>ut.recurring.endDate)return!1;switch(ut.recurring.pattern){case"daily":return Dr%ut.recurring.interval===0;case"weekly":return Dr%(ut.recurring.interval*7)!==0?!1:ut.recurring.daysOfWeek?ut.recurring.daysOfWeek.includes(Ke.getDay()):Ke.getDay()===Et.getDay();case"monthly":return((Ke.getFullYear()-Et.getFullYear())*12+(Ke.getMonth()-Et.getMonth()))%ut.recurring.interval!==0?!1:ut.recurring.dayOfMonth?Ke.getDate()===ut.recurring.dayOfMonth:Ke.getDate()===Et.getDate();case"yearly":return(Ke.getFullYear()-Et.getFullYear())%ut.recurring.interval!==0?!1:Ke.getMonth()===Et.getMonth()&&Ke.getDate()===Et.getDate();default:return!1}},vr=Ke=>Ke.toDateString()===Se.toDateString(),Ue=Ke=>Ke.getMonth()===_e,ze=Ke=>D&&Ke.toDateString()===D.toDateString(),He=Ke=>!!(d||f&&Ke<f||p&&Ke>p),st=Ke=>{let ut=new Date(L);Ke==="prev"?ut.setMonth(_e-1):ut.setMonth(_e+1),B(ut),a?.(ut)},xt=Ke=>{q(Ke),i?.(Ke)},vt=()=>{let Ke=nr(It),ut=new Blob([Ke],{type:"text/calendar"}),Et=URL.createObjectURL(ut),Dr=document.createElement("a");Dr.href=Et,Dr.download="calendar.ics",Dr.click(),URL.revokeObjectURL(Et)},nr=Ke=>{let ut=`BEGIN:VCALENDAR\r
279
+ `})]})},_K=e=>{let{hasProAccess:t,isLoading:r}=Ee();return!r&&!t?(0,rl.jsx)(Ve,{componentName:"Marquee",compact:!0,className:"inline-block"}):(0,rl.jsx)(_lt,{...e})};_K.displayName="Marquee";var MN=O(be(),1);var ya=O(fe(),1),FK=class extends MN.Component{constructor(r){super(r);this.resetTimeoutId=null;this.previousResetKeys=[];this.resetErrorBoundary=()=>{let{onReset:r}=this.props;r?.(),this.setState({hasError:!1,error:void 0,errorInfo:void 0})};this.state={hasError:!1},this.previousResetKeys=r.resetKeys||[]}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){let{onError:o,isolate:a}=this.props;this.setState({errorInfo:n}),o?.(r,n),console.error(a?"[Isolated ErrorBoundary] caught an error:":"ErrorBoundary caught an error:",r,n)}componentDidUpdate(r){let{resetKeys:n,resetOnPropsChange:o}=this.props,{hasError:a}=this.state;if(a&&n&&n.some((s,l)=>s!==this.previousResetKeys[l])&&(this.previousResetKeys=n,this.resetErrorBoundary()),a&&o&&r!==this.props){let i={...this.props,children:null},s={...r,children:null};JSON.stringify(i)!==JSON.stringify(s)&&this.resetErrorBoundary()}}renderFallback(){let{fallback:r,className:n,showErrorDetails:o}=this.props,{error:a,errorInfo:i}=this.state;return a?r?typeof r=="function"?(0,ya.jsx)(r,{error:a,resetErrorBoundary:this.resetErrorBoundary,errorInfo:i}):r:(0,ya.jsx)("div",{className:M("flex items-center justify-center min-h-[200px] p-4",n),children:(0,ya.jsxs)(Ze,{className:"w-full max-w-md",children:[(0,ya.jsxs)(wr,{className:"text-center",children:[(0,ya.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",children:(0,ya.jsx)(ua,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),(0,ya.jsx)(zr,{children:"Something went wrong"}),(0,ya.jsx)(ts,{children:"An error occurred while rendering this component"})]}),(0,ya.jsxs)(tt,{className:"text-center",children:[o&&!1,(0,ya.jsxs)(we,{onClick:this.resetErrorBoundary,className:"mt-4",children:[(0,ya.jsx)(bo,{className:"mr-2 h-4 w-4"}),"Try again"]})]})]})}):null}render(){let{hasError:r}=this.state,{children:n,isolate:o}=this.props;if(r){if(o)try{return this.renderFallback()}catch(a){return console.error("Error boundary fallback failed:",a),(0,ya.jsx)("div",{className:"p-4 text-center text-red-600",children:"Critical error: Unable to recover"})}return this.renderFallback()}return n}componentWillUnmount(){this.resetTimeoutId&&clearTimeout(this.resetTimeoutId)}};function Flt(e){let{hasProAccess:t,isLoading:r}=Ee(),n=(0,MN.useRef)(e.resetKeys);return(0,MN.useEffect)(()=>{n.current=e.resetKeys},[e.resetKeys]),!r&&!t?(0,ya.jsx)(Ze,{className:M("w-fit",e.className),children:(0,ya.jsx)(tt,{className:"py-6 text-center",children:(0,ya.jsxs)("div",{className:"space-y-4",children:[(0,ya.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,ya.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,ya.jsxs)("div",{children:[(0,ya.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,ya.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Error Boundary is available exclusively to MoonUI Pro subscribers."}),(0,ya.jsx)("a",{href:"/pricing",children:(0,ya.jsxs)(we,{size:"sm",children:[(0,ya.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,ya.jsx)(FK,{...e})}var Blt=Flt;var oI=O(be(),1);var Ua=O(fe(),1),jSe=oI.default.forwardRef(({actions:e=[],position:t="bottom-right",size:r="default",className:n,children:o,onClick:a,...i},s)=>{let[l,c]=(0,oI.useState)(!1),u={sm:"h-10 w-10",default:"h-12 w-12",lg:"h-14 w-14"},d={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},f={"bottom-right":{x:-60,y:0},"bottom-left":{x:60,y:0},"top-right":{x:-60,y:0},"top-left":{x:60,y:0}},p=m=>{e.length>0?c(!l):a&&a(m)};return(0,Ua.jsxs)("div",{className:M("fixed z-50",d[t]),children:[(0,Ua.jsx)(Mt,{children:l&&e.length>0&&(0,Ua.jsx)("div",{className:"absolute",children:e.map((m,h)=>(0,Ua.jsxs)(ve.div,{initial:{scale:0,opacity:0,x:0,y:0},animate:{scale:1,opacity:1,x:f[t].x,y:f[t].y*(h+1)-10},exit:{scale:0,opacity:0,x:0,y:0},transition:{delay:h*.05,type:"spring",stiffness:200,damping:15},className:"absolute flex items-center gap-2",style:{transform:`translate(${t.includes("right"),"0"}, ${t.includes("bottom"),"0"})`},children:[(0,Ua.jsx)(ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{delay:(h+1)*.05},className:M("px-2 py-1 bg-background/90 backdrop-blur-sm text-sm font-medium rounded-md shadow-sm border whitespace-nowrap",t.includes("right")?"mr-2":"ml-2"),children:m.label}),(0,Ua.jsx)("button",{onClick:()=>{m.onClick(),c(!1)},className:M("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r]),children:m.icon})]},h))})}),(0,Ua.jsx)(ve.button,{ref:s,className:M("inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",u[r],n),onClick:p,whileHover:{scale:1.1},whileTap:{scale:.9},animate:{rotate:l?45:0},transition:{duration:.2},children:o||(e.length>0?(0,Ua.jsx)(Ci,{className:"h-5 w-5"}):(0,Ua.jsx)(Ci,{className:"h-5 w-5"}))}),(0,Ua.jsx)(Mt,{children:l&&(0,Ua.jsx)(ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[-1]",onClick:()=>c(!1)})})]})});jSe.displayName="FloatingActionButtonInternal";var WSe=oI.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ee();return!o&&!n?(0,Ua.jsx)(Ze,{className:M("w-fit",e),children:(0,Ua.jsx)(tt,{className:"py-6 text-center",children:(0,Ua.jsxs)("div",{className:"space-y-4",children:[(0,Ua.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Ua.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Ua.jsxs)("div",{children:[(0,Ua.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Ua.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Floating Action Button is available exclusively to MoonUI Pro subscribers."}),(0,Ua.jsx)("a",{href:"/pricing",children:(0,Ua.jsxs)(we,{size:"sm",children:[(0,Ua.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Ua.jsx)(jSe,{className:e,ref:r,...t})});WSe.displayName="FloatingActionButton";var Ts=O(be(),1);var ii=O(fe(),1),qSe=gt("relative rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200 isolate",{variants:{variant:{subtle:"hover:bg-card/95",dramatic:"hover:bg-gradient-to-br hover:from-card hover:to-card/80",gaming:"hover:border-primary/50 hover:shadow-lg hover:shadow-primary/25",elegant:"hover:border-border/50 hover:bg-gradient-to-br hover:from-card hover:via-card/95 hover:to-card/90",neon:"hover:border-primary hover:shadow-[0_0_30px_rgba(var(--primary),0.3)]"},shadowIntensity:{none:"",light:"hover:shadow-md",medium:"hover:shadow-lg",heavy:"hover:shadow-xl",extreme:"hover:shadow-2xl"},glowEffect:{none:"",subtle:"",vibrant:"",neon:""}},defaultVariants:{variant:"subtle",shadowIntensity:"medium",glowEffect:"none"}}),zlt={"product-card":{variant:"elegant",shadowIntensity:"heavy",glowEffect:"subtle",maxRotation:12,scale:1.08,enableShine:!0,shineIntensity:.6,springConfig:{stiffness:150,damping:12}},"profile-card":{variant:"subtle",shadowIntensity:"medium",glowEffect:"none",maxRotation:8,scale:1.03,enableShine:!1,springConfig:{stiffness:180,damping:15}},"game-card":{variant:"gaming",shadowIntensity:"extreme",glowEffect:"vibrant",maxRotation:20,scale:1.1,enableShine:!0,shineIntensity:.8,springConfig:{stiffness:220,damping:10}},"price-card":{variant:"dramatic",shadowIntensity:"heavy",glowEffect:"subtle",maxRotation:10,scale:1.05,enableShine:!0,shineIntensity:.4,springConfig:{stiffness:200,damping:18}},"feature-card":{variant:"neon",shadowIntensity:"extreme",glowEffect:"neon",maxRotation:15,scale:1.06,enableShine:!0,shineIntensity:.7,springConfig:{stiffness:180,damping:12}}},GSe=Ts.default.forwardRef(({children:e,className:t,variant:r,shadowIntensity:n,glowEffect:o,perspective:a=1e3,maxRotation:i=15,rotationIntensity:s,scale:l=1.05,springConfig:c={stiffness:200,damping:15,mass:1,velocity:0},animationSpeed:u=1,overlay:d,overlayAlwaysVisible:f=!1,glowColor:p="hsl(var(--primary))",glowBlur:m=20,glowSpread:h=1.2,enableTouch:g=!0,enableKeyboard:v=!0,onHoverStart:y,onHoverEnd:b,onRotationChange:w,animationDelay:x=0,ariaLabel:C,autoFocus:P=!1,rotateAxes:R={x:!0,y:!0},depthLayers:I,enableShine:z=!1,shineIntensity:A=.5,shineColor:T="rgba(255, 255, 255, 0.1)",glowLayers:$,preset:F,...S},N)=>{let k=(0,Ts.useMemo)(()=>{if(!F)return{variant:r,shadowIntensity:n,glowEffect:o,maxRotation:i,scale:l,springConfig:c,enableShine:z,shineIntensity:A,shineColor:T};let pe=zlt[F];return{variant:r??pe.variant,shadowIntensity:n??pe.shadowIntensity,glowEffect:o??pe.glowEffect,maxRotation:i!==15?i:pe.maxRotation??15,scale:l!==1.05?l:pe.scale??1.05,springConfig:{...pe.springConfig,...c},enableShine:z||pe.enableShine||!1,shineIntensity:A!==.5?A:pe.shineIntensity??.5,shineColor:T}},[F,r,n,o,i,l,c,z,A,T]),{onDrag:L,onDragStart:B,onDragEnd:D,onDragOver:_,onDrop:E,onAnimationStart:q,onAnimationEnd:H,onAnimationIteration:j,...V}=S,W=(0,Ts.useRef)(null),[G,U]=(0,Ts.useState)(!1),[J,ae]=(0,Ts.useState)(!1),[Q,ee]=(0,Ts.useState)({x:0,y:0}),te=k.maxRotation||s||15,X=aa(0),Z=aa(0),ne=jp(X,{...k.springConfig,stiffness:k.springConfig.stiffness*u,damping:k.springConfig.damping/u}),oe=jp(Z,{...k.springConfig,stiffness:k.springConfig.stiffness*u,damping:k.springConfig.damping/u}),se=Td(oe,[-1,1],R.x?[te,-te]:[0,0]),Y=Td(ne,[-1,1],R.y?[-te,te]:[0,0]),K=(0,Ts.useCallback)(pe=>{if(!W.current)return;let de=W.current.getBoundingClientRect(),ge=de.left+de.width/2,Se=de.top+de.height/2,_e,De;if("touches"in pe&&g)_e=pe.touches[0].clientX,De=pe.touches[0].clientY;else if("clientX"in pe)_e=pe.clientX,De=pe.clientY;else return;let Me=(De-Se)/(de.height/2),he=(_e-ge)/(de.width/2);if(X.set(he),Z.set(Me),k.enableShine){let xe=(_e-de.left)/de.width,Ae=(De-de.top)/de.height;ee({x:xe,y:Ae})}w&&w(se.get(),Y.get())},[g,X,Z,se,Y,w,k.enableShine]),le=(0,Ts.useCallback)(()=>{U(!0),y?.()},[y]),me=(0,Ts.useCallback)(()=>{U(!1),X.set(0),Z.set(0),b?.()},[X,Z,b]),re=(0,Ts.useCallback)(pe=>{if(!v||!J)return;let de=.1,ge=X.get(),Se=Z.get();switch(pe.key){case"ArrowUp":Se=Math.max(-.5,Se-de),Z.set(Se),pe.preventDefault();break;case"ArrowDown":Se=Math.min(.5,Se+de),Z.set(Se),pe.preventDefault();break;case"ArrowLeft":ge=Math.max(-.5,ge-de),X.set(ge),pe.preventDefault();break;case"ArrowRight":ge=Math.min(.5,ge+de),X.set(ge),pe.preventDefault();break;case"Enter":case" ":U(!G),G?b?.():y?.(),pe.preventDefault();break;case"Escape":X.set(0),Z.set(0),U(!1),b?.(),pe.preventDefault();break}w&&w(se.get(),Y.get())},[v,J,X,Z,G,y,b,se,Y,w]);(0,Ts.useEffect)(()=>{P&&W.current&&W.current.focus()},[P]);let ue=(0,Ts.useMemo)(()=>d?typeof d=="function"?d({isHovered:G,rotateX:se.get(),rotateY:Y.get()}):d:null,[d,G,se,Y]),ie=(0,Ts.useMemo)(()=>{if(k.glowEffect==="none")return{};let pe=0,de=m,ge=h;switch(k.glowEffect){case"subtle":pe=G?.3:0;break;case"vibrant":pe=G?.6:0,de=m*1.5;break;case"neon":pe=G?.8:0,de=m*2,ge=h*1.3;break}return{opacity:pe,filter:`blur(${de}px)`,scale:ge,backgroundColor:p}},[k.glowEffect,G,m,h,p]);return(0,ii.jsx)("div",{style:{perspective:`${a}px`},children:(0,ii.jsxs)(ve.div,{ref:pe=>{W.current=pe,typeof N=="function"?N(pe):N&&(N.current=pe)},className:M(qSe({variant:k.variant,shadowIntensity:k.shadowIntensity,glowEffect:k.glowEffect}),"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),onMouseMove:K,onMouseEnter:le,onMouseLeave:me,onTouchMove:g?K:void 0,onTouchStart:g?le:void 0,onTouchEnd:g?me:void 0,onKeyDown:re,onFocus:()=>ae(!0),onBlur:()=>ae(!1),style:{transformStyle:"preserve-3d",transformOrigin:"center center",rotateX:G||J?se:0,rotateY:G||J?Y:0,scale:G||J?k.scale:1},transition:{type:"spring",stiffness:k.springConfig.stiffness,damping:k.springConfig.damping,duration:.15*(1/u),delay:x/1e3},tabIndex:v?0:void 0,role:v?"button":void 0,"aria-label":C,...V,children:[(0,ii.jsx)(ve.div,{className:"relative z-10",animate:{z:G||J?20:0},transition:{duration:.2*(1/u)},children:e}),ue&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none z-20",animate:{opacity:f||G||J?1:0},transition:{duration:.3*(1/u)},children:ue}),I&&I.map((pe,de)=>(0,ii.jsx)(ve.div,{className:M("absolute inset-0 pointer-events-none",pe.className),style:{transformStyle:"preserve-3d",transform:`translateZ(${pe.depth}px)`},animate:{x:G||J?Y.get()*pe.depth*.1:0,y:G||J?se.get()*pe.depth*.1:0},transition:{duration:.2*(1/u)},children:pe.element},`depth-layer-${de}`)),k.enableShine&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none overflow-hidden",animate:{opacity:G||J?k.shineIntensity:0},transition:{duration:.3*(1/u)},children:(0,ii.jsx)("div",{className:"absolute w-full h-full",style:{background:`radial-gradient(circle at ${Q.x*100}% ${Q.y*100}%, ${k.shineColor} 0%, transparent 50%)`,transform:"translateZ(1px)"}})}),k.variant!=="subtle"&&(0,ii.jsx)(ve.div,{className:M("absolute inset-0 rounded-lg pointer-events-none",k.variant==="dramatic"&&"bg-gradient-to-br from-white/10 via-transparent to-black/10",k.variant==="gaming"&&"bg-gradient-to-br from-primary/10 via-transparent to-primary/5",k.variant==="elegant"&&"bg-gradient-to-br from-white/5 via-transparent to-black/5",k.variant==="neon"&&"bg-gradient-to-br from-primary/20 via-transparent to-primary/10"),animate:{opacity:G||J?1:0},transition:{duration:.3*(1/u)}}),$&&$.map((pe,de)=>{let ge={};return pe.animation==="pulse"?ge.animation="pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite":pe.animation==="rotate"&&(ge.animation="spin 3s linear infinite"),(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none",style:{...ge,zIndex:-10-de},animate:{opacity:G||J?pe.opacity:0,filter:`blur(${pe.blur}px)`,scale:pe.spread,backgroundColor:pe.color},transition:{duration:.3*(1/u)}},`glow-layer-${de}`)}),k.glowEffect!=="none"&&(0,ii.jsx)(ve.div,{className:"absolute inset-0 rounded-lg pointer-events-none -z-10",animate:ie,transition:{duration:.3*(1/u)}})]})})});GSe.displayName="HoverCard3DInternal";var KSe=Ts.default.forwardRef((e,t)=>{let{hasProAccess:r,isLoading:n}=Ee();return!n&&!r?(0,ii.jsx)(Ze,{className:M("w-fit",e.className),children:(0,ii.jsx)(tt,{className:"py-6 text-center",children:(0,ii.jsxs)("div",{className:"space-y-4",children:[(0,ii.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,ii.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,ii.jsxs)("div",{children:[(0,ii.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,ii.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"3D Hover Card is available exclusively to MoonUI Pro subscribers."}),(0,ii.jsx)("a",{href:"/pricing",children:(0,ii.jsxs)(we,{size:"sm",children:[(0,ii.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,ii.jsx)(GSe,{...e,ref:t})});KSe.displayName="HoverCard3D";var Xo=O(be(),1);var Gn=O(fe(),1),YSe=Xo.default.forwardRef(({children:e,minZoom:t=.5,maxZoom:r=3,initialZoom:n=1,className:o,contentClassName:a,onZoomChange:i,showControls:s=!0,showIndicator:l=!0,doubleTapBehavior:c="zoom",wheelScaling:u=!0,dragEnabled:d=!0,zoomStep:f=.5,smoothZoom:p=!0,boundaryConstraints:m=!0,...h},g)=>{let v=(0,Xo.useRef)(null),y=(0,Xo.useRef)(null),[b,w]=(0,Xo.useState)(!1),[x,C]=(0,Xo.useState)(!1),[P,R]=(0,Xo.useState)(0),[I,z]=(0,Xo.useState)(!1),[A,T]=(0,Xo.useState)(!1),$=aa(n),F=aa(0),S=aa(0),N=Td($,W=>Math.min(Math.max(W,t),r)),k=Td($,W=>Math.round(W*100)),L=(0,Xo.useCallback)(()=>{if(!v.current||!y.current||!m)return{left:0,right:0,top:0,bottom:0};let W=v.current.getBoundingClientRect(),G=$.get(),U=W.width*G,J=W.height*G,ae=Math.max(0,(U-W.width)/2),Q=Math.max(0,(J-W.height)/2);return{left:-ae,right:ae,top:-Q,bottom:Q}},[$,m]);(0,Xo.useEffect)(()=>{if(!v.current||!u)return;let W=v.current,G=U=>{I&&u&&(U.ctrlKey||U.metaKey)&&U.preventDefault()};return W.addEventListener("wheel",G,{passive:!1}),()=>{W.removeEventListener("wheel",G)}},[I,u]);let B=(0,Xo.useCallback)(W=>{if(!u||!W.ctrlKey&&!W.metaKey)return;W.preventDefault();let G=-W.deltaY/1e3,U=$.get(),J=Math.min(Math.max(U+G,t),r);if(v.current){let ae=v.current.getBoundingClientRect(),Q=(W.clientX-ae.left)/ae.width-.5,ee=(W.clientY-ae.top)/ae.height-.5,te=J-U,X=F.get(),Z=S.get(),ne=X-Q*ae.width*te,oe=Z-ee*ae.height*te;p?(jo(F,ne,{duration:.2}),jo(S,oe,{duration:.2})):(F.set(ne),S.set(oe))}p?jo($,J,{duration:.2}):$.set(J),i?.(J),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,F,S,t,r,i,u,p,l]),D=(0,Xo.useCallback)(W=>{W.preventDefault();let G=$.get(),U;if(c==="reset")U=n;else if(U=G>1?1:2,U>1&&v.current){let J=v.current.getBoundingClientRect(),ae=(W.clientX-J.left)/J.width-.5,Q=(W.clientY-J.top)/J.height-.5,ee=-ae*J.width*(U-1),te=-Q*J.height*(U-1);jo(F,ee,{duration:.3,type:"spring",stiffness:300}),jo(S,te,{duration:.3,type:"spring",stiffness:300})}jo($,Math.min(Math.max(U,t),r),{duration:.3,type:"spring",stiffness:300}),(U===1||c==="reset")&&(jo(F,0,{duration:.3}),jo(S,0,{duration:.3})),i?.(U),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,F,S,t,r,n,i,c,l]),_=(0,Xo.useCallback)(W=>{let G=Date.now(),U=G-P;if(U<300&&U>0){let J=W.changedTouches[0],ae={clientX:J.clientX,clientY:J.clientY,preventDefault:()=>{}};D(ae)}R(G)},[P,D]),E=(0,Xo.useCallback)(()=>{jo($,n,{duration:.3,type:"spring",stiffness:300}),jo(F,0,{duration:.3,type:"spring",stiffness:300}),jo(S,0,{duration:.3,type:"spring",stiffness:300}),i?.(n)},[$,F,S,n,i]),q=(0,Xo.useCallback)(()=>{let W=$.get(),G=Math.min(W+f,r);jo($,G,{duration:.3,type:"spring",stiffness:300}),i?.(G),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,r,f,i,l]),H=(0,Xo.useCallback)(()=>{let W=$.get(),G=Math.max(W-f,t);if(jo($,G,{duration:.3,type:"spring",stiffness:300}),G<$.get()){let U=L(),J=F.get(),ae=S.get();(J<U.left||J>U.right)&&jo(F,0,{duration:.3}),(ae<U.top||ae>U.bottom)&&jo(S,0,{duration:.3})}i?.(G),l&&(C(!0),setTimeout(()=>C(!1),1500))},[$,t,f,F,S,L,i,l]),j=(0,Xo.useCallback)(()=>{E()},[E]),V=(0,Xo.useCallback)(()=>{v.current&&(document.fullscreenElement?document.exitFullscreen().then(()=>{T(!1)}).catch(W=>{console.error("Exit fullscreen error:",W)}):(v.current.parentElement||v.current).requestFullscreen().then(()=>{T(!0)}).catch(G=>{console.error("Fullscreen error:",G)}))},[]);return(0,Xo.useEffect)(()=>{let W=()=>{T(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",W),document.addEventListener("webkitfullscreenchange",W),document.addEventListener("mozfullscreenchange",W),document.addEventListener("MSFullscreenChange",W),()=>{document.removeEventListener("fullscreenchange",W),document.removeEventListener("webkitfullscreenchange",W),document.removeEventListener("mozfullscreenchange",W),document.removeEventListener("MSFullscreenChange",W)}},[]),(0,Xo.useEffect)(()=>{if(!I||!u)return;let W=G=>{!G.ctrlKey&&!G.metaKey||(G.key==="+"||G.key==="="?(G.preventDefault(),q()):G.key==="-"||G.key==="_"?(G.preventDefault(),H()):G.key==="0"&&(G.preventDefault(),E()))};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[I,u,q,H,E]),(0,Xo.useEffect)(()=>$.onChange(()=>{let G=L(),U=F.get(),J=S.get();m&&((U<G.left||U>G.right)&&jo(F,Math.max(G.left,Math.min(G.right,U)),{duration:.2}),(J<G.top||J>G.bottom)&&jo(S,Math.max(G.top,Math.min(G.bottom,J)),{duration:.2}))}),[$,F,S,L,m]),(0,Gn.jsxs)("div",{ref:g,className:M("relative overflow-hidden touch-none select-none",d&&"cursor-grab active:cursor-grabbing",A&&"fixed inset-0 z-50 bg-background",o),onWheel:B,onDoubleClick:D,onTouchEnd:_,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),...h,children:[(0,Gn.jsx)("div",{ref:v,className:"w-full h-full",children:(0,Gn.jsx)(ve.div,{ref:y,drag:d,dragElastic:.1,dragMomentum:!1,dragConstraints:m?L():!1,onDragStart:()=>w(!0),onDragEnd:()=>w(!1),style:{scale:N,x:F,y:S},className:M("w-full h-full flex items-center justify-center",b&&"cursor-grabbing",a),children:e})}),(0,Gn.jsx)(Mt,{children:l&&x&&(0,Gn.jsxs)(ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute top-4 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-black/80 dark:bg-white/80 text-white dark:text-black rounded-full text-sm font-medium pointer-events-none",children:[k.get(),"%"]})}),s&&(0,Gn.jsxs)("div",{className:"absolute bottom-4 right-4 flex gap-2",children:[(0,Gn.jsx)("button",{onClick:H,disabled:$.get()<=t,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom out",children:(0,Gn.jsx)(Gd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:q,disabled:$.get()>=r,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","disabled:opacity-50 disabled:cursor-not-allowed","shadow-sm hover:shadow-md"),"aria-label":"Zoom in",children:(0,Gn.jsx)(qd,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:E,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":"Reset zoom",children:(0,Gn.jsx)(jx,{className:"w-4 h-4"})}),(0,Gn.jsx)("button",{onClick:V,className:M("p-2 bg-background/80 backdrop-blur-sm border rounded-md","hover:bg-background/90 transition-all duration-200","shadow-sm hover:shadow-md"),"aria-label":A?"Exit fullscreen":"Enter fullscreen",children:A?(0,Gn.jsx)($x,{className:"w-4 h-4"}):(0,Gn.jsx)(Wl,{className:"w-4 h-4"})})]}),s&&(0,Gn.jsx)("div",{className:"absolute bottom-4 left-4 px-3 py-1.5 bg-background/80 backdrop-blur-sm border rounded-md text-sm",children:(0,Gn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Gn.jsxs)("span",{children:[Math.round($.get()*100),"%"]}),u&&!x&&(0,Gn.jsx)("span",{className:"text-xs text-muted-foreground",children:"(Ctrl+Scroll to zoom)"})]})})]})});YSe.displayName="PinchZoomInternal";var XSe=Xo.default.forwardRef(({className:e,...t},r)=>{let{hasProAccess:n,isLoading:o}=Ee();return!o&&!n?(0,Gn.jsx)(Ze,{className:M("w-fit",e),children:(0,Gn.jsx)(tt,{className:"py-6 text-center",children:(0,Gn.jsxs)("div",{className:"space-y-4",children:[(0,Gn.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Gn.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Gn.jsxs)("div",{children:[(0,Gn.jsx)("h3",{className:"font-semibold text-sm mb-2",children:"Pro Feature"}),(0,Gn.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Pinch Zoom is available exclusively to MoonUI Pro subscribers."}),(0,Gn.jsx)("a",{href:"/pricing",children:(0,Gn.jsxs)(we,{size:"sm",children:[(0,Gn.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})]})]})})}):(0,Gn.jsx)(YSe,{className:e,ref:r,...t})});XSe.displayName="PinchZoom";var nl=O(be(),1);var EN=O(be(),1);var lr=O(fe(),1),JSe=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],Ult=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e","#64748b"];function QSe({open:e,onOpenChange:t,event:r,selectedDate:n,onSave:o,onDelete:a,mode:i="create"}){let[s,l]=(0,EN.useState)({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,u]=(0,EN.useState)({}),[d,f]=(0,EN.useState)(!1);(0,EN.useEffect)(()=>{if(i==="edit"&&r)l({title:r.title||"",description:r.description||"",date:r.date.toISOString().split("T")[0],startTime:r.startTime||"",endTime:r.endTime||"",location:r.location||"",type:r.type||"meeting",color:r.color||"#3b82f6",attendees:r.attendees?.join(", ")||""});else if(i==="create"){let v=n?n.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:v,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""})}u({})},[r,n,i,e]);let p=()=>{let v={};return s.title.trim()||(v.title="Title is required"),s.date||(v.date="Date is required"),s.startTime&&s.endTime&&s.startTime>=s.endTime&&(v.endTime="End time must be after start time"),u(v),Object.keys(v).length===0},m=async v=>{if(v.preventDefault(),!!p()){f(!0);try{let y={...i==="edit"&&r?{id:r.id}:{},title:s.title.trim(),description:s.description.trim(),date:new Date(s.date+"T00:00:00"),startTime:s.startTime||void 0,endTime:s.endTime||void 0,location:s.location.trim()||void 0,type:s.type,color:s.color,attendees:s.attendees?s.attendees.split(",").map(b=>b.trim()).filter(Boolean):void 0};await o(y),t(!1)}catch(y){console.error("Error saving event:",y)}finally{f(!1)}}},h=()=>{r&&a&&(a(r.id),t(!1))},g=v=>{let y=JSe.find(b=>b.value===v);l(b=>({...b,type:v,color:y?.color||b.color}))};return(0,lr.jsx)(ha,{open:e,onOpenChange:t,children:(0,lr.jsxs)(Ko,{className:"sm:max-w-[500px]",children:[(0,lr.jsxs)(Ba,{children:[(0,lr.jsxs)(ga,{className:"flex items-center gap-2",children:[(0,lr.jsx)(ei,{className:"w-5 h-5"}),i==="create"?"Create Event":"Edit Event"]}),(0,lr.jsx)(Cl,{children:i==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),(0,lr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"title",children:"Title *"}),(0,lr.jsx)(Zt,{id:"title",value:s.title,onChange:v=>l(y=>({...y,title:v.target.value})),placeholder:"Event title",className:M(c.title&&"border-red-500")}),c.title&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.title})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"description",children:"Description"}),(0,lr.jsx)(lu,{id:"description",value:s.description,onChange:v=>l(y=>({...y,description:v.target.value})),placeholder:"Event description (optional)",rows:3})]}),(0,lr.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"date",children:"Date *"}),(0,lr.jsx)(Zt,{id:"date",type:"date",value:s.date,onChange:v=>l(y=>({...y,date:v.target.value})),className:M(c.date&&"border-red-500")}),c.date&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.date})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"startTime",children:"Start Time"}),(0,lr.jsx)(Zt,{id:"startTime",type:"time",value:s.startTime,onChange:v=>l(y=>({...y,startTime:v.target.value})),placeholder:"09:00"})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"endTime",children:"End Time"}),(0,lr.jsx)(Zt,{id:"endTime",type:"time",value:s.endTime,onChange:v=>l(y=>({...y,endTime:v.target.value})),placeholder:"10:00",className:M(c.endTime&&"border-red-500")}),c.endTime&&(0,lr.jsx)("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{htmlFor:"location",className:"flex items-center gap-2",children:[(0,lr.jsx)(Hf,{className:"w-4 h-4"}),"Location"]}),(0,lr.jsx)(Zt,{id:"location",value:s.location,onChange:v=>l(y=>({...y,location:v.target.value})),placeholder:"Meeting room, address, or link"})]}),(0,lr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{className:"flex items-center gap-2",children:[(0,lr.jsx)(Kx,{className:"w-4 h-4"}),"Type"]}),(0,lr.jsxs)(_o,{value:s.type,onValueChange:g,children:[(0,lr.jsx)(Fo,{children:(0,lr.jsx)(Yo,{})}),(0,lr.jsx)(Bo,{children:JSe.map(v=>(0,lr.jsx)(Ut,{value:v.value,children:(0,lr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lr.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:v.color}}),v.label]})},v.value))})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)(Lt,{className:"flex items-center gap-2",children:[(0,lr.jsx)(Qc,{className:"w-4 h-4"}),"Color"]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lr.jsx)("input",{type:"color",value:s.color,onChange:v=>l(y=>({...y,color:v.target.value})),className:"w-8 h-8 rounded border cursor-pointer flex-shrink-0"}),(0,lr.jsx)("span",{className:"text-sm text-muted-foreground",children:"Custom color"})]}),(0,lr.jsx)("div",{className:"grid grid-cols-8 gap-1",children:Ult.map(v=>(0,lr.jsx)("button",{type:"button",onClick:()=>l(y=>({...y,color:v})),className:M("w-full aspect-square rounded border-2 hover:scale-110 transition-transform",s.color===v?"border-foreground shadow-sm":"border-transparent"),style:{backgroundColor:v},"aria-label":`Select color ${v}`},v))})]})]})]}),(0,lr.jsxs)("div",{className:"space-y-2",children:[(0,lr.jsx)(Lt,{htmlFor:"attendees",children:"Attendees"}),(0,lr.jsx)(Zt,{id:"attendees",value:s.attendees,onChange:v=>l(y=>({...y,attendees:v.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),(0,lr.jsxs)(dm,{className:"gap-2",children:[i==="edit"&&a&&(0,lr.jsx)(we,{type:"button",variant:"destructive",onClick:h,className:"mr-auto",children:"Delete Event"}),(0,lr.jsx)(we,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:d,children:"Cancel"}),(0,lr.jsx)(we,{type:"submit",disabled:d,children:d?i==="create"?"Creating...":"Saving...":i==="create"?"Create Event":"Save Changes"})]})]})]})})}var Be=O(fe(),1),BK=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZSe=["January","February","March","April","May","June","July","August","September","October","November","December"],TN={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500",birthday:"bg-pink-500",holiday:"bg-orange-500",conference:"bg-indigo-500"},Vlt={low:"border-l-4 border-l-muted-foreground",medium:"border-l-4 border-l-yellow-500",high:"border-l-4 border-l-red-500"},$lt={confirmed:"",tentative:"opacity-70 border-dashed",cancelled:"opacity-50 line-through"};function Hlt({events:e=[],onEventClick:t,onEventAdd:r,onEventEdit:n,onEventDelete:o,onDateChange:a,onViewChange:i,onEventDrop:s,className:l,showWeekends:c=!0,showEventDetails:u=!0,disabled:d=!1,minDate:f,maxDate:p,highlightToday:m=!0,height:h,defaultView:g="month",enableDragDrop:v=!0,enableSearch:y=!0,enableFilters:b=!0,enableExport:w=!0,enableImport:x=!1,enableRecurringEvents:C=!0,enableReminders:P=!0,eventCategories:R,workingHours:I={start:"09:00",end:"18:00"},holidays:z=[],locale:A="en-US",timeFormat:T="12h",firstDayOfWeek:$=0,theme:F="auto",customTheme:S,compactMode:N=!1,showProUpgrade:k=!1}){if(k)return(0,Be.jsx)(Ze,{className:M("w-full",l),children:(0,Be.jsx)(tt,{className:"py-12 text-center",children:(0,Be.jsxs)("div",{className:"max-w-md mx-auto space-y-4",children:[(0,Be.jsx)("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:(0,Be.jsx)(Qt,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),(0,Be.jsxs)("div",{children:[(0,Be.jsx)("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),(0,Be.jsx)("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),(0,Be.jsx)("div",{className:"flex gap-3 justify-center",children:(0,Be.jsx)("a",{href:"/pricing",children:(0,Be.jsxs)(we,{size:"sm",children:[(0,Be.jsx)(jt,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[L,B]=nl.default.useState(new Date),[D,_]=nl.default.useState(null),[E,q]=nl.default.useState(g),[H,j]=nl.default.useState(!1),[V,W]=nl.default.useState("create"),[G,U]=nl.default.useState(null),[J,ae]=nl.default.useState(null),[Q,ee]=nl.default.useState(null),[te,X]=nl.default.useState(""),[Z,ne]=nl.default.useState("all"),[oe,se]=nl.default.useState("all"),[Y,K]=nl.default.useState(!1),[le,me]=nl.default.useState([]),[re,ue]=nl.default.useState(new Date),[ie,pe]=nl.default.useState(!1),[de,ge]=nl.default.useState(!1),Se=new Date,_e=L.getMonth(),De=L.getFullYear(),Me=new Date(De,_e,1),he=new Date(De,_e+1,0),xe=new Date(Me),Ae=(xe.getDay()-$+7)%7;xe.setDate(xe.getDate()-Ae);let Te=new Date(he),Oe=(6-Te.getDay()+$)%7;Te.setDate(Te.getDate()+Oe);let ct=[],We=new Date(xe);for(;We<=Te;)ct.push(new Date(We)),We.setDate(We.getDate()+1);let bt=nl.default.useMemo(()=>{let Ke=new Set;return e.forEach(ut=>{ut.tags?.forEach(Et=>Ke.add(Et))}),Array.from(Ke)},[e]),It=nl.default.useMemo(()=>e.filter(Ke=>!(te&&!Ke.title.toLowerCase().includes(te.toLowerCase())&&!Ke.description?.toLowerCase().includes(te.toLowerCase())||Z!=="all"&&Ke.type!==Z||oe!=="all"&&Ke.priority!==oe||le.length>0&&(!Ke.tags||!Ke.tags.some(ut=>le.includes(ut))))),[e,te,Z,oe,le]),it=Ke=>It.filter(ut=>{let Et=new Date(ut.date);return ut.recurring?Ft(Ke,ut):Et.toDateString()===Ke.toDateString()}),Ft=(Ke,ut)=>{if(!ut.recurring)return!1;let Et=new Date(ut.date),Dr=Math.floor((Ke.getTime()-Et.getTime())/(1e3*60*60*24));if(Dr<0||ut.recurring.endDate&&Ke>ut.recurring.endDate)return!1;switch(ut.recurring.pattern){case"daily":return Dr%ut.recurring.interval===0;case"weekly":return Dr%(ut.recurring.interval*7)!==0?!1:ut.recurring.daysOfWeek?ut.recurring.daysOfWeek.includes(Ke.getDay()):Ke.getDay()===Et.getDay();case"monthly":return((Ke.getFullYear()-Et.getFullYear())*12+(Ke.getMonth()-Et.getMonth()))%ut.recurring.interval!==0?!1:ut.recurring.dayOfMonth?Ke.getDate()===ut.recurring.dayOfMonth:Ke.getDate()===Et.getDate();case"yearly":return(Ke.getFullYear()-Et.getFullYear())%ut.recurring.interval!==0?!1:Ke.getMonth()===Et.getMonth()&&Ke.getDate()===Et.getDate();default:return!1}},vr=Ke=>Ke.toDateString()===Se.toDateString(),Ue=Ke=>Ke.getMonth()===_e,ze=Ke=>D&&Ke.toDateString()===D.toDateString(),He=Ke=>!!(d||f&&Ke<f||p&&Ke>p),st=Ke=>{let ut=new Date(L);Ke==="prev"?ut.setMonth(_e-1):ut.setMonth(_e+1),B(ut),a?.(ut)},xt=Ke=>{q(Ke),i?.(Ke)},vt=()=>{let Ke=nr(It),ut=new Blob([Ke],{type:"text/calendar"}),Et=URL.createObjectURL(ut),Dr=document.createElement("a");Dr.href=Et,Dr.download="calendar.ics",Dr.click(),URL.revokeObjectURL(Et)},nr=Ke=>{let ut=`BEGIN:VCALENDAR\r
280
280
  VERSION:2.0\r
281
281
  PRODID:-//MoonUI//Calendar//EN\r
282
282
  `;return Ke.forEach(Et=>{ut+=`BEGIN:VEVENT\r