@mcpjam/inspector 3.27.1 → 3.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{CaniuseCapabilityPage-CrC-cTZL.js → CaniuseCapabilityPage-BGCx_CV1.js} +4 -4
- package/dist/client/assets/{CaniuseLoadingScreen-DFga82Px.js → CaniuseLoadingScreen-CnLJTk-6.js} +2 -2
- package/dist/client/assets/{PosthogUtils-C6QzDx66.js → PosthogUtils-BnkWsJl1.js} +1 -1
- package/dist/client/assets/{PosthogUtils-BAwbC5iX.js → PosthogUtils-CreNC30F.js} +2 -2
- package/dist/client/assets/{access-link-BJMsYDmK.js → access-link-CiqZlBT_.js} +2 -2
- package/dist/client/assets/{app-bootstrap-DzzSTL6f.js → app-bootstrap-Dihy9pBm.js} +259 -259
- package/dist/client/assets/{app-navigation-CTBnrg26.js → app-navigation-BzZWduTQ.js} +2 -2
- package/dist/client/assets/{bundle-mjs-BGe1waGK.js → bundle-mjs-C4gHyVze.js} +2 -2
- package/dist/client/assets/{caniuse-bootstrap-C-sKeXoq.js → caniuse-bootstrap-DClGA--s.js} +3 -3
- package/dist/client/assets/{chunk-D32TOXHM-C-gMffNp.js → chunk-D32TOXHM-BM6p8aoA.js} +5 -5
- package/dist/client/assets/{dead-clicks-autocapture-Bf2yz9Zr.js → dead-clicks-autocapture-DMIvXYDI.js} +2 -2
- package/dist/client/assets/{error-reporting-DmYc69Ih.js → error-reporting-BufzMdax.js} +1 -1
- package/dist/client/assets/{error-reporting-C7685g3J.js → error-reporting-C3V1rL02.js} +2 -2
- package/dist/client/assets/{exception-autocapture-C6yGegF5.js → exception-autocapture-D42Ql1CZ.js} +2 -2
- package/dist/client/assets/{feature-flags-Cbn8gAeC.js → feature-flags-9Kzm95Iy.js} +2 -2
- package/dist/client/assets/{first-run-oauth-return-CFW2tqzu.js → first-run-oauth-return-DBF8M446.js} +2 -2
- package/dist/client/assets/{highlighted-body-KQOG7T2V-BufAIVu0.js → highlighted-body-KQOG7T2V-BDDk3j-o.js} +2 -2
- package/dist/client/assets/{index-CCQWRMU8.js → index-CB2B0gyI.js} +3 -3
- package/dist/client/assets/{jszip.min-C6ASC0Lj.js → jszip.min-D0H-wysy.js} +2 -2
- package/dist/client/assets/{mcp-init-BWmQoGiF.js → mcp-init-D384t3us.js} +3 -3
- package/dist/client/assets/{mermaid-MCJ5UELQ-84PBltPS.js → mermaid-MCJ5UELQ-DXZIWzsB.js} +1 -1
- package/dist/client/assets/{module-BA6blRdw.js → module-BHBrpZ4U.js} +2 -2
- package/dist/client/assets/{module-DovF9UUB.js → module-CmXaunIz.js} +1 -1
- package/dist/client/assets/posthog-bundled-extensions-CrY82kI1.js +3 -0
- package/dist/client/assets/{posthog-bundled-extensions-_dhL7VQK.js → posthog-bundled-extensions-DUscOFM-.js} +1 -1
- package/dist/client/assets/{posthog-recorder-BIqCIRJB.js → posthog-recorder-PnXQoK1P.js} +2 -2
- package/dist/client/assets/{preload-helper-CQSqs-Ur.js → preload-helper-Dk-R02bM.js} +1 -1
- package/dist/client/assets/{project-route-B8ycjI6Q.js → project-route-CwOywjoT.js} +2 -2
- package/dist/client/assets/{react-dom-DXowvrFG.js → react-dom-s4nupq_N.js} +2 -2
- package/dist/client/assets/{rolldown-runtime-BlpueFg6.js → rolldown-runtime-Df2-koJ7.js} +1 -1
- package/dist/client/assets/{server-feature-flags-CFqtsG2I.js → server-feature-flags-ByZjY7fi.js} +2 -2
- package/dist/client/assets/{server-feature-flags-yy8cq8x7.js → server-feature-flags-CqB4sk67.js} +1 -1
- package/dist/client/assets/{session-revoked-BJat-_na.js → session-revoked-B_iZLaTD.js} +2 -2
- package/dist/client/assets/{surveys-DSRAF-TV.js → surveys-B4xlE-Cz.js} +2 -2
- package/dist/client/assets/telemetry-files-620cc3a6060f3829.js +1 -0
- package/dist/client/assets/{trace-timeline-BdQMiVa6.js → trace-timeline-BEzP_FzL.js} +1 -1
- package/dist/client/assets/{trace-timeline-CLTmhMpA.js → trace-timeline-BWWuYM0j.js} +2 -2
- package/dist/client/assets/{web-vitals-BGMXZEXu.js → web-vitals-jdhe8VpD.js} +2 -2
- package/dist/client/index.html +12 -12
- package/dist/server/index.js +2 -2
- package/package.json +2 -2
- package/dist/client/assets/posthog-bundled-extensions-Cs4q3GVP.js +0 -3
- package/dist/client/assets/telemetry-files-58cade72c6da8102.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as bc}from"./rolldown-runtime-BlpueFg6.js";import{_ as hd,g as ps,p as pd}from"./PosthogUtils-BAwbC5iX.js";import{n as md,t as gd}from"./react-dom-DXowvrFG.js";import{r as vd}from"./bundle-mjs-BGe1waGK.js";import{Ar as Y,Cr as yd,Dr as Lt,Or as wd,Sr as jt,hn as bd,jr as Me,mn as xd,pn as Sd,xr as Cd}from"./app-navigation-CTBnrg26.js";import{B as fo,H as Td}from"./mcp-init-BWmQoGiF.js";import{A as Pd,D as tr,E as ke,O as Fe,T as bi,j as Rd,k as Ed,t as Ad}from"./error-reporting-C7685g3J.js";import{p as ho}from"./module-BA6blRdw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cf0a0a03-d1b6-4174-a194-78de6b772b23",e._sentryDebugIdIdentifier="sentry-dbid-cf0a0a03-d1b6-4174-a194-78de6b772b23")}catch{}})();var h=bc(md(),1),po=bc(gd(),1),S=vd(),Md=Object.defineProperty,kd=(e,t)=>Md(e,"name",{value:t,configurable:!0}),ne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Lt(`Primitive.${t}`),r=h.forwardRef((i,o)=>{const{asChild:s,...a}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mo(e,t){e&&po.flushSync(()=>e.dispatchEvent(t))}kd(mo,"dispatchDiscreteCustomEvent");var Dd=Object.defineProperty,Od=(e,t)=>Dd(e,"name",{value:t,configurable:!0}),_d=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Id=h.forwardRef(Od(function(t,n){return(0,S.jsx)(ne.span,{...t,ref:n,style:{..._d,...t.style}})},"VisuallyHidden")),Ld=Id,Vd=Object.defineProperty,he=(e,t)=>Vd(e,"name",{value:t,configurable:!0});function Fd(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=he(o=>{const{children:s,...a}=o,c=h.useMemo(()=>a,Object.values(a));return(0,S.jsx)(n.Provider,{value:c,children:s})},"Provider");r.displayName=e+"Provider";function i(o,s={}){const{optional:a=!1}=s,c=h.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${o}\` must be used within \`${e}\``)}return he(i,"useContext"),[r,i]}he(Fd,"createContext");function Je(e,t=[]){let n=[];function r(o,s){const a=h.createContext(s);a.displayName=o+"Context";const c=n.length;n=[...n,s];const u=he(f=>{const{scope:d,children:p,...m}=f,g=d?.[e]?.[c]||a,v=h.useMemo(()=>m,Object.values(m));return(0,S.jsx)(g.Provider,{value:v,children:p})},"Provider");u.displayName=o+"Provider";function l(f,d,p={}){const{optional:m=!1}=p,g=d?.[e]?.[c]||a,v=h.useContext(g);if(v)return v;if(s!==void 0)return s;if(!m)throw new Error(`\`${f}\` must be used within \`${o}\``)}return he(l,"useContext"),[u,l]}he(r,"createContext");const i=he(()=>{const o=n.map(s=>h.createContext(s));return he(function(a){const c=a?.[e]||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return i.scopeName=e,[r,xc(i,...t)]}he(Je,"createContextScope");function xc(...e){const t=e[0];if(e.length===1)return t;const n=he(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return he(function(o){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(o)[`__scope${u}`];return{...a,...l}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}he(xc,"composeContextScopes");var Nd=Object.defineProperty,Z=(e,t)=>Nd(e,"name",{value:t,configurable:!0});function go(e){const t=e+"CollectionProvider",[n,r]=Je(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=Z(g=>{const{scope:v,children:x}=g,y=h.useRef(null),b=h.useRef(new Map).current;return(0,S.jsx)(i,{scope:v,itemMap:b,collectionRef:y,children:x})},"CollectionProvider");s.displayName=t;const a=e+"CollectionSlot",c=Lt(a),u=h.forwardRef((g,v)=>{const{scope:x,children:y}=g,b=o(a,x),w=Y(v,b.collectionRef);return(0,S.jsx)(c,{ref:w,children:y})});u.displayName=a;const l=e+"CollectionItemSlot",f="data-radix-collection-item",d=Lt(l),p=h.forwardRef((g,v)=>{const{scope:x,children:y,...b}=g,w=h.useRef(null),T=Y(v,w),R=o(l,x);return h.useEffect(()=>(R.itemMap.set(w,{ref:w,...b}),()=>{R.itemMap.delete(w)})),(0,S.jsx)(d,{[f]:"",ref:T,children:y})});p.displayName=l;function m(g){const v=o(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((b,w)=>y.indexOf(b.ref.current)-y.indexOf(w.ref.current))},[v.collectionRef,v.itemMap])}return Z(m,"useCollection"),[{Provider:s,Slot:u,ItemSlot:p},m,r]}Z(go,"createCollection");var ms=new WeakMap,$r=class Qe extends Map{static{Z(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],ms.set(this,!0)}set(t,n){return ms.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,n),this}insert(t,n,r){const i=this.has(n),o=this.#e.length,s=vo(t);let a=s>=0?s:o+s;const c=a<0||a>=o?-1:a;if(c===this.size||i&&c===this.size-1||c===-1)return this.set(n,r),this;const u=this.size+(i?0:1);s<0&&a++;const l=[...this.#e];let f,d=!1;for(let p=a;p<u;p++)if(a===p){let m=l[p];l[p]===n&&(m=l[p+1]),i&&this.delete(n),f=this.get(m),this.set(n,r)}else{!d&&l[p-1]===n&&(d=!0);const m=l[d?p:p-1],g=f;f=this.get(m),this.delete(m),this.set(m,g)}return this}with(t,n,r){const i=new Qe(this);return i.insert(t,n,r),i}before(t){const n=this.#e.indexOf(t)-1;if(!(n<0))return this.entryAt(n)}setBefore(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i,n,r)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i+1,n,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){const n=super.delete(t);return n&&this.#e.splice(this.#e.indexOf(t),1),n}deleteAt(t){const n=this.keyAt(t);return n!==void 0?this.delete(n):!1}at(t){const n=Bn(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){const n=Bn(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Bn(this.#e,t)}from(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return i;r++}}findIndex(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return r;r++}return-1}filter(t,n){const r=[];let i=0;for(const o of this)Reflect.apply(t,n,[o,i,this])&&r.push(o),i++;return new Qe(r)}map(t,n){const r=[];let i=0;for(const o of this)r.push([o[0],Reflect.apply(t,n,[o,i,this])]),i++;return new Qe(r)}reduce(...t){const[n,r]=t;let i=0,o=r??this.at(0);for(const s of this)i===0&&t.length===1?o=s:o=Reflect.apply(n,this,[o,s,i,this]),i++;return o}reduceRight(...t){const[n,r]=t;let i=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const s=this.at(o);o===this.size-1&&t.length===1?i=s:i=Reflect.apply(n,this,[i,s,o,this])}return i}toSorted(t){const n=[...this.entries()].sort(t);return new Qe(n)}toReversed(){const t=new Qe;for(let n=this.size-1;n>=0;n--){const r=this.keyAt(n),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){const n=[...this.entries()];return n.splice(...t),new Qe(n)}slice(t,n){const r=new Qe;let i=this.size-1;if(t===void 0)return r;t<0&&(t=t+this.size),n!==void 0&&n>0&&(i=n-1);for(let o=t;o<=i;o++){const s=this.keyAt(o),a=this.get(s);r.set(s,a)}return r}every(t,n){let r=0;for(const i of this){if(!Reflect.apply(t,n,[i,r,this]))return!1;r++}return!0}some(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return!0;r++}return!1}};function Bn(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Sc(e,t);return n===-1?void 0:e[n]}Z(Bn,"at");function Sc(e,t){const n=e.length,r=vo(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Z(Sc,"toSafeIndex");function vo(e){return e!==e||e===0?0:Math.trunc(e)}Z(vo,"toSafeInteger");function jd(e){const t=e+"CollectionProvider",[n,r]=Je(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new $r,setItemMap:Z(()=>{},"setItemMap")}),s=Z(({state:y,...b})=>y?(0,S.jsx)(c,{...b,state:y}):(0,S.jsx)(a,{...b}),"CollectionProvider");s.displayName=t;const a=Z(y=>{const b=v();return(0,S.jsx)(c,{...y,state:b})},"CollectionInit");a.displayName=t+"Init";const c=Z(y=>{const{scope:b,children:w,state:T}=y,R=h.useRef(null),[C,P]=h.useState(null),E=Y(R,P),[k,I]=T;return h.useEffect(()=>{if(!C)return;const D=Pc(()=>{});return D.observe(C,{childList:!0,subtree:!0}),()=>{D.disconnect()}},[C]),(0,S.jsx)(i,{scope:b,itemMap:k,setItemMap:I,collectionRef:E,collectionRefObject:R,collectionElement:C,children:w})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",l=Lt(u),f=h.forwardRef((y,b)=>{const{scope:w,children:T}=y,R=o(u,w),C=Y(b,R.collectionRef);return(0,S.jsx)(l,{ref:C,children:T})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Lt(d),g=h.forwardRef((y,b)=>{const{scope:w,children:T,...R}=y,C=h.useRef(null),[P,E]=h.useState(null),k=Y(b,C,E),{setItemMap:I}=o(d,w),D=h.useRef(R);Cc(D.current,R)||(D.current=R);const O=D.current;return h.useEffect(()=>{const V=O;return I(j=>P?j.has(P)?j.set(P,{...V,element:P}).toSorted(xi):(j.set(P,{...V,element:P}),j.toSorted(xi)):j),()=>{I(j=>!P||!j.has(P)?j:(j.delete(P),new $r(j)))}},[P,O,I]),(0,S.jsx)(m,{[p]:"",ref:k,children:T})});g.displayName=d;function v(){return h.useState(new $r)}Z(v,"useInitCollection");function x(y){const{itemMap:b}=o(e+"CollectionConsumer",y);return b}return Z(x,"useCollection"),[{Provider:s,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Z(jd,"createCollection");function Cc(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Z(Cc,"shallowEqual");function Tc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Z(Tc,"isElementPreceding");function xi(e,t){return!e[1].element||!t[1].element?0:Tc(e[1].element,t[1].element)?-1:1}Z(xi,"sortByDocumentPosition");function Pc(e){return new MutationObserver(t=>{for(const n of t)if(n.type==="childList"){e();return}})}Z(Pc,"getChildListObserver");var $d=Object.defineProperty,$t=(e,t)=>$d(e,"name",{value:t,configurable:!0}),Rc=!!(typeof window<"u"&&window.document&&window.document.createElement);function L(e,t,{checkForDefaultPrevented:n=!0}={}){return $t(function(i){if(e?.(i),n===!1||!i||!i.defaultPrevented)return t?.(i)},"handleEvent")}$t(L,"composeEventHandlers");function Bd(e){if(!Rc)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}$t(Bd,"getOwnerWindow");function Si(e){if(!Rc)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}$t(Si,"getOwnerDocument");function Ec(e,t=!1){const{activeElement:n}=Si(e);if(!n?.nodeName)return null;if(Ac(n)&&n.contentDocument)return Ec(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Si(n).getElementById(r);if(i)return i}}return n}$t(Ec,"getActiveElement");function Ac(e){return e.tagName==="IFRAME"}$t(Ac,"isFrame");var me=globalThis?.document?h.useLayoutEffect:()=>{},qd=Object.defineProperty,Ud=(e,t)=>qd(e,"name",{value:t,configurable:!0}),gs=h[" useEffectEvent ".trim().toString()],vs=h[" useInsertionEffect ".trim().toString()];function Mc(e){if(typeof gs=="function")return gs(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof vs=="function"?vs(()=>{t.current=e}):me(()=>{t.current=e}),h.useMemo(()=>((...n)=>t.current?.(...n)),[])}Ud(Mc,"useEffectEvent");var Wd=Object.defineProperty,vn=(e,t)=>Wd(e,"name",{value:t,configurable:!0}),Hd=h[" useInsertionEffect ".trim().toString()]||me;function yn({prop:e,defaultProp:t,onChange:n=vn(()=>{},"onChange"),caller:r}){const[i,o,s]=kc({defaultProp:t,onChange:n}),a=e!==void 0;return[a?e:i,h.useCallback(u=>{if(a){const l=Dc(u)?u(e):u;l!==e&&s.current?.(l)}else o(u)},[a,e,o,s])]}vn(yn,"useControllableState");function kc({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),i=h.useRef(n),o=h.useRef(t);return Hd(()=>{o.current=t},[t]),h.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}vn(kc,"useUncontrolledState");function Dc(e){return typeof e=="function"}vn(Dc,"isFunction");var ys=Symbol("RADIX:SYNC_STATE");function zd(e,t,n,r){const{prop:i,defaultProp:o,onChange:s,caller:a}=t,c=i!==void 0,u=Mc(s),l=[{...n,state:o}];r&&l.push(r);const[f,d]=h.useReducer((v,x)=>{if(x.type===ys)return{...v,state:x.state};const y=e(v,x);return c&&!Object.is(y.state,v.state)&&u(y.state),y},...l),p=f.state,m=h.useRef(p);h.useEffect(()=>{m.current!==p&&(m.current=p,c||u(p))},[p,m,c]);const g=h.useMemo(()=>i!==void 0?{...f,state:i}:f,[f,i]);return h.useEffect(()=>{c&&!Object.is(i,f.state)&&d({type:ys,state:i})},[i,f.state,c]),[g,d]}vn(zd,"useControllableStateReducer");var Kd=Object.defineProperty,Be=(e,t)=>Kd(e,"name",{value:t,configurable:!0});function Oc(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}Be(Oc,"useStateMachine");var Bt=Be(e=>{const{present:t,children:n}=e,r=_c(t),i=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=Ic(r.ref,Lc(i));return typeof n=="function"||r.isPresent?h.cloneElement(i,{ref:o}):null},"Presence");function _c(e){const[t,n]=h.useState(),r=h.useRef(null),i=h.useRef(e),o=h.useRef("none"),s=h.useRef(void 0),[a,c]=Oc(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{a==="mounted"?(o.current=s.current??Pt(r.current),s.current=void 0):o.current="none"},[a]),me(()=>{const u=r.current,l=i.current;if(l!==e){const f=o.current,d=Pt(u);e?(s.current=d,c("MOUNT")):d==="none"||u?.display==="none"?c("UNMOUNT"):c(l&&f!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),me(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,f=Be(p=>{const m=Pt(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},"handleAnimationEnd"),d=Be(p=>{p.target===t&&(o.current=Pt(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(u=>{if(u){const l=getComputedStyle(u);r.current=l,s.current=Pt(l)}else r.current=null;n(u)},[])}}Be(_c,"usePresence");function Ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Be(Ci,"setRef");function Ic(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(s=>{const a=Ci(s,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<o.length;s++){const a=o[s];typeof a=="function"?a():Ci(r[s],null)}}},[])}Be(Ic,"useStableComposedRefs");function Pt(e){return e?.animationName||"none"}Be(Pt,"getAnimationName");function Lc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Be(Lc,"getElementRef");var Qd=Object.defineProperty,Gd=(e,t)=>Qd(e,"name",{value:t,configurable:!0}),Yd=h[" useId ".trim().toString()]||(()=>{}),Xd=0;function ht(e){const[t,n]=h.useState(Yd());return me(()=>{e||n(r=>r??String(Xd++))},[e]),e||(t?`radix-${t}`:"")}Gd(ht,"useId");var Zd=Object.defineProperty,Jd=(e,t)=>Zd(e,"name",{value:t,configurable:!0}),eh=h.createContext(void 0);function yo(e){const t=h.useContext(eh);return e||t||"ltr"}Jd(yo,"useDirection");var th=Object.defineProperty,nh=(e,t)=>th(e,"name",{value:t,configurable:!0});function xe(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>((...n)=>t.current?.(...n)),[])}nh(xe,"useCallbackRef");var rh=Object.defineProperty,X=(e,t)=>rh(e,"name",{value:t,configurable:!0}),Ti="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",oh="dismissableLayer.focusOutside",ws,Vc=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Fc=h.forwardRef(X(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...l}=t,f=h.useContext(Vc),[d,p]=h.useState(null),m=d?.ownerDocument??globalThis?.document,[,g]=h.useState({}),v=Y(n,p),x=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?x.indexOf(y):-1,w=d?x.indexOf(d):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=w>=b,C=h.useRef(!1),P=Nc(D=>{s?.(D),c?.(D),D.defaultPrevented||u?.()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(D=>{if(!(D instanceof Node))return!1;const O=[...f.branches].some(V=>V.contains(D));return R&&!O},[f.branches,R])}),E=jc(D=>{if(i&&C.current)return;const O=D.target;[...f.branches].some(V=>V.contains(O))||(a?.(D),c?.(D),D.defaultPrevented||u?.())},m),k=d?w===x.length-1:!1,I=xe(D=>{D.key==="Escape"&&(o?.(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))});return h.useEffect(()=>{if(k)return m.addEventListener("keydown",I,{capture:!0}),()=>m.removeEventListener("keydown",I,{capture:!0})},[m,k,I]),h.useEffect(()=>{if(d)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ws=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),Pi(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(d),f.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=ws))}},[d,m,r,f]),h.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),Pi())},[d,f]),h.useEffect(()=>{const D=X(()=>g({}),"handleUpdate");return document.addEventListener(Ti,D),()=>document.removeEventListener(Ti,D)},[]),(0,S.jsx)(ne.div,{...l,ref:v,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:L(t.onFocusCapture,E.onFocusCapture),onBlurCapture:L(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:L(t.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function sh(){const e=h.useContext(Vc),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}X(sh,"useDismissableLayerSurface");var ah=X(()=>!0,"IS_TRUE");function Nc(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:s=ah}=t,a=xe(e),c=h.useRef(!1),u=h.useRef(!1),l=h.useRef(new Map),f=h.useRef(()=>{});return h.useEffect(()=>{function d(){u.current=!1,i.current=!1,l.current.clear()}X(d,"resetOutsideInteraction");function p(){return Array.from(l.current.values()).some(Boolean)}X(p,"isOutsideInteractionIntercepted");function m(b){if(!u.current)return;const w=b.target;w instanceof Node&&[...o].some(T=>T.contains(w))||l.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}X(m,"handleInteractionCapture");function g(b){u.current&&l.current.set(b.type,!1)}X(g,"handleInteractionBubble");const v=X(b=>{if(b.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const R=p();d(),R||wo(ih,a,T,{discrete:!0})};if(X(w,"handleAndDispatchPointerDownOutsideEvent"),!s(b.target)){n.removeEventListener("click",f.current),d(),c.current=!1;return}const T={originalEvent:b};u.current=!0,i.current=r&&b.button===0,l.current.clear(),!r||b.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),d();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,m,!0),n.addEventListener(b,g);const y=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(y),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,m,!0),n.removeEventListener(b,g)}},[n,a,r,i,o,s]),{onPointerDownCapture:X(()=>c.current=!0,"onPointerDownCapture")}}X(Nc,"usePointerDownOutside");function jc(e,t=globalThis?.document){const n=xe(e),r=h.useRef(!1);return h.useEffect(()=>{const i=X(o=>{o.target&&!r.current&&wo(oh,n,{originalEvent:o},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:X(()=>r.current=!0,"onFocusCapture"),onBlurCapture:X(()=>r.current=!1,"onBlurCapture")}}X(jc,"useFocusOutside");function Pi(){const e=new CustomEvent(Ti);document.dispatchEvent(e)}X(Pi,"dispatchUpdate");function wo(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mo(i,o):i.dispatchEvent(o)}X(wo,"handleAndDispatchCustomEvent");var ch=Object.defineProperty,re=(e,t)=>ch(e,"name",{value:t,configurable:!0}),Br="focusScope.autoFocusOnMount",qr="focusScope.autoFocusOnUnmount",bs={bubbles:!1,cancelable:!0},uh=h.forwardRef(re(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=t,[c,u]=h.useState(null),l=xe(o),f=xe(s),d=h.useRef(null),p=Y(n,u),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(i){let v=function(w){if(m.paused||!c)return;const T=w.target;c.contains(T)?d.current=T:Ve(d.current,{select:!0})},x=function(w){if(m.paused||!c)return;const T=w.relatedTarget;T!==null&&(c.contains(T)||Ve(d.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&Ve(c)};re(v,"handleFocusIn"),re(x,"handleFocusOut"),re(y,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(y);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[i,c,m.paused]),h.useEffect(()=>{if(c){xs.add(m);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(Br,bs);c.addEventListener(Br,l),c.dispatchEvent(x),x.defaultPrevented||($c(Hc(bo(c)),{select:!0}),document.activeElement===v&&Ve(c))}return()=>{c.removeEventListener(Br,l),setTimeout(()=>{const x=new CustomEvent(qr,bs);c.addEventListener(qr,f),c.dispatchEvent(x),x.defaultPrevented||Ve(v??document.body,{select:!0}),c.removeEventListener(qr,f),xs.remove(m)},0)}}},[c,l,f,m]);const g=h.useCallback(v=>{if(!r&&!i||m.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(x&&y){const b=v.currentTarget,[w,T]=Bc(b);w&&T?!v.shiftKey&&y===T?(v.preventDefault(),r&&Ve(w,{select:!0})):v.shiftKey&&y===w&&(v.preventDefault(),r&&Ve(T,{select:!0})):y===b&&v.preventDefault()}},[r,i,m.paused]);return(0,S.jsx)(ne.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})},"FocusScope"));function $c(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ve(r,{select:t}),document.activeElement!==n)return}re($c,"focusFirst");function Bc(e){const t=bo(e);return[Ri(t,e),Ri(t.reverse(),e)]}re(Bc,"getTabbableEdges");function bo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:re(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}re(bo,"getTabbableCandidates");function Ri(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):qc(r,{upTo:t})))return r}re(Ri,"findVisible");function qc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}re(qc,"isHidden");function Uc(e){return e instanceof HTMLInputElement&&"select"in e}re(Uc,"isSelectableInput");function Ve(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Uc(e)&&t&&e.select()}}re(Ve,"focus");var xs=Wc();function Wc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ei(e,t),e.unshift(t)},remove(t){e=Ei(e,t),e[0]?.resume()}}}re(Wc,"createFocusScopesStack");function Ei(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}re(Ei,"arrayRemove");function Hc(e){return e.filter(t=>t.tagName!=="A")}re(Hc,"removeLinks");var lh=Object.defineProperty,fh=(e,t)=>lh(e,"name",{value:t,configurable:!0}),zc=h.forwardRef(fh(function(t,n){const{container:r,...i}=t,[o,s]=h.useState(!1);me(()=>s(!0),[]);const a=r||o&&globalThis?.document?.body;return a?po.createPortal((0,S.jsx)(ne.div,{...i,ref:n}),a):null},"Portal")),dh=Object.defineProperty,xo=(e,t)=>dh(e,"name",{value:t,configurable:!0}),En=0,xt=null;function hh(e){return So(),e.children}xo(hh,"FocusGuards");function So(){h.useEffect(()=>{xt||(xt={start:Ai(),end:Ai()});const{start:e,end:t}=xt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),En++,()=>{En===1&&(xt?.start.remove(),xt?.end.remove(),xt=null),En=Math.max(0,En-1)}},[])}xo(So,"useFocusGuards");function Ai(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}xo(Ai,"createFocusGuard");var Re=function(){return Re=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Re.apply(this,arguments)};function Kc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ph(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var qn="right-scroll-bar-position",Un="width-before-scroll-bar",mh="with-scroll-bars-hidden",gh="--removed-body-scroll-bar-size";function Ur(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vh(e,t){var n=(0,h.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var yh=typeof window<"u"?h.useLayoutEffect:h.useEffect,Ss=new WeakMap;function wh(e,t){var n=vh(t||null,function(r){return e.forEach(function(i){return Ur(i,r)})});return yh(function(){var r=Ss.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Ur(a,null)}),o.forEach(function(a){i.has(a)||Ur(a,s)})}Ss.set(n,e)},[e]),n}function bh(e){return e}function xh(e,t){t===void 0&&(t=bh);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(i),o=n}var a=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}}}function Sh(e){e===void 0&&(e={});var t=xh(null);return t.options=Re({async:!0,ssr:!1},e),t}var Qc=function(e){var t=e.sideCar,n=Kc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Re({},n))};Qc.isSideCarExport=!0;function Ch(e,t){return e.useMedium(t),Qc}var Gc=Sh(),Wr=function(){},yr=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,l=e.enabled,f=e.shards,d=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=Kc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=d,R=wh([n,t]),C=Re(Re({},w),i);return h.createElement(h.Fragment,null,l&&h.createElement(T,{sideCar:Gc,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:b}),s?h.cloneElement(h.Children.only(a),Re(Re({},C),{ref:R})):h.createElement(y,Re({},C,{className:c,ref:R}),a))});yr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yr.classNames={fullWidth:Un,zeroRight:qn};var Cs,Th=function(){if(Cs)return Cs;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ph(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Th();return t&&e.setAttribute("nonce",t),e}function Rh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Eh(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var Ah=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ph())&&(Rh(t,n),Eh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mh=function(){var e=Ah();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yc=function(){var e=Mh(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},kh={left:0,top:0,right:0,gap:0},Hr=function(e){return parseInt(e||"",10)||0},Dh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Hr(n),Hr(r),Hr(i)]},Oh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kh;var t=Dh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_h=Yc(),Xt="data-scroll-locked",Ih=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{o as bc}from"./rolldown-runtime-Df2-koJ7.js";import{_ as hd,g as ps,p as pd}from"./PosthogUtils-CreNC30F.js";import{n as md,t as gd}from"./react-dom-s4nupq_N.js";import{r as vd}from"./bundle-mjs-C4gHyVze.js";import{Ar as Y,Cr as yd,Dr as Lt,Or as wd,Sr as jt,hn as bd,jr as Me,mn as xd,pn as Sd,xr as Cd}from"./app-navigation-BzZWduTQ.js";import{B as fo,H as Td}from"./mcp-init-D384t3us.js";import{A as Pd,D as tr,E as ke,O as Fe,T as bi,j as Rd,k as Ed,t as Ad}from"./error-reporting-C3V1rL02.js";import{p as ho}from"./module-BHBrpZ4U.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.27.2"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cf0a0a03-d1b6-4174-a194-78de6b772b23",e._sentryDebugIdIdentifier="sentry-dbid-cf0a0a03-d1b6-4174-a194-78de6b772b23")}catch{}})();var h=bc(md(),1),po=bc(gd(),1),S=vd(),Md=Object.defineProperty,kd=(e,t)=>Md(e,"name",{value:t,configurable:!0}),ne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Lt(`Primitive.${t}`),r=h.forwardRef((i,o)=>{const{asChild:s,...a}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mo(e,t){e&&po.flushSync(()=>e.dispatchEvent(t))}kd(mo,"dispatchDiscreteCustomEvent");var Dd=Object.defineProperty,Od=(e,t)=>Dd(e,"name",{value:t,configurable:!0}),_d=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Id=h.forwardRef(Od(function(t,n){return(0,S.jsx)(ne.span,{...t,ref:n,style:{..._d,...t.style}})},"VisuallyHidden")),Ld=Id,Vd=Object.defineProperty,he=(e,t)=>Vd(e,"name",{value:t,configurable:!0});function Fd(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=he(o=>{const{children:s,...a}=o,c=h.useMemo(()=>a,Object.values(a));return(0,S.jsx)(n.Provider,{value:c,children:s})},"Provider");r.displayName=e+"Provider";function i(o,s={}){const{optional:a=!1}=s,c=h.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${o}\` must be used within \`${e}\``)}return he(i,"useContext"),[r,i]}he(Fd,"createContext");function Je(e,t=[]){let n=[];function r(o,s){const a=h.createContext(s);a.displayName=o+"Context";const c=n.length;n=[...n,s];const u=he(f=>{const{scope:d,children:p,...m}=f,g=d?.[e]?.[c]||a,v=h.useMemo(()=>m,Object.values(m));return(0,S.jsx)(g.Provider,{value:v,children:p})},"Provider");u.displayName=o+"Provider";function l(f,d,p={}){const{optional:m=!1}=p,g=d?.[e]?.[c]||a,v=h.useContext(g);if(v)return v;if(s!==void 0)return s;if(!m)throw new Error(`\`${f}\` must be used within \`${o}\``)}return he(l,"useContext"),[u,l]}he(r,"createContext");const i=he(()=>{const o=n.map(s=>h.createContext(s));return he(function(a){const c=a?.[e]||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return i.scopeName=e,[r,xc(i,...t)]}he(Je,"createContextScope");function xc(...e){const t=e[0];if(e.length===1)return t;const n=he(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return he(function(o){const s=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(o)[`__scope${u}`];return{...a,...l}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}he(xc,"composeContextScopes");var Nd=Object.defineProperty,Z=(e,t)=>Nd(e,"name",{value:t,configurable:!0});function go(e){const t=e+"CollectionProvider",[n,r]=Je(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=Z(g=>{const{scope:v,children:x}=g,y=h.useRef(null),b=h.useRef(new Map).current;return(0,S.jsx)(i,{scope:v,itemMap:b,collectionRef:y,children:x})},"CollectionProvider");s.displayName=t;const a=e+"CollectionSlot",c=Lt(a),u=h.forwardRef((g,v)=>{const{scope:x,children:y}=g,b=o(a,x),w=Y(v,b.collectionRef);return(0,S.jsx)(c,{ref:w,children:y})});u.displayName=a;const l=e+"CollectionItemSlot",f="data-radix-collection-item",d=Lt(l),p=h.forwardRef((g,v)=>{const{scope:x,children:y,...b}=g,w=h.useRef(null),T=Y(v,w),R=o(l,x);return h.useEffect(()=>(R.itemMap.set(w,{ref:w,...b}),()=>{R.itemMap.delete(w)})),(0,S.jsx)(d,{[f]:"",ref:T,children:y})});p.displayName=l;function m(g){const v=o(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((b,w)=>y.indexOf(b.ref.current)-y.indexOf(w.ref.current))},[v.collectionRef,v.itemMap])}return Z(m,"useCollection"),[{Provider:s,Slot:u,ItemSlot:p},m,r]}Z(go,"createCollection");var ms=new WeakMap,$r=class Qe extends Map{static{Z(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],ms.set(this,!0)}set(t,n){return ms.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,n),this}insert(t,n,r){const i=this.has(n),o=this.#e.length,s=vo(t);let a=s>=0?s:o+s;const c=a<0||a>=o?-1:a;if(c===this.size||i&&c===this.size-1||c===-1)return this.set(n,r),this;const u=this.size+(i?0:1);s<0&&a++;const l=[...this.#e];let f,d=!1;for(let p=a;p<u;p++)if(a===p){let m=l[p];l[p]===n&&(m=l[p+1]),i&&this.delete(n),f=this.get(m),this.set(n,r)}else{!d&&l[p-1]===n&&(d=!0);const m=l[d?p:p-1],g=f;f=this.get(m),this.delete(m),this.set(m,g)}return this}with(t,n,r){const i=new Qe(this);return i.insert(t,n,r),i}before(t){const n=this.#e.indexOf(t)-1;if(!(n<0))return this.entryAt(n)}setBefore(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i,n,r)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(t,n,r){const i=this.#e.indexOf(t);return i===-1?this:this.insert(i+1,n,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){const n=super.delete(t);return n&&this.#e.splice(this.#e.indexOf(t),1),n}deleteAt(t){const n=this.keyAt(t);return n!==void 0?this.delete(n):!1}at(t){const n=Bn(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){const n=Bn(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Bn(this.#e,t)}from(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(t,n){const r=this.indexOf(t);if(r===-1)return;let i=r+n;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return i;r++}}findIndex(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return r;r++}return-1}filter(t,n){const r=[];let i=0;for(const o of this)Reflect.apply(t,n,[o,i,this])&&r.push(o),i++;return new Qe(r)}map(t,n){const r=[];let i=0;for(const o of this)r.push([o[0],Reflect.apply(t,n,[o,i,this])]),i++;return new Qe(r)}reduce(...t){const[n,r]=t;let i=0,o=r??this.at(0);for(const s of this)i===0&&t.length===1?o=s:o=Reflect.apply(n,this,[o,s,i,this]),i++;return o}reduceRight(...t){const[n,r]=t;let i=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const s=this.at(o);o===this.size-1&&t.length===1?i=s:i=Reflect.apply(n,this,[i,s,o,this])}return i}toSorted(t){const n=[...this.entries()].sort(t);return new Qe(n)}toReversed(){const t=new Qe;for(let n=this.size-1;n>=0;n--){const r=this.keyAt(n),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){const n=[...this.entries()];return n.splice(...t),new Qe(n)}slice(t,n){const r=new Qe;let i=this.size-1;if(t===void 0)return r;t<0&&(t=t+this.size),n!==void 0&&n>0&&(i=n-1);for(let o=t;o<=i;o++){const s=this.keyAt(o),a=this.get(s);r.set(s,a)}return r}every(t,n){let r=0;for(const i of this){if(!Reflect.apply(t,n,[i,r,this]))return!1;r++}return!0}some(t,n){let r=0;for(const i of this){if(Reflect.apply(t,n,[i,r,this]))return!0;r++}return!1}};function Bn(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Sc(e,t);return n===-1?void 0:e[n]}Z(Bn,"at");function Sc(e,t){const n=e.length,r=vo(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Z(Sc,"toSafeIndex");function vo(e){return e!==e||e===0?0:Math.trunc(e)}Z(vo,"toSafeInteger");function jd(e){const t=e+"CollectionProvider",[n,r]=Je(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new $r,setItemMap:Z(()=>{},"setItemMap")}),s=Z(({state:y,...b})=>y?(0,S.jsx)(c,{...b,state:y}):(0,S.jsx)(a,{...b}),"CollectionProvider");s.displayName=t;const a=Z(y=>{const b=v();return(0,S.jsx)(c,{...y,state:b})},"CollectionInit");a.displayName=t+"Init";const c=Z(y=>{const{scope:b,children:w,state:T}=y,R=h.useRef(null),[C,P]=h.useState(null),E=Y(R,P),[k,I]=T;return h.useEffect(()=>{if(!C)return;const D=Pc(()=>{});return D.observe(C,{childList:!0,subtree:!0}),()=>{D.disconnect()}},[C]),(0,S.jsx)(i,{scope:b,itemMap:k,setItemMap:I,collectionRef:E,collectionRefObject:R,collectionElement:C,children:w})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",l=Lt(u),f=h.forwardRef((y,b)=>{const{scope:w,children:T}=y,R=o(u,w),C=Y(b,R.collectionRef);return(0,S.jsx)(l,{ref:C,children:T})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=Lt(d),g=h.forwardRef((y,b)=>{const{scope:w,children:T,...R}=y,C=h.useRef(null),[P,E]=h.useState(null),k=Y(b,C,E),{setItemMap:I}=o(d,w),D=h.useRef(R);Cc(D.current,R)||(D.current=R);const O=D.current;return h.useEffect(()=>{const V=O;return I(j=>P?j.has(P)?j.set(P,{...V,element:P}).toSorted(xi):(j.set(P,{...V,element:P}),j.toSorted(xi)):j),()=>{I(j=>!P||!j.has(P)?j:(j.delete(P),new $r(j)))}},[P,O,I]),(0,S.jsx)(m,{[p]:"",ref:k,children:T})});g.displayName=d;function v(){return h.useState(new $r)}Z(v,"useInitCollection");function x(y){const{itemMap:b}=o(e+"CollectionConsumer",y);return b}return Z(x,"useCollection"),[{Provider:s,Slot:f,ItemSlot:g},{createCollectionScope:r,useCollection:x,useInitCollection:v}]}Z(jd,"createCollection");function Cc(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Z(Cc,"shallowEqual");function Tc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Z(Tc,"isElementPreceding");function xi(e,t){return!e[1].element||!t[1].element?0:Tc(e[1].element,t[1].element)?-1:1}Z(xi,"sortByDocumentPosition");function Pc(e){return new MutationObserver(t=>{for(const n of t)if(n.type==="childList"){e();return}})}Z(Pc,"getChildListObserver");var $d=Object.defineProperty,$t=(e,t)=>$d(e,"name",{value:t,configurable:!0}),Rc=!!(typeof window<"u"&&window.document&&window.document.createElement);function L(e,t,{checkForDefaultPrevented:n=!0}={}){return $t(function(i){if(e?.(i),n===!1||!i||!i.defaultPrevented)return t?.(i)},"handleEvent")}$t(L,"composeEventHandlers");function Bd(e){if(!Rc)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}$t(Bd,"getOwnerWindow");function Si(e){if(!Rc)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}$t(Si,"getOwnerDocument");function Ec(e,t=!1){const{activeElement:n}=Si(e);if(!n?.nodeName)return null;if(Ac(n)&&n.contentDocument)return Ec(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Si(n).getElementById(r);if(i)return i}}return n}$t(Ec,"getActiveElement");function Ac(e){return e.tagName==="IFRAME"}$t(Ac,"isFrame");var me=globalThis?.document?h.useLayoutEffect:()=>{},qd=Object.defineProperty,Ud=(e,t)=>qd(e,"name",{value:t,configurable:!0}),gs=h[" useEffectEvent ".trim().toString()],vs=h[" useInsertionEffect ".trim().toString()];function Mc(e){if(typeof gs=="function")return gs(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof vs=="function"?vs(()=>{t.current=e}):me(()=>{t.current=e}),h.useMemo(()=>((...n)=>t.current?.(...n)),[])}Ud(Mc,"useEffectEvent");var Wd=Object.defineProperty,vn=(e,t)=>Wd(e,"name",{value:t,configurable:!0}),Hd=h[" useInsertionEffect ".trim().toString()]||me;function yn({prop:e,defaultProp:t,onChange:n=vn(()=>{},"onChange"),caller:r}){const[i,o,s]=kc({defaultProp:t,onChange:n}),a=e!==void 0;return[a?e:i,h.useCallback(u=>{if(a){const l=Dc(u)?u(e):u;l!==e&&s.current?.(l)}else o(u)},[a,e,o,s])]}vn(yn,"useControllableState");function kc({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),i=h.useRef(n),o=h.useRef(t);return Hd(()=>{o.current=t},[t]),h.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}vn(kc,"useUncontrolledState");function Dc(e){return typeof e=="function"}vn(Dc,"isFunction");var ys=Symbol("RADIX:SYNC_STATE");function zd(e,t,n,r){const{prop:i,defaultProp:o,onChange:s,caller:a}=t,c=i!==void 0,u=Mc(s),l=[{...n,state:o}];r&&l.push(r);const[f,d]=h.useReducer((v,x)=>{if(x.type===ys)return{...v,state:x.state};const y=e(v,x);return c&&!Object.is(y.state,v.state)&&u(y.state),y},...l),p=f.state,m=h.useRef(p);h.useEffect(()=>{m.current!==p&&(m.current=p,c||u(p))},[p,m,c]);const g=h.useMemo(()=>i!==void 0?{...f,state:i}:f,[f,i]);return h.useEffect(()=>{c&&!Object.is(i,f.state)&&d({type:ys,state:i})},[i,f.state,c]),[g,d]}vn(zd,"useControllableStateReducer");var Kd=Object.defineProperty,Be=(e,t)=>Kd(e,"name",{value:t,configurable:!0});function Oc(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}Be(Oc,"useStateMachine");var Bt=Be(e=>{const{present:t,children:n}=e,r=_c(t),i=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=Ic(r.ref,Lc(i));return typeof n=="function"||r.isPresent?h.cloneElement(i,{ref:o}):null},"Presence");function _c(e){const[t,n]=h.useState(),r=h.useRef(null),i=h.useRef(e),o=h.useRef("none"),s=h.useRef(void 0),[a,c]=Oc(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{a==="mounted"?(o.current=s.current??Pt(r.current),s.current=void 0):o.current="none"},[a]),me(()=>{const u=r.current,l=i.current;if(l!==e){const f=o.current,d=Pt(u);e?(s.current=d,c("MOUNT")):d==="none"||u?.display==="none"?c("UNMOUNT"):c(l&&f!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),me(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,f=Be(p=>{const m=Pt(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},"handleAnimationEnd"),d=Be(p=>{p.target===t&&(o.current=Pt(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(u=>{if(u){const l=getComputedStyle(u);r.current=l,s.current=Pt(l)}else r.current=null;n(u)},[])}}Be(_c,"usePresence");function Ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Be(Ci,"setRef");function Ic(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(s=>{const a=Ci(s,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<o.length;s++){const a=o[s];typeof a=="function"?a():Ci(r[s],null)}}},[])}Be(Ic,"useStableComposedRefs");function Pt(e){return e?.animationName||"none"}Be(Pt,"getAnimationName");function Lc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Be(Lc,"getElementRef");var Qd=Object.defineProperty,Gd=(e,t)=>Qd(e,"name",{value:t,configurable:!0}),Yd=h[" useId ".trim().toString()]||(()=>{}),Xd=0;function ht(e){const[t,n]=h.useState(Yd());return me(()=>{e||n(r=>r??String(Xd++))},[e]),e||(t?`radix-${t}`:"")}Gd(ht,"useId");var Zd=Object.defineProperty,Jd=(e,t)=>Zd(e,"name",{value:t,configurable:!0}),eh=h.createContext(void 0);function yo(e){const t=h.useContext(eh);return e||t||"ltr"}Jd(yo,"useDirection");var th=Object.defineProperty,nh=(e,t)=>th(e,"name",{value:t,configurable:!0});function xe(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>((...n)=>t.current?.(...n)),[])}nh(xe,"useCallbackRef");var rh=Object.defineProperty,X=(e,t)=>rh(e,"name",{value:t,configurable:!0}),Ti="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",oh="dismissableLayer.focusOutside",ws,Vc=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Fc=h.forwardRef(X(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...l}=t,f=h.useContext(Vc),[d,p]=h.useState(null),m=d?.ownerDocument??globalThis?.document,[,g]=h.useState({}),v=Y(n,p),x=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?x.indexOf(y):-1,w=d?x.indexOf(d):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,R=w>=b,C=h.useRef(!1),P=Nc(D=>{s?.(D),c?.(D),D.defaultPrevented||u?.()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(D=>{if(!(D instanceof Node))return!1;const O=[...f.branches].some(V=>V.contains(D));return R&&!O},[f.branches,R])}),E=jc(D=>{if(i&&C.current)return;const O=D.target;[...f.branches].some(V=>V.contains(O))||(a?.(D),c?.(D),D.defaultPrevented||u?.())},m),k=d?w===x.length-1:!1,I=xe(D=>{D.key==="Escape"&&(o?.(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))});return h.useEffect(()=>{if(k)return m.addEventListener("keydown",I,{capture:!0}),()=>m.removeEventListener("keydown",I,{capture:!0})},[m,k,I]),h.useEffect(()=>{if(d)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ws=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),Pi(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(d),f.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=ws))}},[d,m,r,f]),h.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),Pi())},[d,f]),h.useEffect(()=>{const D=X(()=>g({}),"handleUpdate");return document.addEventListener(Ti,D),()=>document.removeEventListener(Ti,D)},[]),(0,S.jsx)(ne.div,{...l,ref:v,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:L(t.onFocusCapture,E.onFocusCapture),onBlurCapture:L(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:L(t.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function sh(){const e=h.useContext(Vc),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}X(sh,"useDismissableLayerSurface");var ah=X(()=>!0,"IS_TRUE");function Nc(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:s=ah}=t,a=xe(e),c=h.useRef(!1),u=h.useRef(!1),l=h.useRef(new Map),f=h.useRef(()=>{});return h.useEffect(()=>{function d(){u.current=!1,i.current=!1,l.current.clear()}X(d,"resetOutsideInteraction");function p(){return Array.from(l.current.values()).some(Boolean)}X(p,"isOutsideInteractionIntercepted");function m(b){if(!u.current)return;const w=b.target;w instanceof Node&&[...o].some(T=>T.contains(w))||l.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}X(m,"handleInteractionCapture");function g(b){u.current&&l.current.set(b.type,!1)}X(g,"handleInteractionBubble");const v=X(b=>{if(b.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const R=p();d(),R||wo(ih,a,T,{discrete:!0})};if(X(w,"handleAndDispatchPointerDownOutsideEvent"),!s(b.target)){n.removeEventListener("click",f.current),d(),c.current=!1;return}const T={originalEvent:b};u.current=!0,i.current=r&&b.button===0,l.current.clear(),!r||b.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),d();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,m,!0),n.addEventListener(b,g);const y=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(y),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,m,!0),n.removeEventListener(b,g)}},[n,a,r,i,o,s]),{onPointerDownCapture:X(()=>c.current=!0,"onPointerDownCapture")}}X(Nc,"usePointerDownOutside");function jc(e,t=globalThis?.document){const n=xe(e),r=h.useRef(!1);return h.useEffect(()=>{const i=X(o=>{o.target&&!r.current&&wo(oh,n,{originalEvent:o},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:X(()=>r.current=!0,"onFocusCapture"),onBlurCapture:X(()=>r.current=!1,"onBlurCapture")}}X(jc,"useFocusOutside");function Pi(){const e=new CustomEvent(Ti);document.dispatchEvent(e)}X(Pi,"dispatchUpdate");function wo(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mo(i,o):i.dispatchEvent(o)}X(wo,"handleAndDispatchCustomEvent");var ch=Object.defineProperty,re=(e,t)=>ch(e,"name",{value:t,configurable:!0}),Br="focusScope.autoFocusOnMount",qr="focusScope.autoFocusOnUnmount",bs={bubbles:!1,cancelable:!0},uh=h.forwardRef(re(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=t,[c,u]=h.useState(null),l=xe(o),f=xe(s),d=h.useRef(null),p=Y(n,u),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(i){let v=function(w){if(m.paused||!c)return;const T=w.target;c.contains(T)?d.current=T:Ve(d.current,{select:!0})},x=function(w){if(m.paused||!c)return;const T=w.relatedTarget;T!==null&&(c.contains(T)||Ve(d.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&Ve(c)};re(v,"handleFocusIn"),re(x,"handleFocusOut"),re(y,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(y);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[i,c,m.paused]),h.useEffect(()=>{if(c){xs.add(m);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(Br,bs);c.addEventListener(Br,l),c.dispatchEvent(x),x.defaultPrevented||($c(Hc(bo(c)),{select:!0}),document.activeElement===v&&Ve(c))}return()=>{c.removeEventListener(Br,l),setTimeout(()=>{const x=new CustomEvent(qr,bs);c.addEventListener(qr,f),c.dispatchEvent(x),x.defaultPrevented||Ve(v??document.body,{select:!0}),c.removeEventListener(qr,f),xs.remove(m)},0)}}},[c,l,f,m]);const g=h.useCallback(v=>{if(!r&&!i||m.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(x&&y){const b=v.currentTarget,[w,T]=Bc(b);w&&T?!v.shiftKey&&y===T?(v.preventDefault(),r&&Ve(w,{select:!0})):v.shiftKey&&y===w&&(v.preventDefault(),r&&Ve(T,{select:!0})):y===b&&v.preventDefault()}},[r,i,m.paused]);return(0,S.jsx)(ne.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})},"FocusScope"));function $c(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ve(r,{select:t}),document.activeElement!==n)return}re($c,"focusFirst");function Bc(e){const t=bo(e);return[Ri(t,e),Ri(t.reverse(),e)]}re(Bc,"getTabbableEdges");function bo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:re(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}re(bo,"getTabbableCandidates");function Ri(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):qc(r,{upTo:t})))return r}re(Ri,"findVisible");function qc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}re(qc,"isHidden");function Uc(e){return e instanceof HTMLInputElement&&"select"in e}re(Uc,"isSelectableInput");function Ve(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Uc(e)&&t&&e.select()}}re(Ve,"focus");var xs=Wc();function Wc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ei(e,t),e.unshift(t)},remove(t){e=Ei(e,t),e[0]?.resume()}}}re(Wc,"createFocusScopesStack");function Ei(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}re(Ei,"arrayRemove");function Hc(e){return e.filter(t=>t.tagName!=="A")}re(Hc,"removeLinks");var lh=Object.defineProperty,fh=(e,t)=>lh(e,"name",{value:t,configurable:!0}),zc=h.forwardRef(fh(function(t,n){const{container:r,...i}=t,[o,s]=h.useState(!1);me(()=>s(!0),[]);const a=r||o&&globalThis?.document?.body;return a?po.createPortal((0,S.jsx)(ne.div,{...i,ref:n}),a):null},"Portal")),dh=Object.defineProperty,xo=(e,t)=>dh(e,"name",{value:t,configurable:!0}),En=0,xt=null;function hh(e){return So(),e.children}xo(hh,"FocusGuards");function So(){h.useEffect(()=>{xt||(xt={start:Ai(),end:Ai()});const{start:e,end:t}=xt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),En++,()=>{En===1&&(xt?.start.remove(),xt?.end.remove(),xt=null),En=Math.max(0,En-1)}},[])}xo(So,"useFocusGuards");function Ai(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}xo(Ai,"createFocusGuard");var Re=function(){return Re=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Re.apply(this,arguments)};function Kc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ph(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var qn="right-scroll-bar-position",Un="width-before-scroll-bar",mh="with-scroll-bars-hidden",gh="--removed-body-scroll-bar-size";function Ur(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vh(e,t){var n=(0,h.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var yh=typeof window<"u"?h.useLayoutEffect:h.useEffect,Ss=new WeakMap;function wh(e,t){var n=vh(t||null,function(r){return e.forEach(function(i){return Ur(i,r)})});return yh(function(){var r=Ss.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Ur(a,null)}),o.forEach(function(a){i.has(a)||Ur(a,s)})}Ss.set(n,e)},[e]),n}function bh(e){return e}function xh(e,t){t===void 0&&(t=bh);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(i),o=n}var a=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}}}function Sh(e){e===void 0&&(e={});var t=xh(null);return t.options=Re({async:!0,ssr:!1},e),t}var Qc=function(e){var t=e.sideCar,n=Kc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Re({},n))};Qc.isSideCarExport=!0;function Ch(e,t){return e.useMedium(t),Qc}var Gc=Sh(),Wr=function(){},yr=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,l=e.enabled,f=e.shards,d=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=Kc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=d,R=wh([n,t]),C=Re(Re({},w),i);return h.createElement(h.Fragment,null,l&&h.createElement(T,{sideCar:Gc,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:b}),s?h.cloneElement(h.Children.only(a),Re(Re({},C),{ref:R})):h.createElement(y,Re({},C,{className:c,ref:R}),a))});yr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yr.classNames={fullWidth:Un,zeroRight:qn};var Cs,Th=function(){if(Cs)return Cs;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ph(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Th();return t&&e.setAttribute("nonce",t),e}function Rh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Eh(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}var Ah=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ph())&&(Rh(t,n),Eh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mh=function(){var e=Ah();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yc=function(){var e=Mh(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},kh={left:0,top:0,right:0,gap:0},Hr=function(e){return parseInt(e||"",10)||0},Dh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Hr(n),Hr(r),Hr(i)]},Oh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kh;var t=Dh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_h=Yc(),Xt="data-scroll-locked",Ih=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(mh,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -41,4 +41,4 @@ import{o as bc}from"./rolldown-runtime-BlpueFg6.js";import{_ as hd,g as ps,p as
|
|
|
41
41
|
`)},zh=0,Ct=[];function Kh(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),i=h.useState(zh++)[0],o=h.useState(Yc)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=ph([e.lockRef.current],(e.shards||[]).map(Es),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var x=Mn(g),y=n.current,b="deltaX"in g?g.deltaX:y[0]-x[0],w="deltaY"in g?g.deltaY:y[1]-x[1],T,R=g.target,C=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in g&&C==="h"&&R.type==="range")return!1;var P=window.getSelection(),E=P&&P.anchorNode;if(E&&(E===R||E.contains(R)))return!1;var k=Ps(C,R);if(!k)return!0;if(k?T=C:(T=C==="v"?"h":"v",k=Ps(C,R)),!k)return!1;if(!r.current&&"changedTouches"in g&&(b||w)&&(r.current=T),!T)return!0;var I=r.current||T;return Uh(I,v,g,I==="h"?b:w,!0)},[]),c=h.useCallback(function(g){var v=g;if(!(!Ct.length||Ct[Ct.length-1]!==o)){var x="deltaY"in v?Rs(v):Mn(v),y=t.current.filter(function(w){return w.name===v.type&&(w.target===v.target||v.target===w.shadowParent)&&Wh(w.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var b=(s.current.shards||[]).map(Es).filter(Boolean).filter(function(w){return w.contains(v.target)});(b.length>0?a(v,b[0]):!s.current.noIsolation)&&v.cancelable&&v.preventDefault()}}},[]),u=h.useCallback(function(g,v,x,y){var b={name:g,delta:v,target:x,should:y,shadowParent:Qh(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),l=h.useCallback(function(g){n.current=Mn(g),r.current=void 0},[]),f=h.useCallback(function(g){u(g.type,Rs(g),g.target,a(g,e.lockRef.current))},[]),d=h.useCallback(function(g){u(g.type,Mn(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Ct.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,St),document.addEventListener("touchmove",c,St),document.addEventListener("touchstart",l,St),function(){Ct=Ct.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,St),document.removeEventListener("touchmove",c,St),document.removeEventListener("touchstart",l,St)}},[]);var p=e.removeScrollBar,m=e.inert;return h.createElement(h.Fragment,null,m?h.createElement(o,{styles:Hh(i)}):null,p?h.createElement(Vh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gh=Ch(Gc,Kh),eu=h.forwardRef(function(e,t){return h.createElement(yr,Re({},e,{ref:t,sideCar:Gh}))});eu.classNames=yr.classNames;var Yh=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Tt=new WeakMap,kn=new WeakMap,Dn={},zr=0,tu=function(e){return e&&(e.host||tu(e.parentNode))},Xh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=tu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Zh=function(e,t,n,r){var i=Xh(t,Array.isArray(e)?e:[e]);Dn[n]||(Dn[n]=new WeakMap);var o=Dn[n],s=[],a=new Set,c=new Set(i),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};i.forEach(u);var l=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))l(d);else try{var p=d.getAttribute(r),m=p!==null&&p!=="false",g=(Tt.get(d)||0)+1,v=(o.get(d)||0)+1;Tt.set(d,g),o.set(d,v),s.push(d),g===1&&m&&kn.set(d,!0),v===1&&d.setAttribute(n,"true"),m||d.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",d,x)}})};return l(t),a.clear(),zr++,function(){s.forEach(function(f){var d=Tt.get(f)-1,p=o.get(f)-1;Tt.set(f,d),o.set(f,p),d||(kn.has(f)||f.removeAttribute(r),kn.delete(f)),p||f.removeAttribute(n)}),zr--,zr||(Tt=new WeakMap,Tt=new WeakMap,kn=new WeakMap,Dn={})}},Jh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Yh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Zh(r,i,n,"aria-hidden")):function(){return null}},ep=Object.defineProperty,tp=(e,t)=>ep(e,"name",{value:t,configurable:!0});function nu(e){const[t,n]=h.useState(void 0);return me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}tp(nu,"useSize");var np=["top","right","bottom","left"],Ye=Math.min,Ne=Math.max,nr=Math.round,On=Math.floor,je=e=>({x:e,y:e}),rp={left:"right",right:"left",bottom:"top",top:"bottom"};function ru(e,t,n){return Ne(e,Ye(t,n))}function qe(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function Co(e){return e==="x"?"y":"x"}function To(e){return e==="y"?"height":"width"}function Ee(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Po(e){return Co(Ee(e))}function ip(e,t,n){n===void 0&&(n=!1);const r=qt(e),i=Po(e),o=To(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=rr(s)),[s,rr(s)]}function op(e){const t=rr(e);return[ki(e),t,ki(t)]}function ki(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var As=["left","right"],Ms=["right","left"],sp=["top","bottom"],ap=["bottom","top"];function cp(e,t,n){switch(e){case"top":case"bottom":return n?t?Ms:As:t?As:Ms;case"left":case"right":return t?sp:ap;default:return[]}}function up(e,t,n,r){const i=qt(e);let o=cp(Xe(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(ki)))),o}function rr(e){const t=Xe(e);return rp[t]+e.slice(t.length)}function lp(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function iu(e){return typeof e!="number"?lp(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ks(e,t,n){let{reference:r,floating:i}=e;const o=Ee(t),s=Po(t),a=To(s),c=Xe(t),u=o==="y",l=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let p;switch(c){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}const m=qt(t);return m&&(p[s]+=d*(m==="end"?1:-1)*(n&&u?-1:1)),p}async function fp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=qe(t,e),m=iu(p),g=a[d?f==="floating"?"reference":"floating":f],v=ir(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(y))&&await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1},w=ir(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:c}):x);return{top:(v.top-w.top+m.top)/b.y,bottom:(w.bottom-v.bottom+m.bottom)/b.y,left:(v.left-w.left+m.left)/b.x,right:(w.right-v.right+m.right)/b.x}}var dp=50,hp=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:fp},c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=ks(u,r,c),d=r,p=0;const m={};for(let g=0;g<o.length;g++){const v=o[g];if(!v)continue;const{name:x,fn:y}=v,{x:b,y:w,data:T,reset:R}=await y({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});l=b??l,f=w??f,m[x]={...m[x],...T},R&&p<dp&&(p++,typeof R=="object"&&(R.placement&&(d=R.placement),R.rects&&(u=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:l,y:f}=ks(u,d,c)),g=-1)}return{x:l,y:f,placement:d,strategy:i,middlewareData:m}},pp=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=t,{element:u,padding:l=0}=qe(e,t)||{};if(u==null)return{};const f=iu(l),d={x:n,y:r},p=Po(i),m=To(p),g=await s.getDimensions(u),v=p==="y",x=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=o.reference[m]+o.reference[p]-d[p]-o.floating[m],T=d[p]-o.reference[p],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let C=R?R[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(R)))&&(C=a.floating[b]||o.floating[m]);const P=w/2-T/2,E=C/2-g[m]/2-1,k=Ye(f[x],E),I=Ye(f[y],E),D=C-g[m]-I,O=C/2-g[m]/2+P,V=ru(k,O,D),j=!c.arrow&&qt(i)!=null&&O!==V&&o.reference[m]/2-(O<k?k:I)-g[m]/2<0,U=j?O<k?O-k:O-D:0;return{[p]:d[p]+U,data:{[p]:V,centerOffset:O-V-U,...j&&{alignmentOffset:U}},reset:j}}}),mp=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=qe(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Xe(i),y=Ee(a),b=Xe(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),T=d||(b||!g?[rr(a)]:op(a)),R=m!=="none";!d&&R&&T.push(...up(a,g,m,w));const C=[a,...T],P=await c.detectOverflow(t,v),E=[];let k=((r=o.flip)==null?void 0:r.overflows)||[];if(l&&E.push(P[x]),f){const V=ip(i,s,w);E.push(P[V[0]],P[V[1]])}if(k=[...k,{placement:i,overflows:E}],!E.every(V=>V<=0)){var I,D;const V=(((I=o.flip)==null?void 0:I.index)||0)+1,j=C[V];if(j&&(!(f==="alignment"&&y!==Ee(j))||k.every($=>Ee($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:V,overflows:k},reset:{placement:j}};let U=(D=k.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(p){case"bestFit":{var O;const $=(O=k.filter(_=>{if(R){const F=Ee(_.placement);return F===y||F==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((_,F)=>_[1]-F[1])[0])==null?void 0:O[0];$&&(U=$);break}case"initialPlacement":U=a}if(i!==U)return{reset:{placement:U}}}return{}}}};function Ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Os(e){return np.some(t=>e[t]>=0)}var gp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=qe(e,t);switch(i){case"referenceHidden":{const s=Ds(await r.detectOverflow(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Os(s)}}}case"escaped":{const s=Ds(await r.detectOverflow(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:s,escaped:Os(s)}}}default:return{}}}}},ou=new Set(["left","top"]);async function vp(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Xe(n),a=qt(n),c=Ee(n)==="y",u=ou.has(s)?-1:1,l=o&&c?-1:1,f=qe(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*l,y:d*u}:{x:d*u,y:p*l}}var yp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,c=await vp(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},wp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...u}=qe(e,t),l={x:n,y:r},f=await o.detectOverflow(t,u),d=Ee(i),p=Co(d);let m=l[p],g=l[d];const v=(y,b)=>ru(b+f[y==="y"?"top":"left"],b,b-f[y==="y"?"bottom":"right"]);s&&(m=v(p,m)),a&&(g=v(d,g));const x=c.fn({...t,[p]:m,[d]:g});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:s,[d]:a}}}}}},bp=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:o,placement:s,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:l=!0,crossAxis:f=!0}=qe(e,t),d={x:i,y:o},p=Ee(s),m=Co(p);let g=d[m],v=d[p];const x=qe(u,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(l){const T=m==="y"?"height":"width",R=a.reference[m]-a.floating[T]+y.mainAxis,C=a.reference[m]+a.reference[T]-y.mainAxis;g<R?g=R:g>C&&(g=C)}if(f){var b,w;const T=m==="y"?"width":"height",R=ou.has(Xe(s)),C=a.reference[p]-a.floating[T]+(R&&((b=c.offset)==null?void 0:b[p])||0)+(R?0:y.crossAxis),P=a.reference[p]+a.reference[T]+(R?0:((w=c.offset)==null?void 0:w[p])||0)-(R?y.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[m]:g,[p]:v}}}},xp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=qe(e,t),c=await i.detectOverflow(t,a),u=Xe(n),l=qt(n),f=Ee(n)==="y",{width:d,height:p}=r.floating;let m,g;u==="top"||u==="bottom"?(m=u,g=l===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,m=l==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=d-c.left-c.right,y=Ye(p-c[m],v),b=Ye(d-c[g],x),w=t.middlewareData.shift,T=!w;let R=y,C=b;w!=null&&w.enabled.x&&(C=x),w!=null&&w.enabled.y&&(R=v),T&&!l&&(f?C=d-2*Ne(c.left,c.right):R=p-2*Ne(c.top,c.bottom)),await s({...t,availableWidth:C,availableHeight:R});const P=await i.getDimensions(o.floating);return d!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function wr(){return typeof window<"u"}function Ut(e){return su(e)?(e.nodeName||"").toLowerCase():"#document"}function ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function We(e){var t;return(t=(su(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function su(e){return wr()?e instanceof Node||e instanceof ae(e).Node:!1}function De(e){return wr()?e instanceof Element||e instanceof ae(e).Element:!1}function et(e){return wr()?e instanceof HTMLElement||e instanceof ae(e).HTMLElement:!1}function _s(e){return!wr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ae(e).ShadowRoot}function br(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Sp(e){return/^(table|td|th)$/.test(Ut(e))}function xr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Cp=/transform|translate|scale|rotate|perspective|filter/,Tp=/paint|layout|strict|content/,rt=e=>!!e&&e!=="none",Kr;function Ro(e){const t=De(e)?Oe(e):e;return rt(t.transform)||rt(t.translate)||rt(t.scale)||rt(t.rotate)||rt(t.perspective)||!Eo()&&(rt(t.backdropFilter)||rt(t.filter))||Cp.test(t.willChange||"")||Tp.test(t.contain||"")}function Pp(e){let t=pt(e);for(;et(t)&&!nn(t);){if(Ro(t))return t;if(xr(t))return null;t=pt(t)}return null}function Eo(){return Kr==null&&(Kr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kr}function nn(e){return/^(html|body|#document)$/.test(Ut(e))}function Oe(e){return ae(e).getComputedStyle(e)}function Sr(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pt(e){if(Ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_s(e)&&e.host||We(e);return _s(t)?t.host:t}function au(e){const t=pt(e);return nn(t)?(e.ownerDocument||e).body:et(t)&&br(t)?t:au(t)}function rn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=au(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=ae(i);if(o){const a=Di(s);return t.concat(s,s.visualViewport||[],br(i)?i:[],a&&n?rn(a):[])}else return t.concat(i,rn(i,[],n))}function Di(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cu(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=et(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=nr(n)!==o||nr(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Ao(e){return De(e)?e:e.contextElement}function _t(e){const t=Ao(e);if(!et(t))return je(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=cu(t);let s=(o?nr(n.width):n.width)/r,a=(o?nr(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Rp=je(0);function uu(e){const t=ae(e);return!Eo()||!t.visualViewport?Rp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ep(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ae(e)}function mt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ao(e);let s=je(1);t&&(r?De(r)&&(s=_t(r)):s=_t(e));const a=Ep(o,n,r)?uu(o):je(0);let c=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,l=i.width/s.x,f=i.height/s.y;if(o&&r){const d=ae(o),p=De(r)?ae(r):r;let m=d,g=Di(m);for(;g&&p!==m;){const v=_t(g),x=g.getBoundingClientRect(),y=Oe(g),b=x.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,w=x.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,u*=v.y,l*=v.x,f*=v.y,c+=b,u+=w,m=ae(g),g=Di(m)}}return ir({width:l,height:f,x:c,y:u})}function Cr(e,t){const n=Sr(e).scrollLeft;return t?t.left+n:mt(We(e)).left+n}function lu(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Cr(e,n),y:n.top+t.scrollTop}}function Ap(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=We(r),a=t?xr(t.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},u=je(1);const l=je(0),f=et(r);if((f||!o)&&((Ut(r)!=="body"||br(s))&&(c=Sr(r)),f)){const p=mt(r);u=_t(r),l.x=p.x+r.clientLeft,l.y=p.y+r.clientTop}const d=s&&!f&&!o?lu(s,c):je(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+d.x,y:n.y*u.y-c.scrollTop*u.y+l.y+d.y}}function Mp(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function kp(e){const t=Sr(e),n=e.ownerDocument.body,r=Ne(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ne(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Cr(e);const s=-t.scrollTop;return Oe(n).direction==="rtl"&&(o+=Ne(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:s}}var Dp=25;function Op(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=ae(e),o=We(e),s=i.visualViewport;let a=o.clientWidth,c=o.clientHeight,u=0,l=0;if(s){const f=!Eo()||t==="fixed";r?f||(u=-s.offsetLeft,l=-s.offsetTop):(a=s.width,c=s.height,f&&(u=s.offsetLeft,l=s.offsetTop))}if(Cr(o)<=0){const f=o.ownerDocument,d=f.body,p=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-d.clientWidth-m),v=getComputedStyle(o).scrollbarGutter==="stable both-edges"?g/2:g;v<=Dp&&(a-=v)}return{width:a,height:c,x:u,y:l}}function _p(e,t){const n=mt(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=_t(e);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}function Is(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=Op(e,n,t);else if(t==="document")r=kp(We(e));else if(De(t))r=_p(t,n);else{const i=uu(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ir(r)}function Ip(e,t){const n=t.get(e);if(n)return n;let r=rn(e,[],!1).filter(a=>De(a)&&Ut(a)!=="body"),i=null;const o=Oe(e).position==="fixed";let s=o?pt(e):e;for(;De(s)&&!nn(s);){const a=Oe(s),c=Ro(s),u=i?i.position:o?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(l=>l!==s):i=a,s=pt(s)}return t.set(e,r),r}function Lp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?xr(t)?[]:Ip(t,this._c):[].concat(n),r],s=Is(t,o[0],i);let a=s.top,c=s.right,u=s.bottom,l=s.left;for(let f=1;f<o.length;f++){const d=Is(t,o[f],i);a=Ne(d.top,a),c=Ye(d.right,c),u=Ye(d.bottom,u),l=Ne(d.left,l)}return{width:c-l,height:u-a,x:l,y:a}}function Vp(e){const{width:t,height:n}=cu(e);return{width:t,height:n}}function Fp(e,t,n){const r=et(t),i=We(t),o=n==="fixed",s=mt(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=je(0);if((r||!o)&&((Ut(t)!=="body"||br(i))&&(a=Sr(t)),r)){const l=mt(t,!0,o,t);c.x=l.x+t.clientLeft,c.y=l.y+t.clientTop}!r&&i&&(c.x=Cr(i));const u=i&&!r&&!o?lu(i,a):je(0);return{x:s.left+a.scrollLeft-c.x-u.x,y:s.top+a.scrollTop-c.y-u.y,width:s.width,height:s.height}}function Qr(e){return Oe(e).position==="static"}function Ls(e,t){if(!et(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return We(e)===n&&(n=n.ownerDocument.body),n}function fu(e,t){const n=ae(e);if(xr(e))return n;if(!et(e)){let i=pt(e);for(;i&&!nn(i);){if(De(i)&&!Qr(i))return i;i=pt(i)}return n}let r=Ls(e,t);for(;r&&Sp(r)&&Qr(r);)r=Ls(r,t);return r&&nn(r)&&Qr(r)&&!Ro(r)?n:r||Pp(e)||n}var Np=async function(e){const t=this.getOffsetParent||fu,n=this.getDimensions,r=await n(e.floating);return{reference:Fp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jp(e){return Oe(e).direction==="rtl"}var $p={convertOffsetParentRelativeRectToViewportRelativeRect:Ap,getDocumentElement:We,getClippingRect:Lp,getOffsetParent:fu,getElementRects:Np,getClientRects:Mp,getDimensions:Vp,getScale:_t,isElement:De,isRTL:jp};function du(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bp(e,t,n){let r=null,i;const o=We(e);function s(){var l;clearTimeout(i),(l=r)==null||l.disconnect(),r=null}function a(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),s();const d=e.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=d;if(l||t(),!g||!v)return;const x=On(m),y=On(o.clientWidth-(p+g)),b=On(o.clientHeight-(m+v)),w=On(p),T={rootMargin:-x+"px "+-y+"px "+-b+"px "+-w+"px",threshold:Ne(0,Ye(1,f))||1};let R=!0;function C(P){const E=P[0].intersectionRatio;if(!du(d,e.getBoundingClientRect()))return a();if(E!==f){if(!R)return a();E?a(!1,E):i=setTimeout(()=>{a(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(C,{...T,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,T)}r.observe(e)}const c=ae(e),u=()=>a(n);return c.addEventListener("resize",u),a(!0),()=>{c.removeEventListener("resize",u),s()}}function qp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Ao(e),l=i||o?[...u?rn(u):[],...t?rn(t):[]]:[];l.forEach(x=>{i&&x.addEventListener("scroll",n),o&&x.addEventListener("resize",n)});const f=u&&a?Bp(u,n,o):null;let d=-1,p=null;s&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let m,g=c?mt(e):null;c&&v();function v(){const x=mt(e);g&&!du(g,x)&&n(),g=x,m=requestAnimationFrame(v)}return n(),()=>{var x;l.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f?.(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Up=yp,Wp=wp,Hp=mp,zp=xp,Kp=gp,Vs=pp,Qp=bp,Gp=(e,t,n)=>{const r=new Map,i=n??{},o={...$p,...i.platform,_c:r};return hp(e,t,{...i,platform:o})},Wn=typeof document<"u"?h.useLayoutEffect:function(){};function or(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!or(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!or(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function hu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fs(e,t){const n=hu(e);return Math.round(t*n)/n}function Gr(e){const t=h.useRef(e);return Wn(()=>{t.current=e}),t}function Yp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[l,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=h.useState(r);or(d,r)||p(r);const[m,g]=h.useState(null),[v,x]=h.useState(null),y=h.useCallback(_=>{_!==R.current&&(R.current=_,g(_))},[]),b=h.useCallback(_=>{_!==C.current&&(C.current=_,x(_))},[]),w=o||m,T=s||v,R=h.useRef(null),C=h.useRef(null),P=h.useRef(l),E=c!=null,k=Gr(c),I=Gr(i),D=Gr(u),O=h.useCallback(()=>{if(!R.current||!C.current)return;const _={placement:t,strategy:n,middleware:d};I.current&&(_.platform=I.current),Gp(R.current,C.current,_).then(F=>{const M={...F,isPositioned:D.current!==!1};V.current&&!or(P.current,M)&&(P.current=M,po.flushSync(()=>{f(M)}))})},[d,t,n,I,D]);Wn(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[u]);const V=h.useRef(!1);Wn(()=>(V.current=!0,()=>{V.current=!1}),[]),Wn(()=>{if(w&&(R.current=w),T&&(C.current=T),w&&T){if(k.current)return k.current(w,T,O);O()}},[w,T,O,k,E]);const j=h.useMemo(()=>({reference:R,floating:C,setReference:y,setFloating:b}),[y,b]),U=h.useMemo(()=>({reference:w,floating:T}),[w,T]),$=h.useMemo(()=>{const _={position:n,left:0,top:0};if(!U.floating)return _;const F=Fs(U.floating,l.x),M=Fs(U.floating,l.y);return a?{..._,transform:"translate("+F+"px, "+M+"px)",...hu(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,a,U.floating,l.x,l.y]);return h.useMemo(()=>({...l,update:O,refs:j,elements:U,floatingStyles:$}),[l,O,j,U,$])}var Xp=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Vs({element:r.current,padding:i}).fn(n):{}:r?Vs({element:r,padding:i}).fn(n):{}}}},Zp=(e,t)=>{const n=Up(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jp=(e,t)=>{const n=Wp(e);return{name:n.name,fn:n.fn,options:[e,t]}},em=(e,t)=>({fn:Qp(e).fn,options:[e,t]}),tm=(e,t)=>{const n=Hp(e);return{name:n.name,fn:n.fn,options:[e,t]}},nm=(e,t)=>{const n=zp(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>{const n=Kp(e);return{name:n.name,fn:n.fn,options:[e,t]}},im=(e,t)=>{const n=Xp(e);return{name:n.name,fn:n.fn,options:[e,t]}},om=Object.defineProperty,sm=(e,t)=>om(e,"name",{value:t,configurable:!0}),am=h.forwardRef(sm(function(t,n){const{children:r,width:i=10,height:o=5,...s}=t;return(0,S.jsx)(ne.svg,{...s,ref:n,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:(0,S.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),cm=am,um=Object.defineProperty,$e=(e,t)=>um(e,"name",{value:t,configurable:!0}),pu="Popper",[mu,Tr]=Je(pu),[lm,gu]=mu(pu),fm=$e(e=>{const{__scopePopper:t,children:n}=e,[r,i]=h.useState(null),[o,s]=h.useState(void 0);return(0,S.jsx)(lm,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:s,children:n})},"Popper"),dm="PopperAnchor",hm=h.forwardRef($e(function(t,n){const{__scopePopper:r,virtualRef:i,...o}=t,s=gu(dm,r),a=h.useRef(null),c=s.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),l=Y(n,u),f=h.useRef(null);h.useEffect(()=>{if(!i)return;const g=f.current;f.current=i.current,g!==f.current&&c(f.current)});const d=s.placementState&&Pr(s.placementState),p=d?.[0],m=d?.[1];return i?null:(0,S.jsx)(ne.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:l})},"PopperAnchor")),vu="PopperContent",[pm,mm]=mu(vu),gm=h.forwardRef($e(function(t,n){const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:g,...v}=t,x=gu(vu,r),[y,b]=h.useState(null),w=Y(n,b),[T,R]=h.useState(null),C=nu(T),P=C?.width??0,E=C?.height??0,k=i+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(l)?l:[l],O=D.length>0,V={padding:I,boundary:D.filter(yu),altBoundary:O},{refs:j,floatingStyles:U,placement:$,isPositioned:_,middlewareData:F}=Yp({strategy:"fixed",placement:k,whileElementsMounted:$e((...jr)=>qp(...jr,{animationFrame:m==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[Zp({mainAxis:o+E,alignmentAxis:a}),u&&Jp({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?em():void 0,...V}),u&&tm({...V}),nm({...V,apply:$e(({elements:jr,rects:cd,availableWidth:ud,availableHeight:ld})=>{const{width:fd,height:dd}=cd.reference,Rn=jr.floating.style;Rn.setProperty("--radix-popper-available-width",`${ud}px`),Rn.setProperty("--radix-popper-available-height",`${ld}px`),Rn.setProperty("--radix-popper-anchor-width",`${fd}px`),Rn.setProperty("--radix-popper-anchor-height",`${dd}px`)},"apply")}),T&&im({element:T,padding:c}),bm({arrowWidth:P,arrowHeight:E}),p&&rm({strategy:"referenceHidden",...V,boundary:O?V.boundary:void 0})]}),M=x.setPlacementState;me(()=>(M($),()=>{M(void 0)}),[$,M]);const[de,Se]=Pr($),ze=xe(g);me(()=>{_&&ze?.()},[_,ze]);const Kt=F.arrow?.x,bt=F.arrow?.y,Ke=F.arrow?.centerOffset!==0,[ge,Pn]=h.useState();return me(()=>{y&&Pn(window.getComputedStyle(y).zIndex)},[y]),(0,S.jsx)("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:_?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,S.jsx)(pm,{scope:r,placedSide:de,placedAlign:Se,onArrowChange:R,arrowX:Kt,arrowY:bt,shouldHideArrow:Ke,children:(0,S.jsx)(ne.div,{"data-side":de,"data-align":Se,...v,ref:w,style:{...v.style,animation:_?v.style?.animation:"none"}})})})},"PopperContent")),vm="PopperArrow",ym={top:"bottom",right:"left",bottom:"top",left:"right"},wm=h.forwardRef($e(function(t,n){const{__scopePopper:r,...i}=t,o=mm(vm,r),s=ym[o.placedSide];return(0,S.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,S.jsx)(cm,{...i,ref:n,style:{...i.style,display:"block"}})})},"PopperArrow"));function yu(e){return e!==null}$e(yu,"isNotNull");var bm=$e(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[c,u]=Pr(n),l={start:"0%",center:"50%",end:"100%"}[u],f=(i.arrow?.x??0)+s/2,d=(i.arrow?.y??0)+a/2;let p="",m="";return c==="bottom"?(p=o?l:`${f}px`,m=`${-a}px`):c==="top"?(p=o?l:`${f}px`,m=`${r.floating.height+a}px`):c==="right"?(p=`${-a}px`,m=o?l:`${d}px`):c==="left"&&(p=`${r.floating.width+a}px`,m=o?l:`${d}px`),{data:{x:p,y:m}}}}),"transformOrigin");function Pr(e){const[t,n="center"]=e.split("-");return[t,n]}$e(Pr,"getSideAndAlignFromPlacement");var Mo=fm,wu=hm,bu=gm,xm=wm,Sm=Object.defineProperty,ko=(e,t)=>Sm(e,"name",{value:t,configurable:!0}),Yr=!1;function xu(){const[e,t]=h.useState(Yr);return h.useEffect(()=>{Yr||(Yr=!0,t(!0))},[]),e}ko(xu,"useIsHydrated");var Su=h[" useSyncExternalStore ".trim().toString()];function Cu(){return()=>{}}ko(Cu,"subscribe");function Tu(){return Su(Cu,()=>!0,()=>!1)}ko(Tu,"useIsHydratedModern");var Cm=typeof Su=="function"?Tu:xu,Tm=Object.defineProperty,yt=(e,t)=>Tm(e,"name",{value:t,configurable:!0}),Xr="rovingFocusGroup.onEntryFocus",Pm={bubbles:!1,cancelable:!0},Rr="RovingFocusGroup",[Oi,Pu,Rm]=go(Rr),[Em,Ru]=Je(Rr,[Rm]),[Am,Mm]=Em(Rr),km=h.forwardRef(yt(function(t,n){return(0,S.jsx)(Oi.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,S.jsx)(Oi.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,S.jsx)(Dm,{...t,ref:n})})})},"RovingFocusGroup")),Dm=h.forwardRef(yt(function(t,n){const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=t,p=h.useRef(null),m=Y(n,p),g=yo(s),[v,x]=yn({prop:a,defaultProp:c??null,onChange:u,caller:Rr}),[y,b]=h.useState(!1),w=xe(l),T=Pu(r),R=h.useRef(!1),[C,P]=h.useState(0);return h.useEffect(()=>{const E=p.current;if(E)return E.addEventListener(Xr,w),()=>E.removeEventListener(Xr,w)},[w]),(0,S.jsx)(Am,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:v,onItemFocus:h.useCallback(E=>x(E),[x]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>P(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>P(E=>E-1),[]),children:(0,S.jsx)(ne.div,{tabIndex:y||C===0?-1:0,"data-orientation":i,...d,ref:m,style:{outline:"none",...t.style},onMouseDown:L(t.onMouseDown,()=>{R.current=!0}),onFocus:L(t.onFocus,E=>{const k=!R.current;if(E.target===E.currentTarget&&k&&!y){const I=new CustomEvent(Xr,Pm);if(E.currentTarget.dispatchEvent(I),!I.defaultPrevented){const D=T().filter(O=>O.focusable);Do([D.find(O=>O.active),D.find(O=>O.id===v),...D].filter(Boolean).map(O=>O.ref.current),f)}}R.current=!1}),onBlur:L(t.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),Om="RovingFocusGroupItem",_m=h.forwardRef(yt(function(t,n){const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:a,...c}=t,u=ht(),l=s||u,f=Mm(Om,r),d=f.currentTabStopId===l,p=Pu(r),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:v}=f,x=Cm();return me(()=>{if(!(!x||!i))return m(),()=>g()},[x,i,m,g]),h.useEffect(()=>{if(!(x||!i))return m(),()=>g()},[x,i,m,g]),(0,S.jsx)(Oi.ItemSlot,{scope:r,id:l,focusable:i,active:o,children:(0,S.jsx)(ne.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:L(t.onMouseDown,y=>{i?f.onItemFocus(l):y.preventDefault()}),onFocus:L(t.onFocus,()=>f.onItemFocus(l)),onKeyDown:L(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=Au(y,f.orientation,f.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(T=>T.focusable).map(T=>T.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const T=w.indexOf(y.currentTarget);w=f.loop?Mu(w,T+1):w.slice(T+1)}setTimeout(()=>Do(w))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})},"RovingFocusGroupItem")),Im={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Eu(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}yt(Eu,"getDirectionAwareKey");function Au(e,t,n){const r=Eu(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Im[r]}yt(Au,"getFocusIntent");function Do(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}yt(Do,"focusFirst");function Mu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}yt(Mu,"wrapArray");var Lm=km,Vm=_m,Fm=Object.defineProperty,N=(e,t)=>Fm(e,"name",{value:t,configurable:!0}),_i=["Enter"," "],Nm=["ArrowDown","PageUp","Home"],ku=["ArrowUp","PageDown","End"],jm=[...Nm,...ku],$m={ltr:[..._i,"ArrowRight"],rtl:[..._i,"ArrowLeft"]},Bm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Er="Menu",[on,qm,Um]=go(Er),[wt,Du]=Je(Er,[Um,Tr,Ru]),Ar=Tr(),Ou=Ru(),[_u,tt]=wt(Er),[Wm,wn]=wt(Er),Hm=N(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ar(t),[c,u]=h.useState(null),l=h.useRef(!1),f=xe(o),d=yo(i);return h.useEffect(()=>{const p=N(()=>{l.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},"handleKeyDown"),m=N(()=>l.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=N(()=>f(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,f]),(0,S.jsx)(Mo,{...a,children:(0,S.jsx)(_u,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:(0,S.jsx)(Wm,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:l,dir:d,modal:s,children:r})})})},"Menu"),Iu=h.forwardRef(N(function(t,n){const{__scopeMenu:r,...i}=t,o=Ar(r);return(0,S.jsx)(wu,{...o,...i,ref:n})},"MenuAnchor")),Lu="MenuPortal",[zm,Vu]=wt(Lu,{forceMount:void 0}),Km=N(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=tt(Lu,t);return(0,S.jsx)(zm,{scope:t,forceMount:n,children:(0,S.jsx)(Bt,{present:n||o.open,children:(0,S.jsx)(zc,{asChild:!0,container:i,children:r})})})},"MenuPortal"),we="MenuContent",[Qm,Oo]=wt(we),Gm=h.forwardRef(N(function(t,n){const r=Vu(we,t.__scopeMenu),{forceMount:i=r.forceMount,...o}=t,s=tt(we,t.__scopeMenu),a=wn(we,t.__scopeMenu);return(0,S.jsx)(on.Provider,{scope:t.__scopeMenu,children:(0,S.jsx)(Bt,{present:i||s.open,children:(0,S.jsx)(on.Slot,{scope:t.__scopeMenu,children:a.modal?(0,S.jsx)(Ym,{...o,ref:n}):(0,S.jsx)(Xm,{...o,ref:n})})})})},"MenuContent")),Ym=h.forwardRef(N(function(t,n){const r=tt(we,t.__scopeMenu),i=h.useRef(null),o=Y(n,i);return h.useEffect(()=>{const s=i.current;if(s)return Jh(s)},[]),(0,S.jsx)(_o,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:L(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Xm=h.forwardRef(N(function(t,n){const r=tt(we,t.__scopeMenu);return(0,S.jsx)(_o,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Zm=Lt("MenuContent.ScrollLock"),_o=h.forwardRef(N(function(t,n){const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=t,x=tt(we,r),y=wn(we,r),b=Ar(r),w=Ou(r),T=qm(r),[R,C]=h.useState(null),P=h.useRef(null),E=Y(n,P,x.onContentChange),k=h.useRef(0),I=h.useRef(""),D=h.useRef(0),O=h.useRef(null),V=h.useRef("right"),j=h.useRef(0),U=g?eu:h.Fragment,$=g?{as:Zm,allowPinchZoom:!0}:void 0,_=N(M=>{const de=I.current+M,Se=T().filter(ge=>!ge.disabled),ze=document.activeElement,Kt=Se.find(ge=>ge.ref.current===ze)?.textValue,bt=Wu(Se.map(ge=>ge.textValue),de,Kt),Ke=Se.find(ge=>ge.textValue===bt)?.ref.current;N((function ge(Pn){I.current=Pn,window.clearTimeout(k.current),Pn!==""&&(k.current=window.setTimeout(()=>ge(""),1e3))}),"updateSearch")(de),Ke&&setTimeout(()=>Ke.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(k.current),[]),So();const F=h.useCallback(M=>V.current===O.current?.side&&zu(M,O.current?.area),[]);return(0,S.jsx)(Qm,{scope:r,searchRef:I,onItemEnter:h.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:h.useCallback(M=>{F(M)||(P.current?.focus(),C(null))},[F]),onTriggerLeave:h.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:h.useCallback(M=>{O.current=M},[]),children:(0,S.jsx)(U,{...$,children:(0,S.jsx)(uh,{asChild:!0,trapped:o,onMountAutoFocus:L(s,M=>{M.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:(0,S.jsx)(Fc,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,S.jsx)(Lm,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:C,onEntryFocus:L(u,M=>{y.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,S.jsx)(bu,{role:"menu","aria-orientation":"vertical","data-state":Lo(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:E,style:{outline:"none",...v.style},onKeyDown:L(v.onKeyDown,M=>{const de=M.target.closest("[data-radix-menu-content]")===M.currentTarget,Se=M.ctrlKey||M.altKey||M.metaKey,ze=M.key.length===1;de&&(M.key==="Tab"&&M.preventDefault(),!Se&&ze&&_(M.key));const Kt=P.current;if(M.target!==Kt||!jm.includes(M.key))return;M.preventDefault();const bt=T().filter(Ke=>!Ke.disabled).map(Ke=>Ke.ref.current);ku.includes(M.key)&&bt.reverse(),qu(bt)}),onBlur:L(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(k.current),I.current="")}),onPointerMove:L(t.onPointerMove,Vt(M=>{const de=M.target,Se=j.current!==M.clientX;if(M.currentTarget.contains(de)&&Se){const ze=M.clientX>j.current?"right":"left";V.current=ze,j.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Jm=h.forwardRef(N(function(t,n){const{__scopeMenu:r,...i}=t;return(0,S.jsx)(ne.div,{role:"group",...i,ref:n})},"MenuGroup")),eg=h.forwardRef(N(function(t,n){const{__scopeMenu:r,...i}=t;return(0,S.jsx)(ne.div,{...i,ref:n})},"MenuLabel")),Ii="MenuItem",Ns="menu.itemSelect",Io=h.forwardRef(N(function(t,n){const{disabled:r=!1,onSelect:i,...o}=t,s=h.useRef(null),a=wn(Ii,t.__scopeMenu),c=Oo(Ii,t.__scopeMenu),u=Y(n,s),l=h.useRef(!1),f=N(()=>{const d=s.current;if(!r&&d){const p=new CustomEvent(Ns,{bubbles:!0,cancelable:!0});d.addEventListener(Ns,m=>i?.(m),{once:!0}),mo(d,p),p.defaultPrevented?l.current=!1:a.onClose()}},"handleSelect");return(0,S.jsx)(Fu,{...o,ref:u,disabled:r,onClick:L(t.onClick,f),onPointerDown:d=>{t.onPointerDown?.(d),l.current=!0},onPointerUp:L(t.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:L(t.onKeyDown,d=>{r||d.target!==d.currentTarget||c.searchRef.current!==""&&d.key===" "||_i.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),Fu=h.forwardRef(N(function(t,n){const{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=t,a=Oo(Ii,r),c=Ou(r),u=h.useRef(null),l=Y(n,u),[f,d]=h.useState(!1),[p,m]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&m((g.textContent??"").trim())},[s.children]),(0,S.jsx)(on.ItemSlot,{scope:r,disabled:i,textValue:o??p,children:(0,S.jsx)(Vm,{asChild:!0,...c,focusable:!i,children:(0,S.jsx)(ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:l,onPointerMove:L(t.onPointerMove,Vt(g=>{i?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:L(t.onPointerLeave,Vt(g=>a.onItemLeave(g))),onFocus:L(t.onFocus,()=>d(!0)),onBlur:L(t.onBlur,()=>d(!1))})})})},"MenuItemImpl")),tg=h.forwardRef(N(function(t,n){const{checked:r=!1,onCheckedChange:i,...o}=t;return(0,S.jsx)(ju,{scope:t.__scopeMenu,checked:r,children:(0,S.jsx)(Io,{role:"menuitemcheckbox","aria-checked":sn(r)?"mixed":r,...o,ref:n,"data-state":Mr(r),onSelect:L(o.onSelect,()=>i?.(sn(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),[ng,rg]=wt("MenuRadioGroup",{value:void 0,onValueChange:N(()=>{},"onValueChange")}),ig=h.forwardRef(N(function(t,n){const{value:r,onValueChange:i,...o}=t,s=xe(i);return(0,S.jsx)(ng,{scope:t.__scopeMenu,value:r,onValueChange:s,children:(0,S.jsx)(Jm,{...o,ref:n})})},"MenuRadioGroup")),og="MenuRadioItem",sg=h.forwardRef(N(function(t,n){const{value:r,...i}=t,o=rg(og,t.__scopeMenu),s=r===o.value;return(0,S.jsx)(ju,{scope:t.__scopeMenu,checked:s,children:(0,S.jsx)(Io,{role:"menuitemradio","aria-checked":s,...i,ref:n,"data-state":Mr(s),onSelect:L(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Nu="MenuItemIndicator",[ju,ag]=wt(Nu,{checked:!1}),cg=h.forwardRef(N(function(t,n){const{__scopeMenu:r,forceMount:i,...o}=t,s=ag(Nu,r);return(0,S.jsx)(Bt,{present:i||sn(s.checked)||s.checked===!0,children:(0,S.jsx)(ne.span,{...o,ref:n,"data-state":Mr(s.checked)})})},"MenuItemIndicator")),ug=h.forwardRef(N(function(t,n){const{__scopeMenu:r,...i}=t;return(0,S.jsx)(ne.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})},"MenuSeparator")),$u="MenuSub",[lg,Bu]=wt($u),fg=N(e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=tt($u,t),s=Ar(t),[a,c]=h.useState(null),[u,l]=h.useState(null),f=xe(i);return h.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),(0,S.jsx)(Mo,{...s,children:(0,S.jsx)(_u,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:l,children:(0,S.jsx)(lg,{scope:t,contentId:ht(),triggerId:ht(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),_n="MenuSubTrigger",dg=h.forwardRef(N(function(t,n){const r=tt(_n,t.__scopeMenu),i=wn(_n,t.__scopeMenu),o=Bu(_n,t.__scopeMenu),s=Oo(_n,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,l={__scopeMenu:t.__scopeMenu},f=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>f,[f]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const d=Y(n,o.onTriggerChange);return(0,S.jsx)(Iu,{asChild:!0,...l,children:(0,S.jsx)(Fu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":Lo(r.open),...t,ref:d,onClick:p=>{t.onClick?.(p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:L(t.onPointerMove,Vt(p=>{s.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:L(t.onPointerLeave,Vt(p=>{f();const m=r.content?.getBoundingClientRect();if(m){const g=r.content?.dataset.side,v=g==="right",x=v?-5:5,y=m[v?"left":"right"],b=m[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+x,y:p.clientY},{x:y,y:m.top},{x:b,y:m.top},{x:b,y:m.bottom},{x:y,y:m.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:L(t.onKeyDown,p=>{t.disabled||p.target!==p.currentTarget||s.searchRef.current!==""&&p.key===" "||$m[i.dir].includes(p.key)&&(r.onOpenChange(!0),r.content?.focus(),p.preventDefault())})})})},"MenuSubTrigger")),hg="MenuSubContent",pg=h.forwardRef(N(function(t,n){const r=Vu(we,t.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...s}=t,a=tt(we,t.__scopeMenu),c=wn(we,t.__scopeMenu),u=Bu(hg,t.__scopeMenu),l=h.useRef(null),f=Y(n,l);return(0,S.jsx)(on.Provider,{scope:t.__scopeMenu,children:(0,S.jsx)(Bt,{present:i||a.open,children:(0,S.jsx)(on.Slot,{scope:t.__scopeMenu,children:(0,S.jsx)(_o,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{c.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:L(t.onFocusOutside,d=>{d.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:L(t.onEscapeKeyDown,d=>{c.onClose(),d.preventDefault()}),onKeyDown:L(t.onKeyDown,d=>{const p=d.currentTarget.contains(d.target),m=Bm[c.dir].includes(d.key);p&&m&&(a.onOpenChange(!1),u.trigger?.focus(),d.preventDefault())})})})})})},"MenuSubContent"));function Lo(e){return e?"open":"closed"}N(Lo,"getOpenState");function sn(e){return e==="indeterminate"}N(sn,"isIndeterminate");function Mr(e){return sn(e)?"indeterminate":e?"checked":"unchecked"}N(Mr,"getCheckedState");function qu(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}N(qu,"focusFirst");function Uu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}N(Uu,"wrapArray");function Wu(e,t,n){const r=t.length>1&&Array.from(t).every(a=>a===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Uu(e,Math.max(i,0));r.length===1&&(o=o.filter(a=>a!==n));const s=o.find(a=>a.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}N(Wu,"getNextMatch");function Hu(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o],c=t[s],u=a.x,l=a.y,f=c.x,d=c.y;l>r!=d>r&&n<(f-u)*(r-l)/(d-l)+u&&(i=!i)}return i}N(Hu,"isPointInPolygon");function zu(e,t){return t?Hu({x:e.clientX,y:e.clientY},t):!1}N(zu,"isPointerInGraceArea");function Vt(e){return t=>t.pointerType==="mouse"?e(t):void 0}N(Vt,"whenMouse");var mg=Hm,gg=Iu,vg=Km,yg=Gm,wg=eg,bg=Io,xg=tg,Sg=ig,Cg=sg,Tg=cg,Pg=ug,Rg=fg,Eg=dg,Ag=pg,Mg=Object.defineProperty,ce=(e,t)=>Mg(e,"name",{value:t,configurable:!0}),Vo="DropdownMenu",[kg,wC]=Je(Vo,[Du]),ue=Du(),[Dg,Ku]=kg(Vo),Og=ce(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=ue(t),u=h.useRef(null),[l,f]=yn({prop:i,defaultProp:o??!1,onChange:s,caller:Vo});return(0,S.jsx)(Dg,{scope:t,triggerId:ht(),triggerRef:u,contentId:ht(),open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:a,children:(0,S.jsx)(mg,{...c,open:l,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),_g="DropdownMenuTrigger",Ig=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,disabled:i=!1,...o}=t,s=Ku(_g,r),a=ue(r),c=Y(n,s.triggerRef);return(0,S.jsx)(gg,{asChild:!0,...a,children:(0,S.jsx)(ne.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:c,onPointerDown:L(t.onPointerDown,u=>{!i&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:L(t.onKeyDown,u=>{i||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),Lg=ce(e=>{const{__scopeDropdownMenu:t,...n}=e,r=ue(t);return(0,S.jsx)(vg,{...r,...n})},"DropdownMenuPortal"),Vg="DropdownMenuContent",Fg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Ku(Vg,r),s=ue(r),a=h.useRef(!1);return(0,S.jsx)(yg,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:L(t.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:L(t.onInteractOutside,c=>{const u=c.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),Ng=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(wg,{...o,...i,ref:n})},"DropdownMenuLabel")),jg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(bg,{...o,...i,ref:n})},"DropdownMenuItem")),$g=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(xg,{...o,...i,ref:n})},"DropdownMenuCheckboxItem")),Bg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Sg,{...o,...i,ref:n})},"DropdownMenuRadioGroup")),qg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Cg,{...o,...i,ref:n})},"DropdownMenuRadioItem")),Ug=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Tg,{...o,...i,ref:n})},"DropdownMenuItemIndicator")),Wg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Pg,{...o,...i,ref:n})},"DropdownMenuSeparator")),Hg=ce(e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,s=ue(t),[a,c]=yn({prop:r,defaultProp:o??!1,onChange:i,caller:"DropdownMenuSub"});return(0,S.jsx)(Rg,{...s,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),zg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Eg,{...o,...i,ref:n})},"DropdownMenuSubTrigger")),Kg=h.forwardRef(ce(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=ue(r);return(0,S.jsx)(Ag,{...o,...i,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),Qg=Og,Gg=Ig,Yg=Lg,Xg=Fg,Zg=Ng,Jg=jg,ev=$g,tv=Bg,nv=qg,Qu=Ug,rv=Wg,iv=Hg,ov=zg,sv=Kg,av=Object.defineProperty,G=(e,t)=>av(e,"name",{value:t,configurable:!0}),[Fo,bC]=Je("Tooltip",[Tr]),kr=Tr(),cv="TooltipProvider",uv=700,Li="tooltip.open",[lv,No]=Fo(cv),fv=G(e=>{const{__scopeTooltip:t,delayDuration:n=uv,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,s=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),(0,S.jsx)(lv,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),s.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),Vi="Tooltip",[dv,bn]=Fo(Vi),hv=G(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,c=No(Vi,e.__scopeTooltip),u=kr(t),[l,f]=h.useState(null),[d,p]=h.useState(void 0),m=ht(),g=h.useRef(0),v=s??c.disableHoverableContent,x=a??c.delayDuration,y=h.useRef(!1),[b,w]=yn({prop:r,defaultProp:i??!1,onChange:G(k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(Li))):c.onClose(),o?.(k)},"onChange"),caller:Vi}),T=h.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,w(!0)},[w]),C=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,w(!0),g.current=0},x)},[x,w]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const E=d??m;return(0,S.jsx)(Mo,{...u,children:(0,S.jsx)(dv,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:T,trigger:l,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?P():R()},[c.isOpenDelayedRef,P,R]),onTriggerLeave:h.useCallback(()=>{v?C():(window.clearTimeout(g.current),g.current=0)},[C,v]),onOpen:R,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),js="TooltipTrigger",pv=h.forwardRef(G(function(t,n){const{__scopeTooltip:r,...i}=t,o=bn(js,r),s=No(js,r),a=kr(r),c=h.useRef(null),u=Y(n,c,o.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),d=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,S.jsx)(wu,{asChild:!0,...a,children:(0,S.jsx)(ne.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:u,onPointerMove:L(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:L(t.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:L(t.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:L(t.onFocus,()=>{l.current||o.onOpen()}),onBlur:L(t.onBlur,o.onClose),onClick:L(t.onClick,o.onClose)})})},"TooltipTrigger")),Gu="TooltipPortal",[mv,gv]=Fo(Gu,{forceMount:void 0}),vv=G(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=bn(Gu,t);return(0,S.jsx)(mv,{scope:t,forceMount:n,children:(0,S.jsx)(Bt,{present:n||o.open,children:(0,S.jsx)(zc,{asChild:!0,container:i,children:r})})})},"TooltipPortal"),an="TooltipContent",yv=h.forwardRef(G(function(t,n){const r=gv(an,t.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...s}=t,a=bn(an,t.__scopeTooltip);return(0,S.jsx)(Bt,{present:i||a.open,children:a.disableHoverableContent?(0,S.jsx)(Yu,{side:o,...s,ref:n}):(0,S.jsx)(wv,{side:o,...s,ref:n})})},"TooltipContent")),wv=h.forwardRef(G(function(t,n){const r=bn(an,t.__scopeTooltip),i=No(an,t.__scopeTooltip),o=h.useRef(null),s=Y(n,o),[a,c]=h.useState(null),{trigger:u,onClose:l}=r,f=o.current,{onPointerInTransitChange:d}=i,p=h.useCallback(()=>{c(null),d(!1)},[d]),m=h.useCallback((g,v)=>{const x=g.currentTarget,y={x:g.clientX,y:g.clientY},b=Zu(y,Xu(y,x.getBoundingClientRect())),w=Ju(v.getBoundingClientRect()),T=tl([...b,...w]);c(T),d(!0)},[d]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&f){const g=G(x=>m(x,f),"handleTriggerLeave"),v=G(x=>m(x,u),"handleContentLeave");return u.addEventListener("pointerleave",g),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",v)}}},[u,f,m,p]),h.useEffect(()=>{if(a){const g=G(v=>{const x=v.target,y={x:v.clientX,y:v.clientY},b=u?.contains(x)||f?.contains(x),w=!el(y,a);b?p():w&&(p(),l())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,f,a,l,p]),(0,S.jsx)(Yu,{...t,ref:s})},"TooltipContentHoverable")),bv=wd("TooltipContent"),Yu=h.forwardRef(G(function(t,n){const{__scopeTooltip:r,children:i,"aria-label":o,id:s,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,l=bn(an,r),f=kr(r),{onClose:d}=l;h.useEffect(()=>(document.addEventListener(Li,d),()=>document.removeEventListener(Li,d)),[d]),h.useEffect(()=>{if(l.trigger){const m=G(g=>{g.target instanceof Node&&g.target.contains(l.trigger)&&d()},"handleScroll");return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[l.trigger,d]);const{setContentId:p}=l;return me(()=>(p(s),()=>{p(void 0)}),[s,p]),(0,S.jsx)(Fc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:m=>m.preventDefault(),onDismiss:d,children:(0,S.jsxs)(bu,{"data-state":l.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:l.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,S.jsx)(bv,{children:i}),o?(0,S.jsx)(Ld,{id:l.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl")),xv=h.forwardRef(G(function(t,n){const{__scopeTooltip:r,...i}=t,o=kr(r);return(0,S.jsx)(xm,{...o,...i,ref:n})},"TooltipArrow"));function Xu(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}G(Xu,"getExitSideFromRect");function Zu(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}G(Zu,"getPaddedExitPoints");function Ju(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}G(Ju,"getPointsFromRect");function el(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o],c=t[s],u=a.x,l=a.y,f=c.x,d=c.y;l>r!=d>r&&n<(f-u)*(r-l)/(d-l)+u&&(i=!i)}return i}G(el,"isPointInPolygon");function tl(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),nl(t)}G(tl,"getHull");function nl(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}G(nl,"getHullPresorted");var Sv=fv,Cv=hv,Tv=pv,Pv=vv,Rv=yv,Ev=xv,rl={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};rl.node;var Av=jt(rl),il={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};il.node;var xC=jt(il),ol={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};ol.node;var Mv=jt(ol),sl={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};sl.node;var SC=jt(sl),al={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};al.node;var CC=jt(al),cl={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};cl.node;var kv=jt(cl),ul=(0,h.createContext)({});function Dv(e){const t=(0,h.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ov=typeof window<"u",$s=Ov?h.useLayoutEffect:h.useEffect,Dr=(0,h.createContext)(null);function jo(e,t){e.indexOf(t)===-1&&e.push(t)}function sr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}var He=(e,t,n)=>n>t?t:n<e?e:n,Or=()=>{},gt=()=>{},Ue={},$o=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ll=e=>typeof e=="object"&&e!==null,Bo=e=>/^0[^.\s]+$/u.test(e);function fl(e){let t;return()=>(t===void 0&&(t=e()),t)}var be=e=>e,xn=(...e)=>e.reduce((t,n)=>r=>n(t(r))),cn=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1},ar=class{constructor(){this.subscriptions=[]}add(e){return jo(this.subscriptions,e),()=>this.remove(e)}remove(e){sr(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},le=e=>e*1e3,pe=e=>e/1e3,dl=(e,t)=>t?e*(1e3/t):0,hl=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,_v=1e-7,Iv=12;function Lv(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=hl(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>_v&&++a<Iv);return s}function Sn(e,t,n,r){if(e===t&&n===r)return be;const i=o=>Lv(o,0,1,e,n);return o=>o===0||o===1?o:hl(i(o),t,r)}var pl=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ml=e=>t=>1-e(1-t),gl=Sn(.33,1.53,.69,.99),qo=ml(gl),vl=pl(qo),yl=e=>e>=1?1:(e*=2)<1?.5*qo(e):.5*(2-Math.pow(2,-10*(e-1))),Uo=e=>1-Math.sin(Math.acos(e)),wl=ml(Uo),bl=pl(Uo),Vv=Sn(.42,0,1,1),Fv=Sn(0,0,.58,1),Wo=Sn(.42,0,.58,1),Nv=e=>Array.isArray(e)&&typeof e[0]!="number",xl=e=>Array.isArray(e)&&typeof e[0]=="number",Bs={linear:be,easeIn:Vv,easeInOut:Wo,easeOut:Fv,circIn:Uo,circInOut:bl,circOut:wl,backIn:qo,backInOut:vl,backOut:gl,anticipate:yl},jv=e=>typeof e=="string",qs=e=>{if(xl(e)){gt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return Sn(t,n,r,i)}else if(jv(e))return gt(Bs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Bs[e];return e},K={delta:0,timestamp:0,isProcessing:!1},Hn;function $v(){Hn=void 0}var ee={now:()=>(Hn===void 0&&ee.set(K.isProcessing||Ue.useManualTiming?K.timestamp:performance.now()),Hn),set:e=>{Hn=e,queueMicrotask($v)}},It=e=>Math.round(e*1e5)/1e5,Sl=e=>t=>typeof t=="string"&&t.startsWith(e),Cl=Sl("--"),Bv=Sl("var(--"),Ho=e=>Bv(e)?qv.test(e.split("/*")[0].trim()):!1,qv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Us(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Wt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},un={...Wt,transform:e=>He(0,1,e)},In={...Wt,default:1},zo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Uv(e){return e==null}var Wv=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ko=(e,t)=>n=>!!(typeof n=="string"&&Wv.test(n)&&n.startsWith(e)||t&&!Uv(n)&&Object.prototype.hasOwnProperty.call(n,t)),Tl=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(zo);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Hv=e=>He(0,255,e),Zr={...Wt,transform:e=>Math.round(Hv(e))},st={test:Ko("rgb","red"),parse:Tl("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zr.transform(e)+", "+Zr.transform(t)+", "+Zr.transform(n)+", "+It(un.transform(r))+")"};function zv(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Fi={test:Ko("#"),parse:zv,transform:st.transform},Cn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=Cn("deg"),Ae=Cn("%"),A=Cn("px"),Kv=Cn("vh"),Qv=Cn("vw"),Ws={...Ae,parse:e=>Ae.parse(e)/100,transform:e=>Ae.transform(e*100)},Mt={test:Ko("hsl","hue"),parse:Tl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ae.transform(It(t))+", "+Ae.transform(It(n))+", "+It(un.transform(r))+")"},Q={test:e=>st.test(e)||Fi.test(e)||Mt.test(e),parse:e=>st.test(e)?st.parse(e):Mt.test(e)?Mt.parse(e):Fi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?st.transform(e):Mt.transform(e),getAnimatableNone:e=>{const t=Q.parse(e);return t.alpha=0,Q.transform(t)}},Gv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Pl=new RegExp(zo.source),Rl=new RegExp(Gv.source,"i");function Yv(e){return isNaN(e)&&typeof e=="string"&&(Pl.test(e)||Rl.test(e))}var El="number",Al="color",Xv="var",Zv="var(",Hs="${}",Jv=/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 ey(e){const t=e.toString();return Pl.test(t)||Rl.test(t)}function ln(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;return{values:n,split:t.replace(Jv,s=>(Q.test(s)?(r.color.push(o),i.push(Al),n.push(Q.parse(s))):s.startsWith(Zv)?(r.var.push(o),i.push(Xv),n.push(s)):(r.number.push(o),i.push(El),n.push(parseFloat(s))),++o,Hs)).split(Hs),indexes:r,types:i}}function ty(e){return ln(e).values}function Ml({split:e,types:t}){const n=e.length;return r=>{let i="";for(let o=0;o<n;o++)if(i+=e[o],r[o]!==void 0){const s=t[o];s===El?i+=It(r[o]):s===Al?i+=Q.transform(r[o]):i+=r[o]}return i}}function ny(e){return Ml(ln(e))}var ry=e=>typeof e=="number"?0:Q.test(e)?Q.getAnimatableNone(e):e,iy=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:ry(e);function oy(e){const t=ln(e);return Ml(t)(t.values.map((n,r)=>iy(n,t.split[r])))}var fe={test:Yv,parse:ty,createTransformer:ny,getAnimatableNone:oy};function Jr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sy({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=Jr(c,a,e+1/3),o=Jr(c,a,e),s=Jr(c,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function cr(e,t){return n=>n>0?t:e}var B=(e,t,n)=>e+(t-e)*n,ei=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ay=[Fi,st,Mt],cy=e=>ay.find(t=>t.test(e));function zs(e){const t=cy(e);if(!t)return Or(!1,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let n=t.parse(e);return t===Mt&&(n=sy(n)),n}var Ks=(e,t)=>{const n=zs(e),r=zs(t);if(!n||!r)return cr(e,t);const i={...n};return o=>(i.red=ei(n.red,r.red,o),i.green=ei(n.green,r.green,o),i.blue=ei(n.blue,r.blue,o),i.alpha=B(n.alpha,r.alpha,o),st.transform(i))},Ni=new Set(["none","hidden"]);function uy(e,t){return Ni.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ly(e,t){return n=>B(e,t,n)}function Qo(e){return typeof e=="number"?ly:typeof e=="string"?Ho(e)?cr:Q.test(e)?Ks:hy:Array.isArray(e)?kl:typeof e=="object"?Q.test(e)?Ks:fy:cr}function kl(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Qo(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function fy(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qo(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function dy(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],s=e.indexes[o][r[o]],a=e.values[s]??0;n[i]=a,r[o]++}return n}var hy=(e,t)=>{const n=fe.createTransformer(t),r=ln(e),i=ln(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ni.has(e)&&!i.values.length||Ni.has(t)&&!r.values.length?uy(e,t):xn(kl(dy(r,i),i.values),n):(Or(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),cr(e,t))},Qs=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function py(e,t){const n=Qs.exec(e);if(!n)return;const r=Qs.exec(t);if(!r||n[2]!==r[2])return;const i=n[2],o=parseFloat(n[1]),s=parseFloat(r[1]);return a=>It(B(o,s,a))+i}function Go(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return B(e,t,n);if(typeof e=="string"&&typeof t=="string"){const r=py(e,t);if(r)return r}return Qo(e)(e,t)}var Ln=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function my(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new Set;let s={delta:0,timestamp:0,isProcessing:!1};function a(u){o.has(u)&&(n.add(u),e()),u(s)}const c={schedule:(u,l=!1,f=!1)=>{const d=f&&r?t:n;return l&&o.add(u),d.add(u),u},cancel:u=>{n.delete(u),o.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0;const l=t;t=n,n=l,t.forEach(a),t.clear(),r=!1,i&&(i=!1,c.process(u))}};return c}var gy=40;function Dl(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0;const o=()=>r=!0,s=Ln.reduce((b,w)=>(b[w]=my(o),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:f,preRender:d,render:p,postRender:m}=s,g=()=>{const b=Ue.useManualTiming,w=b?n.timestamp:performance.now();r=!1,b||(n.delta=i?1e3/60:Math.max(Math.min(w-n.timestamp,gy),1)),n.timestamp=w,n.isProcessing=!0,a.process(n),c.process(n),u.process(n),l.process(n),f.process(n),d.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(g))},v=()=>{r=!0,i=!0,n.isProcessing||e(g)};return{schedule:Ln.reduce((b,w)=>{const T=s[w];return b[w]=(R,C=!1,P=!1)=>(r||v(),T.schedule(R,C,P)),b},{}),cancel:b=>{for(let w=0;w<Ln.length;w++)s[Ln[w]].cancel(b)},state:n,steps:s}}var{schedule:q,cancel:Ze,steps:ti}=Dl(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0,K),vy=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>q.update(t,n),stop:()=>Ze(t),now:()=>K.isProcessing?K.timestamp:ee.now()}},Ol=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Yo=2e4;function Xo(e,t=50,n=Yo,r){let i=0,o=e.next(i);for(r?.push(o.value);!o.done&&i<n;)i+=t,o=e.next(i),r?.push(o.value);return i>=n?1/0:i}function yy(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Xo(r),Yo);return{type:"keyframes",ease:o=>r.next(i*o).value/t,duration:pe(i)}}var J={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},_l=e=>e<0?1/Math.max(1+e,J.minDamping):Math.max(1-e,J.minDamping);function Il(e,t){if(!(e>1))return 1;const n=Math.sqrt(e*e-1),r=e-n,i=e+n,o=2*n*Math.exp(-t)*(1+t);return Ll(s=>i*Math.exp(-r*s)-r*Math.exp(-i*s)-o,s=>Math.exp(-i*s)-Math.exp(-r*s),t)/t}function ji(e,t){return e*Math.sqrt(1-t*t)}var wy=12;function Ll(e,t,n){let r=n;for(let i=1;i<wy;i++)r=r-e(r)/t(r);return r}var Gs=.001;function by({duration:e=J.duration,bounce:t=J.bounce}){let n,r;Or(e<=le(J.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");const i=_l(t);e=He(J.minDuration,J.maxDuration,pe(e)),i<1?(n=u=>{const l=u*i,f=l*e,d=ji(u,i),p=Math.exp(-f);return Gs-l/d*p},r=u=>{const l=u*i*e,f=i*i*u*u*e,d=Math.exp(-l),p=ji(u*u,i);return(-n(u)+Gs>0?-1:1)*-f*d/p}):(n=u=>-.001+Math.exp(-u*e)*(u*e+1),r=u=>Math.exp(-u*e)*(-u*(e*e)));const o=5/e,s=Ll(n,r,o),a=s*Il(i,s*e),c=a*a;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:le(e)}}var $i=(e,t)=>(t?e>=0:e>0)&&e<1/0;function ni(e,t){if($i(e,t))return e}function xy(e){const t=ni(e.stiffness),n=ni(e.damping,!0),r=ni(e.mass),i={...e,stiffness:t??J.stiffness,damping:n??J.damping,mass:r??J.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){const o=_l(e.bounce||0),s=2*Math.PI/(e.visualDuration*1.2)*Il(o,2*Math.PI/1.2);i.stiffness=s*s,i.damping=2*o*Math.sqrt(i.stiffness)}else Object.assign(i,by(i)),i.isResolvedFromDuration=!0;(!$i(i.stiffness)||!$i(i.damping,!0))&&(i.stiffness=J.stiffness,i.damping=J.damping)}return i}function ur(e=J.visualDuration,t=J.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:s,damping:a,mass:c,duration:u,isResolvedFromDuration:l,isTimeDefined:f}=xy({...n}),d=C=>f?0:-pe(C),p=a/(2*Math.sqrt(s*c)),m=pe(Math.sqrt(s/c)),g=p*m,v={target:i,delta:i-r,velocity:d(n.velocity||0)||0,restSpeed:0,restDelta:0},x=()=>{const C=Math.abs(v.delta)<5;v.restSpeed=n.restSpeed||(C?J.restSpeed.granular:J.restSpeed.default),v.restDelta=n.restDelta||(C?J.restDelta.granular:J.restDelta.default)};x();let y,b,w;if(p<1){const C=ji(m,p),P={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{P.A=(v.velocity+g*v.delta)/C,P.sinC=g*P.A+v.delta*C,P.cosC=g*v.delta-P.A*C};const E=k=>{k!==P.t&&(P.t=k,P.env=Math.exp(-g*k),P.sin=Math.sin(C*k),P.cos=Math.cos(C*k))};y=k=>(E(k),v.target-P.env*(P.A*P.sin+v.delta*P.cos)),b=k=>(E(k),P.env*(P.sinC*P.sin+P.cosC*P.cos))}else if(p===1){y=P=>v.target-Math.exp(-m*P)*(v.delta+(v.velocity+m*v.delta)*P);const C={C:0};w=()=>{C.C=v.velocity+m*v.delta},b=P=>Math.exp(-m*P)*(m*C.C*P-v.velocity)}else{const C=m*Math.sqrt(p*p-1),P=g-C,E=g+C,k=f?1/0:300/C,I=(O,V)=>Math.exp(V>k?-O*k-g*(V-k):-O*V),D={S:0,F:0};w=()=>{const O=(v.velocity+g*v.delta)/C;D.S=(v.delta+O)/2,D.F=(v.delta-O)/2},y=O=>v.target-D.S*I(P,O)-D.F*I(E,O),b=O=>P*D.S*I(P,O)+E*D.F*I(E,O)}w();const T=l&&u||null,R={calculatedDuration:T,retarget:(C,P)=>{v.target=C[C.length-1],v.delta=v.target-C[0],v.velocity=d(P),n.restSpeed&&n.restDelta||x(),R.calculatedDuration=T,o.done=!1,w()},velocity:C=>le(b(C)),next:C=>{const P=y(C);if(l)o.done=C>=u;else{const E=le(b(C));o.done=Math.abs(E)<=v.restSpeed&&Math.abs(v.target-P)<=v.restDelta}return o.value=o.done?v.target:P,o},toString:()=>{const C=Math.min(Xo(R),Yo),P=Ol(E=>R.next(C*E).value,C,30);return C+"ms "+P},toTransition:()=>{}};return R}ur.applyToOptions=e=>{const t=yy(e,100,ur);return e.ease=t.ease,e.duration=le(t.duration),e.type="keyframes",e};function Bi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:c,restDelta:u=.5,restSpeed:l}){const f=e[0],d={done:!1,value:f},p=C=>C<a||C>c,m=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let g=n*t;const v=f+g,x=s===void 0?v:s(v);x!==v&&(g=x-f);const y=C=>-g*Math.exp(-C/r),b=C=>{const P=y(C);d.done=Math.abs(P)<=u,d.value=d.done?x:x+P};let w,T;const R=C=>{p(d.value)&&(w=C,T=ur({keyframes:[d.value,m(d.value)],velocity:-y(C)/r*1e3,damping:i,stiffness:o,restDelta:u,restSpeed:l}))};return R(0),{calculatedDuration:null,next:C=>{let P=!1;return!T&&w===void 0&&(P=!0,b(C),R(C)),w!==void 0&&C>=w?T.next(C-w):(!P&&b(C),d)}}}function Sy(e,t,n){const r=[],i=n||Ue.mix||Go,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||be:t;a=xn(c,a)}r.push(a)}return r}function Cy(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(gt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Sy(t,r,i),c=a.length,u=l=>{if(s&&l<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(l<e[f+1]);f++);const d=cn(e[f],e[f+1],l);return a[f](d)};return n?l=>u(He(e[0],e[o-1],l)):u}function Ty(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=cn(0,t,r);e.push(B(n,1,i))}}function Py(e){const t=[0];return Ty(t,e.length-1),t}function Ry(e,t){return e.map(n=>n*t)}function Ey(e,t){return e.map(()=>t||Wo).splice(0,e.length-1)}function Zt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Nv(r)?r.map(qs):qs(r)||Wo,o={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){const[c,u]=t,l=c===u?void 0:(Ue.mix||Go)(c,u);return{calculatedDuration:e,next:f=>(o.value=l?l(i(e>0?He(0,1,f/e):1)):u,o.done=f>=e,o)}}const s=Ry(n&&n.length===t.length?n:Py(t),e),a=Cy(s,t,{ease:Array.isArray(i)?i:Ey(t,i)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}var Ay=5;function My(e,t,n){const r=Math.max(t-Ay,0);return dl(n-e(r),t-r)}function ky(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):My(r=>e.next(r).value,t,e.next(t).value)}var Dy=e=>e!==null;function _r(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(Dy),s=i<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}var Oy={decay:Bi,inertia:Bi,tween:Zt,keyframes:Zt,spring:ur};function Vl(e){typeof e.type=="string"&&(e.type=Oy[e.type])}function Fl(e,t){return{kind:e,animation:t,timestamp:ee.now(),frameTimestamp:K.timestamp,frameIsProcessing:K.isProcessing}}function Nl(e,t,n){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Fl("animation-start",e),options:n?{...t,...n}:t})}catch{}}function _y(e,t){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Fl("layout-animation-start",e),node:t})}catch{}}var Zo=class{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Iy=e=>e/100,lr=class extends Zo{constructor(e){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=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ee.now()&&this.tick(ee.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Nl(this,this.options)}initAnimation(){const{options:e}=this;Vl(e);const{type:t=Zt,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:s}=e;const a=t||Zt;a!==Zt&&typeof s[0]!="number"&&(this.mixKeyframes=xn(Iy,Go(s[0],s[1])),s=[0,100]);const c=a(s===e.keyframes?e:{...e,keyframes:s});i==="mirror"&&(this.mirroredGenerator=a({...e,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Xo(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:a}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:u,repeat:l,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?v<0:v>r;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,b=n;if(l){const C=Math.min(this.currentTime,r)/s;let P=Math.floor(C),E=C%1;!E&&C>=1&&(E=1),E===1&&P--,P=Math.min(P,l+1),P%2&&(f==="reverse"?(E=1-E,d&&(E-=d/s)):f==="mirror"&&(b=o)),y=He(0,1,E)*s}let w;x?(this.delayState.value=u[0],w=this.delayState):w=b.next(y),i&&!x&&(w.value=i(w.value));let{done:T}=w;!x&&a!==null&&(T=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return R&&p!==Bi&&(w.value=_r(u,this.options,g,this.speed)),m&&m(w.value),R&&this.finish(),w}then(e,t){return this.finished.then(e,t)}get duration(){return pe(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+pe(e)}get time(){return pe(this.currentTime)}set time(e){e=le(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return ky(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ee.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=pe(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=vy,startTime:t}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),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(ee.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}},Ly=new Set(["brightness","contrast","saturate","opacity"]);function Vy(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(zo)||[];if(!r)return e;const i=n.replace(r,"");let o=Ly.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}var Fy=/\b([a-z-]*)\(.*?\)/gu,qi={...fe,getAnimatableNone:e=>{const t=e.match(Fy);return t?t.map(Vy).join(" "):e}},Ui={...fe,getAnimatableNone:e=>{const t=fe.parse(e);return fe.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},Ys={...Wt,transform:Math.round},Ny={rotate:Ie,pathRotation:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:In,scaleX:In,scaleY:In,scaleZ:In,skew:Ie,skewX:Ie,skewY:Ie,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:un,originX:Ws,originY:Ws,originZ:A},fr={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,...Ny,zIndex:Ys,fillOpacity:un,strokeOpacity:un,numOctaves:Ys},jy={...fr,color:Q,backgroundColor:Q,outlineColor:Q,fill:Q,stroke:Q,borderColor:Q,borderTopColor:Q,borderRightColor:Q,borderBottomColor:Q,borderLeftColor:Q,filter:qi,WebkitFilter:qi,mask:Ui,WebkitMask:Ui},jl=e=>jy[e],$y=new Set([qi,Ui]);function Jo(e,t){let n=jl(e);return $y.has(n)||(n=fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function By(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var at=e=>e*180/Math.PI,Wi=e=>{const t=at(Math.atan2(e[1],e[0]));return Hi(t)},qy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wi,rotateZ:Wi,skewX:e=>at(Math.atan(e[1])),skewY:e=>at(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hi=e=>(e=e%360,e<0&&(e+=360),e),Xs=Wi,Zs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Js=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Uy={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zs,scaleY:Js,scale:e=>(Zs(e)+Js(e))/2,rotateX:e=>Hi(at(Math.atan2(e[6],e[5]))),rotateY:e=>Hi(at(Math.atan2(-e[2],e[0]))),rotateZ:Xs,rotate:Xs,skewX:e=>at(Math.atan(e[4])),skewY:e=>at(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fn(e){return e.includes("scale")?1:0}function zi(e,t){if(!e||e==="none")return fn(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Uy,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qy,i=a}if(!i)return fn(t);const o=r[t],s=i[1].split(",").map(Hy);return typeof o=="function"?o(s):s[o]}var Wy=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return zi(n,t)};function Hy(e){return parseFloat(e.trim())}var Ht=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ge=new Set([...Ht,"pathRotation"]),ea=e=>e===Wt||e===A,zy=new Set(["x","y","z"]),Ky=Ht.filter(e=>!zy.has(e));function Qy(e){const t=[];return Ky.forEach(n=>{const r=e.getValue(n);if(r!==void 0){const i=r.get(),o=n.startsWith("scale")?1:0;if(i===o)return;t.push([n,i]),r.set(o)}}),t}var Gy=new Set(["bottom","right"]);function ta(e,t,n,r,i,o){const s=parseFloat(e);if(!isNaN(s))return s;const{min:a,max:c}=t()[n],u=c-a;return o==="border-box"?u:u-parseFloat(r)-parseFloat(i)}var ct={width:({width:e,paddingLeft:t="0",paddingRight:n="0",boxSizing:r},i)=>ta(e,i,"x",t,n,r),height:({height:e,paddingTop:t="0",paddingBottom:n="0",boxSizing:r},i)=>ta(e,i,"y",t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{const{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>zi(e,"x"),y:({transform:e})=>zi(e,"y")};ct.translateX=ct.x;ct.translateY=ct.y;var ut=new Set,Ki=!1,Qi=!1,Gi=!1;function $l(){if(Qi){const e=[],t=new Set,n=new Set;ut.forEach(i=>{i.needsMeasurement&&(e.push(i),t.add(i.element),Gy.has(i.name)&&n.add(i.element))});const r=new Map;n.forEach(i=>{const o=Qy(i);o.length&&(r.set(i,o),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const o=r.get(i);o&&o.forEach(([s,a])=>{i.getValue(s)?.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Qi=!1,Ki=!1,ut.forEach(e=>e.complete(Gi)),ut.clear()}function Bl(){ut.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Qi=!0)})}function Yy(){Gi=!0,Bl(),$l(),Gi=!1}function Xy(e,t,n){if(typeof e=="string"){if($o(e)||Bo(e))return parseFloat(e);if(!fe.test(e)&&fe.test(n))return Jo(t,n)}return e??void 0}var es=class{constructor(e,t,n,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),Ki||(Ki=!0,q.read(Bl),q.resolveKeyframes($l))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){const i=r?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){const s=Xy(n.readValue(t,o),t,o);s!==void 0&&(e[0]=s)}e[0]===void 0&&(e[0]=o),r&&i===void 0&&r.set(e[0])}By(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}},Zy=e=>e.startsWith("--");function ql(e,t,n){Zy(t)?e.style.setProperty(t,n):e.style[t]=n}var Jy={};function Ul(e,t){const n=fl(e);return()=>Jy[t]??n()}var ew=Ul(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Wl=Ul(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Gt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,na={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gt([0,.65,.55,1]),circOut:Gt([.55,0,1,.45]),backIn:Gt([.31,.01,.66,-.59]),backOut:Gt([.33,1.53,.69,.99])};function Hl(e,t){if(e)return typeof e=="function"?Wl()?Ol(e,t):"ease-out":xl(e)?Gt(e):Array.isArray(e)?e.map(n=>Hl(n,t)||na.easeOut):na[e]}function tw(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[t]:n};c&&(l.offset=c);const f=Hl(a,i);Array.isArray(f)&&(l.easing=f);const d={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),e.animate(l,d)}function zl(e){return typeof e=="function"&&"applyToOptions"in e}function nw({type:e,...t}){return zl(e)&&Wl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var Kl=class extends Zo{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:s,onComplete:a}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,gt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=nw(e);this.animation=tw(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=_r(r,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),ql(t,n,u),this.animation.cancel()}a?.(),this.notifyFinished()},Nl(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return pe(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+pe(e)}get time(){return pe(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=le(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n,...r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&ew()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),be):n(this)}},Ql={anticipate:yl,backInOut:vl,circInOut:bl};function rw(e){return e in Ql}function iw(e){typeof e.ease=="string"&&rw(e.ease)&&(e.ease=Ql[e.ease])}var ri=10,ow=class extends Kl{constructor(e){iw(e),Vl(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:i,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const s=new lr({...o,autoplay:!1}),a=Math.max(ri,ee.now()-this.startTime),c=He(0,ri,a-ri),u=s.sample(a).value,{name:l}=this.options;i&&l&&ql(i,l,u),t.setWithVelocity(s.sample(Math.max(0,a-c)).value,u,c),s.stop()}},ra=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fe.test(e)||e==="0")&&!e.startsWith("url("));function sw(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function aw(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=ra(i,t),a=ra(o,t);return!s||!a?(s!==a&&Or(!1,`You are trying to animate ${t} from "${i}" to "${o}". "${s?o:i}" is not an animatable value.`,"value-not-animatable"),!1):sw(e)||(n==="spring"||zl(n))&&r}function Yi(e){e.duration=0,e.type="keyframes"}var Xi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),cw=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function uw(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&cw.test(e[t]))return!0;return!1}var ia=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),lw=fl(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fw(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:s,keyframes:a}=e;if(!n||!(Xi.has(n)||ia.has(n)))return!1;const c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:l}=t.owner.getProps();return lw()&&(Xi.has(n)||ia.has(n)&&uw(a))&&(n!=="transform"||!l)&&!u&&!r&&i!=="mirror"&&o!==0&&s!=="inertia"}var dw=40,hw=class extends Zo{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ee.now();const{keyframes:t,name:n,motionValue:r,element:i}=e,o=e;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const s=i?.KeyframeResolver||es;this.keyframeResolver=new s(t,(a,c,u)=>this.onKeyframesResolved(a,c,o,!u),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:s,delay:a,isHandoff:c,onUpdate:u}=n;this.resolvedAt=ee.now();let l=!0;aw(e,i,o,s)||(l=!1,(Ue.instantAnimations||!a)&&u?.(_r(e,n,t)),e[0]=e[e.length-1],Yi(n),n.repeat=0);const f=r?this.resolvedAt?this.resolvedAt-this.createdAt>dw?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:d}=n;n.startTime??(n.startTime=f),n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};const p=l&&!c&&fw(n);let m;if(p){n.element=n.motionValue?.owner?.current;try{m=new ow(n)}catch{m=new lr(n)}}else m=new lr(n);this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Yy()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Gl(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}var oa=30,pw=e=>!isNaN(parseFloat(e)),sa={current:void 0},mw=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const r=ee.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ee.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pw(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){var n;return e==="change"?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ar)).add(t)}onChangeSubscribe(e){const{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ar,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){q.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return sa.current&&sa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ee.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oa)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,oa);return dl(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ft(e,t){return new mw(e,t)}function Yl(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function ts(e,t){const n=e?.[t]??e?.default??e;return n!==e?Yl(n,e):n}var gw={type:"spring",stiffness:500,damping:25,restSpeed:10},vw=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yw={type:"keyframes",duration:.8},ww={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bw=(e,{keyframes:t})=>t.length>2?yw:Ge.has(e)?e.startsWith("scale")?vw(t[1]):gw:ww,xw=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Sw(e){for(const t in e)if(!xw.has(t))return!0;return!1}var ns=(e,t,n,r={},i,o)=>s=>{const a=ts(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-le(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};Sw(a)||Object.assign(l,bw(e,l)),l.duration&&(l.duration=le(l.duration)),l.repeatDelay&&(l.repeatDelay=le(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Yi(l),l.delay===0&&(f=!0)),(Ue.instantAnimations||Ue.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(f=!0,Yi(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const d=_r(l.keyframes,a);if(d!==void 0){q.update(()=>{l.onUpdate(d),l.onComplete()});return}}return a.isSync?new lr(l):new hw(l)},Cw=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tw(e){const t=Cw.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}var Pw=4;function Xl(e,t,n=1){gt(n<=Pw,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=Tw(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return $o(s)?parseFloat(s):s}return Ho(i)?Xl(i,t,n+1):i}function Rw(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zl(e,t,n,r){const i=o=>typeof o=="function"?o(n!==void 0?n:e.custom,...Rw(r)):o;return t=i(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),i(t)}function lt(e,t,n){return Zl(e.getProps(),t,n,e)}var Jl=(e,t)=>t==="exit"?e.presenceContext?.custom:void 0,ef=new Set(["width","height","top","left","right","bottom",...Ht]),Ew=e=>Array.isArray(e);function Aw(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ft(n))}function Mw(e){return Ew(e)?e[e.length-1]||0:e}function kw(e,t){let{transitionEnd:n={},transition:r={},...i}=lt(e,t)||{};i={...i,...n};for(const o in i)Aw(e,o,Mw(i[o]))}var te=e=>!!(e&&e.getVelocity);function Dw(e){return!!(te(e)&&e.add)}function Zi(e,t){const n=e.getValue("willChange");if(Dw(n))return n.add(t);if(!n&&Ue.WillChange){const r=new Ue.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function rs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Ow="framerAppearId",tf="data-"+rs(Ow);function nf(e){return e.props[tf]}var _w=typeof window<"u";function Iw({protectedKeys:e,needsAnimating:t},n){const r=n in e&&!t[n];return t[n]=!1,r}function rf(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o,transitionEnd:s,...a}=t;const c=e.getDefaultTransition();o=o?Yl(o,c):c;const u=o?.reduceMotion,l=o?.skipAnimations;r&&(o=r);const f=[],d=i&&e.animationState?.getState()[i],p=o?.path;p&&p.animateVisualElement(e,a,o,n,f);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||d&&Iw(d,m))continue;const x={delay:n,...ts(o||{},m)};l&&(x.skipAnimations=!0);const y=g.get();if(y!==void 0&&!g.isAnimating()&&!Array.isArray(v)&&v===y&&!x.velocity){q.update(()=>g.set(v));continue}let b=!1;if(_w&&window.MotionHandoffAnimation){const R=nf(e);if(R){const C=window.MotionHandoffAnimation(R,m,q);C!==null&&(x.startTime=C,b=!0)}}Zi(e,m);const w=u??e.shouldReduceMotion;g.start(ns(m,g,v,w&&ef.has(m)?{type:!1}:x,e,b));const T=g.animation;T&&f.push(T)}if(s){const m=()=>q.update(()=>{s&&kw(e,s)});f.length?Promise.all(f).then(m):m()}return f}function Ji(e,t,n={}){const r=lt(e,t,Jl(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),o=()=>Promise.all(r?rf(e,r,n):[]),s=(c=0)=>{const{variantChildren:u}=e,{delayChildren:l=0,staggerChildren:f,staggerDirection:d}=i,p=[];return u?.forEach(m=>{m.notify("AnimationStart",t),p.push(Ji(m,t,{...n,delay:c+(typeof l=="function"?0:l)+Gl(u,m,l,f,d)}).then(()=>m.notify("AnimationComplete",t)))}),Promise.all(p)},{when:a}=i;return a?a==="beforeChildren"?o().then(()=>s()):s().then(o):Promise.all([o(),s(n.delay)])}function Lw(e,t,n={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(r=>Ji(e,r,n))):typeof t=="string"?Ji(e,t,n):Promise.all(rf(e,lt(e,t,n.custom),n))).then(()=>{e.notify("AnimationComplete",t)})}var Vw={test:e=>e==="auto",parse:e=>e},Fw=e=>t=>t.test(e),Nw=[Wt,A,Ae,Ie,Qv,Kv,Vw],aa=e=>Nw.find(Fw(e));function jw(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Bo(e):!0}var $w=new Set(["auto","none","0"]);function Bw(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!$w.has(o)&&ey(o)&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]!==i&&(e[o]=Jo(n,i))}var qw=class extends es{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="string"&&(c=c.trim(),Ho(c))){const u=Xl(c,t.current);u!==void 0&&(e[a]=u),a===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ef.has(n)||e.length!==2)return;const[r,i]=e;if(typeof r=="number"&&typeof i=="number")return;const o=aa(r),s=aa(i);if(Us(r)!==Us(i)&&ct[n]){this.needsMeasurement=!0;return}if(o!==s)if(ea(o)&&ea(s))for(let a=0;a<e.length;a++){const c=e[a];typeof c=="string"&&(e[a]=parseFloat(c))}else ct[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(e[r]===null||jw(e[r]))&&n.push(r);n.length&&Bw(e,n,t)}measure(){const{element:e,name:t}=this;return ct[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){const{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([i,o])=>{e.getValue(i).set(o)}),this.resolveNoneKeyframes()}},is=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Uw(e){return ll(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function os(e){return ll(e)&&"ownerSVGElement"in e}var eo=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function of(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}var Ww={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Hw=Ht.length;function zw(e,t,n){let r="",i=!0;for(let s=0;s<Hw;s++){const a=Ht[s],c=e[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{const l=parseFloat(c);u=a.startsWith("scale")?l===1:l===0}if(!u||n){const l=eo(c,fr[a]);if(!u){i=!1;const f=Ww[a]||a;r+=`${f}(${l}) `}n&&(t[a]=l)}}const o=e.pathRotation;return o&&(i=!1,r+=`rotate(${eo(o,fr.pathRotation)}) `),r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ss(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const c in t){const u=t[c];if(Ge.has(c)){s=!0;continue}else if(Cl(c)){i[c]=u;continue}else{const l=eo(u,fr[c]);c.startsWith("origin")?(a=!0,o[c]=l):r[c]=l}}if(t.transform||(s||n?r.transform=zw(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=o;r.transformOrigin=`${c} ${u} ${l}`}}var Kw={offset:"stroke-dashoffset",array:"stroke-dasharray"},Qw={offset:"strokeDashoffset",array:"strokeDasharray"};function Gw(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Kw:Qw;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}var sf=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function af(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},c,u,l){if(ss(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;for(const p of sf)f[p]!==void 0&&(d[p]=f[p],delete f[p]);(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=l?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&Gw(f,i,o,s,!1)}function cf({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yw({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xw(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ii(e){return e===void 0||e===1}function to({scale:e,scaleX:t,scaleY:n}){return!ii(e)||!ii(t)||!ii(n)}function it(e){return to(e)||uf(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function uf(e){return ca(e.x)||ca(e.y)}function ca(e){return e&&e!=="0%"}function dr(e,t,n){return n+t*(e-n)}function ua(e,t,n,r,i){return i!==void 0&&(e=dr(e,i,r)),dr(e,n,r)+t}function no(e,t=0,n=1,r,i){e.min=ua(e.min,t,n,r,i),e.max=ua(e.max,t,n,r,i)}function lf(e,{x:t,y:n}){no(e.x,t.translate,t.scale,t.originPoint),no(e.y,n.translate,n.scale,n.originPoint)}var la=.999999999999,fa=1.0000000000001;function Zw(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Pe(e.x,-o.scroll.offset.x),Pe(e.y,-o.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,lf(e,s)),r&&it(o.latestValues)&&zn(e,o.latestValues,o.layout?.layoutBox))}t.x<fa&&t.x>la&&(t.x=1),t.y<fa&&t.y>la&&(t.y=1)}function Pe(e,t){e.min+=t,e.max+=t}function da(e,t,n,r,i=.5){no(e,t,n,B(e.min,e.max,i),r)}function ha(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function zn(e,t,n){const r=n??e;da(e.x,ha(t.x,r.x),t.scaleX,t.scale,t.originX),da(e.y,ha(t.y,r.y),t.scaleY,t.scale,t.originY)}function ff(e,t){return cf(Xw(e.getBoundingClientRect(),t))}function Jw(e,t,n){const r=ff(e,n),{scroll:i}=t;return i&&(Pe(r.x,i.offset.x),Pe(r.y,i.offset.y)),r}var{schedule:as,cancel:TC}=Dl(queueMicrotask,!1),ye={x:!1,y:!1};function df(){return ye.x||ye.y}function eb(e){return e==="x"||e==="y"?ye[e]?null:(ye[e]=!0,()=>{ye[e]=!1}):ye.x||ye.y?null:(ye.x=ye.y=!0,()=>{ye.x=ye.y=!1})}function hf(e,t){const n=of(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function tb(e){return!(e.pointerType==="touch"||df())}function nb(e,t,n={}){const[r,i,o]=hf(e,n);return r.forEach(s=>{let a=!1,c=!1,u;const l=()=>{s.removeEventListener("pointerleave",m)},f=v=>{u&&(u(v),u=void 0),l()},d=v=>{a=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),c&&(c=!1,f(v))},p=()=>{a=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},m=v=>{if(v.pointerType!=="touch"){if(a){c=!0;return}f(v)}},g=v=>{if(!tb(v))return;c=!1;const x=t(s,v);typeof x=="function"&&(u=x,s.addEventListener("pointerleave",m,i))};s.addEventListener("pointerenter",g,i),s.addEventListener("pointerdown",p,i)}),o}var pf=(e,t)=>t?e===t?!0:pf(e,t.parentElement):!1,cs=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,rb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ib(e){return rb.has(e.tagName)||e.isContentEditable===!0}var ob=new Set(["INPUT","SELECT","TEXTAREA"]);function sb(e){return ob.has(e.tagName)||e.isContentEditable===!0}var Kn=new WeakSet;function pa(e){return t=>{t.key==="Enter"&&e(t)}}function oi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var ab=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=pa(()=>{if(Kn.has(n))return;oi(n,"down");const i=pa(()=>{oi(n,"up")}),o=()=>oi(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ma(e){return cs(e)&&!df()}var ga=new WeakSet;function cb(e,t,n={}){const[r,i,o]=hf(e,n),s=a=>{const c=a.currentTarget;if(!ma(a)||ga.has(a))return;Kn.add(c),n.stopPropagation&&ga.add(a);const u=t(c,a),l={...i,capture:!0},f=(m,g)=>{window.removeEventListener("pointerup",d,l),window.removeEventListener("pointercancel",p,l),Kn.has(c)&&Kn.delete(c),ma(m)&&typeof u=="function"&&u(m,{success:g})},d=m=>{f(m,c===window||c===document||n.useGlobalTarget||pf(c,m.target))},p=m=>{f(m,!1)};window.addEventListener("pointerup",d,l),window.addEventListener("pointercancel",p,l)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),Uw(a)&&(a.addEventListener("focus",c=>ab(c,i)),!ib(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}var Qn=new WeakMap,Gn,mf=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:os(r)&&"getBBox"in r?r.getBBox()[t]:r[n],ub=mf("inline","width","offsetWidth"),lb=mf("block","height","offsetHeight");function fb({target:e,borderBoxSize:t}){Qn.get(e)?.forEach(n=>{n(e,{get width(){return ub(e,t)},get height(){return lb(e,t)}})})}function db(e){e.forEach(fb)}function hb(){typeof ResizeObserver>"u"||(Gn=new ResizeObserver(db))}function pb(e,t){Gn||hb();const n=of(e);return n.forEach(r=>{let i=Qn.get(r);i||(i=new Set,Qn.set(r,i)),i.add(t),Gn?.observe(r)}),()=>{n.forEach(r=>{const i=Qn.get(r);i?.delete(t),i?.size||Gn?.unobserve(r)})}}var Yn=new Set,kt;function mb(){kt=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yn.forEach(t=>t(e))},window.addEventListener("resize",kt)}function gb(e){return Yn.add(e),kt||mb(),()=>{Yn.delete(e),!Yn.size&&typeof kt=="function"&&(window.removeEventListener("resize",kt),kt=void 0)}}function va(e,t){return typeof e=="function"?gb(e):pb(e,t)}var Rt={value:null,addProjectionMetrics:null};function vb(e){return os(e)&&e.tagName==="svg"}var ya=e=>typeof e=="number"?e:parseFloat(e),wa=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dt=()=>({x:wa(),y:wa()}),ba=()=>({min:0,max:0}),z=()=>({x:ba(),y:ba()}),yb=new WeakMap;function Ir(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dn(e){return typeof e=="string"||Array.isArray(e)}var us=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xa=["initial",...us];function Lr(e){if(Ir(e.animate))return!0;for(let t=0;t<xa.length;t++)if(dn(e[xa[t]]))return!0;return!1}function gf(e){return!!(Lr(e)||e.variants)}function wb(e,t,n){for(const r in t){const i=t[r],o=n[r];if(te(i))e.addValue(r,i);else if(te(o))e.addValue(r,Ft(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Ft(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}var Sa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],hr={};function vf(e){hr=e}function bb(){return hr}var xb=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,visualState:s},a={}){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=es,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 d=ee.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,q.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Lr(t),this.isVariantNode=gf(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:l,...f}=this.scrapeMotionValuesFromProps(t,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&te(p)&&p.set(c[d])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=e,yb.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let t=this;do t=t.props.inherit!==!1&&t.parent;while(t&&!t.isVariantNode);if(t){const{variantChildren:n}=t;n.add(this),this.removeFromVariantTree=()=>n.delete(this)}}this.values.forEach((t,n)=>this.bindToMotionValue(n,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(xd.current||Sd(),this.shouldReduceMotion=bd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ze(this.notifyUpdate),Ze(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Xi.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:a,ease:c,duration:u}=t.accelerate,l=new Kl({element:this.current,name:e,keyframes:s,times:a,ease:c,duration:le(u)}),f=o(l);this.valueSubscriptions.set(e,()=>{f(),l.cancel()});return}const n=Ge.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&q.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in hr){const t=hr[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Sa.length;n++){const r=Sa[n];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i=e["on"+r];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=wb(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){const n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);const r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Ft(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&($o(n)||Bo(n))?n=parseFloat(n):typeof n!="number"&&!fe.test(n)&&fe.test(t)&&(n=Jo(e,t)),this.setBaseTarget(e,te(n)?n.get():n)),te(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new ar),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){as.render(this.render)}},yf=class extends xb{constructor(){super(...arguments),this.KeyframeResolver=qw}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;te(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}},nt=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function wf(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i?.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}var hn={};function bf(e,{layout:t,layoutId:n}){return Ge.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hn[e]||e==="opacity")}function ls(e,t,n){const r=e.style,i=t?.style,o={};if(!r)return o;for(const s in r)(te(r[s])||i&&te(i[s])||bf(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=r[s]);return o}function Sb(e){return window.getComputedStyle(e)}var Cb=class extends yf{constructor(){super(...arguments),this.type="html",this.renderInstance=wf}mount(e){gt(!!e.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(Ge.has(t))return this.projection?.isProjecting?fn(t):Wy(e,t);{const n=Sb(e),r=(Cl(t)?n.getPropertyValue(t):n[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ff(e,t)}build(e,t,n){ss(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ls(e,t,n)}},xf=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"]),Sf=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Tb(e,t,n,r){wf(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(xf.has(i)?i:rs(i),t.attrs[i])}function Cf(e,t,n){const r=ls(e,t,n);for(const i in e)if(te(e[i])||te(t[i])){const o=Ht.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}var Pb=class extends yf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,t){return Ge.has(t)?super.getBaseTargetFromProps(e,t)??fn(t):e[t]}getDefaultValue(e){return Ge.has(e)?this.latestValues[e]??fn(e):void 0}readValueFromInstance(e,t){if(Ge.has(t)){const n=jl(t);return n&&n.default||0}if(sf.includes(t)){const n=getComputedStyle(e)[t];if(typeof n=="string"&&n)return n.trim()}return t=xf.has(t)?t:rs(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Cf(e,t,n)}build(e,t,n){af(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Tb(e,t,n,r)}mount(e){this.isSVGTag=Sf(e.tagName),super.mount(e)}};function Tf(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Rb=[...us].reverse();function Eb(e){let t=a=>Promise.all(a.map(({animation:c,options:u})=>Lw(e,c,u))),n=Ca(),r=!0,i=!1;function o(a){const{props:c,parent:u,manuallyAnimateOnMount:l}=e,f=r||i,d=[],p=new Set;let m={},g=1/0,v=e;do v=v.props.inherit!==!1&&v.parent;while(v&&!v.isControllingVariants);if(Rb.forEach((y,b)=>{const w=n[y],T=c[y],R=v&&v.props[y],C=T!==void 0?T:dn(R)||R===!1?R:void 0,P=dn(C),E=y===a?w.isActive:null;E===!1&&(g=b);const k=P&&T===void 0&&!(f&&l);if(w.protectedKeys={...m},!w.isActive&&E===null||!C&&!w.prevProp||Ir(C)||typeof C=="boolean")return;if(y==="exit"&&w.isActive&&E!==!0){m={...m,...w.prevResolvedValues};return}const I=Ab(w.prevProp,C);let D=I||P&&(E&&!k||b>g),O=!1;const V=Array.isArray(C)?C:[C];let j={};if(E!==!1)for(const $ of V){const{transition:_,transitionEnd:F,...M}=lt(e,$,Jl(e,y))||{};j={...j,...M,...F}}const{prevResolvedValues:U}=w;for(const $ in{...U,...j}){if($ in m)continue;const _=j[$],F=U[$],M=Array.isArray(_)&&Array.isArray(F)?!Tf(_,F)||I:_!==F;if(M&&_==null)p.add($);else if(M||_!==void 0&&p.has($)){D=!0,p.delete($)&&(O=!0),w.needsAnimating[$]=!0;const de=e.getValue($);de&&(de.liveStyle=!1)}else w.protectedKeys[$]=!0}if(w.prevProp=C,w.prevResolvedValues=j,w.isActive&&(m={...m,...j}),D&&(!(k&&I)||O))for(const $ of V){const _={type:y};if(typeof $=="string"&&f&&l&&u?.enteringChildren){const F=lt(u,$)?.transition?.delayChildren;_.delay=Gl(u.enteringChildren,e,F)}d.push({animation:$,options:_})}}),p.size){const{initial:y}=c,b={},w=typeof y!="boolean"&<(e,Array.isArray(y)?y[0]:y,e.presenceContext?.custom);w&&w.transition&&(b.transition=w.transition),p.forEach(T=>{const R=e.getValue(T);R&&(R.liveStyle=!0);const C=w&&!Array.isArray(y)?w[T]:void 0,P=e.getBaseTargetFromProps(c,T);b[T]=(C!==void 0?C:P!==void 0&&!te(P)?P:e.initialValues[T]===void 0?e.baseTarget[T]:void 0)??null}),d.push({animation:b})}const x=f&&e.blockInitialAnimation||r&&!l&&(c.initial===!1||c.initial===c.animate);return r=i=!1,!x&&d.length?t(d):Promise.resolve()}function s(a,c){if(n[a].isActive===c)return Promise.resolve();e.variantChildren?.forEach(l=>l.animationState?.setActive(a,c)),n[a].isActive=c;const u=o(a);for(const l in n)n[l].protectedKeys={};return u}return{animateChanges:o,setActive:s,setAnimateFunction:a=>{t=a(e)},getState:()=>n,reset:()=>{n=Ca(),i=!0}}}function Ab(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Tf(t,e):!1}function Ca(){const e={};for(const t of us)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ro(e,t){e.min=t.min,e.max=t.max}function ve(e,t){ro(e.x,t.x),ro(e.y,t.y)}function Ta(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Mb=.9999,kb=1.0001,Db=-.01,Ob=.01;function ie(e){return e.max-e.min}function _b(e,t,n){return Math.abs(e-t)<=n}function Pa(e,t,n,r=.5){e.origin=r,e.originPoint=B(t.min,t.max,e.origin),e.scale=ie(n)/ie(t),e.translate=B(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Mb&&e.scale<=kb||isNaN(e.scale))&&(e.scale=1),(e.translate>=Db&&e.translate<=Ob||isNaN(e.translate))&&(e.translate=0)}function Jt(e,t,n,r){Pa(e.x,t.x,n.x,r?r.originX:void 0),Pa(e.y,t.y,n.y,r?r.originY:void 0)}function Ra(e,t,n,r=0){e.min=(r?B(n.min,n.max,r):n.min)+t.min,e.max=e.min+ie(t)}function Ib(e,t,n,r){Ra(e.x,t.x,n.x,r?.x),Ra(e.y,t.y,n.y,r?.y)}function Ea(e,t,n,r=0){const i=r?B(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+ie(t)}function pr(e,t,n,r){Ea(e.x,t.x,n.x,r?.x),Ea(e.y,t.y,n.y,r?.y)}function Aa(e,t,n,r,i){return e-=t,e=dr(e,1/n,r),i!==void 0&&(e=dr(e,1/i,r)),e}function Lb(e,t=0,n=1,r=.5,i,o=e,s=e){if(Ae.test(t)&&(t=parseFloat(t),t=B(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=B(o.min,o.max,r);e===o&&(a-=t),e.min=Aa(e.min,t,n,a,i),e.max=Aa(e.max,t,n,a,i)}function Ma(e,t,[n,r,i],o,s){Lb(e,t[n],t[r],t[i],t.scale,o,s)}var Vb=["x","scaleX","originX"],Fb=["y","scaleY","originY"];function ka(e,t,n,r){Ma(e.x,t,Vb,n?n.x:void 0,r?r.x:void 0),Ma(e.y,t,Fb,n?n.y:void 0,r?r.y:void 0)}function Da(e){return e.translate===0&&e.scale===1}function Pf(e){return Da(e.x)&&Da(e.y)}function Oa(e,t){return e.min===t.min&&e.max===t.max}function Nb(e,t){return Oa(e.x,t.x)&&Oa(e.y,t.y)}function _a(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rf(e,t){return _a(e.x,t.x)&&_a(e.y,t.y)}function Ia(e){return ie(e.x)/ie(e.y)}function La(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Te(e){return[e("x"),e("y")]}function Va(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Qt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(A.test(e))e=parseFloat(e);else return e;return`${Va(e,t.target.x)}% ${Va(e,t.target.y)}%`}},jb={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=fe.parse(e);if(i.length>5)return r;const o=fe.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=c;const u=B(a,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),o(i)}};function $b(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=n?.z||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:l,pathRotation:f,rotateX:d,rotateY:p,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),l&&(r+=`rotate(${l}deg) `),f&&(r+=`rotate(${f}deg) `),d&&(r+=`rotateX(${d}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}var Bb=is.length,Fa=e=>typeof e=="number"||A.test(e);function qb(e,t,n,r,i,o){i?(e.opacity=B(0,n.opacity??1,Ub(r)),e.opacityExit=B(t.opacity??1,0,Wb(r))):o&&(e.opacity=B(t.opacity??1,n.opacity??1,r));for(let s=0;s<Bb;s++){const a=is[s];let c=Na(t,a),u=Na(n,a);c===void 0&&u===void 0||(c||(c=0),u||(u=0),c===0||u===0||Fa(c)===Fa(u)?(e[a]=Math.max(B(ya(c),ya(u),r),0),(Ae.test(u)||Ae.test(c))&&(e[a]+="%")):e[a]=u)}(t.rotate||n.rotate)&&(e.rotate=B(t.rotate||0,n.rotate||0,r))}function Na(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Ub=Ef(0,.5,wl),Wb=Ef(.5,.95,be);function Ef(e,t,n){return r=>r<e?0:r>t?1:n(cn(e,t,r))}function Hb(e,t,n){const r=te(e)?e:Ft(e);return r.start(ns("",r,t,n)),r.animation}function pn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var zb=(e,t)=>e.depth-t.depth,Kb=class{constructor(){this.children=[],this.isDirty=!1}add(e){jo(this.children,e),this.isDirty=!0}remove(e){sr(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(zb),this.isDirty=!1,this.children.forEach(e)}};function Qb(e,t){const n=ee.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Ze(r),e(o-t))};return q.setup(r,!0),()=>Ze(r)}function Xn(e){return te(e)?e.get():e}var Gb=class{constructor(){this.members=[]}add(e){jo(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(sr(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(sr(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const n=this.members[t];if(n.isPresent!==!1&&n.instance?.isConnected!==!1)return this.promote(n),!0}return!1}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Yb={borderRadius:{...Qt,applyTo:[...is]},borderTopLeftRadius:Qt,borderTopRightRadius:Qt,borderBottomLeftRadius:Qt,borderBottomRightRadius:Qt,boxShadow:jb},Zn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(hn,{...Yb,...hn});var ot={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},si=["","X","Y","Z"],Xb=1e3,Zb=0;function ai(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Af(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=nf(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",q,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Af(r)}function Mf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t?.()){this.id=Zb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Rt.value&&(ot.nodes=ot.calculatedTargetDeltas=ot.calculatedProjections=0),this.nodes.forEach(t0),this.nodes.forEach(c0),this.nodes.forEach(u0),this.nodes.forEach(n0),Rt.addProjectionMetrics&&Rt.addProjectionMetrics(ot)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Kb)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new ar),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const c=this.eventHandlers.get(s);c&&c.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=os(s)&&!vb(s),this.instance=s;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let l,f=0;const d=()=>this.root.updateBlockedByResize=!1;q.read(()=>{f=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,l&&l(),l=Qb(d,250),Zn.hasAnimatedSinceResize&&(Zn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ba)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||p0,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=u.getProps(),x=!this.targetLayout||!Rf(this.targetLayout,p),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...ts(m,"layout"),onPlay:g,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(l,y,b.path)}else f||Ba(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ze(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(l0),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Af(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const a=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),a&&this.nodes.forEach(i0),this.nodes.forEach(ja);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($a);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(o0),this.nodes.forEach(s0),this.nodes.forEach(a0),this.nodes.forEach(Jb),this.nodes.forEach(e0)):this.nodes.forEach($a),this.clearAllSnapshots();const s=ee.now();K.delta=He(0,1e3/60,s-K.timestamp),K.timestamp=s,K.isProcessing=!0,ti.update.process(K),ti.preRender.process(K),ti.render.process(K),K.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,as.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(r0),this.sharedNodes.forEach(f0)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ie(this.snapshot.measuredBox.x)&&!ie(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=z()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Pf(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;s&&this.instance&&(a||it(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return s&&(c=this.removeTransform(c)),m0(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return z();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(g0))){const{scroll:c}=this.root;c&&(Pe(a.x,c.offset.x),Pe(a.y,c.offset.y))}return a}removeElementScroll(s){const a=z();if(ve(a,s),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:f}=u;u!==this.root&&l&&f.layoutScroll&&(l.wasRoot&&ve(a,s),Pe(a.x,l.offset.x),Pe(a.y,l.offset.y))}return a}applyTransform(s,a=!1,c){const u=c||z();ve(u,s);for(let l=0;l<this.path.length;l++){const f=this.path[l];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(Pe(u.x,-f.scroll.offset.x),Pe(u.y,-f.scroll.offset.y)),it(f.latestValues)&&zn(u,f.latestValues,f.layout?.layoutBox)}return it(this.latestValues)&&zn(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(s){const a=z();ve(a,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!it(u.latestValues))continue;let l;u.instance&&(to(u.latestValues)&&u.updateSnapshot(),l=z(),ve(l,u.measurePageBox())),ka(a,u.latestValues,u.snapshot?.layoutBox,l)}return it(this.latestValues)&&ka(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==K.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:l}=this.options;if(!this.layout||!(u||l))return;this.resolvedRelativeTargetAt=K.timestamp;const f=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ib(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ve(this.target,this.layout.layoutBox),lf(this.target,this.targetDelta)):ve(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0),Rt.value&&ot.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||to(this.parent.latestValues)||uf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,c){this.relativeParent=s,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),pr(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ve(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===K.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ve(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Zw(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=z());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ta(this.prevProjectionDelta.x,this.projectionDelta.x),Ta(this.prevProjectionDelta.y,this.projectionDelta.y)),Jt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!La(this.projectionDelta.x,this.prevProjectionDelta.x)||!La(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Rt.value&&ot.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dt(),this.projectionDelta=Dt(),this.projectionDeltaWithTransform=Dt()}setAnimationOrigin(s,a=!1,c){const u=this.snapshot,l=u?u.latestValues:{},f={...this.latestValues},d=Dt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=z(),m=(u?u.source:void 0)!==(this.layout?this.layout.source:void 0),g=this.getStack(),v=!g||g.members.length<=1,x=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(h0));this.animationProgress=0;let y;const b=c?.interpolateProjection(s);this.mixTargetDelta=w=>{const T=w/1e3,R=b?.(T);R?(d.x.translate=R.x,d.x.scale=B(s.x.scale,1,T),d.x.origin=s.x.origin,d.x.originPoint=s.x.originPoint,d.y.translate=R.y,d.y.scale=B(s.y.scale,1,T),d.y.origin=s.y.origin,d.y.originPoint=s.y.originPoint):(qa(d.x,s.x,T),qa(d.y,s.y,T)),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pr(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),d0(this.relativeTarget,this.relativeTargetOrigin,p,T),y&&Nb(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=z()),ve(y,this.relativeTarget)),m&&(this.animationValues=f,qb(f,l,this.latestValues,T,x,v)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ze(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=q.update(()=>{Zn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ft(0)),this.motionValue.jump(0,!1),this.currentAnimation=Hb(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),_y(this.currentAnimation,this),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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Xb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead(),{targetWithTransforms:a,layout:c,latestValues:u}=s;let{target:l}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&kf(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||z();const f=ie(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=ie(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}ve(a,l),zn(a,u),Jt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Gb),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ai("z",s,u,this.animationValues);for(let l=0;l<si.length;l++)ai(`rotate${si[l]}`,s,u,this.animationValues),ai(`skew${si[l]}`,s,u,this.animationValues);s.render();for(const l in u)s.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Xn(a?.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Xn(a?.pointerEvents)||""),this.hasProjected&&!it(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=$b(this.projectionDeltaWithTransform,this.treeScale,l);c&&(f=c(l,f)),s.transform=f;const{x:d,y:p}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,u.animationValues?s.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:s.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const m in hn){if(l[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:x}=hn[m],y=f==="none"?l[m]:g(l[m],u);if(v){const b=v.length;for(let w=0;w<b;w++)s[v[w]]=y}else x?this.options.visualElement.renderState.vars[m]=y:s[m]=y}this.options.layoutId&&(s.pointerEvents=u===this?Xn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(ja),this.root.sharedNodes.clear()}}}function Jb(e){e.updateLayout()}function e0(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")Te(l=>{const f=o?t.measuredBox[l]:t.layoutBox[l],d=ie(f);f.min=n[l].min,f.max=f.min+d});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";ro(o?t.measuredBox[l]:t.layoutBox[l],n[l])}else kf(i,t.layoutBox,n)&&Te(l=>{const f=o?t.measuredBox[l]:t.layoutBox[l],d=ie(n[l]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[l].max=e.relativeTarget[l].min+d)});const s=Dt();Jt(s,n,t.layoutBox);const a=Dt();o?Jt(a,e.applyTransform(r,!0),t.measuredBox):Jt(a,n,t.layoutBox);const c=!Pf(s);let u=!1;if(!e.resumeFrom){const l=e.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:f,layout:d}=l;if(f&&d){const p=e.options.layoutAnchor||void 0,m=z();pr(m,t.layoutBox,f.layoutBox,p);const g=z();pr(g,n,d.layoutBox,p),Rf(m,g)||(u=!0),l.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=l)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function t0(e){Rt.value&&ot.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function n0(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function r0(e){e.clearSnapshot()}function ja(e){e.clearMeasurements()}function i0(e){e.isLayoutDirty=!0,e.updateLayout()}function $a(e){e.isLayoutDirty=!1}function o0(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function s0(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function a0(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ba(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function c0(e){e.resolveTargetDelta()}function u0(e){e.calcProjection()}function l0(e){e.resetSkewAndRotation()}function f0(e){e.removeLeadSnapshot()}function qa(e,t,n){e.translate=B(t.translate,0,n),e.scale=B(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ua(e,t,n,r){e.min=B(t.min,n.min,r),e.max=B(t.max,n.max,r)}function d0(e,t,n,r){Ua(e.x,t.x,n.x,r),Ua(e.y,t.y,n.y,r)}function h0(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var p0={duration:.45,ease:[.4,0,.1,1]},Wa=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ha=Wa("applewebkit/")&&!Wa("chrome/")?Math.round:be;function za(e){e.min=Ha(e.min),e.max=Ha(e.max)}function m0(e){za(e.x),za(e.y)}function kf(e,t,n){return e==="position"||e==="preserve-aspect"&&!_b(Ia(t),Ia(n),.2)}function g0(e){return e!==e.root&&e.scroll?.wasRoot}var v0=Mf({attachResizeListener:(e,t)=>pn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ci={current:void 0},Df=Mf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ci.current){const e=new v0({});e.mount(window),e.setOptions({layoutScroll:!0}),ci.current=e}return ci.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Of=(0,h.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function y0(e=!0){const t=(0,h.useContext)(Dr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=(0,h.useId)();(0,h.useEffect)(()=>{if(e)return i(o)},[e]);const s=(0,h.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}function RC(){return w0((0,h.useContext)(Dr))}function w0(e){return e===null?!0:e.isPresent}var _f=(0,h.createContext)({strict:!1}),Ka={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"]},Qa=!1;function b0(){if(Qa)return;const e={};for(const t in Ka)e[t]={isEnabled:n=>Ka[t].some(r=>!!n[r])};vf(e),Qa=!0}function If(){return b0(),bb()}function x0(e){const t=If();for(const n in e)t[n]={...t[n],...e[n]};vf(t)}var Vr=(0,h.createContext)({});function S0(e,t){if(Lr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dn(n)?n:void 0,animate:dn(r)?r:void 0}}return e.inherit!==!1?t:{}}function C0(e){const{initial:t,animate:n}=S0(e,(0,h.useContext)(Vr));return(0,h.useMemo)(()=>({initial:t,animate:n}),[Ga(t),Ga(n)])}function Ga(e){return Array.isArray(e)?e.join(" "):e}var fs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Lf(e,t,n){for(const r in t)!te(t[r])&&!bf(r,n)&&(e[r]=t[r])}function T0({transformTemplate:e},t){return(0,h.useMemo)(()=>{const n=fs();return ss(n,t,e),Object.assign({},n.vars,n.style)},[t])}function P0(e,t){const n=e.style||{},r={};return Lf(r,n,e),Object.assign(r,T0(e,t)),r}function R0(e,t){const n={},r=P0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Vf=()=>({...fs(),attrs:{}});function E0(e,t,n,r){const i=(0,h.useMemo)(()=>{const o=Vf();return af(o,t,Sf(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Lf(o,e.style,e),i.style={...o,...i.style}}return i}var A0=new Set(["animate","exit","variants","initial","style","values","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 mr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||A0.has(e)}function M0(e,t){return e.startsWith("on")?!mr(e):t?.(e)??!mr(e)}function k0(e,t,n,r){const i={};for(const o in e)o==="values"&&typeof e.values=="object"||te(e[o])||(M0(o,r)||n===!0&&mr(o)||!t&&!mr(o)||e.draggable&&o.startsWith("onDrag"))&&(i[o]=e[o]);return i}var D0=["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 ds(e){return typeof e!="string"||e.includes("-")?!1:!!(D0.indexOf(e)>-1||/[A-Z]/u.test(e))}function O0(e,t,n,{latestValues:r},i,o=!1,s,a){const c=(s??ds(e)?E0:R0)(t,r,i,e),u=k0(t,typeof e=="string",o,a),l=e!==h.Fragment?{...u,...c,ref:n}:{},{children:f}=t,d=(0,h.useMemo)(()=>te(f)?f.get():f,[f]);return(0,h.createElement)(e,{...l,children:d})}function _0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:I0(n,r,i,e),renderState:t()}}function I0(e,t,n,r){const i={},o=r(e,{});for(const d in o)i[d]=Xn(o[d]);let{initial:s,animate:a}=e;const c=Lr(e),u=gf(e);t&&u&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let l=n?n.initial===!1:!1;l=l||s===!1;const f=l?a:s;if(f&&typeof f!="boolean"&&!Ir(f)){const d=Array.isArray(f)?f:[f];for(let p=0;p<d.length;p++){const m=Zl(e,d[p]);if(m){const{transitionEnd:g,transition:v,...x}=m;for(const y in x){let b=x[y];if(Array.isArray(b)){const w=l?b.length-1:0;b=b[w]}b!==null&&(i[y]=b)}for(const y in g)i[y]=g[y]}}}return i}var Ff=e=>(t,n)=>{const r=(0,h.useContext)(Vr),i=(0,h.useContext)(Dr),o=()=>_0(e,t,r,i);return n?o():Dv(o)},L0=Ff({scrapeMotionValuesFromProps:ls,createRenderState:fs}),V0=Ff({scrapeMotionValuesFromProps:Cf,createRenderState:Vf}),F0=Symbol.for("motionComponentSymbol");function N0(e,t,n){const r=(0,h.useRef)(n);(0,h.useInsertionEffect)(()=>{r.current=n});const i=(0,h.useRef)(null);return(0,h.useCallback)(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const s=r.current;if(typeof s=="function")if(o){const a=s(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):s(o);else s&&(s.current=o)},[t])}var Nf=(0,h.createContext)({});function Et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function j0(e,t,n,r,i,o){const{visualElement:s}=(0,h.useContext)(Vr),a=(0,h.useContext)(_f),c=(0,h.useContext)(Dr),u=(0,h.useContext)(Of),l=u.reducedMotion,f=u.skipAnimations,d=(0,h.useRef)(null),p=(0,h.useRef)(!1);r=r||a.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:o}),p.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const m=d.current,g=(0,h.useContext)(Nf);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&$0(d.current,n,i,g);const v=(0,h.useRef)(!1);(0,h.useInsertionEffect)(()=>{m&&v.current&&m.update(n,c)});const x=n[tf],y=(0,h.useRef)(!!x&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return $s(()=>{!p.current||!m||(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),$s(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,h.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),y.current=!1),m.enteringChildren=void 0)}),m}function $0(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:jf(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&Et(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function jf(e){if(e)return e.options.allowProjection!==!1?e.projection:jf(e.parent)}function ui(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&x0(r);const o=n?n==="svg":ds(e),s=o?V0:L0;function a(u,l){let f;const d={...(0,h.useContext)(Of),...u,layoutId:B0(u)},{isStatic:p,isValidProp:m}=d,g=C0(u),v=s(u,p);if(!p&&typeof window<"u"){q0(d,r);const x=U0(d);f=x.MeasureLayout,g.visualElement=j0(e,v,d,i,x.ProjectionNode,o)}return(0,S.jsxs)(Vr.Provider,{value:g,children:[f&&g.visualElement?(0,S.jsx)(f,{visualElement:g.visualElement,...d}):null,O0(e,u,N0(v,g.visualElement,l),v,p,t,o,m)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=(0,h.forwardRef)(a);return c[F0]=e,c}function B0({layoutId:e}){const t=(0,h.useContext)(ul).id;return t&&e!==void 0?t+"-"+e:e}function q0(e,t){(0,h.useContext)(_f).strict}function U0(e){const{drag:t,layout:n}=If();if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function W0(e,t){if(typeof Proxy>"u")return ui;const n=new Map,r=(o,s)=>ui(o,s,e,t),i=(o,s)=>r(o,s);return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,ui(s,void 0,e,t)),n.get(s))})}var H0=(e,t)=>t.isSVG??ds(e)?new Pb(t):new Cb(t,{allowProjection:e!==h.Fragment}),z0=class extends nt{constructor(e){super(e),e.animationState||(e.animationState=Eb(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ir(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},K0=0,Q0=class extends nt{constructor(){super(...arguments),this.id=K0++}update(){const{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;const{isPresent:r,onExitComplete:i}=e,o=t?.isPresent;if(r===o)return;if(r&&o===!1){if(this.exit===!0){const{initial:a}=this.node.getProps();if(a&&!Array.isArray(a)){const{transition:c,transitionEnd:u,...l}=lt(this.node,a)||{};for(const f in l)this.node.getValue(f)?.jump(l[f])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);this.exit=void 0;return}const s=this.exit=n.setActive("exit",!r);i&&!r&&s.then(()=>{this.exit===s&&(this.exit=!0,i(this.id))})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}},G0={animation:{Feature:z0},exit:{Feature:Q0}};function Fr(e){return{point:{x:e.pageX,y:e.pageY}}}var Y0=e=>t=>cs(t)&&e(t,Fr(t));function en(e,t,n,r){return pn(e,t,Y0(n),r)}var $f=({current:e})=>e?e.ownerDocument.defaultView:null,Ya=(e,t)=>Math.abs(e-t);function X0(e,t){const n=Ya(e.x,t.x),r=Ya(e.y,t.y);return Math.sqrt(n**2+r**2)}var Xa=new Set(["auto","scroll"]),Bf=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:s}={}){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=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Vn(this.lastRawMoveEventInfo,this.transformPagePoint));const d=li(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=X0(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d;this.history.push({...g,timestamp:ee.now()});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Vn(p,this.transformPagePoint),this.hasPendingMove=!0,q.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=li(d.type==="pointercancel"?this.lastMoveEventInfo:Vn(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,x),g&&g(d,x)},!cs(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=r||window;const a=Vn(Fr(e),this.transformPagePoint),{point:c}=a,{timestamp:u}=K;this.history=[{...c,timestamp:u}];const{onSessionStart:l}=t;l&&l(e,li(a,this.history));const f={passive:!0,capture:!0};this.removeListeners=xn(en(this.contextWindow,"pointermove",this.handlePointerMove,f),en(this.contextWindow,"pointerup",this.handlePointerUp,f),en(this.contextWindow,"pointercancel",this.handlePointerUp,f)),s&&this.startScrollTracking(s)}startScrollTracking(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);(Xa.has(n.overflowX)||Xa.has(n.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.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(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ze(this.updatePoint)}};function Vn(e,t){return t?{point:t(e.point)}:e}function Za(e,t){return{x:e.x-t.x,y:e.y-t.y}}function li({point:e},t){return{point:e,delta:Za(e,qf(t)),offset:Za(e,Z0(t)),velocity:J0(t,.1)}}function Z0(e){return e[0]}function qf(e){return e[e.length-1]}function J0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=qf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>le(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>le(t)*2&&(r=e[1]);const o=pe(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ex(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?B(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?B(n,e,r.max):Math.min(e,n)),e}function Ja(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function tx(e,{top:t,left:n,bottom:r,right:i}){return{x:Ja(e.x,n,i),y:Ja(e.y,t,r)}}function ec(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function nx(e,t){return{x:ec(e.x,t.x),y:ec(e.y,t.y)}}function rx(e,t){let n=.5;const r=ie(e),i=ie(t);return i>r?n=cn(t.min,t.max-r,e.min):r>i&&(n=cn(e.min,e.max-i,t.min)),He(0,1,n)}function ix(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var io=.35;function ox(e=io){return e===!1?e=0:e===!0&&(e=io),{x:tc(e,"left","right"),y:tc(e,"top","bottom")}}function tc(e,t,n){return{min:nc(e,t),max:nc(e,n)}}function nc(e,t){return typeof e=="number"?e:e[t]||0}var sx=new WeakMap,ax=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{t&&this.snapToCursor(l),this.stopAnimation()},o=(l,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eb(d),!this.openDragLock))return;this.latestPointerEvent=l,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Te(v=>{let x=this.getAxisMotionValue(v).get()||0;if(Ae.test(x)){const{projection:y}=this.visualElement;if(y&&y.layout){const b=y.layout.layoutBox[v];b&&(x=ie(b)*(parseFloat(x)/100))}}this.originPoint[v]=x}),m&&q.update(()=>m(l,f),!1,!0),Zi(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},s=(l,f)=>{this.latestPointerEvent=l,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=ux(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),g&&q.update(()=>g(l,f),!1,!0)},a=(l,f)=>{this.latestPointerEvent=l,this.latestPanInfo=f,this.stop(l,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:l}=this.getProps();(l||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Bf(e,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:$f(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&q.postRender(()=>s(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Fn(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=ex(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Et(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=tx(n.layoutBox,e):this.constraints=!1,this.elastic=ox(t),r!==this.constraints&&!Et(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=ix(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Et(e))return!1;const n=e.current;gt(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const i=Jw(n,r.root,this.visualElement.getTransformPagePoint());let o=nx(r.layout.layoutBox,i);if(t){const s=t(Yw(o));this.hasMutatedConstraints=!!s,s&&(o=cf(s))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},c=Te(u=>{if(!Fn(u,t,this.currentDirection))return;let l=a&&a[u]||{};(o===!0||o===u)&&(l={min:0,max:0});const f=r?200:1e6,d=r?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Zi(this.visualElement,e),n.start(ns(e,n,0,t,this.visualElement,!1))}stopAnimation(){Te(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps()[t];return n||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){const{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,o=this.visualElement.measureViewportBox();Te(s=>{if(!Fn(s,n,this.currentDirection))return;const a=this.getAxisMotionValue(s),{min:c,max:u}=o[s];a.set((a.get()||0)+i[s]-B(c,u,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Et(t)||!n||!this.constraints)return;this.stopAnimation();const r=this.constraints,i={x:0,y:0};Te(s=>{const a=this.getAxisMotionValue(s).get();i[s]=rx({min:a,max:a},r[s])});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Te(s=>{const a=this.getAxisMotionValue(s);if(!Fn(s,e,null)||!a.get())return;const{min:c,max:u}=this.constraints[s];a.set(B(c,u,i[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;sx.set(this.visualElement,this);const e=this.visualElement.current,t=en(e,"pointerdown",c=>{const{drag:u,dragListener:l=!0}=this.getProps(),f=c.target,d=f!==e&&sb(f);u&&l&&!d&&this.start(c)});let n;const r=()=>{const{dragConstraints:c}=this.getProps();Et(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),n||(n=cx(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),q.read(r);const s=pn(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Te(l=>{const f=this.getAxisMotionValue(l);f&&(this.originPoint[l]+=c[l].translate,f.set(f.get()+c[l].translate))}),this.visualElement.render())}));return()=>{s(),t(),o(),a&&a(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=io,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:s}}};function rc(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function cx(e,t,n){const r=va(e,rc(n)),i=va(t,rc(n));return()=>{r(),i()}}function Fn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ux(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}var lx=class extends nt{constructor(e){super(e),this.removeGroupControls=be,this.removeListeners=be,this.controls=new ax(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},fi=e=>(t,n)=>{e&&q.update(()=>e(t,n),!1,!0)},fx=class extends nt{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(e){this.session=new Bf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$f(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:fi(e),onStart:fi(t),onMove:fi(n),onEnd:(i,o)=>{delete this.session,r&&q.postRender(()=>r(i,o))}}}mount(){this.removePointerDownListener=en(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},di=!1,dx=class extends h.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),di&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:o}=n;return o&&(o.isPresent=i,e.layoutDependency!==t&&o.setOptions({...o.options,layoutDependency:t}),di=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||q.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),as.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;di=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Uf(e){const[t,n]=y0(),r=(0,h.useContext)(ul);return(0,S.jsx)(dx,{...e,layoutGroup:r,switchLayoutGroup:(0,h.useContext)(Nf),isPresent:t,safeToRemove:n})}var hx={pan:{Feature:fx},drag:{Feature:lx,ProjectionNode:Df,MeasureLayout:Uf}};function ic(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i=r["onHover"+n];i&&q.postRender(()=>i(t,Fr(t)))}var px=class extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=nb(e,(t,n)=>(ic(this.node,n,"Start"),r=>ic(this.node,r,"End"))))}unmount(){}},mx=class extends nt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=xn(pn(this.node.current,"focus",()=>this.onFocus()),pn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function oc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i=r["onTap"+(n==="End"?"":n)];i&&q.postRender(()=>i(t,Fr(t)))}var gx=class extends nt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cb(e,(r,i)=>(oc(this.node,i,"Start"),(o,{success:s})=>oc(this.node,o,s?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},oo=new WeakMap,hi=new WeakMap,vx=e=>{const t=oo.get(e.target);t&&t(e)},yx=e=>{e.forEach(vx)};function wx({root:e,...t}){const n=e||document;hi.has(n)||hi.set(n,{});const r=hi.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(yx,{root:e,...t})),r[i]}function bx(e,t,n){const r=wx(t);return oo.set(e,n),r.observe(e),()=>{oo.delete(e),r.unobserve(e)}}var xx={some:0,all:1},Sx=class extends nt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:xx[r]},s=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:l}=this.node.getProps(),f=c?u:l;f&&f(a)};this.stopObserver=bx(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Cx(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Cx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Tx={inView:{Feature:Sx},tap:{Feature:gx},focus:{Feature:mx},hover:{Feature:px}},Px={layout:{ProjectionNode:Df,MeasureLayout:Uf}},Rx={...G0,...Tx,...hx,...Px},EC=W0(Rx,H0),AC="Project connection defaults are still syncing. Try again in a moment.",MC="Finishing setup.",Ex=1e4,Ax={hover:!0,touch:!1},Mx={top:0,right:0,bottom:0,left:0},Wf=["inline","pip","fullscreen"];function Hf(){return{headers:{},requestTimeout:Ex}}function kC(){return{version:1,connectionDefaults:Hf(),clientCapabilities:fo()}}function DC(e){return{theme:e.theme,displayMode:e.displayMode,availableDisplayModes:Wf,locale:e.locale,timeZone:e.timeZone,...e.deviceCapabilities?{deviceCapabilities:e.deviceCapabilities}:{},...e.safeAreaInsets?{safeAreaInsets:e.safeAreaInsets}:{}}}function OC(e){if(!e||typeof e!="object")return!1;const t=e;return t.version===1&&(t.connectionDefaults===void 0||Qf(t.connectionDefaults))&&Nt(t.clientCapabilities)&&Nt(t.hostContext)}function kx(e,t=fo()){return Nt(e)?e:t}function Dx(e,t={}){return Nt(e)?e:t}function _C(e){return{version:1,connectionDefaults:zf(e?.connectionDefaults),clientCapabilities:kx(e?.clientCapabilities)}}function IC(e,t={}){return Dx(e?.hostContext,t)}function zf(e,t=Hf()){return Qf(e)?{headers:Gf(e.headers),requestTimeout:Fx(e.requestTimeout,t.requestTimeout)}:t}function LC(e){return zf(e?.connectionDefaults)}function VC(e,t){return{...Gf(e),...Vx(t)}}function FC(e){return Ox(e?.clientCapabilities??fo())}function Ox(e){return Td(e)}function _x(e){const t=e?.availableDisplayModes;if(!Array.isArray(t))return Wf;const n=t.filter(Kf);return n.length>0?n:["inline"]}function Ix(e){const t=e?.displayMode;return Kf(t)?t:void 0}function NC(e){return Lx(Ix(e),_x(e))}function jC(e){const t=e?.theme;return t==="light"||t==="dark"?t:void 0}function $C(e,t="en-US"){return typeof e?.locale=="string"?e.locale:t}function BC(e,t="UTC"){return typeof e?.timeZone=="string"?e.timeZone:t}function qC(e,t=Ax){const n=e?.deviceCapabilities;if(!n||typeof n!="object"||Array.isArray(n))return t;const r=n;return{hover:r.hover??t.hover,touch:r.touch??t.touch}}function UC(e,t=Mx){const n=e?.safeAreaInsets;if(!n||typeof n!="object"||Array.isArray(n))return t;const r=n;return{top:r.top??t.top,right:r.right??t.right,bottom:r.bottom??t.bottom,left:r.left??t.left}}function Lx(e,t){return e&&t.includes(e)?e:t[0]??"inline"}function Kf(e){return e==="inline"||e==="pip"||e==="fullscreen"}function Qf(e){return!Nt(e)||e.headers!==void 0&&!Nt(e.headers)?!1:e.requestTimeout===void 0||typeof e.requestTimeout=="number"&&Number.isFinite(e.requestTimeout)}function Gf(e){return e?Object.fromEntries(Object.entries(e).filter(([t,n])=>t.trim()!==""&&t.toLowerCase()!=="authorization"&&typeof n=="string")):{}}function Vx(e){return e?Object.fromEntries(Object.entries(e).filter(([t,n])=>t.trim()!==""&&typeof n=="string")):{}}function Fx(e,t){return typeof e!="number"||!Number.isFinite(e)||e<=0?t:e}function Nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nx=["billing_","credit_topup_","plan_limit_","plans_upgrade_confirm_","pricing_"];function jx(e){return Nx.some(t=>e.startsWith(t))}function $x(e){const t=e.toLowerCase();return t==="organization_id"||t==="package_id"||t==="price_cents"||t==="price_paid_cents"||t==="granted_credits"||t==="amount_credits"||t==="error"||t==="error_name"||t==="error_message"||t.startsWith("stripe_")||t.startsWith("invoice_")||t==="checkout_session_id"||t==="payment_intent_id"}function WC(e,t={}){const{location:n="unknown",platform:r,environment:i,...o}=t;try{const s=jx(e),a=s?o.organization_id:void 0,c=typeof a=="string"&&a.length>0?a:void 0,u=s?Object.fromEntries(Object.entries(o).filter(([l])=>!$x(l))):o;ho.capture(e,{...u,...pd(n),...s?{organization_id:null,...c?{$groups:{organization:c}}:{}}:{}})}catch(s){console.warn(`[analytics] Failed to capture ${e}`,s)}}function HC(e,t,n=ps()){const r=hd();!n||ps()!==n||r.policy.content!=="full"||e.capture("$set",{},{$set:r.policy.identity==="full"?t:{deployment:t.deployment}})}var sc="1.46.0",mn=Symbol.for("functionName"),Bx=Symbol.for("toReferencePath");function qx(e){return e[Bx]??null}function Ux(e){return e.startsWith("function://")}function Wx(e){let t;if(typeof e=="string")Ux(e)?t={functionHandle:e}:t={name:e};else if(e[mn])t={name:e[mn]};else{const n=qx(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function oe(e){const t=Wx(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[mn];if(!n)throw new Error(`${e} is not a functionReference`);return n}function hs(e){return{[mn]:e}}function Yf(e=[]){return new Proxy({},{get(t,n){if(typeof n=="string")return Yf([...e,n]);if(n===mn){if(e.length<2){const o=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${o}\``)}const r=e.slice(0,-1).join("/"),i=e[e.length-1];return i==="default"?r:r+":"+i}else return n===Symbol.toStringTag?"FunctionReference":void 0}})}var zC=Yf(),Hx=Object.defineProperty,zx=(e,t,n)=>t in e?Hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ac=(e,t,n)=>zx(e,typeof t!="symbol"?t+"":t,n),Kx="color:rgb(0, 145, 255)";function Xf(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}var Zf=class{constructor(e){ac(this,"_onLogLineFuncs"),ac(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let n=0;n<10&&this._onLogLineFuncs[t]!==void 0;n++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(const t of Object.values(this._onLogLineFuncs))t("debug",`${new Date().toISOString()}`,...e)}log(...e){for(const t of Object.values(this._onLogLineFuncs))t("info",...e)}warn(...e){for(const t of Object.values(this._onLogLineFuncs))t("warn",...e)}error(...e){for(const t of Object.values(this._onLogLineFuncs))t("error",...e)}};function Jf(e){const t=new Zf(e);return t.addLogLineListener((n,...r)=>{switch(n){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),t}function ed(e){return new Zf(e)}function gr(e,t,n,r,i){const o=Xf(n);if(typeof i=="object"&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t==="info"){const s=i.match(/^\[.*?\] /);if(s===null){e.error(`[CONVEX ${o}(${r})] Could not parse console.log`);return}const a=i.slice(1,s[0].length-2),c=i.slice(s[0].length);e.log(`%c[CONVEX ${o}(${r})] [${a}]`,Kx,c)}else e.error(`[CONVEX ${o}(${r})] ${i}`)}function Qx(e,t){const n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),new Error(n)}function Ot(e,t,n){return`[CONVEX ${Xf(e)}(${t})] ${n.errorMessage}
|
|
42
42
|
Called by client`}function so(e,t){return t.data=e.errorData,t}function vt(e){const t=e.split(":");let n,r;return t.length===1?(n=t[0],r="default"):(n=t.slice(0,t.length-1).join(":"),r=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${r}`}function ft(e,t){return JSON.stringify({udfPath:vt(e),args:ke(t)})}function cc(e,t,n){const{initialNumItems:r,id:i}=n;return JSON.stringify({type:"paginated",udfPath:vt(e),args:ke(t),options:ke({initialNumItems:r,id:i})})}var Gx=Object.defineProperty,Yx=(e,t,n)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t,n)=>Yx(e,typeof t!="symbol"?t+"":t,n),Xx=class{constructor(){Ce(this,"nextQueryId"),Ce(this,"querySetVersion"),Ce(this,"querySet"),Ce(this,"queryIdToToken"),Ce(this,"identityVersion"),Ce(this,"auth"),Ce(this,"outstandingQueriesOlderThanRestart"),Ce(this,"outstandingAuthOlderThanRestart"),Ce(this,"paused"),Ce(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,n,r){const i=vt(e),o=ft(i,t),s=this.querySet.get(o);if(s!==void 0)return s.numSubscribers+=1,{queryToken:o,modification:null,unsubscribe:()=>this.removeSubscriber(o)};{const a=this.nextQueryId++,c={id:a,canonicalizedUdfPath:i,args:t,numSubscribers:1,journal:n,componentPath:r};this.querySet.set(o,c),this.queryIdToToken.set(a,o);const u=this.querySetVersion,l=this.querySetVersion+1,f={type:"Add",queryId:a,udfPath:i,args:[ke(t)],journal:n,componentPath:r};return this.paused?this.pendingQuerySetModifications.set(a,f):this.querySetVersion=l,{queryToken:o,modification:{type:"ModifyQuerySet",baseVersion:u,newVersion:l,modifications:[f]},unsubscribe:()=>this.removeSubscriber(o)}}}transition(e){for(const t of e.modifications)switch(t.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(t.queryId);const n=t.journal;if(n!==void 0){const r=this.queryIdToToken.get(t.queryId);r!==void 0&&(this.querySet.get(r).journal=n)}break}case"QueryRemoved":this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw new Error(`Invalid modification ${t.type}`)}}queryId(e,t){const n=vt(e),r=ft(n,t),i=this.querySet.get(r);return i!==void 0?i.id:null}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:"User",value:e};const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",baseVersion:t,...this.auth}}setAdminAuth(e,t){const n={tokenType:"Admin",value:e,impersonating:t};this.auth=n;const r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:"Authenticate",baseVersion:r,...n}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",tokenType:"None",baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){const t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){const t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const e=[];for(const r of this.querySet.values()){const i={type:"Add",queryId:r.id,udfPath:r.canonicalizedUdfPath,args:[ke(r.args)],journal:r.journal,componentPath:r.componentPath};e.push(i),this.outstandingQueriesOlderThanRestart.add(r.id)}this.querySetVersion=1;const t={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;const n={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[t,n]}pause(){this.paused=!0}resume(){const e=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){const t=this.querySet.get(e);if(t.numSubscribers>1)return t.numSubscribers-=1,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);const n=this.querySetVersion,r=this.querySetVersion+1,i={type:"Remove",queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,i):this.querySetVersion=r,{type:"ModifyQuerySet",baseVersion:n,newVersion:r,modifications:[i]}}}},Zx=Object.defineProperty,Jx=(e,t,n)=>t in e?Zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nn=(e,t,n)=>Jx(e,typeof t!="symbol"?t+"":t,n),eS=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,Nn(this,"inflightRequests"),Nn(this,"requestsOlderThanRestart"),Nn(this,"inflightMutationsCount",0),Nn(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){const n=new Promise(r=>{const i=t?"Requested":"NotSent";this.inflightRequests.set(e.requestId,{message:e,status:{status:i,requestedAt:new Date,onResult:r}}),e.type==="Mutation"?this.inflightMutationsCount++:e.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),n}onResponse(e){const t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status==="Completed")return null;const n=t.message.type==="Mutation"?"mutation":"action",r=t.message.udfPath;for(const a of e.logLines)gr(this.logger,"info",n,r,a);const i=t.status;let o,s;if(e.success)o={success:!0,logLines:e.logLines,value:tr(e.result)},s=()=>i.onResult(o);else{const a=e.result,{errorData:c}=e;gr(this.logger,"error",n,r,a),o={success:!1,errorMessage:a,errorData:c!==void 0?tr(c):void 0,logLines:e.logLines},s=()=>i.onResult(o)}return e.type==="ActionResponse"||!e.success?(s(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type==="Action"?this.inflightActionsCount--:t.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:o}):(t.status={status:"Completed",result:o,ts:e.ts,onResolve:s},null)}removeCompleted(e){const t=new Map;for(const[n,r]of this.inflightRequests.entries()){const i=r.status;i.status==="Completed"&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),t.set(n,i.result),r.message.type==="Mutation"?this.inflightMutationsCount--:r.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const e=[];for(const[t,n]of this.inflightRequests){if(n.status.status==="NotSent"){n.status.status="Requested",e.push(n.message);continue}if(n.message.type==="Mutation")e.push(n.message);else if(n.message.type==="Action"){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,n.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");n.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){const e=[];for(const[,t]of this.inflightRequests)if(t.status.status==="NotSent"){t.status.status="Requested",e.push(t.message);continue}return e}hasIncompleteRequests(){for(const e of this.inflightRequests.values())if(e.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(const t of this.inflightRequests.values())t.status.status!=="Completed"&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}},tS=Object.defineProperty,nS=(e,t,n)=>t in e?tS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vr=(e,t,n)=>nS(e,typeof t!="symbol"?t+"":t,n),uc=class ao{constructor(t){vr(this,"queryResults"),vr(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const r=Fe(n[0]),i=oe(t),o=this.queryResults.get(ft(i,r));if(o!==void 0)return ao.queryValue(o.result)}getAllQueries(t){const n=[],r=oe(t);for(const i of this.queryResults.values())i.udfPath===vt(r)&&n.push({args:i.args,value:ao.queryValue(i.result)});return n}setQuery(t,n,r){const i=Fe(n),o=oe(t),s=ft(o,i);let a;r===void 0?a=void 0:a={success:!0,value:r,logLines:[]};const c={udfPath:o,args:i,result:a};this.queryResults.set(s,c),this.modifiedQueries.push(s)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}},rS=class{constructor(){vr(this,"queryResults"),vr(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(o=>!t.has(o.mutationId));const n=this.queryResults;this.queryResults=new Map(e);const r=new uc(this.queryResults);for(const o of this.optimisticUpdates)o.update(r);const i=[];for(const[o,s]of this.queryResults){const a=n.get(o);(a===void 0||a.result!==s.result)&&i.push(o)}return i}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});const n=new uc(this.queryResults);return e(n),n.modifiedQueries}rawQueryResult(e){const t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){const t=this.queryResults.get(e);if(t===void 0)return;const n=t.result;if(n!==void 0){if(n.success)return n.value;throw n.errorData!==void 0?so(n,new bi(Ot("query",t.udfPath,n))):new Error(Ot("query",t.udfPath,n))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}},iS=Object.defineProperty,oS=(e,t,n)=>t in e?iS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pi=(e,t,n)=>oS(e,typeof t!="symbol"?t+"":t,n),Tn=class Le{constructor(t,n){pi(this,"low"),pi(this,"high"),pi(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new Le(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?lc:t>=sS?aS:new Le(t%tn|0,t/tn|0)}toString(){return(BigInt(this.high)*BigInt(tn)+BigInt(this.low)).toString()}equals(t){return Le.isLong(t)||(t=Le.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return Le.isLong(t)||(t=Le.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?Le.fromNumber(t):new Le(t.low,t.high)}},lc=new Tn(0,0),fc=65536,tn=fc*fc,sS=tn*tn,aS=new Tn(-1,-1),cS=Object.defineProperty,uS=(e,t,n)=>t in e?cS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jn=(e,t,n)=>uS(e,typeof t!="symbol"?t+"":t,n),dc=class{constructor(e,t){jn(this,"version"),jn(this,"remoteQuerySet"),jn(this,"queryPath"),jn(this,"logger"),this.version={querySet:0,ts:Tn.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){const t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw new Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const n of e.modifications)switch(n.type){case"QueryUpdated":{const r=this.queryPath(n.queryId);if(r)for(const o of n.logLines)gr(this.logger,"info","query",r,o);const i=tr(n.value??null);this.remoteQuerySet.set(n.queryId,{success:!0,value:i,logLines:n.logLines});break}case"QueryFailed":{const r=this.queryPath(n.queryId);if(r)for(const o of n.logLines)gr(this.logger,"info","query",r,o);const{errorData:i}=n;this.remoteQuerySet.set(n.queryId,{success:!1,errorMessage:n.errorMessage,errorData:i!==void 0?tr(i):void 0,logLines:n.logLines});break}case"QueryRemoved":this.remoteQuerySet.delete(n.queryId);break;default:throw new Error(`Invalid modification ${n.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}};function mi(e){const t=Rd(e);return Tn.fromBytesLE(Array.from(t))}function lS(e){const t=new Uint8Array(e.toBytesLE());return Pd(t)}function hc(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:mi(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:mi(e.startVersion.ts)},endVersion:{...e.endVersion,ts:mi(e.endVersion.ts)}}}}function fS(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:lS(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var dS=Object.defineProperty,hS=(e,t,n)=>t in e?dS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>hS(e,typeof t!="symbol"?t+"":t,n),pS=1e3,mS=1001,gS=1005,vS=4040,Jn;function At(){return Jn===void 0&&(Jn=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Jn+performance.now())}function pc(){return`t=${Math.round((At()-Jn)/100)/10}s`}var td={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function yS(e){if(e===void 0)return"Unknown";for(const t of Object.keys(td))if(e.startsWith(t))return t;return"Unknown"}var wS=class{constructor(e,t,n,r,i,o){this.markConnectionStateDirty=i,this.debug=o,W(this,"socket"),W(this,"connectionCount"),W(this,"_hasEverConnected",!1),W(this,"lastCloseReason"),W(this,"transitionChunkBuffer",null),W(this,"defaultInitialBackoff"),W(this,"maxBackoff"),W(this,"retries"),W(this,"serverInactivityThreshold"),W(this,"reconnectDueToServerInactivityTimeout"),W(this,"scheduledReconnect",null),W(this,"networkOnlineHandler",null),W(this,"pendingNetworkRecoveryInfo",null),W(this,"uri"),W(this,"onOpen"),W(this,"onResume"),W(this,"onMessage"),W(this,"webSocketConstructor"),W(this,"logger"),W(this,"onServerDisconnectError"),this.webSocketConstructor=n,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=r,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){const t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){const t=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const n=hc(JSON.parse(t));if(n.type!=="Transition")throw new Error(`Expected Transition, got ${n.type} after assembling chunks`);return n}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const e=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:e,paused:"no"}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:e,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:At()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",pc(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",pc())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:t}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:t}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(t/1e3)}s of waiting`)}},e.onerror=t=>{this.transitionChunkBuffer=null;const n=t.message;n&&this.logger.log(`WebSocket error message: ${n}`)},e.onmessage=t=>{this.resetServerInactivityTimeout();const n=t.data.length;let r=hc(JSON.parse(t.data));if(this._logVerbose(`received ws message with type ${r.type}`),r.type!=="Ping"){if(r.type==="TransitionChunk"){const i=this.assembleTransition(r);if(!i)return;r=i,this._logVerbose(`assembled full ws message of type ${r.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${r.type} while buffering TransitionChunks`)),r.type==="Transition"&&this.reportLargeTransition({messageLength:n,transition:r}),this.onMessage(r).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=t=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=t.reason||`closed with code ${t.code}`),t.code!==pS&&t.code!==mS&&t.code!==gS&&t.code!==vS){let r=`WebSocket closed with code ${t.code}`;t.reason&&(r+=`: ${t.reason}`),this.logger.log(r),this.onServerDisconnectError&&t.reason&&this.onServerDisconnectError(r)}const n=yS(t.reason);this.scheduleReconnect(n)}}socketState(){return this.socket.state}sendMessage(e){const t={type:e.type,...e.type==="Authenticate"&&e.tokenType==="User"?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const n=fS(e),r=JSON.stringify(n);let i=!1;try{this.socket.ws.send(r),i=!0}catch(o){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${o}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${i?"sent":"failed to send"} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);const n=At(),r=setTimeout(()=>{this.scheduledReconnect?.timeout===r&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:r,scheduledAt:n,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":this.lastCloseReason=e,this.close(),this.scheduleReconnect("client");return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const e=this.socket.ws;return e.onmessage=t=>{this._logVerbose("Ignoring message received after close")},new Promise(t=>{e.onclose=()=>{this._logVerbose("Closed after connecting"),t()},e.onopen=()=>{this._logVerbose("Opened after connecting"),e.close()}})}case"ready":{this._logVerbose("ws.close called");const e=this.socket.ws;e.onmessage=n=>{this._logVerbose("Ignoring message received after close")};const t=new Promise(n=>{e.onclose=()=>{n()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const e=this.close();return this.setSocketState({state:"terminated"}),e}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const e=this.close();return this.socket={state:"stopped"},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":this.socket={...this.socket,paused:"yes"};return;default:this.socket;return}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){const t=At()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=e!==null?{timeSavedMs:e}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:At()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){const t=(e==="client"?100:e==="Unknown"?this.defaultInitialBackoff:td[e].timeout)*Math.pow(2,this.retries);this.retries+=1;const n=Math.min(t,this.maxBackoff);return n+n*(Math.random()-.5)}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;const n=At()-e.clientClockSkew-e.serverTs/1e6,r=`${Math.round(n)}ms`,i=`${Math.round(t/1e4)/100}MB`,o=t/(n/1e3),s=`${Math.round(o/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${r} at ${s}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):n>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:n,messageLength:t}})}};function bS(){return xS()}function xS(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Yt=class extends Error{};Yt.prototype.name="InvalidTokenError";function SS(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function CS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return SS(t)}catch{return atob(t)}}function nd(e,t){if(typeof e!="string")throw new Yt("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Yt(`Invalid token specified: missing part #${n+1}`);let i;try{i=CS(r)}catch(o){throw new Yt(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new Yt(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}var TS=Object.defineProperty,PS=(e,t,n)=>t in e?TS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,se=(e,t,n)=>PS(e,typeof t!="symbol"?t+"":t,n),RS=1728e6,mc=2,ES=class{constructor(e,t,n){se(this,"authState",{state:"noAuth"}),se(this,"configVersion",0),se(this,"syncState"),se(this,"authenticate"),se(this,"stopSocket"),se(this,"tryRestartSocket"),se(this,"pauseSocket"),se(this,"resumeSocket"),se(this,"clearAuth"),se(this,"logger"),se(this,"refreshTokenLeewaySeconds"),se(this,"initialAuthTokenReuse"),se(this,"lastRefreshChange"),se(this,"tokenConfirmationAttempts",0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=n.logger,this.refreshTokenLeewaySeconds=n.refreshTokenLeewaySeconds,this.initialAuthTokenReuse=n.initialAuthTokenReuse,this.lastRefreshChange=!1}notifyRefreshChange(e){this.authState.state!=="noAuth"&&this.authState.state!=="initialRefetch"&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(r.isFromOutdatedConfig)return;const i={fetchToken:e,onAuthChange:t,onRefreshChange:n};r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:i,hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:i}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid");const t=this.syncState.getAuth()?.value;this.initialAuthTokenReuse&&t?this.scheduleTokenRefetch(t,e.clientClockSkew):this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=mc){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if(this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${mc-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),this.authState.state==="noAuth")return;const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:t.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(e,t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(e);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:i}=n;if(!r||!i){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const o=i-r;if(o<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let s;t!==void 0?(s=i-(Date.now()-t)/1e3,s<=0&&(s=0)):s=o;let a=Math.min(RS,(s-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${s}s`),a=0);const c=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},a);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:c,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,t){const n=++this.configVersion;this._logVerbose(`fetching token with config version ${n}`);const r=await e(t);return this.configVersion!==n?(this._logVerbose(`stale config version, expected ${n}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:r}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:"noAuth"})}setAuthState(e){const t=e.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0}this.authState.state==="waitingForScheduledRefetch"&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return nd(e)}catch(t){return this._logVerbose(`Error decoding token: ${t instanceof Error?t.message:"Unknown error"}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}},AS=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function MS(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function kS(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function DS(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of AS){const r=performance.getEntriesByName(n).filter(i=>i.entryType==="mark").filter(i=>i.detail.sessionId===e);t.push(...r)}return t.map(kS)}var OS=Object.defineProperty,_S=(e,t,n)=>t in e?OS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t,n)=>_S(e,typeof t!="symbol"?t+"":t,n),IS=class{constructor(e,t,n){if(H(this,"address"),H(this,"state"),H(this,"requestManager"),H(this,"webSocketManager"),H(this,"authenticationManager"),H(this,"remoteQuerySet"),H(this,"optimisticQueryResults"),H(this,"_transitionHandlerCounter",0),H(this,"_nextRequestId"),H(this,"_onTransitionFns",new Map),H(this,"_sessionId"),H(this,"firstMessageReceived",!1),H(this,"debug"),H(this,"logger"),H(this,"maxObservedTimestamp"),H(this,"connectionStateSubscribers",new Map),H(this,"nextConnectionStateSubscriberId",0),H(this,"_lastPublishedConnectionState"),H(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const d=this.connectionState();if(JSON.stringify(d)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=d;for(const p of this.connectionStateSubscribers.values())p(d)}})}),H(this,"mark",d=>{this.debug&&MS(d,this.sessionId)}),typeof e=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");n?.skipConvexDeploymentUrlCheck!==!0&&Ed(e),n={...n};const r=n.authRefreshTokenLeewaySeconds??10;let i=n.webSocketConstructor;if(!i&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");i=i||WebSocket,this.debug=n.reportDebugInfoToConvex??!1,this.address=e,this.logger=n.logger===!1?ed({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:Jf({verbose:n.verbose??!1});const o=e.search("://");if(o===-1)throw new Error("Provided address was not an absolute URL.");const s=e.substring(o+3),a=e.substring(0,o);let c;if(a==="http")c="ws";else if(a==="https")c="wss";else throw new Error(`Unknown parent protocol ${a}`);const u=`${c}://${s}/api/${sc}/sync`;this.state=new Xx,this.remoteQuerySet=new dc(d=>this.state.queryPath(d),this.logger),this.requestManager=new eS(this.logger,this.markConnectionStateDirty);const l=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new ES(this.state,{authenticate:d=>{const p=this.state.setAuth(d);return this.webSocketManager.sendMessage(p),p.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:l,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:r,initialAuthTokenReuse:n.initialAuthTokenReuse??!1}),this.optimisticQueryResults=new rS,this.addOnTransitionHandler(d=>{t(d.queries.map(p=>p.token))}),this._nextRequestId=0,this._sessionId=bS();const{unsavedChangesWarning:f}=n;if(typeof window>"u"||typeof window.addEventListener>"u"){if(f===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else f!==!1&&window.addEventListener("beforeunload",d=>{if(this.requestManager.hasIncompleteRequests()){d.preventDefault();const p="Are you sure you want to leave? Your changes may not be saved.";return(d||window.event).returnValue=p,p}});this.webSocketManager=new wS(u,{onOpen:d=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...d,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new dc(g=>this.state.queryPath(g),this.logger);const[p,m]=this.state.restart();m&&this.webSocketManager.sendMessage(m),this.webSocketManager.sendMessage(p);for(const g of this.requestManager.restart())this.webSocketManager.sendMessage(g)},onResume:()=>{const[d,p]=this.state.resume();p&&this.webSocketManager.sendMessage(p),d&&this.webSocketManager.sendMessage(d);for(const m of this.requestManager.resume())this.webSocketManager.sendMessage(m)},onMessage:d=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),d.type){case"Transition":{this.observedTimestamp(d.endVersion.ts),this.authenticationManager.onTransition(d),this.remoteQuerySet.transition(d),this.state.transition(d);const p=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(p);break}case"MutationResponse":{d.success&&this.observedTimestamp(d.ts);const p=this.requestManager.onResponse(d);p!==null&&this.notifyOnQueryResultChanges(new Map([[p.requestId,p.result]]));break}case"ActionResponse":this.requestManager.onResponse(d);break;case"AuthError":this.authenticationManager.onAuthError(d);break;case"FatalError":{const p=Qx(this.logger,d.error);throw this.webSocketManager.terminate(),p}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:n.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),n.expectAuth&&l()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){const t=this.remoteQuerySet.remoteQueryResults(),n=new Map;for(const[i,o]of t){const s=this.state.queryToken(i);if(s!==null){const a={result:o,udfPath:this.state.queryPath(i),args:this.state.queryArgs(i)};n.set(s,a)}}const r=this.optimisticQueryResults.ingestQueryResultsFromServer(n,new Set(e.keys()));this.handleTransition({queries:r.map(i=>({token:i,modification:{kind:"Updated",result:this.optimisticQueryResults.rawQueryResult(i)}})),reflectedMutations:Array.from(e).map(([i,o])=>({requestId:i,result:o})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(const t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){const t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){const e=this.state.getAuth();let t={};if(e&&e.tokenType==="User")try{t=e?nd(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t,n){this.authenticationManager.setConfig(e,t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){const n=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(n)}clearAuth(){const e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,n){const r=Fe(t),{modification:i,queryToken:o,unsubscribe:s}=this.state.subscribe(e,r,n?.journal,n?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:o,unsubscribe:()=>{const a=s();a&&this.webSocketManager.sendMessage(a)}}}localQueryResult(e,t){const n=Fe(t),r=ft(e,n);return this.optimisticQueryResults.queryResult(r)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){const n=Fe(t),r=ft(e,n);return this.optimisticQueryResults.queryLogs(r)}queryJournal(e,t){const n=Fe(t),r=ft(e,n);return this.state.queryJournal(r)}connectionState(){const e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){const t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,n){const r=await this.mutationInternal(e,t,n);if(!r.success)throw r.errorData!==void 0?so(r,new bi(Ot("mutation",e,r))):new Error(Ot("mutation",e,r));return r.value}async mutationInternal(e,t,n,r){const{mutationPromise:i}=this.enqueueMutation(e,t,n,r);return i}enqueueMutation(e,t,n,r){const i=Fe(t);this.tryReportLongDisconnect();const o=this.nextRequestId;if(this._nextRequestId++,n!==void 0){const c=n.optimisticUpdate;if(c!==void 0){const u=f=>{c(f,i)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},l=this.optimisticQueryResults.applyOptimisticUpdate(u,o).map(f=>{const d=this.localQueryResultByToken(f);return{token:f,modification:{kind:"Updated",result:d===void 0?void 0:{success:!0,value:d,logLines:[]}}}});this.handleTransition({queries:l,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const s={type:"Mutation",requestId:o,udfPath:e,componentPath:r,args:[ke(i)]},a=this.webSocketManager.sendMessage(s);return{requestId:o,mutationPromise:this.requestManager.request(s,a)}}async action(e,t){const n=await this.actionInternal(e,t);if(!n.success)throw n.errorData!==void 0?so(n,new bi(Ot("action",e,n))):new Error(Ot("action",e,n));return n.value}async actionInternal(e,t,n){const r=Fe(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const o={type:"Action",requestId:i,udfPath:e,componentPath:n,args:[ke(r)]},s=this.webSocketManager.sendMessage(o);return this.requestManager.request(o,s)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const e=DS(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:e})}}tryReportLongDisconnect(){if(!this.debug)return;const e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=6e4)return;const t=`${this.address}/api/debug_event`;fetch(t,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${sc}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(n=>{n.ok||this.logger.warn("Analytics request failed with response:",n.body)}).catch(n=>{this.logger.warn("Analytics response failed with error:",n)})}};function gi(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var LS=Object.defineProperty,VS=(e,t,n)=>t in e?LS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gc=(e,t,n)=>VS(e,typeof t!="symbol"?t+"":t,n),FS=class{constructor(e,t){this.client=e,this.onTransition=t,gc(this,"paginatedQuerySet",new Map),gc(this,"lastTransitionTs"),this.lastTransitionTs=Tn.fromNumber(0),this.client.addOnTransitionHandler(n=>this.onBaseTransition(n))}subscribe(e,t,n){const r=vt(e),i=cc(r,t,n),o=()=>this.removePaginatedQuerySubscriber(i),s=this.paginatedQuerySet.get(i);return s?(s.numSubscribers+=1,{paginatedQueryToken:i,unsubscribe:o}):(this.paginatedQuerySet.set(i,{token:i,canonicalizedUdfPath:r,args:t,numSubscribers:1,options:{initialNumItems:n.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:n.id}),this.addPageToPaginatedQuery(i,null,n.initialNumItems),{paginatedQueryToken:i,unsubscribe:o})}localQueryResult(e,t,n){const r=vt(e),i=cc(r,t,n);return this.localQueryResultByToken(i)}localQueryResultByToken(e){const t=this.paginatedQuerySet.get(e);if(!t)return;const n=this.activePageQueryTokens(t);if(n.length===0)return{results:[],status:"LoadingFirstPage",loadMore:a=>this.loadMoreOfPaginatedQuery(e,a)};let r=[],i=!1,o=!1;for(const a of n){const c=this.client.localQueryResultByToken(a);if(c===void 0){i=!0,o=!1;continue}const u=gi(c);r=r.concat(u.page),o=!!u.isDone}let s;return i?s=r.length===0?"LoadingFirstPage":"LoadingMore":o?s="Exhausted":s="CanLoadMore",{results:r,status:s,loadMore:a=>this.loadMoreOfPaginatedQuery(e,a)}}onBaseTransition(e){const t=e.queries.map(o=>o.token),n=this.queriesContainingTokens(t);let r=[];n.length>0&&(this.processPaginatedQuerySplits(n,o=>this.client.localQueryResultByToken(o)),r=n.map(o=>({token:o,modification:{kind:"Updated",result:this.localQueryResultByToken(o)}})));const i={...e,paginatedQueries:r};this.onTransition(i)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);const n=this.queryTokenForLastPageOfPaginatedQuery(e),r=this.client.localQueryResultByToken(n);if(!r)return!1;const i=gi(r);if(i.isDone)return!1;this.addPageToPaginatedQuery(e,i.continueCursor,t);const o={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:"Updated",result:this.localQueryResultByToken(e)}}]};return this.onTransition(o),!0}queriesContainingTokens(e){if(e.length===0)return[];const t=[],n=new Set(e);for(const[r,i]of this.paginatedQuerySet)for(const o of this.allQueryTokens(i))if(n.has(o)){t.push(r);break}return t}processPaginatedQuerySplits(e,t){for(const n of e){const r=this.mustGetPaginatedQuery(n),{ongoingSplits:i,pageKeyToQuery:o,pageKeys:s}=r;for(const[a,[c,u]]of i)t(o.get(c).queryToken)!==void 0&&t(o.get(u).queryToken)!==void 0&&this.completePaginatedQuerySplit(r,a,c,u);for(const a of s){if(i.has(a))continue;const c=o.get(a);if(!c)throw new Error(`No page query for active pageKey ${a}`);const u=t(c.queryToken);if(!u)continue;const l=gi(u);l.splitCursor&&(l.pageStatus==="SplitRecommended"||l.pageStatus==="SplitRequired"||l.page.length>r.options.initialNumItems*2)&&this.splitPaginatedQueryPage(r,a,c.cursor,l.splitCursor,l.continueCursor)}}}splitPaginatedQueryPage(e,t,n,r,i){const o=e.nextPageKey++,s=e.nextPageKey++,a={numItems:e.options.initialNumItems,id:e.id},c=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:n,endCursor:r}});e.pageKeyToQuery.set(o,{...c,cursor:n});const u=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...a,cursor:r,endCursor:i}});e.pageKeyToQuery.set(s,{...u,cursor:r}),e.ongoingSplits.set(t,[o,s])}addPageToPaginatedQuery(e,t,n){const r=this.mustGetPaginatedQuery(e),i=r.nextPageKey++,o={cursor:t,numItems:n,id:r.id},s={...r.args,paginationOpts:o},a=this.client.subscribe(r.canonicalizedUdfPath,s);return r.pageKeys.push(i),r.pageKeyToQuery.set(i,{...a,cursor:t}),a}removePaginatedQuerySubscriber(e){const t=this.paginatedQuerySet.get(e);if(t&&(t.numSubscribers-=1,!(t.numSubscribers>0))){for(const n of t.pageKeyToQuery.values())n.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,n,r){const i=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);const o=e.pageKeys.indexOf(t);e.pageKeys.splice(o,1,n,r),e.ongoingSplits.delete(t),i.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(t=>t.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){const t=this.mustGetPaginatedQuery(e),n=t.pageKeys[t.pageKeys.length-1];if(n===void 0)throw new Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(n).queryToken}mustGetPaginatedQuery(e){const t=this.paginatedQuerySet.get(e);if(!t)throw new Error("paginated query no longer exists for token "+e);return t}};function NS({getCurrentValue:e,subscribe:t}){const[n,r]=(0,h.useState)(()=>({getCurrentValue:e,subscribe:t,value:e()}));let i=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(i=e(),r({getCurrentValue:e,subscribe:t,value:i})),(0,h.useEffect)(()=>{let o=!1;const s=()=>{o||r(c=>{if(c.getCurrentValue!==e||c.subscribe!==t)return c;const u=e();return c.value===u?c:{...c,value:u}})},a=t(s);return s(),()=>{o=!0,a()}},[e,t]),i}var jS=Object.defineProperty,$S=(e,t,n)=>t in e?jS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_e=(e,t,n)=>$S(e,typeof t!="symbol"?t+"":t,n),BS=5e3;if(typeof h.default>"u")throw new Error("Required dependency 'react' not found");function rd(e,t,n){function r(i){return WS(i),t.mutation(e,i,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(o){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${oe(e)}`);return rd(e,t,o)},r}function qS(e,t){return function(n){return t.action(e,n)}}var KC=class{constructor(e,t){if(_e(this,"address"),_e(this,"cachedSync"),_e(this,"cachedPaginatedQueryClient"),_e(this,"listeners"),_e(this,"options"),_e(this,"closed",!1),_e(this,"_logger"),_e(this,"adminAuth"),_e(this,"fakeUserIdentity"),e===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof e!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=e,this.listeners=new Map,this._logger=t?.logger===!1?ed({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:Jf({verbose:t?.verbose??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=this.options.baseClient??new IS(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new FS(this.cachedSync,e=>this.handleTransition(e)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(e,t,n){if(typeof e=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(e,t??(()=>{}),n)}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){const[n,r]=t,i=oe(e);return{onUpdate:o=>{const{queryToken:s,unsubscribe:a}=this.sync.subscribe(i,n,r),c=this.listeners.get(s);return c!==void 0?c.add(o):this.listeners.set(s,new Set([o])),()=>{if(this.closed)return;const u=this.listeners.get(s);u.delete(o),u.size===0&&this.listeners.delete(s),a()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,n)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,n)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,n)}}}prewarmQuery(e){const t=e.extendSubscriptionFor??BS,n=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(n,t)}watchPaginatedQuery(e,t,n){const r=oe(e);return{onUpdate:i=>{const{paginatedQueryToken:o,unsubscribe:s}=this.paginatedQueryClient.subscribe(r,t||{},n),a=this.listeners.get(o);return a!==void 0?a.add(i):this.listeners.set(o,new Set([i])),()=>{if(this.closed)return;const c=this.listeners.get(o);c.delete(i),c.size===0&&this.listeners.delete(o),s()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(r,t,n)}}mutation(e,...t){const[n,r]=t,i=oe(e);return this.sync.mutation(i,n,r)}action(e,...t){const n=oe(e);return this.sync.action(n,...t)}query(e,...t){const n=this.watchQuery(e,...t),r=n.localQueryResult();return r!==void 0?Promise.resolve(r):new Promise((i,o)=>{const s=n.onUpdate(()=>{s();try{i(n.localQueryResult())}catch(a){o(a)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){const t=e.queries.map(r=>r.token),n=e.paginatedQueries.map(r=>r.token);this.transition([...t,...n])}transition(e){for(const t of e){const n=this.listeners.get(t);if(n)for(const r of n)r()}}},Nr=h.createContext(void 0);function US(){return(0,h.useContext)(Nr)}var QC=({client:e,children:t})=>h.createElement(Nr.Provider,{value:e},t);function GC(e,...t){const n=t[0]==="skip",r=t[0]==="skip"?{}:Fe(t[0]),i=typeof e=="string"?hs(e):e,o=oe(i),s=(0,h.useMemo)(()=>n?{}:{query:{query:i,args:r}},[JSON.stringify(ke(r)),o,n]),a=QS(s).query;if(a instanceof Error)throw a;return a}function YC(e){const t=typeof e=="string"?hs(e):e,n=(0,h.useContext)(Nr);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,h.useMemo)(()=>rd(t,n),[n,oe(t)])}function XC(e){const t=(0,h.useContext)(Nr),n=typeof e=="string"?hs(e):e;if(t===void 0)throw new Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,h.useMemo)(()=>qS(n,t),[t,oe(n)])}function WS(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var HS=Object.defineProperty,zS=(e,t,n)=>t in e?HS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t,n)=>zS(e,typeof t!="symbol"?t+"":t,n),KS=class{constructor(e){vi(this,"createWatch"),vi(this,"queries"),vi(this,"listeners"),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(const t of Object.keys(e)){const{query:n,args:r,paginationOptions:i}=e[t];if(oe(n),this.queries[t]===void 0)this.addQuery(t,n,r,i?{paginationOptions:i}:{});else{const o=this.queries[t];(oe(n)!==oe(o.query)||JSON.stringify(ke(r))!==JSON.stringify(ke(o.args))||JSON.stringify(i)!==JSON.stringify(o.paginationOptions))&&(this.removeQuery(t),this.addQuery(t,n,r,i?{paginationOptions:i}:{}))}}for(const t of Object.keys(this.queries))e[t]===void 0&&this.removeQuery(t)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){const t={};for(const n of Object.keys(e)){const{query:r,args:i}=e[n],o=e[n].paginationOptions;oe(r);const s=this.createWatch(r,i,o?{paginationOptions:o}:{});let a;try{a=s.localQueryResult()}catch(c){if(c instanceof Error)a=c;else throw c}t[n]=a}return t}setCreateWatch(e){this.createWatch=e;for(const t of Object.keys(this.queries)){const{query:n,args:r,watch:i,paginationOptions:o}=this.queries[t],s="journal"in i?i.journal():void 0;this.removeQuery(t),this.addQuery(t,n,r,{...s?{journal:s}:[],...o?{paginationOptions:o}:{}})}}destroy(){for(const e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,t,n,{paginationOptions:r,journal:i}){if(this.queries[e]!==void 0)throw new Error(`Tried to add a new query with identifier ${e} when it already exists.`);const o=this.createWatch(t,n,{...i?{journal:i}:[],...r?{paginationOptions:r}:{}}),s=o.onUpdate(()=>this.notifyListeners());this.queries[e]={query:t,args:n,watch:o,unsubscribe:s,...r?{paginationOptions:r}:{}}}removeQuery(e){const t=this.queries[e];if(t===void 0)throw new Error(`No query found with identifier ${e}.`);t.unsubscribe(),delete this.queries[e]}notifyListeners(){for(const e of this.listeners)e()}};function QS(e){const t=US();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return GS(e,(0,h.useMemo)(()=>(n,r,{journal:i,paginationOptions:o})=>o?t.watchPaginatedQuery(n,r,o):t.watchQuery(n,r,i?{journal:i}:{}),[t]))}function GS(e,t){const[n]=(0,h.useState)(()=>new KS(t));n.createWatch!==t&&n.setCreateWatch(t),(0,h.useEffect)(()=>()=>n.destroy(),[n]);const r=(0,h.useMemo)(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:i=>(n.setQueries(e),n.subscribe(i))}),[n,e]);return NS(r)}var ZC=class extends h.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.isExpected(e)?console.debug("ErrorBoundary caught an expected error:",e):(console.error("ErrorBoundary caught an error:",e,t),Ad(e,t,this.props.name)),this.props.onError?.(e,t)}isExpected(e){if(!this.props.isExpectedError)return!1;try{return this.props.isExpectedError(e)===!0}catch{return!1}}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback!==void 0?typeof this.props.fallback=="function"?this.props.fallback({error:this.state.error,reset:this.handleReset}):this.props.fallback:(0,S.jsx)("div",{className:"flex items-center justify-center min-h-[400px] p-6",children:(0,S.jsxs)("div",{className:"text-center max-w-md",children:[(0,S.jsx)(kv,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),(0,S.jsx)("h2",{className:"text-xl font-semibold mb-2",children:"Something went wrong"}),(0,S.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred"}),(0,S.jsx)(yd,{onClick:this.handleReset,variant:"outline",children:"Try again"})]})}):this.props.children}};function yi(e){return e.trim().toLowerCase()}function YS(e,t){return e.createdAt-t.createdAt||e.hostId.localeCompare(t.hostId)}function JC(e){const t=new Map,n=new Map;for(const o of e){const s=o.name.trim()||"Client",a=yi(s);n.set(a,n.get(a)??s);const c=t.get(a)??[];c.push(o),t.set(a,c)}const r=new Set(n.keys()),i=new Map;for(const o of t.values()){const s=[...o].sort(YS),a=s[0]?.name.trim()||"Client";let c=2;s.forEach((u,l)=>{if(l===0){i.set(u.hostId,a);return}let f=`${a} #${c}`;for(;r.has(yi(f));)c+=1,f=`${a} #${c}`;r.add(yi(f)),i.set(u.hostId,f),c+=1})}return i}function eT(e){return e.displayName??e.name}function tT({...e}){return(0,S.jsx)(Qg,{"data-slot":"dropdown-menu",...e})}function nT({...e}){return(0,S.jsx)(Gg,{"data-slot":"dropdown-menu-trigger",...e})}function rT({className:e,sideOffset:t=4,...n}){return(0,S.jsx)(Yg,{children:(0,S.jsx)(Xg,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function iT({className:e,inset:t,variant:n="default",...r}){return(0,S.jsx)(Jg,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Me("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function oT({className:e,children:t,checked:n,...r}){return(0,S.jsxs)(ev,{"data-slot":"dropdown-menu-checkbox-item",className:Me("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[(0,S.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,S.jsx)(Qu,{children:(0,S.jsx)(Av,{className:"size-4"})})}),t]})}function sT({...e}){return(0,S.jsx)(tv,{"data-slot":"dropdown-menu-radio-group",...e})}function aT({className:e,children:t,hideIndicator:n=!1,...r}){return(0,S.jsxs)(nv,{"data-slot":"dropdown-menu-radio-item",className:Me("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n?"pl-2":"pl-8",e),...r,children:[n?null:(0,S.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,S.jsx)(Qu,{children:(0,S.jsx)(Cd,{className:"size-2 fill-current"})})}),t]})}function cT({className:e,inset:t,...n}){return(0,S.jsx)(Zg,{"data-slot":"dropdown-menu-label","data-inset":t,className:Me("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function uT({className:e,...t}){return(0,S.jsx)(rv,{"data-slot":"dropdown-menu-separator",className:Me("bg-border -mx-1 my-1 h-px",e),...t})}function lT({...e}){return(0,S.jsx)(iv,{"data-slot":"dropdown-menu-sub",...e})}function fT({className:e,inset:t,children:n,...r}){return(0,S.jsxs)(ov,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:Me("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,(0,S.jsx)(Mv,{className:"ml-auto size-4"})]})}function dT({className:e,...t}){return(0,S.jsx)(sv,{"data-slot":"dropdown-menu-sub-content",className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function XS({delayDuration:e=0,...t}){return(0,S.jsx)(Sv,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ZS({...e}){return(0,S.jsx)(XS,{children:(0,S.jsx)(Cv,{"data-slot":"tooltip",...e})})}function JS({...e}){return(0,S.jsx)(Tv,{"data-slot":"tooltip-trigger",...e})}var id="rounded-md px-3 py-1.5 text-xs",od="bg-primary text-primary-foreground",sd="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",hT=`${id} ${od}`,eC=`${sd} bg-primary fill-primary`;function tC({className:e,sideOffset:t=0,children:n,variant:r="default",...i}){const o=r==="muted";return(0,S.jsx)(Pv,{children:(0,S.jsxs)(Rv,{"data-slot":"tooltip-content",sideOffset:t,className:Me("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",id,o?"border border-border bg-popover text-popover-foreground shadow-md":od,e),...i,children:[n,(0,S.jsx)(Ev,{className:o?Me(sd,"fill-popover"):eC})]})})}function pT({reason:e,fallback:t,children:n,...r}){const i=e||t;return i?(0,S.jsxs)(ZS,{children:[(0,S.jsx)(JS,{asChild:!0,children:e?(0,S.jsx)("span",{className:"inline-flex rounded-md outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px]",tabIndex:0,children:n}):n}),(0,S.jsx)(tC,{...r,children:i})]}):n}var nC=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var rC=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})};var $n,vc="__POSTHOG_REACT_SHARED_STATE__",yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},gn;try{gn=yc[vc]=yc[vc]||new WeakMap}catch{gn=new WeakMap}gn.has(h.createContext)||gn.set(h.createContext,{});var dt=gn.get(h.createContext),co;function iC(e){(!dt.defaultPostHogInstance||dt.defaultPostHogInstance===co)&&(dt.defaultPostHogInstance=e),co=e}function uo(){return co}dt.context||(dt.context=(0,h.createContext)({get client(){return uo()||dt.defaultPostHogInstance},bootstrap:void 0}));var zt=dt.context;function ad(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,s=r;o<s.length;o++){var a=s[o];if(!i.includes(a)||!ad(e[a],t[a],n))return!1}return!0}function mT(e){var t,n,r=e.children,i=e.client,o=e.apiKey,s=e.options,a=(0,h.useRef)(null),c=(0,h.useMemo)(function(){if(i)return o&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),s&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),i;var u=uo();return o||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),u},[i,o,JSON.stringify(s)]);return(0,h.useEffect)(function(){if(!(i||!o)){var u=uo(),l=a.current;l?(o!==l.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),s&&!ad(s,l.options)&&u.set_config(s),a.current={apiKey:o,options:s??{}}):(u.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),u.init(o,s),a.current={apiKey:o,options:s??{}})}},[i,o,JSON.stringify(s)]),h.createElement(zt.Provider,{value:{client:c,bootstrap:(t=s?.bootstrap)!==null&&t!==void 0?t:(n=i?.config)===null||n===void 0?void 0:n.bootstrap}},r)}var wi=function(e){return typeof e=="function"},lo=function(e){return e===void 0};function oC(e,t){var n,r,i=(0,h.useContext)(zt),o=i.client,s=i.bootstrap,a=(0,h.useState)(function(){return o.isFeatureEnabled(e)}),c=a[0],u=a[1];(0,h.useEffect)(function(){return o.onFeatureFlags(function(){u(o.isFeatureEnabled(e))})},[o,e]);var l=(n=s?.featureFlags)===null||n===void 0?void 0:n[e];return!(!((r=o?.featureFlags)===null||r===void 0)&&r.hasLoadedFlags)&&s?.featureFlags?lo(l)?t:!!l:lo(c)?t:c}function gT(){var e,t=(0,h.useContext)(zt),n=t.client,r=t.bootstrap,i=(0,h.useState)(function(){return n.featureFlags.getFlags()}),o=i[0],s=i[1];return(0,h.useEffect)(function(){return n.onFeatureFlags(function(a){s(a)})},[n]),!(!((e=n?.featureFlags)===null||e===void 0)&&e.hasLoadedFlags)&&r?.featureFlags?Object.entries(r.featureFlags).filter(function(a){return a[1]}).map(function(a){return a[0]}):o}function sC(e){var t,n=(0,h.useContext)(zt),r=n.client,i=n.bootstrap,o=(0,h.useState)(function(){return r.getFeatureFlag(e)}),s=o[0],a=o[1];return(0,h.useEffect)(function(){return r.onFeatureFlags(function(){a(r.getFeatureFlag(e))})},[r,e]),!(!((t=r?.featureFlags)===null||t===void 0)&&t.hasLoadedFlags)&&i?.featureFlags?i.featureFlags[e]:s}var vT=function(){return(0,h.useContext)(zt).client},er=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||t==="[object Error]"||t==="[object Exception]"||t==="[object DOMException]"||t==="[object DOMError]"},aC=function(e,t){try{Object.defineProperty(e,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}},cC=function(e,t){for(var n=new WeakSet,r=e;!n.has(r);){if(n.add(r),!er(r.cause)){lo(r.cause)||(t.cause=r.cause),r.cause=t;return}r=r.cause}},uC=function(e,t){if(!t)return e;var n=new Error(er(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return aC(n,"React ErrorBoundary ".concat(er(e)?e.name:"Error")),n.stack=t,er(e)?(cC(e,n),e):n},wc={componentStack:null,exceptionEvent:null,error:null},lC={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},yT=($n=(function(e){nC(t,e);function t(n){var r=e.call(this,n)||this;return r._resetError=function(){r.setState(wc)},r.state=wc,r}return t.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,o;wi(i)?o=i(n,r):typeof i=="object"&&(o=i);var s=this.context.client,a=r.componentStack,c=s.captureException(uC(n,a),o);this.setState({error:n,componentStack:a??null,exceptionEvent:c})},t.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,o=this.state;if(o.componentStack==null)return wi(r)?r():r;var s=wi(i)?h.createElement(i,{error:o.error,componentStack:o.componentStack,exceptionEvent:o.exceptionEvent,resetError:this._resetError}):i;return h.isValidElement(s)?s:(console.warn(lC.INVALID_FALLBACK),h.createElement(h.Fragment,null))},t})(h.Component),rC($n,"PostHogErrorBoundary"),(function(){$n.contextType=zt})(),$n);iC(ho);function wT(e){return oC(e)}function bT(e){return sC(e)}function xT(e,t){return ho.isFeatureEnabled(e,t)}export{UC as $,QS as A,Mo as At,WC as B,xe as Bt,dT as C,Av as Ct,JC as D,wu as Dt,eT as E,Ru as Et,YC as F,So as Ft,Hf as G,me as Gt,Ex as H,ht as Ht,GC as I,zc as It,NC as J,Je as Jt,DC as K,L as Kt,oe as L,uh as Lt,KC as M,nu as Mt,XC as N,Jh as Nt,YS as O,xm as Ot,US as P,eu as Pt,$C as Q,hs as R,Fc as Rt,lT as S,xC as St,nT as T,Lm as Tt,MC as U,Bt as Ut,AC as V,yo as Vt,kC as W,yn as Wt,Ix as X,ne as Xt,qC as Y,_d as Yt,_x as Z,iT as _,ul as _t,gT as a,VC as at,aT as b,SC as bt,ZS as c,EC as ct,JS as d,Of as dt,jC as et,eC as f,Uw as ft,rT as g,Dv as gt,oT as h,$s as ht,mT as i,OC as it,QC as j,Tr as jt,ZC as k,bu as kt,tC as l,RC as lt,tT as m,Dr as mt,wT as n,FC as nt,vT as o,_C as ot,hT as p,q as pt,Lx as q,go as qt,bT as r,LC as rt,pT as s,IC as st,xT as t,BC as tt,XS as u,y0 as ut,cT as v,kv as vt,fT as w,Vm as wt,uT as x,Mv as xt,sT as y,CC as yt,HC as z,sh as zt};
|
|
43
43
|
|
|
44
|
-
//# sourceMappingURL=feature-flags-
|
|
44
|
+
//# sourceMappingURL=feature-flags-9Kzm95Iy.js.map
|