renderloom 1.0.12 → 1.0.14

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.
@@ -177,7 +177,7 @@ React keys must be passed directly to JSX without using spread:
177
177
  ${y}px !important;
178
178
  ${T}px !important;
179
179
  }
180
- `),()=>{var z;(z=a.current)==null||z.removeAttribute("data-motion-pop-id"),E.contains(S)&&E.removeChild(S)}},[t]),l.jsx(zu,{isPresent:t,childRef:a,sizeRef:c,pop:o,children:o===!1?e:vt.cloneElement(e,{ref:f})})}const Ou=({children:e,initial:t,isPresent:s,onExitComplete:n,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:d})=>{const u=ls(Fu),f=b.useId();let h=!0,m=b.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:s,custom:r,onExitComplete:g=>{u.set(g,!0);for(const p of u.values())if(!p)return;n&&n()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[s,u,n]);return o&&h&&(m={...m}),b.useMemo(()=>{u.forEach((g,p)=>u.set(p,!1))},[s]),vt.useEffect(()=>{!s&&!u.size&&n&&n()},[s]),e=l.jsx(_u,{pop:i==="popLayout",isPresent:s,anchorX:a,anchorY:c,root:d,children:e}),l.jsx(Tt.Provider,{value:m,children:e})};function Fu(){return new Map}function yo(e=!0){const t=b.useContext(Tt);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:r}=t,o=b.useId();b.useEffect(()=>{if(e)return r(o)},[e]);const i=b.useCallback(()=>e&&n&&n(o),[o,n,e]);return!s&&n?[!1,i]:[!0]}const Yt=e=>e.key||"";function bo(e){const t=[];return b.Children.forEach(e,s=>{b.isValidElement(s)&&t.push(s)}),t}const oe=({children:e,custom:t,initial:s=!0,onExitComplete:n,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:d})=>{const[u,f]=yo(i),h=b.useMemo(()=>bo(e),[e]),m=i&&!u?[]:h.map(Yt),g=b.useRef(!0),p=b.useRef(h),x=ls(()=>new Map),k=b.useRef(new Set),[v,y]=b.useState(h),[T,S]=b.useState(h);Fn(()=>{g.current=!1,p.current=h;for(let j=0;j<T.length;j++){const V=Yt(T[j]);m.includes(V)?(x.delete(V),k.current.delete(V)):x.get(V)!==!0&&x.set(V,!1)}},[T,m.length,m.join("-")]);const E=[];if(h!==v){let j=[...h];for(let V=0;V<T.length;V++){const D=T[V],O=Yt(D);m.includes(O)||(j.splice(V,0,D),E.push(D))}return o==="wait"&&E.length&&(j=E),S(bo(j)),y(h),null}process.env.NODE_ENV!=="production"&&o==="wait"&&T.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:z}=b.useContext(as);return l.jsx(l.Fragment,{children:T.map(j=>{const V=Yt(j),D=i&&!u?!1:h===T||m.includes(V),O=()=>{if(k.current.has(V))return;if(x.has(V))k.current.add(V),x.set(V,!0);else return;let $=!0;x.forEach(de=>{de||($=!1)}),$&&(z==null||z(),S(p.current),i&&(f==null||f()),n&&n())};return l.jsx(Ou,{isPresent:D,initial:!g.current||s?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:d,onExitComplete:D?void 0:O,anchorX:a,anchorY:c,children:j},V)})})},vo=b.createContext({strict:!1}),wo={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"]};let ko=!1;function Bu(){if(ko)return;const e={};for(const t in wo)e[t]={isEnabled:s=>wo[t].some(n=>!!s[n])};pi(e),ko=!0}function jo(){return Bu(),Sd()}function $u(e){const t=jo();for(const s in e)t[s]={...t[s],...e[s]};pi(t)}const Wu=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","propagate","ignoreStrict","viewport"]);function Kt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Wu.has(e)}let To=e=>!Kt(e);function Uu(e){typeof e=="function"&&(To=t=>t.startsWith("on")?!Kt(t):e(t))}try{Uu(require("@emotion/is-prop-valid").default)}catch{}function Gu(e,t,s){const n={};for(const r in e)r==="values"&&typeof e.values=="object"||ie(e[r])||(To(r)||s===!0&&Kt(r)||!t&&!Kt(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}const Ht=b.createContext({});function Yu(e,t){if(Ot(e)){const{initial:s,animate:n}=e;return{initial:s===!1||ft(s)?s:void 0,animate:ft(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ku(e){const{initial:t,animate:s}=Yu(e,b.useContext(Ht));return b.useMemo(()=>({initial:t,animate:s}),[So(t),So(s)])}function So(e){return Array.isArray(e)?e.join(" "):e}const pn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function No(e,t,s){for(const n in t)!ie(t[n])&&!Ai(n,s)&&(e[n]=t[n])}function Hu({transformTemplate:e},t){return b.useMemo(()=>{const s=pn();return an(s,t,e),Object.assign({},s.vars,s.style)},[t])}function Xu(e,t){const s=e.style||{},n={};return No(n,s,e),Object.assign(n,Hu(e,t)),n}function qu(e,t){const s={},n=Xu(e,t);return e.drag&&e.dragListener!==!1&&(s.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)&&(s.tabIndex=0),s.style=n,s}const Co=()=>({...pn(),attrs:{}});function Zu(e,t,s,n){const r=b.useMemo(()=>{const o=Co();return Mi(o,t,Vi(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};No(o,e.style,e),r.style={...o,...r.style}}return r}const Ju=["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 gn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ju.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qu(e,t,s,{latestValues:n},r,o=!1,i){const c=(i??gn(e)?Zu:qu)(t,n,r,e),d=Gu(t,typeof e=="string",o),u=e!==b.Fragment?{...d,...c,ref:s}:{},{children:f}=t,h=b.useMemo(()=>ie(f)?f.get():f,[f]);return b.createElement(e,{...u,children:h})}function ef({scrapeMotionValuesFromProps:e,createRenderState:t},s,n,r){return{latestValues:tf(s,n,r,e),renderState:t()}}function tf(e,t,s,n){const r={},o=n(e,{});for(const h in o)r[h]=Ut(o[h]);let{initial:i,animate:a}=e;const c=Ot(e),d=fi(e);t&&d&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=s?s.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!_t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const g=$s(e,h[m]);if(g){const{transitionEnd:p,transition:x,...k}=g;for(const v in k){let y=k[v];if(Array.isArray(y)){const T=u?y.length-1:0;y=y[T]}y!==null&&(r[v]=y)}for(const v in p)r[v]=p[v]}}}return r}const Po=e=>(t,s)=>{const n=b.useContext(Ht),r=b.useContext(Tt),o=()=>ef(e,t,n,r);return s?o():ls(o)},sf=Po({scrapeMotionValuesFromProps:cn,createRenderState:pn}),nf=Po({scrapeMotionValuesFromProps:Di,createRenderState:Co}),rf=Symbol.for("motionComponentSymbol");function of(e,t,s){const n=b.useRef(s);b.useInsertionEffect(()=>{n.current=s});const r=b.useRef(null);return b.useCallback(o=>{var a;o&&((a=e.onMount)==null||a.call(e,o));const i=n.current;if(typeof i=="function")if(o){const c=i(o);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const Ao=b.createContext({});function tt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function af(e,t,s,n,r,o){var y,T;const{visualElement:i}=b.useContext(Ht),a=b.useContext(vo),c=b.useContext(Tt),d=b.useContext(mn),u=d.reducedMotion,f=d.skipAnimations,h=b.useRef(null),m=b.useRef(!1);n=n||a.renderer,!h.current&&n&&(h.current=n(e,{visualState:t,parent:i,props:s,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:o}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,p=b.useContext(Ao);g&&!g.projection&&r&&(g.type==="html"||g.type==="svg")&&lf(h.current,s,r,p);const x=b.useRef(!1);b.useInsertionEffect(()=>{g&&x.current&&g.update(s,c)});const k=s[Gr],v=b.useRef(!!k&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,k))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,k)));return Fn(()=>{m.current=!0,g&&(x.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),v.current&&g.animationState&&g.animationState.animateChanges())}),b.useEffect(()=>{g&&(!v.current&&g.animationState&&g.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,k)}),v.current=!1),g.enteringChildren=void 0)}),g}function lf(e,t,s,n){const{layoutId:r,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:d,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:Mo(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||a&&tt(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:c,layoutRoot:d,layoutAnchor:u})}function Mo(e){if(e)return e.options.allowProjection!==!1?e.projection:Mo(e.parent)}function xn(e,{forwardMotionProps:t=!1,type:s}={},n,r){n&&$u(n);const o=s?s==="svg":gn(e),i=o?nf:sf;function a(d,u){let f;const h={...b.useContext(mn),...d,layoutId:cf(d)},{isStatic:m}=h,g=Ku(d),p=i(d,m);if(!m&&typeof window<"u"){df(h,n);const x=uf(h);f=x.MeasureLayout,g.visualElement=af(e,p,h,r,x.ProjectionNode,o)}return l.jsxs(Ht.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,Qu(e,d,of(p,g.visualElement,u),p,m,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=b.forwardRef(a);return c[rf]=e,c}function cf({layoutId:e}){const t=b.useContext(as).id;return t&&e!==void 0?t+"-"+e:e}function df(e,t){const s=b.useContext(vo).strict;if(process.env.NODE_ENV!=="production"&&t&&s){const n="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ge(!1,n,"lazy-strict-mode"):Te(!1,n,"lazy-strict-mode")}}function uf(e){const t=jo(),{drag:s,layout:n}=t;if(!s&&!n)return{};const r={...s,...n};return{MeasureLayout:s!=null&&s.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ff(e,t){if(typeof Proxy>"u")return xn;const s=new Map,n=(o,i)=>xn(o,i,e,t),r=(o,i)=>(process.env.NODE_ENV!=="production"&&fs(!1,"motion() is deprecated. Use motion.create() instead."),n(o,i));return new Proxy(r,{get:(o,i)=>i==="create"?n:(s.has(i)||s.set(i,xn(i,void 0,e,t)),s.get(i))})}const hf=(e,t)=>t.isSVG??gn(e)?new $d(t):new Id(t,{allowProjection:e!==b.Fragment});class mf extends De{constructor(t){super(t),t.animationState||(t.animationState=Kd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let pf=0;class gf extends De{constructor(){super(...arguments),this.id=pf++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Oe(this.node,i,a);if(c){const{transition:d,transitionEnd:u,...f}=c;for(const h in f)(o=this.node.getValue(h))==null||o.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!t);s&&!t&&r.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const xf={animation:{Feature:mf},exit:{Feature:gf}};function gt(e){return{point:{x:e.pageX,y:e.pageY}}}const yf=e=>t=>Zs(t)&&e(t,gt(t));function xt(e,t,s,n){return pt(e,t,yf(s),n)}const Eo=({current:e})=>e?e.ownerDocument.defaultView:null,Vo=(e,t)=>Math.abs(e-t);function bf(e,t){const s=Vo(e.x,t.x),n=Vo(e.y,t.y);return Math.sqrt(s**2+n**2)}const Do=new Set(["auto","scroll"]);class Lo{constructor(t,s,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Xt(this.lastRawMoveEventInfo,this.transformPagePoint));const m=yn(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,p=bf(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!p)return;const{point:x}=m,{timestamp:k}=re;this.history.push({...x,timestamp:k});const{onStart:v,onMove:y}=this.handlers;g||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Xt(g,this.transformPagePoint),F.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:p,onSessionEnd:x,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=yn(m.type==="pointercancel"?this.lastMoveEventInfo:Xt(g,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,v),x&&x(m,v)},!Zs(t))return;this.dragSnapToOrigin=o,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=r||window;const c=gt(t),d=Xt(c,this.transformPagePoint),{point:u}=d,{timestamp:f}=re;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=s;h&&h(t,yn(d,this.history)),this.removeListeners=it(xt(this.contextWindow,"pointermove",this.handlePointerMove),xt(this.contextWindow,"pointerup",this.handlePointerUp),xt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let s=t.parentElement;for(;s;){const n=getComputedStyle(s);(Do.has(n.overflowX)||Do.has(n.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const n=t===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-s.x,y:r.y-s.y};o.x===0&&o.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),F.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ae(this.updatePoint)}}function Xt(e,t){return t?{point:t(e.point)}:e}function Ro(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yn({point:e},t){return{point:e,delta:Ro(e,Io(t)),offset:Ro(e,vf(t)),velocity:wf(t,.1)}}function vf(e){return e[0]}function Io(e){return e[e.length-1]}function wf(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const r=Io(e);for(;s>=0&&(n=e[s],!(r.timestamp-n.timestamp>ue(t)));)s--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&r.timestamp-n.timestamp>ue(t)*2&&(n=e[1]);const o=he(r.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const i={x:(r.x-n.x)/o,y:(r.y-n.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function kf(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?W(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?W(s,e,n.max):Math.min(e,s)),e}function zo(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function jf(e,{top:t,left:s,bottom:n,right:r}){return{x:zo(e.x,s,r),y:zo(e.y,t,n)}}function _o(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function Tf(e,t){return{x:_o(e.x,t.x),y:_o(e.y,t.y)}}function Sf(e,t){let s=.5;const n=ce(e),r=ce(t);return r>n?s=ot(t.min,t.max-n,e.min):n>r&&(s=ot(e.min,e.max-r,t.min)),be(0,1,s)}function Nf(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const bn=.35;function Cf(e=bn){return e===!1?e=0:e===!0&&(e=bn),{x:Oo(e,"left","right"),y:Oo(e,"top","bottom")}}function Oo(e,t,s){return{min:Fo(e,t),max:Fo(e,s)}}function Fo(e,t){return typeof e=="number"?e:e[t]||0}const Pf=new WeakMap;class Af{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=ee(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{s&&this.snapToCursor(gt(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=td(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ke(k=>{let v=this.getAxisMotionValue(k).get()||0;if(ve.test(v)){const{projection:y}=this.visualElement;if(y&&y.layout){const T=y.layout.layoutBox[k];T&&(v=ce(T)*(parseFloat(v)/100))}}this.originPoint[k]=v}),p&&F.update(()=>p(f,h),!1,!0),Us(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:k}=h;if(g&&this.currentDirection===null){this.currentDirection=Ef(k),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),x&&F.update(()=>x(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Lo(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:Eo(this.visualElement),element:this.visualElement.current})}stop(t,s){const n=t||this.latestPointerEvent,r=s||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&F.postRender(()=>a(n,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,n){const{drag:r}=this.getProps();if(!n||!qt(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=kf(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,r=this.constraints;t&&tt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=jf(n.layoutBox,t):this.constraints=!1,this.elastic=Cf(s),r!==this.constraints&&!tt(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Nf(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!tt(t))return!1;const n=t.current;Te(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=Md(n,r.root,this.visualElement.getTransformPagePoint());let i=Tf(r.layout.layoutBox,o);if(s){const a=s(Cd(i));this.hasMutatedConstraints=!!a,a&&(i=xi(a))}return i}startAnimation(t){const{drag:s,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=ke(u=>{if(!qt(u,s,this.currentDirection))return;let f=c&&c[u]||{};(i===!0||i===u)&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(d).then(a)}startAxisValueAnimation(t,s){const n=this.getAxisMotionValue(t);return Us(this.visualElement,t),n.start(Bs(t,n,0,s,this.visualElement,!1))}stopAnimation(){ke(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),r=n[s];return r||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ke(s=>{const{drag:n}=this.getProps();if(!qt(s,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(s);if(r&&r.layout){const{min:i,max:a}=r.layout.layoutBox[s],c=o.get()||0;o.set(t[s]-W(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!tt(s)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();r[i]=Sf({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ke(i=>{if(!qt(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:d}=this.constraints[i];a.set(W(c,d,r[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Pf.set(this.visualElement,this);const t=this.visualElement.current,s=xt(t,"pointerdown",d=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=d.target,m=h!==t&&ad(h);u&&f&&!m&&this.start(d)});let n;const r=()=>{const{dragConstraints:d}=this.getProps();tt(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),n||(n=Mf(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),F.read(r);const a=pt(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:u})=>{this.isDragging&&u&&(ke(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=d[f].translate,h.set(h.get()+d[f].translate))}),this.visualElement.render())}));return()=>{a(),s(),i(),c&&c(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=bn,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function Bo(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Mf(e,t,s){const n=ci(e,Bo(s)),r=ci(t,Bo(s));return()=>{n(),r()}}function qt(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function Ef(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class Vf extends De{constructor(t){super(t),this.removeGroupControls=fe,this.removeListeners=fe,this.controls=new Af(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const vn=e=>(t,s)=>{e&&F.update(()=>e(t,s),!1,!0)};class Df extends De{constructor(){super(...arguments),this.removePointerDownListener=fe}onPointerDown(t){this.session=new Lo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Eo(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:vn(t),onStart:vn(s),onMove:vn(n),onEnd:(o,i)=>{delete this.session,r&&F.postRender(()=>r(o,i))}}}mount(){this.removePointerDownListener=xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let wn=!1;class Lf extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=t;o&&(s.group&&s.group.add(o),n&&n.register&&r&&n.register(o),wn&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:n,drag:r,isPresent:o}=this.props,{projection:i}=n;return i&&(i.isPresent=o,t.layoutDependency!==s&&i.setOptions({...i.options,layoutDependency:s}),wn=!0,r||t.layoutDependency!==s||s===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||F.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=s,n.root.didUpdate(),qs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:r}=t;wn=!0,r&&(r.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function $o(e){const[t,s]=yo(),n=b.useContext(as);return l.jsx(Lf,{...e,layoutGroup:n,switchLayoutGroup:b.useContext(Ao),isPresent:t,safeToRemove:s})}const Rf={pan:{Feature:Df},drag:{Feature:Vf,ProjectionNode:go,MeasureLayout:$o}};function Wo(e,t,s){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",s==="Start");const r="onHover"+s,o=n[r];o&&F.postRender(()=>o(t,gt(t)))}class If extends De{mount(){const{current:t}=this.node;t&&(this.unmount=nd(t,(s,n)=>(Wo(this.node,n,"Start"),r=>Wo(this.node,r,"End"))))}unmount(){}}class zf extends De{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=it(pt(this.node.current,"focus",()=>this.onFocus()),pt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Uo(e,t,s){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",s==="Start");const r="onTap"+(s==="End"?"":s),o=n[r];o&&F.postRender(()=>o(t,gt(t)))}class _f extends De{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:n}=this.node.props;this.unmount=cd(t,(r,o)=>(Uo(this.node,o,"Start"),(i,{success:a})=>Uo(this.node,i,a?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const kn=new WeakMap,jn=new WeakMap,Of=e=>{const t=kn.get(e.target);t&&t(e)},Ff=e=>{e.forEach(Of)};function Bf({root:e,...t}){const s=e||document;jn.has(s)||jn.set(s,{});const n=jn.get(s),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(Ff,{root:e,...t})),n[r]}function $f(e,t,s){const n=Bf(t);return kn.set(e,s),n.observe(e),()=>{kn.delete(e),n.unobserve(e)}}const Wf={some:0,all:1};class Uf extends De{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:s,margin:n,amount:r="some",once:o}=t,i={root:s?s.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:Wf[r]},a=d=>{const{isIntersecting:u}=d;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=u?f:h;m&&m(d)};this.stopObserver=$f(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(Gf(t,s))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Gf({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const Yf={...xf,...{inView:{Feature:Uf},tap:{Feature:_f},focus:{Feature:zf},hover:{Feature:If}},...Rf,...{layout:{ProjectionNode:go,MeasureLayout:$o}}},_=ff(Yf,hf);function Go(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=Go(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function Kf(){for(var e,t,s=0,n="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=Go(e))&&(n&&(n+=" "),n+=t);return n}const Hf=(e,t)=>{const s=new Array(e.length+t.length);for(let n=0;n<e.length;n++)s[n]=e[n];for(let n=0;n<t.length;n++)s[e.length+n]=t[n];return s},Xf=(e,t)=>({classGroupId:e,validator:t}),Yo=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Zt="-",Ko=[],qf="arbitrary..",Zf=e=>{const t=Qf(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Jf(i);const a=i.split(Zt),c=a[0]===""&&a.length>1?1:0;return Ho(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=n[i],d=s[i];return c?d?Hf(d,c):c:d||Ko}return s[i]||Ko}}},Ho=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],o=s.nextPart.get(r);if(o){const d=Ho(e,t+1,o);if(d)return d}const i=s.validators;if(i===null)return;const a=t===0?e.join(Zt):e.slice(t).join(Zt),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(a))return u.classGroupId}},Jf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),n=t.slice(0,s);return n?qf+n:void 0})(),Qf=e=>{const{theme:t,classGroups:s}=e;return eh(s,t)},eh=(e,t)=>{const s=Yo();for(const n in e){const r=e[n];Tn(r,s,n,t)}return s},Tn=(e,t,s,n)=>{const r=e.length;for(let o=0;o<r;o++){const i=e[o];th(i,t,s,n)}},th=(e,t,s,n)=>{if(typeof e=="string"){sh(e,t,s);return}if(typeof e=="function"){nh(e,t,s,n);return}rh(e,t,s,n)},sh=(e,t,s)=>{const n=e===""?t:Xo(t,e);n.classGroupId=s},nh=(e,t,s,n)=>{if(ih(e)){Tn(e(n),t,s,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Xf(s,e))},rh=(e,t,s,n)=>{const r=Object.entries(e),o=r.length;for(let i=0;i<o;i++){const[a,c]=r[i];Tn(c,Xo(t,a),s,n)}},Xo=(e,t)=>{let s=e;const n=t.split(Zt),r=n.length;for(let o=0;o<r;o++){const i=n[o];let a=s.nextPart.get(i);a||(a=Yo(),s.nextPart.set(i,a)),s=a}return s},ih=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,oh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),n=Object.create(null);const r=(o,i)=>{s[o]=i,t++,t>e&&(t=0,n=s,s=Object.create(null))};return{get(o){let i=s[o];if(i!==void 0)return i;if((i=n[o])!==void 0)return r(o,i),i},set(o,i){o in s?s[o]=i:r(o,i)}}},Sn="!",qo=":",ah=[],Zo=(e,t,s,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:n,isExternal:r}),lh=e=>{const{prefix:t,experimentalParseClassName:s}=e;let n=r=>{const o=[];let i=0,a=0,c=0,d;const u=r.length;for(let p=0;p<u;p++){const x=r[p];if(i===0&&a===0){if(x===qo){o.push(r.slice(c,p)),c=p+1;continue}if(x==="/"){d=p;continue}}x==="["?i++:x==="]"?i--:x==="("?a++:x===")"&&a--}const f=o.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(Sn)?(h=f.slice(0,-1),m=!0):f.startsWith(Sn)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Zo(o,m,h,g)};if(t){const r=t+qo,o=n;n=i=>i.startsWith(r)?o(i.slice(r.length)):Zo(ah,!1,i,void 0,!0)}if(s){const r=n;n=o=>s({className:o,parseClassName:r})}return n},ch=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,n)=>{t.set(s,1e6+n)}),s=>{const n=[];let r=[];for(let o=0;o<s.length;o++){const i=s[o],a=i[0]==="[",c=t.has(i);a||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},dh=e=>({cache:oh(e.cacheSize),parseClassName:lh(e),sortModifiers:ch(e),postfixLookupClassGroupIds:uh(e),...Zf(e)}),uh=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let n=0;n<s.length;n++)t[s[n]]=!0;return t},fh=/\s+/,hh=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:o,postfixLookupClassGroupIds:i}=t,a=[],c=e.trim().split(fh);let d="";for(let u=c.length-1;u>=0;u-=1){const f=c[u],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:x}=s(f);if(h){d=f+(d.length>0?" "+d:d);continue}let k=!!x,v;if(k){const z=p.substring(0,x);v=n(z);const j=v&&i[v]?n(p):void 0;j&&j!==v&&(v=j,k=!1)}else v=n(p);if(!v){if(!k){d=f+(d.length>0?" "+d:d);continue}if(v=n(p),!v){d=f+(d.length>0?" "+d:d);continue}k=!1}const y=m.length===0?"":m.length===1?m[0]:o(m).join(":"),T=g?y+Sn:y,S=T+v;if(a.indexOf(S)>-1)continue;a.push(S);const E=r(v,k);for(let z=0;z<E.length;++z){const j=E[z];a.push(T+j)}d=f+(d.length>0?" "+d:d)}return d},mh=(...e)=>{let t=0,s,n,r="";for(;t<e.length;)(s=e[t++])&&(n=Jo(s))&&(r&&(r+=" "),r+=n);return r},Jo=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=Jo(e[n]))&&(s&&(s+=" "),s+=t);return s},ph=(e,...t)=>{let s,n,r,o;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return s=dh(d),n=s.cache.get,r=s.cache.set,o=a,a(c)},a=c=>{const d=n(c);if(d)return d;const u=hh(c,s);return r(c,u),u};return o=i,(...c)=>o(mh(...c))},gh=[],te=e=>{const t=s=>s[e]||gh;return t.isThemeGetter=!0,t},Qo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ea=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>xh.test(e),I=e=>!!e&&!Number.isNaN(Number(e)),je=e=>!!e&&Number.isInteger(Number(e)),Nn=e=>e.endsWith("%")&&I(e.slice(0,-1)),Se=e=>yh.test(e),ta=()=>!0,jh=e=>bh.test(e)&&!vh.test(e),Cn=()=>!1,Th=e=>wh.test(e),Sh=e=>kh.test(e),Nh=e=>!N(e)&&!C(e),Ch=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ph=e=>Re(e,aa,Cn),N=e=>Qo.test(e),$e=e=>Re(e,la,jh),sa=e=>Re(e,Ih,I),Ah=e=>Re(e,da,ta),Mh=e=>Re(e,ca,Cn),na=e=>Re(e,ia,Cn),Eh=e=>Re(e,oa,Sh),Jt=e=>Re(e,ua,Th),C=e=>ea.test(e),yt=e=>We(e,la),Vh=e=>We(e,ca),ra=e=>We(e,ia),Dh=e=>We(e,aa),Lh=e=>We(e,oa),Qt=e=>We(e,ua,!0),Rh=e=>We(e,da,!0),Re=(e,t,s)=>{const n=Qo.exec(e);return n?n[1]?t(n[1]):s(n[2]):!1},We=(e,t,s=!1)=>{const n=ea.exec(e);return n?n[1]?t(n[1]):s:!1},ia=e=>e==="position"||e==="percentage",oa=e=>e==="image"||e==="url",aa=e=>e==="length"||e==="size"||e==="bg-size",la=e=>e==="length",Ih=e=>e==="number",ca=e=>e==="family-name",da=e=>e==="number"||e==="weight",ua=e=>e==="shadow",zh=ph(()=>{const e=te("color"),t=te("font"),s=te("text"),n=te("font-weight"),r=te("tracking"),o=te("leading"),i=te("breakpoint"),a=te("container"),c=te("spacing"),d=te("radius"),u=te("shadow"),f=te("inset-shadow"),h=te("text-shadow"),m=te("drop-shadow"),g=te("blur"),p=te("perspective"),x=te("aspect"),k=te("ease"),v=te("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...T(),C,N],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[C,N,c],V=()=>[Le,"full","auto",...j()],D=()=>[je,"none","subgrid",C,N],O=()=>["auto",{span:["full",je,C,N]},je,C,N],$=()=>[je,"auto",C,N],de=()=>["auto","min","max","fr",C,N],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],ye=()=>[Le,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Y=()=>[Le,"screen","full","dvw","lvw","svw","min","max","fit",...j()],se=()=>[Le,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],A=()=>[e,C,N],w=()=>[...T(),ra,na,{position:[C,N]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",Dh,Ph,{size:[C,N]}],X=()=>[Nn,yt,$e],Q=()=>["","none","full",d,C,N],ne=()=>["",I,yt,$e],K=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[I,Nn,ra,na],ts=()=>["","none",g,C,N],ss=()=>["none",I,C,N],ns=()=>["none",I,C,N],An=()=>[I,C,N],rs=()=>[Le,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Se],breakpoint:[Se],color:[ta],container:[Se],"drop-shadow":[Se],ease:["in","out","in-out"],font:[Nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Se],shadow:[Se],spacing:["px",I],text:[Se],"text-shadow":[Se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Le,N,C,x]}],container:["container"],"container-type":[{"@container":["","normal","size",C,N]}],"container-named":[Ch],columns:[{columns:[I,N,C,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[je,"auto",C,N]}],basis:[{basis:[Le,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[I,Le,"auto","initial","none",N]}],grow:[{grow:["",I,C,N]}],shrink:[{shrink:["",I,C,N]}],order:[{order:[je,"first","last","none",C,N]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:ye()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[a,"screen",...ye()]}],"min-w":[{"min-w":[a,"screen","none",...ye()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...ye()]}],h:[{h:["screen","lh",...ye()]}],"min-h":[{"min-h":["screen","lh","none",...ye()]}],"max-h":[{"max-h":["screen","lh",...ye()]}],"font-size":[{text:["base",s,yt,$e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Rh,Ah]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nn,N]}],"font-family":[{font:[Vh,Mh,t]}],"font-features":[{"font-features":[N]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,C,N]}],"line-clamp":[{"line-clamp":[I,"none",C,sa]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",C,N]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",C,N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[I,"from-font","auto",C,$e]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[I,"auto",C,N]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[je,C,N]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C,N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C,N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:w()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},je,C,N],radial:["",C,N],conic:[je,C,N]},Lh,Eh]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[I,C,N]}],"outline-w":[{outline:["",I,yt,$e]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,Qt,Jt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,Qt,Jt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[I,$e]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",h,Qt,Jt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[I,C,N]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[C,N]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:w()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",C,N]}],filter:[{filter:["","none",C,N]}],blur:[{blur:ts()}],brightness:[{brightness:[I,C,N]}],contrast:[{contrast:[I,C,N]}],"drop-shadow":[{"drop-shadow":["","none",m,Qt,Jt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",I,C,N]}],"hue-rotate":[{"hue-rotate":[I,C,N]}],invert:[{invert:["",I,C,N]}],saturate:[{saturate:[I,C,N]}],sepia:[{sepia:["",I,C,N]}],"backdrop-filter":[{"backdrop-filter":["","none",C,N]}],"backdrop-blur":[{"backdrop-blur":ts()}],"backdrop-brightness":[{"backdrop-brightness":[I,C,N]}],"backdrop-contrast":[{"backdrop-contrast":[I,C,N]}],"backdrop-grayscale":[{"backdrop-grayscale":["",I,C,N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,C,N]}],"backdrop-invert":[{"backdrop-invert":["",I,C,N]}],"backdrop-opacity":[{"backdrop-opacity":[I,C,N]}],"backdrop-saturate":[{"backdrop-saturate":[I,C,N]}],"backdrop-sepia":[{"backdrop-sepia":["",I,C,N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",C,N]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[I,"initial",C,N]}],ease:[{ease:["linear","initial",k,C,N]}],delay:[{delay:[I,C,N]}],animate:[{animate:["none",v,C,N]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,C,N]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ss()}],"rotate-x":[{"rotate-x":ss()}],"rotate-y":[{"rotate-y":ss()}],"rotate-z":[{"rotate-z":ss()}],scale:[{scale:ns()}],"scale-x":[{"scale-x":ns()}],"scale-y":[{"scale-y":ns()}],"scale-z":[{"scale-z":ns()}],"scale-3d":["scale-3d"],skew:[{skew:An()}],"skew-x":[{"skew-x":An()}],"skew-y":[{"skew-y":An()}],transform:[{transform:[C,N,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:rs()}],"translate-x":[{"translate-x":rs()}],"translate-y":[{"translate-y":rs()}],"translate-z":[{"translate-z":rs()}],"translate-none":["translate-none"],zoom:[{zoom:[je,C,N]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C,N]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C,N]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[I,yt,$e,sa]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function M(...e){return zh(Kf(e))}const _h=({title:e,children:t,className:s})=>{const[n,r]=b.useState(!1);return l.jsxs("div",{className:M("glass-card overflow-hidden p-0 border border-border/50",s),children:[l.jsxs("button",{type:"button",onClick:()=>r(!n),className:"w-full px-6 py-4 flex items-center justify-between font-bold text-foreground text-left cursor-pointer hover:bg-secondary/20 transition-colors",children:[l.jsx("span",{children:e}),l.jsx(In,{size:18,className:M("text-muted-foreground transition-transform duration-200",n&&"rotate-180")})]}),l.jsx(oe,{initial:!1,children:n&&l.jsx(_.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.2},className:"overflow-hidden",children:l.jsx("div",{className:"px-6 pb-5 pt-2 border-t border-border/40 text-sm text-muted-foreground leading-relaxed",children:t})})})]})},fa={success:"border-green-500/20 bg-green-500/5",error:"border-red-500/20 bg-red-500/5",warning:"border-amber-500/20 bg-amber-500/5",info:"border-blue-500/20 bg-blue-500/5"},ha={success:{title:"var(--alert-success-title, #14532d)",desc:"var(--alert-success-desc, #15803d)"},error:{title:"var(--alert-error-title, #7f1d1d)",desc:"var(--alert-error-desc, #b91c1c)"},warning:{title:"var(--alert-warning-title, #78350f)",desc:"var(--alert-warning-desc, #b45309)"},info:{title:"var(--alert-info-title, #1e3a8a)",desc:"var(--alert-info-desc, #1d4ed8)"}},Oh=({title:e,description:t,variant:s="info",dismissible:n=!1,className:r})=>{const[o,i]=b.useState(!0),a=ha[s]||ha.info,c={success:l.jsx(kt,{size:18,style:{color:a.title}}),error:l.jsx(zn,{size:18,style:{color:a.title}}),warning:l.jsx(os,{size:18,style:{color:a.title}}),info:l.jsx(jt,{size:18,style:{color:a.title}})};return l.jsx(oe,{children:o&&l.jsxs(_.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:M("flex items-start gap-4 p-4 rounded-2xl border text-left",fa[s]||fa.info,r),children:[l.jsx("div",{className:"mt-0.5 shrink-0",children:c[s]||c.info}),l.jsxs("div",{className:"flex-1 space-y-1",children:[e&&l.jsx("h4",{style:{color:a.title},className:"font-bold text-sm leading-none",children:e}),t&&l.jsx("p",{style:{color:a.desc},className:"text-xs leading-relaxed font-medium",children:t})]}),n&&l.jsx("button",{type:"button",onClick:()=>i(!1),style:{color:a.title},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg transition-colors cursor-pointer shrink-0",children:l.jsx(Ce,{size:14})})]})})},ma={sm:"h-8 w-8 text-xs",md:"h-11 w-11 text-sm",lg:"h-14 w-14 text-base"},pa={online:"bg-emerald-500 ring-emerald-500/20",offline:"bg-zinc-400 ring-zinc-400/20",busy:"bg-destructive ring-destructive/20",syncing:"bg-primary ring-primary/20 animate-pulse"},Fh=({src:e,alt:t="User Profile",name:s="",size:n="md",status:r,className:o})=>{const i=s?s.split(" ").map(a=>a[0]).slice(0,2).join("").toUpperCase():"";return l.jsxs("div",{className:"relative inline-block shrink-0",children:[l.jsx("div",{className:M("relative rounded-full overflow-hidden flex items-center justify-center border border-border/80 shadow-md bg-secondary/50 font-bold text-foreground font-sans",ma[n]||ma.md,o),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx("span",{children:i||"?"})}),r&&pa[r]&&l.jsx("span",{className:M("absolute bottom-0 right-0 block h-2.5 w-2.5 rounded-full ring-2 ring-background",pa[r])})]})},bt=({children:e,className:t,...s})=>l.jsx("div",{className:M("bg-card border border-border rounded-3xl p-6 transition-all duration-300",t),...s,children:e}),Ue=({label:e,error:t,icon:s,className:n,id:r,...o})=>l.jsxs("div",{className:M("space-y-1.5 w-full text-left",n),children:[e&&l.jsx("label",{htmlFor:r,className:"text-sm font-semibold text-foreground ml-1",children:e}),l.jsxs("div",{className:"relative group",children:[s&&l.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground group-focus-within:text-primary transition-colors",children:l.jsx(s,{size:18})}),l.jsx("input",{id:r,className:M("glass-input w-full",s&&"pl-11",t&&"ring-2 ring-destructive/50 border-destructive/50"),...o})]}),t&&l.jsx(_.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-xs text-destructive ml-1 font-medium",children:t})]}),xe=({children:e,className:t,variant:s="primary",loading:n=!1,...r})=>{const o={primary:"btn-primary",secondary:"btn-secondary",outline:"btn-outline",ghost:"btn-ghost",glass:"btn-glass",destructive:"btn-destructive"};return l.jsxs(_.button,{whileHover:{y:-2},whileTap:{scale:.98},className:M("relative overflow-hidden",o[s],n&&"opacity-70 cursor-not-allowed",t),disabled:n||r.disabled,...r,children:[n&&l.jsxs("svg",{className:"animate-spin h-5 w-5 text-current shrink-0",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e,l.jsx("div",{className:"absolute inset-0 w-full h-full bg-gradient-to-r from-transparent via-white/10 to-transparent -translate-x-full hover:animate-[shine_1.5s_infinite]"})]})},Pn=({checked:e=!1,onChange:t,label:s,className:n})=>l.jsxs("label",{className:M("inline-flex items-center gap-3 cursor-pointer select-none text-left",n),children:[l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:"checkbox",checked:e,onChange:r=>t&&t(r.target.checked),className:"sr-only"}),l.jsx(_.div,{className:M("w-5 h-5 rounded-lg border flex items-center justify-center transition-colors duration-200",e?"bg-primary border-primary":"bg-white/40 border-input dark:bg-black/20"),children:l.jsx(oe,{children:e&&l.jsx(_.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:"spring",stiffness:500,damping:30},children:l.jsx(Ba,{size:12,className:"text-primary-foreground stroke-[4px]"})})})})]}),s&&l.jsx("span",{className:"text-sm font-semibold text-foreground leading-none",children:s})]}),Bh=({initialMode:e="login",onLogin:t,onRegister:s,onForgotPassword:n,logo:r=Ga,title:o="Ether UI Console",className:i})=>{const[a,c]=b.useState(e),[d,u]=b.useState(""),[f,h]=b.useState(""),[m,g]=b.useState(""),[p,x]=b.useState(!1),[k,v]=b.useState(!1),[y,T]=b.useState(!1),S=async E=>{E.preventDefault(),T(!0);try{a==="login"&&t?await t({email:f,password:m,rememberMe:p}):a==="register"&&s?await s({name:d,email:f,password:m,acceptTerms:k}):a==="forgot"&&n&&await n({email:f})}finally{T(!1)}};return l.jsxs("div",{className:M("min-h-screen w-full flex items-center justify-center p-6 relative bg-background overflow-hidden",i),children:[l.jsx("div",{className:"absolute top-1/4 left-1/4 w-[400px] h-[400px] bg-primary/5 rounded-full blur-[120px] pointer-events-none animate-pulse"}),l.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-[400px] h-[400px] bg-primary/10 rounded-full blur-[120px] pointer-events-none animate-pulse duration-4000"}),l.jsx("div",{className:"w-full max-w-md z-10",children:l.jsxs(oe,{mode:"wait",children:[a==="login"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("div",{className:"inline-flex items-center justify-center p-3 rounded-2xl bg-primary/10 text-primary mb-2",children:l.jsx(r,{size:28,className:"animate-pulse"})}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground",children:o}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Welcome back! Sign in to manage your ledgers."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Email Address",type:"email",placeholder:"name@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(Ue,{label:"Password",type:"password",placeholder:"••••••••",value:m,onChange:E=>g(E.target.value),required:!0}),l.jsxs("div",{className:"flex items-center justify-between text-xs pt-1",children:[l.jsx(Pn,{label:"Remember me",checked:p,onChange:x}),l.jsx("button",{type:"button",onClick:()=>c("forgot"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Forgot password?"})]}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 mt-2",children:"Sign In to Console"})]}),l.jsxs("div",{className:"text-center text-xs text-muted-foreground border-t border-border/40 pt-4",children:["Don't have an account?"," ",l.jsx("button",{type:"button",onClick:()=>c("register"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Create one now"})]})]})},"login"),a==="register"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("div",{className:"inline-flex items-center justify-center p-3 rounded-2xl bg-primary/10 text-primary mb-2",children:l.jsx(r,{size:28})}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground",children:"Create Account"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Sign up to unlock real-time financial synchrony."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Full Name",type:"text",placeholder:"Alex Carter",value:d,onChange:E=>u(E.target.value),required:!0}),l.jsx(Ue,{label:"Work Email",type:"email",placeholder:"alex@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(Ue,{label:"Choose Password",type:"password",placeholder:"••••••••",value:m,onChange:E=>g(E.target.value),required:!0}),l.jsx("div",{className:"flex items-start pt-1",children:l.jsx(Pn,{label:"I agree to the Terms & Conditions",checked:k,onChange:v})}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 mt-2",children:"Register Workspace"})]}),l.jsxs("div",{className:"text-center text-xs text-muted-foreground border-t border-border/40 pt-4",children:["Already have an account?"," ",l.jsx("button",{type:"button",onClick:()=>c("login"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Sign in instead"})]})]})},"register"),a==="forgot"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"space-y-2 text-left",children:[l.jsxs("button",{type:"button",onClick:()=>c("login"),className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground font-bold cursor-pointer transition-colors",children:[l.jsx(Oa,{size:12})," Back to Sign In"]}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground pt-2",children:"Recover Access"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your verified work email, and we will send a password restoration link."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Registered Email Address",type:"email",placeholder:"alex@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 pt-2",children:"Send Recovery Link"})]})]})},"forgot")]})})]})},ga=({children:e,variant:t="default",className:s})=>{const n={default:"bg-secondary text-secondary-foreground border-border",primary:"bg-primary text-primary-foreground border-primary",success:"bg-emerald-50 text-emerald-700 border-emerald-100 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-500/20",warning:"bg-amber-50 text-amber-700 border-amber-100 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20",danger:"bg-destructive text-destructive-foreground border-destructive"};return l.jsx("span",{className:M("px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wider border inline-flex items-center justify-center",n[t],s),children:e})},xa=({isOpen:e,onClose:t,title:s,children:n,className:r,width:o})=>l.jsx(oe,{children:e&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx(_.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),l.jsxs(_.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:M("relative w-full max-w-lg glass-card overflow-hidden p-0 flex flex-col max-h-[90vh] text-left",o,r),children:[l.jsxs("div",{className:"flex items-center justify-between px-7 py-5 border-b border-border shrink-0",children:[l.jsx("h3",{className:"text-xl font-bold text-foreground",children:s}),l.jsx("button",{onClick:t,className:"p-2 rounded-xl hover:bg-secondary text-muted-foreground hover:text-foreground transition-all cursor-pointer",children:l.jsx(Ce,{size:20})})]}),l.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:n})]})]})}),$h=({isOpen:e,onClose:t,onConfirm:s,title:n="Are you sure?",message:r="This action cannot be undone.",confirmText:o="Confirm",cancelText:i="Cancel",confirmVariant:a="destructive",loading:c=!1})=>l.jsx(xa,{isOpen:e,onClose:t,title:n,className:"max-w-md",children:l.jsxs("div",{className:"space-y-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx(xe,{variant:"ghost",onClick:t,disabled:c,children:i}),l.jsx(xe,{variant:a,onClick:s,loading:c,children:o})]})]})}),Wh=({label:e,options:t=[],value:s,onChange:n,placeholder:r="Select option",className:o})=>{const[i,a]=b.useState(!1),c=b.useRef(null),d=t.find(u=>u.value===s);return b.useEffect(()=>{const u=f=>{c.current&&!c.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]),l.jsxs("div",{ref:c,className:M("space-y-1.5 w-full text-left relative",o),children:[e&&l.jsx("label",{className:"text-sm font-semibold text-foreground ml-1",children:e}),l.jsx("div",{children:l.jsxs("button",{type:"button",onClick:()=>a(!i),className:"glass-input w-full flex items-center justify-between cursor-pointer focus:ring-2 focus:ring-ring/10 text-left",children:[l.jsx("span",{className:M(!d&&"text-muted-foreground/60"),children:d?d.label:r}),l.jsx(In,{size:18,className:M("text-muted-foreground transition-transform duration-200",i&&"rotate-180")})]})}),l.jsx(oe,{children:i&&l.jsx(_.div,{initial:{opacity:0,y:5,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:5,scale:.98},transition:{duration:.15},className:"absolute z-50 w-full mt-2 glass-panel rounded-2xl overflow-hidden shadow-2xl p-1 max-h-60 overflow-y-auto custom-scrollbar",children:t.map((u,f)=>{const h=u.value===s;return l.jsx("button",{type:"button",onClick:()=>{n&&n(u.value),a(!1)},className:M("w-full text-left px-4 py-2.5 rounded-xl text-sm transition-colors cursor-pointer",h?"bg-primary text-primary-foreground font-semibold":"hover:bg-secondary text-foreground"),children:u.label},u.value||f)})})})]})},Uh=({onFilesAdded:e,accept:t="*",maxFiles:s=5,maxSizeMB:n=10,className:r})=>{const[o,i]=b.useState(!1),[a,c]=b.useState([]),d=b.useRef(null),u=p=>{p.preventDefault(),p.stopPropagation(),p.type==="dragenter"||p.type==="dragover"?i(!0):p.type==="dragleave"&&i(!1)},f=p=>{const x=Array.from(p).map(v=>{const T=v.size/1048576>n;return{id:Math.random().toString(36).substring(7),name:v.name,size:(v.size/1024).toFixed(1)+" KB",rawFile:v,progress:0,status:T?"failed":"uploading",error:T?`File exceeds limit of ${n}MB`:null}}),k=[...a,...x].slice(0,s);c(k),e&&e(k.map(v=>v.rawFile)),x.forEach(v=>{if(v.status==="failed")return;let y=0;const T=setInterval(()=>{y+=Math.floor(Math.random()*15)+5,y>=100?(y=100,clearInterval(T),c(S=>S.map(E=>E.id===v.id?{...E,progress:100,status:"success"}:E))):c(S=>S.map(E=>E.id===v.id?{...E,progress:y}:E))},150)})},h=p=>{p.preventDefault(),p.stopPropagation(),i(!1),p.dataTransfer.files&&p.dataTransfer.files[0]&&f(p.dataTransfer.files)},m=p=>{p.target.files&&p.target.files[0]&&f(p.target.files)},g=p=>{c(a.filter(x=>x.id!==p))};return l.jsxs("div",{className:M("space-y-4 w-full text-left",r),children:[l.jsxs("div",{onDragEnter:u,onDragOver:u,onDragLeave:u,onDrop:h,onClick:()=>d.current&&d.current.click(),className:M("relative border-2 border-dashed rounded-2xl p-8 flex flex-col items-center justify-center gap-3 cursor-pointer select-none transition-all duration-300 min-h-[160px]",o?"border-primary bg-primary/5 scale-[0.99] shadow-md shadow-primary/5":"bg-white/40 border-border dark:bg-black/20 hover:border-primary/50 hover:bg-secondary/20"),children:[l.jsx("input",{ref:d,type:"file",multiple:!0,accept:t,onChange:m,className:"hidden"}),l.jsx(_.div,{animate:o?{scale:1.1,y:-2}:{scale:1,y:0},className:M("p-3 rounded-2xl transition-colors",o?"bg-primary text-primary-foreground":"bg-primary/10 text-primary"),children:l.jsx(Wa,{size:24})}),l.jsxs("div",{className:"text-center space-y-1",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:o?"Drop files to stage them!":"Drag & Drop files here"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or click to browse storage (Max ",s," files, limit ",n,"MB)"]})]})]}),l.jsx(oe,{children:a.length>0&&l.jsxs(_.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:"space-y-2 border border-border/40 bg-card/60 rounded-2xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/20",children:[l.jsxs("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground",children:["Upload Queue (",a.length,")"]}),l.jsx("button",{onClick:()=>c([]),className:"text-[10px] font-bold text-destructive hover:underline",children:"Clear All"})]}),l.jsx("div",{className:"space-y-3 max-h-[220px] overflow-y-auto custom-scrollbar pr-1",children:a.map(p=>l.jsxs(_.div,{layout:!0,initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:10},className:"flex items-center justify-between gap-4 p-2.5 rounded-xl bg-secondary/30 border border-border/10 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l.jsx("div",{className:"p-2 rounded-lg bg-card border border-border/20 text-muted-foreground shrink-0",children:l.jsx(Ua,{size:16})}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("p",{className:"font-semibold text-foreground truncate",children:p.name}),l.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:p.size})]}),p.status==="uploading"&&l.jsx("div",{className:"w-full bg-secondary/50 rounded-full h-1 overflow-hidden",children:l.jsx(_.div,{className:"bg-primary h-full rounded-full",animate:{width:`${p.progress}%`},transition:{duration:.1}})}),p.status==="failed"&&l.jsx("p",{className:"text-[10px] font-bold text-destructive truncate",children:p.error}),p.status==="success"&&l.jsxs("p",{className:"text-[10px] font-bold text-primary flex items-center gap-1",children:[l.jsx(kt,{size:10})," Upload complete!"]})]})]}),l.jsx("button",{onClick:()=>g(p.id),className:"p-1 hover:bg-secondary rounded-lg text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:l.jsx(Ce,{size:14})})]},p.id))})]})})]})},Gh=({isOpen:e=!1,onClose:t,notifications:s=[],onClearAll:n,onDismiss:r,className:o})=>l.jsx(oe,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(_.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 z-40 bg-black/30 backdrop-blur-sm cursor-pointer"}),l.jsxs(_.aside,{initial:{x:"110%",opacity:0},animate:{x:0,opacity:1},exit:{x:"110%",opacity:0},transition:{type:"spring",stiffness:380,damping:32},className:M("fixed top-4 right-4 z-50 h-[calc(100vh-2rem)] w-[calc(100%-2rem)] max-w-sm bg-card/95 backdrop-blur-xl border border-border/50 shadow-2xl rounded-3xl flex flex-col text-left overflow-hidden",o),children:[l.jsxs("div",{className:"p-4 border-b border-border/40 flex items-center justify-between min-h-[72px] shrink-0 bg-card/65 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"p-2 rounded-xl bg-primary/10 text-primary",children:l.jsx(Rn,{size:18,className:"animate-bounce"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-extrabold text-foreground",children:"Notifications"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Alert console logs"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[s.length>0&&l.jsx("button",{onClick:n,className:"p-2 hover:bg-secondary rounded-xl text-muted-foreground hover:text-destructive cursor-pointer transition-colors",title:"Clear All",children:l.jsx(On,{size:16})}),l.jsx("button",{onClick:t,className:"p-2 hover:bg-secondary rounded-xl text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:l.jsx(Ce,{size:16})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-4 space-y-3",children:l.jsx(oe,{initial:!1,children:s.length===0?l.jsxs(_.div,{initial:{opacity:0},animate:{opacity:1},className:"h-full flex flex-col items-center justify-center text-center gap-3 py-12",children:[l.jsx("div",{className:"p-4 rounded-full bg-secondary/40 text-muted-foreground",children:l.jsx(Rn,{size:32,className:"opacity-50"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-xs font-bold text-foreground",children:"Zero unread notifications"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"All operational tasks succeeded!"})]})]}):s.map(i=>{const a=i.type==="success",c=i.type==="warning";return l.jsxs(_.div,{layout:!0,initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"p-3.5 rounded-2xl bg-secondary/20 border border-border/10 flex items-start gap-3 relative overflow-hidden group hover:border-border/30 transition-all text-xs",children:[i.unread&&l.jsxs("span",{className:"absolute top-3.5 right-3.5 flex h-2 w-2",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),l.jsxs("div",{className:M("p-2 rounded-xl shrink-0 border border-border/10",a&&"bg-emerald-500/10 text-emerald-500",c&&"bg-amber-500/10 text-amber-500",!a&&!c&&"bg-sky-500/10 text-sky-500"),children:[a&&l.jsx(kt,{size:16}),c&&l.jsx(os,{size:16}),!a&&!c&&l.jsx(jt,{size:16})]}),l.jsxs("div",{className:"flex-1 space-y-1.5 pr-4 text-left",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx("p",{className:"font-bold text-foreground",children:i.title}),l.jsx("span",{className:"text-[9px] text-muted-foreground font-medium",children:i.timestamp})]}),l.jsx("p",{className:"text-muted-foreground text-[11px] leading-relaxed",children:i.description})]}),l.jsx("button",{onClick:()=>r&&r(i.id),className:"absolute bottom-3 right-3 p-1 hover:bg-secondary rounded-lg text-muted-foreground hover:text-foreground cursor-pointer transition-colors opacity-0 group-hover:opacity-100",title:"Dismiss notification",children:l.jsx(Ce,{size:12})})]},i.id)})})})]})]})}),Yh=({currentPage:e=1,totalPages:t=1,onPageChange:s,loading:n=!1})=>{if(t<=1)return null;const o=((i,a)=>a<=5?Array.from({length:a},(c,d)=>d+1):i<=3?[1,2,3,4,"...",a]:i>=a-2?[1,"...",a-3,a-2,a-1,a]:[1,"...",i-1,i,i+1,"...",a])(e,t);return l.jsxs("div",{className:"flex items-center justify-between py-2 mt-6 w-full",children:[l.jsxs("div",{className:"flex-1 flex justify-between sm:hidden",children:[l.jsx(xe,{variant:"outline",className:"text-foreground font-semibold",onClick:()=>s(e-1),disabled:e===1||n,children:"Previous"}),l.jsx(xe,{variant:"outline",className:"text-foreground font-semibold",onClick:()=>s(e+1),disabled:e===t||n,children:"Next"})]}),l.jsxs("div",{className:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[l.jsx("div",{children:l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Page ",l.jsx("span",{className:"font-bold text-foreground",children:e})," of"," ",l.jsx("span",{className:"font-bold text-foreground",children:t})]})}),l.jsx("div",{children:l.jsxs("nav",{className:"relative z-0 inline-flex gap-1.5 rounded-md shadow-sm","aria-label":"Pagination",children:[l.jsxs(xe,{variant:"outline",className:"p-2.5 rounded-xl shrink-0 text-foreground",onClick:()=>s(e-1),disabled:e===1||n,children:[l.jsx("span",{className:"sr-only",children:"Previous"}),l.jsx(is,{size:16})]}),o.map((i,a)=>{if(i==="...")return l.jsx("div",{className:"flex items-end justify-center px-1 pb-1",children:l.jsx("span",{className:"text-muted-foreground tracking-widest leading-none font-bold",children:"..."})},`dots-${a}`);const c=e===i;return l.jsx(xe,{variant:c?"primary":"outline",className:`w-10 h-10 p-0 rounded-xl shrink-0 font-mono text-xs font-semibold ${c?"":"text-muted-foreground hover:text-foreground"}`,onClick:()=>s(i),disabled:n,children:i},i)}),l.jsxs(xe,{variant:"outline",className:"p-2.5 rounded-xl shrink-0 text-foreground",onClick:()=>s(e+1),disabled:e===t||n,children:[l.jsx("span",{className:"sr-only",children:"Next"}),l.jsx(rt,{size:16})]})]})})]})]})},es=({size:e="md",className:t})=>{const s={sm:"h-4 w-4 stroke-[3px]",md:"h-8 w-8 stroke-[2px]",lg:"h-12 w-12 stroke-[1.5px]"};return l.jsx("div",{className:M("flex items-center justify-center",t),children:l.jsxs("svg",{className:M("animate-spin text-primary shrink-0",s[e]),viewBox:"0 0 24 24",fill:"none",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})};function Kh({docs:e=[],label:t="Upload Plans",adding:s=!1,replacing:n={},onAddDocs:r,onReplaceDoc:o,onRemoveDoc:i,onView:a}){return l.jsx("div",{className:"space-y-3",children:e.length>0?l.jsxs("div",{className:"flex flex-wrap gap-3 items-start",children:[e.map(c=>{var d;return l.jsxs("div",{className:"group/doc flex flex-col gap-1.5",children:[l.jsxs("button",{type:"button",onClick:()=>a==null?void 0:a(c.currentUrl),className:"relative w-20 h-20 rounded-xl overflow-hidden border border-border/50 hover:border-primary/50 hover:ring-2 hover:ring-primary/20 transition-all bg-secondary/20",title:"View full screen",children:[(d=c.currentUrl)!=null&&d.endsWith(".pdf")?l.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-1",children:[l.jsx("span",{className:"text-2xl leading-none",children:"📄"}),l.jsx("span",{className:"text-[8px] font-bold text-muted-foreground",children:"PDF"})]}):l.jsx("img",{src:c.currentUrl,alt:c.name,className:"w-full h-full object-cover"}),l.jsxs("span",{className:"absolute top-1 right-1 text-[7px] font-extrabold px-1 py-0.5 rounded bg-black/55 text-white/90 leading-none",children:["v",c.currentV]}),n[c.docId]&&l.jsx("div",{className:"absolute inset-0 bg-card/70 backdrop-blur-sm flex items-center justify-center",children:l.jsx(es,{size:"sm"})})]}),l.jsx("p",{className:"text-[9px] font-semibold text-muted-foreground truncate w-20 text-center leading-tight",children:c.name}),l.jsxs("div",{className:"flex gap-1 justify-center opacity-0 group-hover/doc:opacity-100 transition-opacity",children:[l.jsxs("label",{className:"cursor-pointer p-1 rounded-lg bg-secondary/50 hover:bg-secondary border border-border/50 transition-colors text-muted-foreground hover:text-foreground",title:"Replace with new version",children:[l.jsx(qa,{size:9}),l.jsx("input",{type:"file",accept:"image/*,.pdf",className:"hidden",onChange:u=>{var f;return((f=u.target.files)==null?void 0:f[0])&&(o==null?void 0:o(c.docId,u.target.files[0]))}})]}),l.jsx("button",{type:"button",onClick:()=>i==null?void 0:i(c.docId),className:"p-1 rounded-lg bg-destructive/10 hover:bg-destructive/20 border border-destructive/20 text-destructive transition-colors",title:"Remove",children:l.jsx(On,{size:9})})]})]},c.docId)}),l.jsxs("label",{className:`flex flex-col items-center justify-center w-20 h-20 rounded-xl border-2 border-dashed cursor-pointer transition-all gap-1 self-start
180
+ `),()=>{var z;(z=a.current)==null||z.removeAttribute("data-motion-pop-id"),E.contains(S)&&E.removeChild(S)}},[t]),l.jsx(zu,{isPresent:t,childRef:a,sizeRef:c,pop:o,children:o===!1?e:vt.cloneElement(e,{ref:f})})}const Ou=({children:e,initial:t,isPresent:s,onExitComplete:n,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:d})=>{const u=ls(Fu),f=b.useId();let h=!0,m=b.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:s,custom:r,onExitComplete:g=>{u.set(g,!0);for(const p of u.values())if(!p)return;n&&n()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[s,u,n]);return o&&h&&(m={...m}),b.useMemo(()=>{u.forEach((g,p)=>u.set(p,!1))},[s]),vt.useEffect(()=>{!s&&!u.size&&n&&n()},[s]),e=l.jsx(_u,{pop:i==="popLayout",isPresent:s,anchorX:a,anchorY:c,root:d,children:e}),l.jsx(Tt.Provider,{value:m,children:e})};function Fu(){return new Map}function yo(e=!0){const t=b.useContext(Tt);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:r}=t,o=b.useId();b.useEffect(()=>{if(e)return r(o)},[e]);const i=b.useCallback(()=>e&&n&&n(o),[o,n,e]);return!s&&n?[!1,i]:[!0]}const Yt=e=>e.key||"";function bo(e){const t=[];return b.Children.forEach(e,s=>{b.isValidElement(s)&&t.push(s)}),t}const oe=({children:e,custom:t,initial:s=!0,onExitComplete:n,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:d})=>{const[u,f]=yo(i),h=b.useMemo(()=>bo(e),[e]),m=i&&!u?[]:h.map(Yt),g=b.useRef(!0),p=b.useRef(h),x=ls(()=>new Map),k=b.useRef(new Set),[v,y]=b.useState(h),[T,S]=b.useState(h);Fn(()=>{g.current=!1,p.current=h;for(let j=0;j<T.length;j++){const V=Yt(T[j]);m.includes(V)?(x.delete(V),k.current.delete(V)):x.get(V)!==!0&&x.set(V,!1)}},[T,m.length,m.join("-")]);const E=[];if(h!==v){let j=[...h];for(let V=0;V<T.length;V++){const D=T[V],O=Yt(D);m.includes(O)||(j.splice(V,0,D),E.push(D))}return o==="wait"&&E.length&&(j=E),S(bo(j)),y(h),null}process.env.NODE_ENV!=="production"&&o==="wait"&&T.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:z}=b.useContext(as);return l.jsx(l.Fragment,{children:T.map(j=>{const V=Yt(j),D=i&&!u?!1:h===T||m.includes(V),O=()=>{if(k.current.has(V))return;if(x.has(V))k.current.add(V),x.set(V,!0);else return;let $=!0;x.forEach(de=>{de||($=!1)}),$&&(z==null||z(),S(p.current),i&&(f==null||f()),n&&n())};return l.jsx(Ou,{isPresent:D,initial:!g.current||s?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:d,onExitComplete:D?void 0:O,anchorX:a,anchorY:c,children:j},V)})})},vo=b.createContext({strict:!1}),wo={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"]};let ko=!1;function Bu(){if(ko)return;const e={};for(const t in wo)e[t]={isEnabled:s=>wo[t].some(n=>!!s[n])};pi(e),ko=!0}function jo(){return Bu(),Sd()}function $u(e){const t=jo();for(const s in e)t[s]={...t[s],...e[s]};pi(t)}const Wu=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","propagate","ignoreStrict","viewport"]);function Kt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Wu.has(e)}let To=e=>!Kt(e);function Uu(e){typeof e=="function"&&(To=t=>t.startsWith("on")?!Kt(t):e(t))}try{Uu(require("@emotion/is-prop-valid").default)}catch{}function Gu(e,t,s){const n={};for(const r in e)r==="values"&&typeof e.values=="object"||ie(e[r])||(To(r)||s===!0&&Kt(r)||!t&&!Kt(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}const Ht=b.createContext({});function Yu(e,t){if(Ot(e)){const{initial:s,animate:n}=e;return{initial:s===!1||ft(s)?s:void 0,animate:ft(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ku(e){const{initial:t,animate:s}=Yu(e,b.useContext(Ht));return b.useMemo(()=>({initial:t,animate:s}),[So(t),So(s)])}function So(e){return Array.isArray(e)?e.join(" "):e}const pn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function No(e,t,s){for(const n in t)!ie(t[n])&&!Ai(n,s)&&(e[n]=t[n])}function Hu({transformTemplate:e},t){return b.useMemo(()=>{const s=pn();return an(s,t,e),Object.assign({},s.vars,s.style)},[t])}function Xu(e,t){const s=e.style||{},n={};return No(n,s,e),Object.assign(n,Hu(e,t)),n}function qu(e,t){const s={},n=Xu(e,t);return e.drag&&e.dragListener!==!1&&(s.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)&&(s.tabIndex=0),s.style=n,s}const Co=()=>({...pn(),attrs:{}});function Zu(e,t,s,n){const r=b.useMemo(()=>{const o=Co();return Mi(o,t,Vi(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};No(o,e.style,e),r.style={...o,...r.style}}return r}const Ju=["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 gn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ju.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qu(e,t,s,{latestValues:n},r,o=!1,i){const c=(i??gn(e)?Zu:qu)(t,n,r,e),d=Gu(t,typeof e=="string",o),u=e!==b.Fragment?{...d,...c,ref:s}:{},{children:f}=t,h=b.useMemo(()=>ie(f)?f.get():f,[f]);return b.createElement(e,{...u,children:h})}function ef({scrapeMotionValuesFromProps:e,createRenderState:t},s,n,r){return{latestValues:tf(s,n,r,e),renderState:t()}}function tf(e,t,s,n){const r={},o=n(e,{});for(const h in o)r[h]=Ut(o[h]);let{initial:i,animate:a}=e;const c=Ot(e),d=fi(e);t&&d&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=s?s.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!_t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const g=$s(e,h[m]);if(g){const{transitionEnd:p,transition:x,...k}=g;for(const v in k){let y=k[v];if(Array.isArray(y)){const T=u?y.length-1:0;y=y[T]}y!==null&&(r[v]=y)}for(const v in p)r[v]=p[v]}}}return r}const Po=e=>(t,s)=>{const n=b.useContext(Ht),r=b.useContext(Tt),o=()=>ef(e,t,n,r);return s?o():ls(o)},sf=Po({scrapeMotionValuesFromProps:cn,createRenderState:pn}),nf=Po({scrapeMotionValuesFromProps:Di,createRenderState:Co}),rf=Symbol.for("motionComponentSymbol");function of(e,t,s){const n=b.useRef(s);b.useInsertionEffect(()=>{n.current=s});const r=b.useRef(null);return b.useCallback(o=>{var a;o&&((a=e.onMount)==null||a.call(e,o));const i=n.current;if(typeof i=="function")if(o){const c=i(o);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const Ao=b.createContext({});function tt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function af(e,t,s,n,r,o){var y,T;const{visualElement:i}=b.useContext(Ht),a=b.useContext(vo),c=b.useContext(Tt),d=b.useContext(mn),u=d.reducedMotion,f=d.skipAnimations,h=b.useRef(null),m=b.useRef(!1);n=n||a.renderer,!h.current&&n&&(h.current=n(e,{visualState:t,parent:i,props:s,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:o}),m.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const g=h.current,p=b.useContext(Ao);g&&!g.projection&&r&&(g.type==="html"||g.type==="svg")&&lf(h.current,s,r,p);const x=b.useRef(!1);b.useInsertionEffect(()=>{g&&x.current&&g.update(s,c)});const k=s[Gr],v=b.useRef(!!k&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,k))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,k)));return Fn(()=>{m.current=!0,g&&(x.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),v.current&&g.animationState&&g.animationState.animateChanges())}),b.useEffect(()=>{g&&(!v.current&&g.animationState&&g.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,k)}),v.current=!1),g.enteringChildren=void 0)}),g}function lf(e,t,s,n){const{layoutId:r,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:d,layoutAnchor:u,layoutCrossfade:f}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:Mo(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||a&&tt(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:c,layoutRoot:d,layoutAnchor:u})}function Mo(e){if(e)return e.options.allowProjection!==!1?e.projection:Mo(e.parent)}function xn(e,{forwardMotionProps:t=!1,type:s}={},n,r){n&&$u(n);const o=s?s==="svg":gn(e),i=o?nf:sf;function a(d,u){let f;const h={...b.useContext(mn),...d,layoutId:cf(d)},{isStatic:m}=h,g=Ku(d),p=i(d,m);if(!m&&typeof window<"u"){df(h,n);const x=uf(h);f=x.MeasureLayout,g.visualElement=af(e,p,h,r,x.ProjectionNode,o)}return l.jsxs(Ht.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,Qu(e,d,of(p,g.visualElement,u),p,m,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=b.forwardRef(a);return c[rf]=e,c}function cf({layoutId:e}){const t=b.useContext(as).id;return t&&e!==void 0?t+"-"+e:e}function df(e,t){const s=b.useContext(vo).strict;if(process.env.NODE_ENV!=="production"&&t&&s){const n="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ge(!1,n,"lazy-strict-mode"):Te(!1,n,"lazy-strict-mode")}}function uf(e){const t=jo(),{drag:s,layout:n}=t;if(!s&&!n)return{};const r={...s,...n};return{MeasureLayout:s!=null&&s.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ff(e,t){if(typeof Proxy>"u")return xn;const s=new Map,n=(o,i)=>xn(o,i,e,t),r=(o,i)=>(process.env.NODE_ENV!=="production"&&fs(!1,"motion() is deprecated. Use motion.create() instead."),n(o,i));return new Proxy(r,{get:(o,i)=>i==="create"?n:(s.has(i)||s.set(i,xn(i,void 0,e,t)),s.get(i))})}const hf=(e,t)=>t.isSVG??gn(e)?new $d(t):new Id(t,{allowProjection:e!==b.Fragment});class mf extends De{constructor(t){super(t),t.animationState||(t.animationState=Kd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let pf=0;class gf extends De{constructor(){super(...arguments),this.id=pf++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){const{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"){const c=Oe(this.node,i,a);if(c){const{transition:d,transitionEnd:u,...f}=c;for(const h in f)(o=this.node.getValue(h))==null||o.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!t);s&&!t&&r.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const xf={animation:{Feature:mf},exit:{Feature:gf}};function gt(e){return{point:{x:e.pageX,y:e.pageY}}}const yf=e=>t=>Zs(t)&&e(t,gt(t));function xt(e,t,s,n){return pt(e,t,yf(s),n)}const Eo=({current:e})=>e?e.ownerDocument.defaultView:null,Vo=(e,t)=>Math.abs(e-t);function bf(e,t){const s=Vo(e.x,t.x),n=Vo(e.y,t.y);return Math.sqrt(s**2+n**2)}const Do=new Set(["auto","scroll"]);class Lo{constructor(t,s,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Xt(this.lastRawMoveEventInfo,this.transformPagePoint));const m=yn(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,p=bf(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!p)return;const{point:x}=m,{timestamp:k}=re;this.history.push({...x,timestamp:k});const{onStart:v,onMove:y}=this.handlers;g||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Xt(g,this.transformPagePoint),F.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:p,onSessionEnd:x,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=yn(m.type==="pointercancel"?this.lastMoveEventInfo:Xt(g,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,v),x&&x(m,v)},!Zs(t))return;this.dragSnapToOrigin=o,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=r||window;const c=gt(t),d=Xt(c,this.transformPagePoint),{point:u}=d,{timestamp:f}=re;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=s;h&&h(t,yn(d,this.history)),this.removeListeners=it(xt(this.contextWindow,"pointermove",this.handlePointerMove),xt(this.contextWindow,"pointerup",this.handlePointerUp),xt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let s=t.parentElement;for(;s;){const n=getComputedStyle(s);(Do.has(n.overflowX)||Do.has(n.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const n=t===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-s.x,y:r.y-s.y};o.x===0&&o.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),F.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ae(this.updatePoint)}}function Xt(e,t){return t?{point:t(e.point)}:e}function Ro(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yn({point:e},t){return{point:e,delta:Ro(e,Io(t)),offset:Ro(e,vf(t)),velocity:wf(t,.1)}}function vf(e){return e[0]}function Io(e){return e[e.length-1]}function wf(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const r=Io(e);for(;s>=0&&(n=e[s],!(r.timestamp-n.timestamp>ue(t)));)s--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&r.timestamp-n.timestamp>ue(t)*2&&(n=e[1]);const o=he(r.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const i={x:(r.x-n.x)/o,y:(r.y-n.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function kf(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?W(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?W(s,e,n.max):Math.min(e,s)),e}function zo(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function jf(e,{top:t,left:s,bottom:n,right:r}){return{x:zo(e.x,s,r),y:zo(e.y,t,n)}}function _o(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function Tf(e,t){return{x:_o(e.x,t.x),y:_o(e.y,t.y)}}function Sf(e,t){let s=.5;const n=ce(e),r=ce(t);return r>n?s=ot(t.min,t.max-n,e.min):n>r&&(s=ot(e.min,e.max-r,t.min)),be(0,1,s)}function Nf(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const bn=.35;function Cf(e=bn){return e===!1?e=0:e===!0&&(e=bn),{x:Oo(e,"left","right"),y:Oo(e,"top","bottom")}}function Oo(e,t,s){return{min:Fo(e,t),max:Fo(e,s)}}function Fo(e,t){return typeof e=="number"?e:e[t]||0}const Pf=new WeakMap;class Af{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=ee(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{s&&this.snapToCursor(gt(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=td(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ke(k=>{let v=this.getAxisMotionValue(k).get()||0;if(ve.test(v)){const{projection:y}=this.visualElement;if(y&&y.layout){const T=y.layout.layoutBox[k];T&&(v=ce(T)*(parseFloat(v)/100))}}this.originPoint[k]=v}),p&&F.update(()=>p(f,h),!1,!0),Us(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:k}=h;if(g&&this.currentDirection===null){this.currentDirection=Ef(k),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),x&&F.update(()=>x(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Lo(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:Eo(this.visualElement),element:this.visualElement.current})}stop(t,s){const n=t||this.latestPointerEvent,r=s||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&F.postRender(()=>a(n,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,n){const{drag:r}=this.getProps();if(!n||!qt(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=kf(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,r=this.constraints;t&&tt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=jf(n.layoutBox,t):this.constraints=!1,this.elastic=Cf(s),r!==this.constraints&&!tt(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Nf(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!tt(t))return!1;const n=t.current;Te(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=Md(n,r.root,this.visualElement.getTransformPagePoint());let i=Tf(r.layout.layoutBox,o);if(s){const a=s(Cd(i));this.hasMutatedConstraints=!!a,a&&(i=xi(a))}return i}startAnimation(t){const{drag:s,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=ke(u=>{if(!qt(u,s,this.currentDirection))return;let f=c&&c[u]||{};(i===!0||i===u)&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(d).then(a)}startAxisValueAnimation(t,s){const n=this.getAxisMotionValue(t);return Us(this.visualElement,t),n.start(Bs(t,n,0,s,this.visualElement,!1))}stopAnimation(){ke(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),r=n[s];return r||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ke(s=>{const{drag:n}=this.getProps();if(!qt(s,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(s);if(r&&r.layout){const{min:i,max:a}=r.layout.layoutBox[s],c=o.get()||0;o.set(t[s]-W(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!tt(s)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();r[i]=Sf({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ke(i=>{if(!qt(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:d}=this.constraints[i];a.set(W(c,d,r[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Pf.set(this.visualElement,this);const t=this.visualElement.current,s=xt(t,"pointerdown",d=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=d.target,m=h!==t&&ad(h);u&&f&&!m&&this.start(d)});let n;const r=()=>{const{dragConstraints:d}=this.getProps();tt(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),n||(n=Mf(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),F.read(r);const a=pt(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:u})=>{this.isDragging&&u&&(ke(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=d[f].translate,h.set(h.get()+d[f].translate))}),this.visualElement.render())}));return()=>{a(),s(),i(),c&&c(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=bn,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function Bo(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Mf(e,t,s){const n=ci(e,Bo(s)),r=ci(t,Bo(s));return()=>{n(),r()}}function qt(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function Ef(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class Vf extends De{constructor(t){super(t),this.removeGroupControls=fe,this.removeListeners=fe,this.controls=new Af(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const vn=e=>(t,s)=>{e&&F.update(()=>e(t,s),!1,!0)};class Df extends De{constructor(){super(...arguments),this.removePointerDownListener=fe}onPointerDown(t){this.session=new Lo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Eo(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:vn(t),onStart:vn(s),onMove:vn(n),onEnd:(o,i)=>{delete this.session,r&&F.postRender(()=>r(o,i))}}}mount(){this.removePointerDownListener=xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let wn=!1;class Lf extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=t;o&&(s.group&&s.group.add(o),n&&n.register&&r&&n.register(o),wn&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:n,drag:r,isPresent:o}=this.props,{projection:i}=n;return i&&(i.isPresent=o,t.layoutDependency!==s&&i.setOptions({...i.options,layoutDependency:s}),wn=!0,r||t.layoutDependency!==s||s===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||F.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=s,n.root.didUpdate(),qs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:r}=t;wn=!0,r&&(r.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function $o(e){const[t,s]=yo(),n=b.useContext(as);return l.jsx(Lf,{...e,layoutGroup:n,switchLayoutGroup:b.useContext(Ao),isPresent:t,safeToRemove:s})}const Rf={pan:{Feature:Df},drag:{Feature:Vf,ProjectionNode:go,MeasureLayout:$o}};function Wo(e,t,s){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",s==="Start");const r="onHover"+s,o=n[r];o&&F.postRender(()=>o(t,gt(t)))}class If extends De{mount(){const{current:t}=this.node;t&&(this.unmount=nd(t,(s,n)=>(Wo(this.node,n,"Start"),r=>Wo(this.node,r,"End"))))}unmount(){}}class zf extends De{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=it(pt(this.node.current,"focus",()=>this.onFocus()),pt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Uo(e,t,s){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",s==="Start");const r="onTap"+(s==="End"?"":s),o=n[r];o&&F.postRender(()=>o(t,gt(t)))}class _f extends De{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:n}=this.node.props;this.unmount=cd(t,(r,o)=>(Uo(this.node,o,"Start"),(i,{success:a})=>Uo(this.node,i,a?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const kn=new WeakMap,jn=new WeakMap,Of=e=>{const t=kn.get(e.target);t&&t(e)},Ff=e=>{e.forEach(Of)};function Bf({root:e,...t}){const s=e||document;jn.has(s)||jn.set(s,{});const n=jn.get(s),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(Ff,{root:e,...t})),n[r]}function $f(e,t,s){const n=Bf(t);return kn.set(e,s),n.observe(e),()=>{kn.delete(e),n.unobserve(e)}}const Wf={some:0,all:1};class Uf extends De{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:s,margin:n,amount:r="some",once:o}=t,i={root:s?s.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:Wf[r]},a=d=>{const{isIntersecting:u}=d;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),m=u?f:h;m&&m(d)};this.stopObserver=$f(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(Gf(t,s))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Gf({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const Yf={...xf,...{inView:{Feature:Uf},tap:{Feature:_f},focus:{Feature:zf},hover:{Feature:If}},...Rf,...{layout:{ProjectionNode:go,MeasureLayout:$o}}},_=ff(Yf,hf);function Go(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=Go(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function Kf(){for(var e,t,s=0,n="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=Go(e))&&(n&&(n+=" "),n+=t);return n}const Hf=(e,t)=>{const s=new Array(e.length+t.length);for(let n=0;n<e.length;n++)s[n]=e[n];for(let n=0;n<t.length;n++)s[e.length+n]=t[n];return s},Xf=(e,t)=>({classGroupId:e,validator:t}),Yo=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Zt="-",Ko=[],qf="arbitrary..",Zf=e=>{const t=Qf(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Jf(i);const a=i.split(Zt),c=a[0]===""&&a.length>1?1:0;return Ho(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=n[i],d=s[i];return c?d?Hf(d,c):c:d||Ko}return s[i]||Ko}}},Ho=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],o=s.nextPart.get(r);if(o){const d=Ho(e,t+1,o);if(d)return d}const i=s.validators;if(i===null)return;const a=t===0?e.join(Zt):e.slice(t).join(Zt),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(a))return u.classGroupId}},Jf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),n=t.slice(0,s);return n?qf+n:void 0})(),Qf=e=>{const{theme:t,classGroups:s}=e;return eh(s,t)},eh=(e,t)=>{const s=Yo();for(const n in e){const r=e[n];Tn(r,s,n,t)}return s},Tn=(e,t,s,n)=>{const r=e.length;for(let o=0;o<r;o++){const i=e[o];th(i,t,s,n)}},th=(e,t,s,n)=>{if(typeof e=="string"){sh(e,t,s);return}if(typeof e=="function"){nh(e,t,s,n);return}rh(e,t,s,n)},sh=(e,t,s)=>{const n=e===""?t:Xo(t,e);n.classGroupId=s},nh=(e,t,s,n)=>{if(ih(e)){Tn(e(n),t,s,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Xf(s,e))},rh=(e,t,s,n)=>{const r=Object.entries(e),o=r.length;for(let i=0;i<o;i++){const[a,c]=r[i];Tn(c,Xo(t,a),s,n)}},Xo=(e,t)=>{let s=e;const n=t.split(Zt),r=n.length;for(let o=0;o<r;o++){const i=n[o];let a=s.nextPart.get(i);a||(a=Yo(),s.nextPart.set(i,a)),s=a}return s},ih=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,oh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),n=Object.create(null);const r=(o,i)=>{s[o]=i,t++,t>e&&(t=0,n=s,s=Object.create(null))};return{get(o){let i=s[o];if(i!==void 0)return i;if((i=n[o])!==void 0)return r(o,i),i},set(o,i){o in s?s[o]=i:r(o,i)}}},Sn="!",qo=":",ah=[],Zo=(e,t,s,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:n,isExternal:r}),lh=e=>{const{prefix:t,experimentalParseClassName:s}=e;let n=r=>{const o=[];let i=0,a=0,c=0,d;const u=r.length;for(let p=0;p<u;p++){const x=r[p];if(i===0&&a===0){if(x===qo){o.push(r.slice(c,p)),c=p+1;continue}if(x==="/"){d=p;continue}}x==="["?i++:x==="]"?i--:x==="("?a++:x===")"&&a--}const f=o.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(Sn)?(h=f.slice(0,-1),m=!0):f.startsWith(Sn)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Zo(o,m,h,g)};if(t){const r=t+qo,o=n;n=i=>i.startsWith(r)?o(i.slice(r.length)):Zo(ah,!1,i,void 0,!0)}if(s){const r=n;n=o=>s({className:o,parseClassName:r})}return n},ch=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,n)=>{t.set(s,1e6+n)}),s=>{const n=[];let r=[];for(let o=0;o<s.length;o++){const i=s[o],a=i[0]==="[",c=t.has(i);a||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},dh=e=>({cache:oh(e.cacheSize),parseClassName:lh(e),sortModifiers:ch(e),postfixLookupClassGroupIds:uh(e),...Zf(e)}),uh=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let n=0;n<s.length;n++)t[s[n]]=!0;return t},fh=/\s+/,hh=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:r,sortModifiers:o,postfixLookupClassGroupIds:i}=t,a=[],c=e.trim().split(fh);let d="";for(let u=c.length-1;u>=0;u-=1){const f=c[u],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:x}=s(f);if(h){d=f+(d.length>0?" "+d:d);continue}let k=!!x,v;if(k){const z=p.substring(0,x);v=n(z);const j=v&&i[v]?n(p):void 0;j&&j!==v&&(v=j,k=!1)}else v=n(p);if(!v){if(!k){d=f+(d.length>0?" "+d:d);continue}if(v=n(p),!v){d=f+(d.length>0?" "+d:d);continue}k=!1}const y=m.length===0?"":m.length===1?m[0]:o(m).join(":"),T=g?y+Sn:y,S=T+v;if(a.indexOf(S)>-1)continue;a.push(S);const E=r(v,k);for(let z=0;z<E.length;++z){const j=E[z];a.push(T+j)}d=f+(d.length>0?" "+d:d)}return d},mh=(...e)=>{let t=0,s,n,r="";for(;t<e.length;)(s=e[t++])&&(n=Jo(s))&&(r&&(r+=" "),r+=n);return r},Jo=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=Jo(e[n]))&&(s&&(s+=" "),s+=t);return s},ph=(e,...t)=>{let s,n,r,o;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return s=dh(d),n=s.cache.get,r=s.cache.set,o=a,a(c)},a=c=>{const d=n(c);if(d)return d;const u=hh(c,s);return r(c,u),u};return o=i,(...c)=>o(mh(...c))},gh=[],te=e=>{const t=s=>s[e]||gh;return t.isThemeGetter=!0,t},Qo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ea=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>xh.test(e),I=e=>!!e&&!Number.isNaN(Number(e)),je=e=>!!e&&Number.isInteger(Number(e)),Nn=e=>e.endsWith("%")&&I(e.slice(0,-1)),Se=e=>yh.test(e),ta=()=>!0,jh=e=>bh.test(e)&&!vh.test(e),Cn=()=>!1,Th=e=>wh.test(e),Sh=e=>kh.test(e),Nh=e=>!N(e)&&!C(e),Ch=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ph=e=>Re(e,aa,Cn),N=e=>Qo.test(e),$e=e=>Re(e,la,jh),sa=e=>Re(e,Ih,I),Ah=e=>Re(e,da,ta),Mh=e=>Re(e,ca,Cn),na=e=>Re(e,ia,Cn),Eh=e=>Re(e,oa,Sh),Jt=e=>Re(e,ua,Th),C=e=>ea.test(e),yt=e=>We(e,la),Vh=e=>We(e,ca),ra=e=>We(e,ia),Dh=e=>We(e,aa),Lh=e=>We(e,oa),Qt=e=>We(e,ua,!0),Rh=e=>We(e,da,!0),Re=(e,t,s)=>{const n=Qo.exec(e);return n?n[1]?t(n[1]):s(n[2]):!1},We=(e,t,s=!1)=>{const n=ea.exec(e);return n?n[1]?t(n[1]):s:!1},ia=e=>e==="position"||e==="percentage",oa=e=>e==="image"||e==="url",aa=e=>e==="length"||e==="size"||e==="bg-size",la=e=>e==="length",Ih=e=>e==="number",ca=e=>e==="family-name",da=e=>e==="number"||e==="weight",ua=e=>e==="shadow",zh=ph(()=>{const e=te("color"),t=te("font"),s=te("text"),n=te("font-weight"),r=te("tracking"),o=te("leading"),i=te("breakpoint"),a=te("container"),c=te("spacing"),d=te("radius"),u=te("shadow"),f=te("inset-shadow"),h=te("text-shadow"),m=te("drop-shadow"),g=te("blur"),p=te("perspective"),x=te("aspect"),k=te("ease"),v=te("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...T(),C,N],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[C,N,c],V=()=>[Le,"full","auto",...j()],D=()=>[je,"none","subgrid",C,N],O=()=>["auto",{span:["full",je,C,N]},je,C,N],$=()=>[je,"auto",C,N],de=()=>["auto","min","max","fr",C,N],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],ye=()=>[Le,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],Y=()=>[Le,"screen","full","dvw","lvw","svw","min","max","fit",...j()],se=()=>[Le,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],A=()=>[e,C,N],w=()=>[...T(),ra,na,{position:[C,N]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",Dh,Ph,{size:[C,N]}],X=()=>[Nn,yt,$e],Q=()=>["","none","full",d,C,N],ne=()=>["",I,yt,$e],K=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[I,Nn,ra,na],ts=()=>["","none",g,C,N],ss=()=>["none",I,C,N],ns=()=>["none",I,C,N],An=()=>[I,C,N],rs=()=>[Le,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Se],breakpoint:[Se],color:[ta],container:[Se],"drop-shadow":[Se],ease:["in","out","in-out"],font:[Nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Se],shadow:[Se],spacing:["px",I],text:[Se],"text-shadow":[Se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Le,N,C,x]}],container:["container"],"container-type":[{"@container":["","normal","size",C,N]}],"container-named":[Ch],columns:[{columns:[I,N,C,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[je,"auto",C,N]}],basis:[{basis:[Le,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[I,Le,"auto","initial","none",N]}],grow:[{grow:["",I,C,N]}],shrink:[{shrink:["",I,C,N]}],order:[{order:[je,"first","last","none",C,N]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:ye()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[a,"screen",...ye()]}],"min-w":[{"min-w":[a,"screen","none",...ye()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...ye()]}],h:[{h:["screen","lh",...ye()]}],"min-h":[{"min-h":["screen","lh","none",...ye()]}],"max-h":[{"max-h":["screen","lh",...ye()]}],"font-size":[{text:["base",s,yt,$e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Rh,Ah]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nn,N]}],"font-family":[{font:[Vh,Mh,t]}],"font-features":[{"font-features":[N]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,C,N]}],"line-clamp":[{"line-clamp":[I,"none",C,sa]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",C,N]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",C,N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[I,"from-font","auto",C,$e]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[I,"auto",C,N]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[je,C,N]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C,N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C,N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:w()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},je,C,N],radial:["",C,N],conic:[je,C,N]},Lh,Eh]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[I,C,N]}],"outline-w":[{outline:["",I,yt,$e]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,Qt,Jt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,Qt,Jt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[I,$e]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",h,Qt,Jt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[I,C,N]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[C,N]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:w()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",C,N]}],filter:[{filter:["","none",C,N]}],blur:[{blur:ts()}],brightness:[{brightness:[I,C,N]}],contrast:[{contrast:[I,C,N]}],"drop-shadow":[{"drop-shadow":["","none",m,Qt,Jt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",I,C,N]}],"hue-rotate":[{"hue-rotate":[I,C,N]}],invert:[{invert:["",I,C,N]}],saturate:[{saturate:[I,C,N]}],sepia:[{sepia:["",I,C,N]}],"backdrop-filter":[{"backdrop-filter":["","none",C,N]}],"backdrop-blur":[{"backdrop-blur":ts()}],"backdrop-brightness":[{"backdrop-brightness":[I,C,N]}],"backdrop-contrast":[{"backdrop-contrast":[I,C,N]}],"backdrop-grayscale":[{"backdrop-grayscale":["",I,C,N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,C,N]}],"backdrop-invert":[{"backdrop-invert":["",I,C,N]}],"backdrop-opacity":[{"backdrop-opacity":[I,C,N]}],"backdrop-saturate":[{"backdrop-saturate":[I,C,N]}],"backdrop-sepia":[{"backdrop-sepia":["",I,C,N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",C,N]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[I,"initial",C,N]}],ease:[{ease:["linear","initial",k,C,N]}],delay:[{delay:[I,C,N]}],animate:[{animate:["none",v,C,N]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,C,N]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ss()}],"rotate-x":[{"rotate-x":ss()}],"rotate-y":[{"rotate-y":ss()}],"rotate-z":[{"rotate-z":ss()}],scale:[{scale:ns()}],"scale-x":[{"scale-x":ns()}],"scale-y":[{"scale-y":ns()}],"scale-z":[{"scale-z":ns()}],"scale-3d":["scale-3d"],skew:[{skew:An()}],"skew-x":[{"skew-x":An()}],"skew-y":[{"skew-y":An()}],transform:[{transform:[C,N,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:rs()}],"translate-x":[{"translate-x":rs()}],"translate-y":[{"translate-y":rs()}],"translate-z":[{"translate-z":rs()}],"translate-none":["translate-none"],zoom:[{zoom:[je,C,N]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C,N]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C,N]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[I,yt,$e,sa]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function M(...e){return zh(Kf(e))}const _h=({title:e,children:t,className:s})=>{const[n,r]=b.useState(!1);return l.jsxs("div",{className:M("glass-card overflow-hidden p-0 border border-border/50",s),children:[l.jsxs("button",{type:"button",onClick:()=>r(!n),className:"w-full px-6 py-4 flex items-center justify-between font-bold text-foreground text-left cursor-pointer hover:bg-secondary/20 transition-colors",children:[l.jsx("span",{children:e}),l.jsx(In,{size:18,className:M("text-muted-foreground transition-transform duration-200",n&&"rotate-180")})]}),l.jsx(oe,{initial:!1,children:n&&l.jsx(_.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.2},className:"overflow-hidden",children:l.jsx("div",{className:"px-6 pb-5 pt-2 border-t border-border/40 text-sm text-muted-foreground leading-relaxed",children:t})})})]})},fa={success:"border-green-500/20 bg-green-500/5",error:"border-red-500/20 bg-red-500/5",warning:"border-amber-500/20 bg-amber-500/5",info:"border-blue-500/20 bg-blue-500/5"},ha={success:{title:"var(--alert-success-title, #14532d)",desc:"var(--alert-success-desc, #15803d)"},error:{title:"var(--alert-error-title, #7f1d1d)",desc:"var(--alert-error-desc, #b91c1c)"},warning:{title:"var(--alert-warning-title, #78350f)",desc:"var(--alert-warning-desc, #b45309)"},info:{title:"var(--alert-info-title, #1e3a8a)",desc:"var(--alert-info-desc, #1d4ed8)"}},Oh=({title:e,description:t,variant:s="info",dismissible:n=!1,className:r})=>{const[o,i]=b.useState(!0),a=ha[s]||ha.info,c={success:l.jsx(kt,{size:18,style:{color:a.title}}),error:l.jsx(zn,{size:18,style:{color:a.title}}),warning:l.jsx(os,{size:18,style:{color:a.title}}),info:l.jsx(jt,{size:18,style:{color:a.title}})};return l.jsx(oe,{children:o&&l.jsxs(_.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:M("flex items-start gap-4 p-4 rounded-2xl border text-left",fa[s]||fa.info,r),children:[l.jsx("div",{className:"mt-0.5 shrink-0",children:c[s]||c.info}),l.jsxs("div",{className:"flex-1 space-y-1",children:[e&&l.jsx("h4",{style:{color:a.title},className:"font-bold text-sm leading-none",children:e}),t&&l.jsx("p",{style:{color:a.desc},className:"text-xs leading-relaxed font-medium",children:t})]}),n&&l.jsx("button",{type:"button",onClick:()=>i(!1),style:{color:a.title},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg transition-colors cursor-pointer shrink-0",children:l.jsx(Ce,{size:14})})]})})},ma={sm:"h-8 w-8 text-xs",md:"h-11 w-11 text-sm",lg:"h-14 w-14 text-base"},pa={online:"bg-emerald-500 ring-emerald-500/20",offline:"bg-zinc-400 ring-zinc-400/20",busy:"bg-destructive ring-destructive/20",syncing:"bg-primary ring-primary/20 animate-pulse"},Fh=({src:e,alt:t="User Profile",name:s="",size:n="md",status:r,className:o})=>{const i=s?s.split(" ").map(a=>a[0]).slice(0,2).join("").toUpperCase():"";return l.jsxs("div",{className:"relative inline-block shrink-0",children:[l.jsx("div",{className:M("relative rounded-full overflow-hidden flex items-center justify-center border border-border/80 shadow-md bg-secondary/50 font-bold text-foreground font-sans",ma[n]||ma.md,o),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx("span",{children:i||"?"})}),r&&pa[r]&&l.jsx("span",{className:M("absolute bottom-0 right-0 block h-2.5 w-2.5 rounded-full ring-2 ring-background",pa[r])})]})},bt=({children:e,className:t,...s})=>l.jsx("div",{className:M("bg-card border border-border rounded-3xl p-6 transition-all duration-300",t),...s,children:e}),Ue=({label:e,error:t,icon:s,className:n,id:r,...o})=>l.jsxs("div",{className:M("space-y-1.5 w-full text-left",n),children:[e&&l.jsx("label",{htmlFor:r,className:"text-sm font-semibold text-foreground ml-1",children:e}),l.jsxs("div",{className:"relative group",children:[s&&l.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground group-focus-within:text-primary transition-colors",children:l.jsx(s,{size:18})}),l.jsx("input",{id:r,className:M("glass-input w-full",s&&"pl-11",t&&"ring-2 ring-destructive/50 border-destructive/50"),...o})]}),t&&l.jsx(_.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-xs text-destructive ml-1 font-medium",children:t})]}),xe=({children:e,className:t,variant:s="primary",loading:n=!1,...r})=>{const o={primary:"btn-primary",secondary:"btn-secondary",outline:"btn-outline",ghost:"btn-ghost",glass:"btn-glass",destructive:"btn-destructive"};return l.jsxs(_.button,{whileHover:{y:-2},whileTap:{scale:.98},className:M("relative overflow-hidden",o[s],n&&"opacity-70 cursor-not-allowed",t),disabled:n||r.disabled,...r,children:[n&&l.jsxs("svg",{className:"animate-spin h-5 w-5 text-current shrink-0",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e,l.jsx("div",{className:"absolute inset-0 w-full h-full bg-gradient-to-r from-transparent via-white/10 to-transparent -translate-x-full hover:animate-[shine_1.5s_infinite]"})]})},Pn=({checked:e=!1,onChange:t,label:s,className:n})=>l.jsxs("label",{className:M("inline-flex items-center gap-3 cursor-pointer select-none text-left",n),children:[l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:"checkbox",checked:e,onChange:r=>t&&t(r.target.checked),className:"sr-only"}),l.jsx(_.div,{className:M("w-5 h-5 rounded-lg border flex items-center justify-center transition-colors duration-200",e?"bg-primary border-primary":"bg-white/40 border-input dark:bg-black/20"),children:l.jsx(oe,{children:e&&l.jsx(_.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:"spring",stiffness:500,damping:30},children:l.jsx(Ba,{size:12,className:"text-primary-foreground stroke-[4px]"})})})})]}),s&&l.jsx("span",{className:"text-sm font-semibold text-foreground leading-none",children:s})]}),Bh=({initialMode:e="login",onLogin:t,onRegister:s,onForgotPassword:n,logo:r=Ga,title:o="Ether UI Console",className:i})=>{const[a,c]=b.useState(e),[d,u]=b.useState(""),[f,h]=b.useState(""),[m,g]=b.useState(""),[p,x]=b.useState(!1),[k,v]=b.useState(!1),[y,T]=b.useState(!1),S=async E=>{E.preventDefault(),T(!0);try{a==="login"&&t?await t({email:f,password:m,rememberMe:p}):a==="register"&&s?await s({name:d,email:f,password:m,acceptTerms:k}):a==="forgot"&&n&&await n({email:f})}finally{T(!1)}};return l.jsxs("div",{className:M("min-h-screen w-full flex items-center justify-center p-6 relative bg-background overflow-hidden",i),children:[l.jsx("div",{className:"absolute top-1/4 left-1/4 w-[400px] h-[400px] bg-primary/5 rounded-full blur-[120px] pointer-events-none animate-pulse"}),l.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-[400px] h-[400px] bg-primary/10 rounded-full blur-[120px] pointer-events-none animate-pulse duration-4000"}),l.jsx("div",{className:"w-full max-w-md z-10",children:l.jsxs(oe,{mode:"wait",children:[a==="login"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("div",{className:"inline-flex items-center justify-center p-3 rounded-2xl bg-primary/10 text-primary mb-2",children:l.jsx(r,{size:28,className:"animate-pulse"})}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground",children:o}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Welcome back! Sign in to manage your ledgers."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Email Address",type:"email",placeholder:"name@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(Ue,{label:"Password",type:"password",placeholder:"••••••••",value:m,onChange:E=>g(E.target.value),required:!0}),l.jsxs("div",{className:"flex items-center justify-between text-xs pt-1",children:[l.jsx(Pn,{label:"Remember me",checked:p,onChange:x}),l.jsx("button",{type:"button",onClick:()=>c("forgot"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Forgot password?"})]}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 mt-2",children:"Sign In to Console"})]}),l.jsxs("div",{className:"text-center text-xs text-muted-foreground border-t border-border/40 pt-4",children:["Don't have an account?"," ",l.jsx("button",{type:"button",onClick:()=>c("register"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Create one now"})]})]})},"login"),a==="register"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("div",{className:"inline-flex items-center justify-center p-3 rounded-2xl bg-primary/10 text-primary mb-2",children:l.jsx(r,{size:28})}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground",children:"Create Account"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Sign up to unlock real-time financial synchrony."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Full Name",type:"text",placeholder:"Alex Carter",value:d,onChange:E=>u(E.target.value),required:!0}),l.jsx(Ue,{label:"Work Email",type:"email",placeholder:"alex@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(Ue,{label:"Choose Password",type:"password",placeholder:"••••••••",value:m,onChange:E=>g(E.target.value),required:!0}),l.jsx("div",{className:"flex items-start pt-1",children:l.jsx(Pn,{label:"I agree to the Terms & Conditions",checked:k,onChange:v})}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 mt-2",children:"Register Workspace"})]}),l.jsxs("div",{className:"text-center text-xs text-muted-foreground border-t border-border/40 pt-4",children:["Already have an account?"," ",l.jsx("button",{type:"button",onClick:()=>c("login"),className:"font-bold text-primary hover:underline cursor-pointer",children:"Sign in instead"})]})]})},"register"),a==="forgot"&&l.jsx(_.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.25},children:l.jsxs(bt,{className:"p-8 space-y-6",children:[l.jsxs("div",{className:"space-y-2 text-left",children:[l.jsxs("button",{type:"button",onClick:()=>c("login"),className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground font-bold cursor-pointer transition-colors",children:[l.jsx(Oa,{size:12})," Back to Sign In"]}),l.jsx("h3",{className:"text-2xl font-extrabold tracking-tight text-foreground pt-2",children:"Recover Access"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your verified work email, and we will send a password restoration link."})]}),l.jsxs("form",{onSubmit:S,className:"space-y-4",children:[l.jsx(Ue,{label:"Registered Email Address",type:"email",placeholder:"alex@company.com",value:f,onChange:E=>h(E.target.value),required:!0}),l.jsx(xe,{type:"submit",variant:"primary",loading:y,className:"w-full justify-center py-3 pt-2",children:"Send Recovery Link"})]})]})},"forgot")]})})]})},ga=({children:e,variant:t="default",className:s})=>{const n={default:"bg-secondary text-secondary-foreground border-border",primary:"bg-primary text-primary-foreground border-primary",success:"bg-emerald-50 text-emerald-700 border-emerald-100 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-500/20",warning:"bg-amber-50 text-amber-700 border-amber-100 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20",danger:"bg-destructive text-destructive-foreground border-destructive"};return l.jsx("span",{className:M("px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wider border inline-flex items-center justify-center",n[t],s),children:e})},xa=({isOpen:e,onClose:t,title:s,children:n,className:r,width:o})=>l.jsx(oe,{children:e&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx(_.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),l.jsxs(_.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:M("relative w-full max-w-lg glass-card overflow-hidden p-0 flex flex-col max-h-[90vh] text-left",o,r),children:[l.jsxs("div",{className:"flex items-center justify-between px-7 py-5 border-b border-border shrink-0",children:[l.jsx("h3",{className:"text-xl font-bold text-foreground",children:s}),l.jsx("button",{onClick:t,className:"p-2 rounded-xl hover:bg-secondary text-muted-foreground hover:text-foreground transition-all cursor-pointer",children:l.jsx(Ce,{size:20})})]}),l.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:n})]})]})}),$h=({isOpen:e,onClose:t,onConfirm:s,title:n="Are you sure?",message:r="This action cannot be undone.",confirmText:o="Confirm",cancelText:i="Cancel",confirmVariant:a="destructive",loading:c=!1})=>l.jsx(xa,{isOpen:e,onClose:t,title:n,className:"max-w-md",children:l.jsxs("div",{className:"space-y-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsx(xe,{variant:"ghost",onClick:t,disabled:c,children:i}),l.jsx(xe,{variant:a,onClick:s,loading:c,children:o})]})]})}),Wh=({label:e,options:t=[],value:s,onChange:n,placeholder:r="Select option",className:o})=>{const[i,a]=b.useState(!1),c=b.useRef(null),d=t.find(u=>u.value===s);return b.useEffect(()=>{const u=f=>{c.current&&!c.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]),l.jsxs("div",{ref:c,className:M("space-y-1.5 w-full text-left relative",o),children:[e&&l.jsx("label",{className:"text-sm font-semibold text-foreground ml-1",children:e}),l.jsx("div",{children:l.jsxs("button",{type:"button",onClick:()=>a(!i),className:"glass-input w-full flex items-center justify-between cursor-pointer focus:ring-2 focus:ring-ring/10 text-left",children:[l.jsx("span",{className:M(!d&&"text-muted-foreground/60"),children:d?d.label:r}),l.jsx(In,{size:18,className:M("text-muted-foreground transition-transform duration-200",i&&"rotate-180")})]})}),l.jsx(oe,{children:i&&l.jsx(_.div,{initial:{opacity:0,y:5,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:5,scale:.98},transition:{duration:.15},className:"absolute z-50 w-full mt-2 glass-panel rounded-2xl overflow-hidden shadow-2xl p-1 max-h-60 overflow-y-auto custom-scrollbar",children:t.map((u,f)=>{const h=u.value===s;return l.jsx("button",{type:"button",onClick:()=>{n&&n(u.value),a(!1)},className:M("w-full text-left px-4 py-2.5 rounded-xl text-sm transition-colors cursor-pointer",h?"bg-primary text-primary-foreground font-semibold":"hover:bg-secondary text-foreground"),children:u.label},u.value||f)})})})]})},Uh=({onFilesAdded:e,accept:t="*",maxFiles:s=5,maxSizeMB:n=10,className:r})=>{const[o,i]=b.useState(!1),[a,c]=b.useState([]),d=b.useRef(null),u=p=>{p.preventDefault(),p.stopPropagation(),p.type==="dragenter"||p.type==="dragover"?i(!0):p.type==="dragleave"&&i(!1)},f=p=>{const x=Array.from(p).map(v=>{const T=v.size/1048576>n;return{id:Math.random().toString(36).substring(7),name:v.name,size:(v.size/1024).toFixed(1)+" KB",rawFile:v,progress:0,status:T?"failed":"uploading",error:T?`File exceeds limit of ${n}MB`:null}}),k=[...a,...x].slice(0,s);c(k),e&&e(k.map(v=>v.rawFile)),x.forEach(v=>{if(v.status==="failed")return;let y=0;const T=setInterval(()=>{y+=Math.floor(Math.random()*15)+5,y>=100?(y=100,clearInterval(T),c(S=>S.map(E=>E.id===v.id?{...E,progress:100,status:"success"}:E))):c(S=>S.map(E=>E.id===v.id?{...E,progress:y}:E))},150)})},h=p=>{p.preventDefault(),p.stopPropagation(),i(!1),p.dataTransfer.files&&p.dataTransfer.files[0]&&f(p.dataTransfer.files)},m=p=>{p.target.files&&p.target.files[0]&&f(p.target.files)},g=p=>{c(a.filter(x=>x.id!==p))};return l.jsxs("div",{className:M("space-y-4 w-full text-left",r),children:[l.jsxs("div",{onDragEnter:u,onDragOver:u,onDragLeave:u,onDrop:h,onClick:()=>d.current&&d.current.click(),className:M("relative border-2 border-dashed rounded-2xl p-8 flex flex-col items-center justify-center gap-3 cursor-pointer select-none transition-all duration-300 min-h-[160px]",o?"border-primary bg-primary/5 scale-[0.99] shadow-md shadow-primary/5":"bg-white/40 border-border dark:bg-black/20 hover:border-primary/50 hover:bg-secondary/20"),children:[l.jsx("input",{ref:d,type:"file",multiple:!0,accept:t,onChange:m,className:"hidden"}),l.jsx(_.div,{animate:o?{scale:1.1,y:-2}:{scale:1,y:0},className:M("p-3 rounded-2xl transition-colors",o?"bg-primary text-primary-foreground":"bg-primary/10 text-primary"),children:l.jsx(Wa,{size:24})}),l.jsxs("div",{className:"text-center space-y-1",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:o?"Drop files to stage them!":"Drag & Drop files here"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or click to browse storage (Max ",s," files, limit ",n,"MB)"]})]})]}),l.jsx(oe,{children:a.length>0&&l.jsxs(_.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:"space-y-2 border border-border/40 bg-card/60 rounded-2xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/20",children:[l.jsxs("span",{className:"text-[10px] font-black uppercase tracking-widest text-muted-foreground",children:["Upload Queue (",a.length,")"]}),l.jsx("button",{onClick:()=>c([]),className:"text-[10px] font-bold text-destructive hover:underline",children:"Clear All"})]}),l.jsx("div",{className:"space-y-3 max-h-[220px] overflow-y-auto custom-scrollbar pr-1",children:a.map(p=>l.jsxs(_.div,{layout:!0,initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:10},className:"flex items-center justify-between gap-4 p-2.5 rounded-xl bg-secondary/30 border border-border/10 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l.jsx("div",{className:"p-2 rounded-lg bg-card border border-border/20 text-muted-foreground shrink-0",children:l.jsx(Ua,{size:16})}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("p",{className:"font-semibold text-foreground truncate",children:p.name}),l.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:p.size})]}),p.status==="uploading"&&l.jsx("div",{className:"w-full bg-secondary/50 rounded-full h-1 overflow-hidden",children:l.jsx(_.div,{className:"bg-primary h-full rounded-full",animate:{width:`${p.progress}%`},transition:{duration:.1}})}),p.status==="failed"&&l.jsx("p",{className:"text-[10px] font-bold text-destructive truncate",children:p.error}),p.status==="success"&&l.jsxs("p",{className:"text-[10px] font-bold text-primary flex items-center gap-1",children:[l.jsx(kt,{size:10})," Upload complete!"]})]})]}),l.jsx("button",{onClick:()=>g(p.id),className:"p-1 hover:bg-secondary rounded-lg text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:l.jsx(Ce,{size:14})})]},p.id))})]})})]})},Gh=({isOpen:e=!1,onClose:t,notifications:s=[],onClearAll:n,onDismiss:r,className:o})=>l.jsx(oe,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(_.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 z-40 bg-black/30 backdrop-blur-sm cursor-pointer"}),l.jsxs(_.aside,{initial:{x:"110%",opacity:0},animate:{x:0,opacity:1},exit:{x:"110%",opacity:0},transition:{type:"spring",stiffness:380,damping:32},className:M("fixed top-4 right-4 z-50 h-[calc(100vh-2rem)] w-[calc(100%-2rem)] max-w-sm bg-card/95 backdrop-blur-xl border border-border/50 shadow-2xl rounded-3xl flex flex-col text-left overflow-hidden",o),children:[l.jsxs("div",{className:"p-4 border-b border-border/40 flex items-center justify-between min-h-[72px] shrink-0 bg-card/65 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"p-2 rounded-xl bg-primary/10 text-primary",children:l.jsx(Rn,{size:18,className:"animate-bounce"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-extrabold text-foreground",children:"Notifications"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Alert console logs"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[s.length>0&&l.jsx("button",{onClick:n,className:"p-2 hover:bg-secondary rounded-xl text-muted-foreground hover:text-destructive cursor-pointer transition-colors",title:"Clear All",children:l.jsx(On,{size:16})}),l.jsx("button",{onClick:t,className:"p-2 hover:bg-secondary rounded-xl text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:l.jsx(Ce,{size:16})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-4 space-y-3",children:l.jsx(oe,{initial:!1,children:s.length===0?l.jsxs(_.div,{initial:{opacity:0},animate:{opacity:1},className:"h-full flex flex-col items-center justify-center text-center gap-3 py-12",children:[l.jsx("div",{className:"p-4 rounded-full bg-secondary/40 text-muted-foreground",children:l.jsx(Rn,{size:32,className:"opacity-50"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-xs font-bold text-foreground",children:"Zero unread notifications"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"All operational tasks succeeded!"})]})]}):s.map(i=>{const a=i.type==="success",c=i.type==="warning";return l.jsxs(_.div,{layout:!0,initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"p-3.5 rounded-2xl bg-secondary/20 border border-border/10 flex items-start gap-3 relative overflow-hidden group hover:border-border/30 transition-all text-xs",children:[i.unread&&l.jsxs("span",{className:"absolute top-3.5 right-3.5 flex h-2 w-2",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),l.jsxs("div",{className:M("p-2 rounded-xl shrink-0 border border-border/10",a&&"bg-emerald-500/10 text-emerald-500",c&&"bg-amber-500/10 text-amber-500",!a&&!c&&"bg-sky-500/10 text-sky-500"),children:[a&&l.jsx(kt,{size:16}),c&&l.jsx(os,{size:16}),!a&&!c&&l.jsx(jt,{size:16})]}),l.jsxs("div",{className:"flex-1 space-y-1.5 pr-4 text-left",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx("p",{className:"font-bold text-foreground",children:i.title}),l.jsx("span",{className:"text-[9px] text-muted-foreground font-medium",children:i.timestamp})]}),l.jsx("p",{className:"text-muted-foreground text-[11px] leading-relaxed",children:i.description})]}),l.jsx("button",{onClick:()=>r&&r(i.id),className:"absolute bottom-3 right-3 p-1 hover:bg-secondary rounded-lg text-muted-foreground hover:text-foreground cursor-pointer transition-colors opacity-0 group-hover:opacity-100",title:"Dismiss notification",children:l.jsx(Ce,{size:12})})]},i.id)})})})]})]})}),Yh=({currentPage:e=1,totalPages:t=1,onPageChange:s,loading:n=!1})=>{if(t<=1)return null;const o=((i,a)=>a<=5?Array.from({length:a},(c,d)=>d+1):i<=3?[1,2,3,4,"...",a]:i>=a-2?[1,"...",a-3,a-2,a-1,a]:[1,"...",i-1,i,i+1,"...",a])(e,t);return l.jsxs("div",{className:"flex items-center justify-between py-2 mt-6 w-full",children:[l.jsxs("div",{className:"flex-1 flex justify-between sm:hidden",children:[l.jsx(xe,{variant:"outline",className:"text-foreground font-semibold",onClick:()=>s(e-1),disabled:e===1||n,children:"Previous"}),l.jsx(xe,{variant:"outline",className:"text-foreground font-semibold",onClick:()=>s(e+1),disabled:e===t||n,children:"Next"})]}),l.jsxs("div",{className:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[l.jsx("div",{children:l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Page ",l.jsx("span",{className:"font-bold text-foreground",children:e})," of"," ",l.jsx("span",{className:"font-bold text-foreground",children:t})]})}),l.jsx("div",{children:l.jsxs("nav",{className:"relative z-0 inline-flex gap-1.5 rounded-md shadow-sm","aria-label":"Pagination",children:[l.jsxs(xe,{variant:"outline",className:"p-2.5 rounded-xl shrink-0 text-foreground",onClick:()=>s(e-1),disabled:e===1||n,children:[l.jsx("span",{className:"sr-only",children:"Previous"}),l.jsx(is,{size:16})]}),o.map((i,a)=>{if(i==="...")return l.jsx("div",{className:"flex items-end justify-center px-1 pb-1",children:l.jsx("span",{className:"text-muted-foreground tracking-widest leading-none font-bold",children:"..."})},`dots-${a}`);const c=e===i;return l.jsx(xe,{variant:c?"primary":"outline",className:`w-10 h-10 p-0 rounded-xl shrink-0 font-mono text-xs font-semibold ${c?"":"text-muted-foreground hover:text-foreground"}`,onClick:()=>s(i),disabled:n,children:i},i)}),l.jsxs(xe,{variant:"outline",className:"p-2.5 rounded-xl shrink-0 text-foreground",onClick:()=>s(e+1),disabled:e===t||n,children:[l.jsx("span",{className:"sr-only",children:"Next"}),l.jsx(rt,{size:16})]})]})})]})]})},es=({size:e="md",className:t})=>{const s={sm:"h-4 w-4 stroke-[3px]",md:"h-8 w-8 stroke-[2px]",lg:"h-12 w-12 stroke-[1.5px]"};return l.jsx("div",{className:M("flex items-center justify-center",t),children:l.jsxs("svg",{className:M("animate-spin text-primary shrink-0",s[e]),viewBox:"0 0 24 24",fill:"none",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})};function Kh({docs:e=[],label:t="Upload Plans",adding:s=!1,replacing:n={},onAddDocs:r,onReplaceDoc:o,onRemoveDoc:i,onView:a}){return l.jsx("div",{className:"space-y-3",children:e.length>0?l.jsxs("div",{className:"flex flex-wrap gap-3 items-start",children:[e.map(c=>{var d;return l.jsxs("div",{className:"group/doc flex flex-col gap-1.5",children:[l.jsxs("button",{type:"button",onClick:()=>a==null?void 0:a(c.currentUrl),className:"relative w-20 h-20 rounded-xl overflow-hidden border border-border/50 hover:border-primary/50 hover:ring-2 hover:ring-primary/20 transition-all bg-secondary/20",title:"View full screen",children:[(d=c.currentUrl)!=null&&d.endsWith(".pdf")?l.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-1",children:[l.jsx("span",{className:"text-2xl leading-none",children:"📄"}),l.jsx("span",{className:"text-[8px] font-bold text-muted-foreground",children:"PDF"})]}):l.jsx("img",{src:c.currentUrl,alt:c.name,className:"w-full h-full object-cover"}),l.jsxs("span",{className:"absolute top-1 right-1 text-[10px] font-extrabold px-1.5 py-0.5 rounded-md bg-black/65 text-white leading-none",children:["v",c.currentV]}),n[c.docId]&&l.jsx("div",{className:"absolute inset-0 bg-card/70 backdrop-blur-sm flex items-center justify-center",children:l.jsx(es,{size:"sm"})})]}),l.jsx("p",{className:"text-[9px] font-semibold text-muted-foreground truncate w-20 text-center leading-tight",children:c.name}),l.jsxs("div",{className:"flex gap-1 justify-center opacity-0 group-hover/doc:opacity-100 transition-opacity",children:[l.jsxs("label",{className:"cursor-pointer p-1 rounded-lg bg-secondary/50 hover:bg-secondary border border-border/50 transition-colors text-muted-foreground hover:text-foreground",title:"Replace with new version",children:[l.jsx(qa,{size:9}),l.jsx("input",{type:"file",accept:"image/*,.pdf",className:"hidden",onChange:u=>{var f;return((f=u.target.files)==null?void 0:f[0])&&(o==null?void 0:o(c.docId,u.target.files[0]))}})]}),l.jsx("button",{type:"button",onClick:()=>i==null?void 0:i(c.docId),className:"p-1 rounded-lg bg-destructive/10 hover:bg-destructive/20 border border-destructive/20 text-destructive transition-colors",title:"Remove",children:l.jsx(On,{size:9})})]})]},c.docId)}),l.jsxs("label",{className:`flex flex-col items-center justify-center w-20 h-20 rounded-xl border-2 border-dashed cursor-pointer transition-all gap-1 self-start
181
181
  ${s?"pointer-events-none opacity-50 border-border/30":"border-border/50 hover:border-primary/50 hover:bg-primary/5"}`,title:"Add more documents",children:[s?l.jsx(es,{size:"sm"}):l.jsxs(l.Fragment,{children:[l.jsx(Za,{size:16,className:"text-muted-foreground"}),l.jsx("span",{className:"text-[9px] font-bold text-muted-foreground text-center leading-tight",children:"Add More"})]}),l.jsx("input",{type:"file",accept:"image/*,.pdf",multiple:!0,className:"hidden",onChange:c=>{var d;return((d=c.target.files)==null?void 0:d.length)&&(r==null?void 0:r(Array.from(c.target.files)))}})]})]}):l.jsxs("label",{className:`flex items-center gap-3 cursor-pointer group/up ${s?"pointer-events-none opacity-60":""}`,children:[l.jsx("div",{className:"w-14 h-14 rounded-xl border-2 border-dashed border-border/50 group-hover/up:border-primary/50 flex flex-col items-center justify-center gap-1 transition-colors bg-secondary/10 group-hover/up:bg-primary/5 shrink-0",children:s?l.jsx(es,{size:"sm"}):l.jsxs(l.Fragment,{children:[l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-muted-foreground group-hover/up:text-primary transition-colors",children:[l.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),l.jsx("polyline",{points:"17 8 12 3 7 8"}),l.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),l.jsx("span",{className:"text-[8px] font-bold text-muted-foreground group-hover/up:text-primary transition-colors",children:"Upload"})]})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-foreground",children:t}),l.jsx("p",{className:"text-[9px] text-muted-foreground",children:"JPG, PNG, WebP or PDF · select multiple · max 10 MB each"})]}),l.jsx("input",{type:"file",accept:"image/*,.pdf",multiple:!0,className:"hidden",onChange:c=>{var d;return((d=c.target.files)==null?void 0:d.length)&&(r==null?void 0:r(Array.from(c.target.files)))}})]})})}const Hh=({children:e,content:t})=>{const[s,n]=b.useState(!1),[r,o]=b.useState({x:0,y:0}),i=b.useRef(null),a=()=>{if(i.current){const u=i.current.getBoundingClientRect();o({x:u.left+u.width/2,y:u.top+window.scrollY-8})}};b.useEffect(()=>(s&&(a(),window.addEventListener("scroll",a),window.addEventListener("resize",a)),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),[s]);const c=()=>{t&&n(!0)},d=()=>{n(!1)};return l.jsxs("div",{ref:i,onMouseEnter:c,onMouseLeave:d,className:"inline-block w-full",children:[e,s&&t&&typeof window<"u"&&Pa.createPortal(l.jsx(oe,{children:l.jsxs(_.div,{initial:{opacity:0,scale:.95,y:4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:4},style:{position:"absolute",left:r.x,top:r.y,transform:"translateX(-50%) translateY(-100%)",zIndex:99999,pointerEvents:"none"},className:"bg-zinc-900 text-zinc-100 dark:bg-zinc-100 dark:text-zinc-900 text-[10px] font-black uppercase tracking-widest px-3 py-2 rounded-lg shadow-xl whitespace-nowrap",children:[t,l.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-zinc-900 dark:border-t-zinc-100"})]})}),document.body)]})},Xh=({value:e=0,size:t=80,strokeWidth:s=6,showPercent:n=!0,className:r})=>{const o=(t-s)/2,i=o*2*Math.PI,a=Math.min(Math.max(e,0),100),c=i-a/100*i;return l.jsxs("div",{className:M("relative inline-flex items-center justify-center",r),style:{width:t,height:t},children:[l.jsxs("svg",{className:"transform -rotate-90",width:t,height:t,children:[l.jsx("circle",{className:"text-secondary/50",stroke:"currentColor",strokeWidth:s,fill:"transparent",r:o,cx:t/2,cy:t/2}),l.jsx("circle",{className:"text-primary transition-all duration-500 ease-out",stroke:"currentColor",strokeWidth:s,strokeDasharray:i,strokeDashoffset:c,strokeLinecap:"round",fill:"transparent",r:o,cx:t/2,cy:t/2})]}),n&&l.jsxs("span",{className:"absolute text-[10px] font-mono font-bold text-foreground",children:[Math.round(a),"%"]})]})},qh=({checked:e=!1,onChange:t,label:s,name:n,value:r,className:o})=>l.jsxs("label",{className:M("inline-flex items-center gap-3 cursor-pointer select-none text-left",o),children:[l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:"radio",name:n,value:r,checked:e,onChange:()=>t&&t(r),className:"sr-only"}),l.jsx(_.div,{className:M("w-5 h-5 rounded-full border flex items-center justify-center transition-colors duration-200",e?"border-primary":"bg-white/40 border-input dark:bg-black/20"),children:l.jsx(oe,{children:e&&l.jsx(_.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:"spring",stiffness:500,damping:30},className:"w-2.5 h-2.5 rounded-full bg-primary"})})})]}),s&&l.jsx("span",{className:"text-sm font-semibold text-foreground leading-none",children:s})]}),ya=b.createContext(),Zh=({children:e,defaultTheme:t="light"})=>{const[s,n]=b.useState(()=>{if(typeof window>"u")return!1;const i=new URLSearchParams(window.location.search).get("theme");if(i)return i==="dark";const a=localStorage.getItem("theme");return a?a==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches});b.useEffect(()=>{s?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[s]);const r=()=>n(o=>!o);return l.jsx(ya.Provider,{value:{isDark:s,toggleTheme:r,setIsDark:n},children:e})},ba=()=>{const e=b.useContext(ya);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},Jh=({collapsed:e=!1,onToggle:t,logo:s,title:n="RenderLoom",children:r,footer:o,className:i,showMobileToggle:a=!0,onLogout:c})=>{const[d,u]=b.useState(!1),[f,h]=b.useState(!e);b.useEffect(()=>{h(!e)},[e]),b.useEffect(()=>{const y=()=>{const T=window.innerWidth<768;u(T),T||h(!1)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const m=()=>{if(d){const y=!f;h(y),t&&t(!y)}else t&&t(!e)},g=()=>{d&&(h(!1),t&&t(!0))};let p=!1,x=()=>{},k=!1;try{const y=ba();y&&(p=y.isDark,x=y.toggleTheme,k=!0)}catch{}const v=d?!f:e;return l.jsxs(l.Fragment,{children:[d&&a&&l.jsxs("div",{className:"flex md:hidden items-center justify-between px-6 py-4 border-b border-border/20 bg-card/45 backdrop-blur-xl w-full shrink-0 min-h-[64px]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[s&&l.jsx("div",{className:"text-primary shrink-0 transition-transform duration-300",children:s}),l.jsx("span",{className:"font-extrabold text-sm text-foreground tracking-tight",children:n})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[k&&l.jsx("button",{type:"button",onClick:x,className:"p-2.5 rounded-xl bg-secondary/20 hover:bg-secondary/35 text-foreground cursor-pointer border border-transparent transition-colors flex items-center justify-center shrink-0",children:p?l.jsx(Ja,{size:16,className:"text-amber-500"}):l.jsx(Xa,{size:16,className:"text-primary"})}),l.jsx("button",{type:"button",onClick:m,className:"p-2.5 rounded-xl bg-secondary/20 hover:bg-secondary/35 text-foreground cursor-pointer border border-transparent transition-colors flex items-center justify-center shrink-0",children:l.jsx(Ka,{size:16,className:"text-foreground"})})]})]}),d&&!v&&l.jsx("div",{onClick:m,className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-40 md:hidden transition-opacity duration-300"}),l.jsxs("aside",{className:M("h-screen bg-card/45 backdrop-blur-xl border-r border-border/40 flex flex-col transition-all duration-300 ease-in-out shrink-0 text-left relative",d?"fixed top-0 bottom-0 left-0 z-50":"z-30",v?"w-0 -translate-x-full md:w-20 md:translate-x-0 overflow-hidden border-r-0 md:border-r border-border/20":"w-64 translate-x-0 border-r border-border/40",i),children:[l.jsxs("div",{className:M("flex border-b border-border/20 shrink-0 transition-all duration-300",v?"flex-col items-center justify-center gap-2.5 py-4 px-1 min-h-[88px]":"flex-row items-center justify-between p-4 min-h-[72px]"),children:[l.jsxs("div",{className:M("flex items-center gap-3 overflow-hidden",v&&"justify-center"),children:[s&&l.jsx("div",{className:"text-primary shrink-0 transition-transform duration-300",children:s}),!v&&l.jsx("span",{className:"font-extrabold text-base text-foreground tracking-tight whitespace-nowrap animate-[fadeIn_0.2s_ease-out]",children:n})]}),l.jsx("button",{type:"button",onClick:m,className:"p-1.5 hover:bg-secondary/60 rounded-xl border border-border/20 text-muted-foreground hover:text-foreground cursor-pointer shrink-0 transition-colors",children:v?l.jsx(rt,{size:14}):l.jsx(is,{size:14})})]}),l.jsx("div",{className:"flex-1 py-4 px-3 space-y-1.5 overflow-y-auto custom-scrollbar",onClickCapture:g,children:r}),o&&l.jsxs("div",{className:M("p-3 border-t border-border/20 min-h-[72px] flex overflow-hidden shrink-0 w-full gap-2",v?"flex-col items-center justify-center py-4":"flex-row items-center justify-between"),children:[l.jsx("div",{className:M("flex-1 min-w-0 flex overflow-hidden",v?"flex-col items-center justify-center":"flex-row items-center"),children:o}),c&&l.jsx("button",{type:"button",onClick:c,title:"Logout",className:M("p-2 rounded-xl text-muted-foreground hover:text-rose-400 hover:bg-rose-500/10 cursor-pointer transition-colors flex items-center justify-center shrink-0 border border-transparent hover:border-rose-500/20",v?"mt-2":""),children:l.jsx(Ya,{size:16})})]})]})]})},Qh=({icon:e,label:t,active:s=!1,onClick:n,collapsed:r=!1,badge:o,as:i,...a})=>{const c=u=>l.jsxs(l.Fragment,{children:[e&&l.jsx(e,{size:18,className:"shrink-0"}),!r&&l.jsx("span",{className:"truncate flex-1 font-semibold text-sm whitespace-nowrap overflow-hidden animate-[fadeIn_0.2s_ease-out]",children:t}),!r&&o&&!u&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-bold border shrink-0 bg-primary/10 text-primary border-primary/20",children:o}),!r&&u&&l.jsx(_.div,{layoutId:"active-sidebar-indicator",className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0 ml-auto",transition:{type:"spring",stiffness:380,damping:30}})]}),d=u=>M("relative w-full flex items-center rounded-xl font-bold text-sm transition-all duration-200 cursor-pointer text-left select-none shrink-0 border border-transparent",r?"justify-center p-3":"px-4 py-3 gap-3",u?"bg-primary/10 text-primary border-primary/15":"text-muted-foreground hover:text-foreground hover:bg-secondary/35");return i?l.jsx(i,{className:({isActive:u})=>d(u),...a,children:({isActive:u})=>c(u)}):l.jsx("button",{type:"button",onClick:n,className:d(s),children:c(s)})},em=({avatarLabel:e,avatarSrc:t,avatarClassName:s,title:n,subtitle:r,badges:o=[],meta:i,selected:a=!1,onClick:c,startSlot:d,endSlot:u,showChevron:f=!0,className:h,...m})=>l.jsxs(_.div,{layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18},onClick:c,className:M("flex items-center gap-3 p-4 rounded-2xl border transition-all duration-200 cursor-pointer select-none group",a?"bg-primary/8 border-primary/30 shadow-md shadow-primary/5":"bg-card border-border hover:bg-secondary/50 hover:border-border/80",h),...m,children:[d&&l.jsx("div",{className:"shrink-0",onClick:g=>g.stopPropagation(),children:d}),l.jsx("div",{className:M("shrink-0 w-10 h-10 rounded-xl flex items-center justify-center text-sm font-black text-primary-foreground overflow-hidden",a?"bg-primary shadow-lg shadow-primary/20":"bg-primary/80",s),children:t?l.jsx("img",{src:t,alt:n,className:"w-full h-full object-cover"}):l.jsx("span",{children:e})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:M("text-sm font-bold truncate transition-colors",a?"text-primary":"text-foreground"),children:n}),r&&l.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5 font-medium",children:r}),o.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:o.map((g,p)=>l.jsx(tm,{variant:g.variant,children:g.label},p))}),i&&l.jsx("div",{className:"mt-1",children:i})]}),u?l.jsx("div",{className:"shrink-0",children:u}):f?l.jsx(rt,{size:16,className:M("shrink-0 transition-all duration-200",a?"text-primary translate-x-0.5":"text-muted-foreground/40 group-hover:text-muted-foreground")}):null]}),va={default:"bg-secondary text-foreground border border-border",primary:"bg-primary/10 text-primary border border-primary/20",success:"bg-emerald-500/10 text-emerald-600 border border-emerald-500/20",warning:"bg-amber-500/10 text-amber-600 border border-amber-500/20",danger:"bg-red-500/10 text-red-600 border border-red-500/20"},tm=({variant:e="default",children:t,className:s})=>l.jsx("span",{className:M("inline-flex items-center px-2 py-0.5 rounded-md text-[9px] font-black uppercase tracking-widest",va[e]??va.default,s),children:t}),sm=({count:e=4})=>l.jsx(l.Fragment,{children:Array.from({length:e}).map((t,s)=>l.jsx("div",{className:"h-[76px] rounded-2xl bg-secondary/50 border border-border animate-pulse"},s))}),nm=({selectedItem:e=null,onBack:t,listHeader:s,list:n,listFooter:r,detail:o,emptyDetail:i,backLabel:a="Back to List",listWidth:c="w-full lg:w-[400px]",className:d,listClassName:u,detailClassName:f})=>l.jsxs("div",{className:M("h-full flex flex-col lg:flex-row gap-6 lg:gap-8",d),children:[l.jsxs("div",{className:M("flex flex-col gap-4 transition-all duration-300",e&&"hidden lg:flex",c,u),children:[s&&l.jsx("div",{className:"shrink-0",children:s}),l.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar space-y-2 md:space-y-3 pr-1",children:l.jsx(oe,{mode:"popLayout",children:n})}),r&&l.jsx("div",{className:"shrink-0",children:r})]}),l.jsx("div",{className:M("flex-1 min-w-0 transition-all duration-300",!e&&"hidden lg:block",f),children:l.jsx(oe,{mode:"wait",children:e?l.jsxs(_.div,{initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:16},transition:{duration:.2,ease:"easeOut"},className:"h-full flex flex-col gap-4",children:[t&&l.jsxs("button",{onClick:t,className:"lg:hidden inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground font-bold text-xs uppercase tracking-widest transition-colors w-fit shrink-0",children:[l.jsx(is,{size:15}),a]}),l.jsx("div",{className:"flex-1 min-h-0",children:o})]},(e==null?void 0:e.id)??"detail"):l.jsx(_.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"h-full",children:i??l.jsx(rm,{})},"split-view-empty")})})]}),rm=()=>l.jsxs("div",{className:"h-full rounded-3xl flex flex-col items-center justify-center border-dashed border-2 border-border p-8 text-center bg-card/30",children:[l.jsx("div",{className:"w-16 h-16 rounded-2xl bg-secondary flex items-center justify-center mb-5 border border-border",children:l.jsx(rt,{className:"text-muted-foreground/30",size:28})}),l.jsx("p",{className:"text-muted-foreground font-black uppercase tracking-widest text-[10px]",children:"Select an item to view details"})]}),im=({min:e=0,max:t=100,step:s=1,value:n=50,onChange:r,label:o,className:i})=>{const a=(n-e)/(t-e)*100;return l.jsxs("div",{className:M("space-y-2 w-full text-left",i),children:[(o||n!==void 0)&&l.jsxs("div",{className:"flex justify-between items-center px-1",children:[o&&l.jsx("label",{className:"text-sm font-semibold text-foreground",children:o}),l.jsx("span",{className:"text-xs font-mono font-bold text-primary",children:n})]}),l.jsxs("div",{className:"relative flex items-center group",children:[l.jsx("input",{type:"range",min:e,max:t,step:s,value:n,onChange:c=>r&&r(Number(c.target.value)),className:"w-full h-1.5 bg-secondary/50 dark:bg-zinc-800 rounded-full appearance-none outline-none cursor-pointer",style:{background:`linear-gradient(to right, var(--primary) 0%, var(--primary) ${a}%, var(--secondary) ${a}%, var(--secondary) 100%)`}}),l.jsx("style",{children:`
182
182
  input[type="range"]::-webkit-slider-thumb {
183
183
  -webkit-appearance: none;