@moontra/moonui-pro 2.30.3 → 2.30.4
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.
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -412,7 +412,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
412
412
|
${p}px !important;
|
|
413
413
|
top: ${u}px !important;
|
|
414
414
|
}
|
|
415
|
-
`),()=>{h.contains(m)&&h.removeChild(m)}},[t]),(0,UXe.jsx)(Uce,{isPresent:t,childRef:a,sizeRef:i,children:tG.cloneElement(e,{ref:a})})}var jXe=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:o,presenceAffectsLayout:a,mode:i,anchorX:s,root:l})=>{let c=ev(Vtr),u=(0,gF.useId)(),d=!0,f=(0,gF.useMemo)(()=>(d=!1,{id:u,initial:t,isPresent:r,custom:o,onExitComplete:p=>{c.set(p,!0);for(let m of c.values())if(!m)return;n&&n()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[r,c,n]);return a&&d&&(f={...f}),(0,gF.useMemo)(()=>{c.forEach((p,m)=>c.set(m,!1))},[r]),HXe.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),i==="popLayout"&&(e=(0,zce.jsx)(zXe,{isPresent:r,anchorX:s,root:l,children:e})),(0,zce.jsx)(X0.Provider,{value:f,children:e})};function Vtr(){return new Map}var nw=D(lt(),1);function rG(e=!0){let t=(0,nw.useContext)(X0);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:o}=t,a=(0,nw.useId)();(0,nw.useEffect)(()=>{if(e)return o(a)},[e]);let i=(0,nw.useCallback)(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,i]:[!0]}var nG=D(lt(),1),vF=e=>e.key||"";function Hce(e){let t=[];return nG.Children.forEach(e,r=>{(0,nG.isValidElement)(r)&&t.push(r)}),t}var xF=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",root:l})=>{let[c,u]=rG(i),d=(0,nv.useMemo)(()=>Hce(e),[e]),f=i&&!c?[]:d.map(vF),p=(0,nv.useRef)(!0),m=(0,nv.useRef)(d),h=ev(()=>new Map),[g,v]=(0,nv.useState)(d),[y,x]=(0,nv.useState)(d);cM(()=>{p.current=!1,m.current=d;for(let C=0;C<y.length;C++){let S=vF(y[C]);f.includes(S)?h.delete(S):h.get(S)!==!0&&h.set(S,!1)}},[y,f.length,f.join("-")]);let w=[];if(d!==g){let C=[...d];for(let S=0;S<y.length;S++){let P=y[S],N=vF(P);f.includes(N)||(C.splice(S,0,P),w.push(P))}return a==="wait"&&w.length&&(C=w),x(Hce(C)),v(d),null}let{forceRender:b}=(0,nv.useContext)(sM);return(0,yF.jsx)(yF.Fragment,{children:y.map(C=>{let S=vF(C),P=i&&!c?!1:d===y||f.includes(S),N=()=>{if(h.has(S))h.set(S,!0);else return;let T=!0;h.forEach(A=>{A||(T=!1)}),T&&(b?.(),x(m.current),i&&u?.(),n&&n())};return(0,yF.jsx)(jXe,{isPresent:P,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:o,mode:a,root:l,onExitComplete:P?void 0:N,anchorX:s,children:C},S)})})};var $Xe=D(lt(),1),oG=(0,$Xe.createContext)({strict:!1});var qXe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ax={};for(let e in qXe)ax[e]={isEnabled:t=>qXe[e].some(r=>!!t[r])};function WXe(e){for(let t in e)ax[t]={...ax[t],...e[t]}}var Utr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function bF(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Utr.has(e)}var GXe=e=>!bF(e);function ztr(e){typeof e=="function"&&(GXe=t=>t.startsWith("on")?!bF(t):e(t))}try{ztr(xfe("@emotion/is-prop-valid").default)}catch{}function KXe(e,t,r){let n={};for(let o in e)o==="values"&&typeof e.values=="object"||(GXe(o)||r===!0&&bF(o)||!t&&!bF(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}var gG=D(Or(),1);var kM=D(lt(),1);var XXe=D(lt(),1),ow=(0,XXe.createContext)({});var sG=D(lt(),1);function aw(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ix(e){return typeof e=="string"||Array.isArray(e)}var aG=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wF=["initial",...aG];function A1(e){return aw(e.animate)||wF.some(t=>ix(e[t]))}function iG(e){return!!(A1(e)||e.variants)}function YXe(e,t){if(A1(e)){let{initial:r,animate:n}=e;return{initial:r===!1||ix(r)?r:void 0,animate:ix(n)?n:void 0}}return e.inherit!==!1?t:{}}function ZXe(e){let{initial:t,animate:r}=YXe(e,(0,sG.useContext)(ow));return(0,sG.useMemo)(()=>({initial:t,animate:r}),[QXe(t),QXe(r)])}function QXe(e){return Array.isArray(e)?e.join(" "):e}var wM=D(lt(),1);var tYe=D(lt(),1);var L1={};function JXe(e){for(let t in e)L1[t]=e[t],y1(t)&&(L1[t].isCSSVariable=!0)}function lG(e,{layout:t,layoutId:r}){return Df.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!L1[e]||e==="opacity")}var Htr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jtr=mh.length;function eYe(e,t,r){let n="",o=!0;for(let a=0;a<jtr;a++){let i=mh[a],s=e[i];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(i.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||r){let c=pF(s,k1[i]);if(!l){o=!1;let u=Htr[i]||i;n+=`${u}(${c}) `}r&&(t[i]=c)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}function yM(e,t,r){let{style:n,vars:o,transformOrigin:a}=e,i=!1,s=!1;for(let l in t){let c=t[l];if(Df.has(l)){i=!0;continue}else if(y1(l)){o[l]=c;continue}else{let u=pF(c,k1[l]);l.startsWith("origin")?(s=!0,a[l]=u):n[l]=u}}if(t.transform||(i||r?n.transform=eYe(t,e.transform,r):n.transform&&(n.transform="none")),s){let{originX:l="50%",originY:c="50%",originZ:u=0}=a;n.transformOrigin=`${l} ${c} ${u}`}}var xM=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jce(e,t,r){for(let n in t)!Io(t[n])&&!lG(n,r)&&(e[n]=t[n])}function $tr({transformTemplate:e},t){return(0,tYe.useMemo)(()=>{let r=xM();return yM(r,t,e),Object.assign({},r.vars,r.style)},[t])}function qtr(e,t){let r=e.style||{},n={};return jce(n,r,e),Object.assign(n,$tr(e,t)),n}function rYe(e,t){let r={},n=qtr(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var oYe=D(lt(),1);var Wtr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gtr={offset:"strokeDashoffset",array:"strokeDasharray"};function nYe(e,t,r=1,n=0,o=!0){e.pathLength=1;let a=o?Wtr:Gtr;e[a.offset]=mr.transform(-n);let i=mr.transform(t),s=mr.transform(r);e[a.array]=`${i} ${s}`}function cG(e,{attrX:t,attrY:r,attrScale:n,pathLength:o,pathSpacing:a=1,pathOffset:i=0,...s},l,c,u){if(yM(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),n!==void 0&&(d.scale=n),o!==void 0&&nYe(d,o,a,i,!1)}var uG=()=>({...xM(),attrs:{}});var dG=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aYe(e,t,r,n){let o=(0,oYe.useMemo)(()=>{let a=uG();return cG(a,t,dG(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){let a={};jce(a,e.style,e),o.style={...a,...o.style}}return o}var iYe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function bM(e){return typeof e!="string"||e.includes("-")?!1:!!(iYe.indexOf(e)>-1||/[A-Z]/u.test(e))}function sYe(e,t,r,{latestValues:n},o,a=!1){let s=(bM(e)?aYe:rYe)(t,n,o,e),l=KXe(t,typeof e=="string",a),c=e!==wM.Fragment?{...l,...s,ref:r}:{},{children:u}=t,d=(0,wM.useMemo)(()=>Io(u)?u.get():u,[u]);return(0,wM.createElement)(e,{...c,children:d})}var $ce=D(lt(),1);function lYe(e){let t=[{},{}];return e?.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function CM(e,t,r,n){if(typeof t=="function"){let[o,a]=lYe(n);t=t(r!==void 0?r:e.custom,o,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,a]=lYe(n);t=t(r!==void 0?r:e.custom,o,a)}return t}function SM(e){return Io(e)?e.get():e}function Ktr({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,o){return{latestValues:Xtr(r,n,o,e),renderState:t()}}function Xtr(e,t,r,n){let o={},a=n(e,{});for(let f in a)o[f]=SM(a[f]);let{initial:i,animate:s}=e,l=A1(e),c=iG(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),s===void 0&&(s=t.animate));let u=r?r.initial===!1:!1;u=u||i===!1;let d=u?s:i;if(d&&typeof d!="boolean"&&!aw(d)){let f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){let m=CM(e,f[p]);if(m){let{transitionEnd:h,transition:g,...v}=m;for(let y in v){let x=v[y];if(Array.isArray(x)){let w=u?x.length-1:0;x=x[w]}x!==null&&(o[y]=x)}for(let y in h)o[y]=h[y]}}}return o}var fG=e=>(t,r)=>{let n=(0,$ce.useContext)(ow),o=(0,$ce.useContext)(X0),a=()=>Ktr(e,t,n,o);return r?a():ev(a)};function PM(e,t,r){let{style:n}=e,o={};for(let a in n)(Io(n[a])||t.style&&Io(t.style[a])||lG(a,e)||r?.getValue(a)?.liveStyle!==void 0)&&(o[a]=n[a]);return o}var cYe=fG({scrapeMotionValuesFromProps:PM,createRenderState:xM});function pG(e,t,r){let n=PM(e,t,r);for(let o in e)if(Io(e[o])||Io(t[o])){let a=mh.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;n[a]=e[o]}return n}var uYe=fG({scrapeMotionValuesFromProps:pG,createRenderState:uG});var dYe=Symbol.for("motionComponentSymbol");var fYe=D(lt(),1);function sx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function pYe(e,t,r){return(0,fYe.useCallback)(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):sx(r)&&(r.current=n))},[t])}var Md=D(lt(),1);var IM=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Ytr="framerAppearId",mG="data-"+IM(Ytr);var mYe=D(lt(),1),hG=(0,mYe.createContext)({});function hYe(e,t,r,n,o){let{visualElement:a}=(0,Md.useContext)(ow),i=(0,Md.useContext)(oG),s=(0,Md.useContext)(X0),l=(0,Md.useContext)(rw).reducedMotion,c=(0,Md.useRef)(null);n=n||i.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:a,props:r,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));let u=c.current,d=(0,Md.useContext)(hG);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&Qtr(c.current,r,o,d);let f=(0,Md.useRef)(!1);(0,Md.useInsertionEffect)(()=>{u&&f.current&&u.update(r,s)});let p=r[mG],m=(0,Md.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return cM(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,Md.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),m.current=!1),u.enteringChildren=void 0)}),u}function Qtr(e,t,r,n){let{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:gYe(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&sx(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:c})}function gYe(e){if(e)return e.options.allowProjection!==!1?e.projection:gYe(e.parent)}function vG(e,{forwardMotionProps:t=!1}={},r,n){r&&WXe(r);let o=bM(e)?uYe:cYe;function a(s,l){let c,u={...(0,kM.useContext)(rw),...s,layoutId:Ztr(s)},{isStatic:d}=u,f=ZXe(s),p=o(s,d);if(!d&&lM){Jtr(u,r);let m=err(u);c=m.MeasureLayout,f.visualElement=hYe(e,p,u,n,m.ProjectionNode)}return(0,gG.jsxs)(ow.Provider,{value:f,children:[c&&f.visualElement?(0,gG.jsx)(c,{visualElement:f.visualElement,...u}):null,sYe(e,s,pYe(p,f.visualElement,l),p,d,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;let i=(0,kM.forwardRef)(a);return i[dYe]=e,i}function Ztr({layoutId:e}){let t=(0,kM.useContext)(sM).id;return t&&e!==void 0?t+"-"+e:e}function Jtr(e,t){let r=(0,kM.useContext)(oG).strict}function err(e){let{drag:t,layout:r}=ax;if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function vYe(e,t){if(typeof Proxy>"u")return vG;let r=new Map,n=(a,i)=>vG(a,i,e,t),o=(a,i)=>n(a,i);return new Proxy(o,{get:(a,i)=>i==="create"?n:(r.has(i)||r.set(i,vG(i,void 0,e,t)),r.get(i))})}var EYe=D(lt(),1);function yG({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function yYe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xYe(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function qce(e){return e===void 0||e===1}function xG({scale:e,scaleX:t,scaleY:r}){return!qce(e)||!qce(t)||!qce(r)}function lx(e){return xG(e)||Wce(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wce(e){return bYe(e.x)||bYe(e.y)}function bYe(e){return e&&e!=="0%"}function CF(e,t,r){let n=e-r,o=t*n;return r+o}function wYe(e,t,r,n,o){return o!==void 0&&(e=CF(e,o,n)),CF(e,r,n)+t}function Gce(e,t=0,r=1,n,o){e.min=wYe(e.min,t,r,n,o),e.max=wYe(e.max,t,r,n,o)}function Kce(e,{x:t,y:r}){Gce(e.x,t.translate,t.scale,t.originPoint),Gce(e.y,r.translate,r.scale,r.originPoint)}var CYe=.999999999999,SYe=1.0000000000001;function IYe(e,t,r,n=!1){let o=r.length;if(!o)return;t.x=t.y=1;let a,i;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;let{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&E1(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Kce(e,i)),n&&lx(a.latestValues)&&E1(e,a.latestValues))}t.x<SYe&&t.x>CYe&&(t.x=1),t.y<SYe&&t.y>CYe&&(t.y=1)}function iw(e,t){e.min=e.min+t,e.max=e.max+t}function PYe(e,t,r,n,o=.5){let a=Ln(e.min,e.max,o);Gce(e,t,r,a,n)}function E1(e,t){PYe(e.x,t.x,t.scaleX,t.scale,t.originX),PYe(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xce(e,t){return yG(xYe(e.getBoundingClientRect(),t))}function kYe(e,t,r){let n=Xce(e,r),{scroll:o}=t;return o&&(iw(n.x,o.offset.x),iw(n.y,o.offset.y)),n}var RYe=()=>({translate:0,scale:1,origin:0,originPoint:0}),D1=()=>({x:RYe(),y:RYe()}),NYe=()=>({min:0,max:0}),da=()=>({x:NYe(),y:NYe()});var SF={current:null},bG={current:!1};function MYe(){if(bG.current=!0,!!lM)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>SF.current=e.matches;e.addEventListener("change",t),t()}else SF.current=!1}var sw=new WeakMap;function TYe(e,t,r){for(let n in t){let o=t[n],a=r[n];if(Io(o))e.addValue(n,o);else if(Io(a))e.addValue(n,Nd(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){let i=e.getValue(n);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{let i=e.getStaticValue(n);e.addValue(n,Nd(i!==void 0?i:o,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var AYe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],RM=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:o,blockInitialAnimation:a,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=nx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let f=Qi.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,dn.render(this.render,!1,!0))};let{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=A1(r),this.isVariantNode=iG(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in d){let p=d[f];l[f]!==void 0&&Io(p)&&p.set(l[f])}}mount(t){this.current=t,sw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),bG.current||MYe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:SF.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Hc(this.notifyUpdate),Hc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let n=Df.has(t);n&&this.onBindTransform&&this.onBindTransform();let o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&dn.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ax){let r=ax[t];if(!r)continue;let{isEnabled:n,Feature:o}=r;if(!this.features[t]&&o&&n(this.props)&&(this.features[t]=new o(this)),this.features[t]){let a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):da()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<AYe.length;n++){let o=AYe[n];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let a="on"+o,i=t[a];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=TYe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Nd(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(O_(n)||F_(n))?n=parseFloat(n):!Vce(n)&&$c.test(r)&&(n=uF(t,r)),this.setBaseTarget(t,Io(n)?n.get():n)),Io(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let a=CM(this.props,r,this.presenceContext?.custom);a&&(n=a[t])}if(r&&n!==void 0)return n;let o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Io(o)?o:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Jy),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){N1.render(this.render)}};var NM=class extends RM{constructor(){super(...arguments),this.KeyframeResolver=dF}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Io(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function wG(e,{style:t,vars:r},n,o){let a=e.style,i;for(i in t)a[i]=t[i];o?.applyProjectionStyles(a,n);for(i in r)a.setProperty(i,r[i])}function trr(e){return window.getComputedStyle(e)}var MM=class extends NM{constructor(){super(...arguments),this.type="html",this.renderInstance=wG}readValueFromInstance(t,r){if(Df.has(r))return this.projection?.isProjecting?nF(r):bce(t,r);{let n=trr(t),o=(y1(r)?n.getPropertyValue(r):n[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Xce(t,r)}build(t,r,n){yM(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return PM(t,r,n)}};var CG=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function LYe(e,t,r,n){wG(e,t,void 0,n);for(let o in t.attrs)e.setAttribute(CG.has(o)?o:IM(o),t.attrs[o])}var TM=class extends NM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=da}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Df.has(r)){let n=cF(r);return n&&n.default||0}return r=CG.has(r)?r:IM(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return pG(t,r,n)}build(t,r,n){cG(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,o){LYe(t,r,n,o)}mount(t){this.isSVGTag=dG(t.tagName),super.mount(t)}};var DYe=(e,t)=>bM(e)?new TM(t):new MM(t,{allowProjection:e!==EYe.Fragment});function ov(e,t,r){let n=e.getProps();return CM(n,t,r!==void 0?r:n.custom,e)}var PF=e=>Array.isArray(e);function rrr(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Nd(r))}function nrr(e){return PF(e)?e[e.length-1]||0:e}function OYe(e,t){let r=ov(e,t),{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(let i in a){let s=nrr(a[i]);rrr(e,i,s)}}function _Ye(e){return!!(Io(e)&&e.add)}function IF(e,t){let r=e.getValue("willChange");if(_Ye(r))return r.add(t);if(!r&&zc.WillChange){let n=new zc.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function SG(e){return e.props[mG]}var orr=e=>e!==null;function FYe(e,{repeat:t,repeatType:r="loop"},n){let o=e.filter(orr),a=t&&r!=="loop"&&t%2===1?0:o.length-1;return!a||n===void 0?o[a]:n}var arr={type:"spring",stiffness:500,damping:25,restSpeed:10},irr=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),srr={type:"keyframes",duration:.8},lrr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BYe=(e,{keyframes:t})=>t.length>2?srr:Df.has(e)?e.startsWith("scale")?irr(t[1]):arr:lrr;function VYe({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}var AM=(e,t,r,n={},o,a)=>i=>{let s=I1(n,e)||{},l=s.delay||n.delay||0,{elapsed:c=0}=n;c=c-ds(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};VYe(s)||Object.assign(u,BYe(e,u)),u.duration&&(u.duration=ds(u.duration)),u.repeatDelay&&(u.repeatDelay=ds(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gM(u),u.delay===0&&(d=!0)),(zc.instantAnimations||zc.skipAnimations)&&(d=!0,gM(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let f=FYe(u.keyframes,s);if(f!==void 0){dn.update(()=>{u.onUpdate(f),u.onComplete()});return}}return s.isSync?new rx(u):new aF(u)};function crr({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function LM(e,t,{delay:r=0,transitionOverride:n,type:o}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:i,...s}=t;n&&(a=n);let l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let u in s){let d=e.getValue(u,e.latestValues[u]??null),f=s[u];if(f===void 0||c&&crr(c,u))continue;let p={delay:r,...I1(a||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===m&&!p.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){let v=SG(e);if(v){let y=window.MotionHandoffAnimation(v,u,dn);y!==null&&(p.startTime=y,h=!0)}}IF(e,u),d.start(AM(u,d,f,e.shouldReduceMotion&&sF.has(u)?{type:!1}:p,e,h));let g=d.animation;g&&l.push(g)}return i&&Promise.all(l).then(()=>{dn.update(()=>{i&&OYe(e,i)})}),l}function PG(e,t,r,n=0,o=1){let a=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),i=e.size,s=(i-1)*n;return typeof r=="function"?r(a,i):o===1?a*n:s-a*n}function IG(e,t,r={}){let n=ov(e,t,r.type==="exit"?e.presenceContext?.custom:void 0),{transition:o=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(o=r.transitionOverride);let a=n?()=>Promise.all(LM(e,n,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=o;return urr(e,t,l,c,u,d,r)}:()=>Promise.resolve(),{when:s}=o;if(s){let[l,c]=s==="beforeChildren"?[a,i]:[i,a];return l().then(()=>c())}else return Promise.all([a(),i(r.delay)])}function urr(e,t,r=0,n=0,o=0,a=1,i){let s=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),s.push(IG(l,t,{...i,delay:r+(typeof n=="function"?0:n)+PG(e.variantChildren,l,n,o,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function UYe(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let o=t.map(a=>IG(e,a,r));n=Promise.all(o)}else if(typeof t=="string")n=IG(e,t,r);else{let o=typeof t=="function"?ov(e,t,r.custom):t;n=Promise.all(LM(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function Yce(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var drr=wF.length;function Qce(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?Qce(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<drr;r++){let n=wF[r],o=e.props[n];(ix(o)||o===!1)&&(t[n]=o)}return t}var frr=[...aG].reverse(),prr=aG.length;function mrr(e){return t=>Promise.all(t.map(({animation:r,options:n})=>UYe(e,r,n)))}function HYe(e){let t=mrr(e),r=zYe(),n=!0,o=l=>(c,u)=>{let d=ov(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(d){let{transition:f,transitionEnd:p,...m}=d;c={...c,...m,...p}}return c};function a(l){t=l(e)}function i(l){let{props:c}=e,u=Qce(e.parent)||{},d=[],f=new Set,p={},m=1/0;for(let g=0;g<prr;g++){let v=frr[g],y=r[v],x=c[v]!==void 0?c[v]:u[v],w=ix(x),b=v===l?y.isActive:null;b===!1&&(m=g);let C=x===u[v]&&x!==c[v]&&w;if(C&&n&&e.manuallyAnimateOnMount&&(C=!1),y.protectedKeys={...p},!y.isActive&&b===null||!x&&!y.prevProp||aw(x)||typeof x=="boolean")continue;let S=hrr(y.prevProp,x),P=S||v===l&&y.isActive&&!C&&w||g>m&&w,N=!1,T=Array.isArray(x)?x:[x],A=T.reduce(o(v),{});b===!1&&(A={});let{prevResolvedValues:M={}}=y,O={...M,...A},F=R=>{P=!0,f.has(R)&&(N=!0,f.delete(R)),y.needsAnimating[R]=!0;let E=e.getValue(R);E&&(E.liveStyle=!1)};for(let R in O){let E=A[R],_=M[R];if(p.hasOwnProperty(R))continue;let U=!1;PF(E)&&PF(_)?U=!Yce(E,_):U=E!==_,U?E!=null?F(R):f.add(R):E!==void 0&&f.has(R)?F(R):y.protectedKeys[R]=!0}y.prevProp=x,y.prevResolvedValues=A,y.isActive&&(p={...p,...A}),n&&e.blockInitialAnimation&&(P=!1);let I=C&&S;P&&(!I||N)&&d.push(...T.map(R=>{let E={type:v};if(typeof R=="string"&&n&&!I&&e.manuallyAnimateOnMount&&e.parent){let{parent:_}=e,U=ov(_,R);if(_.enteringChildren&&U){let{delayChildren:V}=U.transition||{};E.delay=PG(_.enteringChildren,e,V)}}return{animation:R,options:E}}))}if(f.size){let g={};if(typeof c.initial!="boolean"){let v=ov(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(g.transition=v.transition)}f.forEach(v=>{let y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),g[v]=y??null}),d.push({animation:g})}let h=!!d.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(h=!1),n=!1,h?t(d):Promise.resolve()}function s(l,c){if(r[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,c)),r[l].isActive=c;let u=i(l);for(let d in r)r[d].protectedKeys={};return u}return{animateChanges:i,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=zYe(),n=!0}}}function hrr(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Yce(t,e):!1}function O1(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zYe(){return{animate:O1(!0),whileInView:O1(),whileHover:O1(),whileTap:O1(),whileDrag:O1(),whileFocus:O1(),exit:O1()}}var Ol=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var kG=class extends Ol{constructor(t){super(t),t.animationState||(t.animationState=HYe(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();aw(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};var grr=0,RG=class extends Ol{constructor(){super(...arguments),this.id=grr++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>{r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var jYe={animation:{Feature:kG},exit:{Feature:RG}};function cx(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function ux(e){return{point:{x:e.pageX,y:e.pageY}}}var $Ye=e=>t=>M1(t)&&e(t,ux(t));function lw(e,t,r,n){return cx(e,t,$Ye(r),n)}var KYe=1e-4,vrr=1-KYe,yrr=1+KYe,XYe=.01,xrr=0-XYe,brr=0+XYe;function ll(e){return e.max-e.min}function YYe(e,t,r){return Math.abs(e-t)<=r}function qYe(e,t,r,n=.5){e.origin=n,e.originPoint=Ln(t.min,t.max,e.origin),e.scale=ll(r)/ll(t),e.translate=Ln(r.min,r.max,e.origin)-e.originPoint,(e.scale>=vrr&&e.scale<=yrr||isNaN(e.scale))&&(e.scale=1),(e.translate>=xrr&&e.translate<=brr||isNaN(e.translate))&&(e.translate=0)}function EM(e,t,r,n){qYe(e.x,t.x,r.x,n?n.originX:void 0),qYe(e.y,t.y,r.y,n?n.originY:void 0)}function WYe(e,t,r){e.min=r.min+t.min,e.max=e.min+ll(t)}function QYe(e,t,r){WYe(e.x,t.x,r.x),WYe(e.y,t.y,r.y)}function GYe(e,t,r){e.min=t.min-r.min,e.max=e.min+ll(t)}function DM(e,t,r){GYe(e.x,t.x,r.x),GYe(e.y,t.y,r.y)}function Td(e){return[e("x"),e("y")]}var NG=({current:e})=>e?e.ownerDocument.defaultView:null;var ZYe=(e,t)=>Math.abs(e-t);function JYe(e,t){let r=ZYe(e.x,t.x),n=ZYe(e.y,t.y);return Math.sqrt(r**2+n**2)}var OM=class{constructor(t,r,{transformPagePoint:n,contextWindow:o=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=Jce(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=JYe(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;let{point:h}=f,{timestamp:g}=Yi;this.history.push({...h,timestamp:g});let{onStart:v,onMove:y}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Zce(p,this.transformPagePoint),dn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();let{onEnd:m,onSessionEnd:h,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=Jce(f.type==="pointercancel"?this.lastMoveEventInfo:Zce(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),h&&h(f,v)},!M1(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=o||window;let s=ux(t),l=Zce(s,this.transformPagePoint),{point:c}=l,{timestamp:u}=Yi;this.history=[{...c,timestamp:u}];let{onSessionStart:d}=r;d&&d(t,Jce(l,this.history)),this.removeListeners=dh(lw(this.contextWindow,"pointermove",this.handlePointerMove),lw(this.contextWindow,"pointerup",this.handlePointerUp),lw(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hc(this.updatePoint)}};function Zce(e,t){return t?{point:t(e.point)}:e}function eQe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jce({point:e},t){return{point:e,delta:eQe(e,tQe(t)),offset:eQe(e,wrr(t)),velocity:Crr(t,.1)}}function wrr(e){return e[0]}function tQe(e){return e[e.length-1]}function Crr(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,o=tQe(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>ds(t)));)r--;if(!n)return{x:0,y:0};let a=lc(o.timestamp-n.timestamp);if(a===0)return{x:0,y:0};let i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function iQe(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?Ln(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?Ln(r,e,n.max):Math.min(e,r)),e}function rQe(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function sQe(e,{top:t,left:r,bottom:n,right:o}){return{x:rQe(e.x,r,o),y:rQe(e.y,t,n)}}function nQe(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function lQe(e,t){return{x:nQe(e.x,t.x),y:nQe(e.y,t.y)}}function cQe(e,t){let r=.5,n=ll(e),o=ll(t);return o>n?r=Zp(t.min,t.max-n,e.min):n>o&&(r=Zp(e.min,e.max-o,t.min)),Dl(0,1,r)}function uQe(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var MG=.35;function dQe(e=MG){return e===!1?e=0:e===!0&&(e=MG),{x:oQe(e,"left","right"),y:oQe(e,"top","bottom")}}function oQe(e,t,r){return{min:aQe(e,t),max:aQe(e,r)}}function aQe(e,t){return typeof e=="number"?e:e[t]||0}var Srr=new WeakMap,AG=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=da(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;let a=d=>{let{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(ux(d).point)},i=(d,f)=>{let{drag:p,dragPropagation:m,onDragStart:h}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ece(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Td(v=>{let y=this.getAxisMotionValue(v).get()||0;if(jc.test(y)){let{projection:x}=this.visualElement;if(x&&x.layout){let w=x.layout.layoutBox[v];w&&(y=ll(w)*(parseFloat(y)/100))}}this.originPoint[v]=y}),h&&dn.postRender(()=>h(d,f)),IF(this.visualElement,"transform");let{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},s=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;let{dragPropagation:p,dragDirectionLock:m,onDirectionLock:h,onDrag:g}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=Prr(v),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Td(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new OM(t,{onSessionStart:a,onStart:i,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:NG(this.visualElement)})}stop(t,r){let n=t||this.latestPointerEvent,o=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!o||!n)return;let{velocity:i}=o;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&dn.postRender(()=>s(n,o))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){let{drag:o}=this.getProps();if(!n||!TG(t,o,this.currentDirection))return;let a=this.getAxisMotionValue(t),i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=iQe(i,this.constraints[t],this.elastic[t])),a.set(i)}resolveConstraints(){let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&sx(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=sQe(n.layoutBox,t):this.constraints=!1,this.elastic=dQe(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Td(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=uQe(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!sx(t))return!1;let n=t.current;sc(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let a=kYe(n,o.root,this.visualElement.getTransformPagePoint()),i=lQe(o.layout.layoutBox,a);if(r){let s=r(yYe(i));this.hasMutatedConstraints=!!s,s&&(i=yG(s))}return i}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:o,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},c=Td(u=>{if(!TG(u,r,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});let f=o?200:1e6,p=o?40:1e7,m={type:"inertia",velocity:n?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(s)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return IF(this.visualElement,t),n.start(AM(t,n,0,r,this.visualElement,!1))}stopAnimation(){Td(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Td(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),o=n[r];return o||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Td(r=>{let{drag:n}=this.getProps();if(!TG(r,n,this.currentDirection))return;let{projection:o}=this.visualElement,a=this.getAxisMotionValue(r);if(o&&o.layout){let{min:i,max:s}=o.layout.layoutBox[r];a.set(t[r]-Ln(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!sx(r)||!n||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};Td(i=>{let s=this.getAxisMotionValue(i);if(s&&this.constraints!==!1){let l=s.get();o[i]=cQe({min:l,max:l},this.constraints[i])}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Td(i=>{if(!TG(i,t,null))return;let s=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];s.set(Ln(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;Srr.set(this.visualElement,this);let t=this.visualElement.current,r=lw(t,"pointerdown",l=>{let{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),n=()=>{let{dragConstraints:l}=this.getProps();sx(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",n);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dn.read(n);let i=cx(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Td(u=>{let d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),r(),a(),s&&s()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:a=!1,dragElastic:i=MG,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:o,dragConstraints:a,dragElastic:i,dragMomentum:s}}};function TG(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Prr(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var LG=class extends Ol{constructor(t){super(t),this.removeGroupControls=Ei,this.removeListeners=Ei,this.controls=new AG(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ei}unmount(){this.removeGroupControls(),this.removeListeners()}};var fQe=e=>(t,r)=>{e&&dn.postRender(()=>e(t,r))},EG=class extends Ol{constructor(){super(...arguments),this.removePointerDownListener=Ei}onPointerDown(t){this.session=new OM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:NG(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:o}=this.node.getProps();return{onSessionStart:fQe(t),onStart:fQe(r),onMove:n,onEnd:(a,i)=>{delete this.session,o&&dn.postRender(()=>o(a,i))}}}mount(){this.removePointerDownListener=lw(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var hQe=D(Or(),1);var kF=D(lt(),1);var _M={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pQe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var FM={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(mr.test(e))e=parseFloat(e);else return e;let r=pQe(e,t.target.x),n=pQe(e,t.target.y);return`${r}% ${n}%`}};var mQe={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,o=$c.parse(e);if(o.length>5)return n;let a=$c.createTransformer(e),i=typeof o[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;let c=Ln(s,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),a(o)}};var eue=!1,tue=class extends kF.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:o}=this.props,{projection:a}=t;JXe(Irr),a&&(r.group&&r.group.add(a),n&&n.register&&o&&n.register(a),eue&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),_M.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:o,isPresent:a}=this.props,{projection:i}=n;return i&&(i.isPresent=a,eue=!0,o||t.layoutDependency!==r||r===void 0||t.isPresent!==a?i.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?i.promote():i.relegate()||dn.postRender(()=>{let s=i.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),N1.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:o}=t;eue=!0,o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),n&&n.deregister&&n.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function DG(e){let[t,r]=rG(),n=(0,kF.useContext)(sM);return(0,hQe.jsx)(tue,{...e,layoutGroup:n,switchLayoutGroup:(0,kF.useContext)(hG),isPresent:t,safeToRemove:r})}var Irr={borderRadius:{...FM,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:FM,borderTopRightRadius:FM,borderBottomLeftRadius:FM,borderBottomRightRadius:FM,boxShadow:mQe};function OG(e,t,r){let n=Io(e)?e:Nd(e);return n.start(AM("",n,t,r)),n.animation}var gQe=(e,t)=>e.depth-t.depth;var _G=class{constructor(){this.children=[],this.isDirty=!1}add(t){g1(this.children,t),this.isDirty=!0}remove(t){uh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gQe),this.isDirty=!1,this.children.forEach(t)}};function vQe(e,t){let r=Qi.now(),n=({timestamp:o})=>{let a=o-r;a>=t&&(Hc(n),e(a-t))};return dn.setup(n,!0),()=>Hc(n)}var wQe=["TopLeft","TopRight","BottomLeft","BottomRight"],krr=wQe.length,yQe=e=>typeof e=="string"?parseFloat(e):e,xQe=e=>typeof e=="number"||mr.test(e);function CQe(e,t,r,n,o,a){o?(e.opacity=Ln(0,r.opacity??1,Rrr(n)),e.opacityExit=Ln(t.opacity??1,0,Nrr(n))):a&&(e.opacity=Ln(t.opacity??1,r.opacity??1,n));for(let i=0;i<krr;i++){let s=`border${wQe[i]}Radius`,l=bQe(t,s),c=bQe(r,s);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||xQe(l)===xQe(c)?(e[s]=Math.max(Ln(yQe(l),yQe(c),n),0),(jc.test(c)||jc.test(l))&&(e[s]+="%")):e[s]=c}(t.rotate||r.rotate)&&(e.rotate=Ln(t.rotate||0,r.rotate||0,n))}function bQe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Rrr=SQe(0,.5,H_),Nrr=SQe(.5,.95,Ei);function SQe(e,t,r){return n=>n<e?0:n>t?1:r(Zp(e,t,n))}function PQe(e,t){e.min=t.min,e.max=t.max}function Of(e,t){PQe(e.x,t.x),PQe(e.y,t.y)}function rue(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function IQe(e,t,r,n,o){return e-=t,e=CF(e,1/r,n),o!==void 0&&(e=CF(e,1/o,n)),e}function Mrr(e,t=0,r=1,n=.5,o,a=e,i=e){if(jc.test(t)&&(t=parseFloat(t),t=Ln(i.min,i.max,t/100)-i.min),typeof t!="number")return;let s=Ln(a.min,a.max,n);e===a&&(s-=t),e.min=IQe(e.min,t,r,s,o),e.max=IQe(e.max,t,r,s,o)}function kQe(e,t,[r,n,o],a,i){Mrr(e,t[r],t[n],t[o],t.scale,a,i)}var Trr=["x","scaleX","originX"],Arr=["y","scaleY","originY"];function nue(e,t,r,n){kQe(e.x,t,Trr,r?r.x:void 0,n?n.x:void 0),kQe(e.y,t,Arr,r?r.y:void 0,n?n.y:void 0)}function RQe(e){return e.translate===0&&e.scale===1}function oue(e){return RQe(e.x)&&RQe(e.y)}function NQe(e,t){return e.min===t.min&&e.max===t.max}function TQe(e,t){return NQe(e.x,t.x)&&NQe(e.y,t.y)}function MQe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aue(e,t){return MQe(e.x,t.x)&&MQe(e.y,t.y)}function iue(e){return ll(e.x)/ll(e.y)}function sue(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var FG=class{constructor(){this.members=[]}add(t){g1(this.members,t),t.scheduleRender()}remove(t){if(uh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(o=>t===o);if(r===0)return!1;let n;for(let o=r;o>=0;o--){let a=this.members[o];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function AQe(e,t,r){let n="",o=e.x.translate/t.x,a=e.y.translate/t.y,i=r?.z||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=r;c&&(n=`perspective(${c}px) ${n}`),u&&(n+=`rotate(${u}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}let s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}var _1={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},lue=["","X","Y","Z"],Lrr=1e3,Err=0;function cue(e,t,r,n){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function UQe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=SG(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",dn,!(o||a))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&UQe(n)}function BG({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(i={},s=t?.()){this.id=Err++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Rd.value&&(_1.nodes=_1.calculatedTargetDeltas=_1.calculatedProjections=0),this.nodes.forEach(_rr),this.nodes.forEach(Urr),this.nodes.forEach(zrr),this.nodes.forEach(Frr),Rd.addProjectionMetrics&&Rd.addProjectionMetrics(_1)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new _G)}addEventListener(i,s){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Jy),this.eventHandlers.get(i).add(s)}notifyListeners(i,...s){let l=this.eventHandlers.get(i);l&&l.notify(...s)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=T1(i)&&!hF(i),this.instance=i;let{layoutId:s,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),e){let u,d=0,f=()=>this.root.updateBlockedByResize=!1;dn.read(()=>{d=window.innerWidth}),e(i,()=>{let p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=vQe(f,250),_M.hasAnimatedSinceResize&&(_M.hasAnimatedSinceResize=!1,this.nodes.forEach(DQe)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let m=this.options.transition||c.getDefaultTransition()||Wrr,{onLayoutAnimationStart:h,onLayoutAnimationComplete:g}=c.getProps(),v=!this.targetLayout||!aue(this.targetLayout,p),y=!d&&f;if(this.options.layoutRoot||this.resumeFrom||y||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let x={...I1(m,"layout"),onPlay:h,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else d||DQe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Hc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Hrr),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&UQe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){let d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(LQe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(EQe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vrr),this.nodes.forEach(Drr),this.nodes.forEach(Orr)):this.nodes.forEach(EQe),this.clearAllSnapshots();let s=Qi.now();Yi.delta=Dl(0,1e3/60,s-Yi.timestamp),Yi.timestamp=s,Yi.isProcessing=!0,X_.update.process(Yi),X_.preRender.process(Yi),X_.render.process(Yi),Yi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,N1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Brr),this.sharedNodes.forEach(jrr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ll(this.snapshot.measuredBox.x)&&!ll(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=da(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(s=!1),s&&this.instance){let l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!oue(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&this.instance&&(s||lx(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let s=this.measurePageBox(),l=this.removeElementScroll(s);return i&&(l=this.removeTransform(l)),Grr(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:i}=this.options;if(!i)return da();let s=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Krr))){let{scroll:c}=this.root;c&&(iw(s.x,c.offset.x),iw(s.y,c.offset.y))}return s}removeElementScroll(i){let s=da();if(Of(s,i),this.scroll?.wasRoot)return s;for(let l=0;l<this.path.length;l++){let c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&Of(s,i),iw(s.x,u.offset.x),iw(s.y,u.offset.y))}return s}applyTransform(i,s=!1){let l=da();Of(l,i);for(let c=0;c<this.path.length;c++){let u=this.path[c];!s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&E1(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),lx(u.latestValues)&&E1(l,u.latestValues)}return lx(this.latestValues)&&E1(l,this.latestValues),l}removeTransform(i){let s=da();Of(s,i);for(let l=0;l<this.path.length;l++){let c=this.path[l];if(!c.instance||!lx(c.latestValues))continue;xG(c.latestValues)&&c.updateSnapshot();let u=da(),d=c.measurePageBox();Of(u,d),nue(s,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return lx(this.latestValues)&&nue(s,this.latestValues),s}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Yi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==s;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Yi.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=da(),this.relativeTargetOrigin=da(),DM(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Of(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=da(),this.targetWithTransforms=da()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QYe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Of(this.target,this.layout.layoutBox),Kce(this.target,this.targetDelta)):Of(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=da(),this.relativeTargetOrigin=da(),DM(this.relativeTargetOrigin,this.target,f.target),Of(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Rd.value&&_1.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||xG(this.parent.latestValues)||Wce(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let i=this.getLead(),s=!!this.resumingFrom||this!==i,l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Yi.timestamp&&(l=!1),l)return;let{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Of(this.layoutCorrected,this.layout.layoutBox);let d=this.treeScale.x,f=this.treeScale.y;IYe(this.layoutCorrected,this.treeScale,this.path,s),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=da());let{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(rue(this.prevProjectionDelta.x,this.projectionDelta.x),rue(this.prevProjectionDelta.y,this.projectionDelta.y)),EM(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!sue(this.projectionDelta.x,this.prevProjectionDelta.x)||!sue(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Rd.value&&_1.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){let s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=D1(),this.projectionDelta=D1(),this.projectionDeltaWithTransform=D1()}setAnimationOrigin(i,s=!1){let l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=D1();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;let f=da(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,h=p!==m,g=this.getStack(),v=!g||g.members.length<=1,y=!!(h&&!v&&this.options.crossfade===!0&&!this.path.some(qrr));this.animationProgress=0;let x;this.mixTargetDelta=w=>{let b=w/1e3;OQe(d.x,i.x,b),OQe(d.y,i.y,b),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(DM(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$rr(this.relativeTarget,this.relativeTargetOrigin,f,b),x&&TQe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=da()),Of(x,this.relativeTarget)),h&&(this.animationValues=u,CQe(u,c,this.latestValues,b,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Hc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dn.update(()=>{_M.hasAnimatedSinceResize=!0,fh.layout++,this.motionValue||(this.motionValue=Nd(0)),this.currentAnimation=OG(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),i.onUpdate&&i.onUpdate(s)},onStop:()=>{fh.layout--},onComplete:()=>{fh.layout--,i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Lrr),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:s,target:l,layout:c,latestValues:u}=i;if(!(!s||!l||!c)){if(this!==i&&this.layout&&c&&zQe(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||da();let d=ll(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;let f=ll(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}Of(s,l),E1(s,u),EM(this.projectionDeltaWithTransform,this.layoutCorrected,s,u)}}registerSharedNode(i,s){this.sharedNodes.has(i)||this.sharedNodes.set(i,new FG),this.sharedNodes.get(i).add(s);let c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){let{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:s,preserveFollowOpacity:l}={}){let c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let s=!1,{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;let c={};l.z&&cue("z",i,c,this.animationValues);for(let u=0;u<lue.length;u++)cue(`rotate${lue[u]}`,i,c,this.animationValues),cue(`skew${lue[u]}`,i,c,this.animationValues);i.render();for(let u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}applyProjectionStyles(i,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=SM(s?.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=SM(s?.pointerEvents)||""),this.hasProjected&&!lx(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";let u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=AQe(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),i.transform=d;let{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?i.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(let m in L1){if(u[m]===void 0)continue;let{correct:h,applyTo:g,isCSSVariable:v}=L1[m],y=d==="none"?u[m]:h(u[m],c);if(g){let x=g.length;for(let w=0;w<x;w++)i[g[w]]=y}else v?this.options.visualElement.renderState.vars[m]=y:i[m]=y}this.options.layoutId&&(i.pointerEvents=c===this?SM(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(LQe),this.root.sharedNodes.clear()}}}function Drr(e){e.updateLayout()}function Orr(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:o}=e.options,a=t.source!==e.layout.source;o==="size"?Td(u=>{let d=a?t.measuredBox[u]:t.layoutBox[u],f=ll(d);d.min=r[u].min,d.max=d.min+f}):zQe(o,t.layoutBox,r)&&Td(u=>{let d=a?t.measuredBox[u]:t.layoutBox[u],f=ll(r[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});let i=D1();EM(i,r,t.layoutBox);let s=D1();a?EM(s,e.applyTransform(n,!0),t.measuredBox):EM(s,r,t.layoutBox);let l=!oue(i),c=!1;if(!e.resumeFrom){let u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){let{snapshot:d,layout:f}=u;if(d&&f){let p=da();DM(p,t.layoutBox,d.layoutBox);let m=da();DM(m,r,f.layoutBox),aue(p,m)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _rr(e){Rd.value&&_1.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Frr(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Brr(e){e.clearSnapshot()}function LQe(e){e.clearMeasurements()}function EQe(e){e.isLayoutDirty=!1}function Vrr(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function DQe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Urr(e){e.resolveTargetDelta()}function zrr(e){e.calcProjection()}function Hrr(e){e.resetSkewAndRotation()}function jrr(e){e.removeLeadSnapshot()}function OQe(e,t,r){e.translate=Ln(t.translate,0,r),e.scale=Ln(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function _Qe(e,t,r,n){e.min=Ln(t.min,r.min,n),e.max=Ln(t.max,r.max,n)}function $rr(e,t,r,n){_Qe(e.x,t.x,r.x,n),_Qe(e.y,t.y,r.y,n)}function qrr(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Wrr={duration:.45,ease:[.4,0,.1,1]},FQe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),BQe=FQe("applewebkit/")&&!FQe("chrome/")?Math.round:Ei;function VQe(e){e.min=BQe(e.min),e.max=BQe(e.max)}function Grr(e){VQe(e.x),VQe(e.y)}function zQe(e,t,r){return e==="position"||e==="preserve-aspect"&&!YYe(iue(t),iue(r),.2)}function Krr(e){return e!==e.root&&e.scroll?.wasRoot}var HQe=BG({attachResizeListener:(e,t)=>cx(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var uue={current:void 0},VG=BG({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!uue.current){let e=new HQe({});e.mount(window),e.setOptions({layoutScroll:!0}),uue.current=e}return uue.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var jQe={pan:{Feature:EG},drag:{Feature:LG,ProjectionNode:VG,MeasureLayout:DG}};function $Qe(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,a=n[o];a&&dn.postRender(()=>a(t,ux(t)))}var UG=class extends Ol{mount(){let{current:t}=this.node;t&&(this.unmount=Dce(t,(r,n)=>($Qe(this.node,n,"Start"),o=>$Qe(this.node,o,"End"))))}unmount(){}};var zG=class extends Ol{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dh(cx(this.node.current,"focus",()=>this.onFocus()),cx(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function qQe(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),a=n[o];a&&dn.postRender(()=>a(t,ux(t)))}var HG=class extends Ol{mount(){let{current:t}=this.node;t&&(this.unmount=Fce(t,(r,n)=>(qQe(this.node,n,"Start"),(o,{success:a})=>qQe(this.node,o,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var fue=new WeakMap,due=new WeakMap,Xrr=e=>{let t=fue.get(e.target);t&&t(e)},Yrr=e=>{e.forEach(Xrr)};function Qrr({root:e,...t}){let r=e||document;due.has(r)||due.set(r,{});let n=due.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(Yrr,{root:e,...t})),n[o]}function WQe(e,t,r){let n=Qrr(t);return fue.set(e,r),n.observe(e),()=>{fue.delete(e),n.unobserve(e)}}var Zrr={some:0,all:1},jG=class extends Ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:o="some",once:a}=t,i={root:r?r.current:void 0,rootMargin:n,threshold:typeof o=="number"?o:Zrr[o]},s=l=>{let{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return WQe(this.node.current,i,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Jrr(t,r))&&this.startObserver()}unmount(){}};function Jrr({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var GQe={inView:{Feature:jG},tap:{Feature:HG},focus:{Feature:zG},hover:{Feature:UG}};var KQe={layout:{ProjectionNode:VG,MeasureLayout:DG}};var XQe={...jYe,...GQe,...jQe,...KQe};var Ad=vYe(XQe,DYe);var BM=D(lt(),1);function VM(e){let t=ev(()=>Nd(e)),{isStatic:r}=(0,BM.useContext)(rw);if(r){let[,n]=(0,BM.useState)(e);(0,BM.useEffect)(()=>t.on("change",n),[])}return t}function $G(e,t){let r=VM(t()),n=()=>r.set(t());return n(),cM(()=>{let o=()=>dn.preRender(n,!1,!0),a=e.map(i=>i.on("change",o));return()=>{a.forEach(i=>i()),Hc(n)}}),r}function YQe(e){R1.current=[],e();let t=$G(R1.current,e);return R1.current=void 0,t}function pue(e,t,r,n){if(typeof e=="function")return YQe(e);let o=typeof t=="function"?t:Bce(t,r,n);return Array.isArray(e)?QQe(e,o):QQe([e],([a])=>o(a))}function QQe(e,t){let r=ev(()=>[]);return $G(e,()=>{r.length=0;let n=e.length;for(let o=0;o<n;o++)r[o]=e[o].get();return t(r)})}function RF(e){return typeof e=="object"&&!Array.isArray(e)}function qG(e,t,r,n){return typeof e=="string"&&RF(t)?fF(e,r,n):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function ZQe(e,t,r){return e*(t+1)}function mue(e,t,r,n){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?r:t.startsWith("<")?Math.max(0,r+parseFloat(t.slice(1))):n.get(t)??e}function enr(e,t,r){for(let n=0;n<e.length;n++){let o=e[n];o.at>t&&o.at<r&&(uh(e,o),n--)}}function JQe(e,t,r,n,o,a){enr(e,o,a);for(let i=0;i<t.length;i++)e.push({value:t[i],at:Ln(o,a,n[i]),easing:W_(r,i)})}function eZe(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]/(t+1)}function tZe(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var tnr="easeInOut",rnr=20;function oZe(e,{defaultTransition:t={},...r}={},n,o){let a=t.duration||.3,i=new Map,s=new Map,l={},c=new Map,u=0,d=0,f=0;for(let p=0;p<e.length;p++){let m=e[p];if(typeof m=="string"){c.set(m,d);continue}else if(!Array.isArray(m)){c.set(m.name,mue(d,m.at,u,c));continue}let[h,g,v={}]=m;v.at!==void 0&&(d=mue(d,v.at,u,c));let y=0,x=(w,b,C,S=0,P=0)=>{let N=nnr(w),{delay:T=0,times:A=rF(N),type:M="keyframes",repeat:O,repeatType:F,repeatDelay:I=0,...k}=b,{ease:R=t.ease||"easeOut",duration:E}=b,_=typeof T=="function"?T(S,P):T,U=N.length,V=P1(M)?M:o?.[M||"keyframes"];if(U<=2&&V){let $=100;if(U===2&&inr(N)){let G=N[1]-N[0];$=Math.abs(G)}let W={...k};E!==void 0&&(W.duration=ds(E));let z=J_(W,$,V);R=z.ease,E=z.duration}E??(E=a);let L=d+_;A.length===1&&A[0]===0&&(A[1]=1);let H=A.length-N.length;if(H>0&&tF(A,H),N.length===1&&N.unshift(null),O){sc(O<rnr,"Repeat count too high, must be less than 20","repeat-count-high"),E=ZQe(E,O);let $=[...N],W=[...A];R=Array.isArray(R)?[...R]:[R];let z=[...R];for(let G=0;G<O;G++){N.push(...$);for(let X=0;X<$.length;X++)A.push(W[X]+(G+1)),R.push(X===0?"linear":W_(z,X-1))}eZe(A,O)}let j=L+E;JQe(C,N,R,A,L,j),y=Math.max(_+E,y),f=Math.max(j,f)};if(Io(h)){let w=rZe(h,s);x(g,v,nZe("default",w))}else{let w=qG(h,g,n,l),b=w.length;for(let C=0;C<b;C++){g=g,v=v;let S=w[C],P=rZe(S,s);for(let N in g)x(g[N],onr(v,N),nZe(N,P),C,b)}}u=d,d+=y}return s.forEach((p,m)=>{for(let h in p){let g=p[h];g.sort(tZe);let v=[],y=[],x=[];for(let b=0;b<g.length;b++){let{at:C,value:S,easing:P}=g[b];v.push(S),y.push(Zp(0,f,C)),x.push(P||"easeOut")}y[0]!==0&&(y.unshift(0),v.unshift(v[0]),x.unshift(tnr)),y[y.length-1]!==1&&(y.push(1),v.push(null)),i.has(m)||i.set(m,{keyframes:{},transition:{}});let w=i.get(m);w.keyframes[h]=v,w.transition[h]={...t,duration:f,ease:x,times:y,...r}}}),i}function rZe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function nZe(e,t){return t[e]||(t[e]=[]),t[e]}function nnr(e){return Array.isArray(e)?e:[e]}function onr(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var anr=e=>typeof e=="number",inr=e=>e.every(anr);function snr(e,t){return e in t}var WG=class extends RM{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,r){if(snr(r,t)){let n=t[r];if(typeof n=="string"||typeof n=="number")return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,r){delete r.output[t]}measureInstanceViewportBox(){return da()}build(t,r){Object.assign(t.output,r)}renderInstance(t,{output:r}){Object.assign(t,r)}sortInstanceNodePosition(){return 0}};function aZe(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=T1(e)&&!hF(e)?new TM(t):new MM(t);r.mount(e),sw.set(e,r)}function iZe(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},r=new WG(t);r.mount(e),sw.set(e,r)}function lnr(e,t){return Io(e)||typeof e=="number"||typeof e=="string"&&!RF(t)}function GG(e,t,r,n){let o=[];if(lnr(e,t))o.push(OG(e,RF(t)&&t.default||t,r&&(r.default||r)));else{let a=qG(e,t,n),i=a.length;sc(!!i,"No valid elements provided.","no-valid-elements");for(let s=0;s<i;s++){let l=a[s];sc(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let c=l instanceof Element?aZe:iZe;sw.has(l)||c(l);let u=sw.get(l),d={...r};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,i)),o.push(...LM(u,{...t,transition:d},{}))}}return o}function sZe(e,t,r){let n=[];return oZe(e,t,r,{spring:tx}).forEach(({keyframes:a,transition:i},s)=>{n.push(...GG(s,a,i))}),n}function cnr(e){return Array.isArray(e)&&e.some(Array.isArray)}function lZe(e){function t(r,n,o){let a=[];cnr(r)?a=sZe(r,n,e):a=GG(r,n,o,e);let i=new iF(a);return e&&(e.animations.push(i),i.finished.then(()=>{uh(e.animations,i)})),i}return t}var hue=lZe();var Du=D(lt(),1);var _f=D(Or(),1),KG="Checkbox",[unr,eGn]=hn(KG),[dnr,gue]=unr(KG);function fnr(e){let{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,p]=eo({prop:r,defaultProp:o??!1,onChange:l,caller:KG}),[m,h]=Du.useState(null),[g,v]=Du.useState(null),y=Du.useRef(!1),x=m?!!i||!!m.closest("form"):!0,w={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:i,value:u,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:cw(o)?!1:o,isFormControl:x,bubbleInput:g,setBubbleInput:v};return(0,_f.jsx)(dnr,{scope:t,...w,children:pnr(d)?d(w):n})}var cZe="CheckboxTrigger",uZe=Du.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{let{control:a,value:i,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=gue(cZe,e),h=Xt(o,u),g=Du.useRef(l);return Du.useEffect(()=>{let v=a?.form;if(v){let y=()=>d(g.current);return v.addEventListener("reset",y),()=>v.removeEventListener("reset",y)}},[a,d]),(0,_f.jsx)(rt.button,{type:"button",role:"checkbox","aria-checked":cw(l)?"mixed":l,"aria-required":c,"data-state":mZe(l),"data-disabled":s?"":void 0,disabled:s,value:i,...n,ref:h,onKeyDown:He(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:He(r,v=>{d(y=>cw(y)?!0:!y),m&&p&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})});uZe.displayName=cZe;var XG=Du.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return(0,_f.jsx)(fnr,{__scopeCheckbox:r,checked:o,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:n,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>(0,_f.jsxs)(_f.Fragment,{children:[(0,_f.jsx)(uZe,{...d,ref:t,__scopeCheckbox:r}),f&&(0,_f.jsx)(pZe,{__scopeCheckbox:r})]})})});XG.displayName=KG;var dZe="CheckboxIndicator",vue=Du.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:n,...o}=e,a=gue(dZe,r);return(0,_f.jsx)(uo,{present:n||cw(a.checked)||a.checked===!0,children:(0,_f.jsx)(rt.span,{"data-state":mZe(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});vue.displayName=dZe;var fZe="CheckboxBubbleInput",pZe=Du.forwardRef(({__scopeCheckbox:e,...t},r)=>{let{control:n,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:i,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=gue(fZe,e),m=Xt(r,p),h=Wb(a),g=uk(n);Du.useEffect(()=>{let y=f;if(!y)return;let x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set,C=!o.current;if(h!==a&&b){let S=new Event("click",{bubbles:C});y.indeterminate=cw(a),b.call(y,cw(a)?!1:a),y.dispatchEvent(S)}},[f,h,a,o]);let v=Du.useRef(cw(a)?!1:a);return(0,_f.jsx)(rt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:s,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});pZe.displayName=fZe;function pnr(e){return typeof e=="function"}function cw(e){return e==="indeterminate"}function mZe(e){return cw(e)?"indeterminate":e?"checked":"unchecked"}var rXn=D(ng(),1);var hZe=D(lt(),1);var gZe=D(Or(),1),hnr="Label",vZe=hZe.forwardRef((e,t)=>(0,gZe.jsx)(rt.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));vZe.displayName=hnr;var yue=vZe;var pi=D(lt(),1);var zs=D(Or(),1),YG="Popover",[yZe,vGn]=hn(YG,[gu]),NF=gu(),[vnr,uw]=yZe(YG),xZe=e=>{let{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=NF(t),l=pi.useRef(null),[c,u]=pi.useState(!1),[d,f]=eo({prop:n,defaultProp:o??!1,onChange:a,caller:YG});return(0,zs.jsx)(_m,{...s,children:(0,zs.jsx)(vnr,{scope:t,contentId:Vo(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:pi.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:pi.useCallback(()=>u(!0),[]),onCustomAnchorRemove:pi.useCallback(()=>u(!1),[]),modal:i,children:r})})};xZe.displayName=YG;var bZe="PopoverAnchor",ynr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(bZe,r),a=NF(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return pi.useEffect(()=>(i(),()=>s()),[i,s]),(0,zs.jsx)(Fm,{...a,...n,ref:t})});ynr.displayName=bZe;var wZe="PopoverTrigger",CZe=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(wZe,r),a=NF(r),i=Xt(t,o.triggerRef),s=(0,zs.jsx)(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":kZe(o.open),...n,ref:i,onClick:He(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:(0,zs.jsx)(Fm,{asChild:!0,...a,children:s})});CZe.displayName=wZe;var xue="PopoverPortal",[xnr,bnr]=yZe(xue,{forceMount:void 0}),wnr=e=>{let{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=uw(xue,t);return(0,zs.jsx)(xnr,{scope:t,forceMount:r,children:(0,zs.jsx)(uo,{present:r||a.open,children:(0,zs.jsx)(vu,{asChild:!0,container:o,children:n})})})};wnr.displayName=xue;var UM="PopoverContent",SZe=pi.forwardRef((e,t)=>{let r=bnr(UM,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=uw(UM,e.__scopePopover);return(0,zs.jsx)(uo,{present:n||a.open,children:a.modal?(0,zs.jsx)(Snr,{...o,ref:t}):(0,zs.jsx)(Pnr,{...o,ref:t})})});SZe.displayName=UM;var Cnr=Sc("PopoverContent.RemoveScroll"),Snr=pi.forwardRef((e,t)=>{let r=uw(UM,e.__scopePopover),n=pi.useRef(null),o=Xt(t,n),a=pi.useRef(!1);return pi.useEffect(()=>{let i=n.current;if(i)return U0(i)},[]),(0,zs.jsx)(Wy,{as:Cnr,allowPinchZoom:!0,children:(0,zs.jsx)(PZe,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,i=>{let s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:He(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Pnr=pi.forwardRef((e,t)=>{let r=uw(UM,e.__scopePopover),n=pi.useRef(!1),o=pi.useRef(!1);return(0,zs.jsx)(PZe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),PZe=pi.forwardRef((e,t)=>{let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=uw(UM,r),p=NF(r);return V0(),(0,zs.jsx)(qy,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,zs.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,zs.jsx)(dg,{"data-state":kZe(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),IZe="PopoverClose",Inr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(IZe,r);return(0,zs.jsx)(rt.button,{type:"button",...n,ref:t,onClick:He(e.onClick,()=>o.onOpenChange(!1))})});Inr.displayName=IZe;var knr="PopoverArrow",Rnr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=NF(r);return(0,zs.jsx)(fg,{...o,...n,ref:t})});Rnr.displayName=knr;function kZe(e){return e?"open":"closed"}var RZe=xZe;var NZe=CZe;var bue=SZe;var fx=D(lt(),1);var _l=D(lt(),1);var dw=D(Or(),1),wue="rovingFocusGroup.onEntryFocus",Mnr={bubbles:!1,cancelable:!0},MF="RovingFocusGroup",[Cue,MZe,Tnr]=cf(MF),[Anr,zM]=hn(MF,[Tnr]),[Lnr,Enr]=Anr(MF),TZe=_l.forwardRef((e,t)=>(0,dw.jsx)(Cue.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,dw.jsx)(Cue.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,dw.jsx)(Dnr,{...e,ref:t})})}));TZe.displayName=MF;var Dnr=_l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=_l.useRef(null),p=Xt(t,f),m=wp(a),[h,g]=eo({prop:i,defaultProp:s??null,onChange:l,caller:MF}),[v,y]=_l.useState(!1),x=to(c),w=MZe(r),b=_l.useRef(!1),[C,S]=_l.useState(0);return _l.useEffect(()=>{let P=f.current;if(P)return P.addEventListener(wue,x),()=>P.removeEventListener(wue,x)},[x]),(0,dw.jsx)(Lnr,{scope:r,orientation:n,dir:m,loop:o,currentTabStopId:h,onItemFocus:_l.useCallback(P=>g(P),[g]),onItemShiftTab:_l.useCallback(()=>y(!0),[]),onFocusableItemAdd:_l.useCallback(()=>S(P=>P+1),[]),onFocusableItemRemove:_l.useCallback(()=>S(P=>P-1),[]),children:(0,dw.jsx)(rt.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,P=>{let N=!b.current;if(P.target===P.currentTarget&&N&&!v){let T=new CustomEvent(wue,Mnr);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){let A=w().filter(k=>k.focusable),M=A.find(k=>k.active),O=A.find(k=>k.id===h),I=[M,O,...A].filter(Boolean).map(k=>k.ref.current);EZe(I,u)}}b.current=!1}),onBlur:He(e.onBlur,()=>y(!1))})})}),AZe="RovingFocusGroupItem",LZe=_l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:a,children:i,...s}=e,l=Vo(),c=a||l,u=Enr(AZe,r),d=u.currentTabStopId===c,f=MZe(r),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _l.useEffect(()=>{if(n)return p(),()=>m()},[n,p,m]),(0,dw.jsx)(Cue.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:(0,dw.jsx)(rt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:He(e.onMouseDown,g=>{n?u.onItemFocus(c):g.preventDefault()}),onFocus:He(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:He(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;let v=Fnr(g,u.orientation,u.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=f().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();let w=x.indexOf(g.currentTarget);x=u.loop?Bnr(x,w+1):x.slice(w+1)}setTimeout(()=>EZe(x))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:h!=null}):i})})});LZe.displayName=AZe;var Onr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fnr(e,t,r){let n=_nr(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Onr[n]}function EZe(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Bnr(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var QG=TZe,ZG=LZe;var dx=D(Or(),1),JG="Tabs",[Vnr,OGn]=hn(JG,[zM]),OZe=zM(),[Unr,Sue]=Vnr(JG),_Ze=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=wp(s),[d,f]=eo({prop:n,onChange:o,defaultProp:a??"",caller:JG});return(0,dx.jsx)(Unr,{scope:r,baseId:Vo(),value:d,onValueChange:f,orientation:i,dir:u,activationMode:l,children:(0,dx.jsx)(rt.div,{dir:u,"data-orientation":i,...c,ref:t})})});_Ze.displayName=JG;var FZe="TabsList",BZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...o}=e,a=Sue(FZe,r),i=OZe(r);return(0,dx.jsx)(QG,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:(0,dx.jsx)(rt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});BZe.displayName=FZe;var VZe="TabsTrigger",UZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=Sue(VZe,r),s=OZe(r),l=jZe(i.baseId,n),c=$Ze(i.baseId,n),u=n===i.value;return(0,dx.jsx)(ZG,{asChild:!0,...s,focusable:!o,active:u,children:(0,dx.jsx)(rt.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:He(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:He(e.onFocus,()=>{let d=i.activationMode!=="manual";!u&&!o&&d&&i.onValueChange(n)})})})});UZe.displayName=VZe;var zZe="TabsContent",HZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,s=Sue(zZe,r),l=jZe(s.baseId,n),c=$Ze(s.baseId,n),u=n===s.value,d=fx.useRef(u);return fx.useEffect(()=>{let f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),(0,dx.jsx)(uo,{present:o||u,children:({present:f})=>(0,dx.jsx)(rt.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&a})})});HZe.displayName=zZe;function jZe(e,t){return`${e}-trigger-${t}`}function $Ze(e,t){return`${e}-content-${t}`}var Pue=_Ze,Iue=BZe,kue=UZe,Rue=HZe;function Rn(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function cc(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function e8(e,t){let r=Rn(e);if(isNaN(t))return cc(e,NaN);if(!t)return r;let n=r.getDate(),o=cc(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);let a=o.getDate();return n>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),n),r)}var Hnr=Math.pow(10,8)*24*60*60*1e3,zGn=-Hnr,t8=6048e5,qZe=864e5;var jnr=3600;var WZe=jnr*24,HGn=WZe*7,$nr=WZe*365.2425,qnr=$nr/12,jGn=qnr*3;var Wnr={};function av(){return Wnr}function hh(e,t){let r=av(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Rn(e),a=o.getDay(),i=(a<n?7:0)+a-n;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function F1(e){return hh(e,{weekStartsOn:1})}function r8(e){let t=Rn(e),r=t.getFullYear(),n=cc(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);let o=F1(n),a=cc(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);let i=F1(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function HM(e){let t=Rn(e);return t.setHours(0,0,0,0),t}function Nue(e){let t=Rn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function GZe(e,t){let r=HM(e),n=HM(t),o=+r-Nue(r),a=+n-Nue(n);return Math.round((o-a)/qZe)}function KZe(e){let t=r8(e),r=cc(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),F1(r)}function XZe(e){return cc(e,Date.now())}function B1(e,t){let r=HM(e),n=HM(t);return+r==+n}function YZe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mue(e){if(!YZe(e)&&typeof e!="number")return!1;let t=Rn(e);return!isNaN(Number(t))}function QZe(e){let t=Rn(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function n8(e,t){let r=Rn(e.start),n=Rn(e.end),o=+r>+n,a=o?+r:+n,i=o?n:r;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);let l=[];for(;+i<=a;)l.push(Rn(i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return o?l.reverse():l}function ZZe(e){let t=Rn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function JZe(e){let t=Rn(e),r=cc(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function eJe(e,t){let r=av(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Rn(e),a=o.getDay(),i=(a<n?-7:0)+6-(a-n);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}var Gnr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tJe=(e,t,r)=>{let n,o=Gnr[e];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function o8(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Knr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xnr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ynr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rJe={date:o8({formats:Knr,defaultWidth:"full"}),time:o8({formats:Xnr,defaultWidth:"full"}),dateTime:o8({formats:Ynr,defaultWidth:"full"})};var Qnr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nJe=(e,t,r,n)=>Qnr[e];function jM(e){return(t,r)=>{let n=r?.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){let i=e.defaultFormattingWidth||e.defaultWidth,s=r?.width?String(r.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{let i=e.defaultWidth,s=r?.width?String(r.width):e.defaultWidth;o=e.values[s]||e.values[i]}let a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}var Znr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Jnr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eor={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tor={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ror={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nor={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oor=(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},oJe={ordinalNumber:oor,era:jM({values:Znr,defaultWidth:"wide"}),quarter:jM({values:Jnr,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jM({values:eor,defaultWidth:"wide"}),day:jM({values:tor,defaultWidth:"wide"}),dayPeriod:jM({values:ror,defaultWidth:"wide",formattingValues:nor,defaultFormattingWidth:"wide"})};function $M(e){return(t,r={})=>{let n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;let i=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?ior(s,d=>d.test(i)):aor(s,d=>d.test(i)),c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;let u=t.slice(i.length);return{value:c,rest:u}}}function aor(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ior(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function aJe(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let o=n[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=r.valueCallback?r.valueCallback(i):i;let s=t.slice(o.length);return{value:i,rest:s}}}var sor=/^(\d+)(th|st|nd|rd)?/i,lor=/\d+/i,cor={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uor={any:[/^b/i,/^(a|c)/i]},dor={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},por={any:[/1/i,/2/i,/3/i,/4/i]},mor={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hor={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gor={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vor={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yor={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xor={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},iJe={ordinalNumber:aJe({matchPattern:sor,parsePattern:lor,valueCallback:e=>parseInt(e,10)}),era:$M({matchPatterns:cor,defaultMatchWidth:"wide",parsePatterns:uor,defaultParseWidth:"any"}),quarter:$M({matchPatterns:dor,defaultMatchWidth:"wide",parsePatterns:por,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$M({matchPatterns:mor,defaultMatchWidth:"wide",parsePatterns:hor,defaultParseWidth:"any"}),day:$M({matchPatterns:gor,defaultMatchWidth:"wide",parsePatterns:vor,defaultParseWidth:"any"}),dayPeriod:$M({matchPatterns:yor,defaultMatchWidth:"any",parsePatterns:xor,defaultParseWidth:"any"})};var Tue={code:"en-US",formatDistance:tJe,formatLong:rJe,formatRelative:nJe,localize:oJe,match:iJe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sJe(e){let t=Rn(e);return GZe(t,JZe(t))+1}function lJe(e){let t=Rn(e),r=+F1(t)-+KZe(t);return Math.round(r/t8)+1}function a8(e,t){let r=Rn(e),n=r.getFullYear(),o=av(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=cc(e,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);let s=hh(i,t),l=cc(e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);let c=hh(l,t);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function cJe(e,t){let r=av(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=a8(e,t),a=cc(e,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),hh(a,t)}function uJe(e,t){let r=Rn(e),n=+hh(r,t)-+cJe(r,t);return Math.round(n/t8)+1}function ko(e,t){let r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}var px={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return ko(t==="yy"?n%100:n,t.length)},M(e,t){let r=e.getMonth();return t==="M"?String(r+1):ko(r+1,2)},d(e,t){return ko(e.getDate(),t.length)},a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ko(e.getHours()%12||12,t.length)},H(e,t){return ko(e.getHours(),t.length)},m(e,t){return ko(e.getMinutes(),t.length)},s(e,t){return ko(e.getSeconds(),t.length)},S(e,t){let r=t.length,n=e.getMilliseconds(),o=Math.trunc(n*Math.pow(10,r-3));return ko(o,t.length)}};var qM={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Aue={G:function(e,t,r){let n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){let n=e.getFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return px.y(e,t)},Y:function(e,t,r,n){let o=a8(e,n),a=o>0?o:1-o;if(t==="YY"){let i=a%100;return ko(i,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):ko(a,t.length)},R:function(e,t){let r=r8(e);return ko(r,t.length)},u:function(e,t){let r=e.getFullYear();return ko(r,t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ko(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ko(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return px.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return ko(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let o=uJe(e,n);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):ko(o,t.length)},I:function(e,t,r){let n=lJe(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):ko(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):px.d(e,t)},D:function(e,t,r){let n=sJe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):ko(n,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ko(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ko(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return ko(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n=e.getHours(),o;switch(n===12?o=qM.noon:n===0?o=qM.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n=e.getHours(),o;switch(n>=17?o=qM.evening:n>=12?o=qM.afternoon:n>=4?o=qM.morning:o=qM.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return px.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):px.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):ko(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):ko(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):px.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):px.s(e,t)},S:function(e,t){return px.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return fJe(n);case"XXXX":case"XX":return V1(n);case"XXXXX":case"XXX":default:return V1(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return fJe(n);case"xxxx":case"xx":return V1(n);case"xxxxx":case"xxx":default:return V1(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dJe(n,":");case"OOOO":default:return"GMT"+V1(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dJe(n,":");case"zzzz":default:return"GMT"+V1(n,":")}},t:function(e,t,r){let n=Math.trunc(e.getTime()/1e3);return ko(n,t.length)},T:function(e,t,r){let n=e.getTime();return ko(n,t.length)}};function dJe(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),a=n%60;return a===0?r+String(o):r+String(o)+t+ko(a,2)}function fJe(e,t){return e%60===0?(e>0?"-":"+")+ko(Math.abs(e)/60,2):V1(e,t)}function V1(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=ko(Math.trunc(n/60),2),a=ko(n%60,2);return r+o+t+a}var pJe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},mJe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},bor=(e,t)=>{let r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return pJe(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",pJe(n,t)).replace("{{time}}",mJe(o,t))},hJe={p:mJe,P:bor};var wor=/^D+$/,Cor=/^Y+$/,Sor=["D","DD","YY","YYYY"];function gJe(e){return wor.test(e)}function vJe(e){return Cor.test(e)}function yJe(e,t,r){let n=Por(e,t,r);if(console.warn(n),Sor.includes(e))throw new RangeError(n)}function Por(e,t,r){let n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Ior=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kor=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ror=/^'([^]*?)'?$/,Nor=/''/g,Mor=/[a-zA-Z]/;function Lue(e,t,r){let n=av(),o=r?.locale??n.locale??Tue,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Rn(e);if(!Mue(s))throw new RangeError("Invalid time value");let l=t.match(kor).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=hJe[d];return f(u,o.formatLong)}return u}).join("").match(Ior).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:Tor(u)};if(Aue[d])return{isToken:!0,value:u};if(d.match(Mor))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));let c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!r?.useAdditionalWeekYearTokens&&vJe(d)||!r?.useAdditionalDayOfYearTokens&&gJe(d))&&yJe(d,t,String(e));let f=Aue[d[0]];return f(s,d,o.localize,c)}).join("")}function Tor(e){let t=e.match(Ror);return t?t[1].replace(Nor,"'"):e}function Eue(e){return Rn(e).getDay()}function xJe(e,t){let r=Rn(e),n=Rn(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function bJe(e){return B1(e,XZe(e))}function wJe(e,t){return e8(e,-t)}var cl=D(lt(),1);var ur=D(lt(),1);var Ur=D(Or(),1),Due=["Enter"," "],Aor=["ArrowDown","PageUp","Home"],SJe=["ArrowUp","PageDown","End"],Lor=[...Aor,...SJe],Eor={ltr:[...Due,"ArrowRight"],rtl:[...Due,"ArrowLeft"]},Dor={ltr:["ArrowLeft"],rtl:["ArrowRight"]},EF="Menu",[AF,Oor,_or]=cf(EF),[U1,Oue]=hn(EF,[_or,gu,zM]),DF=gu(),PJe=zM(),[IJe,fw]=U1(EF),[For,OF]=U1(EF),kJe=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:a,modal:i=!0}=e,s=DF(t),[l,c]=ur.useState(null),u=ur.useRef(!1),d=to(a),f=wp(o);return ur.useEffect(()=>{let p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),(0,Ur.jsx)(_m,{...s,children:(0,Ur.jsx)(IJe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:c,children:(0,Ur.jsx)(For,{scope:t,onClose:ur.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:n})})})};kJe.displayName=EF;var Bor="MenuAnchor",_ue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=DF(r);return(0,Ur.jsx)(Fm,{...o,...n,ref:t})});_ue.displayName=Bor;var Fue="MenuPortal",[Vor,RJe]=U1(Fue,{forceMount:void 0}),NJe=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:o}=e,a=fw(Fue,t);return(0,Ur.jsx)(Vor,{scope:t,forceMount:r,children:(0,Ur.jsx)(uo,{present:r||a.open,children:(0,Ur.jsx)(vu,{asChild:!0,container:o,children:n})})})};NJe.displayName=Fue;var em="MenuContent",[Uor,Bue]=U1(em),MJe=ur.forwardRef((e,t)=>{let r=RJe(em,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=fw(em,e.__scopeMenu),i=OF(em,e.__scopeMenu);return(0,Ur.jsx)(AF.Provider,{scope:e.__scopeMenu,children:(0,Ur.jsx)(uo,{present:n||a.open,children:(0,Ur.jsx)(AF.Slot,{scope:e.__scopeMenu,children:i.modal?(0,Ur.jsx)(zor,{...o,ref:t}):(0,Ur.jsx)(Hor,{...o,ref:t})})})})}),zor=ur.forwardRef((e,t)=>{let r=fw(em,e.__scopeMenu),n=ur.useRef(null),o=Xt(t,n);return ur.useEffect(()=>{let a=n.current;if(a)return U0(a)},[]),(0,Ur.jsx)(Vue,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:He(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Hor=ur.forwardRef((e,t)=>{let r=fw(em,e.__scopeMenu);return(0,Ur.jsx)(Vue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),jor=Sc("MenuContent.ScrollLock"),Vue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=fw(em,r),v=OF(em,r),y=DF(r),x=PJe(r),w=Oor(r),[b,C]=ur.useState(null),S=ur.useRef(null),P=Xt(t,S,g.onContentChange),N=ur.useRef(0),T=ur.useRef(""),A=ur.useRef(0),M=ur.useRef(null),O=ur.useRef("right"),F=ur.useRef(0),I=m?Wy:ur.Fragment,k=m?{as:jor,allowPinchZoom:!0}:void 0,R=_=>{let U=T.current+_,V=w().filter(z=>!z.disabled),L=document.activeElement,H=V.find(z=>z.ref.current===L)?.textValue,j=V.map(z=>z.textValue),$=rar(j,U,H),W=V.find(z=>z.textValue===$)?.ref.current;(function z(G){T.current=G,window.clearTimeout(N.current),G!==""&&(N.current=window.setTimeout(()=>z(""),1e3))})(U),W&&setTimeout(()=>W.focus())};ur.useEffect(()=>()=>window.clearTimeout(N.current),[]),V0();let E=ur.useCallback(_=>O.current===M.current?.side&&oar(_,M.current?.area),[]);return(0,Ur.jsx)(Uor,{scope:r,searchRef:T,onItemEnter:ur.useCallback(_=>{E(_)&&_.preventDefault()},[E]),onItemLeave:ur.useCallback(_=>{E(_)||(S.current?.focus(),C(null))},[E]),onTriggerLeave:ur.useCallback(_=>{E(_)&&_.preventDefault()},[E]),pointerGraceTimerRef:A,onPointerGraceIntentChange:ur.useCallback(_=>{M.current=_},[]),children:(0,Ur.jsx)(I,{...k,children:(0,Ur.jsx)(qy,{asChild:!0,trapped:o,onMountAutoFocus:He(a,_=>{_.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Ur.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,Ur.jsx)(QG,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:C,onEntryFocus:He(l,_=>{v.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Ur.jsx)(dg,{role:"menu","aria-orientation":"vertical","data-state":qJe(g.open),"data-radix-menu-content":"",dir:v.dir,...y,...h,ref:P,style:{outline:"none",...h.style},onKeyDown:He(h.onKeyDown,_=>{let V=_.target.closest("[data-radix-menu-content]")===_.currentTarget,L=_.ctrlKey||_.altKey||_.metaKey,H=_.key.length===1;V&&(_.key==="Tab"&&_.preventDefault(),!L&&H&&R(_.key));let j=S.current;if(_.target!==j||!Lor.includes(_.key))return;_.preventDefault();let W=w().filter(z=>!z.disabled).map(z=>z.ref.current);SJe.includes(_.key)&&W.reverse(),ear(W)}),onBlur:He(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(N.current),T.current="")}),onPointerMove:He(e.onPointerMove,LF(_=>{let U=_.target,V=F.current!==_.clientX;if(_.currentTarget.contains(U)&&V){let L=_.clientX>F.current?"right":"left";O.current=L,F.current=_.clientX}}))})})})})})})});MJe.displayName=em;var $or="MenuGroup",Uue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{role:"group",...n,ref:t})});Uue.displayName=$or;var qor="MenuLabel",TJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{...n,ref:t})});TJe.displayName=qor;var i8="MenuItem",CJe="menu.itemSelect",l8=ur.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...o}=e,a=ur.useRef(null),i=OF(i8,e.__scopeMenu),s=Bue(i8,e.__scopeMenu),l=Xt(t,a),c=ur.useRef(!1),u=()=>{let d=a.current;if(!r&&d){let f=new CustomEvent(CJe,{bubbles:!0,cancelable:!0});d.addEventListener(CJe,p=>n?.(p),{once:!0}),ey(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return(0,Ur.jsx)(AJe,{...o,ref:l,disabled:r,onClick:He(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:He(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:He(e.onKeyDown,d=>{let f=s.searchRef.current!=="";r||f&&d.key===" "||Due.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});l8.displayName=i8;var AJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:o,...a}=e,i=Bue(i8,r),s=PJe(r),l=ur.useRef(null),c=Xt(t,l),[u,d]=ur.useState(!1),[f,p]=ur.useState("");return ur.useEffect(()=>{let m=l.current;m&&p((m.textContent??"").trim())},[a.children]),(0,Ur.jsx)(AF.ItemSlot,{scope:r,disabled:n,textValue:o??f,children:(0,Ur.jsx)(ZG,{asChild:!0,...s,focusable:!n,children:(0,Ur.jsx)(rt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:c,onPointerMove:He(e.onPointerMove,LF(m=>{n?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:He(e.onPointerLeave,LF(m=>i.onItemLeave(m))),onFocus:He(e.onFocus,()=>d(!0)),onBlur:He(e.onBlur,()=>d(!1))})})})}),Wor="MenuCheckboxItem",LJe=ur.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...o}=e;return(0,Ur.jsx)(FJe,{scope:e.__scopeMenu,checked:r,children:(0,Ur.jsx)(l8,{role:"menuitemcheckbox","aria-checked":s8(r)?"mixed":r,...o,ref:t,"data-state":jue(r),onSelect:He(o.onSelect,()=>n?.(s8(r)?!0:!r),{checkForDefaultPrevented:!1})})})});LJe.displayName=Wor;var EJe="MenuRadioGroup",[Gor,Kor]=U1(EJe,{value:void 0,onValueChange:()=>{}}),DJe=ur.forwardRef((e,t)=>{let{value:r,onValueChange:n,...o}=e,a=to(n);return(0,Ur.jsx)(Gor,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,Ur.jsx)(Uue,{...o,ref:t})})});DJe.displayName=EJe;var OJe="MenuRadioItem",_Je=ur.forwardRef((e,t)=>{let{value:r,...n}=e,o=Kor(OJe,e.__scopeMenu),a=r===o.value;return(0,Ur.jsx)(FJe,{scope:e.__scopeMenu,checked:a,children:(0,Ur.jsx)(l8,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":jue(a),onSelect:He(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});_Je.displayName=OJe;var zue="MenuItemIndicator",[FJe,Xor]=U1(zue,{checked:!1}),BJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...o}=e,a=Xor(zue,r);return(0,Ur.jsx)(uo,{present:n||s8(a.checked)||a.checked===!0,children:(0,Ur.jsx)(rt.span,{...o,ref:t,"data-state":jue(a.checked)})})});BJe.displayName=zue;var Yor="MenuSeparator",VJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});VJe.displayName=Yor;var Qor="MenuArrow",UJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=DF(r);return(0,Ur.jsx)(fg,{...o,...n,ref:t})});UJe.displayName=Qor;var Hue="MenuSub",[Zor,zJe]=U1(Hue),Jor=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,a=fw(Hue,t),i=DF(t),[s,l]=ur.useState(null),[c,u]=ur.useState(null),d=to(o);return ur.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,Ur.jsx)(_m,{...i,children:(0,Ur.jsx)(IJe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:(0,Ur.jsx)(Zor,{scope:t,contentId:Vo(),triggerId:Vo(),trigger:s,onTriggerChange:l,children:r})})})};Jor.displayName=Hue;var TF="MenuSubTrigger",HJe=ur.forwardRef((e,t)=>{let r=fw(TF,e.__scopeMenu),n=OF(TF,e.__scopeMenu),o=zJe(TF,e.__scopeMenu),a=Bue(TF,e.__scopeMenu),i=ur.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,c={__scopeMenu:e.__scopeMenu},u=ur.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return ur.useEffect(()=>u,[u]),ur.useEffect(()=>{let d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),(0,Ur.jsx)(_ue,{asChild:!0,...c,children:(0,Ur.jsx)(AJe,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":qJe(r.open),...e,ref:Jv(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:He(e.onPointerMove,LF(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:He(e.onPointerLeave,LF(d=>{u();let f=r.content?.getBoundingClientRect();if(f){let p=r.content?.dataset.side,m=p==="right",h=m?-5:5,g=f[m?"left":"right"],v=f[m?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:g,y:f.top},{x:v,y:f.top},{x:v,y:f.bottom},{x:g,y:f.bottom}],side:p}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:He(e.onKeyDown,d=>{let f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||Eor[n.dir].includes(d.key)&&(r.onOpenChange(!0),r.content?.focus(),d.preventDefault())})})})});HJe.displayName=TF;var jJe="MenuSubContent",$Je=ur.forwardRef((e,t)=>{let r=RJe(em,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=fw(em,e.__scopeMenu),i=OF(em,e.__scopeMenu),s=zJe(jJe,e.__scopeMenu),l=ur.useRef(null),c=Xt(t,l);return(0,Ur.jsx)(AF.Provider,{scope:e.__scopeMenu,children:(0,Ur.jsx)(uo,{present:n||a.open,children:(0,Ur.jsx)(AF.Slot,{scope:e.__scopeMenu,children:(0,Ur.jsx)(Vue,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:He(e.onFocusOutside,u=>{u.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:He(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:He(e.onKeyDown,u=>{let d=u.currentTarget.contains(u.target),f=Dor[i.dir].includes(u.key);d&&f&&(a.onOpenChange(!1),s.trigger?.focus(),u.preventDefault())})})})})})});$Je.displayName=jJe;function qJe(e){return e?"open":"closed"}function s8(e){return e==="indeterminate"}function jue(e){return s8(e)?"indeterminate":e?"checked":"unchecked"}function ear(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function tar(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function rar(e,t,r){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=tar(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==r));let l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function nar(e,t){let{x:r,y:n}=e,o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],c=s.x,u=s.y,d=l.x,f=l.y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function oar(e,t){if(!t)return!1;let r={x:e.clientX,y:e.clientY};return nar(r,t)}function LF(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WJe=kJe,GJe=_ue,KJe=NJe,XJe=MJe,YJe=Uue,QJe=TJe,ZJe=l8,JJe=LJe,eet=DJe,tet=_Je,ret=BJe,net=VJe,oet=UJe;var aet=HJe,iet=$Je;var Fl=D(Or(),1),c8="DropdownMenu",[iar,kKn]=hn(c8,[Oue]),Ou=Oue(),[sar,set]=iar(c8),lar=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=Ou(t),c=cl.useRef(null),[u,d]=eo({prop:o,defaultProp:a??!1,onChange:i,caller:c8});return(0,Fl.jsx)(sar,{scope:t,triggerId:Vo(),triggerRef:c,contentId:Vo(),open:u,onOpenChange:d,onOpenToggle:cl.useCallback(()=>d(f=>!f),[d]),modal:s,children:(0,Fl.jsx)(WJe,{...l,open:u,onOpenChange:d,dir:n,modal:s,children:r})})};lar.displayName=c8;var cet="DropdownMenuTrigger",car=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,a=set(cet,r),i=Ou(r);return(0,Fl.jsx)(GJe,{asChild:!0,...i,children:(0,Fl.jsx)(rt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:Jv(t,a.triggerRef),onPointerDown:He(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:He(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});car.displayName=cet;var uar="DropdownMenuPortal",uet=e=>{let{__scopeDropdownMenu:t,...r}=e,n=Ou(t);return(0,Fl.jsx)(KJe,{...n,...r})};uet.displayName=uar;var det="DropdownMenuContent",fet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=set(det,r),a=Ou(r),i=cl.useRef(!1);return(0,Fl.jsx)(XJe,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...n,ref:t,onCloseAutoFocus:He(e.onCloseAutoFocus,s=>{i.current||o.triggerRef.current?.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:He(e.onInteractOutside,s=>{let l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fet.displayName=det;var dar="DropdownMenuGroup",far=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(YJe,{...o,...n,ref:t})});far.displayName=dar;var par="DropdownMenuLabel",pet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(QJe,{...o,...n,ref:t})});pet.displayName=par;var mar="DropdownMenuItem",met=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(ZJe,{...o,...n,ref:t})});met.displayName=mar;var har="DropdownMenuCheckboxItem",het=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(JJe,{...o,...n,ref:t})});het.displayName=har;var gar="DropdownMenuRadioGroup",yar=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(eet,{...o,...n,ref:t})});yar.displayName=gar;var xar="DropdownMenuRadioItem",get=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(tet,{...o,...n,ref:t})});get.displayName=xar;var bar="DropdownMenuItemIndicator",vet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(ret,{...o,...n,ref:t})});vet.displayName=bar;var war="DropdownMenuSeparator",yet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(net,{...o,...n,ref:t})});yet.displayName=war;var Car="DropdownMenuArrow",Sar=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(oet,{...o,...n,ref:t})});Sar.displayName=Car;var Par="DropdownMenuSubTrigger",xet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(aet,{...o,...n,ref:t})});xet.displayName=Par;var Iar="DropdownMenuSubContent",bet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(iet,{...o,...n,ref:t,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)"}})});bet.displayName=Iar;var wet=uet,$ue=fet;var que=pet,Wue=met,Gue=het;var Kue=get,Xue=vet,Yue=yet;var Que=xet,Zue=bet;var Dt=D(lt(),1),ade=D(ng(),1);function Jue(e,[t,r]){return Math.min(r,Math.max(t,e))}var Cr=D(Or(),1),Rar=[" ","Enter","ArrowUp","ArrowDown"],Nar=[" ","Enter"],z1="Select",[d8,f8,Mar]=cf(z1),[WM,XKn]=hn(z1,[Mar,gu]),p8=gu(),[Tar,pw]=WM(z1),[Aar,Lar]=WM(z1),Cet=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=p8(t),[g,v]=Dt.useState(null),[y,x]=Dt.useState(null),[w,b]=Dt.useState(!1),C=wp(c),[S,P]=eo({prop:n,defaultProp:o??!1,onChange:a,caller:z1}),[N,T]=eo({prop:i,defaultProp:s,onChange:l,caller:z1}),A=Dt.useRef(null),M=g?m||!!g.closest("form"):!0,[O,F]=Dt.useState(new Set),I=Array.from(O).map(k=>k.props.value).join(";");return(0,Cr.jsx)(_m,{...h,children:(0,Cr.jsxs)(Tar,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:b,contentId:Vo(),value:N,onValueChange:T,open:S,onOpenChange:P,dir:C,triggerPointerDownPosRef:A,disabled:f,children:[(0,Cr.jsx)(d8.Provider,{scope:t,children:(0,Cr.jsx)(Aar,{scope:e.__scopeSelect,onNativeOptionAdd:Dt.useCallback(k=>{F(R=>new Set(R).add(k))},[]),onNativeOptionRemove:Dt.useCallback(k=>{F(R=>{let E=new Set(R);return E.delete(k),E})},[]),children:r})}),M?(0,Cr.jsxs)(Get,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:k=>T(k.target.value),disabled:f,form:m,children:[N===void 0?(0,Cr.jsx)("option",{value:""}):null,Array.from(O)]},I):null]})})};Cet.displayName=z1;var Pet="SelectTrigger",Iet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,a=p8(r),i=pw(Pet,r),s=i.disabled||n,l=Xt(t,i.onTriggerChange),c=f8(r),u=Dt.useRef("touch"),[d,f,p]=Xet(h=>{let g=c().filter(x=>!x.disabled),v=g.find(x=>x.value===i.value),y=Yet(g,h,v);y!==void 0&&i.onValueChange(y.value)}),m=h=>{s||(i.onOpenChange(!0),p()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return(0,Cr.jsx)(Fm,{asChild:!0,...a,children:(0,Cr.jsx)(rt.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ket(i.value)?"":void 0,...o,ref:l,onClick:He(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&m(h)}),onPointerDown:He(o.onPointerDown,h=>{u.current=h.pointerType;let g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(m(h),h.preventDefault())}),onKeyDown:He(o.onKeyDown,h=>{let g=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&f(h.key),!(g&&h.key===" ")&&Rar.includes(h.key)&&(m(),h.preventDefault())})})})});Iet.displayName=Pet;var ket="SelectValue",Ret=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:a,placeholder:i="",...s}=e,l=pw(ket,r),{onValueNodeHasChildrenChange:c}=l,u=a!==void 0,d=Xt(t,l.onValueNodeChange);return $n(()=>{c(u)},[c,u]),(0,Cr.jsx)(rt.span,{...s,ref:d,style:{pointerEvents:"none"},children:Ket(l.value)?(0,Cr.jsx)(Cr.Fragment,{children:i}):a})});Ret.displayName=ket;var Ear="SelectIcon",Net=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,Cr.jsx)(rt.span,{"aria-hidden":!0,...o,ref:t,children:n||"\u25BC"})});Net.displayName=Ear;var Dar="SelectPortal",Met=e=>(0,Cr.jsx)(vu,{asChild:!0,...e});Met.displayName=Dar;var H1="SelectContent",Tet=Dt.forwardRef((e,t)=>{let r=pw(H1,e.__scopeSelect),[n,o]=Dt.useState();if($n(()=>{o(new DocumentFragment)},[]),!r.open){let a=n;return a?ade.createPortal((0,Cr.jsx)(Aet,{scope:e.__scopeSelect,children:(0,Cr.jsx)(d8.Slot,{scope:e.__scopeSelect,children:(0,Cr.jsx)("div",{children:e.children})})}),a):null}return(0,Cr.jsx)(Let,{...e,ref:t})});Tet.displayName=H1;var gh=10,[Aet,mw]=WM(H1),Oar="SelectContentImpl",_ar=Sc("SelectContent.RemoveScroll"),Let=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=pw(H1,r),[x,w]=Dt.useState(null),[b,C]=Dt.useState(null),S=Xt(t,z=>w(z)),[P,N]=Dt.useState(null),[T,A]=Dt.useState(null),M=f8(r),[O,F]=Dt.useState(!1),I=Dt.useRef(!1);Dt.useEffect(()=>{if(x)return U0(x)},[x]),V0();let k=Dt.useCallback(z=>{let[G,...X]=M().map(ie=>ie.ref.current),[Y]=X.slice(-1),ae=document.activeElement;for(let ie of z)if(ie===ae||(ie?.scrollIntoView({block:"nearest"}),ie===G&&b&&(b.scrollTop=0),ie===Y&&b&&(b.scrollTop=b.scrollHeight),ie?.focus(),document.activeElement!==ae))return},[M,b]),R=Dt.useCallback(()=>k([P,x]),[k,P,x]);Dt.useEffect(()=>{O&&R()},[O,R]);let{onOpenChange:E,triggerPointerDownPosRef:_}=y;Dt.useEffect(()=>{if(x){let z={x:0,y:0},G=Y=>{z={x:Math.abs(Math.round(Y.pageX)-(_.current?.x??0)),y:Math.abs(Math.round(Y.pageY)-(_.current?.y??0))}},X=Y=>{z.x<=10&&z.y<=10?Y.preventDefault():x.contains(Y.target)||E(!1),document.removeEventListener("pointermove",G),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",X,{capture:!0})}}},[x,E,_]),Dt.useEffect(()=>{let z=()=>E(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[E]);let[U,V]=Xet(z=>{let G=M().filter(ae=>!ae.disabled),X=G.find(ae=>ae.ref.current===document.activeElement),Y=Yet(G,z,X);Y&&setTimeout(()=>Y.ref.current.focus())}),L=Dt.useCallback((z,G,X)=>{let Y=!I.current&&!X;(y.value!==void 0&&y.value===G||Y)&&(N(z),Y&&(I.current=!0))},[y.value]),H=Dt.useCallback(()=>x?.focus(),[x]),j=Dt.useCallback((z,G,X)=>{let Y=!I.current&&!X;(y.value!==void 0&&y.value===G||Y)&&A(z)},[y.value]),$=n==="popper"?ede:Eet,W=$===ede?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,Cr.jsx)(Aet,{scope:r,content:x,viewport:b,onViewportChange:C,itemRefCallback:L,selectedItem:P,onItemLeave:H,itemTextRefCallback:j,focusSelectedItem:R,selectedItemText:T,position:n,isPositioned:O,searchRef:U,children:(0,Cr.jsx)(Wy,{as:_ar,allowPinchZoom:!0,children:(0,Cr.jsx)(qy,{asChild:!0,trapped:y.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:He(o,z=>{y.trigger?.focus({preventScroll:!0}),z.preventDefault()}),children:(0,Cr.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,Cr.jsx)($,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:z=>z.preventDefault(),...v,...W,onPlaced:()=>F(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:He(v.onKeyDown,z=>{let G=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!G&&z.key.length===1&&V(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let Y=M().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(z.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){let ae=z.target,ie=Y.indexOf(ae);Y=Y.slice(ie+1)}setTimeout(()=>k(Y)),z.preventDefault()}})})})})})})});Let.displayName=Oar;var Far="SelectItemAlignedPosition",Eet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,a=pw(H1,r),i=mw(H1,r),[s,l]=Dt.useState(null),[c,u]=Dt.useState(null),d=Xt(t,S=>u(S)),f=f8(r),p=Dt.useRef(!1),m=Dt.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=i,x=Dt.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&c&&h&&g&&v){let S=a.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),N=a.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(a.dir!=="rtl"){let ae=T.left-P.left,ie=N.left-ae,Le=S.left-ie,Se=S.width+Le,Be=Math.max(Se,P.width),me=window.innerWidth-gh,Re=Jue(ie,[gh,Math.max(gh,me-Be)]);s.style.minWidth=Se+"px",s.style.left=Re+"px"}else{let ae=P.right-T.right,ie=window.innerWidth-N.right-ae,Le=window.innerWidth-S.right-ie,Se=S.width+Le,Be=Math.max(Se,P.width),me=window.innerWidth-gh,Re=Jue(ie,[gh,Math.max(gh,me-Be)]);s.style.minWidth=Se+"px",s.style.right=Re+"px"}let A=f(),M=window.innerHeight-gh*2,O=h.scrollHeight,F=window.getComputedStyle(c),I=parseInt(F.borderTopWidth,10),k=parseInt(F.paddingTop,10),R=parseInt(F.borderBottomWidth,10),E=parseInt(F.paddingBottom,10),_=I+k+O+E+R,U=Math.min(g.offsetHeight*5,_),V=window.getComputedStyle(h),L=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),j=S.top+S.height/2-gh,$=M-j,W=g.offsetHeight/2,z=g.offsetTop+W,G=I+k+z,X=_-G;if(G<=j){let ae=A.length>0&&g===A[A.length-1].ref.current;s.style.bottom="0px";let ie=c.clientHeight-h.offsetTop-h.offsetHeight,Le=Math.max($,W+(ae?H:0)+ie+R),Se=G+Le;s.style.height=Se+"px"}else{let ae=A.length>0&&g===A[0].ref.current;s.style.top="0px";let Le=Math.max(j,I+h.offsetTop+(ae?L:0)+W)+X;s.style.height=Le+"px",h.scrollTop=G-j+h.offsetTop}s.style.margin=`${gh}px 0`,s.style.minHeight=U+"px",s.style.maxHeight=M+"px",n?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,c,h,g,v,a.dir,n]);$n(()=>x(),[x]);let[w,b]=Dt.useState();$n(()=>{c&&b(window.getComputedStyle(c).zIndex)},[c]);let C=Dt.useCallback(S=>{S&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return(0,Cr.jsx)(Var,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,Cr.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,Cr.jsx)(rt.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Eet.displayName=Far;var Bar="SelectPopperPosition",ede=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=gh,...a}=e,i=p8(r);return(0,Cr.jsx)(dg,{...i,...a,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ede.displayName=Bar;var[Var,ide]=WM(H1,{}),tde="SelectViewport",Det=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,a=mw(tde,r),i=ide(tde,r),s=Xt(t,a.onViewportChange),l=Dt.useRef(0);return(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,Cr.jsx)(d8.Slot,{scope:r,children:(0,Cr.jsx)(rt.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:He(o.onScroll,c=>{let u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f?.current&&d){let p=Math.abs(l.current-u.scrollTop);if(p>0){let m=window.innerHeight-gh*2,h=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),v=Math.max(h,g);if(v<m){let y=v+p,x=Math.min(m,y),w=y-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Det.displayName=tde;var Oet="SelectGroup",[Uar,zar]=WM(Oet),Har=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=Vo();return(0,Cr.jsx)(Uar,{scope:r,id:o,children:(0,Cr.jsx)(rt.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Har.displayName=Oet;var _et="SelectLabel",Fet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=zar(_et,r);return(0,Cr.jsx)(rt.div,{id:o.id,...n,ref:t})});Fet.displayName=_et;var u8="SelectItem",[jar,Bet]=WM(u8),Vet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:a,...i}=e,s=pw(u8,r),l=mw(u8,r),c=s.value===n,[u,d]=Dt.useState(a??""),[f,p]=Dt.useState(!1),m=Xt(t,y=>l.itemRefCallback?.(y,n,o)),h=Vo(),g=Dt.useRef("touch"),v=()=>{o||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,Cr.jsx)(jar,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:Dt.useCallback(y=>{d(x=>x||(y?.textContent??"").trim())},[]),children:(0,Cr.jsx)(d8.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:(0,Cr.jsx)(rt.div,{role:"option","aria-labelledby":h,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:He(i.onFocus,()=>p(!0)),onBlur:He(i.onBlur,()=>p(!1)),onClick:He(i.onClick,()=>{g.current!=="mouse"&&v()}),onPointerUp:He(i.onPointerUp,()=>{g.current==="mouse"&&v()}),onPointerDown:He(i.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:He(i.onPointerMove,y=>{g.current=y.pointerType,o?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(i.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:He(i.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(Nar.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});Vet.displayName=u8;var _F="SelectItemText",Uet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...a}=e,i=pw(_F,r),s=mw(_F,r),l=Bet(_F,r),c=Lar(_F,r),[u,d]=Dt.useState(null),f=Xt(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),p=u?.textContent,m=Dt.useMemo(()=>(0,Cr.jsx)("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=c;return $n(()=>(h(m),()=>g(m)),[h,g,m]),(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(rt.span,{id:l.textId,...a,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ade.createPortal(a.children,i.valueNode):null]})});Uet.displayName=_F;var zet="SelectItemIndicator",Het=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return Bet(zet,r).isSelected?(0,Cr.jsx)(rt.span,{"aria-hidden":!0,...n,ref:t}):null});Het.displayName=zet;var rde="SelectScrollUpButton",jet=Dt.forwardRef((e,t)=>{let r=mw(rde,e.__scopeSelect),n=ide(rde,e.__scopeSelect),[o,a]=Dt.useState(!1),i=Xt(t,n.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){let u=c.scrollTop>0;a(u)};var s=l;let c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?(0,Cr.jsx)(qet,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});jet.displayName=rde;var nde="SelectScrollDownButton",$et=Dt.forwardRef((e,t)=>{let r=mw(nde,e.__scopeSelect),n=ide(nde,e.__scopeSelect),[o,a]=Dt.useState(!1),i=Xt(t,n.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){let u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};var s=l;let c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?(0,Cr.jsx)(qet,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});$et.displayName=nde;var qet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,a=mw("SelectScrollButton",r),i=Dt.useRef(null),s=f8(r),l=Dt.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return Dt.useEffect(()=>()=>l(),[l]),$n(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),(0,Cr.jsx)(rt.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:He(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:He(o.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:He(o.onPointerLeave,()=>{l()})})}),$ar="SelectSeparator",Wet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,Cr.jsx)(rt.div,{"aria-hidden":!0,...n,ref:t})});Wet.displayName=$ar;var ode="SelectArrow",qar=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=p8(r),a=pw(ode,r),i=mw(ode,r);return a.open&&i.position==="popper"?(0,Cr.jsx)(fg,{...o,...n,ref:t}):null});qar.displayName=ode;var War="SelectBubbleInput",Get=Dt.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{let o=Dt.useRef(null),a=Xt(n,o),i=Wb(t);return Dt.useEffect(()=>{let s=o.current;if(!s)return;let l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){let d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[i,t]),(0,Cr.jsx)(rt.select,{...r,style:{...AZ,...r.style},ref:a,defaultValue:t})});Get.displayName=War;function Ket(e){return e===""||e===void 0}function Xet(e){let t=to(e),r=Dt.useRef(""),n=Dt.useRef(0),o=Dt.useCallback(i=>{let s=r.current+i;t(s),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=Dt.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return Dt.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function Yet(e,t,r){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=Gar(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==r));let l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function Gar(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Qet=Cet,sde=Iet,Zet=Ret,Jet=Net,ett=Met,lde=Tet,ttt=Det;var cde=Fet,ude=Vet,rtt=Uet,ntt=Het,dde=jet,fde=$et,pde=Wet;var att=D(lt(),1);var itt=D(Or(),1),Xar="Separator",ott="horizontal",Yar=["horizontal","vertical"],stt=att.forwardRef((e,t)=>{let{decorative:r,orientation:n=ott,...o}=e,a=Qar(n)?n:ott,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return(0,itt.jsx)(rt.div,{"data-orientation":a,...s,...o,ref:t})});stt.displayName=Xar;function Qar(e){return Yar.includes(e)}var mde=stt;var on=D(lt(),1);var Hs=D(Or(),1),[m8,l7n]=hn("Tooltip",[gu]),h8=gu(),ltt="TooltipProvider",Jar=700,hde="tooltip.open",[eir,vde]=m8(ltt),ctt=e=>{let{__scopeTooltip:t,delayDuration:r=Jar,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=on.useRef(!0),s=on.useRef(!1),l=on.useRef(0);return on.useEffect(()=>{let c=l.current;return()=>window.clearTimeout(c)},[]),(0,Hs.jsx)(eir,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:on.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:on.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:s,onPointerInTransitChange:on.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:a})};ctt.displayName=ltt;var FF="Tooltip",[tir,BF]=m8(FF),utt=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=vde(FF,e.__scopeTooltip),c=h8(t),[u,d]=on.useState(null),f=Vo(),p=on.useRef(0),m=i??l.disableHoverableContent,h=s??l.delayDuration,g=on.useRef(!1),[v,y]=eo({prop:n,defaultProp:o??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(hde))):l.onClose(),a?.(S)},caller:FF}),x=on.useMemo(()=>v?g.current?"delayed-open":"instant-open":"closed",[v]),w=on.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),b=on.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=on.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return on.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),(0,Hs.jsx)(_m,{...c,children:(0,Hs.jsx)(tir,{scope:t,contentId:f,open:v,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:on.useCallback(()=>{l.isOpenDelayedRef.current?C():w()},[l.isOpenDelayedRef,C,w]),onTriggerLeave:on.useCallback(()=>{m?b():(window.clearTimeout(p.current),p.current=0)},[b,m]),onOpen:w,onClose:b,disableHoverableContent:m,children:r})})};utt.displayName=FF;var gde="TooltipTrigger",dtt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,o=BF(gde,r),a=vde(gde,r),i=h8(r),s=on.useRef(null),l=Xt(t,s,o.onTriggerChange),c=on.useRef(!1),u=on.useRef(!1),d=on.useCallback(()=>c.current=!1,[]);return on.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,Hs.jsx)(Fm,{asChild:!0,...i,children:(0,Hs.jsx)(rt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:He(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:He(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:He(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:He(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:He(e.onBlur,o.onClose),onClick:He(e.onClick,o.onClose)})})});dtt.displayName=gde;var yde="TooltipPortal",[rir,nir]=m8(yde,{forceMount:void 0}),oir=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=BF(yde,t);return(0,Hs.jsx)(rir,{scope:t,forceMount:r,children:(0,Hs.jsx)(uo,{present:r||a.open,children:(0,Hs.jsx)(vu,{asChild:!0,container:o,children:n})})})};oir.displayName=yde;var GM="TooltipContent",ftt=on.forwardRef((e,t)=>{let r=nir(GM,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=BF(GM,e.__scopeTooltip);return(0,Hs.jsx)(uo,{present:n||i.open,children:i.disableHoverableContent?(0,Hs.jsx)(ptt,{side:o,...a,ref:t}):(0,Hs.jsx)(air,{side:o,...a,ref:t})})}),air=on.forwardRef((e,t)=>{let r=BF(GM,e.__scopeTooltip),n=vde(GM,e.__scopeTooltip),o=on.useRef(null),a=Xt(t,o),[i,s]=on.useState(null),{trigger:l,onClose:c}=r,u=o.current,{onPointerInTransitChange:d}=n,f=on.useCallback(()=>{s(null),d(!1)},[d]),p=on.useCallback((m,h)=>{let g=m.currentTarget,v={x:m.clientX,y:m.clientY},y=cir(v,g.getBoundingClientRect()),x=uir(v,y),w=dir(h.getBoundingClientRect()),b=pir([...x,...w]);s(b),d(!0)},[d]);return on.useEffect(()=>()=>f(),[f]),on.useEffect(()=>{if(l&&u){let m=g=>p(g,u),h=g=>p(g,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",h)}}},[l,u,p,f]),on.useEffect(()=>{if(i){let m=h=>{let g=h.target,v={x:h.clientX,y:h.clientY},y=l?.contains(g)||u?.contains(g),x=!fir(v,i);y?f():x&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,i,c,f]),(0,Hs.jsx)(ptt,{...e,ref:a})}),[iir,sir]=m8(FF,{isInside:!1}),lir=tU("TooltipContent"),ptt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,l=BF(GM,r),c=h8(r),{onClose:u}=l;return on.useEffect(()=>(document.addEventListener(hde,u),()=>document.removeEventListener(hde,u)),[u]),on.useEffect(()=>{if(l.trigger){let d=f=>{f.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),(0,Hs.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:(0,Hs.jsxs)(dg,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,Hs.jsx)(lir,{children:n}),(0,Hs.jsx)(iir,{scope:r,isInside:!0,children:(0,Hs.jsx)(az,{id:l.contentId,role:"tooltip",children:o||n})})]})})});ftt.displayName=GM;var mtt="TooltipArrow",htt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,o=h8(r);return sir(mtt,r).isInside?null:(0,Hs.jsx)(fg,{...o,...n,ref:t})});htt.displayName=mtt;function cir(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function uir(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function dir(e){let{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function fir(e,t){let{x:r,y:n}=e,o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],c=s.x,u=s.y,d=l.x,f=l.y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function pir(e){let t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),mir(t)}function mir(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let o=e[n];for(;t.length>=2;){let a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();let r=[];for(let n=e.length-1;n>=0;n--){let o=e[n];for(;r.length>=2;){let a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var gtt=ctt,vtt=utt,ytt=dtt;var xde=ftt,bde=htt;var vh=D(lt(),1);var j1=D(Or(),1),g8="Switch",[gir,g7n]=hn(g8),[vir,yir]=gir(g8),xtt=vh.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,p]=vh.useState(null),m=Xt(t,x=>p(x)),h=vh.useRef(!1),g=f?u||!!f.closest("form"):!0,[v,y]=eo({prop:o,defaultProp:a??!1,onChange:c,caller:g8});return(0,j1.jsxs)(vir,{scope:r,checked:v,disabled:s,children:[(0,j1.jsx)(rt.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":Stt(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:m,onClick:He(e.onClick,x=>{y(w=>!w),g&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})}),g&&(0,j1.jsx)(Ctt,{control:f,bubbles:!h.current,name:n,value:l,checked:v,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});xtt.displayName=g8;var btt="SwitchThumb",wtt=vh.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,o=yir(btt,r);return(0,j1.jsx)(rt.span,{"data-state":Stt(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});wtt.displayName=btt;var xir="SwitchBubbleInput",Ctt=vh.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{let i=vh.useRef(null),s=Xt(i,a),l=Wb(r),c=uk(t);return vh.useEffect(()=>{let u=i.current;if(!u)return;let d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==r&&p){let m=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(m)}},[l,r,n]),(0,j1.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ctt.displayName=xir;function Stt(e){return e?"checked":"unchecked"}var wde=xtt,Ptt=wtt;var Qr=D(lt(),1),ktt=D(ng(),1);var Ro=D(Or(),1),kde="ToastProvider",[Rde,wir,Cir]=cf("Toast"),[Rtt,N7n]=hn("Toast",[Cir]),[Sir,y8]=Rtt(kde),Pir=e=>{let{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[s,l]=Qr.useState(null),[c,u]=Qr.useState(0),d=Qr.useRef(!1),f=Qr.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${kde}\`. Expected non-empty \`string\`.`),(0,Ro.jsx)(Rde.Provider,{scope:t,children:(0,Ro.jsx)(Sir,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:Qr.useCallback(()=>u(p=>p+1),[]),onToastRemove:Qr.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};Pir.displayName=kde;var Ntt="ToastViewport",Iir=["F8"],Sde="toast.viewportPause",Pde="toast.viewportResume",Mtt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:n=Iir,label:o="Notifications ({hotkey})",...a}=e,i=y8(Ntt,r),s=wir(r),l=Qr.useRef(null),c=Qr.useRef(null),u=Qr.useRef(null),d=Qr.useRef(null),f=Xt(t,d,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;Qr.useEffect(()=>{let g=v=>{n.length!==0&&n.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),Qr.useEffect(()=>{let g=l.current,v=d.current;if(m&&g&&v){let y=()=>{if(!i.isClosePausedRef.current){let C=new CustomEvent(Sde);v.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){let C=new CustomEvent(Pde);v.dispatchEvent(C),i.isClosePausedRef.current=!1}},w=C=>{!g.contains(C.relatedTarget)&&x()},b=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",w),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",b),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[m,i.isClosePausedRef]);let h=Qr.useCallback(({tabbingDirection:g})=>{let y=s().map(x=>{let w=x.ref.current,b=[w,...Bir(w)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return Qr.useEffect(()=>{let g=d.current;if(g){let v=y=>{let x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){let b=document.activeElement,C=y.shiftKey;if(y.target===g&&C){c.current?.focus();return}let N=h({tabbingDirection:C?"backwards":"forwards"}),T=N.findIndex(A=>A===b);Cde(N.slice(T+1))?y.preventDefault():C?c.current?.focus():u.current?.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,h]),(0,Ro.jsxs)(CNe,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&(0,Ro.jsx)(Ide,{ref:c,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"forwards"});Cde(g)}}),(0,Ro.jsx)(Rde.Slot,{scope:r,children:(0,Ro.jsx)(rt.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,Ro.jsx)(Ide,{ref:u,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"backwards"});Cde(g)}})]})});Mtt.displayName=Ntt;var Ttt="ToastFocusProxy",Ide=Qr.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=y8(Ttt,r);return(0,Ro.jsx)(OE,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{let s=i.relatedTarget;!a.viewport?.contains(s)&&n()}})});Ide.displayName=Ttt;var VF="Toast",kir="toast.swipeStart",Rir="toast.swipeMove",Nir="toast.swipeCancel",Mir="toast.swipeEnd",Att=Qr.forwardRef((e,t)=>{let{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[s,l]=eo({prop:n,defaultProp:o??!0,onChange:a,caller:VF});return(0,Ro.jsx)(uo,{present:r||s,children:(0,Ro.jsx)(Lir,{open:s,...i,ref:t,onClose:()=>l(!1),onPause:to(e.onPause),onResume:to(e.onResume),onSwipeStart:He(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:He(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:He(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:He(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Att.displayName=VF;var[Tir,Air]=Rtt(VF,{onClose(){}}),Lir=Qr.forwardRef((e,t)=>{let{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=y8(VF,r),[g,v]=Qr.useState(null),y=Xt(t,F=>v(F)),x=Qr.useRef(null),w=Qr.useRef(null),b=o||h.duration,C=Qr.useRef(0),S=Qr.useRef(b),P=Qr.useRef(0),{onToastAdd:N,onToastRemove:T}=h,A=to(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),i()}),M=Qr.useCallback(F=>{!F||F===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(A,F))},[A]);Qr.useEffect(()=>{let F=h.viewport;if(F){let I=()=>{M(S.current),c?.()},k=()=>{let R=new Date().getTime()-C.current;S.current=S.current-R,window.clearTimeout(P.current),l?.()};return F.addEventListener(Sde,k),F.addEventListener(Pde,I),()=>{F.removeEventListener(Sde,k),F.removeEventListener(Pde,I)}}},[h.viewport,b,l,c,M]),Qr.useEffect(()=>{a&&!h.isClosePausedRef.current&&M(b)},[a,b,h.isClosePausedRef,M]),Qr.useEffect(()=>(N(),()=>T()),[N,T]);let O=Qr.useMemo(()=>g?Btt(g):null,[g]);return h.viewport?(0,Ro.jsxs)(Ro.Fragment,{children:[O&&(0,Ro.jsx)(Eir,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:O}),(0,Ro.jsx)(Tir,{scope:r,onClose:A,children:ktt.createPortal((0,Ro.jsx)(Rde.ItemSlot,{scope:r,children:(0,Ro.jsx)(wNe,{asChild:!0,onEscapeKeyDown:He(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||A(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,Ro.jsx)(rt.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:He(e.onKeyDown,F=>{F.key==="Escape"&&(s?.(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:He(e.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:He(e.onPointerMove,F=>{if(!x.current)return;let I=F.clientX-x.current.x,k=F.clientY-x.current.y,R=!!w.current,E=["left","right"].includes(h.swipeDirection),_=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,U=E?_(0,I):0,V=E?0:_(0,k),L=F.pointerType==="touch"?10:2,H={x:U,y:V},j={originalEvent:F,delta:H};R?(w.current=H,v8(Rir,d,j,{discrete:!1})):Itt(H,h.swipeDirection,L)?(w.current=H,v8(kir,u,j,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(I)>L||Math.abs(k)>L)&&(x.current=null)}),onPointerUp:He(e.onPointerUp,F=>{let I=w.current,k=F.target;if(k.hasPointerCapture(F.pointerId)&&k.releasePointerCapture(F.pointerId),w.current=null,x.current=null,I){let R=F.currentTarget,E={originalEvent:F,delta:I};Itt(I,h.swipeDirection,h.swipeThreshold)?v8(Mir,p,E,{discrete:!0}):v8(Nir,f,E,{discrete:!0}),R.addEventListener("click",_=>_.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Eir=e=>{let{__scopeToast:t,children:r,...n}=e,o=y8(VF,t),[a,i]=Qr.useState(!1),[s,l]=Qr.useState(!1);return _ir(()=>i(!0)),Qr.useEffect(()=>{let c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:(0,Ro.jsx)(vu,{asChild:!0,children:(0,Ro.jsx)(OE,{...n,children:a&&(0,Ro.jsxs)(Ro.Fragment,{children:[o.label," ",r]})})})},Dir="ToastTitle",Ltt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,Ro.jsx)(rt.div,{...n,ref:t})});Ltt.displayName=Dir;var Oir="ToastDescription",Ett=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,Ro.jsx)(rt.div,{...n,ref:t})});Ett.displayName=Oir;var Dtt="ToastAction",Ott=Qr.forwardRef((e,t)=>{let{altText:r,...n}=e;return r.trim()?(0,Ro.jsx)(Ftt,{altText:r,asChild:!0,children:(0,Ro.jsx)(Nde,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Dtt}\`. Expected non-empty \`string\`.`),null)});Ott.displayName=Dtt;var _tt="ToastClose",Nde=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e,o=Air(_tt,r);return(0,Ro.jsx)(Ftt,{asChild:!0,children:(0,Ro.jsx)(rt.button,{type:"button",...n,ref:t,onClick:He(e.onClick,o.onClose)})})});Nde.displayName=_tt;var Ftt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,altText:n,...o}=e;return(0,Ro.jsx)(rt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function Btt(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Fir(n)){let o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){let i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Btt(n))}}),t}function v8(e,t,r,{discrete:n}){let o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ey(o,a):o.dispatchEvent(a)}var Itt=(e,t,r=0)=>{let n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function _ir(e=()=>{}){let t=to(e);$n(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Fir(e){return e.nodeType===e.ELEMENT_NODE}function Bir(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Cde(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Mde=Mtt,Tde=Att,Ade=Ltt,Lde=Ett,Ede=Ott,Dde=Nde;function Ae(...e){return R7e(MW(e))}var Uir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(p7e,{ref:r,className:Ae("moonui-theme","border-b border-gray-200 dark:border-gray-800",e),...t}));Uir.displayName="AccordionItem";var zir=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsx)(m7e,{className:"flex",children:(0,q.jsxs)(Zle,{ref:n,className:Ae("flex flex-1 items-center justify-between py-4 font-medium transition-all dark:text-gray-100","hover:underline hover:text-primary dark:hover:text-primary-400","[&[data-state=open]>svg]:rotate-180",e),...r,children:[t,(0,q.jsx)(j0,{className:"h-4 w-4 shrink-0 transition-transform duration-200 opacity-70 group-hover:opacity-100"})]})}));zir.displayName=Zle.displayName;var Hir=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsx)(Jle,{ref:n,className:Ae("overflow-hidden text-sm text-gray-700 dark:text-gray-300 transition-all","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...r,children:(0,q.jsx)("div",{className:"pb-4 pt-0",children:t})}));Hir.displayName=Jle.displayName;var jir=Hn("relative w-full flex items-center gap-3 p-4 border text-foreground [&>svg]:shrink-0",{variants:{variant:{default:"bg-background text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/30",success:"bg-success/10 text-success border-success/30",warning:"bg-warning/10 text-warning border-warning/30",error:"bg-destructive/10 text-destructive border-destructive/30",info:"bg-blue-500/10 text-blue-500 border-blue-500/30"},size:{sm:"py-2 text-xs",default:"py-3 text-sm",lg:"py-4 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},withClose:{true:"pr-10"}},defaultVariants:{variant:"default",size:"default",radius:"default",withClose:!1}}),$ir=ee.forwardRef(({className:e,variant:t="default",size:r,radius:n,hideIcon:o=!1,closable:a=!1,onClose:i,children:s,...l},c)=>{let u=ee.useMemo(()=>{switch(t){case"success":return Ky;case"warning":return W0;case"error":return Jg;case"info":return oM;default:return oM}},[t]);return(0,q.jsxs)("div",{ref:c,role:"alert",className:Ae("moonui-theme",jir({variant:t,size:r,radius:n,withClose:a}),e),...l,children:[!o&&(0,q.jsx)(u,{className:"h-5 w-5"}),(0,q.jsx)("div",{className:"flex-1",children:s}),a&&i&&(0,q.jsx)("button",{onClick:i,className:"absolute right-3 top-3 inline-flex h-6 w-6 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100","aria-label":"Kapat",children:(0,q.jsx)(Yy,{className:"h-4 w-4"})})]})});$ir.displayName="Alert";var qir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("h5",{ref:r,className:Ae("moonui-theme","font-semibold leading-tight tracking-tight mb-1",e),...t}));qir.displayName="AlertTitle";var Wir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","text-sm leading-5 text-muted-foreground",e),...t}));Wir.displayName="AlertDescription";var Gir=Hn("relative overflow-hidden",{variants:{variant:{default:"rounded-md bg-muted/10",ghost:"bg-transparent",outline:"rounded-md border border-border",card:"rounded-md bg-card shadow-sm"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"default"}}),Kir=ee.forwardRef(({className:e,variant:t,radius:r,ratio:n=16/9,style:o,children:a,...i},s)=>(0,q.jsx)("div",{ref:s,className:Ae("moonui-theme",Gir({variant:t,radius:r}),e),style:{position:"relative",paddingBottom:`${1/n*100}%`,...o},...i,children:(0,q.jsx)("div",{className:"absolute inset-0",children:a})}));Kir.displayName="AspectRatio";var Xir=Hn("relative flex shrink-0 overflow-hidden",{variants:{size:{default:"h-10 w-10",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12",xl:"h-16 w-16","2xl":"h-20 w-20"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",full:"rounded-full",none:"rounded-none"},variant:{default:"",ring:"ring-2 ring-border",ringOffset:"ring-2 ring-border ring-offset-2 ring-offset-background",border:"border-2 border-border"}},defaultVariants:{size:"default",radius:"default",variant:"default"}}),Xtt=ee.forwardRef(({className:e,size:t,radius:r,variant:n,...o},a)=>(0,q.jsx)(ace,{ref:a,className:Ae("moonui-theme",Xir({size:t,radius:r,variant:n}),e),...o}));Xtt.displayName=ace.displayName;var Yir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(ice,{ref:r,className:Ae("moonui-theme","aspect-square h-full w-full",e),...t}));Yir.displayName=ice.displayName;var Ytt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(sce,{ref:r,className:Ae("flex h-full w-full items-center justify-center bg-muted",e),...t}));Ytt.displayName=sce.displayName;var Qir=ee.forwardRef(({className:e,limit:t,avatars:r,overlapOffset:n=-8,...o},a)=>{let i=t?r.slice(0,t):r,s=t?Math.max(0,r.length-t):0;return(0,q.jsx)("div",{ref:a,className:Ae("moonui-theme","flex items-center",e),...o,children:(0,q.jsxs)("div",{className:"flex",children:[i.map((l,c)=>(0,q.jsx)("div",{className:"relative",style:{marginLeft:c===0?0:`${n}px`,zIndex:i.length-c},children:l},c)),s>0&&(0,q.jsx)("div",{className:"relative z-0",style:{marginLeft:`${n}px`},children:(0,q.jsx)(Xtt,{variant:"border",children:(0,q.jsxs)(Ytt,{children:["+",s]})})})]})})});Qir.displayName="AvatarGroup";var Zir=Hn(["inline-flex items-center justify-center gap-1.5","font-medium transition-colors duration-200","border focus:outline-none","focus-visible:ring-2 focus-visible:ring-offset-1","mr-2 mb-2 last:mr-0"],{variants:{variant:{primary:["border-transparent bg-gray-900 text-white","hover:bg-gray-800 dark:hover:bg-gray-700","focus-visible:ring-gray-500/30 dark:focus-visible:ring-gray-400/40","dark:bg-gray-700 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"],secondary:["border-transparent bg-secondary text-secondary-foreground","hover:bg-gray-200 dark:hover:bg-gray-600","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:bg-gray-700/50 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"],outline:["border-gray-200 dark:border-gray-600","bg-transparent text-foreground","hover:border-gray-300 dark:hover:border-gray-500","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-100 dark:bg-transparent dark:backdrop-blur-sm"],destructive:["border-transparent bg-error text-white","hover:bg-error/90 dark:hover:bg-error/80","focus-visible:ring-error/30 dark:focus-visible:ring-error/25","dark:bg-error/90 dark:text-white dark:shadow-inner dark:shadow-error/10"],success:["border-transparent bg-success text-white","hover:bg-success/90 dark:hover:bg-success/80","focus-visible:ring-success/30 dark:focus-visible:ring-success/25","dark:bg-success/90 dark:text-white dark:shadow-inner dark:shadow-success/10"],warning:["border-transparent bg-warning text-white","hover:bg-warning/90 dark:hover:bg-warning/80","focus-visible:ring-warning/30 dark:focus-visible:ring-warning/25","dark:bg-warning/90 dark:text-gray-900 dark:shadow-inner dark:shadow-warning/10"],ghost:["border border-gray-200 bg-gray-50/50 text-gray-700","hover:bg-gray-100 dark:hover:bg-gray-800/60","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:border-gray-700 dark:bg-gray-800/30 dark:text-gray-300","transition-all duration-200"],pro:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"],admin:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"]},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-3 text-sm",lg:"h-8 px-4 text-base"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",none:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",radius:"default"}});function C8({className:e,variant:t,size:r,radius:n,withDot:o,dotColor:a,removable:i,onRemove:s,leftIcon:l,rightIcon:c,noAutoSpacing:u,children:d,...f}){let p=l,m=d;return t==="pro"&&(p=l||(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:[(0,q.jsx)("path",{d:"M12 0L13.09 8.26L22 9L13.09 9.74L12 18L10.91 9.74L2 9L10.91 8.26L12 0Z",fill:"currentColor"}),(0,q.jsx)("path",{d:"M19 5L19.5 7L21 7.5L19.5 8L19 10L18.5 8L17 7.5L18.5 7L19 5Z",fill:"currentColor"}),(0,q.jsx)("path",{d:"M19 15L19.5 17L21 17.5L19.5 18L19 20L18.5 18L17 17.5L18.5 17L19 15Z",fill:"currentColor"})]}),m=d||"Pro"),t==="admin"&&(p=l||(0,q.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:(0,q.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"})}),m=d||"Admin Pro"),(0,q.jsxs)("div",{className:Ae("moonui-theme",Zir({variant:t,size:r,radius:n}),u&&"mr-0 mb-0",e),"data-removable":i?"":void 0,...f,children:[o&&(0,q.jsx)("span",{className:Ae("h-2 w-2 rounded-full",a||(t==="destructive"||t==="success"||t==="warning"?"bg-white":t==="secondary"?"bg-secondary-foreground":t==="outline"||t==="ghost"?"bg-foreground":t==="pro"||t==="admin"?"bg-white":"bg-primary-foreground")),"aria-hidden":"true"}),p&&(0,q.jsx)("span",{className:"inline-flex shrink-0 items-center",children:p}),(0,q.jsx)("span",{className:"inline-flex items-center",children:m}),c&&(0,q.jsx)("span",{className:"inline-flex shrink-0 items-center",children:c}),i&&s&&(0,q.jsx)("button",{type:"button",className:"ml-1 -mr-1 h-3.5 w-3.5 rounded-full inline-flex items-center justify-center hover:bg-black/10 dark:hover:bg-white/10",onClick:h=>{h.stopPropagation(),s()},"aria-label":"Remove badge",children:(0,q.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"opacity-70","aria-hidden":"true",children:(0,q.jsx)("path",{d:"M0.799988 7.19999L7.19999 0.799988M0.799988 0.799988L7.19999 7.19999",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}var Jir=Hn("flex items-center gap-1.5 text-sm",{variants:{variant:{default:"text-foreground transition-colors",muted:"text-muted-foreground transition-colors",ghost:"text-foreground/60 transition-colors"},size:{default:"text-sm",sm:"text-xs",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),esr=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)("nav",{ref:o,className:Ae("moonui-theme",Jir({variant:t,size:r}),e),"aria-label":"breadcrumb",...n}));esr.displayName="Breadcrumb";var tsr=ee.forwardRef(({className:e,collapsed:t,collapsedWidth:r=3,...n},o)=>{let a=ee.Children.toArray(n.children).filter(Boolean),i=a.length;if(t&&i>r){let s=a[0],l=a.slice(-2);return(0,q.jsxs)("ol",{ref:o,className:Ae("flex flex-wrap items-center gap-1.5 sm:gap-2.5",e),...n,children:[s,(0,q.jsx)(Qtt,{}),l]})}return(0,q.jsx)("ol",{ref:o,className:Ae("flex flex-wrap items-center gap-1.5 sm:gap-2.5",e),...n})});tsr.displayName="BreadcrumbList";var rsr=ee.forwardRef(({className:e,isCurrent:t,href:r,asChild:n=!1,...o},a)=>{let i=n?ee.Fragment:r?"a":"span",s=n?{}:r?{href:r}:{};return(0,q.jsx)("li",{ref:a,className:Ae("moonui-theme","inline-flex items-center gap-1.5",e),"aria-current":t?"page":void 0,...o,children:(0,q.jsx)(i,{className:Ae("transition-colors duration-200 hover:text-foreground",t?"font-medium text-foreground":"text-muted-foreground hover:text-foreground hover:underline hover:underline-offset-4 hover:decoration-muted-foreground/30"),...s,children:o.children})})});rsr.displayName="BreadcrumbItem";var nsr=({children:e,className:t,...r})=>(0,q.jsx)("span",{role:"presentation","aria-hidden":"true",className:Ae("moonui-theme","text-muted-foreground opacity-70",t),...r,children:e||(0,q.jsx)($0,{className:"h-3.5 w-3.5"})});nsr.displayName="BreadcrumbSeparator";var Qtt=({className:e,...t})=>(0,q.jsxs)("span",{role:"presentation","aria-hidden":"true",className:Ae("moonui-theme","flex items-center text-muted-foreground hover:text-foreground/80 transition-colors duration-200",e),...t,children:[(0,q.jsx)(Xy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"More pages"})]});Qtt.displayName="BreadcrumbEllipsis";var osr=ee.forwardRef(({className:e,href:t,...r},n)=>(0,q.jsx)("a",{ref:n,href:t,className:Ae("transition-colors duration-200 hover:text-foreground text-muted-foreground hover:underline hover:underline-offset-4 hover:decoration-muted-foreground/30",e),...r}));osr.displayName="BreadcrumbLink";var asr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("span",{ref:r,className:Ae("font-medium text-foreground dark:text-white dark:text-opacity-95",e),...t}));asr.displayName="BreadcrumbPage";var Ztt=Hn(["inline-flex items-center justify-center gap-2 whitespace-nowrap","font-medium relative","transition-all duration-200 ease-out","transform active:scale-[0.98]","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none disabled:transform-none"],{variants:{variant:{primary:["bg-primary text-primary-foreground","dark:bg-primary dark:text-primary-foreground","hover:bg-primary/90 dark:hover:bg-primary/90","active:bg-primary/80 dark:active:bg-primary/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],secondary:["bg-gray-100 text-gray-900","dark:bg-gray-800 dark:text-gray-100","hover:bg-gray-200 dark:hover:bg-gray-700","active:bg-gray-300 dark:active:bg-gray-600","border border-gray-200 dark:border-gray-700","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","shadow-sm hover:shadow-md"],outline:["bg-background text-foreground","dark:bg-background dark:text-foreground","border border-input dark:border-input","hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground","active:bg-accent/80 dark:active:bg-accent/80","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],ghost:["text-gray-700","dark:text-gray-300","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100","active:bg-gray-200 dark:active:bg-gray-700","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],destructive:["bg-destructive text-destructive-foreground","dark:bg-destructive dark:text-destructive-foreground","hover:bg-destructive/90 dark:hover:bg-destructive/90","active:bg-destructive/80 dark:active:bg-destructive/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],success:["bg-success text-success-foreground","dark:bg-success dark:text-success-foreground","hover:bg-success/90 dark:hover:bg-success/90","active:bg-success/80 dark:active:bg-success/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],link:["text-primary bg-transparent","underline-offset-4 hover:underline","hover:text-primary/80 active:text-primary/70","p-0 h-auto","transition-colors duration-200"],gradient:["bg-gradient-to-r from-purple-500 to-pink-500 text-white","hover:from-purple-600 hover:to-pink-600","active:from-purple-700 active:to-pink-700","shadow-xl shadow-purple-500/40","hover:shadow-2xl hover:shadow-purple-500/50","focus-visible:ring-purple-500/50","transition-all duration-300"],glow:["bg-blue-500 text-white","shadow-[0_0_30px_rgba(59,130,246,0.5)]","hover:shadow-[0_0_40px_rgba(59,130,246,0.7)]","active:shadow-[0_0_20px_rgba(59,130,246,0.4)]","hover:bg-blue-600","focus-visible:ring-blue-500/50","transition-all duration-300"],soft:["bg-primary/10 text-primary","hover:bg-primary/20","active:bg-primary/30","focus-visible:ring-primary/50","dark:bg-primary/20 dark:text-primary-foreground","dark:hover:bg-primary/30 dark:active:bg-primary/40","transition-colors duration-200"],glass:["bg-white/10 backdrop-blur-md text-foreground","border border-white/20","hover:bg-white/20 hover:border-white/30","active:bg-white/30","shadow-lg","focus-visible:ring-white/50","dark:bg-gray-800/10 dark:border-gray-700/20","dark:hover:bg-gray-800/20 dark:hover:border-gray-700/30","transition-all duration-200"],neon:["bg-transparent text-green-400","border-2 border-green-400","hover:bg-green-400 hover:text-gray-900","hover:shadow-[0_0_30px_rgba(74,222,128,0.6)]","active:shadow-[0_0_15px_rgba(74,222,128,0.4)]","focus-visible:ring-green-400/50","transition-all duration-300"]},size:{xs:"h-7 px-2.5 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-base",lg:"h-12 px-6 text-lg",xl:"h-14 px-8 text-xl",icon:"h-10 w-10 p-2","icon-sm":"h-8 w-8 p-1.5","icon-lg":"h-12 w-12 p-3"},rounded:{default:"rounded-xl",full:"rounded-full",none:"rounded-none",sm:"rounded-lg",lg:"rounded-2xl"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md",rounded:"default",fullWidth:!1}}),I8=ee.forwardRef(({className:e,variant:t,size:r,rounded:n,fullWidth:o,asChild:a=!1,loading:i=!1,leftIcon:s,rightIcon:l,children:c,disabled:u,...d},f)=>(0,q.jsxs)("button",{className:Ae("moonui-theme",Ztt({variant:t,size:r,rounded:n,fullWidth:o,className:e})),ref:f,disabled:u||i,"data-loading":i?"":void 0,...d,children:[i&&(0,q.jsx)(Ef,{className:"w-4 h-4 animate-spin","aria-hidden":"true"}),!i&&s,c,!i&&l]}));I8.displayName="Button";Hn("",{variants:{hover:{lift:["transition-all duration-200 ease-out","hover:-translate-y-0.5","hover:shadow-md"],glow:["transition-all duration-300 ease-out","hover:shadow-lg","hover:shadow-primary/20"],scale:["transition-transform duration-200 ease-out","hover:scale-105","active:scale-95"],brightness:["transition-all duration-200 ease-out","hover:brightness-110","active:brightness-95"],border:["transition-all duration-200 ease-out","hover:border-primary/50"]},focus:{ring:["focus:outline-none","focus-visible:ring-2","focus-visible:ring-primary/50","focus-visible:ring-offset-2"],glow:["focus:outline-none","focus-visible:shadow-lg","focus-visible:shadow-primary/30"],border:["focus:outline-none","focus-visible:border-primary","focus-visible:border-2"]},active:{scale:["active:scale-95","transition-transform duration-100"],darken:["active:brightness-90","transition-all duration-100"],depress:["active:translate-y-0.5","active:shadow-sm","transition-all duration-100"]},cursor:{pointer:"cursor-pointer",grab:"cursor-grab active:cursor-grabbing",text:"cursor-text",wait:"cursor-wait",help:"cursor-help",notAllowed:"cursor-not-allowed"}},defaultVariants:{hover:"lift",focus:"ring",active:"scale",cursor:"pointer"}});var x8={smooth:{type:"spring",stiffness:260,damping:20},bouncy:{type:"spring",stiffness:300,damping:15},stiff:{type:"spring",stiffness:400,damping:25},gentle:{type:"spring",stiffness:150,damping:15}},Ode={lift:{y:-2,transition:x8.smooth},scale:{scale:1.05,transition:x8.smooth},glow:{boxShadow:"0 0 20px rgba(var(--primary), 0.3)",transition:x8.smooth},rotate:{rotate:2,transition:x8.bouncy}},isr={scale:{scale:.95,transition:{duration:.1}},depress:{y:1,transition:{duration:.1}}},ssr={initial:{opacity:.5},animate:{opacity:[.5,.8,.5],transition:{duration:1.5,repeat:1/0,ease:"easeInOut"}}},Vtt=Hn("rounded-lg border bg-card text-card-foreground shadow-sm dark:shadow-gray-900/20 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 transition-all duration-200",{variants:{variant:{default:"",outline:"border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",filled:"border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",elevated:"border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",gradient:"border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",glass:"border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"},size:{default:"",sm:"",lg:"",xl:""},radius:{default:"rounded-lg",sm:"rounded-md",lg:"rounded-xl",full:"rounded-3xl",none:"rounded-none"},interactive:{true:"cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",false:""}},defaultVariants:{variant:"default",size:"default",radius:"default"}}),lsr=ee.forwardRef(({className:e,variant:t,size:r,radius:n,interactive:o,microInteraction:a="lift",...i},s)=>{if(o&&a!=="none"){let l={whileHover:a==="scale"?Ode.scale:a==="glow"?Ode.glow:Ode.lift,whileTap:isr.scale};return(0,q.jsx)(Ad.div,{ref:s,className:Ae("moonui-theme",Vtt({variant:t,size:r,radius:n,interactive:o,className:e})),...l,...i})}return(0,q.jsx)("div",{ref:s,className:Ae("moonui-theme",Vtt({variant:t,size:r,radius:n,interactive:o,className:e})),...i})});lsr.displayName="Card";var csr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","flex flex-col space-y-1.5 p-6",e),...t}));csr.displayName="CardHeader";var usr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("h3",{ref:r,className:Ae("moonui-theme","text-lg font-semibold leading-none tracking-tight",e),...t}));usr.displayName="CardTitle";var dsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("p",{ref:r,className:Ae("moonui-theme","text-sm text-muted-foreground",e),...t}));dsr.displayName="CardDescription";var fsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","p-6 pt-0",e),...t}));fsr.displayName="CardContent";var psr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","flex items-center p-6 pt-0",e),...t}));psr.displayName="CardFooter";var msr=e=>{let t={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/};for(let[r,n]of Object.entries(t))if(n.test(e))return r;return"unknown"},Utt=(e,t)=>{let r=e.replace(/\s+/g,""),n=t==="amex"?[4,6,5]:[4,4,4,4],o="",a=0;for(let i of n){if(a>=r.length)break;o&&(o+=" "),o+=r.slice(a,a+i),a+=i}return o},hsr=ee.forwardRef(({className:e,value:t="",onChange:r,showIcon:n=!0,size:o,...a},i)=>{let[s,l]=ee.useState("unknown"),c=u=>{let d=u.target.value.replace(/\D/g,""),f=msr(d);l(f);let p=f==="amex"?15:16,m=d.slice(0,p),h=Utt(m,f);r?.(m,f),u.target.value=h};return(0,q.jsxs)("div",{className:"relative",children:[(0,q.jsx)(JM,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"1234 5678 9012 3456",value:Utt(t,s),onChange:c,className:Ae(n&&"pl-10",e),...a}),n&&(0,q.jsx)(f_,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})});hsr.displayName="CardNumberInput";var gsr=ee.forwardRef(({className:e,value:t="",onChange:r,size:n,...o},a)=>{let i=l=>{let c=l.target.value.replace(/\D/g,"");if(c.length>=2){let d=parseInt(c.slice(0,2));d>12?c="12"+c.slice(2):d===0&&(c="01"+c.slice(2))}c=c.slice(0,4);let u=c;c.length>=2&&(u=c.slice(0,2)+"/"+c.slice(2)),r?.(c),l.target.value=u},s=t.length>=2?t.slice(0,2)+"/"+t.slice(2):t;return(0,q.jsx)(JM,{ref:a,type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:s,onChange:i,className:e,...o})});gsr.displayName="CardExpiryInput";var vsr=ee.forwardRef(({className:e,value:t="",onChange:r,cardType:n="unknown",size:o,...a},i)=>{let s=n==="amex"?4:3;return(0,q.jsx)(JM,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-csc",placeholder:n==="amex"?"1234":"123",value:t,onChange:c=>{let u=c.target.value.replace(/\D/g,"").slice(0,s);r?.(u)},maxLength:s,className:e,...a})});vsr.displayName="CardCVCInput";var ysr=ee.forwardRef(({className:e,value:t="",onChange:r,format:n="US",size:o,...a},i)=>{let s=c=>{let u=c.target.value;switch(n){case"US":u=u.replace(/\D/g,"").slice(0,5);break;case"CA":u=u.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6),u.length>=3&&(u=u.slice(0,3)+" "+u.slice(3));break;case"UK":u=u.toUpperCase().replace(/[^A-Z0-9\s]/g,"").slice(0,8);break;default:u=u.slice(0,10)}r?.(u.replace(/\s/g,"")),c.target.value=u};return(0,q.jsx)(JM,{ref:i,type:"text",autoComplete:"postal-code",placeholder:(()=>{switch(n){case"US":return"12345";case"CA":return"K1A 0B1";case"UK":return"SW1A 1AA";default:return"Postal Code"}})(),value:t,onChange:s,className:e,...a})});ysr.displayName="CardZipInput";var xsr=Hn("peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",{variants:{variant:{default:"border-border bg-background data-[state=checked]:bg-primary data-[state=checked]:border-primary",outline:"border-border bg-transparent data-[state=checked]:bg-primary data-[state=checked]:border-primary",muted:"border-border bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",ghost:"border-transparent bg-transparent hover:bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-sm",md:"rounded-md",full:"rounded-full"},animation:{none:"",subtle:"transition-all duration-200",default:"transition-all duration-200",bounce:"transition-all duration-200"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default"}}),Jtt=ee.forwardRef(({className:e,variant:t,size:r,radius:n,animation:o,indeterminate:a=!1,icon:i,checked:s,...l},c)=>{let[u,d]=ee.useState(a);return ee.useEffect(()=>{d(a)},[a]),(0,q.jsx)(XG,{ref:c,checked:u?!1:s,className:Ae("moonui-theme",xsr({variant:t,size:r,radius:n,animation:o}),e),...l,children:(0,q.jsx)(vue,{className:Ae("flex items-center justify-center text-current",o==="bounce"&&"data-[state=checked]:animate-bounce"),children:u?(0,q.jsx)(b_,{className:"h-[65%] w-[65%]"}):i||(0,q.jsx)(Ky,{className:"h-[65%] w-[65%]"})})})});Jtt.displayName=XG.displayName;var bsr=ee.forwardRef(({className:e,orientation:t="vertical",spacing:r="1rem",children:n,...o},a)=>(0,q.jsx)("div",{ref:a,className:Ae("flex",t==="vertical"?"flex-col":"flex-row flex-wrap",e),style:{gap:r},role:"group",...o,children:n}));bsr.displayName="CheckboxGroup";var Vde=ee.forwardRef(({className:e,htmlFor:t,children:r,position:n="end",disabled:o=!1,...a},i)=>(0,q.jsx)("label",{ref:i,htmlFor:t,className:Ae("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n==="start"?"mr-2":"ml-2",o&&"cursor-not-allowed opacity-70",e),...a,children:r}));Vde.displayName="CheckboxLabel";var wsr=ee.forwardRef(({id:e,label:t,labelPosition:r="end",labelClassName:n,...o},a)=>{let i=ee.useId(),s=e||i;return(0,q.jsxs)("div",{className:"flex items-center",children:[r==="start"&&(0,q.jsx)(Vde,{htmlFor:s,position:"start",disabled:o.disabled,className:n,children:t}),(0,q.jsx)(Jtt,{ref:a,id:s,...o}),r==="end"&&(0,q.jsx)(Vde,{htmlFor:s,position:"end",disabled:o.disabled,className:n,children:t})]})});wsr.displayName="CheckboxWithLabel";function Csr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Ssr(e,t=[]){let r=[];function n(a,i){let s=ee.createContext(i),l=r.length;r=[...r,i];let c=d=>{let{scope:f,children:p,...m}=d,h=f?.[e]?.[l]||s,g=ee.useMemo(()=>m,Object.values(m));return(0,q.jsx)(h.Provider,{value:g,children:p})};c.displayName=a+"Provider";function u(d,f){let p=f?.[e]?.[l]||s,m=ee.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[c,u]}let o=()=>{let a=r.map(i=>ee.createContext(i));return function(s){let l=s?.[e]||a;return ee.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,Psr(o,...t)]}function Psr(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){let i=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(a)[`__scope${c}`];return{...s,...d}},{});return ee.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var zF=globalThis?.document?ee.useLayoutEffect:()=>{},Isr=ee[" useInsertionEffect ".trim().toString()]||zF;function ksr({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=Rsr({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=ee.useRef(e!==void 0);ee.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=ee.useCallback(u=>{if(s){let d=Nsr(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function Rsr({defaultProp:e,onChange:t}){let[r,n]=ee.useState(e),o=ee.useRef(r),a=ee.useRef(t);return Isr(()=>{a.current=t},[t]),ee.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function Nsr(e){return typeof e=="function"}function ztt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Msr(...e){return t=>{let r=!1,n=e.map(o=>{let a=ztt(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){let a=n[o];typeof a=="function"?a():ztt(e[o],null)}}}}function ert(...e){return ee.useCallback(Msr(...e),e)}var Tsr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$de=Tsr.reduce((e,t)=>{let r=Sc(`Primitive.${t}`),n=ee.forwardRef((o,a)=>{let{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,q.jsx)(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Asr(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var trt=e=>{let{present:t,children:r}=e,n=Lsr(t),o=typeof r=="function"?r({present:n.isPresent}):ee.Children.only(r),a=ert(n.ref,Esr(o));return typeof r=="function"||n.isPresent?ee.cloneElement(o,{ref:a}):null};trt.displayName="Presence";function Lsr(e){let[t,r]=ee.useState(),n=ee.useRef(null),o=ee.useRef(e),a=ee.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Asr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ee.useEffect(()=>{let c=b8(n.current);a.current=s==="mounted"?c:"none"},[s]),zF(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=b8(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),zF(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=b8(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=b8(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:ee.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function b8(e){return e?.animationName||"none"}function Esr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Dsr=ee[" useId ".trim().toString()]||(()=>{}),Osr=0;function _sr(e){let[t,r]=ee.useState(Dsr());return zF(()=>{e||r(n=>n??String(Osr++))},[e]),e||(t?`radix-${t}`:"")}var k8="Collapsible",[Fsr,aXn]=Ssr(k8),[Bsr,qde]=Fsr(k8),Vsr=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...s}=e,[l,c]=ksr({prop:n,defaultProp:o??!1,onChange:i,caller:k8});return(0,q.jsx)(Bsr,{scope:r,disabled:a,contentId:_sr(),open:l,onOpenToggle:ee.useCallback(()=>c(u=>!u),[c]),children:(0,q.jsx)($de.div,{"data-state":Gde(l),"data-disabled":a?"":void 0,...s,ref:t})})});Vsr.displayName=k8;var rrt="CollapsibleTrigger",nrt=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,o=qde(rrt,r);return(0,q.jsx)($de.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Gde(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:Csr(e.onClick,o.onOpenToggle)})});nrt.displayName=rrt;var Wde="CollapsibleContent",ort=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=qde(Wde,e.__scopeCollapsible);return(0,q.jsx)(trt,{present:r||o.open,children:({present:a})=>(0,q.jsx)(Usr,{...n,ref:t,present:a})})});ort.displayName=Wde;var Usr=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:o,...a}=e,i=qde(Wde,r),[s,l]=ee.useState(n),c=ee.useRef(null),u=ert(t,c),d=ee.useRef(0),f=d.current,p=ee.useRef(0),m=p.current,h=i.open||s,g=ee.useRef(h),v=ee.useRef(void 0);return ee.useEffect(()=>{let y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),zF(()=>{let y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";let x=y.getBoundingClientRect();d.current=x.height,p.current=x.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(n)}},[i.open,n]),(0,q.jsx)($de.div,{"data-state":Gde(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{["--radix-collapsible-content-height"]:f?`${f}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style},children:h&&o})});function Gde(e){return e?"open":"closed"}var Ude=nrt,art=ort;var Htt=Hn("flex w-full items-center justify-between transition-all",{variants:{variant:{default:"text-foreground hover:text-primary",ghost:"text-foreground hover:bg-accent/10 rounded",outline:"text-foreground border border-border rounded-t-md hover:bg-accent/5"},size:{sm:"text-xs py-2 px-3",default:"text-sm py-3 px-4",md:"text-base py-4 px-4",lg:"text-lg py-5 px-5"}},defaultVariants:{variant:"default",size:"default"}}),zsr=ee.forwardRef(({className:e,children:t,variant:r,size:n,asChild:o,...a},i)=>o?(0,q.jsx)(Ude,{ref:i,className:Ae("moonui-theme",Htt({variant:r,size:n}),e),asChild:o,...a,children:t}):(0,q.jsxs)(Ude,{ref:i,className:Ae("moonui-theme",Htt({variant:r,size:n}),e),...a,children:[t,(0,q.jsx)(j0,{className:"h-4 w-4 shrink-0 ml-auto transition-transform duration-200 [&[data-state=open]]:rotate-180"})]}));zsr.displayName=Ude.displayName;var Hsr=Hn("overflow-hidden transition-all data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",{variants:{variant:{default:"text-muted-foreground",ghost:"text-muted-foreground rounded-b",outline:"text-muted-foreground border border-t-0 border-border rounded-b-md"},size:{sm:"text-xs",default:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{variant:"default",size:"default"}}),jsr=ee.forwardRef(({className:e,children:t,variant:r,size:n,...o},a)=>(0,q.jsx)(art,{ref:a,className:Ae("moonui-theme",Hsr({variant:r,size:n}),e),...o,children:(0,q.jsx)("div",{className:"p-4",children:t})}));jsr.displayName=art.displayName;var $sr=Hn("group relative flex items-center w-full transition-colors",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),qsr=Hn(["w-full bg-background transition-all duration-200","text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:font-medium","focus-visible:outline-none dark:text-gray-200"],{variants:{variant:{standard:"border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-900/60 dark:shadow-inner dark:shadow-gray-950/10",filled:"border border-transparent bg-gray-100 dark:bg-gray-800/90 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700/90 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",ghost:"border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",underline:"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""},hasRightButton:{true:"pr-10",false:""},isError:{true:"border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",false:""},isSuccess:{true:"border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800/50 pointer-events-none",false:""}},defaultVariants:{variant:"standard",size:"md",isError:!1,isSuccess:!1,isDisabled:!1,hasLeftIcon:!1,hasRightIcon:!1,hasRightButton:!1}}),JM=ee.forwardRef(({className:e,wrapperClassName:t,messageClassName:r,variant:n,size:o,isError:a,disabled:i,error:s,success:l,loading:c,leftIcon:u,rightIcon:d,rightButton:f,alwaysShowMessage:p=!1,...m},h)=>{let g=p||s||l,v=s?"error":l?"success":"normal";return(0,q.jsxs)("div",{className:"space-y-1.5 w-full",children:[(0,q.jsxs)("div",{className:Ae("moonui-theme",$sr({size:o}),t),children:[u&&(0,q.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:c?(0,q.jsx)(Ef,{className:"h-4 w-4 animate-spin"}):u}),(0,q.jsx)("input",{className:Ae(qsr({variant:n,size:o,isError:!!s||a,isSuccess:!!l,isDisabled:i||c,hasLeftIcon:!!u||c,hasRightIcon:!!d,hasRightButton:!!f}),e),ref:h,disabled:i||c,"data-loading":c?"":void 0,"data-error":s?"":void 0,"data-success":l?"":void 0,"aria-invalid":!!s||!!a||void 0,"aria-describedby":s?`${m.id||""}-error`:l?`${m.id||""}-success`:void 0,...m}),d&&!c&&(0,q.jsx)("div",{className:"absolute right-3 text-gray-500 flex items-center justify-center pointer-events-none",children:d}),f&&(0,q.jsx)("div",{className:"absolute right-3",children:f}),c&&!u&&(0,q.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:(0,q.jsx)(Ef,{className:"h-4 w-4 animate-spin","aria-hidden":"true"})})]}),g&&(0,q.jsx)("p",{className:Ae("text-xs transition-all",v==="error"&&"text-error",v==="success"&&"text-success",v==="normal"&&"text-muted-foreground",r),id:s?`${m.id||""}-error`:l?`${m.id||""}-success`:void 0,children:s||l||""})]})});JM.displayName="Input";var Wsr=Hn("text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"),Gsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(yue,{ref:r,className:Ae(Wsr(),e),...t}));Gsr.displayName=yue.displayName;var Ksr=Hn("z-50 w-72 rounded-md border border-border bg-background p-4 shadow-md outline-none 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",{variants:{variant:{default:"",destructive:"border-destructive bg-destructive/5",outline:"border-border bg-transparent",subtle:"border-transparent bg-muted/50"},size:{sm:"w-48 p-3",default:"w-72 p-4",lg:"w-96 p-5"},side:{top:"data-[side=top]:slide-in-from-bottom-2",right:"data-[side=right]:slide-in-from-left-2",bottom:"data-[side=bottom]:slide-in-from-top-2",left:"data-[side=left]:slide-in-from-right-2"},position:{pointerEventsNone:"pointer-events-none",default:""},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},shadow:{none:"shadow-none",sm:"shadow-sm",default:"shadow-md",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}},defaultVariants:{variant:"default",size:"default",radius:"default",shadow:"default"}}),Xsr=RZe,Ysr=NZe;var irt=ee.forwardRef(({className:e,variant:t,size:r,side:n,position:o,radius:a,shadow:i,backdrop:s=!1,closeOnInteractOutside:l=!0,overlayBackdrop:c=!1,sideOffset:u=4,...d},f)=>(0,q.jsxs)(q.Fragment,{children:[c&&(0,q.jsx)("div",{className:"fixed inset-0 z-40 bg-overlay opacity-30"}),(0,q.jsx)(bue,{ref:f,sideOffset:u,collisionPadding:8,onInteractOutside:p=>{l||p.preventDefault()},className:Ae(Ksr({variant:t,size:r,side:n,position:o,radius:a,shadow:i}),s&&"backdrop-blur-md bg-opacity-80",e),...d})]}));irt.displayName=bue.displayName;var Qsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","my-2 h-px bg-border",e),...t});Qsr.displayName="PopoverSeparator";var Zsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","-mx-4 -mt-4 mb-3 px-4 pt-4 pb-3 border-b border-border",e),...t});Zsr.displayName="PopoverHeader";var Jsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","-mx-4 -mb-4 mt-3 px-4 pt-3 pb-4 border-t border-border",e),...t});Jsr.displayName="PopoverFooter";var elr=ee.forwardRef(({vertical:e=!1,...t},r)=>(0,q.jsx)(Pue,{ref:r,className:Ae("moonui-theme",t.className),orientation:e?"vertical":"horizontal",...t}));elr.displayName=Pue.displayName;var tlr=Hn("flex items-center justify-start transition-all duration-200",{variants:{variant:{default:"bg-muted rounded-md p-1 text-muted-foreground dark:bg-gray-800/80 dark:text-gray-400",pills:"bg-transparent gap-2 p-0 dark:text-gray-400",underline:"bg-transparent border-b border-border dark:border-gray-700 gap-4 dark:text-gray-400",cards:"bg-transparent gap-2 p-0 dark:text-gray-400",minimal:"bg-transparent gap-1 p-0 dark:text-gray-400"},orientation:{horizontal:"flex-row",vertical:"flex-col items-start gap-1"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",orientation:"horizontal",fullWidth:!1}}),rlr=ee.forwardRef(({className:e,variant:t,orientation:r,fullWidth:n,...o},a)=>(0,q.jsx)(Iue,{ref:a,className:Ae("moonui-theme",tlr({variant:t,orientation:r,fullWidth:n,className:e})),...o}));rlr.displayName=Iue.displayName;var nlr=Hn("inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/10",underline:"rounded-none border-b-2 border-transparent pb-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground dark:data-[state=active]:border-primary/80 dark:data-[state=active]:text-gray-100",pills:"rounded-full bg-muted hover:bg-muted/80 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground dark:bg-gray-800 dark:hover:bg-gray-700 dark:data-[state=active]:bg-primary/90 dark:data-[state=active]:text-white",cards:"rounded-md bg-muted/50 hover:bg-muted data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md dark:bg-gray-800/50 dark:hover:bg-gray-700/50 dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/20",minimal:"rounded-sm bg-transparent hover:bg-muted/30 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:underline data-[state=active]:underline-offset-4 dark:hover:bg-gray-800/30 dark:data-[state=active]:text-gray-200"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-1.5 text-sm",lg:"h-10 px-4 py-2 text-base"},orientation:{horizontal:"",vertical:"justify-start w-full text-left"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",size:"md",orientation:"horizontal",fullWidth:!1}}),olr=ee.forwardRef(({className:e,variant:t,size:r,icon:n,iconPosition:o="left",badge:a,fadeTabs:i=!1,orientation:s,fullWidth:l,children:c,...u},d)=>(0,q.jsxs)(kue,{ref:d,className:Ae("moonui-theme",nlr({variant:t,size:r,orientation:s,fullWidth:l}),i&&"data-[state=inactive]:opacity-60",e),...u,children:[n&&o==="left"&&(0,q.jsx)("span",{className:"mr-2",children:n}),c,n&&o==="right"&&(0,q.jsx)("span",{className:"ml-2",children:n}),a&&(0,q.jsx)("span",{className:"ml-2",children:a})]}));olr.displayName=kue.displayName;var alr=ee.forwardRef(({className:e,animated:t=!1,...r},n)=>(0,q.jsx)(Rue,{ref:n,className:Ae("moonui-theme","mt-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t&&"data-[state=active]:animate-fadeIn data-[state=inactive]:animate-fadeOut",e),...r}));alr.displayName=Rue.displayName;var ilr=Hn("relative flex w-full touch-none select-none items-center",{variants:{size:{sm:"h-5",default:"h-6",md:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),slr=Hn("relative h-1.5 w-full grow overflow-hidden rounded-full",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",accent:"bg-accent/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"}},defaultVariants:{variant:"default"}}),llr=Hn("absolute h-full",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",accent:"bg-accent",success:"bg-success",warning:"bg-warning",error:"bg-error"}},defaultVariants:{variant:"primary"}}),clr=Hn("block rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border-foreground bg-background",primary:"border-primary bg-background",secondary:"border-secondary bg-background",accent:"border-accent bg-background",success:"border-success bg-background",warning:"border-warning bg-background",error:"border-error bg-background"},size:{sm:"h-3 w-3",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"primary",size:"default"}}),ulr=ee.forwardRef(({className:e,size:t,trackVariant:r,rangeVariant:n,thumbVariant:o,thumbSize:a,showValueLabel:i=!1,valueLabelFormat:s,valueLabelClassName:l,value:c,defaultValue:u=[0],onValueChange:d,disabled:f,...p},m)=>{let[h,g]=ee.useState(c||u||[0]);ee.useEffect(()=>{c!==void 0&&g(c)},[c]);let v=T=>s?s(T):`${Math.round(T*100)/100}`,y=(T,A,M)=>(T-A)/(M-A)*100,x=ee.useRef(null),w=p.min||0,b=p.max||100,C=p.step||1,S=T=>{let A=T.map(M=>{if(C<1){let O=C.toString().split(".")[1]?.length||0;return Math.round(M*Math.pow(10,O))/Math.pow(10,O)}return Math.round(M)});g(A),d&&d(A)},P=T=>{if(f)return;let A=x.current;if(!A)return;let M=A.getBoundingClientRect(),O=(T.clientX-M.left)/M.width,F=w+O*(b-w),I=Math.round(F/C)*C,k=Math.max(w,Math.min(b,I)),R=[...h];R[0]=k,S(R)},N=T=>A=>{if(f)return;A.preventDefault();let M=F=>{let I=x.current;if(!I)return;let k=I.getBoundingClientRect(),R=(F.clientX-k.left)/k.width,E=w+R*(b-w),_=Math.round(E/C)*C,U=Math.max(w,Math.min(b,_)),V=[...h];V[T]=U,S(V)},O=()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",M),document.addEventListener("mouseup",O)};return(0,q.jsxs)("div",{className:"w-full",ref:m,...p,children:[i&&(0,q.jsx)("div",{className:Ae("flex justify-end mb-1 text-sm text-muted-foreground",l),children:h.length===1?(0,q.jsx)("span",{children:v(h[0])}):(0,q.jsxs)("span",{children:[v(h[0])," - ",v(h[h.length-1])]})}),(0,q.jsxs)("div",{className:Ae("moonui-theme",ilr({size:t}),e),"data-disabled":f?!0:void 0,children:[(0,q.jsx)("div",{ref:x,className:Ae(slr({variant:r||o||"default"})),onClick:P,children:(0,q.jsx)("div",{className:Ae(llr({variant:n||o||"primary"})),style:{left:"0%",width:`${y(h[0],w,b)}%`}})}),h.map((T,A)=>(0,q.jsx)("div",{className:Ae(clr({variant:o||"primary",size:a})),style:{left:`${y(T,w,b)}%`,transform:"translateX(-50%)",position:"absolute",top:"50%",marginTop:a==="sm"?"-6px":a==="lg"?"-12px":"-8px",cursor:f?"not-allowed":"pointer"},onMouseDown:N(A),"aria-label":`Thumb ${A+1}`,tabIndex:f?-1:0,role:"slider","aria-valuemin":w,"aria-valuemax":b,"aria-valuenow":T,"aria-disabled":f},A))]})]})});ulr.displayName="Slider";var iXn=Hn("relative inline-flex items-center justify-center",{variants:{size:{default:"h-10 w-10",sm:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},shape:{square:"rounded-md",circle:"rounded-full",rounded:"rounded-lg"}},defaultVariants:{size:"default",shape:"square"}});var jtt=1,dlr=.9,flr=.8,plr=.17,_de=.1,Fde=.999,mlr=.9999,hlr=.99,glr=/[\\\/_+.#"@\[\(\{&]/,vlr=/[\\\/_+.#"@\[\(\{&]/g,ylr=/[\s-]/,srt=/[\s-]/g;function zde(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?jtt:hlr;var s=`${o},${a}`;if(i[s]!==void 0)return i[s];for(var l=n.charAt(a),c=r.indexOf(l,o),u=0,d,f,p,m;c>=0;)d=zde(e,t,r,n,c+1,a+1,i),d>u&&(c===o?d*=jtt:glr.test(e.charAt(c-1))?(d*=flr,p=e.slice(o,c-1).match(vlr),p&&o>0&&(d*=Math.pow(Fde,p.length))):ylr.test(e.charAt(c-1))?(d*=dlr,m=e.slice(o,c-1).match(srt),m&&o>0&&(d*=Math.pow(Fde,m.length))):(d*=plr,o>0&&(d*=Math.pow(Fde,c-o))),e.charAt(c)!==t.charAt(a)&&(d*=mlr)),(d<_de&&r.charAt(c-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(c-1)!==n.charAt(a))&&(f=zde(e,t,r,n,c+1,a+2,i),f*_de>d&&(d=f*_de)),d>u&&(u=d),c=r.indexOf(l,c+1);return i[s]=u,u}function $tt(e){return e.toLowerCase().replace(srt," ")}function xlr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,zde(e,t,$tt(e),$tt(t),0,0,{})}var blr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ld=blr.reduce((e,t)=>{let r=Sc(`Primitive.${t}`),n=ee.forwardRef((o,a)=>{let{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,q.jsx)(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),HF=globalThis?.document?ee.useLayoutEffect:()=>{},wlr=ee[" useId ".trim().toString()]||(()=>{}),Clr=0;function YM(e){let[t,r]=ee.useState(wlr());return HF(()=>{e||r(n=>n??String(Clr++))},[e]),e||(t?`radix-${t}`:"")}function qtt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QM(...e){return t=>{let r=!1,n=e.map(o=>{let a=qtt(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){let a=n[o];typeof a=="function"?a():qtt(e[o],null)}}}}function G1(...e){return ee.useCallback(QM(...e),e)}var UF='[cmdk-group=""]',Bde='[cmdk-group-items=""]',Slr='[cmdk-group-heading=""]',lrt='[cmdk-item=""]',Wtt=`${lrt}:not([aria-disabled="true"])`,Hde="cmdk-item-select",KM="data-value",Plr=(e,t,r)=>xlr(e,t,r),crt=ee.createContext(void 0),jF=()=>ee.useContext(crt),urt=ee.createContext(void 0),Kde=()=>ee.useContext(urt),drt=ee.createContext(void 0),frt=ee.forwardRef((e,t)=>{let r=XM(()=>{var L,H;return{search:"",value:(H=(L=e.value)!=null?L:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=XM(()=>new Set),o=XM(()=>new Map),a=XM(()=>new Map),i=XM(()=>new Set),s=prt(e),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=YM(),x=YM(),w=YM(),b=ee.useRef(null),C=Olr();W1(()=>{if(u!==void 0){let L=u.trim();r.current.value=L,S.emit()}},[u]),W1(()=>{C(6,O)},[]);let S=ee.useMemo(()=>({subscribe:L=>(i.current.add(L),()=>i.current.delete(L)),snapshot:()=>r.current,setState:(L,H,j)=>{var $,W,z,G;if(!Object.is(r.current[L],H)){if(r.current[L]=H,L==="search")M(),T(),C(1,A);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(w);X?X.focus():($=document.getElementById(y))==null||$.focus()}if(C(7,()=>{var X;r.current.selectedItemId=(X=F())==null?void 0:X.id,S.emit()}),j||C(5,O),((W=s.current)==null?void 0:W.value)!==void 0){let X=H??"";(G=(z=s.current).onValueChange)==null||G.call(z,X);return}}S.emit()}},emit:()=>{i.current.forEach(L=>L())}}),[]),P=ee.useMemo(()=>({value:(L,H,j)=>{var $;H!==(($=a.current.get(L))==null?void 0:$.value)&&(a.current.set(L,{value:H,keywords:j}),r.current.filtered.items.set(L,N(H,j)),C(2,()=>{T(),S.emit()}))},item:(L,H)=>(n.current.add(L),H&&(o.current.has(H)?o.current.get(H).add(L):o.current.set(H,new Set([L]))),C(3,()=>{M(),T(),r.current.value||A(),S.emit()}),()=>{a.current.delete(L),n.current.delete(L),r.current.filtered.items.delete(L);let j=F();C(4,()=>{M(),j?.getAttribute("id")===L&&A(),S.emit()})}),group:L=>(o.current.has(L)||o.current.set(L,new Set),()=>{a.current.delete(L),o.current.delete(L)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:b}),[]);function N(L,H){var j,$;let W=($=(j=s.current)==null?void 0:j.filter)!=null?$:Plr;return L?W(L,r.current.search,H):0}function T(){if(!r.current.search||s.current.shouldFilter===!1)return;let L=r.current.filtered.items,H=[];r.current.filtered.groups.forEach($=>{let W=o.current.get($),z=0;W.forEach(G=>{let X=L.get(G);z=Math.max(X,z)}),H.push([$,z])});let j=b.current;I().sort(($,W)=>{var z,G;let X=$.getAttribute("id"),Y=W.getAttribute("id");return((z=L.get(Y))!=null?z:0)-((G=L.get(X))!=null?G:0)}).forEach($=>{let W=$.closest(Bde);W?W.appendChild($.parentElement===W?$:$.closest(`${Bde} > *`)):j.appendChild($.parentElement===j?$:$.closest(`${Bde} > *`))}),H.sort(($,W)=>W[1]-$[1]).forEach($=>{var W;let z=(W=b.current)==null?void 0:W.querySelector(`${UF}[${KM}="${encodeURIComponent($[0])}"]`);z?.parentElement.appendChild(z)})}function A(){let L=I().find(j=>j.getAttribute("aria-disabled")!=="true"),H=L?.getAttribute(KM);S.setState("value",H||void 0)}function M(){var L,H,j,$;if(!r.current.search||s.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let W=0;for(let z of n.current){let G=(H=(L=a.current.get(z))==null?void 0:L.value)!=null?H:"",X=($=(j=a.current.get(z))==null?void 0:j.keywords)!=null?$:[],Y=N(G,X);r.current.filtered.items.set(z,Y),Y>0&&W++}for(let[z,G]of o.current)for(let X of G)if(r.current.filtered.items.get(X)>0){r.current.filtered.groups.add(z);break}r.current.filtered.count=W}function O(){var L,H,j;let $=F();$&&(((L=$.parentElement)==null?void 0:L.firstChild)===$&&((j=(H=$.closest(UF))==null?void 0:H.querySelector(Slr))==null||j.scrollIntoView({block:"nearest"})),$.scrollIntoView({block:"nearest"}))}function F(){var L;return(L=b.current)==null?void 0:L.querySelector(`${lrt}[aria-selected="true"]`)}function I(){var L;return Array.from(((L=b.current)==null?void 0:L.querySelectorAll(Wtt))||[])}function k(L){let H=I()[L];H&&S.setState("value",H.getAttribute(KM))}function R(L){var H;let j=F(),$=I(),W=$.findIndex(G=>G===j),z=$[W+L];(H=s.current)!=null&&H.loop&&(z=W+L<0?$[$.length-1]:W+L===$.length?$[0]:$[W+L]),z&&S.setState("value",z.getAttribute(KM))}function E(L){let H=F(),j=H?.closest(UF),$;for(;j&&!$;)j=L>0?Elr(j,UF):Dlr(j,UF),$=j?.querySelector(Wtt);$?S.setState("value",$.getAttribute(KM)):R(L)}let _=()=>k(I().length-1),U=L=>{L.preventDefault(),L.metaKey?_():L.altKey?E(1):R(1)},V=L=>{L.preventDefault(),L.metaKey?k(0):L.altKey?E(-1):R(-1)};return ee.createElement(Ld.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:L=>{var H;(H=v.onKeyDown)==null||H.call(v,L);let j=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||j))switch(L.key){case"n":case"j":{g&&L.ctrlKey&&U(L);break}case"ArrowDown":{U(L);break}case"p":case"k":{g&&L.ctrlKey&&V(L);break}case"ArrowUp":{V(L);break}case"Home":{L.preventDefault(),k(0);break}case"End":{L.preventDefault(),_();break}case"Enter":{L.preventDefault();let $=F();if($){let W=new Event(Hde);$.dispatchEvent(W)}}}}},ee.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Flr},l),R8(e,L=>ee.createElement(urt.Provider,{value:S},ee.createElement(crt.Provider,{value:P},L))))}),Ilr=ee.forwardRef((e,t)=>{var r,n;let o=YM(),a=ee.useRef(null),i=ee.useContext(drt),s=jF(),l=prt(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;W1(()=>{if(!c)return s.item(o,i?.id)},[c]);let u=mrt(o,a,[e.value,e.children,a],e.keywords),d=Kde(),f=gw(C=>C.value&&C.value===u.current),p=gw(C=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);ee.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(Hde,m),()=>C.removeEventListener(Hde,m)},[p,e.onSelect,e.disabled]);function m(){var C,S;h(),(S=(C=l.current).onSelect)==null||S.call(C,u.current)}function h(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:v,onSelect:y,forceMount:x,keywords:w,...b}=e;return ee.createElement(Ld.div,{ref:QM(a,t),...b,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),klr=ee.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=YM(),s=ee.useRef(null),l=ee.useRef(null),c=YM(),u=jF(),d=gw(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);W1(()=>u.group(i),[]),mrt(i,s,[e.value,e.heading,l]);let f=ee.useMemo(()=>({id:i,forceMount:o}),[o]);return ee.createElement(Ld.div,{ref:QM(s,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&ee.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),R8(e,p=>ee.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},ee.createElement(drt.Provider,{value:f},p))))}),Rlr=ee.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=ee.useRef(null),a=gw(i=>!i.search);return!r&&!a?null:ee.createElement(Ld.div,{ref:QM(o,t),...n,"cmdk-separator":"",role:"separator"})}),Nlr=ee.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,a=Kde(),i=gw(c=>c.search),s=gw(c=>c.selectedItemId),l=jF();return ee.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),ee.createElement(Ld.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?e.value:i,onChange:c=>{o||a.setState("search",c.target.value),r?.(c.target.value)}})}),Mlr=ee.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=ee.useRef(null),i=ee.useRef(null),s=gw(c=>c.selectedItemId),l=jF();return ee.useEffect(()=>{if(i.current&&a.current){let c=i.current,u=a.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),ee.createElement(Ld.div,{ref:QM(a,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":n,id:l.listId},R8(e,c=>ee.createElement("div",{ref:QM(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Tlr=ee.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...s}=e;return ee.createElement(gW,{open:r,onOpenChange:n},ee.createElement(Z2,{container:i},ee.createElement(ZN,{"cmdk-overlay":"",className:o}),ee.createElement(JN,{"aria-label":e.label,"cmdk-dialog":"",className:a},ee.createElement(frt,{ref:t,...s}))))}),Alr=ee.forwardRef((e,t)=>gw(r=>r.filtered.count===0)?ee.createElement(Ld.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Llr=ee.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return ee.createElement(Ld.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},R8(e,i=>ee.createElement("div",{"aria-hidden":!0},i)))}),Ed=Object.assign(frt,{List:Mlr,Item:Ilr,Input:Nlr,Group:klr,Separator:Rlr,Dialog:Tlr,Empty:Alr,Loading:Llr});function Elr(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Dlr(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function prt(e){let t=ee.useRef(e);return W1(()=>{t.current=e}),t}var W1=typeof window>"u"?ee.useEffect:ee.useLayoutEffect;function XM(e){let t=ee.useRef();return t.current===void 0&&(t.current=e()),t}function gw(e){let t=Kde(),r=()=>e(t.snapshot());return ee.useSyncExternalStore(t.subscribe,r,r)}function mrt(e,t,r,n=[]){let o=ee.useRef(),a=jF();return W1(()=>{var i;let s=(()=>{var c;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=n.map(c=>c.trim());a.value(e,s,l),(i=t.current)==null||i.setAttribute(KM,s),o.current=s}),o}var Olr=()=>{let[e,t]=ee.useState(),r=XM(()=>new Map);return W1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function _lr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function R8({asChild:e,children:t},r){return e&&ee.isValidElement(t)?ee.cloneElement(_lr(t),{ref:t.ref},r(t.props.children)):r(t)}var Flr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var Blr=Z2;var Vlr=Hn("fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",{variants:{variant:{default:"bg-black/80",subtle:"bg-black/60",blur:"bg-black/40 backdrop-blur-md",minimal:"bg-black/20 backdrop-blur-sm"},animation:{default:"duration-200",slow:"duration-300",fast:"duration-100"}},defaultVariants:{variant:"default",animation:"default"}}),hrt=ee.forwardRef(({className:e,variant:t,animation:r,...n},o)=>(0,q.jsx)(ZN,{ref:o,className:Ae("moonui-theme",Vlr({variant:t,animation:r}),e),...n}));hrt.displayName=ZN.displayName;var Ulr=Hn("fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg",{variants:{variant:{default:"border-gray-200 dark:border-gray-700",primary:"border-primary/20 dark:border-primary/30",secondary:"border-gray-300 dark:border-gray-600",ghost:"border-transparent shadow-xl",destructive:"border-error/20 dark:border-error/30"},size:{xs:"max-w-xs p-4",sm:"max-w-sm p-5",default:"max-w-lg p-6",md:"max-w-md p-6",lg:"max-w-2xl p-7",xl:"max-w-4xl p-8",full:"max-w-[95vw] max-h-[95vh] p-6"},radius:{none:"rounded-none",sm:"rounded-md",default:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},animation:{default:"duration-200 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",fade:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",zoom:"duration-200 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",slide:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",none:""},position:{default:"top-[50%]",top:"top-[5%]",bottom:"bottom-[5%] top-auto translate-y-0"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default",position:"default"}}),zlr=ee.forwardRef(({className:e,children:t,variant:r,size:n,radius:o,animation:a,position:i,overlayVariant:s="default",overlayAnimation:l="default",hideCloseButton:c=!1,title:u,description:d,icon:f,loading:p=!1,success:m=!1,onClose:h,...g},v)=>{let y=()=>{h&&h()};return(0,q.jsxs)(Blr,{children:[(0,q.jsx)(hrt,{variant:s,animation:l,onClick:c?void 0:y}),(0,q.jsxs)(JN,{ref:v,onEscapeKeyDown:c?void 0:y,onInteractOutside:c?void 0:y,className:Ae(Ulr({variant:r,size:n,radius:o,animation:a,position:i}),"outline-none",p&&"pointer-events-none",m&&"border-success/40",e),...g,children:[(u||d||f)&&(0,q.jsxs)(grt,{className:"flex gap-4",children:[(f||p||m)&&(0,q.jsxs)("div",{className:"flex shrink-0 items-center justify-center",children:[p&&(0,q.jsx)(Ef,{className:"h-5 w-5 animate-spin text-primary"}),m&&(0,q.jsx)(Ky,{className:"h-5 w-5 text-success"}),!p&&!m&&f&&(0,q.jsx)("span",{className:"text-primary",children:f})]}),(0,q.jsxs)("div",{className:"flex-1",children:[u&&(0,q.jsx)(vrt,{children:u}),d&&(0,q.jsx)(yrt,{children:d})]})]}),t,!c&&(0,q.jsxs)(t_,{onClick:y,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:ring-offset-2 disabled:pointer-events-none dark:text-gray-300 dark:hover:text-white",children:[(0,q.jsx)(Yy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});zlr.displayName=JN.displayName;var grt=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});grt.displayName="DialogHeader";var Hlr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),...t});Hlr.displayName="DialogFooter";var vrt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(J2,{ref:r,className:Ae("text-xl font-semibold leading-snug tracking-tight dark:text-white",e),...t}));vrt.displayName=J2.displayName;var yrt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(e_,{ref:r,className:Ae("text-sm text-muted-foreground leading-normal dark:text-gray-400",e),...t}));yrt.displayName=e_.displayName;var jlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("form",{ref:r,className:Ae("moonui-theme","flex flex-col gap-4",e),...t}));jlr.displayName="DialogForm";var $lr=Hn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",{variants:{variant:{default:"bg-popover text-popover-foreground",glass:"bg-background/80 text-foreground backdrop-blur-sm",bordered:"bg-popover text-popover-foreground border border-border"},size:{sm:"min-h-[200px]",default:"min-h-[300px]",lg:"min-h-[400px]"}},defaultVariants:{variant:"default",size:"default"}}),qlr=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)(Ed,{ref:o,className:Ae("moonui-theme",$lr({variant:t,size:r}),e),...n}));qlr.displayName=Ed.displayName;var Wlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,q.jsx)(k_,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,q.jsx)(Ed.Input,{ref:r,className:Ae("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Wlr.displayName=Ed.Input.displayName;var Glr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.List,{ref:r,className:Ae("moonui-theme","max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Glr.displayName=Ed.List.displayName;var Klr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Empty,{ref:r,className:Ae("moonui-theme","py-6 text-center text-sm text-muted-foreground",e),...t}));Klr.displayName=Ed.Empty.displayName;var Xlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Group,{ref:r,className:Ae("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Xlr.displayName=Ed.Group.displayName;var Ylr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Separator,{ref:r,className:Ae("moonui-theme","-mx-1 h-px bg-border",e),...t}));Ylr.displayName=Ed.Separator.displayName;var Qlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Item,{ref:r,className:Ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}));Qlr.displayName=Ed.Item.displayName;var Zlr=({className:e,...t})=>(0,q.jsx)("span",{className:Ae("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Zlr.displayName="CommandShortcut";var Jlr=(e,t,r)=>{var n,o;let a=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(a))};Jlr.autoRemove=e=>yh(e);var ecr=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};ecr.autoRemove=e=>yh(e);var tcr=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===r?.toLowerCase()};tcr.autoRemove=e=>yh(e);var rcr=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};rcr.autoRemove=e=>yh(e);var ncr=(e,t,r)=>!r.some(n=>{var o;return!((o=e.getValue(t))!=null&&o.includes(n))});ncr.autoRemove=e=>yh(e)||!(e!=null&&e.length);var ocr=(e,t,r)=>r.some(n=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)});ocr.autoRemove=e=>yh(e)||!(e!=null&&e.length);var acr=(e,t,r)=>e.getValue(t)===r;acr.autoRemove=e=>yh(e);var icr=(e,t,r)=>e.getValue(t)==r;icr.autoRemove=e=>yh(e);var xrt=(e,t,r)=>{let[n,o]=r,a=e.getValue(t);return a>=n&&a<=o};xrt.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(o)?1/0:o;if(a>i){let s=a;a=i,i=s}return[a,i]};xrt.autoRemove=e=>yh(e)||yh(e[0])&&yh(e[1]);function yh(e){return e==null||e===""}var sXn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER};var scr=Hn("w-full caption-bottom text-sm",{variants:{variant:{default:"dark:text-gray-200",bordered:"border border-border dark:border-gray-700",striped:"dark:text-gray-200",card:"border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",minimal:"border-none dark:text-gray-200"},size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),lcr=ee.forwardRef(({className:e,variant:t,size:r,loading:n,emptyContent:o,...a},i)=>{let s=t==="striped",l=ee.Children.map(a.children,c=>{if(ee.isValidElement(c)&&c.type==="tbody"){let u=c.props;return ee.cloneElement(c,{className:Ae(u.className,s&&"even:[&>tr]:bg-muted/50")})}return c});return(0,q.jsxs)("div",{className:"relative w-full overflow-auto",children:[n&&(0,q.jsx)("div",{className:"absolute inset-0 bg-background/60 flex items-center justify-center z-10",children:(0,q.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),(0,q.jsx)("table",{ref:i,className:Ae(scr({variant:t,size:r}),n&&"opacity-70",e),...a,children:l})]})});lcr.displayName="Table";var ccr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("thead",{ref:r,className:Ae("moonui-theme","[&_tr]:border-b",e),...t}));ccr.displayName="TableHeader";var ucr=ee.forwardRef(({className:e,emptyContent:t,emptyMessage:r="No data available",children:n,...o},a)=>{let i=ee.Children.count(n)>0;return(0,q.jsx)("tbody",{ref:a,className:Ae("moonui-theme","[&_tr:last-child]:border-0",e),...o,children:i?n:(0,q.jsx)("tr",{children:(0,q.jsx)("td",{colSpan:100,className:"h-24 text-center",children:t||(0,q.jsx)("div",{className:"py-6 text-muted-foreground",children:(0,q.jsx)("div",{className:"text-sm",children:r})})})})})});ucr.displayName="TableBody";var dcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("tfoot",{ref:r,className:Ae("moonui-theme","bg-primary text-primary-foreground font-medium",e),...t}));dcr.displayName="TableFooter";var fcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("tr",{ref:r,className:Ae("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));fcr.displayName="TableRow";var pcr=ee.forwardRef(({className:e,sortable:t,sorted:r,onSort:n,children:o,...a},i)=>{let s=()=>t?r==="asc"?(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):r==="desc"?(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block opacity-30",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}):null;return(0,q.jsx)("th",{ref:i,className:Ae("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t&&"cursor-pointer hover:text-foreground select-none",e),onClick:t?n:void 0,...a,children:(0,q.jsxs)("div",{className:"flex items-center",children:[o,t&&s()]})})});pcr.displayName="TableHead";var mcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("td",{ref:r,className:Ae("moonui-theme","p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));mcr.displayName="TableCell";var hcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("caption",{ref:r,className:Ae("moonui-theme","mt-4 text-sm text-muted-foreground",e),...t}));hcr.displayName="TableCaption";function gcr({mode:e="single",selected:t,onSelect:r,disabled:n,showOutsideDays:o=!1,className:a,classNames:i,numberOfMonths:s=1,defaultMonth:l,...c}){let[u,d]=ee.useState(l||t&&t||new Date),f=[{short:"S",full:"Sunday"},{short:"M",full:"Monday"},{short:"T",full:"Tuesday"},{short:"W",full:"Wednesday"},{short:"T",full:"Thursday"},{short:"F",full:"Friday"},{short:"S",full:"Saturday"}],p=()=>{d(wJe(u,1))},m=()=>{d(e8(u,1))},h=C=>{if(!n?.(C)){if(e==="single")r?.(C);else if(e==="range"){let S=t;!S?.from||S.from&&S.to?r?.({from:C,to:void 0}):C<S.from?r?.({from:C,to:S.from}):r?.({from:S.from,to:C})}}},g=C=>{if(!t)return!1;if(e==="single")return B1(C,t);if(e==="range"){let S=t;return S.from&&S.to?C>=S.from&&C<=S.to:S.from?B1(C,S.from):!1}return!1},v=C=>{if(e!=="range"||!t)return!1;let S=t;return S.from?B1(C,S.from):!1},y=C=>{if(e!=="range"||!t)return!1;let S=t;return S.to?B1(C,S.to):!1},x=C=>{if(e!=="range"||!t)return!1;let S=t;return!S.from||!S.to?!1:C>S.from&&C<S.to},b=(()=>{let C=ZZe(u),S=QZe(u),P=n8({start:C,end:S}),N=Eue(C),T=[];if(N>0&&o){let F=hh(C),I=new Date(C);I.setDate(I.getDate()-1),T.push(...n8({start:F,end:I}))}let A=Eue(S),M=[];if(A<6&&o){let F=new Date(S);F.setDate(F.getDate()+1);let I=eJe(S);M.push(...n8({start:F,end:I}))}let O=[];if(!o&&N>0)for(let F=0;F<N;F++)O.push(null);return[...T,...O,...P,...M]})();return(0,q.jsxs)("div",{className:Ae("moonui-theme","p-0",a),children:[(0,q.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border/50 dark:border-gray-700/50",children:[(0,q.jsx)("button",{onClick:p,className:Ae("h-10 w-10 bg-transparent p-0 rounded-lg","hover:bg-muted transition-colors","inline-flex items-center justify-center"),type:"button",children:(0,q.jsx)(tM,{className:"h-5 w-5"})}),(0,q.jsx)("h2",{className:"text-base font-medium",children:Lue(u,"MMMM yyyy")}),(0,q.jsx)("button",{onClick:m,className:Ae("h-10 w-10 bg-transparent p-0 rounded-lg","hover:bg-muted transition-colors","inline-flex items-center justify-center"),type:"button",children:(0,q.jsx)($0,{className:"h-5 w-5"})})]}),(0,q.jsxs)("div",{className:"px-6 pb-4",children:[(0,q.jsx)("div",{className:"grid grid-cols-7 mb-2",children:f.map((C,S)=>(0,q.jsx)("div",{className:"text-muted-foreground text-xs font-medium h-10 flex items-center justify-center",title:C.full,children:C.short},`weekday-${S}`))}),(0,q.jsx)("div",{className:"grid grid-cols-7 gap-1",children:b.map((C,S)=>{if(!C)return(0,q.jsx)("div",{className:"h-10 w-10"},`empty-${S}`);let P=!xJe(C,u),N=n?.(C)||!1,T=g(C),A=bJe(C),M=v(C),O=y(C),F=x(C);return(0,q.jsx)("button",{onClick:()=>h(C),disabled:N,className:Ae("h-10 w-10 p-0 font-normal","inline-flex items-center justify-center rounded-lg","hover:bg-muted transition-colors text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",P&&"text-muted-foreground/50",N&&"text-muted-foreground/30 cursor-not-allowed hover:bg-transparent",T&&!F&&"bg-primary text-primary-foreground font-medium hover:bg-primary hover:text-primary-foreground",A&&"font-semibold relative after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:h-1 after:w-1 after:rounded-full after:bg-primary",F&&"bg-accent/30 text-accent-foreground rounded-none",M&&"rounded-r-none",O&&"rounded-l-none"),type:"button",children:Lue(C,"d")},C.toISOString())})})]})]})}gcr.displayName="Calendar";var lXn=Hn("w-full justify-start text-left font-normal",{variants:{variant:{default:"",outline:"border-2",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-sm",lg:"h-12 px-6 text-base",icon:"h-10 w-10"},state:{default:"",error:"border-destructive focus:ring-destructive",success:"border-success focus:ring-success",warning:"border-warning focus:ring-warning"}},defaultVariants:{variant:"default",size:"default",state:"default"}});var vcr=ee.forwardRef(({className:e,inset:t,children:r,...n},o)=>(0,q.jsxs)(Que,{ref:o,className:Ae("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,(0,q.jsx)($0,{className:"ml-auto h-4 w-4"})]}));vcr.displayName=Que.displayName;var ycr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Zue,{ref:r,className:Ae("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),...t}));ycr.displayName=Zue.displayName;var xcr=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>(0,q.jsx)(wet,{children:(0,q.jsx)($ue,{ref:n,sideOffset:t,className:Ae("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),...r})}));xcr.displayName=$ue.displayName;var bcr=ee.forwardRef(({className:e,inset:t,...r},n)=>(0,q.jsx)(Wue,{ref:n,className:Ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));bcr.displayName=Wue.displayName;var wcr=ee.forwardRef(({className:e,children:t,checked:r,...n},o)=>(0,q.jsxs)(Gue,{ref:o,className:Ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(Xue,{children:(0,q.jsx)(Ky,{className:"h-4 w-4"})})}),t]}));wcr.displayName=Gue.displayName;var Ccr=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsxs)(Kue,{ref:n,className:Ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(Xue,{children:(0,q.jsx)(rM,{className:"h-2 w-2 fill-current"})})}),t]}));Ccr.displayName=Kue.displayName;var Scr=ee.forwardRef(({className:e,inset:t,...r},n)=>(0,q.jsx)(que,{ref:n,className:Ae("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Scr.displayName=que.displayName;var Pcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Yue,{ref:r,className:Ae("moonui-theme","-mx-1 my-1 h-px bg-muted",e),...t}));Pcr.displayName=Yue.displayName;var Icr=({className:e,...t})=>(0,q.jsx)("span",{className:Ae("moonui-theme","ml-auto text-xs tracking-widest opacity-60",e),...t});Icr.displayName="DropdownMenuShortcut";var kcr=Hn("relative overflow-hidden bg-muted",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"},size:{xs:"h-1",sm:"h-1.5",default:"h-2",md:"h-2.5",lg:"h-3",xl:"h-4"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},animation:{default:"[&>div]:transition-all [&>div]:duration-500",smooth:"[&>div]:transition-all [&>div]:duration-700",fast:"[&>div]:transition-all [&>div]:duration-300",none:""}},defaultVariants:{variant:"default",size:"default",radius:"full",animation:"default"}}),Rcr=Hn("h-full w-full flex-1",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",error:"bg-error"},animation:{default:"transition-all duration-500",smooth:"transition-all duration-700",fast:"transition-all duration-300",none:""}},defaultVariants:{variant:"primary",animation:"default"}}),brt=ee.forwardRef(({className:e,value:t=0,variant:r,size:n,radius:o,animation:a,indicatorVariant:i,showValueLabel:s=!1,valueLabel:l,labelClassName:c,indeterminate:u=!1,max:d=100,...f},p)=>{let m=Math.max(0,Math.min(t,d)),h=d>0?m/d*100:0,g=l||`${Math.round(h)}%`;return(0,q.jsxs)(q.Fragment,{children:[s&&(0,q.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,q.jsx)("span",{className:Ae("text-sm font-medium text-muted-foreground",c),children:g})}),(0,q.jsx)("div",{ref:p,className:Ae("moonui-theme",kcr({variant:r,size:n,radius:o,animation:a}),e),role:"progressbar","aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":u?void 0:m,...f,children:(0,q.jsx)("div",{className:Ae(Rcr({variant:i||"primary",animation:a}),u&&"animate-indeterminate-progress"),style:u?{}:{transform:`translateX(-${100-h}%)`}})})]})});brt.displayName="Progress";var Ncr=e=>e.startsWith("image/")?(0,q.jsx)(nM,{className:"h-4 w-4"}):e.startsWith("video/")?(0,q.jsx)(A_,{className:"h-4 w-4"}):e.startsWith("audio/")?(0,q.jsx)(w_,{className:"h-4 w-4"}):e.includes("text")||e.includes("document")?(0,q.jsx)(m_,{className:"h-4 w-4"}):(0,q.jsx)(h_,{className:"h-4 w-4"}),jde=e=>{if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]},Mcr=({uploadedFile:e,onRemove:t})=>{let{id:r,file:n,progress:o,status:a,preview:i}=e;return(0,q.jsxs)(Ad.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex items-center space-x-3 p-3 border rounded-lg bg-background",children:[(0,q.jsx)("div",{className:"flex-shrink-0",children:i?(0,q.jsx)("img",{src:i,alt:n.name,className:"h-10 w-10 object-cover rounded"}):(0,q.jsx)("div",{className:"h-10 w-10 rounded bg-muted flex items-center justify-center",children:Ncr(n.type)})}),(0,q.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,q.jsxs)("div",{className:"flex items-center justify-between",children:[(0,q.jsx)("p",{className:"text-sm font-medium truncate",children:n.name}),(0,q.jsx)(I8,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(r),children:(0,q.jsx)(Yy,{className:"h-3 w-3"})})]}),(0,q.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,q.jsx)("p",{className:"text-xs text-muted-foreground",children:jde(n.size)}),a==="uploading"&&(0,q.jsxs)(C8,{variant:"secondary",className:"h-5",children:[(0,q.jsx)(Ef,{className:"h-3 w-3 mr-1 animate-spin"}),"Uploading"]}),a==="success"&&(0,q.jsxs)(C8,{variant:"success",className:"h-5",children:[(0,q.jsx)(q0,{className:"h-3 w-3 mr-1"}),"Done"]}),a==="error"&&(0,q.jsxs)(C8,{variant:"destructive",className:"h-5",children:[(0,q.jsx)(Jg,{className:"h-3 w-3 mr-1"}),"Error"]})]}),a==="uploading"&&(0,q.jsx)("div",{className:"mt-2",children:(0,q.jsx)(brt,{value:o,className:"h-1"})})]})]})},Tcr=Bn.default.forwardRef(({accept:e="*",multiple:t=!0,maxSize:r=10*1024*1024,maxFiles:n=5,disabled:o=!1,className:a,onUpload:i,onRemove:s,children:l,...c},u)=>{let[d,f]=(0,Bn.useState)([]),[p,m]=(0,Bn.useState)(!1),[h,g]=(0,Bn.useState)(null),v=P=>P.size>r?`File size exceeds ${jde(r)}`:e!=="*"&&!e.split(",").some(N=>{let T=N.trim();return T.includes("*")?P.type.startsWith(T.replace("*","")):P.type===T})?"File type not supported":null,y=(0,Bn.useCallback)(async P=>{let N=Array.from(P);if(g(null),d.length+N.length>n){g(`Maximum ${n} files allowed`);return}let T=[],A=[];if(N.forEach(O=>{let F=v(O);F?A.push(`${O.name}: ${F}`):T.push(O)}),A.length>0){g(A.join(", "));return}let M=T.map((O,F)=>({id:`${Date.now()}-${F}-${O.name.replace(/[^a-zA-Z0-9]/g,"")}`,file:O,progress:0,status:"uploading",preview:O.type.startsWith("image/")?URL.createObjectURL(O):void 0}));f(O=>[...O,...M]);for(let O of M){let F=0,I=setInterval(()=>{F+=15+O.file.size%10,F>=100?(F=100,clearInterval(I),f(k=>k.map(R=>R.id===O.id?{...R,progress:100,status:"success"}:R))):f(k=>k.map(R=>R.id===O.id?{...R,progress:F}:R))},200)}if(i)try{await i(T)}catch(O){console.error("Upload failed:",O),f(F=>F.map(I=>M.some(k=>k.id===I.id)?{...I,status:"error"}:I))}},[d.length,n,r,e,i]),x=(0,Bn.useCallback)(P=>{if(P.preventDefault(),m(!1),o)return;let N=P.dataTransfer.files;N.length>0&&y(N)},[y,o]),w=(0,Bn.useCallback)(P=>{P.preventDefault(),o||m(!0)},[o]),b=(0,Bn.useCallback)(P=>{P.preventDefault(),m(!1)},[]),C=(0,Bn.useCallback)(P=>{let N=P.target.files;N&&N.length>0&&y(N),P.target.value=""},[y]),S=(0,Bn.useCallback)(P=>{f(N=>{let T=N.find(A=>A.id===P);return T?.preview&&URL.revokeObjectURL(T.preview),N.filter(A=>A.id!==P)}),s&&s(P)},[s]);return(0,q.jsxs)("div",{ref:u,className:Ae("moonui-theme","space-y-4",a),...c,children:[(0,q.jsxs)(Ad.div,{className:Ae("relative border-2 border-dashed rounded-lg p-8 text-center transition-colors",p&&"border-primary bg-primary/5",o&&"opacity-50 cursor-not-allowed",!o&&"hover:border-primary/50 cursor-pointer"),onDrop:x,onDragOver:w,onDragLeave:b,animate:{scale:p?1.02:1,borderColor:p?"hsl(var(--primary))":"hsl(var(--border))"},children:[(0,q.jsx)("input",{type:"file",accept:e,multiple:t,disabled:o,onChange:C,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),l||(0,q.jsxs)("div",{className:"space-y-4",children:[(0,q.jsx)("div",{className:"mx-auto h-12 w-12 text-muted-foreground",children:(0,q.jsx)(T_,{className:"h-full w-full"})}),(0,q.jsxs)("div",{children:[(0,q.jsx)("p",{className:"text-lg font-medium",children:p?"Drop files here":"Upload files"}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Drag & drop files here, or click to select"}),(0,q.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Max ",n," files, ",jde(r)," each"]})]}),(0,q.jsx)(I8,{variant:"outline",disabled:o,children:"Select Files"})]})]}),(0,q.jsx)(xF,{children:h&&(0,q.jsxs)(Ad.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex items-center space-x-2 text-sm text-destructive",children:[(0,q.jsx)(Jg,{className:"h-4 w-4"}),(0,q.jsx)("span",{children:h})]})}),(0,q.jsx)(xF,{children:d.length>0&&(0,q.jsxs)(Ad.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-2",children:[(0,q.jsxs)("h4",{className:"text-sm font-medium",children:["Uploaded Files (",d.length,")"]}),(0,q.jsx)("div",{className:"space-y-2",children:(0,q.jsx)(xF,{children:d.map(P=>(0,q.jsx)(Mcr,{uploadedFile:P,onRemove:S},P.id))})})]})})]})});Tcr.displayName="FileUpload";var Acr=Bn.default.forwardRef(({children:e,isOpen:t,onOpenChange:r,direction:n="up",threshold:o=50,className:a,overlayClassName:i,enableSwipeToClose:s=!0,...l},c)=>{let u=VM(0),d=VM(0),f=n==="up"||n==="down",p=f?u:d,m=pue(p,[0,o],[1,.5]),h=(y,x)=>{if(!s)return;let w=f?x.offset.y:x.offset.x,b=f?x.velocity.y:x.velocity.x,C=!1;switch(n){case"up":C=w>o||b>500;break;case"down":C=w<-o||b<-500;break;case"left":C=w>o||b>500;break;case"right":C=w<-o||b<-500;break}C?r(!1):hue(p,0,{type:"spring",stiffness:300,damping:20})},g=()=>{switch(n){case"up":return{y:"100%"};case"down":return{y:"-100%"};case"left":return{x:"100%"};case"right":return{x:"-100%"};default:return{y:"100%"}}},v=()=>f?{y:0}:{x:0};return t?(0,q.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,q.jsx)(Ad.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>r(!1),className:Ae("absolute inset-0 bg-black/50",i)}),(0,q.jsxs)(Ad.div,{ref:c,drag:s?f?"y":"x":!1,dragConstraints:{top:n==="up"?0:void 0,bottom:n==="down"?0:void 0,left:n==="left"?0:void 0,right:n==="right"?0:void 0},dragElastic:.2,onDragEnd:h,style:{[f?"y":"x"]:p,opacity:m},initial:g(),animate:v(),exit:g(),transition:{type:"spring",damping:30,stiffness:300},className:Ae("absolute bg-background border shadow-lg",{"bottom-0 left-0 right-0 rounded-t-lg":n==="up","top-0 left-0 right-0 rounded-b-lg":n==="down","top-0 bottom-0 right-0 rounded-l-lg":n==="left","top-0 bottom-0 left-0 rounded-r-lg":n==="right"},a),...l,children:[(n==="up"||n==="down")&&(0,q.jsx)("div",{className:"flex justify-center p-2",children:(0,q.jsx)("div",{className:"w-12 h-1 bg-muted rounded-full"})}),e]})]}):null});Acr.displayName="GestureDrawer";var Lcr=({className:e,...t})=>(0,q.jsx)("nav",{role:"navigation","aria-label":"pagination",className:Ae("moonui-theme","mx-auto flex w-full justify-center",e),...t});Lcr.displayName="Pagination";var Ecr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("ul",{ref:r,className:Ae("moonui-theme","flex flex-row items-center gap-1",e),...t}));Ecr.displayName="PaginationContent";var Dcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("li",{ref:r,className:Ae("moonui-theme","",e),...t}));Dcr.displayName="PaginationItem";var Xde=({className:e,isActive:t,size:r="icon",...n})=>(0,q.jsx)("a",{"aria-current":t?"page":void 0,className:Ae(Ztt({variant:t?"outline":"ghost",size:r}),e),...n});Xde.displayName="PaginationLink";var Ocr=({className:e,...t})=>(0,q.jsxs)(Xde,{"aria-label":"Go to previous page",size:"md",className:Ae("moonui-theme","gap-1 pl-2.5",e),...t,children:[(0,q.jsx)(tM,{className:"h-4 w-4"}),(0,q.jsx)("span",{children:"Previous"})]});Ocr.displayName="PaginationPrevious";var _cr=({className:e,...t})=>(0,q.jsxs)(Xde,{"aria-label":"Go to next page",size:"md",className:Ae("moonui-theme","gap-1 pr-2.5",e),...t,children:[(0,q.jsx)("span",{children:"Next"}),(0,q.jsx)($0,{className:"h-4 w-4"})]});_cr.displayName="PaginationNext";var Fcr=({className:e,...t})=>(0,q.jsxs)("span",{"aria-hidden":!0,className:Ae("moonui-theme","flex h-9 w-9 items-center justify-center",e),...t,children:[(0,q.jsx)(Xy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"More pages"})]});Fcr.displayName="PaginationEllipsis";var Yde=Qet;Yde.displayName="Select";var wrt=Zet,Qde=ee.forwardRef(({className:e,children:t,variant:r="standard",size:n="md",error:o,success:a,loading:i,leftIcon:s,rightIcon:l,...c},u)=>(0,q.jsxs)(sde,{ref:u,className:Ae("flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","focus-visible:outline-none",o&&"border-error focus-visible:ring-error/30 focus-visible:border-error",a&&"border-success focus-visible:ring-success/30 focus-visible:border-success",n==="sm"&&"h-8 text-xs px-2",n==="md"&&"h-10 text-sm px-3",n==="lg"&&"h-12 text-base px-4",r==="standard"&&"border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-900 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="outline"&&"border border-gray-300 dark:border-gray-700 bg-transparent hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="ghost"&&"border-none bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50",r==="underline"&&"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary",e),...c,disabled:c.disabled||i,"data-error":o?!0:void 0,"data-success":a?!0:void 0,"data-loading":i?!0:void 0,children:[(0,q.jsxs)("div",{className:"flex items-center flex-1 gap-2",children:[s&&(0,q.jsx)("span",{className:"flex items-center justify-center text-gray-500 dark:text-gray-400",children:s}),i?(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(Ef,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400"}),(0,q.jsx)("span",{className:"text-muted-foreground dark:text-gray-400",children:"Loading..."})]}):t]}),!i&&(0,q.jsx)(Jet,{asChild:!0,children:l?(0,q.jsx)("span",{className:"opacity-60",children:l}):(0,q.jsx)(j0,{className:"h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180"})})]}));Qde.displayName=sde.displayName;var Crt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(dde,{ref:r,className:Ae("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",e),...t,children:(0,q.jsx)(u_,{className:"h-4 w-4"})}));Crt.displayName=dde.displayName;var Srt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(fde,{ref:r,className:Ae("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",e),...t,children:(0,q.jsx)(j0,{className:"h-4 w-4"})}));Srt.displayName=fde.displayName;var Zde=ee.forwardRef(({className:e,children:t,position:r="popper",side:n="bottom",sideOffset:o=4,align:a="start",...i},s)=>(0,q.jsx)(ett,{children:(0,q.jsxs)(lde,{ref:s,side:n,sideOffset:o,align:a,avoidCollisions:!1,className:Ae(["relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900 text-foreground","shadow-lg dark:shadow-gray-900/20","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-[state=open]:duration-150"],r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...i,children:[(0,q.jsx)(Crt,{}),(0,q.jsx)(ttt,{className:Ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,q.jsx)(Srt,{})]})}));Zde.displayName=lde.displayName;var Bcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(cde,{ref:r,className:Ae("moonui-theme","py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Bcr.displayName=cde.displayName;var tm=ee.forwardRef(({className:e,children:t,variant:r="default",size:n="md",rightIcon:o,customIndicator:a,...i},s)=>(0,q.jsxs)(ude,{ref:s,className:Ae("relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n==="sm"&&"py-1 pl-7 pr-2 text-xs",n==="md"&&"py-1.5 pl-8 pr-2 text-sm",n==="lg"&&"py-2 pl-9 pr-3 text-base",r==="default"&&"focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",r==="subtle"&&"focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",r==="destructive"&&"text-error dark:text-red-400 focus:bg-error/10 dark:focus:bg-red-900/20 focus:text-error dark:focus:text-red-300",r==="success"&&"text-success dark:text-green-400 focus:bg-success/10 dark:focus:bg-green-900/20 focus:text-success dark:focus:text-green-300",r==="warning"&&"text-warning dark:text-yellow-400 focus:bg-warning/10 dark:focus:bg-yellow-900/20 focus:text-warning dark:focus:text-yellow-300",e),...i,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(ntt,{children:a||(0,q.jsx)(Ky,{className:"h-4 w-4"})})}),(0,q.jsx)(rtt,{children:t}),o&&(0,q.jsx)("span",{className:"ml-auto pl-2 opacity-70",children:o})]}));tm.displayName=ude.displayName;var Vcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(pde,{ref:r,className:Ae("moonui-theme","-mx-1 my-1 h-px bg-muted dark:bg-gray-700",e),...t}));Vcr.displayName=pde.displayName;var Ucr=[{code:"+1",country:"US",flag:"\u{1F1FA}\u{1F1F8}",name:"United States"},{code:"+44",country:"GB",flag:"\u{1F1EC}\u{1F1E7}",name:"United Kingdom"},{code:"+49",country:"DE",flag:"\u{1F1E9}\u{1F1EA}",name:"Germany"},{code:"+33",country:"FR",flag:"\u{1F1EB}\u{1F1F7}",name:"France"},{code:"+39",country:"IT",flag:"\u{1F1EE}\u{1F1F9}",name:"Italy"},{code:"+34",country:"ES",flag:"\u{1F1EA}\u{1F1F8}",name:"Spain"},{code:"+31",country:"NL",flag:"\u{1F1F3}\u{1F1F1}",name:"Netherlands"},{code:"+46",country:"SE",flag:"\u{1F1F8}\u{1F1EA}",name:"Sweden"},{code:"+47",country:"NO",flag:"\u{1F1F3}\u{1F1F4}",name:"Norway"},{code:"+45",country:"DK",flag:"\u{1F1E9}\u{1F1F0}",name:"Denmark"},{code:"+358",country:"FI",flag:"\u{1F1EB}\u{1F1EE}",name:"Finland"},{code:"+48",country:"PL",flag:"\u{1F1F5}\u{1F1F1}",name:"Poland"},{code:"+90",country:"TR",flag:"\u{1F1F9}\u{1F1F7}",name:"Turkey"},{code:"+86",country:"CN",flag:"\u{1F1E8}\u{1F1F3}",name:"China"},{code:"+81",country:"JP",flag:"\u{1F1EF}\u{1F1F5}",name:"Japan"},{code:"+82",country:"KR",flag:"\u{1F1F0}\u{1F1F7}",name:"South Korea"},{code:"+91",country:"IN",flag:"\u{1F1EE}\u{1F1F3}",name:"India"},{code:"+61",country:"AU",flag:"\u{1F1E6}\u{1F1FA}",name:"Australia"},{code:"+64",country:"NZ",flag:"\u{1F1F3}\u{1F1FF}",name:"New Zealand"},{code:"+27",country:"ZA",flag:"\u{1F1FF}\u{1F1E6}",name:"South Africa"},{code:"+55",country:"BR",flag:"\u{1F1E7}\u{1F1F7}",name:"Brazil"},{code:"+52",country:"MX",flag:"\u{1F1F2}\u{1F1FD}",name:"Mexico"},{code:"+54",country:"AR",flag:"\u{1F1E6}\u{1F1F7}",name:"Argentina"},{code:"+20",country:"EG",flag:"\u{1F1EA}\u{1F1EC}",name:"Egypt"},{code:"+966",country:"SA",flag:"\u{1F1F8}\u{1F1E6}",name:"Saudi Arabia"},{code:"+971",country:"AE",flag:"\u{1F1E6}\u{1F1EA}",name:"UAE"}],Gtt=(e,t)=>{let r=e.replace(/\D/g,"");switch(t){case"+1":return r.length<=3?r:r.length<=6?`(${r.slice(0,3)}) ${r.slice(3)}`:`(${r.slice(0,3)}) ${r.slice(3,6)}-${r.slice(6,10)}`;case"+44":return r.length<=4?r:r.length<=7?`${r.slice(0,4)} ${r.slice(4)}`:`${r.slice(0,4)} ${r.slice(4,7)} ${r.slice(7,11)}`;case"+90":return r.length<=3?r:r.length<=6?`(${r.slice(0,3)}) ${r.slice(3)}`:r.length<=9?`(${r.slice(0,3)}) ${r.slice(3,6)} ${r.slice(6)}`:`(${r.slice(0,3)}) ${r.slice(3,6)} ${r.slice(6,8)} ${r.slice(8,10)}`;default:let n="";for(let o=0;o<r.length;o++)o>0&&o%3===0&&(n+=" "),n+=r[o];return n}},zcr=e=>{switch(e){case"+1":return 10;case"+44":return 11;case"+90":return 10;default:return 15}},Hcr=ee.forwardRef(({className:e,value:t="",onChange:r,defaultCountry:n="+1",showIcon:o=!0,showCountrySelect:a=!0,countries:i=Ucr,size:s,...l},c)=>{let[u,d]=ee.useState(n),[f,p]=ee.useState(t),m=i.find(y=>y.code===u)||i[0],h=y=>{let x=y.target.value.replace(/\D/g,""),w=zcr(u),b=x.slice(0,w),C=Gtt(b,u);p(b),r?.(b,u),y.target.value=C},g=y=>{d(y),r?.(f,y)},v=Gtt(f,u);return(0,q.jsxs)("div",{className:Ae("relative flex gap-2",e),children:[a&&(0,q.jsxs)(Yde,{value:u,onValueChange:g,children:[(0,q.jsx)(Qde,{className:"w-[120px]",children:(0,q.jsx)(wrt,{children:(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{children:m.flag}),(0,q.jsx)("span",{children:m.code})]})})}),(0,q.jsx)(Zde,{children:i.map(y=>(0,q.jsx)(tm,{value:y.code,children:(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{children:y.flag}),(0,q.jsx)("span",{children:y.code}),(0,q.jsx)("span",{className:"text-muted-foreground",children:y.name})]})},y.code))})]}),(0,q.jsxs)("div",{className:"relative flex-1",children:[(0,q.jsx)(JM,{ref:c,type:"tel",inputMode:"numeric",autoComplete:"tel",placeholder:u==="+1"?"(555) 123-4567":"123 456 789",value:v,onChange:h,className:Ae(o&&"pl-10",e),...l}),o&&(0,q.jsx)(S_,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})]})});Hcr.displayName="PhoneInput";var jcr=Hn("aspect-square border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-border bg-background text-primary",outline:"border-border bg-transparent text-primary",filled:"border-primary bg-primary/10 text-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"default",size:"default"}}),Prt=ee.createContext({}),$cr=ee.forwardRef(({className:e,value:t,onValueChange:r,disabled:n,name:o,...a},i)=>(0,q.jsx)(Prt.Provider,{value:{value:t,onValueChange:r,disabled:n,name:o},children:(0,q.jsx)("div",{ref:i,role:"radiogroup",className:Ae("moonui-theme","grid gap-2",e),...a})}));$cr.displayName="RadioGroup";var Irt=ee.forwardRef(({className:e,variant:t,size:r,indicator:n,id:o,value:a,disabled:i,...s},l)=>{let c=ee.useContext(Prt),u=ee.useId(),d=o||u,f=c.value===a,p=m=>{c.onValueChange&&c.onValueChange(m.target.value),s.onChange&&s.onChange(m)};return(0,q.jsxs)("div",{className:"relative flex items-center",children:[(0,q.jsx)("input",{type:"radio",id:d,ref:l,value:a,checked:f,disabled:i||c.disabled,name:c.name,onChange:p,className:"sr-only",...s}),(0,q.jsx)("label",{htmlFor:d,className:Ae(jcr({variant:t,size:r}),"rounded-full","focus-visible:ring-primary/50","relative inline-flex shrink-0 cursor-pointer items-center justify-center overflow-hidden",i&&"cursor-not-allowed opacity-50",e),children:(0,q.jsx)("span",{className:Ae("absolute inset-0 pointer-events-none",f&&"flex items-center justify-center"),children:f&&(n||(0,q.jsx)(rM,{className:"h-[60%] w-[60%] fill-current text-current"}))})})]})});Irt.displayName="RadioGroupItem";var krt=ee.forwardRef(({className:e,htmlFor:t,children:r,disabled:n=!1,...o},a)=>(0,q.jsx)("label",{ref:a,htmlFor:t,className:Ae("text-sm font-medium leading-none ml-2 text-foreground",n&&"cursor-not-allowed opacity-70",e),...o,children:r}));krt.displayName="RadioLabel";var qcr=ee.forwardRef(({id:e,label:t,labelClassName:r,...n},o)=>{let a=ee.useId(),i=e||a;return(0,q.jsxs)("div",{className:"flex items-center",children:[(0,q.jsx)(Irt,{ref:o,id:i,...n}),(0,q.jsx)(krt,{htmlFor:i,disabled:n.disabled,className:r,children:t})]})});qcr.displayName="RadioItemWithLabel";function Wcr(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var $F=e=>{let{present:t,children:r}=e,n=Gcr(t),o=typeof r=="function"?r({present:n.isPresent}):ee.Children.only(r),a=G1(n.ref,Kcr(o));return typeof r=="function"||n.isPresent?ee.cloneElement(o,{ref:a}):null};$F.displayName="Presence";function Gcr(e){let[t,r]=ee.useState(),n=ee.useRef(null),o=ee.useRef(e),a=ee.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Wcr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ee.useEffect(()=>{let c=w8(n.current);a.current=s==="mounted"?c:"none"},[s]),HF(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=w8(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),HF(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=w8(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=w8(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:ee.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function w8(e){return e?.animationName||"none"}function Kcr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Xcr(e,t=[]){let r=[];function n(a,i){let s=ee.createContext(i),l=r.length;r=[...r,i];let c=d=>{let{scope:f,children:p,...m}=d,h=f?.[e]?.[l]||s,g=ee.useMemo(()=>m,Object.values(m));return(0,q.jsx)(h.Provider,{value:g,children:p})};c.displayName=a+"Provider";function u(d,f){let p=f?.[e]?.[l]||s,m=ee.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[c,u]}let o=()=>{let a=r.map(i=>ee.createContext(i));return function(s){let l=s?.[e]||a;return ee.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,Ycr(o,...t)]}function Ycr(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){let i=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(a)[`__scope${c}`];return{...s,...d}},{});return ee.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function $1(e){let t=ee.useRef(e);return ee.useEffect(()=>{t.current=e}),ee.useMemo(()=>(...r)=>t.current?.(...r),[])}var Qcr=ee.createContext(void 0);function Zcr(e){let t=ee.useContext(Qcr);return e||t||"ltr"}function Jcr(e,[t,r]){return Math.min(r,Math.max(t,e))}function hw(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eur(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var Jde="ScrollArea",[Rrt,cXn]=Xcr(Jde),[tur,rm]=Rrt(Jde),Nrt=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=ee.useState(null),[c,u]=ee.useState(null),[d,f]=ee.useState(null),[p,m]=ee.useState(null),[h,g]=ee.useState(null),[v,y]=ee.useState(0),[x,w]=ee.useState(0),[b,C]=ee.useState(!1),[S,P]=ee.useState(!1),N=G1(t,A=>l(A)),T=Zcr(o);return(0,q.jsx)(tur,{scope:r,type:n,dir:T,scrollHideDelay:a,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:b,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:S,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:w,children:(0,q.jsx)(Ld.div,{dir:T,...i,ref:N,style:{position:"relative",["--radix-scroll-area-corner-width"]:v+"px",["--radix-scroll-area-corner-height"]:x+"px",...e.style}})})});Nrt.displayName=Jde;var Mrt="ScrollAreaViewport",Trt=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:n,nonce:o,...a}=e,i=rm(Mrt,r),s=ee.useRef(null),l=G1(t,s,i.onViewportChange);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,q.jsx)(Ld.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,q.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Trt.displayName=Mrt;var sv="ScrollAreaScrollbar",efe=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s=e.orientation==="horizontal";return ee.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),o.type==="hover"?(0,q.jsx)(rur,{...n,ref:t,forceMount:r}):o.type==="scroll"?(0,q.jsx)(nur,{...n,ref:t,forceMount:r}):o.type==="auto"?(0,q.jsx)(Art,{...n,ref:t,forceMount:r}):o.type==="always"?(0,q.jsx)(tfe,{...n,ref:t}):null});efe.displayName=sv;var rur=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),[a,i]=ee.useState(!1);return ee.useEffect(()=>{let s=o.scrollArea,l=0;if(s){let c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),(0,q.jsx)($F,{present:r||a,children:(0,q.jsx)(Art,{"data-state":a?"visible":"hidden",...n,ref:t})})}),nur=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),a=e.orientation==="horizontal",i=M8(()=>l("SCROLL_END"),100),[s,l]=eur("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return ee.useEffect(()=>{if(s==="idle"){let c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),ee.useEffect(()=>{let c=o.viewport,u=a?"scrollLeft":"scrollTop";if(c){let d=c[u],f=()=>{let p=c[u];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,a,l,i]),(0,q.jsx)($F,{present:r||s!=="hidden",children:(0,q.jsx)(tfe,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:hw(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:hw(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Art=ee.forwardRef((e,t)=>{let r=rm(sv,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=ee.useState(!1),s=e.orientation==="horizontal",l=M8(()=>{if(r.viewport){let c=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;i(s?c:u)}},10);return ZM(r.viewport,l),ZM(r.content,l),(0,q.jsx)($F,{present:n||a,children:(0,q.jsx)(tfe,{"data-state":a?"visible":"hidden",...o,ref:t})})}),tfe=ee.forwardRef((e,t)=>{let{orientation:r="vertical",...n}=e,o=rm(sv,e.__scopeScrollArea),a=ee.useRef(null),i=ee.useRef(0),[s,l]=ee.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=_rt(s.viewport,s.content),u={...n,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,p){return cur(f,i.current,s,p)}return r==="horizontal"?(0,q.jsx)(our,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollLeft,p=Ktt(f,s,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,q.jsx)(aur,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollTop,p=Ktt(f,s);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),our=ee.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rm(sv,e.__scopeScrollArea),[i,s]=ee.useState(),l=ee.useRef(null),c=G1(t,l,a.onScrollbarXChange);return ee.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,q.jsx)(Ert,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:N8(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),Brt(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:P8(i.paddingLeft),paddingEnd:P8(i.paddingRight)}})}})}),aur=ee.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rm(sv,e.__scopeScrollArea),[i,s]=ee.useState(),l=ee.useRef(null),c=G1(t,l,a.onScrollbarYChange);return ee.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,q.jsx)(Ert,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:N8(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),Brt(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:P8(i.paddingTop),paddingEnd:P8(i.paddingBottom)}})}})}),[iur,Lrt]=Rrt(sv),Ert=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=rm(sv,r),[m,h]=ee.useState(null),g=G1(t,N=>h(N)),v=ee.useRef(null),y=ee.useRef(""),x=p.viewport,w=n.content-n.viewport,b=$1(u),C=$1(l),S=M8(d,10);function P(N){if(v.current){let T=N.clientX-v.current.left,A=N.clientY-v.current.top;c({x:T,y:A})}}return ee.useEffect(()=>{let N=T=>{let A=T.target;m?.contains(A)&&b(T,w)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,m,w,b]),ee.useEffect(C,[n,C]),ZM(m,S),ZM(p.content,S),(0,q.jsx)(iur,{scope:r,scrollbar:m,hasThumb:o,onThumbChange:$1(a),onThumbPointerUp:$1(i),onThumbPositionChange:C,onThumbPointerDown:$1(s),children:(0,q.jsx)(Ld.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:hw(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(N))}),onPointerMove:hw(e.onPointerMove,P),onPointerUp:hw(e.onPointerUp,N=>{let T=N.target;T.hasPointerCapture(N.pointerId)&&T.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),S8="ScrollAreaThumb",Drt=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=Lrt(S8,e.__scopeScrollArea);return(0,q.jsx)($F,{present:r||o.hasThumb,children:(0,q.jsx)(sur,{ref:t,...n})})}),sur=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:n,...o}=e,a=rm(S8,r),i=Lrt(S8,r),{onThumbPositionChange:s}=i,l=G1(t,d=>i.onThumbChange(d)),c=ee.useRef(void 0),u=M8(()=>{c.current&&(c.current(),c.current=void 0)},100);return ee.useEffect(()=>{let d=a.viewport;if(d){let f=()=>{if(u(),!c.current){let p=uur(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[a.viewport,u,s]),(0,q.jsx)(Ld.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:hw(e.onPointerDownCapture,d=>{let p=d.target.getBoundingClientRect(),m=d.clientX-p.left,h=d.clientY-p.top;i.onThumbPointerDown({x:m,y:h})}),onPointerUp:hw(e.onPointerUp,i.onThumbPointerUp)})});Drt.displayName=S8;var rfe="ScrollAreaCorner",Ort=ee.forwardRef((e,t)=>{let r=rm(rfe,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?(0,q.jsx)(lur,{...e,ref:t}):null});Ort.displayName=rfe;var lur=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,...n}=e,o=rm(rfe,r),[a,i]=ee.useState(0),[s,l]=ee.useState(0),c=!!(a&&s);return ZM(o.scrollbarX,()=>{let u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),ZM(o.scrollbarY,()=>{let u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?(0,q.jsx)(Ld.div,{...n,ref:t,style:{width:a,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function P8(e){return e?parseInt(e,10):0}function _rt(e,t){let r=e/t;return isNaN(r)?0:r}function N8(e){let t=_rt(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function cur(e,t,r,n="ltr"){let o=N8(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return Frt([l,c],d)(e)}function Ktt(e,t,r="ltr"){let n=N8(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=r==="ltr"?[0,i]:[i*-1,0],c=Jcr(e,l);return Frt([0,i],[0,s])(c)}function Frt(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Brt(e,t){return e>0&&e<t}var uur=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){let a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function M8(e,t){let r=$1(e),n=ee.useRef(0);return ee.useEffect(()=>()=>window.clearTimeout(n.current),[]),ee.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ZM(e,t){let r=$1(t);HF(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Vrt=Nrt,dur=Trt,fur=Ort,pur=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsxs)(Vrt,{ref:n,className:Ae("relative overflow-hidden",e),...r,children:[(0,q.jsx)(dur,{className:"h-full w-full rounded-[inherit]",children:t}),(0,q.jsx)(Urt,{}),(0,q.jsx)(fur,{})]}));pur.displayName=Vrt.displayName;var Urt=ee.forwardRef(({className:e,orientation:t="vertical",...r},n)=>(0,q.jsx)(efe,{ref:n,orientation:t,className:Ae("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,q.jsx)(Drt,{className:"relative flex-1 rounded-full bg-border"})}));Urt.displayName=efe.displayName;var mur=Hn("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"},variant:{default:"bg-border",dashed:"border-dashed border-border bg-transparent",dotted:"border-dotted border-border bg-transparent",gradient:"bg-gradient-to-r from-transparent via-border to-transparent"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",variant:"dashed",className:"border-t h-0"},{orientation:"vertical",variant:"dashed",className:"border-l w-0"},{orientation:"horizontal",variant:"dotted",className:"border-t h-0"},{orientation:"vertical",variant:"dotted",className:"border-l w-0"},{orientation:"horizontal",size:"sm",variant:["dashed","dotted"],className:"border-t-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["dashed","dotted"],className:"border-t-2"},{orientation:"vertical",size:"sm",variant:["dashed","dotted"],className:"border-l-[0.5px]"},{orientation:"vertical",size:"lg",variant:["dashed","dotted"],className:"border-l-2"},{orientation:"horizontal",size:"sm",variant:["default","gradient"],className:"h-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["default","gradient"],className:"h-[2px]"},{orientation:"vertical",size:"sm",variant:["default","gradient"],className:"w-[0.5px]"},{orientation:"vertical",size:"lg",variant:["default","gradient"],className:"w-[2px]"}],defaultVariants:{orientation:"horizontal",variant:"default",size:"md"}}),iv=ee.forwardRef(({className:e,orientation:t="horizontal",variant:r="default",size:n="md",decorative:o=!0,...a},i)=>(0,q.jsx)(mde,{ref:i,decorative:o,orientation:t||void 0,className:Ae(mur({orientation:t,variant:r,size:n}),e),...a}));iv.displayName=mde.displayName;var hur=ee[" useInsertionEffect ".trim().toString()]||HF;function gur({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=vur({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=ee.useRef(e!==void 0);ee.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=ee.useCallback(u=>{if(s){let d=yur(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function vur({defaultProp:e,onChange:t}){let[r,n]=ee.useState(e),o=ee.useRef(r),a=ee.useRef(t);return hur(()=>{a.current=t},[t]),ee.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function yur(e){return typeof e=="function"}var zrt="Toggle",Hrt=ee.forwardRef((e,t)=>{let{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,s]=gur({prop:r,onChange:o,defaultProp:n??!1,caller:zrt});return(0,q.jsx)(Ld.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:hw(e.onClick,()=>{e.disabled||s(!i)})})});Hrt.displayName=zrt;var jrt=Hrt,xur=Hn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),$rt=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)(jrt,{ref:o,className:Ae("moonui-theme",xur({variant:t,size:r,className:e})),...n}));$rt.displayName=jrt.displayName;var bur=gtt,wur=Hn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500 text-white border-green-600",warning:"bg-yellow-500 text-white border-yellow-600",destructive:"bg-destructive text-destructive-foreground",info:"bg-blue-500 text-white border-blue-600"},size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{variant:"default",size:"md"}}),qrt=vtt,Wrt=ytt,Grt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(bde,{ref:r,className:Ae("moonui-theme","fill-current",e),...t}));Grt.displayName=bde.displayName;var nfe=ee.forwardRef(({className:e,variant:t,size:r,showArrow:n=!1,sideOffset:o=4,...a},i)=>(0,q.jsxs)(xde,{ref:i,sideOffset:o,className:Ae("moonui-theme",wur({variant:t,size:r}),e),...a,children:[a.children,n&&(0,q.jsx)(Grt,{})]}));nfe.displayName=xde.displayName;var Cur=ee.forwardRef(({children:e,content:t,variant:r="default",size:n="md",side:o="top",align:a="center",delayDuration:i=400,sideOffset:s=4,showArrow:l=!1,className:c,open:u,defaultOpen:d,onOpenChange:f,...p},m)=>(0,q.jsxs)(qrt,{open:u,defaultOpen:d,onOpenChange:f,delayDuration:i,children:[(0,q.jsx)(Wrt,{asChild:!0,children:e}),(0,q.jsx)(nfe,{ref:m,side:o,align:a,variant:r,size:n,sideOffset:s,showArrow:l,className:c,...p,children:t})]}));Cur.displayName="SimpleTooltip";var ul=({icon:e,tooltip:t,active:r,onClick:n,disabled:o})=>(0,q.jsxs)(qrt,{children:[(0,q.jsx)(Wrt,{asChild:!0,children:(0,q.jsx)($rt,{pressed:r,onPressedChange:()=>n(),disabled:o,className:"h-8 w-8 p-0",children:e})}),(0,q.jsx)(nfe,{children:(0,q.jsx)("p",{children:t})})]}),Sur=({onColorSelect:e})=>(0,q.jsx)("div",{className:"grid grid-cols-4 gap-1 p-2",children:["#000000","#374151","#6B7280","#9CA3AF","#EF4444","#F59E0B","#EAB308","#22C55E","#3B82F6","#6366F1","#8B5CF6","#EC4899"].map(r=>(0,q.jsx)("button",{className:"w-6 h-6 rounded border-2 border-gray-200 hover:border-gray-400",style:{backgroundColor:r},onClick:()=>e(r)},r))}),Pur=Bn.default.forwardRef(({value:e="",onChange:t,placeholder:r="Start writing...",disabled:n=!1,className:o,minHeight:a=200,maxHeight:i=500,showToolbar:s=!0,showPreview:l=!0,...c},u)=>{let[d,f]=(0,Bn.useState)(e),[p,m]=(0,Bn.useState)(!1),[h,g]=(0,Bn.useState)(e);(0,Bn.useState)(null);let v=Bn.default.useRef(null),y=Bn.default.useRef(null),[x,w]=(0,Bn.useState)({bold:!1,italic:!1,underline:!1,strikethrough:!1,alignLeft:!0,alignCenter:!1,alignRight:!1,alignJustify:!1,orderedList:!1,unorderedList:!1,quote:!1,code:!1}),b=(0,Bn.useCallback)(I=>{f(I),t?.(I)},[t]),C=(0,Bn.useCallback)(()=>{let I=window.getSelection();return I&&I.rangeCount>0?I.getRangeAt(0):null},[]);(0,Bn.useCallback)(I=>{if(!I)return;let k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(I))},[]);let S=(0,Bn.useCallback)((I,k)=>{if(n)return;if(v.current&&v.current.focus(),C(),document.execCommand(I,!1,k)||console.warn(`Command '${I}' failed to execute`),v.current){let E=v.current.innerHTML;b(E)}w({bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),strikethrough:document.queryCommandState("strikeThrough"),alignLeft:document.queryCommandState("justifyLeft"),alignCenter:document.queryCommandState("justifyCenter"),alignRight:document.queryCommandState("justifyRight"),alignJustify:document.queryCommandState("justifyFull"),orderedList:document.queryCommandState("insertOrderedList"),unorderedList:document.queryCommandState("insertUnorderedList"),quote:document.queryCommandState("formatBlock"),code:document.queryCommandState("formatBlock")}),v.current&&v.current.focus()},[n,C,b]),P=(0,Bn.useCallback)(I=>{let k=I.currentTarget.innerHTML;b(k)},[b]),N=(0,Bn.useCallback)(I=>{if(I.ctrlKey||I.metaKey)switch(I.key){case"b":I.preventDefault(),S("bold");break;case"i":I.preventDefault(),S("italic");break;case"u":I.preventDefault(),S("underline");break;case"z":I.preventDefault(),I.shiftKey?S("redo"):S("undo");break}I.key==="Tab"&&(I.preventDefault(),S("insertHTML"," "))},[S]),T=(0,Bn.useCallback)(()=>{let I=prompt("Enter URL:");I&&S("createLink",I)},[S]),A=(0,Bn.useCallback)(()=>{let I=prompt("Enter image URL:");I&&S("insertImage",I)},[S]),M=(0,Bn.useCallback)(I=>{S("formatBlock",`<h${I}>`)},[S]),O=(0,Bn.useCallback)(I=>{let k=window.getSelection();if(k&&k.rangeCount>0){let R=k.getRangeAt(0),E=document.createElement("span");E.style.color=I;try{R.surroundContents(E)}catch{S("foreColor",I)}if(v.current){let _=v.current.innerHTML;b(_)}}},[S,b]);Bn.default.useEffect(()=>{v.current&&d&&d!==v.current.innerHTML&&(v.current.innerHTML=d)},[d]),Bn.default.useEffect(()=>{e!==void 0&&e!==d&&(f(e),g(e))},[e,d]);let F=s&&(0,q.jsx)(bur,{children:(0,q.jsxs)(Ad.div,{className:"flex items-center gap-1 p-2 border-b bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[!p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(c_,{className:"h-3 w-3"}),tooltip:"Bold (Ctrl+B)",active:x.bold,onClick:()=>S("bold"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(g_,{className:"h-3 w-3"}),tooltip:"Italic (Ctrl+I)",active:x.italic,onClick:()=>S("italic"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(N_,{className:"h-3 w-3"}),tooltip:"Underline (Ctrl+U)",active:x.underline,onClick:()=>S("underline"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(R_,{className:"h-3 w-3"}),tooltip:"Strikethrough",active:x.strikethrough,onClick:()=>S("strikeThrough"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)(Yde,{onValueChange:I=>{I.startsWith("h")?M(I.substring(1)):I==="normal"?S("formatBlock","p"):S("fontSize",I)},disabled:n,children:[(0,q.jsx)(Qde,{className:"w-24 h-8",children:(0,q.jsx)(wrt,{placeholder:"Size"})}),(0,q.jsxs)(Zde,{children:[(0,q.jsx)(tm,{value:"1",children:"Small"}),(0,q.jsx)(tm,{value:"3",children:"Normal"}),(0,q.jsx)(tm,{value:"5",children:"Large"}),(0,q.jsx)(tm,{value:"7",children:"X-Large"}),(0,q.jsx)(iv,{className:"my-1"}),(0,q.jsx)(tm,{value:"h1",children:"Heading 1"}),(0,q.jsx)(tm,{value:"h2",children:"Heading 2"}),(0,q.jsx)(tm,{value:"h3",children:"Heading 3"}),(0,q.jsx)(tm,{value:"h4",children:"Heading 4"}),(0,q.jsx)(tm,{value:"h5",children:"Heading 5"}),(0,q.jsx)(tm,{value:"h6",children:"Heading 6"})]})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(s_,{className:"h-3 w-3"}),tooltip:"Align Left",active:x.alignLeft,onClick:()=>S("justifyLeft"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(a_,{className:"h-3 w-3"}),tooltip:"Align Center",active:x.alignCenter,onClick:()=>S("justifyCenter"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(l_,{className:"h-3 w-3"}),tooltip:"Align Right",active:x.alignRight,onClick:()=>S("justifyRight"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(i_,{className:"h-3 w-3"}),tooltip:"Justify",active:x.alignJustify,onClick:()=>S("justifyFull"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(x_,{className:"h-3 w-3"}),tooltip:"Bullet List",active:x.unorderedList,onClick:()=>S("insertUnorderedList"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(y_,{className:"h-3 w-3"}),tooltip:"Numbered List",active:x.orderedList,onClick:()=>S("insertOrderedList"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(P_,{className:"h-3 w-3"}),tooltip:"Quote",active:x.quote,onClick:()=>S("formatBlock","blockquote"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(d_,{className:"h-3 w-3"}),tooltip:"Code Block",active:x.code,onClick:()=>S("formatBlock","pre"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)("span",{className:"text-xs font-mono",children:"\u2190"}),tooltip:"Decrease Indent",onClick:()=>S("outdent"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)("span",{className:"text-xs font-mono",children:"\u2192"}),tooltip:"Increase Indent",onClick:()=>S("indent"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(v_,{className:"h-3 w-3"}),tooltip:"Insert Link",onClick:T,disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(nM,{className:"h-3 w-3"}),tooltip:"Insert Image",onClick:A,disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)(Xsr,{children:[(0,q.jsx)(Ysr,{asChild:!0,children:(0,q.jsx)(I8,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:n,title:"Text Color",children:(0,q.jsx)(C_,{className:"h-3 w-3"})})}),(0,q.jsx)(irt,{className:"w-auto p-0",children:(0,q.jsx)(Sur,{onColorSelect:O})})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(M_,{className:"h-3 w-3"}),tooltip:"Undo (Ctrl+Z)",onClick:()=>S("undo"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(I_,{className:"h-3 w-3"}),tooltip:"Redo (Ctrl+Shift+Z)",onClick:()=>S("redo"),disabled:n})]})]}),l&&(0,q.jsxs)(q.Fragment,{children:[!p&&(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsx)(ul,{icon:p?(0,q.jsx)(kd,{className:"h-3 w-3"}):(0,q.jsx)(p_,{className:"h-3 w-3"}),tooltip:p?"Edit Mode":"View Source Code",active:p,onClick:()=>{p?b(h):g(d),m(!p)},disabled:n})]})]})});return(0,q.jsxs)("div",{ref:u,className:Ae("border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",n&&"opacity-50 cursor-not-allowed",o),...c,children:[F,(0,q.jsxs)("div",{className:"relative",children:[p?(0,q.jsx)(Ad.div,{initial:{opacity:0},animate:{opacity:1},className:"bg-slate-50 dark:bg-zinc-900/95",style:{minHeight:a,maxHeight:i,overflow:"auto"},children:(0,q.jsx)("textarea",{ref:y,value:h,onChange:I=>g(I.target.value),className:"w-full h-full bg-transparent p-4 font-mono text-sm text-gray-900 dark:text-gray-100 resize-none focus:outline-none",style:{minHeight:a-32},disabled:n,placeholder:"HTML source code..."})}):(0,q.jsx)(Ad.div,{ref:v,contentEditable:!n,suppressContentEditableWarning:!0,className:Ae("p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto","bg-slate-50 dark:bg-zinc-900/95","text-gray-900 dark:text-gray-100","focus:ring-0","[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4","[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3","[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2","[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2","[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1","[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1","[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4","[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4","[&_li]:mb-1","[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic","[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"),style:{minHeight:a,maxHeight:i},onInput:P,onKeyDown:N,"data-placeholder":r,initial:{opacity:0},animate:{opacity:1}}),!d&&!p&&(0,q.jsx)("div",{className:"absolute top-4 left-4 text-muted-foreground pointer-events-none",style:{fontSize:"16px"},children:r})]}),(0,q.jsx)("div",{className:"px-4 py-2 border-t bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm text-xs text-gray-600 dark:text-gray-400",children:(0,q.jsx)(Iur,{content:d})})]})});Pur.displayName="SimpleEditor";var Iur=({content:e})=>{let[t,r]=(0,Bn.useState)(0);return(0,Bn.useEffect)(()=>{r((o=>{let a=document.createElement("div");return a.innerHTML=o,a.textContent||a.innerText||""})(e).length)},[e]),(0,q.jsxs)(q.Fragment,{children:[t," characters"]})},kur=Hn("animate-pulse rounded-md",{variants:{variant:{default:"bg-muted",primary:"bg-primary/10",secondary:"bg-secondary/10",accent:"bg-accent"},size:{default:"",sm:"scale-90",lg:"scale-110"},shape:{rect:"rounded-md",circle:"rounded-full",pill:"rounded-full"},animation:{pulse:"animate-pulse",wave:"overflow-hidden relative after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_2s_infinite] after:bg-gradient-to-r after:from-transparent after:via-white/10 after:to-transparent dark:after:via-white/5",none:"animate-none"}},defaultVariants:{variant:"default",size:"default",shape:"rect",animation:"pulse"}}),q1=ee.forwardRef(({className:e,variant:t,size:r,shape:n,animation:o,height:a,width:i,isLoaded:s=!1,children:l,fadeInDuration:c=400,motion:u=!1,style:d,...f},p)=>{let{onDrag:m,onDragEnd:h,onDragStart:g,onAnimationStart:v,onAnimationEnd:y,onAnimationIteration:x,...w}=f;if(s&&l)return u?(0,q.jsx)(Ad.div,{ref:p,initial:{opacity:0},animate:{opacity:1},transition:{duration:c/1e3},className:Ae("moonui-theme",e),style:{height:a,width:i,...d},...w,children:l}):(0,q.jsx)("div",{ref:p,className:Ae("moonui-theme","animate-fade-in",e),style:{animationDuration:`${c}ms`,height:a,width:i,...d},...f,children:l});let b=u?Ad.div:"div";return(0,q.jsx)(b,{ref:p,className:Ae("moonui-theme",kur({variant:t,size:r,shape:n,animation:o}),"relative isolate",e),style:{height:a,width:i,...d},...u?ssr:{},...w})});q1.displayName="Skeleton";var Krt=ee.forwardRef(({className:e,lines:t=3,lineHeight:r="0.85rem",spacing:n="0.5rem",lastLineWidth:o=80,randomWidths:a=!1,variant:i="default",animation:s="pulse",...l},c)=>(0,q.jsx)("div",{ref:c,className:Ae("moonui-theme","flex flex-col",e),style:{gap:n},...l,children:Array.from({length:t}).map((u,d)=>{let p=d===t-1?o:a?85+d%3*5:100;return(0,q.jsx)(q1,{variant:i,animation:s,className:"w-full",style:{height:r,width:`${p}%`}},d)})}));Krt.displayName="SkeletonText";var Xrt=ee.forwardRef(({className:e,size:t="2.5rem",variant:r="default",animation:n="pulse",...o},a)=>(0,q.jsx)(q1,{ref:a,variant:r,animation:n,shape:"circle",className:Ae("moonui-theme","shrink-0",e),style:{height:t,width:t},...o}));Xrt.displayName="SkeletonAvatar";var Rur=ee.forwardRef(({className:e,showHeader:t=!0,contentLines:r=3,showFooter:n=!0,variant:o="default",animation:a="pulse",...i},s)=>(0,q.jsxs)("div",{ref:s,className:Ae("overflow-hidden rounded-md border border-border bg-background p-4",e),...i,children:[t&&(0,q.jsxs)("div",{className:"mb-4 flex items-center gap-4",children:[(0,q.jsx)(Xrt,{size:"2.5rem",variant:o,animation:a}),(0,q.jsxs)("div",{className:"flex-1",children:[(0,q.jsx)(q1,{variant:o,animation:a,className:"mb-2 h-4 w-1/3"}),(0,q.jsx)(q1,{variant:o,animation:a,className:"h-3 w-1/4"})]})]}),(0,q.jsx)(Krt,{lines:r,variant:o,animation:a,className:"mb-4"}),n&&(0,q.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-border",children:[(0,q.jsx)(q1,{variant:o,animation:a,className:"h-4 w-1/4"}),(0,q.jsx)(q1,{variant:o,animation:a,className:"h-4 w-1/5"})]})]}));Rur.displayName="SkeletonCard";var Nur=ee.forwardRef(({className:e,children:t,onSwipeLeft:r,onSwipeRight:n,threshold:o=100,disabled:a=!1,...i},s)=>{let[l,c]=ee.useState(0),[u,d]=ee.useState(0),[f,p]=ee.useState(!1),m=v=>{a||(c(v.touches[0].clientX),p(!0))},h=v=>{a||!f||d(v.touches[0].clientX)},g=()=>{if(a||!f)return;let v=u-l;Math.abs(v)>o&&(v>0&&n?n():v<0&&r&&r()),p(!1),d(0),c(0)};return(0,q.jsx)("div",{ref:s,className:Ae("touch-pan-y select-none transition-transform duration-200",f&&"cursor-grabbing",e),onTouchStart:m,onTouchMove:h,onTouchEnd:g,...i,children:t})});Nur.displayName="SwipeableCard";var Mur=ee.forwardRef(({className:e,size:t="md",variant:r="primary",loading:n,leftIcon:o,rightIcon:a,description:i,...s},l)=>(0,q.jsxs)("div",{className:"moonui-theme inline-flex items-center gap-2",children:[o&&(0,q.jsx)("span",{className:"text-muted-foreground",children:o}),(0,q.jsxs)(wde,{className:Ae("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=unchecked]:bg-gray-700/70 dark:focus-visible:ring-primary/40 dark:focus-visible:ring-offset-gray-950",t==="sm"&&"h-4 w-8",t==="md"&&"h-6 w-11",t==="lg"&&"h-7 w-14",r==="primary"&&"data-[state=checked]:bg-primary",r==="success"&&"data-[state=checked]:bg-success",r==="warning"&&"data-[state=checked]:bg-warning",r==="danger"&&"data-[state=checked]:bg-error",r==="secondary"&&"data-[state=checked]:bg-accent","data-[state=unchecked]:bg-input",n&&"opacity-80 cursor-wait",e),disabled:n||s.disabled,...s,ref:l,children:[n?(0,q.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,q.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-primary"})}):null,(0,q.jsx)(Ptt,{className:Ae("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",t==="sm"&&"h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",t==="md"&&"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",t==="lg"&&"h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0")})]}),a&&(0,q.jsx)("span",{className:"text-muted-foreground",children:a}),i&&(0,q.jsx)("span",{className:"text-sm text-muted-foreground",children:i})]}));Mur.displayName=wde.displayName;var Tur=ee.forwardRef(({value:e=[],onChange:t,maxTags:r,variant:n="primary",allowDuplicates:o=!1,delimiter:a=",",placeholder:i="Add tag and press Enter",className:s,disabled:l,...c},u)=>{let[d,f]=ee.useState(""),[p,m]=ee.useState(""),h=y=>{y.key==="Enter"||y.key===a?(y.preventDefault(),g()):y.key==="Backspace"&&d===""&&e.length>0&&v(e.length-1)},g=()=>{let y=d.trim();if(y){if(!o&&e.includes(y)){m("This tag already exists"),setTimeout(()=>m(""),2e3);return}if(r&&e.length>=r){m(`Maximum ${r} tags allowed`),setTimeout(()=>m(""),2e3);return}t([...e,y]),f(""),m("")}},v=y=>{l||t(e.filter((x,w)=>w!==y))};return(0,q.jsxs)("div",{className:"relative",children:[(0,q.jsxs)("div",{className:Ae("flex min-h-[2.5rem] w-full flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","dark:bg-zinc-950/50 dark:border-zinc-800","focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l&&"cursor-not-allowed opacity-50",s),children:[e.map((y,x)=>(0,q.jsxs)(C8,{variant:n,className:"gap-1 pr-1.5",children:[(0,q.jsx)("span",{className:"text-xs",children:y}),!l&&(0,q.jsx)("button",{type:"button",onClick:()=>v(x),className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",children:(0,q.jsx)(Yy,{className:"h-3 w-3 text-muted-foreground hover:text-foreground transition-colors"})})]},x)),(0,q.jsx)("input",{ref:u,type:"text",value:d,onChange:y=>f(y.target.value),onKeyDown:h,onBlur:g,disabled:l,placeholder:e.length===0?i:"",className:Ae("flex-1 bg-transparent outline-none placeholder:text-muted-foreground","dark:placeholder:text-zinc-500","min-w-[120px]",l&&"cursor-not-allowed"),...c})]}),p&&(0,q.jsx)("p",{className:"mt-1 text-xs text-destructive",children:p})]})});Tur.displayName="TagsInput";var Aur=ee.forwardRef(({className:e,variant:t,size:r,error:n,success:o,loading:a,autoResize:i,maxHeight:s,characterCount:l,...c},u)=>(0,q.jsx)("textarea",{className:Ae("moonui-theme","flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:u,...c}));Aur.displayName="Textarea";var Lur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Mde,{ref:r,className:Ae("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Lur.displayName=Mde.displayName;var Eur=Hn("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-900/20 dark:text-green-100",warning:"border-orange-200 bg-orange-50 text-orange-900 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-100",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),Dur=ee.forwardRef(({className:e,variant:t,...r},n)=>(0,q.jsx)(Tde,{ref:n,className:Ae("moonui-theme",Eur({variant:t}),e),...r}));Dur.displayName=Tde.displayName;var Our=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ede,{ref:r,className:Ae("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Our.displayName=Ede.displayName;var _ur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Dde,{ref:r,className:Ae("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,q.jsx)(Yy,{className:"h-4 w-4"})}));_ur.displayName=Dde.displayName;var Fur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ade,{ref:r,className:Ae("moonui-theme","text-sm font-semibold [&+div]:text-xs",e),...t}));Fur.displayName=Ade.displayName;var Bur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Lde,{ref:r,className:Ae("moonui-theme","text-sm opacity-90",e),...t}));Bur.displayName=Lde.displayName;var qc=D(fe(),1),T8=xt("relative inline-flex shrink-0 overflow-hidden font-semibold transition-all",{variants:{size:{xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-14 w-14 text-lg","2xl":"h-16 w-16 text-xl","3xl":"h-20 w-20 text-2xl"},shape:{circle:"rounded-full",square:"rounded-md",hexagon:"mask mask-hexagon"},ring:{none:"",default:"ring-2 ring-offset-2 ring-offset-background",gradient:"ring-2 ring-offset-2 ring-offset-background",glow:"ring-2 ring-offset-2 ring-offset-background shadow-lg"}},defaultVariants:{size:"md",shape:"circle",ring:"none"}}),ofe=xt("absolute rounded-full border-2 border-background",{variants:{size:{xs:"h-2 w-2",sm:"h-2.5 w-2.5",md:"h-3 w-3",lg:"h-3.5 w-3.5",xl:"h-4 w-4","2xl":"h-5 w-5","3xl":"h-6 w-6"},position:{"bottom-right":"bottom-0 right-0","bottom-left":"bottom-0 left-0","top-right":"top-0 right-0","top-left":"top-0 left-0"},status:{online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-yellow-500",focus:"bg-purple-500"}},defaultVariants:{size:"md",position:"bottom-right",status:"offline"}}),afe=xt("absolute flex items-center justify-center rounded-full font-bold text-white",{variants:{size:{xs:"h-3 w-3 text-[8px]",sm:"h-3.5 w-3.5 text-[9px]",md:"h-4 w-4 text-[10px]",lg:"h-5 w-5 text-[11px]",xl:"h-6 w-6 text-xs","2xl":"h-7 w-7 text-sm","3xl":"h-8 w-8 text-base"},position:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"},variant:{default:"bg-primary",destructive:"bg-destructive",success:"bg-green-500",warning:"bg-yellow-500",info:"bg-blue-500",pro:"bg-gradient-to-r from-purple-500 to-pink-500",lifetime:"bg-gradient-to-r from-yellow-400 to-amber-500"}},defaultVariants:{size:"md",position:"top-right",variant:"default"}}),Vur={crown:_w,sparkles:bt,star:vs,heart:Vw,shield:YA,award:aA,gem:xA,flame:yA,zap:es},A8=Dd.forwardRef(({className:e,size:t,shape:r,ring:n,src:o,alt:a,fallback:i,delayMs:s,status:l,statusPosition:c="bottom-right",badge:u,ringColor:d,gradientFrom:f,gradientTo:p,animate:m=!1,animationType:h="pulse",onStatusClick:g,loading:v=!1,error:y=!1,...x},w)=>{let b={pulse:"animate-pulse",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping"},C=Dd.useMemo(()=>n==="gradient"&&f&&p?{background:`linear-gradient(135deg, ${f}, ${p})`,padding:"2px"}:d?{boxShadow:`0 0 0 2px ${d}`}:{},[n,d,f,p]),S=u?.icon?Vur[u.icon]:null;return(0,qc.jsxs)("div",{className:"relative inline-block",children:[n==="gradient"&&(0,qc.jsx)("div",{className:"absolute -inset-[2px] rounded-full",style:{background:`linear-gradient(135deg, ${f||"#8b5cf6"}, ${p||"#ec4899"})`}}),(0,qc.jsxs)(fL,{ref:w,className:Ae(T8({size:t,shape:r,ring:n}),m&&b[h],n==="gradient"&&"relative",e),style:n!=="gradient"?C:void 0,...x,children:[(0,qc.jsx)(pL,{src:o,alt:a,className:"aspect-square h-full w-full object-cover"}),(0,qc.jsx)(mL,{className:Ae("flex h-full w-full items-center justify-center bg-muted",v&&"animate-pulse",y&&"bg-destructive/10 text-destructive"),delayMs:s,children:v?(0,qc.jsx)("div",{className:"h-1/2 w-1/2 rounded-full bg-muted-foreground/20 animate-pulse"}):y?(0,qc.jsx)(lo,{className:"h-1/2 w-1/2"}):i})]}),l&&!v&&(0,qc.jsx)("button",{className:Ae(ofe({size:t,position:c,status:l}),g&&"cursor-pointer hover:scale-110 transition-transform",l==="online"&&"animate-pulse"),onClick:g,"aria-label":`Status: ${l}`}),u&&!v&&(0,qc.jsx)("div",{className:Ae(afe({size:t,position:u.position,variant:u.variant}),"shadow-sm"),children:S?(0,qc.jsx)(S,{className:"h-full w-full p-0.5"}):u.content})]})});A8.displayName="MoonUIAvatarPro";var ife=Dd.forwardRef(({children:e,max:t=4,size:r="md",spacing:n="normal",className:o},a)=>{let i=Dd.Children.toArray(e),s=i.slice(0,t),l=i.length-t;return(0,qc.jsxs)("div",{ref:a,className:Ae("flex items-center",{tight:"-space-x-3",normal:"-space-x-2",loose:"-space-x-1"}[n],o),children:[s.map((u,d)=>(0,qc.jsx)("div",{className:"relative ring-2 ring-background rounded-full",style:{zIndex:s.length-d},children:u},d)),l>0&&(0,qc.jsxs)("div",{className:Ae(T8({size:r,shape:"circle"}),"relative flex items-center justify-center bg-muted ring-2 ring-background","text-muted-foreground font-medium"),style:{zIndex:0},children:["+",l]})]})});ife.displayName="MoonUIAvatarGroupPro";var sfe=Dd.forwardRef(({userId:e,fetchUser:t,...r},n)=>{let[o,a]=Dd.useState(null),[i,s]=Dd.useState(!1),[l,c]=Dd.useState(!1);return Dd.useEffect(()=>{e&&t&&(s(!0),c(!1),t(e).then(a).catch(()=>c(!0)).finally(()=>s(!1)))},[e,t]),(0,qc.jsx)(A8,{ref:n,src:o?.image||r.src,fallback:o?.name?.[0]||r.fallback,loading:i,error:l,...r})});sfe.displayName="MoonUIAsyncAvatarPro";var dl=D(fe(),1);function _u({title:e,subtitle:t,children:r,variant:n="default",backgroundVariant:o,colorScheme:a="blue",className:i,headerAction:s,loading:l=!1,error:c=null,animate:u=!0,rounded:d="lg",shadow:f="sm",gradientDirection:p="to-br",overlay:m}){let h=o||n,g={blue:"from-blue-500/10 via-blue-500/5 to-transparent border-blue-500/20 dark:from-blue-400/10 dark:via-blue-400/5 dark:border-blue-400/20",green:"from-green-500/10 via-green-500/5 to-transparent border-green-500/20 dark:from-green-400/10 dark:via-green-400/5 dark:border-green-400/20",purple:"from-purple-500/10 via-purple-500/5 to-transparent border-purple-500/20 dark:from-purple-400/10 dark:via-purple-400/5 dark:border-purple-400/20",orange:"from-orange-500/10 via-orange-500/5 to-transparent border-orange-500/20 dark:from-orange-400/10 dark:via-orange-400/5 dark:border-orange-400/20",pink:"from-pink-500/10 via-pink-500/5 to-transparent border-pink-500/20 dark:from-pink-400/10 dark:via-pink-400/5 dark:border-pink-400/20",cyan:"from-cyan-500/10 via-cyan-500/5 to-transparent border-cyan-500/20 dark:from-cyan-400/10 dark:via-cyan-400/5 dark:border-cyan-400/20",neutral:"from-gray-500/10 via-gray-500/5 to-transparent border-gray-500/20 dark:from-gray-400/10 dark:via-gray-400/5 dark:border-gray-400/20"},v={blue:"from-blue-500/20 via-blue-500/10 to-transparent border-blue-500/30 dark:from-blue-400/20 dark:via-blue-400/10 dark:border-blue-400/30",green:"from-green-500/20 via-green-500/10 to-transparent border-green-500/30 dark:from-green-400/20 dark:via-green-400/10 dark:border-green-400/30",purple:"from-purple-500/20 via-purple-500/10 to-transparent border-purple-500/30 dark:from-purple-400/20 dark:via-purple-400/10 dark:border-purple-400/30",orange:"from-orange-500/20 via-orange-500/10 to-transparent border-orange-500/30 dark:from-orange-400/20 dark:via-orange-400/10 dark:border-orange-400/30",pink:"from-pink-500/20 via-pink-500/10 to-transparent border-pink-500/30 dark:from-pink-400/20 dark:via-pink-400/10 dark:border-pink-400/30",cyan:"from-cyan-500/20 via-cyan-500/10 to-transparent border-cyan-500/30 dark:from-cyan-400/20 dark:via-cyan-400/10 dark:border-cyan-400/30",neutral:"from-gray-500/20 via-gray-500/10 to-transparent border-gray-500/30 dark:from-gray-400/20 dark:via-gray-400/10 dark:border-gray-400/30"},y={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"},x={none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl","2xl":"shadow-2xl"},w={dots:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",grid:"linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)",diagonal:"repeating-linear-gradient(45deg, transparent, transparent 2px, currentColor 2px, currentColor 4px)",waves:"radial-gradient(ellipse at center, transparent 20%, currentColor 21%, currentColor 25%, transparent 26%)",none:"none"},b={"to-t":"bg-gradient-to-t","to-tr":"bg-gradient-to-tr","to-r":"bg-gradient-to-r","to-br":"bg-gradient-to-br","to-b":"bg-gradient-to-b","to-bl":"bg-gradient-to-bl","to-l":"bg-gradient-to-l","to-tl":"bg-gradient-to-tl"},C={"to-t":{backgroundImage:"linear-gradient(to top, var(--tw-gradient-stops))"},"to-tr":{backgroundImage:"linear-gradient(to top right, var(--tw-gradient-stops))"},"to-r":{backgroundImage:"linear-gradient(to right, var(--tw-gradient-stops))"},"to-br":{backgroundImage:"linear-gradient(to bottom right, var(--tw-gradient-stops))"},"to-b":{backgroundImage:"linear-gradient(to bottom, var(--tw-gradient-stops))"},"to-bl":{backgroundImage:"linear-gradient(to bottom left, var(--tw-gradient-stops))"},"to-l":{backgroundImage:"linear-gradient(to left, var(--tw-gradient-stops))"},"to-tl":{backgroundImage:"linear-gradient(to top left, var(--tw-gradient-stops))"}},S={default:"bg-card border",minimal:"border-0 shadow-none bg-card/50",glass:"bg-background/60 backdrop-blur-md border-white/10",bordered:"border-2 bg-card",gradient:`${b[p]} ${g[a]}`,colored:`${b[p]} ${v[a]} border-2`,overlay:"bg-card border relative overflow-hidden",floating:"bg-card border-0 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1 transition-all duration-300 ring-1 ring-gray-200/50 dark:ring-gray-700/50"},P=(0,dl.jsxs)(Ve,{className:B(S[h],y[d],x[f],"transition-all duration-200 relative",i),style:h==="gradient"||h==="colored"?C[p]:void 0,children:[(h==="overlay"||m)&&m?.pattern&&m.pattern!=="none"&&(0,dl.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:w[m.pattern],backgroundSize:m.pattern==="dots"?"8px 8px":m.pattern==="grid"?"20px 20px":m.pattern==="diagonal"?"8px 8px":m.pattern==="waves"?"60px 60px":"auto",opacity:m.opacity||.1,color:m.color||"currentColor"}}),(e||t||s)&&(0,dl.jsxs)(vr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,dl.jsxs)("div",{children:[e&&(0,dl.jsx)(Dr,{className:"text-base font-semibold",children:e}),t&&(0,dl.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),s&&(0,dl.jsx)("div",{className:"ml-4",children:s})]}),(0,dl.jsx)(ze,{className:B(e||t||s?"pt-0":"pt-6"),children:l?(0,dl.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,dl.jsxs)("div",{className:"animate-pulse space-y-2",children:[(0,dl.jsx)("div",{className:"h-4 bg-muted rounded w-24 mx-auto"}),(0,dl.jsx)("div",{className:"h-8 bg-muted rounded w-16 mx-auto"})]})}):c?(0,dl.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,dl.jsxs)("div",{className:"text-destructive",children:[(0,dl.jsx)("p",{className:"text-sm font-medium",children:"Error"}),(0,dl.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:c})]})}):r})]});return u?(0,dl.jsx)(oe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:P}):P}var Er=D(fe(),1);function lfe({data:e,title:t,variant:r="default",backgroundVariant:n,gradientDirection:o,orientation:a="horizontal",showTrend:i=!0,showTarget:s=!0,showChange:l=!0,animate:c=!0,icon:u,onKPIClick:d,...f}){let p=Array.isArray(e)?e:[e],m=(y,x)=>{if(typeof y=="string")return y;let w;return y%1!==0?w=(Math.round(y*100)/100).toString():w=y.toString(),x?`${w}${x}`:w},h=y=>{switch(y){case"success":return"text-green-600 dark:text-green-400";case"warning":return"text-yellow-600 dark:text-yellow-400";case"danger":return"text-red-600 dark:text-red-400";case"info":return"text-blue-600 dark:text-blue-400";default:return"text-foreground"}},g=y=>{if(!y||y.length<2)return null;let x=Math.max(...y),w=Math.min(...y),b=x-w||1;return(0,Er.jsx)("div",{className:"flex items-end gap-0.5 h-8 w-16",children:y.map((C,S)=>(0,Er.jsx)(oe.div,{className:"flex-1 bg-primary/60 rounded-t-sm min-h-[2px]",initial:{height:0},animate:{height:`${Math.max((C-w)/b*100,10)}%`},transition:{delay:S*.05,duration:c?.3:0}},S))})},v=(y,x)=>{let w=y.target&&typeof y.value=="number"?y.value/y.target.value*100:0;return(0,Er.jsxs)(oe.div,{className:B("space-y-2",d&&"cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"),onClick:()=>d?.(y),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:x*.1,duration:c?.3:0},children:[(r==="default"||r==="detailed")&&(0,Er.jsxs)("div",{className:B("flex items-center",a==="vertical"?"flex-col space-y-2":"justify-between"),children:[(0,Er.jsxs)("div",{className:B("flex items-center gap-2",a==="vertical"?"flex-col text-center":""),children:[y.icon&&(0,Er.jsx)("div",{className:"text-muted-foreground",children:y.icon}),(0,Er.jsxs)("div",{className:a==="vertical"?"text-center":"",children:[(0,Er.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:y.label}),y.description&&(0,Er.jsx)("p",{className:"text-xs text-muted-foreground/70",children:y.description})]})]}),(0,Er.jsxs)("div",{className:B("flex items-center gap-3",a==="vertical"?"flex-col":""),children:[(0,Er.jsx)("div",{className:B("text-right",a==="vertical"?"text-center":""),children:(0,Er.jsx)("p",{className:B("text-2xl font-bold tracking-tight",h(y.status)),children:m(y.value,y.unit)})}),l&&y.change&&(0,Er.jsxs)("div",{className:B("flex items-center gap-1",y.change.type==="increase"?"text-green-600":y.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[y.change.type==="increase"?(0,Er.jsx)(va,{className:"h-4 w-4"}):y.change.type==="decrease"?(0,Er.jsx)(vc,{className:"h-4 w-4"}):(0,Er.jsx)(eu,{className:"h-4 w-4"}),(0,Er.jsxs)("span",{className:"text-sm font-medium",children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]})]}),i&&y.trend&&g(y.trend)]})]}),r==="card"&&(0,Er.jsxs)("div",{className:"space-y-3",children:[(0,Er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{className:"text-sm text-muted-foreground",children:y.label}),(0,Er.jsx)("p",{className:"text-3xl font-bold tracking-tight",children:m(y.value,y.unit)})]}),u&&(0,Er.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10",children:u})]}),l&&y.change&&(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Er.jsxs)(dt,{variant:y.change.type==="increase"?"success":y.change.type==="decrease"?"destructive":"secondary",leftIcon:y.change.type==="increase"?(0,Er.jsx)(Qc,{className:"h-3 w-3"}):y.change.type==="decrease"?(0,Er.jsx)(gc,{className:"h-3 w-3"}):(0,Er.jsx)(eu,{className:"h-3 w-3"}),className:"text-xs",children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]}),y.change.period&&(0,Er.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",y.change.period]})]})]}),r==="compact"&&(0,Er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[y.icon&&(0,Er.jsx)("div",{className:"text-muted-foreground text-sm",children:y.icon}),(0,Er.jsx)("span",{className:"text-sm font-medium",children:y.label})]}),(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Er.jsx)("span",{className:"font-bold",children:m(y.value,y.unit)}),l&&y.change&&(0,Er.jsxs)(dt,{variant:"outline",className:"text-xs",leftIcon:y.change.type==="increase"?(0,Er.jsx)(Qc,{className:"h-3 w-3"}):y.change.type==="decrease"?(0,Er.jsx)(gc,{className:"h-3 w-3"}):(0,Er.jsx)(eu,{className:"h-3 w-3"}),children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]})]})]}),r==="detailed"&&s&&y.target&&(0,Er.jsxs)("div",{className:"space-y-2",children:[(0,Er.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,Er.jsx)("span",{className:"text-muted-foreground",children:y.target.label||"Target"}),(0,Er.jsxs)("span",{className:"font-medium",children:[w.toFixed(1),"% of ",m(y.target.value,y.unit)]})]}),(0,Er.jsx)(Mo,{value:w,className:"h-2"})]})]},x)};return(0,Er.jsx)(_u,{title:t,variant:n,gradientDirection:o,...f,children:(0,Er.jsx)("div",{className:B("space-y-4",r==="compact"&&"space-y-2"),children:p.map((y,x)=>v(y,x))})})}var cfe=D(ue(),1);var Qt=D(fe(),1);function ufe({data:e,title:t,type:r="line",variant:n="default",backgroundVariant:o,gradientDirection:a,height:i=300,showLegend:s=!0,showGrid:l=!0,showTooltip:c=!0,showDataLabels:u=!1,animate:d=!0,colors:f,onDataPointClick:p,...m}){let[h,g]=cfe.default.useState(null),y=f||["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#06b6d4","#a855f7"],x=cfe.default.useMemo(()=>e.values?Math.max(...e.values):e.series?Math.max(...e.series.flatMap(T=>T.data.map(A=>A.value))):100,[e]),w=T=>T%1!==0?(Math.round(T*100)/100).toString():T.toString(),b=()=>{let T=e.values||[],A=e.labels||e.categories||[];return(0,Qt.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,Qt.jsx)("div",{className:"absolute inset-0 flex items-end justify-between gap-1 pl-10 pr-2 pb-6",children:T.map((M,O)=>{let F=M/x*100,I=h===O;return(0,Qt.jsxs)(oe.div,{className:"relative flex flex-col items-center justify-end min-w-0",style:{height:"calc(100% - 24px)",flex:"1 1 0"},onMouseEnter:()=>g(O),onMouseLeave:()=>g(null),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:O*.05},children:[u&&(0,Qt.jsx)(oe.span,{className:"absolute text-xs font-medium text-white mix-blend-difference",style:{bottom:`calc(${F}% / 2)`,left:"50%",transform:"translateX(-50%)"},initial:{opacity:0},animate:{opacity:1},transition:{delay:O*.1+.6},children:w(M)}),(0,Qt.jsx)("div",{className:"relative h-full w-full flex flex-col justify-end",children:(0,Qt.jsx)(oe.div,{className:B("w-full rounded-t cursor-pointer transition-all duration-200","shadow-lg",I&&"brightness-110 scale-y-105"),style:{background:`linear-gradient(to top, ${y[O%y.length]}, ${y[O%y.length]}dd)`,minHeight:"2px",boxShadow:I?`0 4px 20px ${y[O%y.length]}40`:"none"},initial:{height:0},animate:{height:`${F}%`},transition:{duration:d?.6:0,delay:O*.1,ease:"easeOut"},onClick:()=>p?.({label:A[O],value:M})})})]},O)})}),h!==null&&(0,Qt.jsxs)(oe.div,{className:"absolute bg-background border rounded-lg px-3 py-2 text-xs pointer-events-none shadow-lg",style:{left:`${10+h/T.length*85+85/T.length/2}%`,bottom:`${Math.min(90,30+T[h]/x*60)}%`,transform:"translateX(-50%)",zIndex:50},initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2},children:[(0,Qt.jsx)("div",{className:"font-medium",children:A[h]||`Item ${h+1}`}),(0,Qt.jsx)("div",{className:"text-muted-foreground",children:w(T[h])})]}),(0,Qt.jsx)("div",{className:"absolute bottom-0 left-10 right-0 flex justify-between gap-1 pr-2 h-6",children:A.map((M,O)=>(0,Qt.jsx)("div",{className:"flex-1 flex justify-center",children:(0,Qt.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:M})},O))}),l&&(0,Qt.jsxs)("div",{className:"absolute inset-0 pb-6 pointer-events-none",children:[[0,25,50,75,100].map(M=>(0,Qt.jsx)("div",{className:"absolute left-10 right-0 border-b border-muted/20",style:{bottom:`calc(24px + ${M}% * (100% - 24px) / 100)`}},M)),(0,Qt.jsxs)("div",{className:"absolute left-0 top-0 bottom-6 w-9 flex flex-col justify-between text-xs text-muted-foreground pr-1",children:[(0,Qt.jsx)("span",{className:"text-right",children:w(x)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.75)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.5)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.25)}),(0,Qt.jsx)("span",{className:"text-right",children:"0"})]})]})]})},C=()=>{let T=e.values||[],A=e.labels||e.categories||[];if(T.length<2)return null;let M=5,O=100-M*2,F=100-M*2,I=T.map((R,E)=>{let _=M+E/(T.length-1)*O,U=M+(F-R/x*F);return{x:_,y:U,value:R,label:A[E]}}),k=I.map((R,E)=>`${E===0?"M":"L"} ${R.x} ${R.y}`).join(" ");return(0,Qt.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,Qt.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,Qt.jsxs)("defs",{children:[(0,Qt.jsxs)("linearGradient",{id:"chartLineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,Qt.jsx)("stop",{offset:"0%",stopColor:y[0],stopOpacity:"1"}),(0,Qt.jsx)("stop",{offset:"50%",stopColor:y[1]||y[0],stopOpacity:"1"}),(0,Qt.jsx)("stop",{offset:"100%",stopColor:y[2]||y[0],stopOpacity:"1"})]}),(0,Qt.jsxs)("linearGradient",{id:"chartAreaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,Qt.jsx)("stop",{offset:"0%",stopColor:y[0],stopOpacity:"0.3"}),(0,Qt.jsx)("stop",{offset:"50%",stopColor:y[0],stopOpacity:"0.15"}),(0,Qt.jsx)("stop",{offset:"100%",stopColor:y[0],stopOpacity:"0.05"})]})]}),l&&(0,Qt.jsx)("g",{className:"opacity-10",children:[25,50,75].map(R=>{let E=5+R/100*90;return(0,Qt.jsx)("line",{x1:"0",y1:E,x2:"100",y2:E,stroke:"currentColor",strokeWidth:"0.3"},R)})}),(0,Qt.jsx)(oe.path,{d:k,fill:"none",stroke:"url(#chartLineGradient)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:d?1:0}}),r==="area"&&(0,Qt.jsx)(oe.path,{d:`${k} L 90 90 L 10 90 Z`,fill:"url(#chartAreaGradient)",initial:{opacity:0},animate:{opacity:1},transition:{duration:d?.5:0,delay:.5}}),I.map((R,E)=>(0,Qt.jsx)(oe.circle,{cx:R.x,cy:R.y,r:"1.2",fill:y[0],stroke:"white",strokeWidth:"1",initial:{r:0,opacity:0},animate:{r:h===E?2:1.2,opacity:1,strokeWidth:h===E?1.2:1},onMouseEnter:()=>g(E),onMouseLeave:()=>g(null),className:"cursor-pointer",style:{shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"},onClick:()=>p?.(R),transition:{duration:.2}},E))]}),c&&h!==null&&I[h]&&(()=>{let R=I[h],E=R.y<30;return(0,Qt.jsxs)("div",{className:"absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10 shadow-lg",style:{left:`${Math.min(90,Math.max(10,R.x))}%`,top:E?`${R.y}%`:`${R.y}%`,transform:E?"translate(-50%, 10px)":"translate(-50%, calc(-100% - 10px))"},children:[(0,Qt.jsx)("div",{className:"font-medium",children:R.label}),(0,Qt.jsx)("div",{children:w(R.value)})]})})()]})},S=()=>{let T=e.values||[],A=e.labels||e.categories||[],M=T.reduce((F,I)=>F+I,0),O=-90;return(0,Qt.jsxs)("div",{className:"flex items-center justify-between gap-4 h-full overflow-hidden",children:[(0,Qt.jsxs)("div",{className:"relative w-48 h-48 flex-shrink-0",children:[(0,Qt.jsxs)("svg",{className:"w-full h-full transform",viewBox:"0 0 100 100",children:[T.map((F,I)=>{let k=F/M*100,R=k/100*360,E=O,_=O+R,U=P(50,50,40,E),V=P(50,50,40,_),L=R>180?1:0,H=["M 50 50",`L ${U.x} ${U.y}`,`A 40 40 0 ${L} 1 ${V.x} ${V.y}`,"Z"].join(" ");return O=_,(0,Qt.jsx)(oe.path,{d:H,fill:y[I%y.length],initial:{scale:0},animate:{scale:h===I?1.05:1},style:{transformOrigin:"50px 50px"},transition:{duration:d?.3:0,delay:I*.05},onMouseEnter:()=>g(I),onMouseLeave:()=>g(null),className:"cursor-pointer",onClick:()=>p?.({label:A[I],value:F,percentage:k})},I)}),r==="donut"&&(0,Qt.jsx)("circle",{cx:"50",cy:"50",r:"25",fill:"var(--background)"})]}),r==="donut"&&(0,Qt.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,Qt.jsx)("div",{className:"text-2xl font-bold",children:M}),(0,Qt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Total"})]})]}),s&&(0,Qt.jsx)("div",{className:"space-y-1 overflow-y-auto flex-1 min-w-0",children:T.map((F,I)=>{let k=(F/M*100).toFixed(1);return(0,Qt.jsxs)("div",{className:B("flex items-center gap-2 cursor-pointer",h===I&&"opacity-80"),onMouseEnter:()=>g(I),onMouseLeave:()=>g(null),children:[(0,Qt.jsx)("div",{className:"w-2 h-2 rounded flex-shrink-0",style:{backgroundColor:y[I%y.length]}}),(0,Qt.jsx)("span",{className:"text-xs truncate",children:A[I]}),(0,Qt.jsxs)("span",{className:"text-xs text-muted-foreground ml-auto",children:[k,"%"]})]},I)})})]})},P=(T,A,M,O)=>{let F=O*Math.PI/180;return{x:T+M*Math.cos(F),y:A+M*Math.sin(F)}},N=()=>{switch(r){case"bar":return b();case"line":case"area":return C();case"pie":case"donut":return S();default:return b()}};return(0,Qt.jsx)(_u,{title:t,variant:o,gradientDirection:a,...m,children:(0,Qt.jsxs)("div",{className:"space-y-4",children:[e.total!==void 0&&(0,Qt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qt.jsxs)("div",{children:[(0,Qt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Total"}),(0,Qt.jsx)("p",{className:"text-2xl font-bold",children:w(e.total)})]}),e.change&&(0,Qt.jsxs)("div",{className:B("flex items-center gap-1",e.change.type==="increase"?"text-green-600":e.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[e.change.type==="increase"?(0,Qt.jsx)(Qc,{className:"h-4 w-4"}):e.change.type==="decrease"?(0,Qt.jsx)(gc,{className:"h-4 w-4"}):null,(0,Qt.jsxs)("span",{className:"font-medium",children:[e.change.type!=="neutral"&&(e.change.type==="increase"?"+":"-"),Math.abs(e.change.value),"%"]}),e.change.period&&(0,Qt.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",e.change.period]})]})]}),(0,Qt.jsx)("div",{className:"overflow-hidden",style:{height:`${i}px`},children:N()})]})})}var Fr=D(fe(),1);function dfe({data:e,title:t,variant:r="radial",backgroundVariant:n,gradientDirection:o,showValue:a=!0,showTarget:i=!0,showThresholds:s=!0,showLabels:l=!0,showTrend:c=!0,showPercentage:u=!0,size:d="md",animate:f=!0,strokeWidth:p=12,onGaugeClick:m,...h}){let g=Array.isArray(e)?e:[e],y={sm:{width:120,height:120,fontSize:"text-lg",strokeWidth:8},md:{width:180,height:180,fontSize:"text-2xl",strokeWidth:12},lg:{width:240,height:240,fontSize:"text-3xl",strokeWidth:16},xl:{width:320,height:320,fontSize:"text-4xl",strokeWidth:20}}[d],x=N=>N%1!==0?(Math.round(N*100)/100).toString():N.toString(),w=N=>{let T=N.min??0,M=(N.max??100)-T;return(N.value-T)/M*100},b=(N,T)=>{if(N.thresholds&&N.thresholds.length>0){let M=[...N.thresholds].sort((O,F)=>O.value-F.value);for(let O=M.length-1;O>=0;O--)if(T>=M[O].value)return M[O].color;return M[0].color}let A={success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#3b82f6",neutral:"#6b7280"};return N.status?A[N.status]:T>=75?"#22c55e":T>=50?"#f59e0b":T>=25?"#fb923c":"#ef4444"},C=(N,T)=>{let A=w(N),M=(y.width-y.strokeWidth)/2,O=2*Math.PI*M,F=O-A/100*O,I=b(N,A),k=N.target?(N.target-(N.min??0))/((N.max??100)-(N.min??0))*360:null;return(0,Fr.jsxs)(oe.div,{className:"relative flex flex-col items-center cursor-pointer",onClick:()=>m?.(N),whileHover:{scale:1.02},whileTap:{scale:.98},children:[(0,Fr.jsxs)("svg",{width:y.width,height:y.height,className:"transform -rotate-90",children:[(0,Fr.jsx)("circle",{cx:y.width/2,cy:y.height/2,r:M,fill:"none",stroke:"currentColor",strokeWidth:y.strokeWidth,className:"text-muted/20"}),s&&N.thresholds&&N.thresholds.map((R,E)=>{let _=(R.value/100*360-90)*(Math.PI/180),U=y.width/2+(M-y.strokeWidth)*Math.cos(_),V=y.height/2+(M-y.strokeWidth)*Math.sin(_),L=y.width/2+(M+y.strokeWidth)*Math.cos(_),H=y.height/2+(M+y.strokeWidth)*Math.sin(_);return(0,Fr.jsx)("line",{x1:U,y1:V,x2:L,y2:H,stroke:R.color,strokeWidth:2,opacity:.5},E)}),(0,Fr.jsx)(oe.circle,{cx:y.width/2,cy:y.height/2,r:M,fill:"none",stroke:I,strokeWidth:y.strokeWidth,strokeLinecap:"round",strokeDasharray:O,initial:{strokeDashoffset:O},animate:{strokeDashoffset:F},transition:{duration:f?1:0,ease:"easeOut"}}),i&&k!==null&&(0,Fr.jsx)("g",{transform:`rotate(${k} ${y.width/2} ${y.height/2})`,children:(0,Fr.jsx)("line",{x1:y.width/2,y1:y.strokeWidth,x2:y.width/2,y2:y.strokeWidth+10,stroke:"currentColor",strokeWidth:3,className:"text-primary"})})]}),(0,Fr.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center transform rotate-0",children:[a&&(0,Fr.jsxs)(oe.div,{className:B(y.fontSize,"font-bold"),initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:.3},children:[x(N.value),N.unit&&(0,Fr.jsx)("span",{className:"text-sm ml-1",children:N.unit})]}),u&&(0,Fr.jsxs)("div",{className:"text-sm text-muted-foreground",children:[x(A),"%"]}),l&&(0,Fr.jsx)("div",{className:"text-xs text-muted-foreground mt-1 text-center px-2",children:N.label}),c&&N.trend&&(0,Fr.jsxs)("div",{className:B("flex items-center gap-1 mt-2",N.trend.type==="increase"?"text-green-600":N.trend.type==="decrease"?"text-red-600":"text-gray-600"),children:[N.trend.type==="increase"?(0,Fr.jsx)(va,{className:"h-3 w-3"}):N.trend.type==="decrease"?(0,Fr.jsx)(vc,{className:"h-3 w-3"}):null,(0,Fr.jsxs)("span",{className:"text-xs font-medium",children:[x(N.trend.value),"%"]})]})]})]},T)},S=(N,T)=>{let A=w(N),M=b(N,A);return(0,Fr.jsxs)(oe.div,{className:"w-full space-y-2 cursor-pointer",onClick:()=>m?.(N),whileHover:{scale:1.01},children:[(0,Fr.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Fr.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,Fr.jsx)("span",{className:"text-sm font-medium",children:N.label}),N.status&&(0,Fr.jsx)(dt,{variant:"outline",className:"text-xs",children:N.status})]}),(0,Fr.jsxs)("div",{className:"flex items-center gap-2",children:[a&&(0,Fr.jsxs)("span",{className:B("font-bold",d==="sm"?"text-base":"text-lg"),children:[x(N.value),N.unit&&(0,Fr.jsx)("span",{className:"text-sm ml-1 text-muted-foreground",children:N.unit})]}),u&&(0,Fr.jsxs)("span",{className:"text-sm text-muted-foreground",children:["(",x(A),"%)"]})]})]}),(0,Fr.jsxs)("div",{className:"relative",children:[(0,Fr.jsx)("div",{className:B("w-full rounded-full bg-muted/30 overflow-hidden",d==="sm"?"h-2":d==="md"?"h-3":d==="lg"?"h-4":"h-5"),children:(0,Fr.jsx)(oe.div,{className:"h-full rounded-full",style:{backgroundColor:M},initial:{width:0},animate:{width:`${A}%`},transition:{duration:f?1:0,ease:"easeOut"}})}),s&&N.thresholds&&N.thresholds.map((O,F)=>(0,Fr.jsx)(Ys,{children:(0,Fr.jsxs)(ws,{children:[(0,Fr.jsx)(Cs,{asChild:!0,children:(0,Fr.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-0.5 h-full bg-background",style:{left:`${O.value}%`}})}),(0,Fr.jsx)(ns,{children:(0,Fr.jsx)("p",{children:O.label||`${O.value}%`})})]})},F)),i&&N.target&&(0,Fr.jsx)(Ys,{children:(0,Fr.jsxs)(ws,{children:[(0,Fr.jsx)(Cs,{asChild:!0,children:(0,Fr.jsx)("div",{className:"absolute -top-1 w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[8px] border-t-primary",style:{left:`${(N.target-(N.min??0))/((N.max??100)-(N.min??0))*100}%`,transform:"translateX(-50%)"}})}),(0,Fr.jsx)(ns,{children:(0,Fr.jsxs)("p",{children:["Target: ",x(N.target),N.unit]})})]})})]}),l&&(0,Fr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,Fr.jsx)("span",{children:N.min??0}),(0,Fr.jsx)("span",{children:N.max??100})]})]},T)},P=(N,T)=>{switch(r){case"linear":case"progress":return S(N,T);case"radial":default:return C(N,T)}};return(0,Fr.jsx)(_u,{title:t,variant:n,gradientDirection:o,...h,children:(0,Fr.jsx)("div",{className:B("flex flex-wrap items-center justify-center",r==="linear"||r==="progress"?"flex-col space-y-4":"gap-6","p-4"),children:g.map((N,T)=>P(N,T))})})}var L8=D(ue(),1);var kt=D(fe(),1);function ffe({data:e,title:t,variant:r="vertical",backgroundVariant:n,gradientDirection:o,showValues:a=!0,showPercentages:i=!0,showDropoff:s=!0,showTargets:l=!1,showDuration:c=!1,showConversionRate:u=!0,animate:d=!0,interactive:f=!0,onStageClick:p,...m}){let[h,g]=L8.default.useState(null),v=T=>T%1!==0?(Math.round(T*100)/100).toString():T.toString(),y=L8.default.useMemo(()=>{let T=Math.max(...e.stages.map(A=>A.value));return e.stages.map((A,M)=>{let O=A.percentage??A.value/T*100,F=M>0?e.stages[M-1].value:A.value,I=A.dropoff??F-A.value,k=A.dropoffPercentage??(F>0?(F-A.value)/F*100:0);return{...A,percentage:O,dropoff:I,dropoffPercentage:k}})},[e.stages]),x=(T,A)=>{if(T.color)return T.color;let M=["#3b82f6","#8b5cf6","#ec4899","#f59e0b","#10b981","#06b6d4"];return M[A%M.length]},w=(T,A)=>T.icon?T.icon:[(0,kt.jsx)(Xd,{className:"h-4 w-4"}),(0,kt.jsx)(ZA,{className:"h-4 w-4"}),(0,kt.jsx)(Sv,{className:"h-4 w-4"}),(0,kt.jsx)(Bo,{className:"h-4 w-4"})][A]||(0,kt.jsx)(ep,{className:"h-4 w-4"}),b=T=>e.currency?new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency,minimumFractionDigits:0,maximumFractionDigits:0}).format(T):T>=1e6?`${v(T/1e6)}M`:T>=1e3?`${v(T/1e3)}K`:T.toLocaleString(),C=()=>(0,kt.jsx)("div",{className:"space-y-2",children:y.map((T,A)=>{let M=`${T.percentage}%`,O=x(T,A),F=w(T,A),I=h===T.id;return(0,kt.jsx)(oe.div,{className:B("relative group",f&&"cursor-pointer"),onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:A*.1},children:(0,kt.jsxs)("div",{className:"flex items-center gap-4",children:[(0,kt.jsxs)("div",{className:"flex-1",children:[(0,kt.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,kt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,kt.jsx)("div",{className:"p-1.5 rounded",style:{backgroundColor:`${O}20`},children:(0,kt.jsx)("div",{style:{color:O},children:F})}),(0,kt.jsx)("span",{className:"text-sm font-medium",children:T.name}),T.description&&(0,kt.jsx)(Ys,{children:(0,kt.jsxs)(ws,{children:[(0,kt.jsx)(Cs,{children:(0,kt.jsx)(Nn,{className:"h-3 w-3 text-muted-foreground"})}),(0,kt.jsx)(ns,{children:(0,kt.jsx)("p",{className:"max-w-xs",children:T.description})})]})})]}),(0,kt.jsxs)("div",{className:"flex items-center gap-2",children:[a&&(0,kt.jsx)("span",{className:"text-sm font-bold",children:b(T.value)}),i&&(0,kt.jsxs)(dt,{variant:"outline",className:"text-xs",children:[v(T.percentage),"%"]}),c&&T.duration&&(0,kt.jsx)("span",{className:"text-xs text-muted-foreground",children:T.duration})]})]}),(0,kt.jsxs)("div",{className:"relative",children:[(0,kt.jsx)("div",{className:"h-8 bg-muted/30 rounded overflow-hidden",children:(0,kt.jsx)(oe.div,{className:"h-full rounded transition-all duration-300",style:{backgroundColor:O,opacity:I?1:.8},initial:{width:0},animate:{width:M},transition:{duration:d?.5:0,delay:A*.1}})}),l&&T.target&&(0,kt.jsx)("div",{className:"absolute top-0 bottom-0 w-0.5 bg-foreground/50",style:{left:`${T.target/Math.max(...e.stages.map(k=>k.value))*100}%`},children:(0,kt.jsx)("div",{className:"absolute -top-1 -left-1 w-2 h-2 rounded-full bg-foreground/50"})})]}),A<y.length-1&&(0,kt.jsx)("div",{className:"flex justify-center mt-2 mb-1",children:(0,kt.jsx)(Gf,{className:"h-4 w-4 text-muted-foreground/50"})})]}),s&&A>0&&(0,kt.jsxs)("div",{className:"flex items-center gap-1 text-xs",children:[(0,kt.jsx)(Gf,{className:"h-3 w-3 text-red-500"}),(0,kt.jsxs)("span",{className:"text-red-500 font-medium",children:["-",v(T.dropoffPercentage),"%"]})]})]})},T.id)})}),S=()=>(0,kt.jsx)("div",{className:"flex items-center justify-between",children:y.map((T,A)=>{let M=x(T,A),O=w(T,A),F=h===T.id,I=A===y.length-1;return(0,kt.jsxs)(L8.default.Fragment,{children:[(0,kt.jsxs)(oe.div,{className:B("flex flex-col items-center gap-2 flex-1",f&&"cursor-pointer"),onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:A*.1},children:[(0,kt.jsxs)(oe.div,{className:"relative",whileHover:{scale:1.1},whileTap:{scale:.95},children:[(0,kt.jsx)("div",{className:B("w-16 h-16 rounded-full flex items-center justify-center","border-2 transition-all duration-300"),style:{borderColor:M,backgroundColor:F?`${M}20`:"transparent"},children:(0,kt.jsx)("div",{style:{color:M},children:O})}),(0,kt.jsx)("svg",{className:"absolute inset-0 -rotate-90",width:"64",height:"64",children:(0,kt.jsx)("circle",{cx:"32",cy:"32",r:"30",fill:"none",stroke:M,strokeWidth:"2",strokeDasharray:`${T.percentage*1.88} 188`,opacity:"0.3"})})]}),(0,kt.jsxs)("div",{className:"text-center",children:[(0,kt.jsx)("div",{className:"font-medium text-sm",children:T.name}),a&&(0,kt.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:b(T.value)}),i&&(0,kt.jsxs)(dt,{variant:"outline",className:"text-xs mt-1",children:[v(T.percentage),"%"]})]})]}),!I&&(0,kt.jsx)("div",{className:"flex-shrink-0 px-2",children:(0,kt.jsxs)("div",{className:"relative",children:[(0,kt.jsx)(Ow,{className:"h-5 w-5 text-muted-foreground"}),s&&(0,kt.jsxs)("div",{className:"absolute -top-6 left-1/2 -translate-x-1/2 text-xs text-red-500 whitespace-nowrap",children:["-",v(y[A+1].dropoffPercentage),"%"]})]})})]},T.id)})}),P=()=>(0,kt.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:y.map((T,A)=>{let M=x(T,A),O=w(T,A),F=h===T.id;return(0,kt.jsxs)(oe.div,{className:B("relative p-4 rounded-lg border transition-all",f&&"cursor-pointer hover:shadow-lg",F&&"border-primary"),style:{borderColor:F?M:void 0},onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:A*.1},children:[(0,kt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,kt.jsx)("div",{className:"p-2 rounded",style:{backgroundColor:`${M}20`},children:(0,kt.jsx)("div",{style:{color:M},children:O})}),A>0&&s&&(0,kt.jsxs)(dt,{variant:"destructive",className:"text-xs flex items-center gap-1",children:[(0,kt.jsx)(vc,{className:"h-3 w-3"}),v(T.dropoffPercentage),"%"]})]}),(0,kt.jsxs)("div",{className:"space-y-2",children:[(0,kt.jsx)("h4",{className:"font-semibold",children:T.name}),a&&(0,kt.jsx)("div",{className:"text-2xl font-bold",children:b(T.value)}),i&&(0,kt.jsx)(Mo,{value:T.percentage,className:"h-2"}),T.description&&(0,kt.jsx)("p",{className:"text-xs text-muted-foreground",children:T.description}),l&&T.target&&(0,kt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,kt.jsx)("span",{className:"text-muted-foreground",children:"Target"}),(0,kt.jsx)("span",{className:"font-medium",children:b(T.target)})]})]})]},T.id)})}),N=()=>{switch(r){case"steps":return S();case"cards":return P();case"vertical":default:return C()}};return(0,kt.jsx)(_u,{title:t,variant:n,gradientDirection:o,...m,children:(0,kt.jsxs)("div",{className:"space-y-4",children:[u&&(0,kt.jsxs)("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-lg",children:[(0,kt.jsxs)("div",{children:[(0,kt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Overall Conversion Rate"}),(0,kt.jsx)("p",{className:"text-2xl font-bold",children:e.conversionRate?`${v(e.conversionRate)}%`:`${v(y[y.length-1].value/y[0].value*100)}%`})]}),e.comparison&&(0,kt.jsxs)("div",{className:B("flex items-center gap-1",e.comparison.type==="increase"?"text-green-600":"text-red-600"),children:[e.comparison.type==="increase"?(0,kt.jsx)(va,{className:"h-4 w-4"}):(0,kt.jsx)(vc,{className:"h-4 w-4"}),(0,kt.jsxs)("span",{className:"font-medium",children:[e.comparison.type==="increase"?"+":"-",Math.abs(e.comparison.value),"%"]}),(0,kt.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",e.comparison.period]})]})]}),N()]})})}var Yrt=D(ue(),1);var Ke=D(fe(),1);function pfe({data:e,title:t,variant:r="default",showStreams:n=!0,showMetrics:o=!0,showBreakdown:a=!0,showForecast:i=!0,showTimeline:s=!1,showTopProducts:l=!1,showCustomerMetrics:c=!1,animate:u=!0,onStreamClick:d,onMetricClick:f,...p}){let[m,h]=Yrt.default.useState("overview"),g=F=>F%1!==0?(Math.round(F*100)/100).toString():F.toString(),y=(F=>{switch(F){case"EUR":return"\u20AC";case"GBP":return"\xA3";case"USD":default:return"$"}})(e.currency),x=F=>{switch(F){case"EUR":return(0,Ke.jsx)(hA,{className:"h-5 w-5"});case"GBP":return(0,Ke.jsx)(jA,{className:"h-5 w-5"});case"USD":default:return(0,Ke.jsx)(Fw,{className:"h-5 w-5"})}},w=F=>new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency||"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(F),b=F=>F>=1e6?`${y}${g(F/1e6)}M`:F>=1e3?`${y}${g(F/1e3)}K`:`${y}${g(F)}`,C=e.target?e.total/e.target.value*100:0,S=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#ec4899"],P=(F,I)=>F.color?F.color:S[I%S.length],N=()=>(0,Ke.jsxs)("div",{className:"space-y-4",children:[(0,Ke.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ke.jsx)("div",{className:"space-y-1",children:(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("div",{className:B("p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"),children:x(e.currency)}),(0,Ke.jsxs)("div",{children:[(0,Ke.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Total Revenue ",e.period&&`(${e.period})`]}),(0,Ke.jsx)(oe.p,{className:"text-3xl font-bold",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{duration:u?.3:0},children:w(e.total)})]})]})}),e.change&&(0,Ke.jsxs)(oe.div,{className:B("flex items-center gap-1",e.change.type==="increase"?"text-green-600":e.change.type==="decrease"?"text-red-600":"text-gray-600"),initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.1},children:[e.change.type==="increase"?(0,Ke.jsx)(Qc,{className:"h-5 w-5"}):e.change.type==="decrease"?(0,Ke.jsx)(gc,{className:"h-5 w-5"}):null,(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsxs)("p",{className:"text-lg font-bold",children:[e.change.type!=="neutral"&&(e.change.type==="increase"?"+":"-"),Math.abs(e.change.value),"%"]}),e.change.period&&(0,Ke.jsxs)("p",{className:"text-xs text-muted-foreground",children:["vs ",e.change.period]})]})]})]}),e.target&&(0,Ke.jsxs)("div",{className:"space-y-2",children:[(0,Ke.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,Ke.jsx)("span",{className:"text-muted-foreground",children:e.target.label||"Target"}),(0,Ke.jsxs)("span",{className:"font-medium",children:[g(C),"% of ",w(e.target.value)]})]}),(0,Ke.jsx)(Mo,{value:C,className:"h-2"})]}),i&&e.forecast&&(0,Ke.jsxs)("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-lg",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(va,{className:"h-4 w-4 text-muted-foreground"}),(0,Ke.jsx)("span",{className:"text-sm text-muted-foreground",children:e.forecast.label||"Forecast"})]}),(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsx)("p",{className:"font-semibold",children:w(e.forecast.value)}),e.forecast.confidence&&(0,Ke.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.forecast.confidence,"% confidence"]})]})]})]}),T=()=>{if(!e.streams||e.streams.length===0)return null;let F=e.streams.reduce((I,k)=>I+k.amount,0);return(0,Ke.jsxs)("div",{className:"space-y-3",children:[(0,Ke.jsx)("h4",{className:"text-sm font-medium text-muted-foreground",children:"Revenue Streams"}),e.streams.map((I,k)=>{let R=I.percentage??I.amount/F*100,E=P(I,k);return(0,Ke.jsxs)(oe.div,{className:B("space-y-2",d&&"cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"),onClick:()=>d?.(I),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:k*.05},children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E}}),(0,Ke.jsx)("span",{className:"text-sm font-medium",children:I.name}),I.icon&&(0,Ke.jsx)("div",{className:"text-muted-foreground",children:I.icon})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(I.amount)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(R),"%"]}),I.change&&(0,Ke.jsxs)("div",{className:B("flex items-center gap-0.5 text-xs",I.change.type==="increase"?"text-green-600":I.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[I.change.type==="increase"?(0,Ke.jsx)(Qc,{className:"h-3 w-3"}):I.change.type==="decrease"?(0,Ke.jsx)(gc,{className:"h-3 w-3"}):null,Math.abs(I.change.value),"%"]})]})]}),(0,Ke.jsx)("div",{className:"relative h-2 bg-muted/30 rounded-full overflow-hidden",children:(0,Ke.jsx)(oe.div,{className:"h-full rounded-full",style:{backgroundColor:E},initial:{width:0},animate:{width:`${R}%`},transition:{duration:u?.5:0,delay:k*.05}})})]},I.id)})]})},A=()=>{if(!e.breakdown)return null;let F=e.breakdown.recurring+e.breakdown.oneTime+(e.breakdown.refunds||0),I=e.breakdown.recurring/F*100,k=e.breakdown.oneTime/F*100,R=e.breakdown.refunds?e.breakdown.refunds/F*100:0;return(0,Ke.jsxs)("div",{className:"space-y-3",children:[(0,Ke.jsx)("h4",{className:"text-sm font-medium text-muted-foreground",children:"Revenue Breakdown"}),(0,Ke.jsxs)("div",{className:"space-y-2",children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(Ah,{className:"h-4 w-4 text-blue-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"Recurring"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(e.breakdown.recurring)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(I),"%"]})]})]}),(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(Sv,{className:"h-4 w-4 text-green-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"One-time"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(e.breakdown.oneTime)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(k),"%"]})]})]}),e.breakdown.refunds&&(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(gc,{className:"h-4 w-4 text-red-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"Refunds"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsxs)("span",{className:"text-sm font-semibold text-red-600",children:["-",b(Math.abs(e.breakdown.refunds))]}),(0,Ke.jsxs)(dt,{variant:"destructive",className:"text-xs",children:[g(R),"%"]})]})]})]}),(0,Ke.jsxs)("div",{className:"h-3 flex rounded-full overflow-hidden",children:[(0,Ke.jsx)(oe.div,{className:"bg-blue-600",initial:{width:0},animate:{width:`${I}%`},transition:{duration:u?.5:0}}),(0,Ke.jsx)(oe.div,{className:"bg-green-600",initial:{width:0},animate:{width:`${k}%`},transition:{duration:u?.5:0,delay:.1}}),e.breakdown.refunds&&(0,Ke.jsx)(oe.div,{className:"bg-red-600",initial:{width:0},animate:{width:`${R}%`},transition:{duration:u?.5:0,delay:.2}})]})]})},M=()=>{if(!e.customerMetrics)return null;let F=[{label:"ARPU (Average Revenue Per User)",value:w(e.customerMetrics.arpu||0),icon:(0,Ke.jsx)(Xd,{className:"h-4 w-4"}),description:"Average revenue generated per user"},{label:"LTV (Lifetime Value)",value:w(e.customerMetrics.ltv||0),icon:(0,Ke.jsx)(va,{className:"h-4 w-4"}),description:"Expected revenue from customer over their lifetime"},{label:"CAC (Customer Acquisition Cost)",value:w(e.customerMetrics.cac||0),icon:(0,Ke.jsx)(QA,{className:"h-4 w-4"}),description:"Cost to acquire one new customer"},{label:"Churn Rate",value:`${g(e.customerMetrics.churnRate||0)}%`,icon:(0,Ke.jsx)(vc,{className:"h-4 w-4"}),description:"Percentage of customers lost per period"},{label:"Retention Rate",value:`${g(e.customerMetrics.retentionRate||0)}%`,icon:(0,Ke.jsx)(Ah,{className:"h-4 w-4"}),description:"Percentage of customers retained"}],I=(e.customerMetrics.ltv||0)/(e.customerMetrics.cac||1);return(0,Ke.jsxs)("div",{className:"space-y-6",children:[(0,Ke.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:F.map((k,R)=>(0,Ke.jsx)(Ys,{children:(0,Ke.jsxs)(ws,{children:[(0,Ke.jsx)(Cs,{asChild:!0,children:(0,Ke.jsx)(oe.div,{className:"p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors cursor-help",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:R*.1},children:(0,Ke.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ke.jsx)("div",{className:"text-muted-foreground",children:k.icon}),(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)("p",{className:"text-xs text-muted-foreground",children:k.label}),(0,Ke.jsx)("p",{className:"text-lg font-semibold",children:k.value})]})]})})}),(0,Ke.jsx)(ns,{children:(0,Ke.jsx)("p",{children:k.description})})]})},R))}),(0,Ke.jsxs)("div",{className:"p-4 rounded-lg border bg-card",children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)("p",{className:"text-sm text-muted-foreground",children:"LTV/CAC Ratio"}),(0,Ke.jsx)("p",{className:"text-2xl font-bold",children:g(I)})]}),(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsx)(dt,{variant:I>=3?"primary":I>=2?"secondary":"destructive",className:"text-xs",children:I>=3?"Excellent":I>=2?"Good":"Needs Improvement"}),(0,Ke.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Target: 3:1 or higher"})]})]}),(0,Ke.jsxs)("div",{className:"mt-3",children:[(0,Ke.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:"Ratio Progress"}),(0,Ke.jsx)(Mo,{value:Math.min(100,I/5*100),className:"h-2"})]})]})]})};return(0,Ke.jsx)(_u,{title:t,...p,children:(()=>{switch(r){case"compact":return(0,Ke.jsx)("div",{className:"space-y-4",children:N()});case"detailed":return(0,Ke.jsxs)(Sl,{value:m,onValueChange:h,children:[(0,Ke.jsxs)(el,{className:"grid grid-cols-3 w-full",children:[(0,Ke.jsx)(Dn,{value:"overview",children:"Overview"}),(0,Ke.jsx)(Dn,{value:"streams",children:"Streams"}),(0,Ke.jsx)(Dn,{value:"metrics",children:"Metrics"})]}),(0,Ke.jsxs)(Xn,{value:"overview",className:"space-y-4",children:[N(),a&&A()]}),(0,Ke.jsx)(Xn,{value:"streams",className:"space-y-4",children:T()}),(0,Ke.jsx)(Xn,{value:"metrics",className:"space-y-4",children:M()})]});case"dashboard":return(0,Ke.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Ke.jsxs)("div",{className:"space-y-4",children:[N(),a&&A()]}),(0,Ke.jsx)("div",{className:"space-y-4",children:n&&T()})]});case"default":default:return(0,Ke.jsxs)("div",{className:"space-y-6",children:[N(),n&&T(),a&&A()]})}})()})}var E8=D(ue(),1);var je=D(fe(),1);function mfe({data:e,title:t,variant:r="default",backgroundVariant:n,gradientDirection:o,showMetrics:a=!0,showAlerts:i=!0,showServices:s=!1,showHistory:l=!1,showUptime:c=!0,updateInterval:u=30,animate:d=!0,onServerClick:f,onAlertClick:p,...m}){let h=Array.isArray(e)?e:[e],[g,v]=E8.default.useState("overview"),[y,x]=E8.default.useState(h),w=O=>typeof O=="string"?O:O%1!==0?(Math.round(O*100)/100).toString():O.toString();E8.default.useEffect(()=>{if(!d)return;let O=setInterval(()=>{x(F=>F.map(I=>({...I,lastUpdated:new Date,metrics:{...I.metrics,cpu:I.metrics.cpu?{...I.metrics.cpu,value:Math.min(100,Math.max(0,I.metrics.cpu.value+(Math.random()-.5)*10))}:void 0,memory:I.metrics.memory?{...I.metrics.memory,value:Math.min(100,Math.max(0,I.metrics.memory.value+(Math.random()-.5)*5))}:void 0}})))},u*1e3);return()=>clearInterval(O)},[u,d]);let b=O=>{switch(O){case"online":case"healthy":case"running":return"text-green-600 dark:text-green-400";case"warning":case"degraded":return"text-yellow-600 dark:text-yellow-400";case"critical":case"error":case"offline":case"stopped":return"text-red-600 dark:text-red-400";case"maintenance":return"text-blue-600 dark:text-blue-400";default:return"text-gray-600 dark:text-gray-400"}},C=O=>{switch(O){case"online":case"healthy":case"running":return(0,je.jsx)(Bo,{className:"h-4 w-4"});case"warning":case"degraded":return(0,je.jsx)(ya,{className:"h-4 w-4"});case"critical":case"error":case"offline":case"stopped":return(0,je.jsx)(lo,{className:"h-4 w-4"});case"maintenance":return(0,je.jsx)(yn,{className:"h-4 w-4"});default:return(0,je.jsx)(Nn,{className:"h-4 w-4"})}},S=O=>{switch(O){case"database":return(0,je.jsx)(mA,{className:"h-5 w-5"});case"cache":return(0,je.jsx)(Mh,{className:"h-5 w-5"});case"storage":return(0,je.jsx)(Rv,{className:"h-5 w-5"});case"compute":return(0,je.jsx)(Xf,{className:"h-5 w-5"});case"web":default:return(0,je.jsx)($w,{className:"h-5 w-5"})}},P=O=>{if(O.status)return O.status;let F=O.value,I=O.max||100,k=F/I*100;return k>=90?"critical":k>=75?"warning":"healthy"},N=(O,F)=>{let I=O.value,k=O.max||100,R=I/k*100,E=P(O),_={healthy:"bg-green-600",warning:"bg-yellow-600",critical:"bg-red-600",offline:"bg-gray-600"};return(0,je.jsxs)("div",{className:"space-y-2",children:[(0,je.jsxs)("div",{className:"flex items-center justify-between",children:[(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)("div",{className:"text-muted-foreground",children:F}),(0,je.jsx)("span",{className:"text-sm font-medium",children:O.label}),O.trend&&(0,je.jsx)("div",{className:B("text-xs",O.trend==="up"?"text-green-600":O.trend==="down"?"text-red-600":"text-gray-600"),children:O.trend==="up"?(0,je.jsx)(va,{className:"h-3 w-3"}):O.trend==="down"?(0,je.jsx)(vc,{className:"h-3 w-3"}):null})]}),(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsxs)("span",{className:"text-sm font-semibold",children:[w(I),O.unit||"%"]}),k&&k!==100&&(0,je.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",w(k),O.unit]})]})]}),(0,je.jsxs)("div",{className:"relative",children:[(0,je.jsx)(Mo,{value:R,className:"h-2"}),(0,je.jsx)(oe.div,{className:B("absolute top-0 left-0 h-2 rounded-full",_[E]),initial:{width:0},animate:{width:`${R}%`},transition:{duration:d?.5:0}})]}),l&&O.history&&O.history.length>0&&(0,je.jsx)("div",{className:"flex items-end gap-0.5 h-8",children:O.history.slice(-20).map((U,V)=>(0,je.jsx)(oe.div,{className:B("flex-1 rounded-t",U>75?"bg-red-600/50":U>50?"bg-yellow-600/50":"bg-green-600/50"),initial:{height:0},animate:{height:`${U/100*32}px`},transition:{delay:V*.01}},V))})]})},T=O=>{let F=O.status==="online",I=O.metrics;return(0,je.jsxs)(Ve,{className:B("p-4 transition-all",f&&"cursor-pointer hover:shadow-lg",!F&&"opacity-75"),onClick:()=>f?.(O),children:[(0,je.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,je.jsxs)("div",{className:"flex items-center gap-3",children:[(0,je.jsx)("div",{className:B("p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"),children:S(O.type)}),(0,je.jsxs)("div",{children:[(0,je.jsx)("h4",{className:"font-semibold",children:O.name}),O.location&&(0,je.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,je.jsx)(kv,{className:"h-3 w-3"}),O.location]})]})]}),(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)(dt,{variant:F?"secondary":"destructive",leftIcon:F?(0,je.jsx)(Bo,{className:"h-3 w-3"}):(0,je.jsx)(lo,{className:"h-3 w-3"}),children:O.status}),F?(0,je.jsx)(uL,{className:"h-4 w-4 text-green-600"}):(0,je.jsx)(cL,{className:"h-4 w-4 text-red-600"})]})]}),c&&O.uptime!==void 0&&(0,je.jsxs)("div",{className:"mb-4",children:[(0,je.jsxs)("div",{className:"flex justify-between text-sm mb-1",children:[(0,je.jsx)("span",{className:"text-muted-foreground",children:"Uptime"}),(0,je.jsxs)("span",{className:"font-medium",children:[w(O.uptime),"%"]})]}),(0,je.jsx)(Mo,{value:O.uptime,className:"h-1"})]}),a&&(0,je.jsxs)("div",{className:"space-y-3",children:[I.cpu&&N(I.cpu,(0,je.jsx)(Xf,{className:"h-4 w-4"})),I.memory&&N(I.memory,(0,je.jsx)(Mh,{className:"h-4 w-4"})),I.disk&&N(I.disk,(0,je.jsx)(Rv,{className:"h-4 w-4"})),I.network&&N(I.network,(0,je.jsx)(Gx,{className:"h-4 w-4"})),I.temperature&&N(I.temperature,(0,je.jsx)(rL,{className:"h-4 w-4"}))]}),I.requests||I.responseTime||I.errorRate?(0,je.jsxs)("div",{className:"grid grid-cols-3 gap-2 mt-4 pt-4 border-t",children:[I.requests&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Requests"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.requests.value),"/s"]})]}),I.responseTime&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Response"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.responseTime.value),"ms"]})]}),I.errorRate&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Errors"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.errorRate.value),"%"]})]})]}):null,i&&O.alerts&&O.alerts.length>0&&(0,je.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,je.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,je.jsx)("span",{className:"text-sm font-medium",children:"Recent Alerts"}),(0,je.jsx)(dt,{variant:"outline",className:"text-xs",children:O.alerts.length})]}),(0,je.jsx)("div",{className:"space-y-1",children:O.alerts.slice(0,3).map(k=>(0,je.jsxs)("div",{className:B("text-xs p-2 rounded flex items-start gap-2",k.type==="error"?"bg-red-100 dark:bg-red-900/20":k.type==="warning"?"bg-yellow-100 dark:bg-yellow-900/20":"bg-blue-100 dark:bg-blue-900/20",p&&"cursor-pointer hover:opacity-80"),onClick:R=>{R.stopPropagation(),p?.(k)},children:[k.type==="error"?(0,je.jsx)(lo,{className:"h-3 w-3 text-red-600 flex-shrink-0"}):k.type==="warning"?(0,je.jsx)(ya,{className:"h-3 w-3 text-yellow-600 flex-shrink-0"}):(0,je.jsx)(Nn,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),(0,je.jsx)("span",{className:"flex-1",children:k.message})]},k.id))})]}),O.lastUpdated&&(0,je.jsxs)("div",{className:"mt-4 pt-4 border-t flex items-center justify-between text-xs text-muted-foreground",children:[(0,je.jsx)("span",{children:"Last updated"}),(0,je.jsx)("span",{children:new Date(O.lastUpdated).toLocaleTimeString()})]})]})},A=()=>(0,je.jsx)("div",{className:"space-y-2",children:y.map((O,F)=>(0,je.jsxs)(oe.div,{className:B("flex items-center justify-between p-3 rounded-lg border",f&&"cursor-pointer hover:bg-muted/30 transition-colors"),onClick:()=>f?.(O),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:F*.05},children:[(0,je.jsxs)("div",{className:"flex items-center gap-3",children:[S(O.type),(0,je.jsxs)("div",{children:[(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)("span",{className:"font-medium",children:O.name}),(0,je.jsx)(dt,{variant:O.status==="online"?"secondary":"destructive",className:"text-xs",leftIcon:O.status==="online"?(0,je.jsx)(Bo,{className:"h-3 w-3"}):(0,je.jsx)(lo,{className:"h-3 w-3"}),children:O.status})]}),O.location&&(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:O.location})]})]}),(0,je.jsxs)("div",{className:"flex items-center gap-4",children:[O.metrics.cpu&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"CPU"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.metrics.cpu.value),"%"]})]}),O.metrics.memory&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Memory"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.metrics.memory.value),O.metrics.memory.unit||"%"]})]}),c&&O.uptime!==void 0&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uptime"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.uptime),"%"]})]})]})]},O.id))});return(0,je.jsx)(_u,{title:t,variant:n,gradientDirection:o,...m,children:(0,je.jsx)(Bt,{mode:"wait",children:(()=>{switch(r){case"compact":return A();case"grid":return(0,je.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:y.map(O=>(0,je.jsx)("div",{children:T(O)},O.id))});case"detailed":return(0,je.jsxs)(Sl,{value:g,onValueChange:v,children:[(0,je.jsxs)(el,{className:"grid grid-cols-3 w-full",children:[(0,je.jsx)(Dn,{value:"overview",children:"Overview"}),(0,je.jsx)(Dn,{value:"metrics",children:"Metrics"}),(0,je.jsx)(Dn,{value:"alerts",children:"Alerts"})]}),y.map(O=>(0,je.jsxs)("div",{children:[(0,je.jsx)(Xn,{value:"overview",children:T(O)}),(0,je.jsx)(Xn,{value:"metrics",className:"space-y-4",children:(0,je.jsx)("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(O.metrics).map(([F,I])=>!I||F==="custom"||Array.isArray(I)?null:(0,je.jsx)(Ve,{className:"p-4",children:N(I,F==="cpu"?(0,je.jsx)(Xf,{className:"h-4 w-4"}):F==="memory"?(0,je.jsx)(Mh,{className:"h-4 w-4"}):F==="disk"?(0,je.jsx)(Rv,{className:"h-4 w-4"}):F==="network"?(0,je.jsx)(Gx,{className:"h-4 w-4"}):(0,je.jsx)(ha,{className:"h-4 w-4"}))},F))})}),(0,je.jsx)(Xn,{value:"alerts",children:O.alerts&&O.alerts.length>0?(0,je.jsx)("div",{className:"space-y-2",children:O.alerts.map(F=>(0,je.jsxs)("div",{className:B("p-3 rounded-lg flex items-start gap-3",F.type==="error"?"bg-red-100 dark:bg-red-900/20":F.type==="warning"?"bg-yellow-100 dark:bg-yellow-900/20":"bg-blue-100 dark:bg-blue-900/20",p&&"cursor-pointer hover:opacity-80"),onClick:()=>p?.(F),children:[F.type==="error"?(0,je.jsx)(lo,{className:"h-5 w-5 text-red-600"}):F.type==="warning"?(0,je.jsx)(ya,{className:"h-5 w-5 text-yellow-600"}):(0,je.jsx)(Nn,{className:"h-5 w-5 text-blue-600"}),(0,je.jsxs)("div",{className:"flex-1",children:[(0,je.jsx)("p",{className:"font-medium",children:F.message}),(0,je.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(F.timestamp).toLocaleString()})]})]},F.id))}):(0,je.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,je.jsx)(Bo,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),(0,je.jsx)("p",{children:"No active alerts"})]})})]},O.id))]});case"default":default:return(0,je.jsx)("div",{className:"space-y-4",children:y.map(O=>(0,je.jsx)("div",{children:T(O)},O.id))})}})()})})}return wfe(Uur);})();
|
|
415
|
+
`),()=>{h.contains(m)&&h.removeChild(m)}},[t]),(0,UXe.jsx)(Uce,{isPresent:t,childRef:a,sizeRef:i,children:tG.cloneElement(e,{ref:a})})}var jXe=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:o,presenceAffectsLayout:a,mode:i,anchorX:s,root:l})=>{let c=ev(Vtr),u=(0,gF.useId)(),d=!0,f=(0,gF.useMemo)(()=>(d=!1,{id:u,initial:t,isPresent:r,custom:o,onExitComplete:p=>{c.set(p,!0);for(let m of c.values())if(!m)return;n&&n()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[r,c,n]);return a&&d&&(f={...f}),(0,gF.useMemo)(()=>{c.forEach((p,m)=>c.set(m,!1))},[r]),HXe.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),i==="popLayout"&&(e=(0,zce.jsx)(zXe,{isPresent:r,anchorX:s,root:l,children:e})),(0,zce.jsx)(X0.Provider,{value:f,children:e})};function Vtr(){return new Map}var nw=D(lt(),1);function rG(e=!0){let t=(0,nw.useContext)(X0);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:o}=t,a=(0,nw.useId)();(0,nw.useEffect)(()=>{if(e)return o(a)},[e]);let i=(0,nw.useCallback)(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,i]:[!0]}var nG=D(lt(),1),vF=e=>e.key||"";function Hce(e){let t=[];return nG.Children.forEach(e,r=>{(0,nG.isValidElement)(r)&&t.push(r)}),t}var xF=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",root:l})=>{let[c,u]=rG(i),d=(0,nv.useMemo)(()=>Hce(e),[e]),f=i&&!c?[]:d.map(vF),p=(0,nv.useRef)(!0),m=(0,nv.useRef)(d),h=ev(()=>new Map),[g,v]=(0,nv.useState)(d),[y,x]=(0,nv.useState)(d);cM(()=>{p.current=!1,m.current=d;for(let C=0;C<y.length;C++){let S=vF(y[C]);f.includes(S)?h.delete(S):h.get(S)!==!0&&h.set(S,!1)}},[y,f.length,f.join("-")]);let w=[];if(d!==g){let C=[...d];for(let S=0;S<y.length;S++){let P=y[S],N=vF(P);f.includes(N)||(C.splice(S,0,P),w.push(P))}return a==="wait"&&w.length&&(C=w),x(Hce(C)),v(d),null}let{forceRender:b}=(0,nv.useContext)(sM);return(0,yF.jsx)(yF.Fragment,{children:y.map(C=>{let S=vF(C),P=i&&!c?!1:d===y||f.includes(S),N=()=>{if(h.has(S))h.set(S,!0);else return;let T=!0;h.forEach(A=>{A||(T=!1)}),T&&(b?.(),x(m.current),i&&u?.(),n&&n())};return(0,yF.jsx)(jXe,{isPresent:P,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:o,mode:a,root:l,onExitComplete:P?void 0:N,anchorX:s,children:C},S)})})};var $Xe=D(lt(),1),oG=(0,$Xe.createContext)({strict:!1});var qXe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ax={};for(let e in qXe)ax[e]={isEnabled:t=>qXe[e].some(r=>!!t[r])};function WXe(e){for(let t in e)ax[t]={...ax[t],...e[t]}}var Utr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function bF(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Utr.has(e)}var GXe=e=>!bF(e);function ztr(e){typeof e=="function"&&(GXe=t=>t.startsWith("on")?!bF(t):e(t))}try{ztr(xfe("@emotion/is-prop-valid").default)}catch{}function KXe(e,t,r){let n={};for(let o in e)o==="values"&&typeof e.values=="object"||(GXe(o)||r===!0&&bF(o)||!t&&!bF(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}var gG=D(Or(),1);var kM=D(lt(),1);var XXe=D(lt(),1),ow=(0,XXe.createContext)({});var sG=D(lt(),1);function aw(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ix(e){return typeof e=="string"||Array.isArray(e)}var aG=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wF=["initial",...aG];function A1(e){return aw(e.animate)||wF.some(t=>ix(e[t]))}function iG(e){return!!(A1(e)||e.variants)}function YXe(e,t){if(A1(e)){let{initial:r,animate:n}=e;return{initial:r===!1||ix(r)?r:void 0,animate:ix(n)?n:void 0}}return e.inherit!==!1?t:{}}function ZXe(e){let{initial:t,animate:r}=YXe(e,(0,sG.useContext)(ow));return(0,sG.useMemo)(()=>({initial:t,animate:r}),[QXe(t),QXe(r)])}function QXe(e){return Array.isArray(e)?e.join(" "):e}var wM=D(lt(),1);var tYe=D(lt(),1);var L1={};function JXe(e){for(let t in e)L1[t]=e[t],y1(t)&&(L1[t].isCSSVariable=!0)}function lG(e,{layout:t,layoutId:r}){return Df.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!L1[e]||e==="opacity")}var Htr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jtr=mh.length;function eYe(e,t,r){let n="",o=!0;for(let a=0;a<jtr;a++){let i=mh[a],s=e[i];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(i.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||r){let c=pF(s,k1[i]);if(!l){o=!1;let u=Htr[i]||i;n+=`${u}(${c}) `}r&&(t[i]=c)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}function yM(e,t,r){let{style:n,vars:o,transformOrigin:a}=e,i=!1,s=!1;for(let l in t){let c=t[l];if(Df.has(l)){i=!0;continue}else if(y1(l)){o[l]=c;continue}else{let u=pF(c,k1[l]);l.startsWith("origin")?(s=!0,a[l]=u):n[l]=u}}if(t.transform||(i||r?n.transform=eYe(t,e.transform,r):n.transform&&(n.transform="none")),s){let{originX:l="50%",originY:c="50%",originZ:u=0}=a;n.transformOrigin=`${l} ${c} ${u}`}}var xM=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jce(e,t,r){for(let n in t)!Io(t[n])&&!lG(n,r)&&(e[n]=t[n])}function $tr({transformTemplate:e},t){return(0,tYe.useMemo)(()=>{let r=xM();return yM(r,t,e),Object.assign({},r.vars,r.style)},[t])}function qtr(e,t){let r=e.style||{},n={};return jce(n,r,e),Object.assign(n,$tr(e,t)),n}function rYe(e,t){let r={},n=qtr(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var oYe=D(lt(),1);var Wtr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gtr={offset:"strokeDashoffset",array:"strokeDasharray"};function nYe(e,t,r=1,n=0,o=!0){e.pathLength=1;let a=o?Wtr:Gtr;e[a.offset]=mr.transform(-n);let i=mr.transform(t),s=mr.transform(r);e[a.array]=`${i} ${s}`}function cG(e,{attrX:t,attrY:r,attrScale:n,pathLength:o,pathSpacing:a=1,pathOffset:i=0,...s},l,c,u){if(yM(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),n!==void 0&&(d.scale=n),o!==void 0&&nYe(d,o,a,i,!1)}var uG=()=>({...xM(),attrs:{}});var dG=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aYe(e,t,r,n){let o=(0,oYe.useMemo)(()=>{let a=uG();return cG(a,t,dG(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){let a={};jce(a,e.style,e),o.style={...a,...o.style}}return o}var iYe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function bM(e){return typeof e!="string"||e.includes("-")?!1:!!(iYe.indexOf(e)>-1||/[A-Z]/u.test(e))}function sYe(e,t,r,{latestValues:n},o,a=!1){let s=(bM(e)?aYe:rYe)(t,n,o,e),l=KXe(t,typeof e=="string",a),c=e!==wM.Fragment?{...l,...s,ref:r}:{},{children:u}=t,d=(0,wM.useMemo)(()=>Io(u)?u.get():u,[u]);return(0,wM.createElement)(e,{...c,children:d})}var $ce=D(lt(),1);function lYe(e){let t=[{},{}];return e?.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function CM(e,t,r,n){if(typeof t=="function"){let[o,a]=lYe(n);t=t(r!==void 0?r:e.custom,o,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,a]=lYe(n);t=t(r!==void 0?r:e.custom,o,a)}return t}function SM(e){return Io(e)?e.get():e}function Ktr({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,o){return{latestValues:Xtr(r,n,o,e),renderState:t()}}function Xtr(e,t,r,n){let o={},a=n(e,{});for(let f in a)o[f]=SM(a[f]);let{initial:i,animate:s}=e,l=A1(e),c=iG(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),s===void 0&&(s=t.animate));let u=r?r.initial===!1:!1;u=u||i===!1;let d=u?s:i;if(d&&typeof d!="boolean"&&!aw(d)){let f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){let m=CM(e,f[p]);if(m){let{transitionEnd:h,transition:g,...v}=m;for(let y in v){let x=v[y];if(Array.isArray(x)){let w=u?x.length-1:0;x=x[w]}x!==null&&(o[y]=x)}for(let y in h)o[y]=h[y]}}}return o}var fG=e=>(t,r)=>{let n=(0,$ce.useContext)(ow),o=(0,$ce.useContext)(X0),a=()=>Ktr(e,t,n,o);return r?a():ev(a)};function PM(e,t,r){let{style:n}=e,o={};for(let a in n)(Io(n[a])||t.style&&Io(t.style[a])||lG(a,e)||r?.getValue(a)?.liveStyle!==void 0)&&(o[a]=n[a]);return o}var cYe=fG({scrapeMotionValuesFromProps:PM,createRenderState:xM});function pG(e,t,r){let n=PM(e,t,r);for(let o in e)if(Io(e[o])||Io(t[o])){let a=mh.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;n[a]=e[o]}return n}var uYe=fG({scrapeMotionValuesFromProps:pG,createRenderState:uG});var dYe=Symbol.for("motionComponentSymbol");var fYe=D(lt(),1);function sx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function pYe(e,t,r){return(0,fYe.useCallback)(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):sx(r)&&(r.current=n))},[t])}var Md=D(lt(),1);var IM=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Ytr="framerAppearId",mG="data-"+IM(Ytr);var mYe=D(lt(),1),hG=(0,mYe.createContext)({});function hYe(e,t,r,n,o){let{visualElement:a}=(0,Md.useContext)(ow),i=(0,Md.useContext)(oG),s=(0,Md.useContext)(X0),l=(0,Md.useContext)(rw).reducedMotion,c=(0,Md.useRef)(null);n=n||i.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:a,props:r,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));let u=c.current,d=(0,Md.useContext)(hG);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&Qtr(c.current,r,o,d);let f=(0,Md.useRef)(!1);(0,Md.useInsertionEffect)(()=>{u&&f.current&&u.update(r,s)});let p=r[mG],m=(0,Md.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return cM(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,Md.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),m.current=!1),u.enteringChildren=void 0)}),u}function Qtr(e,t,r,n){let{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:gYe(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&sx(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:c})}function gYe(e){if(e)return e.options.allowProjection!==!1?e.projection:gYe(e.parent)}function vG(e,{forwardMotionProps:t=!1}={},r,n){r&&WXe(r);let o=bM(e)?uYe:cYe;function a(s,l){let c,u={...(0,kM.useContext)(rw),...s,layoutId:Ztr(s)},{isStatic:d}=u,f=ZXe(s),p=o(s,d);if(!d&&lM){Jtr(u,r);let m=err(u);c=m.MeasureLayout,f.visualElement=hYe(e,p,u,n,m.ProjectionNode)}return(0,gG.jsxs)(ow.Provider,{value:f,children:[c&&f.visualElement?(0,gG.jsx)(c,{visualElement:f.visualElement,...u}):null,sYe(e,s,pYe(p,f.visualElement,l),p,d,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;let i=(0,kM.forwardRef)(a);return i[dYe]=e,i}function Ztr({layoutId:e}){let t=(0,kM.useContext)(sM).id;return t&&e!==void 0?t+"-"+e:e}function Jtr(e,t){let r=(0,kM.useContext)(oG).strict}function err(e){let{drag:t,layout:r}=ax;if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function vYe(e,t){if(typeof Proxy>"u")return vG;let r=new Map,n=(a,i)=>vG(a,i,e,t),o=(a,i)=>n(a,i);return new Proxy(o,{get:(a,i)=>i==="create"?n:(r.has(i)||r.set(i,vG(i,void 0,e,t)),r.get(i))})}var EYe=D(lt(),1);function yG({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function yYe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xYe(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function qce(e){return e===void 0||e===1}function xG({scale:e,scaleX:t,scaleY:r}){return!qce(e)||!qce(t)||!qce(r)}function lx(e){return xG(e)||Wce(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wce(e){return bYe(e.x)||bYe(e.y)}function bYe(e){return e&&e!=="0%"}function CF(e,t,r){let n=e-r,o=t*n;return r+o}function wYe(e,t,r,n,o){return o!==void 0&&(e=CF(e,o,n)),CF(e,r,n)+t}function Gce(e,t=0,r=1,n,o){e.min=wYe(e.min,t,r,n,o),e.max=wYe(e.max,t,r,n,o)}function Kce(e,{x:t,y:r}){Gce(e.x,t.translate,t.scale,t.originPoint),Gce(e.y,r.translate,r.scale,r.originPoint)}var CYe=.999999999999,SYe=1.0000000000001;function IYe(e,t,r,n=!1){let o=r.length;if(!o)return;t.x=t.y=1;let a,i;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;let{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&E1(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Kce(e,i)),n&&lx(a.latestValues)&&E1(e,a.latestValues))}t.x<SYe&&t.x>CYe&&(t.x=1),t.y<SYe&&t.y>CYe&&(t.y=1)}function iw(e,t){e.min=e.min+t,e.max=e.max+t}function PYe(e,t,r,n,o=.5){let a=Ln(e.min,e.max,o);Gce(e,t,r,a,n)}function E1(e,t){PYe(e.x,t.x,t.scaleX,t.scale,t.originX),PYe(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xce(e,t){return yG(xYe(e.getBoundingClientRect(),t))}function kYe(e,t,r){let n=Xce(e,r),{scroll:o}=t;return o&&(iw(n.x,o.offset.x),iw(n.y,o.offset.y)),n}var RYe=()=>({translate:0,scale:1,origin:0,originPoint:0}),D1=()=>({x:RYe(),y:RYe()}),NYe=()=>({min:0,max:0}),da=()=>({x:NYe(),y:NYe()});var SF={current:null},bG={current:!1};function MYe(){if(bG.current=!0,!!lM)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>SF.current=e.matches;e.addEventListener("change",t),t()}else SF.current=!1}var sw=new WeakMap;function TYe(e,t,r){for(let n in t){let o=t[n],a=r[n];if(Io(o))e.addValue(n,o);else if(Io(a))e.addValue(n,Nd(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){let i=e.getValue(n);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{let i=e.getStaticValue(n);e.addValue(n,Nd(i!==void 0?i:o,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var AYe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],RM=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:o,blockInitialAnimation:a,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=nx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let f=Qi.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,dn.render(this.render,!1,!0))};let{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=A1(r),this.isVariantNode=iG(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in d){let p=d[f];l[f]!==void 0&&Io(p)&&p.set(l[f])}}mount(t){this.current=t,sw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),bG.current||MYe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:SF.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Hc(this.notifyUpdate),Hc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let n=Df.has(t);n&&this.onBindTransform&&this.onBindTransform();let o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&dn.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ax){let r=ax[t];if(!r)continue;let{isEnabled:n,Feature:o}=r;if(!this.features[t]&&o&&n(this.props)&&(this.features[t]=new o(this)),this.features[t]){let a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):da()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<AYe.length;n++){let o=AYe[n];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let a="on"+o,i=t[a];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=TYe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Nd(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(O_(n)||F_(n))?n=parseFloat(n):!Vce(n)&&$c.test(r)&&(n=uF(t,r)),this.setBaseTarget(t,Io(n)?n.get():n)),Io(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let a=CM(this.props,r,this.presenceContext?.custom);a&&(n=a[t])}if(r&&n!==void 0)return n;let o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Io(o)?o:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Jy),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){N1.render(this.render)}};var NM=class extends RM{constructor(){super(...arguments),this.KeyframeResolver=dF}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Io(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function wG(e,{style:t,vars:r},n,o){let a=e.style,i;for(i in t)a[i]=t[i];o?.applyProjectionStyles(a,n);for(i in r)a.setProperty(i,r[i])}function trr(e){return window.getComputedStyle(e)}var MM=class extends NM{constructor(){super(...arguments),this.type="html",this.renderInstance=wG}readValueFromInstance(t,r){if(Df.has(r))return this.projection?.isProjecting?nF(r):bce(t,r);{let n=trr(t),o=(y1(r)?n.getPropertyValue(r):n[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Xce(t,r)}build(t,r,n){yM(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return PM(t,r,n)}};var CG=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function LYe(e,t,r,n){wG(e,t,void 0,n);for(let o in t.attrs)e.setAttribute(CG.has(o)?o:IM(o),t.attrs[o])}var TM=class extends NM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=da}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Df.has(r)){let n=cF(r);return n&&n.default||0}return r=CG.has(r)?r:IM(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return pG(t,r,n)}build(t,r,n){cG(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,o){LYe(t,r,n,o)}mount(t){this.isSVGTag=dG(t.tagName),super.mount(t)}};var DYe=(e,t)=>bM(e)?new TM(t):new MM(t,{allowProjection:e!==EYe.Fragment});function ov(e,t,r){let n=e.getProps();return CM(n,t,r!==void 0?r:n.custom,e)}var PF=e=>Array.isArray(e);function rrr(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Nd(r))}function nrr(e){return PF(e)?e[e.length-1]||0:e}function OYe(e,t){let r=ov(e,t),{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(let i in a){let s=nrr(a[i]);rrr(e,i,s)}}function _Ye(e){return!!(Io(e)&&e.add)}function IF(e,t){let r=e.getValue("willChange");if(_Ye(r))return r.add(t);if(!r&&zc.WillChange){let n=new zc.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function SG(e){return e.props[mG]}var orr=e=>e!==null;function FYe(e,{repeat:t,repeatType:r="loop"},n){let o=e.filter(orr),a=t&&r!=="loop"&&t%2===1?0:o.length-1;return!a||n===void 0?o[a]:n}var arr={type:"spring",stiffness:500,damping:25,restSpeed:10},irr=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),srr={type:"keyframes",duration:.8},lrr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BYe=(e,{keyframes:t})=>t.length>2?srr:Df.has(e)?e.startsWith("scale")?irr(t[1]):arr:lrr;function VYe({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}var AM=(e,t,r,n={},o,a)=>i=>{let s=I1(n,e)||{},l=s.delay||n.delay||0,{elapsed:c=0}=n;c=c-ds(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};VYe(s)||Object.assign(u,BYe(e,u)),u.duration&&(u.duration=ds(u.duration)),u.repeatDelay&&(u.repeatDelay=ds(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gM(u),u.delay===0&&(d=!0)),(zc.instantAnimations||zc.skipAnimations)&&(d=!0,gM(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let f=FYe(u.keyframes,s);if(f!==void 0){dn.update(()=>{u.onUpdate(f),u.onComplete()});return}}return s.isSync?new rx(u):new aF(u)};function crr({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function LM(e,t,{delay:r=0,transitionOverride:n,type:o}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:i,...s}=t;n&&(a=n);let l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let u in s){let d=e.getValue(u,e.latestValues[u]??null),f=s[u];if(f===void 0||c&&crr(c,u))continue;let p={delay:r,...I1(a||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===m&&!p.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){let v=SG(e);if(v){let y=window.MotionHandoffAnimation(v,u,dn);y!==null&&(p.startTime=y,h=!0)}}IF(e,u),d.start(AM(u,d,f,e.shouldReduceMotion&&sF.has(u)?{type:!1}:p,e,h));let g=d.animation;g&&l.push(g)}return i&&Promise.all(l).then(()=>{dn.update(()=>{i&&OYe(e,i)})}),l}function PG(e,t,r,n=0,o=1){let a=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),i=e.size,s=(i-1)*n;return typeof r=="function"?r(a,i):o===1?a*n:s-a*n}function IG(e,t,r={}){let n=ov(e,t,r.type==="exit"?e.presenceContext?.custom:void 0),{transition:o=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(o=r.transitionOverride);let a=n?()=>Promise.all(LM(e,n,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=o;return urr(e,t,l,c,u,d,r)}:()=>Promise.resolve(),{when:s}=o;if(s){let[l,c]=s==="beforeChildren"?[a,i]:[i,a];return l().then(()=>c())}else return Promise.all([a(),i(r.delay)])}function urr(e,t,r=0,n=0,o=0,a=1,i){let s=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),s.push(IG(l,t,{...i,delay:r+(typeof n=="function"?0:n)+PG(e.variantChildren,l,n,o,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function UYe(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let o=t.map(a=>IG(e,a,r));n=Promise.all(o)}else if(typeof t=="string")n=IG(e,t,r);else{let o=typeof t=="function"?ov(e,t,r.custom):t;n=Promise.all(LM(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function Yce(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var drr=wF.length;function Qce(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?Qce(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<drr;r++){let n=wF[r],o=e.props[n];(ix(o)||o===!1)&&(t[n]=o)}return t}var frr=[...aG].reverse(),prr=aG.length;function mrr(e){return t=>Promise.all(t.map(({animation:r,options:n})=>UYe(e,r,n)))}function HYe(e){let t=mrr(e),r=zYe(),n=!0,o=l=>(c,u)=>{let d=ov(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(d){let{transition:f,transitionEnd:p,...m}=d;c={...c,...m,...p}}return c};function a(l){t=l(e)}function i(l){let{props:c}=e,u=Qce(e.parent)||{},d=[],f=new Set,p={},m=1/0;for(let g=0;g<prr;g++){let v=frr[g],y=r[v],x=c[v]!==void 0?c[v]:u[v],w=ix(x),b=v===l?y.isActive:null;b===!1&&(m=g);let C=x===u[v]&&x!==c[v]&&w;if(C&&n&&e.manuallyAnimateOnMount&&(C=!1),y.protectedKeys={...p},!y.isActive&&b===null||!x&&!y.prevProp||aw(x)||typeof x=="boolean")continue;let S=hrr(y.prevProp,x),P=S||v===l&&y.isActive&&!C&&w||g>m&&w,N=!1,T=Array.isArray(x)?x:[x],A=T.reduce(o(v),{});b===!1&&(A={});let{prevResolvedValues:M={}}=y,O={...M,...A},F=R=>{P=!0,f.has(R)&&(N=!0,f.delete(R)),y.needsAnimating[R]=!0;let E=e.getValue(R);E&&(E.liveStyle=!1)};for(let R in O){let E=A[R],_=M[R];if(p.hasOwnProperty(R))continue;let U=!1;PF(E)&&PF(_)?U=!Yce(E,_):U=E!==_,U?E!=null?F(R):f.add(R):E!==void 0&&f.has(R)?F(R):y.protectedKeys[R]=!0}y.prevProp=x,y.prevResolvedValues=A,y.isActive&&(p={...p,...A}),n&&e.blockInitialAnimation&&(P=!1);let I=C&&S;P&&(!I||N)&&d.push(...T.map(R=>{let E={type:v};if(typeof R=="string"&&n&&!I&&e.manuallyAnimateOnMount&&e.parent){let{parent:_}=e,U=ov(_,R);if(_.enteringChildren&&U){let{delayChildren:V}=U.transition||{};E.delay=PG(_.enteringChildren,e,V)}}return{animation:R,options:E}}))}if(f.size){let g={};if(typeof c.initial!="boolean"){let v=ov(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(g.transition=v.transition)}f.forEach(v=>{let y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),g[v]=y??null}),d.push({animation:g})}let h=!!d.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(h=!1),n=!1,h?t(d):Promise.resolve()}function s(l,c){if(r[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,c)),r[l].isActive=c;let u=i(l);for(let d in r)r[d].protectedKeys={};return u}return{animateChanges:i,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=zYe(),n=!0}}}function hrr(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Yce(t,e):!1}function O1(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zYe(){return{animate:O1(!0),whileInView:O1(),whileHover:O1(),whileTap:O1(),whileDrag:O1(),whileFocus:O1(),exit:O1()}}var Ol=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var kG=class extends Ol{constructor(t){super(t),t.animationState||(t.animationState=HYe(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();aw(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};var grr=0,RG=class extends Ol{constructor(){super(...arguments),this.id=grr++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>{r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var jYe={animation:{Feature:kG},exit:{Feature:RG}};function cx(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function ux(e){return{point:{x:e.pageX,y:e.pageY}}}var $Ye=e=>t=>M1(t)&&e(t,ux(t));function lw(e,t,r,n){return cx(e,t,$Ye(r),n)}var KYe=1e-4,vrr=1-KYe,yrr=1+KYe,XYe=.01,xrr=0-XYe,brr=0+XYe;function ll(e){return e.max-e.min}function YYe(e,t,r){return Math.abs(e-t)<=r}function qYe(e,t,r,n=.5){e.origin=n,e.originPoint=Ln(t.min,t.max,e.origin),e.scale=ll(r)/ll(t),e.translate=Ln(r.min,r.max,e.origin)-e.originPoint,(e.scale>=vrr&&e.scale<=yrr||isNaN(e.scale))&&(e.scale=1),(e.translate>=xrr&&e.translate<=brr||isNaN(e.translate))&&(e.translate=0)}function EM(e,t,r,n){qYe(e.x,t.x,r.x,n?n.originX:void 0),qYe(e.y,t.y,r.y,n?n.originY:void 0)}function WYe(e,t,r){e.min=r.min+t.min,e.max=e.min+ll(t)}function QYe(e,t,r){WYe(e.x,t.x,r.x),WYe(e.y,t.y,r.y)}function GYe(e,t,r){e.min=t.min-r.min,e.max=e.min+ll(t)}function DM(e,t,r){GYe(e.x,t.x,r.x),GYe(e.y,t.y,r.y)}function Td(e){return[e("x"),e("y")]}var NG=({current:e})=>e?e.ownerDocument.defaultView:null;var ZYe=(e,t)=>Math.abs(e-t);function JYe(e,t){let r=ZYe(e.x,t.x),n=ZYe(e.y,t.y);return Math.sqrt(r**2+n**2)}var OM=class{constructor(t,r,{transformPagePoint:n,contextWindow:o=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=Jce(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=JYe(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;let{point:h}=f,{timestamp:g}=Yi;this.history.push({...h,timestamp:g});let{onStart:v,onMove:y}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Zce(p,this.transformPagePoint),dn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();let{onEnd:m,onSessionEnd:h,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=Jce(f.type==="pointercancel"?this.lastMoveEventInfo:Zce(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),h&&h(f,v)},!M1(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=o||window;let s=ux(t),l=Zce(s,this.transformPagePoint),{point:c}=l,{timestamp:u}=Yi;this.history=[{...c,timestamp:u}];let{onSessionStart:d}=r;d&&d(t,Jce(l,this.history)),this.removeListeners=dh(lw(this.contextWindow,"pointermove",this.handlePointerMove),lw(this.contextWindow,"pointerup",this.handlePointerUp),lw(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hc(this.updatePoint)}};function Zce(e,t){return t?{point:t(e.point)}:e}function eQe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jce({point:e},t){return{point:e,delta:eQe(e,tQe(t)),offset:eQe(e,wrr(t)),velocity:Crr(t,.1)}}function wrr(e){return e[0]}function tQe(e){return e[e.length-1]}function Crr(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,o=tQe(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>ds(t)));)r--;if(!n)return{x:0,y:0};let a=lc(o.timestamp-n.timestamp);if(a===0)return{x:0,y:0};let i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function iQe(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?Ln(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?Ln(r,e,n.max):Math.min(e,r)),e}function rQe(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function sQe(e,{top:t,left:r,bottom:n,right:o}){return{x:rQe(e.x,r,o),y:rQe(e.y,t,n)}}function nQe(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function lQe(e,t){return{x:nQe(e.x,t.x),y:nQe(e.y,t.y)}}function cQe(e,t){let r=.5,n=ll(e),o=ll(t);return o>n?r=Zp(t.min,t.max-n,e.min):n>o&&(r=Zp(e.min,e.max-o,t.min)),Dl(0,1,r)}function uQe(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var MG=.35;function dQe(e=MG){return e===!1?e=0:e===!0&&(e=MG),{x:oQe(e,"left","right"),y:oQe(e,"top","bottom")}}function oQe(e,t,r){return{min:aQe(e,t),max:aQe(e,r)}}function aQe(e,t){return typeof e=="number"?e:e[t]||0}var Srr=new WeakMap,AG=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=da(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;let a=d=>{let{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(ux(d).point)},i=(d,f)=>{let{drag:p,dragPropagation:m,onDragStart:h}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ece(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Td(v=>{let y=this.getAxisMotionValue(v).get()||0;if(jc.test(y)){let{projection:x}=this.visualElement;if(x&&x.layout){let w=x.layout.layoutBox[v];w&&(y=ll(w)*(parseFloat(y)/100))}}this.originPoint[v]=y}),h&&dn.postRender(()=>h(d,f)),IF(this.visualElement,"transform");let{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},s=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;let{dragPropagation:p,dragDirectionLock:m,onDirectionLock:h,onDrag:g}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=Prr(v),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Td(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new OM(t,{onSessionStart:a,onStart:i,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:NG(this.visualElement)})}stop(t,r){let n=t||this.latestPointerEvent,o=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!o||!n)return;let{velocity:i}=o;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&dn.postRender(()=>s(n,o))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){let{drag:o}=this.getProps();if(!n||!TG(t,o,this.currentDirection))return;let a=this.getAxisMotionValue(t),i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=iQe(i,this.constraints[t],this.elastic[t])),a.set(i)}resolveConstraints(){let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&sx(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=sQe(n.layoutBox,t):this.constraints=!1,this.elastic=dQe(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Td(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=uQe(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!sx(t))return!1;let n=t.current;sc(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let a=kYe(n,o.root,this.visualElement.getTransformPagePoint()),i=lQe(o.layout.layoutBox,a);if(r){let s=r(yYe(i));this.hasMutatedConstraints=!!s,s&&(i=yG(s))}return i}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:o,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},c=Td(u=>{if(!TG(u,r,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});let f=o?200:1e6,p=o?40:1e7,m={type:"inertia",velocity:n?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(s)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return IF(this.visualElement,t),n.start(AM(t,n,0,r,this.visualElement,!1))}stopAnimation(){Td(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Td(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),o=n[r];return o||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Td(r=>{let{drag:n}=this.getProps();if(!TG(r,n,this.currentDirection))return;let{projection:o}=this.visualElement,a=this.getAxisMotionValue(r);if(o&&o.layout){let{min:i,max:s}=o.layout.layoutBox[r];a.set(t[r]-Ln(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!sx(r)||!n||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};Td(i=>{let s=this.getAxisMotionValue(i);if(s&&this.constraints!==!1){let l=s.get();o[i]=cQe({min:l,max:l},this.constraints[i])}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Td(i=>{if(!TG(i,t,null))return;let s=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];s.set(Ln(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;Srr.set(this.visualElement,this);let t=this.visualElement.current,r=lw(t,"pointerdown",l=>{let{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),n=()=>{let{dragConstraints:l}=this.getProps();sx(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",n);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dn.read(n);let i=cx(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Td(u=>{let d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),r(),a(),s&&s()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:a=!1,dragElastic:i=MG,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:o,dragConstraints:a,dragElastic:i,dragMomentum:s}}};function TG(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Prr(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var LG=class extends Ol{constructor(t){super(t),this.removeGroupControls=Ei,this.removeListeners=Ei,this.controls=new AG(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ei}unmount(){this.removeGroupControls(),this.removeListeners()}};var fQe=e=>(t,r)=>{e&&dn.postRender(()=>e(t,r))},EG=class extends Ol{constructor(){super(...arguments),this.removePointerDownListener=Ei}onPointerDown(t){this.session=new OM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:NG(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:o}=this.node.getProps();return{onSessionStart:fQe(t),onStart:fQe(r),onMove:n,onEnd:(a,i)=>{delete this.session,o&&dn.postRender(()=>o(a,i))}}}mount(){this.removePointerDownListener=lw(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var hQe=D(Or(),1);var kF=D(lt(),1);var _M={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pQe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var FM={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(mr.test(e))e=parseFloat(e);else return e;let r=pQe(e,t.target.x),n=pQe(e,t.target.y);return`${r}% ${n}%`}};var mQe={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,o=$c.parse(e);if(o.length>5)return n;let a=$c.createTransformer(e),i=typeof o[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;let c=Ln(s,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),a(o)}};var eue=!1,tue=class extends kF.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:o}=this.props,{projection:a}=t;JXe(Irr),a&&(r.group&&r.group.add(a),n&&n.register&&o&&n.register(a),eue&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),_M.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:o,isPresent:a}=this.props,{projection:i}=n;return i&&(i.isPresent=a,eue=!0,o||t.layoutDependency!==r||r===void 0||t.isPresent!==a?i.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?i.promote():i.relegate()||dn.postRender(()=>{let s=i.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),N1.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:o}=t;eue=!0,o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),n&&n.deregister&&n.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function DG(e){let[t,r]=rG(),n=(0,kF.useContext)(sM);return(0,hQe.jsx)(tue,{...e,layoutGroup:n,switchLayoutGroup:(0,kF.useContext)(hG),isPresent:t,safeToRemove:r})}var Irr={borderRadius:{...FM,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:FM,borderTopRightRadius:FM,borderBottomLeftRadius:FM,borderBottomRightRadius:FM,boxShadow:mQe};function OG(e,t,r){let n=Io(e)?e:Nd(e);return n.start(AM("",n,t,r)),n.animation}var gQe=(e,t)=>e.depth-t.depth;var _G=class{constructor(){this.children=[],this.isDirty=!1}add(t){g1(this.children,t),this.isDirty=!0}remove(t){uh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gQe),this.isDirty=!1,this.children.forEach(t)}};function vQe(e,t){let r=Qi.now(),n=({timestamp:o})=>{let a=o-r;a>=t&&(Hc(n),e(a-t))};return dn.setup(n,!0),()=>Hc(n)}var wQe=["TopLeft","TopRight","BottomLeft","BottomRight"],krr=wQe.length,yQe=e=>typeof e=="string"?parseFloat(e):e,xQe=e=>typeof e=="number"||mr.test(e);function CQe(e,t,r,n,o,a){o?(e.opacity=Ln(0,r.opacity??1,Rrr(n)),e.opacityExit=Ln(t.opacity??1,0,Nrr(n))):a&&(e.opacity=Ln(t.opacity??1,r.opacity??1,n));for(let i=0;i<krr;i++){let s=`border${wQe[i]}Radius`,l=bQe(t,s),c=bQe(r,s);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||xQe(l)===xQe(c)?(e[s]=Math.max(Ln(yQe(l),yQe(c),n),0),(jc.test(c)||jc.test(l))&&(e[s]+="%")):e[s]=c}(t.rotate||r.rotate)&&(e.rotate=Ln(t.rotate||0,r.rotate||0,n))}function bQe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Rrr=SQe(0,.5,H_),Nrr=SQe(.5,.95,Ei);function SQe(e,t,r){return n=>n<e?0:n>t?1:r(Zp(e,t,n))}function PQe(e,t){e.min=t.min,e.max=t.max}function Of(e,t){PQe(e.x,t.x),PQe(e.y,t.y)}function rue(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function IQe(e,t,r,n,o){return e-=t,e=CF(e,1/r,n),o!==void 0&&(e=CF(e,1/o,n)),e}function Mrr(e,t=0,r=1,n=.5,o,a=e,i=e){if(jc.test(t)&&(t=parseFloat(t),t=Ln(i.min,i.max,t/100)-i.min),typeof t!="number")return;let s=Ln(a.min,a.max,n);e===a&&(s-=t),e.min=IQe(e.min,t,r,s,o),e.max=IQe(e.max,t,r,s,o)}function kQe(e,t,[r,n,o],a,i){Mrr(e,t[r],t[n],t[o],t.scale,a,i)}var Trr=["x","scaleX","originX"],Arr=["y","scaleY","originY"];function nue(e,t,r,n){kQe(e.x,t,Trr,r?r.x:void 0,n?n.x:void 0),kQe(e.y,t,Arr,r?r.y:void 0,n?n.y:void 0)}function RQe(e){return e.translate===0&&e.scale===1}function oue(e){return RQe(e.x)&&RQe(e.y)}function NQe(e,t){return e.min===t.min&&e.max===t.max}function TQe(e,t){return NQe(e.x,t.x)&&NQe(e.y,t.y)}function MQe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aue(e,t){return MQe(e.x,t.x)&&MQe(e.y,t.y)}function iue(e){return ll(e.x)/ll(e.y)}function sue(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var FG=class{constructor(){this.members=[]}add(t){g1(this.members,t),t.scheduleRender()}remove(t){if(uh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(o=>t===o);if(r===0)return!1;let n;for(let o=r;o>=0;o--){let a=this.members[o];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function AQe(e,t,r){let n="",o=e.x.translate/t.x,a=e.y.translate/t.y,i=r?.z||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=r;c&&(n=`perspective(${c}px) ${n}`),u&&(n+=`rotate(${u}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}let s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}var _1={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},lue=["","X","Y","Z"],Lrr=1e3,Err=0;function cue(e,t,r,n){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function UQe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=SG(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",dn,!(o||a))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&UQe(n)}function BG({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(i={},s=t?.()){this.id=Err++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Rd.value&&(_1.nodes=_1.calculatedTargetDeltas=_1.calculatedProjections=0),this.nodes.forEach(_rr),this.nodes.forEach(Urr),this.nodes.forEach(zrr),this.nodes.forEach(Frr),Rd.addProjectionMetrics&&Rd.addProjectionMetrics(_1)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new _G)}addEventListener(i,s){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Jy),this.eventHandlers.get(i).add(s)}notifyListeners(i,...s){let l=this.eventHandlers.get(i);l&&l.notify(...s)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=T1(i)&&!hF(i),this.instance=i;let{layoutId:s,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),e){let u,d=0,f=()=>this.root.updateBlockedByResize=!1;dn.read(()=>{d=window.innerWidth}),e(i,()=>{let p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=vQe(f,250),_M.hasAnimatedSinceResize&&(_M.hasAnimatedSinceResize=!1,this.nodes.forEach(DQe)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let m=this.options.transition||c.getDefaultTransition()||Wrr,{onLayoutAnimationStart:h,onLayoutAnimationComplete:g}=c.getProps(),v=!this.targetLayout||!aue(this.targetLayout,p),y=!d&&f;if(this.options.layoutRoot||this.resumeFrom||y||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let x={...I1(m,"layout"),onPlay:h,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else d||DQe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Hc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Hrr),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&UQe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){let d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(LQe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(EQe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vrr),this.nodes.forEach(Drr),this.nodes.forEach(Orr)):this.nodes.forEach(EQe),this.clearAllSnapshots();let s=Qi.now();Yi.delta=Dl(0,1e3/60,s-Yi.timestamp),Yi.timestamp=s,Yi.isProcessing=!0,X_.update.process(Yi),X_.preRender.process(Yi),X_.render.process(Yi),Yi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,N1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Brr),this.sharedNodes.forEach(jrr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ll(this.snapshot.measuredBox.x)&&!ll(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=da(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(s=!1),s&&this.instance){let l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!oue(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&this.instance&&(s||lx(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let s=this.measurePageBox(),l=this.removeElementScroll(s);return i&&(l=this.removeTransform(l)),Grr(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:i}=this.options;if(!i)return da();let s=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Krr))){let{scroll:c}=this.root;c&&(iw(s.x,c.offset.x),iw(s.y,c.offset.y))}return s}removeElementScroll(i){let s=da();if(Of(s,i),this.scroll?.wasRoot)return s;for(let l=0;l<this.path.length;l++){let c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&Of(s,i),iw(s.x,u.offset.x),iw(s.y,u.offset.y))}return s}applyTransform(i,s=!1){let l=da();Of(l,i);for(let c=0;c<this.path.length;c++){let u=this.path[c];!s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&E1(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),lx(u.latestValues)&&E1(l,u.latestValues)}return lx(this.latestValues)&&E1(l,this.latestValues),l}removeTransform(i){let s=da();Of(s,i);for(let l=0;l<this.path.length;l++){let c=this.path[l];if(!c.instance||!lx(c.latestValues))continue;xG(c.latestValues)&&c.updateSnapshot();let u=da(),d=c.measurePageBox();Of(u,d),nue(s,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return lx(this.latestValues)&&nue(s,this.latestValues),s}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Yi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==s;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Yi.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=da(),this.relativeTargetOrigin=da(),DM(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Of(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=da(),this.targetWithTransforms=da()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QYe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Of(this.target,this.layout.layoutBox),Kce(this.target,this.targetDelta)):Of(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=da(),this.relativeTargetOrigin=da(),DM(this.relativeTargetOrigin,this.target,f.target),Of(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Rd.value&&_1.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||xG(this.parent.latestValues)||Wce(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let i=this.getLead(),s=!!this.resumingFrom||this!==i,l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Yi.timestamp&&(l=!1),l)return;let{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Of(this.layoutCorrected,this.layout.layoutBox);let d=this.treeScale.x,f=this.treeScale.y;IYe(this.layoutCorrected,this.treeScale,this.path,s),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=da());let{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(rue(this.prevProjectionDelta.x,this.projectionDelta.x),rue(this.prevProjectionDelta.y,this.projectionDelta.y)),EM(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!sue(this.projectionDelta.x,this.prevProjectionDelta.x)||!sue(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Rd.value&&_1.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){let s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=D1(),this.projectionDelta=D1(),this.projectionDeltaWithTransform=D1()}setAnimationOrigin(i,s=!1){let l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=D1();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;let f=da(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,h=p!==m,g=this.getStack(),v=!g||g.members.length<=1,y=!!(h&&!v&&this.options.crossfade===!0&&!this.path.some(qrr));this.animationProgress=0;let x;this.mixTargetDelta=w=>{let b=w/1e3;OQe(d.x,i.x,b),OQe(d.y,i.y,b),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(DM(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$rr(this.relativeTarget,this.relativeTargetOrigin,f,b),x&&TQe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=da()),Of(x,this.relativeTarget)),h&&(this.animationValues=u,CQe(u,c,this.latestValues,b,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Hc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dn.update(()=>{_M.hasAnimatedSinceResize=!0,fh.layout++,this.motionValue||(this.motionValue=Nd(0)),this.currentAnimation=OG(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),i.onUpdate&&i.onUpdate(s)},onStop:()=>{fh.layout--},onComplete:()=>{fh.layout--,i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Lrr),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:s,target:l,layout:c,latestValues:u}=i;if(!(!s||!l||!c)){if(this!==i&&this.layout&&c&&zQe(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||da();let d=ll(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;let f=ll(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}Of(s,l),E1(s,u),EM(this.projectionDeltaWithTransform,this.layoutCorrected,s,u)}}registerSharedNode(i,s){this.sharedNodes.has(i)||this.sharedNodes.set(i,new FG),this.sharedNodes.get(i).add(s);let c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){let{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:s,preserveFollowOpacity:l}={}){let c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let s=!1,{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;let c={};l.z&&cue("z",i,c,this.animationValues);for(let u=0;u<lue.length;u++)cue(`rotate${lue[u]}`,i,c,this.animationValues),cue(`skew${lue[u]}`,i,c,this.animationValues);i.render();for(let u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}applyProjectionStyles(i,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=SM(s?.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=SM(s?.pointerEvents)||""),this.hasProjected&&!lx(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";let u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=AQe(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),i.transform=d;let{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?i.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(let m in L1){if(u[m]===void 0)continue;let{correct:h,applyTo:g,isCSSVariable:v}=L1[m],y=d==="none"?u[m]:h(u[m],c);if(g){let x=g.length;for(let w=0;w<x;w++)i[g[w]]=y}else v?this.options.visualElement.renderState.vars[m]=y:i[m]=y}this.options.layoutId&&(i.pointerEvents=c===this?SM(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(LQe),this.root.sharedNodes.clear()}}}function Drr(e){e.updateLayout()}function Orr(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:o}=e.options,a=t.source!==e.layout.source;o==="size"?Td(u=>{let d=a?t.measuredBox[u]:t.layoutBox[u],f=ll(d);d.min=r[u].min,d.max=d.min+f}):zQe(o,t.layoutBox,r)&&Td(u=>{let d=a?t.measuredBox[u]:t.layoutBox[u],f=ll(r[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});let i=D1();EM(i,r,t.layoutBox);let s=D1();a?EM(s,e.applyTransform(n,!0),t.measuredBox):EM(s,r,t.layoutBox);let l=!oue(i),c=!1;if(!e.resumeFrom){let u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){let{snapshot:d,layout:f}=u;if(d&&f){let p=da();DM(p,t.layoutBox,d.layoutBox);let m=da();DM(m,r,f.layoutBox),aue(p,m)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _rr(e){Rd.value&&_1.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Frr(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Brr(e){e.clearSnapshot()}function LQe(e){e.clearMeasurements()}function EQe(e){e.isLayoutDirty=!1}function Vrr(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function DQe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Urr(e){e.resolveTargetDelta()}function zrr(e){e.calcProjection()}function Hrr(e){e.resetSkewAndRotation()}function jrr(e){e.removeLeadSnapshot()}function OQe(e,t,r){e.translate=Ln(t.translate,0,r),e.scale=Ln(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function _Qe(e,t,r,n){e.min=Ln(t.min,r.min,n),e.max=Ln(t.max,r.max,n)}function $rr(e,t,r,n){_Qe(e.x,t.x,r.x,n),_Qe(e.y,t.y,r.y,n)}function qrr(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Wrr={duration:.45,ease:[.4,0,.1,1]},FQe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),BQe=FQe("applewebkit/")&&!FQe("chrome/")?Math.round:Ei;function VQe(e){e.min=BQe(e.min),e.max=BQe(e.max)}function Grr(e){VQe(e.x),VQe(e.y)}function zQe(e,t,r){return e==="position"||e==="preserve-aspect"&&!YYe(iue(t),iue(r),.2)}function Krr(e){return e!==e.root&&e.scroll?.wasRoot}var HQe=BG({attachResizeListener:(e,t)=>cx(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var uue={current:void 0},VG=BG({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!uue.current){let e=new HQe({});e.mount(window),e.setOptions({layoutScroll:!0}),uue.current=e}return uue.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var jQe={pan:{Feature:EG},drag:{Feature:LG,ProjectionNode:VG,MeasureLayout:DG}};function $Qe(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,a=n[o];a&&dn.postRender(()=>a(t,ux(t)))}var UG=class extends Ol{mount(){let{current:t}=this.node;t&&(this.unmount=Dce(t,(r,n)=>($Qe(this.node,n,"Start"),o=>$Qe(this.node,o,"End"))))}unmount(){}};var zG=class extends Ol{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dh(cx(this.node.current,"focus",()=>this.onFocus()),cx(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function qQe(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),a=n[o];a&&dn.postRender(()=>a(t,ux(t)))}var HG=class extends Ol{mount(){let{current:t}=this.node;t&&(this.unmount=Fce(t,(r,n)=>(qQe(this.node,n,"Start"),(o,{success:a})=>qQe(this.node,o,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var fue=new WeakMap,due=new WeakMap,Xrr=e=>{let t=fue.get(e.target);t&&t(e)},Yrr=e=>{e.forEach(Xrr)};function Qrr({root:e,...t}){let r=e||document;due.has(r)||due.set(r,{});let n=due.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(Yrr,{root:e,...t})),n[o]}function WQe(e,t,r){let n=Qrr(t);return fue.set(e,r),n.observe(e),()=>{fue.delete(e),n.unobserve(e)}}var Zrr={some:0,all:1},jG=class extends Ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:o="some",once:a}=t,i={root:r?r.current:void 0,rootMargin:n,threshold:typeof o=="number"?o:Zrr[o]},s=l=>{let{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return WQe(this.node.current,i,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Jrr(t,r))&&this.startObserver()}unmount(){}};function Jrr({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var GQe={inView:{Feature:jG},tap:{Feature:HG},focus:{Feature:zG},hover:{Feature:UG}};var KQe={layout:{ProjectionNode:VG,MeasureLayout:DG}};var XQe={...jYe,...GQe,...jQe,...KQe};var Ad=vYe(XQe,DYe);var BM=D(lt(),1);function VM(e){let t=ev(()=>Nd(e)),{isStatic:r}=(0,BM.useContext)(rw);if(r){let[,n]=(0,BM.useState)(e);(0,BM.useEffect)(()=>t.on("change",n),[])}return t}function $G(e,t){let r=VM(t()),n=()=>r.set(t());return n(),cM(()=>{let o=()=>dn.preRender(n,!1,!0),a=e.map(i=>i.on("change",o));return()=>{a.forEach(i=>i()),Hc(n)}}),r}function YQe(e){R1.current=[],e();let t=$G(R1.current,e);return R1.current=void 0,t}function pue(e,t,r,n){if(typeof e=="function")return YQe(e);let o=typeof t=="function"?t:Bce(t,r,n);return Array.isArray(e)?QQe(e,o):QQe([e],([a])=>o(a))}function QQe(e,t){let r=ev(()=>[]);return $G(e,()=>{r.length=0;let n=e.length;for(let o=0;o<n;o++)r[o]=e[o].get();return t(r)})}function RF(e){return typeof e=="object"&&!Array.isArray(e)}function qG(e,t,r,n){return typeof e=="string"&&RF(t)?fF(e,r,n):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function ZQe(e,t,r){return e*(t+1)}function mue(e,t,r,n){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?r:t.startsWith("<")?Math.max(0,r+parseFloat(t.slice(1))):n.get(t)??e}function enr(e,t,r){for(let n=0;n<e.length;n++){let o=e[n];o.at>t&&o.at<r&&(uh(e,o),n--)}}function JQe(e,t,r,n,o,a){enr(e,o,a);for(let i=0;i<t.length;i++)e.push({value:t[i],at:Ln(o,a,n[i]),easing:W_(r,i)})}function eZe(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]/(t+1)}function tZe(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var tnr="easeInOut",rnr=20;function oZe(e,{defaultTransition:t={},...r}={},n,o){let a=t.duration||.3,i=new Map,s=new Map,l={},c=new Map,u=0,d=0,f=0;for(let p=0;p<e.length;p++){let m=e[p];if(typeof m=="string"){c.set(m,d);continue}else if(!Array.isArray(m)){c.set(m.name,mue(d,m.at,u,c));continue}let[h,g,v={}]=m;v.at!==void 0&&(d=mue(d,v.at,u,c));let y=0,x=(w,b,C,S=0,P=0)=>{let N=nnr(w),{delay:T=0,times:A=rF(N),type:M="keyframes",repeat:O,repeatType:F,repeatDelay:I=0,...k}=b,{ease:R=t.ease||"easeOut",duration:E}=b,_=typeof T=="function"?T(S,P):T,U=N.length,V=P1(M)?M:o?.[M||"keyframes"];if(U<=2&&V){let $=100;if(U===2&&inr(N)){let G=N[1]-N[0];$=Math.abs(G)}let W={...k};E!==void 0&&(W.duration=ds(E));let z=J_(W,$,V);R=z.ease,E=z.duration}E??(E=a);let L=d+_;A.length===1&&A[0]===0&&(A[1]=1);let H=A.length-N.length;if(H>0&&tF(A,H),N.length===1&&N.unshift(null),O){sc(O<rnr,"Repeat count too high, must be less than 20","repeat-count-high"),E=ZQe(E,O);let $=[...N],W=[...A];R=Array.isArray(R)?[...R]:[R];let z=[...R];for(let G=0;G<O;G++){N.push(...$);for(let X=0;X<$.length;X++)A.push(W[X]+(G+1)),R.push(X===0?"linear":W_(z,X-1))}eZe(A,O)}let j=L+E;JQe(C,N,R,A,L,j),y=Math.max(_+E,y),f=Math.max(j,f)};if(Io(h)){let w=rZe(h,s);x(g,v,nZe("default",w))}else{let w=qG(h,g,n,l),b=w.length;for(let C=0;C<b;C++){g=g,v=v;let S=w[C],P=rZe(S,s);for(let N in g)x(g[N],onr(v,N),nZe(N,P),C,b)}}u=d,d+=y}return s.forEach((p,m)=>{for(let h in p){let g=p[h];g.sort(tZe);let v=[],y=[],x=[];for(let b=0;b<g.length;b++){let{at:C,value:S,easing:P}=g[b];v.push(S),y.push(Zp(0,f,C)),x.push(P||"easeOut")}y[0]!==0&&(y.unshift(0),v.unshift(v[0]),x.unshift(tnr)),y[y.length-1]!==1&&(y.push(1),v.push(null)),i.has(m)||i.set(m,{keyframes:{},transition:{}});let w=i.get(m);w.keyframes[h]=v,w.transition[h]={...t,duration:f,ease:x,times:y,...r}}}),i}function rZe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function nZe(e,t){return t[e]||(t[e]=[]),t[e]}function nnr(e){return Array.isArray(e)?e:[e]}function onr(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var anr=e=>typeof e=="number",inr=e=>e.every(anr);function snr(e,t){return e in t}var WG=class extends RM{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,r){if(snr(r,t)){let n=t[r];if(typeof n=="string"||typeof n=="number")return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,r){delete r.output[t]}measureInstanceViewportBox(){return da()}build(t,r){Object.assign(t.output,r)}renderInstance(t,{output:r}){Object.assign(t,r)}sortInstanceNodePosition(){return 0}};function aZe(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=T1(e)&&!hF(e)?new TM(t):new MM(t);r.mount(e),sw.set(e,r)}function iZe(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},r=new WG(t);r.mount(e),sw.set(e,r)}function lnr(e,t){return Io(e)||typeof e=="number"||typeof e=="string"&&!RF(t)}function GG(e,t,r,n){let o=[];if(lnr(e,t))o.push(OG(e,RF(t)&&t.default||t,r&&(r.default||r)));else{let a=qG(e,t,n),i=a.length;sc(!!i,"No valid elements provided.","no-valid-elements");for(let s=0;s<i;s++){let l=a[s];sc(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let c=l instanceof Element?aZe:iZe;sw.has(l)||c(l);let u=sw.get(l),d={...r};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,i)),o.push(...LM(u,{...t,transition:d},{}))}}return o}function sZe(e,t,r){let n=[];return oZe(e,t,r,{spring:tx}).forEach(({keyframes:a,transition:i},s)=>{n.push(...GG(s,a,i))}),n}function cnr(e){return Array.isArray(e)&&e.some(Array.isArray)}function lZe(e){function t(r,n,o){let a=[];cnr(r)?a=sZe(r,n,e):a=GG(r,n,o,e);let i=new iF(a);return e&&(e.animations.push(i),i.finished.then(()=>{uh(e.animations,i)})),i}return t}var hue=lZe();var Du=D(lt(),1);var _f=D(Or(),1),KG="Checkbox",[unr,eGn]=hn(KG),[dnr,gue]=unr(KG);function fnr(e){let{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,p]=eo({prop:r,defaultProp:o??!1,onChange:l,caller:KG}),[m,h]=Du.useState(null),[g,v]=Du.useState(null),y=Du.useRef(!1),x=m?!!i||!!m.closest("form"):!0,w={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:i,value:u,hasConsumerStoppedPropagationRef:y,required:c,defaultChecked:cw(o)?!1:o,isFormControl:x,bubbleInput:g,setBubbleInput:v};return(0,_f.jsx)(dnr,{scope:t,...w,children:pnr(d)?d(w):n})}var cZe="CheckboxTrigger",uZe=Du.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{let{control:a,value:i,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=gue(cZe,e),h=Xt(o,u),g=Du.useRef(l);return Du.useEffect(()=>{let v=a?.form;if(v){let y=()=>d(g.current);return v.addEventListener("reset",y),()=>v.removeEventListener("reset",y)}},[a,d]),(0,_f.jsx)(rt.button,{type:"button",role:"checkbox","aria-checked":cw(l)?"mixed":l,"aria-required":c,"data-state":mZe(l),"data-disabled":s?"":void 0,disabled:s,value:i,...n,ref:h,onKeyDown:He(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:He(r,v=>{d(y=>cw(y)?!0:!y),m&&p&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})});uZe.displayName=cZe;var XG=Du.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return(0,_f.jsx)(fnr,{__scopeCheckbox:r,checked:o,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:n,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>(0,_f.jsxs)(_f.Fragment,{children:[(0,_f.jsx)(uZe,{...d,ref:t,__scopeCheckbox:r}),f&&(0,_f.jsx)(pZe,{__scopeCheckbox:r})]})})});XG.displayName=KG;var dZe="CheckboxIndicator",vue=Du.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:n,...o}=e,a=gue(dZe,r);return(0,_f.jsx)(uo,{present:n||cw(a.checked)||a.checked===!0,children:(0,_f.jsx)(rt.span,{"data-state":mZe(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});vue.displayName=dZe;var fZe="CheckboxBubbleInput",pZe=Du.forwardRef(({__scopeCheckbox:e,...t},r)=>{let{control:n,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:i,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=gue(fZe,e),m=Xt(r,p),h=Wb(a),g=uk(n);Du.useEffect(()=>{let y=f;if(!y)return;let x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set,C=!o.current;if(h!==a&&b){let S=new Event("click",{bubbles:C});y.indeterminate=cw(a),b.call(y,cw(a)?!1:a),y.dispatchEvent(S)}},[f,h,a,o]);let v=Du.useRef(cw(a)?!1:a);return(0,_f.jsx)(rt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:s,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});pZe.displayName=fZe;function pnr(e){return typeof e=="function"}function cw(e){return e==="indeterminate"}function mZe(e){return cw(e)?"indeterminate":e?"checked":"unchecked"}var rXn=D(ng(),1);var hZe=D(lt(),1);var gZe=D(Or(),1),hnr="Label",vZe=hZe.forwardRef((e,t)=>(0,gZe.jsx)(rt.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));vZe.displayName=hnr;var yue=vZe;var pi=D(lt(),1);var zs=D(Or(),1),YG="Popover",[yZe,vGn]=hn(YG,[gu]),NF=gu(),[vnr,uw]=yZe(YG),xZe=e=>{let{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=NF(t),l=pi.useRef(null),[c,u]=pi.useState(!1),[d,f]=eo({prop:n,defaultProp:o??!1,onChange:a,caller:YG});return(0,zs.jsx)(_m,{...s,children:(0,zs.jsx)(vnr,{scope:t,contentId:Vo(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:pi.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:pi.useCallback(()=>u(!0),[]),onCustomAnchorRemove:pi.useCallback(()=>u(!1),[]),modal:i,children:r})})};xZe.displayName=YG;var bZe="PopoverAnchor",ynr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(bZe,r),a=NF(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return pi.useEffect(()=>(i(),()=>s()),[i,s]),(0,zs.jsx)(Fm,{...a,...n,ref:t})});ynr.displayName=bZe;var wZe="PopoverTrigger",CZe=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(wZe,r),a=NF(r),i=Xt(t,o.triggerRef),s=(0,zs.jsx)(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":kZe(o.open),...n,ref:i,onClick:He(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:(0,zs.jsx)(Fm,{asChild:!0,...a,children:s})});CZe.displayName=wZe;var xue="PopoverPortal",[xnr,bnr]=yZe(xue,{forceMount:void 0}),wnr=e=>{let{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=uw(xue,t);return(0,zs.jsx)(xnr,{scope:t,forceMount:r,children:(0,zs.jsx)(uo,{present:r||a.open,children:(0,zs.jsx)(vu,{asChild:!0,container:o,children:n})})})};wnr.displayName=xue;var UM="PopoverContent",SZe=pi.forwardRef((e,t)=>{let r=bnr(UM,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=uw(UM,e.__scopePopover);return(0,zs.jsx)(uo,{present:n||a.open,children:a.modal?(0,zs.jsx)(Snr,{...o,ref:t}):(0,zs.jsx)(Pnr,{...o,ref:t})})});SZe.displayName=UM;var Cnr=Sc("PopoverContent.RemoveScroll"),Snr=pi.forwardRef((e,t)=>{let r=uw(UM,e.__scopePopover),n=pi.useRef(null),o=Xt(t,n),a=pi.useRef(!1);return pi.useEffect(()=>{let i=n.current;if(i)return U0(i)},[]),(0,zs.jsx)(Wy,{as:Cnr,allowPinchZoom:!0,children:(0,zs.jsx)(PZe,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,i=>{let s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:He(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Pnr=pi.forwardRef((e,t)=>{let r=uw(UM,e.__scopePopover),n=pi.useRef(!1),o=pi.useRef(!1);return(0,zs.jsx)(PZe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||r.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let i=a.target;r.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),PZe=pi.forwardRef((e,t)=>{let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=uw(UM,r),p=NF(r);return V0(),(0,zs.jsx)(qy,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,zs.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,zs.jsx)(dg,{"data-state":kZe(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),IZe="PopoverClose",Inr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=uw(IZe,r);return(0,zs.jsx)(rt.button,{type:"button",...n,ref:t,onClick:He(e.onClick,()=>o.onOpenChange(!1))})});Inr.displayName=IZe;var knr="PopoverArrow",Rnr=pi.forwardRef((e,t)=>{let{__scopePopover:r,...n}=e,o=NF(r);return(0,zs.jsx)(fg,{...o,...n,ref:t})});Rnr.displayName=knr;function kZe(e){return e?"open":"closed"}var RZe=xZe;var NZe=CZe;var bue=SZe;var fx=D(lt(),1);var _l=D(lt(),1);var dw=D(Or(),1),wue="rovingFocusGroup.onEntryFocus",Mnr={bubbles:!1,cancelable:!0},MF="RovingFocusGroup",[Cue,MZe,Tnr]=cf(MF),[Anr,zM]=hn(MF,[Tnr]),[Lnr,Enr]=Anr(MF),TZe=_l.forwardRef((e,t)=>(0,dw.jsx)(Cue.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,dw.jsx)(Cue.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,dw.jsx)(Dnr,{...e,ref:t})})}));TZe.displayName=MF;var Dnr=_l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=_l.useRef(null),p=Xt(t,f),m=wp(a),[h,g]=eo({prop:i,defaultProp:s??null,onChange:l,caller:MF}),[v,y]=_l.useState(!1),x=to(c),w=MZe(r),b=_l.useRef(!1),[C,S]=_l.useState(0);return _l.useEffect(()=>{let P=f.current;if(P)return P.addEventListener(wue,x),()=>P.removeEventListener(wue,x)},[x]),(0,dw.jsx)(Lnr,{scope:r,orientation:n,dir:m,loop:o,currentTabStopId:h,onItemFocus:_l.useCallback(P=>g(P),[g]),onItemShiftTab:_l.useCallback(()=>y(!0),[]),onFocusableItemAdd:_l.useCallback(()=>S(P=>P+1),[]),onFocusableItemRemove:_l.useCallback(()=>S(P=>P-1),[]),children:(0,dw.jsx)(rt.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{b.current=!0}),onFocus:He(e.onFocus,P=>{let N=!b.current;if(P.target===P.currentTarget&&N&&!v){let T=new CustomEvent(wue,Mnr);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){let A=w().filter(k=>k.focusable),M=A.find(k=>k.active),O=A.find(k=>k.id===h),I=[M,O,...A].filter(Boolean).map(k=>k.ref.current);EZe(I,u)}}b.current=!1}),onBlur:He(e.onBlur,()=>y(!1))})})}),AZe="RovingFocusGroupItem",LZe=_l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:a,children:i,...s}=e,l=Vo(),c=a||l,u=Enr(AZe,r),d=u.currentTabStopId===c,f=MZe(r),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _l.useEffect(()=>{if(n)return p(),()=>m()},[n,p,m]),(0,dw.jsx)(Cue.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:(0,dw.jsx)(rt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:He(e.onMouseDown,g=>{n?u.onItemFocus(c):g.preventDefault()}),onFocus:He(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:He(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;let v=Fnr(g,u.orientation,u.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=f().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();let w=x.indexOf(g.currentTarget);x=u.loop?Bnr(x,w+1):x.slice(w+1)}setTimeout(()=>EZe(x))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:h!=null}):i})})});LZe.displayName=AZe;var Onr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fnr(e,t,r){let n=_nr(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Onr[n]}function EZe(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Bnr(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var QG=TZe,ZG=LZe;var dx=D(Or(),1),JG="Tabs",[Vnr,OGn]=hn(JG,[zM]),OZe=zM(),[Unr,Sue]=Vnr(JG),_Ze=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=wp(s),[d,f]=eo({prop:n,onChange:o,defaultProp:a??"",caller:JG});return(0,dx.jsx)(Unr,{scope:r,baseId:Vo(),value:d,onValueChange:f,orientation:i,dir:u,activationMode:l,children:(0,dx.jsx)(rt.div,{dir:u,"data-orientation":i,...c,ref:t})})});_Ze.displayName=JG;var FZe="TabsList",BZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...o}=e,a=Sue(FZe,r),i=OZe(r);return(0,dx.jsx)(QG,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:(0,dx.jsx)(rt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});BZe.displayName=FZe;var VZe="TabsTrigger",UZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,i=Sue(VZe,r),s=OZe(r),l=jZe(i.baseId,n),c=$Ze(i.baseId,n),u=n===i.value;return(0,dx.jsx)(ZG,{asChild:!0,...s,focusable:!o,active:u,children:(0,dx.jsx)(rt.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:He(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:He(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:He(e.onFocus,()=>{let d=i.activationMode!=="manual";!u&&!o&&d&&i.onValueChange(n)})})})});UZe.displayName=VZe;var zZe="TabsContent",HZe=fx.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,forceMount:o,children:a,...i}=e,s=Sue(zZe,r),l=jZe(s.baseId,n),c=$Ze(s.baseId,n),u=n===s.value,d=fx.useRef(u);return fx.useEffect(()=>{let f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),(0,dx.jsx)(uo,{present:o||u,children:({present:f})=>(0,dx.jsx)(rt.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&a})})});HZe.displayName=zZe;function jZe(e,t){return`${e}-trigger-${t}`}function $Ze(e,t){return`${e}-content-${t}`}var Pue=_Ze,Iue=BZe,kue=UZe,Rue=HZe;function Rn(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function cc(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function e8(e,t){let r=Rn(e);if(isNaN(t))return cc(e,NaN);if(!t)return r;let n=r.getDate(),o=cc(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);let a=o.getDate();return n>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),n),r)}var Hnr=Math.pow(10,8)*24*60*60*1e3,zGn=-Hnr,t8=6048e5,qZe=864e5;var jnr=3600;var WZe=jnr*24,HGn=WZe*7,$nr=WZe*365.2425,qnr=$nr/12,jGn=qnr*3;var Wnr={};function av(){return Wnr}function hh(e,t){let r=av(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Rn(e),a=o.getDay(),i=(a<n?7:0)+a-n;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function F1(e){return hh(e,{weekStartsOn:1})}function r8(e){let t=Rn(e),r=t.getFullYear(),n=cc(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);let o=F1(n),a=cc(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);let i=F1(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function HM(e){let t=Rn(e);return t.setHours(0,0,0,0),t}function Nue(e){let t=Rn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function GZe(e,t){let r=HM(e),n=HM(t),o=+r-Nue(r),a=+n-Nue(n);return Math.round((o-a)/qZe)}function KZe(e){let t=r8(e),r=cc(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),F1(r)}function XZe(e){return cc(e,Date.now())}function B1(e,t){let r=HM(e),n=HM(t);return+r==+n}function YZe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mue(e){if(!YZe(e)&&typeof e!="number")return!1;let t=Rn(e);return!isNaN(Number(t))}function QZe(e){let t=Rn(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function n8(e,t){let r=Rn(e.start),n=Rn(e.end),o=+r>+n,a=o?+r:+n,i=o?n:r;i.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);let l=[];for(;+i<=a;)l.push(Rn(i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return o?l.reverse():l}function ZZe(e){let t=Rn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function JZe(e){let t=Rn(e),r=cc(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function eJe(e,t){let r=av(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Rn(e),a=o.getDay(),i=(a<n?-7:0)+6-(a-n);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}var Gnr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tJe=(e,t,r)=>{let n,o=Gnr[e];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function o8(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Knr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xnr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ynr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rJe={date:o8({formats:Knr,defaultWidth:"full"}),time:o8({formats:Xnr,defaultWidth:"full"}),dateTime:o8({formats:Ynr,defaultWidth:"full"})};var Qnr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nJe=(e,t,r,n)=>Qnr[e];function jM(e){return(t,r)=>{let n=r?.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){let i=e.defaultFormattingWidth||e.defaultWidth,s=r?.width?String(r.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{let i=e.defaultWidth,s=r?.width?String(r.width):e.defaultWidth;o=e.values[s]||e.values[i]}let a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}var Znr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Jnr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eor={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tor={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ror={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nor={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oor=(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},oJe={ordinalNumber:oor,era:jM({values:Znr,defaultWidth:"wide"}),quarter:jM({values:Jnr,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jM({values:eor,defaultWidth:"wide"}),day:jM({values:tor,defaultWidth:"wide"}),dayPeriod:jM({values:ror,defaultWidth:"wide",formattingValues:nor,defaultFormattingWidth:"wide"})};function $M(e){return(t,r={})=>{let n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;let i=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?ior(s,d=>d.test(i)):aor(s,d=>d.test(i)),c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;let u=t.slice(i.length);return{value:c,rest:u}}}function aor(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ior(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function aJe(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let o=n[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=r.valueCallback?r.valueCallback(i):i;let s=t.slice(o.length);return{value:i,rest:s}}}var sor=/^(\d+)(th|st|nd|rd)?/i,lor=/\d+/i,cor={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uor={any:[/^b/i,/^(a|c)/i]},dor={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},por={any:[/1/i,/2/i,/3/i,/4/i]},mor={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hor={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gor={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vor={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yor={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xor={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},iJe={ordinalNumber:aJe({matchPattern:sor,parsePattern:lor,valueCallback:e=>parseInt(e,10)}),era:$M({matchPatterns:cor,defaultMatchWidth:"wide",parsePatterns:uor,defaultParseWidth:"any"}),quarter:$M({matchPatterns:dor,defaultMatchWidth:"wide",parsePatterns:por,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$M({matchPatterns:mor,defaultMatchWidth:"wide",parsePatterns:hor,defaultParseWidth:"any"}),day:$M({matchPatterns:gor,defaultMatchWidth:"wide",parsePatterns:vor,defaultParseWidth:"any"}),dayPeriod:$M({matchPatterns:yor,defaultMatchWidth:"any",parsePatterns:xor,defaultParseWidth:"any"})};var Tue={code:"en-US",formatDistance:tJe,formatLong:rJe,formatRelative:nJe,localize:oJe,match:iJe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sJe(e){let t=Rn(e);return GZe(t,JZe(t))+1}function lJe(e){let t=Rn(e),r=+F1(t)-+KZe(t);return Math.round(r/t8)+1}function a8(e,t){let r=Rn(e),n=r.getFullYear(),o=av(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=cc(e,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);let s=hh(i,t),l=cc(e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);let c=hh(l,t);return r.getTime()>=s.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function cJe(e,t){let r=av(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=a8(e,t),a=cc(e,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),hh(a,t)}function uJe(e,t){let r=Rn(e),n=+hh(r,t)-+cJe(r,t);return Math.round(n/t8)+1}function ko(e,t){let r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}var px={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return ko(t==="yy"?n%100:n,t.length)},M(e,t){let r=e.getMonth();return t==="M"?String(r+1):ko(r+1,2)},d(e,t){return ko(e.getDate(),t.length)},a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ko(e.getHours()%12||12,t.length)},H(e,t){return ko(e.getHours(),t.length)},m(e,t){return ko(e.getMinutes(),t.length)},s(e,t){return ko(e.getSeconds(),t.length)},S(e,t){let r=t.length,n=e.getMilliseconds(),o=Math.trunc(n*Math.pow(10,r-3));return ko(o,t.length)}};var qM={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Aue={G:function(e,t,r){let n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){let n=e.getFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return px.y(e,t)},Y:function(e,t,r,n){let o=a8(e,n),a=o>0?o:1-o;if(t==="YY"){let i=a%100;return ko(i,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):ko(a,t.length)},R:function(e,t){let r=r8(e);return ko(r,t.length)},u:function(e,t){let r=e.getFullYear();return ko(r,t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ko(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ko(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return px.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return ko(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let o=uJe(e,n);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):ko(o,t.length)},I:function(e,t,r){let n=lJe(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):ko(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):px.d(e,t)},D:function(e,t,r){let n=sJe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):ko(n,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ko(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ko(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return ko(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n=e.getHours(),o;switch(n===12?o=qM.noon:n===0?o=qM.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n=e.getHours(),o;switch(n>=17?o=qM.evening:n>=12?o=qM.afternoon:n>=4?o=qM.morning:o=qM.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return px.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):px.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):ko(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):ko(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):px.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):px.s(e,t)},S:function(e,t){return px.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return fJe(n);case"XXXX":case"XX":return V1(n);case"XXXXX":case"XXX":default:return V1(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return fJe(n);case"xxxx":case"xx":return V1(n);case"xxxxx":case"xxx":default:return V1(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dJe(n,":");case"OOOO":default:return"GMT"+V1(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dJe(n,":");case"zzzz":default:return"GMT"+V1(n,":")}},t:function(e,t,r){let n=Math.trunc(e.getTime()/1e3);return ko(n,t.length)},T:function(e,t,r){let n=e.getTime();return ko(n,t.length)}};function dJe(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),a=n%60;return a===0?r+String(o):r+String(o)+t+ko(a,2)}function fJe(e,t){return e%60===0?(e>0?"-":"+")+ko(Math.abs(e)/60,2):V1(e,t)}function V1(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=ko(Math.trunc(n/60),2),a=ko(n%60,2);return r+o+t+a}var pJe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},mJe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},bor=(e,t)=>{let r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return pJe(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",pJe(n,t)).replace("{{time}}",mJe(o,t))},hJe={p:mJe,P:bor};var wor=/^D+$/,Cor=/^Y+$/,Sor=["D","DD","YY","YYYY"];function gJe(e){return wor.test(e)}function vJe(e){return Cor.test(e)}function yJe(e,t,r){let n=Por(e,t,r);if(console.warn(n),Sor.includes(e))throw new RangeError(n)}function Por(e,t,r){let n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Ior=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kor=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ror=/^'([^]*?)'?$/,Nor=/''/g,Mor=/[a-zA-Z]/;function Lue(e,t,r){let n=av(),o=r?.locale??n.locale??Tue,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Rn(e);if(!Mue(s))throw new RangeError("Invalid time value");let l=t.match(kor).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=hJe[d];return f(u,o.formatLong)}return u}).join("").match(Ior).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:Tor(u)};if(Aue[d])return{isToken:!0,value:u};if(d.match(Mor))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));let c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!r?.useAdditionalWeekYearTokens&&vJe(d)||!r?.useAdditionalDayOfYearTokens&&gJe(d))&&yJe(d,t,String(e));let f=Aue[d[0]];return f(s,d,o.localize,c)}).join("")}function Tor(e){let t=e.match(Ror);return t?t[1].replace(Nor,"'"):e}function Eue(e){return Rn(e).getDay()}function xJe(e,t){let r=Rn(e),n=Rn(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function bJe(e){return B1(e,XZe(e))}function wJe(e,t){return e8(e,-t)}var cl=D(lt(),1);var ur=D(lt(),1);var Ur=D(Or(),1),Due=["Enter"," "],Aor=["ArrowDown","PageUp","Home"],SJe=["ArrowUp","PageDown","End"],Lor=[...Aor,...SJe],Eor={ltr:[...Due,"ArrowRight"],rtl:[...Due,"ArrowLeft"]},Dor={ltr:["ArrowLeft"],rtl:["ArrowRight"]},EF="Menu",[AF,Oor,_or]=cf(EF),[U1,Oue]=hn(EF,[_or,gu,zM]),DF=gu(),PJe=zM(),[IJe,fw]=U1(EF),[For,OF]=U1(EF),kJe=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:a,modal:i=!0}=e,s=DF(t),[l,c]=ur.useState(null),u=ur.useRef(!1),d=to(a),f=wp(o);return ur.useEffect(()=>{let p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),(0,Ur.jsx)(_m,{...s,children:(0,Ur.jsx)(IJe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:c,children:(0,Ur.jsx)(For,{scope:t,onClose:ur.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:n})})})};kJe.displayName=EF;var Bor="MenuAnchor",_ue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=DF(r);return(0,Ur.jsx)(Fm,{...o,...n,ref:t})});_ue.displayName=Bor;var Fue="MenuPortal",[Vor,RJe]=U1(Fue,{forceMount:void 0}),NJe=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:o}=e,a=fw(Fue,t);return(0,Ur.jsx)(Vor,{scope:t,forceMount:r,children:(0,Ur.jsx)(uo,{present:r||a.open,children:(0,Ur.jsx)(vu,{asChild:!0,container:o,children:n})})})};NJe.displayName=Fue;var em="MenuContent",[Uor,Bue]=U1(em),MJe=ur.forwardRef((e,t)=>{let r=RJe(em,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=fw(em,e.__scopeMenu),i=OF(em,e.__scopeMenu);return(0,Ur.jsx)(AF.Provider,{scope:e.__scopeMenu,children:(0,Ur.jsx)(uo,{present:n||a.open,children:(0,Ur.jsx)(AF.Slot,{scope:e.__scopeMenu,children:i.modal?(0,Ur.jsx)(zor,{...o,ref:t}):(0,Ur.jsx)(Hor,{...o,ref:t})})})})}),zor=ur.forwardRef((e,t)=>{let r=fw(em,e.__scopeMenu),n=ur.useRef(null),o=Xt(t,n);return ur.useEffect(()=>{let a=n.current;if(a)return U0(a)},[]),(0,Ur.jsx)(Vue,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:He(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Hor=ur.forwardRef((e,t)=>{let r=fw(em,e.__scopeMenu);return(0,Ur.jsx)(Vue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),jor=Sc("MenuContent.ScrollLock"),Vue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=fw(em,r),v=OF(em,r),y=DF(r),x=PJe(r),w=Oor(r),[b,C]=ur.useState(null),S=ur.useRef(null),P=Xt(t,S,g.onContentChange),N=ur.useRef(0),T=ur.useRef(""),A=ur.useRef(0),M=ur.useRef(null),O=ur.useRef("right"),F=ur.useRef(0),I=m?Wy:ur.Fragment,k=m?{as:jor,allowPinchZoom:!0}:void 0,R=_=>{let U=T.current+_,V=w().filter(z=>!z.disabled),L=document.activeElement,H=V.find(z=>z.ref.current===L)?.textValue,j=V.map(z=>z.textValue),$=rar(j,U,H),W=V.find(z=>z.textValue===$)?.ref.current;(function z(G){T.current=G,window.clearTimeout(N.current),G!==""&&(N.current=window.setTimeout(()=>z(""),1e3))})(U),W&&setTimeout(()=>W.focus())};ur.useEffect(()=>()=>window.clearTimeout(N.current),[]),V0();let E=ur.useCallback(_=>O.current===M.current?.side&&oar(_,M.current?.area),[]);return(0,Ur.jsx)(Uor,{scope:r,searchRef:T,onItemEnter:ur.useCallback(_=>{E(_)&&_.preventDefault()},[E]),onItemLeave:ur.useCallback(_=>{E(_)||(S.current?.focus(),C(null))},[E]),onTriggerLeave:ur.useCallback(_=>{E(_)&&_.preventDefault()},[E]),pointerGraceTimerRef:A,onPointerGraceIntentChange:ur.useCallback(_=>{M.current=_},[]),children:(0,Ur.jsx)(I,{...k,children:(0,Ur.jsx)(qy,{asChild:!0,trapped:o,onMountAutoFocus:He(a,_=>{_.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Ur.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,Ur.jsx)(QG,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:C,onEntryFocus:He(l,_=>{v.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Ur.jsx)(dg,{role:"menu","aria-orientation":"vertical","data-state":qJe(g.open),"data-radix-menu-content":"",dir:v.dir,...y,...h,ref:P,style:{outline:"none",...h.style},onKeyDown:He(h.onKeyDown,_=>{let V=_.target.closest("[data-radix-menu-content]")===_.currentTarget,L=_.ctrlKey||_.altKey||_.metaKey,H=_.key.length===1;V&&(_.key==="Tab"&&_.preventDefault(),!L&&H&&R(_.key));let j=S.current;if(_.target!==j||!Lor.includes(_.key))return;_.preventDefault();let W=w().filter(z=>!z.disabled).map(z=>z.ref.current);SJe.includes(_.key)&&W.reverse(),ear(W)}),onBlur:He(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(N.current),T.current="")}),onPointerMove:He(e.onPointerMove,LF(_=>{let U=_.target,V=F.current!==_.clientX;if(_.currentTarget.contains(U)&&V){let L=_.clientX>F.current?"right":"left";O.current=L,F.current=_.clientX}}))})})})})})})});MJe.displayName=em;var $or="MenuGroup",Uue=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{role:"group",...n,ref:t})});Uue.displayName=$or;var qor="MenuLabel",TJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{...n,ref:t})});TJe.displayName=qor;var i8="MenuItem",CJe="menu.itemSelect",l8=ur.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...o}=e,a=ur.useRef(null),i=OF(i8,e.__scopeMenu),s=Bue(i8,e.__scopeMenu),l=Xt(t,a),c=ur.useRef(!1),u=()=>{let d=a.current;if(!r&&d){let f=new CustomEvent(CJe,{bubbles:!0,cancelable:!0});d.addEventListener(CJe,p=>n?.(p),{once:!0}),ey(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return(0,Ur.jsx)(AJe,{...o,ref:l,disabled:r,onClick:He(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:He(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:He(e.onKeyDown,d=>{let f=s.searchRef.current!=="";r||f&&d.key===" "||Due.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});l8.displayName=i8;var AJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:o,...a}=e,i=Bue(i8,r),s=PJe(r),l=ur.useRef(null),c=Xt(t,l),[u,d]=ur.useState(!1),[f,p]=ur.useState("");return ur.useEffect(()=>{let m=l.current;m&&p((m.textContent??"").trim())},[a.children]),(0,Ur.jsx)(AF.ItemSlot,{scope:r,disabled:n,textValue:o??f,children:(0,Ur.jsx)(ZG,{asChild:!0,...s,focusable:!n,children:(0,Ur.jsx)(rt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:c,onPointerMove:He(e.onPointerMove,LF(m=>{n?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:He(e.onPointerLeave,LF(m=>i.onItemLeave(m))),onFocus:He(e.onFocus,()=>d(!0)),onBlur:He(e.onBlur,()=>d(!1))})})})}),Wor="MenuCheckboxItem",LJe=ur.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...o}=e;return(0,Ur.jsx)(FJe,{scope:e.__scopeMenu,checked:r,children:(0,Ur.jsx)(l8,{role:"menuitemcheckbox","aria-checked":s8(r)?"mixed":r,...o,ref:t,"data-state":jue(r),onSelect:He(o.onSelect,()=>n?.(s8(r)?!0:!r),{checkForDefaultPrevented:!1})})})});LJe.displayName=Wor;var EJe="MenuRadioGroup",[Gor,Kor]=U1(EJe,{value:void 0,onValueChange:()=>{}}),DJe=ur.forwardRef((e,t)=>{let{value:r,onValueChange:n,...o}=e,a=to(n);return(0,Ur.jsx)(Gor,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,Ur.jsx)(Uue,{...o,ref:t})})});DJe.displayName=EJe;var OJe="MenuRadioItem",_Je=ur.forwardRef((e,t)=>{let{value:r,...n}=e,o=Kor(OJe,e.__scopeMenu),a=r===o.value;return(0,Ur.jsx)(FJe,{scope:e.__scopeMenu,checked:a,children:(0,Ur.jsx)(l8,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":jue(a),onSelect:He(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});_Je.displayName=OJe;var zue="MenuItemIndicator",[FJe,Xor]=U1(zue,{checked:!1}),BJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...o}=e,a=Xor(zue,r);return(0,Ur.jsx)(uo,{present:n||s8(a.checked)||a.checked===!0,children:(0,Ur.jsx)(rt.span,{...o,ref:t,"data-state":jue(a.checked)})})});BJe.displayName=zue;var Yor="MenuSeparator",VJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,Ur.jsx)(rt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});VJe.displayName=Yor;var Qor="MenuArrow",UJe=ur.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=DF(r);return(0,Ur.jsx)(fg,{...o,...n,ref:t})});UJe.displayName=Qor;var Hue="MenuSub",[Zor,zJe]=U1(Hue),Jor=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,a=fw(Hue,t),i=DF(t),[s,l]=ur.useState(null),[c,u]=ur.useState(null),d=to(o);return ur.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,Ur.jsx)(_m,{...i,children:(0,Ur.jsx)(IJe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:(0,Ur.jsx)(Zor,{scope:t,contentId:Vo(),triggerId:Vo(),trigger:s,onTriggerChange:l,children:r})})})};Jor.displayName=Hue;var TF="MenuSubTrigger",HJe=ur.forwardRef((e,t)=>{let r=fw(TF,e.__scopeMenu),n=OF(TF,e.__scopeMenu),o=zJe(TF,e.__scopeMenu),a=Bue(TF,e.__scopeMenu),i=ur.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,c={__scopeMenu:e.__scopeMenu},u=ur.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return ur.useEffect(()=>u,[u]),ur.useEffect(()=>{let d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),(0,Ur.jsx)(_ue,{asChild:!0,...c,children:(0,Ur.jsx)(AJe,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":qJe(r.open),...e,ref:Jv(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:He(e.onPointerMove,LF(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:He(e.onPointerLeave,LF(d=>{u();let f=r.content?.getBoundingClientRect();if(f){let p=r.content?.dataset.side,m=p==="right",h=m?-5:5,g=f[m?"left":"right"],v=f[m?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:g,y:f.top},{x:v,y:f.top},{x:v,y:f.bottom},{x:g,y:f.bottom}],side:p}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:He(e.onKeyDown,d=>{let f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||Eor[n.dir].includes(d.key)&&(r.onOpenChange(!0),r.content?.focus(),d.preventDefault())})})})});HJe.displayName=TF;var jJe="MenuSubContent",$Je=ur.forwardRef((e,t)=>{let r=RJe(em,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=fw(em,e.__scopeMenu),i=OF(em,e.__scopeMenu),s=zJe(jJe,e.__scopeMenu),l=ur.useRef(null),c=Xt(t,l);return(0,Ur.jsx)(AF.Provider,{scope:e.__scopeMenu,children:(0,Ur.jsx)(uo,{present:n||a.open,children:(0,Ur.jsx)(AF.Slot,{scope:e.__scopeMenu,children:(0,Ur.jsx)(Vue,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:He(e.onFocusOutside,u=>{u.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:He(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:He(e.onKeyDown,u=>{let d=u.currentTarget.contains(u.target),f=Dor[i.dir].includes(u.key);d&&f&&(a.onOpenChange(!1),s.trigger?.focus(),u.preventDefault())})})})})})});$Je.displayName=jJe;function qJe(e){return e?"open":"closed"}function s8(e){return e==="indeterminate"}function jue(e){return s8(e)?"indeterminate":e?"checked":"unchecked"}function ear(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function tar(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function rar(e,t,r){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=tar(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==r));let l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function nar(e,t){let{x:r,y:n}=e,o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],c=s.x,u=s.y,d=l.x,f=l.y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function oar(e,t){if(!t)return!1;let r={x:e.clientX,y:e.clientY};return nar(r,t)}function LF(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WJe=kJe,GJe=_ue,KJe=NJe,XJe=MJe,YJe=Uue,QJe=TJe,ZJe=l8,JJe=LJe,eet=DJe,tet=_Je,ret=BJe,net=VJe,oet=UJe;var aet=HJe,iet=$Je;var Fl=D(Or(),1),c8="DropdownMenu",[iar,kKn]=hn(c8,[Oue]),Ou=Oue(),[sar,set]=iar(c8),lar=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=Ou(t),c=cl.useRef(null),[u,d]=eo({prop:o,defaultProp:a??!1,onChange:i,caller:c8});return(0,Fl.jsx)(sar,{scope:t,triggerId:Vo(),triggerRef:c,contentId:Vo(),open:u,onOpenChange:d,onOpenToggle:cl.useCallback(()=>d(f=>!f),[d]),modal:s,children:(0,Fl.jsx)(WJe,{...l,open:u,onOpenChange:d,dir:n,modal:s,children:r})})};lar.displayName=c8;var cet="DropdownMenuTrigger",car=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,a=set(cet,r),i=Ou(r);return(0,Fl.jsx)(GJe,{asChild:!0,...i,children:(0,Fl.jsx)(rt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:Jv(t,a.triggerRef),onPointerDown:He(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:He(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});car.displayName=cet;var uar="DropdownMenuPortal",uet=e=>{let{__scopeDropdownMenu:t,...r}=e,n=Ou(t);return(0,Fl.jsx)(KJe,{...n,...r})};uet.displayName=uar;var det="DropdownMenuContent",fet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=set(det,r),a=Ou(r),i=cl.useRef(!1);return(0,Fl.jsx)(XJe,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...n,ref:t,onCloseAutoFocus:He(e.onCloseAutoFocus,s=>{i.current||o.triggerRef.current?.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:He(e.onInteractOutside,s=>{let l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fet.displayName=det;var dar="DropdownMenuGroup",far=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(YJe,{...o,...n,ref:t})});far.displayName=dar;var par="DropdownMenuLabel",pet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(QJe,{...o,...n,ref:t})});pet.displayName=par;var mar="DropdownMenuItem",met=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(ZJe,{...o,...n,ref:t})});met.displayName=mar;var har="DropdownMenuCheckboxItem",het=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(JJe,{...o,...n,ref:t})});het.displayName=har;var gar="DropdownMenuRadioGroup",yar=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(eet,{...o,...n,ref:t})});yar.displayName=gar;var xar="DropdownMenuRadioItem",get=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(tet,{...o,...n,ref:t})});get.displayName=xar;var bar="DropdownMenuItemIndicator",vet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(ret,{...o,...n,ref:t})});vet.displayName=bar;var war="DropdownMenuSeparator",yet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(net,{...o,...n,ref:t})});yet.displayName=war;var Car="DropdownMenuArrow",Sar=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(oet,{...o,...n,ref:t})});Sar.displayName=Car;var Par="DropdownMenuSubTrigger",xet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(aet,{...o,...n,ref:t})});xet.displayName=Par;var Iar="DropdownMenuSubContent",bet=cl.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=Ou(r);return(0,Fl.jsx)(iet,{...o,...n,ref:t,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)"}})});bet.displayName=Iar;var wet=uet,$ue=fet;var que=pet,Wue=met,Gue=het;var Kue=get,Xue=vet,Yue=yet;var Que=xet,Zue=bet;var Dt=D(lt(),1),ade=D(ng(),1);function Jue(e,[t,r]){return Math.min(r,Math.max(t,e))}var Cr=D(Or(),1),Rar=[" ","Enter","ArrowUp","ArrowDown"],Nar=[" ","Enter"],z1="Select",[d8,f8,Mar]=cf(z1),[WM,XKn]=hn(z1,[Mar,gu]),p8=gu(),[Tar,pw]=WM(z1),[Aar,Lar]=WM(z1),Cet=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=p8(t),[g,v]=Dt.useState(null),[y,x]=Dt.useState(null),[w,b]=Dt.useState(!1),C=wp(c),[S,P]=eo({prop:n,defaultProp:o??!1,onChange:a,caller:z1}),[N,T]=eo({prop:i,defaultProp:s,onChange:l,caller:z1}),A=Dt.useRef(null),M=g?m||!!g.closest("form"):!0,[O,F]=Dt.useState(new Set),I=Array.from(O).map(k=>k.props.value).join(";");return(0,Cr.jsx)(_m,{...h,children:(0,Cr.jsxs)(Tar,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:b,contentId:Vo(),value:N,onValueChange:T,open:S,onOpenChange:P,dir:C,triggerPointerDownPosRef:A,disabled:f,children:[(0,Cr.jsx)(d8.Provider,{scope:t,children:(0,Cr.jsx)(Aar,{scope:e.__scopeSelect,onNativeOptionAdd:Dt.useCallback(k=>{F(R=>new Set(R).add(k))},[]),onNativeOptionRemove:Dt.useCallback(k=>{F(R=>{let E=new Set(R);return E.delete(k),E})},[]),children:r})}),M?(0,Cr.jsxs)(Get,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:k=>T(k.target.value),disabled:f,form:m,children:[N===void 0?(0,Cr.jsx)("option",{value:""}):null,Array.from(O)]},I):null]})})};Cet.displayName=z1;var Pet="SelectTrigger",Iet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,a=p8(r),i=pw(Pet,r),s=i.disabled||n,l=Xt(t,i.onTriggerChange),c=f8(r),u=Dt.useRef("touch"),[d,f,p]=Xet(h=>{let g=c().filter(x=>!x.disabled),v=g.find(x=>x.value===i.value),y=Yet(g,h,v);y!==void 0&&i.onValueChange(y.value)}),m=h=>{s||(i.onOpenChange(!0),p()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return(0,Cr.jsx)(Fm,{asChild:!0,...a,children:(0,Cr.jsx)(rt.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ket(i.value)?"":void 0,...o,ref:l,onClick:He(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&m(h)}),onPointerDown:He(o.onPointerDown,h=>{u.current=h.pointerType;let g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(m(h),h.preventDefault())}),onKeyDown:He(o.onKeyDown,h=>{let g=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&f(h.key),!(g&&h.key===" ")&&Rar.includes(h.key)&&(m(),h.preventDefault())})})})});Iet.displayName=Pet;var ket="SelectValue",Ret=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:a,placeholder:i="",...s}=e,l=pw(ket,r),{onValueNodeHasChildrenChange:c}=l,u=a!==void 0,d=Xt(t,l.onValueNodeChange);return $n(()=>{c(u)},[c,u]),(0,Cr.jsx)(rt.span,{...s,ref:d,style:{pointerEvents:"none"},children:Ket(l.value)?(0,Cr.jsx)(Cr.Fragment,{children:i}):a})});Ret.displayName=ket;var Ear="SelectIcon",Net=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,Cr.jsx)(rt.span,{"aria-hidden":!0,...o,ref:t,children:n||"\u25BC"})});Net.displayName=Ear;var Dar="SelectPortal",Met=e=>(0,Cr.jsx)(vu,{asChild:!0,...e});Met.displayName=Dar;var H1="SelectContent",Tet=Dt.forwardRef((e,t)=>{let r=pw(H1,e.__scopeSelect),[n,o]=Dt.useState();if($n(()=>{o(new DocumentFragment)},[]),!r.open){let a=n;return a?ade.createPortal((0,Cr.jsx)(Aet,{scope:e.__scopeSelect,children:(0,Cr.jsx)(d8.Slot,{scope:e.__scopeSelect,children:(0,Cr.jsx)("div",{children:e.children})})}),a):null}return(0,Cr.jsx)(Let,{...e,ref:t})});Tet.displayName=H1;var gh=10,[Aet,mw]=WM(H1),Oar="SelectContentImpl",_ar=Sc("SelectContent.RemoveScroll"),Let=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=pw(H1,r),[x,w]=Dt.useState(null),[b,C]=Dt.useState(null),S=Xt(t,z=>w(z)),[P,N]=Dt.useState(null),[T,A]=Dt.useState(null),M=f8(r),[O,F]=Dt.useState(!1),I=Dt.useRef(!1);Dt.useEffect(()=>{if(x)return U0(x)},[x]),V0();let k=Dt.useCallback(z=>{let[G,...X]=M().map(ie=>ie.ref.current),[Y]=X.slice(-1),ae=document.activeElement;for(let ie of z)if(ie===ae||(ie?.scrollIntoView({block:"nearest"}),ie===G&&b&&(b.scrollTop=0),ie===Y&&b&&(b.scrollTop=b.scrollHeight),ie?.focus(),document.activeElement!==ae))return},[M,b]),R=Dt.useCallback(()=>k([P,x]),[k,P,x]);Dt.useEffect(()=>{O&&R()},[O,R]);let{onOpenChange:E,triggerPointerDownPosRef:_}=y;Dt.useEffect(()=>{if(x){let z={x:0,y:0},G=Y=>{z={x:Math.abs(Math.round(Y.pageX)-(_.current?.x??0)),y:Math.abs(Math.round(Y.pageY)-(_.current?.y??0))}},X=Y=>{z.x<=10&&z.y<=10?Y.preventDefault():x.contains(Y.target)||E(!1),document.removeEventListener("pointermove",G),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",X,{capture:!0})}}},[x,E,_]),Dt.useEffect(()=>{let z=()=>E(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[E]);let[U,V]=Xet(z=>{let G=M().filter(ae=>!ae.disabled),X=G.find(ae=>ae.ref.current===document.activeElement),Y=Yet(G,z,X);Y&&setTimeout(()=>Y.ref.current.focus())}),L=Dt.useCallback((z,G,X)=>{let Y=!I.current&&!X;(y.value!==void 0&&y.value===G||Y)&&(N(z),Y&&(I.current=!0))},[y.value]),H=Dt.useCallback(()=>x?.focus(),[x]),j=Dt.useCallback((z,G,X)=>{let Y=!I.current&&!X;(y.value!==void 0&&y.value===G||Y)&&A(z)},[y.value]),$=n==="popper"?ede:Eet,W=$===ede?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,Cr.jsx)(Aet,{scope:r,content:x,viewport:b,onViewportChange:C,itemRefCallback:L,selectedItem:P,onItemLeave:H,itemTextRefCallback:j,focusSelectedItem:R,selectedItemText:T,position:n,isPositioned:O,searchRef:U,children:(0,Cr.jsx)(Wy,{as:_ar,allowPinchZoom:!0,children:(0,Cr.jsx)(qy,{asChild:!0,trapped:y.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:He(o,z=>{y.trigger?.focus({preventScroll:!0}),z.preventDefault()}),children:(0,Cr.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,Cr.jsx)($,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:z=>z.preventDefault(),...v,...W,onPlaced:()=>F(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:He(v.onKeyDown,z=>{let G=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!G&&z.key.length===1&&V(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let Y=M().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(z.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){let ae=z.target,ie=Y.indexOf(ae);Y=Y.slice(ie+1)}setTimeout(()=>k(Y)),z.preventDefault()}})})})})})})});Let.displayName=Oar;var Far="SelectItemAlignedPosition",Eet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,a=pw(H1,r),i=mw(H1,r),[s,l]=Dt.useState(null),[c,u]=Dt.useState(null),d=Xt(t,S=>u(S)),f=f8(r),p=Dt.useRef(!1),m=Dt.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=i,x=Dt.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&c&&h&&g&&v){let S=a.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),N=a.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(a.dir!=="rtl"){let ae=T.left-P.left,ie=N.left-ae,Le=S.left-ie,Se=S.width+Le,Be=Math.max(Se,P.width),me=window.innerWidth-gh,Re=Jue(ie,[gh,Math.max(gh,me-Be)]);s.style.minWidth=Se+"px",s.style.left=Re+"px"}else{let ae=P.right-T.right,ie=window.innerWidth-N.right-ae,Le=window.innerWidth-S.right-ie,Se=S.width+Le,Be=Math.max(Se,P.width),me=window.innerWidth-gh,Re=Jue(ie,[gh,Math.max(gh,me-Be)]);s.style.minWidth=Se+"px",s.style.right=Re+"px"}let A=f(),M=window.innerHeight-gh*2,O=h.scrollHeight,F=window.getComputedStyle(c),I=parseInt(F.borderTopWidth,10),k=parseInt(F.paddingTop,10),R=parseInt(F.borderBottomWidth,10),E=parseInt(F.paddingBottom,10),_=I+k+O+E+R,U=Math.min(g.offsetHeight*5,_),V=window.getComputedStyle(h),L=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),j=S.top+S.height/2-gh,$=M-j,W=g.offsetHeight/2,z=g.offsetTop+W,G=I+k+z,X=_-G;if(G<=j){let ae=A.length>0&&g===A[A.length-1].ref.current;s.style.bottom="0px";let ie=c.clientHeight-h.offsetTop-h.offsetHeight,Le=Math.max($,W+(ae?H:0)+ie+R),Se=G+Le;s.style.height=Se+"px"}else{let ae=A.length>0&&g===A[0].ref.current;s.style.top="0px";let Le=Math.max(j,I+h.offsetTop+(ae?L:0)+W)+X;s.style.height=Le+"px",h.scrollTop=G-j+h.offsetTop}s.style.margin=`${gh}px 0`,s.style.minHeight=U+"px",s.style.maxHeight=M+"px",n?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,c,h,g,v,a.dir,n]);$n(()=>x(),[x]);let[w,b]=Dt.useState();$n(()=>{c&&b(window.getComputedStyle(c).zIndex)},[c]);let C=Dt.useCallback(S=>{S&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return(0,Cr.jsx)(Var,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,Cr.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,Cr.jsx)(rt.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Eet.displayName=Far;var Bar="SelectPopperPosition",ede=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=gh,...a}=e,i=p8(r);return(0,Cr.jsx)(dg,{...i,...a,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ede.displayName=Bar;var[Var,ide]=WM(H1,{}),tde="SelectViewport",Det=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,a=mw(tde,r),i=ide(tde,r),s=Xt(t,a.onViewportChange),l=Dt.useRef(0);return(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,Cr.jsx)(d8.Slot,{scope:r,children:(0,Cr.jsx)(rt.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:He(o.onScroll,c=>{let u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f?.current&&d){let p=Math.abs(l.current-u.scrollTop);if(p>0){let m=window.innerHeight-gh*2,h=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),v=Math.max(h,g);if(v<m){let y=v+p,x=Math.min(m,y),w=y-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Det.displayName=tde;var Oet="SelectGroup",[Uar,zar]=WM(Oet),Har=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=Vo();return(0,Cr.jsx)(Uar,{scope:r,id:o,children:(0,Cr.jsx)(rt.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Har.displayName=Oet;var _et="SelectLabel",Fet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=zar(_et,r);return(0,Cr.jsx)(rt.div,{id:o.id,...n,ref:t})});Fet.displayName=_et;var u8="SelectItem",[jar,Bet]=WM(u8),Vet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:a,...i}=e,s=pw(u8,r),l=mw(u8,r),c=s.value===n,[u,d]=Dt.useState(a??""),[f,p]=Dt.useState(!1),m=Xt(t,y=>l.itemRefCallback?.(y,n,o)),h=Vo(),g=Dt.useRef("touch"),v=()=>{o||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,Cr.jsx)(jar,{scope:r,value:n,disabled:o,textId:h,isSelected:c,onItemTextChange:Dt.useCallback(y=>{d(x=>x||(y?.textContent??"").trim())},[]),children:(0,Cr.jsx)(d8.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:(0,Cr.jsx)(rt.div,{role:"option","aria-labelledby":h,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:He(i.onFocus,()=>p(!0)),onBlur:He(i.onBlur,()=>p(!1)),onClick:He(i.onClick,()=>{g.current!=="mouse"&&v()}),onPointerUp:He(i.onPointerUp,()=>{g.current==="mouse"&&v()}),onPointerDown:He(i.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:He(i.onPointerMove,y=>{g.current=y.pointerType,o?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(i.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:He(i.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(Nar.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});Vet.displayName=u8;var _F="SelectItemText",Uet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...a}=e,i=pw(_F,r),s=mw(_F,r),l=Bet(_F,r),c=Lar(_F,r),[u,d]=Dt.useState(null),f=Xt(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),p=u?.textContent,m=Dt.useMemo(()=>(0,Cr.jsx)("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=c;return $n(()=>(h(m),()=>g(m)),[h,g,m]),(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(rt.span,{id:l.textId,...a,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ade.createPortal(a.children,i.valueNode):null]})});Uet.displayName=_F;var zet="SelectItemIndicator",Het=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return Bet(zet,r).isSelected?(0,Cr.jsx)(rt.span,{"aria-hidden":!0,...n,ref:t}):null});Het.displayName=zet;var rde="SelectScrollUpButton",jet=Dt.forwardRef((e,t)=>{let r=mw(rde,e.__scopeSelect),n=ide(rde,e.__scopeSelect),[o,a]=Dt.useState(!1),i=Xt(t,n.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){let u=c.scrollTop>0;a(u)};var s=l;let c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?(0,Cr.jsx)(qet,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});jet.displayName=rde;var nde="SelectScrollDownButton",$et=Dt.forwardRef((e,t)=>{let r=mw(nde,e.__scopeSelect),n=ide(nde,e.__scopeSelect),[o,a]=Dt.useState(!1),i=Xt(t,n.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){let u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};var s=l;let c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?(0,Cr.jsx)(qet,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});$et.displayName=nde;var qet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,a=mw("SelectScrollButton",r),i=Dt.useRef(null),s=f8(r),l=Dt.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return Dt.useEffect(()=>()=>l(),[l]),$n(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),(0,Cr.jsx)(rt.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:He(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:He(o.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:He(o.onPointerLeave,()=>{l()})})}),$ar="SelectSeparator",Wet=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,Cr.jsx)(rt.div,{"aria-hidden":!0,...n,ref:t})});Wet.displayName=$ar;var ode="SelectArrow",qar=Dt.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=p8(r),a=pw(ode,r),i=mw(ode,r);return a.open&&i.position==="popper"?(0,Cr.jsx)(fg,{...o,...n,ref:t}):null});qar.displayName=ode;var War="SelectBubbleInput",Get=Dt.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{let o=Dt.useRef(null),a=Xt(n,o),i=Wb(t);return Dt.useEffect(()=>{let s=o.current;if(!s)return;let l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){let d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[i,t]),(0,Cr.jsx)(rt.select,{...r,style:{...AZ,...r.style},ref:a,defaultValue:t})});Get.displayName=War;function Ket(e){return e===""||e===void 0}function Xet(e){let t=to(e),r=Dt.useRef(""),n=Dt.useRef(0),o=Dt.useCallback(i=>{let s=r.current+i;t(s),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=Dt.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return Dt.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function Yet(e,t,r){let o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=Gar(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==r));let l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function Gar(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Qet=Cet,sde=Iet,Zet=Ret,Jet=Net,ett=Met,lde=Tet,ttt=Det;var cde=Fet,ude=Vet,rtt=Uet,ntt=Het,dde=jet,fde=$et,pde=Wet;var att=D(lt(),1);var itt=D(Or(),1),Xar="Separator",ott="horizontal",Yar=["horizontal","vertical"],stt=att.forwardRef((e,t)=>{let{decorative:r,orientation:n=ott,...o}=e,a=Qar(n)?n:ott,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return(0,itt.jsx)(rt.div,{"data-orientation":a,...s,...o,ref:t})});stt.displayName=Xar;function Qar(e){return Yar.includes(e)}var mde=stt;var on=D(lt(),1);var Hs=D(Or(),1),[m8,l7n]=hn("Tooltip",[gu]),h8=gu(),ltt="TooltipProvider",Jar=700,hde="tooltip.open",[eir,vde]=m8(ltt),ctt=e=>{let{__scopeTooltip:t,delayDuration:r=Jar,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,i=on.useRef(!0),s=on.useRef(!1),l=on.useRef(0);return on.useEffect(()=>{let c=l.current;return()=>window.clearTimeout(c)},[]),(0,Hs.jsx)(eir,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:on.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:on.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:s,onPointerInTransitChange:on.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:a})};ctt.displayName=ltt;var FF="Tooltip",[tir,BF]=m8(FF),utt=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=vde(FF,e.__scopeTooltip),c=h8(t),[u,d]=on.useState(null),f=Vo(),p=on.useRef(0),m=i??l.disableHoverableContent,h=s??l.delayDuration,g=on.useRef(!1),[v,y]=eo({prop:n,defaultProp:o??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(hde))):l.onClose(),a?.(S)},caller:FF}),x=on.useMemo(()=>v?g.current?"delayed-open":"instant-open":"closed",[v]),w=on.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),b=on.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=on.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return on.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),(0,Hs.jsx)(_m,{...c,children:(0,Hs.jsx)(tir,{scope:t,contentId:f,open:v,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:on.useCallback(()=>{l.isOpenDelayedRef.current?C():w()},[l.isOpenDelayedRef,C,w]),onTriggerLeave:on.useCallback(()=>{m?b():(window.clearTimeout(p.current),p.current=0)},[b,m]),onOpen:w,onClose:b,disableHoverableContent:m,children:r})})};utt.displayName=FF;var gde="TooltipTrigger",dtt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,o=BF(gde,r),a=vde(gde,r),i=h8(r),s=on.useRef(null),l=Xt(t,s,o.onTriggerChange),c=on.useRef(!1),u=on.useRef(!1),d=on.useCallback(()=>c.current=!1,[]);return on.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,Hs.jsx)(Fm,{asChild:!0,...i,children:(0,Hs.jsx)(rt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:He(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:He(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:He(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:He(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:He(e.onBlur,o.onClose),onClick:He(e.onClick,o.onClose)})})});dtt.displayName=gde;var yde="TooltipPortal",[rir,nir]=m8(yde,{forceMount:void 0}),oir=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=BF(yde,t);return(0,Hs.jsx)(rir,{scope:t,forceMount:r,children:(0,Hs.jsx)(uo,{present:r||a.open,children:(0,Hs.jsx)(vu,{asChild:!0,container:o,children:n})})})};oir.displayName=yde;var GM="TooltipContent",ftt=on.forwardRef((e,t)=>{let r=nir(GM,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=BF(GM,e.__scopeTooltip);return(0,Hs.jsx)(uo,{present:n||i.open,children:i.disableHoverableContent?(0,Hs.jsx)(ptt,{side:o,...a,ref:t}):(0,Hs.jsx)(air,{side:o,...a,ref:t})})}),air=on.forwardRef((e,t)=>{let r=BF(GM,e.__scopeTooltip),n=vde(GM,e.__scopeTooltip),o=on.useRef(null),a=Xt(t,o),[i,s]=on.useState(null),{trigger:l,onClose:c}=r,u=o.current,{onPointerInTransitChange:d}=n,f=on.useCallback(()=>{s(null),d(!1)},[d]),p=on.useCallback((m,h)=>{let g=m.currentTarget,v={x:m.clientX,y:m.clientY},y=cir(v,g.getBoundingClientRect()),x=uir(v,y),w=dir(h.getBoundingClientRect()),b=pir([...x,...w]);s(b),d(!0)},[d]);return on.useEffect(()=>()=>f(),[f]),on.useEffect(()=>{if(l&&u){let m=g=>p(g,u),h=g=>p(g,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",h)}}},[l,u,p,f]),on.useEffect(()=>{if(i){let m=h=>{let g=h.target,v={x:h.clientX,y:h.clientY},y=l?.contains(g)||u?.contains(g),x=!fir(v,i);y?f():x&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,i,c,f]),(0,Hs.jsx)(ptt,{...e,ref:a})}),[iir,sir]=m8(FF,{isInside:!1}),lir=tU("TooltipContent"),ptt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,l=BF(GM,r),c=h8(r),{onClose:u}=l;return on.useEffect(()=>(document.addEventListener(hde,u),()=>document.removeEventListener(hde,u)),[u]),on.useEffect(()=>{if(l.trigger){let d=f=>{f.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),(0,Hs.jsx)(kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:(0,Hs.jsxs)(dg,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,Hs.jsx)(lir,{children:n}),(0,Hs.jsx)(iir,{scope:r,isInside:!0,children:(0,Hs.jsx)(az,{id:l.contentId,role:"tooltip",children:o||n})})]})})});ftt.displayName=GM;var mtt="TooltipArrow",htt=on.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,o=h8(r);return sir(mtt,r).isInside?null:(0,Hs.jsx)(fg,{...o,...n,ref:t})});htt.displayName=mtt;function cir(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function uir(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function dir(e){let{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function fir(e,t){let{x:r,y:n}=e,o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],c=s.x,u=s.y,d=l.x,f=l.y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function pir(e){let t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),mir(t)}function mir(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let o=e[n];for(;t.length>=2;){let a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();let r=[];for(let n=e.length-1;n>=0;n--){let o=e[n];for(;r.length>=2;){let a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var gtt=ctt,vtt=utt,ytt=dtt;var xde=ftt,bde=htt;var vh=D(lt(),1);var j1=D(Or(),1),g8="Switch",[gir,g7n]=hn(g8),[vir,yir]=gir(g8),xtt=vh.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,p]=vh.useState(null),m=Xt(t,x=>p(x)),h=vh.useRef(!1),g=f?u||!!f.closest("form"):!0,[v,y]=eo({prop:o,defaultProp:a??!1,onChange:c,caller:g8});return(0,j1.jsxs)(vir,{scope:r,checked:v,disabled:s,children:[(0,j1.jsx)(rt.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":Stt(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:m,onClick:He(e.onClick,x=>{y(w=>!w),g&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})}),g&&(0,j1.jsx)(Ctt,{control:f,bubbles:!h.current,name:n,value:l,checked:v,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});xtt.displayName=g8;var btt="SwitchThumb",wtt=vh.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,o=yir(btt,r);return(0,j1.jsx)(rt.span,{"data-state":Stt(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});wtt.displayName=btt;var xir="SwitchBubbleInput",Ctt=vh.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{let i=vh.useRef(null),s=Xt(i,a),l=Wb(r),c=uk(t);return vh.useEffect(()=>{let u=i.current;if(!u)return;let d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==r&&p){let m=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(m)}},[l,r,n]),(0,j1.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ctt.displayName=xir;function Stt(e){return e?"checked":"unchecked"}var wde=xtt,Ptt=wtt;var Qr=D(lt(),1),ktt=D(ng(),1);var Ro=D(Or(),1),kde="ToastProvider",[Rde,wir,Cir]=cf("Toast"),[Rtt,N7n]=hn("Toast",[Cir]),[Sir,y8]=Rtt(kde),Pir=e=>{let{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[s,l]=Qr.useState(null),[c,u]=Qr.useState(0),d=Qr.useRef(!1),f=Qr.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${kde}\`. Expected non-empty \`string\`.`),(0,Ro.jsx)(Rde.Provider,{scope:t,children:(0,Ro.jsx)(Sir,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:Qr.useCallback(()=>u(p=>p+1),[]),onToastRemove:Qr.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:i})})};Pir.displayName=kde;var Ntt="ToastViewport",Iir=["F8"],Sde="toast.viewportPause",Pde="toast.viewportResume",Mtt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:n=Iir,label:o="Notifications ({hotkey})",...a}=e,i=y8(Ntt,r),s=wir(r),l=Qr.useRef(null),c=Qr.useRef(null),u=Qr.useRef(null),d=Qr.useRef(null),f=Xt(t,d,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=i.toastCount>0;Qr.useEffect(()=>{let g=v=>{n.length!==0&&n.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),Qr.useEffect(()=>{let g=l.current,v=d.current;if(m&&g&&v){let y=()=>{if(!i.isClosePausedRef.current){let C=new CustomEvent(Sde);v.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){let C=new CustomEvent(Pde);v.dispatchEvent(C),i.isClosePausedRef.current=!1}},w=C=>{!g.contains(C.relatedTarget)&&x()},b=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",w),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",b),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[m,i.isClosePausedRef]);let h=Qr.useCallback(({tabbingDirection:g})=>{let y=s().map(x=>{let w=x.ref.current,b=[w,...Bir(w)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return Qr.useEffect(()=>{let g=d.current;if(g){let v=y=>{let x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){let b=document.activeElement,C=y.shiftKey;if(y.target===g&&C){c.current?.focus();return}let N=h({tabbingDirection:C?"backwards":"forwards"}),T=N.findIndex(A=>A===b);Cde(N.slice(T+1))?y.preventDefault():C?c.current?.focus():u.current?.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[s,h]),(0,Ro.jsxs)(CNe,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&(0,Ro.jsx)(Ide,{ref:c,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"forwards"});Cde(g)}}),(0,Ro.jsx)(Rde.Slot,{scope:r,children:(0,Ro.jsx)(rt.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,Ro.jsx)(Ide,{ref:u,onFocusFromOutsideViewport:()=>{let g=h({tabbingDirection:"backwards"});Cde(g)}})]})});Mtt.displayName=Ntt;var Ttt="ToastFocusProxy",Ide=Qr.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=y8(Ttt,r);return(0,Ro.jsx)(OE,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{let s=i.relatedTarget;!a.viewport?.contains(s)&&n()}})});Ide.displayName=Ttt;var VF="Toast",kir="toast.swipeStart",Rir="toast.swipeMove",Nir="toast.swipeCancel",Mir="toast.swipeEnd",Att=Qr.forwardRef((e,t)=>{let{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[s,l]=eo({prop:n,defaultProp:o??!0,onChange:a,caller:VF});return(0,Ro.jsx)(uo,{present:r||s,children:(0,Ro.jsx)(Lir,{open:s,...i,ref:t,onClose:()=>l(!1),onPause:to(e.onPause),onResume:to(e.onResume),onSwipeStart:He(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:He(e.onSwipeMove,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:He(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:He(e.onSwipeEnd,c=>{let{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Att.displayName=VF;var[Tir,Air]=Rtt(VF,{onClose(){}}),Lir=Qr.forwardRef((e,t)=>{let{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=y8(VF,r),[g,v]=Qr.useState(null),y=Xt(t,F=>v(F)),x=Qr.useRef(null),w=Qr.useRef(null),b=o||h.duration,C=Qr.useRef(0),S=Qr.useRef(b),P=Qr.useRef(0),{onToastAdd:N,onToastRemove:T}=h,A=to(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),i()}),M=Qr.useCallback(F=>{!F||F===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(A,F))},[A]);Qr.useEffect(()=>{let F=h.viewport;if(F){let I=()=>{M(S.current),c?.()},k=()=>{let R=new Date().getTime()-C.current;S.current=S.current-R,window.clearTimeout(P.current),l?.()};return F.addEventListener(Sde,k),F.addEventListener(Pde,I),()=>{F.removeEventListener(Sde,k),F.removeEventListener(Pde,I)}}},[h.viewport,b,l,c,M]),Qr.useEffect(()=>{a&&!h.isClosePausedRef.current&&M(b)},[a,b,h.isClosePausedRef,M]),Qr.useEffect(()=>(N(),()=>T()),[N,T]);let O=Qr.useMemo(()=>g?Btt(g):null,[g]);return h.viewport?(0,Ro.jsxs)(Ro.Fragment,{children:[O&&(0,Ro.jsx)(Eir,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:O}),(0,Ro.jsx)(Tir,{scope:r,onClose:A,children:ktt.createPortal((0,Ro.jsx)(Rde.ItemSlot,{scope:r,children:(0,Ro.jsx)(wNe,{asChild:!0,onEscapeKeyDown:He(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||A(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,Ro.jsx)(rt.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:He(e.onKeyDown,F=>{F.key==="Escape"&&(s?.(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:He(e.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:He(e.onPointerMove,F=>{if(!x.current)return;let I=F.clientX-x.current.x,k=F.clientY-x.current.y,R=!!w.current,E=["left","right"].includes(h.swipeDirection),_=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,U=E?_(0,I):0,V=E?0:_(0,k),L=F.pointerType==="touch"?10:2,H={x:U,y:V},j={originalEvent:F,delta:H};R?(w.current=H,v8(Rir,d,j,{discrete:!1})):Itt(H,h.swipeDirection,L)?(w.current=H,v8(kir,u,j,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(I)>L||Math.abs(k)>L)&&(x.current=null)}),onPointerUp:He(e.onPointerUp,F=>{let I=w.current,k=F.target;if(k.hasPointerCapture(F.pointerId)&&k.releasePointerCapture(F.pointerId),w.current=null,x.current=null,I){let R=F.currentTarget,E={originalEvent:F,delta:I};Itt(I,h.swipeDirection,h.swipeThreshold)?v8(Mir,p,E,{discrete:!0}):v8(Nir,f,E,{discrete:!0}),R.addEventListener("click",_=>_.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Eir=e=>{let{__scopeToast:t,children:r,...n}=e,o=y8(VF,t),[a,i]=Qr.useState(!1),[s,l]=Qr.useState(!1);return _ir(()=>i(!0)),Qr.useEffect(()=>{let c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:(0,Ro.jsx)(vu,{asChild:!0,children:(0,Ro.jsx)(OE,{...n,children:a&&(0,Ro.jsxs)(Ro.Fragment,{children:[o.label," ",r]})})})},Dir="ToastTitle",Ltt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,Ro.jsx)(rt.div,{...n,ref:t})});Ltt.displayName=Dir;var Oir="ToastDescription",Ett=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e;return(0,Ro.jsx)(rt.div,{...n,ref:t})});Ett.displayName=Oir;var Dtt="ToastAction",Ott=Qr.forwardRef((e,t)=>{let{altText:r,...n}=e;return r.trim()?(0,Ro.jsx)(Ftt,{altText:r,asChild:!0,children:(0,Ro.jsx)(Nde,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Dtt}\`. Expected non-empty \`string\`.`),null)});Ott.displayName=Dtt;var _tt="ToastClose",Nde=Qr.forwardRef((e,t)=>{let{__scopeToast:r,...n}=e,o=Air(_tt,r);return(0,Ro.jsx)(Ftt,{asChild:!0,children:(0,Ro.jsx)(rt.button,{type:"button",...n,ref:t,onClick:He(e.onClick,o.onClose)})})});Nde.displayName=_tt;var Ftt=Qr.forwardRef((e,t)=>{let{__scopeToast:r,altText:n,...o}=e;return(0,Ro.jsx)(rt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function Btt(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Fir(n)){let o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){let i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Btt(n))}}),t}function v8(e,t,r,{discrete:n}){let o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ey(o,a):o.dispatchEvent(a)}var Itt=(e,t,r=0)=>{let n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function _ir(e=()=>{}){let t=to(e);$n(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Fir(e){return e.nodeType===e.ELEMENT_NODE}function Bir(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Cde(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Mde=Mtt,Tde=Att,Ade=Ltt,Lde=Ett,Ede=Ott,Dde=Nde;function Ae(...e){return R7e(MW(e))}var Uir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(p7e,{ref:r,className:Ae("moonui-theme","border-b border-gray-200 dark:border-gray-800",e),...t}));Uir.displayName="AccordionItem";var zir=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsx)(m7e,{className:"flex",children:(0,q.jsxs)(Zle,{ref:n,className:Ae("flex flex-1 items-center justify-between py-4 font-medium transition-all dark:text-gray-100","hover:underline hover:text-primary dark:hover:text-primary-400","[&[data-state=open]>svg]:rotate-180",e),...r,children:[t,(0,q.jsx)(j0,{className:"h-4 w-4 shrink-0 transition-transform duration-200 opacity-70 group-hover:opacity-100"})]})}));zir.displayName=Zle.displayName;var Hir=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsx)(Jle,{ref:n,className:Ae("overflow-hidden text-sm text-gray-700 dark:text-gray-300 transition-all","data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...r,children:(0,q.jsx)("div",{className:"pb-4 pt-0",children:t})}));Hir.displayName=Jle.displayName;var jir=Hn("relative w-full flex items-center gap-3 p-4 border text-foreground [&>svg]:shrink-0",{variants:{variant:{default:"bg-background text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/30",success:"bg-success/10 text-success border-success/30",warning:"bg-warning/10 text-warning border-warning/30",error:"bg-destructive/10 text-destructive border-destructive/30",info:"bg-blue-500/10 text-blue-500 border-blue-500/30"},size:{sm:"py-2 text-xs",default:"py-3 text-sm",lg:"py-4 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},withClose:{true:"pr-10"}},defaultVariants:{variant:"default",size:"default",radius:"default",withClose:!1}}),$ir=ee.forwardRef(({className:e,variant:t="default",size:r,radius:n,hideIcon:o=!1,closable:a=!1,onClose:i,children:s,...l},c)=>{let u=ee.useMemo(()=>{switch(t){case"success":return Ky;case"warning":return W0;case"error":return Jg;case"info":return oM;default:return oM}},[t]);return(0,q.jsxs)("div",{ref:c,role:"alert",className:Ae("moonui-theme",jir({variant:t,size:r,radius:n,withClose:a}),e),...l,children:[!o&&(0,q.jsx)(u,{className:"h-5 w-5"}),(0,q.jsx)("div",{className:"flex-1",children:s}),a&&i&&(0,q.jsx)("button",{onClick:i,className:"absolute right-3 top-3 inline-flex h-6 w-6 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100","aria-label":"Kapat",children:(0,q.jsx)(Yy,{className:"h-4 w-4"})})]})});$ir.displayName="Alert";var qir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("h5",{ref:r,className:Ae("moonui-theme","font-semibold leading-tight tracking-tight mb-1",e),...t}));qir.displayName="AlertTitle";var Wir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","text-sm leading-5 text-muted-foreground",e),...t}));Wir.displayName="AlertDescription";var Gir=Hn("relative overflow-hidden",{variants:{variant:{default:"rounded-md bg-muted/10",ghost:"bg-transparent",outline:"rounded-md border border-border",card:"rounded-md bg-card shadow-sm"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"default"}}),Kir=ee.forwardRef(({className:e,variant:t,radius:r,ratio:n=16/9,style:o,children:a,...i},s)=>(0,q.jsx)("div",{ref:s,className:Ae("moonui-theme",Gir({variant:t,radius:r}),e),style:{position:"relative",paddingBottom:`${1/n*100}%`,...o},...i,children:(0,q.jsx)("div",{className:"absolute inset-0",children:a})}));Kir.displayName="AspectRatio";var Xir=Hn("relative flex shrink-0 overflow-hidden",{variants:{size:{default:"h-10 w-10",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12",xl:"h-16 w-16","2xl":"h-20 w-20"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",full:"rounded-full",none:"rounded-none"},variant:{default:"",ring:"ring-2 ring-border",ringOffset:"ring-2 ring-border ring-offset-2 ring-offset-background",border:"border-2 border-border"}},defaultVariants:{size:"default",radius:"default",variant:"default"}}),Xtt=ee.forwardRef(({className:e,size:t,radius:r,variant:n,...o},a)=>(0,q.jsx)(ace,{ref:a,className:Ae("moonui-theme",Xir({size:t,radius:r,variant:n}),e),...o}));Xtt.displayName=ace.displayName;var Yir=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(ice,{ref:r,className:Ae("moonui-theme","aspect-square h-full w-full",e),...t}));Yir.displayName=ice.displayName;var Ytt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(sce,{ref:r,className:Ae("flex h-full w-full items-center justify-center bg-muted",e),...t}));Ytt.displayName=sce.displayName;var Qir=ee.forwardRef(({className:e,limit:t,avatars:r,overlapOffset:n=-8,...o},a)=>{let i=t?r.slice(0,t):r,s=t?Math.max(0,r.length-t):0;return(0,q.jsx)("div",{ref:a,className:Ae("moonui-theme","flex items-center",e),...o,children:(0,q.jsxs)("div",{className:"flex",children:[i.map((l,c)=>(0,q.jsx)("div",{className:"relative",style:{marginLeft:c===0?0:`${n}px`,zIndex:i.length-c},children:l},c)),s>0&&(0,q.jsx)("div",{className:"relative z-0",style:{marginLeft:`${n}px`},children:(0,q.jsx)(Xtt,{variant:"border",children:(0,q.jsxs)(Ytt,{children:["+",s]})})})]})})});Qir.displayName="AvatarGroup";var Zir=Hn(["inline-flex items-center justify-center gap-1.5","font-medium transition-colors duration-200","border focus:outline-none","focus-visible:ring-2 focus-visible:ring-offset-1","mr-2 mb-2 last:mr-0"],{variants:{variant:{primary:["border-transparent bg-gray-900 text-white","hover:bg-gray-800 dark:hover:bg-gray-700","focus-visible:ring-gray-500/30 dark:focus-visible:ring-gray-400/40","dark:bg-gray-700 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"],secondary:["border-transparent bg-secondary text-secondary-foreground","hover:bg-gray-200 dark:hover:bg-gray-600","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:bg-gray-700/50 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"],outline:["border-gray-200 dark:border-gray-600","bg-transparent text-foreground","hover:border-gray-300 dark:hover:border-gray-500","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-100 dark:bg-transparent dark:backdrop-blur-sm"],destructive:["border-transparent bg-error text-white","hover:bg-error/90 dark:hover:bg-error/80","focus-visible:ring-error/30 dark:focus-visible:ring-error/25","dark:bg-error/90 dark:text-white dark:shadow-inner dark:shadow-error/10"],success:["border-transparent bg-success text-white","hover:bg-success/90 dark:hover:bg-success/80","focus-visible:ring-success/30 dark:focus-visible:ring-success/25","dark:bg-success/90 dark:text-white dark:shadow-inner dark:shadow-success/10"],warning:["border-transparent bg-warning text-white","hover:bg-warning/90 dark:hover:bg-warning/80","focus-visible:ring-warning/30 dark:focus-visible:ring-warning/25","dark:bg-warning/90 dark:text-gray-900 dark:shadow-inner dark:shadow-warning/10"],ghost:["border border-gray-200 bg-gray-50/50 text-gray-700","hover:bg-gray-100 dark:hover:bg-gray-800/60","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:border-gray-700 dark:bg-gray-800/30 dark:text-gray-300","transition-all duration-200"],pro:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"],admin:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"]},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-3 text-sm",lg:"h-8 px-4 text-base"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",none:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",radius:"default"}});function C8({className:e,variant:t,size:r,radius:n,withDot:o,dotColor:a,removable:i,onRemove:s,leftIcon:l,rightIcon:c,noAutoSpacing:u,children:d,...f}){let p=l,m=d;return t==="pro"&&(p=l||(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:[(0,q.jsx)("path",{d:"M12 0L13.09 8.26L22 9L13.09 9.74L12 18L10.91 9.74L2 9L10.91 8.26L12 0Z",fill:"currentColor"}),(0,q.jsx)("path",{d:"M19 5L19.5 7L21 7.5L19.5 8L19 10L18.5 8L17 7.5L18.5 7L19 5Z",fill:"currentColor"}),(0,q.jsx)("path",{d:"M19 15L19.5 17L21 17.5L19.5 18L19 20L18.5 18L17 17.5L18.5 17L19 15Z",fill:"currentColor"})]}),m=d||"Pro"),t==="admin"&&(p=l||(0,q.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:(0,q.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"})}),m=d||"Admin Pro"),(0,q.jsxs)("div",{className:Ae("moonui-theme",Zir({variant:t,size:r,radius:n}),u&&"mr-0 mb-0",e),"data-removable":i?"":void 0,...f,children:[o&&(0,q.jsx)("span",{className:Ae("h-2 w-2 rounded-full",a||(t==="destructive"||t==="success"||t==="warning"?"bg-white":t==="secondary"?"bg-secondary-foreground":t==="outline"||t==="ghost"?"bg-foreground":t==="pro"||t==="admin"?"bg-white":"bg-primary-foreground")),"aria-hidden":"true"}),p&&(0,q.jsx)("span",{className:"inline-flex shrink-0 items-center",children:p}),(0,q.jsx)("span",{className:"inline-flex items-center",children:m}),c&&(0,q.jsx)("span",{className:"inline-flex shrink-0 items-center",children:c}),i&&s&&(0,q.jsx)("button",{type:"button",className:"ml-1 -mr-1 h-3.5 w-3.5 rounded-full inline-flex items-center justify-center hover:bg-black/10 dark:hover:bg-white/10",onClick:h=>{h.stopPropagation(),s()},"aria-label":"Remove badge",children:(0,q.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"opacity-70","aria-hidden":"true",children:(0,q.jsx)("path",{d:"M0.799988 7.19999L7.19999 0.799988M0.799988 0.799988L7.19999 7.19999",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}var Jir=Hn("flex items-center gap-1.5 text-sm",{variants:{variant:{default:"text-foreground transition-colors",muted:"text-muted-foreground transition-colors",ghost:"text-foreground/60 transition-colors"},size:{default:"text-sm",sm:"text-xs",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),esr=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)("nav",{ref:o,className:Ae("moonui-theme",Jir({variant:t,size:r}),e),"aria-label":"breadcrumb",...n}));esr.displayName="Breadcrumb";var tsr=ee.forwardRef(({className:e,collapsed:t,collapsedWidth:r=3,...n},o)=>{let a=ee.Children.toArray(n.children).filter(Boolean),i=a.length;if(t&&i>r){let s=a[0],l=a.slice(-2);return(0,q.jsxs)("ol",{ref:o,className:Ae("flex flex-wrap items-center gap-1.5 sm:gap-2.5",e),...n,children:[s,(0,q.jsx)(Qtt,{}),l]})}return(0,q.jsx)("ol",{ref:o,className:Ae("flex flex-wrap items-center gap-1.5 sm:gap-2.5",e),...n})});tsr.displayName="BreadcrumbList";var rsr=ee.forwardRef(({className:e,isCurrent:t,href:r,asChild:n=!1,...o},a)=>{let i=n?ee.Fragment:r?"a":"span",s=n?{}:r?{href:r}:{};return(0,q.jsx)("li",{ref:a,className:Ae("moonui-theme","inline-flex items-center gap-1.5",e),"aria-current":t?"page":void 0,...o,children:(0,q.jsx)(i,{className:Ae("transition-colors duration-200 hover:text-foreground",t?"font-medium text-foreground":"text-muted-foreground hover:text-foreground hover:underline hover:underline-offset-4 hover:decoration-muted-foreground/30"),...s,children:o.children})})});rsr.displayName="BreadcrumbItem";var nsr=({children:e,className:t,...r})=>(0,q.jsx)("span",{role:"presentation","aria-hidden":"true",className:Ae("moonui-theme","text-muted-foreground opacity-70",t),...r,children:e||(0,q.jsx)($0,{className:"h-3.5 w-3.5"})});nsr.displayName="BreadcrumbSeparator";var Qtt=({className:e,...t})=>(0,q.jsxs)("span",{role:"presentation","aria-hidden":"true",className:Ae("moonui-theme","flex items-center text-muted-foreground hover:text-foreground/80 transition-colors duration-200",e),...t,children:[(0,q.jsx)(Xy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"More pages"})]});Qtt.displayName="BreadcrumbEllipsis";var osr=ee.forwardRef(({className:e,href:t,...r},n)=>(0,q.jsx)("a",{ref:n,href:t,className:Ae("transition-colors duration-200 hover:text-foreground text-muted-foreground hover:underline hover:underline-offset-4 hover:decoration-muted-foreground/30",e),...r}));osr.displayName="BreadcrumbLink";var asr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("span",{ref:r,className:Ae("font-medium text-foreground dark:text-white dark:text-opacity-95",e),...t}));asr.displayName="BreadcrumbPage";var Ztt=Hn(["inline-flex items-center justify-center gap-2 whitespace-nowrap","font-medium relative","transition-all duration-200 ease-out","transform active:scale-[0.98]","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none disabled:transform-none"],{variants:{variant:{primary:["bg-primary text-primary-foreground","dark:bg-primary dark:text-primary-foreground","hover:bg-primary/90 dark:hover:bg-primary/90","active:bg-primary/80 dark:active:bg-primary/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],secondary:["bg-gray-100 text-gray-900","dark:bg-gray-800 dark:text-gray-100","hover:bg-gray-200 dark:hover:bg-gray-700","active:bg-gray-300 dark:active:bg-gray-600","border border-gray-200 dark:border-gray-700","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","shadow-sm hover:shadow-md"],outline:["bg-background text-foreground","dark:bg-background dark:text-foreground","border border-input dark:border-input","hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground","active:bg-accent/80 dark:active:bg-accent/80","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],ghost:["text-gray-700","dark:text-gray-300","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100","active:bg-gray-200 dark:active:bg-gray-700","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],destructive:["bg-destructive text-destructive-foreground","dark:bg-destructive dark:text-destructive-foreground","hover:bg-destructive/90 dark:hover:bg-destructive/90","active:bg-destructive/80 dark:active:bg-destructive/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],success:["bg-success text-success-foreground","dark:bg-success dark:text-success-foreground","hover:bg-success/90 dark:hover:bg-success/90","active:bg-success/80 dark:active:bg-success/80","shadow-sm hover:shadow-md","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-all duration-200"],link:["text-primary bg-transparent","underline-offset-4 hover:underline","hover:text-primary/80 active:text-primary/70","p-0 h-auto","transition-colors duration-200"],gradient:["bg-gradient-to-r from-purple-500 to-pink-500 text-white","hover:from-purple-600 hover:to-pink-600","active:from-purple-700 active:to-pink-700","shadow-xl shadow-purple-500/40","hover:shadow-2xl hover:shadow-purple-500/50","focus-visible:ring-purple-500/50","transition-all duration-300"],glow:["bg-blue-500 text-white","shadow-[0_0_30px_rgba(59,130,246,0.5)]","hover:shadow-[0_0_40px_rgba(59,130,246,0.7)]","active:shadow-[0_0_20px_rgba(59,130,246,0.4)]","hover:bg-blue-600","focus-visible:ring-blue-500/50","transition-all duration-300"],soft:["bg-primary/10 text-primary","hover:bg-primary/20","active:bg-primary/30","focus-visible:ring-primary/50","dark:bg-primary/20 dark:text-primary-foreground","dark:hover:bg-primary/30 dark:active:bg-primary/40","transition-colors duration-200"],glass:["bg-white/10 backdrop-blur-md text-foreground","border border-white/20","hover:bg-white/20 hover:border-white/30","active:bg-white/30","shadow-lg","focus-visible:ring-white/50","dark:bg-gray-800/10 dark:border-gray-700/20","dark:hover:bg-gray-800/20 dark:hover:border-gray-700/30","transition-all duration-200"],neon:["bg-transparent text-green-400","border-2 border-green-400","hover:bg-green-400 hover:text-gray-900","hover:shadow-[0_0_30px_rgba(74,222,128,0.6)]","active:shadow-[0_0_15px_rgba(74,222,128,0.4)]","focus-visible:ring-green-400/50","transition-all duration-300"]},size:{xs:"h-7 px-2.5 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-base",lg:"h-12 px-6 text-lg",xl:"h-14 px-8 text-xl",icon:"h-10 w-10 p-2","icon-sm":"h-8 w-8 p-1.5","icon-lg":"h-12 w-12 p-3"},rounded:{default:"rounded-xl",full:"rounded-full",none:"rounded-none",sm:"rounded-lg",lg:"rounded-2xl"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md",rounded:"default",fullWidth:!1}}),I8=ee.forwardRef(({className:e,variant:t,size:r,rounded:n,fullWidth:o,asChild:a=!1,loading:i=!1,leftIcon:s,rightIcon:l,children:c,disabled:u,...d},f)=>(0,q.jsxs)("button",{className:Ae("moonui-theme",Ztt({variant:t,size:r,rounded:n,fullWidth:o,className:e})),ref:f,disabled:u||i,"data-loading":i?"":void 0,...d,children:[i&&(0,q.jsx)(Ef,{className:"w-4 h-4 animate-spin","aria-hidden":"true"}),!i&&s,c,!i&&l]}));I8.displayName="Button";Hn("",{variants:{hover:{lift:["transition-all duration-200 ease-out","hover:-translate-y-0.5","hover:shadow-md"],glow:["transition-all duration-300 ease-out","hover:shadow-lg","hover:shadow-primary/20"],scale:["transition-transform duration-200 ease-out","hover:scale-105","active:scale-95"],brightness:["transition-all duration-200 ease-out","hover:brightness-110","active:brightness-95"],border:["transition-all duration-200 ease-out","hover:border-primary/50"]},focus:{ring:["focus:outline-none","focus-visible:ring-2","focus-visible:ring-primary/50","focus-visible:ring-offset-2"],glow:["focus:outline-none","focus-visible:shadow-lg","focus-visible:shadow-primary/30"],border:["focus:outline-none","focus-visible:border-primary","focus-visible:border-2"]},active:{scale:["active:scale-95","transition-transform duration-100"],darken:["active:brightness-90","transition-all duration-100"],depress:["active:translate-y-0.5","active:shadow-sm","transition-all duration-100"]},cursor:{pointer:"cursor-pointer",grab:"cursor-grab active:cursor-grabbing",text:"cursor-text",wait:"cursor-wait",help:"cursor-help",notAllowed:"cursor-not-allowed"}},defaultVariants:{hover:"lift",focus:"ring",active:"scale",cursor:"pointer"}});var x8={smooth:{type:"spring",stiffness:260,damping:20},bouncy:{type:"spring",stiffness:300,damping:15},stiff:{type:"spring",stiffness:400,damping:25},gentle:{type:"spring",stiffness:150,damping:15}},Ode={lift:{y:-2,transition:x8.smooth},scale:{scale:1.05,transition:x8.smooth},glow:{boxShadow:"0 0 20px rgba(var(--primary), 0.3)",transition:x8.smooth},rotate:{rotate:2,transition:x8.bouncy}},isr={scale:{scale:.95,transition:{duration:.1}},depress:{y:1,transition:{duration:.1}}},ssr={initial:{opacity:.5},animate:{opacity:[.5,.8,.5],transition:{duration:1.5,repeat:1/0,ease:"easeInOut"}}},Vtt=Hn("rounded-lg border bg-card text-card-foreground shadow-sm dark:shadow-gray-900/20 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 transition-all duration-200",{variants:{variant:{default:"",outline:"border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",filled:"border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",elevated:"border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",gradient:"border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",glass:"border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"},size:{default:"",sm:"",lg:"",xl:""},radius:{default:"rounded-lg",sm:"rounded-md",lg:"rounded-xl",full:"rounded-3xl",none:"rounded-none"},interactive:{true:"cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",false:""}},defaultVariants:{variant:"default",size:"default",radius:"default"}}),lsr=ee.forwardRef(({className:e,variant:t,size:r,radius:n,interactive:o,microInteraction:a="lift",...i},s)=>{if(o&&a!=="none"){let l={whileHover:a==="scale"?Ode.scale:a==="glow"?Ode.glow:Ode.lift,whileTap:isr.scale};return(0,q.jsx)(Ad.div,{ref:s,className:Ae("moonui-theme",Vtt({variant:t,size:r,radius:n,interactive:o,className:e})),...l,...i})}return(0,q.jsx)("div",{ref:s,className:Ae("moonui-theme",Vtt({variant:t,size:r,radius:n,interactive:o,className:e})),...i})});lsr.displayName="Card";var csr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","flex flex-col space-y-1.5 p-6",e),...t}));csr.displayName="CardHeader";var usr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("h3",{ref:r,className:Ae("moonui-theme","text-lg font-semibold leading-none tracking-tight",e),...t}));usr.displayName="CardTitle";var dsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("p",{ref:r,className:Ae("moonui-theme","text-sm text-muted-foreground",e),...t}));dsr.displayName="CardDescription";var fsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","p-6 pt-0",e),...t}));fsr.displayName="CardContent";var psr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("div",{ref:r,className:Ae("moonui-theme","flex items-center p-6 pt-0",e),...t}));psr.displayName="CardFooter";var msr=e=>{let t={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/};for(let[r,n]of Object.entries(t))if(n.test(e))return r;return"unknown"},Utt=(e,t)=>{let r=e.replace(/\s+/g,""),n=t==="amex"?[4,6,5]:[4,4,4,4],o="",a=0;for(let i of n){if(a>=r.length)break;o&&(o+=" "),o+=r.slice(a,a+i),a+=i}return o},hsr=ee.forwardRef(({className:e,value:t="",onChange:r,showIcon:n=!0,size:o,...a},i)=>{let[s,l]=ee.useState("unknown"),c=u=>{let d=u.target.value.replace(/\D/g,""),f=msr(d);l(f);let p=f==="amex"?15:16,m=d.slice(0,p),h=Utt(m,f);r?.(m,f),u.target.value=h};return(0,q.jsxs)("div",{className:"relative",children:[(0,q.jsx)(JM,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"1234 5678 9012 3456",value:Utt(t,s),onChange:c,className:Ae(n&&"pl-10",e),...a}),n&&(0,q.jsx)(f_,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})});hsr.displayName="CardNumberInput";var gsr=ee.forwardRef(({className:e,value:t="",onChange:r,size:n,...o},a)=>{let i=l=>{let c=l.target.value.replace(/\D/g,"");if(c.length>=2){let d=parseInt(c.slice(0,2));d>12?c="12"+c.slice(2):d===0&&(c="01"+c.slice(2))}c=c.slice(0,4);let u=c;c.length>=2&&(u=c.slice(0,2)+"/"+c.slice(2)),r?.(c),l.target.value=u},s=t.length>=2?t.slice(0,2)+"/"+t.slice(2):t;return(0,q.jsx)(JM,{ref:a,type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:s,onChange:i,className:e,...o})});gsr.displayName="CardExpiryInput";var vsr=ee.forwardRef(({className:e,value:t="",onChange:r,cardType:n="unknown",size:o,...a},i)=>{let s=n==="amex"?4:3;return(0,q.jsx)(JM,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-csc",placeholder:n==="amex"?"1234":"123",value:t,onChange:c=>{let u=c.target.value.replace(/\D/g,"").slice(0,s);r?.(u)},maxLength:s,className:e,...a})});vsr.displayName="CardCVCInput";var ysr=ee.forwardRef(({className:e,value:t="",onChange:r,format:n="US",size:o,...a},i)=>{let s=c=>{let u=c.target.value;switch(n){case"US":u=u.replace(/\D/g,"").slice(0,5);break;case"CA":u=u.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6),u.length>=3&&(u=u.slice(0,3)+" "+u.slice(3));break;case"UK":u=u.toUpperCase().replace(/[^A-Z0-9\s]/g,"").slice(0,8);break;default:u=u.slice(0,10)}r?.(u.replace(/\s/g,"")),c.target.value=u};return(0,q.jsx)(JM,{ref:i,type:"text",autoComplete:"postal-code",placeholder:(()=>{switch(n){case"US":return"12345";case"CA":return"K1A 0B1";case"UK":return"SW1A 1AA";default:return"Postal Code"}})(),value:t,onChange:s,className:e,...a})});ysr.displayName="CardZipInput";var xsr=Hn("peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",{variants:{variant:{default:"border-border bg-background data-[state=checked]:bg-primary data-[state=checked]:border-primary",outline:"border-border bg-transparent data-[state=checked]:bg-primary data-[state=checked]:border-primary",muted:"border-border bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",ghost:"border-transparent bg-transparent hover:bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-sm",md:"rounded-md",full:"rounded-full"},animation:{none:"",subtle:"transition-all duration-200",default:"transition-all duration-200",bounce:"transition-all duration-200"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default"}}),Jtt=ee.forwardRef(({className:e,variant:t,size:r,radius:n,animation:o,indeterminate:a=!1,icon:i,checked:s,...l},c)=>{let[u,d]=ee.useState(a);return ee.useEffect(()=>{d(a)},[a]),(0,q.jsx)(XG,{ref:c,checked:u?!1:s,className:Ae("moonui-theme",xsr({variant:t,size:r,radius:n,animation:o}),e),...l,children:(0,q.jsx)(vue,{className:Ae("flex items-center justify-center text-current",o==="bounce"&&"data-[state=checked]:animate-bounce"),children:u?(0,q.jsx)(b_,{className:"h-[65%] w-[65%]"}):i||(0,q.jsx)(Ky,{className:"h-[65%] w-[65%]"})})})});Jtt.displayName=XG.displayName;var bsr=ee.forwardRef(({className:e,orientation:t="vertical",spacing:r="1rem",children:n,...o},a)=>(0,q.jsx)("div",{ref:a,className:Ae("flex",t==="vertical"?"flex-col":"flex-row flex-wrap",e),style:{gap:r},role:"group",...o,children:n}));bsr.displayName="CheckboxGroup";var Vde=ee.forwardRef(({className:e,htmlFor:t,children:r,position:n="end",disabled:o=!1,...a},i)=>(0,q.jsx)("label",{ref:i,htmlFor:t,className:Ae("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n==="start"?"mr-2":"ml-2",o&&"cursor-not-allowed opacity-70",e),...a,children:r}));Vde.displayName="CheckboxLabel";var wsr=ee.forwardRef(({id:e,label:t,labelPosition:r="end",labelClassName:n,...o},a)=>{let i=ee.useId(),s=e||i;return(0,q.jsxs)("div",{className:"flex items-center",children:[r==="start"&&(0,q.jsx)(Vde,{htmlFor:s,position:"start",disabled:o.disabled,className:n,children:t}),(0,q.jsx)(Jtt,{ref:a,id:s,...o}),r==="end"&&(0,q.jsx)(Vde,{htmlFor:s,position:"end",disabled:o.disabled,className:n,children:t})]})});wsr.displayName="CheckboxWithLabel";function Csr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Ssr(e,t=[]){let r=[];function n(a,i){let s=ee.createContext(i),l=r.length;r=[...r,i];let c=d=>{let{scope:f,children:p,...m}=d,h=f?.[e]?.[l]||s,g=ee.useMemo(()=>m,Object.values(m));return(0,q.jsx)(h.Provider,{value:g,children:p})};c.displayName=a+"Provider";function u(d,f){let p=f?.[e]?.[l]||s,m=ee.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[c,u]}let o=()=>{let a=r.map(i=>ee.createContext(i));return function(s){let l=s?.[e]||a;return ee.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,Psr(o,...t)]}function Psr(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){let i=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(a)[`__scope${c}`];return{...s,...d}},{});return ee.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var zF=globalThis?.document?ee.useLayoutEffect:()=>{},Isr=ee[" useInsertionEffect ".trim().toString()]||zF;function ksr({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=Rsr({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=ee.useRef(e!==void 0);ee.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=ee.useCallback(u=>{if(s){let d=Nsr(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function Rsr({defaultProp:e,onChange:t}){let[r,n]=ee.useState(e),o=ee.useRef(r),a=ee.useRef(t);return Isr(()=>{a.current=t},[t]),ee.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function Nsr(e){return typeof e=="function"}function ztt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Msr(...e){return t=>{let r=!1,n=e.map(o=>{let a=ztt(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){let a=n[o];typeof a=="function"?a():ztt(e[o],null)}}}}function ert(...e){return ee.useCallback(Msr(...e),e)}var Tsr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$de=Tsr.reduce((e,t)=>{let r=Sc(`Primitive.${t}`),n=ee.forwardRef((o,a)=>{let{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,q.jsx)(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Asr(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var trt=e=>{let{present:t,children:r}=e,n=Lsr(t),o=typeof r=="function"?r({present:n.isPresent}):ee.Children.only(r),a=ert(n.ref,Esr(o));return typeof r=="function"||n.isPresent?ee.cloneElement(o,{ref:a}):null};trt.displayName="Presence";function Lsr(e){let[t,r]=ee.useState(),n=ee.useRef(null),o=ee.useRef(e),a=ee.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Asr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ee.useEffect(()=>{let c=b8(n.current);a.current=s==="mounted"?c:"none"},[s]),zF(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=b8(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),zF(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=b8(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=b8(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:ee.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function b8(e){return e?.animationName||"none"}function Esr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Dsr=ee[" useId ".trim().toString()]||(()=>{}),Osr=0;function _sr(e){let[t,r]=ee.useState(Dsr());return zF(()=>{e||r(n=>n??String(Osr++))},[e]),e||(t?`radix-${t}`:"")}var k8="Collapsible",[Fsr,aXn]=Ssr(k8),[Bsr,qde]=Fsr(k8),Vsr=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:a,onOpenChange:i,...s}=e,[l,c]=ksr({prop:n,defaultProp:o??!1,onChange:i,caller:k8});return(0,q.jsx)(Bsr,{scope:r,disabled:a,contentId:_sr(),open:l,onOpenToggle:ee.useCallback(()=>c(u=>!u),[c]),children:(0,q.jsx)($de.div,{"data-state":Gde(l),"data-disabled":a?"":void 0,...s,ref:t})})});Vsr.displayName=k8;var rrt="CollapsibleTrigger",nrt=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,o=qde(rrt,r);return(0,q.jsx)($de.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Gde(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:Csr(e.onClick,o.onOpenToggle)})});nrt.displayName=rrt;var Wde="CollapsibleContent",ort=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=qde(Wde,e.__scopeCollapsible);return(0,q.jsx)(trt,{present:r||o.open,children:({present:a})=>(0,q.jsx)(Usr,{...n,ref:t,present:a})})});ort.displayName=Wde;var Usr=ee.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:o,...a}=e,i=qde(Wde,r),[s,l]=ee.useState(n),c=ee.useRef(null),u=ert(t,c),d=ee.useRef(0),f=d.current,p=ee.useRef(0),m=p.current,h=i.open||s,g=ee.useRef(h),v=ee.useRef(void 0);return ee.useEffect(()=>{let y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),zF(()=>{let y=c.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";let x=y.getBoundingClientRect();d.current=x.height,p.current=x.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(n)}},[i.open,n]),(0,q.jsx)($de.div,{"data-state":Gde(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{["--radix-collapsible-content-height"]:f?`${f}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...e.style},children:h&&o})});function Gde(e){return e?"open":"closed"}var Ude=nrt,art=ort;var Htt=Hn("flex w-full items-center justify-between transition-all",{variants:{variant:{default:"text-foreground hover:text-primary",ghost:"text-foreground hover:bg-accent/10 rounded",outline:"text-foreground border border-border rounded-t-md hover:bg-accent/5"},size:{sm:"text-xs py-2 px-3",default:"text-sm py-3 px-4",md:"text-base py-4 px-4",lg:"text-lg py-5 px-5"}},defaultVariants:{variant:"default",size:"default"}}),zsr=ee.forwardRef(({className:e,children:t,variant:r,size:n,asChild:o,...a},i)=>o?(0,q.jsx)(Ude,{ref:i,className:Ae("moonui-theme",Htt({variant:r,size:n}),e),asChild:o,...a,children:t}):(0,q.jsxs)(Ude,{ref:i,className:Ae("moonui-theme",Htt({variant:r,size:n}),e),...a,children:[t,(0,q.jsx)(j0,{className:"h-4 w-4 shrink-0 ml-auto transition-transform duration-200 [&[data-state=open]]:rotate-180"})]}));zsr.displayName=Ude.displayName;var Hsr=Hn("overflow-hidden transition-all data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",{variants:{variant:{default:"text-muted-foreground",ghost:"text-muted-foreground rounded-b",outline:"text-muted-foreground border border-t-0 border-border rounded-b-md"},size:{sm:"text-xs",default:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{variant:"default",size:"default"}}),jsr=ee.forwardRef(({className:e,children:t,variant:r,size:n,...o},a)=>(0,q.jsx)(art,{ref:a,className:Ae("moonui-theme",Hsr({variant:r,size:n}),e),...o,children:(0,q.jsx)("div",{className:"p-4",children:t})}));jsr.displayName=art.displayName;var $sr=Hn("group relative flex items-center w-full transition-colors",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),qsr=Hn(["w-full bg-background transition-all duration-200","text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:font-medium","focus-visible:outline-none dark:text-gray-200"],{variants:{variant:{standard:"border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-900/60 dark:shadow-inner dark:shadow-gray-950/10",filled:"border border-transparent bg-gray-100 dark:bg-gray-800/90 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700/90 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",ghost:"border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",underline:"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""},hasRightButton:{true:"pr-10",false:""},isError:{true:"border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",false:""},isSuccess:{true:"border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800/50 pointer-events-none",false:""}},defaultVariants:{variant:"standard",size:"md",isError:!1,isSuccess:!1,isDisabled:!1,hasLeftIcon:!1,hasRightIcon:!1,hasRightButton:!1}}),JM=ee.forwardRef(({className:e,wrapperClassName:t,messageClassName:r,variant:n,size:o,isError:a,disabled:i,error:s,success:l,loading:c,leftIcon:u,rightIcon:d,rightButton:f,alwaysShowMessage:p=!1,...m},h)=>{let g=p||s||l,v=s?"error":l?"success":"normal";return(0,q.jsxs)("div",{className:"space-y-1.5 w-full",children:[(0,q.jsxs)("div",{className:Ae("moonui-theme",$sr({size:o}),t),children:[u&&(0,q.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:c?(0,q.jsx)(Ef,{className:"h-4 w-4 animate-spin"}):u}),(0,q.jsx)("input",{className:Ae(qsr({variant:n,size:o,isError:!!s||a,isSuccess:!!l,isDisabled:i||c,hasLeftIcon:!!u||c,hasRightIcon:!!d,hasRightButton:!!f}),e),ref:h,disabled:i||c,"data-loading":c?"":void 0,"data-error":s?"":void 0,"data-success":l?"":void 0,"aria-invalid":!!s||!!a||void 0,"aria-describedby":s?`${m.id||""}-error`:l?`${m.id||""}-success`:void 0,...m}),d&&!c&&(0,q.jsx)("div",{className:"absolute right-3 text-gray-500 flex items-center justify-center pointer-events-none",children:d}),f&&(0,q.jsx)("div",{className:"absolute right-3",children:f}),c&&!u&&(0,q.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:(0,q.jsx)(Ef,{className:"h-4 w-4 animate-spin","aria-hidden":"true"})})]}),g&&(0,q.jsx)("p",{className:Ae("text-xs transition-all",v==="error"&&"text-error",v==="success"&&"text-success",v==="normal"&&"text-muted-foreground",r),id:s?`${m.id||""}-error`:l?`${m.id||""}-success`:void 0,children:s||l||""})]})});JM.displayName="Input";var Wsr=Hn("text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"),Gsr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(yue,{ref:r,className:Ae(Wsr(),e),...t}));Gsr.displayName=yue.displayName;var Ksr=Hn("z-50 w-72 rounded-md border border-border bg-background p-4 shadow-md outline-none 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",{variants:{variant:{default:"",destructive:"border-destructive bg-destructive/5",outline:"border-border bg-transparent",subtle:"border-transparent bg-muted/50"},size:{sm:"w-48 p-3",default:"w-72 p-4",lg:"w-96 p-5"},side:{top:"data-[side=top]:slide-in-from-bottom-2",right:"data-[side=right]:slide-in-from-left-2",bottom:"data-[side=bottom]:slide-in-from-top-2",left:"data-[side=left]:slide-in-from-right-2"},position:{pointerEventsNone:"pointer-events-none",default:""},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},shadow:{none:"shadow-none",sm:"shadow-sm",default:"shadow-md",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}},defaultVariants:{variant:"default",size:"default",radius:"default",shadow:"default"}}),Xsr=RZe,Ysr=NZe;var irt=ee.forwardRef(({className:e,variant:t,size:r,side:n,position:o,radius:a,shadow:i,backdrop:s=!1,closeOnInteractOutside:l=!0,overlayBackdrop:c=!1,sideOffset:u=4,...d},f)=>(0,q.jsxs)(q.Fragment,{children:[c&&(0,q.jsx)("div",{className:"fixed inset-0 z-40 bg-overlay opacity-30"}),(0,q.jsx)(bue,{ref:f,sideOffset:u,collisionPadding:8,onInteractOutside:p=>{l||p.preventDefault()},className:Ae(Ksr({variant:t,size:r,side:n,position:o,radius:a,shadow:i}),s&&"backdrop-blur-md bg-opacity-80",e),...d})]}));irt.displayName=bue.displayName;var Qsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","my-2 h-px bg-border",e),...t});Qsr.displayName="PopoverSeparator";var Zsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","-mx-4 -mt-4 mb-3 px-4 pt-4 pb-3 border-b border-border",e),...t});Zsr.displayName="PopoverHeader";var Jsr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("moonui-theme","-mx-4 -mb-4 mt-3 px-4 pt-3 pb-4 border-t border-border",e),...t});Jsr.displayName="PopoverFooter";var elr=ee.forwardRef(({vertical:e=!1,...t},r)=>(0,q.jsx)(Pue,{ref:r,className:Ae("moonui-theme",t.className),orientation:e?"vertical":"horizontal",...t}));elr.displayName=Pue.displayName;var tlr=Hn("flex items-center justify-start transition-all duration-200",{variants:{variant:{default:"bg-muted rounded-md p-1 text-muted-foreground dark:bg-gray-800/80 dark:text-gray-400",pills:"bg-transparent gap-2 p-0 dark:text-gray-400",underline:"bg-transparent border-b border-border dark:border-gray-700 gap-4 dark:text-gray-400",cards:"bg-transparent gap-2 p-0 dark:text-gray-400",minimal:"bg-transparent gap-1 p-0 dark:text-gray-400"},orientation:{horizontal:"flex-row",vertical:"flex-col items-start gap-1"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",orientation:"horizontal",fullWidth:!1}}),rlr=ee.forwardRef(({className:e,variant:t,orientation:r,fullWidth:n,...o},a)=>(0,q.jsx)(Iue,{ref:a,className:Ae("moonui-theme",tlr({variant:t,orientation:r,fullWidth:n,className:e})),...o}));rlr.displayName=Iue.displayName;var nlr=Hn("inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/10",underline:"rounded-none border-b-2 border-transparent pb-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground dark:data-[state=active]:border-primary/80 dark:data-[state=active]:text-gray-100",pills:"rounded-full bg-muted hover:bg-muted/80 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground dark:bg-gray-800 dark:hover:bg-gray-700 dark:data-[state=active]:bg-primary/90 dark:data-[state=active]:text-white",cards:"rounded-md bg-muted/50 hover:bg-muted data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md dark:bg-gray-800/50 dark:hover:bg-gray-700/50 dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/20",minimal:"rounded-sm bg-transparent hover:bg-muted/30 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:underline data-[state=active]:underline-offset-4 dark:hover:bg-gray-800/30 dark:data-[state=active]:text-gray-200"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-1.5 text-sm",lg:"h-10 px-4 py-2 text-base"},orientation:{horizontal:"",vertical:"justify-start w-full text-left"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",size:"md",orientation:"horizontal",fullWidth:!1}}),olr=ee.forwardRef(({className:e,variant:t,size:r,icon:n,iconPosition:o="left",badge:a,fadeTabs:i=!1,orientation:s,fullWidth:l,children:c,...u},d)=>(0,q.jsxs)(kue,{ref:d,className:Ae("moonui-theme",nlr({variant:t,size:r,orientation:s,fullWidth:l}),i&&"data-[state=inactive]:opacity-60",e),...u,children:[n&&o==="left"&&(0,q.jsx)("span",{className:"mr-2",children:n}),c,n&&o==="right"&&(0,q.jsx)("span",{className:"ml-2",children:n}),a&&(0,q.jsx)("span",{className:"ml-2",children:a})]}));olr.displayName=kue.displayName;var alr=ee.forwardRef(({className:e,animated:t=!1,...r},n)=>(0,q.jsx)(Rue,{ref:n,className:Ae("moonui-theme","mt-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t&&"data-[state=active]:animate-fadeIn data-[state=inactive]:animate-fadeOut",e),...r}));alr.displayName=Rue.displayName;var ilr=Hn("relative flex w-full touch-none select-none items-center",{variants:{size:{sm:"h-5",default:"h-6",md:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),slr=Hn("relative h-1.5 w-full grow overflow-hidden rounded-full",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",accent:"bg-accent/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"}},defaultVariants:{variant:"default"}}),llr=Hn("absolute h-full",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",accent:"bg-accent",success:"bg-success",warning:"bg-warning",error:"bg-error"}},defaultVariants:{variant:"primary"}}),clr=Hn("block rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border-foreground bg-background",primary:"border-primary bg-background",secondary:"border-secondary bg-background",accent:"border-accent bg-background",success:"border-success bg-background",warning:"border-warning bg-background",error:"border-error bg-background"},size:{sm:"h-3 w-3",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"primary",size:"default"}}),ulr=ee.forwardRef(({className:e,size:t,trackVariant:r,rangeVariant:n,thumbVariant:o,thumbSize:a,showValueLabel:i=!1,valueLabelFormat:s,valueLabelClassName:l,value:c,defaultValue:u=[0],onValueChange:d,disabled:f,...p},m)=>{let[h,g]=ee.useState(c||u||[0]);ee.useEffect(()=>{c!==void 0&&g(c)},[c]);let v=T=>s?s(T):`${Math.round(T*100)/100}`,y=(T,A,M)=>(T-A)/(M-A)*100,x=ee.useRef(null),w=p.min||0,b=p.max||100,C=p.step||1,S=T=>{let A=T.map(M=>{if(C<1){let O=C.toString().split(".")[1]?.length||0;return Math.round(M*Math.pow(10,O))/Math.pow(10,O)}return Math.round(M)});g(A),d&&d(A)},P=T=>{if(f)return;let A=x.current;if(!A)return;let M=A.getBoundingClientRect(),O=(T.clientX-M.left)/M.width,F=w+O*(b-w),I=Math.round(F/C)*C,k=Math.max(w,Math.min(b,I)),R=[...h];R[0]=k,S(R)},N=T=>A=>{if(f)return;A.preventDefault();let M=F=>{let I=x.current;if(!I)return;let k=I.getBoundingClientRect(),R=(F.clientX-k.left)/k.width,E=w+R*(b-w),_=Math.round(E/C)*C,U=Math.max(w,Math.min(b,_)),V=[...h];V[T]=U,S(V)},O=()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",M),document.addEventListener("mouseup",O)};return(0,q.jsxs)("div",{className:"w-full",ref:m,...p,children:[i&&(0,q.jsx)("div",{className:Ae("flex justify-end mb-1 text-sm text-muted-foreground",l),children:h.length===1?(0,q.jsx)("span",{children:v(h[0])}):(0,q.jsxs)("span",{children:[v(h[0])," - ",v(h[h.length-1])]})}),(0,q.jsxs)("div",{className:Ae("moonui-theme",ilr({size:t}),e),"data-disabled":f?!0:void 0,children:[(0,q.jsx)("div",{ref:x,className:Ae(slr({variant:r||o||"default"})),onClick:P,children:(0,q.jsx)("div",{className:Ae(llr({variant:n||o||"primary"})),style:{left:"0%",width:`${y(h[0],w,b)}%`}})}),h.map((T,A)=>(0,q.jsx)("div",{className:Ae(clr({variant:o||"primary",size:a})),style:{left:`${y(T,w,b)}%`,transform:"translateX(-50%)",position:"absolute",top:"50%",marginTop:a==="sm"?"-6px":a==="lg"?"-12px":"-8px",cursor:f?"not-allowed":"pointer"},onMouseDown:N(A),"aria-label":`Thumb ${A+1}`,tabIndex:f?-1:0,role:"slider","aria-valuemin":w,"aria-valuemax":b,"aria-valuenow":T,"aria-disabled":f},A))]})]})});ulr.displayName="Slider";var iXn=Hn("relative inline-flex items-center justify-center",{variants:{size:{default:"h-10 w-10",sm:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},shape:{square:"rounded-md",circle:"rounded-full",rounded:"rounded-lg"}},defaultVariants:{size:"default",shape:"square"}});var jtt=1,dlr=.9,flr=.8,plr=.17,_de=.1,Fde=.999,mlr=.9999,hlr=.99,glr=/[\\\/_+.#"@\[\(\{&]/,vlr=/[\\\/_+.#"@\[\(\{&]/g,ylr=/[\s-]/,srt=/[\s-]/g;function zde(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?jtt:hlr;var s=`${o},${a}`;if(i[s]!==void 0)return i[s];for(var l=n.charAt(a),c=r.indexOf(l,o),u=0,d,f,p,m;c>=0;)d=zde(e,t,r,n,c+1,a+1,i),d>u&&(c===o?d*=jtt:glr.test(e.charAt(c-1))?(d*=flr,p=e.slice(o,c-1).match(vlr),p&&o>0&&(d*=Math.pow(Fde,p.length))):ylr.test(e.charAt(c-1))?(d*=dlr,m=e.slice(o,c-1).match(srt),m&&o>0&&(d*=Math.pow(Fde,m.length))):(d*=plr,o>0&&(d*=Math.pow(Fde,c-o))),e.charAt(c)!==t.charAt(a)&&(d*=mlr)),(d<_de&&r.charAt(c-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(c-1)!==n.charAt(a))&&(f=zde(e,t,r,n,c+1,a+2,i),f*_de>d&&(d=f*_de)),d>u&&(u=d),c=r.indexOf(l,c+1);return i[s]=u,u}function $tt(e){return e.toLowerCase().replace(srt," ")}function xlr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,zde(e,t,$tt(e),$tt(t),0,0,{})}var blr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ld=blr.reduce((e,t)=>{let r=Sc(`Primitive.${t}`),n=ee.forwardRef((o,a)=>{let{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,q.jsx)(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),HF=globalThis?.document?ee.useLayoutEffect:()=>{},wlr=ee[" useId ".trim().toString()]||(()=>{}),Clr=0;function YM(e){let[t,r]=ee.useState(wlr());return HF(()=>{e||r(n=>n??String(Clr++))},[e]),e||(t?`radix-${t}`:"")}function qtt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QM(...e){return t=>{let r=!1,n=e.map(o=>{let a=qtt(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){let a=n[o];typeof a=="function"?a():qtt(e[o],null)}}}}function G1(...e){return ee.useCallback(QM(...e),e)}var UF='[cmdk-group=""]',Bde='[cmdk-group-items=""]',Slr='[cmdk-group-heading=""]',lrt='[cmdk-item=""]',Wtt=`${lrt}:not([aria-disabled="true"])`,Hde="cmdk-item-select",KM="data-value",Plr=(e,t,r)=>xlr(e,t,r),crt=ee.createContext(void 0),jF=()=>ee.useContext(crt),urt=ee.createContext(void 0),Kde=()=>ee.useContext(urt),drt=ee.createContext(void 0),frt=ee.forwardRef((e,t)=>{let r=XM(()=>{var L,H;return{search:"",value:(H=(L=e.value)!=null?L:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=XM(()=>new Set),o=XM(()=>new Map),a=XM(()=>new Map),i=XM(()=>new Set),s=prt(e),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=YM(),x=YM(),w=YM(),b=ee.useRef(null),C=Olr();W1(()=>{if(u!==void 0){let L=u.trim();r.current.value=L,S.emit()}},[u]),W1(()=>{C(6,O)},[]);let S=ee.useMemo(()=>({subscribe:L=>(i.current.add(L),()=>i.current.delete(L)),snapshot:()=>r.current,setState:(L,H,j)=>{var $,W,z,G;if(!Object.is(r.current[L],H)){if(r.current[L]=H,L==="search")M(),T(),C(1,A);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(w);X?X.focus():($=document.getElementById(y))==null||$.focus()}if(C(7,()=>{var X;r.current.selectedItemId=(X=F())==null?void 0:X.id,S.emit()}),j||C(5,O),((W=s.current)==null?void 0:W.value)!==void 0){let X=H??"";(G=(z=s.current).onValueChange)==null||G.call(z,X);return}}S.emit()}},emit:()=>{i.current.forEach(L=>L())}}),[]),P=ee.useMemo(()=>({value:(L,H,j)=>{var $;H!==(($=a.current.get(L))==null?void 0:$.value)&&(a.current.set(L,{value:H,keywords:j}),r.current.filtered.items.set(L,N(H,j)),C(2,()=>{T(),S.emit()}))},item:(L,H)=>(n.current.add(L),H&&(o.current.has(H)?o.current.get(H).add(L):o.current.set(H,new Set([L]))),C(3,()=>{M(),T(),r.current.value||A(),S.emit()}),()=>{a.current.delete(L),n.current.delete(L),r.current.filtered.items.delete(L);let j=F();C(4,()=>{M(),j?.getAttribute("id")===L&&A(),S.emit()})}),group:L=>(o.current.has(L)||o.current.set(L,new Set),()=>{a.current.delete(L),o.current.delete(L)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:b}),[]);function N(L,H){var j,$;let W=($=(j=s.current)==null?void 0:j.filter)!=null?$:Plr;return L?W(L,r.current.search,H):0}function T(){if(!r.current.search||s.current.shouldFilter===!1)return;let L=r.current.filtered.items,H=[];r.current.filtered.groups.forEach($=>{let W=o.current.get($),z=0;W.forEach(G=>{let X=L.get(G);z=Math.max(X,z)}),H.push([$,z])});let j=b.current;I().sort(($,W)=>{var z,G;let X=$.getAttribute("id"),Y=W.getAttribute("id");return((z=L.get(Y))!=null?z:0)-((G=L.get(X))!=null?G:0)}).forEach($=>{let W=$.closest(Bde);W?W.appendChild($.parentElement===W?$:$.closest(`${Bde} > *`)):j.appendChild($.parentElement===j?$:$.closest(`${Bde} > *`))}),H.sort(($,W)=>W[1]-$[1]).forEach($=>{var W;let z=(W=b.current)==null?void 0:W.querySelector(`${UF}[${KM}="${encodeURIComponent($[0])}"]`);z?.parentElement.appendChild(z)})}function A(){let L=I().find(j=>j.getAttribute("aria-disabled")!=="true"),H=L?.getAttribute(KM);S.setState("value",H||void 0)}function M(){var L,H,j,$;if(!r.current.search||s.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let W=0;for(let z of n.current){let G=(H=(L=a.current.get(z))==null?void 0:L.value)!=null?H:"",X=($=(j=a.current.get(z))==null?void 0:j.keywords)!=null?$:[],Y=N(G,X);r.current.filtered.items.set(z,Y),Y>0&&W++}for(let[z,G]of o.current)for(let X of G)if(r.current.filtered.items.get(X)>0){r.current.filtered.groups.add(z);break}r.current.filtered.count=W}function O(){var L,H,j;let $=F();$&&(((L=$.parentElement)==null?void 0:L.firstChild)===$&&((j=(H=$.closest(UF))==null?void 0:H.querySelector(Slr))==null||j.scrollIntoView({block:"nearest"})),$.scrollIntoView({block:"nearest"}))}function F(){var L;return(L=b.current)==null?void 0:L.querySelector(`${lrt}[aria-selected="true"]`)}function I(){var L;return Array.from(((L=b.current)==null?void 0:L.querySelectorAll(Wtt))||[])}function k(L){let H=I()[L];H&&S.setState("value",H.getAttribute(KM))}function R(L){var H;let j=F(),$=I(),W=$.findIndex(G=>G===j),z=$[W+L];(H=s.current)!=null&&H.loop&&(z=W+L<0?$[$.length-1]:W+L===$.length?$[0]:$[W+L]),z&&S.setState("value",z.getAttribute(KM))}function E(L){let H=F(),j=H?.closest(UF),$;for(;j&&!$;)j=L>0?Elr(j,UF):Dlr(j,UF),$=j?.querySelector(Wtt);$?S.setState("value",$.getAttribute(KM)):R(L)}let _=()=>k(I().length-1),U=L=>{L.preventDefault(),L.metaKey?_():L.altKey?E(1):R(1)},V=L=>{L.preventDefault(),L.metaKey?k(0):L.altKey?E(-1):R(-1)};return ee.createElement(Ld.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:L=>{var H;(H=v.onKeyDown)==null||H.call(v,L);let j=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||j))switch(L.key){case"n":case"j":{g&&L.ctrlKey&&U(L);break}case"ArrowDown":{U(L);break}case"p":case"k":{g&&L.ctrlKey&&V(L);break}case"ArrowUp":{V(L);break}case"Home":{L.preventDefault(),k(0);break}case"End":{L.preventDefault(),_();break}case"Enter":{L.preventDefault();let $=F();if($){let W=new Event(Hde);$.dispatchEvent(W)}}}}},ee.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Flr},l),R8(e,L=>ee.createElement(urt.Provider,{value:S},ee.createElement(crt.Provider,{value:P},L))))}),Ilr=ee.forwardRef((e,t)=>{var r,n;let o=YM(),a=ee.useRef(null),i=ee.useContext(drt),s=jF(),l=prt(e),c=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:i?.forceMount;W1(()=>{if(!c)return s.item(o,i?.id)},[c]);let u=mrt(o,a,[e.value,e.children,a],e.keywords),d=Kde(),f=gw(C=>C.value&&C.value===u.current),p=gw(C=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);ee.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(Hde,m),()=>C.removeEventListener(Hde,m)},[p,e.onSelect,e.disabled]);function m(){var C,S;h(),(S=(C=l.current).onSelect)==null||S.call(C,u.current)}function h(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:v,onSelect:y,forceMount:x,keywords:w,...b}=e;return ee.createElement(Ld.div,{ref:QM(a,t),...b,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},e.children)}),klr=ee.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=YM(),s=ee.useRef(null),l=ee.useRef(null),c=YM(),u=jF(),d=gw(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(i):!0);W1(()=>u.group(i),[]),mrt(i,s,[e.value,e.heading,l]);let f=ee.useMemo(()=>({id:i,forceMount:o}),[o]);return ee.createElement(Ld.div,{ref:QM(s,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&ee.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),R8(e,p=>ee.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},ee.createElement(drt.Provider,{value:f},p))))}),Rlr=ee.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=ee.useRef(null),a=gw(i=>!i.search);return!r&&!a?null:ee.createElement(Ld.div,{ref:QM(o,t),...n,"cmdk-separator":"",role:"separator"})}),Nlr=ee.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=e.value!=null,a=Kde(),i=gw(c=>c.search),s=gw(c=>c.selectedItemId),l=jF();return ee.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),ee.createElement(Ld.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?e.value:i,onChange:c=>{o||a.setState("search",c.target.value),r?.(c.target.value)}})}),Mlr=ee.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=ee.useRef(null),i=ee.useRef(null),s=gw(c=>c.selectedItemId),l=jF();return ee.useEffect(()=>{if(i.current&&a.current){let c=i.current,u=a.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),ee.createElement(Ld.div,{ref:QM(a,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":n,id:l.listId},R8(e,c=>ee.createElement("div",{ref:QM(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Tlr=ee.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...s}=e;return ee.createElement(gW,{open:r,onOpenChange:n},ee.createElement(Z2,{container:i},ee.createElement(ZN,{"cmdk-overlay":"",className:o}),ee.createElement(JN,{"aria-label":e.label,"cmdk-dialog":"",className:a},ee.createElement(frt,{ref:t,...s}))))}),Alr=ee.forwardRef((e,t)=>gw(r=>r.filtered.count===0)?ee.createElement(Ld.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Llr=ee.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return ee.createElement(Ld.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},R8(e,i=>ee.createElement("div",{"aria-hidden":!0},i)))}),Ed=Object.assign(frt,{List:Mlr,Item:Ilr,Input:Nlr,Group:klr,Separator:Rlr,Dialog:Tlr,Empty:Alr,Loading:Llr});function Elr(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Dlr(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function prt(e){let t=ee.useRef(e);return W1(()=>{t.current=e}),t}var W1=typeof window>"u"?ee.useEffect:ee.useLayoutEffect;function XM(e){let t=ee.useRef();return t.current===void 0&&(t.current=e()),t}function gw(e){let t=Kde(),r=()=>e(t.snapshot());return ee.useSyncExternalStore(t.subscribe,r,r)}function mrt(e,t,r,n=[]){let o=ee.useRef(),a=jF();return W1(()=>{var i;let s=(()=>{var c;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=n.map(c=>c.trim());a.value(e,s,l),(i=t.current)==null||i.setAttribute(KM,s),o.current=s}),o}var Olr=()=>{let[e,t]=ee.useState(),r=XM(()=>new Map);return W1(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,o)=>{r.current.set(n,o),t({})}};function _lr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function R8({asChild:e,children:t},r){return e&&ee.isValidElement(t)?ee.cloneElement(_lr(t),{ref:t.ref},r(t.props.children)):r(t)}var Flr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var Blr=Z2;var Vlr=Hn("fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",{variants:{variant:{default:"bg-black/80",subtle:"bg-black/60",blur:"bg-black/40 backdrop-blur-md",minimal:"bg-black/20 backdrop-blur-sm"},animation:{default:"duration-200",slow:"duration-300",fast:"duration-100"}},defaultVariants:{variant:"default",animation:"default"}}),hrt=ee.forwardRef(({className:e,variant:t,animation:r,...n},o)=>(0,q.jsx)(ZN,{ref:o,className:Ae("moonui-theme",Vlr({variant:t,animation:r}),e),...n}));hrt.displayName=ZN.displayName;var Ulr=Hn("fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg",{variants:{variant:{default:"border-gray-200 dark:border-gray-700",primary:"border-primary/20 dark:border-primary/30",secondary:"border-gray-300 dark:border-gray-600",ghost:"border-transparent shadow-xl",destructive:"border-error/20 dark:border-error/30"},size:{xs:"max-w-xs p-4",sm:"max-w-sm p-5",default:"max-w-lg p-6",md:"max-w-md p-6",lg:"max-w-2xl p-7",xl:"max-w-4xl p-8",full:"max-w-[95vw] max-h-[95vh] p-6"},radius:{none:"rounded-none",sm:"rounded-md",default:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},animation:{default:"duration-200 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",fade:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",zoom:"duration-200 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",slide:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",none:""},position:{default:"top-[50%]",top:"top-[5%]",bottom:"bottom-[5%] top-auto translate-y-0"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default",position:"default"}}),zlr=ee.forwardRef(({className:e,children:t,variant:r,size:n,radius:o,animation:a,position:i,overlayVariant:s="default",overlayAnimation:l="default",hideCloseButton:c=!1,title:u,description:d,icon:f,loading:p=!1,success:m=!1,onClose:h,...g},v)=>{let y=()=>{h&&h()};return(0,q.jsxs)(Blr,{children:[(0,q.jsx)(hrt,{variant:s,animation:l,onClick:c?void 0:y}),(0,q.jsxs)(JN,{ref:v,onEscapeKeyDown:c?void 0:y,onInteractOutside:c?void 0:y,className:Ae(Ulr({variant:r,size:n,radius:o,animation:a,position:i}),"outline-none",p&&"pointer-events-none",m&&"border-success/40",e),...g,children:[(u||d||f)&&(0,q.jsxs)(grt,{className:"flex gap-4",children:[(f||p||m)&&(0,q.jsxs)("div",{className:"flex shrink-0 items-center justify-center",children:[p&&(0,q.jsx)(Ef,{className:"h-5 w-5 animate-spin text-primary"}),m&&(0,q.jsx)(Ky,{className:"h-5 w-5 text-success"}),!p&&!m&&f&&(0,q.jsx)("span",{className:"text-primary",children:f})]}),(0,q.jsxs)("div",{className:"flex-1",children:[u&&(0,q.jsx)(vrt,{children:u}),d&&(0,q.jsx)(yrt,{children:d})]})]}),t,!c&&(0,q.jsxs)(t_,{onClick:y,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:ring-offset-2 disabled:pointer-events-none dark:text-gray-300 dark:hover:text-white",children:[(0,q.jsx)(Yy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});zlr.displayName=JN.displayName;var grt=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});grt.displayName="DialogHeader";var Hlr=({className:e,...t})=>(0,q.jsx)("div",{className:Ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),...t});Hlr.displayName="DialogFooter";var vrt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(J2,{ref:r,className:Ae("text-xl font-semibold leading-snug tracking-tight dark:text-white",e),...t}));vrt.displayName=J2.displayName;var yrt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(e_,{ref:r,className:Ae("text-sm text-muted-foreground leading-normal dark:text-gray-400",e),...t}));yrt.displayName=e_.displayName;var jlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("form",{ref:r,className:Ae("moonui-theme","flex flex-col gap-4",e),...t}));jlr.displayName="DialogForm";var $lr=Hn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",{variants:{variant:{default:"bg-popover text-popover-foreground",glass:"bg-background/80 text-foreground backdrop-blur-sm",bordered:"bg-popover text-popover-foreground border border-border"},size:{sm:"min-h-[200px]",default:"min-h-[300px]",lg:"min-h-[400px]"}},defaultVariants:{variant:"default",size:"default"}}),qlr=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)(Ed,{ref:o,className:Ae("moonui-theme",$lr({variant:t,size:r}),e),...n}));qlr.displayName=Ed.displayName;var Wlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,q.jsx)(k_,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,q.jsx)(Ed.Input,{ref:r,className:Ae("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Wlr.displayName=Ed.Input.displayName;var Glr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.List,{ref:r,className:Ae("moonui-theme","max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Glr.displayName=Ed.List.displayName;var Klr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Empty,{ref:r,className:Ae("moonui-theme","py-6 text-center text-sm text-muted-foreground",e),...t}));Klr.displayName=Ed.Empty.displayName;var Xlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Group,{ref:r,className:Ae("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Xlr.displayName=Ed.Group.displayName;var Ylr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Separator,{ref:r,className:Ae("moonui-theme","-mx-1 h-px bg-border",e),...t}));Ylr.displayName=Ed.Separator.displayName;var Qlr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ed.Item,{ref:r,className:Ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}));Qlr.displayName=Ed.Item.displayName;var Zlr=({className:e,...t})=>(0,q.jsx)("span",{className:Ae("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Zlr.displayName="CommandShortcut";var Jlr=(e,t,r)=>{var n,o;let a=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(a))};Jlr.autoRemove=e=>yh(e);var ecr=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};ecr.autoRemove=e=>yh(e);var tcr=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===r?.toLowerCase()};tcr.autoRemove=e=>yh(e);var rcr=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};rcr.autoRemove=e=>yh(e);var ncr=(e,t,r)=>!r.some(n=>{var o;return!((o=e.getValue(t))!=null&&o.includes(n))});ncr.autoRemove=e=>yh(e)||!(e!=null&&e.length);var ocr=(e,t,r)=>r.some(n=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)});ocr.autoRemove=e=>yh(e)||!(e!=null&&e.length);var acr=(e,t,r)=>e.getValue(t)===r;acr.autoRemove=e=>yh(e);var icr=(e,t,r)=>e.getValue(t)==r;icr.autoRemove=e=>yh(e);var xrt=(e,t,r)=>{let[n,o]=r,a=e.getValue(t);return a>=n&&a<=o};xrt.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,o=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(o)?1/0:o;if(a>i){let s=a;a=i,i=s}return[a,i]};xrt.autoRemove=e=>yh(e)||yh(e[0])&&yh(e[1]);function yh(e){return e==null||e===""}var sXn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER};var scr=Hn("w-full caption-bottom text-sm",{variants:{variant:{default:"dark:text-gray-200",bordered:"border border-border dark:border-gray-700",striped:"dark:text-gray-200",card:"border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",minimal:"border-none dark:text-gray-200"},size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),lcr=ee.forwardRef(({className:e,variant:t,size:r,loading:n,emptyContent:o,...a},i)=>{let s=t==="striped",l=ee.Children.map(a.children,c=>{if(ee.isValidElement(c)&&c.type==="tbody"){let u=c.props;return ee.cloneElement(c,{className:Ae(u.className,s&&"even:[&>tr]:bg-muted/50")})}return c});return(0,q.jsxs)("div",{className:"relative w-full overflow-auto",children:[n&&(0,q.jsx)("div",{className:"absolute inset-0 bg-background/60 flex items-center justify-center z-10",children:(0,q.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),(0,q.jsx)("table",{ref:i,className:Ae(scr({variant:t,size:r}),n&&"opacity-70",e),...a,children:l})]})});lcr.displayName="Table";var ccr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("thead",{ref:r,className:Ae("moonui-theme","[&_tr]:border-b",e),...t}));ccr.displayName="TableHeader";var ucr=ee.forwardRef(({className:e,emptyContent:t,emptyMessage:r="No data available",children:n,...o},a)=>{let i=ee.Children.count(n)>0;return(0,q.jsx)("tbody",{ref:a,className:Ae("moonui-theme","[&_tr:last-child]:border-0",e),...o,children:i?n:(0,q.jsx)("tr",{children:(0,q.jsx)("td",{colSpan:100,className:"h-24 text-center",children:t||(0,q.jsx)("div",{className:"py-6 text-muted-foreground",children:(0,q.jsx)("div",{className:"text-sm",children:r})})})})})});ucr.displayName="TableBody";var dcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("tfoot",{ref:r,className:Ae("moonui-theme","bg-primary text-primary-foreground font-medium",e),...t}));dcr.displayName="TableFooter";var fcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("tr",{ref:r,className:Ae("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));fcr.displayName="TableRow";var pcr=ee.forwardRef(({className:e,sortable:t,sorted:r,onSort:n,children:o,...a},i)=>{let s=()=>t?r==="asc"?(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):r==="desc"?(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"ml-1 h-4 w-4 inline-block opacity-30",viewBox:"0 0 20 20",fill:"currentColor",children:(0,q.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}):null;return(0,q.jsx)("th",{ref:i,className:Ae("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t&&"cursor-pointer hover:text-foreground select-none",e),onClick:t?n:void 0,...a,children:(0,q.jsxs)("div",{className:"flex items-center",children:[o,t&&s()]})})});pcr.displayName="TableHead";var mcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("td",{ref:r,className:Ae("moonui-theme","p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));mcr.displayName="TableCell";var hcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("caption",{ref:r,className:Ae("moonui-theme","mt-4 text-sm text-muted-foreground",e),...t}));hcr.displayName="TableCaption";function gcr({mode:e="single",selected:t,onSelect:r,disabled:n,showOutsideDays:o=!1,className:a,classNames:i,numberOfMonths:s=1,defaultMonth:l,...c}){let[u,d]=ee.useState(l||t&&t||new Date),f=[{short:"S",full:"Sunday"},{short:"M",full:"Monday"},{short:"T",full:"Tuesday"},{short:"W",full:"Wednesday"},{short:"T",full:"Thursday"},{short:"F",full:"Friday"},{short:"S",full:"Saturday"}],p=()=>{d(wJe(u,1))},m=()=>{d(e8(u,1))},h=C=>{if(!n?.(C)){if(e==="single")r?.(C);else if(e==="range"){let S=t;!S?.from||S.from&&S.to?r?.({from:C,to:void 0}):C<S.from?r?.({from:C,to:S.from}):r?.({from:S.from,to:C})}}},g=C=>{if(!t)return!1;if(e==="single")return B1(C,t);if(e==="range"){let S=t;return S.from&&S.to?C>=S.from&&C<=S.to:S.from?B1(C,S.from):!1}return!1},v=C=>{if(e!=="range"||!t)return!1;let S=t;return S.from?B1(C,S.from):!1},y=C=>{if(e!=="range"||!t)return!1;let S=t;return S.to?B1(C,S.to):!1},x=C=>{if(e!=="range"||!t)return!1;let S=t;return!S.from||!S.to?!1:C>S.from&&C<S.to},b=(()=>{let C=ZZe(u),S=QZe(u),P=n8({start:C,end:S}),N=Eue(C),T=[];if(N>0&&o){let F=hh(C),I=new Date(C);I.setDate(I.getDate()-1),T.push(...n8({start:F,end:I}))}let A=Eue(S),M=[];if(A<6&&o){let F=new Date(S);F.setDate(F.getDate()+1);let I=eJe(S);M.push(...n8({start:F,end:I}))}let O=[];if(!o&&N>0)for(let F=0;F<N;F++)O.push(null);return[...T,...O,...P,...M]})();return(0,q.jsxs)("div",{className:Ae("moonui-theme","p-0",a),children:[(0,q.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border/50 dark:border-gray-700/50",children:[(0,q.jsx)("button",{onClick:p,className:Ae("h-10 w-10 bg-transparent p-0 rounded-lg","hover:bg-muted transition-colors","inline-flex items-center justify-center"),type:"button",children:(0,q.jsx)(tM,{className:"h-5 w-5"})}),(0,q.jsx)("h2",{className:"text-base font-medium",children:Lue(u,"MMMM yyyy")}),(0,q.jsx)("button",{onClick:m,className:Ae("h-10 w-10 bg-transparent p-0 rounded-lg","hover:bg-muted transition-colors","inline-flex items-center justify-center"),type:"button",children:(0,q.jsx)($0,{className:"h-5 w-5"})})]}),(0,q.jsxs)("div",{className:"px-6 pb-4",children:[(0,q.jsx)("div",{className:"grid grid-cols-7 mb-2",children:f.map((C,S)=>(0,q.jsx)("div",{className:"text-muted-foreground text-xs font-medium h-10 flex items-center justify-center",title:C.full,children:C.short},`weekday-${S}`))}),(0,q.jsx)("div",{className:"grid grid-cols-7 gap-1",children:b.map((C,S)=>{if(!C)return(0,q.jsx)("div",{className:"h-10 w-10"},`empty-${S}`);let P=!xJe(C,u),N=n?.(C)||!1,T=g(C),A=bJe(C),M=v(C),O=y(C),F=x(C);return(0,q.jsx)("button",{onClick:()=>h(C),disabled:N,className:Ae("h-10 w-10 p-0 font-normal","inline-flex items-center justify-center rounded-lg","hover:bg-muted transition-colors text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",P&&"text-muted-foreground/50",N&&"text-muted-foreground/30 cursor-not-allowed hover:bg-transparent",T&&!F&&"bg-primary text-primary-foreground font-medium hover:bg-primary hover:text-primary-foreground",A&&"font-semibold relative after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:h-1 after:w-1 after:rounded-full after:bg-primary",F&&"bg-accent/30 text-accent-foreground rounded-none",M&&"rounded-r-none",O&&"rounded-l-none"),type:"button",children:Lue(C,"d")},C.toISOString())})})]})]})}gcr.displayName="Calendar";var lXn=Hn("w-full justify-start text-left font-normal",{variants:{variant:{default:"",outline:"border-2",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-sm",lg:"h-12 px-6 text-base",icon:"h-10 w-10"},state:{default:"",error:"border-destructive focus:ring-destructive",success:"border-success focus:ring-success",warning:"border-warning focus:ring-warning"}},defaultVariants:{variant:"default",size:"default",state:"default"}});var vcr=ee.forwardRef(({className:e,inset:t,children:r,...n},o)=>(0,q.jsxs)(Que,{ref:o,className:Ae("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,(0,q.jsx)($0,{className:"ml-auto h-4 w-4"})]}));vcr.displayName=Que.displayName;var ycr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Zue,{ref:r,className:Ae("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),...t}));ycr.displayName=Zue.displayName;var xcr=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>(0,q.jsx)(wet,{children:(0,q.jsx)($ue,{ref:n,sideOffset:t,className:Ae("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),...r})}));xcr.displayName=$ue.displayName;var bcr=ee.forwardRef(({className:e,inset:t,...r},n)=>(0,q.jsx)(Wue,{ref:n,className:Ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));bcr.displayName=Wue.displayName;var wcr=ee.forwardRef(({className:e,children:t,checked:r,...n},o)=>(0,q.jsxs)(Gue,{ref:o,className:Ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(Xue,{children:(0,q.jsx)(Ky,{className:"h-4 w-4"})})}),t]}));wcr.displayName=Gue.displayName;var Ccr=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsxs)(Kue,{ref:n,className:Ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(Xue,{children:(0,q.jsx)(rM,{className:"h-2 w-2 fill-current"})})}),t]}));Ccr.displayName=Kue.displayName;var Scr=ee.forwardRef(({className:e,inset:t,...r},n)=>(0,q.jsx)(que,{ref:n,className:Ae("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Scr.displayName=que.displayName;var Pcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Yue,{ref:r,className:Ae("moonui-theme","-mx-1 my-1 h-px bg-muted",e),...t}));Pcr.displayName=Yue.displayName;var Icr=({className:e,...t})=>(0,q.jsx)("span",{className:Ae("moonui-theme","ml-auto text-xs tracking-widest opacity-60",e),...t});Icr.displayName="DropdownMenuShortcut";var kcr=Hn("relative overflow-hidden bg-muted",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"},size:{xs:"h-1",sm:"h-1.5",default:"h-2",md:"h-2.5",lg:"h-3",xl:"h-4"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},animation:{default:"[&>div]:transition-all [&>div]:duration-500",smooth:"[&>div]:transition-all [&>div]:duration-700",fast:"[&>div]:transition-all [&>div]:duration-300",none:""}},defaultVariants:{variant:"default",size:"default",radius:"full",animation:"default"}}),Rcr=Hn("h-full w-full flex-1",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",error:"bg-error"},animation:{default:"transition-all duration-500",smooth:"transition-all duration-700",fast:"transition-all duration-300",none:""}},defaultVariants:{variant:"primary",animation:"default"}}),brt=ee.forwardRef(({className:e,value:t=0,variant:r,size:n,radius:o,animation:a,indicatorVariant:i,showValueLabel:s=!1,valueLabel:l,labelClassName:c,indeterminate:u=!1,max:d=100,...f},p)=>{let m=Math.max(0,Math.min(t,d)),h=d>0?m/d*100:0,g=l||`${Math.round(h)}%`;return(0,q.jsxs)(q.Fragment,{children:[s&&(0,q.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,q.jsx)("span",{className:Ae("text-sm font-medium text-muted-foreground",c),children:g})}),(0,q.jsx)("div",{ref:p,className:Ae("moonui-theme",kcr({variant:r,size:n,radius:o,animation:a}),e),role:"progressbar","aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":u?void 0:m,...f,children:(0,q.jsx)("div",{className:Ae(Rcr({variant:i||"primary",animation:a}),u&&"animate-indeterminate-progress"),style:u?{}:{transform:`translateX(-${100-h}%)`}})})]})});brt.displayName="Progress";var Ncr=e=>e.startsWith("image/")?(0,q.jsx)(nM,{className:"h-4 w-4"}):e.startsWith("video/")?(0,q.jsx)(A_,{className:"h-4 w-4"}):e.startsWith("audio/")?(0,q.jsx)(w_,{className:"h-4 w-4"}):e.includes("text")||e.includes("document")?(0,q.jsx)(m_,{className:"h-4 w-4"}):(0,q.jsx)(h_,{className:"h-4 w-4"}),jde=e=>{if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]},Mcr=({uploadedFile:e,onRemove:t})=>{let{id:r,file:n,progress:o,status:a,preview:i}=e;return(0,q.jsxs)(Ad.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex items-center space-x-3 p-3 border rounded-lg bg-background",children:[(0,q.jsx)("div",{className:"flex-shrink-0",children:i?(0,q.jsx)("img",{src:i,alt:n.name,className:"h-10 w-10 object-cover rounded"}):(0,q.jsx)("div",{className:"h-10 w-10 rounded bg-muted flex items-center justify-center",children:Ncr(n.type)})}),(0,q.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,q.jsxs)("div",{className:"flex items-center justify-between",children:[(0,q.jsx)("p",{className:"text-sm font-medium truncate",children:n.name}),(0,q.jsx)(I8,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(r),children:(0,q.jsx)(Yy,{className:"h-3 w-3"})})]}),(0,q.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,q.jsx)("p",{className:"text-xs text-muted-foreground",children:jde(n.size)}),a==="uploading"&&(0,q.jsxs)(C8,{variant:"secondary",className:"h-5",children:[(0,q.jsx)(Ef,{className:"h-3 w-3 mr-1 animate-spin"}),"Uploading"]}),a==="success"&&(0,q.jsxs)(C8,{variant:"success",className:"h-5",children:[(0,q.jsx)(q0,{className:"h-3 w-3 mr-1"}),"Done"]}),a==="error"&&(0,q.jsxs)(C8,{variant:"destructive",className:"h-5",children:[(0,q.jsx)(Jg,{className:"h-3 w-3 mr-1"}),"Error"]})]}),a==="uploading"&&(0,q.jsx)("div",{className:"mt-2",children:(0,q.jsx)(brt,{value:o,className:"h-1"})})]})]})},Tcr=Bn.default.forwardRef(({accept:e="*",multiple:t=!0,maxSize:r=10*1024*1024,maxFiles:n=5,disabled:o=!1,className:a,onUpload:i,onRemove:s,children:l,...c},u)=>{let[d,f]=(0,Bn.useState)([]),[p,m]=(0,Bn.useState)(!1),[h,g]=(0,Bn.useState)(null),v=P=>P.size>r?`File size exceeds ${jde(r)}`:e!=="*"&&!e.split(",").some(N=>{let T=N.trim();return T.includes("*")?P.type.startsWith(T.replace("*","")):P.type===T})?"File type not supported":null,y=(0,Bn.useCallback)(async P=>{let N=Array.from(P);if(g(null),d.length+N.length>n){g(`Maximum ${n} files allowed`);return}let T=[],A=[];if(N.forEach(O=>{let F=v(O);F?A.push(`${O.name}: ${F}`):T.push(O)}),A.length>0){g(A.join(", "));return}let M=T.map((O,F)=>({id:`${Date.now()}-${F}-${O.name.replace(/[^a-zA-Z0-9]/g,"")}`,file:O,progress:0,status:"uploading",preview:O.type.startsWith("image/")?URL.createObjectURL(O):void 0}));f(O=>[...O,...M]);for(let O of M){let F=0,I=setInterval(()=>{F+=15+O.file.size%10,F>=100?(F=100,clearInterval(I),f(k=>k.map(R=>R.id===O.id?{...R,progress:100,status:"success"}:R))):f(k=>k.map(R=>R.id===O.id?{...R,progress:F}:R))},200)}if(i)try{await i(T)}catch(O){console.error("Upload failed:",O),f(F=>F.map(I=>M.some(k=>k.id===I.id)?{...I,status:"error"}:I))}},[d.length,n,r,e,i]),x=(0,Bn.useCallback)(P=>{if(P.preventDefault(),m(!1),o)return;let N=P.dataTransfer.files;N.length>0&&y(N)},[y,o]),w=(0,Bn.useCallback)(P=>{P.preventDefault(),o||m(!0)},[o]),b=(0,Bn.useCallback)(P=>{P.preventDefault(),m(!1)},[]),C=(0,Bn.useCallback)(P=>{let N=P.target.files;N&&N.length>0&&y(N),P.target.value=""},[y]),S=(0,Bn.useCallback)(P=>{f(N=>{let T=N.find(A=>A.id===P);return T?.preview&&URL.revokeObjectURL(T.preview),N.filter(A=>A.id!==P)}),s&&s(P)},[s]);return(0,q.jsxs)("div",{ref:u,className:Ae("moonui-theme","space-y-4",a),...c,children:[(0,q.jsxs)(Ad.div,{className:Ae("relative border-2 border-dashed rounded-lg p-8 text-center transition-colors",p&&"border-primary bg-primary/5",o&&"opacity-50 cursor-not-allowed",!o&&"hover:border-primary/50 cursor-pointer"),onDrop:x,onDragOver:w,onDragLeave:b,animate:{scale:p?1.02:1,borderColor:p?"hsl(var(--primary))":"hsl(var(--border))"},children:[(0,q.jsx)("input",{type:"file",accept:e,multiple:t,disabled:o,onChange:C,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),l||(0,q.jsxs)("div",{className:"space-y-4",children:[(0,q.jsx)("div",{className:"mx-auto h-12 w-12 text-muted-foreground",children:(0,q.jsx)(T_,{className:"h-full w-full"})}),(0,q.jsxs)("div",{children:[(0,q.jsx)("p",{className:"text-lg font-medium",children:p?"Drop files here":"Upload files"}),(0,q.jsx)("p",{className:"text-sm text-muted-foreground",children:"Drag & drop files here, or click to select"}),(0,q.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Max ",n," files, ",jde(r)," each"]})]}),(0,q.jsx)(I8,{variant:"outline",disabled:o,children:"Select Files"})]})]}),(0,q.jsx)(xF,{children:h&&(0,q.jsxs)(Ad.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex items-center space-x-2 text-sm text-destructive",children:[(0,q.jsx)(Jg,{className:"h-4 w-4"}),(0,q.jsx)("span",{children:h})]})}),(0,q.jsx)(xF,{children:d.length>0&&(0,q.jsxs)(Ad.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-2",children:[(0,q.jsxs)("h4",{className:"text-sm font-medium",children:["Uploaded Files (",d.length,")"]}),(0,q.jsx)("div",{className:"space-y-2",children:(0,q.jsx)(xF,{children:d.map(P=>(0,q.jsx)(Mcr,{uploadedFile:P,onRemove:S},P.id))})})]})})]})});Tcr.displayName="FileUpload";var Acr=Bn.default.forwardRef(({children:e,isOpen:t,onOpenChange:r,direction:n="up",threshold:o=50,className:a,overlayClassName:i,enableSwipeToClose:s=!0,...l},c)=>{let u=VM(0),d=VM(0),f=n==="up"||n==="down",p=f?u:d,m=pue(p,[0,o],[1,.5]),h=(y,x)=>{if(!s)return;let w=f?x.offset.y:x.offset.x,b=f?x.velocity.y:x.velocity.x,C=!1;switch(n){case"up":C=w>o||b>500;break;case"down":C=w<-o||b<-500;break;case"left":C=w>o||b>500;break;case"right":C=w<-o||b<-500;break}C?r(!1):hue(p,0,{type:"spring",stiffness:300,damping:20})},g=()=>{switch(n){case"up":return{y:"100%"};case"down":return{y:"-100%"};case"left":return{x:"100%"};case"right":return{x:"-100%"};default:return{y:"100%"}}},v=()=>f?{y:0}:{x:0};return t?(0,q.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,q.jsx)(Ad.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>r(!1),className:Ae("absolute inset-0 bg-black/50",i)}),(0,q.jsxs)(Ad.div,{ref:c,drag:s?f?"y":"x":!1,dragConstraints:{top:n==="up"?0:void 0,bottom:n==="down"?0:void 0,left:n==="left"?0:void 0,right:n==="right"?0:void 0},dragElastic:.2,onDragEnd:h,style:{[f?"y":"x"]:p,opacity:m},initial:g(),animate:v(),exit:g(),transition:{type:"spring",damping:30,stiffness:300},className:Ae("absolute bg-background border shadow-lg",{"bottom-0 left-0 right-0 rounded-t-lg":n==="up","top-0 left-0 right-0 rounded-b-lg":n==="down","top-0 bottom-0 right-0 rounded-l-lg":n==="left","top-0 bottom-0 left-0 rounded-r-lg":n==="right"},a),...l,children:[(n==="up"||n==="down")&&(0,q.jsx)("div",{className:"flex justify-center p-2",children:(0,q.jsx)("div",{className:"w-12 h-1 bg-muted rounded-full"})}),e]})]}):null});Acr.displayName="GestureDrawer";var Lcr=({className:e,...t})=>(0,q.jsx)("nav",{role:"navigation","aria-label":"pagination",className:Ae("moonui-theme","mx-auto flex w-full justify-center",e),...t});Lcr.displayName="Pagination";var Ecr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("ul",{ref:r,className:Ae("moonui-theme","flex flex-row items-center gap-1",e),...t}));Ecr.displayName="PaginationContent";var Dcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)("li",{ref:r,className:Ae("moonui-theme","",e),...t}));Dcr.displayName="PaginationItem";var Xde=({className:e,isActive:t,size:r="icon",...n})=>(0,q.jsx)("a",{"aria-current":t?"page":void 0,className:Ae(Ztt({variant:t?"outline":"ghost",size:r}),e),...n});Xde.displayName="PaginationLink";var Ocr=({className:e,...t})=>(0,q.jsxs)(Xde,{"aria-label":"Go to previous page",size:"md",className:Ae("moonui-theme","gap-1 pl-2.5",e),...t,children:[(0,q.jsx)(tM,{className:"h-4 w-4"}),(0,q.jsx)("span",{children:"Previous"})]});Ocr.displayName="PaginationPrevious";var _cr=({className:e,...t})=>(0,q.jsxs)(Xde,{"aria-label":"Go to next page",size:"md",className:Ae("moonui-theme","gap-1 pr-2.5",e),...t,children:[(0,q.jsx)("span",{children:"Next"}),(0,q.jsx)($0,{className:"h-4 w-4"})]});_cr.displayName="PaginationNext";var Fcr=({className:e,...t})=>(0,q.jsxs)("span",{"aria-hidden":!0,className:Ae("moonui-theme","flex h-9 w-9 items-center justify-center",e),...t,children:[(0,q.jsx)(Xy,{className:"h-4 w-4"}),(0,q.jsx)("span",{className:"sr-only",children:"More pages"})]});Fcr.displayName="PaginationEllipsis";var Yde=Qet;Yde.displayName="Select";var wrt=Zet,Qde=ee.forwardRef(({className:e,children:t,variant:r="standard",size:n="md",error:o,success:a,loading:i,leftIcon:s,rightIcon:l,...c},u)=>(0,q.jsxs)(sde,{ref:u,className:Ae("flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","focus-visible:outline-none",o&&"border-error focus-visible:ring-error/30 focus-visible:border-error",a&&"border-success focus-visible:ring-success/30 focus-visible:border-success",n==="sm"&&"h-8 text-xs px-2",n==="md"&&"h-10 text-sm px-3",n==="lg"&&"h-12 text-base px-4",r==="standard"&&"border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-900 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="outline"&&"border border-gray-300 dark:border-gray-700 bg-transparent hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="ghost"&&"border-none bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50",r==="underline"&&"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary",e),...c,disabled:c.disabled||i,"data-error":o?!0:void 0,"data-success":a?!0:void 0,"data-loading":i?!0:void 0,children:[(0,q.jsxs)("div",{className:"flex items-center flex-1 gap-2",children:[s&&(0,q.jsx)("span",{className:"flex items-center justify-center text-gray-500 dark:text-gray-400",children:s}),i?(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)(Ef,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400"}),(0,q.jsx)("span",{className:"text-muted-foreground dark:text-gray-400",children:"Loading..."})]}):t]}),!i&&(0,q.jsx)(Jet,{asChild:!0,children:l?(0,q.jsx)("span",{className:"opacity-60",children:l}):(0,q.jsx)(j0,{className:"h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180"})})]}));Qde.displayName=sde.displayName;var Crt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(dde,{ref:r,className:Ae("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",e),...t,children:(0,q.jsx)(u_,{className:"h-4 w-4"})}));Crt.displayName=dde.displayName;var Srt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(fde,{ref:r,className:Ae("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",e),...t,children:(0,q.jsx)(j0,{className:"h-4 w-4"})}));Srt.displayName=fde.displayName;var Zde=ee.forwardRef(({className:e,children:t,position:r="popper",side:n="bottom",sideOffset:o=4,align:a="start",...i},s)=>(0,q.jsx)(ett,{children:(0,q.jsxs)(lde,{ref:s,side:n,sideOffset:o,align:a,avoidCollisions:!1,className:Ae(["relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900 text-foreground","shadow-lg dark:shadow-gray-900/20","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-[state=open]:duration-150"],r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...i,children:[(0,q.jsx)(Crt,{}),(0,q.jsx)(ttt,{className:Ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,q.jsx)(Srt,{})]})}));Zde.displayName=lde.displayName;var Bcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(cde,{ref:r,className:Ae("moonui-theme","py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Bcr.displayName=cde.displayName;var tm=ee.forwardRef(({className:e,children:t,variant:r="default",size:n="md",rightIcon:o,customIndicator:a,...i},s)=>(0,q.jsxs)(ude,{ref:s,className:Ae("relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n==="sm"&&"py-1 pl-7 pr-2 text-xs",n==="md"&&"py-1.5 pl-8 pr-2 text-sm",n==="lg"&&"py-2 pl-9 pr-3 text-base",r==="default"&&"focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",r==="subtle"&&"focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",r==="destructive"&&"text-error dark:text-red-400 focus:bg-error/10 dark:focus:bg-red-900/20 focus:text-error dark:focus:text-red-300",r==="success"&&"text-success dark:text-green-400 focus:bg-success/10 dark:focus:bg-green-900/20 focus:text-success dark:focus:text-green-300",r==="warning"&&"text-warning dark:text-yellow-400 focus:bg-warning/10 dark:focus:bg-yellow-900/20 focus:text-warning dark:focus:text-yellow-300",e),...i,children:[(0,q.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,q.jsx)(ntt,{children:a||(0,q.jsx)(Ky,{className:"h-4 w-4"})})}),(0,q.jsx)(rtt,{children:t}),o&&(0,q.jsx)("span",{className:"ml-auto pl-2 opacity-70",children:o})]}));tm.displayName=ude.displayName;var Vcr=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(pde,{ref:r,className:Ae("moonui-theme","-mx-1 my-1 h-px bg-muted dark:bg-gray-700",e),...t}));Vcr.displayName=pde.displayName;var Ucr=[{code:"+1",country:"US",flag:"\u{1F1FA}\u{1F1F8}",name:"United States"},{code:"+44",country:"GB",flag:"\u{1F1EC}\u{1F1E7}",name:"United Kingdom"},{code:"+49",country:"DE",flag:"\u{1F1E9}\u{1F1EA}",name:"Germany"},{code:"+33",country:"FR",flag:"\u{1F1EB}\u{1F1F7}",name:"France"},{code:"+39",country:"IT",flag:"\u{1F1EE}\u{1F1F9}",name:"Italy"},{code:"+34",country:"ES",flag:"\u{1F1EA}\u{1F1F8}",name:"Spain"},{code:"+31",country:"NL",flag:"\u{1F1F3}\u{1F1F1}",name:"Netherlands"},{code:"+46",country:"SE",flag:"\u{1F1F8}\u{1F1EA}",name:"Sweden"},{code:"+47",country:"NO",flag:"\u{1F1F3}\u{1F1F4}",name:"Norway"},{code:"+45",country:"DK",flag:"\u{1F1E9}\u{1F1F0}",name:"Denmark"},{code:"+358",country:"FI",flag:"\u{1F1EB}\u{1F1EE}",name:"Finland"},{code:"+48",country:"PL",flag:"\u{1F1F5}\u{1F1F1}",name:"Poland"},{code:"+90",country:"TR",flag:"\u{1F1F9}\u{1F1F7}",name:"Turkey"},{code:"+86",country:"CN",flag:"\u{1F1E8}\u{1F1F3}",name:"China"},{code:"+81",country:"JP",flag:"\u{1F1EF}\u{1F1F5}",name:"Japan"},{code:"+82",country:"KR",flag:"\u{1F1F0}\u{1F1F7}",name:"South Korea"},{code:"+91",country:"IN",flag:"\u{1F1EE}\u{1F1F3}",name:"India"},{code:"+61",country:"AU",flag:"\u{1F1E6}\u{1F1FA}",name:"Australia"},{code:"+64",country:"NZ",flag:"\u{1F1F3}\u{1F1FF}",name:"New Zealand"},{code:"+27",country:"ZA",flag:"\u{1F1FF}\u{1F1E6}",name:"South Africa"},{code:"+55",country:"BR",flag:"\u{1F1E7}\u{1F1F7}",name:"Brazil"},{code:"+52",country:"MX",flag:"\u{1F1F2}\u{1F1FD}",name:"Mexico"},{code:"+54",country:"AR",flag:"\u{1F1E6}\u{1F1F7}",name:"Argentina"},{code:"+20",country:"EG",flag:"\u{1F1EA}\u{1F1EC}",name:"Egypt"},{code:"+966",country:"SA",flag:"\u{1F1F8}\u{1F1E6}",name:"Saudi Arabia"},{code:"+971",country:"AE",flag:"\u{1F1E6}\u{1F1EA}",name:"UAE"}],Gtt=(e,t)=>{let r=e.replace(/\D/g,"");switch(t){case"+1":return r.length<=3?r:r.length<=6?`(${r.slice(0,3)}) ${r.slice(3)}`:`(${r.slice(0,3)}) ${r.slice(3,6)}-${r.slice(6,10)}`;case"+44":return r.length<=4?r:r.length<=7?`${r.slice(0,4)} ${r.slice(4)}`:`${r.slice(0,4)} ${r.slice(4,7)} ${r.slice(7,11)}`;case"+90":return r.length<=3?r:r.length<=6?`(${r.slice(0,3)}) ${r.slice(3)}`:r.length<=9?`(${r.slice(0,3)}) ${r.slice(3,6)} ${r.slice(6)}`:`(${r.slice(0,3)}) ${r.slice(3,6)} ${r.slice(6,8)} ${r.slice(8,10)}`;default:let n="";for(let o=0;o<r.length;o++)o>0&&o%3===0&&(n+=" "),n+=r[o];return n}},zcr=e=>{switch(e){case"+1":return 10;case"+44":return 11;case"+90":return 10;default:return 15}},Hcr=ee.forwardRef(({className:e,value:t="",onChange:r,defaultCountry:n="+1",showIcon:o=!0,showCountrySelect:a=!0,countries:i=Ucr,size:s,...l},c)=>{let[u,d]=ee.useState(n),[f,p]=ee.useState(t),m=i.find(y=>y.code===u)||i[0],h=y=>{let x=y.target.value.replace(/\D/g,""),w=zcr(u),b=x.slice(0,w),C=Gtt(b,u);p(b),r?.(b,u),y.target.value=C},g=y=>{d(y),r?.(f,y)},v=Gtt(f,u);return(0,q.jsxs)("div",{className:Ae("relative flex gap-2",e),children:[a&&(0,q.jsxs)(Yde,{value:u,onValueChange:g,children:[(0,q.jsx)(Qde,{className:"w-[120px]",children:(0,q.jsx)(wrt,{children:(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{children:m.flag}),(0,q.jsx)("span",{children:m.code})]})})}),(0,q.jsx)(Zde,{children:i.map(y=>(0,q.jsx)(tm,{value:y.code,children:(0,q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,q.jsx)("span",{children:y.flag}),(0,q.jsx)("span",{children:y.code}),(0,q.jsx)("span",{className:"text-muted-foreground",children:y.name})]})},y.code))})]}),(0,q.jsxs)("div",{className:"relative flex-1",children:[(0,q.jsx)(JM,{ref:c,type:"tel",inputMode:"numeric",autoComplete:"tel",placeholder:u==="+1"?"(555) 123-4567":"123 456 789",value:v,onChange:h,className:Ae(o&&"pl-10",e),...l}),o&&(0,q.jsx)(S_,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})]})});Hcr.displayName="PhoneInput";var jcr=Hn("aspect-square border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-border bg-background text-primary",outline:"border-border bg-transparent text-primary",filled:"border-primary bg-primary/10 text-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"default",size:"default"}}),Prt=ee.createContext({}),$cr=ee.forwardRef(({className:e,value:t,onValueChange:r,disabled:n,name:o,...a},i)=>(0,q.jsx)(Prt.Provider,{value:{value:t,onValueChange:r,disabled:n,name:o},children:(0,q.jsx)("div",{ref:i,role:"radiogroup",className:Ae("moonui-theme","grid gap-2",e),...a})}));$cr.displayName="RadioGroup";var Irt=ee.forwardRef(({className:e,variant:t,size:r,indicator:n,id:o,value:a,disabled:i,...s},l)=>{let c=ee.useContext(Prt),u=ee.useId(),d=o||u,f=c.value===a,p=m=>{c.onValueChange&&c.onValueChange(m.target.value),s.onChange&&s.onChange(m)};return(0,q.jsxs)("div",{className:"relative flex items-center",children:[(0,q.jsx)("input",{type:"radio",id:d,ref:l,value:a,checked:f,disabled:i||c.disabled,name:c.name,onChange:p,className:"sr-only",...s}),(0,q.jsx)("label",{htmlFor:d,className:Ae(jcr({variant:t,size:r}),"rounded-full","focus-visible:ring-primary/50","relative inline-flex shrink-0 cursor-pointer items-center justify-center overflow-hidden",i&&"cursor-not-allowed opacity-50",e),children:(0,q.jsx)("span",{className:Ae("absolute inset-0 pointer-events-none",f&&"flex items-center justify-center"),children:f&&(n||(0,q.jsx)(rM,{className:"h-[60%] w-[60%] fill-current text-current"}))})})]})});Irt.displayName="RadioGroupItem";var krt=ee.forwardRef(({className:e,htmlFor:t,children:r,disabled:n=!1,...o},a)=>(0,q.jsx)("label",{ref:a,htmlFor:t,className:Ae("text-sm font-medium leading-none ml-2 text-foreground",n&&"cursor-not-allowed opacity-70",e),...o,children:r}));krt.displayName="RadioLabel";var qcr=ee.forwardRef(({id:e,label:t,labelClassName:r,...n},o)=>{let a=ee.useId(),i=e||a;return(0,q.jsxs)("div",{className:"flex items-center",children:[(0,q.jsx)(Irt,{ref:o,id:i,...n}),(0,q.jsx)(krt,{htmlFor:i,disabled:n.disabled,className:r,children:t})]})});qcr.displayName="RadioItemWithLabel";function Wcr(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var $F=e=>{let{present:t,children:r}=e,n=Gcr(t),o=typeof r=="function"?r({present:n.isPresent}):ee.Children.only(r),a=G1(n.ref,Kcr(o));return typeof r=="function"||n.isPresent?ee.cloneElement(o,{ref:a}):null};$F.displayName="Presence";function Gcr(e){let[t,r]=ee.useState(),n=ee.useRef(null),o=ee.useRef(e),a=ee.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Wcr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ee.useEffect(()=>{let c=w8(n.current);a.current=s==="mounted"?c:"none"},[s]),HF(()=>{let c=n.current,u=o.current;if(u!==e){let f=a.current,p=w8(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),HF(()=>{if(t){let c,u=t.ownerDocument.defaultView??window,d=p=>{let h=w8(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&h&&(l("ANIMATION_END"),!o.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(a.current=w8(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:ee.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function w8(e){return e?.animationName||"none"}function Kcr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Xcr(e,t=[]){let r=[];function n(a,i){let s=ee.createContext(i),l=r.length;r=[...r,i];let c=d=>{let{scope:f,children:p,...m}=d,h=f?.[e]?.[l]||s,g=ee.useMemo(()=>m,Object.values(m));return(0,q.jsx)(h.Provider,{value:g,children:p})};c.displayName=a+"Provider";function u(d,f){let p=f?.[e]?.[l]||s,m=ee.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[c,u]}let o=()=>{let a=r.map(i=>ee.createContext(i));return function(s){let l=s?.[e]||a;return ee.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,Ycr(o,...t)]}function Ycr(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){let i=n.reduce((s,{useScope:l,scopeName:c})=>{let d=l(a)[`__scope${c}`];return{...s,...d}},{});return ee.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function $1(e){let t=ee.useRef(e);return ee.useEffect(()=>{t.current=e}),ee.useMemo(()=>(...r)=>t.current?.(...r),[])}var Qcr=ee.createContext(void 0);function Zcr(e){let t=ee.useContext(Qcr);return e||t||"ltr"}function Jcr(e,[t,r]){return Math.min(r,Math.max(t,e))}function hw(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eur(e,t){return ee.useReducer((r,n)=>t[r][n]??r,e)}var Jde="ScrollArea",[Rrt,cXn]=Xcr(Jde),[tur,rm]=Rrt(Jde),Nrt=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=ee.useState(null),[c,u]=ee.useState(null),[d,f]=ee.useState(null),[p,m]=ee.useState(null),[h,g]=ee.useState(null),[v,y]=ee.useState(0),[x,w]=ee.useState(0),[b,C]=ee.useState(!1),[S,P]=ee.useState(!1),N=G1(t,A=>l(A)),T=Zcr(o);return(0,q.jsx)(tur,{scope:r,type:n,dir:T,scrollHideDelay:a,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:b,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:S,onScrollbarYEnabledChange:P,onCornerWidthChange:y,onCornerHeightChange:w,children:(0,q.jsx)(Ld.div,{dir:T,...i,ref:N,style:{position:"relative",["--radix-scroll-area-corner-width"]:v+"px",["--radix-scroll-area-corner-height"]:x+"px",...e.style}})})});Nrt.displayName=Jde;var Mrt="ScrollAreaViewport",Trt=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:n,nonce:o,...a}=e,i=rm(Mrt,r),s=ee.useRef(null),l=G1(t,s,i.onViewportChange);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,q.jsx)(Ld.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,q.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Trt.displayName=Mrt;var sv="ScrollAreaScrollbar",efe=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s=e.orientation==="horizontal";return ee.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),o.type==="hover"?(0,q.jsx)(rur,{...n,ref:t,forceMount:r}):o.type==="scroll"?(0,q.jsx)(nur,{...n,ref:t,forceMount:r}):o.type==="auto"?(0,q.jsx)(Art,{...n,ref:t,forceMount:r}):o.type==="always"?(0,q.jsx)(tfe,{...n,ref:t}):null});efe.displayName=sv;var rur=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),[a,i]=ee.useState(!1);return ee.useEffect(()=>{let s=o.scrollArea,l=0;if(s){let c=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),(0,q.jsx)($F,{present:r||a,children:(0,q.jsx)(Art,{"data-state":a?"visible":"hidden",...n,ref:t})})}),nur=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=rm(sv,e.__scopeScrollArea),a=e.orientation==="horizontal",i=M8(()=>l("SCROLL_END"),100),[s,l]=eur("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return ee.useEffect(()=>{if(s==="idle"){let c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),ee.useEffect(()=>{let c=o.viewport,u=a?"scrollLeft":"scrollTop";if(c){let d=c[u],f=()=>{let p=c[u];d!==p&&(l("SCROLL"),i()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,a,l,i]),(0,q.jsx)($F,{present:r||s!=="hidden",children:(0,q.jsx)(tfe,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:hw(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:hw(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Art=ee.forwardRef((e,t)=>{let r=rm(sv,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=ee.useState(!1),s=e.orientation==="horizontal",l=M8(()=>{if(r.viewport){let c=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;i(s?c:u)}},10);return ZM(r.viewport,l),ZM(r.content,l),(0,q.jsx)($F,{present:n||a,children:(0,q.jsx)(tfe,{"data-state":a?"visible":"hidden",...o,ref:t})})}),tfe=ee.forwardRef((e,t)=>{let{orientation:r="vertical",...n}=e,o=rm(sv,e.__scopeScrollArea),a=ee.useRef(null),i=ee.useRef(0),[s,l]=ee.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=_rt(s.viewport,s.content),u={...n,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,p){return cur(f,i.current,s,p)}return r==="horizontal"?(0,q.jsx)(our,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollLeft,p=Ktt(f,s,o.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,q.jsx)(aur,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){let f=o.viewport.scrollTop,p=Ktt(f,s);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),our=ee.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rm(sv,e.__scopeScrollArea),[i,s]=ee.useState(),l=ee.useRef(null),c=G1(t,l,a.onScrollbarXChange);return ee.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,q.jsx)(Ert,{"data-orientation":"horizontal",...o,ref:c,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:N8(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),Brt(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:P8(i.paddingLeft),paddingEnd:P8(i.paddingRight)}})}})}),aur=ee.forwardRef((e,t)=>{let{sizes:r,onSizesChange:n,...o}=e,a=rm(sv,e.__scopeScrollArea),[i,s]=ee.useState(),l=ee.useRef(null),c=G1(t,l,a.onScrollbarYChange);return ee.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,q.jsx)(Ert,{"data-orientation":"vertical",...o,ref:c,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:N8(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(a.viewport){let f=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),Brt(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:P8(i.paddingTop),paddingEnd:P8(i.paddingBottom)}})}})}),[iur,Lrt]=Rrt(sv),Ert=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=rm(sv,r),[m,h]=ee.useState(null),g=G1(t,N=>h(N)),v=ee.useRef(null),y=ee.useRef(""),x=p.viewport,w=n.content-n.viewport,b=$1(u),C=$1(l),S=M8(d,10);function P(N){if(v.current){let T=N.clientX-v.current.left,A=N.clientY-v.current.top;c({x:T,y:A})}}return ee.useEffect(()=>{let N=T=>{let A=T.target;m?.contains(A)&&b(T,w)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,m,w,b]),ee.useEffect(C,[n,C]),ZM(m,S),ZM(p.content,S),(0,q.jsx)(iur,{scope:r,scrollbar:m,hasThumb:o,onThumbChange:$1(a),onThumbPointerUp:$1(i),onThumbPositionChange:C,onThumbPointerDown:$1(s),children:(0,q.jsx)(Ld.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:hw(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(N))}),onPointerMove:hw(e.onPointerMove,P),onPointerUp:hw(e.onPointerUp,N=>{let T=N.target;T.hasPointerCapture(N.pointerId)&&T.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),S8="ScrollAreaThumb",Drt=ee.forwardRef((e,t)=>{let{forceMount:r,...n}=e,o=Lrt(S8,e.__scopeScrollArea);return(0,q.jsx)($F,{present:r||o.hasThumb,children:(0,q.jsx)(sur,{ref:t,...n})})}),sur=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:n,...o}=e,a=rm(S8,r),i=Lrt(S8,r),{onThumbPositionChange:s}=i,l=G1(t,d=>i.onThumbChange(d)),c=ee.useRef(void 0),u=M8(()=>{c.current&&(c.current(),c.current=void 0)},100);return ee.useEffect(()=>{let d=a.viewport;if(d){let f=()=>{if(u(),!c.current){let p=uur(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[a.viewport,u,s]),(0,q.jsx)(Ld.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:hw(e.onPointerDownCapture,d=>{let p=d.target.getBoundingClientRect(),m=d.clientX-p.left,h=d.clientY-p.top;i.onThumbPointerDown({x:m,y:h})}),onPointerUp:hw(e.onPointerUp,i.onThumbPointerUp)})});Drt.displayName=S8;var rfe="ScrollAreaCorner",Ort=ee.forwardRef((e,t)=>{let r=rm(rfe,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?(0,q.jsx)(lur,{...e,ref:t}):null});Ort.displayName=rfe;var lur=ee.forwardRef((e,t)=>{let{__scopeScrollArea:r,...n}=e,o=rm(rfe,r),[a,i]=ee.useState(0),[s,l]=ee.useState(0),c=!!(a&&s);return ZM(o.scrollbarX,()=>{let u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),ZM(o.scrollbarY,()=>{let u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),i(u)}),c?(0,q.jsx)(Ld.div,{...n,ref:t,style:{width:a,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function P8(e){return e?parseInt(e,10):0}function _rt(e,t){let r=e/t;return isNaN(r)?0:r}function N8(e){let t=_rt(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function cur(e,t,r,n="ltr"){let o=N8(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return Frt([l,c],d)(e)}function Ktt(e,t,r="ltr"){let n=N8(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=r==="ltr"?[0,i]:[i*-1,0],c=Jcr(e,l);return Frt([0,i],[0,s])(c)}function Frt(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Brt(e,t){return e>0&&e<t}var uur=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){let a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function M8(e,t){let r=$1(e),n=ee.useRef(0);return ee.useEffect(()=>()=>window.clearTimeout(n.current),[]),ee.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ZM(e,t){let r=$1(t);HF(()=>{let n=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Vrt=Nrt,dur=Trt,fur=Ort,pur=ee.forwardRef(({className:e,children:t,...r},n)=>(0,q.jsxs)(Vrt,{ref:n,className:Ae("relative overflow-hidden",e),...r,children:[(0,q.jsx)(dur,{className:"h-full w-full rounded-[inherit]",children:t}),(0,q.jsx)(Urt,{}),(0,q.jsx)(fur,{})]}));pur.displayName=Vrt.displayName;var Urt=ee.forwardRef(({className:e,orientation:t="vertical",...r},n)=>(0,q.jsx)(efe,{ref:n,orientation:t,className:Ae("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,q.jsx)(Drt,{className:"relative flex-1 rounded-full bg-border"})}));Urt.displayName=efe.displayName;var mur=Hn("shrink-0 bg-border",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"},variant:{default:"bg-border",dashed:"border-dashed border-border bg-transparent",dotted:"border-dotted border-border bg-transparent",gradient:"bg-gradient-to-r from-transparent via-border to-transparent"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",variant:"dashed",className:"border-t h-0"},{orientation:"vertical",variant:"dashed",className:"border-l w-0"},{orientation:"horizontal",variant:"dotted",className:"border-t h-0"},{orientation:"vertical",variant:"dotted",className:"border-l w-0"},{orientation:"horizontal",size:"sm",variant:["dashed","dotted"],className:"border-t-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["dashed","dotted"],className:"border-t-2"},{orientation:"vertical",size:"sm",variant:["dashed","dotted"],className:"border-l-[0.5px]"},{orientation:"vertical",size:"lg",variant:["dashed","dotted"],className:"border-l-2"},{orientation:"horizontal",size:"sm",variant:["default","gradient"],className:"h-[0.5px]"},{orientation:"horizontal",size:"lg",variant:["default","gradient"],className:"h-[2px]"},{orientation:"vertical",size:"sm",variant:["default","gradient"],className:"w-[0.5px]"},{orientation:"vertical",size:"lg",variant:["default","gradient"],className:"w-[2px]"}],defaultVariants:{orientation:"horizontal",variant:"default",size:"md"}}),iv=ee.forwardRef(({className:e,orientation:t="horizontal",variant:r="default",size:n="md",decorative:o=!0,...a},i)=>(0,q.jsx)(mde,{ref:i,decorative:o,orientation:t||void 0,className:Ae(mur({orientation:t,variant:r,size:n}),e),...a}));iv.displayName=mde.displayName;var hur=ee[" useInsertionEffect ".trim().toString()]||HF;function gur({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,a,i]=vur({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{let u=ee.useRef(e!==void 0);ee.useEffect(()=>{let d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}let c=ee.useCallback(u=>{if(s){let d=yur(u)?u(e):u;d!==e&&i.current?.(d)}else a(u)},[s,e,a,i]);return[l,c]}function vur({defaultProp:e,onChange:t}){let[r,n]=ee.useState(e),o=ee.useRef(r),a=ee.useRef(t);return hur(()=>{a.current=t},[t]),ee.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}function yur(e){return typeof e=="function"}var zrt="Toggle",Hrt=ee.forwardRef((e,t)=>{let{pressed:r,defaultPressed:n,onPressedChange:o,...a}=e,[i,s]=gur({prop:r,onChange:o,defaultProp:n??!1,caller:zrt});return(0,q.jsx)(Ld.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:hw(e.onClick,()=>{e.disabled||s(!i)})})});Hrt.displayName=zrt;var jrt=Hrt,xur=Hn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),$rt=ee.forwardRef(({className:e,variant:t,size:r,...n},o)=>(0,q.jsx)(jrt,{ref:o,className:Ae("moonui-theme",xur({variant:t,size:r,className:e})),...n}));$rt.displayName=jrt.displayName;var bur=gtt,wur=Hn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500 text-white border-green-600",warning:"bg-yellow-500 text-white border-yellow-600",destructive:"bg-destructive text-destructive-foreground",info:"bg-blue-500 text-white border-blue-600"},size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{variant:"default",size:"md"}}),qrt=vtt,Wrt=ytt,Grt=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(bde,{ref:r,className:Ae("moonui-theme","fill-current",e),...t}));Grt.displayName=bde.displayName;var nfe=ee.forwardRef(({className:e,variant:t,size:r,showArrow:n=!1,sideOffset:o=4,...a},i)=>(0,q.jsxs)(xde,{ref:i,sideOffset:o,className:Ae("moonui-theme",wur({variant:t,size:r}),e),...a,children:[a.children,n&&(0,q.jsx)(Grt,{})]}));nfe.displayName=xde.displayName;var Cur=ee.forwardRef(({children:e,content:t,variant:r="default",size:n="md",side:o="top",align:a="center",delayDuration:i=400,sideOffset:s=4,showArrow:l=!1,className:c,open:u,defaultOpen:d,onOpenChange:f,...p},m)=>(0,q.jsxs)(qrt,{open:u,defaultOpen:d,onOpenChange:f,delayDuration:i,children:[(0,q.jsx)(Wrt,{asChild:!0,children:e}),(0,q.jsx)(nfe,{ref:m,side:o,align:a,variant:r,size:n,sideOffset:s,showArrow:l,className:c,...p,children:t})]}));Cur.displayName="SimpleTooltip";var ul=({icon:e,tooltip:t,active:r,onClick:n,disabled:o})=>(0,q.jsxs)(qrt,{children:[(0,q.jsx)(Wrt,{asChild:!0,children:(0,q.jsx)($rt,{pressed:r,onPressedChange:()=>n(),disabled:o,className:"h-8 w-8 p-0",children:e})}),(0,q.jsx)(nfe,{children:(0,q.jsx)("p",{children:t})})]}),Sur=({onColorSelect:e})=>(0,q.jsx)("div",{className:"grid grid-cols-4 gap-1 p-2",children:["#000000","#374151","#6B7280","#9CA3AF","#EF4444","#F59E0B","#EAB308","#22C55E","#3B82F6","#6366F1","#8B5CF6","#EC4899"].map(r=>(0,q.jsx)("button",{className:"w-6 h-6 rounded border-2 border-gray-200 hover:border-gray-400",style:{backgroundColor:r},onClick:()=>e(r)},r))}),Pur=Bn.default.forwardRef(({value:e="",onChange:t,placeholder:r="Start writing...",disabled:n=!1,className:o,minHeight:a=200,maxHeight:i=500,showToolbar:s=!0,showPreview:l=!0,...c},u)=>{let[d,f]=(0,Bn.useState)(e),[p,m]=(0,Bn.useState)(!1),[h,g]=(0,Bn.useState)(e);(0,Bn.useState)(null);let v=Bn.default.useRef(null),y=Bn.default.useRef(null),[x,w]=(0,Bn.useState)({bold:!1,italic:!1,underline:!1,strikethrough:!1,alignLeft:!0,alignCenter:!1,alignRight:!1,alignJustify:!1,orderedList:!1,unorderedList:!1,quote:!1,code:!1}),b=(0,Bn.useCallback)(I=>{f(I),t?.(I)},[t]),C=(0,Bn.useCallback)(()=>{let I=window.getSelection();return I&&I.rangeCount>0?I.getRangeAt(0):null},[]);(0,Bn.useCallback)(I=>{if(!I)return;let k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(I))},[]);let S=(0,Bn.useCallback)((I,k)=>{if(n)return;if(v.current&&v.current.focus(),C(),document.execCommand(I,!1,k)||console.warn(`Command '${I}' failed to execute`),v.current){let E=v.current.innerHTML;b(E)}w({bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),strikethrough:document.queryCommandState("strikeThrough"),alignLeft:document.queryCommandState("justifyLeft"),alignCenter:document.queryCommandState("justifyCenter"),alignRight:document.queryCommandState("justifyRight"),alignJustify:document.queryCommandState("justifyFull"),orderedList:document.queryCommandState("insertOrderedList"),unorderedList:document.queryCommandState("insertUnorderedList"),quote:document.queryCommandState("formatBlock"),code:document.queryCommandState("formatBlock")}),v.current&&v.current.focus()},[n,C,b]),P=(0,Bn.useCallback)(I=>{let k=I.currentTarget.innerHTML;b(k)},[b]),N=(0,Bn.useCallback)(I=>{if(I.ctrlKey||I.metaKey)switch(I.key){case"b":I.preventDefault(),S("bold");break;case"i":I.preventDefault(),S("italic");break;case"u":I.preventDefault(),S("underline");break;case"z":I.preventDefault(),I.shiftKey?S("redo"):S("undo");break}I.key==="Tab"&&(I.preventDefault(),S("insertHTML"," "))},[S]),T=(0,Bn.useCallback)(()=>{let I=prompt("Enter URL:");I&&S("createLink",I)},[S]),A=(0,Bn.useCallback)(()=>{let I=prompt("Enter image URL:");I&&S("insertImage",I)},[S]),M=(0,Bn.useCallback)(I=>{S("formatBlock",`<h${I}>`)},[S]),O=(0,Bn.useCallback)(I=>{let k=window.getSelection();if(k&&k.rangeCount>0){let R=k.getRangeAt(0),E=document.createElement("span");E.style.color=I;try{R.surroundContents(E)}catch{S("foreColor",I)}if(v.current){let _=v.current.innerHTML;b(_)}}},[S,b]);Bn.default.useEffect(()=>{v.current&&d&&d!==v.current.innerHTML&&(v.current.innerHTML=d)},[d]),Bn.default.useEffect(()=>{e!==void 0&&e!==d&&(f(e),g(e))},[e,d]);let F=s&&(0,q.jsx)(bur,{children:(0,q.jsxs)(Ad.div,{className:"flex items-center gap-1 p-2 border-b bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[!p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(c_,{className:"h-3 w-3"}),tooltip:"Bold (Ctrl+B)",active:x.bold,onClick:()=>S("bold"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(g_,{className:"h-3 w-3"}),tooltip:"Italic (Ctrl+I)",active:x.italic,onClick:()=>S("italic"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(N_,{className:"h-3 w-3"}),tooltip:"Underline (Ctrl+U)",active:x.underline,onClick:()=>S("underline"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(R_,{className:"h-3 w-3"}),tooltip:"Strikethrough",active:x.strikethrough,onClick:()=>S("strikeThrough"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)(Yde,{onValueChange:I=>{I.startsWith("h")?M(I.substring(1)):I==="normal"?S("formatBlock","p"):S("fontSize",I)},disabled:n,children:[(0,q.jsx)(Qde,{className:"w-24 h-8",children:(0,q.jsx)(wrt,{placeholder:"Size"})}),(0,q.jsxs)(Zde,{children:[(0,q.jsx)(tm,{value:"1",children:"Small"}),(0,q.jsx)(tm,{value:"3",children:"Normal"}),(0,q.jsx)(tm,{value:"5",children:"Large"}),(0,q.jsx)(tm,{value:"7",children:"X-Large"}),(0,q.jsx)(iv,{className:"my-1"}),(0,q.jsx)(tm,{value:"h1",children:"Heading 1"}),(0,q.jsx)(tm,{value:"h2",children:"Heading 2"}),(0,q.jsx)(tm,{value:"h3",children:"Heading 3"}),(0,q.jsx)(tm,{value:"h4",children:"Heading 4"}),(0,q.jsx)(tm,{value:"h5",children:"Heading 5"}),(0,q.jsx)(tm,{value:"h6",children:"Heading 6"})]})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(s_,{className:"h-3 w-3"}),tooltip:"Align Left",active:x.alignLeft,onClick:()=>S("justifyLeft"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(a_,{className:"h-3 w-3"}),tooltip:"Align Center",active:x.alignCenter,onClick:()=>S("justifyCenter"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(l_,{className:"h-3 w-3"}),tooltip:"Align Right",active:x.alignRight,onClick:()=>S("justifyRight"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(i_,{className:"h-3 w-3"}),tooltip:"Justify",active:x.alignJustify,onClick:()=>S("justifyFull"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(x_,{className:"h-3 w-3"}),tooltip:"Bullet List",active:x.unorderedList,onClick:()=>S("insertUnorderedList"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(y_,{className:"h-3 w-3"}),tooltip:"Numbered List",active:x.orderedList,onClick:()=>S("insertOrderedList"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(P_,{className:"h-3 w-3"}),tooltip:"Quote",active:x.quote,onClick:()=>S("formatBlock","blockquote"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(d_,{className:"h-3 w-3"}),tooltip:"Code Block",active:x.code,onClick:()=>S("formatBlock","pre"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)("span",{className:"text-xs font-mono",children:"\u2190"}),tooltip:"Decrease Indent",onClick:()=>S("outdent"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)("span",{className:"text-xs font-mono",children:"\u2192"}),tooltip:"Increase Indent",onClick:()=>S("indent"),disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(v_,{className:"h-3 w-3"}),tooltip:"Insert Link",onClick:T,disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(nM,{className:"h-3 w-3"}),tooltip:"Insert Image",onClick:A,disabled:n})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)(Xsr,{children:[(0,q.jsx)(Ysr,{asChild:!0,children:(0,q.jsx)(I8,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:n,title:"Text Color",children:(0,q.jsx)(C_,{className:"h-3 w-3"})})}),(0,q.jsx)(irt,{className:"w-auto p-0",children:(0,q.jsx)(Sur,{onColorSelect:O})})]}),(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,q.jsx)(ul,{icon:(0,q.jsx)(M_,{className:"h-3 w-3"}),tooltip:"Undo (Ctrl+Z)",onClick:()=>S("undo"),disabled:n}),(0,q.jsx)(ul,{icon:(0,q.jsx)(I_,{className:"h-3 w-3"}),tooltip:"Redo (Ctrl+Shift+Z)",onClick:()=>S("redo"),disabled:n})]})]}),l&&(0,q.jsxs)(q.Fragment,{children:[!p&&(0,q.jsx)(iv,{orientation:"vertical",className:"h-6 bg-gray-300 dark:bg-zinc-600"}),(0,q.jsx)(ul,{icon:p?(0,q.jsx)(kd,{className:"h-3 w-3"}):(0,q.jsx)(p_,{className:"h-3 w-3"}),tooltip:p?"Edit Mode":"View Source Code",active:p,onClick:()=>{p?b(h):g(d),m(!p)},disabled:n})]})]})});return(0,q.jsxs)("div",{ref:u,className:Ae("border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",n&&"opacity-50 cursor-not-allowed",o),...c,children:[F,(0,q.jsxs)("div",{className:"relative",children:[p?(0,q.jsx)(Ad.div,{initial:{opacity:0},animate:{opacity:1},className:"bg-slate-50 dark:bg-zinc-900/95",style:{minHeight:a,maxHeight:i,overflow:"auto"},children:(0,q.jsx)("textarea",{ref:y,value:h,onChange:I=>g(I.target.value),className:"w-full h-full bg-transparent p-4 font-mono text-sm text-gray-900 dark:text-gray-100 resize-none focus:outline-none",style:{minHeight:a-32},disabled:n,placeholder:"HTML source code..."})}):(0,q.jsx)(Ad.div,{ref:v,contentEditable:!n,suppressContentEditableWarning:!0,className:Ae("p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto","bg-slate-50 dark:bg-zinc-900/95","text-gray-900 dark:text-gray-100","focus:ring-0","[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4","[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3","[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2","[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2","[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1","[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1","[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4","[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4","[&_li]:mb-1","[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic","[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"),style:{minHeight:a,maxHeight:i},onInput:P,onKeyDown:N,"data-placeholder":r,initial:{opacity:0},animate:{opacity:1}}),!d&&!p&&(0,q.jsx)("div",{className:"absolute top-4 left-4 text-muted-foreground pointer-events-none",style:{fontSize:"16px"},children:r})]}),(0,q.jsx)("div",{className:"px-4 py-2 border-t bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm text-xs text-gray-600 dark:text-gray-400",children:(0,q.jsx)(Iur,{content:d})})]})});Pur.displayName="SimpleEditor";var Iur=({content:e})=>{let[t,r]=(0,Bn.useState)(0);return(0,Bn.useEffect)(()=>{r((o=>{let a=document.createElement("div");return a.innerHTML=o,a.textContent||a.innerText||""})(e).length)},[e]),(0,q.jsxs)(q.Fragment,{children:[t," characters"]})},kur=Hn("animate-pulse rounded-md",{variants:{variant:{default:"bg-muted",primary:"bg-primary/10",secondary:"bg-secondary/10",accent:"bg-accent"},size:{default:"",sm:"scale-90",lg:"scale-110"},shape:{rect:"rounded-md",circle:"rounded-full",pill:"rounded-full"},animation:{pulse:"animate-pulse",wave:"overflow-hidden relative after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_2s_infinite] after:bg-gradient-to-r after:from-transparent after:via-white/10 after:to-transparent dark:after:via-white/5",none:"animate-none"}},defaultVariants:{variant:"default",size:"default",shape:"rect",animation:"pulse"}}),q1=ee.forwardRef(({className:e,variant:t,size:r,shape:n,animation:o,height:a,width:i,isLoaded:s=!1,children:l,fadeInDuration:c=400,motion:u=!1,style:d,...f},p)=>{let{onDrag:m,onDragEnd:h,onDragStart:g,onAnimationStart:v,onAnimationEnd:y,onAnimationIteration:x,...w}=f;if(s&&l)return u?(0,q.jsx)(Ad.div,{ref:p,initial:{opacity:0},animate:{opacity:1},transition:{duration:c/1e3},className:Ae("moonui-theme",e),style:{height:a,width:i,...d},...w,children:l}):(0,q.jsx)("div",{ref:p,className:Ae("moonui-theme","animate-fade-in",e),style:{animationDuration:`${c}ms`,height:a,width:i,...d},...f,children:l});let b=u?Ad.div:"div";return(0,q.jsx)(b,{ref:p,className:Ae("moonui-theme",kur({variant:t,size:r,shape:n,animation:o}),"relative isolate",e),style:{height:a,width:i,...d},...u?ssr:{},...w})});q1.displayName="Skeleton";var Krt=ee.forwardRef(({className:e,lines:t=3,lineHeight:r="0.85rem",spacing:n="0.5rem",lastLineWidth:o=80,randomWidths:a=!1,variant:i="default",animation:s="pulse",...l},c)=>(0,q.jsx)("div",{ref:c,className:Ae("moonui-theme","flex flex-col",e),style:{gap:n},...l,children:Array.from({length:t}).map((u,d)=>{let p=d===t-1?o:a?85+d%3*5:100;return(0,q.jsx)(q1,{variant:i,animation:s,className:"w-full",style:{height:r,width:`${p}%`}},d)})}));Krt.displayName="SkeletonText";var Xrt=ee.forwardRef(({className:e,size:t="2.5rem",variant:r="default",animation:n="pulse",...o},a)=>(0,q.jsx)(q1,{ref:a,variant:r,animation:n,shape:"circle",className:Ae("moonui-theme","shrink-0",e),style:{height:t,width:t},...o}));Xrt.displayName="SkeletonAvatar";var Rur=ee.forwardRef(({className:e,showHeader:t=!0,contentLines:r=3,showFooter:n=!0,variant:o="default",animation:a="pulse",...i},s)=>(0,q.jsxs)("div",{ref:s,className:Ae("overflow-hidden rounded-md border border-border bg-background p-4",e),...i,children:[t&&(0,q.jsxs)("div",{className:"mb-4 flex items-center gap-4",children:[(0,q.jsx)(Xrt,{size:"2.5rem",variant:o,animation:a}),(0,q.jsxs)("div",{className:"flex-1",children:[(0,q.jsx)(q1,{variant:o,animation:a,className:"mb-2 h-4 w-1/3"}),(0,q.jsx)(q1,{variant:o,animation:a,className:"h-3 w-1/4"})]})]}),(0,q.jsx)(Krt,{lines:r,variant:o,animation:a,className:"mb-4"}),n&&(0,q.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-border",children:[(0,q.jsx)(q1,{variant:o,animation:a,className:"h-4 w-1/4"}),(0,q.jsx)(q1,{variant:o,animation:a,className:"h-4 w-1/5"})]})]}));Rur.displayName="SkeletonCard";var Nur=ee.forwardRef(({className:e,children:t,onSwipeLeft:r,onSwipeRight:n,threshold:o=100,disabled:a=!1,...i},s)=>{let[l,c]=ee.useState(0),[u,d]=ee.useState(0),[f,p]=ee.useState(!1),m=v=>{a||(c(v.touches[0].clientX),p(!0))},h=v=>{a||!f||d(v.touches[0].clientX)},g=()=>{if(a||!f)return;let v=u-l;Math.abs(v)>o&&(v>0&&n?n():v<0&&r&&r()),p(!1),d(0),c(0)};return(0,q.jsx)("div",{ref:s,className:Ae("touch-pan-y select-none transition-transform duration-200",f&&"cursor-grabbing",e),onTouchStart:m,onTouchMove:h,onTouchEnd:g,...i,children:t})});Nur.displayName="SwipeableCard";var Mur=ee.forwardRef(({className:e,size:t="md",variant:r="primary",loading:n,leftIcon:o,rightIcon:a,description:i,...s},l)=>(0,q.jsxs)("div",{className:"moonui-theme inline-flex items-center gap-2",children:[o&&(0,q.jsx)("span",{className:"text-muted-foreground",children:o}),(0,q.jsxs)(wde,{className:Ae("peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=unchecked]:bg-gray-700/70 dark:focus-visible:ring-primary/40 dark:focus-visible:ring-offset-gray-950",t==="sm"&&"h-4 w-8",t==="md"&&"h-6 w-11",t==="lg"&&"h-7 w-14",r==="primary"&&"data-[state=checked]:bg-primary",r==="success"&&"data-[state=checked]:bg-success",r==="warning"&&"data-[state=checked]:bg-warning",r==="danger"&&"data-[state=checked]:bg-error",r==="secondary"&&"data-[state=checked]:bg-accent","data-[state=unchecked]:bg-input",n&&"opacity-80 cursor-wait",e),disabled:n||s.disabled,...s,ref:l,children:[n?(0,q.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,q.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-primary"})}):null,(0,q.jsx)(Ptt,{className:Ae("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",t==="sm"&&"h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",t==="md"&&"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",t==="lg"&&"h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0")})]}),a&&(0,q.jsx)("span",{className:"text-muted-foreground",children:a}),i&&(0,q.jsx)("span",{className:"text-sm text-muted-foreground",children:i})]}));Mur.displayName=wde.displayName;var Tur=ee.forwardRef(({value:e=[],onChange:t,maxTags:r,variant:n="primary",allowDuplicates:o=!1,delimiter:a=",",placeholder:i="Add tag and press Enter",className:s,disabled:l,...c},u)=>{let[d,f]=ee.useState(""),[p,m]=ee.useState(""),h=y=>{y.key==="Enter"||y.key===a?(y.preventDefault(),g()):y.key==="Backspace"&&d===""&&e.length>0&&v(e.length-1)},g=()=>{let y=d.trim();if(y){if(!o&&e.includes(y)){m("This tag already exists"),setTimeout(()=>m(""),2e3);return}if(r&&e.length>=r){m(`Maximum ${r} tags allowed`),setTimeout(()=>m(""),2e3);return}t([...e,y]),f(""),m("")}},v=y=>{l||t(e.filter((x,w)=>w!==y))};return(0,q.jsxs)("div",{className:"relative",children:[(0,q.jsxs)("div",{className:Ae("flex min-h-[2.5rem] w-full flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","dark:bg-zinc-950/50 dark:border-zinc-800","focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l&&"cursor-not-allowed opacity-50",s),children:[e.map((y,x)=>(0,q.jsxs)(C8,{variant:n,className:"gap-1 pr-1.5",children:[(0,q.jsx)("span",{className:"text-xs",children:y}),!l&&(0,q.jsx)("button",{type:"button",onClick:()=>v(x),className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",children:(0,q.jsx)(Yy,{className:"h-3 w-3 text-muted-foreground hover:text-foreground transition-colors"})})]},x)),(0,q.jsx)("input",{ref:u,type:"text",value:d,onChange:y=>f(y.target.value),onKeyDown:h,onBlur:g,disabled:l,placeholder:e.length===0?i:"",className:Ae("flex-1 bg-transparent outline-none placeholder:text-muted-foreground","dark:placeholder:text-zinc-500","min-w-[120px]",l&&"cursor-not-allowed"),...c})]}),p&&(0,q.jsx)("p",{className:"mt-1 text-xs text-destructive",children:p})]})});Tur.displayName="TagsInput";var Aur=ee.forwardRef(({className:e,variant:t,size:r,error:n,success:o,loading:a,autoResize:i,maxHeight:s,characterCount:l,...c},u)=>(0,q.jsx)("textarea",{className:Ae("moonui-theme","flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:u,...c}));Aur.displayName="Textarea";var Lur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Mde,{ref:r,className:Ae("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Lur.displayName=Mde.displayName;var Eur=Hn("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-900/20 dark:text-green-100",warning:"border-orange-200 bg-orange-50 text-orange-900 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-100",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),Dur=ee.forwardRef(({className:e,variant:t,...r},n)=>(0,q.jsx)(Tde,{ref:n,className:Ae("moonui-theme",Eur({variant:t}),e),...r}));Dur.displayName=Tde.displayName;var Our=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ede,{ref:r,className:Ae("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Our.displayName=Ede.displayName;var _ur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Dde,{ref:r,className:Ae("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,q.jsx)(Yy,{className:"h-4 w-4"})}));_ur.displayName=Dde.displayName;var Fur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Ade,{ref:r,className:Ae("moonui-theme","text-sm font-semibold [&+div]:text-xs",e),...t}));Fur.displayName=Ade.displayName;var Bur=ee.forwardRef(({className:e,...t},r)=>(0,q.jsx)(Lde,{ref:r,className:Ae("moonui-theme","text-sm opacity-90",e),...t}));Bur.displayName=Lde.displayName;var qc=D(fe(),1),T8=xt("relative inline-flex shrink-0 overflow-hidden font-semibold transition-all",{variants:{size:{xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-14 w-14 text-lg","2xl":"h-16 w-16 text-xl","3xl":"h-20 w-20 text-2xl"},shape:{circle:"rounded-full",square:"rounded-md",hexagon:"mask mask-hexagon"},ring:{none:"",default:"ring-2 ring-offset-2 ring-offset-background",gradient:"ring-2 ring-offset-2 ring-offset-background",glow:"ring-2 ring-offset-2 ring-offset-background shadow-lg"}},defaultVariants:{size:"md",shape:"circle",ring:"none"}}),ofe=xt("absolute rounded-full border-2 border-background",{variants:{size:{xs:"h-2 w-2",sm:"h-2.5 w-2.5",md:"h-3 w-3",lg:"h-3.5 w-3.5",xl:"h-4 w-4","2xl":"h-5 w-5","3xl":"h-6 w-6"},position:{"bottom-right":"bottom-0 right-0","bottom-left":"bottom-0 left-0","top-right":"top-0 right-0","top-left":"top-0 left-0"},status:{online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-yellow-500",focus:"bg-purple-500"}},defaultVariants:{size:"md",position:"bottom-right",status:"offline"}}),afe=xt("absolute flex items-center justify-center rounded-full font-bold text-white",{variants:{size:{xs:"h-3 w-3 text-[8px]",sm:"h-3.5 w-3.5 text-[9px]",md:"h-4 w-4 text-[10px]",lg:"h-5 w-5 text-[11px]",xl:"h-6 w-6 text-xs","2xl":"h-7 w-7 text-sm","3xl":"h-8 w-8 text-base"},position:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"},variant:{default:"bg-primary",destructive:"bg-destructive",success:"bg-green-500",warning:"bg-yellow-500",info:"bg-blue-500",pro:"bg-gradient-to-r from-purple-500 to-pink-500",lifetime:"bg-gradient-to-r from-yellow-400 to-amber-500"}},defaultVariants:{size:"md",position:"top-right",variant:"default"}}),Vur={crown:_w,sparkles:bt,star:vs,heart:Vw,shield:YA,award:aA,gem:xA,flame:yA,zap:es},A8=Dd.forwardRef(({className:e,size:t,shape:r,ring:n,src:o,alt:a,fallback:i,delayMs:s,status:l,statusPosition:c="bottom-right",badge:u,ringColor:d,gradientFrom:f,gradientTo:p,animate:m=!1,animationType:h="pulse",onStatusClick:g,loading:v=!1,error:y=!1,...x},w)=>{let b={pulse:"animate-pulse",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping"},C=Dd.useMemo(()=>n==="gradient"&&f&&p?{background:`linear-gradient(135deg, ${f}, ${p})`,padding:"2px"}:d?{boxShadow:`0 0 0 2px ${d}`}:{},[n,d,f,p]),S=u?.icon?Vur[u.icon]:null;return(0,qc.jsxs)("div",{className:"relative inline-block",children:[n==="gradient"&&(0,qc.jsx)("div",{className:"absolute -inset-[2px] rounded-full",style:{background:`linear-gradient(135deg, ${f||"#8b5cf6"}, ${p||"#ec4899"})`}}),(0,qc.jsxs)(fL,{ref:w,className:Ae(T8({size:t,shape:r,ring:n}),m&&b[h],n==="gradient"&&"relative",e),style:n!=="gradient"?C:void 0,...x,children:[(0,qc.jsx)(pL,{src:o,alt:a,className:"aspect-square h-full w-full object-cover"}),(0,qc.jsx)(mL,{className:Ae("flex h-full w-full items-center justify-center bg-muted",v&&"animate-pulse",y&&"bg-destructive/10 text-destructive"),delayMs:s,children:v?(0,qc.jsx)("div",{className:"h-1/2 w-1/2 rounded-full bg-muted-foreground/20 animate-pulse"}):y?(0,qc.jsx)(lo,{className:"h-1/2 w-1/2"}):i})]}),l&&!v&&(0,qc.jsx)("button",{className:Ae(ofe({size:t,position:c,status:l}),g&&"cursor-pointer hover:scale-110 transition-transform",l==="online"&&"animate-pulse"),onClick:g,"aria-label":`Status: ${l}`}),u&&!v&&(0,qc.jsx)("div",{className:Ae(afe({size:t,position:u.position,variant:u.variant}),"shadow-sm"),children:S?(0,qc.jsx)(S,{className:"h-full w-full p-0.5"}):u.content})]})});A8.displayName="MoonUIAvatarPro";var ife=Dd.forwardRef(({children:e,max:t=4,size:r="md",spacing:n="normal",className:o},a)=>{let i=Dd.Children.toArray(e),s=i.slice(0,t),l=i.length-t;return(0,qc.jsxs)("div",{ref:a,className:Ae("flex items-center",{tight:"-space-x-3",normal:"-space-x-2",loose:"-space-x-1"}[n],o),children:[s.map((u,d)=>(0,qc.jsx)("div",{className:"relative ring-2 ring-background rounded-full",style:{zIndex:s.length-d},children:u},d)),l>0&&(0,qc.jsxs)("div",{className:Ae(T8({size:r,shape:"circle"}),"relative flex items-center justify-center bg-muted ring-2 ring-background","text-muted-foreground font-medium"),style:{zIndex:0},children:["+",l]})]})});ife.displayName="MoonUIAvatarGroupPro";var sfe=Dd.forwardRef(({userId:e,fetchUser:t,...r},n)=>{let[o,a]=Dd.useState(null),[i,s]=Dd.useState(!1),[l,c]=Dd.useState(!1);return Dd.useEffect(()=>{e&&t&&(s(!0),c(!1),t(e).then(a).catch(()=>c(!0)).finally(()=>s(!1)))},[e,t]),(0,qc.jsx)(A8,{ref:n,src:o?.image||r.src,fallback:o?.name?.[0]||r.fallback,loading:i,error:l,...r})});sfe.displayName="MoonUIAsyncAvatarPro";var dl=D(fe(),1);function _u({title:e,subtitle:t,children:r,variant:n="default",backgroundVariant:o,colorScheme:a="blue",className:i,headerAction:s,loading:l=!1,error:c=null,animate:u=!0,rounded:d="lg",shadow:f="sm",gradientDirection:p="to-br",overlay:m}){let h=o||n,g={blue:"from-blue-500/10 via-blue-500/5 to-transparent border-blue-500/20 dark:from-blue-400/10 dark:via-blue-400/5 dark:border-blue-400/20",green:"from-green-500/10 via-green-500/5 to-transparent border-green-500/20 dark:from-green-400/10 dark:via-green-400/5 dark:border-green-400/20",purple:"from-purple-500/10 via-purple-500/5 to-transparent border-purple-500/20 dark:from-purple-400/10 dark:via-purple-400/5 dark:border-purple-400/20",orange:"from-orange-500/10 via-orange-500/5 to-transparent border-orange-500/20 dark:from-orange-400/10 dark:via-orange-400/5 dark:border-orange-400/20",pink:"from-pink-500/10 via-pink-500/5 to-transparent border-pink-500/20 dark:from-pink-400/10 dark:via-pink-400/5 dark:border-pink-400/20",cyan:"from-cyan-500/10 via-cyan-500/5 to-transparent border-cyan-500/20 dark:from-cyan-400/10 dark:via-cyan-400/5 dark:border-cyan-400/20",neutral:"from-gray-500/10 via-gray-500/5 to-transparent border-gray-500/20 dark:from-gray-400/10 dark:via-gray-400/5 dark:border-gray-400/20"},v={blue:"from-blue-500/20 via-blue-500/10 to-transparent border-blue-500/30 dark:from-blue-400/20 dark:via-blue-400/10 dark:border-blue-400/30",green:"from-green-500/20 via-green-500/10 to-transparent border-green-500/30 dark:from-green-400/20 dark:via-green-400/10 dark:border-green-400/30",purple:"from-purple-500/20 via-purple-500/10 to-transparent border-purple-500/30 dark:from-purple-400/20 dark:via-purple-400/10 dark:border-purple-400/30",orange:"from-orange-500/20 via-orange-500/10 to-transparent border-orange-500/30 dark:from-orange-400/20 dark:via-orange-400/10 dark:border-orange-400/30",pink:"from-pink-500/20 via-pink-500/10 to-transparent border-pink-500/30 dark:from-pink-400/20 dark:via-pink-400/10 dark:border-pink-400/30",cyan:"from-cyan-500/20 via-cyan-500/10 to-transparent border-cyan-500/30 dark:from-cyan-400/20 dark:via-cyan-400/10 dark:border-cyan-400/30",neutral:"from-gray-500/20 via-gray-500/10 to-transparent border-gray-500/30 dark:from-gray-400/20 dark:via-gray-400/10 dark:border-gray-400/30"},y={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl",full:"rounded-full"},x={none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl","2xl":"shadow-2xl"},w={dots:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",grid:"linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px)",diagonal:"repeating-linear-gradient(45deg, transparent, transparent 2px, currentColor 2px, currentColor 4px)",waves:"radial-gradient(ellipse at center, transparent 20%, currentColor 21%, currentColor 25%, transparent 26%)",none:"none"},b={"to-t":"bg-gradient-to-t","to-tr":"bg-gradient-to-tr","to-r":"bg-gradient-to-r","to-br":"bg-gradient-to-br","to-b":"bg-gradient-to-b","to-bl":"bg-gradient-to-bl","to-l":"bg-gradient-to-l","to-tl":"bg-gradient-to-tl"},C={"to-t":{backgroundImage:"linear-gradient(to top, var(--tw-gradient-stops))"},"to-tr":{backgroundImage:"linear-gradient(to top right, var(--tw-gradient-stops))"},"to-r":{backgroundImage:"linear-gradient(to right, var(--tw-gradient-stops))"},"to-br":{backgroundImage:"linear-gradient(to bottom right, var(--tw-gradient-stops))"},"to-b":{backgroundImage:"linear-gradient(to bottom, var(--tw-gradient-stops))"},"to-bl":{backgroundImage:"linear-gradient(to bottom left, var(--tw-gradient-stops))"},"to-l":{backgroundImage:"linear-gradient(to left, var(--tw-gradient-stops))"},"to-tl":{backgroundImage:"linear-gradient(to top left, var(--tw-gradient-stops))"}},S={default:"bg-card border",minimal:"border-0 shadow-none bg-card/50",glass:"bg-background/60 backdrop-blur-md border-white/10",bordered:"border-2 bg-card",gradient:`${b[p]} ${g[a]}`,colored:`${b[p]} ${v[a]} border-2`,overlay:"bg-card border relative overflow-hidden",floating:"bg-card border-0 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1 transition-all duration-300 ring-1 ring-gray-200/50 dark:ring-gray-700/50"},P=(0,dl.jsxs)(Ve,{className:B(S[h],y[d],x[f],"transition-all duration-200 relative",i),style:h==="gradient"||h==="colored"?C[p]:void 0,children:[(h==="overlay"||m)&&m?.pattern&&m.pattern!=="none"&&(0,dl.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:w[m.pattern],backgroundSize:m.pattern==="dots"?"8px 8px":m.pattern==="grid"?"20px 20px":m.pattern==="diagonal"?"8px 8px":m.pattern==="waves"?"60px 60px":"auto",opacity:m.opacity||.1,color:m.color||"currentColor"}}),(e||t||s)&&(0,dl.jsxs)(vr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,dl.jsxs)("div",{children:[e&&(0,dl.jsx)(Dr,{className:"text-base font-semibold",children:e}),t&&(0,dl.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),s&&(0,dl.jsx)("div",{className:"ml-4",children:s})]}),(0,dl.jsx)(ze,{className:B(e||t||s?"pt-0":"pt-6"),children:l?(0,dl.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,dl.jsxs)("div",{className:"animate-pulse space-y-2",children:[(0,dl.jsx)("div",{className:"h-4 bg-muted rounded w-24 mx-auto"}),(0,dl.jsx)("div",{className:"h-8 bg-muted rounded w-16 mx-auto"})]})}):c?(0,dl.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,dl.jsxs)("div",{className:"text-destructive",children:[(0,dl.jsx)("p",{className:"text-sm font-medium",children:"Error"}),(0,dl.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:c})]})}):r})]});return u?(0,dl.jsx)(oe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:P}):P}var Er=D(fe(),1);function lfe({data:e,title:t,variant:r="default",backgroundVariant:n,gradientDirection:o,orientation:a="horizontal",showTrend:i=!0,showTarget:s=!0,showChange:l=!0,animate:c=!0,icon:u,onKPIClick:d,...f}){let p=Array.isArray(e)?e:[e],m=(y,x)=>{if(typeof y=="string")return y;let w;return y%1!==0?w=(Math.round(y*100)/100).toString():w=y.toString(),x?`${w}${x}`:w},h=y=>{switch(y){case"success":return"text-green-600 dark:text-green-400";case"warning":return"text-yellow-600 dark:text-yellow-400";case"danger":return"text-red-600 dark:text-red-400";case"info":return"text-blue-600 dark:text-blue-400";default:return"text-foreground"}},g=y=>{if(!y||y.length<2)return null;let x=Math.max(...y),w=Math.min(...y),b=x-w||1;return(0,Er.jsx)("div",{className:"flex items-end gap-0.5 h-8 w-16",children:y.map((C,S)=>(0,Er.jsx)(oe.div,{className:"flex-1 bg-primary/60 rounded-t-sm min-h-[2px]",initial:{height:0},animate:{height:`${Math.max((C-w)/b*100,10)}%`},transition:{delay:S*.05,duration:c?.3:0}},S))})},v=(y,x)=>{let w=y.target&&typeof y.value=="number"?y.value/y.target.value*100:0;return(0,Er.jsxs)(oe.div,{className:B("space-y-2",d&&"cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"),onClick:()=>d?.(y),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:x*.1,duration:c?.3:0},children:[(r==="default"||r==="detailed")&&(0,Er.jsxs)("div",{className:B("flex items-center",a==="vertical"?"flex-col space-y-2":"justify-between"),children:[(0,Er.jsxs)("div",{className:B("flex items-center gap-2",a==="vertical"?"flex-col text-center":""),children:[y.icon&&(0,Er.jsx)("div",{className:"text-muted-foreground",children:y.icon}),(0,Er.jsxs)("div",{className:a==="vertical"?"text-center":"",children:[(0,Er.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:y.label}),y.description&&(0,Er.jsx)("p",{className:"text-xs text-muted-foreground/70",children:y.description})]})]}),(0,Er.jsxs)("div",{className:B("flex items-center gap-3",a==="vertical"?"flex-col":""),children:[(0,Er.jsx)("div",{className:B("text-right",a==="vertical"?"text-center":""),children:(0,Er.jsx)("p",{className:B("text-2xl font-bold tracking-tight",h(y.status)),children:m(y.value,y.unit)})}),l&&y.change&&(0,Er.jsxs)("div",{className:B("flex items-center gap-1",y.change.type==="increase"?"text-green-600":y.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[y.change.type==="increase"?(0,Er.jsx)(va,{className:"h-4 w-4"}):y.change.type==="decrease"?(0,Er.jsx)(vc,{className:"h-4 w-4"}):(0,Er.jsx)(eu,{className:"h-4 w-4"}),(0,Er.jsxs)("span",{className:"text-sm font-medium",children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]})]}),i&&y.trend&&g(y.trend)]})]}),r==="card"&&(0,Er.jsxs)("div",{className:"space-y-3",children:[(0,Er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Er.jsxs)("div",{children:[(0,Er.jsx)("p",{className:"text-sm text-muted-foreground",children:y.label}),(0,Er.jsx)("p",{className:"text-3xl font-bold tracking-tight",children:m(y.value,y.unit)})]}),u&&(0,Er.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10",children:u})]}),l&&y.change&&(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Er.jsxs)(dt,{variant:y.change.type==="increase"?"success":y.change.type==="decrease"?"destructive":"secondary",leftIcon:y.change.type==="increase"?(0,Er.jsx)(Qc,{className:"h-3 w-3"}):y.change.type==="decrease"?(0,Er.jsx)(gc,{className:"h-3 w-3"}):(0,Er.jsx)(eu,{className:"h-3 w-3"}),className:"text-xs",children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]}),y.change.period&&(0,Er.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",y.change.period]})]})]}),r==="compact"&&(0,Er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[y.icon&&(0,Er.jsx)("div",{className:"text-muted-foreground text-sm",children:y.icon}),(0,Er.jsx)("span",{className:"text-sm font-medium",children:y.label})]}),(0,Er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Er.jsx)("span",{className:"font-bold",children:m(y.value,y.unit)}),l&&y.change&&(0,Er.jsxs)(dt,{variant:"outline",className:"text-xs",leftIcon:y.change.type==="increase"?(0,Er.jsx)(Qc,{className:"h-3 w-3"}):y.change.type==="decrease"?(0,Er.jsx)(gc,{className:"h-3 w-3"}):(0,Er.jsx)(eu,{className:"h-3 w-3"}),children:[y.change.type!=="neutral"&&(y.change.type==="increase"?"+":"-"),Math.abs(y.change.value),"%"]})]})]}),r==="detailed"&&s&&y.target&&(0,Er.jsxs)("div",{className:"space-y-2",children:[(0,Er.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,Er.jsx)("span",{className:"text-muted-foreground",children:y.target.label||"Target"}),(0,Er.jsxs)("span",{className:"font-medium",children:[w.toFixed(1),"% of ",m(y.target.value,y.unit)]})]}),(0,Er.jsx)(Mo,{value:w,className:"h-2"})]})]},x)};return(0,Er.jsx)(_u,{title:t,variant:n,gradientDirection:o,...f,children:(0,Er.jsx)("div",{className:B("space-y-4",r==="compact"&&"space-y-2"),children:p.map((y,x)=>v(y,x))})})}var cfe=D(ue(),1);var Qt=D(fe(),1);function ufe({data:e,title:t,type:r="line",variant:n="default",backgroundVariant:o,gradientDirection:a,height:i=300,showLegend:s=!0,showGrid:l=!0,showTooltip:c=!0,showDataLabels:u=!1,animate:d=!0,colors:f,onDataPointClick:p,...m}){let[h,g]=cfe.default.useState(null),y=f||["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#06b6d4","#a855f7"],x=cfe.default.useMemo(()=>e.values?Math.max(...e.values):e.series?Math.max(...e.series.flatMap(T=>T.data.map(A=>A.value))):100,[e]),w=T=>T%1!==0?(Math.round(T*100)/100).toString():T.toString(),b=()=>{let T=e.values||[],A=e.labels||e.categories||[];return(0,Qt.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,Qt.jsx)("div",{className:"absolute inset-0 flex items-end justify-between gap-1 pl-10 pr-2 pb-6",children:T.map((M,O)=>{let F=M/x*100,I=h===O;return(0,Qt.jsxs)(oe.div,{className:"relative flex flex-col items-center justify-end min-w-0",style:{height:"calc(100% - 24px)",flex:"1 1 0"},onMouseEnter:()=>g(O),onMouseLeave:()=>g(null),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:O*.05},children:[u&&(0,Qt.jsx)(oe.span,{className:"absolute text-xs font-medium text-white mix-blend-difference",style:{bottom:`calc(${F}% / 2)`,left:"50%",transform:"translateX(-50%)"},initial:{opacity:0},animate:{opacity:1},transition:{delay:O*.1+.6},children:w(M)}),(0,Qt.jsx)("div",{className:"relative h-full w-full flex flex-col justify-end",children:(0,Qt.jsx)(oe.div,{className:B("w-full rounded-t cursor-pointer transition-all duration-200","shadow-lg",I&&"brightness-110 scale-y-105"),style:{background:`linear-gradient(to top, ${y[O%y.length]}, ${y[O%y.length]}dd)`,minHeight:"2px",boxShadow:I?`0 4px 20px ${y[O%y.length]}40`:"none"},initial:{height:0},animate:{height:`${F}%`},transition:{duration:d?.6:0,delay:O*.1,ease:"easeOut"},onClick:()=>p?.({label:A[O],value:M})})})]},O)})}),h!==null&&(0,Qt.jsxs)(oe.div,{className:"absolute bg-background border-2 rounded-lg px-4 py-3 text-sm pointer-events-none shadow-xl",style:{left:"50%",top:"10%",transform:"translateX(-50%)",zIndex:100},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.15},children:[(0,Qt.jsx)("div",{className:"font-semibold text-foreground",children:A[h]||`Item ${h+1}`}),(0,Qt.jsx)("div",{className:"text-primary font-bold text-base mt-1",children:w(T[h])})]}),(0,Qt.jsx)("div",{className:"absolute bottom-0 left-10 right-0 flex justify-between gap-1 pr-2 h-6",children:A.map((M,O)=>(0,Qt.jsx)("div",{className:"flex-1 flex justify-center",children:(0,Qt.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:M})},O))}),l&&(0,Qt.jsxs)("div",{className:"absolute inset-0 pb-6 pointer-events-none",children:[[0,25,50,75,100].map(M=>(0,Qt.jsx)("div",{className:"absolute left-10 right-0 border-b border-muted/20",style:{bottom:`calc(24px + ${M}% * (100% - 24px) / 100)`}},M)),(0,Qt.jsxs)("div",{className:"absolute left-0 top-0 bottom-6 w-9 flex flex-col justify-between text-xs text-muted-foreground pr-1",children:[(0,Qt.jsx)("span",{className:"text-right",children:w(x)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.75)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.5)}),(0,Qt.jsx)("span",{className:"text-right",children:w(x*.25)}),(0,Qt.jsx)("span",{className:"text-right",children:"0"})]})]})]})},C=()=>{let T=e.values||[],A=e.labels||e.categories||[];if(T.length<2)return null;let M=5,O=100-M*2,F=100-M*2,I=T.map((R,E)=>{let _=M+E/(T.length-1)*O,U=M+(F-R/x*F);return{x:_,y:U,value:R,label:A[E]}}),k=I.map((R,E)=>`${E===0?"M":"L"} ${R.x} ${R.y}`).join(" ");return(0,Qt.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,Qt.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,Qt.jsxs)("defs",{children:[(0,Qt.jsxs)("linearGradient",{id:"chartLineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,Qt.jsx)("stop",{offset:"0%",stopColor:y[0],stopOpacity:"1"}),(0,Qt.jsx)("stop",{offset:"50%",stopColor:y[1]||y[0],stopOpacity:"1"}),(0,Qt.jsx)("stop",{offset:"100%",stopColor:y[2]||y[0],stopOpacity:"1"})]}),(0,Qt.jsxs)("linearGradient",{id:"chartAreaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,Qt.jsx)("stop",{offset:"0%",stopColor:y[0],stopOpacity:"0.3"}),(0,Qt.jsx)("stop",{offset:"50%",stopColor:y[0],stopOpacity:"0.15"}),(0,Qt.jsx)("stop",{offset:"100%",stopColor:y[0],stopOpacity:"0.05"})]})]}),l&&(0,Qt.jsx)("g",{className:"opacity-10",children:[25,50,75].map(R=>{let E=5+R/100*90;return(0,Qt.jsx)("line",{x1:"0",y1:E,x2:"100",y2:E,stroke:"currentColor",strokeWidth:"0.3"},R)})}),(0,Qt.jsx)(oe.path,{d:k,fill:"none",stroke:"url(#chartLineGradient)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",initial:{pathLength:0},animate:{pathLength:1},transition:{duration:d?1:0}}),r==="area"&&(0,Qt.jsx)(oe.path,{d:`${k} L 90 90 L 10 90 Z`,fill:"url(#chartAreaGradient)",initial:{opacity:0},animate:{opacity:1},transition:{duration:d?.5:0,delay:.5}}),I.map((R,E)=>(0,Qt.jsx)(oe.circle,{cx:R.x,cy:R.y,r:"1.2",fill:y[0],stroke:"white",strokeWidth:"1",initial:{r:0,opacity:0},animate:{r:h===E?2:1.2,opacity:1,strokeWidth:h===E?1.2:1},onMouseEnter:()=>g(E),onMouseLeave:()=>g(null),className:"cursor-pointer",style:{shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"},onClick:()=>p?.(R),transition:{duration:.2}},E))]}),c&&h!==null&&I[h]&&(()=>{let R=I[h],E=R.y<30;return(0,Qt.jsxs)("div",{className:"absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none z-10 shadow-lg",style:{left:`${Math.min(90,Math.max(10,R.x))}%`,top:E?`${R.y}%`:`${R.y}%`,transform:E?"translate(-50%, 10px)":"translate(-50%, calc(-100% - 10px))"},children:[(0,Qt.jsx)("div",{className:"font-medium",children:R.label}),(0,Qt.jsx)("div",{children:w(R.value)})]})})()]})},S=()=>{let T=e.values||[],A=e.labels||e.categories||[],M=T.reduce((F,I)=>F+I,0),O=-90;return(0,Qt.jsxs)("div",{className:"flex items-center justify-between gap-4 h-full overflow-hidden",children:[(0,Qt.jsxs)("div",{className:"relative w-48 h-48 flex-shrink-0",children:[(0,Qt.jsxs)("svg",{className:"w-full h-full transform",viewBox:"0 0 100 100",children:[T.map((F,I)=>{let k=F/M*100,R=k/100*360,E=O,_=O+R,U=P(50,50,40,E),V=P(50,50,40,_),L=R>180?1:0,H=["M 50 50",`L ${U.x} ${U.y}`,`A 40 40 0 ${L} 1 ${V.x} ${V.y}`,"Z"].join(" ");return O=_,(0,Qt.jsx)(oe.path,{d:H,fill:y[I%y.length],initial:{scale:0},animate:{scale:h===I?1.05:1},style:{transformOrigin:"50px 50px"},transition:{duration:d?.3:0,delay:I*.05},onMouseEnter:()=>g(I),onMouseLeave:()=>g(null),className:"cursor-pointer",onClick:()=>p?.({label:A[I],value:F,percentage:k})},I)}),r==="donut"&&(0,Qt.jsx)("circle",{cx:"50",cy:"50",r:"25",fill:"var(--background)"})]}),r==="donut"&&(0,Qt.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,Qt.jsx)("div",{className:"text-2xl font-bold",children:M}),(0,Qt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Total"})]})]}),s&&(0,Qt.jsx)("div",{className:"space-y-1 overflow-y-auto flex-1 min-w-0",children:T.map((F,I)=>{let k=(F/M*100).toFixed(1);return(0,Qt.jsxs)("div",{className:B("flex items-center gap-2 cursor-pointer",h===I&&"opacity-80"),onMouseEnter:()=>g(I),onMouseLeave:()=>g(null),children:[(0,Qt.jsx)("div",{className:"w-2 h-2 rounded flex-shrink-0",style:{backgroundColor:y[I%y.length]}}),(0,Qt.jsx)("span",{className:"text-xs truncate",children:A[I]}),(0,Qt.jsxs)("span",{className:"text-xs text-muted-foreground ml-auto",children:[k,"%"]})]},I)})})]})},P=(T,A,M,O)=>{let F=O*Math.PI/180;return{x:T+M*Math.cos(F),y:A+M*Math.sin(F)}},N=()=>{switch(r){case"bar":return b();case"line":case"area":return C();case"pie":case"donut":return S();default:return b()}};return(0,Qt.jsx)(_u,{title:t,variant:o,gradientDirection:a,...m,children:(0,Qt.jsxs)("div",{className:"space-y-4",children:[e.total!==void 0&&(0,Qt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qt.jsxs)("div",{children:[(0,Qt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Total"}),(0,Qt.jsx)("p",{className:"text-2xl font-bold",children:w(e.total)})]}),e.change&&(0,Qt.jsxs)("div",{className:B("flex items-center gap-1",e.change.type==="increase"?"text-green-600":e.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[e.change.type==="increase"?(0,Qt.jsx)(Qc,{className:"h-4 w-4"}):e.change.type==="decrease"?(0,Qt.jsx)(gc,{className:"h-4 w-4"}):null,(0,Qt.jsxs)("span",{className:"font-medium",children:[e.change.type!=="neutral"&&(e.change.type==="increase"?"+":"-"),Math.abs(e.change.value),"%"]}),e.change.period&&(0,Qt.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",e.change.period]})]})]}),(0,Qt.jsx)("div",{className:"overflow-hidden",style:{height:`${i}px`},children:N()})]})})}var Fr=D(fe(),1);function dfe({data:e,title:t,variant:r="radial",backgroundVariant:n,gradientDirection:o,showValue:a=!0,showTarget:i=!0,showThresholds:s=!0,showLabels:l=!0,showTrend:c=!0,showPercentage:u=!0,size:d="md",animate:f=!0,strokeWidth:p=12,onGaugeClick:m,...h}){let g=Array.isArray(e)?e:[e],y={sm:{width:120,height:120,fontSize:"text-lg",strokeWidth:8},md:{width:180,height:180,fontSize:"text-2xl",strokeWidth:12},lg:{width:240,height:240,fontSize:"text-3xl",strokeWidth:16},xl:{width:320,height:320,fontSize:"text-4xl",strokeWidth:20}}[d],x=N=>N%1!==0?(Math.round(N*100)/100).toString():N.toString(),w=N=>{let T=N.min??0,M=(N.max??100)-T;return(N.value-T)/M*100},b=(N,T)=>{if(N.thresholds&&N.thresholds.length>0){let M=[...N.thresholds].sort((O,F)=>O.value-F.value);for(let O=M.length-1;O>=0;O--)if(T>=M[O].value)return M[O].color;return M[0].color}let A={success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#3b82f6",neutral:"#6b7280"};return N.status?A[N.status]:T>=75?"#22c55e":T>=50?"#f59e0b":T>=25?"#fb923c":"#ef4444"},C=(N,T)=>{let A=w(N),M=(y.width-y.strokeWidth)/2,O=2*Math.PI*M,F=O-A/100*O,I=b(N,A),k=N.target?(N.target-(N.min??0))/((N.max??100)-(N.min??0))*360:null;return(0,Fr.jsxs)(oe.div,{className:"relative flex flex-col items-center cursor-pointer",onClick:()=>m?.(N),whileHover:{scale:1.02},whileTap:{scale:.98},children:[(0,Fr.jsxs)("svg",{width:y.width,height:y.height,className:"transform -rotate-90",children:[(0,Fr.jsx)("circle",{cx:y.width/2,cy:y.height/2,r:M,fill:"none",stroke:"currentColor",strokeWidth:y.strokeWidth,className:"text-muted/20"}),s&&N.thresholds&&N.thresholds.map((R,E)=>{let _=(R.value/100*360-90)*(Math.PI/180),U=y.width/2+(M-y.strokeWidth)*Math.cos(_),V=y.height/2+(M-y.strokeWidth)*Math.sin(_),L=y.width/2+(M+y.strokeWidth)*Math.cos(_),H=y.height/2+(M+y.strokeWidth)*Math.sin(_);return(0,Fr.jsx)("line",{x1:U,y1:V,x2:L,y2:H,stroke:R.color,strokeWidth:2,opacity:.5},E)}),(0,Fr.jsx)(oe.circle,{cx:y.width/2,cy:y.height/2,r:M,fill:"none",stroke:I,strokeWidth:y.strokeWidth,strokeLinecap:"round",strokeDasharray:O,initial:{strokeDashoffset:O},animate:{strokeDashoffset:F},transition:{duration:f?1:0,ease:"easeOut"}}),i&&k!==null&&(0,Fr.jsx)("g",{transform:`rotate(${k} ${y.width/2} ${y.height/2})`,children:(0,Fr.jsx)("line",{x1:y.width/2,y1:y.strokeWidth,x2:y.width/2,y2:y.strokeWidth+10,stroke:"currentColor",strokeWidth:3,className:"text-primary"})})]}),(0,Fr.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center transform rotate-0",children:[a&&(0,Fr.jsxs)(oe.div,{className:B(y.fontSize,"font-bold"),initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:.3},children:[x(N.value),N.unit&&(0,Fr.jsx)("span",{className:"text-sm ml-1",children:N.unit})]}),u&&(0,Fr.jsxs)("div",{className:"text-sm text-muted-foreground",children:[x(A),"%"]}),l&&(0,Fr.jsx)("div",{className:"text-xs text-muted-foreground mt-1 text-center px-2",children:N.label}),c&&N.trend&&(0,Fr.jsxs)("div",{className:B("flex items-center gap-1 mt-2",N.trend.type==="increase"?"text-green-600":N.trend.type==="decrease"?"text-red-600":"text-gray-600"),children:[N.trend.type==="increase"?(0,Fr.jsx)(va,{className:"h-3 w-3"}):N.trend.type==="decrease"?(0,Fr.jsx)(vc,{className:"h-3 w-3"}):null,(0,Fr.jsxs)("span",{className:"text-xs font-medium",children:[x(N.trend.value),"%"]})]})]})]},T)},S=(N,T)=>{let A=w(N),M=b(N,A);return(0,Fr.jsxs)(oe.div,{className:"w-full space-y-2 cursor-pointer",onClick:()=>m?.(N),whileHover:{scale:1.01},children:[(0,Fr.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Fr.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,Fr.jsx)("span",{className:"text-sm font-medium",children:N.label}),N.status&&(0,Fr.jsx)(dt,{variant:"outline",className:"text-xs",children:N.status})]}),(0,Fr.jsxs)("div",{className:"flex items-center gap-2",children:[a&&(0,Fr.jsxs)("span",{className:B("font-bold",d==="sm"?"text-base":"text-lg"),children:[x(N.value),N.unit&&(0,Fr.jsx)("span",{className:"text-sm ml-1 text-muted-foreground",children:N.unit})]}),u&&(0,Fr.jsxs)("span",{className:"text-sm text-muted-foreground",children:["(",x(A),"%)"]})]})]}),(0,Fr.jsxs)("div",{className:"relative",children:[(0,Fr.jsx)("div",{className:B("w-full rounded-full bg-muted/30 overflow-hidden",d==="sm"?"h-2":d==="md"?"h-3":d==="lg"?"h-4":"h-5"),children:(0,Fr.jsx)(oe.div,{className:"h-full rounded-full",style:{backgroundColor:M},initial:{width:0},animate:{width:`${A}%`},transition:{duration:f?1:0,ease:"easeOut"}})}),s&&N.thresholds&&N.thresholds.map((O,F)=>(0,Fr.jsx)(Ys,{children:(0,Fr.jsxs)(ws,{children:[(0,Fr.jsx)(Cs,{asChild:!0,children:(0,Fr.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-0.5 h-full bg-background",style:{left:`${O.value}%`}})}),(0,Fr.jsx)(ns,{children:(0,Fr.jsx)("p",{children:O.label||`${O.value}%`})})]})},F)),i&&N.target&&(0,Fr.jsx)(Ys,{children:(0,Fr.jsxs)(ws,{children:[(0,Fr.jsx)(Cs,{asChild:!0,children:(0,Fr.jsx)("div",{className:"absolute -top-1 w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[8px] border-t-primary",style:{left:`${(N.target-(N.min??0))/((N.max??100)-(N.min??0))*100}%`,transform:"translateX(-50%)"}})}),(0,Fr.jsx)(ns,{children:(0,Fr.jsxs)("p",{children:["Target: ",x(N.target),N.unit]})})]})})]}),l&&(0,Fr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,Fr.jsx)("span",{children:N.min??0}),(0,Fr.jsx)("span",{children:N.max??100})]})]},T)},P=(N,T)=>{switch(r){case"linear":case"progress":return S(N,T);case"radial":default:return C(N,T)}};return(0,Fr.jsx)(_u,{title:t,variant:n,gradientDirection:o,...h,children:(0,Fr.jsx)("div",{className:B("flex flex-wrap items-center justify-center",r==="linear"||r==="progress"?"flex-col space-y-4":"gap-6","p-4"),children:g.map((N,T)=>P(N,T))})})}var L8=D(ue(),1);var kt=D(fe(),1);function ffe({data:e,title:t,variant:r="vertical",backgroundVariant:n,gradientDirection:o,showValues:a=!0,showPercentages:i=!0,showDropoff:s=!0,showTargets:l=!1,showDuration:c=!1,showConversionRate:u=!0,animate:d=!0,interactive:f=!0,onStageClick:p,...m}){let[h,g]=L8.default.useState(null),v=T=>T%1!==0?(Math.round(T*100)/100).toString():T.toString(),y=L8.default.useMemo(()=>{let T=Math.max(...e.stages.map(A=>A.value));return e.stages.map((A,M)=>{let O=A.percentage??A.value/T*100,F=M>0?e.stages[M-1].value:A.value,I=A.dropoff??F-A.value,k=A.dropoffPercentage??(F>0?(F-A.value)/F*100:0);return{...A,percentage:O,dropoff:I,dropoffPercentage:k}})},[e.stages]),x=(T,A)=>{if(T.color)return T.color;let M=["#3b82f6","#8b5cf6","#ec4899","#f59e0b","#10b981","#06b6d4"];return M[A%M.length]},w=(T,A)=>T.icon?T.icon:[(0,kt.jsx)(Xd,{className:"h-4 w-4"}),(0,kt.jsx)(ZA,{className:"h-4 w-4"}),(0,kt.jsx)(Sv,{className:"h-4 w-4"}),(0,kt.jsx)(Bo,{className:"h-4 w-4"})][A]||(0,kt.jsx)(ep,{className:"h-4 w-4"}),b=T=>e.currency?new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency,minimumFractionDigits:0,maximumFractionDigits:0}).format(T):T>=1e6?`${v(T/1e6)}M`:T>=1e3?`${v(T/1e3)}K`:T.toLocaleString(),C=()=>(0,kt.jsx)("div",{className:"space-y-2",children:y.map((T,A)=>{let M=`${T.percentage}%`,O=x(T,A),F=w(T,A),I=h===T.id;return(0,kt.jsx)(oe.div,{className:B("relative group",f&&"cursor-pointer"),onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:A*.1},children:(0,kt.jsxs)("div",{className:"flex items-center gap-4",children:[(0,kt.jsxs)("div",{className:"flex-1",children:[(0,kt.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,kt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,kt.jsx)("div",{className:"p-1.5 rounded",style:{backgroundColor:`${O}20`},children:(0,kt.jsx)("div",{style:{color:O},children:F})}),(0,kt.jsx)("span",{className:"text-sm font-medium",children:T.name}),T.description&&(0,kt.jsx)(Ys,{children:(0,kt.jsxs)(ws,{children:[(0,kt.jsx)(Cs,{children:(0,kt.jsx)(Nn,{className:"h-3 w-3 text-muted-foreground"})}),(0,kt.jsx)(ns,{children:(0,kt.jsx)("p",{className:"max-w-xs",children:T.description})})]})})]}),(0,kt.jsxs)("div",{className:"flex items-center gap-2",children:[a&&(0,kt.jsx)("span",{className:"text-sm font-bold",children:b(T.value)}),i&&(0,kt.jsxs)(dt,{variant:"outline",className:"text-xs",children:[v(T.percentage),"%"]}),c&&T.duration&&(0,kt.jsx)("span",{className:"text-xs text-muted-foreground",children:T.duration})]})]}),(0,kt.jsxs)("div",{className:"relative",children:[(0,kt.jsx)("div",{className:"h-8 bg-muted/30 rounded overflow-hidden",children:(0,kt.jsx)(oe.div,{className:"h-full rounded transition-all duration-300",style:{backgroundColor:O,opacity:I?1:.8},initial:{width:0},animate:{width:M},transition:{duration:d?.5:0,delay:A*.1}})}),l&&T.target&&(0,kt.jsx)("div",{className:"absolute top-0 bottom-0 w-0.5 bg-foreground/50",style:{left:`${T.target/Math.max(...e.stages.map(k=>k.value))*100}%`},children:(0,kt.jsx)("div",{className:"absolute -top-1 -left-1 w-2 h-2 rounded-full bg-foreground/50"})})]}),A<y.length-1&&(0,kt.jsx)("div",{className:"flex justify-center mt-2 mb-1",children:(0,kt.jsx)(Gf,{className:"h-4 w-4 text-muted-foreground/50"})})]}),s&&A>0&&(0,kt.jsxs)("div",{className:"flex items-center gap-1 text-xs",children:[(0,kt.jsx)(Gf,{className:"h-3 w-3 text-red-500"}),(0,kt.jsxs)("span",{className:"text-red-500 font-medium",children:["-",v(T.dropoffPercentage),"%"]})]})]})},T.id)})}),S=()=>(0,kt.jsx)("div",{className:"flex items-center justify-between",children:y.map((T,A)=>{let M=x(T,A),O=w(T,A),F=h===T.id,I=A===y.length-1;return(0,kt.jsxs)(L8.default.Fragment,{children:[(0,kt.jsxs)(oe.div,{className:B("flex flex-col items-center gap-2 flex-1",f&&"cursor-pointer"),onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:A*.1},children:[(0,kt.jsxs)(oe.div,{className:"relative",whileHover:{scale:1.1},whileTap:{scale:.95},children:[(0,kt.jsx)("div",{className:B("w-16 h-16 rounded-full flex items-center justify-center","border-2 transition-all duration-300"),style:{borderColor:M,backgroundColor:F?`${M}20`:"transparent"},children:(0,kt.jsx)("div",{style:{color:M},children:O})}),(0,kt.jsx)("svg",{className:"absolute inset-0 -rotate-90",width:"64",height:"64",children:(0,kt.jsx)("circle",{cx:"32",cy:"32",r:"30",fill:"none",stroke:M,strokeWidth:"2",strokeDasharray:`${T.percentage*1.88} 188`,opacity:"0.3"})})]}),(0,kt.jsxs)("div",{className:"text-center",children:[(0,kt.jsx)("div",{className:"font-medium text-sm",children:T.name}),a&&(0,kt.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:b(T.value)}),i&&(0,kt.jsxs)(dt,{variant:"outline",className:"text-xs mt-1",children:[v(T.percentage),"%"]})]})]}),!I&&(0,kt.jsx)("div",{className:"flex-shrink-0 px-2",children:(0,kt.jsxs)("div",{className:"relative",children:[(0,kt.jsx)(Ow,{className:"h-5 w-5 text-muted-foreground"}),s&&(0,kt.jsxs)("div",{className:"absolute -top-6 left-1/2 -translate-x-1/2 text-xs text-red-500 whitespace-nowrap",children:["-",v(y[A+1].dropoffPercentage),"%"]})]})})]},T.id)})}),P=()=>(0,kt.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:y.map((T,A)=>{let M=x(T,A),O=w(T,A),F=h===T.id;return(0,kt.jsxs)(oe.div,{className:B("relative p-4 rounded-lg border transition-all",f&&"cursor-pointer hover:shadow-lg",F&&"border-primary"),style:{borderColor:F?M:void 0},onMouseEnter:()=>g(T.id),onMouseLeave:()=>g(null),onClick:()=>f&&p?.(T),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:A*.1},children:[(0,kt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,kt.jsx)("div",{className:"p-2 rounded",style:{backgroundColor:`${M}20`},children:(0,kt.jsx)("div",{style:{color:M},children:O})}),A>0&&s&&(0,kt.jsxs)(dt,{variant:"destructive",className:"text-xs flex items-center gap-1",children:[(0,kt.jsx)(vc,{className:"h-3 w-3"}),v(T.dropoffPercentage),"%"]})]}),(0,kt.jsxs)("div",{className:"space-y-2",children:[(0,kt.jsx)("h4",{className:"font-semibold",children:T.name}),a&&(0,kt.jsx)("div",{className:"text-2xl font-bold",children:b(T.value)}),i&&(0,kt.jsx)(Mo,{value:T.percentage,className:"h-2"}),T.description&&(0,kt.jsx)("p",{className:"text-xs text-muted-foreground",children:T.description}),l&&T.target&&(0,kt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,kt.jsx)("span",{className:"text-muted-foreground",children:"Target"}),(0,kt.jsx)("span",{className:"font-medium",children:b(T.target)})]})]})]},T.id)})}),N=()=>{switch(r){case"steps":return S();case"cards":return P();case"vertical":default:return C()}};return(0,kt.jsx)(_u,{title:t,variant:n,gradientDirection:o,...m,children:(0,kt.jsxs)("div",{className:"space-y-4",children:[u&&(0,kt.jsxs)("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-lg",children:[(0,kt.jsxs)("div",{children:[(0,kt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Overall Conversion Rate"}),(0,kt.jsx)("p",{className:"text-2xl font-bold",children:e.conversionRate?`${v(e.conversionRate)}%`:`${v(y[y.length-1].value/y[0].value*100)}%`})]}),e.comparison&&(0,kt.jsxs)("div",{className:B("flex items-center gap-1",e.comparison.type==="increase"?"text-green-600":"text-red-600"),children:[e.comparison.type==="increase"?(0,kt.jsx)(va,{className:"h-4 w-4"}):(0,kt.jsx)(vc,{className:"h-4 w-4"}),(0,kt.jsxs)("span",{className:"font-medium",children:[e.comparison.type==="increase"?"+":"-",Math.abs(e.comparison.value),"%"]}),(0,kt.jsxs)("span",{className:"text-xs text-muted-foreground",children:["vs ",e.comparison.period]})]})]}),N()]})})}var Yrt=D(ue(),1);var Ke=D(fe(),1);function pfe({data:e,title:t,variant:r="default",showStreams:n=!0,showMetrics:o=!0,showBreakdown:a=!0,showForecast:i=!0,showTimeline:s=!1,showTopProducts:l=!1,showCustomerMetrics:c=!1,animate:u=!0,onStreamClick:d,onMetricClick:f,...p}){let[m,h]=Yrt.default.useState("overview"),g=F=>F%1!==0?(Math.round(F*100)/100).toString():F.toString(),y=(F=>{switch(F){case"EUR":return"\u20AC";case"GBP":return"\xA3";case"USD":default:return"$"}})(e.currency),x=F=>{switch(F){case"EUR":return(0,Ke.jsx)(hA,{className:"h-5 w-5"});case"GBP":return(0,Ke.jsx)(jA,{className:"h-5 w-5"});case"USD":default:return(0,Ke.jsx)(Fw,{className:"h-5 w-5"})}},w=F=>new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency||"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(F),b=F=>F>=1e6?`${y}${g(F/1e6)}M`:F>=1e3?`${y}${g(F/1e3)}K`:`${y}${g(F)}`,C=e.target?e.total/e.target.value*100:0,S=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#ec4899"],P=(F,I)=>F.color?F.color:S[I%S.length],N=()=>(0,Ke.jsxs)("div",{className:"space-y-4",children:[(0,Ke.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ke.jsx)("div",{className:"space-y-1",children:(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("div",{className:B("p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"),children:x(e.currency)}),(0,Ke.jsxs)("div",{children:[(0,Ke.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Total Revenue ",e.period&&`(${e.period})`]}),(0,Ke.jsx)(oe.p,{className:"text-3xl font-bold",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{duration:u?.3:0},children:w(e.total)})]})]})}),e.change&&(0,Ke.jsxs)(oe.div,{className:B("flex items-center gap-1",e.change.type==="increase"?"text-green-600":e.change.type==="decrease"?"text-red-600":"text-gray-600"),initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.1},children:[e.change.type==="increase"?(0,Ke.jsx)(Qc,{className:"h-5 w-5"}):e.change.type==="decrease"?(0,Ke.jsx)(gc,{className:"h-5 w-5"}):null,(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsxs)("p",{className:"text-lg font-bold",children:[e.change.type!=="neutral"&&(e.change.type==="increase"?"+":"-"),Math.abs(e.change.value),"%"]}),e.change.period&&(0,Ke.jsxs)("p",{className:"text-xs text-muted-foreground",children:["vs ",e.change.period]})]})]})]}),e.target&&(0,Ke.jsxs)("div",{className:"space-y-2",children:[(0,Ke.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,Ke.jsx)("span",{className:"text-muted-foreground",children:e.target.label||"Target"}),(0,Ke.jsxs)("span",{className:"font-medium",children:[g(C),"% of ",w(e.target.value)]})]}),(0,Ke.jsx)(Mo,{value:C,className:"h-2"})]}),i&&e.forecast&&(0,Ke.jsxs)("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-lg",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(va,{className:"h-4 w-4 text-muted-foreground"}),(0,Ke.jsx)("span",{className:"text-sm text-muted-foreground",children:e.forecast.label||"Forecast"})]}),(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsx)("p",{className:"font-semibold",children:w(e.forecast.value)}),e.forecast.confidence&&(0,Ke.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.forecast.confidence,"% confidence"]})]})]})]}),T=()=>{if(!e.streams||e.streams.length===0)return null;let F=e.streams.reduce((I,k)=>I+k.amount,0);return(0,Ke.jsxs)("div",{className:"space-y-3",children:[(0,Ke.jsx)("h4",{className:"text-sm font-medium text-muted-foreground",children:"Revenue Streams"}),e.streams.map((I,k)=>{let R=I.percentage??I.amount/F*100,E=P(I,k);return(0,Ke.jsxs)(oe.div,{className:B("space-y-2",d&&"cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"),onClick:()=>d?.(I),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:k*.05},children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E}}),(0,Ke.jsx)("span",{className:"text-sm font-medium",children:I.name}),I.icon&&(0,Ke.jsx)("div",{className:"text-muted-foreground",children:I.icon})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(I.amount)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(R),"%"]}),I.change&&(0,Ke.jsxs)("div",{className:B("flex items-center gap-0.5 text-xs",I.change.type==="increase"?"text-green-600":I.change.type==="decrease"?"text-red-600":"text-gray-600"),children:[I.change.type==="increase"?(0,Ke.jsx)(Qc,{className:"h-3 w-3"}):I.change.type==="decrease"?(0,Ke.jsx)(gc,{className:"h-3 w-3"}):null,Math.abs(I.change.value),"%"]})]})]}),(0,Ke.jsx)("div",{className:"relative h-2 bg-muted/30 rounded-full overflow-hidden",children:(0,Ke.jsx)(oe.div,{className:"h-full rounded-full",style:{backgroundColor:E},initial:{width:0},animate:{width:`${R}%`},transition:{duration:u?.5:0,delay:k*.05}})})]},I.id)})]})},A=()=>{if(!e.breakdown)return null;let F=e.breakdown.recurring+e.breakdown.oneTime+(e.breakdown.refunds||0),I=e.breakdown.recurring/F*100,k=e.breakdown.oneTime/F*100,R=e.breakdown.refunds?e.breakdown.refunds/F*100:0;return(0,Ke.jsxs)("div",{className:"space-y-3",children:[(0,Ke.jsx)("h4",{className:"text-sm font-medium text-muted-foreground",children:"Revenue Breakdown"}),(0,Ke.jsxs)("div",{className:"space-y-2",children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(Ah,{className:"h-4 w-4 text-blue-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"Recurring"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(e.breakdown.recurring)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(I),"%"]})]})]}),(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(Sv,{className:"h-4 w-4 text-green-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"One-time"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)("span",{className:"text-sm font-semibold",children:b(e.breakdown.oneTime)}),(0,Ke.jsxs)(dt,{variant:"outline",className:"text-xs",children:[g(k),"%"]})]})]}),e.breakdown.refunds&&(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsx)(gc,{className:"h-4 w-4 text-red-600"}),(0,Ke.jsx)("span",{className:"text-sm",children:"Refunds"})]}),(0,Ke.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ke.jsxs)("span",{className:"text-sm font-semibold text-red-600",children:["-",b(Math.abs(e.breakdown.refunds))]}),(0,Ke.jsxs)(dt,{variant:"destructive",className:"text-xs",children:[g(R),"%"]})]})]})]}),(0,Ke.jsxs)("div",{className:"h-3 flex rounded-full overflow-hidden",children:[(0,Ke.jsx)(oe.div,{className:"bg-blue-600",initial:{width:0},animate:{width:`${I}%`},transition:{duration:u?.5:0}}),(0,Ke.jsx)(oe.div,{className:"bg-green-600",initial:{width:0},animate:{width:`${k}%`},transition:{duration:u?.5:0,delay:.1}}),e.breakdown.refunds&&(0,Ke.jsx)(oe.div,{className:"bg-red-600",initial:{width:0},animate:{width:`${R}%`},transition:{duration:u?.5:0,delay:.2}})]})]})},M=()=>{if(!e.customerMetrics)return null;let F=[{label:"ARPU (Average Revenue Per User)",value:w(e.customerMetrics.arpu||0),icon:(0,Ke.jsx)(Xd,{className:"h-4 w-4"}),description:"Average revenue generated per user"},{label:"LTV (Lifetime Value)",value:w(e.customerMetrics.ltv||0),icon:(0,Ke.jsx)(va,{className:"h-4 w-4"}),description:"Expected revenue from customer over their lifetime"},{label:"CAC (Customer Acquisition Cost)",value:w(e.customerMetrics.cac||0),icon:(0,Ke.jsx)(QA,{className:"h-4 w-4"}),description:"Cost to acquire one new customer"},{label:"Churn Rate",value:`${g(e.customerMetrics.churnRate||0)}%`,icon:(0,Ke.jsx)(vc,{className:"h-4 w-4"}),description:"Percentage of customers lost per period"},{label:"Retention Rate",value:`${g(e.customerMetrics.retentionRate||0)}%`,icon:(0,Ke.jsx)(Ah,{className:"h-4 w-4"}),description:"Percentage of customers retained"}],I=(e.customerMetrics.ltv||0)/(e.customerMetrics.cac||1);return(0,Ke.jsxs)("div",{className:"space-y-6",children:[(0,Ke.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:F.map((k,R)=>(0,Ke.jsx)(Ys,{children:(0,Ke.jsxs)(ws,{children:[(0,Ke.jsx)(Cs,{asChild:!0,children:(0,Ke.jsx)(oe.div,{className:"p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors cursor-help",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:R*.1},children:(0,Ke.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ke.jsx)("div",{className:"text-muted-foreground",children:k.icon}),(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)("p",{className:"text-xs text-muted-foreground",children:k.label}),(0,Ke.jsx)("p",{className:"text-lg font-semibold",children:k.value})]})]})})}),(0,Ke.jsx)(ns,{children:(0,Ke.jsx)("p",{children:k.description})})]})},R))}),(0,Ke.jsxs)("div",{className:"p-4 rounded-lg border bg-card",children:[(0,Ke.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)("p",{className:"text-sm text-muted-foreground",children:"LTV/CAC Ratio"}),(0,Ke.jsx)("p",{className:"text-2xl font-bold",children:g(I)})]}),(0,Ke.jsxs)("div",{className:"text-right",children:[(0,Ke.jsx)(dt,{variant:I>=3?"primary":I>=2?"secondary":"destructive",className:"text-xs",children:I>=3?"Excellent":I>=2?"Good":"Needs Improvement"}),(0,Ke.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Target: 3:1 or higher"})]})]}),(0,Ke.jsxs)("div",{className:"mt-3",children:[(0,Ke.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:"Ratio Progress"}),(0,Ke.jsx)(Mo,{value:Math.min(100,I/5*100),className:"h-2"})]})]})]})};return(0,Ke.jsx)(_u,{title:t,...p,children:(()=>{switch(r){case"compact":return(0,Ke.jsx)("div",{className:"space-y-4",children:N()});case"detailed":return(0,Ke.jsxs)(Sl,{value:m,onValueChange:h,children:[(0,Ke.jsxs)(el,{className:"grid grid-cols-3 w-full",children:[(0,Ke.jsx)(Dn,{value:"overview",children:"Overview"}),(0,Ke.jsx)(Dn,{value:"streams",children:"Streams"}),(0,Ke.jsx)(Dn,{value:"metrics",children:"Metrics"})]}),(0,Ke.jsxs)(Xn,{value:"overview",className:"space-y-4",children:[N(),a&&A()]}),(0,Ke.jsx)(Xn,{value:"streams",className:"space-y-4",children:T()}),(0,Ke.jsx)(Xn,{value:"metrics",className:"space-y-4",children:M()})]});case"dashboard":return(0,Ke.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Ke.jsxs)("div",{className:"space-y-4",children:[N(),a&&A()]}),(0,Ke.jsx)("div",{className:"space-y-4",children:n&&T()})]});case"default":default:return(0,Ke.jsxs)("div",{className:"space-y-6",children:[N(),n&&T(),a&&A()]})}})()})}var E8=D(ue(),1);var je=D(fe(),1);function mfe({data:e,title:t,variant:r="default",backgroundVariant:n,gradientDirection:o,showMetrics:a=!0,showAlerts:i=!0,showServices:s=!1,showHistory:l=!1,showUptime:c=!0,updateInterval:u=30,animate:d=!0,onServerClick:f,onAlertClick:p,...m}){let h=Array.isArray(e)?e:[e],[g,v]=E8.default.useState("overview"),[y,x]=E8.default.useState(h),w=O=>typeof O=="string"?O:O%1!==0?(Math.round(O*100)/100).toString():O.toString();E8.default.useEffect(()=>{if(!d)return;let O=setInterval(()=>{x(F=>F.map(I=>({...I,lastUpdated:new Date,metrics:{...I.metrics,cpu:I.metrics.cpu?{...I.metrics.cpu,value:Math.min(100,Math.max(0,I.metrics.cpu.value+(Math.random()-.5)*10))}:void 0,memory:I.metrics.memory?{...I.metrics.memory,value:Math.min(100,Math.max(0,I.metrics.memory.value+(Math.random()-.5)*5))}:void 0}})))},u*1e3);return()=>clearInterval(O)},[u,d]);let b=O=>{switch(O){case"online":case"healthy":case"running":return"text-green-600 dark:text-green-400";case"warning":case"degraded":return"text-yellow-600 dark:text-yellow-400";case"critical":case"error":case"offline":case"stopped":return"text-red-600 dark:text-red-400";case"maintenance":return"text-blue-600 dark:text-blue-400";default:return"text-gray-600 dark:text-gray-400"}},C=O=>{switch(O){case"online":case"healthy":case"running":return(0,je.jsx)(Bo,{className:"h-4 w-4"});case"warning":case"degraded":return(0,je.jsx)(ya,{className:"h-4 w-4"});case"critical":case"error":case"offline":case"stopped":return(0,je.jsx)(lo,{className:"h-4 w-4"});case"maintenance":return(0,je.jsx)(yn,{className:"h-4 w-4"});default:return(0,je.jsx)(Nn,{className:"h-4 w-4"})}},S=O=>{switch(O){case"database":return(0,je.jsx)(mA,{className:"h-5 w-5"});case"cache":return(0,je.jsx)(Mh,{className:"h-5 w-5"});case"storage":return(0,je.jsx)(Rv,{className:"h-5 w-5"});case"compute":return(0,je.jsx)(Xf,{className:"h-5 w-5"});case"web":default:return(0,je.jsx)($w,{className:"h-5 w-5"})}},P=O=>{if(O.status)return O.status;let F=O.value,I=O.max||100,k=F/I*100;return k>=90?"critical":k>=75?"warning":"healthy"},N=(O,F)=>{let I=O.value,k=O.max||100,R=I/k*100,E=P(O),_={healthy:"bg-green-600",warning:"bg-yellow-600",critical:"bg-red-600",offline:"bg-gray-600"};return(0,je.jsxs)("div",{className:"space-y-2",children:[(0,je.jsxs)("div",{className:"flex items-center justify-between",children:[(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)("div",{className:"text-muted-foreground",children:F}),(0,je.jsx)("span",{className:"text-sm font-medium",children:O.label}),O.trend&&(0,je.jsx)("div",{className:B("text-xs",O.trend==="up"?"text-green-600":O.trend==="down"?"text-red-600":"text-gray-600"),children:O.trend==="up"?(0,je.jsx)(va,{className:"h-3 w-3"}):O.trend==="down"?(0,je.jsx)(vc,{className:"h-3 w-3"}):null})]}),(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsxs)("span",{className:"text-sm font-semibold",children:[w(I),O.unit||"%"]}),k&&k!==100&&(0,je.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",w(k),O.unit]})]})]}),(0,je.jsxs)("div",{className:"relative",children:[(0,je.jsx)(Mo,{value:R,className:"h-2"}),(0,je.jsx)(oe.div,{className:B("absolute top-0 left-0 h-2 rounded-full",_[E]),initial:{width:0},animate:{width:`${R}%`},transition:{duration:d?.5:0}})]}),l&&O.history&&O.history.length>0&&(0,je.jsx)("div",{className:"flex items-end gap-0.5 h-8",children:O.history.slice(-20).map((U,V)=>(0,je.jsx)(oe.div,{className:B("flex-1 rounded-t",U>75?"bg-red-600/50":U>50?"bg-yellow-600/50":"bg-green-600/50"),initial:{height:0},animate:{height:`${U/100*32}px`},transition:{delay:V*.01}},V))})]})},T=O=>{let F=O.status==="online",I=O.metrics;return(0,je.jsxs)(Ve,{className:B("p-4 transition-all",f&&"cursor-pointer hover:shadow-lg",!F&&"opacity-75"),onClick:()=>f?.(O),children:[(0,je.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,je.jsxs)("div",{className:"flex items-center gap-3",children:[(0,je.jsx)("div",{className:B("p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"),children:S(O.type)}),(0,je.jsxs)("div",{children:[(0,je.jsx)("h4",{className:"font-semibold",children:O.name}),O.location&&(0,je.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,je.jsx)(kv,{className:"h-3 w-3"}),O.location]})]})]}),(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)(dt,{variant:F?"secondary":"destructive",leftIcon:F?(0,je.jsx)(Bo,{className:"h-3 w-3"}):(0,je.jsx)(lo,{className:"h-3 w-3"}),children:O.status}),F?(0,je.jsx)(uL,{className:"h-4 w-4 text-green-600"}):(0,je.jsx)(cL,{className:"h-4 w-4 text-red-600"})]})]}),c&&O.uptime!==void 0&&(0,je.jsxs)("div",{className:"mb-4",children:[(0,je.jsxs)("div",{className:"flex justify-between text-sm mb-1",children:[(0,je.jsx)("span",{className:"text-muted-foreground",children:"Uptime"}),(0,je.jsxs)("span",{className:"font-medium",children:[w(O.uptime),"%"]})]}),(0,je.jsx)(Mo,{value:O.uptime,className:"h-1"})]}),a&&(0,je.jsxs)("div",{className:"space-y-3",children:[I.cpu&&N(I.cpu,(0,je.jsx)(Xf,{className:"h-4 w-4"})),I.memory&&N(I.memory,(0,je.jsx)(Mh,{className:"h-4 w-4"})),I.disk&&N(I.disk,(0,je.jsx)(Rv,{className:"h-4 w-4"})),I.network&&N(I.network,(0,je.jsx)(Gx,{className:"h-4 w-4"})),I.temperature&&N(I.temperature,(0,je.jsx)(rL,{className:"h-4 w-4"}))]}),I.requests||I.responseTime||I.errorRate?(0,je.jsxs)("div",{className:"grid grid-cols-3 gap-2 mt-4 pt-4 border-t",children:[I.requests&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Requests"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.requests.value),"/s"]})]}),I.responseTime&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Response"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.responseTime.value),"ms"]})]}),I.errorRate&&(0,je.jsxs)("div",{className:"text-center",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Errors"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(I.errorRate.value),"%"]})]})]}):null,i&&O.alerts&&O.alerts.length>0&&(0,je.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,je.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,je.jsx)("span",{className:"text-sm font-medium",children:"Recent Alerts"}),(0,je.jsx)(dt,{variant:"outline",className:"text-xs",children:O.alerts.length})]}),(0,je.jsx)("div",{className:"space-y-1",children:O.alerts.slice(0,3).map(k=>(0,je.jsxs)("div",{className:B("text-xs p-2 rounded flex items-start gap-2",k.type==="error"?"bg-red-100 dark:bg-red-900/20":k.type==="warning"?"bg-yellow-100 dark:bg-yellow-900/20":"bg-blue-100 dark:bg-blue-900/20",p&&"cursor-pointer hover:opacity-80"),onClick:R=>{R.stopPropagation(),p?.(k)},children:[k.type==="error"?(0,je.jsx)(lo,{className:"h-3 w-3 text-red-600 flex-shrink-0"}):k.type==="warning"?(0,je.jsx)(ya,{className:"h-3 w-3 text-yellow-600 flex-shrink-0"}):(0,je.jsx)(Nn,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),(0,je.jsx)("span",{className:"flex-1",children:k.message})]},k.id))})]}),O.lastUpdated&&(0,je.jsxs)("div",{className:"mt-4 pt-4 border-t flex items-center justify-between text-xs text-muted-foreground",children:[(0,je.jsx)("span",{children:"Last updated"}),(0,je.jsx)("span",{children:new Date(O.lastUpdated).toLocaleTimeString()})]})]})},A=()=>(0,je.jsx)("div",{className:"space-y-2",children:y.map((O,F)=>(0,je.jsxs)(oe.div,{className:B("flex items-center justify-between p-3 rounded-lg border",f&&"cursor-pointer hover:bg-muted/30 transition-colors"),onClick:()=>f?.(O),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:F*.05},children:[(0,je.jsxs)("div",{className:"flex items-center gap-3",children:[S(O.type),(0,je.jsxs)("div",{children:[(0,je.jsxs)("div",{className:"flex items-center gap-2",children:[(0,je.jsx)("span",{className:"font-medium",children:O.name}),(0,je.jsx)(dt,{variant:O.status==="online"?"secondary":"destructive",className:"text-xs",leftIcon:O.status==="online"?(0,je.jsx)(Bo,{className:"h-3 w-3"}):(0,je.jsx)(lo,{className:"h-3 w-3"}),children:O.status})]}),O.location&&(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:O.location})]})]}),(0,je.jsxs)("div",{className:"flex items-center gap-4",children:[O.metrics.cpu&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"CPU"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.metrics.cpu.value),"%"]})]}),O.metrics.memory&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Memory"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.metrics.memory.value),O.metrics.memory.unit||"%"]})]}),c&&O.uptime!==void 0&&(0,je.jsxs)("div",{className:"text-right",children:[(0,je.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uptime"}),(0,je.jsxs)("p",{className:"text-sm font-semibold",children:[w(O.uptime),"%"]})]})]})]},O.id))});return(0,je.jsx)(_u,{title:t,variant:n,gradientDirection:o,...m,children:(0,je.jsx)(Bt,{mode:"wait",children:(()=>{switch(r){case"compact":return A();case"grid":return(0,je.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:y.map(O=>(0,je.jsx)("div",{children:T(O)},O.id))});case"detailed":return(0,je.jsxs)(Sl,{value:g,onValueChange:v,children:[(0,je.jsxs)(el,{className:"grid grid-cols-3 w-full",children:[(0,je.jsx)(Dn,{value:"overview",children:"Overview"}),(0,je.jsx)(Dn,{value:"metrics",children:"Metrics"}),(0,je.jsx)(Dn,{value:"alerts",children:"Alerts"})]}),y.map(O=>(0,je.jsxs)("div",{children:[(0,je.jsx)(Xn,{value:"overview",children:T(O)}),(0,je.jsx)(Xn,{value:"metrics",className:"space-y-4",children:(0,je.jsx)("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(O.metrics).map(([F,I])=>!I||F==="custom"||Array.isArray(I)?null:(0,je.jsx)(Ve,{className:"p-4",children:N(I,F==="cpu"?(0,je.jsx)(Xf,{className:"h-4 w-4"}):F==="memory"?(0,je.jsx)(Mh,{className:"h-4 w-4"}):F==="disk"?(0,je.jsx)(Rv,{className:"h-4 w-4"}):F==="network"?(0,je.jsx)(Gx,{className:"h-4 w-4"}):(0,je.jsx)(ha,{className:"h-4 w-4"}))},F))})}),(0,je.jsx)(Xn,{value:"alerts",children:O.alerts&&O.alerts.length>0?(0,je.jsx)("div",{className:"space-y-2",children:O.alerts.map(F=>(0,je.jsxs)("div",{className:B("p-3 rounded-lg flex items-start gap-3",F.type==="error"?"bg-red-100 dark:bg-red-900/20":F.type==="warning"?"bg-yellow-100 dark:bg-yellow-900/20":"bg-blue-100 dark:bg-blue-900/20",p&&"cursor-pointer hover:opacity-80"),onClick:()=>p?.(F),children:[F.type==="error"?(0,je.jsx)(lo,{className:"h-5 w-5 text-red-600"}):F.type==="warning"?(0,je.jsx)(ya,{className:"h-5 w-5 text-yellow-600"}):(0,je.jsx)(Nn,{className:"h-5 w-5 text-blue-600"}),(0,je.jsxs)("div",{className:"flex-1",children:[(0,je.jsx)("p",{className:"font-medium",children:F.message}),(0,je.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(F.timestamp).toLocaleString()})]})]},F.id))}):(0,je.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,je.jsx)(Bo,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),(0,je.jsx)("p",{children:"No active alerts"})]})})]},O.id))]});case"default":default:return(0,je.jsx)("div",{className:"space-y-4",children:y.map(O=>(0,je.jsx)("div",{children:T(O)},O.id))})}})()})})}return wfe(Uur);})();
|
|
416
416
|
/*! Bundled license information:
|
|
417
417
|
|
|
418
418
|
react/cjs/react.production.min.js:
|