tokentracker-cli 0.5.12 → 0.5.13

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CRoqVbH0.js","assets/ThemeToggle-D2rifL57.js","assets/LeaderboardPage-B3ZnlNgw.js","assets/leaderboard-columns-DQnk56C_.js","assets/LeaderboardProfilePage-Cq17bu0k.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BS38-6Xx.js","assets/ThemeToggle-DVKbB4qC.js","assets/LeaderboardPage-BhqpZtev.js","assets/leaderboard-columns-2mvo_uNL.js","assets/LeaderboardProfilePage-CfQdUOe3.js"])))=>i.map(i=>d[i]);
2
2
  function i2(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function P1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r2(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var mm={exports:{}},Lc={},gm={exports:{}},Jt={};var xb;function s2(){if(xb)return Jt;xb=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function y(z,ie,_e){this.props=z,this.context=ie,this.refs=w,this.updater=_e||v}y.prototype.isReactComponent={},y.prototype.setState=function(z,ie){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,ie,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function x(){}x.prototype=y.prototype;function M(z,ie,_e){this.props=z,this.context=ie,this.refs=w,this.updater=_e||v}var A=M.prototype=new x;A.constructor=M,_(A,y.prototype),A.isPureReactComponent=!0;var T=Array.isArray,D=Object.prototype.hasOwnProperty,I={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function S(z,ie,_e){var Ee,Ue={},le=null,be=null;if(ie!=null)for(Ee in ie.ref!==void 0&&(be=ie.ref),ie.key!==void 0&&(le=""+ie.key),ie)D.call(ie,Ee)&&!U.hasOwnProperty(Ee)&&(Ue[Ee]=ie[Ee]);var Se=arguments.length-2;if(Se===1)Ue.children=_e;else if(1<Se){for(var Ne=Array(Se),et=0;et<Se;et++)Ne[et]=arguments[et+2];Ue.children=Ne}if(z&&z.defaultProps)for(Ee in Se=z.defaultProps,Se)Ue[Ee]===void 0&&(Ue[Ee]=Se[Ee]);return{$$typeof:t,type:z,key:le,ref:be,props:Ue,_owner:I.current}}function R(z,ie){return{$$typeof:t,type:z.type,key:ie,ref:z.ref,props:z.props,_owner:z._owner}}function H(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function F(z){var ie={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(_e){return ie[_e]})}var W=/\/+/g;function X(z,ie){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):ie.toString(36)}function V(z,ie,_e,Ee,Ue){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var be=!1;if(z===null)be=!0;else switch(le){case"string":case"number":be=!0;break;case"object":switch(z.$$typeof){case t:case e:be=!0}}if(be)return be=z,Ue=Ue(be),z=Ee===""?"."+X(be,0):Ee,T(Ue)?(_e="",z!=null&&(_e=z.replace(W,"$&/")+"/"),V(Ue,ie,_e,"",function(et){return et})):Ue!=null&&(H(Ue)&&(Ue=R(Ue,_e+(!Ue.key||be&&be.key===Ue.key?"":(""+Ue.key).replace(W,"$&/")+"/")+z)),ie.push(Ue)),1;if(be=0,Ee=Ee===""?".":Ee+":",T(z))for(var Se=0;Se<z.length;Se++){le=z[Se];var Ne=Ee+X(le,Se);be+=V(le,ie,_e,Ne,Ue)}else if(Ne=m(z),typeof Ne=="function")for(z=Ne.call(z),Se=0;!(le=z.next()).done;)le=le.value,Ne=Ee+X(le,Se++),be+=V(le,ie,_e,Ne,Ue);else if(le==="object")throw ie=String(z),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return be}function q(z,ie,_e){if(z==null)return z;var Ee=[],Ue=0;return V(z,Ee,"","",function(le){return ie.call(_e,le,Ue++)}),Ee}function J(z){if(z._status===-1){var ie=z._result;ie=ie(),ie.then(function(_e){(z._status===0||z._status===-1)&&(z._status=1,z._result=_e)},function(_e){(z._status===0||z._status===-1)&&(z._status=2,z._result=_e)}),z._status===-1&&(z._status=0,z._result=ie)}if(z._status===1)return z._result.default;throw z._result}var Q={current:null},$={transition:null},Y={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:$,ReactCurrentOwner:I};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Jt.Children={map:q,forEach:function(z,ie,_e){q(z,function(){ie.apply(this,arguments)},_e)},count:function(z){var ie=0;return q(z,function(){ie++}),ie},toArray:function(z){return q(z,function(ie){return ie})||[]},only:function(z){if(!H(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Jt.Component=y,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=M,Jt.StrictMode=i,Jt.Suspense=u,Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Jt.act=Z,Jt.cloneElement=function(z,ie,_e){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var Ee=_({},z.props),Ue=z.key,le=z.ref,be=z._owner;if(ie!=null){if(ie.ref!==void 0&&(le=ie.ref,be=I.current),ie.key!==void 0&&(Ue=""+ie.key),z.type&&z.type.defaultProps)var Se=z.type.defaultProps;for(Ne in ie)D.call(ie,Ne)&&!U.hasOwnProperty(Ne)&&(Ee[Ne]=ie[Ne]===void 0&&Se!==void 0?Se[Ne]:ie[Ne])}var Ne=arguments.length-2;if(Ne===1)Ee.children=_e;else if(1<Ne){Se=Array(Ne);for(var et=0;et<Ne;et++)Se[et]=arguments[et+2];Ee.children=Se}return{$$typeof:t,type:z.type,key:Ue,ref:le,props:Ee,_owner:be}},Jt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:s,_context:z},z.Consumer=z},Jt.createElement=S,Jt.createFactory=function(z){var ie=S.bind(null,z);return ie.type=z,ie},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(z){return{$$typeof:c,render:z}},Jt.isValidElement=H,Jt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:J}},Jt.memo=function(z,ie){return{$$typeof:f,type:z,compare:ie===void 0?null:ie}},Jt.startTransition=function(z){var ie=$.transition;$.transition={};try{z()}finally{$.transition=ie}},Jt.unstable_act=Z,Jt.useCallback=function(z,ie){return Q.current.useCallback(z,ie)},Jt.useContext=function(z){return Q.current.useContext(z)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(z){return Q.current.useDeferredValue(z)},Jt.useEffect=function(z,ie){return Q.current.useEffect(z,ie)},Jt.useId=function(){return Q.current.useId()},Jt.useImperativeHandle=function(z,ie,_e){return Q.current.useImperativeHandle(z,ie,_e)},Jt.useInsertionEffect=function(z,ie){return Q.current.useInsertionEffect(z,ie)},Jt.useLayoutEffect=function(z,ie){return Q.current.useLayoutEffect(z,ie)},Jt.useMemo=function(z,ie){return Q.current.useMemo(z,ie)},Jt.useReducer=function(z,ie,_e){return Q.current.useReducer(z,ie,_e)},Jt.useRef=function(z){return Q.current.useRef(z)},Jt.useState=function(z){return Q.current.useState(z)},Jt.useSyncExternalStore=function(z,ie,_e){return Q.current.useSyncExternalStore(z,ie,_e)},Jt.useTransition=function(){return Q.current.useTransition()},Jt.version="18.3.1",Jt}var bb;function Rv(){return bb||(bb=1,gm.exports=s2()),gm.exports}var Sb;function a2(){if(Sb)return Lc;Sb=1;var t=Rv(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,f){var h,p={},m=null,v=null;f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)i.call(u,h)&&!s.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:v,props:p,_owner:r.current}}return Lc.Fragment=n,Lc.jsx=o,Lc.jsxs=o,Lc}var wb;function o2(){return wb||(wb=1,mm.exports=a2()),mm.exports}var B=o2(),N=Rv();const Gl=P1(N),k1=i2({__proto__:null,default:Gl},[N]);var Id={},vm={exports:{}},Vi={},ym={exports:{}},_m={};var Eb;function l2(){return Eb||(Eb=1,(function(t){function e($,Y){var Z=$.length;$.push(Y);e:for(;0<Z;){var z=Z-1>>>1,ie=$[z];if(0<r(ie,Y))$[z]=Y,$[Z]=ie,Z=z;else break e}}function n($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var Y=$[0],Z=$.pop();if(Z!==Y){$[0]=Z;e:for(var z=0,ie=$.length,_e=ie>>>1;z<_e;){var Ee=2*(z+1)-1,Ue=$[Ee],le=Ee+1,be=$[le];if(0>r(Ue,Z))le<ie&&0>r(be,Ue)?($[z]=be,$[le]=Z,z=le):($[z]=Ue,$[Ee]=Z,z=Ee);else if(le<ie&&0>r(be,Z))$[z]=be,$[le]=Z,z=le;else break e}}return Y}function r($,Y){var Z=$.sortIndex-Y.sortIndex;return Z!==0?Z:$.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],f=[],h=1,p=null,m=3,v=!1,_=!1,w=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A($){for(var Y=n(f);Y!==null;){if(Y.callback===null)i(f);else if(Y.startTime<=$)i(f),Y.sortIndex=Y.expirationTime,e(u,Y);else break;Y=n(f)}}function T($){if(w=!1,A($),!_)if(n(u)!==null)_=!0,J(D);else{var Y=n(f);Y!==null&&Q(T,Y.startTime-$)}}function D($,Y){_=!1,w&&(w=!1,x(S),S=-1),v=!0;var Z=m;try{for(A(Y),p=n(u);p!==null&&(!(p.expirationTime>Y)||$&&!F());){var z=p.callback;if(typeof z=="function"){p.callback=null,m=p.priorityLevel;var ie=z(p.expirationTime<=Y);Y=t.unstable_now(),typeof ie=="function"?p.callback=ie:p===n(u)&&i(u),A(Y)}else i(u);p=n(u)}if(p!==null)var _e=!0;else{var Ee=n(f);Ee!==null&&Q(T,Ee.startTime-Y),_e=!1}return _e}finally{p=null,m=Z,v=!1}}var I=!1,U=null,S=-1,R=5,H=-1;function F(){return!(t.unstable_now()-H<R)}function W(){if(U!==null){var $=t.unstable_now();H=$;var Y=!0;try{Y=U(!0,$)}finally{Y?X():(I=!1,U=null)}}else I=!1}var X;if(typeof M=="function")X=function(){M(W)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,q=V.port2;V.port1.onmessage=W,X=function(){q.postMessage(null)}}else X=function(){y(W,0)};function J($){U=$,I||(I=!0,X())}function Q($,Y){S=y(function(){$(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,J(D))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var Y=3;break;default:Y=m}var Z=m;m=Y;try{return $()}finally{m=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Z=m;m=$;try{return Y()}finally{m=Z}},t.unstable_scheduleCallback=function($,Y,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,$){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=Z+ie,$={id:h++,callback:Y,priorityLevel:$,startTime:Z,expirationTime:ie,sortIndex:-1},Z>z?($.sortIndex=Z,e(f,$),n(u)===null&&$===n(f)&&(w?(x(S),S=-1):w=!0,Q(T,Z-z))):($.sortIndex=ie,e(u,$),_||v||(_=!0,J(D))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var Y=m;return function(){var Z=m;m=Y;try{return $.apply(this,arguments)}finally{m=Z}}}})(_m)),_m}var Mb;function c2(){return Mb||(Mb=1,ym.exports=l2()),ym.exports}var Tb;function u2(){if(Tb)return Vi;Tb=1;var t=Rv(),e=c2();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(r[a]=l,a=0;a<l.length;a++)i.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=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]*$/,h={},p={};function m(a){return u.call(p,a)?!0:u.call(h,a)?!1:f.test(a)?p[a]=!0:(h[a]=!0,!1)}function v(a,l,d,g){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,d,g){if(l===null||typeof l>"u"||v(a,l,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,d,g,b,E,k){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=a,this.type=l,this.sanitizeURL=E,this.removeEmptyString=k}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){y[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];y[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){y[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){y[a]=new w(a,2,!1,a,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(a){y[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){y[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){y[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){y[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){y[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function M(a){return a[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(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),y.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,l,d,g){var b=y.hasOwnProperty(l)?y[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,d,b,g)&&(d=null),g||b===null?m(l)&&(d===null?a.removeAttribute(l):a.setAttribute(l,""+d)):b.mustUseProperty?a[b.propertyName]=d===null?b.type===3?!1:"":d:(l=b.attributeName,g=b.attributeNamespace,d===null?a.removeAttribute(l):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,g?a.setAttributeNS(g,l,d):a.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),I=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),F=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,z;function ie(a){if(z===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
3
3
  `+z+a}var _e=!1;function Ee(a,l){if(!a||_e)return"";_e=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ge){var g=ge}Reflect.construct(a,[],l)}else{try{l.call()}catch(ge){g=ge}a.call(l.prototype)}else{try{throw Error()}catch(ge){g=ge}a()}}catch(ge){if(ge&&g&&typeof ge.stack=="string"){for(var b=ge.stack.split(`
4
4
  `),E=g.stack.split(`
@@ -39,7 +39,7 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
39
39
  `))}logResponse(t,e,n,i,r){if(!this.enabled)return;const s=[`← ${t} ${e} ${n} (${i}ms)`],o=AS(tu(r));if(o){const c=o.length>1e3?o.slice(0,1e3)+"... [truncated]":o;s.push(` Body: ${c}`)}n>=400?this.error(s.join(`
40
40
  `)):this.log(s.join(`
41
41
  `))}},ey="insforge_csrf_token";function qM(){if(typeof document>"u")return null;const t=document.cookie.split(";").find(e=>e.trim().startsWith(`${ey}=`));return t&&t.split("=")[1]||null}function YM(t){if(typeof document>"u")return;const e=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${ey}=${encodeURIComponent(t)}; path=/; max-age=${e}; SameSite=Lax${n}`}function KM(){if(typeof document>"u")return;const t=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${ey}=; path=/; max-age=0; SameSite=Lax${t}`}var ZM=class{constructor(){this.accessToken=null,this.user=null,this.onTokenChange=null}saveSession(t){const e=t.accessToken!==this.accessToken;this.accessToken=t.accessToken,this.user=t.user,e&&this.onTokenChange&&this.onTokenChange()}getSession(){return!this.accessToken||!this.user?null:{accessToken:this.accessToken,user:this.user}}getAccessToken(){return this.accessToken}setAccessToken(t){const e=t!==this.accessToken;this.accessToken=t,e&&this.onTokenChange&&this.onTokenChange()}getUser(){return this.user}setUser(t){this.user=t}clearSession(){const t=this.accessToken!==null;this.accessToken=null,this.user=null,t&&this.onTokenChange&&this.onTokenChange()}},$N=new Set([500,502,503,504]),XN=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),qN=class{constructor(t,e,n){if(this.userToken=null,this.autoRefreshToken=!0,this.isRefreshing=!1,this.refreshPromise=null,this.refreshToken=null,this.baseUrl=t.baseUrl||"http://localhost:7130",this.autoRefreshToken=t.autoRefreshToken??!0,this.fetch=t.fetch||(globalThis.fetch?globalThis.fetch.bind(globalThis):void 0),this.anonKey=t.anonKey,this.defaultHeaders={...t.headers},this.tokenManager=e??new ZM,this.logger=n||new XM(!1),this.timeout=t.timeout??3e4,this.retryCount=t.retryCount??3,this.retryDelay=t.retryDelay??500,!this.fetch)throw new Error("Fetch is not available. Please provide a fetch implementation in the config.")}buildUrl(t,e){const n=new URL(t,this.baseUrl);return e&&Object.entries(e).forEach(([i,r])=>{if(i==="select"){let s=r.replace(/\s+/g," ").trim();s=s.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(i,s)}else n.searchParams.append(i,r)}),n.toString()}isRetryableStatus(t){return $N.has(t)}computeRetryDelay(t){const n=this.retryDelay*Math.pow(2,t-1)*(.85+Math.random()*.3);return Math.round(n)}async handleRequest(t,e,n={}){const{params:i,headers:r={},body:s,signal:o,...c}=n,u=this.buildUrl(e,i),f=Date.now(),p=XN.has(t.toUpperCase())||n.idempotent===!0?this.retryCount:0,m={...this.defaultHeaders},v=this.userToken||this.anonKey;v&&(m.Authorization=`Bearer ${v}`);let _;s!==void 0&&(typeof FormData<"u"&&s instanceof FormData?_=s:(t!=="GET"&&(m["Content-Type"]="application/json;charset=UTF-8"),_=JSON.stringify(s))),r instanceof Headers?r.forEach((y,x)=>{m[x]=y}):Array.isArray(r)?r.forEach(([y,x])=>{m[y]=x}):Object.assign(m,r),this.logger.logRequest(t,u,m,_);let w;for(let y=0;y<=p;y++){if(y>0){const A=this.computeRetryDelay(y);if(this.logger.warn(`Retry ${y}/${p} for ${t} ${u} in ${A}ms`),o?.aborted)throw o.reason;await new Promise((T,D)=>{const I=()=>{clearTimeout(U),D(o.reason)},U=setTimeout(()=>{o&&o.removeEventListener("abort",I),T()},A);o&&o.addEventListener("abort",I,{once:!0})})}let x,M;if((this.timeout>0||o)&&(x=new AbortController,this.timeout>0&&(M=setTimeout(()=>x.abort(),this.timeout)),o))if(o.aborted)x.abort(o.reason);else{const A=()=>x.abort(o.reason);o.addEventListener("abort",A,{once:!0}),x.signal.addEventListener("abort",()=>{o.removeEventListener("abort",A)},{once:!0})}try{const A=await this.fetch(u,{method:t,headers:m,body:_,...c,...x?{signal:x.signal}:{}});if(this.isRetryableStatus(A.status)&&y<p){M!==void 0&&clearTimeout(M),await A.body?.cancel(),w=new Gt(`Server error: ${A.status} ${A.statusText}`,A.status,"SERVER_ERROR");continue}if(A.status===204){M!==void 0&&clearTimeout(M);return}let T;const D=A.headers.get("content-type");try{D?.includes("json")?T=await A.json():T=await A.text()}catch(I){throw M!==void 0&&clearTimeout(M),new Gt(`Failed to parse response body: ${I?.message||"Unknown error"}`,A.status,A.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(M!==void 0&&clearTimeout(M),!A.ok){if(this.logger.logResponse(t,u,A.status,Date.now()-f,T),T&&typeof T=="object"&&"error"in T){!T.statusCode&&!T.status&&(T.statusCode=A.status);const I=Gt.fromApiError(T);throw Object.keys(T).forEach(U=>{U!=="error"&&U!=="message"&&U!=="statusCode"&&(I[U]=T[U])}),I}throw new Gt(`Request failed: ${A.statusText}`,A.status,"REQUEST_FAILED")}return this.logger.logResponse(t,u,A.status,Date.now()-f,T),T}catch(A){if(M!==void 0&&clearTimeout(M),A?.name==="AbortError")throw x&&x.signal.aborted&&this.timeout>0&&!o?.aborted?new Gt(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):A;if(A instanceof Gt)throw A;if(y<p){w=A;continue}throw new Gt(`Network request failed: ${A?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw w||new Gt("Request failed after all retry attempts",0,"NETWORK_ERROR")}async request(t,e,n={}){try{return await this.handleRequest(t,e,{...n})}catch(i){if(i instanceof Gt&&i.statusCode===401&&i.error==="INVALID_TOKEN"&&this.autoRefreshToken)try{const r=await this.handleTokenRefresh();return this.setAuthToken(r.accessToken),this.tokenManager.saveSession(r),r.csrfToken&&YM(r.csrfToken),r.refreshToken&&this.setRefreshToken(r.refreshToken),await this.handleRequest(t,e,{...n})}catch(r){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,KM(),r}throw i}}get(t,e){return this.request("GET",t,e)}post(t,e,n){return this.request("POST",t,{...n,body:e})}put(t,e,n){return this.request("PUT",t,{...n,body:e})}patch(t,e,n){return this.request("PATCH",t,{...n,body:e})}delete(t,e){return this.request("DELETE",t,e)}setAuthToken(t){this.userToken=t}setRefreshToken(t){this.refreshToken=t}getHeaders(){const t={...this.defaultHeaders},e=this.userToken||this.anonKey;return e&&(t.Authorization=`Bearer ${e}`),t}async handleTokenRefresh(){return this.isRefreshing?this.refreshPromise:(this.isRefreshing=!0,this.refreshPromise=(async()=>{try{const t=qM(),e=this.refreshToken?{refreshToken:this.refreshToken}:void 0;return await this.handleRequest("POST","/api/auth/sessions/current",{body:e,headers:t?{"X-CSRF-Token":t}:{},credentials:"include"})}finally{this.isRefreshing=!1,this.refreshPromise=null}})(),this.refreshPromise)}},i0="insforge_pkce_verifier";function JM(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function YN(){const t=new Uint8Array(32);return crypto.getRandomValues(t),JM(t)}async function KN(t){const n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",n);return JM(new Uint8Array(i))}function ZN(t){typeof sessionStorage<"u"&&sessionStorage.setItem(i0,t)}function JN(){if(typeof sessionStorage>"u")return null;const t=sessionStorage.getItem(i0);return t&&sessionStorage.removeItem(i0),t}function Yi(t,e){return t instanceof Gt?{data:null,error:t}:{data:null,error:new Gt(t instanceof Error?t.message:e,500,"UNEXPECTED_ERROR")}}function CS(...t){if(typeof window>"u")return;const e=new URL(window.location.href);t.forEach(n=>e.searchParams.delete(n)),window.history.replaceState({},document.title,e.toString())}var QN=class{constructor(t,e,n={}){this.http=t,this.tokenManager=e,this.options=n,this.authCallbackHandled=this.detectAuthCallback()}isServerMode(){return!!this.options.isServerMode}saveSessionFromResponse(t){if(!t.accessToken||!t.user)return!1;const e={accessToken:t.accessToken,user:t.user};return!this.isServerMode()&&t.csrfToken&&YM(t.csrfToken),this.isServerMode()||this.tokenManager.saveSession(e),this.http.setAuthToken(t.accessToken),this.http.setRefreshToken(t.refreshToken??null),!0}async detectAuthCallback(){if(!(this.isServerMode()||typeof window>"u"))try{const t=new URLSearchParams(window.location.search),e=t.get("error");if(e){CS("error"),console.debug("OAuth callback error:",e);return}const n=t.get("insforge_code");if(n){CS("insforge_code");const{error:i}=await this.exchangeOAuthCode(n);i&&console.debug("OAuth code exchange failed:",i.message);return}}catch(t){console.debug("OAuth callback detection skipped:",t)}}async signUp(t){try{const e=await this.http.post(this.isServerMode()?"/api/auth/users?client_type=mobile":"/api/auth/users",t,{credentials:"include"});return e.accessToken&&e.user&&this.saveSessionFromResponse(e),e.refreshToken&&this.http.setRefreshToken(e.refreshToken),{data:e,error:null}}catch(e){return Yi(e,"An unexpected error occurred during sign up")}}async signInWithPassword(t){try{const e=await this.http.post(this.isServerMode()?"/api/auth/sessions?client_type=mobile":"/api/auth/sessions",t,{credentials:"include"});return this.saveSessionFromResponse(e),e.refreshToken&&this.http.setRefreshToken(e.refreshToken),{data:e,error:null}}catch(e){return Yi(e,"An unexpected error occurred during sign in")}}async signOut(){try{try{await this.http.post(this.isServerMode()?"/api/auth/logout?client_type=mobile":"/api/auth/logout",void 0,{credentials:"include"})}catch{}return this.tokenManager.clearSession(),this.http.setAuthToken(null),this.http.setRefreshToken(null),this.isServerMode()||KM(),{error:null}}catch{return{error:new Gt("Failed to sign out",500,"SIGNOUT_ERROR")}}}async signInWithOAuth(t){try{const{provider:e,redirectTo:n,skipBrowserRedirect:i}=t,r=encodeURIComponent(e.toLowerCase()),s=YN(),o=await KN(s);ZN(s);const c={code_challenge:o};n&&(c.redirect_uri=n);const f=Eh.options.includes(r)?`/api/auth/oauth/${r}`:`/api/auth/oauth/custom/${r}`,h=await this.http.get(f,{params:c});return!this.isServerMode()&&typeof window<"u"&&!i?(window.location.href=h.authUrl,{data:{},error:null}):{data:{url:h.authUrl,provider:r,codeVerifier:s},error:null}}catch(e){return e instanceof Gt?{data:{},error:e}:{data:{},error:new Gt("An unexpected error occurred during OAuth initialization",500,"UNEXPECTED_ERROR")}}}async exchangeOAuthCode(t,e){try{const n=e??JN();if(!n)return{data:null,error:new Gt("PKCE code verifier not found. Ensure signInWithOAuth was called in the same browser session.",400,"PKCE_VERIFIER_MISSING")};const i={code:t,code_verifier:n},r=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",i,{credentials:"include"});return this.saveSessionFromResponse(r),{data:r,error:null}}catch(n){return Yi(n,"An unexpected error occurred during OAuth code exchange")}}async signInWithIdToken(t){try{const{provider:e,token:n}=t,i=await this.http.post("/api/auth/id-token?client_type=mobile",{provider:e,token:n},{credentials:"include"});return this.saveSessionFromResponse(i),i.refreshToken&&this.http.setRefreshToken(i.refreshToken),{data:i,error:null}}catch(e){return Yi(e,"An unexpected error occurred during ID token sign in")}}async refreshSession(t){try{if(this.isServerMode()&&!t?.refreshToken)return{data:null,error:new Gt("refreshToken is required when refreshing session in server mode",400,"REFRESH_TOKEN_REQUIRED")};const e=this.isServerMode()?null:qM(),n=await this.http.post(this.isServerMode()?"/api/auth/refresh?client_type=mobile":"/api/auth/refresh",this.isServerMode()?{refresh_token:t?.refreshToken}:void 0,{headers:e?{"X-CSRF-Token":e}:{},credentials:"include"});return n.accessToken&&this.saveSessionFromResponse(n),{data:n,error:null}}catch(e){return Yi(e,"An unexpected error occurred during session refresh")}}async getCurrentUser(){await this.authCallbackHandled;try{if(this.isServerMode()){const e=this.tokenManager.getAccessToken();return e?(this.http.setAuthToken(e),{data:{user:(await this.http.get("/api/auth/sessions/current")).user??null},error:null}):{data:{user:null},error:null}}const t=this.tokenManager.getSession();if(t)return this.http.setAuthToken(t.accessToken),{data:{user:t.user},error:null};if(typeof window<"u"){const{data:e,error:n}=await this.refreshSession();if(n)return{data:{user:null},error:n};if(e?.accessToken)return{data:{user:e.user??null},error:null}}return{data:{user:null},error:null}}catch(t){return t instanceof Gt?{data:{user:null},error:t}:{data:{user:null},error:new Gt("An unexpected error occurred while getting user",500,"UNEXPECTED_ERROR")}}}async getProfile(t){try{return{data:await this.http.get(`/api/auth/profiles/${t}`),error:null}}catch(e){return Yi(e,"An unexpected error occurred while fetching user profile")}}async setProfile(t){try{const e=await this.http.patch("/api/auth/profiles/current",{profile:t}),n=this.tokenManager.getUser();return!this.isServerMode()&&n&&e.profile!==void 0&&this.tokenManager.setUser({...n,profile:e.profile}),{data:e,error:null}}catch(e){return Yi(e,"An unexpected error occurred while updating user profile")}}async resendVerificationEmail(t){try{return{data:await this.http.post("/api/auth/email/send-verification",t),error:null}}catch(e){return Yi(e,"An unexpected error occurred while sending verification email")}}async verifyEmail(t){try{const e=await this.http.post(this.isServerMode()?"/api/auth/email/verify?client_type=mobile":"/api/auth/email/verify",t,{credentials:"include"});return this.saveSessionFromResponse(e),e.refreshToken&&this.http.setRefreshToken(e.refreshToken),{data:e,error:null}}catch(e){return Yi(e,"An unexpected error occurred while verifying email")}}async sendResetPasswordEmail(t){try{return{data:await this.http.post("/api/auth/email/send-reset-password",t),error:null}}catch(e){return Yi(e,"An unexpected error occurred while sending password reset email")}}async exchangeResetPasswordToken(t){try{return{data:await this.http.post("/api/auth/email/exchange-reset-password-token",t),error:null}}catch(e){return Yi(e,"An unexpected error occurred while verifying reset code")}}async resetPassword(t){try{return{data:await this.http.post("/api/auth/email/reset-password",t),error:null}}catch(e){return Yi(e,"An unexpected error occurred while resetting password")}}async getPublicAuthConfig(){try{return{data:await this.http.get("/api/auth/public-config"),error:null}}catch(t){return Yi(t,"An unexpected error occurred while fetching auth configuration")}}};function eI(t,e){return async(n,i)=>{const r=typeof n=="string"?n:n.toString(),s=new URL(r),o=s.pathname.slice(1),c=o.match(/^rpc\/(.+)$/),u=c?`/api/database/rpc/${c[1]}`:`/api/database/records/${o}`,f=`${t.baseUrl}${u}${s.search}`,h=e.getAccessToken(),p=t.getHeaders(),m=h||p.Authorization?.replace("Bearer ",""),v=new Headers(i?.headers);return m&&!v.has("Authorization")&&v.set("Authorization",`Bearer ${m}`),await fetch(f,{...i,headers:v})}}var tI=class{constructor(t,e){this.postgrest=new Y3("http://dummy",{fetch:eI(t,e),headers:{}})}from(t){return this.postgrest.from(t)}rpc(t,e,n){return this.postgrest.rpc(t,e,n)}},nI=class{constructor(t,e){this.bucketName=t,this.http=e}async upload(t,e){try{const n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:t,contentType:e.type||"application/octet-stream",size:e.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,e);if(n.method==="direct"){const i=new FormData;return i.append("file",e),{data:await this.http.request("PUT",`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(t)}`,{body:i,headers:{}}),error:null}}throw new Gt(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(n){return{data:null,error:n instanceof Gt?n:new Gt("Upload failed",500,"STORAGE_ERROR")}}}async uploadAuto(t){try{const e=t instanceof File?t.name:"file",n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:e,contentType:t.type||"application/octet-stream",size:t.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,t);if(n.method==="direct"){const i=new FormData;return i.append("file",t),{data:await this.http.request("POST",`/api/storage/buckets/${this.bucketName}/objects`,{body:i,headers:{}}),error:null}}throw new Gt(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(e){return{data:null,error:e instanceof Gt?e:new Gt("Upload failed",500,"STORAGE_ERROR")}}}async uploadWithPresignedUrl(t,e){try{const n=new FormData;t.fields&&Object.entries(t.fields).forEach(([r,s])=>{n.append(r,s)}),n.append("file",e);const i=await fetch(t.uploadUrl,{method:"POST",body:n});if(!i.ok)throw new Gt(`Upload to storage failed: ${i.statusText}`,i.status,"STORAGE_ERROR");return t.confirmRequired&&t.confirmUrl?{data:await this.http.post(t.confirmUrl,{size:e.size,contentType:e.type||"application/octet-stream"}),error:null}:{data:{key:t.key,bucket:this.bucketName,size:e.size,mimeType:e.type||"application/octet-stream",uploadedAt:new Date().toISOString(),url:this.getPublicUrl(t.key)},error:null}}catch(n){throw n instanceof Gt?n:new Gt("Presigned upload failed",500,"STORAGE_ERROR")}}async download(t){try{const e=await this.http.post(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(t)}/download-strategy`,{expiresIn:3600}),n=e.url,i={};e.method==="direct"&&Object.assign(i,this.http.getHeaders());const r=await fetch(n,{method:"GET",headers:i});if(!r.ok)try{const o=await r.json();throw Gt.fromApiError(o)}catch{throw new Gt(`Download failed: ${r.statusText}`,r.status,"STORAGE_ERROR")}return{data:await r.blob(),error:null}}catch(e){return{data:null,error:e instanceof Gt?e:new Gt("Download failed",500,"STORAGE_ERROR")}}}getPublicUrl(t){return`${this.http.baseUrl}/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(t)}`}async list(t){try{const e={};return t?.prefix&&(e.prefix=t.prefix),t?.search&&(e.search=t.search),t?.limit&&(e.limit=t.limit.toString()),t?.offset&&(e.offset=t.offset.toString()),{data:await this.http.get(`/api/storage/buckets/${this.bucketName}/objects`,{params:e}),error:null}}catch(e){return{data:null,error:e instanceof Gt?e:new Gt("List failed",500,"STORAGE_ERROR")}}}async remove(t){try{return{data:await this.http.delete(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(t)}`),error:null}}catch(e){return{data:null,error:e instanceof Gt?e:new Gt("Delete failed",500,"STORAGE_ERROR")}}}},iI=class{constructor(t){this.http=t}from(t){return new nI(t,this.http)}},rI=class{constructor(t){this.http=t,this.chat=new sI(t),this.images=new lI(t),this.embeddings=new oI(t)}},sI=class{constructor(t){this.completions=new aI(t)}},aI=class{constructor(t){this.http=t}async create(t){const e={model:t.model,messages:t.messages,temperature:t.temperature,maxTokens:t.maxTokens,topP:t.topP,stream:t.stream,webSearch:t.webSearch,fileParser:t.fileParser,thinking:t.thinking,tools:t.tools,toolChoice:t.toolChoice,parallelToolCalls:t.parallelToolCalls};if(t.stream){const r=this.http.getHeaders();r["Content-Type"]="application/json";const s=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:r,body:JSON.stringify(e)});if(!s.ok){const o=await s.json();throw new Error(o.error||"Stream request failed")}return this.parseSSEStream(s,t.model)}const n=await this.http.post("/api/ai/chat/completion",e),i=n.text||"";return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:n.metadata?.model,choices:[{index:0,message:{role:"assistant",content:i,...n.tool_calls?.length&&{tool_calls:n.tool_calls},...n.annotations?.length&&{annotations:n.annotations}},finish_reason:n.tool_calls?.length?"tool_calls":"stop"}],usage:n.metadata?.usage||{prompt_tokens:0,completion_tokens:0,total_tokens:0}}}async*parseSSEStream(t,e){const n=t.body.getReader(),i=new TextDecoder;let r="";try{for(;;){const{done:s,value:o}=await n.read();if(s)break;r+=i.decode(o,{stream:!0});const c=r.split(`
42
- `);r=c.pop()||"";for(const u of c)if(u.startsWith("data: ")){const f=u.slice(6).trim();if(f)try{const h=JSON.parse(f);if((h.chunk||h.content)&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:e,choices:[{index:0,delta:{content:h.chunk||h.content},finish_reason:null}]}),h.tool_calls?.length&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:e,choices:[{index:0,delta:{tool_calls:h.tool_calls},finish_reason:"tool_calls"}]}),h.done){n.releaseLock();return}}catch{console.warn("Failed to parse SSE data:",f)}}}}finally{n.releaseLock()}}},oI=class{constructor(t){this.http=t}async create(t){const e=await this.http.post("/api/ai/embeddings",t);return{object:e.object,data:e.data,model:e.metadata?.model,usage:e.metadata?.usage?{prompt_tokens:e.metadata.usage.promptTokens||0,total_tokens:e.metadata.usage.totalTokens||0}:{prompt_tokens:0,total_tokens:0}}}},lI=class{constructor(t){this.http=t}async generate(t){const e=await this.http.post("/api/ai/image/generation",t);let n=[];return e.images&&e.images.length>0?n=e.images.map(i=>({b64_json:i.imageUrl.replace(/^data:image\/\w+;base64,/,""),content:e.text})):e.text&&(n=[{content:e.text}]),{created:Math.floor(Date.now()/1e3),data:n,...e.metadata?.usage&&{usage:{total_tokens:e.metadata.usage.totalTokens||0,input_tokens:e.metadata.usage.promptTokens||0,output_tokens:e.metadata.usage.completionTokens||0}}}}},cI=class QM{constructor(e,n){this.http=e,this.functionsUrl=n||QM.deriveSubhostingUrl(e.baseUrl)}static deriveSubhostingUrl(e){try{const{hostname:n}=new URL(e);return n.endsWith(".insforge.app")?`https://${n.split(".")[0]}.functions.insforge.app`:void 0}catch{return}}async invoke(e,n={}){const{method:i="POST",body:r,headers:s={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(i,`${this.functionsUrl}/${e}`,{body:r,headers:s}),error:null}}catch(o){if(o instanceof Error&&o.name==="AbortError")throw o;if(!(o instanceof Gt&&o.statusCode===404))return{data:null,error:o instanceof Gt?o:new Gt(o instanceof Error?o.message:"Function invocation failed",500,"FUNCTION_ERROR")}}try{const o=`/functions/${e}`;return{data:await this.http.request(i,o,{body:r,headers:s}),error:null}}catch(o){if(o instanceof Error&&o.name==="AbortError")throw o;return{data:null,error:o instanceof Gt?o:new Gt(o instanceof Error?o.message:"Function invocation failed",500,"FUNCTION_ERROR")}}}},RS=1e4,uI=class{constructor(t,e,n){this.socket=null,this.connectPromise=null,this.subscribedChannels=new Set,this.eventListeners=new Map,this.baseUrl=t,this.tokenManager=e,this.anonKey=n,this.tokenManager.onTokenChange=()=>this.onTokenChange()}notifyListeners(t,e){const n=this.eventListeners.get(t);if(n)for(const i of n)try{i(e)}catch(r){console.error(`Error in ${t} callback:`,r)}}connect(){return this.socket?.connected?Promise.resolve():this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((t,e)=>{const n=this.tokenManager.getAccessToken()??this.anonKey;this.socket=Tf(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let i=!0,r=null;const s=()=>{r&&(clearTimeout(r),r=null)};r=setTimeout(()=>{i&&(i=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,e(new Error(`Connection timeout after ${RS}ms`)))},RS),this.socket.on("connect",()=>{s();for(const o of this.subscribedChannels)this.socket.emit("realtime:subscribe",{channel:o});this.notifyListeners("connect"),i&&(i=!1,this.connectPromise=null,t())}),this.socket.on("connect_error",o=>{s(),this.notifyListeners("connect_error",o),i&&(i=!1,this.connectPromise=null,e(o))}),this.socket.on("disconnect",o=>{this.notifyListeners("disconnect",o)}),this.socket.on("realtime:error",o=>{this.notifyListeners("error",o)}),this.socket.onAny((o,c)=>{o!=="realtime:error"&&this.notifyListeners(o,c)})}),this.connectPromise)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null),this.subscribedChannels.clear()}onTokenChange(){const t=this.tokenManager.getAccessToken()??this.anonKey;this.socket&&(this.socket.auth=t?{token:t}:{}),this.socket&&(this.socket.connected||this.connectPromise)&&(this.socket.disconnect(),this.socket.connect())}get isConnected(){return this.socket?.connected??!1}get connectionState(){return this.socket?this.socket.connected?"connected":"connecting":"disconnected"}get socketId(){return this.socket?.id}async subscribe(t){if(this.subscribedChannels.has(t))return{ok:!0,channel:t};if(!this.socket?.connected)try{await this.connect()}catch(e){const n=e instanceof Error?e.message:"Connection failed";return{ok:!1,channel:t,error:{code:"CONNECTION_FAILED",message:n}}}return new Promise(e=>{this.socket.emit("realtime:subscribe",{channel:t},n=>{n.ok&&this.subscribedChannels.add(t),e(n)})})}unsubscribe(t){this.subscribedChannels.delete(t),this.socket?.connected&&this.socket.emit("realtime:unsubscribe",{channel:t})}async publish(t,e,n){if(!this.socket?.connected)throw new Error("Not connected to realtime server. Call connect() first.");this.socket.emit("realtime:publish",{channel:t,event:e,payload:n})}on(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(e)}off(t,e){const n=this.eventListeners.get(t);n&&(n.delete(e),n.size===0&&this.eventListeners.delete(t))}once(t,e){const n=i=>{this.off(t,n),e(i)};this.on(t,n)}getSubscribedChannels(){return Array.from(this.subscribedChannels)}},dI=class{constructor(t){this.http=t}async send(t){try{return{data:await this.http.post("/api/email/send-raw",t),error:null}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{data:null,error:e instanceof Gt?e:new Gt(e instanceof Error?e.message:"Email send failed",500,"EMAIL_ERROR")}}}},fI=class{constructor(t={}){const e=new XM(t.debug);this.tokenManager=new ZM,this.http=new qN(t,this.tokenManager,e),t.edgeFunctionToken&&(this.http.setAuthToken(t.edgeFunctionToken),this.tokenManager.setAccessToken(t.edgeFunctionToken)),this.auth=new QN(this.http,this.tokenManager,{isServerMode:t.isServerMode??!1}),this.database=new tI(this.http,this.tokenManager),this.storage=new iI(this.http),this.ai=new rI(this.http),this.functions=new cI(this.http,t.functionsUrl),this.realtime=new uI(this.http.baseUrl,this.tokenManager,t.anonKey),this.emails=new dI(this.http)}getHttpClient(){return this.http}};function hI(t){return new fI(t)}const ty={VITE_INSFORGE_ANON_KEY:"ik_68e892cf2095c194c6a3e35d1960bc84",VITE_INSFORGE_BASE_URL:"https://b46ug8xu.us-east.insforge.app"};function Co(){const t=typeof import.meta<"u"?ty:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function eT(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return window.location.origin;const e=typeof import.meta<"u"?ty:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function Ah(){const t=typeof import.meta<"u"?ty:void 0;return(t?.VITE_INSFORGE_ANON_KEY||t?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||"").trim()}function r0(){return!!eT()}let km=null;function pI(){return r0()?(km||(km=hI({baseUrl:eT(),anonKey:Ah()||void 0,autoRefreshToken:!0})),km):null}const tT="tokentracker_cloud_sync_enabled",ny="tokentracker_cloud_device_session_v1",iy="tokentracker_cloud_last_sync_ts";function nT(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"}function iT(){try{const t=localStorage.getItem(tT);return t===null||t===""?!1:t==="1"||t==="true"}catch{return!1}}function mI(t){try{localStorage.setItem(tT,t?"1":"0")}catch{}}function rT(){try{const t=localStorage.getItem(ny);if(!t)return null;const e=JSON.parse(t);if(typeof e?.token=="string"&&e.token&&typeof e.deviceId=="string")return e}catch{}return null}function sT(t){try{localStorage.setItem(ny,JSON.stringify(t))}catch{}}function gI(){try{localStorage.removeItem(ny),localStorage.removeItem(iy)}catch{}}function vI(){try{const t=Number(localStorage.getItem(iy));return Number.isFinite(t)?t:0}catch{return 0}}function aT(t){try{localStorage.setItem(iy,String(t))}catch{}}function io(t){if(typeof t!="string")return null;const e=t.trim();return e.length>0?e:null}function yI(t){const e=io(t);if(!e)return null;const n=e.split(".");if(n.length<2)return null;const i=n[1];try{const r=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("utf8"),c=JSON.parse(s)?.exp;return typeof c!="number"||!Number.isFinite(c)||c<=0?null:Math.floor(c*1e3)}catch{return null}}function _I(t,e=3e4){const n=yI(t);return n?n<=Date.now()+Math.max(0,Number(e)||0):!1}async function xI(t){if(!t)return null;if(typeof t=="string")return io(t);if(typeof t=="function")try{const e=await t();return io(e)}catch{return null}if(typeof t=="object"){if(typeof t.getAccessToken=="function"){try{const e=await t.getAccessToken(),n=io(e);if(n)return n}catch{}return io(t.accessToken)}return null}return io(t)}async function Lm(t,e={}){const n=Math.max(1,Math.min(12,Math.floor(Number(e.maxAttempts)||8))),i=Math.max(20,Math.floor(Number(e.baseDelayMs)||50));for(let r=0;r<n;r++){const s=await xI(t);if(s)return s;r<n-1&&await new Promise(o=>setTimeout(o,i*(r+1)))}return null}function e$(t){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")||typeof t=="function"||t&&typeof t=="object"&&typeof t.getAccessToken=="function"?!0:!!io(t)}const oT=N.createContext(null);function PS(t){if(!t||typeof t!="object")return null;const e=t,n=e.session&&typeof e.session=="object"?e.session:null,i=typeof e.accessToken=="string"&&e.accessToken||typeof e.access_token=="string"&&e.access_token||n&&typeof n.accessToken=="string"&&n.accessToken||n&&typeof n.access_token=="string"&&n.access_token||null;return i&&i.length>0?i:null}async function bI(t,e={}){if(!t)return null;const n=Math.max(0,Math.floor(Number(e.skewMs)||6e4)),i=t.tokenManager,r=()=>i?.getAccessToken?.()??i?.getSession?.()?.accessToken??null;let s=r();if(!s||_I(s,n)){const{data:o}=await t.auth.refreshSession();if(s=r()??PS(o)??null,!s&&typeof t.auth.getCurrentUser=="function")try{await t.auth.getCurrentUser(),s=r()??PS(o)??null}catch{}}return s||null}function SI({children:t}){const[e,n]=N.useState(null),[i,r]=N.useState(null),[s,o]=N.useState(!0);N.useEffect(()=>{if(!r0()){n(null),r(null),o(!1);return}n(pI())},[]),N.useEffect(()=>{if(!e)return;let w=!0;return o(!0),(async()=>{try{let{data:y,error:x}=await e.auth.getCurrentUser();if(!w)return;if(!x&&!y?.user){if(await new Promise(A=>setTimeout(A,150)),!w)return;const M=await e.auth.getCurrentUser();y=M.data,x=M.error}if(x){r(null);return}r(y?.user??null)}catch{w&&r(null)}finally{w&&o(!1)}})(),()=>{w=!1}},[e]);const c=N.useCallback(async()=>{if(e)try{let{data:w,error:y}=await e.auth.getCurrentUser();if(!y&&!w?.user){await new Promise(M=>setTimeout(M,150));const x=await e.auth.getCurrentUser();w=x.data,y=x.error}if(y){r(null);return}r(w?.user??null)}catch{r(null)}},[e]),u=N.useCallback(async(w,y)=>{if(!e)return{error:new Error("InsForge client not configured")};const x=typeof y=="string"&&y.trim()?y.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return e.auth.signInWithOAuth({provider:w,redirectTo:x,skipBrowserRedirect:!1})},[e]),f=N.useCallback(async w=>{if(!e)return{data:null,error:new Error("InsForge client not configured")};const{data:y,error:x}=await e.auth.signInWithPassword(w);return y?.user&&r(y.user),{data:y,error:x}},[e]),h=N.useCallback(async w=>{if(!e)return{data:null,error:new Error("InsForge client not configured")};const{data:y,error:x}=await e.auth.signUp(w);return y?.user&&y?.accessToken&&r(y.user),{data:y,error:x}},[e]),p=N.useCallback(async()=>e?e.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[e]),m=N.useCallback(async()=>{e&&(await e.auth.signOut(),gI(),r(null))},[e]),v=N.useCallback(async()=>bI(e),[e]),_=N.useMemo(()=>!r0()||!e?{enabled:!1,client:null,user:null,signedIn:!1,loading:!1,refreshUser:async()=>{},signInWithOAuth:async()=>({error:new Error("InsForge not configured")}),signInWithPassword:async()=>({data:null,error:new Error("InsForge not configured")}),signUp:async()=>({data:null,error:new Error("InsForge not configured")}),getPublicAuthConfig:async()=>({data:null,error:new Error("InsForge not configured")}),signOut:async()=>{},getAccessToken:async()=>null}:{enabled:!0,client:e,user:i,signedIn:!!i,loading:s,refreshUser:c,signInWithOAuth:u,signInWithPassword:f,signUp:h,getPublicAuthConfig:p,signOut:m,getAccessToken:v},[e,i,s,c,u,f,h,p,m,v]);return B.jsx(oT.Provider,{value:_,children:t})}function $l(){return N.useContext(oT)}const wI="modulepreload",EI=function(t){return"/"+t},kS={},ry=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let u=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");r=u(n.map(f=>{if(f=EI(f),f in kS)return;kS[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":wI,h||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((v,_)=>{m.addEventListener("load",v),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return r.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var eh={},MI=()=>{window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)})},TI="@vercel/analytics",AI="2.0.1";function lT(){return typeof window<"u"}function cT(){try{const t="production"}catch{}return"production"}function CI(t="auto"){if(t==="auto"){window.vam=cT();return}window.vam=t}function RI(){return(lT()?window.vam:cT())||"production"}function sy(){return RI()==="development"}function PI(t){return t.scriptSrc?Ml(t.scriptSrc):sy()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?Ml(`${t.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function kI(t,e){var n;let i=t;if(e)try{i={...(n=JSON.parse(e))==null?void 0:n.analytics,...t}}catch{}CI(i.mode);const r={sdkn:TI+(i.framework?`/${i.framework}`:""),sdkv:AI};return i.disableAutoTrack&&(r.disableAutoTrack="1"),i.viewEndpoint&&(r.viewEndpoint=Ml(i.viewEndpoint)),i.eventEndpoint&&(r.eventEndpoint=Ml(i.eventEndpoint)),i.sessionEndpoint&&(r.sessionEndpoint=Ml(i.sessionEndpoint)),sy()&&i.debug===!1&&(r.debug="false"),i.dsn&&(r.dsn=i.dsn),i.endpoint?r.endpoint=i.endpoint:i.basePath&&(r.endpoint=Ml(`${i.basePath}/insights`)),{beforeSend:i.beforeSend,src:PI(i),dataset:r}}function Ml(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function LI(t={debug:!0},e){var n;if(!lT())return;const{beforeSend:i,src:r,dataset:s}=kI(t,e);if(MI(),i&&((n=window.va)==null||n.call(window,"beforeSend",i)),document.head.querySelector(`script[src*="${r}"]`))return;const o=document.createElement("script");o.src=r;for(const[c,u]of Object.entries(s))o.dataset[c]=u;o.defer=!0,o.onerror=()=>{const c=sy()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${r}. ${c}`)},document.head.appendChild(o)}function DI({route:t,path:e}){var n;(n=window.va)==null||n.call(window,"pageview",{route:t,path:e})}function NI(){if(!(typeof process>"u"||typeof eh>"u"))return eh.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function II(){if(!(typeof process>"u"||typeof eh>"u"))return eh.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function UI(t){return N.useEffect(()=>{var e;t.beforeSend&&((e=window.va)==null||e.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]),N.useEffect(()=>{LI({framework:t.framework||"react",basePath:t.basePath??NI(),...t.route!==void 0&&{disableAutoTrack:!0},...t},t.configString??II())},[]),N.useEffect(()=>{t.route&&t.path&&DI({route:t.route,path:t.path})},[t.route,t.path]),null}var th={},FI=()=>{window.si||(window.si=function(...e){window.siq=window.siq||[],window.siq.push(e)})},OI="@vercel/speed-insights",BI="2.0.0";function zI(){return typeof window<"u"}function VI(){try{const t="production"}catch{}return"production"}function uT(){return VI()==="development"}function HI(t){return t.scriptSrc?nh(t.scriptSrc):uT()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":t.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":t.basePath?nh(`${t.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function GI(t,e){var n;let i=t;if(e)try{i={...(n=JSON.parse(e))==null?void 0:n.speedInsights,...t}}catch{}const r={sdkn:OI+(i.framework?`/${i.framework}`:""),sdkv:BI};return i.sampleRate&&(r.sampleRate=i.sampleRate.toString()),i.route&&(r.route=i.route),uT()&&i.debug===!1&&(r.debug="false"),i.dsn&&(r.dsn=i.dsn),i.endpoint?r.endpoint=nh(i.endpoint):i.basePath&&(r.endpoint=nh(`${i.basePath}/speed-insights/vitals`)),{src:HI(i),beforeSend:i.beforeSend,dataset:r}}function nh(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function WI(t={},e){var n;if(!zI()||t.route===null)return null;FI();const{beforeSend:i,src:r,dataset:s}=GI(t,e);if(document.head.querySelector(`script[src*="${r}"]`))return null;i&&((n=window.si)==null||n.call(window,"beforeSend",i));const o=document.createElement("script");o.src=r,o.defer=!0;for(const[c,u]of Object.entries(s))o.dataset[c]=u;return o.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(o),{setRoute:c=>{o.dataset.route=c??void 0}}}function jI(){if(!(typeof process>"u"||typeof th>"u"))return th.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function $I(){if(!(typeof process>"u"||typeof th>"u"))return th.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function XI(t){N.useEffect(()=>{var n;t.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]);const e=N.useRef(null);return N.useEffect(()=>{if(!e.current){const n=WI({framework:t.framework??"react",basePath:t.basePath??jI(),...t},t.configString??$I());n&&(e.current=n.setRoute)}},[t]),N.useEffect(()=>{e.current&&t.route&&e.current(t.route)},[t.route]),null}function Ch(){return typeof window<"u"}function ay(t){return dT(t)?(t.nodeName||"").toLowerCase():"#document"}function Xl(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function qI(t){var e;return(e=(dT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dT(t){return Ch()?t instanceof Node||t instanceof Xl(t).Node:!1}function fT(t){return Ch()?t instanceof Element||t instanceof Xl(t).Element:!1}function oy(t){return Ch()?t instanceof HTMLElement||t instanceof Xl(t).HTMLElement:!1}function LS(t){return!Ch()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xl(t).ShadowRoot}function hT(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=mT(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function t$(t){return/^(table|td|th)$/.test(ay(t))}function YI(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const KI=/transform|translate|scale|rotate|perspective|filter/,ZI=/paint|layout|strict|content/,$a=t=>!!t&&t!=="none";let Dm;function JI(t){const e=fT(t)?mT(t):t;return $a(e.transform)||$a(e.translate)||$a(e.scale)||$a(e.rotate)||$a(e.perspective)||!QI()&&($a(e.backdropFilter)||$a(e.filter))||KI.test(e.willChange||"")||ZI.test(e.contain||"")}function n$(t){let e=s0(t);for(;oy(e)&&!pT(e);){if(JI(e))return e;if(YI(e))return null;e=s0(e)}return null}function QI(){return Dm==null&&(Dm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Dm}function pT(t){return/^(html|body|#document)$/.test(ay(t))}function mT(t){return Xl(t).getComputedStyle(t)}function i$(t){return fT(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function s0(t){if(ay(t)==="html")return t;const e=t.assignedSlot||t.parentNode||LS(t)&&t.host||qI(t);return LS(e)?e.host:e}function gT(t){const e=s0(t);return pT(e)?t.ownerDocument?t.ownerDocument.body:t.body:oy(e)&&hT(e)?e:gT(e)}function DS(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=gT(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=Xl(r);if(s){const c=eU(o);return e.concat(o,o.visualViewport||[],hT(r)?r:[],c&&n?DS(c):[])}else return e.concat(r,DS(r,[],n))}function eU(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const NS={};function ly(t,e){const n=N.useRef(NS);return n.current===NS&&(n.current=t(e)),n}const Nm=k1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],tU=Nm&&Nm!==N.useLayoutEffect?Nm:t=>t();function IS(t){const e=ly(nU).current;return e.next=t,tU(e.effect),e.trampoline}function nU(){const t={next:void 0,callback:iU,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function iU(){}const rU=()=>{},sU=typeof document<"u"?N.useLayoutEffect:rU;function a0(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const nu={};function vT(t,e,n,i,r){let s={...o0(t,nu)};return e&&(s=Af(s,e)),n&&(s=Af(s,n)),i&&(s=Af(s,i)),s}function aU(t){if(t.length===0)return nu;if(t.length===1)return o0(t[0],nu);let e={...o0(t[0],nu)};for(let n=1;n<t.length;n+=1)e=Af(e,t[n]);return e}function Af(t,e){return yT(e)?e(t):oU(t,e)}function oU(t,e){if(!e)return t;for(const n in e){const i=e[n];switch(n){case"style":{t[n]=a0(t.style,i);break}case"className":{t[n]=_T(t.className,i);break}default:lU(n,i)?t[n]=cU(t[n],i):t[n]=i}}return t}function lU(t,e){const n=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2);return n===111&&i===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function yT(t){return typeof t=="function"}function o0(t,e){return yT(t)?t(e):t??nu}function cU(t,e){return e?t?n=>{if(uU(n)){const r=n;l0(r);const s=e(r);return r.baseUIHandlerPrevented||t?.(r),s}const i=e(n);return t?.(n),i}:e:t}function l0(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function _T(t,e){return e?t?e+" "+t:e:t}function uU(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function xT(t,...e){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",t.toString()),e.forEach(i=>n.searchParams.append("args[]",i)),`Base UI error #${t}; visit ${n} for the full message.`}const dU=N.createContext(void 0);function fU(t=!1){const e=N.useContext(dU);if(e===void 0&&!t)throw new Error(xT(16));return e}function hU(t){const{focusableWhenDisabled:e,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=t,o=i&&e!==!1,c=i&&e===!1;return{props:N.useMemo(()=>{const f={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return i||(f.tabIndex=r,!s&&n&&(f.tabIndex=e?r:-1)),(s&&(e||o)||!s&&n)&&(f["aria-disabled"]=n),s&&(!e||c)&&(f.disabled=n),f},[i,n,e,o,c,s,r])}}function pU(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0}=t,s=N.useRef(null),o=fU(!0)!==void 0,c=IS(()=>{const m=s.current;return!!(m?.tagName==="A"&&m?.href)}),{props:u}=hU({focusableWhenDisabled:n,disabled:e,composite:o,tabIndex:i,isNativeButton:r}),f=N.useCallback(()=>{const m=s.current;mU(m)&&o&&e&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[e,u.disabled,o]);sU(f,[f]);const h=N.useCallback((m={})=>{const{onClick:v,onMouseDown:_,onKeyUp:w,onKeyDown:y,onPointerDown:x,...M}=m;return vT({type:r?"button":void 0,onClick(T){if(e){T.preventDefault();return}v?.(T)},onMouseDown(T){e||_?.(T)},onKeyDown(T){if(e||(l0(T),y?.(T)),T.baseUIHandlerPrevented)return;const D=T.target===T.currentTarget&&!r&&!c()&&!e,I=T.key==="Enter",U=T.key===" ";D&&((U||I)&&T.preventDefault(),I&&v?.(T))},onKeyUp(T){e||(l0(T),w?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!r&&!e&&T.key===" "&&v?.(T)},onPointerDown(T){if(e){T.preventDefault();return}x?.(T)}},r?void 0:{role:"button"},u,M)},[e,u,r,c]),p=IS(m=>{s.current=m,f()});return{getButtonProps:h,buttonRef:p}}function mU(t){return oy(t)&&t.tagName==="BUTTON"}function US(t,e,n,i){const r=ly(bT).current;return vU(r,t,e,n,i)&&ST(r,[t,e,n,i]),r.callback}function gU(t){const e=ly(bT).current;return yU(e,t)&&ST(e,t),e.callback}function bT(){return{callback:null,cleanup:null,refs:[]}}function vU(t,e,n,i,r){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==i||t.refs[3]!==r}function yU(t,e){return t.refs.length!==e.length||t.refs.some((n,i)=>n!==e[i])}function ST(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const i=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const o=s(n);typeof o=="function"&&(i[r]=o);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const o=i[r];typeof o=="function"?o():s(null);break}case"object":{s.current=null;break}}}}}}}const _U=parseInt(N.version,10);function xU(t){return _U>=t}function FS(t){if(!N.isValidElement(t))return null;const e=t,n=e.props;return(xU(19)?n?.ref:e.ref)??null}function bU(t,e){const n={};for(const i in t){const r=t[i];if(e?.hasOwnProperty(i)){const s=e[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function SU(t,e){return typeof t=="function"?t(e):t}function wU(t,e){return typeof t=="function"?t(e):t}function r$(){}const bl=Object.freeze({});function EU(t,e,n={}){const i=e.render,r=MU(e,n);if(n.enabled===!1)return null;const s=n.state??bl;return TU(t,i,r,s)}function MU(t,e={}){const{className:n,style:i,render:r}=t,{state:s=bl,ref:o,props:c,stateAttributesMapping:u,enabled:f=!0}=e,h=f?SU(n,s):void 0,p=f?wU(i,s):void 0,m=f?bU(s,u):bl,v=f?a0(m,Array.isArray(c)?aU(c):c)??bl:bl;return typeof document<"u"&&(f?Array.isArray(o)?v.ref=gU([v.ref,FS(r),...o]):v.ref=US(v.ref,FS(r),o):US(null,null)),f?(h!==void 0&&(v.className=_T(v.className,h)),p!==void 0&&(v.style=a0(v.style,p)),v):bl}function TU(t,e,n,i){if(e){if(typeof e=="function")return e(n,i);const r=vT(n,e.props);return r.ref=n.ref,N.cloneElement(e,r)}if(t&&typeof t=="string")return AU(t,n);throw new Error(xT(8))}function AU(t,e){return t==="button"?N.createElement("button",{type:"button",...e,key:e.key}):t==="img"?N.createElement("img",{alt:"",...e,key:e.key}):N.createElement(t,e)}const CU=N.forwardRef(function(e,n){const{render:i,className:r,disabled:s=!1,focusableWhenDisabled:o=!1,nativeButton:c=!0,...u}=e,{getButtonProps:f,buttonRef:h}=pU({disabled:s,focusableWhenDisabled:o,native:c}),p=N.useMemo(()=>({disabled:s}),[s]);return EU("button",e,{state:p,ref:[n,h],props:[u,f]})}),RU=`key,module,page,component,slot,text,notes,status
42
+ `);r=c.pop()||"";for(const u of c)if(u.startsWith("data: ")){const f=u.slice(6).trim();if(f)try{const h=JSON.parse(f);if((h.chunk||h.content)&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:e,choices:[{index:0,delta:{content:h.chunk||h.content},finish_reason:null}]}),h.tool_calls?.length&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:e,choices:[{index:0,delta:{tool_calls:h.tool_calls},finish_reason:"tool_calls"}]}),h.done){n.releaseLock();return}}catch{console.warn("Failed to parse SSE data:",f)}}}}finally{n.releaseLock()}}},oI=class{constructor(t){this.http=t}async create(t){const e=await this.http.post("/api/ai/embeddings",t);return{object:e.object,data:e.data,model:e.metadata?.model,usage:e.metadata?.usage?{prompt_tokens:e.metadata.usage.promptTokens||0,total_tokens:e.metadata.usage.totalTokens||0}:{prompt_tokens:0,total_tokens:0}}}},lI=class{constructor(t){this.http=t}async generate(t){const e=await this.http.post("/api/ai/image/generation",t);let n=[];return e.images&&e.images.length>0?n=e.images.map(i=>({b64_json:i.imageUrl.replace(/^data:image\/\w+;base64,/,""),content:e.text})):e.text&&(n=[{content:e.text}]),{created:Math.floor(Date.now()/1e3),data:n,...e.metadata?.usage&&{usage:{total_tokens:e.metadata.usage.totalTokens||0,input_tokens:e.metadata.usage.promptTokens||0,output_tokens:e.metadata.usage.completionTokens||0}}}}},cI=class QM{constructor(e,n){this.http=e,this.functionsUrl=n||QM.deriveSubhostingUrl(e.baseUrl)}static deriveSubhostingUrl(e){try{const{hostname:n}=new URL(e);return n.endsWith(".insforge.app")?`https://${n.split(".")[0]}.functions.insforge.app`:void 0}catch{return}}async invoke(e,n={}){const{method:i="POST",body:r,headers:s={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(i,`${this.functionsUrl}/${e}`,{body:r,headers:s}),error:null}}catch(o){if(o instanceof Error&&o.name==="AbortError")throw o;if(!(o instanceof Gt&&o.statusCode===404))return{data:null,error:o instanceof Gt?o:new Gt(o instanceof Error?o.message:"Function invocation failed",500,"FUNCTION_ERROR")}}try{const o=`/functions/${e}`;return{data:await this.http.request(i,o,{body:r,headers:s}),error:null}}catch(o){if(o instanceof Error&&o.name==="AbortError")throw o;return{data:null,error:o instanceof Gt?o:new Gt(o instanceof Error?o.message:"Function invocation failed",500,"FUNCTION_ERROR")}}}},RS=1e4,uI=class{constructor(t,e,n){this.socket=null,this.connectPromise=null,this.subscribedChannels=new Set,this.eventListeners=new Map,this.baseUrl=t,this.tokenManager=e,this.anonKey=n,this.tokenManager.onTokenChange=()=>this.onTokenChange()}notifyListeners(t,e){const n=this.eventListeners.get(t);if(n)for(const i of n)try{i(e)}catch(r){console.error(`Error in ${t} callback:`,r)}}connect(){return this.socket?.connected?Promise.resolve():this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((t,e)=>{const n=this.tokenManager.getAccessToken()??this.anonKey;this.socket=Tf(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let i=!0,r=null;const s=()=>{r&&(clearTimeout(r),r=null)};r=setTimeout(()=>{i&&(i=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,e(new Error(`Connection timeout after ${RS}ms`)))},RS),this.socket.on("connect",()=>{s();for(const o of this.subscribedChannels)this.socket.emit("realtime:subscribe",{channel:o});this.notifyListeners("connect"),i&&(i=!1,this.connectPromise=null,t())}),this.socket.on("connect_error",o=>{s(),this.notifyListeners("connect_error",o),i&&(i=!1,this.connectPromise=null,e(o))}),this.socket.on("disconnect",o=>{this.notifyListeners("disconnect",o)}),this.socket.on("realtime:error",o=>{this.notifyListeners("error",o)}),this.socket.onAny((o,c)=>{o!=="realtime:error"&&this.notifyListeners(o,c)})}),this.connectPromise)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null),this.subscribedChannels.clear()}onTokenChange(){const t=this.tokenManager.getAccessToken()??this.anonKey;this.socket&&(this.socket.auth=t?{token:t}:{}),this.socket&&(this.socket.connected||this.connectPromise)&&(this.socket.disconnect(),this.socket.connect())}get isConnected(){return this.socket?.connected??!1}get connectionState(){return this.socket?this.socket.connected?"connected":"connecting":"disconnected"}get socketId(){return this.socket?.id}async subscribe(t){if(this.subscribedChannels.has(t))return{ok:!0,channel:t};if(!this.socket?.connected)try{await this.connect()}catch(e){const n=e instanceof Error?e.message:"Connection failed";return{ok:!1,channel:t,error:{code:"CONNECTION_FAILED",message:n}}}return new Promise(e=>{this.socket.emit("realtime:subscribe",{channel:t},n=>{n.ok&&this.subscribedChannels.add(t),e(n)})})}unsubscribe(t){this.subscribedChannels.delete(t),this.socket?.connected&&this.socket.emit("realtime:unsubscribe",{channel:t})}async publish(t,e,n){if(!this.socket?.connected)throw new Error("Not connected to realtime server. Call connect() first.");this.socket.emit("realtime:publish",{channel:t,event:e,payload:n})}on(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(e)}off(t,e){const n=this.eventListeners.get(t);n&&(n.delete(e),n.size===0&&this.eventListeners.delete(t))}once(t,e){const n=i=>{this.off(t,n),e(i)};this.on(t,n)}getSubscribedChannels(){return Array.from(this.subscribedChannels)}},dI=class{constructor(t){this.http=t}async send(t){try{return{data:await this.http.post("/api/email/send-raw",t),error:null}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{data:null,error:e instanceof Gt?e:new Gt(e instanceof Error?e.message:"Email send failed",500,"EMAIL_ERROR")}}}},fI=class{constructor(t={}){const e=new XM(t.debug);this.tokenManager=new ZM,this.http=new qN(t,this.tokenManager,e),t.edgeFunctionToken&&(this.http.setAuthToken(t.edgeFunctionToken),this.tokenManager.setAccessToken(t.edgeFunctionToken)),this.auth=new QN(this.http,this.tokenManager,{isServerMode:t.isServerMode??!1}),this.database=new tI(this.http,this.tokenManager),this.storage=new iI(this.http),this.ai=new rI(this.http),this.functions=new cI(this.http,t.functionsUrl),this.realtime=new uI(this.http.baseUrl,this.tokenManager,t.anonKey),this.emails=new dI(this.http)}getHttpClient(){return this.http}};function hI(t){return new fI(t)}const ty={VITE_INSFORGE_ANON_KEY:"ik_68e892cf2095c194c6a3e35d1960bc84",VITE_INSFORGE_BASE_URL:"https://b46ug8xu.us-east.insforge.app"};function Co(){const t=typeof import.meta<"u"?ty:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function eT(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return window.location.origin;const e=typeof import.meta<"u"?ty:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function Ah(){const t=typeof import.meta<"u"?ty:void 0;return(t?.VITE_INSFORGE_ANON_KEY||t?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||"").trim()}function r0(){return!!eT()}let km=null;function pI(){return r0()?(km||(km=hI({baseUrl:eT(),anonKey:Ah()||void 0,autoRefreshToken:!0})),km):null}const tT="tokentracker_cloud_sync_enabled",ny="tokentracker_cloud_device_session_v1",iy="tokentracker_cloud_last_sync_ts";function nT(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"}function iT(){try{const t=localStorage.getItem(tT);return t===null||t===""?!1:t==="1"||t==="true"}catch{return!1}}function mI(t){try{localStorage.setItem(tT,t?"1":"0")}catch{}}function rT(){try{const t=localStorage.getItem(ny);if(!t)return null;const e=JSON.parse(t);if(typeof e?.token=="string"&&e.token&&typeof e.deviceId=="string")return e}catch{}return null}function sT(t){try{localStorage.setItem(ny,JSON.stringify(t))}catch{}}function gI(){try{localStorage.removeItem(ny),localStorage.removeItem(iy)}catch{}}function vI(){try{const t=Number(localStorage.getItem(iy));return Number.isFinite(t)?t:0}catch{return 0}}function aT(t){try{localStorage.setItem(iy,String(t))}catch{}}function io(t){if(typeof t!="string")return null;const e=t.trim();return e.length>0?e:null}function yI(t){const e=io(t);if(!e)return null;const n=e.split(".");if(n.length<2)return null;const i=n[1];try{const r=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=typeof atob=="function"?atob(r):Buffer.from(r,"base64").toString("utf8"),c=JSON.parse(s)?.exp;return typeof c!="number"||!Number.isFinite(c)||c<=0?null:Math.floor(c*1e3)}catch{return null}}function _I(t,e=3e4){const n=yI(t);return n?n<=Date.now()+Math.max(0,Number(e)||0):!1}async function xI(t){if(!t)return null;if(typeof t=="string")return io(t);if(typeof t=="function")try{const e=await t();return io(e)}catch{return null}if(typeof t=="object"){if(typeof t.getAccessToken=="function"){try{const e=await t.getAccessToken(),n=io(e);if(n)return n}catch{}return io(t.accessToken)}return null}return io(t)}async function Lm(t,e={}){const n=Math.max(1,Math.min(12,Math.floor(Number(e.maxAttempts)||8))),i=Math.max(20,Math.floor(Number(e.baseDelayMs)||50));for(let r=0;r<n;r++){const s=await xI(t);if(s)return s;r<n-1&&await new Promise(o=>setTimeout(o,i*(r+1)))}return null}function e$(t){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")||typeof t=="function"||t&&typeof t=="object"&&typeof t.getAccessToken=="function"?!0:!!io(t)}const oT=N.createContext(null);function PS(t){if(!t||typeof t!="object")return null;const e=t,n=e.session&&typeof e.session=="object"?e.session:null,i=typeof e.accessToken=="string"&&e.accessToken||typeof e.access_token=="string"&&e.access_token||n&&typeof n.accessToken=="string"&&n.accessToken||n&&typeof n.access_token=="string"&&n.access_token||null;return i&&i.length>0?i:null}async function bI(t,e={}){if(!t)return null;const n=Math.max(0,Math.floor(Number(e.skewMs)||6e4)),i=t.tokenManager,r=()=>i?.getAccessToken?.()??i?.getSession?.()?.accessToken??null;let s=r();if(!s||_I(s,n)){const{data:o}=await t.auth.refreshSession();if(s=r()??PS(o)??null,!s&&typeof t.auth.getCurrentUser=="function")try{await t.auth.getCurrentUser(),s=r()??PS(o)??null}catch{}}return s||null}function SI({children:t}){const[e,n]=N.useState(null),[i,r]=N.useState(null),[s,o]=N.useState(!0);N.useEffect(()=>{if(!r0()){n(null),r(null),o(!1);return}n(pI())},[]),N.useEffect(()=>{if(!e)return;let w=!0;return o(!0),(async()=>{try{let{data:y,error:x}=await e.auth.getCurrentUser();if(!w)return;if(!x&&!y?.user){if(await new Promise(A=>setTimeout(A,150)),!w)return;const M=await e.auth.getCurrentUser();y=M.data,x=M.error}if(x){r(null);return}r(y?.user??null)}catch{w&&r(null)}finally{w&&o(!1)}})(),()=>{w=!1}},[e]);const c=N.useCallback(async()=>{if(e)try{let{data:w,error:y}=await e.auth.getCurrentUser();if(!y&&!w?.user){await new Promise(M=>setTimeout(M,150));const x=await e.auth.getCurrentUser();w=x.data,y=x.error}if(y){r(null);return}r(w?.user??null)}catch{r(null)}},[e]),u=N.useCallback(async(w,y)=>{if(!e)return{error:new Error("InsForge client not configured")};const x=typeof y=="string"&&y.trim()?y.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0,M=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth,A=await e.auth.signInWithOAuth({provider:w,redirectTo:x,skipBrowserRedirect:!!M});return M&&A.data?.url&&M.postMessage(A.data.url),A},[e]),f=N.useCallback(async w=>{if(!e)return{data:null,error:new Error("InsForge client not configured")};const{data:y,error:x}=await e.auth.signInWithPassword(w);return y?.user&&r(y.user),{data:y,error:x}},[e]),h=N.useCallback(async w=>{if(!e)return{data:null,error:new Error("InsForge client not configured")};const{data:y,error:x}=await e.auth.signUp(w);return y?.user&&y?.accessToken&&r(y.user),{data:y,error:x}},[e]),p=N.useCallback(async()=>e?e.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[e]),m=N.useCallback(async()=>{e&&(await e.auth.signOut(),gI(),r(null))},[e]),v=N.useCallback(async()=>bI(e),[e]),_=N.useMemo(()=>!r0()||!e?{enabled:!1,client:null,user:null,signedIn:!1,loading:!1,refreshUser:async()=>{},signInWithOAuth:async()=>({error:new Error("InsForge not configured")}),signInWithPassword:async()=>({data:null,error:new Error("InsForge not configured")}),signUp:async()=>({data:null,error:new Error("InsForge not configured")}),getPublicAuthConfig:async()=>({data:null,error:new Error("InsForge not configured")}),signOut:async()=>{},getAccessToken:async()=>null}:{enabled:!0,client:e,user:i,signedIn:!!i,loading:s,refreshUser:c,signInWithOAuth:u,signInWithPassword:f,signUp:h,getPublicAuthConfig:p,signOut:m,getAccessToken:v},[e,i,s,c,u,f,h,p,m,v]);return B.jsx(oT.Provider,{value:_,children:t})}function $l(){return N.useContext(oT)}const wI="modulepreload",EI=function(t){return"/"+t},kS={},ry=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let u=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");r=u(n.map(f=>{if(f=EI(f),f in kS)return;kS[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":wI,h||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((v,_)=>{m.addEventListener("load",v),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return r.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var eh={},MI=()=>{window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)})},TI="@vercel/analytics",AI="2.0.1";function lT(){return typeof window<"u"}function cT(){try{const t="production"}catch{}return"production"}function CI(t="auto"){if(t==="auto"){window.vam=cT();return}window.vam=t}function RI(){return(lT()?window.vam:cT())||"production"}function sy(){return RI()==="development"}function PI(t){return t.scriptSrc?Ml(t.scriptSrc):sy()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?Ml(`${t.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function kI(t,e){var n;let i=t;if(e)try{i={...(n=JSON.parse(e))==null?void 0:n.analytics,...t}}catch{}CI(i.mode);const r={sdkn:TI+(i.framework?`/${i.framework}`:""),sdkv:AI};return i.disableAutoTrack&&(r.disableAutoTrack="1"),i.viewEndpoint&&(r.viewEndpoint=Ml(i.viewEndpoint)),i.eventEndpoint&&(r.eventEndpoint=Ml(i.eventEndpoint)),i.sessionEndpoint&&(r.sessionEndpoint=Ml(i.sessionEndpoint)),sy()&&i.debug===!1&&(r.debug="false"),i.dsn&&(r.dsn=i.dsn),i.endpoint?r.endpoint=i.endpoint:i.basePath&&(r.endpoint=Ml(`${i.basePath}/insights`)),{beforeSend:i.beforeSend,src:PI(i),dataset:r}}function Ml(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function LI(t={debug:!0},e){var n;if(!lT())return;const{beforeSend:i,src:r,dataset:s}=kI(t,e);if(MI(),i&&((n=window.va)==null||n.call(window,"beforeSend",i)),document.head.querySelector(`script[src*="${r}"]`))return;const o=document.createElement("script");o.src=r;for(const[c,u]of Object.entries(s))o.dataset[c]=u;o.defer=!0,o.onerror=()=>{const c=sy()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${r}. ${c}`)},document.head.appendChild(o)}function DI({route:t,path:e}){var n;(n=window.va)==null||n.call(window,"pageview",{route:t,path:e})}function NI(){if(!(typeof process>"u"||typeof eh>"u"))return eh.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function II(){if(!(typeof process>"u"||typeof eh>"u"))return eh.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function UI(t){return N.useEffect(()=>{var e;t.beforeSend&&((e=window.va)==null||e.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]),N.useEffect(()=>{LI({framework:t.framework||"react",basePath:t.basePath??NI(),...t.route!==void 0&&{disableAutoTrack:!0},...t},t.configString??II())},[]),N.useEffect(()=>{t.route&&t.path&&DI({route:t.route,path:t.path})},[t.route,t.path]),null}var th={},FI=()=>{window.si||(window.si=function(...e){window.siq=window.siq||[],window.siq.push(e)})},OI="@vercel/speed-insights",BI="2.0.0";function zI(){return typeof window<"u"}function VI(){try{const t="production"}catch{}return"production"}function uT(){return VI()==="development"}function HI(t){return t.scriptSrc?nh(t.scriptSrc):uT()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":t.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":t.basePath?nh(`${t.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function GI(t,e){var n;let i=t;if(e)try{i={...(n=JSON.parse(e))==null?void 0:n.speedInsights,...t}}catch{}const r={sdkn:OI+(i.framework?`/${i.framework}`:""),sdkv:BI};return i.sampleRate&&(r.sampleRate=i.sampleRate.toString()),i.route&&(r.route=i.route),uT()&&i.debug===!1&&(r.debug="false"),i.dsn&&(r.dsn=i.dsn),i.endpoint?r.endpoint=nh(i.endpoint):i.basePath&&(r.endpoint=nh(`${i.basePath}/speed-insights/vitals`)),{src:HI(i),beforeSend:i.beforeSend,dataset:r}}function nh(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function WI(t={},e){var n;if(!zI()||t.route===null)return null;FI();const{beforeSend:i,src:r,dataset:s}=GI(t,e);if(document.head.querySelector(`script[src*="${r}"]`))return null;i&&((n=window.si)==null||n.call(window,"beforeSend",i));const o=document.createElement("script");o.src=r,o.defer=!0;for(const[c,u]of Object.entries(s))o.dataset[c]=u;return o.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(o),{setRoute:c=>{o.dataset.route=c??void 0}}}function jI(){if(!(typeof process>"u"||typeof th>"u"))return th.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function $I(){if(!(typeof process>"u"||typeof th>"u"))return th.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function XI(t){N.useEffect(()=>{var n;t.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]);const e=N.useRef(null);return N.useEffect(()=>{if(!e.current){const n=WI({framework:t.framework??"react",basePath:t.basePath??jI(),...t},t.configString??$I());n&&(e.current=n.setRoute)}},[t]),N.useEffect(()=>{e.current&&t.route&&e.current(t.route)},[t.route]),null}function Ch(){return typeof window<"u"}function ay(t){return dT(t)?(t.nodeName||"").toLowerCase():"#document"}function Xl(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function qI(t){var e;return(e=(dT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dT(t){return Ch()?t instanceof Node||t instanceof Xl(t).Node:!1}function fT(t){return Ch()?t instanceof Element||t instanceof Xl(t).Element:!1}function oy(t){return Ch()?t instanceof HTMLElement||t instanceof Xl(t).HTMLElement:!1}function LS(t){return!Ch()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xl(t).ShadowRoot}function hT(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=mT(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function t$(t){return/^(table|td|th)$/.test(ay(t))}function YI(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const KI=/transform|translate|scale|rotate|perspective|filter/,ZI=/paint|layout|strict|content/,$a=t=>!!t&&t!=="none";let Dm;function JI(t){const e=fT(t)?mT(t):t;return $a(e.transform)||$a(e.translate)||$a(e.scale)||$a(e.rotate)||$a(e.perspective)||!QI()&&($a(e.backdropFilter)||$a(e.filter))||KI.test(e.willChange||"")||ZI.test(e.contain||"")}function n$(t){let e=s0(t);for(;oy(e)&&!pT(e);){if(JI(e))return e;if(YI(e))return null;e=s0(e)}return null}function QI(){return Dm==null&&(Dm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Dm}function pT(t){return/^(html|body|#document)$/.test(ay(t))}function mT(t){return Xl(t).getComputedStyle(t)}function i$(t){return fT(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function s0(t){if(ay(t)==="html")return t;const e=t.assignedSlot||t.parentNode||LS(t)&&t.host||qI(t);return LS(e)?e.host:e}function gT(t){const e=s0(t);return pT(e)?t.ownerDocument?t.ownerDocument.body:t.body:oy(e)&&hT(e)?e:gT(e)}function DS(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=gT(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=Xl(r);if(s){const c=eU(o);return e.concat(o,o.visualViewport||[],hT(r)?r:[],c&&n?DS(c):[])}else return e.concat(r,DS(r,[],n))}function eU(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const NS={};function ly(t,e){const n=N.useRef(NS);return n.current===NS&&(n.current=t(e)),n}const Nm=k1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],tU=Nm&&Nm!==N.useLayoutEffect?Nm:t=>t();function IS(t){const e=ly(nU).current;return e.next=t,tU(e.effect),e.trampoline}function nU(){const t={next:void 0,callback:iU,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function iU(){}const rU=()=>{},sU=typeof document<"u"?N.useLayoutEffect:rU;function a0(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const nu={};function vT(t,e,n,i,r){let s={...o0(t,nu)};return e&&(s=Af(s,e)),n&&(s=Af(s,n)),i&&(s=Af(s,i)),s}function aU(t){if(t.length===0)return nu;if(t.length===1)return o0(t[0],nu);let e={...o0(t[0],nu)};for(let n=1;n<t.length;n+=1)e=Af(e,t[n]);return e}function Af(t,e){return yT(e)?e(t):oU(t,e)}function oU(t,e){if(!e)return t;for(const n in e){const i=e[n];switch(n){case"style":{t[n]=a0(t.style,i);break}case"className":{t[n]=_T(t.className,i);break}default:lU(n,i)?t[n]=cU(t[n],i):t[n]=i}}return t}function lU(t,e){const n=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2);return n===111&&i===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function yT(t){return typeof t=="function"}function o0(t,e){return yT(t)?t(e):t??nu}function cU(t,e){return e?t?n=>{if(uU(n)){const r=n;l0(r);const s=e(r);return r.baseUIHandlerPrevented||t?.(r),s}const i=e(n);return t?.(n),i}:e:t}function l0(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function _T(t,e){return e?t?e+" "+t:e:t}function uU(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function xT(t,...e){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",t.toString()),e.forEach(i=>n.searchParams.append("args[]",i)),`Base UI error #${t}; visit ${n} for the full message.`}const dU=N.createContext(void 0);function fU(t=!1){const e=N.useContext(dU);if(e===void 0&&!t)throw new Error(xT(16));return e}function hU(t){const{focusableWhenDisabled:e,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=t,o=i&&e!==!1,c=i&&e===!1;return{props:N.useMemo(()=>{const f={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return i||(f.tabIndex=r,!s&&n&&(f.tabIndex=e?r:-1)),(s&&(e||o)||!s&&n)&&(f["aria-disabled"]=n),s&&(!e||c)&&(f.disabled=n),f},[i,n,e,o,c,s,r])}}function pU(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0}=t,s=N.useRef(null),o=fU(!0)!==void 0,c=IS(()=>{const m=s.current;return!!(m?.tagName==="A"&&m?.href)}),{props:u}=hU({focusableWhenDisabled:n,disabled:e,composite:o,tabIndex:i,isNativeButton:r}),f=N.useCallback(()=>{const m=s.current;mU(m)&&o&&e&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[e,u.disabled,o]);sU(f,[f]);const h=N.useCallback((m={})=>{const{onClick:v,onMouseDown:_,onKeyUp:w,onKeyDown:y,onPointerDown:x,...M}=m;return vT({type:r?"button":void 0,onClick(T){if(e){T.preventDefault();return}v?.(T)},onMouseDown(T){e||_?.(T)},onKeyDown(T){if(e||(l0(T),y?.(T)),T.baseUIHandlerPrevented)return;const D=T.target===T.currentTarget&&!r&&!c()&&!e,I=T.key==="Enter",U=T.key===" ";D&&((U||I)&&T.preventDefault(),I&&v?.(T))},onKeyUp(T){e||(l0(T),w?.(T)),!T.baseUIHandlerPrevented&&T.target===T.currentTarget&&!r&&!e&&T.key===" "&&v?.(T)},onPointerDown(T){if(e){T.preventDefault();return}x?.(T)}},r?void 0:{role:"button"},u,M)},[e,u,r,c]),p=IS(m=>{s.current=m,f()});return{getButtonProps:h,buttonRef:p}}function mU(t){return oy(t)&&t.tagName==="BUTTON"}function US(t,e,n,i){const r=ly(bT).current;return vU(r,t,e,n,i)&&ST(r,[t,e,n,i]),r.callback}function gU(t){const e=ly(bT).current;return yU(e,t)&&ST(e,t),e.callback}function bT(){return{callback:null,cleanup:null,refs:[]}}function vU(t,e,n,i,r){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==i||t.refs[3]!==r}function yU(t,e){return t.refs.length!==e.length||t.refs.some((n,i)=>n!==e[i])}function ST(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const i=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const o=s(n);typeof o=="function"&&(i[r]=o);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){const s=e[r];if(s!=null)switch(typeof s){case"function":{const o=i[r];typeof o=="function"?o():s(null);break}case"object":{s.current=null;break}}}}}}}const _U=parseInt(N.version,10);function xU(t){return _U>=t}function FS(t){if(!N.isValidElement(t))return null;const e=t,n=e.props;return(xU(19)?n?.ref:e.ref)??null}function bU(t,e){const n={};for(const i in t){const r=t[i];if(e?.hasOwnProperty(i)){const s=e[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function SU(t,e){return typeof t=="function"?t(e):t}function wU(t,e){return typeof t=="function"?t(e):t}function r$(){}const bl=Object.freeze({});function EU(t,e,n={}){const i=e.render,r=MU(e,n);if(n.enabled===!1)return null;const s=n.state??bl;return TU(t,i,r,s)}function MU(t,e={}){const{className:n,style:i,render:r}=t,{state:s=bl,ref:o,props:c,stateAttributesMapping:u,enabled:f=!0}=e,h=f?SU(n,s):void 0,p=f?wU(i,s):void 0,m=f?bU(s,u):bl,v=f?a0(m,Array.isArray(c)?aU(c):c)??bl:bl;return typeof document<"u"&&(f?Array.isArray(o)?v.ref=gU([v.ref,FS(r),...o]):v.ref=US(v.ref,FS(r),o):US(null,null)),f?(h!==void 0&&(v.className=_T(v.className,h)),p!==void 0&&(v.style=a0(v.style,p)),v):bl}function TU(t,e,n,i){if(e){if(typeof e=="function")return e(n,i);const r=vT(n,e.props);return r.ref=n.ref,N.cloneElement(e,r)}if(t&&typeof t=="string")return AU(t,n);throw new Error(xT(8))}function AU(t,e){return t==="button"?N.createElement("button",{type:"button",...e,key:e.key}):t==="img"?N.createElement("img",{alt:"",...e,key:e.key}):N.createElement(t,e)}const CU=N.forwardRef(function(e,n){const{render:i,className:r,disabled:s=!1,focusableWhenDisabled:o=!1,nativeButton:c=!0,...u}=e,{getButtonProps:f,buttonRef:h}=pU({disabled:s,focusableWhenDisabled:o,native:c}),p=N.useMemo(()=>({disabled:s}),[s]);return EU("button",e,{state:p,ref:[n,h],props:[u,f]})}),RU=`key,module,page,component,slot,text,notes,status
43
43
  header.auth.sign_in_aria,shared,*,InsforgeUserHeaderControls,sign_in_aria,"Sign in",,active
44
44
  header.auth.user_fallback,shared,*,InsforgeUserHeaderControls,user_fallback,"User",,active
45
45
  header.cloud_sync.label,shared,*,InsforgeUserHeaderControls,cloud_sync_label,"Sync local usage to cloud",,active
@@ -4860,4 +4860,4 @@ void main() {
4860
4860
  vec4 color;
4861
4861
  mainImage(color, gl_FragCoord.xy);
4862
4862
  gl_FragColor = color;
4863
- }`;function R7({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:f=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=N.useRef(null),_=N.useRef(null),w=N.useRef(null),y=N.useRef({x:.5,y:.5}),x=N.useRef({x:.5,y:.5}),M=N.useRef(null),A=N.useRef(null),T=N.useRef(null),[D,I]=N.useState(!1),U=N.useRef(null);return N.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{I(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),N.useEffect(()=>!D||!v.current?void 0:(T.current&&(T.current(),T.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const R=new Aj({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=R;const H=R.gl;for(H.canvas.style.width="100%",H.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(H.canvas);const F={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:M1(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:f},noiseAmount:{value:h},distortion:{value:p}};_.current=F;const W=new T7(H),X=new Sj(H,{vertex:A7,fragment:C7,uniforms:F}),V=new M7(H,{geometry:W,program:X});A.current=V;const q=()=>{if(!v.current||!R)return;R.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:$}=v.current;R.setSize(Q,$);const Y=R.dpr,Z=Q*Y,z=$*Y;F.iResolution.value=[Z,z];const{anchor:ie,dir:_e}=T1(t,Z,z);F.rayPos.value=ie,F.rayDir.value=_e},J=Q=>{if(!(!w.current||!_.current||!A.current)){F.iTime.value=Q*.001,u&&f>0&&(x.current.x=x.current.x*.92+y.current.x*(1-.92),x.current.y=x.current.y*.92+y.current.y*(1-.92),F.mousePos.value=[x.current.x,x.current.y]);try{R.render({scene:V}),M.current=requestAnimationFrame(J)}catch($){console.warn("WebGL rendering error:",$)}}};window.addEventListener("resize",q),q(),M.current=requestAnimationFrame(J),T.current=()=>{if(M.current&&(cancelAnimationFrame(M.current),M.current=null),window.removeEventListener("resize",q),R)try{const Q=R.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const $=R.gl.canvas;$&&$.parentNode&&$.parentNode.removeChild($)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{T.current&&(T.current(),T.current=null)}),[D,t,e,n,i,r,s,o,c,u,f,h,p]),N.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,R=w.current;S.raysColor.value=M1(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=f,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:H,clientHeight:F}=v.current,W=R.dpr,{anchor:X,dir:V}=T1(t,H*W,F*W);S.rayPos.value=X,S.rayDir.value=V},[e,n,i,t,r,s,o,c,f,h,p]),N.useEffect(()=>{if(!u)return;const S=R=>{if(!v.current)return;const H=v.current.getBoundingClientRect();y.current={x:(R.clientX-H.left)/H.width,y:(R.clientY-H.top)/H.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),B.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function P7({className:t}){return B.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:B.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function k7({className:t}){return B.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:B.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"})})}function L7({className:t}){return B.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[B.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),B.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function D7({className:t}){return B.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:B.jsx("polyline",{points:"20 6 9 17 4 12"})})}const A1="https://github.com/mm7894215/TokenTracker",N7="https://github.com/mm7894215/TokenTracker/releases/latest";function I7(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out 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",r={default:"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",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Si(i,r[t],s[e],n)}function U7({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Bz(),[c,u]=N.useState(!1);N.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=$l(),m=N.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=N.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return B.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[B.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:B.jsx(R7,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),B.jsx("header",{className:Si("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:B.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[B.jsxs("div",{className:"flex items-center gap-5",children:[B.jsxs(ho,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),B.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),B.jsx("div",{className:"hidden sm:block",children:B.jsx(IV,{})})]}),f&&B.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[B.jsxs(ho,{to:DV(),className:Si(I7(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),B.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),B.jsx(VV,{})]})]})}),B.jsxs("main",{children:[B.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:B.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[B.jsxs(go.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[B.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),B.jsx("br",{}),B.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),B.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[B.jsxs(go.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[B.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[B.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),B.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>B.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),B.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?B.jsx(D7,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):B.jsx(L7,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),B.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[B.jsxs("a",{href:N7,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(P7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),B.jsxs("a",{href:A1,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(k7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),B.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),B.jsx("div",{className:"relative group w-full",children:B.jsxs(go.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[B.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:B.jsx(nj,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),B.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:B.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),B.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),B.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:B.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:B.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[B.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),B.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>B.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[B.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),B.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),B.jsx("section",{className:"py-20 lg:py-32",children:B.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[B.jsxs("div",{className:"max-w-md",children:[B.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),B.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),B.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),B.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),B.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:B.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[B.jsx("p",{children:t("landing.v2.footer.line")}),B.jsxs("div",{className:"flex items-center gap-6",children:[B.jsx("a",{href:A1,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),f&&B.jsxs(ho,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function F7({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function O7(){return N.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function B7(t=0,e=!0){const[n,i]=N.useState(()=>!e);return N.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function z7({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=N.useState(i),o=O7(),c=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),u=F7({prefersReducedMotion:o,screenshotMode:c});B7(250,u);const f="tokentracker.dashboard.from_landing.v1";N.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),N.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),N.useMemo(()=>{const _=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:_})},[r,n]);const h=qt("landing.install.command"),[p,m]=N.useState(!1),v=async()=>{await kV(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return B.jsx(U7,{copy:qt,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function V7(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const C1={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function R1(t){const e=String(t||"").trim();return C1[e]?C1[e]:e.replace(/-/g," ")}function H7(){const t=Fv(),[e,n]=kL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:f,getPublicAuthConfig:h}=$l(),p=N.useMemo(()=>V7(e.toString()),[e]),[m,v]=N.useState("signin"),[_,w]=N.useState(""),[y,x]=N.useState(""),[M,A]=N.useState(""),[T,D]=N.useState(!1),[I,U]=N.useState(null),[S,R]=N.useState(null),[H,F]=N.useState(!0),[W,X]=N.useState([]),[V,q]=N.useState([]),[J,Q]=N.useState(8);N.useEffect(()=>{const _e=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");_e==="success"&&Ee==="verify_email"?R(qt("login.verify_email_success")):_e==="error"&&Ee==="verify_email"&&Ue&&R(qt("shared.error.prefix",{error:Ue}))},[e]),N.useEffect(()=>{if(!i){F(!1);return}let _e=!0;return(async()=>{const{data:Ee,error:Ue}=await h();_e&&(Ue||!Ee?(X(["google","github"]),q([])):(X(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&Q(Ee.passwordMinLength)),F(!1))})(),()=>{_e=!1}},[i,h]),N.useEffect(()=>{!i||r||s&&t(p,{replace:!0})},[i,r,s,t,p]),N.useEffect(()=>{i&&o()},[i,o]);const $=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Y=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Z=N.useCallback(async _e=>{_e.preventDefault(),U(null),D(!0);try{if(m==="signup"){const{data:Ue,error:le}=await u({email:_.trim(),password:y,name:M.trim()||void 0,redirectTo:Y});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){R(qt("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:Ee}=await c({email:_.trim(),password:y});if(Ee){U(Ee.message||String(Ee));return}t(p,{replace:!0})}finally{D(!1)}},[m,_,y,M,u,c,t,p,Y]),z=N.useCallback(async _e=>{U(null),D(!0);try{const{error:Ee}=await f(_e,$);Ee&&U(Ee.message||String(Ee))}finally{D(!1)}},[f,$]),ie=N.useCallback(()=>{n(_e=>{const Ee=new URLSearchParams(_e);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),R(null)},[n]);return i?B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:B.jsxs("div",{className:"w-full max-w-md space-y-8",children:[B.jsxs("div",{className:"text-center",children:[B.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),B.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?B.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[B.jsx("span",{children:S}),B.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?B.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,B.jsx("div",{className:"space-y-3",children:H?B.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):B.jsxs(B.Fragment,{children:[W.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e)),V.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e))]})}),B.jsxs("div",{className:"relative",children:[B.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:B.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),B.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[m==="signup"?B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),B.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:M,onChange:_e=>A(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),B.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:_e=>w(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),B.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?J:void 0,value:y,onChange:_e=>x(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?B.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(J)})}):null]}),B.jsx("button",{type:"submit",disabled:T||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:B.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const G7=Gl.lazy(()=>ry(()=>import("./DashboardPage-CRoqVbH0.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),W7=Gl.lazy(()=>ry(()=>import("./LeaderboardPage-B3ZnlNgw.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),j7=Gl.lazy(()=>ry(()=>import("./LeaderboardProfilePage-Cq17bu0k.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function $7(){const t=vr(),e=$l();RV();const n=xr(),i=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=u||f,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,x=!!(e.enabled&&e.signedIn),M=m||x,A=!1,T=Y5(),D=N.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=m||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),y&&(I="dashboard");const U=w?j7:v==="/leaderboard"?W7:G7,S=B.jsx("div",{className:"min-h-screen bg-[#050505]"});let R=null;return v==="/login"?R=B.jsx(H7,{}):I==="landing"?R=B.jsx(z7,{signInUrl:"/login",signUpUrl:"/login"}):R=B.jsx(N.Suspense,{fallback:S,children:B.jsx(U,{baseUrl:T,auth:D,signedIn:M,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})}),B.jsx(UU,{children:B.jsx(zU,{children:B.jsxs(VU,{children:[R,B.jsx(X5,{}),B.jsx(UI,{}),B.jsx(XI,{})]})})})}const X7=EL([{path:"*",element:B.jsx($7,{})}]);f2.createRoot(document.getElementById("root")).render(B.jsx(Gl.StrictMode,{children:B.jsx(SI,{children:B.jsx(OL,{router:X7})})}));export{QI as $,RC as A,qt as B,B as C,ly as D,sU as E,xT as F,Rv as G,xU as H,IS as I,oh as J,LS as K,oy as L,Uy as M,r$ as N,bl as O,ay as P,FL as Q,k1 as R,dT as S,EU as T,US as U,Xl as V,mT as W,DS as X,fT as Y,qI as Z,eU as _,hi as a,YI as a0,s0 as a1,pT as a2,t$ as a3,JI as a4,n$ as a5,hT as a6,i$ as a7,VV as a8,ho as a9,a$ as aA,iT as aB,Lm as aC,x$ as aD,Si as aE,IV as aF,DV as aG,TV as aH,b$ as aI,mI as aJ,S$ as aK,FU as aL,NV as aa,Bz as ab,go as ac,pU as ad,Gl as ae,m$ as af,p$ as ag,ET as ah,$l as ai,QA as aj,NC as ak,io as al,w$ as am,o$ as an,l$ as ao,g$ as ap,tV as aq,c$ as ar,u$ as as,E$ as at,h$ as au,ry as av,v$ as aw,kV as ax,vr as ay,Fv as az,MT as b,Ra as c,ew as d,By as e,Tn as f,PC as g,xr as h,FF as i,e$ as j,xI as k,R$ as l,Fl as m,rV as n,sV as o,T$ as p,f$ as q,N as r,_$ as s,A$ as t,uy as u,C$ as v,d$ as w,kn as x,y$ as y,M$ as z};
4863
+ }`;function R7({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:f=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=N.useRef(null),_=N.useRef(null),w=N.useRef(null),y=N.useRef({x:.5,y:.5}),x=N.useRef({x:.5,y:.5}),M=N.useRef(null),A=N.useRef(null),T=N.useRef(null),[D,I]=N.useState(!1),U=N.useRef(null);return N.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{I(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),N.useEffect(()=>!D||!v.current?void 0:(T.current&&(T.current(),T.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const R=new Aj({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=R;const H=R.gl;for(H.canvas.style.width="100%",H.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(H.canvas);const F={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:M1(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:f},noiseAmount:{value:h},distortion:{value:p}};_.current=F;const W=new T7(H),X=new Sj(H,{vertex:A7,fragment:C7,uniforms:F}),V=new M7(H,{geometry:W,program:X});A.current=V;const q=()=>{if(!v.current||!R)return;R.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:$}=v.current;R.setSize(Q,$);const Y=R.dpr,Z=Q*Y,z=$*Y;F.iResolution.value=[Z,z];const{anchor:ie,dir:_e}=T1(t,Z,z);F.rayPos.value=ie,F.rayDir.value=_e},J=Q=>{if(!(!w.current||!_.current||!A.current)){F.iTime.value=Q*.001,u&&f>0&&(x.current.x=x.current.x*.92+y.current.x*(1-.92),x.current.y=x.current.y*.92+y.current.y*(1-.92),F.mousePos.value=[x.current.x,x.current.y]);try{R.render({scene:V}),M.current=requestAnimationFrame(J)}catch($){console.warn("WebGL rendering error:",$)}}};window.addEventListener("resize",q),q(),M.current=requestAnimationFrame(J),T.current=()=>{if(M.current&&(cancelAnimationFrame(M.current),M.current=null),window.removeEventListener("resize",q),R)try{const Q=R.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const $=R.gl.canvas;$&&$.parentNode&&$.parentNode.removeChild($)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{T.current&&(T.current(),T.current=null)}),[D,t,e,n,i,r,s,o,c,u,f,h,p]),N.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,R=w.current;S.raysColor.value=M1(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=f,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:H,clientHeight:F}=v.current,W=R.dpr,{anchor:X,dir:V}=T1(t,H*W,F*W);S.rayPos.value=X,S.rayDir.value=V},[e,n,i,t,r,s,o,c,f,h,p]),N.useEffect(()=>{if(!u)return;const S=R=>{if(!v.current)return;const H=v.current.getBoundingClientRect();y.current={x:(R.clientX-H.left)/H.width,y:(R.clientY-H.top)/H.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),B.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function P7({className:t}){return B.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:B.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function k7({className:t}){return B.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:B.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"})})}function L7({className:t}){return B.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[B.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),B.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function D7({className:t}){return B.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:B.jsx("polyline",{points:"20 6 9 17 4 12"})})}const A1="https://github.com/mm7894215/TokenTracker",N7="https://github.com/mm7894215/TokenTracker/releases/latest";function I7(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out 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",r={default:"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",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Si(i,r[t],s[e],n)}function U7({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Bz(),[c,u]=N.useState(!1);N.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=$l(),m=N.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=N.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return B.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[B.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:B.jsx(R7,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),B.jsx("header",{className:Si("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:B.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[B.jsxs("div",{className:"flex items-center gap-5",children:[B.jsxs(ho,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),B.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),B.jsx("div",{className:"hidden sm:block",children:B.jsx(IV,{})})]}),f&&B.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[B.jsxs(ho,{to:DV(),className:Si(I7(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),B.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),B.jsx(VV,{})]})]})}),B.jsxs("main",{children:[B.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:B.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[B.jsxs(go.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[B.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),B.jsx("br",{}),B.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),B.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[B.jsxs(go.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[B.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[B.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),B.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>B.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),B.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?B.jsx(D7,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):B.jsx(L7,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),B.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[B.jsxs("a",{href:N7,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(P7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),B.jsxs("a",{href:A1,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(k7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),B.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),B.jsx("div",{className:"relative group w-full",children:B.jsxs(go.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[B.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:B.jsx(nj,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),B.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:B.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),B.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),B.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:B.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:B.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[B.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),B.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>B.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[B.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),B.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),B.jsx("section",{className:"py-20 lg:py-32",children:B.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[B.jsxs("div",{className:"max-w-md",children:[B.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),B.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),B.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),B.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),B.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:B.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[B.jsx("p",{children:t("landing.v2.footer.line")}),B.jsxs("div",{className:"flex items-center gap-6",children:[B.jsx("a",{href:A1,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),f&&B.jsxs(ho,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function F7({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function O7(){return N.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function B7(t=0,e=!0){const[n,i]=N.useState(()=>!e);return N.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function z7({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=N.useState(i),o=O7(),c=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),u=F7({prefersReducedMotion:o,screenshotMode:c});B7(250,u);const f="tokentracker.dashboard.from_landing.v1";N.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),N.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),N.useMemo(()=>{const _=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:_})},[r,n]);const h=qt("landing.install.command"),[p,m]=N.useState(!1),v=async()=>{await kV(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return B.jsx(U7,{copy:qt,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function V7(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const C1={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function R1(t){const e=String(t||"").trim();return C1[e]?C1[e]:e.replace(/-/g," ")}function H7(){const t=Fv(),[e,n]=kL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:f,getPublicAuthConfig:h}=$l(),p=N.useMemo(()=>V7(e.toString()),[e]),[m,v]=N.useState("signin"),[_,w]=N.useState(""),[y,x]=N.useState(""),[M,A]=N.useState(""),[T,D]=N.useState(!1),[I,U]=N.useState(null),[S,R]=N.useState(null),[H,F]=N.useState(!0),[W,X]=N.useState([]),[V,q]=N.useState([]),[J,Q]=N.useState(8);N.useEffect(()=>{const _e=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");_e==="success"&&Ee==="verify_email"?R(qt("login.verify_email_success")):_e==="error"&&Ee==="verify_email"&&Ue&&R(qt("shared.error.prefix",{error:Ue}))},[e]),N.useEffect(()=>{if(!i){F(!1);return}let _e=!0;return(async()=>{const{data:Ee,error:Ue}=await h();_e&&(Ue||!Ee?(X(["google","github"]),q([])):(X(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&Q(Ee.passwordMinLength)),F(!1))})(),()=>{_e=!1}},[i,h]),N.useEffect(()=>{!i||r||s&&t(p,{replace:!0})},[i,r,s,t,p]),N.useEffect(()=>{i&&o()},[i,o]);const $=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Y=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Z=N.useCallback(async _e=>{_e.preventDefault(),U(null),D(!0);try{if(m==="signup"){const{data:Ue,error:le}=await u({email:_.trim(),password:y,name:M.trim()||void 0,redirectTo:Y});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){R(qt("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:Ee}=await c({email:_.trim(),password:y});if(Ee){U(Ee.message||String(Ee));return}t(p,{replace:!0})}finally{D(!1)}},[m,_,y,M,u,c,t,p,Y]),z=N.useCallback(async _e=>{U(null),D(!0);try{const{error:Ee}=await f(_e,$);Ee&&U(Ee.message||String(Ee))}finally{D(!1)}},[f,$]),ie=N.useCallback(()=>{n(_e=>{const Ee=new URLSearchParams(_e);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),R(null)},[n]);return i?B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:B.jsxs("div",{className:"w-full max-w-md space-y-8",children:[B.jsxs("div",{className:"text-center",children:[B.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),B.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?B.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[B.jsx("span",{children:S}),B.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?B.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,B.jsx("div",{className:"space-y-3",children:H?B.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):B.jsxs(B.Fragment,{children:[W.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e)),V.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e))]})}),B.jsxs("div",{className:"relative",children:[B.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:B.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),B.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[m==="signup"?B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),B.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:M,onChange:_e=>A(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),B.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:_e=>w(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),B.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?J:void 0,value:y,onChange:_e=>x(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?B.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(J)})}):null]}),B.jsx("button",{type:"submit",disabled:T||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:B.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const G7=Gl.lazy(()=>ry(()=>import("./DashboardPage-BS38-6Xx.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),W7=Gl.lazy(()=>ry(()=>import("./LeaderboardPage-BhqpZtev.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),j7=Gl.lazy(()=>ry(()=>import("./LeaderboardProfilePage-CfQdUOe3.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function $7(){const t=vr(),e=$l();RV();const n=xr(),i=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=u||f,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,x=!!(e.enabled&&e.signedIn),M=m||x,A=!1,T=Y5(),D=N.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=m||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),y&&(I="dashboard");const U=w?j7:v==="/leaderboard"?W7:G7,S=B.jsx("div",{className:"min-h-screen bg-[#050505]"});let R=null;return v==="/login"?R=B.jsx(H7,{}):I==="landing"?R=B.jsx(z7,{signInUrl:"/login",signUpUrl:"/login"}):R=B.jsx(N.Suspense,{fallback:S,children:B.jsx(U,{baseUrl:T,auth:D,signedIn:M,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})}),B.jsx(UU,{children:B.jsx(zU,{children:B.jsxs(VU,{children:[R,B.jsx(X5,{}),B.jsx(UI,{}),B.jsx(XI,{})]})})})}const X7=EL([{path:"*",element:B.jsx($7,{})}]);f2.createRoot(document.getElementById("root")).render(B.jsx(Gl.StrictMode,{children:B.jsx(SI,{children:B.jsx(OL,{router:X7})})}));export{QI as $,RC as A,qt as B,B as C,ly as D,sU as E,xT as F,Rv as G,xU as H,IS as I,oh as J,LS as K,oy as L,Uy as M,r$ as N,bl as O,ay as P,FL as Q,k1 as R,dT as S,EU as T,US as U,Xl as V,mT as W,DS as X,fT as Y,qI as Z,eU as _,hi as a,YI as a0,s0 as a1,pT as a2,t$ as a3,JI as a4,n$ as a5,hT as a6,i$ as a7,VV as a8,ho as a9,a$ as aA,iT as aB,Lm as aC,x$ as aD,Si as aE,IV as aF,DV as aG,TV as aH,b$ as aI,mI as aJ,S$ as aK,FU as aL,NV as aa,Bz as ab,go as ac,pU as ad,Gl as ae,m$ as af,p$ as ag,ET as ah,$l as ai,QA as aj,NC as ak,io as al,w$ as am,o$ as an,l$ as ao,g$ as ap,tV as aq,c$ as ar,u$ as as,E$ as at,h$ as au,ry as av,v$ as aw,kV as ax,vr as ay,Fv as az,MT as b,Ra as c,ew as d,By as e,Tn as f,PC as g,xr as h,FF as i,e$ as j,xI as k,R$ as l,Fl as m,rV as n,sV as o,T$ as p,f$ as q,N as r,_$ as s,A$ as t,uy as u,C$ as v,d$ as w,kn as x,y$ as y,M$ as z};
@@ -107,7 +107,7 @@
107
107
  ]
108
108
  }
109
109
  </script>
110
- <script type="module" crossorigin src="/assets/main-wolIKQH9.js"></script>
110
+ <script type="module" crossorigin src="/assets/main-7kFIj2vL.js"></script>
111
111
  <link rel="stylesheet" crossorigin href="/assets/main-CJMr9zAk.css">
112
112
  </head>
113
113
  <body>
@@ -51,7 +51,7 @@
51
51
  "description": "Shareable Token Tracker dashboard snapshot."
52
52
  }
53
53
  </script>
54
- <script type="module" crossorigin src="/assets/main-wolIKQH9.js"></script>
54
+ <script type="module" crossorigin src="/assets/main-7kFIj2vL.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="/assets/main-CJMr9zAk.css">
56
56
  </head>
57
57
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Token usage tracker for AI agent CLIs (Claude Code, Codex, Cursor, Kiro, Gemini, OpenCode, OpenClaw)",
5
5
  "main": "src/cli.js",
6
6
  "bin": {