@ouro.bot/cli 0.1.0-alpha.167 → 0.1.0-alpha.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.json +14 -0
- package/dist/heart/daemon/auth-flow.js +1 -1
- package/dist/heart/daemon/daemon-cli.js +1 -1
- package/dist/heart/daemon/daemon.js +1 -0
- package/dist/heart/daemon/outlook-http.js +31 -1
- package/dist/heart/daemon/outlook-read.js +7 -0
- package/dist/heart/provider-ping.js +1 -1
- package/dist/outlook-ui/assets/{index-CAPJ0Xt3.js → index-BiPZDyU8.js} +1 -1
- package/dist/outlook-ui/assets/{index-KazIYzAr.css → index-DFa9PD0N.css} +1 -1
- package/dist/outlook-ui/index.html +2 -2
- package/package.json +1 -1
|
@@ -58,4 +58,4 @@ Error generating stack: `+l.message+`
|
|
|
58
58
|
* This source code is licensed under the MIT license found in the
|
|
59
59
|
* LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/var gv;function j2(){if(gv)return df;gv=1;var n=Sr();function a(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var s=typeof Object.is=="function"?Object.is:a,o=n.useSyncExternalStore,u=n.useRef,d=n.useEffect,f=n.useMemo,h=n.useDebugValue;return df.useSyncExternalStoreWithSelector=function(m,p,y,b,S){var T=u(null);if(T.current===null){var j={hasValue:!1,value:null};T.current=j}else j=T.current;T=f(function(){function C(X){if(!A){if(A=!0,L=X,X=b(X),S!==void 0&&j.hasValue){var tt=j.value;if(S(tt,X))return U=tt}return U=X}if(tt=U,s(L,X))return tt;var Z=b(X);return S!==void 0&&S(tt,Z)?(L=X,tt):(L=X,U=Z)}var A=!1,L,U,Y=y===void 0?null:y;return[function(){return C(p())},Y===null?void 0:function(){return C(Y())}]},[p,y,b,S]);var E=o(m,T[0],T[1]);return d(function(){j.hasValue=!0,j.value=E},[E]),h(E),E},df}var vv;function N2(){return vv||(vv=1,ff.exports=j2()),ff.exports}var C2=N2();function Ty(n,a,s=by){return C2.useSyncExternalStoreWithSelector(jt(o=>n.subscribe(M2,o)),jt(()=>n.state),jt(()=>n.state),jt(a),s)}function M2(n){return n}function ys(n,a){let s=w.useId(),o=Sy.get(a),[u,d]=Ty(o,w.useCallback(f=>[o.selectors.isTop(f,s),o.selectors.inStack(f,s)],[o,s]));return Ee(()=>{if(n)return o.actions.push(s),()=>o.actions.pop(s)},[o,n,s]),n?d?u:!0:!1}let Yf=new Map,is=new Map;function yv(n){var a;let s=(a=is.get(n))!=null?a:0;return is.set(n,s+1),s!==0?()=>bv(n):(Yf.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>bv(n))}function bv(n){var a;let s=(a=is.get(n))!=null?a:1;if(s===1?is.delete(n):is.set(n,s-1),s!==1)return;let o=Yf.get(n);o&&(o["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",o["aria-hidden"]),n.inert=o.inert,Yf.delete(n))}function D2(n,{allowed:a,disallowed:s}={}){let o=ys(n,"inert-others");Ee(()=>{var u,d;if(!o)return;let f=kn();for(let m of(u=s==null?void 0:s())!=null?u:[])m&&f.add(yv(m));let h=(d=a==null?void 0:a())!=null?d:[];for(let m of h){if(!m)continue;let p=Pi(m);if(!p)continue;let y=m.parentElement;for(;y&&y!==p.body;){for(let b of y.children)h.some(S=>b.contains(S))||f.add(yv(b));y=y.parentElement}}return f.dispose},[o,a,s])}function z2(n,a,s){let o=ti(u=>{let d=u.getBoundingClientRect();d.x===0&&d.y===0&&d.width===0&&d.height===0&&s()});w.useEffect(()=>{if(!n)return;let u=a===null?null:Ia(a)?a:a.current;if(!u)return;let d=kn();if(typeof ResizeObserver<"u"){let f=new ResizeObserver(()=>o.current(u));f.observe(u),d.add(()=>f.disconnect())}if(typeof IntersectionObserver<"u"){let f=new IntersectionObserver(()=>o.current(u));f.observe(u),d.add(()=>f.disconnect())}return()=>d.dispose()},[a,o,n])}let cr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(","),O2=["[data-autofocus]"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var Ln=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(Ln||{}),qf=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(qf||{}),R2=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(R2||{});function V2(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(cr)).sort((a,s)=>Math.sign((a.tabIndex||Number.MAX_SAFE_INTEGER)-(s.tabIndex||Number.MAX_SAFE_INTEGER)))}function L2(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(O2)).sort((a,s)=>Math.sign((a.tabIndex||Number.MAX_SAFE_INTEGER)-(s.tabIndex||Number.MAX_SAFE_INTEGER)))}var wy=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(wy||{});function _2(n,a=0){var s;return n===((s=Pi(n))==null?void 0:s.body)?!1:Un(a,{0(){return n.matches(cr)},1(){let o=n;for(;o!==null;){if(o.matches(cr))return!0;o=o.parentElement}return!1}})}var U2=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(U2||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function _n(n){n==null||n.focus({preventScroll:!0})}let k2=["textarea","input"].join(",");function B2(n){var a,s;return(s=(a=n==null?void 0:n.matches)==null?void 0:a.call(n,k2))!=null?s:!1}function H2(n,a=s=>s){return n.slice().sort((s,o)=>{let u=a(s),d=a(o);if(u===null||d===null)return 0;let f=u.compareDocumentPosition(d);return f&Node.DOCUMENT_POSITION_FOLLOWING?-1:f&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ls(n,a,{sorted:s=!0,relativeTo:o=null,skipElements:u=[]}={}){let d=Array.isArray(n)?n.length>0?Hf(n[0]):document:Hf(n),f=Array.isArray(n)?s?H2(n):n:a&64?L2(n):V2(n);u.length>0&&f.length>1&&(f=f.filter(T=>!u.some(j=>j!=null&&"current"in j?(j==null?void 0:j.current)===T:j===T))),o=o??(d==null?void 0:d.activeElement);let h=(()=>{if(a&5)return 1;if(a&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),m=(()=>{if(a&1)return 0;if(a&2)return Math.max(0,f.indexOf(o))-1;if(a&4)return Math.max(0,f.indexOf(o))+1;if(a&8)return f.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=a&32?{preventScroll:!0}:{},y=0,b=f.length,S;do{if(y>=b||y+b<=0)return 0;let T=m+y;if(a&16)T=(T+b)%b;else{if(T<0)return 3;if(T>=b)return 1}S=f[T],S==null||S.focus(p),y+=h}while(S!==ry(S));return a&6&&B2(S)&&S.select(),2}function Ey(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function $2(){return/Android/gi.test(window.navigator.userAgent)}function xv(){return Ey()||$2()}function Xo(n,a,s,o){let u=ti(s);w.useEffect(()=>{if(!n)return;function d(f){u.current(f)}return document.addEventListener(a,d,o),()=>document.removeEventListener(a,d,o)},[n,a,o])}function Ay(n,a,s,o){let u=ti(s);w.useEffect(()=>{if(!n)return;function d(f){u.current(f)}return window.addEventListener(a,d,o),()=>window.removeEventListener(a,d,o)},[n,a,o])}const Sv=30;function G2(n,a,s){let o=ti(s),u=w.useCallback(function(h,m){if(h.defaultPrevented)return;let p=m(h);if(p===null||!p.getRootNode().contains(p)||!p.isConnected)return;let y=(function b(S){return typeof S=="function"?b(S()):Array.isArray(S)||S instanceof Set?S:[S]})(a);for(let b of y)if(b!==null&&(b.contains(p)||h.composed&&h.composedPath().includes(b)))return;return!_2(p,wy.Loose)&&p.tabIndex!==-1&&h.preventDefault(),o.current(h,p)},[o,a]),d=w.useRef(null);Xo(n,"pointerdown",h=>{var m,p;xv()||(d.current=((p=(m=h.composedPath)==null?void 0:m.call(h))==null?void 0:p[0])||h.target)},!0),Xo(n,"pointerup",h=>{if(xv()||!d.current)return;let m=d.current;return d.current=null,u(h,()=>m)},!0);let f=w.useRef({x:0,y:0});Xo(n,"touchstart",h=>{f.current.x=h.touches[0].clientX,f.current.y=h.touches[0].clientY},!0),Xo(n,"touchend",h=>{let m={x:h.changedTouches[0].clientX,y:h.changedTouches[0].clientY};if(!(Math.abs(m.x-f.current.x)>=Sv||Math.abs(m.y-f.current.y)>=Sv))return u(h,()=>ma(h.target)?h.target:null)},!0),Ay(n,"blur",h=>u(h,()=>s2(window.document.activeElement)?window.document.activeElement:null),!0)}function Sd(...n){return w.useMemo(()=>Pi(...n),[...n])}function jy(n,a,s,o){let u=ti(s);w.useEffect(()=>{n=n??window;function d(f){u.current(f)}return n.addEventListener(a,d,o),()=>n.removeEventListener(a,d,o)},[n,a,o])}function Y2(n){return w.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function q2(n,a){let s=n(),o=new Set;return{getSnapshot(){return s},subscribe(u){return o.add(u),()=>o.delete(u)},dispatch(u,...d){let f=a[u].call(s,...d);f&&(s=f,o.forEach(h=>h()))}}}function X2(){let n;return{before({doc:a}){var s;let o=a.documentElement,u=(s=a.defaultView)!=null?s:window;n=Math.max(0,u.innerWidth-o.clientWidth)},after({doc:a,d:s}){let o=a.documentElement,u=Math.max(0,o.clientWidth-o.offsetWidth),d=Math.max(0,n-u);s.style(o,"paddingRight",`${d}px`)}}}function K2(){return Ey()?{before({doc:n,d:a,meta:s}){function o(u){for(let d of s().containers)for(let f of d())if(f.contains(u))return!0;return!1}a.microTask(()=>{var u;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let h=kn();h.style(n.documentElement,"scrollBehavior","auto"),a.add(()=>a.microTask(()=>h.dispose()))}let d=(u=window.scrollY)!=null?u:window.pageYOffset,f=null;a.addEventListener(n,"click",h=>{if(ma(h.target))try{let m=h.target.closest("a");if(!m)return;let{hash:p}=new URL(m.href),y=n.querySelector(p);ma(y)&&!o(y)&&(f=y)}catch{}},!0),a.group(h=>{a.addEventListener(n,"touchstart",m=>{if(h.dispose(),ma(m.target)&&l2(m.target))if(o(m.target)){let p=m.target;for(;p.parentElement&&o(p.parentElement);)p=p.parentElement;h.style(p,"overscrollBehavior","contain")}else h.style(m.target,"touchAction","none")})}),a.addEventListener(n,"touchmove",h=>{if(ma(h.target)){if(o2(h.target))return;if(o(h.target)){let m=h.target;for(;m.parentElement&&m.dataset.headlessuiPortal!==""&&!(m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth);)m=m.parentElement;m.dataset.headlessuiPortal===""&&h.preventDefault()}else h.preventDefault()}},{passive:!1}),a.add(()=>{var h;let m=(h=window.scrollY)!=null?h:window.pageYOffset;d!==m&&window.scrollTo(0,d),f&&f.isConnected&&(f.scrollIntoView({block:"nearest"}),f=null)})})}}:{}}function F2(){return{before({doc:n,d:a}){a.style(n.documentElement,"overflow","hidden")}}}function Tv(n){let a={};for(let s of n)Object.assign(a,s(a));return a}let Fa=q2(()=>new Map,{PUSH(n,a){var s;let o=(s=this.get(n))!=null?s:{doc:n,count:0,d:kn(),meta:new Set,computedMeta:{}};return o.count++,o.meta.add(a),o.computedMeta=Tv(o.meta),this.set(n,o),this},POP(n,a){let s=this.get(n);return s&&(s.count--,s.meta.delete(a),s.computedMeta=Tv(s.meta)),this},SCROLL_PREVENT(n){let a={doc:n.doc,d:n.d,meta(){return n.computedMeta}},s=[K2(),X2(),F2()];s.forEach(({before:o})=>o==null?void 0:o(a)),s.forEach(({after:o})=>o==null?void 0:o(a))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});Fa.subscribe(()=>{let n=Fa.getSnapshot(),a=new Map;for(let[s]of n)a.set(s,s.documentElement.style.overflow);for(let s of n.values()){let o=a.get(s.doc)==="hidden",u=s.count!==0;(u&&!o||!u&&o)&&Fa.dispatch(s.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",s),s.count===0&&Fa.dispatch("TEARDOWN",s)}});function Z2(n,a,s=()=>({containers:[]})){let o=Y2(Fa),u=a?o.get(a):void 0,d=u?u.count>0:!1;return Ee(()=>{if(!(!a||!n))return Fa.dispatch("PUSH",a,s),()=>Fa.dispatch("POP",a,s)},[n,a]),d}function Q2(n,a,s=()=>[document.body]){let o=ys(n,"scroll-lock");Z2(o,a,u=>{var d;return{containers:[...(d=u.containers)!=null?d:[],s]}})}function J2(n=0){let[a,s]=w.useState(n),o=w.useCallback(m=>s(m),[]),u=w.useCallback(m=>s(p=>p|m),[]),d=w.useCallback(m=>(a&m)===m,[a]),f=w.useCallback(m=>s(p=>p&~m),[]),h=w.useCallback(m=>s(p=>p^m),[]);return{flags:a,setFlag:o,addFlag:u,hasFlag:d,removeFlag:f,toggleFlag:h}}var P2={},wv,Ev;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((wv=process==null?void 0:P2)==null?void 0:wv.NODE_ENV)==="test"&&typeof((Ev=Element==null?void 0:Element.prototype)==null?void 0:Ev.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
61
|
-
`)),[]});var W2=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(W2||{});function I2(n){let a={};for(let s in n)n[s]===!0&&(a[`data-${s}`]="");return a}function tw(n,a,s,o){let[u,d]=w.useState(s),{hasFlag:f,addFlag:h,removeFlag:m}=J2(n&&u?3:0),p=w.useRef(!1),y=w.useRef(!1),b=gs();return Ee(()=>{var S;if(n){if(s&&d(!0),!a){s&&h(3);return}return(S=o==null?void 0:o.start)==null||S.call(o,s),ew(a,{inFlight:p,prepare(){y.current?y.current=!1:y.current=p.current,p.current=!0,!y.current&&(s?(h(3),m(4)):(h(4),m(2)))},run(){y.current?s?(m(3),h(4)):(m(4),h(3)):s?m(1):h(1)},done(){var T;y.current&&iw(a)||(p.current=!1,m(7),s||d(!1),(T=o==null?void 0:o.end)==null||T.call(o,s))}})}},[n,s,a,b]),n?[u,{closed:f(1),enter:f(2),leave:f(4),transition:f(2)||f(4)}]:[s,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ew(n,{prepare:a,run:s,done:o,inFlight:u}){let d=kn();return aw(n,{prepare:a,inFlight:u}),d.nextFrame(()=>{s(),d.requestAnimationFrame(()=>{d.add(nw(n,o))})}),d.dispose}function nw(n,a){var s,o;let u=kn();if(!n)return u.dispose;let d=!1;u.add(()=>{d=!0});let f=(o=(s=n.getAnimations)==null?void 0:s.call(n).filter(h=>h instanceof CSSTransition))!=null?o:[];return f.length===0?(a(),u.dispose):(Promise.allSettled(f.map(h=>h.finished)).then(()=>{d||a()}),u.dispose)}function aw(n,{inFlight:a,prepare:s}){if(a!=null&&a.current){s();return}let o=n.style.transition;n.style.transition="none",s(),n.offsetHeight,n.style.transition=o}function iw(n){var a,s;return((s=(a=n.getAnimations)==null?void 0:a.call(n))!=null?s:[]).some(o=>o instanceof CSSTransition&&o.playState!=="finished")}function Td(n,a){let s=w.useRef([]),o=jt(n);w.useEffect(()=>{let u=[...s.current];for(let[d,f]of a.entries())if(s.current[d]!==f){let h=o(a,u);return s.current=a,h}},[o,...a])}let Er=w.createContext(null);Er.displayName="OpenClosedContext";var nn=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(nn||{});function Ar(){return w.useContext(Er)}function lw({value:n,children:a}){return st.createElement(Er.Provider,{value:n},a)}function sw({children:n}){return st.createElement(Er.Provider,{value:null},n)}function ow(n){function a(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",a))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",a),a())}let da=[];ow(()=>{function n(a){if(!ma(a.target)||a.target===document.body||da[0]===a.target)return;let s=a.target;s=s.closest(cr),da.unshift(s??a.target),da=da.filter(o=>o!=null&&o.isConnected),da.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Ny(n){let a=jt(n),s=w.useRef(!1);w.useEffect(()=>(s.current=!1,()=>{s.current=!0,wr(()=>{s.current&&a()})}),[a])}let Cy=w.createContext(!1);function rw(){return w.useContext(Cy)}function Av(n){return st.createElement(Cy.Provider,{value:n.force},n.children)}function uw(n){let a=rw(),s=w.useContext(Dy),[o,u]=w.useState(()=>{var d;if(!a&&s!==null)return(d=s.current)!=null?d:null;if(hn.isServer)return null;let f=n==null?void 0:n.getElementById("headlessui-portal-root");if(f)return f;if(n===null)return null;let h=n.createElement("div");return h.setAttribute("id","headlessui-portal-root"),n.body.appendChild(h)});return w.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),w.useEffect(()=>{a||s!==null&&u(s.current)},[s,u,a]),o}let My=w.Fragment,cw=ce(function(n,a){let{ownerDocument:s=null,...o}=n,u=w.useRef(null),d=gn(r2(S=>{u.current=S}),a),f=Sd(u.current),h=s??f,m=uw(h),p=w.useContext(Xf),y=gs(),b=Ae();return Ny(()=>{var S;m&&m.childNodes.length<=0&&((S=m.parentElement)==null||S.removeChild(m))}),m?MT.createPortal(st.createElement("div",{"data-headlessui-portal":"",ref:S=>{y.dispose(),p&&S&&y.add(p.register(S))}},b({ourProps:{ref:d},theirProps:o,slot:{},defaultTag:My,name:"Portal"})),m):null});function fw(n,a){let s=gn(a),{enabled:o=!0,ownerDocument:u,...d}=n,f=Ae();return o?st.createElement(cw,{...d,ownerDocument:u,ref:s}):f({ourProps:{ref:s},theirProps:d,slot:{},defaultTag:My,name:"Portal"})}let dw=w.Fragment,Dy=w.createContext(null);function hw(n,a){let{target:s,...o}=n,u={ref:gn(a)},d=Ae();return st.createElement(Dy.Provider,{value:s},d({ourProps:u,theirProps:o,defaultTag:dw,name:"Popover.Group"}))}let Xf=w.createContext(null);function mw(){let n=w.useContext(Xf),a=w.useRef([]),s=jt(d=>(a.current.push(d),n&&n.register(d),()=>o(d))),o=jt(d=>{let f=a.current.indexOf(d);f!==-1&&a.current.splice(f,1),n&&n.unregister(d)}),u=w.useMemo(()=>({register:s,unregister:o,portals:a}),[s,o,a]);return[a,w.useMemo(()=>function({children:d}){return st.createElement(Xf.Provider,{value:u},d)},[u])]}let pw=ce(fw),zy=ce(hw),gw=Object.assign(pw,{Group:zy}),vw=w.Fragment;function yw(n,a){let{...s}=n,o=!1,{isFocusVisible:u,focusProps:d}=oy(),{isHovered:f,hoverProps:h}=sy({isDisabled:o}),{pressed:m,pressProps:p}=uy({disabled:o}),y=bd({ref:a},d,h,p),b=ei({hover:f,focus:u,active:m});return Ae()({ourProps:y,theirProps:s,slot:b,defaultTag:vw,name:"DataInteractive"})}let bw=ce(yw);function xw(n,a=typeof document<"u"?document.defaultView:null,s){let o=ys(n,"escape");jy(a,"keydown",u=>{o&&(u.defaultPrevented||u.key===my.Escape&&s(u))})}function Sw(){var n;let[a]=w.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[s,o]=w.useState((n=a==null?void 0:a.matches)!=null?n:!1);return Ee(()=>{if(!a)return;function u(d){o(d.matches)}return a.addEventListener("change",u),()=>a.removeEventListener("change",u)},[a]),s}function Tw({defaultContainers:n=[],portals:a,mainTreeNode:s}={}){let o=jt(()=>{var u,d;let f=Pi(s),h=[];for(let m of n)m!==null&&(ga(m)?h.push(m):"current"in m&&ga(m.current)&&h.push(m.current));if(a!=null&&a.current)for(let m of a.current)h.push(m);for(let m of(u=f==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?u:[])m!==document.body&&m!==document.head&&ga(m)&&m.id!=="headlessui-portal-root"&&(s&&(m.contains(s)||m.contains((d=s==null?void 0:s.getRootNode())==null?void 0:d.host))||h.some(p=>m.contains(p))||h.push(m));return h});return{resolveContainers:o,contains:jt(u=>o().some(d=>d.contains(u)))}}let Oy=w.createContext(null);function jv({children:n,node:a}){let[s,o]=w.useState(null),u=Ry(a??s);return st.createElement(Oy.Provider,{value:u},n,u===null&&st.createElement(Gf,{features:ur.Hidden,ref:d=>{var f,h;if(d){for(let m of(h=(f=Pi(d))==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?h:[])if(m!==document.body&&m!==document.head&&ga(m)&&m!=null&&m.contains(d)){o(m);break}}}}))}function Ry(n=null){var a;return(a=w.useContext(Oy))!=null?a:n}function ww(){let n=typeof document>"u";return"useSyncExternalStore"in lv?(a=>a.useSyncExternalStore)(lv)(()=>()=>{},()=>!1,()=>!n):!1}function jr(){let n=ww(),[a,s]=w.useState(hn.isHandoffComplete);return a&&hn.isHandoffComplete===!1&&s(!1),w.useEffect(()=>{a!==!0&&s(!0)},[a]),w.useEffect(()=>hn.handoff(),[]),n?!1:a}function wd(){let n=w.useRef(!1);return Ee(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var ts=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(ts||{});function Ew(){let n=w.useRef(0);return Ay(!0,"keydown",a=>{a.key==="Tab"&&(n.current=a.shiftKey?1:0)},!0),n}function Vy(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let a=new Set;for(let s of n.current)ga(s.current)&&a.add(s.current);return a}let Aw="div";var qa=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(qa||{});function jw(n,a){let s=w.useRef(null),o=gn(s,a),{initialFocus:u,initialFocusFallback:d,containers:f,features:h=15,...m}=n;jr()||(h=0);let p=Sd(s.current);Dw(h,{ownerDocument:p});let y=zw(h,{ownerDocument:p,container:s,initialFocus:u,initialFocusFallback:d});Ow(h,{ownerDocument:p,container:s,containers:f,previousActiveElement:y});let b=Ew(),S=jt(L=>{if(!Ia(s.current))return;let U=s.current;(Y=>Y())(()=>{Un(b.current,{[ts.Forwards]:()=>{ls(U,Ln.First,{skipElements:[L.relatedTarget,d]})},[ts.Backwards]:()=>{ls(U,Ln.Last,{skipElements:[L.relatedTarget,d]})}})})}),T=ys(!!(h&2),"focus-trap#tab-lock"),j=gs(),E=w.useRef(!1),C={ref:o,onKeyDown(L){L.key=="Tab"&&(E.current=!0,j.requestAnimationFrame(()=>{E.current=!1}))},onBlur(L){if(!(h&4))return;let U=Vy(f);Ia(s.current)&&U.add(s.current);let Y=L.relatedTarget;ma(Y)&&Y.dataset.headlessuiFocusGuard!=="true"&&(Ly(U,Y)||(E.current?ls(s.current,Un(b.current,{[ts.Forwards]:()=>Ln.Next,[ts.Backwards]:()=>Ln.Previous})|Ln.WrapAround,{relativeTo:L.target}):ma(L.target)&&_n(L.target)))}},A=Ae();return st.createElement(st.Fragment,null,T&&st.createElement(Gf,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:S,features:ur.Focusable}),A({ourProps:C,theirProps:m,defaultTag:Aw,name:"FocusTrap"}),T&&st.createElement(Gf,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:S,features:ur.Focusable}))}let Nw=ce(jw),Cw=Object.assign(Nw,{features:qa});function Mw(n=!0){let a=w.useRef(da.slice());return Td(([s],[o])=>{o===!0&&s===!1&&wr(()=>{a.current.splice(0)}),o===!1&&s===!0&&(a.current=da.slice())},[n,da,a]),jt(()=>{var s;return(s=a.current.find(o=>o!=null&&o.isConnected))!=null?s:null})}function Dw(n,{ownerDocument:a}){let s=!!(n&8),o=Mw(s);Td(()=>{s||XT(a==null?void 0:a.body)&&_n(o())},[s]),Ny(()=>{s&&_n(o())})}function zw(n,{ownerDocument:a,container:s,initialFocus:o,initialFocusFallback:u}){let d=w.useRef(null),f=ys(!!(n&1),"focus-trap#initial-focus"),h=wd();return Td(()=>{if(n===0)return;if(!f){u!=null&&u.current&&_n(u.current);return}let m=s.current;m&&wr(()=>{if(!h.current)return;let p=a==null?void 0:a.activeElement;if(o!=null&&o.current){if((o==null?void 0:o.current)===p){d.current=p;return}}else if(m.contains(p)){d.current=p;return}if(o!=null&&o.current)_n(o.current);else{if(n&16){if(ls(m,Ln.First|Ln.AutoFocus)!==qf.Error)return}else if(ls(m,Ln.First)!==qf.Error)return;if(u!=null&&u.current&&(_n(u.current),(a==null?void 0:a.activeElement)===u.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}d.current=a==null?void 0:a.activeElement})},[u,f,n]),d}function Ow(n,{ownerDocument:a,container:s,containers:o,previousActiveElement:u}){let d=wd(),f=!!(n&4);jy(a==null?void 0:a.defaultView,"focus",h=>{if(!f||!d.current)return;let m=Vy(o);Ia(s.current)&&m.add(s.current);let p=u.current;if(!p)return;let y=h.target;Ia(y)?Ly(m,y)?(u.current=y,_n(y)):(h.preventDefault(),h.stopPropagation(),_n(p)):_n(u.current)},!0)}function Ly(n,a){for(let s of n)if(s.contains(a))return!0;return!1}function _y(n){var a;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||!as((a=n.as)!=null?a:ky)||st.Children.count(n.children)===1}let Nr=w.createContext(null);Nr.displayName="TransitionContext";var Rw=(n=>(n.Visible="visible",n.Hidden="hidden",n))(Rw||{});function Vw(){let n=w.useContext(Nr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function Lw(){let n=w.useContext(Cr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Cr=w.createContext(null);Cr.displayName="NestingContext";function Mr(n){return"children"in n?Mr(n.children):n.current.filter(({el:a})=>a.current!==null).filter(({state:a})=>a==="visible").length>0}function Uy(n,a){let s=ti(n),o=w.useRef([]),u=wd(),d=gs(),f=jt((T,j=ha.Hidden)=>{let E=o.current.findIndex(({el:C})=>C===T);E!==-1&&(Un(j,{[ha.Unmount](){o.current.splice(E,1)},[ha.Hidden](){o.current[E].state="hidden"}}),d.microTask(()=>{var C;!Mr(o)&&u.current&&((C=s.current)==null||C.call(s))}))}),h=jt(T=>{let j=o.current.find(({el:E})=>E===T);return j?j.state!=="visible"&&(j.state="visible"):o.current.push({el:T,state:"visible"}),()=>f(T,ha.Unmount)}),m=w.useRef([]),p=w.useRef(Promise.resolve()),y=w.useRef({enter:[],leave:[]}),b=jt((T,j,E)=>{m.current.splice(0),a&&(a.chains.current[j]=a.chains.current[j].filter(([C])=>C!==T)),a==null||a.chains.current[j].push([T,new Promise(C=>{m.current.push(C)})]),a==null||a.chains.current[j].push([T,new Promise(C=>{Promise.all(y.current[j].map(([A,L])=>L)).then(()=>C())})]),j==="enter"?p.current=p.current.then(()=>a==null?void 0:a.wait.current).then(()=>E(j)):E(j)}),S=jt((T,j,E)=>{Promise.all(y.current[j].splice(0).map(([C,A])=>A)).then(()=>{var C;(C=m.current.shift())==null||C()}).then(()=>E(j))});return w.useMemo(()=>({children:o,register:h,unregister:f,onStart:b,onStop:S,wait:p,chains:y}),[h,f,o,b,S,y,p])}let ky=w.Fragment,By=rr.RenderStrategy;function _w(n,a){var s,o;let{transition:u=!0,beforeEnter:d,afterEnter:f,beforeLeave:h,afterLeave:m,enter:p,enterFrom:y,enterTo:b,entered:S,leave:T,leaveFrom:j,leaveTo:E,...C}=n,[A,L]=w.useState(null),U=w.useRef(null),Y=_y(n),X=gn(...Y?[U,a,L]:a===null?[]:[a]),tt=(s=C.unmount)==null||s?ha.Unmount:ha.Hidden,{show:Z,appear:nt,initial:xt}=Vw(),[J,ft]=w.useState(Z?"visible":"hidden"),vt=Lw(),{register:Ot,unregister:Nt}=vt;Ee(()=>Ot(U),[Ot,U]),Ee(()=>{if(tt===ha.Hidden&&U.current){if(Z&&J!=="visible"){ft("visible");return}return Un(J,{hidden:()=>Nt(U),visible:()=>Ot(U)})}},[J,U,Ot,Nt,Z,tt]);let Rt=jr();Ee(()=>{if(Y&&Rt&&J==="visible"&&U.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[U,J,Rt,Y]);let k=xt&&!nt,K=nt&&Z&&xt,F=w.useRef(!1),it=Uy(()=>{F.current||(ft("hidden"),Nt(U))},vt),ct=jt(bt=>{F.current=!0;let Ft=bt?"enter":"leave";it.onStart(U,Ft,Vt=>{Vt==="enter"?d==null||d():Vt==="leave"&&(h==null||h())})}),M=jt(bt=>{let Ft=bt?"enter":"leave";F.current=!1,it.onStop(U,Ft,Vt=>{Vt==="enter"?f==null||f():Vt==="leave"&&(m==null||m())}),Ft==="leave"&&!Mr(it)&&(ft("hidden"),Nt(U))});w.useEffect(()=>{Y&&u||(ct(Z),M(Z))},[Z,Y,u]);let $=!(!u||!Y||!Rt||k),[,q]=tw($,A,Z,{start:ct,end:M}),Q=Ga({ref:X,className:((o=$f(C.className,K&&p,K&&y,q.enter&&p,q.enter&&q.closed&&y,q.enter&&!q.closed&&b,q.leave&&T,q.leave&&!q.closed&&j,q.leave&&q.closed&&E,!q.transition&&Z&&S))==null?void 0:o.trim())||void 0,...I2(q)}),lt=0;J==="visible"&&(lt|=nn.Open),J==="hidden"&&(lt|=nn.Closed),Z&&J==="hidden"&&(lt|=nn.Opening),!Z&&J==="visible"&&(lt|=nn.Closing);let dt=Ae();return st.createElement(Cr.Provider,{value:it},st.createElement(lw,{value:lt},dt({ourProps:Q,theirProps:C,defaultTag:ky,features:By,visible:J==="visible",name:"Transition.Child"})))}function Uw(n,a){let{show:s,appear:o=!1,unmount:u=!0,...d}=n,f=w.useRef(null),h=_y(n),m=gn(...h?[f,a]:a===null?[]:[a]);jr();let p=Ar();if(s===void 0&&p!==null&&(s=(p&nn.Open)===nn.Open),s===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[y,b]=w.useState(s?"visible":"hidden"),S=Uy(()=>{s||b("hidden")}),[T,j]=w.useState(!0),E=w.useRef([s]);Ee(()=>{T!==!1&&E.current[E.current.length-1]!==s&&(E.current.push(s),j(!1))},[E,s]);let C=w.useMemo(()=>({show:s,appear:o,initial:T}),[s,o,T]);Ee(()=>{s?b("visible"):!Mr(S)&&f.current!==null&&b("hidden")},[s,S]);let A={unmount:u},L=jt(()=>{var X;T&&j(!1),(X=n.beforeEnter)==null||X.call(n)}),U=jt(()=>{var X;T&&j(!1),(X=n.beforeLeave)==null||X.call(n)}),Y=Ae();return st.createElement(Cr.Provider,{value:S},st.createElement(Nr.Provider,{value:C},Y({ourProps:{...A,as:w.Fragment,children:st.createElement(Hy,{ref:m,...A,...d,beforeEnter:L,beforeLeave:U})},theirProps:{},defaultTag:w.Fragment,features:By,visible:y==="visible",name:"Transition"})))}function kw(n,a){let s=w.useContext(Nr)!==null,o=Ar()!==null;return st.createElement(st.Fragment,null,!s&&o?st.createElement(Kf,{ref:a,...n}):st.createElement(Hy,{ref:a,...n}))}let Kf=ce(Uw),Hy=ce(_w),Ed=ce(kw),Bw=Object.assign(Kf,{Child:Ed,Root:Kf});var Hw=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Hw||{}),$w=(n=>(n[n.SetTitleId=0]="SetTitleId",n))($w||{});let Gw={0(n,a){return n.titleId===a.id?n:{...n,titleId:a.id}}},Ad=w.createContext(null);Ad.displayName="DialogContext";function Dr(n){let a=w.useContext(Ad);if(a===null){let s=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,Dr),s}return a}function Yw(n,a){return Un(a.type,Gw,n,a)}let Nv=ce(function(n,a){let s=w.useId(),{id:o=`headlessui-dialog-${s}`,open:u,onClose:d,initialFocus:f,role:h="dialog",autoFocus:m=!0,__demoMode:p=!1,unmount:y=!1,...b}=n,S=w.useRef(!1);h=(function(){return h==="dialog"||h==="alertdialog"?h:(S.current||(S.current=!0,console.warn(`Invalid role [${h}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let T=Ar();u===void 0&&T!==null&&(u=(T&nn.Open)===nn.Open);let j=w.useRef(null),E=gn(j,a),C=Sd(j.current),A=u?0:1,[L,U]=w.useReducer(Yw,{titleId:null,descriptionId:null,panelRef:w.createRef()}),Y=jt(()=>d(!1)),X=jt(q=>U({type:0,id:q})),tt=jr()?A===0:!1,[Z,nt]=mw(),xt={get current(){var q;return(q=L.panelRef.current)!=null?q:j.current}},J=Ry(),{resolveContainers:ft}=Tw({mainTreeNode:J,portals:Z,defaultContainers:[xt]}),vt=T!==null?(T&nn.Closing)===nn.Closing:!1;D2(p||vt?!1:tt,{allowed:jt(()=>{var q,Q;return[(Q=(q=j.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Q:null]}),disallowed:jt(()=>{var q;return[(q=J==null?void 0:J.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})});let Ot=Sy.get(null);Ee(()=>{if(tt)return Ot.actions.push(o),()=>Ot.actions.pop(o)},[Ot,o,tt]);let Nt=Ty(Ot,w.useCallback(q=>Ot.selectors.isTop(q,o),[Ot,o]));G2(Nt,ft,q=>{q.preventDefault(),Y()}),xw(Nt,C==null?void 0:C.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),Y()}),Q2(p||vt?!1:tt,C,ft),z2(tt,j,Y);let[Rt,k]=u2(),K=w.useMemo(()=>[{dialogState:A,close:Y,setTitleId:X,unmount:y},L],[A,Y,X,y,L]),F=ei({open:A===0}),it={ref:E,id:o,role:h,tabIndex:-1,"aria-modal":p?void 0:A===0?!0:void 0,"aria-labelledby":L.titleId,"aria-describedby":Rt,unmount:y},ct=!Sw(),M=qa.None;tt&&!p&&(M|=qa.RestoreFocus,M|=qa.TabLock,m&&(M|=qa.AutoFocus),ct&&(M|=qa.InitialFocus));let $=Ae();return st.createElement(sw,null,st.createElement(Av,{force:!0},st.createElement(gw,null,st.createElement(Ad.Provider,{value:K},st.createElement(zy,{target:j},st.createElement(Av,{force:!1},st.createElement(k,{slot:F},st.createElement(nt,null,st.createElement(Cw,{initialFocus:f,initialFocusFallback:j,containers:ft,features:M},st.createElement(p2,{value:Y},$({ourProps:it,theirProps:b,slot:F,defaultTag:qw,features:Xw,visible:A===0,name:"Dialog"})))))))))))}),qw="div",Xw=rr.RenderStrategy|rr.Static;function Kw(n,a){let{transition:s=!1,open:o,...u}=n,d=Ar(),f=n.hasOwnProperty("open")||d!==null,h=n.hasOwnProperty("onClose");if(!f&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!f)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!h)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!d&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(o!==void 0||s)&&!u.static?st.createElement(jv,null,st.createElement(Bw,{show:o,transition:s,unmount:u.unmount},st.createElement(Nv,{ref:a,...u}))):st.createElement(jv,null,st.createElement(Nv,{ref:a,open:o,...u}))}let Fw="div";function Zw(n,a){let s=w.useId(),{id:o=`headlessui-dialog-panel-${s}`,transition:u=!1,...d}=n,[{dialogState:f,unmount:h},m]=Dr("Dialog.Panel"),p=gn(a,m.panelRef),y=ei({open:f===0}),b=jt(C=>{C.stopPropagation()}),S={ref:p,id:o,onClick:b},T=u?Ed:w.Fragment,j=u?{unmount:h}:{},E=Ae();return st.createElement(T,{...j},E({ourProps:S,theirProps:d,slot:y,defaultTag:Fw,name:"Dialog.Panel"}))}let Qw="div";function Jw(n,a){let{transition:s=!1,...o}=n,[{dialogState:u,unmount:d}]=Dr("Dialog.Backdrop"),f=ei({open:u===0}),h={ref:a,"aria-hidden":!0},m=s?Ed:w.Fragment,p=s?{unmount:d}:{},y=Ae();return st.createElement(m,{...p},y({ourProps:h,theirProps:o,slot:f,defaultTag:Qw,name:"Dialog.Backdrop"}))}let Pw="h2";function Ww(n,a){let s=w.useId(),{id:o=`headlessui-dialog-title-${s}`,...u}=n,[{dialogState:d,setTitleId:f}]=Dr("Dialog.Title"),h=gn(a);w.useEffect(()=>(f(o),()=>f(null)),[o,f]);let m=ei({open:d===0}),p={ref:h,id:o};return Ae()({ourProps:p,theirProps:u,slot:m,defaultTag:Pw,name:"Dialog.Title"})}let Iw=ce(Kw),$y=ce(Zw),tE=ce(Jw),eE=ce(Ww),nE=Object.assign(Iw,{Panel:$y,Title:eE,Description:h2});const fr=w.createContext({});function aE(n){const a=w.useRef(null);return a.current===null&&(a.current=n()),a.current}const iE=typeof window<"u",Gy=iE?w.useLayoutEffect:w.useEffect,jd=w.createContext(null);function Nd(n,a){n.indexOf(a)===-1&&n.push(a)}function dr(n,a){const s=n.indexOf(a);s>-1&&n.splice(s,1)}const pn=(n,a,s)=>s>a?a:s<n?n:s;let Cd=()=>{};const va={},Yy=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function qy(n){return typeof n=="object"&&n!==null}const Xy=n=>/^0[^.\s]+$/u.test(n);function Ky(n){let a;return()=>(a===void 0&&(a=n()),a)}const Je=n=>n,lE=(n,a)=>s=>a(n(s)),bs=(...n)=>n.reduce(lE),fs=(n,a,s)=>{const o=a-n;return o===0?1:(s-n)/o};class Md{constructor(){this.subscriptions=[]}add(a){return Nd(this.subscriptions,a),()=>dr(this.subscriptions,a)}notify(a,s,o){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](a,s,o);else for(let d=0;d<u;d++){const f=this.subscriptions[d];f&&f(a,s,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=n=>n*1e3,Ze=n=>n/1e3;function Fy(n,a){return a?n*(1e3/a):0}const Zy=(n,a,s)=>(((1-3*s+3*a)*n+(3*s-6*a))*n+3*a)*n,sE=1e-7,oE=12;function rE(n,a,s,o,u){let d,f,h=0;do f=a+(s-a)/2,d=Zy(f,o,u)-n,d>0?s=f:a=f;while(Math.abs(d)>sE&&++h<oE);return f}function xs(n,a,s,o){if(n===a&&s===o)return Je;const u=d=>rE(d,0,1,n,s);return d=>d===0||d===1?d:Zy(u(d),a,o)}const Qy=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Jy=n=>a=>1-n(1-a),Py=xs(.33,1.53,.69,.99),Dd=Jy(Py),Wy=Qy(Dd),Iy=n=>n>=1?1:(n*=2)<1?.5*Dd(n):.5*(2-Math.pow(2,-10*(n-1))),zd=n=>1-Math.sin(Math.acos(n)),tb=Jy(zd),eb=Qy(zd),uE=xs(.42,0,1,1),cE=xs(0,0,.58,1),nb=xs(.42,0,.58,1),fE=n=>Array.isArray(n)&&typeof n[0]!="number",ab=n=>Array.isArray(n)&&typeof n[0]=="number",dE={linear:Je,easeIn:uE,easeInOut:nb,easeOut:cE,circIn:zd,circInOut:eb,circOut:tb,backIn:Dd,backInOut:Wy,backOut:Py,anticipate:Iy},hE=n=>typeof n=="string",Cv=n=>{if(ab(n)){Cd(n.length===4);const[a,s,o,u]=n;return xs(a,s,o,u)}else if(hE(n))return dE[n];return n},Ko=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mE(n,a){let s=new Set,o=new Set,u=!1,d=!1;const f=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(y){f.has(y)&&(p.schedule(y),n()),y(h)}const p={schedule:(y,b=!1,S=!1)=>{const j=S&&u?s:o;return b&&f.add(y),j.add(y),y},cancel:y=>{o.delete(y),f.delete(y)},process:y=>{if(h=y,u){d=!0;return}u=!0;const b=s;s=o,o=b,s.forEach(m),s.clear(),u=!1,d&&(d=!1,p.process(y))}};return p}const pE=40;function ib(n,a){let s=!1,o=!0;const u={delta:0,timestamp:0,isProcessing:!1},d=()=>s=!0,f=Ko.reduce((U,Y)=>(U[Y]=mE(d),U),{}),{setup:h,read:m,resolveKeyframes:p,preUpdate:y,update:b,preRender:S,render:T,postRender:j}=f,E=()=>{const U=va.useManualTiming,Y=U?u.timestamp:performance.now();s=!1,U||(u.delta=o?1e3/60:Math.max(Math.min(Y-u.timestamp,pE),1)),u.timestamp=Y,u.isProcessing=!0,h.process(u),m.process(u),p.process(u),y.process(u),b.process(u),S.process(u),T.process(u),j.process(u),u.isProcessing=!1,s&&a&&(o=!1,n(E))},C=()=>{s=!0,o=!0,u.isProcessing||n(E)};return{schedule:Ko.reduce((U,Y)=>{const X=f[Y];return U[Y]=(tt,Z=!1,nt=!1)=>(s||C(),X.schedule(tt,Z,nt)),U},{}),cancel:U=>{for(let Y=0;Y<Ko.length;Y++)f[Ko[Y]].cancel(U)},state:u,steps:f}}const{schedule:zt,cancel:ya,state:re,steps:hf}=ib(typeof requestAnimationFrame<"u"?requestAnimationFrame:Je,!0);let Io;function gE(){Io=void 0}const me={now:()=>(Io===void 0&&me.set(re.isProcessing||va.useManualTiming?re.timestamp:performance.now()),Io),set:n=>{Io=n,queueMicrotask(gE)}},lb=n=>a=>typeof a=="string"&&a.startsWith(n),sb=lb("--"),vE=lb("var(--"),Od=n=>vE(n)?yE.test(n.split("/*")[0].trim()):!1,yE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mv(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Wi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ds={...Wi,transform:n=>pn(0,1,n)},Fo={...Wi,default:1},ss=n=>Math.round(n*1e5)/1e5,Rd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bE(n){return n==null}const xE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vd=(n,a)=>s=>!!(typeof s=="string"&&xE.test(s)&&s.startsWith(n)||a&&!bE(s)&&Object.prototype.hasOwnProperty.call(s,a)),ob=(n,a,s)=>o=>{if(typeof o!="string")return o;const[u,d,f,h]=o.match(Rd);return{[n]:parseFloat(u),[a]:parseFloat(d),[s]:parseFloat(f),alpha:h!==void 0?parseFloat(h):1}},SE=n=>pn(0,255,n),mf={...Wi,transform:n=>Math.round(SE(n))},Za={test:Vd("rgb","red"),parse:ob("red","green","blue"),transform:({red:n,green:a,blue:s,alpha:o=1})=>"rgba("+mf.transform(n)+", "+mf.transform(a)+", "+mf.transform(s)+", "+ss(ds.transform(o))+")"};function TE(n){let a="",s="",o="",u="";return n.length>5?(a=n.substring(1,3),s=n.substring(3,5),o=n.substring(5,7),u=n.substring(7,9)):(a=n.substring(1,2),s=n.substring(2,3),o=n.substring(3,4),u=n.substring(4,5),a+=a,s+=s,o+=o,u+=u),{red:parseInt(a,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:u?parseInt(u,16)/255:1}}const Ff={test:Vd("#"),parse:TE,transform:Za.transform},Ss=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),ca=Ss("deg"),mn=Ss("%"),W=Ss("px"),wE=Ss("vh"),EE=Ss("vw"),Dv={...mn,parse:n=>mn.parse(n)/100,transform:n=>mn.transform(n*100)},Gi={test:Vd("hsl","hue"),parse:ob("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:s,alpha:o=1})=>"hsla("+Math.round(n)+", "+mn.transform(ss(a))+", "+mn.transform(ss(s))+", "+ss(ds.transform(o))+")"},Wt={test:n=>Za.test(n)||Ff.test(n)||Gi.test(n),parse:n=>Za.test(n)?Za.parse(n):Gi.test(n)?Gi.parse(n):Ff.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Za.transform(n):Gi.transform(n),getAnimatableNone:n=>{const a=Wt.parse(n);return a.alpha=0,Wt.transform(a)}},AE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jE(n){var a,s;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Rd))==null?void 0:a.length)||0)+(((s=n.match(AE))==null?void 0:s.length)||0)>0}const rb="number",ub="color",NE="var",CE="var(",zv="${}",ME=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fi(n){const a=n.toString(),s=[],o={color:[],number:[],var:[]},u=[];let d=0;const h=a.replace(ME,m=>(Wt.test(m)?(o.color.push(d),u.push(ub),s.push(Wt.parse(m))):m.startsWith(CE)?(o.var.push(d),u.push(NE),s.push(m)):(o.number.push(d),u.push(rb),s.push(parseFloat(m))),++d,zv)).split(zv);return{values:s,split:h,indexes:o,types:u}}function DE(n){return Fi(n).values}function cb({split:n,types:a}){const s=n.length;return o=>{let u="";for(let d=0;d<s;d++)if(u+=n[d],o[d]!==void 0){const f=a[d];f===rb?u+=ss(o[d]):f===ub?u+=Wt.transform(o[d]):u+=o[d]}return u}}function zE(n){return cb(Fi(n))}const OE=n=>typeof n=="number"?0:Wt.test(n)?Wt.getAnimatableNone(n):n,RE=(n,a)=>typeof n=="number"?a!=null&&a.trim().endsWith("/")?n:0:OE(n);function VE(n){const a=Fi(n);return cb(a)(a.values.map((o,u)=>RE(o,a.split[u])))}const an={test:jE,parse:DE,createTransformer:zE,getAnimatableNone:VE};function pf(n,a,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(a-n)*6*s:s<1/2?a:s<2/3?n+(a-n)*(2/3-s)*6:n}function LE({hue:n,saturation:a,lightness:s,alpha:o}){n/=360,a/=100,s/=100;let u=0,d=0,f=0;if(!a)u=d=f=s;else{const h=s<.5?s*(1+a):s+a-s*a,m=2*s-h;u=pf(m,h,n+1/3),d=pf(m,h,n),f=pf(m,h,n-1/3)}return{red:Math.round(u*255),green:Math.round(d*255),blue:Math.round(f*255),alpha:o}}function hr(n,a){return s=>s>0?a:n}const kt=(n,a,s)=>n+(a-n)*s,gf=(n,a,s)=>{const o=n*n,u=s*(a*a-o)+o;return u<0?0:Math.sqrt(u)},_E=[Ff,Za,Gi],UE=n=>_E.find(a=>a.test(n));function Ov(n){const a=UE(n);if(!a)return!1;let s=a.parse(n);return a===Gi&&(s=LE(s)),s}const Rv=(n,a)=>{const s=Ov(n),o=Ov(a);if(!s||!o)return hr(n,a);const u={...s};return d=>(u.red=gf(s.red,o.red,d),u.green=gf(s.green,o.green,d),u.blue=gf(s.blue,o.blue,d),u.alpha=kt(s.alpha,o.alpha,d),Za.transform(u))},Zf=new Set(["none","hidden"]);function kE(n,a){return Zf.has(n)?s=>s<=0?n:a:s=>s>=1?a:n}function BE(n,a){return s=>kt(n,a,s)}function Ld(n){return typeof n=="number"?BE:typeof n=="string"?Od(n)?hr:Wt.test(n)?Rv:GE:Array.isArray(n)?fb:typeof n=="object"?Wt.test(n)?Rv:HE:hr}function fb(n,a){const s=[...n],o=s.length,u=n.map((d,f)=>Ld(d)(d,a[f]));return d=>{for(let f=0;f<o;f++)s[f]=u[f](d);return s}}function HE(n,a){const s={...n,...a},o={};for(const u in s)n[u]!==void 0&&a[u]!==void 0&&(o[u]=Ld(n[u])(n[u],a[u]));return u=>{for(const d in o)s[d]=o[d](u);return s}}function $E(n,a){const s=[],o={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],f=n.indexes[d][o[d]],h=n.values[f]??0;s[u]=h,o[d]++}return s}const GE=(n,a)=>{const s=an.createTransformer(a),o=Fi(n),u=Fi(a);return o.indexes.var.length===u.indexes.var.length&&o.indexes.color.length===u.indexes.color.length&&o.indexes.number.length>=u.indexes.number.length?Zf.has(n)&&!u.values.length||Zf.has(a)&&!o.values.length?kE(n,a):bs(fb($E(o,u),u.values),s):hr(n,a)};function db(n,a,s){return typeof n=="number"&&typeof a=="number"&&typeof s=="number"?kt(n,a,s):Ld(n)(n,a)}const YE=n=>{const a=({timestamp:s})=>n(s);return{start:(s=!0)=>zt.update(a,s),stop:()=>ya(a),now:()=>re.isProcessing?re.timestamp:me.now()}},hb=(n,a,s=10)=>{let o="";const u=Math.max(Math.round(a/s),2);for(let d=0;d<u;d++)o+=Math.round(n(d/(u-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`},mr=2e4;function _d(n){let a=0;const s=50;let o=n.next(a);for(;!o.done&&a<mr;)a+=s,o=n.next(a);return a>=mr?1/0:a}function qE(n,a=100,s){const o=s({...n,keyframes:[0,a]}),u=Math.min(_d(o),mr);return{type:"keyframes",ease:d=>o.next(u*d).value/a,duration:Ze(u)}}const Gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Qf(n,a){return n*Math.sqrt(1-a*a)}const XE=12;function KE(n,a,s){let o=s;for(let u=1;u<XE;u++)o=o-n(o)/a(o);return o}const vf=.001;function FE({duration:n=Gt.duration,bounce:a=Gt.bounce,velocity:s=Gt.velocity,mass:o=Gt.mass}){let u,d,f=1-a;f=pn(Gt.minDamping,Gt.maxDamping,f),n=pn(Gt.minDuration,Gt.maxDuration,Ze(n)),f<1?(u=p=>{const y=p*f,b=y*n,S=y-s,T=Qf(p,f),j=Math.exp(-b);return vf-S/T*j},d=p=>{const b=p*f*n,S=b*s+s,T=Math.pow(f,2)*Math.pow(p,2)*n,j=Math.exp(-b),E=Qf(Math.pow(p,2),f);return(-u(p)+vf>0?-1:1)*((S-T)*j)/E}):(u=p=>{const y=Math.exp(-p*n),b=(p-s)*n+1;return-vf+y*b},d=p=>{const y=Math.exp(-p*n),b=(s-p)*(n*n);return y*b});const h=5/n,m=KE(u,d,h);if(n=_e(n),isNaN(m))return{stiffness:Gt.stiffness,damping:Gt.damping,duration:n};{const p=Math.pow(m,2)*o;return{stiffness:p,damping:f*2*Math.sqrt(o*p),duration:n}}}const ZE=["duration","bounce"],QE=["stiffness","damping","mass"];function Vv(n,a){return a.some(s=>n[s]!==void 0)}function JE(n){let a={velocity:Gt.velocity,stiffness:Gt.stiffness,damping:Gt.damping,mass:Gt.mass,isResolvedFromDuration:!1,...n};if(!Vv(n,QE)&&Vv(n,ZE))if(a.velocity=0,n.visualDuration){const s=n.visualDuration,o=2*Math.PI/(s*1.2),u=o*o,d=2*pn(.05,1,1-(n.bounce||0))*Math.sqrt(u);a={...a,mass:Gt.mass,stiffness:u,damping:d}}else{const s=FE({...n,velocity:0});a={...a,...s,mass:Gt.mass},a.isResolvedFromDuration=!0}return a}function pr(n=Gt.visualDuration,a=Gt.bounce){const s=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:u}=s;const d=s.keyframes[0],f=s.keyframes[s.keyframes.length-1],h={done:!1,value:d},{stiffness:m,damping:p,mass:y,duration:b,velocity:S,isResolvedFromDuration:T}=JE({...s,velocity:-Ze(s.velocity||0)}),j=S||0,E=p/(2*Math.sqrt(m*y)),C=f-d,A=Ze(Math.sqrt(m/y)),L=Math.abs(C)<5;o||(o=L?Gt.restSpeed.granular:Gt.restSpeed.default),u||(u=L?Gt.restDelta.granular:Gt.restDelta.default);let U,Y,X,tt,Z,nt;if(E<1)X=Qf(A,E),tt=(j+E*A*C)/X,U=J=>{const ft=Math.exp(-E*A*J);return f-ft*(tt*Math.sin(X*J)+C*Math.cos(X*J))},Z=E*A*tt+C*X,nt=E*A*C-tt*X,Y=J=>Math.exp(-E*A*J)*(Z*Math.sin(X*J)+nt*Math.cos(X*J));else if(E===1){U=ft=>f-Math.exp(-A*ft)*(C+(j+A*C)*ft);const J=j+A*C;Y=ft=>Math.exp(-A*ft)*(A*J*ft-j)}else{const J=A*Math.sqrt(E*E-1);U=Nt=>{const Rt=Math.exp(-E*A*Nt),k=Math.min(J*Nt,300);return f-Rt*((j+E*A*C)*Math.sinh(k)+J*C*Math.cosh(k))/J};const ft=(j+E*A*C)/J,vt=E*A*ft-C*J,Ot=E*A*C-ft*J;Y=Nt=>{const Rt=Math.exp(-E*A*Nt),k=Math.min(J*Nt,300);return Rt*(vt*Math.sinh(k)+Ot*Math.cosh(k))}}const xt={calculatedDuration:T&&b||null,velocity:J=>_e(Y(J)),next:J=>{if(!T&&E<1){const vt=Math.exp(-E*A*J),Ot=Math.sin(X*J),Nt=Math.cos(X*J),Rt=f-vt*(tt*Ot+C*Nt),k=_e(vt*(Z*Ot+nt*Nt));return h.done=Math.abs(k)<=o&&Math.abs(f-Rt)<=u,h.value=h.done?f:Rt,h}const ft=U(J);if(T)h.done=J>=b;else{const vt=_e(Y(J));h.done=Math.abs(vt)<=o&&Math.abs(f-ft)<=u}return h.value=h.done?f:ft,h},toString:()=>{const J=Math.min(_d(xt),mr),ft=hb(vt=>xt.next(J*vt).value,J,30);return J+"ms "+ft},toTransition:()=>{}};return xt}pr.applyToOptions=n=>{const a=qE(n,100,pr);return n.ease=a.ease,n.duration=_e(a.duration),n.type="keyframes",n};const PE=5;function mb(n,a,s){const o=Math.max(a-PE,0);return Fy(s-n(o),a-o)}function Jf({keyframes:n,velocity:a=0,power:s=.8,timeConstant:o=325,bounceDamping:u=10,bounceStiffness:d=500,modifyTarget:f,min:h,max:m,restDelta:p=.5,restSpeed:y}){const b=n[0],S={done:!1,value:b},T=nt=>h!==void 0&&nt<h||m!==void 0&&nt>m,j=nt=>h===void 0?m:m===void 0||Math.abs(h-nt)<Math.abs(m-nt)?h:m;let E=s*a;const C=b+E,A=f===void 0?C:f(C);A!==C&&(E=A-b);const L=nt=>-E*Math.exp(-nt/o),U=nt=>A+L(nt),Y=nt=>{const xt=L(nt),J=U(nt);S.done=Math.abs(xt)<=p,S.value=S.done?A:J};let X,tt;const Z=nt=>{T(S.value)&&(X=nt,tt=pr({keyframes:[S.value,j(S.value)],velocity:mb(U,nt,S.value),damping:u,stiffness:d,restDelta:p,restSpeed:y}))};return Z(0),{calculatedDuration:null,next:nt=>{let xt=!1;return!tt&&X===void 0&&(xt=!0,Y(nt),Z(nt)),X!==void 0&&nt>=X?tt.next(nt-X):(!xt&&Y(nt),S)}}}function WE(n,a,s){const o=[],u=s||va.mix||db,d=n.length-1;for(let f=0;f<d;f++){let h=u(n[f],n[f+1]);if(a){const m=Array.isArray(a)?a[f]||Je:a;h=bs(m,h)}o.push(h)}return o}function IE(n,a,{clamp:s=!0,ease:o,mixer:u}={}){const d=n.length;if(Cd(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const h=WE(a,o,u),m=h.length,p=y=>{if(f&&y<n[0])return a[0];let b=0;if(m>1)for(;b<n.length-2&&!(y<n[b+1]);b++);const S=fs(n[b],n[b+1],y);return h[b](S)};return s?y=>p(pn(n[0],n[d-1],y)):p}function t5(n,a){const s=n[n.length-1];for(let o=1;o<=a;o++){const u=fs(0,a,o);n.push(kt(s,1,u))}}function e5(n){const a=[0];return t5(a,n.length-1),a}function n5(n,a){return n.map(s=>s*a)}function a5(n,a){return n.map(()=>a||nb).splice(0,n.length-1)}function os({duration:n=300,keyframes:a,times:s,ease:o="easeInOut"}){const u=fE(o)?o.map(Cv):Cv(o),d={done:!1,value:a[0]},f=n5(s&&s.length===a.length?s:e5(a),n),h=IE(f,a,{ease:Array.isArray(u)?u:a5(a,u)});return{calculatedDuration:n,next:m=>(d.value=h(m),d.done=m>=n,d)}}const i5=n=>n!==null;function zr(n,{repeat:a,repeatType:s="loop"},o,u=1){const d=n.filter(i5),h=u<0||a&&s!=="loop"&&a%2===1?0:d.length-1;return!h||o===void 0?d[h]:o}const l5={decay:Jf,inertia:Jf,tween:os,keyframes:os,spring:pr};function pb(n){typeof n.type=="string"&&(n.type=l5[n.type])}class Ud{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(a=>{this.resolve=a})}notifyFinished(){this.resolve()}then(a,s){return this.finished.then(a,s)}}const s5=n=>n/100;class gr extends Ud{constructor(a){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var o,u;const{motionValue:s}=this.options;s&&s.updatedAt!==me.now()&&this.tick(me.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(u=(o=this.options).onStop)==null||u.call(o))},this.options=a,this.initAnimation(),this.play(),a.autoplay===!1&&this.pause()}initAnimation(){const{options:a}=this;pb(a);const{type:s=os,repeat:o=0,repeatDelay:u=0,repeatType:d,velocity:f=0}=a;let{keyframes:h}=a;const m=s||os;m!==os&&typeof h[0]!="number"&&(this.mixKeyframes=bs(s5,db(h[0],h[1])),h=[0,100]);const p=m({...a,keyframes:h});d==="mirror"&&(this.mirroredGenerator=m({...a,keyframes:[...h].reverse(),velocity:-f})),p.calculatedDuration===null&&(p.calculatedDuration=_d(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+u,this.totalDuration=this.resolvedDuration*(o+1)-u,this.generator=p}updateTime(a){const s=Math.round(a-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(a,s=!1){const{generator:o,totalDuration:u,mixKeyframes:d,mirroredGenerator:f,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:y,repeat:b,repeatType:S,repeatDelay:T,type:j,onUpdate:E,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-u/this.speed,this.startTime)),s?this.currentTime=a:this.updateTime(a);const A=this.currentTime-p*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?A<0:A>u;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let U=this.currentTime,Y=o;if(b){const nt=Math.min(this.currentTime,u)/h;let xt=Math.floor(nt),J=nt%1;!J&&nt>=1&&(J=1),J===1&&xt--,xt=Math.min(xt,b+1),!!(xt%2)&&(S==="reverse"?(J=1-J,T&&(J-=T/h)):S==="mirror"&&(Y=f)),U=pn(0,1,J)*h}let X;L?(this.delayState.value=y[0],X=this.delayState):X=Y.next(U),d&&!L&&(X.value=d(X.value));let{done:tt}=X;!L&&m!==null&&(tt=this.playbackSpeed>=0?this.currentTime>=u:this.currentTime<=0);const Z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&tt);return Z&&j!==Jf&&(X.value=zr(y,this.options,C,this.speed)),E&&E(X.value),Z&&this.finish(),X}then(a,s){return this.finished.then(a,s)}get duration(){return Ze(this.calculatedDuration)}get iterationDuration(){const{delay:a=0}=this.options||{};return this.duration+Ze(a)}get time(){return Ze(this.currentTime)}set time(a){a=_e(a),this.currentTime=a,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=a,this.tick(a))}getGeneratorVelocity(){const a=this.currentTime;if(a<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(a);const s=this.generator.next(a).value;return mb(o=>this.generator.next(o).value,a,s)}get speed(){return this.playbackSpeed}set speed(a){const s=this.playbackSpeed!==a;s&&this.driver&&this.updateTime(me.now()),this.playbackSpeed=a,s&&this.driver&&(this.time=Ze(this.currentTime))}play(){var u,d;if(this.isStopped)return;const{driver:a=YE,startTime:s}=this.options;this.driver||(this.driver=a(f=>this.tick(f))),(d=(u=this.options).onPlay)==null||d.call(u);const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(me.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var a,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(a=this.options).onComplete)==null||s.call(a)}cancel(){var a,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(a=this.options).onCancel)==null||s.call(a)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}attachTimeline(a){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),a.observe(this)}}function o5(n){for(let a=1;a<n.length;a++)n[a]??(n[a]=n[a-1])}const Qa=n=>n*180/Math.PI,Pf=n=>{const a=Qa(Math.atan2(n[1],n[0]));return Wf(a)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Pf,rotateZ:Pf,skewX:n=>Qa(Math.atan(n[1])),skewY:n=>Qa(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Wf=n=>(n=n%360,n<0&&(n+=360),n),Lv=Pf,_v=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),Uv=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),u5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_v,scaleY:Uv,scale:n=>(_v(n)+Uv(n))/2,rotateX:n=>Wf(Qa(Math.atan2(n[6],n[5]))),rotateY:n=>Wf(Qa(Math.atan2(-n[2],n[0]))),rotateZ:Lv,rotate:Lv,skewX:n=>Qa(Math.atan(n[4])),skewY:n=>Qa(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function If(n){return n.includes("scale")?1:0}function td(n,a){if(!n||n==="none")return If(a);const s=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,u;if(s)o=u5,u=s;else{const h=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=r5,u=h}if(!u)return If(a);const d=o[a],f=u[1].split(",").map(f5);return typeof d=="function"?d(f):f[d]}const c5=(n,a)=>{const{transform:s="none"}=getComputedStyle(n);return td(s,a)};function f5(n){return parseFloat(n.trim())}const Ii=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tl=new Set(Ii),kv=n=>n===Wi||n===W,d5=new Set(["x","y","z"]),h5=Ii.filter(n=>!d5.has(n));function m5(n){const a=[];return h5.forEach(s=>{const o=n.getValue(s);o!==void 0&&(a.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),a}const pa={width:({x:n},{paddingLeft:a="0",paddingRight:s="0",boxSizing:o})=>{const u=n.max-n.min;return o==="border-box"?u:u-parseFloat(a)-parseFloat(s)},height:({y:n},{paddingTop:a="0",paddingBottom:s="0",boxSizing:o})=>{const u=n.max-n.min;return o==="border-box"?u:u-parseFloat(a)-parseFloat(s)},top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:(n,{transform:a})=>td(a,"x"),y:(n,{transform:a})=>td(a,"y")};pa.translateX=pa.x;pa.translateY=pa.y;const Ja=new Set;let ed=!1,nd=!1,ad=!1;function gb(){if(nd){const n=Array.from(Ja).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),s=new Map;a.forEach(o=>{const u=m5(o);u.length&&(s.set(o,u),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const u=s.get(o);u&&u.forEach(([d,f])=>{var h;(h=o.getValue(d))==null||h.set(f)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}nd=!1,ed=!1,Ja.forEach(n=>n.complete(ad)),Ja.clear()}function vb(){Ja.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(nd=!0)})}function p5(){ad=!0,vb(),gb(),ad=!1}class kd{constructor(a,s,o,u,d,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...a],this.onComplete=s,this.name=o,this.motionValue=u,this.element=d,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ja.add(this),ed||(ed=!0,zt.read(vb),zt.resolveKeyframes(gb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:s,element:o,motionValue:u}=this;if(a[0]===null){const d=u==null?void 0:u.get(),f=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&s){const h=o.readValue(s,f);h!=null&&(a[0]=h)}a[0]===void 0&&(a[0]=f),u&&d===void 0&&u.set(a[0])}o5(a)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(a=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,a),Ja.delete(this)}cancel(){this.state==="scheduled"&&(Ja.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const g5=n=>n.startsWith("--");function yb(n,a,s){g5(a)?n.style.setProperty(a,s):n.style[a]=s}const v5={};function bb(n,a){const s=Ky(n);return()=>v5[a]??s()}const y5=bb(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xb=bb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),es=([n,a,s,o])=>`cubic-bezier(${n}, ${a}, ${s}, ${o})`,Bv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:es([0,.65,.55,1]),circOut:es([.55,0,1,.45]),backIn:es([.31,.01,.66,-.59]),backOut:es([.33,1.53,.69,.99])};function Sb(n,a){if(n)return typeof n=="function"?xb()?hb(n,a):"ease-out":ab(n)?es(n):Array.isArray(n)?n.map(s=>Sb(s,a)||Bv.easeOut):Bv[n]}function b5(n,a,s,{delay:o=0,duration:u=300,repeat:d=0,repeatType:f="loop",ease:h="easeOut",times:m}={},p=void 0){const y={[a]:s};m&&(y.offset=m);const b=Sb(h,u);Array.isArray(b)&&(y.easing=b);const S={delay:o,duration:u,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:d+1,direction:f==="reverse"?"alternate":"normal"};return p&&(S.pseudoElement=p),n.animate(y,S)}function Tb(n){return typeof n=="function"&&"applyToOptions"in n}function x5({type:n,...a}){return Tb(n)&&xb()?n.applyToOptions(a):(a.duration??(a.duration=300),a.ease??(a.ease="easeOut"),a)}class wb extends Ud{constructor(a){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!a)return;const{element:s,name:o,keyframes:u,pseudoElement:d,allowFlatten:f=!1,finalKeyframe:h,onComplete:m}=a;this.isPseudoElement=!!d,this.allowFlatten=f,this.options=a,Cd(typeof a.type!="string");const p=x5(a);this.animation=b5(s,o,u,p,d),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!d){const y=zr(u,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(y),yb(s,o,y),this.animation.cancel()}m==null||m(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var a,s;(s=(a=this.animation).finish)==null||s.call(a)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:a}=this;a==="idle"||a==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var s,o,u;const a=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(a!=null&&a.isConnected)&&((u=(o=this.animation).commitStyles)==null||u.call(o))}get duration(){var s,o;const a=((o=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:o.call(s).duration)||0;return Ze(Number(a))}get iterationDuration(){const{delay:a=0}=this.options||{};return this.duration+Ze(a)}get time(){return Ze(Number(this.animation.currentTime)||0)}set time(a){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_e(a),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(a){a<0&&(this.finishedTime=null),this.animation.playbackRate=a}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(a){this.manualStartTime=this.animation.startTime=a}attachTimeline({timeline:a,rangeStart:s,rangeEnd:o,observe:u}){var d;return this.allowFlatten&&((d=this.animation.effect)==null||d.updateTiming({easing:"linear"})),this.animation.onfinish=null,a&&y5()?(this.animation.timeline=a,s&&(this.animation.rangeStart=s),o&&(this.animation.rangeEnd=o),Je):u(this)}}const Eb={anticipate:Iy,backInOut:Wy,circInOut:eb};function S5(n){return n in Eb}function T5(n){typeof n.ease=="string"&&S5(n.ease)&&(n.ease=Eb[n.ease])}const yf=10;class w5 extends wb{constructor(a){T5(a),pb(a),super(a),a.startTime!==void 0&&a.autoplay!==!1&&(this.startTime=a.startTime),this.options=a}updateMotionValue(a){const{motionValue:s,onUpdate:o,onComplete:u,element:d,...f}=this.options;if(!s)return;if(a!==void 0){s.set(a);return}const h=new gr({...f,autoplay:!1}),m=Math.max(yf,me.now()-this.startTime),p=pn(0,yf,m-yf),y=h.sample(m).value,{name:b}=this.options;d&&b&&yb(d,b,y),s.setWithVelocity(h.sample(Math.max(0,m-p)).value,y,p),h.stop()}}const Hv=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(an.test(n)||n==="0")&&!n.startsWith("url("));function E5(n){const a=n[0];if(n.length===1)return!0;for(let s=0;s<n.length;s++)if(n[s]!==a)return!0}function A5(n,a,s,o){const u=n[0];if(u===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],f=Hv(u,a),h=Hv(d,a);return!f||!h?!1:E5(n)||(s==="spring"||Tb(s))&&o}function id(n){n.duration=0,n.type="keyframes"}const Ab=new Set(["opacity","clipPath","filter","transform"]),j5=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function N5(n){for(let a=0;a<n.length;a++)if(typeof n[a]=="string"&&j5.test(n[a]))return!0;return!1}const C5=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),M5=Ky(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function D5(n){var b;const{motionValue:a,name:s,repeatDelay:o,repeatType:u,damping:d,type:f,keyframes:h}=n;if(!(((b=a==null?void 0:a.owner)==null?void 0:b.current)instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:y}=a.owner.getProps();return M5()&&s&&(Ab.has(s)||C5.has(s)&&N5(h))&&(s!=="transform"||!y)&&!p&&!o&&u!=="mirror"&&d!==0&&f!=="inertia"}const z5=40;class O5 extends Ud{constructor({autoplay:a=!0,delay:s=0,type:o="keyframes",repeat:u=0,repeatDelay:d=0,repeatType:f="loop",keyframes:h,name:m,motionValue:p,element:y,...b}){var j;super(),this.stop=()=>{var E,C;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=me.now();const S={autoplay:a,delay:s,type:o,repeat:u,repeatDelay:d,repeatType:f,name:m,motionValue:p,element:y,...b},T=(y==null?void 0:y.KeyframeResolver)||kd;this.keyframeResolver=new T(h,(E,C,A)=>this.onKeyframesResolved(E,C,S,!A),m,p,y),(j=this.keyframeResolver)==null||j.scheduleResolve()}onKeyframesResolved(a,s,o,u){var A,L;this.keyframeResolver=void 0;const{name:d,type:f,velocity:h,delay:m,isHandoff:p,onUpdate:y}=o;this.resolvedAt=me.now();let b=!0;A5(a,d,f,h)||(b=!1,(va.instantAnimations||!m)&&(y==null||y(zr(a,o,s))),a[0]=a[a.length-1],id(o),o.repeat=0);const T={startTime:u?this.resolvedAt?this.resolvedAt-this.createdAt>z5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...o,keyframes:a},j=b&&!p&&D5(T),E=(L=(A=T.motionValue)==null?void 0:A.owner)==null?void 0:L.current;let C;if(j)try{C=new w5({...T,element:E})}catch{C=new gr(T)}else C=new gr(T);C.finished.then(()=>{this.notifyFinished()}).catch(Je),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(a,s){return this.finished.finally(a).then(()=>{})}get animation(){var a;return this._animation||((a=this.keyframeResolver)==null||a.resume(),p5()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(a){this.animation.time=a}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(a){this.animation.speed=a}get startTime(){return this.animation.startTime}attachTimeline(a){return this._animation?this.stopTimeline=this.animation.attachTimeline(a):this.pendingTimeline=a,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var a;this._animation&&this.animation.cancel(),(a=this.keyframeResolver)==null||a.cancel()}}function jb(n,a,s,o=0,u=1){const d=Array.from(n).sort((p,y)=>p.sortNodePosition(y)).indexOf(a),f=n.size,h=(f-1)*o;return typeof s=="function"?s(d,f):u===1?d*o:h-d*o}const R5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function V5(n){const a=R5.exec(n);if(!a)return[,];const[,s,o,u]=a;return[`--${s??o}`,u]}function Nb(n,a,s=1){const[o,u]=V5(n);if(!o)return;const d=window.getComputedStyle(a).getPropertyValue(o);if(d){const f=d.trim();return Yy(f)?parseFloat(f):f}return Od(u)?Nb(u,a,s+1):u}const L5={type:"spring",stiffness:500,damping:25,restSpeed:10},_5=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),U5={type:"keyframes",duration:.8},k5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B5=(n,{keyframes:a})=>a.length>2?U5:tl.has(n)?n.startsWith("scale")?_5(a[1]):L5:k5;function Cb(n,a){if(n!=null&&n.inherit&&a){const{inherit:s,...o}=n;return{...a,...o}}return n}function Bd(n,a){const s=(n==null?void 0:n[a])??(n==null?void 0:n.default)??n;return s!==n?Cb(s,n):s}const H5=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function $5(n){for(const a in n)if(!H5.has(a))return!0;return!1}const Hd=(n,a,s,o={},u,d)=>f=>{const h=Bd(o,n)||{},m=h.delay||o.delay||0;let{elapsed:p=0}=o;p=p-_e(m);const y={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:a.getVelocity(),...h,delay:-p,onUpdate:S=>{a.set(S),h.onUpdate&&h.onUpdate(S)},onComplete:()=>{f(),h.onComplete&&h.onComplete()},name:n,motionValue:a,element:d?void 0:u};$5(h)||Object.assign(y,B5(n,y)),y.duration&&(y.duration=_e(y.duration)),y.repeatDelay&&(y.repeatDelay=_e(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let b=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(id(y),y.delay===0&&(b=!0)),(va.instantAnimations||va.skipAnimations||u!=null&&u.shouldSkipAnimations)&&(b=!0,id(y),y.delay=0),y.allowFlatten=!h.type&&!h.ease,b&&!d&&a.get()!==void 0){const S=zr(y.keyframes,h);if(S!==void 0){zt.update(()=>{y.onUpdate(S),y.onComplete()});return}}return h.isSync?new gr(y):new O5(y)};function $v(n){const a=[{},{}];return n==null||n.values.forEach((s,o)=>{a[0][o]=s.get(),a[1][o]=s.getVelocity()}),a}function $d(n,a,s,o){if(typeof a=="function"){const[u,d]=$v(o);a=a(s!==void 0?s:n.custom,u,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[u,d]=$v(o);a=a(s!==void 0?s:n.custom,u,d)}return a}function Pa(n,a,s){const o=n.getProps();return $d(o,a,s!==void 0?s:o.custom,n)}const Mb=new Set(["width","height","top","left","right","bottom",...Ii]),Gv=30,G5=n=>!isNaN(parseFloat(n));class Y5{constructor(a,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var d;const u=me.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((d=this.events.change)==null||d.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty()},this.hasAnimated=!1,this.setCurrent(a),this.owner=s.owner}setCurrent(a){this.current=a,this.updatedAt=me.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=G5(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,s){this.events[a]||(this.events[a]=new Md);const o=this.events[a].add(s);return a==="change"?()=>{o(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,s){this.passiveEffect=a,this.stopPassiveEffect=s}set(a){this.passiveEffect?this.passiveEffect(a,this.updateAndNotify):this.updateAndNotify(a)}setWithVelocity(a,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,s=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var a;(a=this.events.change)==null||a.notify(this.current)}addDependent(a){this.dependents||(this.dependents=new Set),this.dependents.add(a)}removeDependent(a){this.dependents&&this.dependents.delete(a)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Gv)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Gv);return Fy(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(a){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=a(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var a,s;(a=this.dependents)==null||a.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zi(n,a){return new Y5(n,a)}const ld=n=>Array.isArray(n);function q5(n,a,s){n.hasValue(a)?n.getValue(a).set(s):n.addValue(a,Zi(s))}function X5(n){return ld(n)?n[n.length-1]||0:n}function K5(n,a){const s=Pa(n,a);let{transitionEnd:o={},transition:u={},...d}=s||{};d={...d,...o};for(const f in d){const h=X5(d[f]);q5(n,f,h)}}const ue=n=>!!(n&&n.getVelocity);function F5(n){return!!(ue(n)&&n.add)}function sd(n,a){const s=n.getValue("willChange");if(F5(s))return s.add(a);if(!s&&va.WillChange){const o=new va.WillChange("auto");n.addValue("willChange",o),o.add(a)}}function Gd(n){return n.replace(/([A-Z])/g,a=>`-${a.toLowerCase()}`)}const Z5="framerAppearId",Db="data-"+Gd(Z5);function zb(n){return n.props[Db]}function Q5({protectedKeys:n,needsAnimating:a},s){const o=n.hasOwnProperty(s)&&a[s]!==!0;return a[s]=!1,o}function Ob(n,a,{delay:s=0,transitionOverride:o,type:u}={}){let{transition:d,transitionEnd:f,...h}=a;const m=n.getDefaultTransition();d=d?Cb(d,m):m;const p=d==null?void 0:d.reduceMotion;o&&(d=o);const y=[],b=u&&n.animationState&&n.animationState.getState()[u];for(const S in h){const T=n.getValue(S,n.latestValues[S]??null),j=h[S];if(j===void 0||b&&Q5(b,S))continue;const E={delay:s,...Bd(d||{},S)},C=T.get();if(C!==void 0&&!T.isAnimating()&&!Array.isArray(j)&&j===C&&!E.velocity){zt.update(()=>T.set(j));continue}let A=!1;if(window.MotionHandoffAnimation){const Y=zb(n);if(Y){const X=window.MotionHandoffAnimation(Y,S,zt);X!==null&&(E.startTime=X,A=!0)}}sd(n,S);const L=p??n.shouldReduceMotion;T.start(Hd(S,T,j,L&&Mb.has(S)?{type:!1}:E,n,A));const U=T.animation;U&&y.push(U)}if(f){const S=()=>zt.update(()=>{f&&K5(n,f)});y.length?Promise.all(y).then(S):S()}return y}function od(n,a,s={}){var m;const o=Pa(n,a,s.type==="exit"?(m=n.presenceContext)==null?void 0:m.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(u=s.transitionOverride);const d=o?()=>Promise.all(Ob(n,o,s)):()=>Promise.resolve(),f=n.variantChildren&&n.variantChildren.size?(p=0)=>{const{delayChildren:y=0,staggerChildren:b,staggerDirection:S}=u;return J5(n,a,p,y,b,S,s)}:()=>Promise.resolve(),{when:h}=u;if(h){const[p,y]=h==="beforeChildren"?[d,f]:[f,d];return p().then(()=>y())}else return Promise.all([d(),f(s.delay)])}function J5(n,a,s=0,o=0,u=0,d=1,f){const h=[];for(const m of n.variantChildren)m.notify("AnimationStart",a),h.push(od(m,a,{...f,delay:s+(typeof o=="function"?0:o)+jb(n.variantChildren,m,o,u,d)}).then(()=>m.notify("AnimationComplete",a)));return Promise.all(h)}function P5(n,a,s={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const u=a.map(d=>od(n,d,s));o=Promise.all(u)}else if(typeof a=="string")o=od(n,a,s);else{const u=typeof a=="function"?Pa(n,a,s.custom):a;o=Promise.all(Ob(n,u,s))}return o.then(()=>{n.notify("AnimationComplete",a)})}const W5={test:n=>n==="auto",parse:n=>n},Rb=n=>a=>a.test(n),Vb=[Wi,W,mn,ca,EE,wE,W5],Yv=n=>Vb.find(Rb(n));function I5(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Xy(n):!0}const tA=new Set(["brightness","contrast","saturate","opacity"]);function eA(n){const[a,s]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=s.match(Rd)||[];if(!o)return n;const u=s.replace(o,"");let d=tA.has(a)?1:0;return o!==s&&(d*=100),a+"("+d+u+")"}const nA=/\b([a-z-]*)\(.*?\)/gu,rd={...an,getAnimatableNone:n=>{const a=n.match(nA);return a?a.map(eA).join(" "):n}},ud={...an,getAnimatableNone:n=>{const a=an.parse(n);return an.createTransformer(n)(a.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},qv={...Wi,transform:Math.round},aA={rotate:ca,rotateX:ca,rotateY:ca,rotateZ:ca,scale:Fo,scaleX:Fo,scaleY:Fo,scaleZ:Fo,skew:ca,skewX:ca,skewY:ca,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:ds,originX:Dv,originY:Dv,originZ:W},Yd={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,inset:W,insetBlock:W,insetBlockStart:W,insetBlockEnd:W,insetInline:W,insetInlineStart:W,insetInlineEnd:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,paddingBlock:W,paddingBlockStart:W,paddingBlockEnd:W,paddingInline:W,paddingInlineStart:W,paddingInlineEnd:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,marginBlock:W,marginBlockStart:W,marginBlockEnd:W,marginInline:W,marginInlineStart:W,marginInlineEnd:W,fontSize:W,backgroundPositionX:W,backgroundPositionY:W,...aA,zIndex:qv,fillOpacity:ds,strokeOpacity:ds,numOctaves:qv},iA={...Yd,color:Wt,backgroundColor:Wt,outlineColor:Wt,fill:Wt,stroke:Wt,borderColor:Wt,borderTopColor:Wt,borderRightColor:Wt,borderBottomColor:Wt,borderLeftColor:Wt,filter:rd,WebkitFilter:rd,mask:ud,WebkitMask:ud},Lb=n=>iA[n],lA=new Set([rd,ud]);function _b(n,a){let s=Lb(n);return lA.has(s)||(s=an),s.getAnimatableNone?s.getAnimatableNone(a):void 0}const sA=new Set(["auto","none","0"]);function oA(n,a,s){let o=0,u;for(;o<n.length&&!u;){const d=n[o];typeof d=="string"&&!sA.has(d)&&Fi(d).values.length&&(u=n[o]),o++}if(u&&s)for(const d of a)n[d]=_b(s,u)}class rA extends kd{constructor(a,s,o,u,d){super(a,s,o,u,d,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:s,name:o}=this;if(!s||!s.current)return;super.readKeyframes();for(let y=0;y<a.length;y++){let b=a[y];if(typeof b=="string"&&(b=b.trim(),Od(b))){const S=Nb(b,s.current);S!==void 0&&(a[y]=S),y===a.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!Mb.has(o)||a.length!==2)return;const[u,d]=a,f=Yv(u),h=Yv(d),m=Mv(u),p=Mv(d);if(m!==p&&pa[o]){this.needsMeasurement=!0;return}if(f!==h)if(kv(f)&&kv(h))for(let y=0;y<a.length;y++){const b=a[y];typeof b=="string"&&(a[y]=parseFloat(b))}else pa[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:s}=this,o=[];for(let u=0;u<a.length;u++)(a[u]===null||I5(a[u]))&&o.push(u);o.length&&oA(a,o,s)}measureInitialState(){const{element:a,unresolvedKeyframes:s,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pa[o](a.measureViewportBox(),window.getComputedStyle(a.current)),s[0]=this.measuredOrigin;const u=s[s.length-1];u!==void 0&&a.getValue(o,u).jump(u,!1)}measureEndState(){var h;const{element:a,name:s,unresolvedKeyframes:o}=this;if(!a||!a.current)return;const u=a.getValue(s);u&&u.jump(this.measuredOrigin,!1);const d=o.length-1,f=o[d];o[d]=pa[s](a.measureViewportBox(),window.getComputedStyle(a.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),(h=this.removedTransforms)!=null&&h.length&&this.removedTransforms.forEach(([m,p])=>{a.getValue(m).set(p)}),this.resolveNoneKeyframes()}}function Ub(n,a,s){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let o=document;const u=(s==null?void 0:s[n])??o.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n).filter(o=>o!=null)}const kb=(n,a)=>a&&typeof n=="number"?a.transform(n):n;function uA(n){return qy(n)&&"offsetHeight"in n&&!("ownerSVGElement"in n)}const{schedule:qd}=ib(queueMicrotask,!1),en={x:!1,y:!1};function Bb(){return en.x||en.y}function cA(n){return n==="x"||n==="y"?en[n]?null:(en[n]=!0,()=>{en[n]=!1}):en.x||en.y?null:(en.x=en.y=!0,()=>{en.x=en.y=!1})}function Hb(n,a){const s=Ub(n),o=new AbortController,u={passive:!0,...a,signal:o.signal};return[s,u,()=>o.abort()]}function fA(n){return!(n.pointerType==="touch"||Bb())}function dA(n,a,s={}){const[o,u,d]=Hb(n,s);return o.forEach(f=>{let h=!1,m=!1,p;const y=()=>{f.removeEventListener("pointerleave",j)},b=C=>{p&&(p(C),p=void 0),y()},S=C=>{h=!1,window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),m&&(m=!1,b(C))},T=()=>{h=!0,window.addEventListener("pointerup",S,u),window.addEventListener("pointercancel",S,u)},j=C=>{if(C.pointerType!=="touch"){if(h){m=!0;return}b(C)}},E=C=>{if(!fA(C))return;m=!1;const A=a(f,C);typeof A=="function"&&(p=A,f.addEventListener("pointerleave",j,u))};f.addEventListener("pointerenter",E,u),f.addEventListener("pointerdown",T,u)}),d}const $b=(n,a)=>a?n===a?!0:$b(n,a.parentElement):!1,Xd=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,hA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mA(n){return hA.has(n.tagName)||n.isContentEditable===!0}const pA=new Set(["INPUT","SELECT","TEXTAREA"]);function gA(n){return pA.has(n.tagName)||n.isContentEditable===!0}const tr=new WeakSet;function Xv(n){return a=>{a.key==="Enter"&&n(a)}}function bf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const vA=(n,a)=>{const s=n.currentTarget;if(!s)return;const o=Xv(()=>{if(tr.has(s))return;bf(s,"down");const u=Xv(()=>{bf(s,"up")}),d=()=>bf(s,"cancel");s.addEventListener("keyup",u,a),s.addEventListener("blur",d,a)});s.addEventListener("keydown",o,a),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),a)};function Kv(n){return Xd(n)&&!Bb()}const Fv=new WeakSet;function yA(n,a,s={}){const[o,u,d]=Hb(n,s),f=h=>{const m=h.currentTarget;if(!Kv(h)||Fv.has(h))return;tr.add(m),s.stopPropagation&&Fv.add(h);const p=a(m,h),y=(T,j)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",S),tr.has(m)&&tr.delete(m),Kv(T)&&typeof p=="function"&&p(T,{success:j})},b=T=>{y(T,m===window||m===document||s.useGlobalTarget||$b(m,T.target))},S=T=>{y(T,!1)};window.addEventListener("pointerup",b,u),window.addEventListener("pointercancel",S,u)};return o.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",f,u),uA(h)&&(h.addEventListener("focus",p=>vA(p,u)),!mA(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),d}function Kd(n){return qy(n)&&"ownerSVGElement"in n}const er=new WeakMap;let fa;const Gb=(n,a,s)=>(o,u)=>u&&u[0]?u[0][n+"Size"]:Kd(o)&&"getBBox"in o?o.getBBox()[a]:o[s],bA=Gb("inline","width","offsetWidth"),xA=Gb("block","height","offsetHeight");function SA({target:n,borderBoxSize:a}){var s;(s=er.get(n))==null||s.forEach(o=>{o(n,{get width(){return bA(n,a)},get height(){return xA(n,a)}})})}function TA(n){n.forEach(SA)}function wA(){typeof ResizeObserver>"u"||(fa=new ResizeObserver(TA))}function EA(n,a){fa||wA();const s=Ub(n);return s.forEach(o=>{let u=er.get(o);u||(u=new Set,er.set(o,u)),u.add(a),fa==null||fa.observe(o)}),()=>{s.forEach(o=>{const u=er.get(o);u==null||u.delete(a),u!=null&&u.size||fa==null||fa.unobserve(o)})}}const nr=new Set;let Yi;function AA(){Yi=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};nr.forEach(a=>a(n))},window.addEventListener("resize",Yi)}function jA(n){return nr.add(n),Yi||AA(),()=>{nr.delete(n),!nr.size&&typeof Yi=="function"&&(window.removeEventListener("resize",Yi),Yi=void 0)}}function Zv(n,a){return typeof n=="function"?jA(n):EA(n,a)}function NA(n){return Kd(n)&&n.tagName==="svg"}const CA=[...Vb,Wt,an],MA=n=>CA.find(Rb(n)),Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),qi=()=>({x:Qv(),y:Qv()}),Jv=()=>({min:0,max:0}),te=()=>({x:Jv(),y:Jv()}),DA=new WeakMap;function Or(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function hs(n){return typeof n=="string"||Array.isArray(n)}const Fd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zd=["initial",...Fd];function Rr(n){return Or(n.animate)||Zd.some(a=>hs(n[a]))}function Yb(n){return!!(Rr(n)||n.variants)}function zA(n,a,s){for(const o in a){const u=a[o],d=s[o];if(ue(u))n.addValue(o,u);else if(ue(d))n.addValue(o,Zi(u,{owner:n}));else if(d!==u)if(n.hasValue(o)){const f=n.getValue(o);f.liveStyle===!0?f.jump(u):f.hasAnimated||f.set(u)}else{const f=n.getStaticValue(o);n.addValue(o,Zi(f!==void 0?f:u,{owner:n}))}}for(const o in s)a[o]===void 0&&n.removeValue(o);return a}const cd={current:null},qb={current:!1},OA=typeof window<"u";function RA(){if(qb.current=!0,!!OA)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>cd.current=n.matches;n.addEventListener("change",a),a()}else cd.current=!1}const Pv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vr={};function Xb(n){vr=n}function VA(){return vr}class LA{scrapeMotionValuesFromProps(a,s,o){return{}}constructor({parent:a,props:s,presenceContext:o,reducedMotionConfig:u,skipAnimations:d,blockInitialAnimation:f,visualState:h},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=kd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const T=me.now();this.renderScheduledAt<T&&(this.renderScheduledAt=T,zt.render(this.render,!1,!0))};const{latestValues:p,renderState:y}=h;this.latestValues=p,this.baseTarget={...p},this.initialValues=s.initial?{...p}:{},this.renderState=y,this.parent=a,this.props=s,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=u,this.skipAnimationsConfig=d,this.options=m,this.blockInitialAnimation=!!f,this.isControllingVariants=Rr(s),this.isVariantNode=Yb(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...S}=this.scrapeMotionValuesFromProps(s,{},this);for(const T in S){const j=S[T];p[T]!==void 0&&ue(j)&&j.set(p[T])}}mount(a){var s,o;if(this.hasBeenMounted)for(const u in this.initialValues)(s=this.values.get(u))==null||s.jump(this.initialValues[u]),this.latestValues[u]=this.initialValues[u];this.current=a,DA.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((u,d)=>this.bindToMotionValue(d,u)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(qb.current||RA(),this.shouldReduceMotion=cd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(o=this.parent)==null||o.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var a;this.projection&&this.projection.unmount(),ya(this.notifyUpdate),ya(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(a=this.parent)==null||a.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(a){this.children.add(a),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(a)}removeChild(a){this.children.delete(a),this.enteringChildren&&this.enteringChildren.delete(a)}bindToMotionValue(a,s){if(this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)(),s.accelerate&&Ab.has(a)&&this.current instanceof HTMLElement){const{factory:f,keyframes:h,times:m,ease:p,duration:y}=s.accelerate,b=new wb({element:this.current,name:a,keyframes:h,times:m,ease:p,duration:_e(y)}),S=f(b);this.valueSubscriptions.set(a,()=>{S(),b.cancel()});return}const o=tl.has(a);o&&this.onBindTransform&&this.onBindTransform();const u=s.on("change",f=>{this.latestValues[a]=f,this.props.onUpdate&&zt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let d;typeof window<"u"&&window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,s)),this.valueSubscriptions.set(a,()=>{u(),d&&d(),s.owner&&s.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in vr){const s=vr[a];if(!s)continue;const{isEnabled:o,Feature:u}=s;if(!this.features[a]&&u&&o(this.props)&&(this.features[a]=new u(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):te()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,s){this.latestValues[a]=s}update(a,s){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;o<Pv.length;o++){const u=Pv[o];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const d="on"+u,f=a[d];f&&(this.propEventSubscriptions[u]=this.on(u,f))}this.prevMotionValues=zA(this,this.scrapeMotionValuesFromProps(a,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(a),()=>s.variantChildren.delete(a)}addValue(a,s){const o=this.values.get(a);s!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,s),this.values.set(a,s),this.latestValues[a]=s.get())}removeValue(a){this.values.delete(a);const s=this.valueSubscriptions.get(a);s&&(s(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,s){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&s!==void 0&&(o=Zi(s===null?void 0:s,{owner:this}),this.addValue(a,o)),o}readValue(a,s){let o=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:this.getBaseTargetFromProps(this.props,a)??this.readValueFromInstance(this.current,a,this.options);return o!=null&&(typeof o=="string"&&(Yy(o)||Xy(o))?o=parseFloat(o):!MA(o)&&an.test(s)&&(o=_b(a,s)),this.setBaseTarget(a,ue(o)?o.get():o)),ue(o)?o.get():o}setBaseTarget(a,s){this.baseTarget[a]=s}getBaseTarget(a){var d;const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const f=$d(this.props,s,(d=this.presenceContext)==null?void 0:d.custom);f&&(o=f[a])}if(s&&o!==void 0)return o;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!ue(u)?u:this.initialValues[a]!==void 0&&o===void 0?void 0:this.baseTarget[a]}on(a,s){return this.events[a]||(this.events[a]=new Md),this.events[a].add(s)}notify(a,...s){this.events[a]&&this.events[a].notify(...s)}scheduleRenderMicrotask(){qd.render(this.render)}}class Kb extends LA{constructor(){super(...arguments),this.KeyframeResolver=rA}sortInstanceNodePosition(a,s){return a.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(a,s){const o=a.style;return o?o[s]:void 0}removeValueFromRenderState(a,{vars:s,style:o}){delete s[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;ue(a)&&(this.childSubscription=a.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Sa{constructor(a){this.isMounted=!1,this.node=a}update(){}}function Fb({top:n,left:a,right:s,bottom:o}){return{x:{min:a,max:s},y:{min:n,max:o}}}function _A({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function UA(n,a){if(!a)return n;const s=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function xf(n){return n===void 0||n===1}function fd({scale:n,scaleX:a,scaleY:s}){return!xf(n)||!xf(a)||!xf(s)}function Ya(n){return fd(n)||Zb(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Zb(n){return Wv(n.x)||Wv(n.y)}function Wv(n){return n&&n!=="0%"}function yr(n,a,s){const o=n-s,u=a*o;return s+u}function Iv(n,a,s,o,u){return u!==void 0&&(n=yr(n,u,o)),yr(n,s,o)+a}function dd(n,a=0,s=1,o,u){n.min=Iv(n.min,a,s,o,u),n.max=Iv(n.max,a,s,o,u)}function Qb(n,{x:a,y:s}){dd(n.x,a.translate,a.scale,a.originPoint),dd(n.y,s.translate,s.scale,s.originPoint)}const t0=.999999999999,e0=1.0000000000001;function kA(n,a,s,o=!1){var h;const u=s.length;if(!u)return;a.x=a.y=1;let d,f;for(let m=0;m<u;m++){d=s[m],f=d.projectionDelta;const{visualElement:p}=d.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(fn(n.x,-d.scroll.offset.x),fn(n.y,-d.scroll.offset.y)),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Qb(n,f)),o&&Ya(d.latestValues)&&ar(n,d.latestValues,(h=d.layout)==null?void 0:h.layoutBox))}a.x<e0&&a.x>t0&&(a.x=1),a.y<e0&&a.y>t0&&(a.y=1)}function fn(n,a){n.min+=a,n.max+=a}function n0(n,a,s,o,u=.5){const d=kt(n.min,n.max,u);dd(n,a,s,d,o)}function a0(n,a){return typeof n=="string"?parseFloat(n)/100*(a.max-a.min):n}function ar(n,a,s){const o=s??n;n0(n.x,a0(a.x,o.x),a.scaleX,a.scale,a.originX),n0(n.y,a0(a.y,o.y),a.scaleY,a.scale,a.originY)}function Jb(n,a){return Fb(UA(n.getBoundingClientRect(),a))}function BA(n,a,s){const o=Jb(n,s),{scroll:u}=a;return u&&(fn(o.x,u.offset.x),fn(o.y,u.offset.y)),o}const HA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$A=Ii.length;function GA(n,a,s){let o="",u=!0;for(let d=0;d<$A;d++){const f=Ii[d],h=n[f];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(f.startsWith("scale")?1:0);else{const p=parseFloat(h);m=f.startsWith("scale")?p===1:p===0}if(!m||s){const p=kb(h,Yd[f]);if(!m){u=!1;const y=HA[f]||f;o+=`${y}(${p}) `}s&&(a[f]=p)}}return o=o.trim(),s?o=s(a,u?"":o):u&&(o="none"),o}function Qd(n,a,s){const{style:o,vars:u,transformOrigin:d}=n;let f=!1,h=!1;for(const m in a){const p=a[m];if(tl.has(m)){f=!0;continue}else if(sb(m)){u[m]=p;continue}else{const y=kb(p,Yd[m]);m.startsWith("origin")?(h=!0,d[m]=y):o[m]=y}}if(a.transform||(f||s?o.transform=GA(a,n.transform,s):o.transform&&(o.transform="none")),h){const{originX:m="50%",originY:p="50%",originZ:y=0}=d;o.transformOrigin=`${m} ${p} ${y}`}}function Pb(n,{style:a,vars:s},o,u){const d=n.style;let f;for(f in a)d[f]=a[f];u==null||u.applyProjectionStyles(d,o);for(f in s)d.setProperty(f,s[f])}function i0(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Jl={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(W.test(n))n=parseFloat(n);else return n;const s=i0(n,a.target.x),o=i0(n,a.target.y);return`${s}% ${o}%`}},YA={correct:(n,{treeScale:a,projectionDelta:s})=>{const o=n,u=an.parse(n);if(u.length>5)return o;const d=an.createTransformer(n),f=typeof u[0]!="number"?1:0,h=s.x.scale*a.x,m=s.y.scale*a.y;u[0+f]/=h,u[1+f]/=m;const p=kt(h,m,.5);return typeof u[2+f]=="number"&&(u[2+f]/=p),typeof u[3+f]=="number"&&(u[3+f]/=p),d(u)}},hd={borderRadius:{...Jl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jl,borderTopRightRadius:Jl,borderBottomLeftRadius:Jl,borderBottomRightRadius:Jl,boxShadow:YA};function Wb(n,{layout:a,layoutId:s}){return tl.has(n)||n.startsWith("origin")||(a||s!==void 0)&&(!!hd[n]||n==="opacity")}function Jd(n,a,s){var f;const o=n.style,u=a==null?void 0:a.style,d={};if(!o)return d;for(const h in o)(ue(o[h])||u&&ue(u[h])||Wb(h,n)||((f=s==null?void 0:s.getValue(h))==null?void 0:f.liveStyle)!==void 0)&&(d[h]=o[h]);return d}function qA(n){return window.getComputedStyle(n)}class XA extends Kb{constructor(){super(...arguments),this.type="html",this.renderInstance=Pb}readValueFromInstance(a,s){var o;if(tl.has(s))return(o=this.projection)!=null&&o.isProjecting?If(s):c5(a,s);{const u=qA(a),d=(sb(s)?u.getPropertyValue(s):u[s])||0;return typeof d=="string"?d.trim():d}}measureInstanceViewportBox(a,{transformPagePoint:s}){return Jb(a,s)}build(a,s,o){Qd(a,s,o.transformTemplate)}scrapeMotionValuesFromProps(a,s,o){return Jd(a,s,o)}}const KA={offset:"stroke-dashoffset",array:"stroke-dasharray"},FA={offset:"strokeDashoffset",array:"strokeDasharray"};function ZA(n,a,s=1,o=0,u=!0){n.pathLength=1;const d=u?KA:FA;n[d.offset]=`${-o}`,n[d.array]=`${a} ${s}`}const QA=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ib(n,{attrX:a,attrY:s,attrScale:o,pathLength:u,pathSpacing:d=1,pathOffset:f=0,...h},m,p,y){if(Qd(n,h,p),m){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:b,style:S}=n;b.transform&&(S.transform=b.transform,delete b.transform),(S.transform||b.transformOrigin)&&(S.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),S.transform&&(S.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete b.transformBox);for(const T of QA)b[T]!==void 0&&(S[T]=b[T],delete b[T]);a!==void 0&&(b.x=a),s!==void 0&&(b.y=s),o!==void 0&&(b.scale=o),u!==void 0&&ZA(b,u,d,f,!1)}const tx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ex=n=>typeof n=="string"&&n.toLowerCase()==="svg";function JA(n,a,s,o){Pb(n,a,void 0,o);for(const u in a.attrs)n.setAttribute(tx.has(u)?u:Gd(u),a.attrs[u])}function nx(n,a,s){const o=Jd(n,a,s);for(const u in n)if(ue(n[u])||ue(a[u])){const d=Ii.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;o[d]=n[u]}return o}class PA extends Kb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=te}getBaseTargetFromProps(a,s){return a[s]}readValueFromInstance(a,s){if(tl.has(s)){const o=Lb(s);return o&&o.default||0}return s=tx.has(s)?s:Gd(s),a.getAttribute(s)}scrapeMotionValuesFromProps(a,s,o){return nx(a,s,o)}build(a,s,o){Ib(a,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(a,s,o,u){JA(a,s,o,u)}mount(a){this.isSVGTag=ex(a.tagName),super.mount(a)}}const WA=Zd.length;function ax(n){if(!n)return;if(!n.isControllingVariants){const s=n.parent?ax(n.parent)||{}:{};return n.props.initial!==void 0&&(s.initial=n.props.initial),s}const a={};for(let s=0;s<WA;s++){const o=Zd[s],u=n.props[o];(hs(u)||u===!1)&&(a[o]=u)}return a}function ix(n,a){if(!Array.isArray(a))return!1;const s=a.length;if(s!==n.length)return!1;for(let o=0;o<s;o++)if(a[o]!==n[o])return!1;return!0}const IA=[...Fd].reverse(),tj=Fd.length;function ej(n){return a=>Promise.all(a.map(({animation:s,options:o})=>P5(n,s,o)))}function nj(n){let a=ej(n),s=l0(),o=!0,u=!1;const d=p=>(y,b)=>{var T;const S=Pa(n,b,p==="exit"?(T=n.presenceContext)==null?void 0:T.custom:void 0);if(S){const{transition:j,transitionEnd:E,...C}=S;y={...y,...C,...E}}return y};function f(p){a=p(n)}function h(p){const{props:y}=n,b=ax(n.parent)||{},S=[],T=new Set;let j={},E=1/0;for(let A=0;A<tj;A++){const L=IA[A],U=s[L],Y=y[L]!==void 0?y[L]:b[L],X=hs(Y),tt=L===p?U.isActive:null;tt===!1&&(E=A);let Z=Y===b[L]&&Y!==y[L]&&X;if(Z&&(o||u)&&n.manuallyAnimateOnMount&&(Z=!1),U.protectedKeys={...j},!U.isActive&&tt===null||!Y&&!U.prevProp||Or(Y)||typeof Y=="boolean")continue;if(L==="exit"&&U.isActive&&tt!==!0){U.prevResolvedValues&&(j={...j,...U.prevResolvedValues});continue}const nt=aj(U.prevProp,Y);let xt=nt||L===p&&U.isActive&&!Z&&X||A>E&&X,J=!1;const ft=Array.isArray(Y)?Y:[Y];let vt=ft.reduce(d(L),{});tt===!1&&(vt={});const{prevResolvedValues:Ot={}}=U,Nt={...Ot,...vt},Rt=F=>{xt=!0,T.has(F)&&(J=!0,T.delete(F)),U.needsAnimating[F]=!0;const it=n.getValue(F);it&&(it.liveStyle=!1)};for(const F in Nt){const it=vt[F],ct=Ot[F];if(j.hasOwnProperty(F))continue;let M=!1;ld(it)&&ld(ct)?M=!ix(it,ct):M=it!==ct,M?it!=null?Rt(F):T.add(F):it!==void 0&&T.has(F)?Rt(F):U.protectedKeys[F]=!0}U.prevProp=Y,U.prevResolvedValues=vt,U.isActive&&(j={...j,...vt}),(o||u)&&n.blockInitialAnimation&&(xt=!1);const k=Z&&nt;xt&&(!k||J)&&S.push(...ft.map(F=>{const it={type:L};if(typeof F=="string"&&(o||u)&&!k&&n.manuallyAnimateOnMount&&n.parent){const{parent:ct}=n,M=Pa(ct,F);if(ct.enteringChildren&&M){const{delayChildren:$}=M.transition||{};it.delay=jb(ct.enteringChildren,n,$)}}return{animation:F,options:it}}))}if(T.size){const A={};if(typeof y.initial!="boolean"){const L=Pa(n,Array.isArray(y.initial)?y.initial[0]:y.initial);L&&L.transition&&(A.transition=L.transition)}T.forEach(L=>{const U=n.getBaseTarget(L),Y=n.getValue(L);Y&&(Y.liveStyle=!0),A[L]=U??null}),S.push({animation:A})}let C=!!S.length;return o&&(y.initial===!1||y.initial===y.animate)&&!n.manuallyAnimateOnMount&&(C=!1),o=!1,u=!1,C?a(S):Promise.resolve()}function m(p,y){var S;if(s[p].isActive===y)return Promise.resolve();(S=n.variantChildren)==null||S.forEach(T=>{var j;return(j=T.animationState)==null?void 0:j.setActive(p,y)}),s[p].isActive=y;const b=h(p);for(const T in s)s[T].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:f,getState:()=>s,reset:()=>{s=l0(),u=!0}}}function aj(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!ix(a,n):!1}function $a(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function l0(){return{animate:$a(!0),whileInView:$a(),whileHover:$a(),whileTap:$a(),whileDrag:$a(),whileFocus:$a(),exit:$a()}}function md(n,a){n.min=a.min,n.max=a.max}function tn(n,a){md(n.x,a.x),md(n.y,a.y)}function s0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}const lx=1e-4,ij=1-lx,lj=1+lx,sx=.01,sj=0-sx,oj=0+sx;function pe(n){return n.max-n.min}function rj(n,a,s){return Math.abs(n-a)<=s}function o0(n,a,s,o=.5){n.origin=o,n.originPoint=kt(a.min,a.max,n.origin),n.scale=pe(s)/pe(a),n.translate=kt(s.min,s.max,n.origin)-n.originPoint,(n.scale>=ij&&n.scale<=lj||isNaN(n.scale))&&(n.scale=1),(n.translate>=sj&&n.translate<=oj||isNaN(n.translate))&&(n.translate=0)}function rs(n,a,s,o){o0(n.x,a.x,s.x,o?o.originX:void 0),o0(n.y,a.y,s.y,o?o.originY:void 0)}function r0(n,a,s,o=0){const u=o?kt(s.min,s.max,o):s.min;n.min=u+a.min,n.max=n.min+pe(a)}function uj(n,a,s,o){r0(n.x,a.x,s.x,o==null?void 0:o.x),r0(n.y,a.y,s.y,o==null?void 0:o.y)}function u0(n,a,s,o=0){const u=o?kt(s.min,s.max,o):s.min;n.min=a.min-u,n.max=n.min+pe(a)}function br(n,a,s,o){u0(n.x,a.x,s.x,o==null?void 0:o.x),u0(n.y,a.y,s.y,o==null?void 0:o.y)}function c0(n,a,s,o,u){return n-=a,n=yr(n,1/s,o),u!==void 0&&(n=yr(n,1/u,o)),n}function cj(n,a=0,s=1,o=.5,u,d=n,f=n){if(mn.test(a)&&(a=parseFloat(a),a=kt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let h=kt(d.min,d.max,o);n===d&&(h-=a),n.min=c0(n.min,a,s,h,u),n.max=c0(n.max,a,s,h,u)}function f0(n,a,[s,o,u],d,f){cj(n,a[s],a[o],a[u],a.scale,d,f)}const fj=["x","scaleX","originX"],dj=["y","scaleY","originY"];function d0(n,a,s,o){f0(n.x,a,fj,s?s.x:void 0,o?o.x:void 0),f0(n.y,a,dj,s?s.y:void 0,o?o.y:void 0)}function h0(n){return n.translate===0&&n.scale===1}function ox(n){return h0(n.x)&&h0(n.y)}function m0(n,a){return n.min===a.min&&n.max===a.max}function hj(n,a){return m0(n.x,a.x)&&m0(n.y,a.y)}function p0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function rx(n,a){return p0(n.x,a.x)&&p0(n.y,a.y)}function g0(n){return pe(n.x)/pe(n.y)}function v0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}function cn(n){return[n("x"),n("y")]}function mj(n,a,s){let o="";const u=n.x.translate/a.x,d=n.y.translate/a.y,f=(s==null?void 0:s.z)||0;if((u||d||f)&&(o=`translate3d(${u}px, ${d}px, ${f}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),s){const{transformPerspective:p,rotate:y,rotateX:b,rotateY:S,skewX:T,skewY:j}=s;p&&(o=`perspective(${p}px) ${o}`),y&&(o+=`rotate(${y}deg) `),b&&(o+=`rotateX(${b}deg) `),S&&(o+=`rotateY(${S}deg) `),T&&(o+=`skewX(${T}deg) `),j&&(o+=`skewY(${j}deg) `)}const h=n.x.scale*a.x,m=n.y.scale*a.y;return(h!==1||m!==1)&&(o+=`scale(${h}, ${m})`),o||"none"}const ux=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],pj=ux.length,y0=n=>typeof n=="string"?parseFloat(n):n,b0=n=>typeof n=="number"||W.test(n);function gj(n,a,s,o,u,d){u?(n.opacity=kt(0,s.opacity??1,vj(o)),n.opacityExit=kt(a.opacity??1,0,yj(o))):d&&(n.opacity=kt(a.opacity??1,s.opacity??1,o));for(let f=0;f<pj;f++){const h=ux[f];let m=x0(a,h),p=x0(s,h);if(m===void 0&&p===void 0)continue;m||(m=0),p||(p=0),m===0||p===0||b0(m)===b0(p)?(n[h]=Math.max(kt(y0(m),y0(p),o),0),(mn.test(p)||mn.test(m))&&(n[h]+="%")):n[h]=p}(a.rotate||s.rotate)&&(n.rotate=kt(a.rotate||0,s.rotate||0,o))}function x0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const vj=cx(0,.5,tb),yj=cx(.5,.95,Je);function cx(n,a,s){return o=>o<n?0:o>a?1:s(fs(n,a,o))}function bj(n,a,s){const o=ue(n)?n:Zi(n);return o.start(Hd("",o,a,s)),o.animation}function ms(n,a,s,o={passive:!0}){return n.addEventListener(a,s,o),()=>n.removeEventListener(a,s)}const xj=(n,a)=>n.depth-a.depth;class Sj{constructor(){this.children=[],this.isDirty=!1}add(a){Nd(this.children,a),this.isDirty=!0}remove(a){dr(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(xj),this.isDirty=!1,this.children.forEach(a)}}function Tj(n,a){const s=me.now(),o=({timestamp:u})=>{const d=u-s;d>=a&&(ya(o),n(d-a))};return zt.setup(o,!0),()=>ya(o)}function ir(n){return ue(n)?n.get():n}class wj{constructor(){this.members=[]}add(a){Nd(this.members,a);for(let s=this.members.length-1;s>=0;s--){const o=this.members[s];if(o===a||o===this.lead||o===this.prevLead)continue;const u=o.instance;(!u||u.isConnected===!1)&&!o.snapshot&&(dr(this.members,o),o.unmount())}a.scheduleRender()}remove(a){if(dr(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(a){var s;for(let o=this.members.indexOf(a)-1;o>=0;o--){const u=this.members[o];if(u.isPresent!==!1&&((s=u.instance)==null?void 0:s.isConnected)!==!1)return this.promote(u),!0}return!1}promote(a,s){var u;const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.updateSnapshot(),a.scheduleRender();const{layoutDependency:d}=o.options,{layoutDependency:f}=a.options;(d===void 0||d!==f)&&(a.resumeFrom=o,s&&(o.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),(u=a.root)!=null&&u.isUpdating&&(a.isLayoutDirty=!0)),a.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{var s,o,u,d,f;(o=(s=a.options).onExitComplete)==null||o.call(s),(f=(u=a.resumingFrom)==null?void 0:(d=u.options).onExitComplete)==null||f.call(d)})}scheduleRender(){this.members.forEach(a=>a.instance&&a.scheduleRender(!1))}removeLeadSnapshot(){var a;(a=this.lead)!=null&&a.snapshot&&(this.lead.snapshot=void 0)}}const lr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sf=["","X","Y","Z"],Ej=1e3;let Aj=0;function Tf(n,a,s,o){const{latestValues:u}=a;u[n]&&(s[n]=u[n],a.setStaticValue(n,0),o&&(o[n]=0))}function fx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const s=zb(a);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(s,"transform",zt,!(u||d))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&fx(o)}function dx({attachResizeListener:n,defaultParent:a,measureScroll:s,checkIsScrollRoot:o,resetTransform:u}){return class{constructor(f={},h=a==null?void 0:a()){this.id=Aj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Cj),this.nodes.forEach(Vj),this.nodes.forEach(Lj),this.nodes.forEach(Mj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sj)}addEventListener(f,h){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Md),this.eventHandlers.get(f).add(h)}notifyListeners(f,...h){const m=this.eventHandlers.get(f);m&&m.notify(...h)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=Kd(f)&&!NA(f),this.instance=f;const{layoutId:h,layout:m,visualElement:p}=this.options;if(p&&!p.current&&p.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),n){let y,b=0;const S=()=>this.root.updateBlockedByResize=!1;zt.read(()=>{b=window.innerWidth}),n(f,()=>{const T=window.innerWidth;T!==b&&(b=T,this.root.updateBlockedByResize=!0,y&&y(),y=Tj(S,250),lr.hasAnimatedSinceResize&&(lr.hasAnimatedSinceResize=!1,this.nodes.forEach(w0)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&p&&(h||m)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeLayoutChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||p.getDefaultTransition()||Hj,{onLayoutAnimationStart:E,onLayoutAnimationComplete:C}=p.getProps(),A=!this.targetLayout||!rx(this.targetLayout,T),L=!b&&S;if(this.options.layoutRoot||this.resumeFrom||L||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const U={...Bd(j,"layout"),onPlay:E,onComplete:C};(p.shouldReduceMotion||this.options.layoutRoot)&&(U.delay=0,U.type=!1),this.startAnimation(U),this.setAnimationOrigin(y,L)}else b||w0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ya(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_j),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const b=this.path[y];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const m=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),m&&this.nodes.forEach(zj),this.nodes.forEach(S0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(T0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Oj),this.nodes.forEach(Rj),this.nodes.forEach(jj),this.nodes.forEach(Nj)):this.nodes.forEach(T0),this.clearAllSnapshots();const h=me.now();re.delta=pn(0,1e3/60,h-re.timestamp),re.timestamp=h,re.isProcessing=!0,hf.update.process(re),hf.preRender.process(re),hf.render.process(re),re.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dj),this.sharedNodes.forEach(Uj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!pe(this.snapshot.measuredBox.x)&&!pe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=te()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(h=!1),h&&this.instance){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!ox(this.projectionDelta),m=this.getTransformTemplate(),p=m?m(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;f&&this.instance&&(h||Ya(this.latestValues)||y)&&(u(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return f&&(m=this.removeTransform(m)),$j(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:f}=this.options;if(!f)return te();const h=f.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(Gj))){const{scroll:y}=this.root;y&&(fn(h.x,y.offset.x),fn(h.y,y.offset.y))}return h}removeElementScroll(f){var m;const h=te();if(tn(h,f),(m=this.scroll)!=null&&m.wasRoot)return h;for(let p=0;p<this.path.length;p++){const y=this.path[p],{scroll:b,options:S}=y;y!==this.root&&b&&S.layoutScroll&&(b.wasRoot&&tn(h,f),fn(h.x,b.offset.x),fn(h.y,b.offset.y))}return h}applyTransform(f,h=!1,m){var y,b;const p=m||te();tn(p,f);for(let S=0;S<this.path.length;S++){const T=this.path[S];!h&&T.options.layoutScroll&&T.scroll&&T!==T.root&&(fn(p.x,-T.scroll.offset.x),fn(p.y,-T.scroll.offset.y)),Ya(T.latestValues)&&ar(p,T.latestValues,(y=T.layout)==null?void 0:y.layoutBox)}return Ya(this.latestValues)&&ar(p,this.latestValues,(b=this.layout)==null?void 0:b.layoutBox),p}removeTransform(f){var m;const h=te();tn(h,f);for(let p=0;p<this.path.length;p++){const y=this.path[p];if(!Ya(y.latestValues))continue;let b;y.instance&&(fd(y.latestValues)&&y.updateSnapshot(),b=te(),tn(b,y.measurePageBox())),d0(h,y.latestValues,(m=y.snapshot)==null?void 0:m.layoutBox,b)}return Ya(this.latestValues)&&d0(h,this.latestValues),h}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==re.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var T;const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(f||m&&this.isSharedProjectionDirty||this.isProjectionDirty||(T=this.parent)!=null&&T.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!this.layout||!(y||b))return;this.resolvedRelativeTargetAt=re.timestamp;const S=this.getClosestProjectingParent();S&&this.linkedParentVersion!==S.layoutVersion&&!S.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&S&&S.layout?this.createRelativeTarget(S,this.layout.layoutBox,S.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=te(),this.targetWithTransforms=te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uj(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tn(this.target,this.layout.layoutBox),Qb(this.target,this.targetDelta)):tn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?this.createRelativeTarget(S,this.target,S.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||fd(this.parent.latestValues)||Zb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(f,h,m){this.relativeParent=f,this.linkedParentVersion=f.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=te(),this.relativeTargetOrigin=te(),br(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),tn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var j;const f=this.getLead(),h=!!this.resumingFrom||this!==f;let m=!0;if((this.isProjectionDirty||(j=this.parent)!=null&&j.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===re.timestamp&&(m=!1),m)return;const{layout:p,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||y))return;tn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;kA(this.layoutCorrected,this.treeScale,this.path,h),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=te());const{target:T}=f;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(s0(this.prevProjectionDelta.x,this.projectionDelta.x),s0(this.prevProjectionDelta.y,this.projectionDelta.y)),rs(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!v0(this.projectionDelta.x,this.prevProjectionDelta.x)||!v0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var h;if((h=this.options.visualElement)==null||h.scheduleRender(),f){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qi(),this.projectionDelta=qi(),this.projectionDeltaWithTransform=qi()}setAnimationOrigin(f,h=!1){const m=this.snapshot,p=m?m.latestValues:{},y={...this.latestValues},b=qi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const S=te(),T=m?m.source:void 0,j=this.layout?this.layout.source:void 0,E=T!==j,C=this.getStack(),A=!C||C.members.length<=1,L=!!(E&&!A&&this.options.crossfade===!0&&!this.path.some(Bj));this.animationProgress=0;let U;this.mixTargetDelta=Y=>{const X=Y/1e3;E0(b.x,f.x,X),E0(b.y,f.y,X),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(br(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),kj(this.relativeTarget,this.relativeTargetOrigin,S,X),U&&hj(this.relativeTarget,U)&&(this.isProjectionDirty=!1),U||(U=te()),tn(U,this.relativeTarget)),E&&(this.animationValues=y,gj(y,p,this.latestValues,X,L,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=X},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){var h,m,p;this.notifyListeners("animationStart"),(h=this.currentAnimation)==null||h.stop(),(p=(m=this.resumingFrom)==null?void 0:m.currentAnimation)==null||p.stop(),this.pendingAnimation&&(ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{lr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zi(0)),this.motionValue.jump(0,!1),this.currentAnimation=bj(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),f.onUpdate&&f.onUpdate(y)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ej),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:h,target:m,layout:p,latestValues:y}=f;if(!(!h||!m||!p)){if(this!==f&&this.layout&&p&&hx(this.options.animationType,this.layout.layoutBox,p.layoutBox)){m=this.target||te();const b=pe(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+b;const S=pe(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+S}tn(h,m),ar(h,y),rs(this.projectionDeltaWithTransform,this.layoutCorrected,h,y)}}registerSharedNode(f,h){this.sharedNodes.has(f)||this.sharedNodes.set(f,new wj),this.sharedNodes.get(f).add(h);const p=h.options.initialPromotionConfig;h.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(h):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var h;const{layoutId:f}=this.options;return f?((h=this.getStack())==null?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:f}=this.options;return f?(h=this.getStack())==null?void 0:h.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:h,preserveFollowOpacity:m}={}){const p=this.getStack();p&&p.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let h=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const p={};m.z&&Tf("z",f,p,this.animationValues);for(let y=0;y<Sf.length;y++)Tf(`rotate${Sf[y]}`,f,p,this.animationValues),Tf(`skew${Sf[y]}`,f,p,this.animationValues);f.render();for(const y in p)f.setStaticValue(y,p[y]),this.animationValues&&(this.animationValues[y]=p[y]);f.scheduleRender()}applyProjectionStyles(f,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=ir(h==null?void 0:h.pointerEvents)||"",f.transform=m?m(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=ir(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!Ya(this.latestValues)&&(f.transform=m?m({},""):"none",this.hasProjected=!1);return}f.visibility="";const y=p.animationValues||p.latestValues;this.applyTransformsToTarget();let b=mj(this.projectionDeltaWithTransform,this.treeScale,y);m&&(b=m(y,b)),f.transform=b;const{x:S,y:T}=this.projectionDelta;f.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,p.animationValues?f.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:f.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const j in hd){if(y[j]===void 0)continue;const{correct:E,applyTo:C,isCSSVariable:A}=hd[j],L=b==="none"?y[j]:E(y[j],p);if(C){const U=C.length;for(let Y=0;Y<U;Y++)f[C[Y]]=L}else A?this.options.visualElement.renderState.vars[j]=L:f[j]=L}this.options.layoutId&&(f.pointerEvents=p===this?ir(h==null?void 0:h.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var h;return(h=f.currentAnimation)==null?void 0:h.stop()}),this.root.nodes.forEach(S0),this.root.sharedNodes.clear()}}}function jj(n){n.updateLayout()}function Nj(n){var s;const a=((s=n.resumeFrom)==null?void 0:s.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&a&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:u}=n.layout,{animationType:d}=n.options,f=a.source!==n.layout.source;if(d==="size")cn(b=>{const S=f?a.measuredBox[b]:a.layoutBox[b],T=pe(S);S.min=o[b].min,S.max=S.min+T});else if(d==="x"||d==="y"){const b=d==="x"?"y":"x";md(f?a.measuredBox[b]:a.layoutBox[b],o[b])}else hx(d,a.layoutBox,o)&&cn(b=>{const S=f?a.measuredBox[b]:a.layoutBox[b],T=pe(o[b]);S.max=S.min+T,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+T)});const h=qi();rs(h,o,a.layoutBox);const m=qi();f?rs(m,n.applyTransform(u,!0),a.measuredBox):rs(m,o,a.layoutBox);const p=!ox(h);let y=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:S,layout:T}=b;if(S&&T){const j=n.options.layoutAnchor||void 0,E=te();br(E,a.layoutBox,S.layoutBox,j);const C=te();br(C,o,T.layoutBox,j),rx(E,C)||(y=!0),b.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=E,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:a,delta:m,layoutDelta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function Cj(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function Mj(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Dj(n){n.clearSnapshot()}function S0(n){n.clearMeasurements()}function zj(n){n.isLayoutDirty=!0,n.updateLayout()}function T0(n){n.isLayoutDirty=!1}function Oj(n){n.isAnimationBlocked&&n.layout&&!n.isLayoutDirty&&(n.snapshot=n.layout,n.isLayoutDirty=!0)}function Rj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function w0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Vj(n){n.resolveTargetDelta()}function Lj(n){n.calcProjection()}function _j(n){n.resetSkewAndRotation()}function Uj(n){n.removeLeadSnapshot()}function E0(n,a,s){n.translate=kt(a.translate,0,s),n.scale=kt(a.scale,1,s),n.origin=a.origin,n.originPoint=a.originPoint}function A0(n,a,s,o){n.min=kt(a.min,s.min,o),n.max=kt(a.max,s.max,o)}function kj(n,a,s,o){A0(n.x,a.x,s.x,o),A0(n.y,a.y,s.y,o)}function Bj(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Hj={duration:.45,ease:[.4,0,.1,1]},j0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),N0=j0("applewebkit/")&&!j0("chrome/")?Math.round:Je;function C0(n){n.min=N0(n.min),n.max=N0(n.max)}function $j(n){C0(n.x),C0(n.y)}function hx(n,a,s){return n==="position"||n==="preserve-aspect"&&!rj(g0(a),g0(s),.2)}function Gj(n){var a;return n!==n.root&&((a=n.scroll)==null?void 0:a.wasRoot)}const Yj=dx({attachResizeListener:(n,a)=>ms(n,"resize",a),measureScroll:()=>{var n,a;return{x:document.documentElement.scrollLeft||((n=document.body)==null?void 0:n.scrollLeft)||0,y:document.documentElement.scrollTop||((a=document.body)==null?void 0:a.scrollTop)||0}},checkIsScrollRoot:()=>!0}),qj=n=>!n.isLayoutDirty&&n.willUpdate(!1);function M0(){const n=new Set,a=new WeakMap,s=()=>n.forEach(qj);return{add:o=>{n.add(o),a.set(o,o.addEventListener("willUpdate",s))},remove:o=>{n.delete(o);const u=a.get(o);u&&(u(),a.delete(o)),s()},dirty:s}}const wf={current:void 0},mx=dx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!wf.current){const n=new Yj({});n.mount(window),n.setOptions({layoutScroll:!0}),wf.current=n}return wf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),px=w.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function Xj(n=!0){const a=w.useContext(jd);if(a===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:u}=a,d=w.useId();w.useEffect(()=>{if(n)return u(d)},[n]);const f=w.useCallback(()=>n&&o&&o(d),[d,o,n]);return!s&&o?[!1,f]:[!0]}const Kj=w.createContext(null);function Fj(){const n=w.useRef(!1);return Gy(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Zj(){const n=Fj(),[a,s]=w.useState(0),o=w.useCallback(()=>{n.current&&s(a+1)},[a]);return[w.useCallback(()=>zt.postRender(o),[o]),a]}const gx=n=>n===!0,Qj=n=>gx(n===!0)||n==="id",vx=({children:n,id:a,inherit:s=!0})=>{const o=w.useContext(fr),u=w.useContext(Kj),[d,f]=Zj(),h=w.useRef(null),m=o.id||u;h.current===null&&(Qj(s)&&m&&(a=a?m+"-"+a:m),h.current={id:a,group:gx(s)&&o.group||M0()});const p=w.useMemo(()=>({...h.current,forceRender:d}),[f]);return v.jsx(fr.Provider,{value:p,children:n})},yx=w.createContext({strict:!1}),D0={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 z0=!1;function Jj(){if(z0)return;const n={};for(const a in D0)n[a]={isEnabled:s=>D0[a].some(o=>!!s[o])};Xb(n),z0=!0}function bx(){return Jj(),VA()}function Pj(n){const a=bx();for(const s in n)a[s]={...a[s],...n[s]};Xb(a)}const Wj=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 xr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Wj.has(n)}let xx=n=>!xr(n);function Ij(n){typeof n=="function"&&(xx=a=>a.startsWith("on")?!xr(a):n(a))}try{Ij(require("@emotion/is-prop-valid").default)}catch{}function t3(n,a,s){const o={};for(const u in n)u==="values"&&typeof n.values=="object"||ue(n[u])||(xx(u)||s===!0&&xr(u)||!a&&!xr(u)||n.draggable&&u.startsWith("onDrag"))&&(o[u]=n[u]);return o}const Vr=w.createContext({});function e3(n,a){if(Rr(n)){const{initial:s,animate:o}=n;return{initial:s===!1||hs(s)?s:void 0,animate:hs(o)?o:void 0}}return n.inherit!==!1?a:{}}function n3(n){const{initial:a,animate:s}=e3(n,w.useContext(Vr));return w.useMemo(()=>({initial:a,animate:s}),[O0(a),O0(s)])}function O0(n){return Array.isArray(n)?n.join(" "):n}const Pd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sx(n,a,s){for(const o in a)!ue(a[o])&&!Wb(o,s)&&(n[o]=a[o])}function a3({transformTemplate:n},a){return w.useMemo(()=>{const s=Pd();return Qd(s,a,n),Object.assign({},s.vars,s.style)},[a])}function i3(n,a){const s=n.style||{},o={};return Sx(o,s,n),Object.assign(o,a3(n,a)),o}function l3(n,a){const s={},o=i3(n,a);return n.drag&&n.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(s.tabIndex=0),s.style=o,s}const Tx=()=>({...Pd(),attrs:{}});function s3(n,a,s,o){const u=w.useMemo(()=>{const d=Tx();return Ib(d,a,ex(o),n.transformTemplate,n.style),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};Sx(d,n.style,n),u.style={...d,...u.style}}return u}const o3=["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 Wd(n){return typeof n!="string"||n.includes("-")?!1:!!(o3.indexOf(n)>-1||/[A-Z]/u.test(n))}function r3(n,a,s,{latestValues:o},u,d=!1,f){const m=(f??Wd(n)?s3:l3)(a,o,u,n),p=t3(a,typeof n=="string",d),y=n!==w.Fragment?{...p,...m,ref:s}:{},{children:b}=a,S=w.useMemo(()=>ue(b)?b.get():b,[b]);return w.createElement(n,{...y,children:S})}function u3({scrapeMotionValuesFromProps:n,createRenderState:a},s,o,u){return{latestValues:c3(s,o,u,n),renderState:a()}}function c3(n,a,s,o){const u={},d=o(n,{});for(const S in d)u[S]=ir(d[S]);let{initial:f,animate:h}=n;const m=Rr(n),p=Yb(n);a&&p&&!m&&n.inherit!==!1&&(f===void 0&&(f=a.initial),h===void 0&&(h=a.animate));let y=s?s.initial===!1:!1;y=y||f===!1;const b=y?h:f;if(b&&typeof b!="boolean"&&!Or(b)){const S=Array.isArray(b)?b:[b];for(let T=0;T<S.length;T++){const j=$d(n,S[T]);if(j){const{transitionEnd:E,transition:C,...A}=j;for(const L in A){let U=A[L];if(Array.isArray(U)){const Y=y?U.length-1:0;U=U[Y]}U!==null&&(u[L]=U)}for(const L in E)u[L]=E[L]}}}return u}const wx=n=>(a,s)=>{const o=w.useContext(Vr),u=w.useContext(jd),d=()=>u3(n,a,o,u);return s?d():aE(d)},f3=wx({scrapeMotionValuesFromProps:Jd,createRenderState:Pd}),d3=wx({scrapeMotionValuesFromProps:nx,createRenderState:Tx}),h3=Symbol.for("motionComponentSymbol");function m3(n,a,s){const o=w.useRef(s);w.useInsertionEffect(()=>{o.current=s});const u=w.useRef(null);return w.useCallback(d=>{var h;d&&((h=n.onMount)==null||h.call(n,d));const f=o.current;if(typeof f=="function")if(d){const m=f(d);typeof m=="function"&&(u.current=m)}else u.current?(u.current(),u.current=null):f(d);else f&&(f.current=d);a&&(d?a.mount(d):a.unmount())},[a])}const Ex=w.createContext({});function $i(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function p3(n,a,s,o,u,d){var U,Y;const{visualElement:f}=w.useContext(Vr),h=w.useContext(yx),m=w.useContext(jd),p=w.useContext(px),y=p.reducedMotion,b=p.skipAnimations,S=w.useRef(null),T=w.useRef(!1);o=o||h.renderer,!S.current&&o&&(S.current=o(n,{visualState:a,parent:f,props:s,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:y,skipAnimations:b,isSVG:d}),T.current&&S.current&&(S.current.manuallyAnimateOnMount=!0));const j=S.current,E=w.useContext(Ex);j&&!j.projection&&u&&(j.type==="html"||j.type==="svg")&&g3(S.current,s,u,E);const C=w.useRef(!1);w.useInsertionEffect(()=>{j&&C.current&&j.update(s,m)});const A=s[Db],L=w.useRef(!!A&&typeof window<"u"&&!((U=window.MotionHandoffIsComplete)!=null&&U.call(window,A))&&((Y=window.MotionHasOptimisedAnimation)==null?void 0:Y.call(window,A)));return Gy(()=>{T.current=!0,j&&(C.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),L.current&&j.animationState&&j.animationState.animateChanges())}),w.useEffect(()=>{j&&(!L.current&&j.animationState&&j.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var X;(X=window.MotionHandoffMarkAsComplete)==null||X.call(window,A)}),L.current=!1),j.enteringChildren=void 0)}),j}function g3(n,a,s,o){const{layoutId:u,layout:d,drag:f,dragConstraints:h,layoutScroll:m,layoutRoot:p,layoutAnchor:y,layoutCrossfade:b}=a;n.projection=new s(n.latestValues,a["data-framer-portal-id"]?void 0:Ax(n.parent)),n.projection.setOptions({layoutId:u,layout:d,alwaysMeasureLayout:!!f||h&&$i(h),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:o,crossfade:b,layoutScroll:m,layoutRoot:p,layoutAnchor:y})}function Ax(n){if(n)return n.options.allowProjection!==!1?n.projection:Ax(n.parent)}function Ef(n,{forwardMotionProps:a=!1,type:s}={},o,u){o&&Pj(o);const d=s?s==="svg":Wd(n),f=d?d3:f3;function h(p,y){let b;const S={...w.useContext(px),...p,layoutId:v3(p)},{isStatic:T}=S,j=n3(p),E=f(p,T);if(!T&&typeof window<"u"){y3();const C=b3(S);b=C.MeasureLayout,j.visualElement=p3(n,E,S,u,C.ProjectionNode,d)}return v.jsxs(Vr.Provider,{value:j,children:[b&&j.visualElement?v.jsx(b,{visualElement:j.visualElement,...S}):null,r3(n,p,m3(E,j.visualElement,y),E,T,a,d)]})}h.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const m=w.forwardRef(h);return m[h3]=n,m}function v3({layoutId:n}){const a=w.useContext(fr).id;return a&&n!==void 0?a+"-"+n:n}function y3(n,a){w.useContext(yx).strict}function b3(n){const a=bx(),{drag:s,layout:o}=a;if(!s&&!o)return{};const u={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(n)||o!=null&&o.isEnabled(n)?u.MeasureLayout:void 0,ProjectionNode:u.ProjectionNode}}function x3(n,a){if(typeof Proxy>"u")return Ef;const s=new Map,o=(d,f)=>Ef(d,f,n,a),u=(d,f)=>o(d,f);return new Proxy(u,{get:(d,f)=>f==="create"?o:(s.has(f)||s.set(f,Ef(f,void 0,n,a)),s.get(f))})}const S3=(n,a)=>a.isSVG??Wd(n)?new PA(a):new XA(a,{allowProjection:n!==w.Fragment});class T3 extends Sa{constructor(a){super(a),a.animationState||(a.animationState=nj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Or(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:s}=this.node.prevProps||{};a!==s&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)==null||a.call(this)}}let w3=0;class E3 extends Sa{constructor(){super(...arguments),this.id=w3++,this.isExitComplete=!1}update(){var d;if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;if(a&&o===!1){if(this.isExitComplete){const{initial:f,custom:h}=this.node.getProps();if(typeof f=="string"){const m=Pa(this.node,f,h);if(m){const{transition:p,transitionEnd:y,...b}=m;for(const S in b)(d=this.node.getValue(S))==null||d.jump(b[S])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const u=this.node.animationState.setActive("exit",!a);s&&!a&&u.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:a,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),a&&(this.unmount=a(this.id))}unmount(){}}const A3={animation:{Feature:T3},exit:{Feature:E3}};function Ts(n){return{point:{x:n.pageX,y:n.pageY}}}const j3=n=>a=>Xd(a)&&n(a,Ts(a));function us(n,a,s,o){return ms(n,a,j3(s),o)}const jx=({current:n})=>n?n.ownerDocument.defaultView:null,R0=(n,a)=>Math.abs(n-a);function N3(n,a){const s=R0(n.x,a.x),o=R0(n.y,a.y);return Math.sqrt(s**2+o**2)}const V0=new Set(["auto","scroll"]);class Nx{constructor(a,s,{transformPagePoint:o,contextWindow:u=window,dragSnapToOrigin:d=!1,distanceThreshold:f=3,element:h}={}){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=T=>{this.handleScroll(T.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zo(this.lastRawMoveEventInfo,this.transformPagePoint));const T=Af(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,E=N3(T.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!E)return;const{point:C}=T,{timestamp:A}=re;this.history.push({...C,timestamp:A});const{onStart:L,onMove:U}=this.handlers;j||(L&&L(this.lastMoveEvent,T),this.startEvent=this.lastMoveEvent),U&&U(this.lastMoveEvent,T)},this.handlePointerMove=(T,j)=>{this.lastMoveEvent=T,this.lastRawMoveEventInfo=j,this.lastMoveEventInfo=Zo(j,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(T,j)=>{this.end();const{onEnd:E,onSessionEnd:C,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Af(T.type==="pointercancel"?this.lastMoveEventInfo:Zo(j,this.transformPagePoint),this.history);this.startEvent&&E&&E(T,L),C&&C(T,L)},!Xd(a))return;this.dragSnapToOrigin=d,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=f,this.contextWindow=u||window;const m=Ts(a),p=Zo(m,this.transformPagePoint),{point:y}=p,{timestamp:b}=re;this.history=[{...y,timestamp:b}];const{onSessionStart:S}=s;S&&S(a,Af(p,this.history)),this.removeListeners=bs(us(this.contextWindow,"pointermove",this.handlePointerMove),us(this.contextWindow,"pointerup",this.handlePointerUp),us(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(a){let s=a.parentElement;for(;s;){const o=getComputedStyle(s);(V0.has(o.overflowX)||V0.has(o.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(a){const s=this.scrollPositions.get(a);if(!s)return;const o=a===window,u=o?{x:window.scrollX,y:window.scrollY}:{x:a.scrollLeft,y:a.scrollTop},d={x:u.x-s.x,y:u.y-s.y};d.x===0&&d.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=d.x,this.lastMoveEventInfo.point.y+=d.y):this.history.length>0&&(this.history[0].x-=d.x,this.history[0].y-=d.y),this.scrollPositions.set(a,u),zt.update(this.updatePoint,!0))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ya(this.updatePoint)}}function Zo(n,a){return a?{point:a(n.point)}:n}function L0(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Af({point:n},a){return{point:n,delta:L0(n,Cx(a)),offset:L0(n,C3(a)),velocity:M3(a,.1)}}function C3(n){return n[0]}function Cx(n){return n[n.length-1]}function M3(n,a){if(n.length<2)return{x:0,y:0};let s=n.length-1,o=null;const u=Cx(n);for(;s>=0&&(o=n[s],!(u.timestamp-o.timestamp>_e(a)));)s--;if(!o)return{x:0,y:0};o===n[0]&&n.length>2&&u.timestamp-o.timestamp>_e(a)*2&&(o=n[1]);const d=Ze(u.timestamp-o.timestamp);if(d===0)return{x:0,y:0};const f={x:(u.x-o.x)/d,y:(u.y-o.y)/d};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function D3(n,{min:a,max:s},o){return a!==void 0&&n<a?n=o?kt(a,n,o.min):Math.max(n,a):s!==void 0&&n>s&&(n=o?kt(s,n,o.max):Math.min(n,s)),n}function _0(n,a,s){return{min:a!==void 0?n.min+a:void 0,max:s!==void 0?n.max+s-(n.max-n.min):void 0}}function z3(n,{top:a,left:s,bottom:o,right:u}){return{x:_0(n.x,s,u),y:_0(n.y,a,o)}}function U0(n,a){let s=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([s,o]=[o,s]),{min:s,max:o}}function O3(n,a){return{x:U0(n.x,a.x),y:U0(n.y,a.y)}}function R3(n,a){let s=.5;const o=pe(n),u=pe(a);return u>o?s=fs(a.min,a.max-o,n.min):o>u&&(s=fs(n.min,n.max-u,a.min)),pn(0,1,s)}function V3(n,a){const s={};return a.min!==void 0&&(s.min=a.min-n.min),a.max!==void 0&&(s.max=a.max-n.min),s}const pd=.35;function L3(n=pd){return n===!1?n=0:n===!0&&(n=pd),{x:k0(n,"left","right"),y:k0(n,"top","bottom")}}function k0(n,a,s){return{min:B0(n,a),max:B0(n,s)}}function B0(n,a){return typeof n=="number"?n:n[a]||0}const _3=new WeakMap;class U3{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=te(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=a}start(a,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:u}=this.visualElement;if(u&&u.isPresent===!1)return;const d=b=>{s&&this.snapToCursor(Ts(b).point),this.stopAnimation()},f=(b,S)=>{const{drag:T,dragPropagation:j,onDragStart:E}=this.getProps();if(T&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cA(T),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=S,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cn(A=>{let L=this.getAxisMotionValue(A).get()||0;if(mn.test(L)){const{projection:U}=this.visualElement;if(U&&U.layout){const Y=U.layout.layoutBox[A];Y&&(L=pe(Y)*(parseFloat(L)/100))}}this.originPoint[A]=L}),E&&zt.update(()=>E(b,S),!1,!0),sd(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},h=(b,S)=>{this.latestPointerEvent=b,this.latestPanInfo=S;const{dragPropagation:T,dragDirectionLock:j,onDirectionLock:E,onDrag:C}=this.getProps();if(!T&&!this.openDragLock)return;const{offset:A}=S;if(j&&this.currentDirection===null){this.currentDirection=B3(A),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",S.point,A),this.updateAxis("y",S.point,A),this.visualElement.render(),C&&zt.update(()=>C(b,S),!1,!0)},m=(b,S)=>{this.latestPointerEvent=b,this.latestPanInfo=S,this.stop(b,S),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:y}=this.getProps();this.panSession=new Nx(a,{onSessionStart:d,onStart:f,onMove:h,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:o,contextWindow:jx(this.visualElement),element:this.visualElement.current})}stop(a,s){const o=a||this.latestPointerEvent,u=s||this.latestPanInfo,d=this.isDragging;if(this.cancel(),!d||!u||!o)return;const{velocity:f}=u;this.startAnimation(f);const{onDragEnd:h}=this.getProps();h&&zt.postRender(()=>h(o,u))}cancel(){this.isDragging=!1;const{projection:a,animationState:s}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(a,s,o){const{drag:u}=this.getProps();if(!o||!Qo(a,u,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(f=D3(f,this.constraints[a],this.elastic[a])),d.set(f)}resolveConstraints(){var d;const{dragConstraints:a,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(d=this.visualElement.projection)==null?void 0:d.layout,u=this.constraints;a&&$i(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=z3(o.layoutBox,a):this.constraints=!1,this.elastic=L3(s),u!==this.constraints&&!$i(a)&&o&&this.constraints&&!this.hasMutatedConstraints&&cn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=V3(o.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:s}=this.getProps();if(!a||!$i(a))return!1;const o=a.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const d=BA(o,u.root,this.visualElement.getTransformPagePoint());let f=O3(u.layout.layoutBox,d);if(s){const h=s(_A(f));this.hasMutatedConstraints=!!h,h&&(f=Fb(h))}return f}startAnimation(a){const{drag:s,dragMomentum:o,dragElastic:u,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},p=cn(y=>{if(!Qo(y,s,this.currentDirection))return;let b=m&&m[y]||{};(f===!0||f===y)&&(b={min:0,max:0});const S=u?200:1e6,T=u?40:1e7,j={type:"inertia",velocity:o?a[y]:0,bounceStiffness:S,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(y,j)});return Promise.all(p).then(h)}startAxisValueAnimation(a,s){const o=this.getAxisMotionValue(a);return sd(this.visualElement,a),o.start(Hd(a,o,0,s,this.visualElement,!1))}stopAnimation(){cn(a=>this.getAxisMotionValue(a).stop())}getAxisMotionValue(a){const s=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),u=o[s];return u||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){cn(s=>{const{drag:o}=this.getProps();if(!Qo(s,o,this.currentDirection))return;const{projection:u}=this.visualElement,d=this.getAxisMotionValue(s);if(u&&u.layout){const{min:f,max:h}=u.layout.layoutBox[s],m=d.get()||0;d.set(a[s]-kt(f,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!$i(s)||!o||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};cn(f=>{const h=this.getAxisMotionValue(f);if(h&&this.constraints!==!1){const m=h.get();u[f]=R3({min:m,max:m},this.constraints[f])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),cn(f=>{if(!Qo(f,a,null))return;const h=this.getAxisMotionValue(f),{min:m,max:p}=this.constraints[f];h.set(kt(m,p,u[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_3.set(this.visualElement,this);const a=this.visualElement.current,s=us(a,"pointerdown",p=>{const{drag:y,dragListener:b=!0}=this.getProps(),S=p.target,T=S!==a&&gA(S);y&&b&&!T&&this.start(p)});let o;const u=()=>{const{dragConstraints:p}=this.getProps();$i(p)&&p.current&&(this.constraints=this.resolveRefConstraints(),o||(o=k3(a,p.current,()=>this.scalePositionWithinConstraints())))},{projection:d}=this.visualElement,f=d.addEventListener("measure",u);d&&!d.layout&&(d.root&&d.root.updateScroll(),d.updateLayout()),zt.read(u);const h=ms(window,"resize",()=>this.scalePositionWithinConstraints()),m=d.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:y})=>{this.isDragging&&y&&(cn(b=>{const S=this.getAxisMotionValue(b);S&&(this.originPoint[b]+=p[b].translate,S.set(S.get()+p[b].translate))}),this.visualElement.render())}));return()=>{h(),s(),f(),m&&m(),o&&o()}}getProps(){const a=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:u=!1,dragConstraints:d=!1,dragElastic:f=pd,dragMomentum:h=!0}=a;return{...a,drag:s,dragDirectionLock:o,dragPropagation:u,dragConstraints:d,dragElastic:f,dragMomentum:h}}}function H0(n){let a=!0;return()=>{if(a){a=!1;return}n()}}function k3(n,a,s){const o=Zv(n,H0(s)),u=Zv(a,H0(s));return()=>{o(),u()}}function Qo(n,a,s){return(a===!0||a===n)&&(s===null||s===n)}function B3(n,a=10){let s=null;return Math.abs(n.y)>a?s="y":Math.abs(n.x)>a&&(s="x"),s}class H3 extends Sa{constructor(a){super(a),this.removeGroupControls=Je,this.removeListeners=Je,this.controls=new U3(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Je}update(){const{dragControls:a}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};a!==s&&(this.removeGroupControls(),a&&(this.removeGroupControls=a.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const jf=n=>(a,s)=>{n&&zt.update(()=>n(a,s),!1,!0)};class $3 extends Sa{constructor(){super(...arguments),this.removePointerDownListener=Je}onPointerDown(a){this.session=new Nx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:s,onPan:o,onPanEnd:u}=this.node.getProps();return{onSessionStart:jf(a),onStart:jf(s),onMove:jf(o),onEnd:(d,f)=>{delete this.session,u&&zt.postRender(()=>u(d,f))}}}mount(){this.removePointerDownListener=us(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Nf=!1;class G3 extends w.Component{componentDidMount(){const{visualElement:a,layoutGroup:s,switchLayoutGroup:o,layoutId:u}=this.props,{projection:d}=a;d&&(s.group&&s.group.add(d),o&&o.register&&u&&o.register(d),Nf&&d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:s,visualElement:o,drag:u,isPresent:d}=this.props,{projection:f}=o;return f&&(f.isPresent=d,a.layoutDependency!==s&&f.setOptions({...f.options,layoutDependency:s}),Nf=!0,u||a.layoutDependency!==s||s===void 0||a.isPresent!==d?f.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?f.promote():f.relegate()||zt.postRender(()=>{const h=f.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:a,layoutAnchor:s}=this.props,{projection:o}=a;o&&(o.options.layoutAnchor=s,o.root.didUpdate(),qd.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:u}=a;Nf=!0,u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),o&&o.deregister&&o.deregister(u))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Mx(n){const[a,s]=Xj(),o=w.useContext(fr);return v.jsx(G3,{...n,layoutGroup:o,switchLayoutGroup:w.useContext(Ex),isPresent:a,safeToRemove:s})}const Y3={pan:{Feature:$3},drag:{Feature:H3,ProjectionNode:mx,MeasureLayout:Mx}};function $0(n,a,s){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,d=o[u];d&&zt.postRender(()=>d(a,Ts(a)))}class q3 extends Sa{mount(){const{current:a}=this.node;a&&(this.unmount=dA(a,(s,o)=>($0(this.node,o,"Start"),u=>$0(this.node,u,"End"))))}unmount(){}}class X3 extends Sa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!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=bs(ms(this.node.current,"focus",()=>this.onFocus()),ms(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function G0(n,a,s){const{props:o}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),d=o[u];d&&zt.postRender(()=>d(a,Ts(a)))}class K3 extends Sa{mount(){const{current:a}=this.node;if(!a)return;const{globalTapTarget:s,propagate:o}=this.node.props;this.unmount=yA(a,(u,d)=>(G0(this.node,d,"Start"),(f,{success:h})=>G0(this.node,f,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(o==null?void 0:o.tap)===!1})}unmount(){}}const gd=new WeakMap,Cf=new WeakMap,F3=n=>{const a=gd.get(n.target);a&&a(n)},Z3=n=>{n.forEach(F3)};function Q3({root:n,...a}){const s=n||document;Cf.has(s)||Cf.set(s,{});const o=Cf.get(s),u=JSON.stringify(a);return o[u]||(o[u]=new IntersectionObserver(Z3,{root:n,...a})),o[u]}function J3(n,a,s){const o=Q3(a);return gd.set(n,s),o.observe(n),()=>{gd.delete(n),o.unobserve(n)}}const P3={some:0,all:1};class W3 extends Sa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var m;(m=this.stopObserver)==null||m.call(this);const{viewport:a={}}=this.node.getProps(),{root:s,margin:o,amount:u="some",once:d}=a,f={root:s?s.current:void 0,rootMargin:o,threshold:typeof u=="number"?u:P3[u]},h=p=>{const{isIntersecting:y}=p;if(this.isInView===y||(this.isInView=y,d&&!y&&this.hasEnteredView))return;y&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",y);const{onViewportEnter:b,onViewportLeave:S}=this.node.getProps(),T=y?b:S;T&&T(p)};this.stopObserver=J3(this.node.current,f,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:s}=this.node;["amount","margin","root"].some(I3(a,s))&&this.startObserver()}unmount(){var a;(a=this.stopObserver)==null||a.call(this),this.hasEnteredView=!1,this.isInView=!1}}function I3({viewport:n={}},{viewport:a={}}={}){return s=>n[s]!==a[s]}const tN={inView:{Feature:W3},tap:{Feature:K3},focus:{Feature:X3},hover:{Feature:q3}},eN={layout:{ProjectionNode:mx,MeasureLayout:Mx}},nN={...A3,...tN,...Y3,...eN},Dx=x3(nN,S3),Lr=w.forwardRef(function(a,s){return v.jsx(bw,{children:v.jsx("a",{...a,ref:s})})}),Pl={base:["relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-lg border text-base/6 font-semibold","px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)] sm:text-sm/6","focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500","data-disabled:opacity-50","*:data-[slot=icon]:-mx-0.5 *:data-[slot=icon]:my-0.5 *:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:self-center *:data-[slot=icon]:text-(--btn-icon) sm:*:data-[slot=icon]:my-1 sm:*:data-[slot=icon]:size-4 forced-colors:[--btn-icon:ButtonText] forced-colors:data-hover:[--btn-icon:ButtonText]"],solid:["border-transparent bg-(--btn-border)","dark:bg-(--btn-bg)","before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-lg)-1px)] before:bg-(--btn-bg)","before:shadow-sm","dark:before:hidden","dark:border-white/5","after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-lg)-1px)]","after:shadow-[inset_0_1px_--theme(--color-white/15%)]","data-active:after:bg-(--btn-hover-overlay) data-hover:after:bg-(--btn-hover-overlay)","dark:after:-inset-px dark:after:rounded-lg","data-disabled:before:shadow-none data-disabled:after:shadow-none"],outline:["border-zinc-950/10 text-zinc-950 data-active:bg-zinc-950/2.5 data-hover:bg-zinc-950/2.5","dark:border-white/15 dark:text-white dark:[--btn-bg:transparent] dark:data-active:bg-white/5 dark:data-hover:bg-white/5","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],plain:["border-transparent text-zinc-950 data-active:bg-zinc-950/5 data-hover:bg-zinc-950/5","dark:text-white dark:data-active:bg-white/10 dark:data-hover:bg-white/10","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],colors:{"dark/zinc":["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:text-white dark:[--btn-bg:var(--color-zinc-600)] dark:[--btn-hover-overlay:var(--color-white)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],light:["text-zinc-950 [--btn-bg:white] [--btn-border:var(--color-zinc-950)]/10 [--btn-hover-overlay:var(--color-zinc-950)]/2.5 data-active:[--btn-border:var(--color-zinc-950)]/15 data-hover:[--btn-border:var(--color-zinc-950)]/15","dark:text-white dark:[--btn-hover-overlay:var(--color-white)]/5 dark:[--btn-bg:var(--color-zinc-800)]","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],"dark/white":["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:text-zinc-950 dark:[--btn-bg:white] dark:[--btn-hover-overlay:var(--color-zinc-950)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],dark:["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:[--btn-hover-overlay:var(--color-white)]/5 dark:[--btn-bg:var(--color-zinc-800)]","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],white:["text-zinc-950 [--btn-bg:white] [--btn-border:var(--color-zinc-950)]/10 [--btn-hover-overlay:var(--color-zinc-950)]/2.5 data-active:[--btn-border:var(--color-zinc-950)]/15 data-hover:[--btn-border:var(--color-zinc-950)]/15","dark:[--btn-hover-overlay:var(--color-zinc-950)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-500)] data-hover:[--btn-icon:var(--color-zinc-500)]"],zinc:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-zinc-600)] [--btn-border:var(--color-zinc-700)]/90","dark:[--btn-hover-overlay:var(--color-white)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],indigo:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-indigo-500)] [--btn-border:var(--color-indigo-600)]/90","[--btn-icon:var(--color-indigo-300)] data-active:[--btn-icon:var(--color-indigo-200)] data-hover:[--btn-icon:var(--color-indigo-200)]"],cyan:["text-cyan-950 [--btn-bg:var(--color-cyan-300)] [--btn-border:var(--color-cyan-400)]/80 [--btn-hover-overlay:var(--color-white)]/25","[--btn-icon:var(--color-cyan-500)]"],red:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-red-600)] [--btn-border:var(--color-red-700)]/90","[--btn-icon:var(--color-red-300)] data-active:[--btn-icon:var(--color-red-200)] data-hover:[--btn-icon:var(--color-red-200)]"],orange:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-orange-500)] [--btn-border:var(--color-orange-600)]/90","[--btn-icon:var(--color-orange-300)] data-active:[--btn-icon:var(--color-orange-200)] data-hover:[--btn-icon:var(--color-orange-200)]"],amber:["text-amber-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-amber-400)] [--btn-border:var(--color-amber-500)]/80","[--btn-icon:var(--color-amber-600)]"],yellow:["text-yellow-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-yellow-300)] [--btn-border:var(--color-yellow-400)]/80","[--btn-icon:var(--color-yellow-600)] data-active:[--btn-icon:var(--color-yellow-700)] data-hover:[--btn-icon:var(--color-yellow-700)]"],lime:["text-lime-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-lime-300)] [--btn-border:var(--color-lime-400)]/80","[--btn-icon:var(--color-lime-600)] data-active:[--btn-icon:var(--color-lime-700)] data-hover:[--btn-icon:var(--color-lime-700)]"],green:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-green-600)] [--btn-border:var(--color-green-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],emerald:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-emerald-600)] [--btn-border:var(--color-emerald-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],teal:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-teal-600)] [--btn-border:var(--color-teal-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],sky:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-sky-500)] [--btn-border:var(--color-sky-600)]/80","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],blue:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-blue-600)] [--btn-border:var(--color-blue-700)]/90","[--btn-icon:var(--color-blue-400)] data-active:[--btn-icon:var(--color-blue-300)] data-hover:[--btn-icon:var(--color-blue-300)]"],violet:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-violet-500)] [--btn-border:var(--color-violet-600)]/90","[--btn-icon:var(--color-violet-300)] data-active:[--btn-icon:var(--color-violet-200)] data-hover:[--btn-icon:var(--color-violet-200)]"],purple:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-purple-500)] [--btn-border:var(--color-purple-600)]/90","[--btn-icon:var(--color-purple-300)] data-active:[--btn-icon:var(--color-purple-200)] data-hover:[--btn-icon:var(--color-purple-200)]"],fuchsia:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-fuchsia-500)] [--btn-border:var(--color-fuchsia-600)]/90","[--btn-icon:var(--color-fuchsia-300)] data-active:[--btn-icon:var(--color-fuchsia-200)] data-hover:[--btn-icon:var(--color-fuchsia-200)]"],pink:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-pink-500)] [--btn-border:var(--color-pink-600)]/90","[--btn-icon:var(--color-pink-300)] data-active:[--btn-icon:var(--color-pink-200)] data-hover:[--btn-icon:var(--color-pink-200)]"],rose:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-rose-500)] [--btn-border:var(--color-rose-600)]/90","[--btn-icon:var(--color-rose-300)] data-active:[--btn-icon:var(--color-rose-200)] data-hover:[--btn-icon:var(--color-rose-200)]"]}};w.forwardRef(function({color:a,outline:s,plain:o,className:u,children:d,...f},h){let m=Kt(u,Pl.base,s?Pl.outline:o?Pl.plain:Kt(Pl.solid,Pl.colors[a??"dark/zinc"]));return typeof f.href=="string"?v.jsx(Lr,{...f,className:m,ref:h,children:v.jsx(ba,{children:d})}):v.jsx(vs,{...f,className:Kt(m,"cursor-default"),ref:h,children:v.jsx(ba,{children:d})})});function ba({children:n}){return v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"absolute top-1/2 left-1/2 size-[max(100%,2.75rem)] -translate-x-1/2 -translate-y-1/2 pointer-fine:hidden","aria-hidden":"true"}),n]})}function aN({className:n,...a}){return v.jsx("nav",{...a,className:Kt(n,"flex flex-1 items-center gap-4 py-2.5")})}function iN({className:n,...a}){let s=w.useId();return v.jsx(vx,{id:s,children:v.jsx("div",{...a,className:Kt(n,"flex items-center gap-3")})})}function lN({className:n,...a}){return v.jsx("div",{"aria-hidden":"true",...a,className:Kt(n,"-ml-4 flex-1")})}const Id=w.forwardRef(function({current:a,className:s,children:o,...u},d){let f=Kt("relative flex min-w-0 items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 sm:text-sm/5","*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5","*:not-nth-2:last:data-[slot=icon]:ml-auto *:not-nth-2:last:data-[slot=icon]:size-5 sm:*:not-nth-2:last:data-[slot=icon]:size-4","*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 *:data-[slot=avatar]:[--avatar-radius:var(--radius-md)] sm:*:data-[slot=avatar]:size-6","data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950","data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950","dark:text-white dark:*:data-[slot=icon]:fill-zinc-400","dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white","dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white");return v.jsxs("span",{className:Kt(s,"relative"),children:[a&&v.jsx(Dx.span,{layoutId:"current-indicator",className:"absolute inset-x-2 -bottom-2.5 h-0.5 rounded-full bg-zinc-950 dark:bg-white"}),typeof u.href=="string"?v.jsx(Lr,{...u,className:f,"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})}):v.jsx(vs,{...u,className:Kt("cursor-default",f),"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})})]})});function sN(){return v.jsx("svg",{"data-slot":"icon",viewBox:"0 0 20 20","aria-hidden":"true",children:v.jsx("path",{d:"M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z"})})}function oN(){return v.jsx("svg",{"data-slot":"icon",viewBox:"0 0 20 20","aria-hidden":"true",children:v.jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})})}function rN({open:n,close:a,children:s}){return v.jsxs(nE,{open:n,onClose:a,className:"lg:hidden",children:[v.jsx(tE,{transition:!0,className:"fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"}),v.jsx($y,{transition:!0,className:"fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full",children:v.jsxs("div",{className:"flex h-full flex-col rounded-lg bg-ouro-deep shadow-xl ring-1 ring-ouro-moss/40",children:[v.jsx("div",{className:"-mb-3 px-4 pt-3",children:v.jsx(gy,{as:Id,"aria-label":"Close navigation",children:v.jsx(oN,{})})}),s]})})]})}function uN({navbar:n,sidebar:a,children:s}){let[o,u]=w.useState(!1);return v.jsxs("div",{className:"relative isolate flex min-h-svh w-full bg-ouro-void max-lg:flex-col",children:[v.jsx("div",{className:"fixed inset-y-0 left-0 w-64 max-lg:hidden border-r border-zinc-200 dark:border-ouro-moss/30",children:a}),v.jsx(rN,{open:o,close:()=>u(!1),children:a}),v.jsxs("header",{className:"flex items-center px-4 lg:hidden",children:[v.jsx("div",{className:"py-2.5",children:v.jsx(Id,{onClick:()=>u(!0),"aria-label":"Open navigation",children:v.jsx(sN,{})})}),v.jsx("div",{className:"min-w-0 flex-1",children:n})]}),v.jsx("main",{className:"flex flex-1 flex-col pb-2 lg:min-w-0 lg:pt-2 lg:pr-2 lg:pl-64",children:v.jsx("div",{className:"grow p-4 lg:rounded-lg lg:bg-ouro-deep lg:p-8 lg:ring-1 lg:ring-ouro-moss/30",children:v.jsx("div",{className:"mx-auto max-w-6xl",children:s})})})]})}function cN({className:n,...a}){return v.jsx("nav",{...a,className:Kt(n,"flex h-full min-h-0 flex-col")})}function fN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function dN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-1 flex-col overflow-y-auto p-4 [&>[data-slot=section]+[data-slot=section]]:mt-8")})}function hN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function Y0({className:n,...a}){let s=w.useId();return v.jsx(vx,{id:s,children:v.jsx("div",{...a,"data-slot":"section",className:Kt(n,"flex flex-col gap-0.5")})})}function q0({className:n,...a}){return v.jsx("h3",{...a,className:Kt(n,"mb-1 px-2 text-xs/6 font-medium text-zinc-500 dark:text-zinc-400")})}const mN=w.forwardRef(function({current:a,className:s,children:o,...u},d){let f=Kt("flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5","*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5","*:last:data-[slot=icon]:ml-auto *:last:data-[slot=icon]:size-5 sm:*:last:data-[slot=icon]:size-4","*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 sm:*:data-[slot=avatar]:size-6","data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950","data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950","data-current:*:data-[slot=icon]:fill-zinc-950","dark:text-white dark:*:data-[slot=icon]:fill-zinc-400","dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white","dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white","dark:data-current:*:data-[slot=icon]:fill-white");return v.jsxs("span",{className:Kt(s,"relative"),children:[a&&v.jsx(Dx.span,{layoutId:"current-indicator",className:"absolute inset-y-2 -left-4 w-0.5 rounded-full bg-zinc-950 dark:bg-white"}),typeof u.href=="string"?v.jsx(gy,{as:Lr,...u,className:f,"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})}):v.jsx(vs,{...u,className:Kt("cursor-default",f),"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})})]})});function pN({className:n,...a}){return v.jsx("span",{...a,className:Kt(n,"truncate")})}const gN={red:"bg-red-500/15 text-red-700 group-data-hover:bg-red-500/25 dark:bg-red-500/10 dark:text-red-400 dark:group-data-hover:bg-red-500/20",orange:"bg-orange-500/15 text-orange-700 group-data-hover:bg-orange-500/25 dark:bg-orange-500/10 dark:text-orange-400 dark:group-data-hover:bg-orange-500/20",amber:"bg-amber-400/20 text-amber-700 group-data-hover:bg-amber-400/30 dark:bg-amber-400/10 dark:text-amber-400 dark:group-data-hover:bg-amber-400/15",yellow:"bg-yellow-400/20 text-yellow-700 group-data-hover:bg-yellow-400/30 dark:bg-yellow-400/10 dark:text-yellow-300 dark:group-data-hover:bg-yellow-400/15",lime:"bg-lime-400/20 text-lime-700 group-data-hover:bg-lime-400/30 dark:bg-lime-400/10 dark:text-lime-300 dark:group-data-hover:bg-lime-400/15",green:"bg-green-500/15 text-green-700 group-data-hover:bg-green-500/25 dark:bg-green-500/10 dark:text-green-400 dark:group-data-hover:bg-green-500/20",emerald:"bg-emerald-500/15 text-emerald-700 group-data-hover:bg-emerald-500/25 dark:bg-emerald-500/10 dark:text-emerald-400 dark:group-data-hover:bg-emerald-500/20",teal:"bg-teal-500/15 text-teal-700 group-data-hover:bg-teal-500/25 dark:bg-teal-500/10 dark:text-teal-300 dark:group-data-hover:bg-teal-500/20",cyan:"bg-cyan-400/20 text-cyan-700 group-data-hover:bg-cyan-400/30 dark:bg-cyan-400/10 dark:text-cyan-300 dark:group-data-hover:bg-cyan-400/15",sky:"bg-sky-500/15 text-sky-700 group-data-hover:bg-sky-500/25 dark:bg-sky-500/10 dark:text-sky-300 dark:group-data-hover:bg-sky-500/20",blue:"bg-blue-500/15 text-blue-700 group-data-hover:bg-blue-500/25 dark:text-blue-400 dark:group-data-hover:bg-blue-500/25",indigo:"bg-indigo-500/15 text-indigo-700 group-data-hover:bg-indigo-500/25 dark:text-indigo-400 dark:group-data-hover:bg-indigo-500/20",violet:"bg-violet-500/15 text-violet-700 group-data-hover:bg-violet-500/25 dark:text-violet-400 dark:group-data-hover:bg-violet-500/20",purple:"bg-purple-500/15 text-purple-700 group-data-hover:bg-purple-500/25 dark:text-purple-400 dark:group-data-hover:bg-purple-500/20",fuchsia:"bg-fuchsia-400/15 text-fuchsia-700 group-data-hover:bg-fuchsia-400/25 dark:bg-fuchsia-400/10 dark:text-fuchsia-400 dark:group-data-hover:bg-fuchsia-400/20",pink:"bg-pink-400/15 text-pink-700 group-data-hover:bg-pink-400/25 dark:bg-pink-400/10 dark:text-pink-400 dark:group-data-hover:bg-pink-400/20",rose:"bg-rose-400/15 text-rose-700 group-data-hover:bg-rose-400/25 dark:bg-rose-400/10 dark:text-rose-400 dark:group-data-hover:bg-rose-400/20",zinc:"bg-zinc-600/10 text-zinc-700 group-data-hover:bg-zinc-600/20 dark:bg-white/5 dark:text-zinc-400 dark:group-data-hover:bg-white/10"};function Yt({color:n="zinc",className:a,...s}){return v.jsx("span",{...s,className:Kt(a,"inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-sm/5 font-medium sm:text-xs/5 forced-colors:outline",gN[n])})}w.forwardRef(function({color:a="zinc",className:s,children:o,...u},d){let f=Kt(s,"group relative inline-flex rounded-md focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500");return typeof u.href=="string"?v.jsx(Lr,{...u,className:f,ref:d,children:v.jsx(ba,{children:v.jsx(Yt,{color:a,children:o})})}):v.jsx(vs,{...u,className:f,ref:d,children:v.jsx(ba,{children:v.jsx(Yt,{color:a,children:o})})})});const vN={"owed-reply":"red","blocking-obligation":"red","broken-return":"red","stale-delegation":"yellow","return-ready":"lime","overdue-habit":"yellow"},yN={"owed-reply":"owed reply","blocking-obligation":"blocking","broken-return":"broken return","stale-delegation":"stale","return-ready":"ready to return","overdue-habit":"overdue"},bN={"owed-reply":"Someone spoke last and is waiting for your response","blocking-obligation":"This obligation is open and blocking forward progress","broken-return":"Work was done but the result was never returned to the requester","stale-delegation":"This was delegated to you and hasn't been addressed","return-ready":"The result is ready — deliver it to close the loop","overdue-habit":"This routine is past its scheduled cadence"};function xN({view:n,deskPrefs:a}){const s=Qi(),[o,u]=w.useState(null),d=n.agent,f=n.work,h=n.inner,m=n.activity,p=d.degraded,y=d.attention,b=f.tasks,S=f.obligations,T=f.sessions,j=f.coding,E=d.senses??[],C=f.bridges??[];return w.useEffect(()=>{ge(`/agents/${encodeURIComponent(d.agentName)}/needs-me`).then(u)},[d.agentName]),v.jsxs("div",{className:"space-y-6",children:[o&&o.items.length>0&&v.jsxs("div",{className:"rounded-xl bg-ouro-fang/5 p-4 ring-1 ring-ouro-fang/15",children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-fang",children:["Needs me now (",o.items.length,")"]}),v.jsx("div",{className:"mt-2 space-y-1.5",children:o.items.map((A,L)=>v.jsxs("button",{onClick:()=>A.ref&&s({tab:A.ref.tab,focus:A.ref.focus}),className:"flex w-full items-start gap-2.5 rounded-lg bg-ouro-void/40 px-3 py-2.5 text-left ring-1 ring-ouro-moss/10 hover:ring-ouro-fang/20 transition-colors",children:[v.jsx(Yt,{color:vN[A.urgency]??"zinc",children:yN[A.urgency]??A.urgency}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"text-sm font-medium text-ouro-bone",children:A.label}),v.jsx("p",{className:"text-xs text-ouro-shadow truncate",children:A.detail}),v.jsx("p",{className:"text-[10px] italic text-ouro-shadow/60 mt-0.5",children:bN[A.urgency]??""})]}),A.ageMs!=null&&v.jsx("span",{className:"shrink-0 text-xs tabular-nums text-ouro-shadow",children:A.ageMs<36e5?`${Math.floor(A.ageMs/6e4)}m`:A.ageMs<864e5?`${Math.floor(A.ageMs/36e5)}h`:`${Math.floor(A.ageMs/864e5)}d`})]},L))})]}),(a==null?void 0:a.carrying)&&v.jsxs("div",{className:"rounded-xl bg-ouro-moss/10 p-4 ring-1 ring-ouro-glow/8",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"What I'm carrying"}),v.jsx("p",{className:"mt-1 text-sm leading-relaxed text-ouro-bone",children:a.carrying})]}),(()=>{const A=(a==null?void 0:a.pinnedConstellations)??[];return A.length===0?null:v.jsxs("div",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Pinned threads"}),v.jsx("div",{className:"mt-2 space-y-2",children:A.map((L,U)=>v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-medium text-ouro-bone",children:L.label}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5",children:[(L.friendIds??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"sessions"}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["friend:",Y.slice(0,8),"…"]},Y)),(L.taskRefs??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"work"}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["task:",Y]},Y)),(L.bridgeIds??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"connections",focus:Y}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["bridge:",Y.slice(0,8),"…"]},Y))]})]},U))})]})})(),v.jsxs("div",{className:"rounded-xl bg-ouro-moss/15 p-4 ring-1 ring-ouro-glow/10 sm:p-5",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"Center of gravity"}),v.jsx("p",{className:"mt-1 font-display text-xl italic font-semibold text-ouro-bone sm:text-2xl",children:y.label}),v.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ouro-mist",children:[d.agentName," has"," ",v.jsxs(Jo,{tab:"work",children:[b.liveCount," live tasks"]}),","," ",v.jsxs(Jo,{tab:"work",children:[S.openCount," obligations"]}),","," ",v.jsxs(Jo,{tab:"work",children:[j.activeCount," coding lanes"]}),", and"," ",v.jsxs(Jo,{tab:"sessions",children:[T.liveCount," live sessions"]}),"."]}),p.status==="degraded"&&p.issues.length>0&&v.jsxs("div",{className:"mt-3 space-y-1",children:[p.issues.slice(0,5).map((A,L)=>v.jsxs("button",{onClick:()=>s({tab:"runtime"}),className:"flex w-full items-start gap-2 rounded-lg bg-ouro-fang/5 px-3 py-2 text-left text-sm ring-1 ring-ouro-fang/10 hover:ring-ouro-fang/25 transition-colors",children:[v.jsx("span",{className:"mt-0.5 h-2 w-2 shrink-0 rounded-full bg-ouro-fang"}),v.jsxs("span",{className:"text-ouro-mist",children:[v.jsx("span",{className:"font-semibold text-ouro-fang",children:A.code}),v.jsxs("span",{className:"text-ouro-shadow",children:[" — ",dn(A.detail,80)]})]})]},L)),p.issues.length>5&&v.jsxs("button",{onClick:()=>s({tab:"runtime"}),className:"text-xs text-ouro-glow underline underline-offset-2",children:["+",p.issues.length-5," more issues"]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[v.jsx(Po,{label:"Tasks",value:b.liveCount,sub:`${b.blockedCount} blocked`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Obligations",value:S.openCount,sub:`${T.liveCount} sessions`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Coding",value:j.activeCount,sub:`${j.blockedCount} blocked`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Inner",value:h.status,sub:dn(h.summary??"",30),onClick:()=>s({tab:"inner"})})]}),v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Wo,{title:"Senses",children:E.length>0?v.jsx(SN,{items:E}):v.jsx(Mf,{children:"No active senses"})}),v.jsx(Wo,{title:"Bridges",children:C.length>0?v.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.map(A=>v.jsx("button",{onClick:()=>s({tab:"connections",focus:A}),children:v.jsx(Yt,{color:"lime",children:A})},A))}):v.jsx(Mf,{children:"No active bridges"})})]}),(()=>{var U;const L=(((U=f.obligations)==null?void 0:U.items)??[]).filter(Y=>Y.status==="fulfilled");return L.length===0?null:v.jsx(Wo,{title:"Recently closed",children:v.jsx("div",{className:"space-y-1",children:L.slice(0,3).map((Y,X)=>v.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-3 py-2 bg-ouro-glow/5 ring-1 ring-ouro-glow/10",children:[v.jsx(Yt,{color:"lime",children:"closed"}),v.jsx("p",{className:"text-sm text-ouro-mist truncate",children:dn(Y.content,80)}),v.jsx("span",{className:"shrink-0 text-xs text-ouro-shadow",children:Qe(Y.updatedAt)})]},X))})})})(),v.jsx(Wo,{title:"Recent activity",children:m.recent.length>0?v.jsx("div",{className:"space-y-1",children:m.recent.map((A,L)=>{const U=A.kind==="coding"||A.kind==="obligation"?"work":A.kind==="session"?"sessions":"inner";return v.jsxs("button",{onClick:()=>s({tab:U}),className:"flex w-full flex-col gap-0.5 rounded-lg px-3 py-2.5 text-left hover:bg-ouro-moss/10 transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{children:A.kind}),v.jsx("span",{className:"text-xs text-ouro-shadow",children:Qe(A.at)})]}),v.jsx("p",{className:"truncate text-sm font-medium text-ouro-bone",children:dn(A.label,100)}),v.jsx("p",{className:"truncate text-xs text-ouro-shadow",children:dn(A.detail,80)})]},L)})}):v.jsx(Mf,{children:"No recent activity yet."})})]})}function Jo({tab:n,children:a}){const s=Qi();return v.jsx("button",{onClick:()=>s({tab:n}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow transition-colors",children:a})}function Po({label:n,value:a,sub:s,onClick:o}){return v.jsxs("button",{onClick:o,className:"rounded-xl bg-ouro-void/50 p-3 text-left ring-1 ring-ouro-moss/20 hover:ring-ouro-glow/20 transition-all",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow",children:n}),v.jsx("p",{className:"mt-1 text-xl font-semibold tabular-nums text-ouro-bone",children:a}),v.jsx("p",{className:"mt-0.5 truncate text-xs text-ouro-shadow",children:s})]})}function Wo({title:n,children:a}){return v.jsxs("div",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n}),v.jsx("div",{className:"mt-2",children:a})]})}function SN({items:n}){return v.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(a=>v.jsx(Yt,{color:"lime",children:a},a))})}function Mf({children:n}){return v.jsx("p",{className:"text-sm text-ouro-shadow",children:n})}function zx(n){const a=n.function.name,s=TN(n.function.arguments);return a==="settle"?{kind:"response",name:a,id:n.id,deliveredText:s.answer??null,delegatedThought:null,metadata:s.intent??null,rawArgs:null}:a==="ponder"?{kind:"delegation",name:a,id:n.id,deliveredText:s.say??null,delegatedThought:s.thought??null,metadata:null,rawArgs:null}:a==="rest"?{kind:"rest",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:null,rawArgs:null}:a==="observe"?{kind:"observe",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:s.reason??null,rawArgs:null}:a==="surface"?{kind:"surface",name:a,id:n.id,deliveredText:s.content??null,delegatedThought:null,metadata:s.delegationId??s.friendId??null,rawArgs:null}:{kind:"action",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:null,rawArgs:n.function.arguments}}function TN(n){try{const a=JSON.parse(n);if(a&&typeof a=="object")return a}catch{}return{}}const X0={"needs-reply":{color:"red",label:"needs reply"},"on-hold":{color:"yellow",label:"on hold"},monitoring:{color:"zinc",label:"monitoring"},idle:{color:"zinc",label:"idle"}};function wN({agentName:n,focus:a,onFocusConsumed:s,deskPrefs:o}){Qi();const[u,d]=w.useState(null),[f,h]=w.useState(null),[m,p]=w.useState(null),[y,b]=w.useState(!1);w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/sessions`).then(E=>{d(E),a&&(S(a),s==null||s())})},[n,a]);function S(E){if(f===E){h(null),p(null);return}h(E),p(null),b(!0);const[C,A,L]=E.split("/");ge(`/agents/${encodeURIComponent(n)}/sessions/${encodeURIComponent(C)}/${encodeURIComponent(A)}/${encodeURIComponent(L)}`).then(p).catch(()=>p(null)).finally(()=>b(!1))}const T=new Set((o==null?void 0:o.starredFriends)??[]);if(!u)return v.jsx(Ox,{label:"Loading sessions"});const j=[...u.items].sort((E,C)=>{const A=T.has(E.friendId)?0:1,L=T.has(C.friendId)?0:1;return A-L});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:[u.totalCount," sessions · ",u.activeCount," active · ",u.staleCount," stale"]}),v.jsx("div",{className:"space-y-1.5",children:j.map(E=>{var Z;const C=T.has(E.friendId),A=`${E.friendId}/${E.channel}/${E.key}`,L=f===A,U=X0[E.replyState]??X0.idle,Y=((Z=E.lastUsage)==null?void 0:Z.total_tokens)??E.estimatedTokens??0,tt=Y>0?Math.min(100,Math.round(Y/8e4*100)):0;return v.jsxs("div",{children:[v.jsxs("button",{onClick:()=>S(A),className:`flex w-full flex-col gap-1.5 rounded-lg px-3 py-3 text-left transition-colors ring-1 ${L?"bg-ouro-moss/15 ring-ouro-glow/20":"ring-ouro-moss/15 hover:bg-ouro-moss/8"}`,children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C&&v.jsx("span",{className:"text-ouro-gold",title:"Starred",children:"★"}),v.jsx("span",{className:"truncate font-medium text-ouro-bone",children:E.friendName}),v.jsxs("span",{className:"shrink-0 text-xs text-ouro-shadow",children:["via ",E.channel]}),v.jsx(Yt,{color:U.color,children:U.label})]}),v.jsx("span",{className:"shrink-0 text-xs tabular-nums text-ouro-shadow",children:Qe(E.lastActivityAt)})]}),E.latestUserExcerpt&&v.jsx("p",{className:"truncate text-sm text-ouro-shadow",children:dn(E.latestUserExcerpt,120)}),v.jsxs("div",{className:"flex items-center gap-3 text-xs text-ouro-shadow",children:[v.jsxs("span",{className:"tabular-nums",children:[E.messageCount," msgs"]}),E.lastUsage&&v.jsxs("span",{className:"tabular-nums",children:[E.lastUsage.total_tokens.toLocaleString()," tok"]}),tt>0&&v.jsxs("div",{className:"flex items-center gap-1.5 flex-1 max-w-32",title:"Context pressure — steady state oscillates between 80-100%",children:[v.jsx("div",{className:"h-1 flex-1 rounded-full bg-ouro-moss/20",children:v.jsx("div",{className:`h-1 rounded-full transition-all ${tt>100?"bg-ouro-fang":tt>80?"bg-ouro-gold":"bg-ouro-glow"}`,style:{width:`${Math.min(100,tt)}%`}})}),v.jsxs("span",{className:"tabular-nums text-[10px]",children:[tt,"%"]})]})]})]}),L&&v.jsx(EN,{loading:y,transcript:m})]},A)})})]})}function EN({loading:n,transcript:a}){const s=w.useRef(null);return w.useEffect(()=>{a&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[a]),v.jsxs("div",{ref:s,className:"mt-1 max-h-[70vh] overflow-y-auto rounded-lg bg-ouro-void/60 p-3 ring-1 ring-ouro-moss/15",children:[n&&v.jsx(Ox,{label:"Loading transcript"}),a&&v.jsx(AN,{messages:a.messages,usage:a.lastUsage})]})}function AN({messages:n,usage:a}){const s=n.filter(h=>h.role==="system"),o=n.filter(h=>h.role!=="system"),[u,d]=w.useState(!1),f=new Map;for(const h of o)h.role==="tool"&&h.tool_call_id&&f.set(h.tool_call_id,h);return v.jsxs("div",{className:"space-y-0.5",children:[a&&v.jsxs("p",{className:"pb-2 font-mono text-[10px] text-ouro-shadow",children:[a.input_tokens.toLocaleString()," in · ",a.output_tokens.toLocaleString()," out · ",a.total_tokens.toLocaleString()," total"]}),s.length>0&&v.jsxs("div",{className:"pb-2 mb-2 border-b border-ouro-moss/15",children:[v.jsxs("button",{onClick:()=>d(!u),className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow hover:text-ouro-mist transition-colors",children:[u?"▼":"▶"," system context (",s.length,")"]}),u&&s.map(h=>v.jsx("div",{className:"mt-2 max-h-60 overflow-y-auto rounded bg-ouro-void/40 p-2 text-xs text-ouro-shadow whitespace-pre-wrap break-words",children:h.content},h.index))]}),o.map(h=>h.role==="tool"?null:h.role==="user"?v.jsx(jN,{msg:h},h.index):h.role==="assistant"?v.jsx(NN,{msg:h,toolResults:f},h.index):null)]})}function jN({msg:n}){return v.jsx("div",{className:"flex justify-start py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-bl-sm bg-ouro-moss/25 px-3.5 py-2 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-gold/70",children:"user"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",n.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:n.content})]})})}function NN({msg:n,toolResults:a}){const s=(n.tool_calls??[]).map(zx),o=s.filter(f=>f.kind!=="action"),u=s.filter(f=>f.kind==="action"),d=[];for(const f of o)f.kind==="response"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.metadata&&f.metadata!=="complete"&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["intent: ",f.metadata]})]})},f.id)):f.kind==="delegation"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),f.deliveredText&&v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.delegatedThought&&v.jsxs("div",{className:"mt-2 rounded-lg bg-ouro-moss/20 px-2.5 py-1.5 ring-1 ring-ouro-glow/8",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/60",children:"→ inner dialog"}),v.jsx("p",{className:"mt-0.5 text-xs text-ouro-mist",children:f.delegatedThought})]})]})},f.id)):f.kind==="surface"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-scale/12 px-3.5 py-2 ring-1 ring-ouro-scale/15",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"surfaced"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.metadata&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["→ ",f.metadata]})]})},f.id)):f.kind==="rest"?d.push(v.jsx("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/50",children:"— resting —"},f.id)):f.kind==="observe"&&d.push(v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/50",children:["— observed",f.metadata?`: ${f.metadata}`:""," —"]},f.id));return n.content&&o.length===0&&d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:n.content})]})},`${n.index}-content`)),u.length>0&&d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsx("div",{className:"max-w-[85%] sm:max-w-[75%] space-y-1",children:u.map(f=>v.jsx(CN,{call:f,result:a.get(f.id)},f.id))})},`${n.index}-tools`)),v.jsx(v.Fragment,{children:d})}function CN({call:n,result:a}){const[s,o]=w.useState(!1);return v.jsxs("button",{onClick:()=>o(!s),className:"w-full text-left rounded-lg bg-ouro-moss/10 px-2.5 py-1.5 text-sm ring-1 ring-ouro-moss/12 hover:ring-ouro-glow/15 transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-mono text-xs text-ouro-glow",children:n.name}),!s&&v.jsx("span",{className:"text-[10px] text-ouro-shadow",children:"tap to inspect"})]}),s&&v.jsxs(v.Fragment,{children:[n.rawArgs&&v.jsx("pre",{className:"mt-1.5 max-h-24 overflow-y-auto rounded bg-ouro-void/40 p-1.5 font-mono text-[11px] text-ouro-shadow whitespace-pre-wrap break-words",children:n.rawArgs}),a&&v.jsxs("div",{className:"mt-1.5 border-t border-ouro-moss/15 pt-1.5",children:[v.jsx(Yt,{children:"result"}),v.jsx("pre",{className:"mt-1 max-h-32 overflow-y-auto rounded bg-ouro-void/40 p-1.5 font-mono text-[11px] text-ouro-mist whitespace-pre-wrap break-words",children:a.content})]})]})]})}function Ox({label:n}){return v.jsxs("div",{className:"flex items-center gap-2 py-6",children:[v.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-ouro-glow"}),v.jsxs("span",{className:"font-mono text-xs text-ouro-shadow",children:[n,"…"]})]})}function MN({agentName:n,view:a,focus:s,onFocusConsumed:o}){var S,T,j;const u=Qi(),[d,f]=w.useState(null),h=a.work,m=h.obligations,p=h.tasks;w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/coding`).then(f)},[n]);const y=(d==null?void 0:d.items)??[],b=new Map;for(const E of y){const C=E.obligationId;C&&(b.has(C)||b.set(C,[]),b.get(C).push(E))}return v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{children:[v.jsx(Df,{label:`Obligations (${m.openCount} open)`}),((S=m.items)==null?void 0:S.length)>0?v.jsx("div",{className:"mt-3 space-y-3",children:m.items.map(E=>{const C=b.get(E.id)??[];return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx(Yt,{color:E.status==="pending"?"yellow":E.status==="fulfilled"?"lime":"zinc",children:E.status}),v.jsx("span",{className:"text-sm font-medium text-ouro-bone",children:dn(E.content,120)})]}),E.origin&&v.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[v.jsx("span",{className:"text-ouro-shadow",children:"triggered from"}),v.jsxs("button",{onClick:()=>u({tab:"sessions",focus:`${E.origin.friendId}/${E.origin.channel}/${E.origin.key}`}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:[E.origin.friendId.slice(0,8),"…/",E.origin.channel,"/",E.origin.key]})]}),E.currentSurface&&v.jsxs("div",{className:"mt-1 text-xs text-ouro-mist",children:["surface: ",v.jsx("span",{className:"text-ouro-bone",children:E.currentSurface.kind})," — ",E.currentSurface.label]}),C.length>0&&v.jsxs("div",{className:"mt-2 space-y-1",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow",children:"Linked coding"}),C.map(A=>v.jsxs("div",{className:"flex items-center gap-2 rounded bg-ouro-moss/10 px-2 py-1 text-xs",children:[v.jsx(Yt,{color:A.status==="failed"?"red":A.status==="running"?"lime":"zinc",children:A.status}),v.jsxs("span",{className:"text-ouro-mist truncate",children:[A.runner," — ",A.workdir]})]},A.id))]}),E.nextAction&&v.jsxs("p",{className:"mt-1.5 text-xs text-ouro-mist",children:["Next: ",E.nextAction]}),v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow",children:Qe(E.updatedAt)})]},E.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No open obligations."})]}),v.jsxs("section",{children:[v.jsx(Df,{label:`Coding lanes (${y.length})`}),y.length>0?v.jsx("div",{className:"mt-3 space-y-2",children:y.map(E=>{const C=E.status,A=C==="failed",L=E.failure;return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{color:A?"red":C==="running"?"lime":C==="completed"?"zinc":"yellow",children:C}),v.jsx("span",{className:"text-sm font-medium text-ouro-bone",children:E.runner}),v.jsx("span",{className:"truncate text-xs text-ouro-shadow",children:E.workdir})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-2",children:[E.obligationId&&v.jsxs("button",{onClick:()=>u({tab:"work",focus:E.obligationId}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",E.obligationId.slice(0,20),"…"]}),E.taskRef&&v.jsxs("span",{className:"text-xs text-ouro-glow",children:["task: ",E.taskRef]}),E.originSession&&v.jsx("button",{onClick:()=>{const U=E.originSession;u({tab:"sessions",focus:`${U.friendId}/${U.channel}/${U.key}`})},className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:"origin session"})]}),E.checkpoint&&v.jsx("p",{className:"mt-1.5 text-xs text-ouro-mist",children:dn(E.checkpoint,100)}),v.jsxs("p",{className:"mt-1 text-xs text-ouro-shadow",children:["pid ",E.pid??"–"," · restarts ",E.restartCount," · ",Qe(E.lastActivityAt)]}),A&&L&&v.jsxs("div",{className:"mt-2 rounded bg-ouro-fang/5 p-2 text-xs ring-1 ring-ouro-fang/15",children:[v.jsx("span",{className:"font-semibold text-ouro-fang",children:"FAILURE:"})," ",v.jsxs("span",{className:"text-ouro-mist",children:[L.command," exited ",String(L.code??L.signal)]}),L.stderrTail&&v.jsx("pre",{className:"mt-1 max-h-20 overflow-y-auto font-mono text-[11px] text-ouro-shadow whitespace-pre-wrap",children:L.stderrTail})]})]},E.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No coding sessions."})]}),v.jsxs("section",{children:[v.jsx(Df,{label:`Tasks (${p.liveCount} live, ${p.blockedCount} blocked)`}),((T=p.liveTaskNames)==null?void 0:T.length)>0?v.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.liveTaskNames.map(E=>v.jsx(Yt,{children:E},E))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No live tasks."}),((j=p.actionRequired)==null?void 0:j.length)>0&&v.jsxs("div",{className:"mt-3",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-fang",children:"Action required"}),v.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:p.actionRequired.map(E=>v.jsx(Yt,{color:"red",children:E},E))})]})]})]})}function Df({label:n}){return v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n})}function DN({agentName:n,focus:a,onFocusConsumed:s}){const o=Qi(),[u,d]=w.useState(null),[f,h]=w.useState(null),[m,p]=w.useState(null);w.useEffect(()=>{const T=`/agents/${encodeURIComponent(n)}`;Promise.all([ge(`${T}/attention`).then(d),ge(`${T}/bridges`).then(h),ge(`${T}/friends`).then(p)])},[n]);const y=(u==null?void 0:u.queueItems)??[],b=(f==null?void 0:f.items)??[],S=(m==null?void 0:m.friends)??[];return v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{children:[v.jsx(zf,{label:`Who is waiting (${(u==null?void 0:u.queueLength)??0})`}),y.length>0?v.jsx("div",{className:"mt-3 space-y-2",children:y.map((T,j)=>v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:()=>o({tab:"sessions"}),className:"font-medium text-ouro-bone hover:text-ouro-glow transition-colors",children:T.friendName}),v.jsxs("span",{className:"text-xs text-ouro-shadow",children:["via ",T.channel]}),v.jsxs(Yt,{color:"yellow",children:["waiting ",Qe(new Date(T.timestamp).toISOString())]})]}),v.jsx("p",{className:"mt-1 text-sm text-ouro-mist",children:dn(T.delegatedContent,140)}),v.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-2 text-xs",children:[T.bridgeId&&v.jsxs("button",{onClick:()=>o({tab:"connections",focus:T.bridgeId}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["bridge: ",T.bridgeId.slice(0,12),"…"]}),T.obligationId&&v.jsxs("button",{onClick:()=>o({tab:"work",focus:T.obligationId}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",T.obligationId.slice(0,16),"…"]})]})]},j))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"Nobody waiting."})]}),v.jsxs("section",{children:[v.jsx(zf,{label:`Bridges (${(f==null?void 0:f.totalCount)??0})`}),b.length>0?v.jsx("div",{className:"mt-3 space-y-3",children:b.map(T=>{const j=T.attachedSessions??[],E=T.task,C=T.lifecycle==="active";return v.jsxs("div",{className:`rounded-lg px-3 py-3 ring-1 ${C?"bg-ouro-moss/10 ring-ouro-glow/12":"bg-ouro-void/40 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx(Yt,{color:C?"lime":"zinc",children:T.lifecycle}),v.jsx("p",{className:"font-medium text-ouro-bone",children:T.objective})]}),T.summary&&v.jsx("p",{className:"mt-1 text-sm text-ouro-mist",children:dn(T.summary,160)}),j.length>0&&v.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:j.map((A,L)=>v.jsxs("button",{onClick:()=>o({tab:"sessions",focus:`${A.friendId}/${A.channel}/${A.key}`}),className:"rounded-md bg-ouro-moss/10 px-2 py-0.5 font-mono text-[11px] text-ouro-glow ring-1 ring-ouro-moss/12 hover:ring-ouro-glow/25 transition-colors",children:[A.friendId,"/",A.channel,"/",A.key]},L))}),E&&v.jsxs("p",{className:"mt-1.5 text-xs",children:[v.jsxs("button",{onClick:()=>o({tab:"work"}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["task: ",E.taskName]}),v.jsxs("span",{className:"text-ouro-shadow",children:[" (",E.mode,")"]})]}),v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow",children:Qe(T.updatedAt)})]},T.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No bridges."})]}),v.jsxs("section",{children:[v.jsx(zf,{label:`Friends (${(m==null?void 0:m.totalFriends)??0})`}),S.length>0?v.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(T=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("button",{onClick:()=>o({tab:"sessions"}),className:"font-medium text-ouro-bone hover:text-ouro-glow transition-colors",children:T.friendName}),v.jsxs("p",{className:"text-xs text-ouro-shadow",children:[T.channels.join(", ")," · ",T.sessionCount," sessions",T.lastActivityAt&&v.jsxs(v.Fragment,{children:[" · ",Qe(T.lastActivityAt)]})]})]}),v.jsxs("div",{className:"shrink-0 text-right",children:[v.jsx("p",{className:"tabular-nums text-sm font-medium text-ouro-bone",children:T.totalTokens.toLocaleString()}),v.jsx("p",{className:"text-[10px] text-ouro-shadow",children:"tokens"})]})]},T.friendId))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No friends."})]})]})}function zf({label:n}){return v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n})}function zN({agentName:n,view:a}){var C;const s=Qi(),[o,u]=w.useState(null),[d,f]=w.useState(null),[h,m]=w.useState(!1),p=a.inner;w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/habits`).then(u)},[n]);function y(){if(d){m(!h);return}ge(`/agents/${encodeURIComponent(n)}/inner-transcript`).then(A=>{f(A),m(!0)})}const b=(o==null?void 0:o.items)??[],S=b.filter(A=>A.isOverdue),T=b.filter(A=>A.status==="active"&&!A.isOverdue),j=b.filter(A=>A.status==="paused"),E=b.find(A=>{var L;return((L=A.name)==null?void 0:L.toLowerCase())==="heartbeat"});return v.jsxs("div",{className:"space-y-8",children:[E&&v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Heartbeat"}),v.jsx("div",{className:`mt-2 rounded-xl p-4 ring-1 ${E.isOverdue?"bg-ouro-fang/5 ring-ouro-fang/15":"bg-ouro-moss/10 ring-ouro-glow/10"}`,children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${E.isOverdue?"bg-ouro-fang animate-pulse":"bg-ouro-glow"}`}),v.jsx("span",{className:"font-medium text-ouro-bone",children:E.isOverdue?"Overdue":"Healthy"}),v.jsxs("span",{className:"text-xs text-ouro-shadow",children:["every ",E.cadence," · last ",E.lastRun?Qe(E.lastRun):"never"]})]})})]}),v.jsx("section",{children:v.jsxs("div",{className:"rounded-xl bg-ouro-moss/15 p-4 ring-1 ring-ouro-glow/10",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"Inner work"}),v.jsx("p",{className:"mt-1 font-display text-xl italic font-semibold text-ouro-bone",children:p.status}),p.summary&&v.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ouro-mist",children:p.summary}),v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:p.hasPending?"Pending inner work queued.":"No pending inner work."}),p.mode==="deep"&&p.origin&&v.jsxs("div",{className:"mt-3",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow",children:"Triggered from"}),v.jsxs("button",{onClick:()=>{const A=p.origin;s({tab:"sessions",focus:`${A.friendId}/${A.channel}/${A.key}`})},className:"mt-1 text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:[(C=p.origin.friendId)==null?void 0:C.slice(0,8),"…/",p.origin.channel,"/",p.origin.key]}),p.obligationStatus&&v.jsxs("button",{onClick:()=>s({tab:"work"}),className:"ml-2 text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",p.obligationStatus]})]})]})}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Inner dialog ",d?`(${d.messages.length} total)`:""]}),d?v.jsx(ON,{messages:d.messages}):v.jsx("button",{onClick:y,className:"mt-2 w-full rounded-lg px-3 py-2.5 text-left font-mono text-xs text-ouro-glow ring-1 ring-ouro-moss/15 hover:ring-ouro-glow/20 transition-colors",children:"Load inner dialog"})]}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Habits (",(o==null?void 0:o.totalCount)??0,")"]}),S.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-fang mb-1.5",children:["Overdue (",S.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:S.map(A=>v.jsx(Of,{h:A},A.name))})]}),T.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow mb-1.5",children:["Running fine (",T.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:T.map(A=>v.jsx(Of,{h:A},A.name))})]}),j.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow mb-1.5",children:["Paused (",j.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:j.map(A=>v.jsx(Of,{h:A},A.name))})]}),b.length===0&&v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No habits configured."})]})]})}function ON({messages:n}){const a=n.filter(h=>h.role!=="system"&&h.role!=="tool"),[s,o]=w.useState(!1),u=w.useRef(null),d=s?a:a.slice(-30),f=a.length-d.length;return w.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[d.length]),v.jsxs("div",{ref:u,className:"mt-2 max-h-[60vh] overflow-y-auto rounded-lg bg-ouro-void/60 p-3 ring-1 ring-ouro-moss/15 space-y-1",children:[f>0&&v.jsxs("button",{onClick:()=>o(!0),className:"w-full rounded-lg px-3 py-2 text-center font-mono text-xs text-ouro-shadow hover:text-ouro-mist ring-1 ring-ouro-moss/10 hover:ring-ouro-moss/20 transition-colors mb-2",children:["Load ",f," earlier messages"]}),d.map(h=>{var m,p,y,b;if(h.role==="user"){const S=((m=h.content)==null?void 0:m.includes("[pending from"))||((p=h.content)==null?void 0:p.includes("[delegated")),T=((y=h.content)==null?void 0:y.includes("waking up"))||((b=h.content)==null?void 0:b.includes("world-state checkpoint"));return v.jsx("div",{className:"flex justify-start py-1",children:v.jsxs("div",{className:`max-w-[85%] rounded-2xl rounded-bl-sm px-3 py-2 ring-1 ${S?"bg-ouro-gold/8 ring-ouro-gold/15":T?"bg-ouro-moss/20 ring-ouro-moss/15":"bg-ouro-moss/25 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider",style:{color:S?"var(--color-ouro-gold)":"var(--color-ouro-shadow)"},children:S?"★ delegated":T?"heartbeat":"prompt"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:h.content})]})},h.index)}if(h.role==="assistant"){const S=(h.tool_calls??[]).map(zx),T=S.filter(C=>C.kind==="surface"),j=S.filter(C=>C.kind==="rest"),E=S.filter(C=>C.kind==="delegation");return v.jsxs("div",{children:[T.map(C=>v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-ouro-scale/15 px-3 py-2 ring-1 ring-ouro-scale/20",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow",children:"★ surfaced outward"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:C.deliveredText}),C.metadata&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["→ ",C.metadata]})]})},C.id)),E.length>0&&v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-gold/50",children:["— still thinking — #",h.index]}),j.length>0&&v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/40",children:["— resting — #",h.index]}),T.length===0&&j.length===0&&E.length===0&&h.content&&v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-ouro-glow/6 px-3 py-2 ring-1 ring-ouro-glow/8",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/50",children:"thinking"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-mist whitespace-pre-wrap break-words",children:h.content})]})})]},h.index)}return null})]})}function Of({h:n}){const a=n.isOverdue,s=n.isDegraded,o=n.status;return v.jsxs("div",{className:`rounded-lg px-3 py-2.5 ring-1 ${a?"bg-ouro-fang/5 ring-ouro-fang/15":s?"bg-ouro-gold/5 ring-ouro-gold/15":o==="paused"?"bg-ouro-void/30 ring-ouro-moss/10":"bg-ouro-void/40 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{color:a?"red":s?"yellow":o==="active"?"lime":"zinc",children:a?"overdue":s?"degraded":o}),v.jsx("span",{className:"font-medium text-ouro-bone",children:n.title})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 text-xs text-ouro-shadow",children:[n.cadence&&v.jsxs("span",{children:["every ",n.cadence]}),v.jsx("span",{children:n.lastRun?`last ${Qe(n.lastRun)}`:"never run"}),s&&n.degradedReason&&v.jsx("span",{className:"text-ouro-gold",children:n.degradedReason})]}),n.bodyExcerpt&&v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow/70",children:n.bodyExcerpt})]})}function RN({agentName:n}){const[a,s]=w.useState(null),[o,u]=w.useState("diary");if(w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/memory`).then(s)},[n]),!a)return v.jsxs("div",{className:"flex items-center gap-2 py-6",children:[v.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-ouro-glow"}),v.jsx("span",{className:"font-mono text-xs text-ouro-shadow",children:"Loading…"})]});const d=a.recentDiaryEntries??[],f=a.recentJournalEntries??[];return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("button",{onClick:()=>u("diary"),className:`font-mono text-xs uppercase tracking-wider transition-colors ${o==="diary"?"text-ouro-glow":"text-ouro-shadow hover:text-ouro-mist"}`,children:["Diary (",a.diaryEntryCount,")"]}),v.jsx("span",{className:"text-ouro-shadow/30",children:"|"}),v.jsxs("button",{onClick:()=>u("journal"),className:`font-mono text-xs uppercase tracking-wider transition-colors ${o==="journal"?"text-ouro-glow":"text-ouro-shadow hover:text-ouro-mist"}`,children:["Journal (",a.journalEntryCount,")"]})]}),o==="diary"&&v.jsx("div",{children:d.length>0?v.jsx("div",{className:"space-y-3",children:d.map(h=>v.jsxs("article",{className:"rounded-xl bg-ouro-void/40 px-4 py-3.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone",children:h.text}),v.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-ouro-shadow",children:[v.jsx(Yt,{children:h.source}),v.jsx("span",{children:Qe(h.createdAt)})]})]},h.id))}):v.jsx("p",{className:"text-sm text-ouro-shadow italic",children:"No diary entries yet. The agent hasn't written anything down."})}),o==="journal"&&v.jsx("div",{children:f.length>0?v.jsx("div",{className:"space-y-3",children:f.map(h=>v.jsxs("article",{className:"rounded-xl bg-ouro-void/40 px-4 py-3.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-medium text-ouro-bone",children:h.filename}),v.jsx("p",{className:"mt-1 text-sm leading-relaxed text-ouro-mist",children:h.preview})]},h.filename))}):v.jsx("p",{className:"text-sm text-ouro-shadow italic",children:"No journal entries yet."})})]})}function VN({agentName:n,view:a}){const[s,o]=w.useState(null),[u,d]=w.useState(null),f=a.agent,h=f.degraded,m=f.freshness;w.useEffect(()=>{Promise.all([ge("/machine/health").then(o).catch(()=>null),ge("/machine/logs").then(d).catch(()=>null)])},[n]);const p=(s==null?void 0:s.degradedComponents)??[],y=(u==null?void 0:u.entries)??[];return v.jsxs("div",{className:"space-y-8",children:[h.status==="degraded"&&h.issues.length>0&&v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-fang",children:["Agent issues (",h.issues.length,")"]}),v.jsx("div",{className:"mt-3 space-y-1.5",children:h.issues.map((b,S)=>v.jsxs("div",{className:"rounded-lg bg-ouro-fang/5 px-3 py-2.5 ring-1 ring-ouro-fang/15",children:[v.jsx("p",{className:"font-mono text-xs font-semibold text-ouro-fang",children:b.code}),v.jsx("p",{className:"mt-0.5 text-xs text-ouro-mist break-all",children:b.detail})]},S))})]}),v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Agent config"}),v.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[v.jsx(Hi,{label:"Provider",value:f.provider||"none"}),v.jsx(Hi,{label:"Enabled",value:f.enabled?"yes":"no"}),v.jsx(Hi,{label:"Freshness",value:`${m.status}${m.ageMs!=null?` (${Math.floor(m.ageMs/6e4)}m)`:""}`})]})]}),v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Daemon health"}),s&&s.status!=="unavailable"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[v.jsx(Hi,{label:"Status",value:s.status}),v.jsx(Hi,{label:"Mode",value:s.mode}),v.jsx(Hi,{label:"Uptime",value:`${Math.floor(s.uptimeSeconds/60)}m`})]}),p.length>0&&v.jsxs("div",{className:"mt-3 space-y-1.5",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-fang",children:"Degraded components"}),p.map((b,S)=>v.jsxs("div",{className:"rounded-lg bg-ouro-fang/5 px-3 py-2 ring-1 ring-ouro-fang/15",children:[v.jsx("p",{className:"text-xs font-semibold text-ouro-fang",children:b.component}),v.jsx("p",{className:"text-xs text-ouro-mist",children:b.reason})]},S))]})]}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No health file found. This is normal when not running under the daemon."})]}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Recent logs (",(u==null?void 0:u.totalLines)??0," total)"]}),y.length>0?v.jsx("div",{className:"mt-3 max-h-96 overflow-y-auto rounded-lg bg-ouro-void/40 ring-1 ring-ouro-moss/15",children:[...y].reverse().slice(0,50).map((b,S)=>{const T=b.level;return v.jsxs("div",{className:"border-b border-ouro-moss/10 px-3 py-1.5 last:border-b-0",children:[v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsx(Yt,{color:T==="error"?"red":T==="warn"?"yellow":"zinc",children:T}),v.jsx("span",{className:"text-ouro-shadow",children:Qe(b.ts)}),v.jsx("span",{className:"font-mono text-ouro-glow",children:b.event})]}),v.jsx("p",{className:"truncate text-xs text-ouro-mist",children:b.message})]},S)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No log entries."})]})]})}function Hi({label:n,value:a}){return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow",children:n}),v.jsx("p",{className:"mt-1 text-sm font-medium text-ouro-bone",children:a})]})}const Rf=[{id:"overview",label:"Overview"},{id:"sessions",label:"Sessions"},{id:"work",label:"Work"},{id:"connections",label:"Connections"},{id:"inner",label:"Inner"},{id:"memory",label:"Diary & Journal"},{id:"runtime",label:"Runtime"}];function LN(n){return n==="degraded"||n==="blocked"?"red":n==="stale"?"yellow":n==="active"?"lime":"zinc"}function _N({agentName:n,view:a,deskPrefs:s,initialRoute:o}){const[u,d]=w.useState((o==null?void 0:o.tab)??"overview"),[f,h]=w.useState(o==null?void 0:o.focus),m=w.useRef(!1);w.useEffect(()=>{(o==null?void 0:o.agent)===n&&!m.current?(m.current=!0,d(o.tab),h(o.focus)):(d("overview"),h(void 0))},[n]);const p=w.useCallback(j=>{d(j.tab),h(j.focus),window.history.pushState(null,"",Vf({agent:n,tab:j.tab,focus:j.focus}))},[n]),y=w.useCallback(j=>{d(j),h(void 0),window.history.pushState(null,"",Vf({agent:n,tab:j,focus:void 0}))},[n]),b=w.useCallback(()=>h(void 0),[]);if(!a||!n)return v.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[v.jsx("p",{className:"font-display text-2xl italic text-ouro-bone",children:"Choose an agent"}),v.jsx("p",{className:"mt-2 text-sm text-ouro-mist",children:"Select an agent from the sidebar to inspect its state."})]});const T=a.agent.attention;return v.jsx(Q0.Provider,{value:p,children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 pb-4 border-b border-ouro-moss/30",children:[v.jsx("div",{className:"min-w-0",children:v.jsx("h1",{className:"font-display text-2xl italic font-semibold text-ouro-bone sm:text-3xl",children:n})}),v.jsx(Yt,{color:LN(T.level),children:T.label})]}),v.jsx("nav",{className:"mt-4 flex gap-0.5 overflow-x-auto border-b border-ouro-moss/20 -mx-1",children:(()=>{const j=s==null?void 0:s.tabOrder;if(!j)return Rf;const E=j.map(A=>Rf.find(L=>L.id===A)).filter(A=>A!==void 0),C=Rf.filter(A=>!j.includes(A.id));return[...E,...C]})().map(j=>v.jsx("button",{type:"button",onClick:()=>y(j.id),className:`shrink-0 px-3 py-2 text-xs font-mono uppercase tracking-wider transition-colors rounded-t-md ${u===j.id?"bg-ouro-moss/20 text-ouro-glow border-b-2 border-ouro-glow":"text-ouro-shadow hover:text-ouro-mist hover:bg-ouro-moss/10"}`,children:j.label},j.id))}),v.jsxs("div",{className:"mt-6",children:[u==="overview"&&v.jsx(xN,{view:a,deskPrefs:s}),u==="sessions"&&v.jsx(wN,{agentName:n,focus:f,onFocusConsumed:b,deskPrefs:s}),u==="work"&&v.jsx(MN,{agentName:n,view:a,focus:f,onFocusConsumed:b}),u==="connections"&&v.jsx(DN,{agentName:n,focus:f,onFocusConsumed:b}),u==="inner"&&v.jsx(zN,{agentName:n,view:a}),u==="memory"&&v.jsx(RN,{agentName:n}),u==="runtime"&&v.jsx(VN,{agentName:n,view:a})]})]})})}function K0(){return J0(window.location.hash)}function UN(n){return n==="degraded"||n==="blocked"?"red":n==="stale"?"yellow":n==="active"?"lime":"zinc"}function kN(){var j,E;const[n,a]=w.useState(null),[s,o]=w.useState(((j=K0())==null?void 0:j.agent)??""),[u,d]=w.useState(null),f=w.useRef(0),h=w.useRef(K0()),m=w.useCallback(async()=>{var C;try{const A=await ge("/machine");if(a(A),!s&&A.agents.length>0){const L=((C=h.current)==null?void 0:C.agent)??A.agents[0].agentName;o(L)}}catch{}},[s]),[p,y]=w.useState(null),b=w.useCallback(async C=>{if(!C){d(null),y(null);return}try{const[A,L]=await Promise.all([ge(`/agents/${encodeURIComponent(C)}`),ge(`/agents/${encodeURIComponent(C)}/desk-prefs`)]);d(A),y(L)}catch{d(null),y(null)}},[]);w.useEffect(()=>{m()},[m]),w.useEffect(()=>{s&&b(s)},[s,b]),w.useEffect(()=>hT(()=>{const A=++f.current;m().then(()=>{f.current===A&&s&&b(s)})}),[m,b,s]),w.useEffect(()=>{const C=()=>{const A=J0(window.location.hash);A&&o(A.agent)};return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[]);const S=w.useCallback(C=>{o(C),window.history.pushState(null,"",Vf({agent:C,tab:"overview",focus:void 0}))},[]);if(!n)return v.jsx("div",{className:"flex h-screen items-center justify-center bg-ouro-void",children:v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"mx-auto mb-4 h-4 w-4 animate-pulse rounded-full bg-ouro-glow shadow-[0_0_20px_theme(--color-ouro-glow)]"}),v.jsx("p",{className:"font-mono text-sm text-ouro-mist",children:"Connecting to Outlook…"})]})});const T=n.overview.totals;return v.jsx(uN,{navbar:v.jsxs(aN,{children:[v.jsx(lN,{}),v.jsx(iN,{children:v.jsx(Id,{children:v.jsx(Yt,{color:n.overview.daemon.mode==="dev"?"yellow":"lime",children:n.overview.daemon.mode})})})]}),sidebar:v.jsxs(cN,{className:"bg-ouro-deep",children:[v.jsx(fN,{className:"border-ouro-moss/30",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"h-3 w-3 shrink-0 rounded-full bg-ouro-glow shadow-[0_0_16px_theme(--color-ouro-glow)]"}),v.jsx("div",{className:"min-w-0",children:v.jsx("p",{className:"truncate font-display text-lg italic font-semibold text-ouro-bone",children:"Ouro Outlook"})})]})}),v.jsxs(dN,{className:"[&>[data-slot=section]+[data-slot=section]]:mt-4",children:[v.jsxs(Y0,{children:[v.jsx(q0,{className:"text-ouro-mist/60",children:"Machine"}),v.jsx("div",{className:"grid grid-cols-3 gap-1.5 px-2",children:[{v:T.liveTasks??0,l:"Tasks",alert:(T.blockedTasks??0)>0},{v:T.openObligations??0,l:"Oblig."},{v:T.activeCodingAgents??0,l:"Coding"}].map(C=>v.jsxs("div",{className:"rounded-md bg-ouro-void/60 px-2 py-1.5 text-center ring-1 ring-ouro-moss/20",children:[v.jsx("div",{className:`text-base font-semibold tabular-nums ${C.alert?"text-ouro-fang":"text-ouro-bone"}`,children:C.v}),v.jsx("div",{className:"text-[9px] uppercase tracking-widest text-ouro-shadow",children:C.l})]},C.l))})]}),v.jsxs(Y0,{children:[v.jsx(q0,{className:"text-ouro-mist/60",children:"Agents"}),n.agents.map(C=>v.jsx(mN,{current:C.agentName===s,onClick:()=>S(C.agentName),children:v.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx(pN,{className:"text-ouro-bone",children:C.agentName}),v.jsxs("p",{className:"truncate text-xs text-ouro-shadow",children:[C.tasks.liveCount,"t · ",C.obligations.openCount,"o · ",C.coding.activeCount,"c"]})]}),v.jsx(Yt,{color:UN(C.attention.level),children:C.attention.label})]})},C.agentName))]})]}),v.jsx(hN,{className:"border-ouro-moss/30",children:v.jsxs("div",{className:"px-2 text-xs text-ouro-shadow",children:[v.jsx("p",{className:"font-mono",children:n.overview.runtime.version}),v.jsxs("p",{className:"mt-0.5",children:[n.overview.daemon.mode," · ",n.overview.freshness.status]})]})}),s&&u&&v.jsx("div",{className:"px-4 py-2 border-t border-ouro-moss/20",children:v.jsx("p",{className:"text-xs italic text-ouro-shadow/70",children:(()=>{var X;const C=p==null?void 0:p.statusLine;if(C)return C;const A=u==null?void 0:u.inner;if((A==null?void 0:A.status)==="working"||A!=null&&A.hasPending)return"thinking through something privately";const U=u==null?void 0:u.work,Y=((X=U==null?void 0:U.obligations)==null?void 0:X.openCount)??0;return Y>2?"a few loose ends":Y>0?"carrying something":"steady"})()})})]}),children:v.jsx(_N,{agentName:s,view:u,deskPrefs:p,initialRoute:((E=h.current)==null?void 0:E.agent)===s?h.current:void 0})})}dT.createRoot(document.getElementById("app")).render(v.jsx(w.StrictMode,{children:v.jsx(kN,{})}));
|
|
61
|
+
`)),[]});var W2=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(W2||{});function I2(n){let a={};for(let s in n)n[s]===!0&&(a[`data-${s}`]="");return a}function tw(n,a,s,o){let[u,d]=w.useState(s),{hasFlag:f,addFlag:h,removeFlag:m}=J2(n&&u?3:0),p=w.useRef(!1),y=w.useRef(!1),b=gs();return Ee(()=>{var S;if(n){if(s&&d(!0),!a){s&&h(3);return}return(S=o==null?void 0:o.start)==null||S.call(o,s),ew(a,{inFlight:p,prepare(){y.current?y.current=!1:y.current=p.current,p.current=!0,!y.current&&(s?(h(3),m(4)):(h(4),m(2)))},run(){y.current?s?(m(3),h(4)):(m(4),h(3)):s?m(1):h(1)},done(){var T;y.current&&iw(a)||(p.current=!1,m(7),s||d(!1),(T=o==null?void 0:o.end)==null||T.call(o,s))}})}},[n,s,a,b]),n?[u,{closed:f(1),enter:f(2),leave:f(4),transition:f(2)||f(4)}]:[s,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ew(n,{prepare:a,run:s,done:o,inFlight:u}){let d=kn();return aw(n,{prepare:a,inFlight:u}),d.nextFrame(()=>{s(),d.requestAnimationFrame(()=>{d.add(nw(n,o))})}),d.dispose}function nw(n,a){var s,o;let u=kn();if(!n)return u.dispose;let d=!1;u.add(()=>{d=!0});let f=(o=(s=n.getAnimations)==null?void 0:s.call(n).filter(h=>h instanceof CSSTransition))!=null?o:[];return f.length===0?(a(),u.dispose):(Promise.allSettled(f.map(h=>h.finished)).then(()=>{d||a()}),u.dispose)}function aw(n,{inFlight:a,prepare:s}){if(a!=null&&a.current){s();return}let o=n.style.transition;n.style.transition="none",s(),n.offsetHeight,n.style.transition=o}function iw(n){var a,s;return((s=(a=n.getAnimations)==null?void 0:a.call(n))!=null?s:[]).some(o=>o instanceof CSSTransition&&o.playState!=="finished")}function Td(n,a){let s=w.useRef([]),o=jt(n);w.useEffect(()=>{let u=[...s.current];for(let[d,f]of a.entries())if(s.current[d]!==f){let h=o(a,u);return s.current=a,h}},[o,...a])}let Er=w.createContext(null);Er.displayName="OpenClosedContext";var nn=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(nn||{});function Ar(){return w.useContext(Er)}function lw({value:n,children:a}){return st.createElement(Er.Provider,{value:n},a)}function sw({children:n}){return st.createElement(Er.Provider,{value:null},n)}function ow(n){function a(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",a))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",a),a())}let da=[];ow(()=>{function n(a){if(!ma(a.target)||a.target===document.body||da[0]===a.target)return;let s=a.target;s=s.closest(cr),da.unshift(s??a.target),da=da.filter(o=>o!=null&&o.isConnected),da.splice(10)}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function Ny(n){let a=jt(n),s=w.useRef(!1);w.useEffect(()=>(s.current=!1,()=>{s.current=!0,wr(()=>{s.current&&a()})}),[a])}let Cy=w.createContext(!1);function rw(){return w.useContext(Cy)}function Av(n){return st.createElement(Cy.Provider,{value:n.force},n.children)}function uw(n){let a=rw(),s=w.useContext(Dy),[o,u]=w.useState(()=>{var d;if(!a&&s!==null)return(d=s.current)!=null?d:null;if(hn.isServer)return null;let f=n==null?void 0:n.getElementById("headlessui-portal-root");if(f)return f;if(n===null)return null;let h=n.createElement("div");return h.setAttribute("id","headlessui-portal-root"),n.body.appendChild(h)});return w.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),w.useEffect(()=>{a||s!==null&&u(s.current)},[s,u,a]),o}let My=w.Fragment,cw=ce(function(n,a){let{ownerDocument:s=null,...o}=n,u=w.useRef(null),d=gn(r2(S=>{u.current=S}),a),f=Sd(u.current),h=s??f,m=uw(h),p=w.useContext(Xf),y=gs(),b=Ae();return Ny(()=>{var S;m&&m.childNodes.length<=0&&((S=m.parentElement)==null||S.removeChild(m))}),m?MT.createPortal(st.createElement("div",{"data-headlessui-portal":"",ref:S=>{y.dispose(),p&&S&&y.add(p.register(S))}},b({ourProps:{ref:d},theirProps:o,slot:{},defaultTag:My,name:"Portal"})),m):null});function fw(n,a){let s=gn(a),{enabled:o=!0,ownerDocument:u,...d}=n,f=Ae();return o?st.createElement(cw,{...d,ownerDocument:u,ref:s}):f({ourProps:{ref:s},theirProps:d,slot:{},defaultTag:My,name:"Portal"})}let dw=w.Fragment,Dy=w.createContext(null);function hw(n,a){let{target:s,...o}=n,u={ref:gn(a)},d=Ae();return st.createElement(Dy.Provider,{value:s},d({ourProps:u,theirProps:o,defaultTag:dw,name:"Popover.Group"}))}let Xf=w.createContext(null);function mw(){let n=w.useContext(Xf),a=w.useRef([]),s=jt(d=>(a.current.push(d),n&&n.register(d),()=>o(d))),o=jt(d=>{let f=a.current.indexOf(d);f!==-1&&a.current.splice(f,1),n&&n.unregister(d)}),u=w.useMemo(()=>({register:s,unregister:o,portals:a}),[s,o,a]);return[a,w.useMemo(()=>function({children:d}){return st.createElement(Xf.Provider,{value:u},d)},[u])]}let pw=ce(fw),zy=ce(hw),gw=Object.assign(pw,{Group:zy}),vw=w.Fragment;function yw(n,a){let{...s}=n,o=!1,{isFocusVisible:u,focusProps:d}=oy(),{isHovered:f,hoverProps:h}=sy({isDisabled:o}),{pressed:m,pressProps:p}=uy({disabled:o}),y=bd({ref:a},d,h,p),b=ei({hover:f,focus:u,active:m});return Ae()({ourProps:y,theirProps:s,slot:b,defaultTag:vw,name:"DataInteractive"})}let bw=ce(yw);function xw(n,a=typeof document<"u"?document.defaultView:null,s){let o=ys(n,"escape");jy(a,"keydown",u=>{o&&(u.defaultPrevented||u.key===my.Escape&&s(u))})}function Sw(){var n;let[a]=w.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[s,o]=w.useState((n=a==null?void 0:a.matches)!=null?n:!1);return Ee(()=>{if(!a)return;function u(d){o(d.matches)}return a.addEventListener("change",u),()=>a.removeEventListener("change",u)},[a]),s}function Tw({defaultContainers:n=[],portals:a,mainTreeNode:s}={}){let o=jt(()=>{var u,d;let f=Pi(s),h=[];for(let m of n)m!==null&&(ga(m)?h.push(m):"current"in m&&ga(m.current)&&h.push(m.current));if(a!=null&&a.current)for(let m of a.current)h.push(m);for(let m of(u=f==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?u:[])m!==document.body&&m!==document.head&&ga(m)&&m.id!=="headlessui-portal-root"&&(s&&(m.contains(s)||m.contains((d=s==null?void 0:s.getRootNode())==null?void 0:d.host))||h.some(p=>m.contains(p))||h.push(m));return h});return{resolveContainers:o,contains:jt(u=>o().some(d=>d.contains(u)))}}let Oy=w.createContext(null);function jv({children:n,node:a}){let[s,o]=w.useState(null),u=Ry(a??s);return st.createElement(Oy.Provider,{value:u},n,u===null&&st.createElement(Gf,{features:ur.Hidden,ref:d=>{var f,h;if(d){for(let m of(h=(f=Pi(d))==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?h:[])if(m!==document.body&&m!==document.head&&ga(m)&&m!=null&&m.contains(d)){o(m);break}}}}))}function Ry(n=null){var a;return(a=w.useContext(Oy))!=null?a:n}function ww(){let n=typeof document>"u";return"useSyncExternalStore"in lv?(a=>a.useSyncExternalStore)(lv)(()=>()=>{},()=>!1,()=>!n):!1}function jr(){let n=ww(),[a,s]=w.useState(hn.isHandoffComplete);return a&&hn.isHandoffComplete===!1&&s(!1),w.useEffect(()=>{a!==!0&&s(!0)},[a]),w.useEffect(()=>hn.handoff(),[]),n?!1:a}function wd(){let n=w.useRef(!1);return Ee(()=>(n.current=!0,()=>{n.current=!1}),[]),n}var ts=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(ts||{});function Ew(){let n=w.useRef(0);return Ay(!0,"keydown",a=>{a.key==="Tab"&&(n.current=a.shiftKey?1:0)},!0),n}function Vy(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let a=new Set;for(let s of n.current)ga(s.current)&&a.add(s.current);return a}let Aw="div";var qa=(n=>(n[n.None=0]="None",n[n.InitialFocus=1]="InitialFocus",n[n.TabLock=2]="TabLock",n[n.FocusLock=4]="FocusLock",n[n.RestoreFocus=8]="RestoreFocus",n[n.AutoFocus=16]="AutoFocus",n))(qa||{});function jw(n,a){let s=w.useRef(null),o=gn(s,a),{initialFocus:u,initialFocusFallback:d,containers:f,features:h=15,...m}=n;jr()||(h=0);let p=Sd(s.current);Dw(h,{ownerDocument:p});let y=zw(h,{ownerDocument:p,container:s,initialFocus:u,initialFocusFallback:d});Ow(h,{ownerDocument:p,container:s,containers:f,previousActiveElement:y});let b=Ew(),S=jt(L=>{if(!Ia(s.current))return;let U=s.current;(Y=>Y())(()=>{Un(b.current,{[ts.Forwards]:()=>{ls(U,Ln.First,{skipElements:[L.relatedTarget,d]})},[ts.Backwards]:()=>{ls(U,Ln.Last,{skipElements:[L.relatedTarget,d]})}})})}),T=ys(!!(h&2),"focus-trap#tab-lock"),j=gs(),E=w.useRef(!1),C={ref:o,onKeyDown(L){L.key=="Tab"&&(E.current=!0,j.requestAnimationFrame(()=>{E.current=!1}))},onBlur(L){if(!(h&4))return;let U=Vy(f);Ia(s.current)&&U.add(s.current);let Y=L.relatedTarget;ma(Y)&&Y.dataset.headlessuiFocusGuard!=="true"&&(Ly(U,Y)||(E.current?ls(s.current,Un(b.current,{[ts.Forwards]:()=>Ln.Next,[ts.Backwards]:()=>Ln.Previous})|Ln.WrapAround,{relativeTo:L.target}):ma(L.target)&&_n(L.target)))}},A=Ae();return st.createElement(st.Fragment,null,T&&st.createElement(Gf,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:S,features:ur.Focusable}),A({ourProps:C,theirProps:m,defaultTag:Aw,name:"FocusTrap"}),T&&st.createElement(Gf,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:S,features:ur.Focusable}))}let Nw=ce(jw),Cw=Object.assign(Nw,{features:qa});function Mw(n=!0){let a=w.useRef(da.slice());return Td(([s],[o])=>{o===!0&&s===!1&&wr(()=>{a.current.splice(0)}),o===!1&&s===!0&&(a.current=da.slice())},[n,da,a]),jt(()=>{var s;return(s=a.current.find(o=>o!=null&&o.isConnected))!=null?s:null})}function Dw(n,{ownerDocument:a}){let s=!!(n&8),o=Mw(s);Td(()=>{s||XT(a==null?void 0:a.body)&&_n(o())},[s]),Ny(()=>{s&&_n(o())})}function zw(n,{ownerDocument:a,container:s,initialFocus:o,initialFocusFallback:u}){let d=w.useRef(null),f=ys(!!(n&1),"focus-trap#initial-focus"),h=wd();return Td(()=>{if(n===0)return;if(!f){u!=null&&u.current&&_n(u.current);return}let m=s.current;m&&wr(()=>{if(!h.current)return;let p=a==null?void 0:a.activeElement;if(o!=null&&o.current){if((o==null?void 0:o.current)===p){d.current=p;return}}else if(m.contains(p)){d.current=p;return}if(o!=null&&o.current)_n(o.current);else{if(n&16){if(ls(m,Ln.First|Ln.AutoFocus)!==qf.Error)return}else if(ls(m,Ln.First)!==qf.Error)return;if(u!=null&&u.current&&(_n(u.current),(a==null?void 0:a.activeElement)===u.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}d.current=a==null?void 0:a.activeElement})},[u,f,n]),d}function Ow(n,{ownerDocument:a,container:s,containers:o,previousActiveElement:u}){let d=wd(),f=!!(n&4);jy(a==null?void 0:a.defaultView,"focus",h=>{if(!f||!d.current)return;let m=Vy(o);Ia(s.current)&&m.add(s.current);let p=u.current;if(!p)return;let y=h.target;Ia(y)?Ly(m,y)?(u.current=y,_n(y)):(h.preventDefault(),h.stopPropagation(),_n(p)):_n(u.current)},!0)}function Ly(n,a){for(let s of n)if(s.contains(a))return!0;return!1}function _y(n){var a;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||!as((a=n.as)!=null?a:ky)||st.Children.count(n.children)===1}let Nr=w.createContext(null);Nr.displayName="TransitionContext";var Rw=(n=>(n.Visible="visible",n.Hidden="hidden",n))(Rw||{});function Vw(){let n=w.useContext(Nr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function Lw(){let n=w.useContext(Cr);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Cr=w.createContext(null);Cr.displayName="NestingContext";function Mr(n){return"children"in n?Mr(n.children):n.current.filter(({el:a})=>a.current!==null).filter(({state:a})=>a==="visible").length>0}function Uy(n,a){let s=ti(n),o=w.useRef([]),u=wd(),d=gs(),f=jt((T,j=ha.Hidden)=>{let E=o.current.findIndex(({el:C})=>C===T);E!==-1&&(Un(j,{[ha.Unmount](){o.current.splice(E,1)},[ha.Hidden](){o.current[E].state="hidden"}}),d.microTask(()=>{var C;!Mr(o)&&u.current&&((C=s.current)==null||C.call(s))}))}),h=jt(T=>{let j=o.current.find(({el:E})=>E===T);return j?j.state!=="visible"&&(j.state="visible"):o.current.push({el:T,state:"visible"}),()=>f(T,ha.Unmount)}),m=w.useRef([]),p=w.useRef(Promise.resolve()),y=w.useRef({enter:[],leave:[]}),b=jt((T,j,E)=>{m.current.splice(0),a&&(a.chains.current[j]=a.chains.current[j].filter(([C])=>C!==T)),a==null||a.chains.current[j].push([T,new Promise(C=>{m.current.push(C)})]),a==null||a.chains.current[j].push([T,new Promise(C=>{Promise.all(y.current[j].map(([A,L])=>L)).then(()=>C())})]),j==="enter"?p.current=p.current.then(()=>a==null?void 0:a.wait.current).then(()=>E(j)):E(j)}),S=jt((T,j,E)=>{Promise.all(y.current[j].splice(0).map(([C,A])=>A)).then(()=>{var C;(C=m.current.shift())==null||C()}).then(()=>E(j))});return w.useMemo(()=>({children:o,register:h,unregister:f,onStart:b,onStop:S,wait:p,chains:y}),[h,f,o,b,S,y,p])}let ky=w.Fragment,By=rr.RenderStrategy;function _w(n,a){var s,o;let{transition:u=!0,beforeEnter:d,afterEnter:f,beforeLeave:h,afterLeave:m,enter:p,enterFrom:y,enterTo:b,entered:S,leave:T,leaveFrom:j,leaveTo:E,...C}=n,[A,L]=w.useState(null),U=w.useRef(null),Y=_y(n),X=gn(...Y?[U,a,L]:a===null?[]:[a]),tt=(s=C.unmount)==null||s?ha.Unmount:ha.Hidden,{show:Z,appear:nt,initial:xt}=Vw(),[J,ft]=w.useState(Z?"visible":"hidden"),vt=Lw(),{register:Ot,unregister:Nt}=vt;Ee(()=>Ot(U),[Ot,U]),Ee(()=>{if(tt===ha.Hidden&&U.current){if(Z&&J!=="visible"){ft("visible");return}return Un(J,{hidden:()=>Nt(U),visible:()=>Ot(U)})}},[J,U,Ot,Nt,Z,tt]);let Rt=jr();Ee(()=>{if(Y&&Rt&&J==="visible"&&U.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[U,J,Rt,Y]);let k=xt&&!nt,K=nt&&Z&&xt,F=w.useRef(!1),it=Uy(()=>{F.current||(ft("hidden"),Nt(U))},vt),ct=jt(bt=>{F.current=!0;let Ft=bt?"enter":"leave";it.onStart(U,Ft,Vt=>{Vt==="enter"?d==null||d():Vt==="leave"&&(h==null||h())})}),M=jt(bt=>{let Ft=bt?"enter":"leave";F.current=!1,it.onStop(U,Ft,Vt=>{Vt==="enter"?f==null||f():Vt==="leave"&&(m==null||m())}),Ft==="leave"&&!Mr(it)&&(ft("hidden"),Nt(U))});w.useEffect(()=>{Y&&u||(ct(Z),M(Z))},[Z,Y,u]);let $=!(!u||!Y||!Rt||k),[,q]=tw($,A,Z,{start:ct,end:M}),Q=Ga({ref:X,className:((o=$f(C.className,K&&p,K&&y,q.enter&&p,q.enter&&q.closed&&y,q.enter&&!q.closed&&b,q.leave&&T,q.leave&&!q.closed&&j,q.leave&&q.closed&&E,!q.transition&&Z&&S))==null?void 0:o.trim())||void 0,...I2(q)}),lt=0;J==="visible"&&(lt|=nn.Open),J==="hidden"&&(lt|=nn.Closed),Z&&J==="hidden"&&(lt|=nn.Opening),!Z&&J==="visible"&&(lt|=nn.Closing);let dt=Ae();return st.createElement(Cr.Provider,{value:it},st.createElement(lw,{value:lt},dt({ourProps:Q,theirProps:C,defaultTag:ky,features:By,visible:J==="visible",name:"Transition.Child"})))}function Uw(n,a){let{show:s,appear:o=!1,unmount:u=!0,...d}=n,f=w.useRef(null),h=_y(n),m=gn(...h?[f,a]:a===null?[]:[a]);jr();let p=Ar();if(s===void 0&&p!==null&&(s=(p&nn.Open)===nn.Open),s===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[y,b]=w.useState(s?"visible":"hidden"),S=Uy(()=>{s||b("hidden")}),[T,j]=w.useState(!0),E=w.useRef([s]);Ee(()=>{T!==!1&&E.current[E.current.length-1]!==s&&(E.current.push(s),j(!1))},[E,s]);let C=w.useMemo(()=>({show:s,appear:o,initial:T}),[s,o,T]);Ee(()=>{s?b("visible"):!Mr(S)&&f.current!==null&&b("hidden")},[s,S]);let A={unmount:u},L=jt(()=>{var X;T&&j(!1),(X=n.beforeEnter)==null||X.call(n)}),U=jt(()=>{var X;T&&j(!1),(X=n.beforeLeave)==null||X.call(n)}),Y=Ae();return st.createElement(Cr.Provider,{value:S},st.createElement(Nr.Provider,{value:C},Y({ourProps:{...A,as:w.Fragment,children:st.createElement(Hy,{ref:m,...A,...d,beforeEnter:L,beforeLeave:U})},theirProps:{},defaultTag:w.Fragment,features:By,visible:y==="visible",name:"Transition"})))}function kw(n,a){let s=w.useContext(Nr)!==null,o=Ar()!==null;return st.createElement(st.Fragment,null,!s&&o?st.createElement(Kf,{ref:a,...n}):st.createElement(Hy,{ref:a,...n}))}let Kf=ce(Uw),Hy=ce(_w),Ed=ce(kw),Bw=Object.assign(Kf,{Child:Ed,Root:Kf});var Hw=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Hw||{}),$w=(n=>(n[n.SetTitleId=0]="SetTitleId",n))($w||{});let Gw={0(n,a){return n.titleId===a.id?n:{...n,titleId:a.id}}},Ad=w.createContext(null);Ad.displayName="DialogContext";function Dr(n){let a=w.useContext(Ad);if(a===null){let s=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,Dr),s}return a}function Yw(n,a){return Un(a.type,Gw,n,a)}let Nv=ce(function(n,a){let s=w.useId(),{id:o=`headlessui-dialog-${s}`,open:u,onClose:d,initialFocus:f,role:h="dialog",autoFocus:m=!0,__demoMode:p=!1,unmount:y=!1,...b}=n,S=w.useRef(!1);h=(function(){return h==="dialog"||h==="alertdialog"?h:(S.current||(S.current=!0,console.warn(`Invalid role [${h}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let T=Ar();u===void 0&&T!==null&&(u=(T&nn.Open)===nn.Open);let j=w.useRef(null),E=gn(j,a),C=Sd(j.current),A=u?0:1,[L,U]=w.useReducer(Yw,{titleId:null,descriptionId:null,panelRef:w.createRef()}),Y=jt(()=>d(!1)),X=jt(q=>U({type:0,id:q})),tt=jr()?A===0:!1,[Z,nt]=mw(),xt={get current(){var q;return(q=L.panelRef.current)!=null?q:j.current}},J=Ry(),{resolveContainers:ft}=Tw({mainTreeNode:J,portals:Z,defaultContainers:[xt]}),vt=T!==null?(T&nn.Closing)===nn.Closing:!1;D2(p||vt?!1:tt,{allowed:jt(()=>{var q,Q;return[(Q=(q=j.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Q:null]}),disallowed:jt(()=>{var q;return[(q=J==null?void 0:J.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})});let Ot=Sy.get(null);Ee(()=>{if(tt)return Ot.actions.push(o),()=>Ot.actions.pop(o)},[Ot,o,tt]);let Nt=Ty(Ot,w.useCallback(q=>Ot.selectors.isTop(q,o),[Ot,o]));G2(Nt,ft,q=>{q.preventDefault(),Y()}),xw(Nt,C==null?void 0:C.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),Y()}),Q2(p||vt?!1:tt,C,ft),z2(tt,j,Y);let[Rt,k]=u2(),K=w.useMemo(()=>[{dialogState:A,close:Y,setTitleId:X,unmount:y},L],[A,Y,X,y,L]),F=ei({open:A===0}),it={ref:E,id:o,role:h,tabIndex:-1,"aria-modal":p?void 0:A===0?!0:void 0,"aria-labelledby":L.titleId,"aria-describedby":Rt,unmount:y},ct=!Sw(),M=qa.None;tt&&!p&&(M|=qa.RestoreFocus,M|=qa.TabLock,m&&(M|=qa.AutoFocus),ct&&(M|=qa.InitialFocus));let $=Ae();return st.createElement(sw,null,st.createElement(Av,{force:!0},st.createElement(gw,null,st.createElement(Ad.Provider,{value:K},st.createElement(zy,{target:j},st.createElement(Av,{force:!1},st.createElement(k,{slot:F},st.createElement(nt,null,st.createElement(Cw,{initialFocus:f,initialFocusFallback:j,containers:ft,features:M},st.createElement(p2,{value:Y},$({ourProps:it,theirProps:b,slot:F,defaultTag:qw,features:Xw,visible:A===0,name:"Dialog"})))))))))))}),qw="div",Xw=rr.RenderStrategy|rr.Static;function Kw(n,a){let{transition:s=!1,open:o,...u}=n,d=Ar(),f=n.hasOwnProperty("open")||d!==null,h=n.hasOwnProperty("onClose");if(!f&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!f)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!h)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!d&&typeof n.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n.open}`);if(typeof n.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n.onClose}`);return(o!==void 0||s)&&!u.static?st.createElement(jv,null,st.createElement(Bw,{show:o,transition:s,unmount:u.unmount},st.createElement(Nv,{ref:a,...u}))):st.createElement(jv,null,st.createElement(Nv,{ref:a,open:o,...u}))}let Fw="div";function Zw(n,a){let s=w.useId(),{id:o=`headlessui-dialog-panel-${s}`,transition:u=!1,...d}=n,[{dialogState:f,unmount:h},m]=Dr("Dialog.Panel"),p=gn(a,m.panelRef),y=ei({open:f===0}),b=jt(C=>{C.stopPropagation()}),S={ref:p,id:o,onClick:b},T=u?Ed:w.Fragment,j=u?{unmount:h}:{},E=Ae();return st.createElement(T,{...j},E({ourProps:S,theirProps:d,slot:y,defaultTag:Fw,name:"Dialog.Panel"}))}let Qw="div";function Jw(n,a){let{transition:s=!1,...o}=n,[{dialogState:u,unmount:d}]=Dr("Dialog.Backdrop"),f=ei({open:u===0}),h={ref:a,"aria-hidden":!0},m=s?Ed:w.Fragment,p=s?{unmount:d}:{},y=Ae();return st.createElement(m,{...p},y({ourProps:h,theirProps:o,slot:f,defaultTag:Qw,name:"Dialog.Backdrop"}))}let Pw="h2";function Ww(n,a){let s=w.useId(),{id:o=`headlessui-dialog-title-${s}`,...u}=n,[{dialogState:d,setTitleId:f}]=Dr("Dialog.Title"),h=gn(a);w.useEffect(()=>(f(o),()=>f(null)),[o,f]);let m=ei({open:d===0}),p={ref:h,id:o};return Ae()({ourProps:p,theirProps:u,slot:m,defaultTag:Pw,name:"Dialog.Title"})}let Iw=ce(Kw),$y=ce(Zw),tE=ce(Jw),eE=ce(Ww),nE=Object.assign(Iw,{Panel:$y,Title:eE,Description:h2});const fr=w.createContext({});function aE(n){const a=w.useRef(null);return a.current===null&&(a.current=n()),a.current}const iE=typeof window<"u",Gy=iE?w.useLayoutEffect:w.useEffect,jd=w.createContext(null);function Nd(n,a){n.indexOf(a)===-1&&n.push(a)}function dr(n,a){const s=n.indexOf(a);s>-1&&n.splice(s,1)}const pn=(n,a,s)=>s>a?a:s<n?n:s;let Cd=()=>{};const va={},Yy=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function qy(n){return typeof n=="object"&&n!==null}const Xy=n=>/^0[^.\s]+$/u.test(n);function Ky(n){let a;return()=>(a===void 0&&(a=n()),a)}const Je=n=>n,lE=(n,a)=>s=>a(n(s)),bs=(...n)=>n.reduce(lE),fs=(n,a,s)=>{const o=a-n;return o===0?1:(s-n)/o};class Md{constructor(){this.subscriptions=[]}add(a){return Nd(this.subscriptions,a),()=>dr(this.subscriptions,a)}notify(a,s,o){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](a,s,o);else for(let d=0;d<u;d++){const f=this.subscriptions[d];f&&f(a,s,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=n=>n*1e3,Ze=n=>n/1e3;function Fy(n,a){return a?n*(1e3/a):0}const Zy=(n,a,s)=>(((1-3*s+3*a)*n+(3*s-6*a))*n+3*a)*n,sE=1e-7,oE=12;function rE(n,a,s,o,u){let d,f,h=0;do f=a+(s-a)/2,d=Zy(f,o,u)-n,d>0?s=f:a=f;while(Math.abs(d)>sE&&++h<oE);return f}function xs(n,a,s,o){if(n===a&&s===o)return Je;const u=d=>rE(d,0,1,n,s);return d=>d===0||d===1?d:Zy(u(d),a,o)}const Qy=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Jy=n=>a=>1-n(1-a),Py=xs(.33,1.53,.69,.99),Dd=Jy(Py),Wy=Qy(Dd),Iy=n=>n>=1?1:(n*=2)<1?.5*Dd(n):.5*(2-Math.pow(2,-10*(n-1))),zd=n=>1-Math.sin(Math.acos(n)),tb=Jy(zd),eb=Qy(zd),uE=xs(.42,0,1,1),cE=xs(0,0,.58,1),nb=xs(.42,0,.58,1),fE=n=>Array.isArray(n)&&typeof n[0]!="number",ab=n=>Array.isArray(n)&&typeof n[0]=="number",dE={linear:Je,easeIn:uE,easeInOut:nb,easeOut:cE,circIn:zd,circInOut:eb,circOut:tb,backIn:Dd,backInOut:Wy,backOut:Py,anticipate:Iy},hE=n=>typeof n=="string",Cv=n=>{if(ab(n)){Cd(n.length===4);const[a,s,o,u]=n;return xs(a,s,o,u)}else if(hE(n))return dE[n];return n},Ko=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mE(n,a){let s=new Set,o=new Set,u=!1,d=!1;const f=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(y){f.has(y)&&(p.schedule(y),n()),y(h)}const p={schedule:(y,b=!1,S=!1)=>{const j=S&&u?s:o;return b&&f.add(y),j.add(y),y},cancel:y=>{o.delete(y),f.delete(y)},process:y=>{if(h=y,u){d=!0;return}u=!0;const b=s;s=o,o=b,s.forEach(m),s.clear(),u=!1,d&&(d=!1,p.process(y))}};return p}const pE=40;function ib(n,a){let s=!1,o=!0;const u={delta:0,timestamp:0,isProcessing:!1},d=()=>s=!0,f=Ko.reduce((U,Y)=>(U[Y]=mE(d),U),{}),{setup:h,read:m,resolveKeyframes:p,preUpdate:y,update:b,preRender:S,render:T,postRender:j}=f,E=()=>{const U=va.useManualTiming,Y=U?u.timestamp:performance.now();s=!1,U||(u.delta=o?1e3/60:Math.max(Math.min(Y-u.timestamp,pE),1)),u.timestamp=Y,u.isProcessing=!0,h.process(u),m.process(u),p.process(u),y.process(u),b.process(u),S.process(u),T.process(u),j.process(u),u.isProcessing=!1,s&&a&&(o=!1,n(E))},C=()=>{s=!0,o=!0,u.isProcessing||n(E)};return{schedule:Ko.reduce((U,Y)=>{const X=f[Y];return U[Y]=(tt,Z=!1,nt=!1)=>(s||C(),X.schedule(tt,Z,nt)),U},{}),cancel:U=>{for(let Y=0;Y<Ko.length;Y++)f[Ko[Y]].cancel(U)},state:u,steps:f}}const{schedule:zt,cancel:ya,state:re,steps:hf}=ib(typeof requestAnimationFrame<"u"?requestAnimationFrame:Je,!0);let Io;function gE(){Io=void 0}const me={now:()=>(Io===void 0&&me.set(re.isProcessing||va.useManualTiming?re.timestamp:performance.now()),Io),set:n=>{Io=n,queueMicrotask(gE)}},lb=n=>a=>typeof a=="string"&&a.startsWith(n),sb=lb("--"),vE=lb("var(--"),Od=n=>vE(n)?yE.test(n.split("/*")[0].trim()):!1,yE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mv(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Wi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ds={...Wi,transform:n=>pn(0,1,n)},Fo={...Wi,default:1},ss=n=>Math.round(n*1e5)/1e5,Rd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bE(n){return n==null}const xE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vd=(n,a)=>s=>!!(typeof s=="string"&&xE.test(s)&&s.startsWith(n)||a&&!bE(s)&&Object.prototype.hasOwnProperty.call(s,a)),ob=(n,a,s)=>o=>{if(typeof o!="string")return o;const[u,d,f,h]=o.match(Rd);return{[n]:parseFloat(u),[a]:parseFloat(d),[s]:parseFloat(f),alpha:h!==void 0?parseFloat(h):1}},SE=n=>pn(0,255,n),mf={...Wi,transform:n=>Math.round(SE(n))},Za={test:Vd("rgb","red"),parse:ob("red","green","blue"),transform:({red:n,green:a,blue:s,alpha:o=1})=>"rgba("+mf.transform(n)+", "+mf.transform(a)+", "+mf.transform(s)+", "+ss(ds.transform(o))+")"};function TE(n){let a="",s="",o="",u="";return n.length>5?(a=n.substring(1,3),s=n.substring(3,5),o=n.substring(5,7),u=n.substring(7,9)):(a=n.substring(1,2),s=n.substring(2,3),o=n.substring(3,4),u=n.substring(4,5),a+=a,s+=s,o+=o,u+=u),{red:parseInt(a,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:u?parseInt(u,16)/255:1}}const Ff={test:Vd("#"),parse:TE,transform:Za.transform},Ss=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),ca=Ss("deg"),mn=Ss("%"),W=Ss("px"),wE=Ss("vh"),EE=Ss("vw"),Dv={...mn,parse:n=>mn.parse(n)/100,transform:n=>mn.transform(n*100)},Gi={test:Vd("hsl","hue"),parse:ob("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:s,alpha:o=1})=>"hsla("+Math.round(n)+", "+mn.transform(ss(a))+", "+mn.transform(ss(s))+", "+ss(ds.transform(o))+")"},Wt={test:n=>Za.test(n)||Ff.test(n)||Gi.test(n),parse:n=>Za.test(n)?Za.parse(n):Gi.test(n)?Gi.parse(n):Ff.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Za.transform(n):Gi.transform(n),getAnimatableNone:n=>{const a=Wt.parse(n);return a.alpha=0,Wt.transform(a)}},AE=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jE(n){var a,s;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Rd))==null?void 0:a.length)||0)+(((s=n.match(AE))==null?void 0:s.length)||0)>0}const rb="number",ub="color",NE="var",CE="var(",zv="${}",ME=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fi(n){const a=n.toString(),s=[],o={color:[],number:[],var:[]},u=[];let d=0;const h=a.replace(ME,m=>(Wt.test(m)?(o.color.push(d),u.push(ub),s.push(Wt.parse(m))):m.startsWith(CE)?(o.var.push(d),u.push(NE),s.push(m)):(o.number.push(d),u.push(rb),s.push(parseFloat(m))),++d,zv)).split(zv);return{values:s,split:h,indexes:o,types:u}}function DE(n){return Fi(n).values}function cb({split:n,types:a}){const s=n.length;return o=>{let u="";for(let d=0;d<s;d++)if(u+=n[d],o[d]!==void 0){const f=a[d];f===rb?u+=ss(o[d]):f===ub?u+=Wt.transform(o[d]):u+=o[d]}return u}}function zE(n){return cb(Fi(n))}const OE=n=>typeof n=="number"?0:Wt.test(n)?Wt.getAnimatableNone(n):n,RE=(n,a)=>typeof n=="number"?a!=null&&a.trim().endsWith("/")?n:0:OE(n);function VE(n){const a=Fi(n);return cb(a)(a.values.map((o,u)=>RE(o,a.split[u])))}const an={test:jE,parse:DE,createTransformer:zE,getAnimatableNone:VE};function pf(n,a,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(a-n)*6*s:s<1/2?a:s<2/3?n+(a-n)*(2/3-s)*6:n}function LE({hue:n,saturation:a,lightness:s,alpha:o}){n/=360,a/=100,s/=100;let u=0,d=0,f=0;if(!a)u=d=f=s;else{const h=s<.5?s*(1+a):s+a-s*a,m=2*s-h;u=pf(m,h,n+1/3),d=pf(m,h,n),f=pf(m,h,n-1/3)}return{red:Math.round(u*255),green:Math.round(d*255),blue:Math.round(f*255),alpha:o}}function hr(n,a){return s=>s>0?a:n}const kt=(n,a,s)=>n+(a-n)*s,gf=(n,a,s)=>{const o=n*n,u=s*(a*a-o)+o;return u<0?0:Math.sqrt(u)},_E=[Ff,Za,Gi],UE=n=>_E.find(a=>a.test(n));function Ov(n){const a=UE(n);if(!a)return!1;let s=a.parse(n);return a===Gi&&(s=LE(s)),s}const Rv=(n,a)=>{const s=Ov(n),o=Ov(a);if(!s||!o)return hr(n,a);const u={...s};return d=>(u.red=gf(s.red,o.red,d),u.green=gf(s.green,o.green,d),u.blue=gf(s.blue,o.blue,d),u.alpha=kt(s.alpha,o.alpha,d),Za.transform(u))},Zf=new Set(["none","hidden"]);function kE(n,a){return Zf.has(n)?s=>s<=0?n:a:s=>s>=1?a:n}function BE(n,a){return s=>kt(n,a,s)}function Ld(n){return typeof n=="number"?BE:typeof n=="string"?Od(n)?hr:Wt.test(n)?Rv:GE:Array.isArray(n)?fb:typeof n=="object"?Wt.test(n)?Rv:HE:hr}function fb(n,a){const s=[...n],o=s.length,u=n.map((d,f)=>Ld(d)(d,a[f]));return d=>{for(let f=0;f<o;f++)s[f]=u[f](d);return s}}function HE(n,a){const s={...n,...a},o={};for(const u in s)n[u]!==void 0&&a[u]!==void 0&&(o[u]=Ld(n[u])(n[u],a[u]));return u=>{for(const d in o)s[d]=o[d](u);return s}}function $E(n,a){const s=[],o={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],f=n.indexes[d][o[d]],h=n.values[f]??0;s[u]=h,o[d]++}return s}const GE=(n,a)=>{const s=an.createTransformer(a),o=Fi(n),u=Fi(a);return o.indexes.var.length===u.indexes.var.length&&o.indexes.color.length===u.indexes.color.length&&o.indexes.number.length>=u.indexes.number.length?Zf.has(n)&&!u.values.length||Zf.has(a)&&!o.values.length?kE(n,a):bs(fb($E(o,u),u.values),s):hr(n,a)};function db(n,a,s){return typeof n=="number"&&typeof a=="number"&&typeof s=="number"?kt(n,a,s):Ld(n)(n,a)}const YE=n=>{const a=({timestamp:s})=>n(s);return{start:(s=!0)=>zt.update(a,s),stop:()=>ya(a),now:()=>re.isProcessing?re.timestamp:me.now()}},hb=(n,a,s=10)=>{let o="";const u=Math.max(Math.round(a/s),2);for(let d=0;d<u;d++)o+=Math.round(n(d/(u-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`},mr=2e4;function _d(n){let a=0;const s=50;let o=n.next(a);for(;!o.done&&a<mr;)a+=s,o=n.next(a);return a>=mr?1/0:a}function qE(n,a=100,s){const o=s({...n,keyframes:[0,a]}),u=Math.min(_d(o),mr);return{type:"keyframes",ease:d=>o.next(u*d).value/a,duration:Ze(u)}}const Gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Qf(n,a){return n*Math.sqrt(1-a*a)}const XE=12;function KE(n,a,s){let o=s;for(let u=1;u<XE;u++)o=o-n(o)/a(o);return o}const vf=.001;function FE({duration:n=Gt.duration,bounce:a=Gt.bounce,velocity:s=Gt.velocity,mass:o=Gt.mass}){let u,d,f=1-a;f=pn(Gt.minDamping,Gt.maxDamping,f),n=pn(Gt.minDuration,Gt.maxDuration,Ze(n)),f<1?(u=p=>{const y=p*f,b=y*n,S=y-s,T=Qf(p,f),j=Math.exp(-b);return vf-S/T*j},d=p=>{const b=p*f*n,S=b*s+s,T=Math.pow(f,2)*Math.pow(p,2)*n,j=Math.exp(-b),E=Qf(Math.pow(p,2),f);return(-u(p)+vf>0?-1:1)*((S-T)*j)/E}):(u=p=>{const y=Math.exp(-p*n),b=(p-s)*n+1;return-vf+y*b},d=p=>{const y=Math.exp(-p*n),b=(s-p)*(n*n);return y*b});const h=5/n,m=KE(u,d,h);if(n=_e(n),isNaN(m))return{stiffness:Gt.stiffness,damping:Gt.damping,duration:n};{const p=Math.pow(m,2)*o;return{stiffness:p,damping:f*2*Math.sqrt(o*p),duration:n}}}const ZE=["duration","bounce"],QE=["stiffness","damping","mass"];function Vv(n,a){return a.some(s=>n[s]!==void 0)}function JE(n){let a={velocity:Gt.velocity,stiffness:Gt.stiffness,damping:Gt.damping,mass:Gt.mass,isResolvedFromDuration:!1,...n};if(!Vv(n,QE)&&Vv(n,ZE))if(a.velocity=0,n.visualDuration){const s=n.visualDuration,o=2*Math.PI/(s*1.2),u=o*o,d=2*pn(.05,1,1-(n.bounce||0))*Math.sqrt(u);a={...a,mass:Gt.mass,stiffness:u,damping:d}}else{const s=FE({...n,velocity:0});a={...a,...s,mass:Gt.mass},a.isResolvedFromDuration=!0}return a}function pr(n=Gt.visualDuration,a=Gt.bounce){const s=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:u}=s;const d=s.keyframes[0],f=s.keyframes[s.keyframes.length-1],h={done:!1,value:d},{stiffness:m,damping:p,mass:y,duration:b,velocity:S,isResolvedFromDuration:T}=JE({...s,velocity:-Ze(s.velocity||0)}),j=S||0,E=p/(2*Math.sqrt(m*y)),C=f-d,A=Ze(Math.sqrt(m/y)),L=Math.abs(C)<5;o||(o=L?Gt.restSpeed.granular:Gt.restSpeed.default),u||(u=L?Gt.restDelta.granular:Gt.restDelta.default);let U,Y,X,tt,Z,nt;if(E<1)X=Qf(A,E),tt=(j+E*A*C)/X,U=J=>{const ft=Math.exp(-E*A*J);return f-ft*(tt*Math.sin(X*J)+C*Math.cos(X*J))},Z=E*A*tt+C*X,nt=E*A*C-tt*X,Y=J=>Math.exp(-E*A*J)*(Z*Math.sin(X*J)+nt*Math.cos(X*J));else if(E===1){U=ft=>f-Math.exp(-A*ft)*(C+(j+A*C)*ft);const J=j+A*C;Y=ft=>Math.exp(-A*ft)*(A*J*ft-j)}else{const J=A*Math.sqrt(E*E-1);U=Nt=>{const Rt=Math.exp(-E*A*Nt),k=Math.min(J*Nt,300);return f-Rt*((j+E*A*C)*Math.sinh(k)+J*C*Math.cosh(k))/J};const ft=(j+E*A*C)/J,vt=E*A*ft-C*J,Ot=E*A*C-ft*J;Y=Nt=>{const Rt=Math.exp(-E*A*Nt),k=Math.min(J*Nt,300);return Rt*(vt*Math.sinh(k)+Ot*Math.cosh(k))}}const xt={calculatedDuration:T&&b||null,velocity:J=>_e(Y(J)),next:J=>{if(!T&&E<1){const vt=Math.exp(-E*A*J),Ot=Math.sin(X*J),Nt=Math.cos(X*J),Rt=f-vt*(tt*Ot+C*Nt),k=_e(vt*(Z*Ot+nt*Nt));return h.done=Math.abs(k)<=o&&Math.abs(f-Rt)<=u,h.value=h.done?f:Rt,h}const ft=U(J);if(T)h.done=J>=b;else{const vt=_e(Y(J));h.done=Math.abs(vt)<=o&&Math.abs(f-ft)<=u}return h.value=h.done?f:ft,h},toString:()=>{const J=Math.min(_d(xt),mr),ft=hb(vt=>xt.next(J*vt).value,J,30);return J+"ms "+ft},toTransition:()=>{}};return xt}pr.applyToOptions=n=>{const a=qE(n,100,pr);return n.ease=a.ease,n.duration=_e(a.duration),n.type="keyframes",n};const PE=5;function mb(n,a,s){const o=Math.max(a-PE,0);return Fy(s-n(o),a-o)}function Jf({keyframes:n,velocity:a=0,power:s=.8,timeConstant:o=325,bounceDamping:u=10,bounceStiffness:d=500,modifyTarget:f,min:h,max:m,restDelta:p=.5,restSpeed:y}){const b=n[0],S={done:!1,value:b},T=nt=>h!==void 0&&nt<h||m!==void 0&&nt>m,j=nt=>h===void 0?m:m===void 0||Math.abs(h-nt)<Math.abs(m-nt)?h:m;let E=s*a;const C=b+E,A=f===void 0?C:f(C);A!==C&&(E=A-b);const L=nt=>-E*Math.exp(-nt/o),U=nt=>A+L(nt),Y=nt=>{const xt=L(nt),J=U(nt);S.done=Math.abs(xt)<=p,S.value=S.done?A:J};let X,tt;const Z=nt=>{T(S.value)&&(X=nt,tt=pr({keyframes:[S.value,j(S.value)],velocity:mb(U,nt,S.value),damping:u,stiffness:d,restDelta:p,restSpeed:y}))};return Z(0),{calculatedDuration:null,next:nt=>{let xt=!1;return!tt&&X===void 0&&(xt=!0,Y(nt),Z(nt)),X!==void 0&&nt>=X?tt.next(nt-X):(!xt&&Y(nt),S)}}}function WE(n,a,s){const o=[],u=s||va.mix||db,d=n.length-1;for(let f=0;f<d;f++){let h=u(n[f],n[f+1]);if(a){const m=Array.isArray(a)?a[f]||Je:a;h=bs(m,h)}o.push(h)}return o}function IE(n,a,{clamp:s=!0,ease:o,mixer:u}={}){const d=n.length;if(Cd(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const h=WE(a,o,u),m=h.length,p=y=>{if(f&&y<n[0])return a[0];let b=0;if(m>1)for(;b<n.length-2&&!(y<n[b+1]);b++);const S=fs(n[b],n[b+1],y);return h[b](S)};return s?y=>p(pn(n[0],n[d-1],y)):p}function t5(n,a){const s=n[n.length-1];for(let o=1;o<=a;o++){const u=fs(0,a,o);n.push(kt(s,1,u))}}function e5(n){const a=[0];return t5(a,n.length-1),a}function n5(n,a){return n.map(s=>s*a)}function a5(n,a){return n.map(()=>a||nb).splice(0,n.length-1)}function os({duration:n=300,keyframes:a,times:s,ease:o="easeInOut"}){const u=fE(o)?o.map(Cv):Cv(o),d={done:!1,value:a[0]},f=n5(s&&s.length===a.length?s:e5(a),n),h=IE(f,a,{ease:Array.isArray(u)?u:a5(a,u)});return{calculatedDuration:n,next:m=>(d.value=h(m),d.done=m>=n,d)}}const i5=n=>n!==null;function zr(n,{repeat:a,repeatType:s="loop"},o,u=1){const d=n.filter(i5),h=u<0||a&&s!=="loop"&&a%2===1?0:d.length-1;return!h||o===void 0?d[h]:o}const l5={decay:Jf,inertia:Jf,tween:os,keyframes:os,spring:pr};function pb(n){typeof n.type=="string"&&(n.type=l5[n.type])}class Ud{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(a=>{this.resolve=a})}notifyFinished(){this.resolve()}then(a,s){return this.finished.then(a,s)}}const s5=n=>n/100;class gr extends Ud{constructor(a){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var o,u;const{motionValue:s}=this.options;s&&s.updatedAt!==me.now()&&this.tick(me.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(u=(o=this.options).onStop)==null||u.call(o))},this.options=a,this.initAnimation(),this.play(),a.autoplay===!1&&this.pause()}initAnimation(){const{options:a}=this;pb(a);const{type:s=os,repeat:o=0,repeatDelay:u=0,repeatType:d,velocity:f=0}=a;let{keyframes:h}=a;const m=s||os;m!==os&&typeof h[0]!="number"&&(this.mixKeyframes=bs(s5,db(h[0],h[1])),h=[0,100]);const p=m({...a,keyframes:h});d==="mirror"&&(this.mirroredGenerator=m({...a,keyframes:[...h].reverse(),velocity:-f})),p.calculatedDuration===null&&(p.calculatedDuration=_d(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+u,this.totalDuration=this.resolvedDuration*(o+1)-u,this.generator=p}updateTime(a){const s=Math.round(a-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(a,s=!1){const{generator:o,totalDuration:u,mixKeyframes:d,mirroredGenerator:f,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:y,repeat:b,repeatType:S,repeatDelay:T,type:j,onUpdate:E,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-u/this.speed,this.startTime)),s?this.currentTime=a:this.updateTime(a);const A=this.currentTime-p*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?A<0:A>u;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let U=this.currentTime,Y=o;if(b){const nt=Math.min(this.currentTime,u)/h;let xt=Math.floor(nt),J=nt%1;!J&&nt>=1&&(J=1),J===1&&xt--,xt=Math.min(xt,b+1),!!(xt%2)&&(S==="reverse"?(J=1-J,T&&(J-=T/h)):S==="mirror"&&(Y=f)),U=pn(0,1,J)*h}let X;L?(this.delayState.value=y[0],X=this.delayState):X=Y.next(U),d&&!L&&(X.value=d(X.value));let{done:tt}=X;!L&&m!==null&&(tt=this.playbackSpeed>=0?this.currentTime>=u:this.currentTime<=0);const Z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&tt);return Z&&j!==Jf&&(X.value=zr(y,this.options,C,this.speed)),E&&E(X.value),Z&&this.finish(),X}then(a,s){return this.finished.then(a,s)}get duration(){return Ze(this.calculatedDuration)}get iterationDuration(){const{delay:a=0}=this.options||{};return this.duration+Ze(a)}get time(){return Ze(this.currentTime)}set time(a){a=_e(a),this.currentTime=a,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=a,this.tick(a))}getGeneratorVelocity(){const a=this.currentTime;if(a<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(a);const s=this.generator.next(a).value;return mb(o=>this.generator.next(o).value,a,s)}get speed(){return this.playbackSpeed}set speed(a){const s=this.playbackSpeed!==a;s&&this.driver&&this.updateTime(me.now()),this.playbackSpeed=a,s&&this.driver&&(this.time=Ze(this.currentTime))}play(){var u,d;if(this.isStopped)return;const{driver:a=YE,startTime:s}=this.options;this.driver||(this.driver=a(f=>this.tick(f))),(d=(u=this.options).onPlay)==null||d.call(u);const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(me.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var a,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(a=this.options).onComplete)==null||s.call(a)}cancel(){var a,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(a=this.options).onCancel)==null||s.call(a)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}attachTimeline(a){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),a.observe(this)}}function o5(n){for(let a=1;a<n.length;a++)n[a]??(n[a]=n[a-1])}const Qa=n=>n*180/Math.PI,Pf=n=>{const a=Qa(Math.atan2(n[1],n[0]));return Wf(a)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Pf,rotateZ:Pf,skewX:n=>Qa(Math.atan(n[1])),skewY:n=>Qa(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Wf=n=>(n=n%360,n<0&&(n+=360),n),Lv=Pf,_v=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),Uv=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),u5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_v,scaleY:Uv,scale:n=>(_v(n)+Uv(n))/2,rotateX:n=>Wf(Qa(Math.atan2(n[6],n[5]))),rotateY:n=>Wf(Qa(Math.atan2(-n[2],n[0]))),rotateZ:Lv,rotate:Lv,skewX:n=>Qa(Math.atan(n[4])),skewY:n=>Qa(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function If(n){return n.includes("scale")?1:0}function td(n,a){if(!n||n==="none")return If(a);const s=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,u;if(s)o=u5,u=s;else{const h=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=r5,u=h}if(!u)return If(a);const d=o[a],f=u[1].split(",").map(f5);return typeof d=="function"?d(f):f[d]}const c5=(n,a)=>{const{transform:s="none"}=getComputedStyle(n);return td(s,a)};function f5(n){return parseFloat(n.trim())}const Ii=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tl=new Set(Ii),kv=n=>n===Wi||n===W,d5=new Set(["x","y","z"]),h5=Ii.filter(n=>!d5.has(n));function m5(n){const a=[];return h5.forEach(s=>{const o=n.getValue(s);o!==void 0&&(a.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),a}const pa={width:({x:n},{paddingLeft:a="0",paddingRight:s="0",boxSizing:o})=>{const u=n.max-n.min;return o==="border-box"?u:u-parseFloat(a)-parseFloat(s)},height:({y:n},{paddingTop:a="0",paddingBottom:s="0",boxSizing:o})=>{const u=n.max-n.min;return o==="border-box"?u:u-parseFloat(a)-parseFloat(s)},top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:(n,{transform:a})=>td(a,"x"),y:(n,{transform:a})=>td(a,"y")};pa.translateX=pa.x;pa.translateY=pa.y;const Ja=new Set;let ed=!1,nd=!1,ad=!1;function gb(){if(nd){const n=Array.from(Ja).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),s=new Map;a.forEach(o=>{const u=m5(o);u.length&&(s.set(o,u),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const u=s.get(o);u&&u.forEach(([d,f])=>{var h;(h=o.getValue(d))==null||h.set(f)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}nd=!1,ed=!1,Ja.forEach(n=>n.complete(ad)),Ja.clear()}function vb(){Ja.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(nd=!0)})}function p5(){ad=!0,vb(),gb(),ad=!1}class kd{constructor(a,s,o,u,d,f=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...a],this.onComplete=s,this.name=o,this.motionValue=u,this.element=d,this.isAsync=f}scheduleResolve(){this.state="scheduled",this.isAsync?(Ja.add(this),ed||(ed=!0,zt.read(vb),zt.resolveKeyframes(gb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:s,element:o,motionValue:u}=this;if(a[0]===null){const d=u==null?void 0:u.get(),f=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&s){const h=o.readValue(s,f);h!=null&&(a[0]=h)}a[0]===void 0&&(a[0]=f),u&&d===void 0&&u.set(a[0])}o5(a)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(a=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,a),Ja.delete(this)}cancel(){this.state==="scheduled"&&(Ja.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const g5=n=>n.startsWith("--");function yb(n,a,s){g5(a)?n.style.setProperty(a,s):n.style[a]=s}const v5={};function bb(n,a){const s=Ky(n);return()=>v5[a]??s()}const y5=bb(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xb=bb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),es=([n,a,s,o])=>`cubic-bezier(${n}, ${a}, ${s}, ${o})`,Bv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:es([0,.65,.55,1]),circOut:es([.55,0,1,.45]),backIn:es([.31,.01,.66,-.59]),backOut:es([.33,1.53,.69,.99])};function Sb(n,a){if(n)return typeof n=="function"?xb()?hb(n,a):"ease-out":ab(n)?es(n):Array.isArray(n)?n.map(s=>Sb(s,a)||Bv.easeOut):Bv[n]}function b5(n,a,s,{delay:o=0,duration:u=300,repeat:d=0,repeatType:f="loop",ease:h="easeOut",times:m}={},p=void 0){const y={[a]:s};m&&(y.offset=m);const b=Sb(h,u);Array.isArray(b)&&(y.easing=b);const S={delay:o,duration:u,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:d+1,direction:f==="reverse"?"alternate":"normal"};return p&&(S.pseudoElement=p),n.animate(y,S)}function Tb(n){return typeof n=="function"&&"applyToOptions"in n}function x5({type:n,...a}){return Tb(n)&&xb()?n.applyToOptions(a):(a.duration??(a.duration=300),a.ease??(a.ease="easeOut"),a)}class wb extends Ud{constructor(a){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!a)return;const{element:s,name:o,keyframes:u,pseudoElement:d,allowFlatten:f=!1,finalKeyframe:h,onComplete:m}=a;this.isPseudoElement=!!d,this.allowFlatten=f,this.options=a,Cd(typeof a.type!="string");const p=x5(a);this.animation=b5(s,o,u,p,d),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!d){const y=zr(u,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(y),yb(s,o,y),this.animation.cancel()}m==null||m(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var a,s;(s=(a=this.animation).finish)==null||s.call(a)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:a}=this;a==="idle"||a==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var s,o,u;const a=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(a!=null&&a.isConnected)&&((u=(o=this.animation).commitStyles)==null||u.call(o))}get duration(){var s,o;const a=((o=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:o.call(s).duration)||0;return Ze(Number(a))}get iterationDuration(){const{delay:a=0}=this.options||{};return this.duration+Ze(a)}get time(){return Ze(Number(this.animation.currentTime)||0)}set time(a){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_e(a),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(a){a<0&&(this.finishedTime=null),this.animation.playbackRate=a}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(a){this.manualStartTime=this.animation.startTime=a}attachTimeline({timeline:a,rangeStart:s,rangeEnd:o,observe:u}){var d;return this.allowFlatten&&((d=this.animation.effect)==null||d.updateTiming({easing:"linear"})),this.animation.onfinish=null,a&&y5()?(this.animation.timeline=a,s&&(this.animation.rangeStart=s),o&&(this.animation.rangeEnd=o),Je):u(this)}}const Eb={anticipate:Iy,backInOut:Wy,circInOut:eb};function S5(n){return n in Eb}function T5(n){typeof n.ease=="string"&&S5(n.ease)&&(n.ease=Eb[n.ease])}const yf=10;class w5 extends wb{constructor(a){T5(a),pb(a),super(a),a.startTime!==void 0&&a.autoplay!==!1&&(this.startTime=a.startTime),this.options=a}updateMotionValue(a){const{motionValue:s,onUpdate:o,onComplete:u,element:d,...f}=this.options;if(!s)return;if(a!==void 0){s.set(a);return}const h=new gr({...f,autoplay:!1}),m=Math.max(yf,me.now()-this.startTime),p=pn(0,yf,m-yf),y=h.sample(m).value,{name:b}=this.options;d&&b&&yb(d,b,y),s.setWithVelocity(h.sample(Math.max(0,m-p)).value,y,p),h.stop()}}const Hv=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(an.test(n)||n==="0")&&!n.startsWith("url("));function E5(n){const a=n[0];if(n.length===1)return!0;for(let s=0;s<n.length;s++)if(n[s]!==a)return!0}function A5(n,a,s,o){const u=n[0];if(u===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],f=Hv(u,a),h=Hv(d,a);return!f||!h?!1:E5(n)||(s==="spring"||Tb(s))&&o}function id(n){n.duration=0,n.type="keyframes"}const Ab=new Set(["opacity","clipPath","filter","transform"]),j5=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function N5(n){for(let a=0;a<n.length;a++)if(typeof n[a]=="string"&&j5.test(n[a]))return!0;return!1}const C5=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),M5=Ky(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function D5(n){var b;const{motionValue:a,name:s,repeatDelay:o,repeatType:u,damping:d,type:f,keyframes:h}=n;if(!(((b=a==null?void 0:a.owner)==null?void 0:b.current)instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:y}=a.owner.getProps();return M5()&&s&&(Ab.has(s)||C5.has(s)&&N5(h))&&(s!=="transform"||!y)&&!p&&!o&&u!=="mirror"&&d!==0&&f!=="inertia"}const z5=40;class O5 extends Ud{constructor({autoplay:a=!0,delay:s=0,type:o="keyframes",repeat:u=0,repeatDelay:d=0,repeatType:f="loop",keyframes:h,name:m,motionValue:p,element:y,...b}){var j;super(),this.stop=()=>{var E,C;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=me.now();const S={autoplay:a,delay:s,type:o,repeat:u,repeatDelay:d,repeatType:f,name:m,motionValue:p,element:y,...b},T=(y==null?void 0:y.KeyframeResolver)||kd;this.keyframeResolver=new T(h,(E,C,A)=>this.onKeyframesResolved(E,C,S,!A),m,p,y),(j=this.keyframeResolver)==null||j.scheduleResolve()}onKeyframesResolved(a,s,o,u){var A,L;this.keyframeResolver=void 0;const{name:d,type:f,velocity:h,delay:m,isHandoff:p,onUpdate:y}=o;this.resolvedAt=me.now();let b=!0;A5(a,d,f,h)||(b=!1,(va.instantAnimations||!m)&&(y==null||y(zr(a,o,s))),a[0]=a[a.length-1],id(o),o.repeat=0);const T={startTime:u?this.resolvedAt?this.resolvedAt-this.createdAt>z5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...o,keyframes:a},j=b&&!p&&D5(T),E=(L=(A=T.motionValue)==null?void 0:A.owner)==null?void 0:L.current;let C;if(j)try{C=new w5({...T,element:E})}catch{C=new gr(T)}else C=new gr(T);C.finished.then(()=>{this.notifyFinished()}).catch(Je),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(a,s){return this.finished.finally(a).then(()=>{})}get animation(){var a;return this._animation||((a=this.keyframeResolver)==null||a.resume(),p5()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(a){this.animation.time=a}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(a){this.animation.speed=a}get startTime(){return this.animation.startTime}attachTimeline(a){return this._animation?this.stopTimeline=this.animation.attachTimeline(a):this.pendingTimeline=a,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var a;this._animation&&this.animation.cancel(),(a=this.keyframeResolver)==null||a.cancel()}}function jb(n,a,s,o=0,u=1){const d=Array.from(n).sort((p,y)=>p.sortNodePosition(y)).indexOf(a),f=n.size,h=(f-1)*o;return typeof s=="function"?s(d,f):u===1?d*o:h-d*o}const R5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function V5(n){const a=R5.exec(n);if(!a)return[,];const[,s,o,u]=a;return[`--${s??o}`,u]}function Nb(n,a,s=1){const[o,u]=V5(n);if(!o)return;const d=window.getComputedStyle(a).getPropertyValue(o);if(d){const f=d.trim();return Yy(f)?parseFloat(f):f}return Od(u)?Nb(u,a,s+1):u}const L5={type:"spring",stiffness:500,damping:25,restSpeed:10},_5=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),U5={type:"keyframes",duration:.8},k5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B5=(n,{keyframes:a})=>a.length>2?U5:tl.has(n)?n.startsWith("scale")?_5(a[1]):L5:k5;function Cb(n,a){if(n!=null&&n.inherit&&a){const{inherit:s,...o}=n;return{...a,...o}}return n}function Bd(n,a){const s=(n==null?void 0:n[a])??(n==null?void 0:n.default)??n;return s!==n?Cb(s,n):s}const H5=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function $5(n){for(const a in n)if(!H5.has(a))return!0;return!1}const Hd=(n,a,s,o={},u,d)=>f=>{const h=Bd(o,n)||{},m=h.delay||o.delay||0;let{elapsed:p=0}=o;p=p-_e(m);const y={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:a.getVelocity(),...h,delay:-p,onUpdate:S=>{a.set(S),h.onUpdate&&h.onUpdate(S)},onComplete:()=>{f(),h.onComplete&&h.onComplete()},name:n,motionValue:a,element:d?void 0:u};$5(h)||Object.assign(y,B5(n,y)),y.duration&&(y.duration=_e(y.duration)),y.repeatDelay&&(y.repeatDelay=_e(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let b=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(id(y),y.delay===0&&(b=!0)),(va.instantAnimations||va.skipAnimations||u!=null&&u.shouldSkipAnimations)&&(b=!0,id(y),y.delay=0),y.allowFlatten=!h.type&&!h.ease,b&&!d&&a.get()!==void 0){const S=zr(y.keyframes,h);if(S!==void 0){zt.update(()=>{y.onUpdate(S),y.onComplete()});return}}return h.isSync?new gr(y):new O5(y)};function $v(n){const a=[{},{}];return n==null||n.values.forEach((s,o)=>{a[0][o]=s.get(),a[1][o]=s.getVelocity()}),a}function $d(n,a,s,o){if(typeof a=="function"){const[u,d]=$v(o);a=a(s!==void 0?s:n.custom,u,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[u,d]=$v(o);a=a(s!==void 0?s:n.custom,u,d)}return a}function Pa(n,a,s){const o=n.getProps();return $d(o,a,s!==void 0?s:o.custom,n)}const Mb=new Set(["width","height","top","left","right","bottom",...Ii]),Gv=30,G5=n=>!isNaN(parseFloat(n));class Y5{constructor(a,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var d;const u=me.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((d=this.events.change)==null||d.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty()},this.hasAnimated=!1,this.setCurrent(a),this.owner=s.owner}setCurrent(a){this.current=a,this.updatedAt=me.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=G5(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,s){this.events[a]||(this.events[a]=new Md);const o=this.events[a].add(s);return a==="change"?()=>{o(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,s){this.passiveEffect=a,this.stopPassiveEffect=s}set(a){this.passiveEffect?this.passiveEffect(a,this.updateAndNotify):this.updateAndNotify(a)}setWithVelocity(a,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,s=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var a;(a=this.events.change)==null||a.notify(this.current)}addDependent(a){this.dependents||(this.dependents=new Set),this.dependents.add(a)}removeDependent(a){this.dependents&&this.dependents.delete(a)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Gv)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Gv);return Fy(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(a){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=a(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var a,s;(a=this.dependents)==null||a.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zi(n,a){return new Y5(n,a)}const ld=n=>Array.isArray(n);function q5(n,a,s){n.hasValue(a)?n.getValue(a).set(s):n.addValue(a,Zi(s))}function X5(n){return ld(n)?n[n.length-1]||0:n}function K5(n,a){const s=Pa(n,a);let{transitionEnd:o={},transition:u={},...d}=s||{};d={...d,...o};for(const f in d){const h=X5(d[f]);q5(n,f,h)}}const ue=n=>!!(n&&n.getVelocity);function F5(n){return!!(ue(n)&&n.add)}function sd(n,a){const s=n.getValue("willChange");if(F5(s))return s.add(a);if(!s&&va.WillChange){const o=new va.WillChange("auto");n.addValue("willChange",o),o.add(a)}}function Gd(n){return n.replace(/([A-Z])/g,a=>`-${a.toLowerCase()}`)}const Z5="framerAppearId",Db="data-"+Gd(Z5);function zb(n){return n.props[Db]}function Q5({protectedKeys:n,needsAnimating:a},s){const o=n.hasOwnProperty(s)&&a[s]!==!0;return a[s]=!1,o}function Ob(n,a,{delay:s=0,transitionOverride:o,type:u}={}){let{transition:d,transitionEnd:f,...h}=a;const m=n.getDefaultTransition();d=d?Cb(d,m):m;const p=d==null?void 0:d.reduceMotion;o&&(d=o);const y=[],b=u&&n.animationState&&n.animationState.getState()[u];for(const S in h){const T=n.getValue(S,n.latestValues[S]??null),j=h[S];if(j===void 0||b&&Q5(b,S))continue;const E={delay:s,...Bd(d||{},S)},C=T.get();if(C!==void 0&&!T.isAnimating()&&!Array.isArray(j)&&j===C&&!E.velocity){zt.update(()=>T.set(j));continue}let A=!1;if(window.MotionHandoffAnimation){const Y=zb(n);if(Y){const X=window.MotionHandoffAnimation(Y,S,zt);X!==null&&(E.startTime=X,A=!0)}}sd(n,S);const L=p??n.shouldReduceMotion;T.start(Hd(S,T,j,L&&Mb.has(S)?{type:!1}:E,n,A));const U=T.animation;U&&y.push(U)}if(f){const S=()=>zt.update(()=>{f&&K5(n,f)});y.length?Promise.all(y).then(S):S()}return y}function od(n,a,s={}){var m;const o=Pa(n,a,s.type==="exit"?(m=n.presenceContext)==null?void 0:m.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(u=s.transitionOverride);const d=o?()=>Promise.all(Ob(n,o,s)):()=>Promise.resolve(),f=n.variantChildren&&n.variantChildren.size?(p=0)=>{const{delayChildren:y=0,staggerChildren:b,staggerDirection:S}=u;return J5(n,a,p,y,b,S,s)}:()=>Promise.resolve(),{when:h}=u;if(h){const[p,y]=h==="beforeChildren"?[d,f]:[f,d];return p().then(()=>y())}else return Promise.all([d(),f(s.delay)])}function J5(n,a,s=0,o=0,u=0,d=1,f){const h=[];for(const m of n.variantChildren)m.notify("AnimationStart",a),h.push(od(m,a,{...f,delay:s+(typeof o=="function"?0:o)+jb(n.variantChildren,m,o,u,d)}).then(()=>m.notify("AnimationComplete",a)));return Promise.all(h)}function P5(n,a,s={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const u=a.map(d=>od(n,d,s));o=Promise.all(u)}else if(typeof a=="string")o=od(n,a,s);else{const u=typeof a=="function"?Pa(n,a,s.custom):a;o=Promise.all(Ob(n,u,s))}return o.then(()=>{n.notify("AnimationComplete",a)})}const W5={test:n=>n==="auto",parse:n=>n},Rb=n=>a=>a.test(n),Vb=[Wi,W,mn,ca,EE,wE,W5],Yv=n=>Vb.find(Rb(n));function I5(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Xy(n):!0}const tA=new Set(["brightness","contrast","saturate","opacity"]);function eA(n){const[a,s]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=s.match(Rd)||[];if(!o)return n;const u=s.replace(o,"");let d=tA.has(a)?1:0;return o!==s&&(d*=100),a+"("+d+u+")"}const nA=/\b([a-z-]*)\(.*?\)/gu,rd={...an,getAnimatableNone:n=>{const a=n.match(nA);return a?a.map(eA).join(" "):n}},ud={...an,getAnimatableNone:n=>{const a=an.parse(n);return an.createTransformer(n)(a.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},qv={...Wi,transform:Math.round},aA={rotate:ca,rotateX:ca,rotateY:ca,rotateZ:ca,scale:Fo,scaleX:Fo,scaleY:Fo,scaleZ:Fo,skew:ca,skewX:ca,skewY:ca,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:ds,originX:Dv,originY:Dv,originZ:W},Yd={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,inset:W,insetBlock:W,insetBlockStart:W,insetBlockEnd:W,insetInline:W,insetInlineStart:W,insetInlineEnd:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,paddingBlock:W,paddingBlockStart:W,paddingBlockEnd:W,paddingInline:W,paddingInlineStart:W,paddingInlineEnd:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,marginBlock:W,marginBlockStart:W,marginBlockEnd:W,marginInline:W,marginInlineStart:W,marginInlineEnd:W,fontSize:W,backgroundPositionX:W,backgroundPositionY:W,...aA,zIndex:qv,fillOpacity:ds,strokeOpacity:ds,numOctaves:qv},iA={...Yd,color:Wt,backgroundColor:Wt,outlineColor:Wt,fill:Wt,stroke:Wt,borderColor:Wt,borderTopColor:Wt,borderRightColor:Wt,borderBottomColor:Wt,borderLeftColor:Wt,filter:rd,WebkitFilter:rd,mask:ud,WebkitMask:ud},Lb=n=>iA[n],lA=new Set([rd,ud]);function _b(n,a){let s=Lb(n);return lA.has(s)||(s=an),s.getAnimatableNone?s.getAnimatableNone(a):void 0}const sA=new Set(["auto","none","0"]);function oA(n,a,s){let o=0,u;for(;o<n.length&&!u;){const d=n[o];typeof d=="string"&&!sA.has(d)&&Fi(d).values.length&&(u=n[o]),o++}if(u&&s)for(const d of a)n[d]=_b(s,u)}class rA extends kd{constructor(a,s,o,u,d){super(a,s,o,u,d,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:s,name:o}=this;if(!s||!s.current)return;super.readKeyframes();for(let y=0;y<a.length;y++){let b=a[y];if(typeof b=="string"&&(b=b.trim(),Od(b))){const S=Nb(b,s.current);S!==void 0&&(a[y]=S),y===a.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!Mb.has(o)||a.length!==2)return;const[u,d]=a,f=Yv(u),h=Yv(d),m=Mv(u),p=Mv(d);if(m!==p&&pa[o]){this.needsMeasurement=!0;return}if(f!==h)if(kv(f)&&kv(h))for(let y=0;y<a.length;y++){const b=a[y];typeof b=="string"&&(a[y]=parseFloat(b))}else pa[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:s}=this,o=[];for(let u=0;u<a.length;u++)(a[u]===null||I5(a[u]))&&o.push(u);o.length&&oA(a,o,s)}measureInitialState(){const{element:a,unresolvedKeyframes:s,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pa[o](a.measureViewportBox(),window.getComputedStyle(a.current)),s[0]=this.measuredOrigin;const u=s[s.length-1];u!==void 0&&a.getValue(o,u).jump(u,!1)}measureEndState(){var h;const{element:a,name:s,unresolvedKeyframes:o}=this;if(!a||!a.current)return;const u=a.getValue(s);u&&u.jump(this.measuredOrigin,!1);const d=o.length-1,f=o[d];o[d]=pa[s](a.measureViewportBox(),window.getComputedStyle(a.current)),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),(h=this.removedTransforms)!=null&&h.length&&this.removedTransforms.forEach(([m,p])=>{a.getValue(m).set(p)}),this.resolveNoneKeyframes()}}function Ub(n,a,s){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let o=document;const u=(s==null?void 0:s[n])??o.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n).filter(o=>o!=null)}const kb=(n,a)=>a&&typeof n=="number"?a.transform(n):n;function uA(n){return qy(n)&&"offsetHeight"in n&&!("ownerSVGElement"in n)}const{schedule:qd}=ib(queueMicrotask,!1),en={x:!1,y:!1};function Bb(){return en.x||en.y}function cA(n){return n==="x"||n==="y"?en[n]?null:(en[n]=!0,()=>{en[n]=!1}):en.x||en.y?null:(en.x=en.y=!0,()=>{en.x=en.y=!1})}function Hb(n,a){const s=Ub(n),o=new AbortController,u={passive:!0,...a,signal:o.signal};return[s,u,()=>o.abort()]}function fA(n){return!(n.pointerType==="touch"||Bb())}function dA(n,a,s={}){const[o,u,d]=Hb(n,s);return o.forEach(f=>{let h=!1,m=!1,p;const y=()=>{f.removeEventListener("pointerleave",j)},b=C=>{p&&(p(C),p=void 0),y()},S=C=>{h=!1,window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),m&&(m=!1,b(C))},T=()=>{h=!0,window.addEventListener("pointerup",S,u),window.addEventListener("pointercancel",S,u)},j=C=>{if(C.pointerType!=="touch"){if(h){m=!0;return}b(C)}},E=C=>{if(!fA(C))return;m=!1;const A=a(f,C);typeof A=="function"&&(p=A,f.addEventListener("pointerleave",j,u))};f.addEventListener("pointerenter",E,u),f.addEventListener("pointerdown",T,u)}),d}const $b=(n,a)=>a?n===a?!0:$b(n,a.parentElement):!1,Xd=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,hA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mA(n){return hA.has(n.tagName)||n.isContentEditable===!0}const pA=new Set(["INPUT","SELECT","TEXTAREA"]);function gA(n){return pA.has(n.tagName)||n.isContentEditable===!0}const tr=new WeakSet;function Xv(n){return a=>{a.key==="Enter"&&n(a)}}function bf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const vA=(n,a)=>{const s=n.currentTarget;if(!s)return;const o=Xv(()=>{if(tr.has(s))return;bf(s,"down");const u=Xv(()=>{bf(s,"up")}),d=()=>bf(s,"cancel");s.addEventListener("keyup",u,a),s.addEventListener("blur",d,a)});s.addEventListener("keydown",o,a),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),a)};function Kv(n){return Xd(n)&&!Bb()}const Fv=new WeakSet;function yA(n,a,s={}){const[o,u,d]=Hb(n,s),f=h=>{const m=h.currentTarget;if(!Kv(h)||Fv.has(h))return;tr.add(m),s.stopPropagation&&Fv.add(h);const p=a(m,h),y=(T,j)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",S),tr.has(m)&&tr.delete(m),Kv(T)&&typeof p=="function"&&p(T,{success:j})},b=T=>{y(T,m===window||m===document||s.useGlobalTarget||$b(m,T.target))},S=T=>{y(T,!1)};window.addEventListener("pointerup",b,u),window.addEventListener("pointercancel",S,u)};return o.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",f,u),uA(h)&&(h.addEventListener("focus",p=>vA(p,u)),!mA(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),d}function Kd(n){return qy(n)&&"ownerSVGElement"in n}const er=new WeakMap;let fa;const Gb=(n,a,s)=>(o,u)=>u&&u[0]?u[0][n+"Size"]:Kd(o)&&"getBBox"in o?o.getBBox()[a]:o[s],bA=Gb("inline","width","offsetWidth"),xA=Gb("block","height","offsetHeight");function SA({target:n,borderBoxSize:a}){var s;(s=er.get(n))==null||s.forEach(o=>{o(n,{get width(){return bA(n,a)},get height(){return xA(n,a)}})})}function TA(n){n.forEach(SA)}function wA(){typeof ResizeObserver>"u"||(fa=new ResizeObserver(TA))}function EA(n,a){fa||wA();const s=Ub(n);return s.forEach(o=>{let u=er.get(o);u||(u=new Set,er.set(o,u)),u.add(a),fa==null||fa.observe(o)}),()=>{s.forEach(o=>{const u=er.get(o);u==null||u.delete(a),u!=null&&u.size||fa==null||fa.unobserve(o)})}}const nr=new Set;let Yi;function AA(){Yi=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};nr.forEach(a=>a(n))},window.addEventListener("resize",Yi)}function jA(n){return nr.add(n),Yi||AA(),()=>{nr.delete(n),!nr.size&&typeof Yi=="function"&&(window.removeEventListener("resize",Yi),Yi=void 0)}}function Zv(n,a){return typeof n=="function"?jA(n):EA(n,a)}function NA(n){return Kd(n)&&n.tagName==="svg"}const CA=[...Vb,Wt,an],MA=n=>CA.find(Rb(n)),Qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),qi=()=>({x:Qv(),y:Qv()}),Jv=()=>({min:0,max:0}),te=()=>({x:Jv(),y:Jv()}),DA=new WeakMap;function Or(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function hs(n){return typeof n=="string"||Array.isArray(n)}const Fd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zd=["initial",...Fd];function Rr(n){return Or(n.animate)||Zd.some(a=>hs(n[a]))}function Yb(n){return!!(Rr(n)||n.variants)}function zA(n,a,s){for(const o in a){const u=a[o],d=s[o];if(ue(u))n.addValue(o,u);else if(ue(d))n.addValue(o,Zi(u,{owner:n}));else if(d!==u)if(n.hasValue(o)){const f=n.getValue(o);f.liveStyle===!0?f.jump(u):f.hasAnimated||f.set(u)}else{const f=n.getStaticValue(o);n.addValue(o,Zi(f!==void 0?f:u,{owner:n}))}}for(const o in s)a[o]===void 0&&n.removeValue(o);return a}const cd={current:null},qb={current:!1},OA=typeof window<"u";function RA(){if(qb.current=!0,!!OA)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>cd.current=n.matches;n.addEventListener("change",a),a()}else cd.current=!1}const Pv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vr={};function Xb(n){vr=n}function VA(){return vr}class LA{scrapeMotionValuesFromProps(a,s,o){return{}}constructor({parent:a,props:s,presenceContext:o,reducedMotionConfig:u,skipAnimations:d,blockInitialAnimation:f,visualState:h},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=kd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const T=me.now();this.renderScheduledAt<T&&(this.renderScheduledAt=T,zt.render(this.render,!1,!0))};const{latestValues:p,renderState:y}=h;this.latestValues=p,this.baseTarget={...p},this.initialValues=s.initial?{...p}:{},this.renderState=y,this.parent=a,this.props=s,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=u,this.skipAnimationsConfig=d,this.options=m,this.blockInitialAnimation=!!f,this.isControllingVariants=Rr(s),this.isVariantNode=Yb(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:b,...S}=this.scrapeMotionValuesFromProps(s,{},this);for(const T in S){const j=S[T];p[T]!==void 0&&ue(j)&&j.set(p[T])}}mount(a){var s,o;if(this.hasBeenMounted)for(const u in this.initialValues)(s=this.values.get(u))==null||s.jump(this.initialValues[u]),this.latestValues[u]=this.initialValues[u];this.current=a,DA.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((u,d)=>this.bindToMotionValue(d,u)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(qb.current||RA(),this.shouldReduceMotion=cd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(o=this.parent)==null||o.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var a;this.projection&&this.projection.unmount(),ya(this.notifyUpdate),ya(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(a=this.parent)==null||a.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(a){this.children.add(a),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(a)}removeChild(a){this.children.delete(a),this.enteringChildren&&this.enteringChildren.delete(a)}bindToMotionValue(a,s){if(this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)(),s.accelerate&&Ab.has(a)&&this.current instanceof HTMLElement){const{factory:f,keyframes:h,times:m,ease:p,duration:y}=s.accelerate,b=new wb({element:this.current,name:a,keyframes:h,times:m,ease:p,duration:_e(y)}),S=f(b);this.valueSubscriptions.set(a,()=>{S(),b.cancel()});return}const o=tl.has(a);o&&this.onBindTransform&&this.onBindTransform();const u=s.on("change",f=>{this.latestValues[a]=f,this.props.onUpdate&&zt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let d;typeof window<"u"&&window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,s)),this.valueSubscriptions.set(a,()=>{u(),d&&d(),s.owner&&s.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in vr){const s=vr[a];if(!s)continue;const{isEnabled:o,Feature:u}=s;if(!this.features[a]&&u&&o(this.props)&&(this.features[a]=new u(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):te()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,s){this.latestValues[a]=s}update(a,s){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;o<Pv.length;o++){const u=Pv[o];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const d="on"+u,f=a[d];f&&(this.propEventSubscriptions[u]=this.on(u,f))}this.prevMotionValues=zA(this,this.scrapeMotionValuesFromProps(a,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(a),()=>s.variantChildren.delete(a)}addValue(a,s){const o=this.values.get(a);s!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,s),this.values.set(a,s),this.latestValues[a]=s.get())}removeValue(a){this.values.delete(a);const s=this.valueSubscriptions.get(a);s&&(s(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,s){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&s!==void 0&&(o=Zi(s===null?void 0:s,{owner:this}),this.addValue(a,o)),o}readValue(a,s){let o=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:this.getBaseTargetFromProps(this.props,a)??this.readValueFromInstance(this.current,a,this.options);return o!=null&&(typeof o=="string"&&(Yy(o)||Xy(o))?o=parseFloat(o):!MA(o)&&an.test(s)&&(o=_b(a,s)),this.setBaseTarget(a,ue(o)?o.get():o)),ue(o)?o.get():o}setBaseTarget(a,s){this.baseTarget[a]=s}getBaseTarget(a){var d;const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const f=$d(this.props,s,(d=this.presenceContext)==null?void 0:d.custom);f&&(o=f[a])}if(s&&o!==void 0)return o;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!ue(u)?u:this.initialValues[a]!==void 0&&o===void 0?void 0:this.baseTarget[a]}on(a,s){return this.events[a]||(this.events[a]=new Md),this.events[a].add(s)}notify(a,...s){this.events[a]&&this.events[a].notify(...s)}scheduleRenderMicrotask(){qd.render(this.render)}}class Kb extends LA{constructor(){super(...arguments),this.KeyframeResolver=rA}sortInstanceNodePosition(a,s){return a.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(a,s){const o=a.style;return o?o[s]:void 0}removeValueFromRenderState(a,{vars:s,style:o}){delete s[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;ue(a)&&(this.childSubscription=a.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Sa{constructor(a){this.isMounted=!1,this.node=a}update(){}}function Fb({top:n,left:a,right:s,bottom:o}){return{x:{min:a,max:s},y:{min:n,max:o}}}function _A({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function UA(n,a){if(!a)return n;const s=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function xf(n){return n===void 0||n===1}function fd({scale:n,scaleX:a,scaleY:s}){return!xf(n)||!xf(a)||!xf(s)}function Ya(n){return fd(n)||Zb(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Zb(n){return Wv(n.x)||Wv(n.y)}function Wv(n){return n&&n!=="0%"}function yr(n,a,s){const o=n-s,u=a*o;return s+u}function Iv(n,a,s,o,u){return u!==void 0&&(n=yr(n,u,o)),yr(n,s,o)+a}function dd(n,a=0,s=1,o,u){n.min=Iv(n.min,a,s,o,u),n.max=Iv(n.max,a,s,o,u)}function Qb(n,{x:a,y:s}){dd(n.x,a.translate,a.scale,a.originPoint),dd(n.y,s.translate,s.scale,s.originPoint)}const t0=.999999999999,e0=1.0000000000001;function kA(n,a,s,o=!1){var h;const u=s.length;if(!u)return;a.x=a.y=1;let d,f;for(let m=0;m<u;m++){d=s[m],f=d.projectionDelta;const{visualElement:p}=d.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(fn(n.x,-d.scroll.offset.x),fn(n.y,-d.scroll.offset.y)),f&&(a.x*=f.x.scale,a.y*=f.y.scale,Qb(n,f)),o&&Ya(d.latestValues)&&ar(n,d.latestValues,(h=d.layout)==null?void 0:h.layoutBox))}a.x<e0&&a.x>t0&&(a.x=1),a.y<e0&&a.y>t0&&(a.y=1)}function fn(n,a){n.min+=a,n.max+=a}function n0(n,a,s,o,u=.5){const d=kt(n.min,n.max,u);dd(n,a,s,d,o)}function a0(n,a){return typeof n=="string"?parseFloat(n)/100*(a.max-a.min):n}function ar(n,a,s){const o=s??n;n0(n.x,a0(a.x,o.x),a.scaleX,a.scale,a.originX),n0(n.y,a0(a.y,o.y),a.scaleY,a.scale,a.originY)}function Jb(n,a){return Fb(UA(n.getBoundingClientRect(),a))}function BA(n,a,s){const o=Jb(n,s),{scroll:u}=a;return u&&(fn(o.x,u.offset.x),fn(o.y,u.offset.y)),o}const HA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$A=Ii.length;function GA(n,a,s){let o="",u=!0;for(let d=0;d<$A;d++){const f=Ii[d],h=n[f];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(f.startsWith("scale")?1:0);else{const p=parseFloat(h);m=f.startsWith("scale")?p===1:p===0}if(!m||s){const p=kb(h,Yd[f]);if(!m){u=!1;const y=HA[f]||f;o+=`${y}(${p}) `}s&&(a[f]=p)}}return o=o.trim(),s?o=s(a,u?"":o):u&&(o="none"),o}function Qd(n,a,s){const{style:o,vars:u,transformOrigin:d}=n;let f=!1,h=!1;for(const m in a){const p=a[m];if(tl.has(m)){f=!0;continue}else if(sb(m)){u[m]=p;continue}else{const y=kb(p,Yd[m]);m.startsWith("origin")?(h=!0,d[m]=y):o[m]=y}}if(a.transform||(f||s?o.transform=GA(a,n.transform,s):o.transform&&(o.transform="none")),h){const{originX:m="50%",originY:p="50%",originZ:y=0}=d;o.transformOrigin=`${m} ${p} ${y}`}}function Pb(n,{style:a,vars:s},o,u){const d=n.style;let f;for(f in a)d[f]=a[f];u==null||u.applyProjectionStyles(d,o);for(f in s)d.setProperty(f,s[f])}function i0(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Jl={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(W.test(n))n=parseFloat(n);else return n;const s=i0(n,a.target.x),o=i0(n,a.target.y);return`${s}% ${o}%`}},YA={correct:(n,{treeScale:a,projectionDelta:s})=>{const o=n,u=an.parse(n);if(u.length>5)return o;const d=an.createTransformer(n),f=typeof u[0]!="number"?1:0,h=s.x.scale*a.x,m=s.y.scale*a.y;u[0+f]/=h,u[1+f]/=m;const p=kt(h,m,.5);return typeof u[2+f]=="number"&&(u[2+f]/=p),typeof u[3+f]=="number"&&(u[3+f]/=p),d(u)}},hd={borderRadius:{...Jl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jl,borderTopRightRadius:Jl,borderBottomLeftRadius:Jl,borderBottomRightRadius:Jl,boxShadow:YA};function Wb(n,{layout:a,layoutId:s}){return tl.has(n)||n.startsWith("origin")||(a||s!==void 0)&&(!!hd[n]||n==="opacity")}function Jd(n,a,s){var f;const o=n.style,u=a==null?void 0:a.style,d={};if(!o)return d;for(const h in o)(ue(o[h])||u&&ue(u[h])||Wb(h,n)||((f=s==null?void 0:s.getValue(h))==null?void 0:f.liveStyle)!==void 0)&&(d[h]=o[h]);return d}function qA(n){return window.getComputedStyle(n)}class XA extends Kb{constructor(){super(...arguments),this.type="html",this.renderInstance=Pb}readValueFromInstance(a,s){var o;if(tl.has(s))return(o=this.projection)!=null&&o.isProjecting?If(s):c5(a,s);{const u=qA(a),d=(sb(s)?u.getPropertyValue(s):u[s])||0;return typeof d=="string"?d.trim():d}}measureInstanceViewportBox(a,{transformPagePoint:s}){return Jb(a,s)}build(a,s,o){Qd(a,s,o.transformTemplate)}scrapeMotionValuesFromProps(a,s,o){return Jd(a,s,o)}}const KA={offset:"stroke-dashoffset",array:"stroke-dasharray"},FA={offset:"strokeDashoffset",array:"strokeDasharray"};function ZA(n,a,s=1,o=0,u=!0){n.pathLength=1;const d=u?KA:FA;n[d.offset]=`${-o}`,n[d.array]=`${a} ${s}`}const QA=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ib(n,{attrX:a,attrY:s,attrScale:o,pathLength:u,pathSpacing:d=1,pathOffset:f=0,...h},m,p,y){if(Qd(n,h,p),m){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:b,style:S}=n;b.transform&&(S.transform=b.transform,delete b.transform),(S.transform||b.transformOrigin)&&(S.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),S.transform&&(S.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete b.transformBox);for(const T of QA)b[T]!==void 0&&(S[T]=b[T],delete b[T]);a!==void 0&&(b.x=a),s!==void 0&&(b.y=s),o!==void 0&&(b.scale=o),u!==void 0&&ZA(b,u,d,f,!1)}const tx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ex=n=>typeof n=="string"&&n.toLowerCase()==="svg";function JA(n,a,s,o){Pb(n,a,void 0,o);for(const u in a.attrs)n.setAttribute(tx.has(u)?u:Gd(u),a.attrs[u])}function nx(n,a,s){const o=Jd(n,a,s);for(const u in n)if(ue(n[u])||ue(a[u])){const d=Ii.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;o[d]=n[u]}return o}class PA extends Kb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=te}getBaseTargetFromProps(a,s){return a[s]}readValueFromInstance(a,s){if(tl.has(s)){const o=Lb(s);return o&&o.default||0}return s=tx.has(s)?s:Gd(s),a.getAttribute(s)}scrapeMotionValuesFromProps(a,s,o){return nx(a,s,o)}build(a,s,o){Ib(a,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(a,s,o,u){JA(a,s,o,u)}mount(a){this.isSVGTag=ex(a.tagName),super.mount(a)}}const WA=Zd.length;function ax(n){if(!n)return;if(!n.isControllingVariants){const s=n.parent?ax(n.parent)||{}:{};return n.props.initial!==void 0&&(s.initial=n.props.initial),s}const a={};for(let s=0;s<WA;s++){const o=Zd[s],u=n.props[o];(hs(u)||u===!1)&&(a[o]=u)}return a}function ix(n,a){if(!Array.isArray(a))return!1;const s=a.length;if(s!==n.length)return!1;for(let o=0;o<s;o++)if(a[o]!==n[o])return!1;return!0}const IA=[...Fd].reverse(),tj=Fd.length;function ej(n){return a=>Promise.all(a.map(({animation:s,options:o})=>P5(n,s,o)))}function nj(n){let a=ej(n),s=l0(),o=!0,u=!1;const d=p=>(y,b)=>{var T;const S=Pa(n,b,p==="exit"?(T=n.presenceContext)==null?void 0:T.custom:void 0);if(S){const{transition:j,transitionEnd:E,...C}=S;y={...y,...C,...E}}return y};function f(p){a=p(n)}function h(p){const{props:y}=n,b=ax(n.parent)||{},S=[],T=new Set;let j={},E=1/0;for(let A=0;A<tj;A++){const L=IA[A],U=s[L],Y=y[L]!==void 0?y[L]:b[L],X=hs(Y),tt=L===p?U.isActive:null;tt===!1&&(E=A);let Z=Y===b[L]&&Y!==y[L]&&X;if(Z&&(o||u)&&n.manuallyAnimateOnMount&&(Z=!1),U.protectedKeys={...j},!U.isActive&&tt===null||!Y&&!U.prevProp||Or(Y)||typeof Y=="boolean")continue;if(L==="exit"&&U.isActive&&tt!==!0){U.prevResolvedValues&&(j={...j,...U.prevResolvedValues});continue}const nt=aj(U.prevProp,Y);let xt=nt||L===p&&U.isActive&&!Z&&X||A>E&&X,J=!1;const ft=Array.isArray(Y)?Y:[Y];let vt=ft.reduce(d(L),{});tt===!1&&(vt={});const{prevResolvedValues:Ot={}}=U,Nt={...Ot,...vt},Rt=F=>{xt=!0,T.has(F)&&(J=!0,T.delete(F)),U.needsAnimating[F]=!0;const it=n.getValue(F);it&&(it.liveStyle=!1)};for(const F in Nt){const it=vt[F],ct=Ot[F];if(j.hasOwnProperty(F))continue;let M=!1;ld(it)&&ld(ct)?M=!ix(it,ct):M=it!==ct,M?it!=null?Rt(F):T.add(F):it!==void 0&&T.has(F)?Rt(F):U.protectedKeys[F]=!0}U.prevProp=Y,U.prevResolvedValues=vt,U.isActive&&(j={...j,...vt}),(o||u)&&n.blockInitialAnimation&&(xt=!1);const k=Z&&nt;xt&&(!k||J)&&S.push(...ft.map(F=>{const it={type:L};if(typeof F=="string"&&(o||u)&&!k&&n.manuallyAnimateOnMount&&n.parent){const{parent:ct}=n,M=Pa(ct,F);if(ct.enteringChildren&&M){const{delayChildren:$}=M.transition||{};it.delay=jb(ct.enteringChildren,n,$)}}return{animation:F,options:it}}))}if(T.size){const A={};if(typeof y.initial!="boolean"){const L=Pa(n,Array.isArray(y.initial)?y.initial[0]:y.initial);L&&L.transition&&(A.transition=L.transition)}T.forEach(L=>{const U=n.getBaseTarget(L),Y=n.getValue(L);Y&&(Y.liveStyle=!0),A[L]=U??null}),S.push({animation:A})}let C=!!S.length;return o&&(y.initial===!1||y.initial===y.animate)&&!n.manuallyAnimateOnMount&&(C=!1),o=!1,u=!1,C?a(S):Promise.resolve()}function m(p,y){var S;if(s[p].isActive===y)return Promise.resolve();(S=n.variantChildren)==null||S.forEach(T=>{var j;return(j=T.animationState)==null?void 0:j.setActive(p,y)}),s[p].isActive=y;const b=h(p);for(const T in s)s[T].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:f,getState:()=>s,reset:()=>{s=l0(),u=!0}}}function aj(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!ix(a,n):!1}function $a(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function l0(){return{animate:$a(!0),whileInView:$a(),whileHover:$a(),whileTap:$a(),whileDrag:$a(),whileFocus:$a(),exit:$a()}}function md(n,a){n.min=a.min,n.max=a.max}function tn(n,a){md(n.x,a.x),md(n.y,a.y)}function s0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}const lx=1e-4,ij=1-lx,lj=1+lx,sx=.01,sj=0-sx,oj=0+sx;function pe(n){return n.max-n.min}function rj(n,a,s){return Math.abs(n-a)<=s}function o0(n,a,s,o=.5){n.origin=o,n.originPoint=kt(a.min,a.max,n.origin),n.scale=pe(s)/pe(a),n.translate=kt(s.min,s.max,n.origin)-n.originPoint,(n.scale>=ij&&n.scale<=lj||isNaN(n.scale))&&(n.scale=1),(n.translate>=sj&&n.translate<=oj||isNaN(n.translate))&&(n.translate=0)}function rs(n,a,s,o){o0(n.x,a.x,s.x,o?o.originX:void 0),o0(n.y,a.y,s.y,o?o.originY:void 0)}function r0(n,a,s,o=0){const u=o?kt(s.min,s.max,o):s.min;n.min=u+a.min,n.max=n.min+pe(a)}function uj(n,a,s,o){r0(n.x,a.x,s.x,o==null?void 0:o.x),r0(n.y,a.y,s.y,o==null?void 0:o.y)}function u0(n,a,s,o=0){const u=o?kt(s.min,s.max,o):s.min;n.min=a.min-u,n.max=n.min+pe(a)}function br(n,a,s,o){u0(n.x,a.x,s.x,o==null?void 0:o.x),u0(n.y,a.y,s.y,o==null?void 0:o.y)}function c0(n,a,s,o,u){return n-=a,n=yr(n,1/s,o),u!==void 0&&(n=yr(n,1/u,o)),n}function cj(n,a=0,s=1,o=.5,u,d=n,f=n){if(mn.test(a)&&(a=parseFloat(a),a=kt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let h=kt(d.min,d.max,o);n===d&&(h-=a),n.min=c0(n.min,a,s,h,u),n.max=c0(n.max,a,s,h,u)}function f0(n,a,[s,o,u],d,f){cj(n,a[s],a[o],a[u],a.scale,d,f)}const fj=["x","scaleX","originX"],dj=["y","scaleY","originY"];function d0(n,a,s,o){f0(n.x,a,fj,s?s.x:void 0,o?o.x:void 0),f0(n.y,a,dj,s?s.y:void 0,o?o.y:void 0)}function h0(n){return n.translate===0&&n.scale===1}function ox(n){return h0(n.x)&&h0(n.y)}function m0(n,a){return n.min===a.min&&n.max===a.max}function hj(n,a){return m0(n.x,a.x)&&m0(n.y,a.y)}function p0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function rx(n,a){return p0(n.x,a.x)&&p0(n.y,a.y)}function g0(n){return pe(n.x)/pe(n.y)}function v0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}function cn(n){return[n("x"),n("y")]}function mj(n,a,s){let o="";const u=n.x.translate/a.x,d=n.y.translate/a.y,f=(s==null?void 0:s.z)||0;if((u||d||f)&&(o=`translate3d(${u}px, ${d}px, ${f}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),s){const{transformPerspective:p,rotate:y,rotateX:b,rotateY:S,skewX:T,skewY:j}=s;p&&(o=`perspective(${p}px) ${o}`),y&&(o+=`rotate(${y}deg) `),b&&(o+=`rotateX(${b}deg) `),S&&(o+=`rotateY(${S}deg) `),T&&(o+=`skewX(${T}deg) `),j&&(o+=`skewY(${j}deg) `)}const h=n.x.scale*a.x,m=n.y.scale*a.y;return(h!==1||m!==1)&&(o+=`scale(${h}, ${m})`),o||"none"}const ux=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],pj=ux.length,y0=n=>typeof n=="string"?parseFloat(n):n,b0=n=>typeof n=="number"||W.test(n);function gj(n,a,s,o,u,d){u?(n.opacity=kt(0,s.opacity??1,vj(o)),n.opacityExit=kt(a.opacity??1,0,yj(o))):d&&(n.opacity=kt(a.opacity??1,s.opacity??1,o));for(let f=0;f<pj;f++){const h=ux[f];let m=x0(a,h),p=x0(s,h);if(m===void 0&&p===void 0)continue;m||(m=0),p||(p=0),m===0||p===0||b0(m)===b0(p)?(n[h]=Math.max(kt(y0(m),y0(p),o),0),(mn.test(p)||mn.test(m))&&(n[h]+="%")):n[h]=p}(a.rotate||s.rotate)&&(n.rotate=kt(a.rotate||0,s.rotate||0,o))}function x0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const vj=cx(0,.5,tb),yj=cx(.5,.95,Je);function cx(n,a,s){return o=>o<n?0:o>a?1:s(fs(n,a,o))}function bj(n,a,s){const o=ue(n)?n:Zi(n);return o.start(Hd("",o,a,s)),o.animation}function ms(n,a,s,o={passive:!0}){return n.addEventListener(a,s,o),()=>n.removeEventListener(a,s)}const xj=(n,a)=>n.depth-a.depth;class Sj{constructor(){this.children=[],this.isDirty=!1}add(a){Nd(this.children,a),this.isDirty=!0}remove(a){dr(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(xj),this.isDirty=!1,this.children.forEach(a)}}function Tj(n,a){const s=me.now(),o=({timestamp:u})=>{const d=u-s;d>=a&&(ya(o),n(d-a))};return zt.setup(o,!0),()=>ya(o)}function ir(n){return ue(n)?n.get():n}class wj{constructor(){this.members=[]}add(a){Nd(this.members,a);for(let s=this.members.length-1;s>=0;s--){const o=this.members[s];if(o===a||o===this.lead||o===this.prevLead)continue;const u=o.instance;(!u||u.isConnected===!1)&&!o.snapshot&&(dr(this.members,o),o.unmount())}a.scheduleRender()}remove(a){if(dr(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(a){var s;for(let o=this.members.indexOf(a)-1;o>=0;o--){const u=this.members[o];if(u.isPresent!==!1&&((s=u.instance)==null?void 0:s.isConnected)!==!1)return this.promote(u),!0}return!1}promote(a,s){var u;const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.updateSnapshot(),a.scheduleRender();const{layoutDependency:d}=o.options,{layoutDependency:f}=a.options;(d===void 0||d!==f)&&(a.resumeFrom=o,s&&(o.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),(u=a.root)!=null&&u.isUpdating&&(a.isLayoutDirty=!0)),a.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{var s,o,u,d,f;(o=(s=a.options).onExitComplete)==null||o.call(s),(f=(u=a.resumingFrom)==null?void 0:(d=u.options).onExitComplete)==null||f.call(d)})}scheduleRender(){this.members.forEach(a=>a.instance&&a.scheduleRender(!1))}removeLeadSnapshot(){var a;(a=this.lead)!=null&&a.snapshot&&(this.lead.snapshot=void 0)}}const lr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sf=["","X","Y","Z"],Ej=1e3;let Aj=0;function Tf(n,a,s,o){const{latestValues:u}=a;u[n]&&(s[n]=u[n],a.setStaticValue(n,0),o&&(o[n]=0))}function fx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const s=zb(a);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:u,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(s,"transform",zt,!(u||d))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&fx(o)}function dx({attachResizeListener:n,defaultParent:a,measureScroll:s,checkIsScrollRoot:o,resetTransform:u}){return class{constructor(f={},h=a==null?void 0:a()){this.id=Aj++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Cj),this.nodes.forEach(Vj),this.nodes.forEach(Lj),this.nodes.forEach(Mj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Sj)}addEventListener(f,h){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Md),this.eventHandlers.get(f).add(h)}notifyListeners(f,...h){const m=this.eventHandlers.get(f);m&&m.notify(...h)}hasListeners(f){return this.eventHandlers.has(f)}mount(f){if(this.instance)return;this.isSVG=Kd(f)&&!NA(f),this.instance=f;const{layoutId:h,layout:m,visualElement:p}=this.options;if(p&&!p.current&&p.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),n){let y,b=0;const S=()=>this.root.updateBlockedByResize=!1;zt.read(()=>{b=window.innerWidth}),n(f,()=>{const T=window.innerWidth;T!==b&&(b=T,this.root.updateBlockedByResize=!0,y&&y(),y=Tj(S,250),lr.hasAnimatedSinceResize&&(lr.hasAnimatedSinceResize=!1,this.nodes.forEach(w0)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&p&&(h||m)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeLayoutChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||p.getDefaultTransition()||Hj,{onLayoutAnimationStart:E,onLayoutAnimationComplete:C}=p.getProps(),A=!this.targetLayout||!rx(this.targetLayout,T),L=!b&&S;if(this.options.layoutRoot||this.resumeFrom||L||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const U={...Bd(j,"layout"),onPlay:E,onComplete:C};(p.shouldReduceMotion||this.options.layoutRoot)&&(U.delay=0,U.type=!1),this.startAnimation(U),this.setAnimationOrigin(y,L)}else b||w0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ya(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_j),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const b=this.path[y];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const m=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),m&&this.nodes.forEach(zj),this.nodes.forEach(S0);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(T0);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Oj),this.nodes.forEach(Rj),this.nodes.forEach(jj),this.nodes.forEach(Nj)):this.nodes.forEach(T0),this.clearAllSnapshots();const h=me.now();re.delta=pn(0,1e3/60,h-re.timestamp),re.timestamp=h,re.isProcessing=!0,hf.update.process(re),hf.preRender.process(re),hf.render.process(re),re.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dj),this.sharedNodes.forEach(Uj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!pe(this.snapshot.measuredBox.x)&&!pe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=te()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(h=!1),h&&this.instance){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!u)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!ox(this.projectionDelta),m=this.getTransformTemplate(),p=m?m(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;f&&this.instance&&(h||Ya(this.latestValues)||y)&&(u(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return f&&(m=this.removeTransform(m)),$j(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:f}=this.options;if(!f)return te();const h=f.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(Gj))){const{scroll:y}=this.root;y&&(fn(h.x,y.offset.x),fn(h.y,y.offset.y))}return h}removeElementScroll(f){var m;const h=te();if(tn(h,f),(m=this.scroll)!=null&&m.wasRoot)return h;for(let p=0;p<this.path.length;p++){const y=this.path[p],{scroll:b,options:S}=y;y!==this.root&&b&&S.layoutScroll&&(b.wasRoot&&tn(h,f),fn(h.x,b.offset.x),fn(h.y,b.offset.y))}return h}applyTransform(f,h=!1,m){var y,b;const p=m||te();tn(p,f);for(let S=0;S<this.path.length;S++){const T=this.path[S];!h&&T.options.layoutScroll&&T.scroll&&T!==T.root&&(fn(p.x,-T.scroll.offset.x),fn(p.y,-T.scroll.offset.y)),Ya(T.latestValues)&&ar(p,T.latestValues,(y=T.layout)==null?void 0:y.layoutBox)}return Ya(this.latestValues)&&ar(p,this.latestValues,(b=this.layout)==null?void 0:b.layoutBox),p}removeTransform(f){var m;const h=te();tn(h,f);for(let p=0;p<this.path.length;p++){const y=this.path[p];if(!Ya(y.latestValues))continue;let b;y.instance&&(fd(y.latestValues)&&y.updateSnapshot(),b=te(),tn(b,y.measurePageBox())),d0(h,y.latestValues,(m=y.snapshot)==null?void 0:m.layoutBox,b)}return Ya(this.latestValues)&&d0(h,this.latestValues),h}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==re.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var T;const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(f||m&&this.isSharedProjectionDirty||this.isProjectionDirty||(T=this.parent)!=null&&T.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!this.layout||!(y||b))return;this.resolvedRelativeTargetAt=re.timestamp;const S=this.getClosestProjectingParent();S&&this.linkedParentVersion!==S.layoutVersion&&!S.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&S&&S.layout?this.createRelativeTarget(S,this.layout.layoutBox,S.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=te(),this.targetWithTransforms=te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uj(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tn(this.target,this.layout.layoutBox),Qb(this.target,this.targetDelta)):tn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?this.createRelativeTarget(S,this.target,S.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||fd(this.parent.latestValues)||Zb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(f,h,m){this.relativeParent=f,this.linkedParentVersion=f.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=te(),this.relativeTargetOrigin=te(),br(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),tn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var j;const f=this.getLead(),h=!!this.resumingFrom||this!==f;let m=!0;if((this.isProjectionDirty||(j=this.parent)!=null&&j.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===re.timestamp&&(m=!1),m)return;const{layout:p,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||y))return;tn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;kA(this.layoutCorrected,this.treeScale,this.path,h),f.layout&&!f.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(f.target=f.layout.layoutBox,f.targetWithTransforms=te());const{target:T}=f;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(s0(this.prevProjectionDelta.x,this.projectionDelta.x),s0(this.prevProjectionDelta.y,this.projectionDelta.y)),rs(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!v0(this.projectionDelta.x,this.prevProjectionDelta.x)||!v0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var h;if((h=this.options.visualElement)==null||h.scheduleRender(),f){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qi(),this.projectionDelta=qi(),this.projectionDeltaWithTransform=qi()}setAnimationOrigin(f,h=!1){const m=this.snapshot,p=m?m.latestValues:{},y={...this.latestValues},b=qi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const S=te(),T=m?m.source:void 0,j=this.layout?this.layout.source:void 0,E=T!==j,C=this.getStack(),A=!C||C.members.length<=1,L=!!(E&&!A&&this.options.crossfade===!0&&!this.path.some(Bj));this.animationProgress=0;let U;this.mixTargetDelta=Y=>{const X=Y/1e3;E0(b.x,f.x,X),E0(b.y,f.y,X),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(br(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),kj(this.relativeTarget,this.relativeTargetOrigin,S,X),U&&hj(this.relativeTarget,U)&&(this.isProjectionDirty=!1),U||(U=te()),tn(U,this.relativeTarget)),E&&(this.animationValues=y,gj(y,p,this.latestValues,X,L,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=X},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){var h,m,p;this.notifyListeners("animationStart"),(h=this.currentAnimation)==null||h.stop(),(p=(m=this.resumingFrom)==null?void 0:m.currentAnimation)==null||p.stop(),this.pendingAnimation&&(ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{lr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zi(0)),this.motionValue.jump(0,!1),this.currentAnimation=bj(this.motionValue,[0,1e3],{...f,velocity:0,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),f.onUpdate&&f.onUpdate(y)},onStop:()=>{},onComplete:()=>{f.onComplete&&f.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ej),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:h,target:m,layout:p,latestValues:y}=f;if(!(!h||!m||!p)){if(this!==f&&this.layout&&p&&hx(this.options.animationType,this.layout.layoutBox,p.layoutBox)){m=this.target||te();const b=pe(this.layout.layoutBox.x);m.x.min=f.target.x.min,m.x.max=m.x.min+b;const S=pe(this.layout.layoutBox.y);m.y.min=f.target.y.min,m.y.max=m.y.min+S}tn(h,m),ar(h,y),rs(this.projectionDeltaWithTransform,this.layoutCorrected,h,y)}}registerSharedNode(f,h){this.sharedNodes.has(f)||this.sharedNodes.set(f,new wj),this.sharedNodes.get(f).add(h);const p=h.options.initialPromotionConfig;h.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(h):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var h;const{layoutId:f}=this.options;return f?((h=this.getStack())==null?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:f}=this.options;return f?(h=this.getStack())==null?void 0:h.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:h,preserveFollowOpacity:m}={}){const p=this.getStack();p&&p.promote(this,m),f&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let h=!1;const{latestValues:m}=f;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const p={};m.z&&Tf("z",f,p,this.animationValues);for(let y=0;y<Sf.length;y++)Tf(`rotate${Sf[y]}`,f,p,this.animationValues),Tf(`skew${Sf[y]}`,f,p,this.animationValues);f.render();for(const y in p)f.setStaticValue(y,p[y]),this.animationValues&&(this.animationValues[y]=p[y]);f.scheduleRender()}applyProjectionStyles(f,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){f.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,f.visibility="",f.opacity="",f.pointerEvents=ir(h==null?void 0:h.pointerEvents)||"",f.transform=m?m(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=ir(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!Ya(this.latestValues)&&(f.transform=m?m({},""):"none",this.hasProjected=!1);return}f.visibility="";const y=p.animationValues||p.latestValues;this.applyTransformsToTarget();let b=mj(this.projectionDeltaWithTransform,this.treeScale,y);m&&(b=m(y,b)),f.transform=b;const{x:S,y:T}=this.projectionDelta;f.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,p.animationValues?f.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:f.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const j in hd){if(y[j]===void 0)continue;const{correct:E,applyTo:C,isCSSVariable:A}=hd[j],L=b==="none"?y[j]:E(y[j],p);if(C){const U=C.length;for(let Y=0;Y<U;Y++)f[C[Y]]=L}else A?this.options.visualElement.renderState.vars[j]=L:f[j]=L}this.options.layoutId&&(f.pointerEvents=p===this?ir(h==null?void 0:h.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var h;return(h=f.currentAnimation)==null?void 0:h.stop()}),this.root.nodes.forEach(S0),this.root.sharedNodes.clear()}}}function jj(n){n.updateLayout()}function Nj(n){var s;const a=((s=n.resumeFrom)==null?void 0:s.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&a&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:u}=n.layout,{animationType:d}=n.options,f=a.source!==n.layout.source;if(d==="size")cn(b=>{const S=f?a.measuredBox[b]:a.layoutBox[b],T=pe(S);S.min=o[b].min,S.max=S.min+T});else if(d==="x"||d==="y"){const b=d==="x"?"y":"x";md(f?a.measuredBox[b]:a.layoutBox[b],o[b])}else hx(d,a.layoutBox,o)&&cn(b=>{const S=f?a.measuredBox[b]:a.layoutBox[b],T=pe(o[b]);S.max=S.min+T,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[b].max=n.relativeTarget[b].min+T)});const h=qi();rs(h,o,a.layoutBox);const m=qi();f?rs(m,n.applyTransform(u,!0),a.measuredBox):rs(m,o,a.layoutBox);const p=!ox(h);let y=!1;if(!n.resumeFrom){const b=n.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:S,layout:T}=b;if(S&&T){const j=n.options.layoutAnchor||void 0,E=te();br(E,a.layoutBox,S.layoutBox,j);const C=te();br(C,o,T.layoutBox,j),rx(E,C)||(y=!0),b.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=E,n.relativeParent=b)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:a,delta:m,layoutDelta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function Cj(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function Mj(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Dj(n){n.clearSnapshot()}function S0(n){n.clearMeasurements()}function zj(n){n.isLayoutDirty=!0,n.updateLayout()}function T0(n){n.isLayoutDirty=!1}function Oj(n){n.isAnimationBlocked&&n.layout&&!n.isLayoutDirty&&(n.snapshot=n.layout,n.isLayoutDirty=!0)}function Rj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function w0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Vj(n){n.resolveTargetDelta()}function Lj(n){n.calcProjection()}function _j(n){n.resetSkewAndRotation()}function Uj(n){n.removeLeadSnapshot()}function E0(n,a,s){n.translate=kt(a.translate,0,s),n.scale=kt(a.scale,1,s),n.origin=a.origin,n.originPoint=a.originPoint}function A0(n,a,s,o){n.min=kt(a.min,s.min,o),n.max=kt(a.max,s.max,o)}function kj(n,a,s,o){A0(n.x,a.x,s.x,o),A0(n.y,a.y,s.y,o)}function Bj(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Hj={duration:.45,ease:[.4,0,.1,1]},j0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),N0=j0("applewebkit/")&&!j0("chrome/")?Math.round:Je;function C0(n){n.min=N0(n.min),n.max=N0(n.max)}function $j(n){C0(n.x),C0(n.y)}function hx(n,a,s){return n==="position"||n==="preserve-aspect"&&!rj(g0(a),g0(s),.2)}function Gj(n){var a;return n!==n.root&&((a=n.scroll)==null?void 0:a.wasRoot)}const Yj=dx({attachResizeListener:(n,a)=>ms(n,"resize",a),measureScroll:()=>{var n,a;return{x:document.documentElement.scrollLeft||((n=document.body)==null?void 0:n.scrollLeft)||0,y:document.documentElement.scrollTop||((a=document.body)==null?void 0:a.scrollTop)||0}},checkIsScrollRoot:()=>!0}),qj=n=>!n.isLayoutDirty&&n.willUpdate(!1);function M0(){const n=new Set,a=new WeakMap,s=()=>n.forEach(qj);return{add:o=>{n.add(o),a.set(o,o.addEventListener("willUpdate",s))},remove:o=>{n.delete(o);const u=a.get(o);u&&(u(),a.delete(o)),s()},dirty:s}}const wf={current:void 0},mx=dx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!wf.current){const n=new Yj({});n.mount(window),n.setOptions({layoutScroll:!0}),wf.current=n}return wf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),px=w.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function Xj(n=!0){const a=w.useContext(jd);if(a===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:u}=a,d=w.useId();w.useEffect(()=>{if(n)return u(d)},[n]);const f=w.useCallback(()=>n&&o&&o(d),[d,o,n]);return!s&&o?[!1,f]:[!0]}const Kj=w.createContext(null);function Fj(){const n=w.useRef(!1);return Gy(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Zj(){const n=Fj(),[a,s]=w.useState(0),o=w.useCallback(()=>{n.current&&s(a+1)},[a]);return[w.useCallback(()=>zt.postRender(o),[o]),a]}const gx=n=>n===!0,Qj=n=>gx(n===!0)||n==="id",vx=({children:n,id:a,inherit:s=!0})=>{const o=w.useContext(fr),u=w.useContext(Kj),[d,f]=Zj(),h=w.useRef(null),m=o.id||u;h.current===null&&(Qj(s)&&m&&(a=a?m+"-"+a:m),h.current={id:a,group:gx(s)&&o.group||M0()});const p=w.useMemo(()=>({...h.current,forceRender:d}),[f]);return v.jsx(fr.Provider,{value:p,children:n})},yx=w.createContext({strict:!1}),D0={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 z0=!1;function Jj(){if(z0)return;const n={};for(const a in D0)n[a]={isEnabled:s=>D0[a].some(o=>!!s[o])};Xb(n),z0=!0}function bx(){return Jj(),VA()}function Pj(n){const a=bx();for(const s in n)a[s]={...a[s],...n[s]};Xb(a)}const Wj=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 xr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Wj.has(n)}let xx=n=>!xr(n);function Ij(n){typeof n=="function"&&(xx=a=>a.startsWith("on")?!xr(a):n(a))}try{Ij(require("@emotion/is-prop-valid").default)}catch{}function t3(n,a,s){const o={};for(const u in n)u==="values"&&typeof n.values=="object"||ue(n[u])||(xx(u)||s===!0&&xr(u)||!a&&!xr(u)||n.draggable&&u.startsWith("onDrag"))&&(o[u]=n[u]);return o}const Vr=w.createContext({});function e3(n,a){if(Rr(n)){const{initial:s,animate:o}=n;return{initial:s===!1||hs(s)?s:void 0,animate:hs(o)?o:void 0}}return n.inherit!==!1?a:{}}function n3(n){const{initial:a,animate:s}=e3(n,w.useContext(Vr));return w.useMemo(()=>({initial:a,animate:s}),[O0(a),O0(s)])}function O0(n){return Array.isArray(n)?n.join(" "):n}const Pd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sx(n,a,s){for(const o in a)!ue(a[o])&&!Wb(o,s)&&(n[o]=a[o])}function a3({transformTemplate:n},a){return w.useMemo(()=>{const s=Pd();return Qd(s,a,n),Object.assign({},s.vars,s.style)},[a])}function i3(n,a){const s=n.style||{},o={};return Sx(o,s,n),Object.assign(o,a3(n,a)),o}function l3(n,a){const s={},o=i3(n,a);return n.drag&&n.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(s.tabIndex=0),s.style=o,s}const Tx=()=>({...Pd(),attrs:{}});function s3(n,a,s,o){const u=w.useMemo(()=>{const d=Tx();return Ib(d,a,ex(o),n.transformTemplate,n.style),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};Sx(d,n.style,n),u.style={...d,...u.style}}return u}const o3=["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 Wd(n){return typeof n!="string"||n.includes("-")?!1:!!(o3.indexOf(n)>-1||/[A-Z]/u.test(n))}function r3(n,a,s,{latestValues:o},u,d=!1,f){const m=(f??Wd(n)?s3:l3)(a,o,u,n),p=t3(a,typeof n=="string",d),y=n!==w.Fragment?{...p,...m,ref:s}:{},{children:b}=a,S=w.useMemo(()=>ue(b)?b.get():b,[b]);return w.createElement(n,{...y,children:S})}function u3({scrapeMotionValuesFromProps:n,createRenderState:a},s,o,u){return{latestValues:c3(s,o,u,n),renderState:a()}}function c3(n,a,s,o){const u={},d=o(n,{});for(const S in d)u[S]=ir(d[S]);let{initial:f,animate:h}=n;const m=Rr(n),p=Yb(n);a&&p&&!m&&n.inherit!==!1&&(f===void 0&&(f=a.initial),h===void 0&&(h=a.animate));let y=s?s.initial===!1:!1;y=y||f===!1;const b=y?h:f;if(b&&typeof b!="boolean"&&!Or(b)){const S=Array.isArray(b)?b:[b];for(let T=0;T<S.length;T++){const j=$d(n,S[T]);if(j){const{transitionEnd:E,transition:C,...A}=j;for(const L in A){let U=A[L];if(Array.isArray(U)){const Y=y?U.length-1:0;U=U[Y]}U!==null&&(u[L]=U)}for(const L in E)u[L]=E[L]}}}return u}const wx=n=>(a,s)=>{const o=w.useContext(Vr),u=w.useContext(jd),d=()=>u3(n,a,o,u);return s?d():aE(d)},f3=wx({scrapeMotionValuesFromProps:Jd,createRenderState:Pd}),d3=wx({scrapeMotionValuesFromProps:nx,createRenderState:Tx}),h3=Symbol.for("motionComponentSymbol");function m3(n,a,s){const o=w.useRef(s);w.useInsertionEffect(()=>{o.current=s});const u=w.useRef(null);return w.useCallback(d=>{var h;d&&((h=n.onMount)==null||h.call(n,d));const f=o.current;if(typeof f=="function")if(d){const m=f(d);typeof m=="function"&&(u.current=m)}else u.current?(u.current(),u.current=null):f(d);else f&&(f.current=d);a&&(d?a.mount(d):a.unmount())},[a])}const Ex=w.createContext({});function $i(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function p3(n,a,s,o,u,d){var U,Y;const{visualElement:f}=w.useContext(Vr),h=w.useContext(yx),m=w.useContext(jd),p=w.useContext(px),y=p.reducedMotion,b=p.skipAnimations,S=w.useRef(null),T=w.useRef(!1);o=o||h.renderer,!S.current&&o&&(S.current=o(n,{visualState:a,parent:f,props:s,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:y,skipAnimations:b,isSVG:d}),T.current&&S.current&&(S.current.manuallyAnimateOnMount=!0));const j=S.current,E=w.useContext(Ex);j&&!j.projection&&u&&(j.type==="html"||j.type==="svg")&&g3(S.current,s,u,E);const C=w.useRef(!1);w.useInsertionEffect(()=>{j&&C.current&&j.update(s,m)});const A=s[Db],L=w.useRef(!!A&&typeof window<"u"&&!((U=window.MotionHandoffIsComplete)!=null&&U.call(window,A))&&((Y=window.MotionHasOptimisedAnimation)==null?void 0:Y.call(window,A)));return Gy(()=>{T.current=!0,j&&(C.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),L.current&&j.animationState&&j.animationState.animateChanges())}),w.useEffect(()=>{j&&(!L.current&&j.animationState&&j.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var X;(X=window.MotionHandoffMarkAsComplete)==null||X.call(window,A)}),L.current=!1),j.enteringChildren=void 0)}),j}function g3(n,a,s,o){const{layoutId:u,layout:d,drag:f,dragConstraints:h,layoutScroll:m,layoutRoot:p,layoutAnchor:y,layoutCrossfade:b}=a;n.projection=new s(n.latestValues,a["data-framer-portal-id"]?void 0:Ax(n.parent)),n.projection.setOptions({layoutId:u,layout:d,alwaysMeasureLayout:!!f||h&&$i(h),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:o,crossfade:b,layoutScroll:m,layoutRoot:p,layoutAnchor:y})}function Ax(n){if(n)return n.options.allowProjection!==!1?n.projection:Ax(n.parent)}function Ef(n,{forwardMotionProps:a=!1,type:s}={},o,u){o&&Pj(o);const d=s?s==="svg":Wd(n),f=d?d3:f3;function h(p,y){let b;const S={...w.useContext(px),...p,layoutId:v3(p)},{isStatic:T}=S,j=n3(p),E=f(p,T);if(!T&&typeof window<"u"){y3();const C=b3(S);b=C.MeasureLayout,j.visualElement=p3(n,E,S,u,C.ProjectionNode,d)}return v.jsxs(Vr.Provider,{value:j,children:[b&&j.visualElement?v.jsx(b,{visualElement:j.visualElement,...S}):null,r3(n,p,m3(E,j.visualElement,y),E,T,a,d)]})}h.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const m=w.forwardRef(h);return m[h3]=n,m}function v3({layoutId:n}){const a=w.useContext(fr).id;return a&&n!==void 0?a+"-"+n:n}function y3(n,a){w.useContext(yx).strict}function b3(n){const a=bx(),{drag:s,layout:o}=a;if(!s&&!o)return{};const u={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(n)||o!=null&&o.isEnabled(n)?u.MeasureLayout:void 0,ProjectionNode:u.ProjectionNode}}function x3(n,a){if(typeof Proxy>"u")return Ef;const s=new Map,o=(d,f)=>Ef(d,f,n,a),u=(d,f)=>o(d,f);return new Proxy(u,{get:(d,f)=>f==="create"?o:(s.has(f)||s.set(f,Ef(f,void 0,n,a)),s.get(f))})}const S3=(n,a)=>a.isSVG??Wd(n)?new PA(a):new XA(a,{allowProjection:n!==w.Fragment});class T3 extends Sa{constructor(a){super(a),a.animationState||(a.animationState=nj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Or(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:s}=this.node.prevProps||{};a!==s&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)==null||a.call(this)}}let w3=0;class E3 extends Sa{constructor(){super(...arguments),this.id=w3++,this.isExitComplete=!1}update(){var d;if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;if(a&&o===!1){if(this.isExitComplete){const{initial:f,custom:h}=this.node.getProps();if(typeof f=="string"){const m=Pa(this.node,f,h);if(m){const{transition:p,transitionEnd:y,...b}=m;for(const S in b)(d=this.node.getValue(S))==null||d.jump(b[S])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const u=this.node.animationState.setActive("exit",!a);s&&!a&&u.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:a,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),a&&(this.unmount=a(this.id))}unmount(){}}const A3={animation:{Feature:T3},exit:{Feature:E3}};function Ts(n){return{point:{x:n.pageX,y:n.pageY}}}const j3=n=>a=>Xd(a)&&n(a,Ts(a));function us(n,a,s,o){return ms(n,a,j3(s),o)}const jx=({current:n})=>n?n.ownerDocument.defaultView:null,R0=(n,a)=>Math.abs(n-a);function N3(n,a){const s=R0(n.x,a.x),o=R0(n.y,a.y);return Math.sqrt(s**2+o**2)}const V0=new Set(["auto","scroll"]);class Nx{constructor(a,s,{transformPagePoint:o,contextWindow:u=window,dragSnapToOrigin:d=!1,distanceThreshold:f=3,element:h}={}){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=T=>{this.handleScroll(T.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zo(this.lastRawMoveEventInfo,this.transformPagePoint));const T=Af(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,E=N3(T.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!E)return;const{point:C}=T,{timestamp:A}=re;this.history.push({...C,timestamp:A});const{onStart:L,onMove:U}=this.handlers;j||(L&&L(this.lastMoveEvent,T),this.startEvent=this.lastMoveEvent),U&&U(this.lastMoveEvent,T)},this.handlePointerMove=(T,j)=>{this.lastMoveEvent=T,this.lastRawMoveEventInfo=j,this.lastMoveEventInfo=Zo(j,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(T,j)=>{this.end();const{onEnd:E,onSessionEnd:C,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Af(T.type==="pointercancel"?this.lastMoveEventInfo:Zo(j,this.transformPagePoint),this.history);this.startEvent&&E&&E(T,L),C&&C(T,L)},!Xd(a))return;this.dragSnapToOrigin=d,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=f,this.contextWindow=u||window;const m=Ts(a),p=Zo(m,this.transformPagePoint),{point:y}=p,{timestamp:b}=re;this.history=[{...y,timestamp:b}];const{onSessionStart:S}=s;S&&S(a,Af(p,this.history)),this.removeListeners=bs(us(this.contextWindow,"pointermove",this.handlePointerMove),us(this.contextWindow,"pointerup",this.handlePointerUp),us(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(a){let s=a.parentElement;for(;s;){const o=getComputedStyle(s);(V0.has(o.overflowX)||V0.has(o.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(a){const s=this.scrollPositions.get(a);if(!s)return;const o=a===window,u=o?{x:window.scrollX,y:window.scrollY}:{x:a.scrollLeft,y:a.scrollTop},d={x:u.x-s.x,y:u.y-s.y};d.x===0&&d.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=d.x,this.lastMoveEventInfo.point.y+=d.y):this.history.length>0&&(this.history[0].x-=d.x,this.history[0].y-=d.y),this.scrollPositions.set(a,u),zt.update(this.updatePoint,!0))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ya(this.updatePoint)}}function Zo(n,a){return a?{point:a(n.point)}:n}function L0(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Af({point:n},a){return{point:n,delta:L0(n,Cx(a)),offset:L0(n,C3(a)),velocity:M3(a,.1)}}function C3(n){return n[0]}function Cx(n){return n[n.length-1]}function M3(n,a){if(n.length<2)return{x:0,y:0};let s=n.length-1,o=null;const u=Cx(n);for(;s>=0&&(o=n[s],!(u.timestamp-o.timestamp>_e(a)));)s--;if(!o)return{x:0,y:0};o===n[0]&&n.length>2&&u.timestamp-o.timestamp>_e(a)*2&&(o=n[1]);const d=Ze(u.timestamp-o.timestamp);if(d===0)return{x:0,y:0};const f={x:(u.x-o.x)/d,y:(u.y-o.y)/d};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}function D3(n,{min:a,max:s},o){return a!==void 0&&n<a?n=o?kt(a,n,o.min):Math.max(n,a):s!==void 0&&n>s&&(n=o?kt(s,n,o.max):Math.min(n,s)),n}function _0(n,a,s){return{min:a!==void 0?n.min+a:void 0,max:s!==void 0?n.max+s-(n.max-n.min):void 0}}function z3(n,{top:a,left:s,bottom:o,right:u}){return{x:_0(n.x,s,u),y:_0(n.y,a,o)}}function U0(n,a){let s=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([s,o]=[o,s]),{min:s,max:o}}function O3(n,a){return{x:U0(n.x,a.x),y:U0(n.y,a.y)}}function R3(n,a){let s=.5;const o=pe(n),u=pe(a);return u>o?s=fs(a.min,a.max-o,n.min):o>u&&(s=fs(n.min,n.max-u,a.min)),pn(0,1,s)}function V3(n,a){const s={};return a.min!==void 0&&(s.min=a.min-n.min),a.max!==void 0&&(s.max=a.max-n.min),s}const pd=.35;function L3(n=pd){return n===!1?n=0:n===!0&&(n=pd),{x:k0(n,"left","right"),y:k0(n,"top","bottom")}}function k0(n,a,s){return{min:B0(n,a),max:B0(n,s)}}function B0(n,a){return typeof n=="number"?n:n[a]||0}const _3=new WeakMap;class U3{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=te(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=a}start(a,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:u}=this.visualElement;if(u&&u.isPresent===!1)return;const d=b=>{s&&this.snapToCursor(Ts(b).point),this.stopAnimation()},f=(b,S)=>{const{drag:T,dragPropagation:j,onDragStart:E}=this.getProps();if(T&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cA(T),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=S,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cn(A=>{let L=this.getAxisMotionValue(A).get()||0;if(mn.test(L)){const{projection:U}=this.visualElement;if(U&&U.layout){const Y=U.layout.layoutBox[A];Y&&(L=pe(Y)*(parseFloat(L)/100))}}this.originPoint[A]=L}),E&&zt.update(()=>E(b,S),!1,!0),sd(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},h=(b,S)=>{this.latestPointerEvent=b,this.latestPanInfo=S;const{dragPropagation:T,dragDirectionLock:j,onDirectionLock:E,onDrag:C}=this.getProps();if(!T&&!this.openDragLock)return;const{offset:A}=S;if(j&&this.currentDirection===null){this.currentDirection=B3(A),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",S.point,A),this.updateAxis("y",S.point,A),this.visualElement.render(),C&&zt.update(()=>C(b,S),!1,!0)},m=(b,S)=>{this.latestPointerEvent=b,this.latestPanInfo=S,this.stop(b,S),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:y}=this.getProps();this.panSession=new Nx(a,{onSessionStart:d,onStart:f,onMove:h,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:o,contextWindow:jx(this.visualElement),element:this.visualElement.current})}stop(a,s){const o=a||this.latestPointerEvent,u=s||this.latestPanInfo,d=this.isDragging;if(this.cancel(),!d||!u||!o)return;const{velocity:f}=u;this.startAnimation(f);const{onDragEnd:h}=this.getProps();h&&zt.postRender(()=>h(o,u))}cancel(){this.isDragging=!1;const{projection:a,animationState:s}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(a,s,o){const{drag:u}=this.getProps();if(!o||!Qo(a,u,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(f=D3(f,this.constraints[a],this.elastic[a])),d.set(f)}resolveConstraints(){var d;const{dragConstraints:a,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(d=this.visualElement.projection)==null?void 0:d.layout,u=this.constraints;a&&$i(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=z3(o.layoutBox,a):this.constraints=!1,this.elastic=L3(s),u!==this.constraints&&!$i(a)&&o&&this.constraints&&!this.hasMutatedConstraints&&cn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=V3(o.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:s}=this.getProps();if(!a||!$i(a))return!1;const o=a.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const d=BA(o,u.root,this.visualElement.getTransformPagePoint());let f=O3(u.layout.layoutBox,d);if(s){const h=s(_A(f));this.hasMutatedConstraints=!!h,h&&(f=Fb(h))}return f}startAnimation(a){const{drag:s,dragMomentum:o,dragElastic:u,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},p=cn(y=>{if(!Qo(y,s,this.currentDirection))return;let b=m&&m[y]||{};(f===!0||f===y)&&(b={min:0,max:0});const S=u?200:1e6,T=u?40:1e7,j={type:"inertia",velocity:o?a[y]:0,bounceStiffness:S,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(y,j)});return Promise.all(p).then(h)}startAxisValueAnimation(a,s){const o=this.getAxisMotionValue(a);return sd(this.visualElement,a),o.start(Hd(a,o,0,s,this.visualElement,!1))}stopAnimation(){cn(a=>this.getAxisMotionValue(a).stop())}getAxisMotionValue(a){const s=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),u=o[s];return u||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){cn(s=>{const{drag:o}=this.getProps();if(!Qo(s,o,this.currentDirection))return;const{projection:u}=this.visualElement,d=this.getAxisMotionValue(s);if(u&&u.layout){const{min:f,max:h}=u.layout.layoutBox[s],m=d.get()||0;d.set(a[s]-kt(f,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!$i(s)||!o||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};cn(f=>{const h=this.getAxisMotionValue(f);if(h&&this.constraints!==!1){const m=h.get();u[f]=R3({min:m,max:m},this.constraints[f])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),cn(f=>{if(!Qo(f,a,null))return;const h=this.getAxisMotionValue(f),{min:m,max:p}=this.constraints[f];h.set(kt(m,p,u[f]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_3.set(this.visualElement,this);const a=this.visualElement.current,s=us(a,"pointerdown",p=>{const{drag:y,dragListener:b=!0}=this.getProps(),S=p.target,T=S!==a&&gA(S);y&&b&&!T&&this.start(p)});let o;const u=()=>{const{dragConstraints:p}=this.getProps();$i(p)&&p.current&&(this.constraints=this.resolveRefConstraints(),o||(o=k3(a,p.current,()=>this.scalePositionWithinConstraints())))},{projection:d}=this.visualElement,f=d.addEventListener("measure",u);d&&!d.layout&&(d.root&&d.root.updateScroll(),d.updateLayout()),zt.read(u);const h=ms(window,"resize",()=>this.scalePositionWithinConstraints()),m=d.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:y})=>{this.isDragging&&y&&(cn(b=>{const S=this.getAxisMotionValue(b);S&&(this.originPoint[b]+=p[b].translate,S.set(S.get()+p[b].translate))}),this.visualElement.render())}));return()=>{h(),s(),f(),m&&m(),o&&o()}}getProps(){const a=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:u=!1,dragConstraints:d=!1,dragElastic:f=pd,dragMomentum:h=!0}=a;return{...a,drag:s,dragDirectionLock:o,dragPropagation:u,dragConstraints:d,dragElastic:f,dragMomentum:h}}}function H0(n){let a=!0;return()=>{if(a){a=!1;return}n()}}function k3(n,a,s){const o=Zv(n,H0(s)),u=Zv(a,H0(s));return()=>{o(),u()}}function Qo(n,a,s){return(a===!0||a===n)&&(s===null||s===n)}function B3(n,a=10){let s=null;return Math.abs(n.y)>a?s="y":Math.abs(n.x)>a&&(s="x"),s}class H3 extends Sa{constructor(a){super(a),this.removeGroupControls=Je,this.removeListeners=Je,this.controls=new U3(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Je}update(){const{dragControls:a}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};a!==s&&(this.removeGroupControls(),a&&(this.removeGroupControls=a.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const jf=n=>(a,s)=>{n&&zt.update(()=>n(a,s),!1,!0)};class $3 extends Sa{constructor(){super(...arguments),this.removePointerDownListener=Je}onPointerDown(a){this.session=new Nx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:s,onPan:o,onPanEnd:u}=this.node.getProps();return{onSessionStart:jf(a),onStart:jf(s),onMove:jf(o),onEnd:(d,f)=>{delete this.session,u&&zt.postRender(()=>u(d,f))}}}mount(){this.removePointerDownListener=us(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Nf=!1;class G3 extends w.Component{componentDidMount(){const{visualElement:a,layoutGroup:s,switchLayoutGroup:o,layoutId:u}=this.props,{projection:d}=a;d&&(s.group&&s.group.add(d),o&&o.register&&u&&o.register(d),Nf&&d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:s,visualElement:o,drag:u,isPresent:d}=this.props,{projection:f}=o;return f&&(f.isPresent=d,a.layoutDependency!==s&&f.setOptions({...f.options,layoutDependency:s}),Nf=!0,u||a.layoutDependency!==s||s===void 0||a.isPresent!==d?f.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?f.promote():f.relegate()||zt.postRender(()=>{const h=f.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:a,layoutAnchor:s}=this.props,{projection:o}=a;o&&(o.options.layoutAnchor=s,o.root.didUpdate(),qd.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:u}=a;Nf=!0,u&&(u.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(u),o&&o.deregister&&o.deregister(u))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Mx(n){const[a,s]=Xj(),o=w.useContext(fr);return v.jsx(G3,{...n,layoutGroup:o,switchLayoutGroup:w.useContext(Ex),isPresent:a,safeToRemove:s})}const Y3={pan:{Feature:$3},drag:{Feature:H3,ProjectionNode:mx,MeasureLayout:Mx}};function $0(n,a,s){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",s==="Start");const u="onHover"+s,d=o[u];d&&zt.postRender(()=>d(a,Ts(a)))}class q3 extends Sa{mount(){const{current:a}=this.node;a&&(this.unmount=dA(a,(s,o)=>($0(this.node,o,"Start"),u=>$0(this.node,u,"End"))))}unmount(){}}class X3 extends Sa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!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=bs(ms(this.node.current,"focus",()=>this.onFocus()),ms(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function G0(n,a,s){const{props:o}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",s==="Start");const u="onTap"+(s==="End"?"":s),d=o[u];d&&zt.postRender(()=>d(a,Ts(a)))}class K3 extends Sa{mount(){const{current:a}=this.node;if(!a)return;const{globalTapTarget:s,propagate:o}=this.node.props;this.unmount=yA(a,(u,d)=>(G0(this.node,d,"Start"),(f,{success:h})=>G0(this.node,f,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(o==null?void 0:o.tap)===!1})}unmount(){}}const gd=new WeakMap,Cf=new WeakMap,F3=n=>{const a=gd.get(n.target);a&&a(n)},Z3=n=>{n.forEach(F3)};function Q3({root:n,...a}){const s=n||document;Cf.has(s)||Cf.set(s,{});const o=Cf.get(s),u=JSON.stringify(a);return o[u]||(o[u]=new IntersectionObserver(Z3,{root:n,...a})),o[u]}function J3(n,a,s){const o=Q3(a);return gd.set(n,s),o.observe(n),()=>{gd.delete(n),o.unobserve(n)}}const P3={some:0,all:1};class W3 extends Sa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var m;(m=this.stopObserver)==null||m.call(this);const{viewport:a={}}=this.node.getProps(),{root:s,margin:o,amount:u="some",once:d}=a,f={root:s?s.current:void 0,rootMargin:o,threshold:typeof u=="number"?u:P3[u]},h=p=>{const{isIntersecting:y}=p;if(this.isInView===y||(this.isInView=y,d&&!y&&this.hasEnteredView))return;y&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",y);const{onViewportEnter:b,onViewportLeave:S}=this.node.getProps(),T=y?b:S;T&&T(p)};this.stopObserver=J3(this.node.current,f,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:s}=this.node;["amount","margin","root"].some(I3(a,s))&&this.startObserver()}unmount(){var a;(a=this.stopObserver)==null||a.call(this),this.hasEnteredView=!1,this.isInView=!1}}function I3({viewport:n={}},{viewport:a={}}={}){return s=>n[s]!==a[s]}const tN={inView:{Feature:W3},tap:{Feature:K3},focus:{Feature:X3},hover:{Feature:q3}},eN={layout:{ProjectionNode:mx,MeasureLayout:Mx}},nN={...A3,...tN,...Y3,...eN},Dx=x3(nN,S3),Lr=w.forwardRef(function(a,s){return v.jsx(bw,{children:v.jsx("a",{...a,ref:s})})}),Pl={base:["relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-lg border text-base/6 font-semibold","px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)] sm:text-sm/6","focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500","data-disabled:opacity-50","*:data-[slot=icon]:-mx-0.5 *:data-[slot=icon]:my-0.5 *:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:self-center *:data-[slot=icon]:text-(--btn-icon) sm:*:data-[slot=icon]:my-1 sm:*:data-[slot=icon]:size-4 forced-colors:[--btn-icon:ButtonText] forced-colors:data-hover:[--btn-icon:ButtonText]"],solid:["border-transparent bg-(--btn-border)","dark:bg-(--btn-bg)","before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-lg)-1px)] before:bg-(--btn-bg)","before:shadow-sm","dark:before:hidden","dark:border-white/5","after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-lg)-1px)]","after:shadow-[inset_0_1px_--theme(--color-white/15%)]","data-active:after:bg-(--btn-hover-overlay) data-hover:after:bg-(--btn-hover-overlay)","dark:after:-inset-px dark:after:rounded-lg","data-disabled:before:shadow-none data-disabled:after:shadow-none"],outline:["border-zinc-950/10 text-zinc-950 data-active:bg-zinc-950/2.5 data-hover:bg-zinc-950/2.5","dark:border-white/15 dark:text-white dark:[--btn-bg:transparent] dark:data-active:bg-white/5 dark:data-hover:bg-white/5","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],plain:["border-transparent text-zinc-950 data-active:bg-zinc-950/5 data-hover:bg-zinc-950/5","dark:text-white dark:data-active:bg-white/10 dark:data-hover:bg-white/10","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],colors:{"dark/zinc":["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:text-white dark:[--btn-bg:var(--color-zinc-600)] dark:[--btn-hover-overlay:var(--color-white)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],light:["text-zinc-950 [--btn-bg:white] [--btn-border:var(--color-zinc-950)]/10 [--btn-hover-overlay:var(--color-zinc-950)]/2.5 data-active:[--btn-border:var(--color-zinc-950)]/15 data-hover:[--btn-border:var(--color-zinc-950)]/15","dark:text-white dark:[--btn-hover-overlay:var(--color-white)]/5 dark:[--btn-bg:var(--color-zinc-800)]","[--btn-icon:var(--color-zinc-500)] data-active:[--btn-icon:var(--color-zinc-700)] data-hover:[--btn-icon:var(--color-zinc-700)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],"dark/white":["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:text-zinc-950 dark:[--btn-bg:white] dark:[--btn-hover-overlay:var(--color-zinc-950)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)] dark:[--btn-icon:var(--color-zinc-500)] dark:data-active:[--btn-icon:var(--color-zinc-400)] dark:data-hover:[--btn-icon:var(--color-zinc-400)]"],dark:["text-white [--btn-bg:var(--color-zinc-900)] [--btn-border:var(--color-zinc-950)]/90 [--btn-hover-overlay:var(--color-white)]/10","dark:[--btn-hover-overlay:var(--color-white)]/5 dark:[--btn-bg:var(--color-zinc-800)]","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],white:["text-zinc-950 [--btn-bg:white] [--btn-border:var(--color-zinc-950)]/10 [--btn-hover-overlay:var(--color-zinc-950)]/2.5 data-active:[--btn-border:var(--color-zinc-950)]/15 data-hover:[--btn-border:var(--color-zinc-950)]/15","dark:[--btn-hover-overlay:var(--color-zinc-950)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-500)] data-hover:[--btn-icon:var(--color-zinc-500)]"],zinc:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-zinc-600)] [--btn-border:var(--color-zinc-700)]/90","dark:[--btn-hover-overlay:var(--color-white)]/5","[--btn-icon:var(--color-zinc-400)] data-active:[--btn-icon:var(--color-zinc-300)] data-hover:[--btn-icon:var(--color-zinc-300)]"],indigo:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-indigo-500)] [--btn-border:var(--color-indigo-600)]/90","[--btn-icon:var(--color-indigo-300)] data-active:[--btn-icon:var(--color-indigo-200)] data-hover:[--btn-icon:var(--color-indigo-200)]"],cyan:["text-cyan-950 [--btn-bg:var(--color-cyan-300)] [--btn-border:var(--color-cyan-400)]/80 [--btn-hover-overlay:var(--color-white)]/25","[--btn-icon:var(--color-cyan-500)]"],red:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-red-600)] [--btn-border:var(--color-red-700)]/90","[--btn-icon:var(--color-red-300)] data-active:[--btn-icon:var(--color-red-200)] data-hover:[--btn-icon:var(--color-red-200)]"],orange:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-orange-500)] [--btn-border:var(--color-orange-600)]/90","[--btn-icon:var(--color-orange-300)] data-active:[--btn-icon:var(--color-orange-200)] data-hover:[--btn-icon:var(--color-orange-200)]"],amber:["text-amber-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-amber-400)] [--btn-border:var(--color-amber-500)]/80","[--btn-icon:var(--color-amber-600)]"],yellow:["text-yellow-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-yellow-300)] [--btn-border:var(--color-yellow-400)]/80","[--btn-icon:var(--color-yellow-600)] data-active:[--btn-icon:var(--color-yellow-700)] data-hover:[--btn-icon:var(--color-yellow-700)]"],lime:["text-lime-950 [--btn-hover-overlay:var(--color-white)]/25 [--btn-bg:var(--color-lime-300)] [--btn-border:var(--color-lime-400)]/80","[--btn-icon:var(--color-lime-600)] data-active:[--btn-icon:var(--color-lime-700)] data-hover:[--btn-icon:var(--color-lime-700)]"],green:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-green-600)] [--btn-border:var(--color-green-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],emerald:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-emerald-600)] [--btn-border:var(--color-emerald-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],teal:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-teal-600)] [--btn-border:var(--color-teal-700)]/90","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],sky:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-sky-500)] [--btn-border:var(--color-sky-600)]/80","[--btn-icon:var(--color-white)]/60 data-active:[--btn-icon:var(--color-white)]/80 data-hover:[--btn-icon:var(--color-white)]/80"],blue:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-blue-600)] [--btn-border:var(--color-blue-700)]/90","[--btn-icon:var(--color-blue-400)] data-active:[--btn-icon:var(--color-blue-300)] data-hover:[--btn-icon:var(--color-blue-300)]"],violet:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-violet-500)] [--btn-border:var(--color-violet-600)]/90","[--btn-icon:var(--color-violet-300)] data-active:[--btn-icon:var(--color-violet-200)] data-hover:[--btn-icon:var(--color-violet-200)]"],purple:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-purple-500)] [--btn-border:var(--color-purple-600)]/90","[--btn-icon:var(--color-purple-300)] data-active:[--btn-icon:var(--color-purple-200)] data-hover:[--btn-icon:var(--color-purple-200)]"],fuchsia:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-fuchsia-500)] [--btn-border:var(--color-fuchsia-600)]/90","[--btn-icon:var(--color-fuchsia-300)] data-active:[--btn-icon:var(--color-fuchsia-200)] data-hover:[--btn-icon:var(--color-fuchsia-200)]"],pink:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-pink-500)] [--btn-border:var(--color-pink-600)]/90","[--btn-icon:var(--color-pink-300)] data-active:[--btn-icon:var(--color-pink-200)] data-hover:[--btn-icon:var(--color-pink-200)]"],rose:["text-white [--btn-hover-overlay:var(--color-white)]/10 [--btn-bg:var(--color-rose-500)] [--btn-border:var(--color-rose-600)]/90","[--btn-icon:var(--color-rose-300)] data-active:[--btn-icon:var(--color-rose-200)] data-hover:[--btn-icon:var(--color-rose-200)]"]}};w.forwardRef(function({color:a,outline:s,plain:o,className:u,children:d,...f},h){let m=Kt(u,Pl.base,s?Pl.outline:o?Pl.plain:Kt(Pl.solid,Pl.colors[a??"dark/zinc"]));return typeof f.href=="string"?v.jsx(Lr,{...f,className:m,ref:h,children:v.jsx(ba,{children:d})}):v.jsx(vs,{...f,className:Kt(m,"cursor-default"),ref:h,children:v.jsx(ba,{children:d})})});function ba({children:n}){return v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"absolute top-1/2 left-1/2 size-[max(100%,2.75rem)] -translate-x-1/2 -translate-y-1/2 pointer-fine:hidden","aria-hidden":"true"}),n]})}function aN({className:n,...a}){return v.jsx("nav",{...a,className:Kt(n,"flex flex-1 items-center gap-4 py-2.5")})}function iN({className:n,...a}){let s=w.useId();return v.jsx(vx,{id:s,children:v.jsx("div",{...a,className:Kt(n,"flex items-center gap-3")})})}function lN({className:n,...a}){return v.jsx("div",{"aria-hidden":"true",...a,className:Kt(n,"-ml-4 flex-1")})}const Id=w.forwardRef(function({current:a,className:s,children:o,...u},d){let f=Kt("relative flex min-w-0 items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 sm:text-sm/5","*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5","*:not-nth-2:last:data-[slot=icon]:ml-auto *:not-nth-2:last:data-[slot=icon]:size-5 sm:*:not-nth-2:last:data-[slot=icon]:size-4","*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 *:data-[slot=avatar]:[--avatar-radius:var(--radius-md)] sm:*:data-[slot=avatar]:size-6","data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950","data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950","dark:text-white dark:*:data-[slot=icon]:fill-zinc-400","dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white","dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white");return v.jsxs("span",{className:Kt(s,"relative"),children:[a&&v.jsx(Dx.span,{layoutId:"current-indicator",className:"absolute inset-x-2 -bottom-2.5 h-0.5 rounded-full bg-zinc-950 dark:bg-white"}),typeof u.href=="string"?v.jsx(Lr,{...u,className:f,"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})}):v.jsx(vs,{...u,className:Kt("cursor-default",f),"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})})]})});function sN(){return v.jsx("svg",{"data-slot":"icon",viewBox:"0 0 20 20","aria-hidden":"true",children:v.jsx("path",{d:"M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z"})})}function oN(){return v.jsx("svg",{"data-slot":"icon",viewBox:"0 0 20 20","aria-hidden":"true",children:v.jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})})}function rN({open:n,close:a,children:s}){return v.jsxs(nE,{open:n,onClose:a,className:"lg:hidden",children:[v.jsx(tE,{transition:!0,className:"fixed inset-0 bg-black/30 transition data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"}),v.jsx($y,{transition:!0,className:"fixed inset-y-0 w-full max-w-80 p-2 transition duration-300 ease-in-out data-closed:-translate-x-full",children:v.jsxs("div",{className:"flex h-full flex-col rounded-lg bg-ouro-deep shadow-xl ring-1 ring-ouro-moss/40",children:[v.jsx("div",{className:"-mb-3 px-4 pt-3",children:v.jsx(gy,{as:Id,"aria-label":"Close navigation",children:v.jsx(oN,{})})}),s]})})]})}function uN({navbar:n,sidebar:a,children:s}){let[o,u]=w.useState(!1);return v.jsxs("div",{className:"relative isolate flex min-h-svh w-full bg-ouro-void max-lg:flex-col",children:[v.jsx("div",{className:"fixed inset-y-0 left-0 w-64 max-lg:hidden border-r border-zinc-200 dark:border-ouro-moss/30",children:a}),v.jsx(rN,{open:o,close:()=>u(!1),children:a}),v.jsxs("header",{className:"flex items-center px-4 lg:hidden",children:[v.jsx("div",{className:"py-2.5",children:v.jsx(Id,{onClick:()=>u(!0),"aria-label":"Open navigation",children:v.jsx(sN,{})})}),v.jsx("div",{className:"min-w-0 flex-1",children:n})]}),v.jsx("main",{className:"flex flex-1 flex-col lg:min-w-0 lg:pl-64",children:v.jsx("div",{className:"grow bg-ouro-deep p-4 lg:p-8",children:v.jsx("div",{className:"mx-auto max-w-6xl",children:s})})})]})}function cN({className:n,...a}){return v.jsx("nav",{...a,className:Kt(n,"flex h-full min-h-0 flex-col")})}function fN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function dN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-1 flex-col overflow-y-auto p-4 [&>[data-slot=section]+[data-slot=section]]:mt-8")})}function hN({className:n,...a}){return v.jsx("div",{...a,className:Kt(n,"flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function Y0({className:n,...a}){let s=w.useId();return v.jsx(vx,{id:s,children:v.jsx("div",{...a,"data-slot":"section",className:Kt(n,"flex flex-col gap-0.5")})})}function q0({className:n,...a}){return v.jsx("h3",{...a,className:Kt(n,"mb-1 px-2 text-xs/6 font-medium text-zinc-500 dark:text-zinc-400")})}const mN=w.forwardRef(function({current:a,className:s,children:o,...u},d){let f=Kt("flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5","*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5","*:last:data-[slot=icon]:ml-auto *:last:data-[slot=icon]:size-5 sm:*:last:data-[slot=icon]:size-4","*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 sm:*:data-[slot=avatar]:size-6","data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950","data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950","data-current:*:data-[slot=icon]:fill-zinc-950","dark:text-white dark:*:data-[slot=icon]:fill-zinc-400","dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white","dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white","dark:data-current:*:data-[slot=icon]:fill-white");return v.jsxs("span",{className:Kt(s,"relative"),children:[a&&v.jsx(Dx.span,{layoutId:"current-indicator",className:"absolute inset-y-2 -left-4 w-0.5 rounded-full bg-zinc-950 dark:bg-white"}),typeof u.href=="string"?v.jsx(gy,{as:Lr,...u,className:f,"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})}):v.jsx(vs,{...u,className:Kt("cursor-default",f),"data-current":a?"true":void 0,ref:d,children:v.jsx(ba,{children:o})})]})});function pN({className:n,...a}){return v.jsx("span",{...a,className:Kt(n,"truncate")})}const gN={red:"bg-red-500/15 text-red-700 group-data-hover:bg-red-500/25 dark:bg-red-500/10 dark:text-red-400 dark:group-data-hover:bg-red-500/20",orange:"bg-orange-500/15 text-orange-700 group-data-hover:bg-orange-500/25 dark:bg-orange-500/10 dark:text-orange-400 dark:group-data-hover:bg-orange-500/20",amber:"bg-amber-400/20 text-amber-700 group-data-hover:bg-amber-400/30 dark:bg-amber-400/10 dark:text-amber-400 dark:group-data-hover:bg-amber-400/15",yellow:"bg-yellow-400/20 text-yellow-700 group-data-hover:bg-yellow-400/30 dark:bg-yellow-400/10 dark:text-yellow-300 dark:group-data-hover:bg-yellow-400/15",lime:"bg-lime-400/20 text-lime-700 group-data-hover:bg-lime-400/30 dark:bg-lime-400/10 dark:text-lime-300 dark:group-data-hover:bg-lime-400/15",green:"bg-green-500/15 text-green-700 group-data-hover:bg-green-500/25 dark:bg-green-500/10 dark:text-green-400 dark:group-data-hover:bg-green-500/20",emerald:"bg-emerald-500/15 text-emerald-700 group-data-hover:bg-emerald-500/25 dark:bg-emerald-500/10 dark:text-emerald-400 dark:group-data-hover:bg-emerald-500/20",teal:"bg-teal-500/15 text-teal-700 group-data-hover:bg-teal-500/25 dark:bg-teal-500/10 dark:text-teal-300 dark:group-data-hover:bg-teal-500/20",cyan:"bg-cyan-400/20 text-cyan-700 group-data-hover:bg-cyan-400/30 dark:bg-cyan-400/10 dark:text-cyan-300 dark:group-data-hover:bg-cyan-400/15",sky:"bg-sky-500/15 text-sky-700 group-data-hover:bg-sky-500/25 dark:bg-sky-500/10 dark:text-sky-300 dark:group-data-hover:bg-sky-500/20",blue:"bg-blue-500/15 text-blue-700 group-data-hover:bg-blue-500/25 dark:text-blue-400 dark:group-data-hover:bg-blue-500/25",indigo:"bg-indigo-500/15 text-indigo-700 group-data-hover:bg-indigo-500/25 dark:text-indigo-400 dark:group-data-hover:bg-indigo-500/20",violet:"bg-violet-500/15 text-violet-700 group-data-hover:bg-violet-500/25 dark:text-violet-400 dark:group-data-hover:bg-violet-500/20",purple:"bg-purple-500/15 text-purple-700 group-data-hover:bg-purple-500/25 dark:text-purple-400 dark:group-data-hover:bg-purple-500/20",fuchsia:"bg-fuchsia-400/15 text-fuchsia-700 group-data-hover:bg-fuchsia-400/25 dark:bg-fuchsia-400/10 dark:text-fuchsia-400 dark:group-data-hover:bg-fuchsia-400/20",pink:"bg-pink-400/15 text-pink-700 group-data-hover:bg-pink-400/25 dark:bg-pink-400/10 dark:text-pink-400 dark:group-data-hover:bg-pink-400/20",rose:"bg-rose-400/15 text-rose-700 group-data-hover:bg-rose-400/25 dark:bg-rose-400/10 dark:text-rose-400 dark:group-data-hover:bg-rose-400/20",zinc:"bg-zinc-600/10 text-zinc-700 group-data-hover:bg-zinc-600/20 dark:bg-white/5 dark:text-zinc-400 dark:group-data-hover:bg-white/10"};function Yt({color:n="zinc",className:a,...s}){return v.jsx("span",{...s,className:Kt(a,"inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-sm/5 font-medium sm:text-xs/5 forced-colors:outline",gN[n])})}w.forwardRef(function({color:a="zinc",className:s,children:o,...u},d){let f=Kt(s,"group relative inline-flex rounded-md focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500");return typeof u.href=="string"?v.jsx(Lr,{...u,className:f,ref:d,children:v.jsx(ba,{children:v.jsx(Yt,{color:a,children:o})})}):v.jsx(vs,{...u,className:f,ref:d,children:v.jsx(ba,{children:v.jsx(Yt,{color:a,children:o})})})});const vN={"owed-reply":"red","blocking-obligation":"red","broken-return":"red","stale-delegation":"yellow","return-ready":"lime","overdue-habit":"yellow"},yN={"owed-reply":"owed reply","blocking-obligation":"blocking","broken-return":"broken return","stale-delegation":"stale","return-ready":"ready to return","overdue-habit":"overdue"},bN={"owed-reply":"Someone spoke last and is waiting for your response","blocking-obligation":"This obligation is open and blocking forward progress","broken-return":"Work was done but the result was never returned to the requester","stale-delegation":"This was delegated to you and hasn't been addressed","return-ready":"The result is ready — deliver it to close the loop","overdue-habit":"This routine is past its scheduled cadence"};function xN({view:n,deskPrefs:a}){const s=Qi(),[o,u]=w.useState(null),d=n.agent,f=n.work,h=n.inner,m=n.activity,p=d.degraded,y=d.attention,b=f.tasks,S=f.obligations,T=f.sessions,j=f.coding,E=d.senses??[],C=f.bridges??[];return w.useEffect(()=>{ge(`/agents/${encodeURIComponent(d.agentName)}/needs-me`).then(u)},[d.agentName]),v.jsxs("div",{className:"space-y-6",children:[o&&o.items.length>0&&v.jsxs("div",{className:"rounded-xl bg-ouro-fang/5 p-4 ring-1 ring-ouro-fang/15",children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-fang",children:["Needs me now (",o.items.length,")"]}),v.jsx("div",{className:"mt-2 space-y-1.5",children:o.items.map((A,L)=>v.jsxs("button",{onClick:()=>A.ref&&s({tab:A.ref.tab,focus:A.ref.focus}),className:"flex w-full items-start gap-2.5 rounded-lg bg-ouro-void/40 px-3 py-2.5 text-left ring-1 ring-ouro-moss/10 hover:ring-ouro-fang/20 transition-colors",children:[v.jsx(Yt,{color:vN[A.urgency]??"zinc",children:yN[A.urgency]??A.urgency}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"text-sm font-medium text-ouro-bone",children:A.label}),v.jsx("p",{className:"text-xs text-ouro-shadow truncate",children:A.detail}),v.jsx("p",{className:"text-[10px] italic text-ouro-shadow/60 mt-0.5",children:bN[A.urgency]??""})]}),A.ageMs!=null&&v.jsx("span",{className:"shrink-0 text-xs tabular-nums text-ouro-shadow",children:A.ageMs<36e5?`${Math.floor(A.ageMs/6e4)}m`:A.ageMs<864e5?`${Math.floor(A.ageMs/36e5)}h`:`${Math.floor(A.ageMs/864e5)}d`})]},L))})]}),(a==null?void 0:a.carrying)&&v.jsxs("div",{className:"rounded-xl bg-ouro-moss/10 p-4 ring-1 ring-ouro-glow/8",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"What I'm carrying"}),v.jsx("p",{className:"mt-1 text-sm leading-relaxed text-ouro-bone",children:a.carrying})]}),(()=>{const A=(a==null?void 0:a.pinnedConstellations)??[];return A.length===0?null:v.jsxs("div",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Pinned threads"}),v.jsx("div",{className:"mt-2 space-y-2",children:A.map((L,U)=>v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-medium text-ouro-bone",children:L.label}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5",children:[(L.friendIds??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"sessions"}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["friend:",Y.slice(0,8),"…"]},Y)),(L.taskRefs??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"work"}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["task:",Y]},Y)),(L.bridgeIds??[]).map(Y=>v.jsxs("button",{onClick:()=>s({tab:"connections",focus:Y}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2",children:["bridge:",Y.slice(0,8),"…"]},Y))]})]},U))})]})})(),v.jsxs("div",{className:"rounded-xl bg-ouro-moss/15 p-4 ring-1 ring-ouro-glow/10 sm:p-5",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"Center of gravity"}),v.jsx("p",{className:"mt-1 font-display text-xl italic font-semibold text-ouro-bone sm:text-2xl",children:y.label}),v.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-ouro-mist",children:[d.agentName," has"," ",v.jsxs(Jo,{tab:"work",children:[b.liveCount," live tasks"]}),","," ",v.jsxs(Jo,{tab:"work",children:[S.openCount," obligations"]}),","," ",v.jsxs(Jo,{tab:"work",children:[j.activeCount," coding lanes"]}),", and"," ",v.jsxs(Jo,{tab:"sessions",children:[T.liveCount," live sessions"]}),"."]}),p.status==="degraded"&&p.issues.length>0&&v.jsxs("div",{className:"mt-3 space-y-1",children:[p.issues.slice(0,5).map((A,L)=>v.jsxs("button",{onClick:()=>s({tab:"runtime"}),className:"flex w-full items-start gap-2 rounded-lg bg-ouro-fang/5 px-3 py-2 text-left text-sm ring-1 ring-ouro-fang/10 hover:ring-ouro-fang/25 transition-colors",children:[v.jsx("span",{className:"mt-0.5 h-2 w-2 shrink-0 rounded-full bg-ouro-fang"}),v.jsxs("span",{className:"text-ouro-mist",children:[v.jsx("span",{className:"font-semibold text-ouro-fang",children:A.code}),v.jsxs("span",{className:"text-ouro-shadow",children:[" — ",dn(A.detail,80)]})]})]},L)),p.issues.length>5&&v.jsxs("button",{onClick:()=>s({tab:"runtime"}),className:"text-xs text-ouro-glow underline underline-offset-2",children:["+",p.issues.length-5," more issues"]})]})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[v.jsx(Po,{label:"Tasks",value:b.liveCount,sub:`${b.blockedCount} blocked`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Obligations",value:S.openCount,sub:`${T.liveCount} sessions`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Coding",value:j.activeCount,sub:`${j.blockedCount} blocked`,onClick:()=>s({tab:"work"})}),v.jsx(Po,{label:"Inner",value:h.status,sub:dn(h.summary??"",30),onClick:()=>s({tab:"inner"})})]}),v.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[v.jsx(Wo,{title:"Senses",children:E.length>0?v.jsx(SN,{items:E}):v.jsx(Mf,{children:"No active senses"})}),v.jsx(Wo,{title:"Bridges",children:C.length>0?v.jsx("div",{className:"flex flex-wrap gap-1.5",children:C.map(A=>v.jsx("button",{onClick:()=>s({tab:"connections",focus:A}),children:v.jsx(Yt,{color:"lime",children:A})},A))}):v.jsx(Mf,{children:"No active bridges"})})]}),(()=>{var U;const L=(((U=f.obligations)==null?void 0:U.items)??[]).filter(Y=>Y.status==="fulfilled");return L.length===0?null:v.jsx(Wo,{title:"Recently closed",children:v.jsx("div",{className:"space-y-1",children:L.slice(0,3).map((Y,X)=>v.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-3 py-2 bg-ouro-glow/5 ring-1 ring-ouro-glow/10",children:[v.jsx(Yt,{color:"lime",children:"closed"}),v.jsx("p",{className:"text-sm text-ouro-mist truncate",children:dn(Y.content,80)}),v.jsx("span",{className:"shrink-0 text-xs text-ouro-shadow",children:Qe(Y.updatedAt)})]},X))})})})(),v.jsx(Wo,{title:"Recent activity",children:m.recent.length>0?v.jsx("div",{className:"space-y-1",children:m.recent.map((A,L)=>{const U=A.kind==="coding"||A.kind==="obligation"?"work":A.kind==="session"?"sessions":"inner";return v.jsxs("button",{onClick:()=>s({tab:U}),className:"flex w-full flex-col gap-0.5 rounded-lg px-3 py-2.5 text-left hover:bg-ouro-moss/10 transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{children:A.kind}),v.jsx("span",{className:"text-xs text-ouro-shadow",children:Qe(A.at)})]}),v.jsx("p",{className:"truncate text-sm font-medium text-ouro-bone",children:dn(A.label,100)}),v.jsx("p",{className:"truncate text-xs text-ouro-shadow",children:dn(A.detail,80)})]},L)})}):v.jsx(Mf,{children:"No recent activity yet."})})]})}function Jo({tab:n,children:a}){const s=Qi();return v.jsx("button",{onClick:()=>s({tab:n}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow transition-colors",children:a})}function Po({label:n,value:a,sub:s,onClick:o}){return v.jsxs("button",{onClick:o,className:"rounded-xl bg-ouro-void/50 p-3 text-left ring-1 ring-ouro-moss/20 hover:ring-ouro-glow/20 transition-all",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow",children:n}),v.jsx("p",{className:"mt-1 text-xl font-semibold tabular-nums text-ouro-bone",children:a}),v.jsx("p",{className:"mt-0.5 truncate text-xs text-ouro-shadow",children:s})]})}function Wo({title:n,children:a}){return v.jsxs("div",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n}),v.jsx("div",{className:"mt-2",children:a})]})}function SN({items:n}){return v.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(a=>v.jsx(Yt,{color:"lime",children:a},a))})}function Mf({children:n}){return v.jsx("p",{className:"text-sm text-ouro-shadow",children:n})}function zx(n){const a=n.function.name,s=TN(n.function.arguments);return a==="settle"?{kind:"response",name:a,id:n.id,deliveredText:s.answer??null,delegatedThought:null,metadata:s.intent??null,rawArgs:null}:a==="ponder"?{kind:"delegation",name:a,id:n.id,deliveredText:s.say??null,delegatedThought:s.thought??null,metadata:null,rawArgs:null}:a==="rest"?{kind:"rest",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:null,rawArgs:null}:a==="observe"?{kind:"observe",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:s.reason??null,rawArgs:null}:a==="surface"?{kind:"surface",name:a,id:n.id,deliveredText:s.content??null,delegatedThought:null,metadata:s.delegationId??s.friendId??null,rawArgs:null}:{kind:"action",name:a,id:n.id,deliveredText:null,delegatedThought:null,metadata:null,rawArgs:n.function.arguments}}function TN(n){try{const a=JSON.parse(n);if(a&&typeof a=="object")return a}catch{}return{}}const X0={"needs-reply":{color:"red",label:"needs reply"},"on-hold":{color:"yellow",label:"on hold"},monitoring:{color:"zinc",label:"monitoring"},idle:{color:"zinc",label:"idle"}};function wN({agentName:n,focus:a,onFocusConsumed:s,deskPrefs:o}){Qi();const[u,d]=w.useState(null),[f,h]=w.useState(null),[m,p]=w.useState(null),[y,b]=w.useState(!1);w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/sessions`).then(E=>{d(E),a&&(S(a),s==null||s())})},[n,a]);function S(E){if(f===E){h(null),p(null);return}h(E),p(null),b(!0);const[C,A,L]=E.split("/");ge(`/agents/${encodeURIComponent(n)}/sessions/${encodeURIComponent(C)}/${encodeURIComponent(A)}/${encodeURIComponent(L)}`).then(p).catch(()=>p(null)).finally(()=>b(!1))}const T=new Set((o==null?void 0:o.starredFriends)??[]);if(!u)return v.jsx(Ox,{label:"Loading sessions"});const j=[...u.items].sort((E,C)=>{const A=T.has(E.friendId)?0:1,L=T.has(C.friendId)?0:1;return A-L});return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:[u.totalCount," sessions · ",u.activeCount," active · ",u.staleCount," stale"]}),v.jsx("div",{className:"space-y-1.5",children:j.map(E=>{var Z;const C=T.has(E.friendId),A=`${E.friendId}/${E.channel}/${E.key}`,L=f===A,U=X0[E.replyState]??X0.idle,Y=((Z=E.lastUsage)==null?void 0:Z.total_tokens)??E.estimatedTokens??0,tt=Y>0?Math.min(100,Math.round(Y/8e4*100)):0;return v.jsxs("div",{children:[v.jsxs("button",{onClick:()=>S(A),className:`flex w-full flex-col gap-1.5 rounded-lg px-3 py-3 text-left transition-colors ring-1 ${L?"bg-ouro-moss/15 ring-ouro-glow/20":"ring-ouro-moss/15 hover:bg-ouro-moss/8"}`,children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C&&v.jsx("span",{className:"text-ouro-gold",title:"Starred",children:"★"}),v.jsx("span",{className:"truncate font-medium text-ouro-bone",children:E.friendName}),v.jsxs("span",{className:"shrink-0 text-xs text-ouro-shadow",children:["via ",E.channel]}),v.jsx(Yt,{color:U.color,children:U.label})]}),v.jsx("span",{className:"shrink-0 text-xs tabular-nums text-ouro-shadow",children:Qe(E.lastActivityAt)})]}),E.latestUserExcerpt&&v.jsx("p",{className:"truncate text-sm text-ouro-shadow",children:dn(E.latestUserExcerpt,120)}),v.jsxs("div",{className:"flex items-center gap-3 text-xs text-ouro-shadow",children:[v.jsxs("span",{className:"tabular-nums",children:[E.messageCount," msgs"]}),E.lastUsage&&v.jsxs("span",{className:"tabular-nums",children:[E.lastUsage.total_tokens.toLocaleString()," tok"]}),tt>0&&v.jsxs("div",{className:"flex items-center gap-1.5 flex-1 max-w-32",title:"Context pressure — steady state oscillates between 80-100%",children:[v.jsx("div",{className:"h-1 flex-1 rounded-full bg-ouro-moss/20",children:v.jsx("div",{className:`h-1 rounded-full transition-all ${tt>100?"bg-ouro-fang":tt>80?"bg-ouro-gold":"bg-ouro-glow"}`,style:{width:`${Math.min(100,tt)}%`}})}),v.jsxs("span",{className:"tabular-nums text-[10px]",children:[tt,"%"]})]})]})]}),L&&v.jsx(EN,{loading:y,transcript:m})]},A)})})]})}function EN({loading:n,transcript:a}){const s=w.useRef(null);return w.useEffect(()=>{a&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[a]),v.jsxs("div",{ref:s,className:"mt-1 max-h-[70vh] overflow-y-auto rounded-lg bg-ouro-void/60 p-3 ring-1 ring-ouro-moss/15",children:[n&&v.jsx(Ox,{label:"Loading transcript"}),a&&v.jsx(AN,{messages:a.messages,usage:a.lastUsage})]})}function AN({messages:n,usage:a}){const s=n.filter(h=>h.role==="system"),o=n.filter(h=>h.role!=="system"),[u,d]=w.useState(!1),f=new Map;for(const h of o)h.role==="tool"&&h.tool_call_id&&f.set(h.tool_call_id,h);return v.jsxs("div",{className:"space-y-0.5",children:[a&&v.jsxs("p",{className:"pb-2 font-mono text-[10px] text-ouro-shadow",children:[a.input_tokens.toLocaleString()," in · ",a.output_tokens.toLocaleString()," out · ",a.total_tokens.toLocaleString()," total"]}),s.length>0&&v.jsxs("div",{className:"pb-2 mb-2 border-b border-ouro-moss/15",children:[v.jsxs("button",{onClick:()=>d(!u),className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow hover:text-ouro-mist transition-colors",children:[u?"▼":"▶"," system context (",s.length,")"]}),u&&s.map(h=>v.jsx("div",{className:"mt-2 max-h-60 overflow-y-auto rounded bg-ouro-void/40 p-2 text-xs text-ouro-shadow whitespace-pre-wrap break-words",children:h.content},h.index))]}),o.map(h=>h.role==="tool"?null:h.role==="user"?v.jsx(jN,{msg:h},h.index):h.role==="assistant"?v.jsx(NN,{msg:h,toolResults:f},h.index):null)]})}function jN({msg:n}){return v.jsx("div",{className:"flex justify-start py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-bl-sm bg-ouro-moss/25 px-3.5 py-2 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-gold/70",children:"user"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",n.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:n.content})]})})}function NN({msg:n,toolResults:a}){const s=(n.tool_calls??[]).map(zx),o=s.filter(f=>f.kind!=="action"),u=s.filter(f=>f.kind==="action"),d=[];for(const f of o)f.kind==="response"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.metadata&&f.metadata!=="complete"&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["intent: ",f.metadata]})]})},f.id)):f.kind==="delegation"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),f.deliveredText&&v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.delegatedThought&&v.jsxs("div",{className:"mt-2 rounded-lg bg-ouro-moss/20 px-2.5 py-1.5 ring-1 ring-ouro-glow/8",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/60",children:"→ inner dialog"}),v.jsx("p",{className:"mt-0.5 text-xs text-ouro-mist",children:f.delegatedThought})]})]})},f.id)):f.kind==="surface"?d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-scale/12 px-3.5 py-2 ring-1 ring-ouro-scale/15",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"surfaced"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:f.deliveredText}),f.metadata&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["→ ",f.metadata]})]})},f.id)):f.kind==="rest"?d.push(v.jsx("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/50",children:"— resting —"},f.id)):f.kind==="observe"&&d.push(v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/50",children:["— observed",f.metadata?`: ${f.metadata}`:""," —"]},f.id));return n.content&&o.length===0&&d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] sm:max-w-[75%] rounded-2xl rounded-br-sm bg-ouro-glow/8 px-3.5 py-2 ring-1 ring-ouro-glow/12",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/70 mb-0.5",children:"agent"}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:n.content})]})},`${n.index}-content`)),u.length>0&&d.push(v.jsx("div",{className:"flex justify-end py-1",children:v.jsx("div",{className:"max-w-[85%] sm:max-w-[75%] space-y-1",children:u.map(f=>v.jsx(CN,{call:f,result:a.get(f.id)},f.id))})},`${n.index}-tools`)),v.jsx(v.Fragment,{children:d})}function CN({call:n,result:a}){const[s,o]=w.useState(!1);return v.jsxs("button",{onClick:()=>o(!s),className:"w-full text-left rounded-lg bg-ouro-moss/10 px-2.5 py-1.5 text-sm ring-1 ring-ouro-moss/12 hover:ring-ouro-glow/15 transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-mono text-xs text-ouro-glow",children:n.name}),!s&&v.jsx("span",{className:"text-[10px] text-ouro-shadow",children:"tap to inspect"})]}),s&&v.jsxs(v.Fragment,{children:[n.rawArgs&&v.jsx("pre",{className:"mt-1.5 max-h-24 overflow-y-auto rounded bg-ouro-void/40 p-1.5 font-mono text-[11px] text-ouro-shadow whitespace-pre-wrap break-words",children:n.rawArgs}),a&&v.jsxs("div",{className:"mt-1.5 border-t border-ouro-moss/15 pt-1.5",children:[v.jsx(Yt,{children:"result"}),v.jsx("pre",{className:"mt-1 max-h-32 overflow-y-auto rounded bg-ouro-void/40 p-1.5 font-mono text-[11px] text-ouro-mist whitespace-pre-wrap break-words",children:a.content})]})]})]})}function Ox({label:n}){return v.jsxs("div",{className:"flex items-center gap-2 py-6",children:[v.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-ouro-glow"}),v.jsxs("span",{className:"font-mono text-xs text-ouro-shadow",children:[n,"…"]})]})}function MN({agentName:n,view:a,focus:s,onFocusConsumed:o}){var S,T,j;const u=Qi(),[d,f]=w.useState(null),h=a.work,m=h.obligations,p=h.tasks;w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/coding`).then(f)},[n]);const y=(d==null?void 0:d.items)??[],b=new Map;for(const E of y){const C=E.obligationId;C&&(b.has(C)||b.set(C,[]),b.get(C).push(E))}return v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{children:[v.jsx(Df,{label:`Obligations (${m.openCount} open)`}),((S=m.items)==null?void 0:S.length)>0?v.jsx("div",{className:"mt-3 space-y-3",children:m.items.map(E=>{const C=b.get(E.id)??[];return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx(Yt,{color:E.status==="pending"?"yellow":E.status==="fulfilled"?"lime":"zinc",children:E.status}),v.jsx("span",{className:"text-sm font-medium text-ouro-bone",children:dn(E.content,120)})]}),E.origin&&v.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[v.jsx("span",{className:"text-ouro-shadow",children:"triggered from"}),v.jsxs("button",{onClick:()=>u({tab:"sessions",focus:`${E.origin.friendId}/${E.origin.channel}/${E.origin.key}`}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:[E.origin.friendId.slice(0,8),"…/",E.origin.channel,"/",E.origin.key]})]}),E.currentSurface&&v.jsxs("div",{className:"mt-1 text-xs text-ouro-mist",children:["surface: ",v.jsx("span",{className:"text-ouro-bone",children:E.currentSurface.kind})," — ",E.currentSurface.label]}),C.length>0&&v.jsxs("div",{className:"mt-2 space-y-1",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow",children:"Linked coding"}),C.map(A=>v.jsxs("div",{className:"flex items-center gap-2 rounded bg-ouro-moss/10 px-2 py-1 text-xs",children:[v.jsx(Yt,{color:A.status==="failed"?"red":A.status==="running"?"lime":"zinc",children:A.status}),v.jsxs("span",{className:"text-ouro-mist truncate",children:[A.runner," — ",A.workdir]})]},A.id))]}),E.nextAction&&v.jsxs("p",{className:"mt-1.5 text-xs text-ouro-mist",children:["Next: ",E.nextAction]}),v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow",children:Qe(E.updatedAt)})]},E.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No open obligations."})]}),v.jsxs("section",{children:[v.jsx(Df,{label:`Coding lanes (${y.length})`}),y.length>0?v.jsx("div",{className:"mt-3 space-y-2",children:y.map(E=>{const C=E.status,A=C==="failed",L=E.failure;return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{color:A?"red":C==="running"?"lime":C==="completed"?"zinc":"yellow",children:C}),v.jsx("span",{className:"text-sm font-medium text-ouro-bone",children:E.runner}),v.jsx("span",{className:"truncate text-xs text-ouro-shadow",children:E.workdir})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-2",children:[E.obligationId&&v.jsxs("button",{onClick:()=>u({tab:"work",focus:E.obligationId}),className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",E.obligationId.slice(0,20),"…"]}),E.taskRef&&v.jsxs("span",{className:"text-xs text-ouro-glow",children:["task: ",E.taskRef]}),E.originSession&&v.jsx("button",{onClick:()=>{const U=E.originSession;u({tab:"sessions",focus:`${U.friendId}/${U.channel}/${U.key}`})},className:"text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:"origin session"})]}),E.checkpoint&&v.jsx("p",{className:"mt-1.5 text-xs text-ouro-mist",children:dn(E.checkpoint,100)}),v.jsxs("p",{className:"mt-1 text-xs text-ouro-shadow",children:["pid ",E.pid??"–"," · restarts ",E.restartCount," · ",Qe(E.lastActivityAt)]}),A&&L&&v.jsxs("div",{className:"mt-2 rounded bg-ouro-fang/5 p-2 text-xs ring-1 ring-ouro-fang/15",children:[v.jsx("span",{className:"font-semibold text-ouro-fang",children:"FAILURE:"})," ",v.jsxs("span",{className:"text-ouro-mist",children:[L.command," exited ",String(L.code??L.signal)]}),L.stderrTail&&v.jsx("pre",{className:"mt-1 max-h-20 overflow-y-auto font-mono text-[11px] text-ouro-shadow whitespace-pre-wrap",children:L.stderrTail})]})]},E.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No coding sessions."})]}),v.jsxs("section",{children:[v.jsx(Df,{label:`Tasks (${p.liveCount} live, ${p.blockedCount} blocked)`}),((T=p.liveTaskNames)==null?void 0:T.length)>0?v.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.liveTaskNames.map(E=>v.jsx(Yt,{children:E},E))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No live tasks."}),((j=p.actionRequired)==null?void 0:j.length)>0&&v.jsxs("div",{className:"mt-3",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-fang",children:"Action required"}),v.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:p.actionRequired.map(E=>v.jsx(Yt,{color:"red",children:E},E))})]})]})]})}function Df({label:n}){return v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n})}function DN({agentName:n,focus:a,onFocusConsumed:s}){const o=Qi(),[u,d]=w.useState(null),[f,h]=w.useState(null),[m,p]=w.useState(null);w.useEffect(()=>{const T=`/agents/${encodeURIComponent(n)}`;Promise.all([ge(`${T}/attention`).then(d),ge(`${T}/bridges`).then(h),ge(`${T}/friends`).then(p)])},[n]);const y=(u==null?void 0:u.queueItems)??[],b=(f==null?void 0:f.items)??[],S=(m==null?void 0:m.friends)??[];return v.jsxs("div",{className:"space-y-8",children:[v.jsxs("section",{children:[v.jsx(zf,{label:`Who is waiting (${(u==null?void 0:u.queueLength)??0})`}),y.length>0?v.jsx("div",{className:"mt-3 space-y-2",children:y.map((T,j)=>v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-3 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:()=>o({tab:"sessions"}),className:"font-medium text-ouro-bone hover:text-ouro-glow transition-colors",children:T.friendName}),v.jsxs("span",{className:"text-xs text-ouro-shadow",children:["via ",T.channel]}),v.jsxs(Yt,{color:"yellow",children:["waiting ",Qe(new Date(T.timestamp).toISOString())]})]}),v.jsx("p",{className:"mt-1 text-sm text-ouro-mist",children:dn(T.delegatedContent,140)}),v.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-2 text-xs",children:[T.bridgeId&&v.jsxs("button",{onClick:()=>o({tab:"connections",focus:T.bridgeId}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["bridge: ",T.bridgeId.slice(0,12),"…"]}),T.obligationId&&v.jsxs("button",{onClick:()=>o({tab:"work",focus:T.obligationId}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",T.obligationId.slice(0,16),"…"]})]})]},j))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"Nobody waiting."})]}),v.jsxs("section",{children:[v.jsx(zf,{label:`Bridges (${(f==null?void 0:f.totalCount)??0})`}),b.length>0?v.jsx("div",{className:"mt-3 space-y-3",children:b.map(T=>{const j=T.attachedSessions??[],E=T.task,C=T.lifecycle==="active";return v.jsxs("div",{className:`rounded-lg px-3 py-3 ring-1 ${C?"bg-ouro-moss/10 ring-ouro-glow/12":"bg-ouro-void/40 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx(Yt,{color:C?"lime":"zinc",children:T.lifecycle}),v.jsx("p",{className:"font-medium text-ouro-bone",children:T.objective})]}),T.summary&&v.jsx("p",{className:"mt-1 text-sm text-ouro-mist",children:dn(T.summary,160)}),j.length>0&&v.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:j.map((A,L)=>v.jsxs("button",{onClick:()=>o({tab:"sessions",focus:`${A.friendId}/${A.channel}/${A.key}`}),className:"rounded-md bg-ouro-moss/10 px-2 py-0.5 font-mono text-[11px] text-ouro-glow ring-1 ring-ouro-moss/12 hover:ring-ouro-glow/25 transition-colors",children:[A.friendId,"/",A.channel,"/",A.key]},L))}),E&&v.jsxs("p",{className:"mt-1.5 text-xs",children:[v.jsxs("button",{onClick:()=>o({tab:"work"}),className:"text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["task: ",E.taskName]}),v.jsxs("span",{className:"text-ouro-shadow",children:[" (",E.mode,")"]})]}),v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow",children:Qe(T.updatedAt)})]},T.id)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No bridges."})]}),v.jsxs("section",{children:[v.jsx(zf,{label:`Friends (${(m==null?void 0:m.totalFriends)??0})`}),S.length>0?v.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(T=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("button",{onClick:()=>o({tab:"sessions"}),className:"font-medium text-ouro-bone hover:text-ouro-glow transition-colors",children:T.friendName}),v.jsxs("p",{className:"text-xs text-ouro-shadow",children:[T.channels.join(", ")," · ",T.sessionCount," sessions",T.lastActivityAt&&v.jsxs(v.Fragment,{children:[" · ",Qe(T.lastActivityAt)]})]})]}),v.jsxs("div",{className:"shrink-0 text-right",children:[v.jsx("p",{className:"tabular-nums text-sm font-medium text-ouro-bone",children:T.totalTokens.toLocaleString()}),v.jsx("p",{className:"text-[10px] text-ouro-shadow",children:"tokens"})]})]},T.friendId))}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No friends."})]})]})}function zf({label:n}){return v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:n})}function zN({agentName:n,view:a}){var C;const s=Qi(),[o,u]=w.useState(null),[d,f]=w.useState(null),[h,m]=w.useState(!1),p=a.inner;w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/habits`).then(u)},[n]);function y(){if(d){m(!h);return}ge(`/agents/${encodeURIComponent(n)}/inner-transcript`).then(A=>{f(A),m(!0)})}const b=(o==null?void 0:o.items)??[],S=b.filter(A=>A.isOverdue),T=b.filter(A=>A.status==="active"&&!A.isOverdue),j=b.filter(A=>A.status==="paused"),E=b.find(A=>{var L;return((L=A.name)==null?void 0:L.toLowerCase())==="heartbeat"});return v.jsxs("div",{className:"space-y-8",children:[E&&v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Heartbeat"}),v.jsx("div",{className:`mt-2 rounded-xl p-4 ring-1 ${E.isOverdue?"bg-ouro-fang/5 ring-ouro-fang/15":"bg-ouro-moss/10 ring-ouro-glow/10"}`,children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${E.isOverdue?"bg-ouro-fang animate-pulse":"bg-ouro-glow"}`}),v.jsx("span",{className:"font-medium text-ouro-bone",children:E.isOverdue?"Overdue":"Healthy"}),v.jsxs("span",{className:"text-xs text-ouro-shadow",children:["every ",E.cadence," · last ",E.lastRun?Qe(E.lastRun):"never"]})]})})]}),v.jsx("section",{children:v.jsxs("div",{className:"rounded-xl bg-ouro-moss/15 p-4 ring-1 ring-ouro-glow/10",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-ouro-glow",children:"Inner work"}),v.jsx("p",{className:"mt-1 font-display text-xl italic font-semibold text-ouro-bone",children:p.status}),p.summary&&v.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ouro-mist",children:p.summary}),v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:p.hasPending?"Pending inner work queued.":"No pending inner work."}),p.mode==="deep"&&p.origin&&v.jsxs("div",{className:"mt-3",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow",children:"Triggered from"}),v.jsxs("button",{onClick:()=>{const A=p.origin;s({tab:"sessions",focus:`${A.friendId}/${A.channel}/${A.key}`})},className:"mt-1 text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:[(C=p.origin.friendId)==null?void 0:C.slice(0,8),"…/",p.origin.channel,"/",p.origin.key]}),p.obligationStatus&&v.jsxs("button",{onClick:()=>s({tab:"work"}),className:"ml-2 text-xs text-ouro-glow underline decoration-ouro-glow/30 underline-offset-2 hover:decoration-ouro-glow",children:["obligation: ",p.obligationStatus]})]})]})}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Inner dialog ",d?`(${d.messages.length} total)`:""]}),d?v.jsx(ON,{messages:d.messages}):v.jsx("button",{onClick:y,className:"mt-2 w-full rounded-lg px-3 py-2.5 text-left font-mono text-xs text-ouro-glow ring-1 ring-ouro-moss/15 hover:ring-ouro-glow/20 transition-colors",children:"Load inner dialog"})]}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Habits (",(o==null?void 0:o.totalCount)??0,")"]}),S.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-fang mb-1.5",children:["Overdue (",S.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:S.map(A=>v.jsx(Of,{h:A},A.name))})]}),T.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow mb-1.5",children:["Running fine (",T.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:T.map(A=>v.jsx(Of,{h:A},A.name))})]}),j.length>0&&v.jsxs("div",{className:"mt-3",children:[v.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-shadow mb-1.5",children:["Paused (",j.length,")"]}),v.jsx("div",{className:"space-y-1.5",children:j.map(A=>v.jsx(Of,{h:A},A.name))})]}),b.length===0&&v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No habits configured."})]})]})}function ON({messages:n}){const a=n.filter(h=>h.role!=="system"&&h.role!=="tool"),[s,o]=w.useState(!1),u=w.useRef(null),d=s?a:a.slice(-30),f=a.length-d.length;return w.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[d.length]),v.jsxs("div",{ref:u,className:"mt-2 max-h-[60vh] overflow-y-auto rounded-lg bg-ouro-void/60 p-3 ring-1 ring-ouro-moss/15 space-y-1",children:[f>0&&v.jsxs("button",{onClick:()=>o(!0),className:"w-full rounded-lg px-3 py-2 text-center font-mono text-xs text-ouro-shadow hover:text-ouro-mist ring-1 ring-ouro-moss/10 hover:ring-ouro-moss/20 transition-colors mb-2",children:["Load ",f," earlier messages"]}),d.map(h=>{var m,p,y,b;if(h.role==="user"){const S=((m=h.content)==null?void 0:m.includes("[pending from"))||((p=h.content)==null?void 0:p.includes("[delegated")),T=((y=h.content)==null?void 0:y.includes("waking up"))||((b=h.content)==null?void 0:b.includes("world-state checkpoint"));return v.jsx("div",{className:"flex justify-start py-1",children:v.jsxs("div",{className:`max-w-[85%] rounded-2xl rounded-bl-sm px-3 py-2 ring-1 ${S?"bg-ouro-gold/8 ring-ouro-gold/15":T?"bg-ouro-moss/20 ring-ouro-moss/15":"bg-ouro-moss/25 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider",style:{color:S?"var(--color-ouro-gold)":"var(--color-ouro-shadow)"},children:S?"★ delegated":T?"heartbeat":"prompt"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:h.content})]})},h.index)}if(h.role==="assistant"){const S=(h.tool_calls??[]).map(zx),T=S.filter(C=>C.kind==="surface"),j=S.filter(C=>C.kind==="rest"),E=S.filter(C=>C.kind==="delegation");return v.jsxs("div",{children:[T.map(C=>v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-ouro-scale/15 px-3 py-2 ring-1 ring-ouro-scale/20",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow",children:"★ surfaced outward"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone whitespace-pre-wrap break-words",children:C.deliveredText}),C.metadata&&v.jsxs("p",{className:"mt-1 font-mono text-[9px] text-ouro-shadow",children:["→ ",C.metadata]})]})},C.id)),E.length>0&&v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-gold/50",children:["— still thinking — #",h.index]}),j.length>0&&v.jsxs("div",{className:"py-1 text-center font-mono text-[10px] text-ouro-shadow/40",children:["— resting — #",h.index]}),T.length===0&&j.length===0&&E.length===0&&h.content&&v.jsx("div",{className:"flex justify-end py-1",children:v.jsxs("div",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-ouro-glow/6 px-3 py-2 ring-1 ring-ouro-glow/8",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("p",{className:"font-mono text-[9px] uppercase tracking-wider text-ouro-glow/50",children:"thinking"}),v.jsxs("span",{className:"font-mono text-[9px] text-ouro-shadow/40",children:["#",h.index]})]}),v.jsx("p",{className:"text-sm leading-relaxed text-ouro-mist whitespace-pre-wrap break-words",children:h.content})]})})]},h.index)}return null})]})}function Of({h:n}){const a=n.isOverdue,s=n.isDegraded,o=n.status;return v.jsxs("div",{className:`rounded-lg px-3 py-2.5 ring-1 ${a?"bg-ouro-fang/5 ring-ouro-fang/15":s?"bg-ouro-gold/5 ring-ouro-gold/15":o==="paused"?"bg-ouro-void/30 ring-ouro-moss/10":"bg-ouro-void/40 ring-ouro-moss/15"}`,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Yt,{color:a?"red":s?"yellow":o==="active"?"lime":"zinc",children:a?"overdue":s?"degraded":o}),v.jsx("span",{className:"font-medium text-ouro-bone",children:n.title})]}),v.jsxs("div",{className:"mt-1 flex flex-wrap gap-3 text-xs text-ouro-shadow",children:[n.cadence&&v.jsxs("span",{children:["every ",n.cadence]}),v.jsx("span",{children:n.lastRun?`last ${Qe(n.lastRun)}`:"never run"}),s&&n.degradedReason&&v.jsx("span",{className:"text-ouro-gold",children:n.degradedReason})]}),n.bodyExcerpt&&v.jsx("p",{className:"mt-1 text-xs text-ouro-shadow/70",children:n.bodyExcerpt})]})}function RN({agentName:n}){const[a,s]=w.useState(null),[o,u]=w.useState("diary");if(w.useEffect(()=>{ge(`/agents/${encodeURIComponent(n)}/memory`).then(s)},[n]),!a)return v.jsxs("div",{className:"flex items-center gap-2 py-6",children:[v.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-ouro-glow"}),v.jsx("span",{className:"font-mono text-xs text-ouro-shadow",children:"Loading…"})]});const d=a.recentDiaryEntries??[],f=a.recentJournalEntries??[];return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("button",{onClick:()=>u("diary"),className:`font-mono text-xs uppercase tracking-wider transition-colors ${o==="diary"?"text-ouro-glow":"text-ouro-shadow hover:text-ouro-mist"}`,children:["Diary (",a.diaryEntryCount,")"]}),v.jsx("span",{className:"text-ouro-shadow/30",children:"|"}),v.jsxs("button",{onClick:()=>u("journal"),className:`font-mono text-xs uppercase tracking-wider transition-colors ${o==="journal"?"text-ouro-glow":"text-ouro-shadow hover:text-ouro-mist"}`,children:["Journal (",a.journalEntryCount,")"]})]}),o==="diary"&&v.jsx("div",{children:d.length>0?v.jsx("div",{className:"space-y-3",children:d.map(h=>v.jsxs("article",{className:"rounded-xl bg-ouro-void/40 px-4 py-3.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"text-sm leading-relaxed text-ouro-bone",children:h.text}),v.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-ouro-shadow",children:[v.jsx(Yt,{children:h.source}),v.jsx("span",{children:Qe(h.createdAt)})]})]},h.id))}):v.jsx("p",{className:"text-sm text-ouro-shadow italic",children:"No diary entries yet. The agent hasn't written anything down."})}),o==="journal"&&v.jsx("div",{children:f.length>0?v.jsx("div",{className:"space-y-3",children:f.map(h=>v.jsxs("article",{className:"rounded-xl bg-ouro-void/40 px-4 py-3.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-medium text-ouro-bone",children:h.filename}),v.jsx("p",{className:"mt-1 text-sm leading-relaxed text-ouro-mist",children:h.preview})]},h.filename))}):v.jsx("p",{className:"text-sm text-ouro-shadow italic",children:"No journal entries yet."})})]})}function VN({agentName:n,view:a}){const[s,o]=w.useState(null),[u,d]=w.useState(null),f=a.agent,h=f.degraded,m=f.freshness;w.useEffect(()=>{Promise.all([ge("/machine/health").then(o).catch(()=>null),ge("/machine/logs").then(d).catch(()=>null)])},[n]);const p=(s==null?void 0:s.degradedComponents)??[],y=(u==null?void 0:u.entries)??[];return v.jsxs("div",{className:"space-y-8",children:[h.status==="degraded"&&h.issues.length>0&&v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-fang",children:["Agent issues (",h.issues.length,")"]}),v.jsx("div",{className:"mt-3 space-y-1.5",children:h.issues.map((b,S)=>v.jsxs("div",{className:"rounded-lg bg-ouro-fang/5 px-3 py-2.5 ring-1 ring-ouro-fang/15",children:[v.jsx("p",{className:"font-mono text-xs font-semibold text-ouro-fang",children:b.code}),v.jsx("p",{className:"mt-0.5 text-xs text-ouro-mist break-all",children:b.detail})]},S))})]}),v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Agent config"}),v.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[v.jsx(Hi,{label:"Provider",value:f.provider||"none"}),v.jsx(Hi,{label:"Enabled",value:f.enabled?"yes":"no"}),v.jsx(Hi,{label:"Freshness",value:`${m.status}${m.ageMs!=null?` (${Math.floor(m.ageMs/6e4)}m)`:""}`})]})]}),v.jsxs("section",{children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:"Daemon health"}),s&&s.status!=="unavailable"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[v.jsx(Hi,{label:"Status",value:s.status}),v.jsx(Hi,{label:"Mode",value:s.mode}),v.jsx(Hi,{label:"Uptime",value:`${Math.floor(s.uptimeSeconds/60)}m`})]}),p.length>0&&v.jsxs("div",{className:"mt-3 space-y-1.5",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-fang",children:"Degraded components"}),p.map((b,S)=>v.jsxs("div",{className:"rounded-lg bg-ouro-fang/5 px-3 py-2 ring-1 ring-ouro-fang/15",children:[v.jsx("p",{className:"text-xs font-semibold text-ouro-fang",children:b.component}),v.jsx("p",{className:"text-xs text-ouro-mist",children:b.reason})]},S))]})]}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No health file found. This is normal when not running under the daemon."})]}),v.jsxs("section",{children:[v.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-ouro-glow",children:["Recent logs (",(u==null?void 0:u.totalLines)??0," total)"]}),y.length>0?v.jsx("div",{className:"mt-3 max-h-96 overflow-y-auto rounded-lg bg-ouro-void/40 ring-1 ring-ouro-moss/15",children:[...y].reverse().slice(0,50).map((b,S)=>{const T=b.level;return v.jsxs("div",{className:"border-b border-ouro-moss/10 px-3 py-1.5 last:border-b-0",children:[v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsx(Yt,{color:T==="error"?"red":T==="warn"?"yellow":"zinc",children:T}),v.jsx("span",{className:"text-ouro-shadow",children:Qe(b.ts)}),v.jsx("span",{className:"font-mono text-ouro-glow",children:b.event})]}),v.jsx("p",{className:"truncate text-xs text-ouro-mist",children:b.message})]},S)})}):v.jsx("p",{className:"mt-2 text-sm text-ouro-shadow",children:"No log entries."})]})]})}function Hi({label:n,value:a}){return v.jsxs("div",{className:"rounded-lg bg-ouro-void/40 px-3 py-2.5 ring-1 ring-ouro-moss/15",children:[v.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-ouro-shadow",children:n}),v.jsx("p",{className:"mt-1 text-sm font-medium text-ouro-bone",children:a})]})}const Rf=[{id:"overview",label:"Overview"},{id:"sessions",label:"Sessions"},{id:"work",label:"Work"},{id:"connections",label:"Connections"},{id:"inner",label:"Inner"},{id:"memory",label:"Diary & Journal"},{id:"runtime",label:"Runtime"}];function LN(n){return n==="degraded"||n==="blocked"?"red":n==="stale"?"yellow":n==="active"?"lime":"zinc"}function _N({agentName:n,view:a,deskPrefs:s,initialRoute:o}){const[u,d]=w.useState((o==null?void 0:o.tab)??"overview"),[f,h]=w.useState(o==null?void 0:o.focus),m=w.useRef(!1);w.useEffect(()=>{(o==null?void 0:o.agent)===n&&!m.current?(m.current=!0,d(o.tab),h(o.focus)):(d("overview"),h(void 0))},[n]);const p=w.useCallback(j=>{d(j.tab),h(j.focus),window.history.pushState(null,"",Vf({agent:n,tab:j.tab,focus:j.focus}))},[n]),y=w.useCallback(j=>{d(j),h(void 0),window.history.pushState(null,"",Vf({agent:n,tab:j,focus:void 0}))},[n]),b=w.useCallback(()=>h(void 0),[]);if(!a||!n)return v.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[v.jsx("p",{className:"font-display text-2xl italic text-ouro-bone",children:"Choose an agent"}),v.jsx("p",{className:"mt-2 text-sm text-ouro-mist",children:"Select an agent from the sidebar to inspect its state."})]});const T=a.agent.attention;return v.jsx(Q0.Provider,{value:p,children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 pb-4 border-b border-ouro-moss/30",children:[v.jsx("div",{className:"min-w-0",children:v.jsx("h1",{className:"font-display text-2xl italic font-semibold text-ouro-bone sm:text-3xl",children:n})}),v.jsx(Yt,{color:LN(T.level),children:T.label})]}),v.jsx("nav",{className:"mt-4 flex gap-0.5 overflow-x-auto border-b border-ouro-moss/20 -mx-1",children:(()=>{const j=s==null?void 0:s.tabOrder;if(!j)return Rf;const E=j.map(A=>Rf.find(L=>L.id===A)).filter(A=>A!==void 0),C=Rf.filter(A=>!j.includes(A.id));return[...E,...C]})().map(j=>v.jsx("button",{type:"button",onClick:()=>y(j.id),className:`shrink-0 px-3 py-2 text-xs font-mono uppercase tracking-wider transition-colors rounded-t-md ${u===j.id?"bg-ouro-moss/20 text-ouro-glow border-b-2 border-ouro-glow":"text-ouro-shadow hover:text-ouro-mist hover:bg-ouro-moss/10"}`,children:j.label},j.id))}),v.jsxs("div",{className:"mt-6",children:[u==="overview"&&v.jsx(xN,{view:a,deskPrefs:s}),u==="sessions"&&v.jsx(wN,{agentName:n,focus:f,onFocusConsumed:b,deskPrefs:s}),u==="work"&&v.jsx(MN,{agentName:n,view:a,focus:f,onFocusConsumed:b}),u==="connections"&&v.jsx(DN,{agentName:n,focus:f,onFocusConsumed:b}),u==="inner"&&v.jsx(zN,{agentName:n,view:a}),u==="memory"&&v.jsx(RN,{agentName:n}),u==="runtime"&&v.jsx(VN,{agentName:n,view:a})]})]})})}function K0(){return J0(window.location.hash)}function UN(n){return n==="degraded"||n==="blocked"?"red":n==="stale"?"yellow":n==="active"?"lime":"zinc"}function kN(){var j,E;const[n,a]=w.useState(null),[s,o]=w.useState(((j=K0())==null?void 0:j.agent)??""),[u,d]=w.useState(null),f=w.useRef(0),h=w.useRef(K0()),m=w.useCallback(async()=>{var C;try{const A=await ge("/machine");if(a(A),!s&&A.agents.length>0){const L=((C=h.current)==null?void 0:C.agent)??A.agents[0].agentName;o(L)}}catch{}},[s]),[p,y]=w.useState(null),b=w.useCallback(async C=>{if(!C){d(null),y(null);return}try{const[A,L]=await Promise.all([ge(`/agents/${encodeURIComponent(C)}`),ge(`/agents/${encodeURIComponent(C)}/desk-prefs`)]);d(A),y(L)}catch{d(null),y(null)}},[]);w.useEffect(()=>{m()},[m]),w.useEffect(()=>{s&&b(s)},[s,b]),w.useEffect(()=>hT(()=>{const A=++f.current;m().then(()=>{f.current===A&&s&&b(s)})}),[m,b,s]),w.useEffect(()=>{const C=()=>{const A=J0(window.location.hash);A&&o(A.agent)};return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[]);const S=w.useCallback(C=>{o(C),window.history.pushState(null,"",Vf({agent:C,tab:"overview",focus:void 0}))},[]);if(!n)return v.jsx("div",{className:"flex h-screen items-center justify-center bg-ouro-void",children:v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"mx-auto mb-4 h-4 w-4 animate-pulse rounded-full bg-ouro-glow shadow-[0_0_20px_theme(--color-ouro-glow)]"}),v.jsx("p",{className:"font-mono text-sm text-ouro-mist",children:"Connecting to Outlook…"})]})});const T=n.overview.totals;return v.jsx(uN,{navbar:v.jsxs(aN,{children:[v.jsx(lN,{}),v.jsx(iN,{children:v.jsx(Id,{children:v.jsx(Yt,{color:n.overview.daemon.mode==="dev"?"yellow":"lime",children:n.overview.daemon.mode})})})]}),sidebar:v.jsxs(cN,{className:"bg-ouro-deep",children:[v.jsx(fN,{className:"border-ouro-moss/30",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"h-3 w-3 shrink-0 rounded-full bg-ouro-glow shadow-[0_0_16px_theme(--color-ouro-glow)]"}),v.jsx("div",{className:"min-w-0",children:v.jsx("p",{className:"truncate font-display text-lg italic font-semibold text-ouro-bone",children:"Ouro Outlook"})})]})}),v.jsxs(dN,{className:"[&>[data-slot=section]+[data-slot=section]]:mt-4",children:[v.jsxs(Y0,{children:[v.jsx(q0,{className:"text-ouro-mist/60",children:"Machine"}),v.jsx("div",{className:"grid grid-cols-3 gap-1.5 px-2",children:[{v:T.liveTasks??0,l:"Tasks",alert:(T.blockedTasks??0)>0},{v:T.openObligations??0,l:"Oblig."},{v:T.activeCodingAgents??0,l:"Coding"}].map(C=>v.jsxs("div",{className:"rounded-md bg-ouro-void/60 px-2 py-1.5 text-center ring-1 ring-ouro-moss/20",children:[v.jsx("div",{className:`text-base font-semibold tabular-nums ${C.alert?"text-ouro-fang":"text-ouro-bone"}`,children:C.v}),v.jsx("div",{className:"text-[9px] uppercase tracking-widest text-ouro-shadow",children:C.l})]},C.l))})]}),v.jsxs(Y0,{children:[v.jsx(q0,{className:"text-ouro-mist/60",children:"Agents"}),n.agents.map(C=>v.jsx(mN,{current:C.agentName===s,onClick:()=>S(C.agentName),children:v.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx(pN,{className:"text-ouro-bone",children:C.agentName}),v.jsxs("p",{className:"truncate text-xs text-ouro-shadow",children:[C.tasks.liveCount,"t · ",C.obligations.openCount,"o · ",C.coding.activeCount,"c"]})]}),v.jsx(Yt,{color:UN(C.attention.level),children:C.attention.label})]})},C.agentName))]})]}),v.jsx(hN,{className:"border-ouro-moss/30",children:v.jsxs("div",{className:"px-2 text-xs text-ouro-shadow",children:[v.jsx("p",{className:"font-mono",children:n.overview.runtime.version}),v.jsxs("p",{className:"mt-0.5",children:[n.overview.daemon.mode," · ",n.overview.freshness.status]})]})}),s&&u&&v.jsx("div",{className:"px-4 py-2 border-t border-ouro-moss/20",children:v.jsx("p",{className:"text-xs italic text-ouro-shadow/70",children:(()=>{var X;const C=p==null?void 0:p.statusLine;if(C)return C;const A=u==null?void 0:u.inner;if((A==null?void 0:A.status)==="working"||A!=null&&A.hasPending)return"thinking through something privately";const U=u==null?void 0:u.work,Y=((X=U==null?void 0:U.obligations)==null?void 0:X.openCount)??0;return Y>2?"a few loose ends":Y>0?"carrying something":"steady"})()})})]}),children:v.jsx(_N,{agentName:s,view:u,deskPrefs:p,initialRoute:((E=h.current)==null?void 0:E.agent)===s?h.current:void 0})})}dT.createRoot(document.getElementById("app")).render(v.jsx(w.StrictMode,{children:v.jsx(kN,{})}));
|