tokentracker-cli 0.26.3 → 0.26.5

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.
Files changed (39) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-BQmAWAi7.js → ActivityHeatmap-B4vj90T6.js} +1 -1
  2. package/dashboard/dist/assets/{Card-Cq6JCZM2.js → Card-C6hMMI_4.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-CUt6YnjQ.js → DashboardPage-DJcrfsmC.js} +1 -1
  4. package/dashboard/dist/assets/{DevicePage-BwZwER8Q.js → DevicePage-D0v5ldVS.js} +1 -1
  5. package/dashboard/dist/assets/{DialogTitle-wuIq7mbf.js → DialogTitle-c_QAGVA6.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-CEOcEh_z.js → FadeIn-B9CRmzqf.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-BRQgDG4V.js → HeaderGithubStar-CNgvRCUc.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-BrOzm4SC.js → IpCheckPage-BV2SZxBg.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-vqu0eDLZ.js → LandingPage-Bk3xCXel.js} +1 -1
  10. package/dashboard/dist/assets/{LeaderboardAvatar-Am5bi8es.js → LeaderboardAvatar-kZAxtPgR.js} +1 -1
  11. package/dashboard/dist/assets/{LeaderboardPage-Bi-245fM.js → LeaderboardPage-CoONwoqy.js} +3 -3
  12. package/dashboard/dist/assets/{LeaderboardProfileModal-C8LQXrnF.js → LeaderboardProfileModal-CntlcMb5.js} +1 -1
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-31yIarGc.js → LeaderboardProfilePage-BPEbL1AU.js} +1 -1
  14. package/dashboard/dist/assets/{LimitsPage-h3rjkQlR.js → LimitsPage-hVKBqUjr.js} +1 -1
  15. package/dashboard/dist/assets/{LocalOnlyNotice-CebJL6tE.js → LocalOnlyNotice-rmwpfmHR.js} +1 -1
  16. package/dashboard/dist/assets/{LoginPage-sRWAttYf.js → LoginPage-BpduG_WF.js} +1 -1
  17. package/dashboard/dist/assets/{PopoverPopup-D5KBjI3r.js → PopoverPopup-Dbv8XdJH.js} +1 -1
  18. package/dashboard/dist/assets/{ProviderIcon-CSMEjb0n.js → ProviderIcon-DSkT5k6O.js} +1 -1
  19. package/dashboard/dist/assets/{SettingsPage-B9x5wKaH.js → SettingsPage-Wx9gFT4s.js} +1 -1
  20. package/dashboard/dist/assets/{SkillsPage-Cl76d9F3.js → SkillsPage-C1mG0Yg0.js} +1 -1
  21. package/dashboard/dist/assets/{WidgetsPage-CfgHQjCv.js → WidgetsPage-CcV2p0y8.js} +1 -1
  22. package/dashboard/dist/assets/{WrappedPage--2jUGICx.js → WrappedPage-JMG44YOJ.js} +1 -1
  23. package/dashboard/dist/assets/{arrow-up-right-ru062Kz1.js → arrow-up-right-Cyexf2d_.js} +1 -1
  24. package/dashboard/dist/assets/check-Ctq0msxB.js +1 -0
  25. package/dashboard/dist/assets/{chevron-down-Czb08wHc.js → chevron-down-Ca1Vw8XB.js} +1 -1
  26. package/dashboard/dist/assets/{download-_X5qj-Bp.js → download-Du66ZCdA.js} +1 -1
  27. package/dashboard/dist/assets/{info-DBw8ck72.js → info-FuzeQ_-E.js} +1 -1
  28. package/dashboard/dist/assets/{main-CYNmFfGa.js → main-D6Cw0vCf.js} +2 -2
  29. package/dashboard/dist/assets/{use-limits-display-prefs-DDOdet4v.js → use-limits-display-prefs-DiZDjG-W.js} +1 -1
  30. package/dashboard/dist/assets/{use-native-settings-Bz5dJHlV.js → use-native-settings-BJEB_imh.js} +1 -1
  31. package/dashboard/dist/assets/{use-reduced-motion-7VZbLGR1.js → use-reduced-motion-B3DdtuWo.js} +1 -1
  32. package/dashboard/dist/assets/{use-usage-limits-CW7MLh5g.js → use-usage-limits-q5qxlmRD.js} +1 -1
  33. package/dashboard/dist/assets/{useCurrency-BF2b0rl-.js → useCurrency-C0DVD_kj.js} +1 -1
  34. package/dashboard/dist/index.html +1 -1
  35. package/dashboard/dist/share.html +1 -1
  36. package/package.json +1 -1
  37. package/src/commands/sync.js +16 -6
  38. package/src/lib/pricing/seed-snapshot.json +1 -1
  39. package/dashboard/dist/assets/check-CG2_3azC.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CUt6YnjQ.js","assets/use-usage-limits-CW7MLh5g.js","assets/useCurrency-BF2b0rl-.js","assets/ActivityHeatmap-BQmAWAi7.js","assets/info-DBw8ck72.js","assets/DialogTitle-wuIq7mbf.js","assets/PopoverPopup-D5KBjI3r.js","assets/Card-Cq6JCZM2.js","assets/use-reduced-motion-7VZbLGR1.js","assets/ProviderIcon-CSMEjb0n.js","assets/FadeIn-CEOcEh_z.js","assets/LandingPage-vqu0eDLZ.js","assets/HeaderGithubStar-BRQgDG4V.js","assets/LeaderboardPage-Bi-245fM.js","assets/LeaderboardAvatar-Am5bi8es.js","assets/chevron-down-Czb08wHc.js","assets/LeaderboardProfilePage-31yIarGc.js","assets/LeaderboardProfileModal-C8LQXrnF.js","assets/arrow-up-right-ru062Kz1.js","assets/LimitsPage-h3rjkQlR.js","assets/use-limits-display-prefs-DDOdet4v.js","assets/LocalOnlyNotice-CebJL6tE.js","assets/download-_X5qj-Bp.js","assets/SettingsPage-B9x5wKaH.js","assets/use-native-settings-Bz5dJHlV.js","assets/check-CG2_3azC.js","assets/SkillsPage-Cl76d9F3.js","assets/WidgetsPage-CfgHQjCv.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DJcrfsmC.js","assets/use-usage-limits-q5qxlmRD.js","assets/useCurrency-C0DVD_kj.js","assets/ActivityHeatmap-B4vj90T6.js","assets/info-FuzeQ_-E.js","assets/DialogTitle-c_QAGVA6.js","assets/PopoverPopup-Dbv8XdJH.js","assets/Card-C6hMMI_4.js","assets/use-reduced-motion-B3DdtuWo.js","assets/ProviderIcon-DSkT5k6O.js","assets/FadeIn-B9CRmzqf.js","assets/LandingPage-Bk3xCXel.js","assets/HeaderGithubStar-CNgvRCUc.js","assets/LeaderboardPage-CoONwoqy.js","assets/LeaderboardAvatar-kZAxtPgR.js","assets/chevron-down-Ca1Vw8XB.js","assets/LeaderboardProfilePage-BPEbL1AU.js","assets/LeaderboardProfileModal-CntlcMb5.js","assets/arrow-up-right-Cyexf2d_.js","assets/LimitsPage-hVKBqUjr.js","assets/use-limits-display-prefs-DiZDjG-W.js","assets/LocalOnlyNotice-rmwpfmHR.js","assets/download-Du66ZCdA.js","assets/SettingsPage-Wx9gFT4s.js","assets/use-native-settings-BJEB_imh.js","assets/check-Ctq0msxB.js","assets/SkillsPage-C1mG0Yg0.js","assets/WidgetsPage-CcV2p0y8.js"])))=>i.map(i=>d[i]);
2
2
  function xS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function PS(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var gh={exports:{}},cs={},yh={exports:{}},Ze={};var jy;function SS(){if(jy)return Ze;jy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function S(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}S.prototype.isReactComponent={},S.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=S.prototype;function L(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}var R=L.prototype=new D;R.constructor=L,x(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray,G=Object.prototype.hasOwnProperty,W={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function P(I,q,xe){var Re,Pe={},Te=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Te=""+q.key),q)G.call(q,Re)&&!z.hasOwnProperty(Re)&&(Pe[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Pe.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Pe.children=Ue}if(I&&I.defaultProps)for(Re in Qe=I.defaultProps,Qe)Pe[Re]===void 0&&(Pe[Re]=Qe[Re]);return{$$typeof:e,type:I,key:Te,ref:Ge,props:Pe,_owner:W.current}}function Y(I,q){return{$$typeof:e,type:I.type,key:q,ref:I.ref,props:I.props,_owner:I._owner}}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ue(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(xe){return q[xe]})}var se=/\/+/g;function Ae(I,q){return typeof I=="object"&&I!==null&&I.key!=null?ue(""+I.key):q.toString(36)}function fe(I,q,xe,Re,Pe){var Te=typeof I;(Te==="undefined"||Te==="boolean")&&(I=null);var Ge=!1;if(I===null)Ge=!0;else switch(Te){case"string":case"number":Ge=!0;break;case"object":switch(I.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=I,Pe=Pe(Ge),I=Re===""?"."+Ae(Ge,0):Re,O(Pe)?(xe="",I!=null&&(xe=I.replace(se,"$&/")+"/"),fe(Pe,q,xe,"",function(jt){return jt})):Pe!=null&&(X(Pe)&&(Pe=Y(Pe,xe+(!Pe.key||Ge&&Ge.key===Pe.key?"":(""+Pe.key).replace(se,"$&/")+"/")+I)),q.push(Pe)),1;if(Ge=0,Re=Re===""?".":Re+":",O(I))for(var Qe=0;Qe<I.length;Qe++){Te=I[Qe];var Ue=Re+Ae(Te,Qe);Ge+=fe(Te,q,xe,Ue,Pe)}else if(Ue=k(I),typeof Ue=="function")for(I=Ue.call(I),Qe=0;!(Te=I.next()).done;)Te=Te.value,Ue=Re+Ae(Te,Qe++),Ge+=fe(Te,q,xe,Ue,Pe);else if(Te==="object")throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function le(I,q,xe){if(I==null)return I;var Re=[],Pe=0;return fe(I,Re,"","",function(Te){return q.call(xe,Te,Pe++)}),Re}function pe(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(xe){(I._status===0||I._status===-1)&&(I._status=1,I._result=xe)},function(xe){(I._status===0||I._status===-1)&&(I._status=2,I._result=xe)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Ne={current:null},K={transition:null},Z={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:W};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:le,forEach:function(I,q,xe){le(I,function(){q.apply(this,arguments)},xe)},count:function(I){var q=0;return le(I,function(){q++}),q},toArray:function(I){return le(I,function(q){return q})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=S,Ze.Fragment=n,Ze.Profiler=o,Ze.PureComponent=L,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ze.act=H,Ze.cloneElement=function(I,q,xe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var Re=x({},I.props),Pe=I.key,Te=I.ref,Ge=I._owner;if(q!=null){if(q.ref!==void 0&&(Te=q.ref,Ge=W.current),q.key!==void 0&&(Pe=""+q.key),I.type&&I.type.defaultProps)var Qe=I.type.defaultProps;for(Ue in q)G.call(q,Ue)&&!z.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:I.type,key:Pe,ref:Te,props:Re,_owner:Ge}},Ze.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},Ze.createElement=P,Ze.createFactory=function(I){var q=P.bind(null,I);return q.type=I,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:u,render:I}},Ze.isValidElement=X,Ze.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:pe}},Ze.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},Ze.startTransition=function(I){var q=K.transition;K.transition={};try{I()}finally{K.transition=q}},Ze.unstable_act=H,Ze.useCallback=function(I,q){return Ne.current.useCallback(I,q)},Ze.useContext=function(I){return Ne.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return Ne.current.useDeferredValue(I)},Ze.useEffect=function(I,q){return Ne.current.useEffect(I,q)},Ze.useId=function(){return Ne.current.useId()},Ze.useImperativeHandle=function(I,q,xe){return Ne.current.useImperativeHandle(I,q,xe)},Ze.useInsertionEffect=function(I,q){return Ne.current.useInsertionEffect(I,q)},Ze.useLayoutEffect=function(I,q){return Ne.current.useLayoutEffect(I,q)},Ze.useMemo=function(I,q){return Ne.current.useMemo(I,q)},Ze.useReducer=function(I,q,xe){return Ne.current.useReducer(I,q,xe)},Ze.useRef=function(I){return Ne.current.useRef(I)},Ze.useState=function(I){return Ne.current.useState(I)},Ze.useSyncExternalStore=function(I,q,xe){return Ne.current.useSyncExternalStore(I,q,xe)},Ze.useTransition=function(){return Ne.current.useTransition()},Ze.version="18.3.1",Ze}var Uy;function Qf(){return Uy||(Uy=1,yh.exports=SS()),yh.exports}var By;function CS(){if(By)return cs;By=1;var e=Qf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},k=null,w=null;f!==void 0&&(k=""+f),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!s.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:k,ref:w,props:y,_owner:o.current}}return cs.Fragment=n,cs.jsx=c,cs.jsxs=c,cs}var Fy;function TS(){return Fy||(Fy=1,gh.exports=CS()),gh.exports}var N=TS(),b=Qf();const Rs=L_(b),ES=xS({__proto__:null,default:Rs},[b]);var uc={},vh={exports:{}},yn={},kh={exports:{}},_h={};var Vy;function AS(){return Vy||(Vy=1,(function(e){function t(K,Z){var H=K.length;K.push(Z);e:for(;0<H;){var I=H-1>>>1,q=K[I];if(0<o(q,Z))K[I]=Z,K[H]=q,H=I;else break e}}function n(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var Z=K[0],H=K.pop();if(H!==Z){K[0]=H;e:for(var I=0,q=K.length,xe=q>>>1;I<xe;){var Re=2*(I+1)-1,Pe=K[Re],Te=Re+1,Ge=K[Te];if(0>o(Pe,H))Te<q&&0>o(Ge,Pe)?(K[I]=Ge,K[Te]=H,I=Te):(K[I]=Pe,K[Re]=H,I=Re);else if(Te<q&&0>o(Ge,H))K[I]=Ge,K[Te]=H,I=Te;else break e}}return Z}function o(K,Z){var H=K.sortIndex-Z.sortIndex;return H!==0?H:K.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,k=3,w=!1,x=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(K){for(var Z=n(f);Z!==null;){if(Z.callback===null)a(f);else if(Z.startTime<=K)a(f),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(f)}}function O(K){if(C=!1,R(K),!x)if(n(h)!==null)x=!0,pe(G);else{var Z=n(f);Z!==null&&Ne(O,Z.startTime-K)}}function G(K,Z){x=!1,C&&(C=!1,D(P),P=-1),w=!0;var H=k;try{for(R(Z),y=n(h);y!==null&&(!(y.expirationTime>Z)||K&&!ue());){var I=y.callback;if(typeof I=="function"){y.callback=null,k=y.priorityLevel;var q=I(y.expirationTime<=Z);Z=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),R(Z)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Ne(O,Re.startTime-Z),xe=!1}return xe}finally{y=null,k=H,w=!1}}var W=!1,z=null,P=-1,Y=5,X=-1;function ue(){return!(e.unstable_now()-X<Y)}function se(){if(z!==null){var K=e.unstable_now();X=K;var Z=!0;try{Z=z(!0,K)}finally{Z?Ae():(W=!1,z=null)}}else W=!1}var Ae;if(typeof L=="function")Ae=function(){L(se)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,le=fe.port2;fe.port1.onmessage=se,Ae=function(){le.postMessage(null)}}else Ae=function(){S(se,0)};function pe(K){z=K,W||(W=!0,Ae())}function Ne(K,Z){P=S(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,pe(G))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(K){switch(k){case 1:case 2:case 3:var Z=3;break;default:Z=k}var H=k;k=Z;try{return K()}finally{k=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var H=k;k=K;try{return Z()}finally{k=H}},e.unstable_scheduleCallback=function(K,Z,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,K){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,K={id:m++,callback:Z,priorityLevel:K,startTime:H,expirationTime:q,sortIndex:-1},H>I?(K.sortIndex=H,t(f,K),n(h)===null&&K===n(f)&&(C?(D(P),P=-1):C=!0,Ne(O,H-I))):(K.sortIndex=q,t(h,K),x||w||(x=!0,pe(G))),K},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(K){var Z=k;return function(){var H=k;k=Z;try{return K.apply(this,arguments)}finally{k=H}}}})(_h)),_h}var zy;function RS(){return zy||(zy=1,kh.exports=AS()),kh.exports}var $y;function LS(){if($y)return yn;$y=1;var e=Qf(),t=RS();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function s(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(o[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function k(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function C(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];S[i]=new C(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function R(r,i,l,d){var p=S.hasOwnProperty(i)?S[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,l,p,d)&&(l=null),d||p===null?k(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),W=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),ue=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Object.assign,I;function q(r){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
3
3
  `+I+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch($){var d=$}Reflect.construct(r,[],i)}else{try{i.call()}catch($){d=$}r.call(i.prototype)}else{try{throw Error()}catch($){d=$}r()}}catch($){if($&&d&&typeof $.stack=="string"){for(var p=$.stack.split(`
4
4
  `),g=d.stack.split(`
@@ -842,4 +842,4 @@ local_only.download,dashboard,LocalOnlyNotice,LocalOnlyNotice,download,"Get the
842
842
  ${L}px !important;
843
843
  ${R}px !important;
844
844
  }
845
- `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(O)&&G.removeChild(O)}},[t]),N.jsx(aO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:y})})}const oO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(sO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const C of m.values())if(!C)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&k&&(w={...w}),b.useMemo(()=>{m.forEach((x,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(iO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function sO(){return new Map}function dx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const c=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,c]:[!0]}const _c=e=>e.key||"";function s_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const lO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=dx(c),k=b.useMemo(()=>s_(e),[e]),w=c&&!m?[]:k.map(_c),x=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,G]=b.useState(k);U0(()=>{x.current=!1,C.current=k;for(let P=0;P<O.length;P++){const Y=_c(O[P]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const W=[];if(k!==L){let P=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],ue=_c(X);w.includes(ue)||(P.splice(Y,0,X),W.push(X))}return s==="wait"&&W.length&&(P=W),G(s_(P)),R(k),null}const{forceRender:z}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(P=>{const Y=_c(P),X=c&&!m?!1:k===O||w.includes(Y),ue=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let se=!0;S.forEach(Ae=>{Ae||(se=!1)}),se&&(z?.(),G(C.current),c&&y?.(),a&&a())};return N.jsx(oO,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:X?void 0:ue,anchorX:u,anchorY:h,children:P},Y)})})},hx=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function cO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};Vw(e),c_=!0}function fx(){return cO(),KI()}function uO(e){const t=fx();for(const n in e)t[n]={...t[n],...e[n]};Vw(t)}const dO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dO.has(e)}let px=e=>!vu(e);function hO(e){typeof e=="function"&&(px=t=>t.startsWith("on")?!vu(t):e(t))}try{hO(require("@emotion/is-prop-valid").default)}catch{}function fO(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Gt(e[o])||(px(o)||n===!0&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const Nu=b.createContext({});function pO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Bs(n)?n:void 0,animate:Bs(a)?a:void 0}}return e.inherit!==!1?t:{}}function mO(e){const{initial:t,animate:n}=pO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mx(e,t,n){for(const a in t)!Gt(t[a])&&!qw(a,n)&&(e[a]=t[a])}function gO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return om(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yO(e,t){const n=e.style||{},a={};return mx(a,n,e),Object.assign(a,gO(e,t)),a}function vO(e,t){const n={},a=yO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.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=a,n}const gx=()=>({...cm(),attrs:{}});function kO(e,t,n,a){const o=b.useMemo(()=>{const s=gx();return Yw(s,t,Xw(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mx(s,e.style,e),o.style={...s,...o.style}}return o}const _O=["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 um(e){return typeof e!="string"||e.includes("-")?!1:!!(_O.indexOf(e)>-1||/[A-Z]/u.test(e))}function bO(e,t,n,{latestValues:a},o,s=!1,c){const h=(c??um(e)?kO:vO)(t,a,o,e),f=fO(t,typeof e=="string",s),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function wO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:xO(n,a,o,e),renderState:t()}}function xO(e,t,n,a){const o={},s=a(e,{});for(const k in s)o[k]=Hc(s[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=Bw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const x=Qp(e,k[w]);if(x){const{transitionEnd:C,transition:S,...D}=x;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(o[L]=R)}for(const L in C)o[L]=C[L]}}}return o}const yx=e=>(t,n)=>{const a=b.useContext(Nu),o=b.useContext(Lu),s=()=>wO(e,t,a,o);return n?s():jp(s)},PO=yx({scrapeMotionValuesFromProps:sm,createRenderState:cm}),SO=yx({scrapeMotionValuesFromProps:Qw,createRenderState:gx}),CO=Symbol.for("motionComponentSymbol");function TO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const o=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s);const c=a.current;if(typeof c=="function")if(s){const u=c(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):c(s);else c&&(c.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const vx=b.createContext({});function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EO(e,t,n,a,o,s){const{visualElement:c}=b.useContext(Nu),u=b.useContext(hx),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const x=k.current,C=b.useContext(vx);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&AO(k.current,n,o,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{x&&S.current&&x.update(n,h)});const D=n[Cw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return U0(()=>{w.current=!0,x&&(S.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),L.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!L.current&&x.animationState&&x.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),x.enteringChildren=void 0)}),x}function AO(e,t,n,a){const{layoutId:o,layout:s,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kx(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!c||u&&to(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function kx(e){if(e)return e.options.allowProjection!==!1?e.projection:kx(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&uO(a);const s=n?n==="svg":um(e),c=s?SO:PO;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:RO(f)},{isStatic:w}=k,x=mO(f),C=c(f,w);if(!w&&typeof window<"u"){LO();const S=DO(k);y=S.MeasureLayout,x.visualElement=EO(e,C,k,o,S.ProjectionNode,s)}return N.jsxs(Nu.Provider,{value:x,children:[y&&x.visualElement?N.jsx(y,{visualElement:x.visualElement,...k}):null,bO(e,f,TO(C,x.visualElement,m),C,w,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[CO]=e,h}function RO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function LO(e,t){b.useContext(hx).strict}function DO(e){const t=fx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(s,c)=>Yh(s,c,e,t),o=(s,c)=>a(s,c);return new Proxy(o,{get:(s,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const IO=(e,t)=>t.isSVG??um(e)?new cN(t):new rN(t,{allowProjection:e!==b.Fragment});class NO extends ja{constructor(t){super(t),t.animationState||(t.animationState=pN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let OO=0;class jO extends ja{constructor(){super(...arguments),this.id=OO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:c}=this.node.getProps();if(typeof s=="string"){const u=si(this.node,s,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UO={animation:{Feature:NO},exit:{Feature:jO}};function nl(e){return{point:{x:e.pageX,y:e.pageY}}}const BO=e=>t=>nm(t)&&e(t,nl(t));function As(e,t,n,a){return Fs(e,t,BO(n),a)}const _x=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function FO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class bx{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:c=3,element:u}={}){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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=FO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;x||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const h=nl(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Js(As(this.contextWindow,"pointermove",this.handlePointerMove),As(this.contextWindow,"pointerup",this.handlePointerUp),As(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,wx(t)),offset:f_(e,VO(t)),velocity:zO(t,.1)}}function VO(e){return e[0]}function wx(e){return e[e.length-1]}function zO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=wx(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const s=On(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const c={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function $O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(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 HO(e,{top:t,left:n,bottom:a,right:o}){return{x:p_(e.x,n,o),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function WO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function KO(e,t){let n=.5;const a=ln(e),o=ln(t);return o>a?n=js(t.min,t.max-a,e.min):a>o&&(n=js(e.min,e.max-o,t.min)),xr(0,1,n)}function GO(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}const qf=.35;function qO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const YO=new WeakMap;class ZO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(nl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:x,onDragStart:C}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(x&&this.currentDirection===null){this.currentDirection=QO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new bx(t,{onSessionStart:s,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:_x(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=$O(c,this.constraints[t],this.elastic[t])),s.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&to(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=HO(a.layoutBox,t):this.constraints=!1,this.elastic=qO(n),o!==this.constraints&&!to(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=GO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XI(a,o.root,this.visualElement.getTransformPagePoint());let c=WO(o.layout.layoutBox,s);if(n){const u=n(qI(c));this.hasMutatedConstraints=!!u,u&&(c=$w(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!wc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!wc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:u}=o.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!to(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();o[c]=KO({min:h,max:h},this.constraints[c])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;YO.set(this.visualElement,this);const t=this.visualElement.current,n=As(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&EI(k);m&&y&&!w&&this.start(f)});let a;const o=()=>{const{dragConstraints:f}=this.getProps();to(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=XO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,c=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),dt.read(o);const u=Fs(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function XO(e,t,n){const a=Sk(e,v_(n)),o=Sk(t,v_(n));return()=>{a(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class JO extends ja{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new ZO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class e3 extends ja{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new bx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_x(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(s,c)=>{delete this.session,o&&dt.postRender(()=>o(s,c))}}}mount(){this.removePointerDownListener=As(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class t3 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),Qh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:c}=a;return c&&(c.isPresent=s,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?c.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;Qh=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xx(e){const[t,n]=dx(),a=b.useContext(Op);return N.jsx(t3,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(vx),isPresent:t,safeToRemove:n})}const n3={pan:{Feature:e3},drag:{Feature:JO,ProjectionNode:ux,MeasureLayout:xx}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class r3 extends ja{mount(){const{current:t}=this.node;t&&(this.unmount=PI(t,(n,a)=>(k_(this.node,a,"Start"),o=>k_(this.node,o,"End"))))}unmount(){}}class a3 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Js(Fs(this.node.current,"focus",()=>this.onFocus()),Fs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class i3 extends ja{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=RI(t,(o,s)=>(__(this.node,s,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,o3=e=>{const t=Yf.get(e.target);t&&t(e)},s3=e=>{e.forEach(o3)};function l3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(s3,{root:e,...t})),a[o]}function c3(e,t,n){const a=l3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const u3={some:0,all:1};class d3 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:u3[o]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=c3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(h3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function h3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const f3={inView:{Feature:d3},tap:{Feature:i3},focus:{Feature:a3},hover:{Feature:r3}},p3={layout:{ProjectionNode:ux,MeasureLayout:xx}},m3={...UO,...f3,...n3,...p3},ef=MO(m3,IO);function Px(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Px(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function g3(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Px(e))&&(a&&(a+=" "),a+=t);return a}const y3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},v3=(e,t)=>({classGroupId:e,validator:t}),Sx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ku="-",b_=[],k3="arbitrary..",_3=e=>{const t=w3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return b3(c);const u=c.split(ku),h=u[0]===""&&u.length>1?1:0;return Cx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?y3(f,h):h:f||b_}return n[c]||b_}}},Cx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=Cx(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(ku):e.slice(t).join(ku),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},b3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?k3+a:void 0})(),w3=e=>{const{theme:t,classGroups:n}=e;return x3(n,t)},x3=(e,t)=>{const n=Sx();for(const a in e){const o=e[a];dm(o,n,a,t)}return n},dm=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const c=e[s];P3(c,t,n,a)}},P3=(e,t,n,a)=>{if(typeof e=="string"){S3(e,t,n);return}if(typeof e=="function"){C3(e,t,n,a);return}T3(e,t,n,a)},S3=(e,t,n)=>{const a=e===""?t:Tx(t,e);a.classGroupId=n},C3=(e,t,n,a)=>{if(E3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(v3(n,e))},T3=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let c=0;c<s;c++){const[u,h]=o[c];dm(h,Tx(t,u),n,a)}},Tx=(e,t)=>{let n=e;const a=t.split(ku),o=a.length;for(let s=0;s<o;s++){const c=a[s];let u=n.nextPart.get(c);u||(u=Sx(),n.nextPart.set(c,u)),n=u}return n},E3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,A3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return o(s,c),c},set(s,c){s in n?n[s]=c:o(s,c)}}},Zf="!",w_=":",R3=[],x_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),L3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,h=0,f;const m=o.length;for(let C=0;C<m;C++){const S=o[C];if(c===0&&u===0){if(S===w_){s.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=s.length===0?o:o.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return x_(s,w,k,x)};if(t){const o=t+w_,s=a;a=c=>c.startsWith(o)?s(c.slice(o.length)):x_(R3,!1,c,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},D3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const c=n[s],u=c[0]==="[",h=t.has(c);u||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},M3=e=>({cache:A3(e.cacheSize),parseClassName:L3(e),sortModifiers:D3(e),..._3(e)}),I3=/\s+/,N3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(I3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?x.substring(0,C):x);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:s(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const G=o(D,S);for(let W=0;W<G.length;++W){const z=G[W];c.push(R+z)}h=m+(h.length>0?" "+h:h)}return h},O3=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Ex(n))&&(o&&(o+=" "),o+=a);return o},Ex=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Ex(e[a]))&&(n&&(n+=" "),n+=t);return n},j3=(e,...t)=>{let n,a,o,s;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=M3(f),a=n.cache.get,o=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=N3(h,n);return o(h,m),m};return s=c,(...h)=>s(O3(...h))},U3=[],Nt=e=>{const t=n=>n[e]||U3;return t.isThemeGetter=!0,t},Ax=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,B3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>B3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Pa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>F3.test(e),Lx=()=>!0,W3=e=>V3.test(e)&&!z3.test(e),hm=()=>!1,K3=e=>$3.test(e),G3=e=>H3.test(e),q3=e=>!ke(e)&&!be(e),Y3=e=>Ua(e,Ix,hm),ke=e=>Ax.test(e),ei=e=>Ua(e,Nx,W3),P_=e=>Ua(e,rj,qe),Z3=e=>Ua(e,jx,Lx),X3=e=>Ua(e,Ox,hm),S_=e=>Ua(e,Dx,hm),Q3=e=>Ua(e,Mx,G3),xc=e=>Ua(e,Ux,K3),be=e=>Rx.test(e),ms=e=>gi(e,Nx),J3=e=>gi(e,Ox),C_=e=>gi(e,Dx),ej=e=>gi(e,Ix),tj=e=>gi(e,Mx),Pc=e=>gi(e,Ux,!0),nj=e=>gi(e,jx,!0),Ua=(e,t,n)=>{const a=Ax.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Rx.exec(e);return a?a[1]?t(a[1]):n:!1},Dx=e=>e==="position"||e==="percentage",Mx=e=>e==="image"||e==="url",Ix=e=>e==="length"||e==="size"||e==="bg-size",Nx=e=>e==="length",rj=e=>e==="number",Ox=e=>e==="family-name",jx=e=>e==="number"||e==="weight",Ux=e=>e==="shadow",aj=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),o=Nt("tracking"),s=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),x=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...O(),be,ke],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[be,ke,h],Y=()=>[xa,"full","auto",...P()],X=()=>[Pa,"none","subgrid",be,ke],ue=()=>["auto",{span:["full",Pa,be,ke]},Pa,be,ke],se=()=>[Pa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],pe=()=>["auto",...P()],Ne=()=>[xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],K=()=>[xa,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Z=()=>[xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",ej,Y3,{size:[be,ke]}],Re=()=>[tf,ms,ei],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,ms,ei],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",x,be,ke],Hn=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[xa,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Lx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[q3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",be,ke]}],basis:[{basis:[xa,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,xa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[Pa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ue()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ue()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:pe()}],mx:[{mx:pe()}],my:[{my:pe()}],ms:[{ms:pe()}],me:[{me:pe()}],mbs:[{mbs:pe()}],mbe:[{mbe:pe()}],mt:[{mt:pe()}],mr:[{mr:pe()}],mb:[{mb:pe()}],ml:[{ml:pe()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,ms,ei]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,nj,Z3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[J3,X3,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,ei]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,be,ke],radial:["",be,ke],conic:[Pa,be,ke]},tj,Q3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,ms,ei]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Pc,xc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,xc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,ei]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,Pc,xc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,Pc,xc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,ms,ei,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ij=j3(aj);function Tt(...e){return ij(g3(e))}const oj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),sj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),lj={google:oj,github:sj},cj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function uj(e){return cj[e]||String(e||"").replace(/-/g," ")}function dj(){Qs();const{isOpen:e,closeLoginModal:t}=j0(),{enabled:n,signedIn:a,refreshUser:o,signInWithPassword:s,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Zs(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,x]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[G,W]=b.useState(null),[z,P]=b.useState(!1),[Y,X]=b.useState(!0),[ue,se]=b.useState([]),[Ae,fe]=b.useState(8);b.useEffect(()=>{e&&(O(null),W(null),m("signin"),k(""),x(""),S(""),P(!1))},[e]),b.useEffect(()=>{if(!e||!n||ue.length>0)return;let K=!0;return X(!0),(async()=>{const{data:Z,error:H}=await h();if(K){if(H||!Z)se(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];se([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&fe(Z.passwordMinLength)}X(!1)}})(),()=>{K=!1}},[e,n,h,ue.length]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const le=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),pe=b.useCallback(async K=>{O(null),L(!0);try{const{error:Z}=await u(K,le);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,le]),Ne=b.useCallback(async K=>{K.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){W(Fe("login.verify_email_pending")),m("signin");return}await o();return}const{error:Z}=await s({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await o()}finally{L(!1)}},[f,y,w,C,c,s,o]);return b.useEffect(()=>{if(!e)return;const K=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,t]),n?N.jsx(lO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:K=>K.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(I0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsxs("div",{className:"space-y-2.5",children:[N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ue.map(K=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>pe(K),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[lj[K]||null,Fe("login.oauth.continue",{provider:uj(K)})]},K))}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:K=>S(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:K=>k(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:K=>x(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>P(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx(GD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const hj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},G4="https://tokentracker.statuspage.io/";function fj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?hj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||Wr()).trim()}function q4(){return Wr()}function pj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const mj=300*1e3,gj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function yj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+gj<=t:!0}async function Bx(e,t){const n=Wr();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),o=Ks(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function vj(e){const t=Wr();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Ks(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||Wr();fm(o)&&(a.insforgeBaseUrl=o.trim());const s=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=r0();if(n&&!yj(n))return n;const a=await vj(t);return a?(BR(a),a):null}async function Fx(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}catch(a){if(!r0()||(a0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}}async function kj(e){const t=FR();if(Date.now()-t<mj)return;const n=await Fx(e);n&&(i0(Date.now()),await Bx(n,"cloud-sync-auto"))}async function Y4(e){const t=await Fx(e);t&&(i0(Date.now()),await Bx(t,"cloud-sync-now"))}function _j(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function bj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||_j(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function wj(){const e=Fn(),t=Zs(),n=b.useRef(!1);b.useEffect(()=>{if(!jR()||!bj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!UR())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await kj(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function xj(){const e=b.useContext(N0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function Pj({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Sj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function Cj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Sc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Qs();const o=t==="sidebar",{enabled:s,loading:c,signedIn:u,user:h,displayName:f}=Zs(),{openLoginModal:m}=j0(),y=wu(),k=b.useMemo(()=>Sj(h),[h]),w=b.useMemo(()=>Cj(k),[k]),[x,C]=Rs.useState(!1);if(Rs.useEffect(()=>{C(!1)},[w]),!s)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(o?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:o&&n?f:void 0,children:[o?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!x?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)})}):w&&!x?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)}),o?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function Tj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:BD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:VD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:cM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:WD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:eM,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:$D,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:aM,label:Fe("nav.settings")}]}]}function Ej(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Aj(){const[e,t]=b.useState(Ej),n=b.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,o?"1":"0")}catch{}return o})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Xf&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Rj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Lj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Dj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return N.jsxs(Pu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Mj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:o}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:o})}function Ij({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Pj({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Nj=[{value:"light",label:"Light",Icon:M0},{value:"dark",label:"Dark",Icon:D0},{value:"system",label:"System",Icon:XD}];function Oj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=b.useState(!1),c=b.useRef(null),u=t==="dark"?D0:M0;return b.useEffect(()=>{if(!o)return;const h=m=>{c.current&&!c.current.contains(m.target)&&s(!1)},f=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[o]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Nj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function Vx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=xj(),{resolvedLocale:y}=Qs(),k=b.useMemo(()=>Tj(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:o,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(I0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,x)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Lj,{label:w.label,collapsed:e,first:x===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Dj,{item:C,collapsed:e,active:Rj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(Oj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:s}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Ij,{glassChrome:s})})]})]})}function jj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(Vx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Uj({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(Vx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Bj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Mj,{title:Fe("nav.menu"),onClick:e,children:N.jsx(YD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(Pu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Fj({children:e}){const{collapsed:t,toggle:n}=Aj(),[a,o]=b.useState(!1),s=b.useCallback(()=>o(!0),[]),c=b.useCallback(()=>o(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(jj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Uj,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Bj,{onOpenDrawer:s}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const Vj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(Vj),Cc=R_.get("insforge_code")||R_.get("code")||null,zj=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function $j(){Qs();const{loading:e,signedIn:t}=Zs(),n=wu(),[a,o]=b.useState("processing"),[s,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Cc||u.current)){if(u.current=!0,zj){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Cc)return;o("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Cc)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Cc&&s===null){const f=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Hj=b.lazy(()=>$n(()=>import("./DashboardPage-CUt6YnjQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Wj=b.lazy(()=>$n(()=>import("./IpCheckPage-BrOzm4SC.js"),[])),Kj=b.lazy(()=>$n(()=>import("./LandingPage-vqu0eDLZ.js"),__vite__mapDeps([11,12,8])).then(e=>({default:e.LandingPage}))),Gj=b.lazy(()=>$n(()=>import("./LeaderboardPage-Bi-245fM.js"),__vite__mapDeps([13,9,2,14,15])).then(e=>({default:e.LeaderboardPage}))),qj=b.lazy(()=>$n(()=>import("./LeaderboardProfilePage-31yIarGc.js"),__vite__mapDeps([16,2,12,17,14,9,3,4,18,5])).then(e=>({default:e.LeaderboardProfilePage}))),Yj=b.lazy(()=>$n(()=>import("./LimitsPage-h3rjkQlR.js"),__vite__mapDeps([19,1,20,7,10,8,21,18,22])).then(e=>({default:e.LimitsPage}))),Zj=b.lazy(()=>$n(()=>import("./LoginPage-sRWAttYf.js"),[]).then(e=>({default:e.LoginPage}))),Xj=b.lazy(()=>$n(()=>import("./DevicePage-BwZwER8Q.js"),[])),Qj=b.lazy(()=>$n(()=>import("./WrappedPage--2jUGICx.js"),[])),Jj=b.lazy(()=>$n(()=>import("./SettingsPage-B9x5wKaH.js"),__vite__mapDeps([23,20,24,7,25,2,15,4,22])).then(e=>({default:e.SettingsPage}))),e4=b.lazy(()=>$n(()=>import("./SkillsPage-Cl76d9F3.js"),__vite__mapDeps([26,21,18,22,7,5,4,9,25,6,8,15])).then(e=>({default:e.SkillsPage}))),t4=b.lazy(()=>$n(()=>import("./WidgetsPage-CfgHQjCv.js"),__vite__mapDeps([27,24,7,10,8,18,22,15])).then(e=>({default:e.WidgetsPage})));function n4(){const{resolvedLocale:e}=Qs(),t=Fn(),n=Zs();wj();const a=Sn(),o=b.useMemo(()=>typeof window>"u"?!1:pj(window.location.search),[]),s=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=s.replace(/\/+$/,"")||"/",C=x==="/leaderboard",S=x.match(/^\/u\/([^/]+)$/i),D=S?S[1]:null,L=!!(n.enabled&&n.signedIn),R=w||L,O=!1,G=fj(),W=b.useMemo(()=>!n.enabled||!L?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[L,n]);let z=w||a||o?"dashboard":"landing";x==="/landing"&&(z="landing"),x==="/dashboard"&&(z="dashboard"),C&&(z="dashboard"),D&&(z="dashboard");const P=x==="/limits",Y=x==="/settings",X=x==="/skills",ue=x==="/widgets",se=x==="/ip-check";(P||Y||X||ue||se)&&(z="dashboard");let Ae=Hj;D?Ae=qj:x==="/leaderboard"?Ae=Gj:P?Ae=Yj:Y?Ae=Jj:X?Ae=e4:ue?Ae=t4:se&&(Ae=Wj);const fe=!k&&(x==="/dashboard"||x==="/"||C||P||Y||X||ue||se);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=N.jsx($j,{});else if(x==="/login")le=N.jsx(Zj,{});else if(x==="/device")le=N.jsx(Xj,{});else if(x==="/wrapped")le=N.jsx(Qj,{});else if(z==="landing")le=N.jsx(Kj,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=N.jsx(Ae,{baseUrl:G,auth:W,signedIn:R,sessionSoftExpired:O,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,userId:D,signInUrl:"/login",signUpUrl:"/login"},e);fe?le=N.jsx(Fj,{children:pe}):le=pe}return N.jsx(hM,{children:N.jsx(mM,{children:N.jsxs(gM,{children:[N.jsx(b.Suspense,{fallback:null,children:le}),N.jsx(dj,{}),N.jsx(_D,{}),N.jsx(LD,{})]})})})}const r4=W1([{path:"*",element:N.jsx(n4,{})}]);MS.createRoot(document.getElementById("root")).render(N.jsx(Rs.StrictMode,{children:N.jsx(JL,{children:N.jsx(oD,{children:N.jsx(RL,{children:N.jsx(aT,{router:r4})})})})}));export{Aa as $,g0 as A,Fe as B,N as C,ef as D,Nc as E,S4 as F,P4 as G,Ns as H,dM as I,pu as J,O4 as K,Pu as L,lm as M,m4 as N,p4 as O,lO as P,xj as Q,Rs as R,Tt as S,j0 as T,Zs as U,b4 as V,A4 as W,I0 as X,Qs as Y,pj as Z,$n as _,Gt as a,M4 as a0,C4 as a1,YR as a2,g4 as a3,y4 as a4,I4 as a5,x4 as a6,_4 as a7,A_ as a8,G4 as a9,nM as aA,iD as aB,Ep as aC,Lp as aD,H4 as aE,ar as aF,Ip as aG,z4 as aH,W4 as aI,$4 as aJ,Ss as aK,Fw as aL,WI as aM,$f as aN,D4 as aO,ES as aP,Qf as aQ,rT as aa,Fn as ab,wu as ac,q4 as ad,UR as ae,d4 as af,Y4 as ag,h4 as ah,L4 as ai,cM as aj,Pj as ak,aM as al,F4 as am,a4 as an,NR as ao,Op as ap,jR as aq,Zv as ar,R4 as as,M0 as at,D0 as au,XD as av,mo as aw,iu as ax,Dp as ay,w4 as az,U0 as b,dn as c,Na as d,kk as e,dt as f,y0 as g,Sn as h,h2 as i,f4 as j,$R as k,V4 as l,yo as m,aL as n,iL as o,j4 as p,k4 as q,b as r,E4 as s,U4 as t,jp as u,B4 as v,v4 as w,yt as x,T4 as y,N4 as z};
845
+ `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(O)&&G.removeChild(O)}},[t]),N.jsx(aO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:y})})}const oO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(sO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const C of m.values())if(!C)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&k&&(w={...w}),b.useMemo(()=>{m.forEach((x,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(iO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function sO(){return new Map}function dx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const c=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,c]:[!0]}const _c=e=>e.key||"";function s_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const lO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=dx(c),k=b.useMemo(()=>s_(e),[e]),w=c&&!m?[]:k.map(_c),x=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,G]=b.useState(k);U0(()=>{x.current=!1,C.current=k;for(let P=0;P<O.length;P++){const Y=_c(O[P]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const W=[];if(k!==L){let P=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],ue=_c(X);w.includes(ue)||(P.splice(Y,0,X),W.push(X))}return s==="wait"&&W.length&&(P=W),G(s_(P)),R(k),null}const{forceRender:z}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(P=>{const Y=_c(P),X=c&&!m?!1:k===O||w.includes(Y),ue=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let se=!0;S.forEach(Ae=>{Ae||(se=!1)}),se&&(z?.(),G(C.current),c&&y?.(),a&&a())};return N.jsx(oO,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:X?void 0:ue,anchorX:u,anchorY:h,children:P},Y)})})},hx=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function cO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};Vw(e),c_=!0}function fx(){return cO(),KI()}function uO(e){const t=fx();for(const n in e)t[n]={...t[n],...e[n]};Vw(t)}const dO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dO.has(e)}let px=e=>!vu(e);function hO(e){typeof e=="function"&&(px=t=>t.startsWith("on")?!vu(t):e(t))}try{hO(require("@emotion/is-prop-valid").default)}catch{}function fO(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Gt(e[o])||(px(o)||n===!0&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const Nu=b.createContext({});function pO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Bs(n)?n:void 0,animate:Bs(a)?a:void 0}}return e.inherit!==!1?t:{}}function mO(e){const{initial:t,animate:n}=pO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mx(e,t,n){for(const a in t)!Gt(t[a])&&!qw(a,n)&&(e[a]=t[a])}function gO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return om(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yO(e,t){const n=e.style||{},a={};return mx(a,n,e),Object.assign(a,gO(e,t)),a}function vO(e,t){const n={},a=yO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.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=a,n}const gx=()=>({...cm(),attrs:{}});function kO(e,t,n,a){const o=b.useMemo(()=>{const s=gx();return Yw(s,t,Xw(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mx(s,e.style,e),o.style={...s,...o.style}}return o}const _O=["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 um(e){return typeof e!="string"||e.includes("-")?!1:!!(_O.indexOf(e)>-1||/[A-Z]/u.test(e))}function bO(e,t,n,{latestValues:a},o,s=!1,c){const h=(c??um(e)?kO:vO)(t,a,o,e),f=fO(t,typeof e=="string",s),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function wO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:xO(n,a,o,e),renderState:t()}}function xO(e,t,n,a){const o={},s=a(e,{});for(const k in s)o[k]=Hc(s[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=Bw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const x=Qp(e,k[w]);if(x){const{transitionEnd:C,transition:S,...D}=x;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(o[L]=R)}for(const L in C)o[L]=C[L]}}}return o}const yx=e=>(t,n)=>{const a=b.useContext(Nu),o=b.useContext(Lu),s=()=>wO(e,t,a,o);return n?s():jp(s)},PO=yx({scrapeMotionValuesFromProps:sm,createRenderState:cm}),SO=yx({scrapeMotionValuesFromProps:Qw,createRenderState:gx}),CO=Symbol.for("motionComponentSymbol");function TO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const o=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s);const c=a.current;if(typeof c=="function")if(s){const u=c(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):c(s);else c&&(c.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const vx=b.createContext({});function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EO(e,t,n,a,o,s){const{visualElement:c}=b.useContext(Nu),u=b.useContext(hx),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const x=k.current,C=b.useContext(vx);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&AO(k.current,n,o,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{x&&S.current&&x.update(n,h)});const D=n[Cw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return U0(()=>{w.current=!0,x&&(S.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),L.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!L.current&&x.animationState&&x.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),x.enteringChildren=void 0)}),x}function AO(e,t,n,a){const{layoutId:o,layout:s,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kx(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!c||u&&to(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function kx(e){if(e)return e.options.allowProjection!==!1?e.projection:kx(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&uO(a);const s=n?n==="svg":um(e),c=s?SO:PO;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:RO(f)},{isStatic:w}=k,x=mO(f),C=c(f,w);if(!w&&typeof window<"u"){LO();const S=DO(k);y=S.MeasureLayout,x.visualElement=EO(e,C,k,o,S.ProjectionNode,s)}return N.jsxs(Nu.Provider,{value:x,children:[y&&x.visualElement?N.jsx(y,{visualElement:x.visualElement,...k}):null,bO(e,f,TO(C,x.visualElement,m),C,w,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[CO]=e,h}function RO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function LO(e,t){b.useContext(hx).strict}function DO(e){const t=fx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(s,c)=>Yh(s,c,e,t),o=(s,c)=>a(s,c);return new Proxy(o,{get:(s,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const IO=(e,t)=>t.isSVG??um(e)?new cN(t):new rN(t,{allowProjection:e!==b.Fragment});class NO extends ja{constructor(t){super(t),t.animationState||(t.animationState=pN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let OO=0;class jO extends ja{constructor(){super(...arguments),this.id=OO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:c}=this.node.getProps();if(typeof s=="string"){const u=si(this.node,s,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UO={animation:{Feature:NO},exit:{Feature:jO}};function nl(e){return{point:{x:e.pageX,y:e.pageY}}}const BO=e=>t=>nm(t)&&e(t,nl(t));function As(e,t,n,a){return Fs(e,t,BO(n),a)}const _x=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function FO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class bx{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:c=3,element:u}={}){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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=FO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;x||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const h=nl(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Js(As(this.contextWindow,"pointermove",this.handlePointerMove),As(this.contextWindow,"pointerup",this.handlePointerUp),As(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,wx(t)),offset:f_(e,VO(t)),velocity:zO(t,.1)}}function VO(e){return e[0]}function wx(e){return e[e.length-1]}function zO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=wx(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const s=On(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const c={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function $O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(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 HO(e,{top:t,left:n,bottom:a,right:o}){return{x:p_(e.x,n,o),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function WO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function KO(e,t){let n=.5;const a=ln(e),o=ln(t);return o>a?n=js(t.min,t.max-a,e.min):a>o&&(n=js(e.min,e.max-o,t.min)),xr(0,1,n)}function GO(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}const qf=.35;function qO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const YO=new WeakMap;class ZO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(nl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:x,onDragStart:C}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(x&&this.currentDirection===null){this.currentDirection=QO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new bx(t,{onSessionStart:s,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:_x(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=$O(c,this.constraints[t],this.elastic[t])),s.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&to(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=HO(a.layoutBox,t):this.constraints=!1,this.elastic=qO(n),o!==this.constraints&&!to(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=GO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XI(a,o.root,this.visualElement.getTransformPagePoint());let c=WO(o.layout.layoutBox,s);if(n){const u=n(qI(c));this.hasMutatedConstraints=!!u,u&&(c=$w(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!wc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!wc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:u}=o.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!to(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();o[c]=KO({min:h,max:h},this.constraints[c])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;YO.set(this.visualElement,this);const t=this.visualElement.current,n=As(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&EI(k);m&&y&&!w&&this.start(f)});let a;const o=()=>{const{dragConstraints:f}=this.getProps();to(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=XO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,c=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),dt.read(o);const u=Fs(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function XO(e,t,n){const a=Sk(e,v_(n)),o=Sk(t,v_(n));return()=>{a(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class JO extends ja{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new ZO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class e3 extends ja{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new bx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_x(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(s,c)=>{delete this.session,o&&dt.postRender(()=>o(s,c))}}}mount(){this.removePointerDownListener=As(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class t3 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),Qh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:c}=a;return c&&(c.isPresent=s,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?c.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;Qh=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xx(e){const[t,n]=dx(),a=b.useContext(Op);return N.jsx(t3,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(vx),isPresent:t,safeToRemove:n})}const n3={pan:{Feature:e3},drag:{Feature:JO,ProjectionNode:ux,MeasureLayout:xx}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class r3 extends ja{mount(){const{current:t}=this.node;t&&(this.unmount=PI(t,(n,a)=>(k_(this.node,a,"Start"),o=>k_(this.node,o,"End"))))}unmount(){}}class a3 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Js(Fs(this.node.current,"focus",()=>this.onFocus()),Fs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class i3 extends ja{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=RI(t,(o,s)=>(__(this.node,s,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,o3=e=>{const t=Yf.get(e.target);t&&t(e)},s3=e=>{e.forEach(o3)};function l3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(s3,{root:e,...t})),a[o]}function c3(e,t,n){const a=l3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const u3={some:0,all:1};class d3 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:u3[o]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=c3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(h3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function h3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const f3={inView:{Feature:d3},tap:{Feature:i3},focus:{Feature:a3},hover:{Feature:r3}},p3={layout:{ProjectionNode:ux,MeasureLayout:xx}},m3={...UO,...f3,...n3,...p3},ef=MO(m3,IO);function Px(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Px(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function g3(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Px(e))&&(a&&(a+=" "),a+=t);return a}const y3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},v3=(e,t)=>({classGroupId:e,validator:t}),Sx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ku="-",b_=[],k3="arbitrary..",_3=e=>{const t=w3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return b3(c);const u=c.split(ku),h=u[0]===""&&u.length>1?1:0;return Cx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?y3(f,h):h:f||b_}return n[c]||b_}}},Cx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=Cx(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(ku):e.slice(t).join(ku),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},b3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?k3+a:void 0})(),w3=e=>{const{theme:t,classGroups:n}=e;return x3(n,t)},x3=(e,t)=>{const n=Sx();for(const a in e){const o=e[a];dm(o,n,a,t)}return n},dm=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const c=e[s];P3(c,t,n,a)}},P3=(e,t,n,a)=>{if(typeof e=="string"){S3(e,t,n);return}if(typeof e=="function"){C3(e,t,n,a);return}T3(e,t,n,a)},S3=(e,t,n)=>{const a=e===""?t:Tx(t,e);a.classGroupId=n},C3=(e,t,n,a)=>{if(E3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(v3(n,e))},T3=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let c=0;c<s;c++){const[u,h]=o[c];dm(h,Tx(t,u),n,a)}},Tx=(e,t)=>{let n=e;const a=t.split(ku),o=a.length;for(let s=0;s<o;s++){const c=a[s];let u=n.nextPart.get(c);u||(u=Sx(),n.nextPart.set(c,u)),n=u}return n},E3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,A3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return o(s,c),c},set(s,c){s in n?n[s]=c:o(s,c)}}},Zf="!",w_=":",R3=[],x_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),L3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,h=0,f;const m=o.length;for(let C=0;C<m;C++){const S=o[C];if(c===0&&u===0){if(S===w_){s.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=s.length===0?o:o.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return x_(s,w,k,x)};if(t){const o=t+w_,s=a;a=c=>c.startsWith(o)?s(c.slice(o.length)):x_(R3,!1,c,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},D3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const c=n[s],u=c[0]==="[",h=t.has(c);u||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},M3=e=>({cache:A3(e.cacheSize),parseClassName:L3(e),sortModifiers:D3(e),..._3(e)}),I3=/\s+/,N3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(I3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?x.substring(0,C):x);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:s(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const G=o(D,S);for(let W=0;W<G.length;++W){const z=G[W];c.push(R+z)}h=m+(h.length>0?" "+h:h)}return h},O3=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Ex(n))&&(o&&(o+=" "),o+=a);return o},Ex=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Ex(e[a]))&&(n&&(n+=" "),n+=t);return n},j3=(e,...t)=>{let n,a,o,s;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=M3(f),a=n.cache.get,o=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=N3(h,n);return o(h,m),m};return s=c,(...h)=>s(O3(...h))},U3=[],Nt=e=>{const t=n=>n[e]||U3;return t.isThemeGetter=!0,t},Ax=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,B3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>B3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Pa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>F3.test(e),Lx=()=>!0,W3=e=>V3.test(e)&&!z3.test(e),hm=()=>!1,K3=e=>$3.test(e),G3=e=>H3.test(e),q3=e=>!ke(e)&&!be(e),Y3=e=>Ua(e,Ix,hm),ke=e=>Ax.test(e),ei=e=>Ua(e,Nx,W3),P_=e=>Ua(e,rj,qe),Z3=e=>Ua(e,jx,Lx),X3=e=>Ua(e,Ox,hm),S_=e=>Ua(e,Dx,hm),Q3=e=>Ua(e,Mx,G3),xc=e=>Ua(e,Ux,K3),be=e=>Rx.test(e),ms=e=>gi(e,Nx),J3=e=>gi(e,Ox),C_=e=>gi(e,Dx),ej=e=>gi(e,Ix),tj=e=>gi(e,Mx),Pc=e=>gi(e,Ux,!0),nj=e=>gi(e,jx,!0),Ua=(e,t,n)=>{const a=Ax.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Rx.exec(e);return a?a[1]?t(a[1]):n:!1},Dx=e=>e==="position"||e==="percentage",Mx=e=>e==="image"||e==="url",Ix=e=>e==="length"||e==="size"||e==="bg-size",Nx=e=>e==="length",rj=e=>e==="number",Ox=e=>e==="family-name",jx=e=>e==="number"||e==="weight",Ux=e=>e==="shadow",aj=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),o=Nt("tracking"),s=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),x=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...O(),be,ke],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[be,ke,h],Y=()=>[xa,"full","auto",...P()],X=()=>[Pa,"none","subgrid",be,ke],ue=()=>["auto",{span:["full",Pa,be,ke]},Pa,be,ke],se=()=>[Pa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],pe=()=>["auto",...P()],Ne=()=>[xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],K=()=>[xa,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Z=()=>[xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",ej,Y3,{size:[be,ke]}],Re=()=>[tf,ms,ei],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,ms,ei],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",x,be,ke],Hn=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[xa,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Lx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[q3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",be,ke]}],basis:[{basis:[xa,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,xa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[Pa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ue()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ue()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:pe()}],mx:[{mx:pe()}],my:[{my:pe()}],ms:[{ms:pe()}],me:[{me:pe()}],mbs:[{mbs:pe()}],mbe:[{mbe:pe()}],mt:[{mt:pe()}],mr:[{mr:pe()}],mb:[{mb:pe()}],ml:[{ml:pe()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,ms,ei]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,nj,Z3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[J3,X3,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,ei]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,be,ke],radial:["",be,ke],conic:[Pa,be,ke]},tj,Q3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,ms,ei]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Pc,xc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,xc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,ei]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,Pc,xc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,Pc,xc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,ms,ei,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ij=j3(aj);function Tt(...e){return ij(g3(e))}const oj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),sj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),lj={google:oj,github:sj},cj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function uj(e){return cj[e]||String(e||"").replace(/-/g," ")}function dj(){Qs();const{isOpen:e,closeLoginModal:t}=j0(),{enabled:n,signedIn:a,refreshUser:o,signInWithPassword:s,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Zs(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,x]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[G,W]=b.useState(null),[z,P]=b.useState(!1),[Y,X]=b.useState(!0),[ue,se]=b.useState([]),[Ae,fe]=b.useState(8);b.useEffect(()=>{e&&(O(null),W(null),m("signin"),k(""),x(""),S(""),P(!1))},[e]),b.useEffect(()=>{if(!e||!n||ue.length>0)return;let K=!0;return X(!0),(async()=>{const{data:Z,error:H}=await h();if(K){if(H||!Z)se(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];se([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&fe(Z.passwordMinLength)}X(!1)}})(),()=>{K=!1}},[e,n,h,ue.length]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const le=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),pe=b.useCallback(async K=>{O(null),L(!0);try{const{error:Z}=await u(K,le);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,le]),Ne=b.useCallback(async K=>{K.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){W(Fe("login.verify_email_pending")),m("signin");return}await o();return}const{error:Z}=await s({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await o()}finally{L(!1)}},[f,y,w,C,c,s,o]);return b.useEffect(()=>{if(!e)return;const K=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,t]),n?N.jsx(lO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:K=>K.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(I0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsxs("div",{className:"space-y-2.5",children:[N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ue.map(K=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>pe(K),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[lj[K]||null,Fe("login.oauth.continue",{provider:uj(K)})]},K))}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:K=>S(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:K=>k(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:K=>x(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>P(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx(GD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const hj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},G4="https://tokentracker.statuspage.io/";function fj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?hj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||Wr()).trim()}function q4(){return Wr()}function pj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const mj=300*1e3,gj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function yj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+gj<=t:!0}async function Bx(e,t){const n=Wr();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),o=Ks(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function vj(e){const t=Wr();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Ks(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||Wr();fm(o)&&(a.insforgeBaseUrl=o.trim());const s=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=r0();if(n&&!yj(n))return n;const a=await vj(t);return a?(BR(a),a):null}async function Fx(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}catch(a){if(!r0()||(a0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}}async function kj(e){const t=FR();if(Date.now()-t<mj)return;const n=await Fx(e);n&&(i0(Date.now()),await Bx(n,"cloud-sync-auto"))}async function Y4(e){const t=await Fx(e);t&&(i0(Date.now()),await Bx(t,"cloud-sync-now"))}function _j(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function bj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||_j(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function wj(){const e=Fn(),t=Zs(),n=b.useRef(!1);b.useEffect(()=>{if(!jR()||!bj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!UR())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await kj(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function xj(){const e=b.useContext(N0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function Pj({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Sj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function Cj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Sc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Qs();const o=t==="sidebar",{enabled:s,loading:c,signedIn:u,user:h,displayName:f}=Zs(),{openLoginModal:m}=j0(),y=wu(),k=b.useMemo(()=>Sj(h),[h]),w=b.useMemo(()=>Cj(k),[k]),[x,C]=Rs.useState(!1);if(Rs.useEffect(()=>{C(!1)},[w]),!s)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(o?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:o&&n?f:void 0,children:[o?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!x?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)})}):w&&!x?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)}),o?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function Tj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:BD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:VD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:cM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:WD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:eM,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:$D,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:aM,label:Fe("nav.settings")}]}]}function Ej(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Aj(){const[e,t]=b.useState(Ej),n=b.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,o?"1":"0")}catch{}return o})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Xf&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Rj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Lj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Dj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return N.jsxs(Pu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Mj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:o}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:o})}function Ij({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Pj({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Nj=[{value:"light",label:"Light",Icon:M0},{value:"dark",label:"Dark",Icon:D0},{value:"system",label:"System",Icon:XD}];function Oj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=b.useState(!1),c=b.useRef(null),u=t==="dark"?D0:M0;return b.useEffect(()=>{if(!o)return;const h=m=>{c.current&&!c.current.contains(m.target)&&s(!1)},f=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[o]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Nj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function Vx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=xj(),{resolvedLocale:y}=Qs(),k=b.useMemo(()=>Tj(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:o,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(I0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,x)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Lj,{label:w.label,collapsed:e,first:x===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Dj,{item:C,collapsed:e,active:Rj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(Oj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:s}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Ij,{glassChrome:s})})]})]})}function jj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(Vx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Uj({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(Vx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Bj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Mj,{title:Fe("nav.menu"),onClick:e,children:N.jsx(YD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(Pu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Fj({children:e}){const{collapsed:t,toggle:n}=Aj(),[a,o]=b.useState(!1),s=b.useCallback(()=>o(!0),[]),c=b.useCallback(()=>o(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(jj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Uj,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Bj,{onOpenDrawer:s}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const Vj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(Vj),Cc=R_.get("insforge_code")||R_.get("code")||null,zj=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function $j(){Qs();const{loading:e,signedIn:t}=Zs(),n=wu(),[a,o]=b.useState("processing"),[s,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Cc||u.current)){if(u.current=!0,zj){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Cc)return;o("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Cc)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Cc&&s===null){const f=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Hj=b.lazy(()=>$n(()=>import("./DashboardPage-DJcrfsmC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Wj=b.lazy(()=>$n(()=>import("./IpCheckPage-BV2SZxBg.js"),[])),Kj=b.lazy(()=>$n(()=>import("./LandingPage-Bk3xCXel.js"),__vite__mapDeps([11,12,8])).then(e=>({default:e.LandingPage}))),Gj=b.lazy(()=>$n(()=>import("./LeaderboardPage-CoONwoqy.js"),__vite__mapDeps([13,9,2,14,15])).then(e=>({default:e.LeaderboardPage}))),qj=b.lazy(()=>$n(()=>import("./LeaderboardProfilePage-BPEbL1AU.js"),__vite__mapDeps([16,2,12,17,14,9,3,4,18,5])).then(e=>({default:e.LeaderboardProfilePage}))),Yj=b.lazy(()=>$n(()=>import("./LimitsPage-hVKBqUjr.js"),__vite__mapDeps([19,1,20,7,10,8,21,18,22])).then(e=>({default:e.LimitsPage}))),Zj=b.lazy(()=>$n(()=>import("./LoginPage-BpduG_WF.js"),[]).then(e=>({default:e.LoginPage}))),Xj=b.lazy(()=>$n(()=>import("./DevicePage-D0v5ldVS.js"),[])),Qj=b.lazy(()=>$n(()=>import("./WrappedPage-JMG44YOJ.js"),[])),Jj=b.lazy(()=>$n(()=>import("./SettingsPage-Wx9gFT4s.js"),__vite__mapDeps([23,20,24,7,25,2,15,4,22])).then(e=>({default:e.SettingsPage}))),e4=b.lazy(()=>$n(()=>import("./SkillsPage-C1mG0Yg0.js"),__vite__mapDeps([26,21,18,22,7,5,4,9,25,6,8,15])).then(e=>({default:e.SkillsPage}))),t4=b.lazy(()=>$n(()=>import("./WidgetsPage-CcV2p0y8.js"),__vite__mapDeps([27,24,7,10,8,18,22,15])).then(e=>({default:e.WidgetsPage})));function n4(){const{resolvedLocale:e}=Qs(),t=Fn(),n=Zs();wj();const a=Sn(),o=b.useMemo(()=>typeof window>"u"?!1:pj(window.location.search),[]),s=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=s.replace(/\/+$/,"")||"/",C=x==="/leaderboard",S=x.match(/^\/u\/([^/]+)$/i),D=S?S[1]:null,L=!!(n.enabled&&n.signedIn),R=w||L,O=!1,G=fj(),W=b.useMemo(()=>!n.enabled||!L?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[L,n]);let z=w||a||o?"dashboard":"landing";x==="/landing"&&(z="landing"),x==="/dashboard"&&(z="dashboard"),C&&(z="dashboard"),D&&(z="dashboard");const P=x==="/limits",Y=x==="/settings",X=x==="/skills",ue=x==="/widgets",se=x==="/ip-check";(P||Y||X||ue||se)&&(z="dashboard");let Ae=Hj;D?Ae=qj:x==="/leaderboard"?Ae=Gj:P?Ae=Yj:Y?Ae=Jj:X?Ae=e4:ue?Ae=t4:se&&(Ae=Wj);const fe=!k&&(x==="/dashboard"||x==="/"||C||P||Y||X||ue||se);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=N.jsx($j,{});else if(x==="/login")le=N.jsx(Zj,{});else if(x==="/device")le=N.jsx(Xj,{});else if(x==="/wrapped")le=N.jsx(Qj,{});else if(z==="landing")le=N.jsx(Kj,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=N.jsx(Ae,{baseUrl:G,auth:W,signedIn:R,sessionSoftExpired:O,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,userId:D,signInUrl:"/login",signUpUrl:"/login"},e);fe?le=N.jsx(Fj,{children:pe}):le=pe}return N.jsx(hM,{children:N.jsx(mM,{children:N.jsxs(gM,{children:[N.jsx(b.Suspense,{fallback:null,children:le}),N.jsx(dj,{}),N.jsx(_D,{}),N.jsx(LD,{})]})})})}const r4=W1([{path:"*",element:N.jsx(n4,{})}]);MS.createRoot(document.getElementById("root")).render(N.jsx(Rs.StrictMode,{children:N.jsx(JL,{children:N.jsx(oD,{children:N.jsx(RL,{children:N.jsx(aT,{router:r4})})})})}));export{Aa as $,g0 as A,Fe as B,N as C,ef as D,Nc as E,S4 as F,P4 as G,Ns as H,dM as I,pu as J,O4 as K,Pu as L,lm as M,m4 as N,p4 as O,lO as P,xj as Q,Rs as R,Tt as S,j0 as T,Zs as U,b4 as V,A4 as W,I0 as X,Qs as Y,pj as Z,$n as _,Gt as a,M4 as a0,C4 as a1,YR as a2,g4 as a3,y4 as a4,I4 as a5,x4 as a6,_4 as a7,A_ as a8,G4 as a9,nM as aA,iD as aB,Ep as aC,Lp as aD,H4 as aE,ar as aF,Ip as aG,z4 as aH,W4 as aI,$4 as aJ,Ss as aK,Fw as aL,WI as aM,$f as aN,D4 as aO,ES as aP,Qf as aQ,rT as aa,Fn as ab,wu as ac,q4 as ad,UR as ae,d4 as af,Y4 as ag,h4 as ah,L4 as ai,cM as aj,Pj as ak,aM as al,F4 as am,a4 as an,NR as ao,Op as ap,jR as aq,Zv as ar,R4 as as,M0 as at,D0 as au,XD as av,mo as aw,iu as ax,Dp as ay,w4 as az,U0 as b,dn as c,Na as d,kk as e,dt as f,y0 as g,Sn as h,h2 as i,f4 as j,$R as k,V4 as l,yo as m,aL as n,iL as o,j4 as p,k4 as q,b as r,E4 as s,U4 as t,jp as u,B4 as v,v4 as w,yt as x,T4 as y,N4 as z};