tokentracker-cli 0.22.3 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +4 -3
  2. package/README.zh-CN.md +4 -3
  3. package/dashboard/dist/assets/{Card-Ce7Bq6YO.js → Card-CQ4ezOtn.js} +1 -1
  4. package/dashboard/dist/assets/DashboardPage-DCixFQNF.js +42 -0
  5. package/dashboard/dist/assets/{DevicePage-B0t441Pp.js → DevicePage-C-d4jlSG.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-rL5OMeU2.js → FadeIn-DEPo9u33.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-CGS4pFqm.js → HeaderGithubStar-CRKWJSGQ.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-Dg8ZSzBs.js → IpCheckPage-BscvPch9.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-BRTdgQhg.js → LandingPage-Bv5OIhRJ.js} +1 -1
  10. package/dashboard/dist/assets/LeaderboardPage-ea_pS5m7.js +5 -0
  11. package/dashboard/dist/assets/{LeaderboardProfilePage-BYY0tPSp.js → LeaderboardProfilePage-DMzZmwP4.js} +1 -1
  12. package/dashboard/dist/assets/{LimitsPage-IguYTVRL.js → LimitsPage-CWaDaTZ9.js} +1 -1
  13. package/dashboard/dist/assets/{LoginPage-Ct_y3yvb.js → LoginPage-BhmcrPVS.js} +1 -1
  14. package/dashboard/dist/assets/PopoverPopup-bhZXkxTE.js +12 -0
  15. package/dashboard/dist/assets/{ProviderIcon-BW8DsxOn.js → ProviderIcon-BFsXZu44.js} +1 -1
  16. package/dashboard/dist/assets/SettingsPage-Dw5iy_IJ.js +1 -0
  17. package/dashboard/dist/assets/SkillsPage-Dz1X6g_o.js +1 -0
  18. package/dashboard/dist/assets/{WidgetsPage-DYLXbN7i.js → WidgetsPage-D8RbtXHy.js} +1 -1
  19. package/dashboard/dist/assets/{WrappedPage-C-NcEsy1.js → WrappedPage-Chw83YEb.js} +1 -1
  20. package/dashboard/dist/assets/check-Bs81cB4C.js +1 -0
  21. package/dashboard/dist/assets/{chevron-down-sxrI4ACd.js → chevron-down-DK-3H5UY.js} +1 -1
  22. package/dashboard/dist/assets/{download-tZXJTa2X.js → download-lOWPegbv.js} +1 -1
  23. package/dashboard/dist/assets/info-DOAPbTJ3.js +1 -0
  24. package/dashboard/dist/assets/{leaderboard-columns-DjTC-eio.js → leaderboard-columns-qXgnSz3Y.js} +1 -1
  25. package/dashboard/dist/assets/main-0bSXJNLn.css +1 -0
  26. package/dashboard/dist/assets/main-uV9_FTHb.js +688 -0
  27. package/dashboard/dist/assets/{use-limits-display-prefs-CzOLYgu5.js → use-limits-display-prefs-DtRFIKBE.js} +1 -1
  28. package/dashboard/dist/assets/{use-native-settings-D6YjGLZJ.js → use-native-settings-BRDZatug.js} +1 -1
  29. package/dashboard/dist/assets/{use-reduced-motion-0uADS5dP.js → use-reduced-motion-CYXeA5H_.js} +1 -1
  30. package/dashboard/dist/assets/{use-usage-limits-xh-A-nDC.js → use-usage-limits-RfcCMHky.js} +1 -1
  31. package/dashboard/dist/assets/useCurrency-B0LcQvSj.js +1 -0
  32. package/dashboard/dist/index.html +2 -2
  33. package/dashboard/dist/share.html +2 -2
  34. package/package.json +1 -1
  35. package/src/lib/antigravity-paths.js +48 -0
  36. package/src/lib/cursor-config.js +20 -47
  37. package/src/lib/pricing/seed-snapshot.json +1 -1
  38. package/src/lib/rollout.js +81 -157
  39. package/src/lib/skills-manager.js +76 -48
  40. package/src/lib/sqlite-reader.js +136 -0
  41. package/dashboard/dist/assets/DashboardPage-K_pYvsl8.js +0 -64
  42. package/dashboard/dist/assets/LeaderboardPage-DMQ92NBo.js +0 -5
  43. package/dashboard/dist/assets/PopoverPopup-BKxuCZoU.js +0 -12
  44. package/dashboard/dist/assets/SettingsPage-BxDpsq6h.js +0 -1
  45. package/dashboard/dist/assets/SkillsPage-DGrfA2Ts.js +0 -1
  46. package/dashboard/dist/assets/check-fi-rlObU.js +0 -1
  47. package/dashboard/dist/assets/main-D55hG1yw.css +0 -1
  48. package/dashboard/dist/assets/main-DsrMFwQm.js +0 -676
@@ -0,0 +1,688 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DCixFQNF.js","assets/use-usage-limits-RfcCMHky.js","assets/useCurrency-B0LcQvSj.js","assets/info-DOAPbTJ3.js","assets/PopoverPopup-bhZXkxTE.js","assets/Card-CQ4ezOtn.js","assets/use-reduced-motion-CYXeA5H_.js","assets/ProviderIcon-BFsXZu44.js","assets/FadeIn-DEPo9u33.js","assets/LandingPage-Bv5OIhRJ.js","assets/HeaderGithubStar-CRKWJSGQ.js","assets/LeaderboardPage-ea_pS5m7.js","assets/leaderboard-columns-qXgnSz3Y.js","assets/chevron-down-DK-3H5UY.js","assets/LeaderboardProfilePage-DMzZmwP4.js","assets/LimitsPage-CWaDaTZ9.js","assets/use-limits-display-prefs-DtRFIKBE.js","assets/SettingsPage-Dw5iy_IJ.js","assets/use-native-settings-BRDZatug.js","assets/check-Bs81cB4C.js","assets/download-lOWPegbv.js","assets/SkillsPage-Dz1X6g_o.js","assets/WidgetsPage-D8RbtXHy.js"])))=>i.map(i=>d[i]);
2
+ function kP(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(a,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function R0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wP(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var s=!1;try{s=this instanceof a}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:function(){return e[a]}})}),n}var ph={exports:{}},lo={},mh={exports:{}},Ze={};var Oy;function xP(){if(Oy)return Ze;Oy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function P(N,q,xe){this.props=N,this.context=q,this.refs=T,this.updater=xe||w}P.prototype.isReactComponent={},P.prototype.setState=function(N,q){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,q,"setState")},P.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function D(){}D.prototype=P.prototype;function R(N,q,xe){this.props=N,this.context=q,this.refs=T,this.updater=xe||w}var L=R.prototype=new D;L.constructor=R,x(L,P.prototype),L.isPureReactComponent=!0;var j=Array.isArray,G=Object.prototype.hasOwnProperty,K={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function S(N,q,xe){var Re,Se={},Ce=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Ce=""+q.key),q)G.call(q,Re)&&!H.hasOwnProperty(Re)&&(Se[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Se.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Se.children=Ue}if(N&&N.defaultProps)for(Re in Qe=N.defaultProps,Qe)Se[Re]===void 0&&(Se[Re]=Qe[Re]);return{$$typeof:e,type:N,key:Ce,ref:Ge,props:Se,_owner:K.current}}function Z(N,q){return{$$typeof:e,type:N.type,key:q,ref:N.ref,props:N.props,_owner:N._owner}}function X(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function me(N){var q={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(xe){return q[xe]})}var oe=/\/+/g;function Ae(N,q){return typeof N=="object"&&N!==null&&N.key!=null?me(""+N.key):q.toString(36)}function fe(N,q,xe,Re,Se){var Ce=typeof N;(Ce==="undefined"||Ce==="boolean")&&(N=null);var Ge=!1;if(N===null)Ge=!0;else switch(Ce){case"string":case"number":Ge=!0;break;case"object":switch(N.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=N,Se=Se(Ge),N=Re===""?"."+Ae(Ge,0):Re,j(Se)?(xe="",N!=null&&(xe=N.replace(oe,"$&/")+"/"),fe(Se,q,xe,"",function(jt){return jt})):Se!=null&&(X(Se)&&(Se=Z(Se,xe+(!Se.key||Ge&&Ge.key===Se.key?"":(""+Se.key).replace(oe,"$&/")+"/")+N)),q.push(Se)),1;if(Ge=0,Re=Re===""?".":Re+":",j(N))for(var Qe=0;Qe<N.length;Qe++){Ce=N[Qe];var Ue=Re+Ae(Ce,Qe);Ge+=fe(Ce,q,xe,Ue,Se)}else if(Ue=b(N),typeof Ue=="function")for(N=Ue.call(N),Qe=0;!(Ce=N.next()).done;)Ce=Ce.value,Ue=Re+Ae(Ce,Qe++),Ge+=fe(Ce,q,xe,Ue,Se);else if(Ce==="object")throw q=String(N),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function ue(N,q,xe){if(N==null)return N;var Re=[],Se=0;return fe(N,Re,"","",function(Ce){return q.call(xe,Ce,Se++)}),Re}function le(N){if(N._status===-1){var q=N._result;q=q(),q.then(function(xe){(N._status===0||N._status===-1)&&(N._status=1,N._result=xe)},function(xe){(N._status===0||N._status===-1)&&(N._status=2,N._result=xe)}),N._status===-1&&(N._status=0,N._result=q)}if(N._status===1)return N._result.default;throw N._result}var Me={current:null},W={transition:null},Y={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:W,ReactCurrentOwner:K};function $(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:ue,forEach:function(N,q,xe){ue(N,function(){q.apply(this,arguments)},xe)},count:function(N){var q=0;return ue(N,function(){q++}),q},toArray:function(N){return ue(N,function(q){return q})||[]},only:function(N){if(!X(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ze.Component=P,Ze.Fragment=n,Ze.Profiler=s,Ze.PureComponent=R,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Ze.act=$,Ze.cloneElement=function(N,q,xe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var Re=x({},N.props),Se=N.key,Ce=N.ref,Ge=N._owner;if(q!=null){if(q.ref!==void 0&&(Ce=q.ref,Ge=K.current),q.key!==void 0&&(Se=""+q.key),N.type&&N.type.defaultProps)var Qe=N.type.defaultProps;for(Ue in q)G.call(q,Ue)&&!H.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:N.type,key:Se,ref:Ce,props:Re,_owner:Ge}},Ze.createContext=function(N){return N={$$typeof:c,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:o,_context:N},N.Consumer=N},Ze.createElement=S,Ze.createFactory=function(N){var q=S.bind(null,N);return q.type=N,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(N){return{$$typeof:u,render:N}},Ze.isValidElement=X,Ze.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:le}},Ze.memo=function(N,q){return{$$typeof:f,type:N,compare:q===void 0?null:q}},Ze.startTransition=function(N){var q=W.transition;W.transition={};try{N()}finally{W.transition=q}},Ze.unstable_act=$,Ze.useCallback=function(N,q){return Me.current.useCallback(N,q)},Ze.useContext=function(N){return Me.current.useContext(N)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(N){return Me.current.useDeferredValue(N)},Ze.useEffect=function(N,q){return Me.current.useEffect(N,q)},Ze.useId=function(){return Me.current.useId()},Ze.useImperativeHandle=function(N,q,xe){return Me.current.useImperativeHandle(N,q,xe)},Ze.useInsertionEffect=function(N,q){return Me.current.useInsertionEffect(N,q)},Ze.useLayoutEffect=function(N,q){return Me.current.useLayoutEffect(N,q)},Ze.useMemo=function(N,q){return Me.current.useMemo(N,q)},Ze.useReducer=function(N,q,xe){return Me.current.useReducer(N,q,xe)},Ze.useRef=function(N){return Me.current.useRef(N)},Ze.useState=function(N){return Me.current.useState(N)},Ze.useSyncExternalStore=function(N,q,xe){return Me.current.useSyncExternalStore(N,q,xe)},Ze.useTransition=function(){return Me.current.useTransition()},Ze.version="18.3.1",Ze}var Iy;function Zf(){return Iy||(Iy=1,mh.exports=xP()),mh.exports}var jy;function SP(){if(jy)return lo;jy=1;var e=Zf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},b=null,w=null;f!==void 0&&(b=""+f),h.key!==void 0&&(b=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!o.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:b,ref:w,props:y,_owner:s.current}}return lo.Fragment=n,lo.jsx=c,lo.jsxs=c,lo}var Uy;function PP(){return Uy||(Uy=1,ph.exports=SP()),ph.exports}var I=PP(),k=Zf();const Xf=R0(k),TP=kP({__proto__:null,default:Xf},[k]);var lc={},gh={exports:{}},yn={},yh={exports:{}},vh={};var By;function CP(){return By||(By=1,(function(e){function t(W,Y){var $=W.length;W.push(Y);e:for(;0<$;){var N=$-1>>>1,q=W[N];if(0<s(q,Y))W[N]=Y,W[$]=q,$=N;else break e}}function n(W){return W.length===0?null:W[0]}function a(W){if(W.length===0)return null;var Y=W[0],$=W.pop();if($!==Y){W[0]=$;e:for(var N=0,q=W.length,xe=q>>>1;N<xe;){var Re=2*(N+1)-1,Se=W[Re],Ce=Re+1,Ge=W[Ce];if(0>s(Se,$))Ce<q&&0>s(Ge,Se)?(W[N]=Ge,W[Ce]=$,N=Ce):(W[N]=Se,W[Re]=$,N=Re);else if(Ce<q&&0>s(Ge,$))W[N]=Ge,W[Ce]=$,N=Ce;else break e}}return Y}function s(W,Y){var $=W.sortIndex-Y.sortIndex;return $!==0?$:W.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,b=3,w=!1,x=!1,T=!1,P=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(W){for(var Y=n(f);Y!==null;){if(Y.callback===null)a(f);else if(Y.startTime<=W)a(f),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(f)}}function j(W){if(T=!1,L(W),!x)if(n(h)!==null)x=!0,le(G);else{var Y=n(f);Y!==null&&Me(j,Y.startTime-W)}}function G(W,Y){x=!1,T&&(T=!1,D(S),S=-1),w=!0;var $=b;try{for(L(Y),y=n(h);y!==null&&(!(y.expirationTime>Y)||W&&!me());){var N=y.callback;if(typeof N=="function"){y.callback=null,b=y.priorityLevel;var q=N(y.expirationTime<=Y);Y=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),L(Y)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Me(j,Re.startTime-Y),xe=!1}return xe}finally{y=null,b=$,w=!1}}var K=!1,H=null,S=-1,Z=5,X=-1;function me(){return!(e.unstable_now()-X<Z)}function oe(){if(H!==null){var W=e.unstable_now();X=W;var Y=!0;try{Y=H(!0,W)}finally{Y?Ae():(K=!1,H=null)}}else K=!1}var Ae;if(typeof R=="function")Ae=function(){R(oe)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ue=fe.port2;fe.port1.onmessage=oe,Ae=function(){ue.postMessage(null)}}else Ae=function(){P(oe,0)};function le(W){H=W,K||(K=!0,Ae())}function Me(W,Y){S=P(function(){W(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,le(G))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(W){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var $=b;b=Y;try{return W()}finally{b=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,Y){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var $=b;b=W;try{return Y()}finally{b=$}},e.unstable_scheduleCallback=function(W,Y,$){var N=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?N+$:N):$=N,W){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=$+q,W={id:m++,callback:Y,priorityLevel:W,startTime:$,expirationTime:q,sortIndex:-1},$>N?(W.sortIndex=$,t(f,W),n(h)===null&&W===n(f)&&(T?(D(S),S=-1):T=!0,Me(j,$-N))):(W.sortIndex=q,t(h,W),x||w||(x=!0,le(G))),W},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(W){var Y=b;return function(){var $=b;b=Y;try{return W.apply(this,arguments)}finally{b=$}}}})(vh)),vh}var Fy;function EP(){return Fy||(Fy=1,yh.exports=CP()),yh.exports}var Vy;function AP(){if(Vy)return yn;Vy=1;var e=Zf(),t=EP();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function o(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(s[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function b(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function T(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){P[r]=new T(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];P[i]=new T(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){P[r]=new T(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){P[r]=new T(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){P[r]=new T(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){P[r]=new T(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){P[r]=new T(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){P[r]=new T(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){P[r]=new T(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function R(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,R);P[i]=new T(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,R);P[i]=new T(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,R);P[i]=new T(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){P[r]=new T(r,1,!1,r.toLowerCase(),null,!1,!1)}),P.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){P[r]=new T(r,1,!1,r.toLowerCase(),null,!0,!0)});function L(r,i,l,d){var p=P.hasOwnProperty(i)?P[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,l,p,d)&&(l=null),d||p===null?b(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),K=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),me=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),Me=Symbol.for("react.offscreen"),W=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=W&&r[W]||r["@@iterator"],typeof r=="function"?r:null)}var $=Object.assign,N;function q(r){if(N===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);N=i&&i[1]||""}return`
3
+ `+N+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(z){var d=z}Reflect.construct(r,[],i)}else{try{i.call()}catch(z){d=z}r.call(i.prototype)}else{try{throw Error()}catch(z){d=z}r()}}catch(z){if(z&&d&&typeof z.stack=="string"){for(var p=z.stack.split(`
4
+ `),g=d.stack.split(`
5
+ `),_=p.length-1,E=g.length-1;1<=_&&0<=E&&p[_]!==g[E];)E--;for(;1<=_&&0<=E;_--,E--)if(p[_]!==g[E]){if(_!==1||E!==1)do if(_--,E--,0>E||p[_]!==g[E]){var M=`
6
+ `+p[_].replace(" at new "," at ");return r.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",r.displayName)),M}while(1<=_&&0<=E);break}}}finally{xe=!1,Error.prepareStackTrace=l}return(r=r?r.displayName||r.name:"")?q(r):""}function Se(r){switch(r.tag){case 5:return q(r.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return r=Re(r.type,!1),r;case 11:return r=Re(r.type.render,!1),r;case 1:return r=Re(r.type,!0),r;default:return""}}function Ce(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case H:return"Fragment";case K:return"Portal";case Z:return"Profiler";case S:return"StrictMode";case Ae:return"Suspense";case fe:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case me:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case oe:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ue:return i=r.displayName||null,i!==null?i:Ce(r.type)||"Memo";case le:i=r._payload,r=r._init;try{return Ce(r(i))}catch{}}return null}function Ge(r){var i=r.type;switch(r.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=i.render,r=r.displayName||r.name||"",i.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(i);case 8:return i===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Qe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ue(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jt(r){var i=Ue(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,g=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(_){d=""+_,g.call(this,_)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Hn(r){r._valueTracker||(r._valueTracker=jt(r))}function Tr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Ue(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function pt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function en(r,i){var l=i.checked;return $({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function ws(r,i){var l=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;l=Qe(i.value!=null?i.value:l),r._wrapperState={initialChecked:d,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function tl(r,i){i=i.checked,i!=null&&L(r,"checked",i,!1)}function Wn(r,i){tl(r,i);var l=Qe(i.value),d=i.type;if(l!=null)d==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+l):r.value!==""+l&&(r.value=""+l);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}i.hasOwnProperty("value")?xs(r,i.type,l):i.hasOwnProperty("defaultValue")&&xs(r,i.type,Qe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function nl(r,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+r._wrapperState.initialValue,l||i===r.value||(r.value=i),r.defaultValue=i}l=r.name,l!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,l!==""&&(r.name=l)}function xs(r,i,l){(i!=="number"||pt(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var Gr=Array.isArray;function qr(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p<l.length;p++)i["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=i.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&d&&(r[l].defaultSelected=!0)}else{for(l=""+Qe(l),i=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ss(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return $({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function rl(r,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(n(92));if(Gr(l)){if(1<l.length)throw Error(n(93));l=l[0]}i=l}i==null&&(i=""),l=i}r._wrapperState={initialValue:Qe(l)}}function al(r,i){var l=Qe(i.value),d=Qe(i.defaultValue);l!=null&&(l=""+l,l!==r.value&&(r.value=l),i.defaultValue==null&&r.defaultValue!==l&&(r.defaultValue=l)),d!=null&&(r.defaultValue=""+d)}function lr(r){var i=r.textContent;i===r._wrapperState.initialValue&&i!==""&&i!==null&&(r.value=i)}function Yr(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yi(r,i){return r==null||r==="http://www.w3.org/1999/xhtml"?Yr(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Zr,Tn=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,d,p){MSApp.execUnsafeLocalFunction(function(){return r(i,l,d,p)})}:r})(function(r,i){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=i;else{for(Zr=Zr||document.createElement("div"),Zr.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Zr.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;i.firstChild;)r.appendChild(i.firstChild)}});function tn(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var Xr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nu=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(r){Nu.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Xr[i]=Xr[r]})});function vi(r,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Xr.hasOwnProperty(r)&&Xr[r]?(""+i).trim():i+"px"}function il(r,i){r=r.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,p=vi(l,i[l],d);l==="float"&&(l="cssFloat"),d?r.setProperty(l,p):r[l]=p}}var Kn=$({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bi(r,i){if(i){if(Kn[r]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function _i(r,i){if(r.indexOf("-")===-1)return typeof i.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ki=null;function Ps(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wi=null,Gn=null,Cr=null;function xi(r){if(r=Gs(r)){if(typeof wi!="function")throw Error(n(280));var i=r.stateNode;i&&(i=xl(i),wi(r.stateNode,r.type,i))}}function sl(r){Gn?Cr?Cr.push(r):Cr=[r]:Gn=r}function Ts(){if(Gn){var r=Gn,i=Cr;if(Cr=Gn=null,xi(r),i)for(r=0;r<i.length;r++)xi(i[r])}}function ol(r,i){return r(i)}function Cs(){}var Qr=!1;function Ua(r,i,l){if(Qr)return r(i,l);Qr=!0;try{return ol(r,i,l)}finally{Qr=!1,(Gn!==null||Cr!==null)&&(Cs(),Ts())}}function Jr(r,i){var l=r.stateNode;if(l===null)return null;var d=xl(l);if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(n(231,i,typeof l));return l}var Es=!1;if(u)try{var Ba={};Object.defineProperty(Ba,"passive",{get:function(){Es=!0}}),window.addEventListener("test",Ba,Ba),window.removeEventListener("test",Ba,Ba)}catch{Es=!1}function A(r,i,l,d,p,g,_,E,M){var z=Array.prototype.slice.call(arguments,3);try{i.apply(l,z)}catch(ee){this.onError(ee)}}var U=!1,V=null,te=!1,ae=null,Ee={onError:function(r){U=!0,V=r}};function pe(r,i,l,d,p,g,_,E,M){U=!1,V=null,A.apply(Ee,arguments)}function De(r,i,l,d,p,g,_,E,M){if(pe.apply(this,arguments),U){if(U){var z=V;U=!1,V=null}else throw Error(n(198));te||(te=!0,ae=z)}}function he(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function Ne(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function Oe(r){if(he(r)!==r)throw Error(n(188))}function Le(r){var i=r.alternate;if(!i){if(i=he(r),i===null)throw Error(n(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var g=p.alternate;if(g===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===l)return Oe(p),r;if(g===d)return Oe(p),i;g=g.sibling}throw Error(n(188))}if(l.return!==d.return)l=p,d=g;else{for(var _=!1,E=p.child;E;){if(E===l){_=!0,l=p,d=g;break}if(E===d){_=!0,d=p,l=g;break}E=E.sibling}if(!_){for(E=g.child;E;){if(E===l){_=!0,l=g,d=p;break}if(E===d){_=!0,d=g,l=p;break}E=E.sibling}if(!_)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?r:i}function st(r){return r=Le(r),r!==null?et(r):null}function et(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var i=et(r);if(i!==null)return i;r=r.sibling}return null}var ht=t.unstable_scheduleCallback,Pt=t.unstable_cancelCallback,$t=t.unstable_shouldYield,lt=t.unstable_requestPaint,rt=t.unstable_now,Er=t.unstable_getCurrentPriorityLevel,Ar=t.unstable_ImmediatePriority,qn=t.unstable_UserBlockingPriority,nn=t.unstable_NormalPriority,As=t.unstable_LowPriority,ea=t.unstable_IdlePriority,Cn=null,rn=null;function Si(r){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Cn,r,void 0,(r.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Rr,Ut=Math.log,ta=Math.LN2;function Rr(r){return r>>>=0,r===0?32:31-(Ut(r)/ta|0)|0}var ut=64,Lr=4194304;function na(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Pi(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,g=r.pingedLanes,_=l&268435455;if(_!==0){var E=_&~p;E!==0?d=na(E):(g&=_,g!==0&&(d=na(g)))}else _=l&~p,_!==0?d=na(_):g!==0&&(d=na(g));if(d===0)return 0;if(i!==0&&i!==d&&(i&p)===0&&(p=d&-d,g=i&-i,p>=g||p===16&&(g&4194240)!==0))return i;if((d&4)!==0&&(d|=l&16),i=r.entangledLanes,i!==0)for(r=r.entanglements,i&=d;0<i;)l=31-He(i),p=1<<l,d|=r[l],i&=~p;return d}function Fx(r,i){switch(r){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vx(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,g=r.pendingLanes;0<g;){var _=31-He(g),E=1<<_,M=p[_];M===-1?((E&l)===0||(E&d)!==0)&&(p[_]=Fx(E,i)):M<=i&&(r.expiredLanes|=E),g&=~E}}function Ou(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function hm(){var r=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),r}function Iu(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Rs(r,i,l){r.pendingLanes|=i,i!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,i=31-He(i),r[i]=l}function zx(r,i){var l=r.pendingLanes&~i;r.pendingLanes=i,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=i,r.mutableReadLanes&=i,r.entangledLanes&=i,i=r.entanglements;var d=r.eventTimes;for(r=r.expirationTimes;0<l;){var p=31-He(l),g=1<<p;i[p]=0,d[p]=-1,r[p]=-1,l&=~g}}function ju(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-He(l),p=1<<d;p&i|r[d]&i&&(r[d]|=i),l&=~p}}var ct=0;function fm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var pm,Uu,mm,gm,ym,Bu=!1,ll=[],ra=null,aa=null,ia=null,Ls=new Map,Ds=new Map,sa=[],$x="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vm(r,i){switch(r){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":ia=null;break;case"pointerover":case"pointerout":Ls.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ds.delete(i.pointerId)}}function Ms(r,i,l,d,p,g){return r===null||r.nativeEvent!==g?(r={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[p]},i!==null&&(i=Gs(i),i!==null&&Uu(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Hx(r,i,l,d,p){switch(i){case"focusin":return ra=Ms(ra,r,i,l,d,p),!0;case"dragenter":return aa=Ms(aa,r,i,l,d,p),!0;case"mouseover":return ia=Ms(ia,r,i,l,d,p),!0;case"pointerover":var g=p.pointerId;return Ls.set(g,Ms(Ls.get(g)||null,r,i,l,d,p)),!0;case"gotpointercapture":return g=p.pointerId,Ds.set(g,Ms(Ds.get(g)||null,r,i,l,d,p)),!0}return!1}function bm(r){var i=Fa(r.target);if(i!==null){var l=he(i);if(l!==null){if(i=l.tag,i===13){if(i=Ne(l),i!==null){r.blockedOn=i,ym(r.priority,function(){mm(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function cl(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Vu(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);ki=d,l.target.dispatchEvent(d),ki=null}else return i=Gs(l),i!==null&&Uu(i),r.blockedOn=l,!1;i.shift()}return!0}function _m(r,i,l){cl(r)&&l.delete(i)}function Wx(){Bu=!1,ra!==null&&cl(ra)&&(ra=null),aa!==null&&cl(aa)&&(aa=null),ia!==null&&cl(ia)&&(ia=null),Ls.forEach(_m),Ds.forEach(_m)}function Ns(r,i){r.blockedOn===i&&(r.blockedOn=null,Bu||(Bu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wx)))}function Os(r){function i(p){return Ns(p,r)}if(0<ll.length){Ns(ll[0],r);for(var l=1;l<ll.length;l++){var d=ll[l];d.blockedOn===r&&(d.blockedOn=null)}}for(ra!==null&&Ns(ra,r),aa!==null&&Ns(aa,r),ia!==null&&Ns(ia,r),Ls.forEach(i),Ds.forEach(i),l=0;l<sa.length;l++)d=sa[l],d.blockedOn===r&&(d.blockedOn=null);for(;0<sa.length&&(l=sa[0],l.blockedOn===null);)bm(l),l.blockedOn===null&&sa.shift()}var Ti=j.ReactCurrentBatchConfig,ul=!0;function Kx(r,i,l,d){var p=ct,g=Ti.transition;Ti.transition=null;try{ct=1,Fu(r,i,l,d)}finally{ct=p,Ti.transition=g}}function Gx(r,i,l,d){var p=ct,g=Ti.transition;Ti.transition=null;try{ct=4,Fu(r,i,l,d)}finally{ct=p,Ti.transition=g}}function Fu(r,i,l,d){if(ul){var p=Vu(r,i,l,d);if(p===null)ad(r,i,d,dl,l),vm(r,d);else if(Hx(p,r,i,l,d))d.stopPropagation();else if(vm(r,d),i&4&&-1<$x.indexOf(r)){for(;p!==null;){var g=Gs(p);if(g!==null&&pm(g),g=Vu(r,i,l,d),g===null&&ad(r,i,d,dl,l),g===p)break;p=g}p!==null&&d.stopPropagation()}else ad(r,i,d,null,l)}}var dl=null;function Vu(r,i,l,d){if(dl=null,r=Ps(d),r=Fa(r),r!==null)if(i=he(r),i===null)r=null;else if(l=i.tag,l===13){if(r=Ne(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null);return dl=r,null}function km(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Er()){case Ar:return 1;case qn:return 4;case nn:case As:return 16;case ea:return 536870912;default:return 16}default:return 16}}var oa=null,zu=null,hl=null;function wm(){if(hl)return hl;var r,i=zu,l=i.length,d,p="value"in oa?oa.value:oa.textContent,g=p.length;for(r=0;r<l&&i[r]===p[r];r++);var _=l-r;for(d=1;d<=_&&i[l-d]===p[g-d];d++);return hl=p.slice(r,1<d?1-d:void 0)}function fl(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function pl(){return!0}function xm(){return!1}function vn(r){function i(l,d,p,g,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=g,this.target=_,this.currentTarget=null;for(var E in r)r.hasOwnProperty(E)&&(l=r[E],this[E]=l?l(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?pl:xm,this.isPropagationStopped=xm,this}return $(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),i}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$u=vn(Ci),Is=$({},Ci,{view:0,detail:0}),qx=vn(Is),Hu,Wu,js,ml=$({},Is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==js&&(js&&r.type==="mousemove"?(Hu=r.screenX-js.screenX,Wu=r.screenY-js.screenY):Wu=Hu=0,js=r),Hu)},movementY:function(r){return"movementY"in r?r.movementY:Wu}}),Sm=vn(ml),Yx=$({},ml,{dataTransfer:0}),Zx=vn(Yx),Xx=$({},Is,{relatedTarget:0}),Ku=vn(Xx),Qx=$({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),Jx=vn(Qx),eS=$({},Ci,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),tS=vn(eS),nS=$({},Ci,{data:0}),Pm=vn(nS),rS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},iS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sS(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=iS[r])?!!i[r]:!1}function Gu(){return sS}var oS=$({},Is,{key:function(r){if(r.key){var i=rS[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=fl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?aS[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gu,charCode:function(r){return r.type==="keypress"?fl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?fl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),lS=vn(oS),cS=$({},ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tm=vn(cS),uS=$({},Is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gu}),dS=vn(uS),hS=$({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),fS=vn(hS),pS=$({},ml,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),mS=vn(pS),gS=[9,13,27,32],qu=u&&"CompositionEvent"in window,Us=null;u&&"documentMode"in document&&(Us=document.documentMode);var yS=u&&"TextEvent"in window&&!Us,Cm=u&&(!qu||Us&&8<Us&&11>=Us),Em=" ",Am=!1;function Rm(r,i){switch(r){case"keyup":return gS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ei=!1;function vS(r,i){switch(r){case"compositionend":return Lm(i);case"keypress":return i.which!==32?null:(Am=!0,Em);case"textInput":return r=i.data,r===Em&&Am?null:r;default:return null}}function bS(r,i){if(Ei)return r==="compositionend"||!qu&&Rm(r,i)?(r=wm(),hl=zu=oa=null,Ei=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Cm&&i.locale!=="ko"?null:i.data;default:return null}}var _S={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dm(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!_S[r.type]:i==="textarea"}function Mm(r,i,l,d){sl(d),i=_l(i,"onChange"),0<i.length&&(l=new $u("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var Bs=null,Fs=null;function kS(r){Xm(r,0)}function gl(r){var i=Mi(r);if(Tr(i))return r}function wS(r,i){if(r==="change")return i}var Nm=!1;if(u){var Yu;if(u){var Zu="oninput"in document;if(!Zu){var Om=document.createElement("div");Om.setAttribute("oninput","return;"),Zu=typeof Om.oninput=="function"}Yu=Zu}else Yu=!1;Nm=Yu&&(!document.documentMode||9<document.documentMode)}function Im(){Bs&&(Bs.detachEvent("onpropertychange",jm),Fs=Bs=null)}function jm(r){if(r.propertyName==="value"&&gl(Fs)){var i=[];Mm(i,Fs,r,Ps(r)),Ua(kS,i)}}function xS(r,i,l){r==="focusin"?(Im(),Bs=i,Fs=l,Bs.attachEvent("onpropertychange",jm)):r==="focusout"&&Im()}function SS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return gl(Fs)}function PS(r,i){if(r==="click")return gl(i)}function TS(r,i){if(r==="input"||r==="change")return gl(i)}function CS(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:CS;function Vs(r,i){if(Yn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!h.call(i,p)||!Yn(r[p],i[p]))return!1}return!0}function Um(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Bm(r,i){var l=Um(r);r=0;for(var d;l;){if(l.nodeType===3){if(d=r+l.textContent.length,r<=i&&d>=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Um(l)}}function Fm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Fm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Vm(){for(var r=window,i=pt();i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=pt(r.document)}return i}function Xu(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function ES(r){var i=Vm(),l=r.focusedElem,d=r.selectionRange;if(i!==l&&l&&l.ownerDocument&&Fm(l.ownerDocument.documentElement,l)){if(d!==null&&Xu(l)){if(i=d.start,r=d.end,r===void 0&&(r=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(r,l.value.length);else if(r=(i=l.ownerDocument||document)&&i.defaultView||window,r.getSelection){r=r.getSelection();var p=l.textContent.length,g=Math.min(d.start,p);d=d.end===void 0?g:Math.min(d.end,p),!r.extend&&g>d&&(p=d,d=g,g=p),p=Bm(l,g);var _=Bm(l,d);p&&_&&(r.rangeCount!==1||r.anchorNode!==p.node||r.anchorOffset!==p.offset||r.focusNode!==_.node||r.focusOffset!==_.offset)&&(i=i.createRange(),i.setStart(p.node,p.offset),r.removeAllRanges(),g>d?(r.addRange(i),r.extend(_.node,_.offset)):(i.setEnd(_.node,_.offset),r.addRange(i)))}}for(i=[],r=l;r=r.parentNode;)r.nodeType===1&&i.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)r=i[l],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var AS=u&&"documentMode"in document&&11>=document.documentMode,Ai=null,Qu=null,zs=null,Ju=!1;function zm(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ju||Ai==null||Ai!==pt(d)||(d=Ai,"selectionStart"in d&&Xu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),zs&&Vs(zs,d)||(zs=d,d=_l(Qu,"onSelect"),0<d.length&&(i=new $u("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Ai)))}function yl(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Ri={animationend:yl("Animation","AnimationEnd"),animationiteration:yl("Animation","AnimationIteration"),animationstart:yl("Animation","AnimationStart"),transitionend:yl("Transition","TransitionEnd")},ed={},$m={};u&&($m=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function vl(r){if(ed[r])return ed[r];if(!Ri[r])return r;var i=Ri[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in $m)return ed[r]=i[l];return r}var Hm=vl("animationend"),Wm=vl("animationiteration"),Km=vl("animationstart"),Gm=vl("transitionend"),qm=new Map,Ym="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function la(r,i){qm.set(r,i),o(i,[r])}for(var td=0;td<Ym.length;td++){var nd=Ym[td],RS=nd.toLowerCase(),LS=nd[0].toUpperCase()+nd.slice(1);la(RS,"on"+LS)}la(Hm,"onAnimationEnd"),la(Wm,"onAnimationIteration"),la(Km,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(Gm,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DS=new Set("cancel close invalid load scroll toggle".split(" ").concat($s));function Zm(r,i,l){var d=r.type||"unknown-event";r.currentTarget=l,De(d,i,void 0,r),r.currentTarget=null}function Xm(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var d=r[l],p=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var _=d.length-1;0<=_;_--){var E=d[_],M=E.instance,z=E.currentTarget;if(E=E.listener,M!==g&&p.isPropagationStopped())break e;Zm(p,E,z),g=M}else for(_=0;_<d.length;_++){if(E=d[_],M=E.instance,z=E.currentTarget,E=E.listener,M!==g&&p.isPropagationStopped())break e;Zm(p,E,z),g=M}}}if(te)throw r=ae,te=!1,ae=null,r}function mt(r,i){var l=i[ud];l===void 0&&(l=i[ud]=new Set);var d=r+"__bubble";l.has(d)||(Qm(i,r,2,!1),l.add(d))}function rd(r,i,l){var d=0;i&&(d|=4),Qm(l,r,d,i)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Hs(r){if(!r[bl]){r[bl]=!0,a.forEach(function(l){l!=="selectionchange"&&(DS.has(l)||rd(l,!1,r),rd(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[bl]||(i[bl]=!0,rd("selectionchange",!1,i))}}function Qm(r,i,l,d){switch(km(i)){case 1:var p=Kx;break;case 4:p=Gx;break;default:p=Fu}l=p.bind(null,i,l,r),p=void 0,!Es||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,l,{capture:!0,passive:p}):r.addEventListener(i,l,!0):p!==void 0?r.addEventListener(i,l,{passive:p}):r.addEventListener(i,l,!1)}function ad(r,i,l,d,p){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var E=d.stateNode.containerInfo;if(E===p||E.nodeType===8&&E.parentNode===p)break;if(_===4)for(_=d.return;_!==null;){var M=_.tag;if((M===3||M===4)&&(M=_.stateNode.containerInfo,M===p||M.nodeType===8&&M.parentNode===p))return;_=_.return}for(;E!==null;){if(_=Fa(E),_===null)return;if(M=_.tag,M===5||M===6){d=g=_;continue e}E=E.parentNode}}d=d.return}Ua(function(){var z=g,ee=Ps(l),ne=[];e:{var J=qm.get(r);if(J!==void 0){var de=$u,ve=r;switch(r){case"keypress":if(fl(l)===0)break e;case"keydown":case"keyup":de=lS;break;case"focusin":ve="focus",de=Ku;break;case"focusout":ve="blur",de=Ku;break;case"beforeblur":case"afterblur":de=Ku;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Zx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=dS;break;case Hm:case Wm:case Km:de=Jx;break;case Gm:de=fS;break;case"scroll":de=qx;break;case"wheel":de=mS;break;case"copy":case"cut":case"paste":de=tS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Tm}var we=(i&4)!==0,Tt=!we&&r==="scroll",B=we?J!==null?J+"Capture":null:J;we=[];for(var O=z,F;O!==null;){F=O;var se=F.stateNode;if(F.tag===5&&se!==null&&(F=se,B!==null&&(se=Jr(O,B),se!=null&&we.push(Ws(O,se,F)))),Tt)break;O=O.return}0<we.length&&(J=new de(J,ve,null,l,ee),ne.push({event:J,listeners:we}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",de=r==="mouseout"||r==="pointerout",J&&l!==ki&&(ve=l.relatedTarget||l.fromElement)&&(Fa(ve)||ve[Dr]))break e;if((de||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,de?(ve=l.relatedTarget||l.toElement,de=z,ve=ve?Fa(ve):null,ve!==null&&(Tt=he(ve),ve!==Tt||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(de=null,ve=z),de!==ve)){if(we=Sm,se="onMouseLeave",B="onMouseEnter",O="mouse",(r==="pointerout"||r==="pointerover")&&(we=Tm,se="onPointerLeave",B="onPointerEnter",O="pointer"),Tt=de==null?J:Mi(de),F=ve==null?J:Mi(ve),J=new we(se,O+"leave",de,l,ee),J.target=Tt,J.relatedTarget=F,se=null,Fa(ee)===z&&(we=new we(B,O+"enter",ve,l,ee),we.target=F,we.relatedTarget=Tt,se=we),Tt=se,de&&ve)t:{for(we=de,B=ve,O=0,F=we;F;F=Li(F))O++;for(F=0,se=B;se;se=Li(se))F++;for(;0<O-F;)we=Li(we),O--;for(;0<F-O;)B=Li(B),F--;for(;O--;){if(we===B||B!==null&&we===B.alternate)break t;we=Li(we),B=Li(B)}we=null}else we=null;de!==null&&Jm(ne,J,de,we,!1),ve!==null&&Tt!==null&&Jm(ne,Tt,ve,we,!0)}}e:{if(J=z?Mi(z):window,de=J.nodeName&&J.nodeName.toLowerCase(),de==="select"||de==="input"&&J.type==="file")var Pe=wS;else if(Dm(J))if(Nm)Pe=TS;else{Pe=SS;var Ie=xS}else(de=J.nodeName)&&de.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Pe=PS);if(Pe&&(Pe=Pe(r,z))){Mm(ne,Pe,l,ee);break e}Ie&&Ie(r,J,z),r==="focusout"&&(Ie=J._wrapperState)&&Ie.controlled&&J.type==="number"&&xs(J,"number",J.value)}switch(Ie=z?Mi(z):window,r){case"focusin":(Dm(Ie)||Ie.contentEditable==="true")&&(Ai=Ie,Qu=z,zs=null);break;case"focusout":zs=Qu=Ai=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,zm(ne,l,ee);break;case"selectionchange":if(AS)break;case"keydown":case"keyup":zm(ne,l,ee)}var je;if(qu)e:{switch(r){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ei?Rm(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Cm&&l.locale!=="ko"&&(Ei||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ei&&(je=wm()):(oa=ee,zu="value"in oa?oa.value:oa.textContent,Ei=!0)),Ie=_l(z,Ve),0<Ie.length&&(Ve=new Pm(Ve,r,null,l,ee),ne.push({event:Ve,listeners:Ie}),je?Ve.data=je:(je=Lm(l),je!==null&&(Ve.data=je)))),(je=yS?vS(r,l):bS(r,l))&&(z=_l(z,"onBeforeInput"),0<z.length&&(ee=new Pm("onBeforeInput","beforeinput",null,l,ee),ne.push({event:ee,listeners:z}),ee.data=je))}Xm(ne,i)})}function Ws(r,i,l){return{instance:r,listener:i,currentTarget:l}}function _l(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=Jr(r,l),g!=null&&d.unshift(Ws(r,g,p)),g=Jr(r,i),g!=null&&d.push(Ws(r,g,p))),r=r.return}return d}function Li(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Jm(r,i,l,d,p){for(var g=i._reactName,_=[];l!==null&&l!==d;){var E=l,M=E.alternate,z=E.stateNode;if(M!==null&&M===d)break;E.tag===5&&z!==null&&(E=z,p?(M=Jr(l,g),M!=null&&_.unshift(Ws(l,M,E))):p||(M=Jr(l,g),M!=null&&_.push(Ws(l,M,E)))),l=l.return}_.length!==0&&r.push({event:i,listeners:_})}var MS=/\r\n?/g,NS=/\u0000|\uFFFD/g;function eg(r){return(typeof r=="string"?r:""+r).replace(MS,`
7
+ `).replace(NS,"")}function kl(r,i,l){if(i=eg(i),eg(r)!==i&&l)throw Error(n(425))}function wl(){}var id=null,sd=null;function od(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ld=typeof setTimeout=="function"?setTimeout:void 0,OS=typeof clearTimeout=="function"?clearTimeout:void 0,tg=typeof Promise=="function"?Promise:void 0,IS=typeof queueMicrotask=="function"?queueMicrotask:typeof tg<"u"?function(r){return tg.resolve(null).then(r).catch(jS)}:ld;function jS(r){setTimeout(function(){throw r})}function cd(r,i){var l=i,d=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(d===0){r.removeChild(p),Os(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);Os(i)}function ca(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return r}function ng(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return r;i--}else l==="/$"&&i++}r=r.previousSibling}return null}var Di=Math.random().toString(36).slice(2),cr="__reactFiber$"+Di,Ks="__reactProps$"+Di,Dr="__reactContainer$"+Di,ud="__reactEvents$"+Di,US="__reactListeners$"+Di,BS="__reactHandles$"+Di;function Fa(r){var i=r[cr];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Dr]||l[cr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=ng(r);r!==null;){if(l=r[cr])return l;r=ng(r)}return i}r=l,l=r.parentNode}return null}function Gs(r){return r=r[cr]||r[Dr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Mi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function xl(r){return r[Ks]||null}var dd=[],Ni=-1;function ua(r){return{current:r}}function gt(r){0>Ni||(r.current=dd[Ni],dd[Ni]=null,Ni--)}function ft(r,i){Ni++,dd[Ni]=r.current,r.current=i}var da={},qt=ua(da),hn=ua(!1),Va=da;function Oi(r,i){var l=r.type.contextTypes;if(!l)return da;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in l)p[g]=i[g];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=i,r.__reactInternalMemoizedMaskedChildContext=p),p}function fn(r){return r=r.childContextTypes,r!=null}function Sl(){gt(hn),gt(qt)}function rg(r,i,l){if(qt.current!==da)throw Error(n(168));ft(qt,i),ft(hn,l)}function ag(r,i,l){var d=r.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var p in d)if(!(p in i))throw Error(n(108,Ge(r)||"Unknown",p));return $({},l,d)}function Pl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||da,Va=qt.current,ft(qt,r),ft(hn,hn.current),!0}function ig(r,i,l){var d=r.stateNode;if(!d)throw Error(n(169));l?(r=ag(r,i,Va),d.__reactInternalMemoizedMergedChildContext=r,gt(hn),gt(qt),ft(qt,r)):gt(hn),ft(hn,l)}var Mr=null,Tl=!1,hd=!1;function sg(r){Mr===null?Mr=[r]:Mr.push(r)}function FS(r){Tl=!0,sg(r)}function ha(){if(!hd&&Mr!==null){hd=!0;var r=0,i=ct;try{var l=Mr;for(ct=1;r<l.length;r++){var d=l[r];do d=d(!0);while(d!==null)}Mr=null,Tl=!1}catch(p){throw Mr!==null&&(Mr=Mr.slice(r+1)),ht(Ar,ha),p}finally{ct=i,hd=!1}}return null}var Ii=[],ji=0,Cl=null,El=0,En=[],An=0,za=null,Nr=1,Or="";function $a(r,i){Ii[ji++]=El,Ii[ji++]=Cl,Cl=r,El=i}function og(r,i,l){En[An++]=Nr,En[An++]=Or,En[An++]=za,za=r;var d=Nr;r=Or;var p=32-He(d)-1;d&=~(1<<p),l+=1;var g=32-He(i)+p;if(30<g){var _=p-p%5;g=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Nr=1<<32-He(i)+p|l<<p|d,Or=g+r}else Nr=1<<g|l<<p|d,Or=r}function fd(r){r.return!==null&&($a(r,1),og(r,1,0))}function pd(r){for(;r===Cl;)Cl=Ii[--ji],Ii[ji]=null,El=Ii[--ji],Ii[ji]=null;for(;r===za;)za=En[--An],En[An]=null,Or=En[--An],En[An]=null,Nr=En[--An],En[An]=null}var bn=null,_n=null,bt=!1,Zn=null;function lg(r,i){var l=Mn(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=r,i=r.deletions,i===null?(r.deletions=[l],r.flags|=16):i.push(l)}function cg(r,i){switch(r.tag){case 5:var l=r.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(r.stateNode=i,bn=r,_n=ca(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,bn=r,_n=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=za!==null?{id:Nr,overflow:Or}:null,r.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Mn(18,null,null,0),l.stateNode=i,l.return=r,r.child=l,bn=r,_n=null,!0):!1;default:return!1}}function md(r){return(r.mode&1)!==0&&(r.flags&128)===0}function gd(r){if(bt){var i=_n;if(i){var l=i;if(!cg(r,i)){if(md(r))throw Error(n(418));i=ca(l.nextSibling);var d=bn;i&&cg(r,i)?lg(d,l):(r.flags=r.flags&-4097|2,bt=!1,bn=r)}}else{if(md(r))throw Error(n(418));r.flags=r.flags&-4097|2,bt=!1,bn=r}}}function ug(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;bn=r}function Al(r){if(r!==bn)return!1;if(!bt)return ug(r),bt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!od(r.type,r.memoizedProps)),i&&(i=_n)){if(md(r))throw dg(),Error(n(418));for(;i;)lg(r,i),i=ca(i.nextSibling)}if(ug(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"){if(i===0){_n=ca(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}r=r.nextSibling}_n=null}}else _n=bn?ca(r.stateNode.nextSibling):null;return!0}function dg(){for(var r=_n;r;)r=ca(r.nextSibling)}function Ui(){_n=bn=null,bt=!1}function yd(r){Zn===null?Zn=[r]:Zn.push(r)}var VS=j.ReactCurrentBatchConfig;function qs(r,i,l){if(r=l.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,r));var p=d,g=""+r;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===g?i.ref:(i=function(_){var E=p.refs;_===null?delete E[g]:E[g]=_},i._stringRef=g,i)}if(typeof r!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,r))}return r}function Rl(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function hg(r){var i=r._init;return i(r._payload)}function fg(r){function i(B,O){if(r){var F=B.deletions;F===null?(B.deletions=[O],B.flags|=16):F.push(O)}}function l(B,O){if(!r)return null;for(;O!==null;)i(B,O),O=O.sibling;return null}function d(B,O){for(B=new Map;O!==null;)O.key!==null?B.set(O.key,O):B.set(O.index,O),O=O.sibling;return B}function p(B,O){return B=_a(B,O),B.index=0,B.sibling=null,B}function g(B,O,F){return B.index=F,r?(F=B.alternate,F!==null?(F=F.index,F<O?(B.flags|=2,O):F):(B.flags|=2,O)):(B.flags|=1048576,O)}function _(B){return r&&B.alternate===null&&(B.flags|=2),B}function E(B,O,F,se){return O===null||O.tag!==6?(O=lh(F,B.mode,se),O.return=B,O):(O=p(O,F),O.return=B,O)}function M(B,O,F,se){var Pe=F.type;return Pe===H?ee(B,O,F.props.children,se,F.key):O!==null&&(O.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===le&&hg(Pe)===O.type)?(se=p(O,F.props),se.ref=qs(B,O,F),se.return=B,se):(se=ec(F.type,F.key,F.props,null,B.mode,se),se.ref=qs(B,O,F),se.return=B,se)}function z(B,O,F,se){return O===null||O.tag!==4||O.stateNode.containerInfo!==F.containerInfo||O.stateNode.implementation!==F.implementation?(O=ch(F,B.mode,se),O.return=B,O):(O=p(O,F.children||[]),O.return=B,O)}function ee(B,O,F,se,Pe){return O===null||O.tag!==7?(O=Xa(F,B.mode,se,Pe),O.return=B,O):(O=p(O,F),O.return=B,O)}function ne(B,O,F){if(typeof O=="string"&&O!==""||typeof O=="number")return O=lh(""+O,B.mode,F),O.return=B,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case G:return F=ec(O.type,O.key,O.props,null,B.mode,F),F.ref=qs(B,null,O),F.return=B,F;case K:return O=ch(O,B.mode,F),O.return=B,O;case le:var se=O._init;return ne(B,se(O._payload),F)}if(Gr(O)||Y(O))return O=Xa(O,B.mode,F,null),O.return=B,O;Rl(B,O)}return null}function J(B,O,F,se){var Pe=O!==null?O.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Pe!==null?null:E(B,O,""+F,se);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case G:return F.key===Pe?M(B,O,F,se):null;case K:return F.key===Pe?z(B,O,F,se):null;case le:return Pe=F._init,J(B,O,Pe(F._payload),se)}if(Gr(F)||Y(F))return Pe!==null?null:ee(B,O,F,se,null);Rl(B,F)}return null}function de(B,O,F,se,Pe){if(typeof se=="string"&&se!==""||typeof se=="number")return B=B.get(F)||null,E(O,B,""+se,Pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case G:return B=B.get(se.key===null?F:se.key)||null,M(O,B,se,Pe);case K:return B=B.get(se.key===null?F:se.key)||null,z(O,B,se,Pe);case le:var Ie=se._init;return de(B,O,F,Ie(se._payload),Pe)}if(Gr(se)||Y(se))return B=B.get(F)||null,ee(O,B,se,Pe,null);Rl(O,se)}return null}function ve(B,O,F,se){for(var Pe=null,Ie=null,je=O,Ve=O=0,Vt=null;je!==null&&Ve<F.length;Ve++){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var ot=J(B,je,F[Ve],se);if(ot===null){je===null&&(je=Vt);break}r&&je&&ot.alternate===null&&i(B,je),O=g(ot,O,Ve),Ie===null?Pe=ot:Ie.sibling=ot,Ie=ot,je=Vt}if(Ve===F.length)return l(B,je),bt&&$a(B,Ve),Pe;if(je===null){for(;Ve<F.length;Ve++)je=ne(B,F[Ve],se),je!==null&&(O=g(je,O,Ve),Ie===null?Pe=je:Ie.sibling=je,Ie=je);return bt&&$a(B,Ve),Pe}for(je=d(B,je);Ve<F.length;Ve++)Vt=de(je,B,Ve,F[Ve],se),Vt!==null&&(r&&Vt.alternate!==null&&je.delete(Vt.key===null?Ve:Vt.key),O=g(Vt,O,Ve),Ie===null?Pe=Vt:Ie.sibling=Vt,Ie=Vt);return r&&je.forEach(function(ka){return i(B,ka)}),bt&&$a(B,Ve),Pe}function we(B,O,F,se){var Pe=Y(F);if(typeof Pe!="function")throw Error(n(150));if(F=Pe.call(F),F==null)throw Error(n(151));for(var Ie=Pe=null,je=O,Ve=O=0,Vt=null,ot=F.next();je!==null&&!ot.done;Ve++,ot=F.next()){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var ka=J(B,je,ot.value,se);if(ka===null){je===null&&(je=Vt);break}r&&je&&ka.alternate===null&&i(B,je),O=g(ka,O,Ve),Ie===null?Pe=ka:Ie.sibling=ka,Ie=ka,je=Vt}if(ot.done)return l(B,je),bt&&$a(B,Ve),Pe;if(je===null){for(;!ot.done;Ve++,ot=F.next())ot=ne(B,ot.value,se),ot!==null&&(O=g(ot,O,Ve),Ie===null?Pe=ot:Ie.sibling=ot,Ie=ot);return bt&&$a(B,Ve),Pe}for(je=d(B,je);!ot.done;Ve++,ot=F.next())ot=de(je,B,Ve,ot.value,se),ot!==null&&(r&&ot.alternate!==null&&je.delete(ot.key===null?Ve:ot.key),O=g(ot,O,Ve),Ie===null?Pe=ot:Ie.sibling=ot,Ie=ot);return r&&je.forEach(function(_P){return i(B,_P)}),bt&&$a(B,Ve),Pe}function Tt(B,O,F,se){if(typeof F=="object"&&F!==null&&F.type===H&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case G:e:{for(var Pe=F.key,Ie=O;Ie!==null;){if(Ie.key===Pe){if(Pe=F.type,Pe===H){if(Ie.tag===7){l(B,Ie.sibling),O=p(Ie,F.props.children),O.return=B,B=O;break e}}else if(Ie.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===le&&hg(Pe)===Ie.type){l(B,Ie.sibling),O=p(Ie,F.props),O.ref=qs(B,Ie,F),O.return=B,B=O;break e}l(B,Ie);break}else i(B,Ie);Ie=Ie.sibling}F.type===H?(O=Xa(F.props.children,B.mode,se,F.key),O.return=B,B=O):(se=ec(F.type,F.key,F.props,null,B.mode,se),se.ref=qs(B,O,F),se.return=B,B=se)}return _(B);case K:e:{for(Ie=F.key;O!==null;){if(O.key===Ie)if(O.tag===4&&O.stateNode.containerInfo===F.containerInfo&&O.stateNode.implementation===F.implementation){l(B,O.sibling),O=p(O,F.children||[]),O.return=B,B=O;break e}else{l(B,O);break}else i(B,O);O=O.sibling}O=ch(F,B.mode,se),O.return=B,B=O}return _(B);case le:return Ie=F._init,Tt(B,O,Ie(F._payload),se)}if(Gr(F))return ve(B,O,F,se);if(Y(F))return we(B,O,F,se);Rl(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,O!==null&&O.tag===6?(l(B,O.sibling),O=p(O,F),O.return=B,B=O):(l(B,O),O=lh(F,B.mode,se),O.return=B,B=O),_(B)):l(B,O)}return Tt}var Bi=fg(!0),pg=fg(!1),Ll=ua(null),Dl=null,Fi=null,vd=null;function bd(){vd=Fi=Dl=null}function _d(r){var i=Ll.current;gt(Ll),r._currentValue=i}function kd(r,i,l){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===l)break;r=r.return}}function Vi(r,i){Dl=r,vd=Fi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&i)!==0&&(pn=!0),r.firstContext=null)}function Rn(r){var i=r._currentValue;if(vd!==r)if(r={context:r,memoizedValue:i,next:null},Fi===null){if(Dl===null)throw Error(n(308));Fi=r,Dl.dependencies={lanes:0,firstContext:r}}else Fi=Fi.next=r;return i}var Ha=null;function wd(r){Ha===null?Ha=[r]:Ha.push(r)}function mg(r,i,l,d){var p=i.interleaved;return p===null?(l.next=l,wd(i)):(l.next=p.next,p.next=l),i.interleaved=l,Ir(r,d)}function Ir(r,i){r.lanes|=i;var l=r.alternate;for(l!==null&&(l.lanes|=i),l=r,r=r.return;r!==null;)r.childLanes|=i,l=r.alternate,l!==null&&(l.childLanes|=i),l=r,r=r.return;return l.tag===3?l.stateNode:null}var fa=!1;function xd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gg(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function jr(r,i){return{eventTime:r,lane:i,tag:0,payload:null,callback:null,next:null}}function pa(r,i,l){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(at&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,Ir(r,l)}return p=d.interleaved,p===null?(i.next=i,wd(d)):(i.next=p.next,p.next=i),d.interleaved=i,Ir(r,l)}function Ml(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,ju(r,l)}}function yg(r,i){var l=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var _={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};g===null?p=g=_:g=g.next=_,l=l.next}while(l!==null);g===null?p=g=i:g=g.next=i}else p=g=i;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:d.shared,effects:d.effects},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}function Nl(r,i,l,d){var p=r.updateQueue;fa=!1;var g=p.firstBaseUpdate,_=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var M=E,z=M.next;M.next=null,_===null?g=z:_.next=z,_=M;var ee=r.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==_&&(E===null?ee.firstBaseUpdate=z:E.next=z,ee.lastBaseUpdate=M))}if(g!==null){var ne=p.baseState;_=0,ee=z=M=null,E=g;do{var J=E.lane,de=E.eventTime;if((d&J)===J){ee!==null&&(ee=ee.next={eventTime:de,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ve=r,we=E;switch(J=i,de=l,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ne=ve.call(de,ne,J);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,J=typeof ve=="function"?ve.call(de,ne,J):ve,J==null)break e;ne=$({},ne,J);break e;case 2:fa=!0}}E.callback!==null&&E.lane!==0&&(r.flags|=64,J=p.effects,J===null?p.effects=[E]:J.push(E))}else de={eventTime:de,lane:J,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ee===null?(z=ee=de,M=ne):ee=ee.next=de,_|=J;if(E=E.next,E===null){if(E=p.shared.pending,E===null)break;J=E,E=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(ee===null&&(M=ne),p.baseState=M,p.firstBaseUpdate=z,p.lastBaseUpdate=ee,i=p.shared.interleaved,i!==null){p=i;do _|=p.lane,p=p.next;while(p!==i)}else g===null&&(p.shared.lanes=0);Ga|=_,r.lanes=_,r.memoizedState=ne}}function vg(r,i,l){if(r=i.effects,i.effects=null,r!==null)for(i=0;i<r.length;i++){var d=r[i],p=d.callback;if(p!==null){if(d.callback=null,d=l,typeof p!="function")throw Error(n(191,p));p.call(d)}}}var Ys={},ur=ua(Ys),Zs=ua(Ys),Xs=ua(Ys);function Wa(r){if(r===Ys)throw Error(n(174));return r}function Sd(r,i){switch(ft(Xs,i),ft(Zs,r),ft(ur,Ys),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:yi(null,"");break;default:r=r===8?i.parentNode:i,i=r.namespaceURI||null,r=r.tagName,i=yi(i,r)}gt(ur),ft(ur,i)}function zi(){gt(ur),gt(Zs),gt(Xs)}function bg(r){Wa(Xs.current);var i=Wa(ur.current),l=yi(i,r.type);i!==l&&(ft(Zs,r),ft(ur,l))}function Pd(r){Zs.current===r&&(gt(ur),gt(Zs))}var kt=ua(0);function Ol(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Td=[];function Cd(){for(var r=0;r<Td.length;r++)Td[r]._workInProgressVersionPrimary=null;Td.length=0}var Il=j.ReactCurrentDispatcher,Ed=j.ReactCurrentBatchConfig,Ka=0,wt=null,Mt=null,Bt=null,jl=!1,Qs=!1,Js=0,zS=0;function Yt(){throw Error(n(321))}function Ad(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Yn(r[l],i[l]))return!1;return!0}function Rd(r,i,l,d,p,g){if(Ka=g,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Il.current=r===null||r.memoizedState===null?KS:GS,r=l(d,p),Qs){g=0;do{if(Qs=!1,Js=0,25<=g)throw Error(n(301));g+=1,Bt=Mt=null,i.updateQueue=null,Il.current=qS,r=l(d,p)}while(Qs)}if(Il.current=Fl,i=Mt!==null&&Mt.next!==null,Ka=0,Bt=Mt=wt=null,jl=!1,i)throw Error(n(300));return r}function Ld(){var r=Js!==0;return Js=0,r}function dr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r,Bt}function Ln(){if(Mt===null){var r=wt.alternate;r=r!==null?r.memoizedState:null}else r=Mt.next;var i=Bt===null?wt.memoizedState:Bt.next;if(i!==null)Bt=i,Mt=r;else{if(r===null)throw Error(n(310));Mt=r,r={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r}return Bt}function eo(r,i){return typeof i=="function"?i(r):i}function Dd(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=Mt,p=d.baseQueue,g=l.pending;if(g!==null){if(p!==null){var _=p.next;p.next=g.next,g.next=_}d.baseQueue=p=g,l.pending=null}if(p!==null){g=p.next,d=d.baseState;var E=_=null,M=null,z=g;do{var ee=z.lane;if((Ka&ee)===ee)M!==null&&(M=M.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),d=z.hasEagerState?z.eagerState:r(d,z.action);else{var ne={lane:ee,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};M===null?(E=M=ne,_=d):M=M.next=ne,wt.lanes|=ee,Ga|=ee}z=z.next}while(z!==null&&z!==g);M===null?_=d:M.next=E,Yn(d,i.memoizedState)||(pn=!0),i.memoizedState=d,i.baseState=_,i.baseQueue=M,l.lastRenderedState=d}if(r=l.interleaved,r!==null){p=r;do g=p.lane,wt.lanes|=g,Ga|=g,p=p.next;while(p!==r)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Md(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=l.dispatch,p=l.pending,g=i.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do g=r(g,_.action),_=_.next;while(_!==p);Yn(g,i.memoizedState)||(pn=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function _g(){}function kg(r,i){var l=wt,d=Ln(),p=i(),g=!Yn(d.memoizedState,p);if(g&&(d.memoizedState=p,pn=!0),d=d.queue,Nd(Sg.bind(null,l,d,r),[r]),d.getSnapshot!==i||g||Bt!==null&&Bt.memoizedState.tag&1){if(l.flags|=2048,to(9,xg.bind(null,l,d,p,i),void 0,null),Ft===null)throw Error(n(349));(Ka&30)!==0||wg(l,i,p)}return p}function wg(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function xg(r,i,l,d){i.value=l,i.getSnapshot=d,Pg(i)&&Tg(r)}function Sg(r,i,l){return l(function(){Pg(i)&&Tg(r)})}function Pg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Yn(r,l)}catch{return!0}}function Tg(r){var i=Ir(r,1);i!==null&&er(i,r,1,-1)}function Cg(r){var i=dr();return typeof r=="function"&&(r=r()),i.memoizedState=i.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eo,lastRenderedState:r},i.queue=r,r=r.dispatch=WS.bind(null,wt,r),[i.memoizedState,r]}function to(r,i,l,d){return r={tag:r,create:i,destroy:l,deps:d,next:null},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.lastEffect=r.next=r):(l=i.lastEffect,l===null?i.lastEffect=r.next=r:(d=l.next,l.next=r,r.next=d,i.lastEffect=r)),r}function Eg(){return Ln().memoizedState}function Ul(r,i,l,d){var p=dr();wt.flags|=r,p.memoizedState=to(1|i,l,void 0,d===void 0?null:d)}function Bl(r,i,l,d){var p=Ln();d=d===void 0?null:d;var g=void 0;if(Mt!==null){var _=Mt.memoizedState;if(g=_.destroy,d!==null&&Ad(d,_.deps)){p.memoizedState=to(i,l,g,d);return}}wt.flags|=r,p.memoizedState=to(1|i,l,g,d)}function Ag(r,i){return Ul(8390656,8,r,i)}function Nd(r,i){return Bl(2048,8,r,i)}function Rg(r,i){return Bl(4,2,r,i)}function Lg(r,i){return Bl(4,4,r,i)}function Dg(r,i){if(typeof i=="function")return r=r(),i(r),function(){i(null)};if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Mg(r,i,l){return l=l!=null?l.concat([r]):null,Bl(4,4,Dg.bind(null,i,r),l)}function Od(){}function Ng(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ad(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function Og(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ad(i,d[1])?d[0]:(r=r(),l.memoizedState=[r,i],r)}function Ig(r,i,l){return(Ka&21)===0?(r.baseState&&(r.baseState=!1,pn=!0),r.memoizedState=l):(Yn(l,i)||(l=hm(),wt.lanes|=l,Ga|=l,r.baseState=!0),i)}function $S(r,i){var l=ct;ct=l!==0&&4>l?l:4,r(!0);var d=Ed.transition;Ed.transition={};try{r(!1),i()}finally{ct=l,Ed.transition=d}}function jg(){return Ln().memoizedState}function HS(r,i,l){var d=va(r);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Ug(r))Bg(i,l);else if(l=mg(r,i,l,d),l!==null){var p=sn();er(l,r,d,p),Fg(l,i,d)}}function WS(r,i,l){var d=va(r),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ug(r))Bg(i,p);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var _=i.lastRenderedState,E=g(_,l);if(p.hasEagerState=!0,p.eagerState=E,Yn(E,_)){var M=i.interleaved;M===null?(p.next=p,wd(i)):(p.next=M.next,M.next=p),i.interleaved=p;return}}catch{}l=mg(r,i,p,d),l!==null&&(p=sn(),er(l,r,d,p),Fg(l,i,d))}}function Ug(r){var i=r.alternate;return r===wt||i!==null&&i===wt}function Bg(r,i){Qs=jl=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function Fg(r,i,l){if((l&4194240)!==0){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,ju(r,l)}}var Fl={readContext:Rn,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},KS={readContext:Rn,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:Ag,useImperativeHandle:function(r,i,l){return l=l!=null?l.concat([r]):null,Ul(4194308,4,Dg.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Ul(4194308,4,r,i)},useInsertionEffect:function(r,i){return Ul(4,2,r,i)},useMemo:function(r,i){var l=dr();return i=i===void 0?null:i,r=r(),l.memoizedState=[r,i],r},useReducer:function(r,i,l){var d=dr();return i=l!==void 0?l(i):i,d.memoizedState=d.baseState=i,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:i},d.queue=r,r=r.dispatch=HS.bind(null,wt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:Cg,useDebugValue:Od,useDeferredValue:function(r){return dr().memoizedState=r},useTransition:function(){var r=Cg(!1),i=r[0];return r=$S.bind(null,r[1]),dr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,l){var d=wt,p=dr();if(bt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Ft===null)throw Error(n(349));(Ka&30)!==0||wg(d,i,l)}p.memoizedState=l;var g={value:l,getSnapshot:i};return p.queue=g,Ag(Sg.bind(null,d,g,r),[r]),d.flags|=2048,to(9,xg.bind(null,d,g,l,i),void 0,null),l},useId:function(){var r=dr(),i=Ft.identifierPrefix;if(bt){var l=Or,d=Nr;l=(d&~(1<<32-He(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=Js++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=zS++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},GS={readContext:Rn,useCallback:Ng,useContext:Rn,useEffect:Nd,useImperativeHandle:Mg,useInsertionEffect:Rg,useLayoutEffect:Lg,useMemo:Og,useReducer:Dd,useRef:Eg,useState:function(){return Dd(eo)},useDebugValue:Od,useDeferredValue:function(r){var i=Ln();return Ig(i,Mt.memoizedState,r)},useTransition:function(){var r=Dd(eo)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:_g,useSyncExternalStore:kg,useId:jg,unstable_isNewReconciler:!1},qS={readContext:Rn,useCallback:Ng,useContext:Rn,useEffect:Nd,useImperativeHandle:Mg,useInsertionEffect:Rg,useLayoutEffect:Lg,useMemo:Og,useReducer:Md,useRef:Eg,useState:function(){return Md(eo)},useDebugValue:Od,useDeferredValue:function(r){var i=Ln();return Mt===null?i.memoizedState=r:Ig(i,Mt.memoizedState,r)},useTransition:function(){var r=Md(eo)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:_g,useSyncExternalStore:kg,useId:jg,unstable_isNewReconciler:!1};function Xn(r,i){if(r&&r.defaultProps){i=$({},i),r=r.defaultProps;for(var l in r)i[l]===void 0&&(i[l]=r[l]);return i}return i}function Id(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:$({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Vl={isMounted:function(r){return(r=r._reactInternals)?he(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=sn(),p=va(r),g=jr(d,p);g.payload=i,l!=null&&(g.callback=l),i=pa(r,g,p),i!==null&&(er(i,r,p,d),Ml(i,r,p))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=sn(),p=va(r),g=jr(d,p);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=pa(r,g,p),i!==null&&(er(i,r,p,d),Ml(i,r,p))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=sn(),d=va(r),p=jr(l,d);p.tag=2,i!=null&&(p.callback=i),i=pa(r,p,d),i!==null&&(er(i,r,d,l),Ml(i,r,d))}};function Vg(r,i,l,d,p,g,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,_):i.prototype&&i.prototype.isPureReactComponent?!Vs(l,d)||!Vs(p,g):!0}function zg(r,i,l){var d=!1,p=da,g=i.contextType;return typeof g=="object"&&g!==null?g=Rn(g):(p=fn(i)?Va:qt.current,d=i.contextTypes,g=(d=d!=null)?Oi(r,p):da),i=new i(l,g),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Vl,r.stateNode=i,i._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=p,r.__reactInternalMemoizedMaskedChildContext=g),i}function $g(r,i,l,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==r&&Vl.enqueueReplaceState(i,i.state,null)}function jd(r,i,l,d){var p=r.stateNode;p.props=l,p.state=r.memoizedState,p.refs={},xd(r);var g=i.contextType;typeof g=="object"&&g!==null?p.context=Rn(g):(g=fn(i)?Va:qt.current,p.context=Oi(r,g)),p.state=r.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Id(r,i,g,l),p.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(i=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),i!==p.state&&Vl.enqueueReplaceState(p,p.state,null),Nl(r,l,p,d),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308)}function $i(r,i){try{var l="",d=i;do l+=Se(d),d=d.return;while(d);var p=l}catch(g){p=`
8
+ Error generating stack: `+g.message+`
9
+ `+g.stack}return{value:r,source:i,stack:p,digest:null}}function Ud(r,i,l){return{value:r,source:null,stack:l??null,digest:i??null}}function Bd(r,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var YS=typeof WeakMap=="function"?WeakMap:Map;function Hg(r,i,l){l=jr(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){ql||(ql=!0,eh=d),Bd(r,i)},l}function Wg(r,i,l){l=jr(-1,l),l.tag=3;var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;l.payload=function(){return d(p)},l.callback=function(){Bd(r,i)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){Bd(r,i),typeof d!="function"&&(ga===null?ga=new Set([this]):ga.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function Kg(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new YS;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(p.add(l),r=cP.bind(null,r,i,l),i.then(r,r))}function Gg(r){do{var i;if((i=r.tag===13)&&(i=r.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return r;r=r.return}while(r!==null);return null}function qg(r,i,l,d,p){return(r.mode&1)===0?(r===i?r.flags|=65536:(r.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=jr(-1,1),i.tag=2,pa(l,i,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=p,r)}var ZS=j.ReactCurrentOwner,pn=!1;function an(r,i,l,d){i.child=r===null?pg(i,null,l,d):Bi(i,r.child,l,d)}function Yg(r,i,l,d,p){l=l.render;var g=i.ref;return Vi(i,p),d=Rd(r,i,l,d,g,p),l=Ld(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(bt&&l&&fd(i),i.flags|=1,an(r,i,d,p),i.child)}function Zg(r,i,l,d,p){if(r===null){var g=l.type;return typeof g=="function"&&!oh(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=g,Xg(r,i,g,d,p)):(r=ec(l.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(g=r.child,(r.lanes&p)===0){var _=g.memoizedProps;if(l=l.compare,l=l!==null?l:Vs,l(_,d)&&r.ref===i.ref)return Ur(r,i,p)}return i.flags|=1,r=_a(g,d),r.ref=i.ref,r.return=i,i.child=r}function Xg(r,i,l,d,p){if(r!==null){var g=r.memoizedProps;if(Vs(g,d)&&r.ref===i.ref)if(pn=!1,i.pendingProps=d=g,(r.lanes&p)!==0)(r.flags&131072)!==0&&(pn=!0);else return i.lanes=r.lanes,Ur(r,i,p)}return Fd(r,i,l,d,p)}function Qg(r,i,l){var d=i.pendingProps,p=d.children,g=r!==null?r.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ft(Wi,kn),kn|=l;else{if((l&1073741824)===0)return r=g!==null?g.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:r,cachePool:null,transitions:null},i.updateQueue=null,ft(Wi,kn),kn|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=g!==null?g.baseLanes:l,ft(Wi,kn),kn|=d}else g!==null?(d=g.baseLanes|l,i.memoizedState=null):d=l,ft(Wi,kn),kn|=d;return an(r,i,p,l),i.child}function Jg(r,i){var l=i.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function Fd(r,i,l,d,p){var g=fn(l)?Va:qt.current;return g=Oi(i,g),Vi(i,p),l=Rd(r,i,l,d,g,p),d=Ld(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(bt&&d&&fd(i),i.flags|=1,an(r,i,l,p),i.child)}function ey(r,i,l,d,p){if(fn(l)){var g=!0;Pl(i)}else g=!1;if(Vi(i,p),i.stateNode===null)$l(r,i),zg(i,l,d),jd(i,l,d,p),d=!0;else if(r===null){var _=i.stateNode,E=i.memoizedProps;_.props=E;var M=_.context,z=l.contextType;typeof z=="object"&&z!==null?z=Rn(z):(z=fn(l)?Va:qt.current,z=Oi(i,z));var ee=l.getDerivedStateFromProps,ne=typeof ee=="function"||typeof _.getSnapshotBeforeUpdate=="function";ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==d||M!==z)&&$g(i,_,d,z),fa=!1;var J=i.memoizedState;_.state=J,Nl(i,d,_,p),M=i.memoizedState,E!==d||J!==M||hn.current||fa?(typeof ee=="function"&&(Id(i,l,ee,d),M=i.memoizedState),(E=fa||Vg(i,l,E,d,J,M,z))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=M),_.props=d,_.state=M,_.context=z,d=E):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,gg(r,i),E=i.memoizedProps,z=i.type===i.elementType?E:Xn(i.type,E),_.props=z,ne=i.pendingProps,J=_.context,M=l.contextType,typeof M=="object"&&M!==null?M=Rn(M):(M=fn(l)?Va:qt.current,M=Oi(i,M));var de=l.getDerivedStateFromProps;(ee=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==ne||J!==M)&&$g(i,_,d,M),fa=!1,J=i.memoizedState,_.state=J,Nl(i,d,_,p);var ve=i.memoizedState;E!==ne||J!==ve||hn.current||fa?(typeof de=="function"&&(Id(i,l,de,d),ve=i.memoizedState),(z=fa||Vg(i,l,z,d,J,ve,M)||!1)?(ee||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,ve,M),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,ve,M)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ve),_.props=d,_.state=ve,_.context=M,d=z):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return Vd(r,i,l,d,g,p)}function Vd(r,i,l,d,p,g){Jg(r,i);var _=(i.flags&128)!==0;if(!d&&!_)return p&&ig(i,l,!1),Ur(r,i,g);d=i.stateNode,ZS.current=i;var E=_&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,r!==null&&_?(i.child=Bi(i,r.child,null,g),i.child=Bi(i,null,E,g)):an(r,i,E,g),i.memoizedState=d.state,p&&ig(i,l,!0),i.child}function ty(r){var i=r.stateNode;i.pendingContext?rg(r,i.pendingContext,i.pendingContext!==i.context):i.context&&rg(r,i.context,!1),Sd(r,i.containerInfo)}function ny(r,i,l,d,p){return Ui(),yd(p),i.flags|=256,an(r,i,l,d),i.child}var zd={dehydrated:null,treeContext:null,retryLane:0};function $d(r){return{baseLanes:r,cachePool:null,transitions:null}}function ry(r,i,l){var d=i.pendingProps,p=kt.current,g=!1,_=(i.flags&128)!==0,E;if((E=_)||(E=r!==null&&r.memoizedState===null?!1:(p&2)!==0),E?(g=!0,i.flags&=-129):(r===null||r.memoizedState!==null)&&(p|=1),ft(kt,p&1),r===null)return gd(i),r=i.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((i.mode&1)===0?i.lanes=1:r.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(_=d.children,r=d.fallback,g?(d=i.mode,g=i.child,_={mode:"hidden",children:_},(d&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=_):g=tc(_,d,0,null),r=Xa(r,d,l,null),g.return=i,r.return=i,g.sibling=r,i.child=g,i.child.memoizedState=$d(l),i.memoizedState=zd,r):Hd(i,_));if(p=r.memoizedState,p!==null&&(E=p.dehydrated,E!==null))return XS(r,i,_,d,E,p,l);if(g){g=d.fallback,_=i.mode,p=r.child,E=p.sibling;var M={mode:"hidden",children:d.children};return(_&1)===0&&i.child!==p?(d=i.child,d.childLanes=0,d.pendingProps=M,i.deletions=null):(d=_a(p,M),d.subtreeFlags=p.subtreeFlags&14680064),E!==null?g=_a(E,g):(g=Xa(g,_,l,null),g.flags|=2),g.return=i,d.return=i,d.sibling=g,i.child=d,d=g,g=i.child,_=r.child.memoizedState,_=_===null?$d(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},g.memoizedState=_,g.childLanes=r.childLanes&~l,i.memoizedState=zd,d}return g=r.child,r=g.sibling,d=_a(g,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=l),d.return=i,d.sibling=null,r!==null&&(l=i.deletions,l===null?(i.deletions=[r],i.flags|=16):l.push(r)),i.child=d,i.memoizedState=null,d}function Hd(r,i){return i=tc({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function zl(r,i,l,d){return d!==null&&yd(d),Bi(i,r.child,null,l),r=Hd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function XS(r,i,l,d,p,g,_){if(l)return i.flags&256?(i.flags&=-257,d=Ud(Error(n(422))),zl(r,i,_,d)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(g=d.fallback,p=i.mode,d=tc({mode:"visible",children:d.children},p,0,null),g=Xa(g,p,_,null),g.flags|=2,d.return=i,g.return=i,d.sibling=g,i.child=d,(i.mode&1)!==0&&Bi(i,r.child,null,_),i.child.memoizedState=$d(_),i.memoizedState=zd,g);if((i.mode&1)===0)return zl(r,i,_,null);if(p.data==="$!"){if(d=p.nextSibling&&p.nextSibling.dataset,d)var E=d.dgst;return d=E,g=Error(n(419)),d=Ud(g,d,void 0),zl(r,i,_,d)}if(E=(_&r.childLanes)!==0,pn||E){if(d=Ft,d!==null){switch(_&-_){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(d.suspendedLanes|_))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,Ir(r,p),er(d,r,p,-1))}return sh(),d=Ud(Error(n(421))),zl(r,i,_,d)}return p.data==="$?"?(i.flags|=128,i.child=r.child,i=uP.bind(null,r),p._reactRetry=i,null):(r=g.treeContext,_n=ca(p.nextSibling),bn=i,bt=!0,Zn=null,r!==null&&(En[An++]=Nr,En[An++]=Or,En[An++]=za,Nr=r.id,Or=r.overflow,za=i),i=Hd(i,d.children),i.flags|=4096,i)}function ay(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),kd(r.return,i,l)}function Wd(r,i,l,d,p){var g=r.memoizedState;g===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(g.isBackwards=i,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=l,g.tailMode=p)}function iy(r,i,l){var d=i.pendingProps,p=d.revealOrder,g=d.tail;if(an(r,i,d.children,l),d=kt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ay(r,l,i);else if(r.tag===19)ay(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}if(ft(kt,d),(i.mode&1)===0)i.memoizedState=null;else switch(p){case"forwards":for(l=i.child,p=null;l!==null;)r=l.alternate,r!==null&&Ol(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Wd(i,!1,p,l,g);break;case"backwards":for(l=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Ol(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Wd(i,!0,l,null,g);break;case"together":Wd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function $l(r,i){(i.mode&1)===0&&r!==null&&(r.alternate=null,i.alternate=null,i.flags|=2)}function Ur(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Ga|=i.lanes,(l&i.childLanes)===0)return null;if(r!==null&&i.child!==r.child)throw Error(n(153));if(i.child!==null){for(r=i.child,l=_a(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=_a(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function QS(r,i,l){switch(i.tag){case 3:ty(i),Ui();break;case 5:bg(i);break;case 1:fn(i.type)&&Pl(i);break;case 4:Sd(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;ft(Ll,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(ft(kt,kt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?ry(r,i,l):(ft(kt,kt.current&1),r=Ur(r,i,l),r!==null?r.sibling:null);ft(kt,kt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(r.flags&128)!==0){if(d)return iy(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(kt,kt.current),d)break;return null;case 22:case 23:return i.lanes=0,Qg(r,i,l)}return Ur(r,i,l)}var sy,Kd,oy,ly;sy=function(r,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)r.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Kd=function(){},oy=function(r,i,l,d){var p=r.memoizedProps;if(p!==d){r=i.stateNode,Wa(ur.current);var g=null;switch(l){case"input":p=en(r,p),d=en(r,d),g=[];break;case"select":p=$({},p,{value:void 0}),d=$({},d,{value:void 0}),g=[];break;case"textarea":p=Ss(r,p),d=Ss(r,d),g=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=wl)}bi(l,d);var _;l=null;for(z in p)if(!d.hasOwnProperty(z)&&p.hasOwnProperty(z)&&p[z]!=null)if(z==="style"){var E=p[z];for(_ in E)E.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(s.hasOwnProperty(z)?g||(g=[]):(g=g||[]).push(z,null));for(z in d){var M=d[z];if(E=p?.[z],d.hasOwnProperty(z)&&M!==E&&(M!=null||E!=null))if(z==="style")if(E){for(_ in E)!E.hasOwnProperty(_)||M&&M.hasOwnProperty(_)||(l||(l={}),l[_]="");for(_ in M)M.hasOwnProperty(_)&&E[_]!==M[_]&&(l||(l={}),l[_]=M[_])}else l||(g||(g=[]),g.push(z,l)),l=M;else z==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,E=E?E.__html:void 0,M!=null&&E!==M&&(g=g||[]).push(z,M)):z==="children"?typeof M!="string"&&typeof M!="number"||(g=g||[]).push(z,""+M):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(s.hasOwnProperty(z)?(M!=null&&z==="onScroll"&&mt("scroll",r),g||E===M||(g=[])):(g=g||[]).push(z,M))}l&&(g=g||[]).push("style",l);var z=g;(i.updateQueue=z)&&(i.flags|=4)}},ly=function(r,i,l,d){l!==d&&(i.flags|=4)};function no(r,i){if(!bt)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Zt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,d=0;if(i)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&14680064,d|=p.flags&14680064,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=l,i}function JS(r,i,l){var d=i.pendingProps;switch(pd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(i),null;case 1:return fn(i.type)&&Sl(),Zt(i),null;case 3:return d=i.stateNode,zi(),gt(hn),gt(qt),Cd(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Al(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zn!==null&&(rh(Zn),Zn=null))),Kd(r,i),Zt(i),null;case 5:Pd(i);var p=Wa(Xs.current);if(l=i.type,r!==null&&i.stateNode!=null)oy(r,i,l,d,p),r.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(n(166));return Zt(i),null}if(r=Wa(ur.current),Al(i)){d=i.stateNode,l=i.type;var g=i.memoizedProps;switch(d[cr]=i,d[Ks]=g,r=(i.mode&1)!==0,l){case"dialog":mt("cancel",d),mt("close",d);break;case"iframe":case"object":case"embed":mt("load",d);break;case"video":case"audio":for(p=0;p<$s.length;p++)mt($s[p],d);break;case"source":mt("error",d);break;case"img":case"image":case"link":mt("error",d),mt("load",d);break;case"details":mt("toggle",d);break;case"input":ws(d,g),mt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!g.multiple},mt("invalid",d);break;case"textarea":rl(d,g),mt("invalid",d)}bi(l,g),p=null;for(var _ in g)if(g.hasOwnProperty(_)){var E=g[_];_==="children"?typeof E=="string"?d.textContent!==E&&(g.suppressHydrationWarning!==!0&&kl(d.textContent,E,r),p=["children",E]):typeof E=="number"&&d.textContent!==""+E&&(g.suppressHydrationWarning!==!0&&kl(d.textContent,E,r),p=["children",""+E]):s.hasOwnProperty(_)&&E!=null&&_==="onScroll"&&mt("scroll",d)}switch(l){case"input":Hn(d),nl(d,g,!0);break;case"textarea":Hn(d),lr(d);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(d.onclick=wl)}d=p,i.updateQueue=d,d!==null&&(i.flags|=4)}else{_=p.nodeType===9?p:p.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Yr(l)),r==="http://www.w3.org/1999/xhtml"?l==="script"?(r=_.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=_.createElement(l,{is:d.is}):(r=_.createElement(l),l==="select"&&(_=r,d.multiple?_.multiple=!0:d.size&&(_.size=d.size))):r=_.createElementNS(r,l),r[cr]=i,r[Ks]=d,sy(r,i,!1,!1),i.stateNode=r;e:{switch(_=_i(l,d),l){case"dialog":mt("cancel",r),mt("close",r),p=d;break;case"iframe":case"object":case"embed":mt("load",r),p=d;break;case"video":case"audio":for(p=0;p<$s.length;p++)mt($s[p],r);p=d;break;case"source":mt("error",r),p=d;break;case"img":case"image":case"link":mt("error",r),mt("load",r),p=d;break;case"details":mt("toggle",r),p=d;break;case"input":ws(r,d),p=en(r,d),mt("invalid",r);break;case"option":p=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},p=$({},d,{value:void 0}),mt("invalid",r);break;case"textarea":rl(r,d),p=Ss(r,d),mt("invalid",r);break;default:p=d}bi(l,p),E=p;for(g in E)if(E.hasOwnProperty(g)){var M=E[g];g==="style"?il(r,M):g==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Tn(r,M)):g==="children"?typeof M=="string"?(l!=="textarea"||M!=="")&&tn(r,M):typeof M=="number"&&tn(r,""+M):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(s.hasOwnProperty(g)?M!=null&&g==="onScroll"&&mt("scroll",r):M!=null&&L(r,g,M,_))}switch(l){case"input":Hn(r),nl(r,d,!1);break;case"textarea":Hn(r),lr(r);break;case"option":d.value!=null&&r.setAttribute("value",""+Qe(d.value));break;case"select":r.multiple=!!d.multiple,g=d.value,g!=null?qr(r,!!d.multiple,g,!1):d.defaultValue!=null&&qr(r,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(r.onclick=wl)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Zt(i),null;case 6:if(r&&i.stateNode!=null)ly(r,i,r.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(l=Wa(Xs.current),Wa(ur.current),Al(i)){if(d=i.stateNode,l=i.memoizedProps,d[cr]=i,(g=d.nodeValue!==l)&&(r=bn,r!==null))switch(r.tag){case 3:kl(d.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&kl(d.nodeValue,l,(r.mode&1)!==0)}g&&(i.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[cr]=i,i.stateNode=d}return Zt(i),null;case 13:if(gt(kt),d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(bt&&_n!==null&&(i.mode&1)!==0&&(i.flags&128)===0)dg(),Ui(),i.flags|=98560,g=!1;else if(g=Al(i),d!==null&&d.dehydrated!==null){if(r===null){if(!g)throw Error(n(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(n(317));g[cr]=i}else Ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),g=!1}else Zn!==null&&(rh(Zn),Zn=null),g=!0;if(!g)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(d=d!==null,d!==(r!==null&&r.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(r===null||(kt.current&1)!==0?Nt===0&&(Nt=3):sh())),i.updateQueue!==null&&(i.flags|=4),Zt(i),null);case 4:return zi(),Kd(r,i),r===null&&Hs(i.stateNode.containerInfo),Zt(i),null;case 10:return _d(i.type._context),Zt(i),null;case 17:return fn(i.type)&&Sl(),Zt(i),null;case 19:if(gt(kt),g=i.memoizedState,g===null)return Zt(i),null;if(d=(i.flags&128)!==0,_=g.rendering,_===null)if(d)no(g,!1);else{if(Nt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(_=Ol(r),_!==null){for(i.flags|=128,no(g,!1),d=_.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=l,l=i.child;l!==null;)g=l,r=d,g.flags&=14680066,_=g.alternate,_===null?(g.childLanes=0,g.lanes=r,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=_.childLanes,g.lanes=_.lanes,g.child=_.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=_.memoizedProps,g.memoizedState=_.memoizedState,g.updateQueue=_.updateQueue,g.type=_.type,r=_.dependencies,g.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l=l.sibling;return ft(kt,kt.current&1|2),i.child}r=r.sibling}g.tail!==null&&rt()>Ki&&(i.flags|=128,d=!0,no(g,!1),i.lanes=4194304)}else{if(!d)if(r=Ol(_),r!==null){if(i.flags|=128,d=!0,l=r.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),no(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!bt)return Zt(i),null}else 2*rt()-g.renderingStartTime>Ki&&l!==1073741824&&(i.flags|=128,d=!0,no(g,!1),i.lanes=4194304);g.isBackwards?(_.sibling=i.child,i.child=_):(l=g.last,l!==null?l.sibling=_:i.child=_,g.last=_)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=rt(),i.sibling=null,l=kt.current,ft(kt,d?l&1|2:l&1),i):(Zt(i),null);case 22:case 23:return ih(),d=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(kn&1073741824)!==0&&(Zt(i),i.subtreeFlags&6&&(i.flags|=8192)):Zt(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function eP(r,i){switch(pd(i),i.tag){case 1:return fn(i.type)&&Sl(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return zi(),gt(hn),gt(qt),Cd(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return Pd(i),null;case 13:if(gt(kt),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Ui()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return gt(kt),null;case 4:return zi(),null;case 10:return _d(i.type._context),null;case 22:case 23:return ih(),null;case 24:return null;default:return null}}var Hl=!1,Xt=!1,tP=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Hi(r,i){var l=r.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){xt(r,i,d)}else l.current=null}function Gd(r,i,l){try{l()}catch(d){xt(r,i,d)}}var cy=!1;function nP(r,i){if(id=ul,r=Vm(),Xu(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var _=0,E=-1,M=-1,z=0,ee=0,ne=r,J=null;t:for(;;){for(var de;ne!==l||p!==0&&ne.nodeType!==3||(E=_+p),ne!==g||d!==0&&ne.nodeType!==3||(M=_+d),ne.nodeType===3&&(_+=ne.nodeValue.length),(de=ne.firstChild)!==null;)J=ne,ne=de;for(;;){if(ne===r)break t;if(J===l&&++z===p&&(E=_),J===g&&++ee===d&&(M=_),(de=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=de}l=E===-1||M===-1?null:{start:E,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(sd={focusedElem:r,selectionRange:l},ul=!1,ge=i;ge!==null;)if(i=ge,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,ge=r;else for(;ge!==null;){i=ge;try{var ve=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Tt=ve.memoizedState,B=i.stateNode,O=B.getSnapshotBeforeUpdate(i.elementType===i.type?we:Xn(i.type,we),Tt);B.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var F=i.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(se){xt(i,i.return,se)}if(r=i.sibling,r!==null){r.return=i.return,ge=r;break}ge=i.return}return ve=cy,cy=!1,ve}function ro(r,i,l){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&r)===r){var g=p.destroy;p.destroy=void 0,g!==void 0&&Gd(i,l,g)}p=p.next}while(p!==d)}}function Wl(r,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&r)===r){var d=l.create;l.destroy=d()}l=l.next}while(l!==i)}}function qd(r){var i=r.ref;if(i!==null){var l=r.stateNode;r.tag,r=l,typeof i=="function"?i(r):i.current=r}}function uy(r){var i=r.alternate;i!==null&&(r.alternate=null,uy(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[cr],delete i[Ks],delete i[ud],delete i[US],delete i[BS])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function dy(r){return r.tag===5||r.tag===3||r.tag===4}function hy(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||dy(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Yd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(r,i):l.insertBefore(r,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(r,l)):(i=l,i.appendChild(r)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=wl));else if(d!==4&&(r=r.child,r!==null))for(Yd(r,i,l),r=r.sibling;r!==null;)Yd(r,i,l),r=r.sibling}function Zd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(Zd(r,i,l),r=r.sibling;r!==null;)Zd(r,i,l),r=r.sibling}var Ht=null,Qn=!1;function ma(r,i,l){for(l=l.child;l!==null;)fy(r,i,l),l=l.sibling}function fy(r,i,l){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Cn,l)}catch{}switch(l.tag){case 5:Xt||Hi(l,i);case 6:var d=Ht,p=Qn;Ht=null,ma(r,i,l),Ht=d,Qn=p,Ht!==null&&(Qn?(r=Ht,l=l.stateNode,r.nodeType===8?r.parentNode.removeChild(l):r.removeChild(l)):Ht.removeChild(l.stateNode));break;case 18:Ht!==null&&(Qn?(r=Ht,l=l.stateNode,r.nodeType===8?cd(r.parentNode,l):r.nodeType===1&&cd(r,l),Os(r)):cd(Ht,l.stateNode));break;case 4:d=Ht,p=Qn,Ht=l.stateNode.containerInfo,Qn=!0,ma(r,i,l),Ht=d,Qn=p;break;case 0:case 11:case 14:case 15:if(!Xt&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var g=p,_=g.destroy;g=g.tag,_!==void 0&&((g&2)!==0||(g&4)!==0)&&Gd(l,i,_),p=p.next}while(p!==d)}ma(r,i,l);break;case 1:if(!Xt&&(Hi(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(E){xt(l,i,E)}ma(r,i,l);break;case 21:ma(r,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ma(r,i,l),Xt=d):ma(r,i,l);break;default:ma(r,i,l)}}function py(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new tP),i.forEach(function(d){var p=dP.bind(null,r,d);l.has(d)||(l.add(d),d.then(p,p))})}}function Jn(r,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];try{var g=r,_=i,E=_;e:for(;E!==null;){switch(E.tag){case 5:Ht=E.stateNode,Qn=!1;break e;case 3:Ht=E.stateNode.containerInfo,Qn=!0;break e;case 4:Ht=E.stateNode.containerInfo,Qn=!0;break e}E=E.return}if(Ht===null)throw Error(n(160));fy(g,_,p),Ht=null,Qn=!1;var M=p.alternate;M!==null&&(M.return=null),p.return=null}catch(z){xt(p,i,z)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)my(i,r),i=i.sibling}function my(r,i){var l=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Jn(i,r),hr(r),d&4){try{ro(3,r,r.return),Wl(3,r)}catch(we){xt(r,r.return,we)}try{ro(5,r,r.return)}catch(we){xt(r,r.return,we)}}break;case 1:Jn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return);break;case 5:if(Jn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return),r.flags&32){var p=r.stateNode;try{tn(p,"")}catch(we){xt(r,r.return,we)}}if(d&4&&(p=r.stateNode,p!=null)){var g=r.memoizedProps,_=l!==null?l.memoizedProps:g,E=r.type,M=r.updateQueue;if(r.updateQueue=null,M!==null)try{E==="input"&&g.type==="radio"&&g.name!=null&&tl(p,g),_i(E,_);var z=_i(E,g);for(_=0;_<M.length;_+=2){var ee=M[_],ne=M[_+1];ee==="style"?il(p,ne):ee==="dangerouslySetInnerHTML"?Tn(p,ne):ee==="children"?tn(p,ne):L(p,ee,ne,z)}switch(E){case"input":Wn(p,g);break;case"textarea":al(p,g);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var de=g.value;de!=null?qr(p,!!g.multiple,de,!1):J!==!!g.multiple&&(g.defaultValue!=null?qr(p,!!g.multiple,g.defaultValue,!0):qr(p,!!g.multiple,g.multiple?[]:"",!1))}p[Ks]=g}catch(we){xt(r,r.return,we)}}break;case 6:if(Jn(i,r),hr(r),d&4){if(r.stateNode===null)throw Error(n(162));p=r.stateNode,g=r.memoizedProps;try{p.nodeValue=g}catch(we){xt(r,r.return,we)}}break;case 3:if(Jn(i,r),hr(r),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Os(i.containerInfo)}catch(we){xt(r,r.return,we)}break;case 4:Jn(i,r),hr(r);break;case 13:Jn(i,r),hr(r),p=r.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(Jd=rt())),d&4&&py(r);break;case 22:if(ee=l!==null&&l.memoizedState!==null,r.mode&1?(Xt=(z=Xt)||ee,Jn(i,r),Xt=z):Jn(i,r),hr(r),d&8192){if(z=r.memoizedState!==null,(r.stateNode.isHidden=z)&&!ee&&(r.mode&1)!==0)for(ge=r,ee=r.child;ee!==null;){for(ne=ge=ee;ge!==null;){switch(J=ge,de=J.child,J.tag){case 0:case 11:case 14:case 15:ro(4,J,J.return);break;case 1:Hi(J,J.return);var ve=J.stateNode;if(typeof ve.componentWillUnmount=="function"){d=J,l=J.return;try{i=d,ve.props=i.memoizedProps,ve.state=i.memoizedState,ve.componentWillUnmount()}catch(we){xt(d,l,we)}}break;case 5:Hi(J,J.return);break;case 22:if(J.memoizedState!==null){vy(ne);continue}}de!==null?(de.return=J,ge=de):vy(ne)}ee=ee.sibling}e:for(ee=null,ne=r;;){if(ne.tag===5){if(ee===null){ee=ne;try{p=ne.stateNode,z?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(E=ne.stateNode,M=ne.memoizedProps.style,_=M!=null&&M.hasOwnProperty("display")?M.display:null,E.style.display=vi("display",_))}catch(we){xt(r,r.return,we)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=z?"":ne.memoizedProps}catch(we){xt(r,r.return,we)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===r)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===r)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===r)break e;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:Jn(i,r),hr(r),d&4&&py(r);break;case 21:break;default:Jn(i,r),hr(r)}}function hr(r){var i=r.flags;if(i&2){try{e:{for(var l=r.return;l!==null;){if(dy(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var p=d.stateNode;d.flags&32&&(tn(p,""),d.flags&=-33);var g=hy(r);Zd(r,g,p);break;case 3:case 4:var _=d.stateNode.containerInfo,E=hy(r);Yd(r,E,_);break;default:throw Error(n(161))}}catch(M){xt(r,r.return,M)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function rP(r,i,l){ge=r,gy(r)}function gy(r,i,l){for(var d=(r.mode&1)!==0;ge!==null;){var p=ge,g=p.child;if(p.tag===22&&d){var _=p.memoizedState!==null||Hl;if(!_){var E=p.alternate,M=E!==null&&E.memoizedState!==null||Xt;E=Hl;var z=Xt;if(Hl=_,(Xt=M)&&!z)for(ge=p;ge!==null;)_=ge,M=_.child,_.tag===22&&_.memoizedState!==null?by(p):M!==null?(M.return=_,ge=M):by(p);for(;g!==null;)ge=g,gy(g),g=g.sibling;ge=p,Hl=E,Xt=z}yy(r)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,ge=g):yy(r)}}function yy(r){for(;ge!==null;){var i=ge;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Xt||Wl(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!Xt)if(l===null)d.componentDidMount();else{var p=i.elementType===i.type?l.memoizedProps:Xn(i.type,l.memoizedProps);d.componentDidUpdate(p,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var g=i.updateQueue;g!==null&&vg(i,g,d);break;case 3:var _=i.updateQueue;if(_!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}vg(i,_,l)}break;case 5:var E=i.stateNode;if(l===null&&i.flags&4){l=E;var M=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&l.focus();break;case"img":M.src&&(l.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var z=i.alternate;if(z!==null){var ee=z.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Os(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xt||i.flags&512&&qd(i)}catch(J){xt(i,i.return,J)}}if(i===r){ge=null;break}if(l=i.sibling,l!==null){l.return=i.return,ge=l;break}ge=i.return}}function vy(r){for(;ge!==null;){var i=ge;if(i===r){ge=null;break}var l=i.sibling;if(l!==null){l.return=i.return,ge=l;break}ge=i.return}}function by(r){for(;ge!==null;){var i=ge;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{Wl(4,i)}catch(M){xt(i,l,M)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var p=i.return;try{d.componentDidMount()}catch(M){xt(i,p,M)}}var g=i.return;try{qd(i)}catch(M){xt(i,g,M)}break;case 5:var _=i.return;try{qd(i)}catch(M){xt(i,_,M)}}}catch(M){xt(i,i.return,M)}if(i===r){ge=null;break}var E=i.sibling;if(E!==null){E.return=i.return,ge=E;break}ge=i.return}}var aP=Math.ceil,Kl=j.ReactCurrentDispatcher,Xd=j.ReactCurrentOwner,Dn=j.ReactCurrentBatchConfig,at=0,Ft=null,At=null,Wt=0,kn=0,Wi=ua(0),Nt=0,ao=null,Ga=0,Gl=0,Qd=0,io=null,mn=null,Jd=0,Ki=1/0,Br=null,ql=!1,eh=null,ga=null,Yl=!1,ya=null,Zl=0,so=0,th=null,Xl=-1,Ql=0;function sn(){return(at&6)!==0?rt():Xl!==-1?Xl:Xl=rt()}function va(r){return(r.mode&1)===0?1:(at&2)!==0&&Wt!==0?Wt&-Wt:VS.transition!==null?(Ql===0&&(Ql=hm()),Ql):(r=ct,r!==0||(r=window.event,r=r===void 0?16:km(r.type)),r)}function er(r,i,l,d){if(50<so)throw so=0,th=null,Error(n(185));Rs(r,l,d),((at&2)===0||r!==Ft)&&(r===Ft&&((at&2)===0&&(Gl|=l),Nt===4&&ba(r,Wt)),gn(r,d),l===1&&at===0&&(i.mode&1)===0&&(Ki=rt()+500,Tl&&ha()))}function gn(r,i){var l=r.callbackNode;Vx(r,i);var d=Pi(r,r===Ft?Wt:0);if(d===0)l!==null&&Pt(l),r.callbackNode=null,r.callbackPriority=0;else if(i=d&-d,r.callbackPriority!==i){if(l!=null&&Pt(l),i===1)r.tag===0?FS(ky.bind(null,r)):sg(ky.bind(null,r)),IS(function(){(at&6)===0&&ha()}),l=null;else{switch(fm(d)){case 1:l=Ar;break;case 4:l=qn;break;case 16:l=nn;break;case 536870912:l=ea;break;default:l=nn}l=Ay(l,_y.bind(null,r))}r.callbackPriority=i,r.callbackNode=l}}function _y(r,i){if(Xl=-1,Ql=0,(at&6)!==0)throw Error(n(327));var l=r.callbackNode;if(Gi()&&r.callbackNode!==l)return null;var d=Pi(r,r===Ft?Wt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||i)i=Jl(r,d);else{i=d;var p=at;at|=2;var g=xy();(Ft!==r||Wt!==i)&&(Br=null,Ki=rt()+500,Ya(r,i));do try{oP();break}catch(E){wy(r,E)}while(!0);bd(),Kl.current=g,at=p,At!==null?i=0:(Ft=null,Wt=0,i=Nt)}if(i!==0){if(i===2&&(p=Ou(r),p!==0&&(d=p,i=nh(r,p))),i===1)throw l=ao,Ya(r,0),ba(r,d),gn(r,rt()),l;if(i===6)ba(r,d);else{if(p=r.current.alternate,(d&30)===0&&!iP(p)&&(i=Jl(r,d),i===2&&(g=Ou(r),g!==0&&(d=g,i=nh(r,g))),i===1))throw l=ao,Ya(r,0),ba(r,d),gn(r,rt()),l;switch(r.finishedWork=p,r.finishedLanes=d,i){case 0:case 1:throw Error(n(345));case 2:Za(r,mn,Br);break;case 3:if(ba(r,d),(d&130023424)===d&&(i=Jd+500-rt(),10<i)){if(Pi(r,0)!==0)break;if(p=r.suspendedLanes,(p&d)!==d){sn(),r.pingedLanes|=r.suspendedLanes&p;break}r.timeoutHandle=ld(Za.bind(null,r,mn,Br),i);break}Za(r,mn,Br);break;case 4:if(ba(r,d),(d&4194240)===d)break;for(i=r.eventTimes,p=-1;0<d;){var _=31-He(d);g=1<<_,_=i[_],_>p&&(p=_),d&=~g}if(d=p,d=rt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*aP(d/1960))-d,10<d){r.timeoutHandle=ld(Za.bind(null,r,mn,Br),d);break}Za(r,mn,Br);break;case 5:Za(r,mn,Br);break;default:throw Error(n(329))}}}return gn(r,rt()),r.callbackNode===l?_y.bind(null,r):null}function nh(r,i){var l=io;return r.current.memoizedState.isDehydrated&&(Ya(r,i).flags|=256),r=Jl(r,i),r!==2&&(i=mn,mn=l,i!==null&&rh(i)),r}function rh(r){mn===null?mn=r:mn.push.apply(mn,r)}function iP(r){for(var i=r;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var p=l[d],g=p.getSnapshot;p=p.value;try{if(!Yn(g(),p))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ba(r,i){for(i&=~Qd,i&=~Gl,r.suspendedLanes|=i,r.pingedLanes&=~i,r=r.expirationTimes;0<i;){var l=31-He(i),d=1<<l;r[l]=-1,i&=~d}}function ky(r){if((at&6)!==0)throw Error(n(327));Gi();var i=Pi(r,0);if((i&1)===0)return gn(r,rt()),null;var l=Jl(r,i);if(r.tag!==0&&l===2){var d=Ou(r);d!==0&&(i=d,l=nh(r,d))}if(l===1)throw l=ao,Ya(r,0),ba(r,i),gn(r,rt()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Za(r,mn,Br),gn(r,rt()),null}function ah(r,i){var l=at;at|=1;try{return r(i)}finally{at=l,at===0&&(Ki=rt()+500,Tl&&ha())}}function qa(r){ya!==null&&ya.tag===0&&(at&6)===0&&Gi();var i=at;at|=1;var l=Dn.transition,d=ct;try{if(Dn.transition=null,ct=1,r)return r()}finally{ct=d,Dn.transition=l,at=i,(at&6)===0&&ha()}}function ih(){kn=Wi.current,gt(Wi)}function Ya(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,OS(l)),At!==null)for(l=At.return;l!==null;){var d=l;switch(pd(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Sl();break;case 3:zi(),gt(hn),gt(qt),Cd();break;case 5:Pd(d);break;case 4:zi();break;case 13:gt(kt);break;case 19:gt(kt);break;case 10:_d(d.type._context);break;case 22:case 23:ih()}l=l.return}if(Ft=r,At=r=_a(r.current,null),Wt=kn=i,Nt=0,ao=null,Qd=Gl=Ga=0,mn=io=null,Ha!==null){for(i=0;i<Ha.length;i++)if(l=Ha[i],d=l.interleaved,d!==null){l.interleaved=null;var p=d.next,g=l.pending;if(g!==null){var _=g.next;g.next=p,d.next=_}l.pending=d}Ha=null}return r}function wy(r,i){do{var l=At;try{if(bd(),Il.current=Fl,jl){for(var d=wt.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}jl=!1}if(Ka=0,Bt=Mt=wt=null,Qs=!1,Js=0,Xd.current=null,l===null||l.return===null){Nt=1,ao=i,At=null;break}e:{var g=r,_=l.return,E=l,M=i;if(i=Wt,E.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var z=M,ee=E,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var de=Gg(_);if(de!==null){de.flags&=-257,qg(de,_,E,g,i),de.mode&1&&Kg(g,z,i),i=de,M=z;var ve=i.updateQueue;if(ve===null){var we=new Set;we.add(M),i.updateQueue=we}else ve.add(M);break e}else{if((i&1)===0){Kg(g,z,i),sh();break e}M=Error(n(426))}}else if(bt&&E.mode&1){var Tt=Gg(_);if(Tt!==null){(Tt.flags&65536)===0&&(Tt.flags|=256),qg(Tt,_,E,g,i),yd($i(M,E));break e}}g=M=$i(M,E),Nt!==4&&(Nt=2),io===null?io=[g]:io.push(g),g=_;do{switch(g.tag){case 3:g.flags|=65536,i&=-i,g.lanes|=i;var B=Hg(g,M,i);yg(g,B);break e;case 1:E=M;var O=g.type,F=g.stateNode;if((g.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ga===null||!ga.has(F)))){g.flags|=65536,i&=-i,g.lanes|=i;var se=Wg(g,E,i);yg(g,se);break e}}g=g.return}while(g!==null)}Py(l)}catch(Pe){i=Pe,At===l&&l!==null&&(At=l=l.return);continue}break}while(!0)}function xy(){var r=Kl.current;return Kl.current=Fl,r===null?Fl:r}function sh(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),Ft===null||(Ga&268435455)===0&&(Gl&268435455)===0||ba(Ft,Wt)}function Jl(r,i){var l=at;at|=2;var d=xy();(Ft!==r||Wt!==i)&&(Br=null,Ya(r,i));do try{sP();break}catch(p){wy(r,p)}while(!0);if(bd(),at=l,Kl.current=d,At!==null)throw Error(n(261));return Ft=null,Wt=0,Nt}function sP(){for(;At!==null;)Sy(At)}function oP(){for(;At!==null&&!$t();)Sy(At)}function Sy(r){var i=Ey(r.alternate,r,kn);r.memoizedProps=r.pendingProps,i===null?Py(r):At=i,Xd.current=null}function Py(r){var i=r;do{var l=i.alternate;if(r=i.return,(i.flags&32768)===0){if(l=JS(l,i,kn),l!==null){At=l;return}}else{if(l=eP(l,i),l!==null){l.flags&=32767,At=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Nt=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=r}while(i!==null);Nt===0&&(Nt=5)}function Za(r,i,l){var d=ct,p=Dn.transition;try{Dn.transition=null,ct=1,lP(r,i,l,d)}finally{Dn.transition=p,ct=d}return null}function lP(r,i,l,d){do Gi();while(ya!==null);if((at&6)!==0)throw Error(n(327));l=r.finishedWork;var p=r.finishedLanes;if(l===null)return null;if(r.finishedWork=null,r.finishedLanes=0,l===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var g=l.lanes|l.childLanes;if(zx(r,g),r===Ft&&(At=Ft=null,Wt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Yl||(Yl=!0,Ay(nn,function(){return Gi(),null})),g=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||g){g=Dn.transition,Dn.transition=null;var _=ct;ct=1;var E=at;at|=4,Xd.current=null,nP(r,l),my(l,r),ES(sd),ul=!!id,sd=id=null,r.current=l,rP(l),lt(),at=E,ct=_,Dn.transition=g}else r.current=l;if(Yl&&(Yl=!1,ya=r,Zl=p),g=r.pendingLanes,g===0&&(ga=null),Si(l.stateNode),gn(r,rt()),i!==null)for(d=r.onRecoverableError,l=0;l<i.length;l++)p=i[l],d(p.value,{componentStack:p.stack,digest:p.digest});if(ql)throw ql=!1,r=eh,eh=null,r;return(Zl&1)!==0&&r.tag!==0&&Gi(),g=r.pendingLanes,(g&1)!==0?r===th?so++:(so=0,th=r):so=0,ha(),null}function Gi(){if(ya!==null){var r=fm(Zl),i=Dn.transition,l=ct;try{if(Dn.transition=null,ct=16>r?16:r,ya===null)var d=!1;else{if(r=ya,ya=null,Zl=0,(at&6)!==0)throw Error(n(331));var p=at;for(at|=4,ge=r.current;ge!==null;){var g=ge,_=g.child;if((ge.flags&16)!==0){var E=g.deletions;if(E!==null){for(var M=0;M<E.length;M++){var z=E[M];for(ge=z;ge!==null;){var ee=ge;switch(ee.tag){case 0:case 11:case 15:ro(8,ee,g)}var ne=ee.child;if(ne!==null)ne.return=ee,ge=ne;else for(;ge!==null;){ee=ge;var J=ee.sibling,de=ee.return;if(uy(ee),ee===z){ge=null;break}if(J!==null){J.return=de,ge=J;break}ge=de}}}var ve=g.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Tt=we.sibling;we.sibling=null,we=Tt}while(we!==null)}}ge=g}}if((g.subtreeFlags&2064)!==0&&_!==null)_.return=g,ge=_;else e:for(;ge!==null;){if(g=ge,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:ro(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,ge=B;break e}ge=g.return}}var O=r.current;for(ge=O;ge!==null;){_=ge;var F=_.child;if((_.subtreeFlags&2064)!==0&&F!==null)F.return=_,ge=F;else e:for(_=O;ge!==null;){if(E=ge,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Wl(9,E)}}catch(Pe){xt(E,E.return,Pe)}if(E===_){ge=null;break e}var se=E.sibling;if(se!==null){se.return=E.return,ge=se;break e}ge=E.return}}if(at=p,ha(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Cn,r)}catch{}d=!0}return d}finally{ct=l,Dn.transition=i}}return!1}function Ty(r,i,l){i=$i(l,i),i=Hg(r,i,1),r=pa(r,i,1),i=sn(),r!==null&&(Rs(r,1,i),gn(r,i))}function xt(r,i,l){if(r.tag===3)Ty(r,r,l);else for(;i!==null;){if(i.tag===3){Ty(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ga===null||!ga.has(d))){r=$i(l,r),r=Wg(i,r,1),i=pa(i,r,1),r=sn(),i!==null&&(Rs(i,1,r),gn(i,r));break}}i=i.return}}function cP(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),i=sn(),r.pingedLanes|=r.suspendedLanes&l,Ft===r&&(Wt&l)===l&&(Nt===4||Nt===3&&(Wt&130023424)===Wt&&500>rt()-Jd?Ya(r,0):Qd|=l),gn(r,i)}function Cy(r,i){i===0&&((r.mode&1)===0?i=1:(i=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var l=sn();r=Ir(r,i),r!==null&&(Rs(r,i,l),gn(r,l))}function uP(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Cy(r,l)}function dP(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(i),Cy(r,l)}var Ey;Ey=function(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps||hn.current)pn=!0;else{if((r.lanes&l)===0&&(i.flags&128)===0)return pn=!1,QS(r,i,l);pn=(r.flags&131072)!==0}else pn=!1,bt&&(i.flags&1048576)!==0&&og(i,El,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;$l(r,i),r=i.pendingProps;var p=Oi(i,qt.current);Vi(i,l),p=Rd(null,i,d,r,p,l);var g=Ld();return i.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,fn(d)?(g=!0,Pl(i)):g=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,xd(i),p.updater=Vl,i.stateNode=p,p._reactInternals=i,jd(i,d,r,l),i=Vd(null,i,d,!0,g,l)):(i.tag=0,bt&&g&&fd(i),an(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch($l(r,i),r=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=fP(d),r=Xn(d,r),p){case 0:i=Fd(null,i,d,r,l);break e;case 1:i=ey(null,i,d,r,l);break e;case 11:i=Yg(null,i,d,r,l);break e;case 14:i=Zg(null,i,d,Xn(d.type,r),l);break e}throw Error(n(306,d,""))}return i;case 0:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Fd(r,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),ey(r,i,d,p,l);case 3:e:{if(ty(i),r===null)throw Error(n(387));d=i.pendingProps,g=i.memoizedState,p=g.element,gg(r,i),Nl(i,d,null,l);var _=i.memoizedState;if(d=_.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){p=$i(Error(n(423)),i),i=ny(r,i,d,l,p);break e}else if(d!==p){p=$i(Error(n(424)),i),i=ny(r,i,d,l,p);break e}else for(_n=ca(i.stateNode.containerInfo.firstChild),bn=i,bt=!0,Zn=null,l=pg(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ui(),d===p){i=Ur(r,i,l);break e}an(r,i,d,l)}i=i.child}return i;case 5:return bg(i),r===null&&gd(i),d=i.type,p=i.pendingProps,g=r!==null?r.memoizedProps:null,_=p.children,od(d,p)?_=null:g!==null&&od(d,g)&&(i.flags|=32),Jg(r,i),an(r,i,_,l),i.child;case 6:return r===null&&gd(i),null;case 13:return ry(r,i,l);case 4:return Sd(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Bi(i,null,d,l):an(r,i,d,l),i.child;case 11:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Yg(r,i,d,p,l);case 7:return an(r,i,i.pendingProps,l),i.child;case 8:return an(r,i,i.pendingProps.children,l),i.child;case 12:return an(r,i,i.pendingProps.children,l),i.child;case 10:e:{if(d=i.type._context,p=i.pendingProps,g=i.memoizedProps,_=p.value,ft(Ll,d._currentValue),d._currentValue=_,g!==null)if(Yn(g.value,_)){if(g.children===p.children&&!hn.current){i=Ur(r,i,l);break e}}else for(g=i.child,g!==null&&(g.return=i);g!==null;){var E=g.dependencies;if(E!==null){_=g.child;for(var M=E.firstContext;M!==null;){if(M.context===d){if(g.tag===1){M=jr(-1,l&-l),M.tag=2;var z=g.updateQueue;if(z!==null){z=z.shared;var ee=z.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),z.pending=M}}g.lanes|=l,M=g.alternate,M!==null&&(M.lanes|=l),kd(g.return,l,i),E.lanes|=l;break}M=M.next}}else if(g.tag===10)_=g.type===i.type?null:g.child;else if(g.tag===18){if(_=g.return,_===null)throw Error(n(341));_.lanes|=l,E=_.alternate,E!==null&&(E.lanes|=l),kd(_,l,i),_=g.sibling}else _=g.child;if(_!==null)_.return=g;else for(_=g;_!==null;){if(_===i){_=null;break}if(g=_.sibling,g!==null){g.return=_.return,_=g;break}_=_.return}g=_}an(r,i,p.children,l),i=i.child}return i;case 9:return p=i.type,d=i.pendingProps.children,Vi(i,l),p=Rn(p),d=d(p),i.flags|=1,an(r,i,d,l),i.child;case 14:return d=i.type,p=Xn(d,i.pendingProps),p=Xn(d.type,p),Zg(r,i,d,p,l);case 15:return Xg(r,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),$l(r,i),i.tag=1,fn(d)?(r=!0,Pl(i)):r=!1,Vi(i,l),zg(i,d,p),jd(i,d,p,l),Vd(null,i,d,!0,r,l);case 19:return iy(r,i,l);case 22:return Qg(r,i,l)}throw Error(n(156,i.tag))};function Ay(r,i){return ht(r,i)}function hP(r,i,l,d){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(r,i,l,d){return new hP(r,i,l,d)}function oh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function fP(r){if(typeof r=="function")return oh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===oe)return 11;if(r===ue)return 14}return 2}function _a(r,i){var l=r.alternate;return l===null?(l=Mn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&14680064,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l}function ec(r,i,l,d,p,g){var _=2;if(d=r,typeof r=="function")oh(r)&&(_=1);else if(typeof r=="string")_=5;else e:switch(r){case H:return Xa(l.children,p,g,i);case S:_=8,p|=8;break;case Z:return r=Mn(12,l,i,p|2),r.elementType=Z,r.lanes=g,r;case Ae:return r=Mn(13,l,i,p),r.elementType=Ae,r.lanes=g,r;case fe:return r=Mn(19,l,i,p),r.elementType=fe,r.lanes=g,r;case Me:return tc(l,p,g,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:_=10;break e;case me:_=9;break e;case oe:_=11;break e;case ue:_=14;break e;case le:_=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return i=Mn(_,l,i,p),i.elementType=r,i.type=d,i.lanes=g,i}function Xa(r,i,l,d){return r=Mn(7,r,d,i),r.lanes=l,r}function tc(r,i,l,d){return r=Mn(22,r,d,i),r.elementType=Me,r.lanes=l,r.stateNode={isHidden:!1},r}function lh(r,i,l){return r=Mn(6,r,null,i),r.lanes=l,r}function ch(r,i,l){return i=Mn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}function pP(r,i,l,d,p){this.tag=i,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Iu(0),this.expirationTimes=Iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Iu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function uh(r,i,l,d,p,g,_,E,M){return r=new pP(r,i,l,E,M),i===1?(i=1,g===!0&&(i|=8)):i=0,g=Mn(3,null,null,i),r.current=g,g.stateNode=r,g.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},xd(g),r}function mP(r,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:d==null?null:""+d,children:r,containerInfo:i,implementation:l}}function Ry(r){if(!r)return da;r=r._reactInternals;e:{if(he(r)!==r||r.tag!==1)throw Error(n(170));var i=r;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(fn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(r.tag===1){var l=r.type;if(fn(l))return ag(r,l,i)}return i}function Ly(r,i,l,d,p,g,_,E,M){return r=uh(l,d,!0,r,p,g,_,E,M),r.context=Ry(null),l=r.current,d=sn(),p=va(l),g=jr(d,p),g.callback=i??null,pa(l,g,p),r.current.lanes=p,Rs(r,p,d),gn(r,d),r}function nc(r,i,l,d){var p=i.current,g=sn(),_=va(p);return l=Ry(l),i.context===null?i.context=l:i.pendingContext=l,i=jr(g,_),i.payload={element:r},d=d===void 0?null:d,d!==null&&(i.callback=d),r=pa(p,i,_),r!==null&&(er(r,p,_,g),Ml(r,p,_)),_}function rc(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Dy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function dh(r,i){Dy(r,i),(r=r.alternate)&&Dy(r,i)}function gP(){return null}var My=typeof reportError=="function"?reportError:function(r){console.error(r)};function hh(r){this._internalRoot=r}ac.prototype.render=hh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));nc(r,i,null,null)},ac.prototype.unmount=hh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;qa(function(){nc(null,r,null,null)}),i[Dr]=null}};function ac(r){this._internalRoot=r}ac.prototype.unstable_scheduleHydration=function(r){if(r){var i=gm();r={blockedOn:null,target:r,priority:i};for(var l=0;l<sa.length&&i!==0&&i<sa[l].priority;l++);sa.splice(l,0,r),l===0&&bm(r)}};function fh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function ic(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Ny(){}function yP(r,i,l,d,p){if(p){if(typeof d=="function"){var g=d;d=function(){var z=rc(_);g.call(z)}}var _=Ly(i,d,r,0,null,!1,!1,"",Ny);return r._reactRootContainer=_,r[Dr]=_.current,Hs(r.nodeType===8?r.parentNode:r),qa(),_}for(;p=r.lastChild;)r.removeChild(p);if(typeof d=="function"){var E=d;d=function(){var z=rc(M);E.call(z)}}var M=uh(r,0,!1,null,null,!1,!1,"",Ny);return r._reactRootContainer=M,r[Dr]=M.current,Hs(r.nodeType===8?r.parentNode:r),qa(function(){nc(i,M,l,d)}),M}function sc(r,i,l,d,p){var g=l._reactRootContainer;if(g){var _=g;if(typeof p=="function"){var E=p;p=function(){var M=rc(_);E.call(M)}}nc(i,_,r,p)}else _=yP(l,i,r,p,d);return rc(_)}pm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var l=na(i.pendingLanes);l!==0&&(ju(i,l|1),gn(i,rt()),(at&6)===0&&(Ki=rt()+500,ha()))}break;case 13:qa(function(){var d=Ir(r,1);if(d!==null){var p=sn();er(d,r,1,p)}}),dh(r,1)}},Uu=function(r){if(r.tag===13){var i=Ir(r,134217728);if(i!==null){var l=sn();er(i,r,134217728,l)}dh(r,134217728)}},mm=function(r){if(r.tag===13){var i=va(r),l=Ir(r,i);if(l!==null){var d=sn();er(l,r,i,d)}dh(r,i)}},gm=function(){return ct},ym=function(r,i){var l=ct;try{return ct=r,i()}finally{ct=l}},wi=function(r,i,l){switch(i){case"input":if(Wn(r,l),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==r&&d.form===r.form){var p=xl(d);if(!p)throw Error(n(90));Tr(d),Wn(d,p)}}}break;case"textarea":al(r,l);break;case"select":i=l.value,i!=null&&qr(r,!!l.multiple,i,!1)}},ol=ah,Cs=qa;var vP={usingClientEntryPoint:!1,Events:[Gs,Mi,xl,sl,Ts,ah]},oo={findFiberByHostInstance:Fa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bP={bundleType:oo.bundleType,version:oo.version,rendererPackageName:oo.rendererPackageName,rendererConfig:oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=st(r),r===null?null:r.stateNode},findFiberByHostInstance:oo.findFiberByHostInstance||gP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{Cn=oc.inject(bP),rn=oc}catch{}}return yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vP,yn.createPortal=function(r,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fh(i))throw Error(n(200));return mP(r,i,null,l)},yn.createRoot=function(r,i){if(!fh(r))throw Error(n(299));var l=!1,d="",p=My;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=uh(r,1,!1,null,null,l,!1,d,p),r[Dr]=i.current,Hs(r.nodeType===8?r.parentNode:r),new hh(i)},yn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=st(i),r=r===null?null:r.stateNode,r},yn.flushSync=function(r){return qa(r)},yn.hydrate=function(r,i,l){if(!ic(i))throw Error(n(200));return sc(null,r,i,!0,l)},yn.hydrateRoot=function(r,i,l){if(!fh(r))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,p=!1,g="",_=My;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=Ly(i,null,r,1,l??null,p,!1,g,_),r[Dr]=i.current,Hs(r),d)for(r=0;r<d.length;r++)l=d[r],p=l._getVersion,p=p(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,p]:i.mutableSourceEagerHydrationData.push(l,p);return new ac(i)},yn.render=function(r,i,l){if(!ic(i))throw Error(n(200));return sc(null,r,i,!1,l)},yn.unmountComponentAtNode=function(r){if(!ic(r))throw Error(n(40));return r._reactRootContainer?(qa(function(){sc(null,null,r,!1,function(){r._reactRootContainer=null,r[Dr]=null})}),!0):!1},yn.unstable_batchedUpdates=ah,yn.unstable_renderSubtreeIntoContainer=function(r,i,l,d){if(!ic(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return sc(r,i,l,!1,d)},yn.version="18.3.1-next-f1338f8080-20240426",yn}var zy;function L0(){if(zy)return gh.exports;zy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gh.exports=AP(),gh.exports}var $y;function RP(){if($y)return lc;$y=1;var e=L0();return lc.createRoot=e.createRoot,lc.hydrateRoot=e.hydrateRoot,lc}var LP=RP();var D0=e=>{throw TypeError(e)},DP=(e,t,n)=>t.has(e)||D0("Cannot "+n),bh=(e,t,n)=>(DP(e,t,"read from private field"),n?n.call(e):t.get(e)),MP=(e,t,n)=>t.has(e)?D0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Hy="popstate";function Wy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function NP(e={}){function t(a,s){let o=s.state?.masked,{pathname:c,search:u,hash:h}=o||a.location;return Ro("",{pathname:c,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:br(s)}return IP(t,n,null,e)}function Xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function OP(){return Math.random().toString(36).substring(2,10)}function Ky(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ro(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Wr(t):t,state:n,key:t&&t.key||a||OP(),unstable_mask:s}}function br({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function IP(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,u="POP",h=null,f=m();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function m(){return(c.state||{idx:null}).idx}function y(){u="POP";let P=m(),D=P==null?null:P-f;f=P,h&&h({action:u,location:T.location,delta:D})}function b(P,D){u="PUSH";let R=Wy(P)?P:Ro(T.location,P,D);f=m()+1;let L=Ky(R,f),j=T.createHref(R.unstable_mask||R);try{c.pushState(L,"",j)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;s.location.assign(j)}o&&h&&h({action:u,location:T.location,delta:1})}function w(P,D){u="REPLACE";let R=Wy(P)?P:Ro(T.location,P,D);f=m();let L=Ky(R,f),j=T.createHref(R.unstable_mask||R);c.replaceState(L,"",j),o&&h&&h({action:u,location:T.location,delta:0})}function x(P){return M0(P)}let T={get action(){return u},get location(){return e(s,c)},listen(P){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Hy,y),h=P,()=>{s.removeEventListener(Hy,y),h=null}},createHref(P){return t(s,P)},createURL:x,encodeLocation(P){let D=x(P);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:b,replace:w,go(P){return c.go(P)}};return T}function M0(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xe(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:br(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var go,Gy=class{constructor(e){if(MP(this,go,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bh(this,go).has(e))return bh(this,go).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bh(this,go).set(e,t)}};go=new WeakMap;var jP=new Set(["lazy","caseSensitive","path","id","index","children"]);function UP(e){return jP.has(e)}var BP=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function FP(e){return BP.has(e)}function VP(e){return e.index===!0}function Lo(e,t,n=[],a={},s=!1){return e.map((o,c)=>{let u=[...n,String(c)],h=typeof o.id=="string"?o.id:u.join("-");if(Xe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Xe(s||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),VP(o)){let f={...o,id:h};return a[h]=qy(f,t(f)),f}else{let f={...o,id:h,children:void 0};return a[h]=qy(f,t(f)),o.children&&(f.children=Lo(o.children,t,u,a,s)),f}})}function qy(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ta(e,t,n="/"){return yo(e,t,n,!1)}function yo(e,t,n,a){let s=typeof t=="string"?Wr(t):t,o=Un(s.pathname||"/",n);if(o==null)return null;let c=N0(e);$P(c);let u=null;for(let h=0;u==null&&h<c.length;++h){let f=e1(o);u=QP(c[h],f,a)}return u}function zP(e,t){let{route:n,pathname:a,params:s}=e;return{id:n.id,pathname:a,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N0(e,t=[],n=[],a="",s=!1){let o=(c,u,h=s,f)=>{let m={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&h)return;Xe(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let y=ir([a,m.relativePath]),b=n.concat(m);c.children&&c.children.length>0&&(Xe(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),N0(c.children,t,b,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:ZP(y,c.index),routesMeta:b})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))o(c,u);else for(let h of O0(c.path))o(c,u,!0,h)}),t}function O0(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return s?[o,""]:[o];let c=O0(a.join("/")),u=[];return u.push(...c.map(h=>h===""?o:[o,h].join("/"))),s&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function $P(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XP(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var HP=/^:[\w-]+$/,WP=3,KP=2,GP=1,qP=10,YP=-2,Yy=e=>e==="*";function ZP(e,t){let n=e.split("/"),a=n.length;return n.some(Yy)&&(a+=YP),t&&(a+=KP),n.filter(s=>!Yy(s)).reduce((s,o)=>s+(HP.test(o)?WP:o===""?GP:qP),a)}function XP(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function QP(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let u=0;u<a.length;++u){let h=a[u],f=u===a.length-1,m=o==="/"?t:t.slice(o.length)||"/",y=$c({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),b=h.route;if(!y&&f&&n&&!a[a.length-1].route.index&&(y=$c({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(s,y.params),c.push({params:s,pathname:ir([o,y.pathname]),pathnameBase:r1(ir([o,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(o=ir([o,y.pathnameBase]))}return c}function $c(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=JP(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:a.reduce((f,{paramName:m,isOptional:y},b)=>{if(m==="*"){let x=u[b]||"";c=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=u[b];return y&&!w?f[m]=void 0:f[m]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:c,pattern:e}}function JP(e,t=!1,n=!0){Et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,h,f,m)=>{if(a.push({paramName:u,isOptional:h!=null}),h){let y=m.charAt(f+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function e1(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Un(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function t1({basename:e,pathname:t}){return t==="/"?e:ir([e,t])}var I0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qf=e=>I0.test(e);function n1(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Wr(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=Zy(n.substring(1),"/"):o=Zy(n,t)):o=t,{pathname:o,search:a1(a),hash:i1(s)}}function Zy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function _h(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function j0(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jf(e){let t=j0(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function yu(e,t,n,a=!1){let s;typeof e=="string"?s=Wr(e):(s={...e},Xe(!s.pathname||!s.pathname.includes("?"),_h("?","pathname","search",s)),Xe(!s.pathname||!s.pathname.includes("#"),_h("#","pathname","hash",s)),Xe(!s.search||!s.search.includes("#"),_h("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),y-=1;s.pathname=b.join("/")}u=y>=0?t[y]:"/"}let h=n1(s,u),f=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var ir=e=>e.join("/").replace(/\/\/+/g,"/"),r1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),a1=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,i1=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Fo=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Do(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Vo(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var U0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function B0(e,t){let n=e;if(typeof n!="string"||!I0.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(U0)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),u=Un(c.pathname,t);c.origin===o.origin&&u!=null?n=u+c.search+c.hash:s=!0}catch{Et(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}var Aa=Symbol("Uninstrumented");function s1(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(o){let c=Object.keys(n);for(let u of c)o[u]&&n[u].push(o[u])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=ns(n.lazy,t.lazy,()=>{});s&&(a.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(o=>{let c=s[o],u=n[`lazy.${o}`];if(typeof c=="function"&&u.length>0){let h=ns(u,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[o]:h}))}})}return["loader","action"].forEach(s=>{let o=t[s];if(typeof o=="function"&&n[s].length>0){let c=o[Aa]??o,u=ns(n[s],c,(...h)=>Xy(h[0]));u&&(s==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Aa]=c,a[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(s=>{let o=s[Aa]??s,c=ns(n.middleware,o,(...u)=>Xy(u[0]));return c?(c[Aa]=o,c):s})),a}function o1(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(s){let o=Object.keys(s);for(let c of o)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let a=e.navigate[Aa]??e.navigate,s=ns(n.navigate,a,(...o)=>{let[c,u]=o;return{to:typeof c=="number"||typeof c=="string"?c:c?br(c):".",...Qy(e,u??{})}});s&&(s[Aa]=a,e.navigate=s)}if(n.fetch.length>0){let a=e.fetch[Aa]??e.fetch,s=ns(n.fetch,a,(...o)=>{let[c,,u,h]=o;return{href:u??".",fetcherKey:c,...Qy(e,h??{})}});s&&(s[Aa]=a,e.fetch=s)}return e}function ns(e,t,n){return e.length===0?null:async(...a)=>{let s=await F0(e,n(...a),()=>t(...a),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function F0(e,t,n,a){let s=e[a],o;if(s){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=F0(e,t,n,a-1),o=await c,Xe(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await s(u,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await u(),await c}else try{o={type:"success",value:await n()}}catch(c){o={type:"error",value:c}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Xy(e){let{request:t,context:n,params:a,unstable_pattern:s}=e;return{request:l1(t),params:{...a},unstable_pattern:s,context:c1(n)}}function Qy(e,t){return{currentUrl:br(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function l1(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function c1(e){if(d1(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var u1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function d1(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===u1}var V0=["POST","PUT","PATCH","DELETE"],h1=new Set(V0),f1=["GET",...V0],p1=new Set(f1),z0=new Set([301,302,303,307,308]),m1=new Set([307,308]),kh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},g1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},y1=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),$0="remix-router-transitions",H0=Symbol("ResetLoaderData");function v1(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],s=e.mapRouteProperties||y1,o=s;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;o=U=>({...s(U),...s1(A.map(V=>V.route).filter(Boolean),U)})}let c={},u=Lo(e.routes,o,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||x1,y={...e.future},b=null,w=new Set,x=null,T=null,P=null,D=e.hydrationData!=null,R=Ta(u,e.history.location,f),L=!1,j=null,G,K;if(R==null&&!e.patchRoutesOnNavigation){let A=Nn(404,{pathname:e.history.location.pathname}),{matches:U,route:V}=cc(u);G=!0,K=!G,R=U,j={[V.id]:A}}else if(R&&!e.hydrationData&&Qr(R,u,e.history.location.pathname).active&&(R=null),R)if(R.some(A=>A.route.lazy))G=!1,K=!G;else if(!R.some(A=>ep(A.route)))G=!0,K=!G;else{let A=e.hydrationData?e.hydrationData.loaderData:null,U=e.hydrationData?e.hydrationData.errors:null,V=R;if(U){let te=R.findIndex(ae=>U[ae.route.id]!==void 0);V=V.slice(0,te+1)}K=!1,G=V.every(te=>{let ae=W0(te.route,A,U);return K=K||ae.renderFallback,!ae.shouldLoad})}else{G=!1,K=!G,R=[];let A=Qr(null,u,e.history.location.pathname);A.active&&A.matches&&(L=!0,R=A.matches)}let H,S={historyAction:e.history.action,location:e.history.location,matches:R,initialized:G,renderFallback:K,navigation:kh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},Z="POP",X=null,me=!1,oe,Ae=!1,fe=new Map,ue=null,le=!1,Me=!1,W=new Set,Y=new Map,$=0,N=-1,q=new Map,xe=new Set,Re=new Map,Se=new Map,Ce=new Set,Ge=new Map,Qe,Ue=null;function jt(){if(b=e.history.listen(({action:A,location:U,delta:V})=>{if(Qe){Qe(),Qe=void 0;return}Et(Ge.size===0||V!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let te=Cr({currentLocation:S.location,nextLocation:U,historyAction:A});if(te&&V!=null){let ae=new Promise(Ee=>{Qe=Ee});e.history.go(V*-1),Gn(te,{state:"blocked",location:U,proceed(){Gn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ae.then(()=>e.history.go(V))},reset(){let Ee=new Map(S.blockers);Ee.set(te,co),pt({blockers:Ee})}}),X?.resolve(),X=null;return}return Wn(A,U)}),n){V1(t,fe);let A=()=>z1(t,fe);t.addEventListener("pagehide",A),ue=()=>t.removeEventListener("pagehide",A)}return S.initialized||Wn("POP",S.location,{initialHydration:!0}),H}function Hn(){b&&b(),ue&&ue(),w.clear(),oe&&oe.abort(),S.fetchers.forEach((A,U)=>vi(U)),S.blockers.forEach((A,U)=>wi(U))}function Tr(A){return w.add(A),()=>w.delete(A)}function pt(A,U={}){A.matches&&(A.matches=A.matches.map(ae=>{let Ee=c[ae.route.id],pe=ae.route;return pe.element!==Ee.element||pe.errorElement!==Ee.errorElement||pe.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ae,route:Ee}:ae})),S={...S,...A};let V=[],te=[];S.fetchers.forEach((ae,Ee)=>{ae.state==="idle"&&(Ce.has(Ee)?V.push(Ee):te.push(Ee))}),Ce.forEach(ae=>{!S.fetchers.has(ae)&&!Y.has(ae)&&V.push(ae)}),[...w].forEach(ae=>ae(S,{deletedFetchers:V,newErrors:A.errors??null,viewTransitionOpts:U.viewTransitionOpts,flushSync:U.flushSync===!0})),V.forEach(ae=>vi(ae)),te.forEach(ae=>S.fetchers.delete(ae))}function en(A,U,{flushSync:V}={}){let te=S.actionData!=null&&S.navigation.formMethod!=null&&Qt(S.navigation.formMethod)&&S.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;U.actionData?Object.keys(U.actionData).length>0?ae=U.actionData:ae=null:te?ae=S.actionData:ae=null;let Ee=U.loaderData?lv(S.loaderData,U.loaderData,U.matches||[],U.errors):S.loaderData,pe=S.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((Oe,Le)=>pe.set(Le,co)));let De=le?!1:Cs(A,U.matches||S.matches),he=me===!0||S.navigation.formMethod!=null&&Qt(S.navigation.formMethod)&&A.state?._isRedirect!==!0;h&&(u=h,h=void 0),le||Z==="POP"||(Z==="PUSH"?e.history.push(A,A.state):Z==="REPLACE"&&e.history.replace(A,A.state));let Ne;if(Z==="POP"){let Oe=fe.get(S.location.pathname);Oe&&Oe.has(A.pathname)?Ne={currentLocation:S.location,nextLocation:A}:fe.has(A.pathname)&&(Ne={currentLocation:A,nextLocation:S.location})}else if(Ae){let Oe=fe.get(S.location.pathname);Oe?Oe.add(A.pathname):(Oe=new Set([A.pathname]),fe.set(S.location.pathname,Oe)),Ne={currentLocation:S.location,nextLocation:A}}pt({...U,actionData:ae,loaderData:Ee,historyAction:Z,location:A,initialized:!0,renderFallback:!1,navigation:kh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:he,blockers:pe},{viewTransitionOpts:Ne,flushSync:V===!0}),Z="POP",me=!1,Ae=!1,le=!1,Me=!1,X?.resolve(),X=null,Ue?.resolve(),Ue=null}async function ws(A,U){if(X?.resolve(),X=null,typeof A=="number"){X||(X=hv());let ht=X.promise;return e.history.go(A),ht}let V=ef(S.location,S.matches,f,A,U?.fromRouteId,U?.relative),{path:te,submission:ae,error:Ee}=Jy(!1,V,U),pe;U?.unstable_mask&&(pe={pathname:"",search:"",hash:"",...typeof U.unstable_mask=="string"?Wr(U.unstable_mask):{...S.location.unstable_mask,...U.unstable_mask}});let De=S.location,he=Ro(De,te,U&&U.state,void 0,pe);he={...he,...e.history.encodeLocation(he)};let Ne=U&&U.replace!=null?U.replace:void 0,Oe="PUSH";Ne===!0?Oe="REPLACE":Ne===!1||ae!=null&&Qt(ae.formMethod)&&ae.formAction===S.location.pathname+S.location.search&&(Oe="REPLACE");let Le=U&&"preventScrollReset"in U?U.preventScrollReset===!0:void 0,st=(U&&U.flushSync)===!0,et=Cr({currentLocation:De,nextLocation:he,historyAction:Oe});if(et){Gn(et,{state:"blocked",location:he,proceed(){Gn(et,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),ws(A,U)},reset(){let ht=new Map(S.blockers);ht.set(et,co),pt({blockers:ht})}});return}await Wn(Oe,he,{submission:ae,pendingError:Ee,preventScrollReset:Le,replace:U&&U.replace,enableViewTransition:U&&U.viewTransition,flushSync:st,callSiteDefaultShouldRevalidate:U&&U.unstable_defaultShouldRevalidate})}function tl(){Ue||(Ue=hv()),Zr(),pt({revalidation:"loading"});let A=Ue.promise;return S.navigation.state==="submitting"?A:S.navigation.state==="idle"?(Wn(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),A):(Wn(Z||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:Ae===!0}),A)}async function Wn(A,U,V){oe&&oe.abort(),oe=null,Z=A,le=(V&&V.startUninterruptedRevalidation)===!0,ol(S.location,S.matches),me=(V&&V.preventScrollReset)===!0,Ae=(V&&V.enableViewTransition)===!0;let te=h||u,ae=V&&V.overrideNavigation,Ee=V?.initialHydration&&S.matches&&S.matches.length>0&&!L?S.matches:Ta(te,U,f),pe=(V&&V.flushSync)===!0;if(Ee&&S.initialized&&!Me&&L1(S.location,U)&&!(V&&V.submission&&Qt(V.submission.formMethod))){en(U,{matches:Ee},{flushSync:pe});return}let De=Qr(Ee,te,U.pathname);if(De.active&&De.matches&&(Ee=De.matches),!Ee){let{error:Pt,notFoundMatches:$t,route:lt}=xi(U.pathname);en(U,{matches:$t,loaderData:{},errors:{[lt.id]:Pt}},{flushSync:pe});return}oe=new AbortController;let he=Ji(e.history,U,oe.signal,V&&V.submission),Ne=e.getContext?await e.getContext():new Gy,Oe;if(V&&V.pendingError)Oe=[Ca(Ee).route.id,{type:"error",error:V.pendingError}];else if(V&&V.submission&&Qt(V.submission.formMethod)){let Pt=await nl(he,U,V.submission,Ee,Ne,De.active,V&&V.initialHydration===!0,{replace:V.replace,flushSync:pe});if(Pt.shortCircuited)return;if(Pt.pendingActionResult){let[$t,lt]=Pt.pendingActionResult;if(xn(lt)&&Do(lt.error)&&lt.error.status===404){oe=null,en(U,{matches:Pt.matches,loaderData:{},errors:{[$t]:lt.error}});return}}Ee=Pt.matches||Ee,Oe=Pt.pendingActionResult,ae=wh(U,V.submission),pe=!1,De.active=!1,he=Ji(e.history,he.url,he.signal)}let{shortCircuited:Le,matches:st,loaderData:et,errors:ht}=await xs(he,U,Ee,Ne,De.active,ae,V&&V.submission,V&&V.fetcherSubmission,V&&V.replace,V&&V.initialHydration===!0,pe,Oe,V&&V.callSiteDefaultShouldRevalidate);Le||(oe=null,en(U,{matches:st||Ee,...cv(Oe),loaderData:et,errors:ht}))}async function nl(A,U,V,te,ae,Ee,pe,De={}){Zr();let he=B1(U,V);if(pt({navigation:he},{flushSync:De.flushSync===!0}),Ee){let Le=await Ua(te,U.pathname,A.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:et,route:ht}=cc(u);return{matches:et,pendingActionResult:[ht.id,{type:"error",error:Le.error}]}}let st=Ca(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[st,{type:"error",error:Le.error}]}}else if(Le.matches)te=Le.matches;else{let{notFoundMatches:st,error:et,route:ht}=xi(U.pathname);return{matches:st,pendingActionResult:[ht.id,{type:"error",error:et}]}}}let Ne,Oe=Sc(te,U);if(!Oe.route.action&&!Oe.route.lazy)Ne={type:"error",error:Nn(405,{method:A.method,pathname:U.pathname,routeId:Oe.route.id})};else{let Le=os(o,c,A,te,Oe,pe?[]:a,ae),st=await Yr(A,Le,ae,null);if(Ne=st[Oe.route.id],!Ne){for(let et of te)if(st[et.route.id]){Ne=st[et.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ti(Ne)){let Le;return De&&De.replace!=null?Le=De.replace:Le=iv(Ne.response.headers.get("Location"),new URL(A.url),f,e.history)===S.location.pathname+S.location.search,await lr(A,Ne,!0,{submission:V,replace:Le}),{shortCircuited:!0}}if(xn(Ne)){let Le=Ca(te,Oe.route.id);return(De&&De.replace)!==!0&&(Z="PUSH"),{matches:te,pendingActionResult:[Le.route.id,Ne,Oe.route.id]}}return{matches:te,pendingActionResult:[Oe.route.id,Ne]}}async function xs(A,U,V,te,ae,Ee,pe,De,he,Ne,Oe,Le,st){let et=Ee||wh(U,pe),ht=pe||De||dv(et),Pt=!le&&!Ne;if(ae){if(Pt){let Ut=Gr(Le);pt({navigation:et,...Ut!==void 0?{actionData:Ut}:{}},{flushSync:Oe})}let He=await Ua(V,U.pathname,A.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:ta,route:Rr}=cc(u);return{matches:ta,loaderData:{},errors:{[Rr.id]:He.error}}}let Ut=Ca(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[Ut]:He.error}}}else if(He.matches)V=He.matches;else{let{error:Ut,notFoundMatches:ta,route:Rr}=xi(U.pathname);return{matches:ta,loaderData:{},errors:{[Rr.id]:Ut}}}}let $t=h||u,{dsMatches:lt,revalidatingFetchers:rt}=ev(A,te,o,c,e.history,S,V,ht,U,Ne?[]:a,Ne===!0,Me,W,Ce,Re,xe,$t,f,e.patchRoutesOnNavigation!=null,Le,st);if(N=++$,!e.dataStrategy&&!lt.some(He=>He.shouldLoad)&&!lt.some(He=>He.route.middleware&&He.route.middleware.length>0)&&rt.length===0){let He=_i();return en(U,{matches:V,loaderData:{},errors:Le&&xn(Le[1])?{[Le[0]]:Le[1].error}:null,...cv(Le),...He?{fetchers:new Map(S.fetchers)}:{}},{flushSync:Oe}),{shortCircuited:!0}}if(Pt){let He={};if(!ae){He.navigation=et;let Ut=Gr(Le);Ut!==void 0&&(He.actionData=Ut)}rt.length>0&&(He.fetchers=qr(rt)),pt(He,{flushSync:Oe})}rt.forEach(He=>{Kn(He.key),He.controller&&Y.set(He.key,He.controller)});let Er=()=>rt.forEach(He=>Kn(He.key));oe&&oe.signal.addEventListener("abort",Er);let{loaderResults:Ar,fetcherResults:qn}=await yi(lt,rt,A,te);if(A.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",Er),rt.forEach(He=>Y.delete(He.key));let nn=uc(Ar);if(nn)return await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};if(nn=uc(qn),nn)return xe.add(nn.key),await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:As,errors:ea}=ov(S,V,Ar,Le,rt,qn);Ne&&S.errors&&(ea={...S.errors,...ea});let Cn=_i(),rn=ki(N),Si=Cn||rn||rt.length>0;return{matches:V,loaderData:As,errors:ea,...Si?{fetchers:new Map(S.fetchers)}:{}}}function Gr(A){if(A&&!xn(A[1]))return{[A[0]]:A[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function qr(A){return A.forEach(U=>{let V=S.fetchers.get(U.key),te=uo(void 0,V?V.data:void 0);S.fetchers.set(U.key,te)}),new Map(S.fetchers)}async function Ss(A,U,V,te){Kn(A);let ae=(te&&te.flushSync)===!0,Ee=h||u,pe=ef(S.location,S.matches,f,V,U,te?.relative),De=Ta(Ee,pe,f),he=Qr(De,Ee,pe);if(he.active&&he.matches&&(De=he.matches),!De){tn(A,U,Nn(404,{pathname:pe}),{flushSync:ae});return}let{path:Ne,submission:Oe,error:Le}=Jy(!0,pe,te);if(Le){tn(A,U,Le,{flushSync:ae});return}let st=e.getContext?await e.getContext():new Gy,et=(te&&te.preventScrollReset)===!0;if(Oe&&Qt(Oe.formMethod)){await rl(A,U,Ne,De,st,he.active,ae,et,Oe,te&&te.unstable_defaultShouldRevalidate);return}Re.set(A,{routeId:U,path:Ne}),await al(A,U,Ne,De,st,he.active,ae,et,Oe)}async function rl(A,U,V,te,ae,Ee,pe,De,he,Ne){Zr(),Re.delete(A);let Oe=S.fetchers.get(A);Tn(A,F1(he,Oe),{flushSync:pe});let Le=new AbortController,st=Ji(e.history,V,Le.signal,he);if(Ee){let ut=await Ua(te,new URL(st.url).pathname,st.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){tn(A,U,ut.error,{flushSync:pe});return}else if(ut.matches)te=ut.matches;else{tn(A,U,Nn(404,{pathname:V}),{flushSync:pe});return}}let et=Sc(te,V);if(!et.route.action&&!et.route.lazy){let ut=Nn(405,{method:he.formMethod,pathname:V,routeId:U});tn(A,U,ut,{flushSync:pe});return}Y.set(A,Le);let ht=$,Pt=os(o,c,st,te,et,a,ae),$t=await Yr(st,Pt,ae,A),lt=$t[et.route.id];if(!lt){for(let ut of Pt)if($t[ut.route.id]){lt=$t[ut.route.id];break}}if(st.signal.aborted){Y.get(A)===Le&&Y.delete(A);return}if(Ce.has(A)){if(ti(lt)||xn(lt)){Tn(A,Vr(void 0));return}}else{if(ti(lt))if(Y.delete(A),N>ht){Tn(A,Vr(void 0));return}else return xe.add(A),Tn(A,uo(he)),lr(st,lt,!1,{fetcherSubmission:he,preventScrollReset:De});if(xn(lt)){tn(A,U,lt.error);return}}let rt=S.navigation.location||S.location,Er=Ji(e.history,rt,Le.signal),Ar=h||u,qn=S.navigation.state!=="idle"?Ta(Ar,S.navigation.location,f):S.matches;Xe(qn,"Didn't find any matches after fetcher action");let nn=++$;q.set(A,nn);let As=uo(he,lt.data);S.fetchers.set(A,As);let{dsMatches:ea,revalidatingFetchers:Cn}=ev(Er,ae,o,c,e.history,S,qn,he,rt,a,!1,Me,W,Ce,Re,xe,Ar,f,e.patchRoutesOnNavigation!=null,[et.route.id,lt],Ne);Cn.filter(ut=>ut.key!==A).forEach(ut=>{let Lr=ut.key,na=S.fetchers.get(Lr),Pi=uo(void 0,na?na.data:void 0);S.fetchers.set(Lr,Pi),Kn(Lr),ut.controller&&Y.set(Lr,ut.controller)}),pt({fetchers:new Map(S.fetchers)});let rn=()=>Cn.forEach(ut=>Kn(ut.key));Le.signal.addEventListener("abort",rn);let{loaderResults:Si,fetcherResults:He}=await yi(ea,Cn,Er,ae);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",rn),q.delete(A),Y.delete(A),Cn.forEach(ut=>Y.delete(ut.key)),S.fetchers.has(A)){let ut=Vr(lt.data);S.fetchers.set(A,ut)}let Ut=uc(Si);if(Ut)return lr(Er,Ut.result,!1,{preventScrollReset:De});if(Ut=uc(He),Ut)return xe.add(Ut.key),lr(Er,Ut.result,!1,{preventScrollReset:De});let{loaderData:ta,errors:Rr}=ov(S,qn,Si,void 0,Cn,He);ki(nn),S.navigation.state==="loading"&&nn>N?(Xe(Z,"Expected pending action"),oe&&oe.abort(),en(S.navigation.location,{matches:qn,loaderData:ta,errors:Rr,fetchers:new Map(S.fetchers)})):(pt({errors:Rr,loaderData:lv(S.loaderData,ta,qn,Rr),fetchers:new Map(S.fetchers)}),Me=!1)}async function al(A,U,V,te,ae,Ee,pe,De,he){let Ne=S.fetchers.get(A);Tn(A,uo(he,Ne?Ne.data:void 0),{flushSync:pe});let Oe=new AbortController,Le=Ji(e.history,V,Oe.signal);if(Ee){let lt=await Ua(te,new URL(Le.url).pathname,Le.signal,A);if(lt.type==="aborted")return;if(lt.type==="error"){tn(A,U,lt.error,{flushSync:pe});return}else if(lt.matches)te=lt.matches;else{tn(A,U,Nn(404,{pathname:V}),{flushSync:pe});return}}let st=Sc(te,V);Y.set(A,Oe);let et=$,ht=os(o,c,Le,te,st,a,ae),$t=(await Yr(Le,ht,ae,A))[st.route.id];if(Y.get(A)===Oe&&Y.delete(A),!Le.signal.aborted){if(Ce.has(A)){Tn(A,Vr(void 0));return}if(ti($t))if(N>et){Tn(A,Vr(void 0));return}else{xe.add(A),await lr(Le,$t,!1,{preventScrollReset:De});return}if(xn($t)){tn(A,U,$t.error);return}Tn(A,Vr($t.data))}}async function lr(A,U,V,{submission:te,fetcherSubmission:ae,preventScrollReset:Ee,replace:pe}={}){V||(X?.resolve(),X=null),U.response.headers.has("X-Remix-Revalidate")&&(Me=!0);let De=U.response.headers.get("Location");Xe(De,"Expected a Location header on the redirect Response"),De=iv(De,new URL(A.url),f,e.history);let he=Ro(S.location,De,{_isRedirect:!0});if(n){let ht=!1;if(U.response.headers.has("X-Remix-Reload-Document"))ht=!0;else if(Qf(De)){const Pt=M0(De,!0);ht=Pt.origin!==t.location.origin||Un(Pt.pathname,f)==null}if(ht){pe?t.location.replace(De):t.location.assign(De);return}}oe=null;let Ne=pe===!0||U.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Oe,formAction:Le,formEncType:st}=S.navigation;!te&&!ae&&Oe&&Le&&st&&(te=dv(S.navigation));let et=te||ae;if(m1.has(U.response.status)&&et&&Qt(et.formMethod))await Wn(Ne,he,{submission:{...et,formAction:De},preventScrollReset:Ee||me,enableViewTransition:V?Ae:void 0});else{let ht=wh(he,te);await Wn(Ne,he,{overrideNavigation:ht,fetcherSubmission:ae,preventScrollReset:Ee||me,enableViewTransition:V?Ae:void 0})}}async function Yr(A,U,V,te){let ae,Ee={};try{ae=await P1(m,A,U,te,V,!1)}catch(pe){return U.filter(De=>De.shouldLoad).forEach(De=>{Ee[De.route.id]={type:"error",error:pe}}),Ee}if(A.signal.aborted)return Ee;if(!Qt(A.method))for(let pe of U){if(ae[pe.route.id]?.type==="error")break;!ae.hasOwnProperty(pe.route.id)&&!S.loaderData.hasOwnProperty(pe.route.id)&&(!S.errors||!S.errors.hasOwnProperty(pe.route.id))&&pe.shouldCallHandler()&&(ae[pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${pe.route.id}`)})}for(let[pe,De]of Object.entries(ae))if(O1(De)){let he=De.result;Ee[pe]={type:"redirect",response:A1(he,A,pe,U,f)}}else Ee[pe]=await E1(De);return Ee}async function yi(A,U,V,te){let ae=Yr(V,A,te,null),Ee=Promise.all(U.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Oe=(await Yr(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:Oe}}else return Promise.resolve({[he.key]:{type:"error",error:Nn(404,{pathname:he.path})}})})),pe=await ae,De=(await Ee).reduce((he,Ne)=>Object.assign(he,Ne),{});return{loaderResults:pe,fetcherResults:De}}function Zr(){Me=!0,Re.forEach((A,U)=>{Y.has(U)&&W.add(U),Kn(U)})}function Tn(A,U,V={}){S.fetchers.set(A,U),pt({fetchers:new Map(S.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function tn(A,U,V,te={}){let ae=Ca(S.matches,U);vi(A),pt({errors:{[ae.route.id]:V},fetchers:new Map(S.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Xr(A){return Se.set(A,(Se.get(A)||0)+1),Ce.has(A)&&Ce.delete(A),S.fetchers.get(A)||g1}function Nu(A,U){Kn(A,U?.reason),Tn(A,Vr(null))}function vi(A){let U=S.fetchers.get(A);Y.has(A)&&!(U&&U.state==="loading"&&q.has(A))&&Kn(A),Re.delete(A),q.delete(A),xe.delete(A),Ce.delete(A),W.delete(A),S.fetchers.delete(A)}function il(A){let U=(Se.get(A)||0)-1;U<=0?(Se.delete(A),Ce.add(A)):Se.set(A,U),pt({fetchers:new Map(S.fetchers)})}function Kn(A,U){let V=Y.get(A);V&&(V.abort(U),Y.delete(A))}function bi(A){for(let U of A){let V=Xr(U),te=Vr(V.data);S.fetchers.set(U,te)}}function _i(){let A=[],U=!1;for(let V of xe){let te=S.fetchers.get(V);Xe(te,`Expected fetcher: ${V}`),te.state==="loading"&&(xe.delete(V),A.push(V),U=!0)}return bi(A),U}function ki(A){let U=[];for(let[V,te]of q)if(te<A){let ae=S.fetchers.get(V);Xe(ae,`Expected fetcher: ${V}`),ae.state==="loading"&&(Kn(V),q.delete(V),U.push(V))}return bi(U),U.length>0}function Ps(A,U){let V=S.blockers.get(A)||co;return Ge.get(A)!==U&&Ge.set(A,U),V}function wi(A){S.blockers.delete(A),Ge.delete(A)}function Gn(A,U){let V=S.blockers.get(A)||co;Xe(V.state==="unblocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="proceeding"||V.state==="blocked"&&U.state==="unblocked"||V.state==="proceeding"&&U.state==="unblocked",`Invalid blocker state transition: ${V.state} -> ${U.state}`);let te=new Map(S.blockers);te.set(A,U),pt({blockers:te})}function Cr({currentLocation:A,nextLocation:U,historyAction:V}){if(Ge.size===0)return;Ge.size>1&&Et(!1,"A router only supports one blocker at a time");let te=Array.from(Ge.entries()),[ae,Ee]=te[te.length-1],pe=S.blockers.get(ae);if(!(pe&&pe.state==="proceeding")&&Ee({currentLocation:A,nextLocation:U,historyAction:V}))return ae}function xi(A){let U=Nn(404,{pathname:A}),V=h||u,{matches:te,route:ae}=cc(V);return{notFoundMatches:te,route:ae,error:U}}function sl(A,U,V){if(x=A,P=U,T=V||null,!D&&S.navigation===kh){D=!0;let te=Cs(S.location,S.matches);te!=null&&pt({restoreScrollPosition:te})}return()=>{x=null,P=null,T=null}}function Ts(A,U){return T&&T(A,U.map(te=>zP(te,S.loaderData)))||A.key}function ol(A,U){if(x&&P){let V=Ts(A,U);x[V]=P()}}function Cs(A,U){if(x){let V=Ts(A,U),te=x[V];if(typeof te=="number")return te}return null}function Qr(A,U,V){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:yo(U,V,f,!0)}}else return{active:!0,matches:yo(U,V,f,!0)||[]};return{active:!1,matches:null}}async function Ua(A,U,V,te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let Ee=h==null,pe=h||u,De=c;try{await e.patchRoutesOnNavigation({signal:V,path:U,matches:ae,fetcherKey:te,patch:(Oe,Le)=>{V.aborted||tv(Oe,Le,pe,De,o,!1)}})}catch(Oe){return{type:"error",error:Oe,partialMatches:ae}}finally{Ee&&!V.aborted&&(u=[...u])}if(V.aborted)return{type:"aborted"};let he=Ta(pe,U,f),Ne=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(Ne=yo(pe,U,f,!0),!(Ne&&ae.length<Ne.length&&Jr(ae,Ne.slice(0,ae.length))))return{type:"success",matches:he}}if(Ne||(Ne=yo(pe,U,f,!0)),!Ne||Jr(ae,Ne))return{type:"success",matches:null};ae=Ne}}function Jr(A,U){return A.length===U.length&&A.every((V,te)=>V.route.id===U[te].route.id)}function Es(A){c={},h=Lo(A,o,void 0,c)}function Ba(A,U,V=!1){let te=h==null;tv(A,U,h||u,c,o,V),te&&(u=[...u],pt({}))}return H={get basename(){return f},get future(){return y},get state(){return S},get routes(){return u},get window(){return t},initialize:jt,subscribe:Tr,enableScrollRestoration:sl,navigate:ws,fetch:Ss,revalidate:tl,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Xr,resetFetcher:Nu,deleteFetcher:il,dispose:Hn,getBlocker:Ps,deleteBlocker:wi,patchRoutes:Ba,_internalFetchControllers:Y,_internalSetRoutes:Es,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){pt(A)}},e.unstable_instrumentations&&(H=o1(H,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),H}function b1(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ef(e,t,n,a,s,o){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let h=yu(a||".",Jf(c),Un(e.pathname,n)||e.pathname,o==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&u){let f=np(h.search);if(u.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let m=new URLSearchParams(h.search),y=m.getAll("index");m.delete("index"),y.filter(w=>w).forEach(w=>m.append("index",w));let b=m.toString();h.search=b?`?${b}`:""}}return n!=="/"&&(h.pathname=t1({basename:n,pathname:h.pathname})),br(h)}function Jy(e,t,n){if(!n||!b1(n))return{path:t};if(n.formMethod&&!U1(n.formMethod))return{path:t,error:Nn(405,{method:n.formMethod})};let a=()=>({path:t,error:Nn(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=X0(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Qt(o))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,[w,x])=>`${b}${w}=${x}
10
+ `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Qt(o))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}Xe(typeof FormData=="function","FormData is not available in this environment");let u,h;if(n.formData)u=nf(n.formData),h=n.formData;else if(n.body instanceof FormData)u=nf(n.body),h=n.body;else if(n.body instanceof URLSearchParams)u=n.body,h=sv(u);else if(n.body==null)u=new URLSearchParams,h=new FormData;else try{u=new URLSearchParams(n.body),h=sv(u)}catch{return a()}let f={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Qt(f.formMethod))return{path:t,submission:f};let m=Wr(t);return e&&m.search&&np(m.search)&&u.append("index",""),m.search=`?${u}`,{path:br(m),submission:f}}function ev(e,t,n,a,s,o,c,u,h,f,m,y,b,w,x,T,P,D,R,L,j){let G=L?xn(L[1])?L[1].error:L[1].data:void 0,K=s.createURL(o.location),H=s.createURL(h),S;if(m&&o.errors){let ue=Object.keys(o.errors)[0];S=c.findIndex(le=>le.route.id===ue)}else if(L&&xn(L[1])){let ue=L[0];S=c.findIndex(le=>le.route.id===ue)-1}let Z=L?L[1].statusCode:void 0,X=Z&&Z>=400,me={currentUrl:K,currentParams:o.matches[0]?.params||{},nextUrl:H,nextParams:c[0].params,...u,actionResult:G,actionStatus:Z},oe=Vo(c),Ae=c.map((ue,le)=>{let{route:Me}=ue,W=null;if(S!=null&&le>S)W=!1;else if(Me.lazy)W=!0;else if(!ep(Me))W=!1;else if(m){let{shouldLoad:q}=W0(Me,o.loaderData,o.errors);W=q}else _1(o.loaderData,o.matches[le],ue)&&(W=!0);if(W!==null)return tf(n,a,e,oe,ue,f,t,W);let Y=!1;typeof j=="boolean"?Y=j:X?Y=!1:(y||K.pathname+K.search===H.pathname+H.search||K.search!==H.search||k1(o.matches[le],ue))&&(Y=!0);let $={...me,defaultShouldRevalidate:Y},N=ko(ue,$);return tf(n,a,e,oe,ue,f,t,N,$,j)}),fe=[];return x.forEach((ue,le)=>{if(m||!c.some(Re=>Re.route.id===ue.routeId)||w.has(le))return;let Me=o.fetchers.get(le),W=Me&&Me.state!=="idle"&&Me.data===void 0,Y=Ta(P,ue.path,D);if(!Y){if(R&&W)return;fe.push({key:le,routeId:ue.routeId,path:ue.path,matches:null,match:null,request:null,controller:null});return}if(T.has(le))return;let $=Sc(Y,ue.path),N=new AbortController,q=Ji(s,ue.path,N.signal),xe=null;if(b.has(le))b.delete(le),xe=os(n,a,q,Y,$,f,t);else if(W)y&&(xe=os(n,a,q,Y,$,f,t));else{let Re;typeof j=="boolean"?Re=j:X?Re=!1:Re=y;let Se={...me,defaultShouldRevalidate:Re};ko($,Se)&&(xe=os(n,a,q,Y,$,f,t,Se))}xe&&fe.push({key:le,routeId:ue.routeId,path:ue.path,matches:xe,match:$,request:q,controller:N})}),{dsMatches:Ae,revalidatingFetchers:fe}}function ep(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function W0(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ep(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;if(!a&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!s;return{shouldLoad:o,renderFallback:o}}function _1(e,t,n){let a=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return a||s}function k1(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ko(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function tv(e,t,n,a,s,o){let c;if(e){let f=a[e];Xe(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let u=[],h=[];if(t.forEach(f=>{let m=c.find(y=>K0(f,y));m?h.push({existingRoute:m,newRoute:f}):u.push(f)}),u.length>0){let f=Lo(u,s,[e||"_","patch",String(c?.length||"0")],a);c.push(...f)}if(o&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:y}=h[f],b=m,[w]=Lo([y],s,[],{},!0);Object.assign(b,{element:w.element?w.element:b.element,errorElement:w.errorElement?w.errorElement:b.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:b.hydrateFallbackElement})}}function K0(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((n,a)=>t.children?.some(s=>K0(n,s)))??!1:!1}var nv=new WeakMap,G0=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let s=n[t.id];if(Xe(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let o=s.lazy[e];if(!o)return;let c=nv.get(s);c||(c={},nv.set(s,c));let u=c[e];if(u)return u;let h=(async()=>{let f=UP(e),y=s[e]!==void 0&&e!=="hasErrorBoundary";if(f)Et(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)Et(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await o();b!=null&&(Object.assign(s,{[e]:b}),Object.assign(s,a(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(b=>b===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},rv=new WeakMap;function w1(e,t,n,a,s){let o=n[e.id];if(Xe(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=rv.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{Xe(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),w={};for(let x in b){let T=b[x];if(T===void 0)continue;let P=FP(x),R=o[x]!==void 0&&x!=="hasErrorBoundary";P?Et(!P,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Et(!R,`Route "${o.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):w[x]=T}Object.assign(o,w),Object.assign(o,{...a(o),lazy:void 0})})();return rv.set(o,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],h;for(let m of c){if(s&&s.includes(m))continue;let y=G0({key:m,route:e,manifest:n,mapRouteProperties:a});y&&(u.push(y),m===t&&(h=y))}let f=u.length>0?Promise.all(u).then(()=>{}):void 0;return f?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function av(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,o)=>{n[t[o].route.id]=s}),n}async function x1(e){return e.matches.some(t=>t.route.middleware)?q0(e,()=>av(e)):av(e)}function q0(e,t){return S1(e,t,a=>{if(j1(a))throw a;return a},M1,n);function n(a,s,o){if(o)return Promise.resolve(Object.assign(o.value,{[s]:{type:"error",result:a}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(f=>f.route.id===s),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=Ca(c,c[u].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function S1(e,t,n,a,s){let{matches:o,request:c,params:u,context:h,unstable_pattern:f}=e,m=o.flatMap(b=>b.route.middleware?b.route.middleware.map(w=>[b.route.id,w]):[]);return await Y0({request:c,params:u,context:h,unstable_pattern:f},m,t,n,a,s)}async function Y0(e,t,n,a,s,o,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let h=t[c];if(!h)return await n();let[f,m]=h,y,b=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Y0(e,t,n,a,s,o,c+1)},y.value}catch(w){return y={value:await o(w,f,y)},y.value}};try{let w=await m(e,b),x=w!=null?a(w):void 0;return s(x)?x:y?x??y.value:(y={value:await b()},y.value)}catch(w){return await o(w,f,y)}}function Z0(e,t,n,a,s){let o=G0({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=w1(a.route,Qt(n.method)?"action":"loader",t,e,s);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function tf(e,t,n,a,s,o,c,u,h=null,f){let m=!1,y=Z0(e,t,n,s,o);return{...s,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:h,shouldCallHandler(b){return m=!0,h?typeof f=="boolean"?ko(s,{...h,defaultShouldRevalidate:f}):typeof b=="boolean"?ko(s,{...h,defaultShouldRevalidate:b}):ko(s,h):u},resolve(b){let{lazy:w,loader:x,middleware:T}=s.route,P=m||u||b&&!Qt(n.method)&&(w||x),D=T&&T.length>0&&!x&&!w;return P&&(Qt(n.method)||!D)?T1({request:n,unstable_pattern:a,match:s,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:b,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function os(e,t,n,a,s,o,c,u=null){return a.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:Z0(e,t,n,h,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:tf(e,t,n,Vo(a),h,o,c,!0,u))}async function P1(e,t,n,a,s,o){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:Vo(n),params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let m=c;return q0(m,()=>f({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return h}async function T1({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:s,handlerOverride:o,scopedContext:c}){let u,h,f=Qt(e.method),m=f?"action":"loader",y=b=>{let w,x=new Promise((D,R)=>w=R);h=()=>w(),e.signal.addEventListener("abort",h);let T=D=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):b({request:e,unstable_pattern:t,params:n.params,context:c},...D!==void 0?[D]:[]),P=(async()=>{try{return{type:"data",result:await(o?o(R=>T(R)):T())}}catch(D){return{type:"error",result:D}}})();return Promise.race([P,x])};try{let b=f?n.route.action:n.route.loader;if(a||s)if(b){let w,[x]=await Promise.all([y(b).catch(T=>{w=T}),a,s]);if(w!==void 0)throw w;u=x}else{await a;let w=f?n.route.action:n.route.loader;if(w)[u]=await Promise.all([y(w),s]);else if(m==="action"){let x=new URL(e.url),T=x.pathname+x.search;throw Nn(405,{method:e.method,pathname:T,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(b)u=await y(b);else{let w=new URL(e.url),x=w.pathname+w.search;throw Nn(404,{pathname:x})}}catch(b){return{type:"error",result:b}}finally{h&&e.signal.removeEventListener("abort",h)}return u}async function C1(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function E1(e){let{result:t,type:n}=e;if(tp(t)){let a;try{a=await C1(t)}catch(s){return{type:"error",error:s}}return n==="error"?{type:"error",error:new Fo(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return n==="error"?uv(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:D1(t),statusCode:Do(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Do(t)?t.status:void 0}:uv(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function A1(e,t,n,a,s){let o=e.headers.get("Location");if(Xe(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Qf(o)){let c=a.slice(0,a.findIndex(u=>u.route.id===n)+1);o=ef(new URL(t.url),c,s,o),e.headers.set("Location",o)}return e}function iv(e,t,n,a){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Qf(e)){let o=e,c=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(s.includes(c.protocol))throw new Error("Invalid redirect location");let u=Un(c.pathname,n)!=null;if(c.origin===t.origin&&u)return c.pathname+c.search+c.hash}try{let o=a.createURL(e);if(s.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ji(e,t,n,a){let s=e.createURL(X0(t)).toString(),o={signal:n};if(a&&Qt(a.formMethod)){let{formMethod:c,formEncType:u}=a;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(a.json)):u==="text/plain"?o.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?o.body=nf(a.formData):o.body=a.formData}return new Request(s,o)}function nf(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function sv(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function R1(e,t,n,a=!1,s=!1){let o={},c=null,u,h=!1,f={},m=n&&xn(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let b=y.route.id,w=t[b];if(Xe(!ti(w),"Cannot handle redirect results in processLoaderData"),xn(w)){let x=w.error;if(m!==void 0&&(x=m,m=void 0),c=c||{},s)c[b]=x;else{let T=Ca(e,b);c[T.route.id]==null&&(c[T.route.id]=x)}a||(o[b]=H0),h||(h=!0,u=Do(w.error)?w.error.status:500),w.headers&&(f[b]=w.headers)}else o[b]=w.data,w.statusCode&&w.statusCode!==200&&!h&&(u=w.statusCode),w.headers&&(f[b]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:f}}function ov(e,t,n,a,s,o){let{loaderData:c,errors:u}=R1(t,n,a);return s.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:m,controller:y}=h;if(y&&y.signal.aborted)return;let b=o[f];if(Xe(b,"Did not find corresponding fetcher result"),xn(b)){let w=Ca(e.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:b.error}),e.fetchers.delete(f)}else if(ti(b))Xe(!1,"Unhandled fetcher revalidation redirect");else{let w=Vr(b.data);e.fetchers.set(f,w)}}),{loaderData:c,errors:u}}function lv(e,t,n,a){let s=Object.entries(t).filter(([,o])=>o!==H0).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(s[c]=e[c]),a&&a.hasOwnProperty(c))break}return s}function cv(e){return e?xn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ca(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function cc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Nn(e,{pathname:t,routeId:n,method:a,type:s,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&t&&n?u=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",a&&t&&n?u=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(u=`Invalid request method "${a.toUpperCase()}"`)),new Fo(e||500,c,new Error(u),!0)}function uc(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,s]=t[n];if(ti(s))return{key:a,result:s}}}function X0(e){let t=typeof e=="string"?Wr(e):e;return br({...t,hash:""})}function L1(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function D1(e){return new Fo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function M1(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&N1(n))}function N1(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function O1(e){return tp(e.result)&&z0.has(e.result.status)}function xn(e){return e.type==="error"}function ti(e){return(e&&e.type)==="redirect"}function uv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function tp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function I1(e){return z0.has(e)}function j1(e){return tp(e)&&I1(e.status)&&e.headers.has("Location")}function U1(e){return p1.has(e.toUpperCase())}function Qt(e){return h1.has(e.toUpperCase())}function np(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Sc(e,t){let n=typeof t=="string"?Wr(t).search:t.search;if(e[e.length-1].route.index&&np(n||""))return e[e.length-1];let a=j0(e);return a[a.length-1]}function dv(e){let{formMethod:t,formAction:n,formEncType:a,text:s,formData:o,json:c}=e;if(!(!t||!n||!a)){if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:c,text:void 0}}}function wh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function B1(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function uo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function F1(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function V1(e,t){try{let n=e.sessionStorage.getItem($0);if(n){let a=JSON.parse(n);for(let[s,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function z1(e,t){if(t.size>0){let n={};for(let[a,s]of t)n[a]=[...s];try{e.sessionStorage.setItem($0,JSON.stringify(n))}catch(a){Et(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function hv(){let e,t,n=new Promise((a,s)=>{e=async o=>{a(o);try{await n}catch{}},t=async o=>{s(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var pi=k.createContext(null);pi.displayName="DataRouter";var zo=k.createContext(null);zo.displayName="DataRouterState";var Q0=k.createContext(!1);function $1(){return k.useContext(Q0)}var rp=k.createContext({isTransitioning:!1});rp.displayName="ViewTransition";var J0=k.createContext(new Map);J0.displayName="Fetchers";var H1=k.createContext(null);H1.displayName="Await";var Bn=k.createContext(null);Bn.displayName="Navigation";var vu=k.createContext(null);vu.displayName="Location";var Kr=k.createContext({outlet:null,matches:[],isDataRoute:!1});Kr.displayName="Route";var ap=k.createContext(null);ap.displayName="RouteError";var e_="REACT_ROUTER_ERROR",W1="REDIRECT",K1="ROUTE_ERROR_RESPONSE";function G1(e){if(e.startsWith(`${e_}:${W1}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function q1(e){if(e.startsWith(`${e_}:${K1}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Fo(t.status,t.statusText,t.data)}catch{}}function Y1(e,{relative:t}={}){Xe($o(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=k.useContext(Bn),{hash:s,pathname:o,search:c}=Ho(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:ir([n,o])),a.createHref({pathname:u,search:c,hash:s})}function $o(){return k.useContext(vu)!=null}function Fn(){return Xe($o(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(vu).location}var t_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function n_(e){k.useContext(Bn).static||k.useLayoutEffect(e)}function bu(){let{isDataRoute:e}=k.useContext(Kr);return e?lT():Z1()}function Z1(){Xe($o(),"useNavigate() may be used only in the context of a <Router> component.");let e=k.useContext(pi),{basename:t,navigator:n}=k.useContext(Bn),{matches:a}=k.useContext(Kr),{pathname:s}=Fn(),o=JSON.stringify(Jf(a)),c=k.useRef(!1);return n_(()=>{c.current=!0}),k.useCallback((h,f={})=>{if(Et(c.current,t_),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=yu(h,JSON.parse(o),s,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ir([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,s,e])}k.createContext(null);function Ho(e,{relative:t}={}){let{matches:n}=k.useContext(Kr),{pathname:a}=Fn(),s=JSON.stringify(Jf(n));return k.useMemo(()=>yu(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function X1(e,t,n){Xe($o(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=k.useContext(Bn),{matches:s}=k.useContext(Kr),o=s[s.length-1],c=o?o.params:{},u=o?o.pathname:"/",h=o?o.pathnameBase:"/",f=o&&o.route;{let P=f&&f.path||"";a_(u,!f||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${P}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${P}"> to <Route path="${P==="/"?"*":`${P}/*`}">.`)}let m=Fn(),y;y=m;let b=y.pathname||"/",w=b;if(h!=="/"){let P=h.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(P.length).join("/")}let x=Ta(e,{pathname:w});return Et(f||x!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Et(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),nT(x&&x.map(P=>Object.assign({},P,{params:Object.assign({},c,P.params),pathname:ir([h,a.encodeLocation?a.encodeLocation(P.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?h:ir([h,a.encodeLocation?a.encodeLocation(P.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathnameBase])})),s,n)}function Q1(){let e=oT(),t=Do(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:o},"ErrorBoundary")," or"," ",k.createElement("code",{style:o},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:s},n):null,c)}var J1=k.createElement(Q1,null),r_=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=q1(e.digest);n&&(e=n)}let t=e!==void 0?k.createElement(Kr.Provider,{value:this.props.routeContext},k.createElement(ap.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?k.createElement(eT,{error:e},t):t}};r_.contextType=Q0;var xh=new WeakMap;function eT({children:e,error:t}){let{basename:n}=k.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=G1(t.digest);if(a){let s=xh.get(t);if(s)throw s;let o=B0(a.location,n);if(U0&&!xh.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw xh.set(t,c),c}return k.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function tT({routeContext:e,match:t,children:n}){let a=k.useContext(pi);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(Kr.Provider,{value:e},n)}function nT(e,t=[],n){let a=n?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,o=a?.errors;if(o!=null){let m=s.findIndex(y=>y.route.id&&o?.[y.route.id]!==void 0);Xe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let c=!1,u=-1;if(n&&a){c=a.renderFallback;for(let m=0;m<s.length;m++){let y=s[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(u=m),y.route.id){let{loaderData:b,errors:w}=a,x=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||x){n.isStatic&&(c=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n?.onError,f=a&&h?(m,y)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:Vo(a.matches),errorInfo:y})}:void 0;return s.reduceRight((m,y,b)=>{let w,x=!1,T=null,P=null;a&&(w=o&&y.route.id?o[y.route.id]:void 0,T=y.route.errorElement||J1,c&&(u<0&&b===0?(a_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,P=null):u===b&&(x=!0,P=y.route.hydrateFallbackElement||null)));let D=t.concat(s.slice(0,b+1)),R=()=>{let L;return w?L=T:x?L=P:y.route.Component?L=k.createElement(y.route.Component,null):y.route.element?L=y.route.element:L=m,k.createElement(tT,{match:y,routeContext:{outlet:m,matches:D,isDataRoute:a!=null},children:L})};return a&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?k.createElement(r_,{location:a.location,revalidation:a.revalidation,component:T,error:w,children:R(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:f}):R()},null)}function ip(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rT(e){let t=k.useContext(pi);return Xe(t,ip(e)),t}function aT(e){let t=k.useContext(zo);return Xe(t,ip(e)),t}function iT(e){let t=k.useContext(Kr);return Xe(t,ip(e)),t}function sp(e){let t=iT(e),n=t.matches[t.matches.length-1];return Xe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sT(){return sp("useRouteId")}function oT(){let e=k.useContext(ap),t=aT("useRouteError"),n=sp("useRouteError");return e!==void 0?e:t.errors?.[n]}function lT(){let{router:e}=rT("useNavigate"),t=sp("useNavigate"),n=k.useRef(!1);return n_(()=>{n.current=!0}),k.useCallback(async(s,o={})=>{Et(n.current,t_),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var fv={};function a_(e,t,n){!t&&!fv[e]&&(fv[e]=!0,Et(!1,n))}var pv={};function mv(e,t){!e&&!pv[t]&&(pv[t]=!0,console.warn(t))}var cT="useOptimistic",gv=TP[cT],uT=()=>{};function dT(e){return gv?gv(e):[e,uT]}function hT(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:k.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:k.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:k.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var fT=["HydrateFallback","hydrateFallbackElement"],pT=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function mT({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=$1()||a;let[o,c]=k.useState(e.state),[u,h]=dT(o),[f,m]=k.useState(),[y,b]=k.useState({isTransitioning:!1}),[w,x]=k.useState(),[T,P]=k.useState(),[D,R]=k.useState(),L=k.useRef(new Map),j=k.useCallback((S,{deletedFetchers:Z,newErrors:X,flushSync:me,viewTransitionOpts:oe})=>{X&&n&&Object.values(X).forEach(fe=>n(fe,{location:S.location,params:S.matches[0]?.params??{},unstable_pattern:Vo(S.matches)})),S.fetchers.forEach((fe,ue)=>{fe.data!==void 0&&L.current.set(ue,fe.data)}),Z.forEach(fe=>L.current.delete(fe)),mv(me===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ae=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(mv(oe==null||Ae,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!oe||!Ae){t&&me?t(()=>c(S)):a===!1?c(S):k.startTransition(()=>{a===!0&&h(fe=>yv(fe,S)),c(S)});return}if(t&&me){t(()=>{T&&(w?.resolve(),T.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let fe=e.window.document.startViewTransition(()=>{t(()=>c(S))});fe.finished.finally(()=>{t(()=>{x(void 0),P(void 0),m(void 0),b({isTransitioning:!1})})}),t(()=>P(fe));return}T?(w?.resolve(),T.skipTransition(),R({state:S,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(m(S),b({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[e.window,t,T,w,a,h,n]);k.useLayoutEffect(()=>e.subscribe(j),[e,j]),k.useEffect(()=>{y.isTransitioning&&!y.flushSync&&x(new pT)},[y]),k.useEffect(()=>{if(w&&f&&e.window){let S=f,Z=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?c(S):k.startTransition(()=>{a===!0&&h(me=>yv(me,S)),c(S)}),await Z});X.finished.finally(()=>{x(void 0),P(void 0),m(void 0),b({isTransitioning:!1})}),P(X)}},[f,w,e.window,a,h]),k.useEffect(()=>{w&&f&&u.location.key===f.location.key&&w.resolve()},[w,T,u.location,f]),k.useEffect(()=>{!y.isTransitioning&&D&&(m(D.state),b({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),R(void 0))},[y.isTransitioning,D]);let G=k.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:S=>e.navigate(S),push:(S,Z,X)=>e.navigate(S,{state:Z,preventScrollReset:X?.preventScrollReset}),replace:(S,Z,X)=>e.navigate(S,{replace:!0,state:Z,preventScrollReset:X?.preventScrollReset})}),[e]),K=e.basename||"/",H=k.useMemo(()=>({router:e,navigator:G,static:!1,basename:K,onError:n}),[e,G,K,n]);return k.createElement(k.Fragment,null,k.createElement(pi.Provider,{value:H},k.createElement(zo.Provider,{value:u},k.createElement(J0.Provider,{value:L.current},k.createElement(rp.Provider,{value:y},k.createElement(vT,{basename:K,location:u.location,navigationType:u.historyAction,navigator:G,unstable_useTransitions:a},k.createElement(gT,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function yv(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var gT=k.memo(yT);function yT({routes:e,future:t,state:n,isStatic:a,onError:s}){return X1(e,void 0,{state:n,isStatic:a,onError:s})}function vT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Xe(!$o(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=k.useMemo(()=>({basename:u,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[u,s,o,c]);typeof n=="string"&&(n=Wr(n));let{pathname:f="/",search:m="",hash:y="",state:b=null,key:w="default",unstable_mask:x}=n,T=k.useMemo(()=>{let P=Un(f,u);return P==null?null:{location:{pathname:P,search:m,hash:y,state:b,key:w,unstable_mask:x},navigationType:a}},[u,f,m,y,b,w,a,x]);return Et(T!=null,`<Router basename="${u}"> is not able to match the URL "${f}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:k.createElement(Bn.Provider,{value:h},k.createElement(vu.Provider,{children:t,value:T}))}var Pc="get",Tc="application/x-www-form-urlencoded";function _u(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function bT(e){return _u(e)&&e.tagName.toLowerCase()==="button"}function _T(e){return _u(e)&&e.tagName.toLowerCase()==="form"}function kT(e){return _u(e)&&e.tagName.toLowerCase()==="input"}function wT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xT(e,t){return e.button===0&&(!t||t==="_self")&&!wT(e)}function rf(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(s=>[n,s]):[[n,a]])},[]))}function ST(e,t){let n=rf(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var dc=null;function PT(){if(dc===null)try{new FormData(document.createElement("form"),0),dc=!1}catch{dc=!0}return dc}var TT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sh(e){return e!=null&&!TT.has(e)?(Et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tc}"`),null):e}function CT(e,t){let n,a,s,o,c;if(_T(e)){let u=e.getAttribute("action");a=u?Un(u,t):null,n=e.getAttribute("method")||Pc,s=Sh(e.getAttribute("enctype"))||Tc,o=new FormData(e)}else if(bT(e)||kT(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(a=h?Un(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Pc,s=Sh(e.getAttribute("formenctype"))||Sh(u.getAttribute("enctype"))||Tc,o=new FormData(u,e),!PT()){let{name:f,type:m,value:y}=e;if(m==="image"){let b=f?`${f}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else f&&o.append(f,y)}}else{if(_u(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pc,a=null,s=Tc,c=e}return o&&s==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function op(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ET(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Un(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function AT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function RT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function LT(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await AT(o,n);return c.links?c.links():[]}return[]}));return OT(a.flat(1).filter(RT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function vv(e,t,n,a,s,o){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,u=(h,f)=>n[f].pathname!==h.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==h.params["*"];return o==="assets"?t.filter((h,f)=>c(h,f)||u(h,f)):o==="data"?t.filter((h,f)=>{let m=a.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,f)||u(h,f))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function DT(e,t,{includeHydrateFallback:n}={}){return MT(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function MT(e){return[...new Set(e)]}function NT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function OT(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(NT(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function i_(){let e=k.useContext(pi);return op(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function IT(){let e=k.useContext(zo);return op(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var lp=k.createContext(void 0);lp.displayName="FrameworkContext";function s_(){let e=k.useContext(lp);return op(e,"You must render this element inside a <HydratedRouter> element"),e}function jT(e,t){let n=k.useContext(lp),[a,s]=k.useState(!1),[o,c]=k.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:y}=t,b=k.useRef(null);k.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let T=D=>{D.forEach(R=>{c(R.isIntersecting)})},P=new IntersectionObserver(T,{threshold:.5});return b.current&&P.observe(b.current),()=>{P.disconnect()}}},[e]),k.useEffect(()=>{if(a){let T=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(T)}}},[a]);let w=()=>{s(!0)},x=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:ho(u,w),onBlur:ho(h,x),onMouseEnter:ho(f,w),onMouseLeave:ho(m,x),onTouchStart:ho(y,w)}]:[!1,b,{}]}function ho(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UT({page:e,...t}){let{router:n}=i_(),a=k.useMemo(()=>Ta(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?k.createElement(FT,{page:e,matches:a,...t}):null}function BT(e){let{manifest:t,routeModules:n}=s_(),[a,s]=k.useState([]);return k.useEffect(()=>{let o=!1;return LT(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function FT({page:e,matches:t,...n}){let a=Fn(),{future:s,manifest:o,routeModules:c}=s_(),{basename:u}=i_(),{loaderData:h,matches:f}=IT(),m=k.useMemo(()=>vv(e,t,f,o,a,"data"),[e,t,f,o,a]),y=k.useMemo(()=>vv(e,t,f,o,a,"assets"),[e,t,f,o,a]),b=k.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let T=new Set,P=!1;if(t.forEach(R=>{let L=o.routes[R.route.id];!L||!L.hasLoader||(!m.some(j=>j.route.id===R.route.id)&&R.route.id in h&&c[R.route.id]?.shouldRevalidate||L.hasClientLoader?P=!0:T.add(R.route.id))}),T.size===0)return[];let D=ET(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return P&&T.size>0&&D.searchParams.set("_routes",t.filter(R=>T.has(R.route.id)).map(R=>R.route.id).join(",")),[D.pathname+D.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,a,o,m,t,e,c]),w=k.useMemo(()=>DT(y,o),[y,o]),x=BT(y);return k.createElement(k.Fragment,null,b.map(T=>k.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),w.map(T=>k.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),x.map(({key:T,link:P})=>k.createElement("link",{key:T,nonce:n.nonce,...P,crossOrigin:P.crossOrigin??n.crossOrigin})))}function VT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var zT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zT&&(window.__reactRouterVersion="7.13.1")}catch{}function $T(e,t){return v1({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:NP({window:t?.window}),hydrationData:HT(),routes:e,mapRouteProperties:hT,hydrationRouteProperties:fT,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function HT(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:WT(e.errors)}),e}function WT(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,s]of t)if(s&&s.__type==="RouteErrorResponse")n[a]=new Fo(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let c=new o(s.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let o=new Error(s.message);o.stack="",n[a]=o}}else n[a]=s;return n}var o_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ku=k.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:u,state:h,target:f,to:m,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:w,...x},T){let{basename:P,navigator:D,unstable_useTransitions:R}=k.useContext(Bn),L=typeof m=="string"&&o_.test(m),j=B0(m,P);m=j.to;let G=Y1(m,{relative:s}),K=Fn(),H=null;if(u){let ue=yu(u,[],K.unstable_mask?K.unstable_mask.pathname:"/",!0);P!=="/"&&(ue.pathname=ue.pathname==="/"?P:ir([P,ue.pathname])),H=D.createHref(ue)}let[S,Z,X]=jT(a,x),me=YT(m,{replace:c,unstable_mask:u,state:h,target:f,preventScrollReset:y,relative:s,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:R});function oe(ue){t&&t(ue),ue.defaultPrevented||me(ue)}let Ae=!(j.isExternal||o),fe=k.createElement("a",{...x,...X,href:(Ae?H:void 0)||j.absoluteURL||G,onClick:Ae?oe:t,ref:VT(T,Z),target:f,"data-discover":!L&&n==="render"?"true":void 0});return S&&!L?k.createElement(k.Fragment,null,fe,k.createElement(UT,{page:G})):fe});ku.displayName="Link";var KT=k.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:u,children:h,...f},m){let y=Ho(c,{relative:f.relative}),b=Fn(),w=k.useContext(zo),{navigator:x,basename:T}=k.useContext(Bn),P=w!=null&&eC(y)&&u===!0,D=x.encodeLocation?x.encodeLocation(y).pathname:y.pathname,R=b.pathname,L=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),L=L?L.toLowerCase():null,D=D.toLowerCase()),L&&T&&(L=Un(L,T)||L);const j=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let G=R===D||!s&&R.startsWith(D)&&R.charAt(j)==="/",K=L!=null&&(L===D||!s&&L.startsWith(D)&&L.charAt(D.length)==="/"),H={isActive:G,isPending:K,isTransitioning:P},S=G?t:void 0,Z;typeof a=="function"?Z=a(H):Z=[a,G?"active":null,K?"pending":null,P?"transitioning":null].filter(Boolean).join(" ");let X=typeof o=="function"?o(H):o;return k.createElement(ku,{...f,"aria-current":S,className:Z,ref:m,style:X,to:c,viewTransition:u},typeof h=="function"?h(H):h)});KT.displayName="NavLink";var GT=k.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=Pc,action:u,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...w},x)=>{let{unstable_useTransitions:T}=k.useContext(Bn),P=QT(),D=JT(u,{relative:f}),R=c.toLowerCase()==="get"?"get":"post",L=typeof u=="string"&&o_.test(u),j=G=>{if(h&&h(G),G.defaultPrevented)return;G.preventDefault();let K=G.nativeEvent.submitter,H=K?.getAttribute("formmethod")||c,S=()=>P(K||G.currentTarget,{fetcherKey:t,method:H,navigate:n,replace:s,state:o,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b});T&&n!==!1?k.startTransition(()=>S()):S()};return k.createElement("form",{ref:x,method:R,action:D,onSubmit:a?h:j,...w,"data-discover":!L&&e==="render"?"true":void 0})});GT.displayName="Form";function qT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l_(e){let t=k.useContext(pi);return Xe(t,qT(e)),t}function YT(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:f}={}){let m=bu(),y=Fn(),b=Ho(e,{relative:c});return k.useCallback(w=>{if(xT(w,t)){w.preventDefault();let x=n!==void 0?n:br(y)===br(b),T=()=>m(e,{replace:x,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h});f?k.startTransition(()=>T()):T()}},[y,m,b,n,a,s,t,e,o,c,u,h,f])}function Qj(e){Et(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=k.useRef(rf(e)),n=k.useRef(!1),a=Fn(),s=k.useMemo(()=>ST(a.search,n.current?null:t.current),[a.search]),o=bu(),c=k.useCallback((u,h)=>{const f=rf(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,o("?"+f,h)},[o,s]);return[s,c]}var ZT=0,XT=()=>`__${String(++ZT)}__`;function QT(){let{router:e}=l_("useSubmit"),{basename:t}=k.useContext(Bn),n=sT(),a=e.fetch,s=e.navigate;return k.useCallback(async(o,c={})=>{let{action:u,method:h,encType:f,formData:m,body:y}=CT(o,t);if(c.navigate===!1){let b=c.fetcherKey||XT();await a(b,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await s(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,t,n])}function JT(e,{relative:t}={}){let{basename:n}=k.useContext(Bn),a=k.useContext(Kr);Xe(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...Ho(e||".",{relative:t})},c=Fn();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(y=>y).forEach(y=>u.append("index",y));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ir([n,o.pathname])),br(o)}function eC(e,{relative:t}={}){let n=k.useContext(rp);Xe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=l_("useViewTransitionState"),s=Ho(e,{relative:t});if(!n.isTransitioning)return!1;let o=Un(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Un(n.nextLocation.pathname,a)||n.nextLocation.pathname;return $c(s.pathname,c)!=null||$c(s.pathname,o)!=null}var tC=L0();function nC(e){return k.createElement(mT,{flushSync:tC.flushSync,...e})}var it;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const c of s)o[c]=c;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of o)c[u]=s[u];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&o.push(c);return o},e.find=(s,o)=>{for(const c of s)if(o(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function a(s,o=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}e.joinValues=a,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(it||(it={}));var bv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bv||(bv={}));const ye=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pa=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return Number.isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},re=it.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Hr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},a={_errors:[]},s=o=>{for(const c of o.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)a._errors.push(n(c));else{let u=a,h=0;for(;h<c.path.length;){const f=c.path[h];h===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return s(this),a}static assert(t){if(!(t instanceof Hr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,it.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},a=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(t(s))}else a.push(t(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const af=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:it.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,it.assertNever(e)}return{message:n}};let rC=af;function aC(){return rC}const iC=e=>{const{data:t,path:n,errorMaps:a,issueData:s}=e,o=[...n,...s.path||[]],c={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const h=a.filter(f=>!!f).slice().reverse();for(const f of h)u=f(c,{data:t,defaultError:u}).message;return{...s,path:o,message:u}};function ce(e,t){const n=aC(),a=iC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===af?void 0:af].filter(s=>!!s)});e.common.issues.push(a)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const a=[];for(const s of n){if(s.status==="aborted")return ze;s.status==="dirty"&&t.dirty(),a.push(s.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const s of n){const o=await s.key,c=await s.value;a.push({key:o,value:c})}return un.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const s of n){const{key:o,value:c}=s;if(o.status==="aborted"||c.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(a[o.value]=c.value)}return{status:t.value,value:a}}}const ze=Object.freeze({status:"aborted"}),vo=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),_v=e=>e.status==="aborted",kv=e=>e.status==="dirty",cs=e=>e.status==="valid",Hc=e=>typeof Promise<"u"&&e instanceof Promise;var Te;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Te||(Te={}));class _r{constructor(t,n,a,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const wv=(e,t)=>{if(cs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Hr(e.common.issues);return this._error=n,this._error}}};function Ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:s}=e;if(t&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,u)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??u.defaultError}:typeof u.data>"u"?{message:h??a??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:h??n??u.defaultError}},description:s}}class Je{get description(){return this._def.description}_getType(t){return Pa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new un,ctx:{common:t.parent.common,data:t.data,parsedType:Pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Hc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const a=this.safeParse(t,n);if(a.success)return a.data;throw a.error}safeParse(t,n){const a={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pa(t)},s=this._parseSync({data:t,path:a.path,parent:a});return wv(a,s)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pa(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return cs(a)?{value:a.value}:{issues:n.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>cs(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const a=await this.safeParseAsync(t,n);if(a.success)return a.data;throw a.error}async safeParseAsync(t,n){const a={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pa(t)},s=this._parse({data:t,path:a.path,parent:a}),o=await(Hc(s)?s:Promise.resolve(s));return wv(a,o)}refine(t,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const c=t(s),u=()=>o.addIssue({code:re.custom,...a(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((a,s)=>t(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(t){return new di({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return $r.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Zc.create(this,this._def)}or(t){return Kc.create([this,t],this._def)}and(t){return Gc.create(this,t,this._def)}transform(t){return new di({...Ke(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Xc({...Ke(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new h_({typeName:$e.ZodBranded,type:this,...Ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Qc({...Ke(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return up.create(this,t)}readonly(){return Jc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sC=/^c[^\s-]{8,}$/i,oC=/^[0-9a-z]+$/,lC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uC=/^[a-z0-9_-]{21}$/i,dC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ph;const mC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_C=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,c_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",kC=new RegExp(`^${c_}$`);function u_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function wC(e){return new RegExp(`^${u_(e)}$`)}function xC(e){let t=`${c_}T${u_(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function SC(e,t){return!!((t==="v4"||!t)&&mC.test(e)||(t==="v6"||!t)&&yC.test(e))}function PC(e,t){if(!dC.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(a));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function TC(e,t){return!!((t==="v4"||!t)&&gC.test(e)||(t==="v6"||!t)&&vC.test(e))}class gr extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ye.string,received:o.parsedType}),ze}const a=new un;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="length"){const c=t.data.length>o.value,u=t.data.length<o.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?ce(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ce(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),a.dirty())}else if(o.kind==="email")fC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"email",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="emoji")Ph||(Ph=new RegExp(pC,"u")),Ph.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"emoji",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="uuid")cC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"uuid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="nanoid")uC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"nanoid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid")sC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cuid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid2")oC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cuid2",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="ulid")lC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"ulid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ce(s,{validation:"url",code:re.invalid_string,message:o.message}),a.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"regex",code:re.invalid_string,message:o.message}),a.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),a.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{startsWith:o.value},message:o.message}),a.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{endsWith:o.value},message:o.message}),a.dirty()):o.kind==="datetime"?xC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"datetime",message:o.message}),a.dirty()):o.kind==="date"?kC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"date",message:o.message}),a.dirty()):o.kind==="time"?wC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"time",message:o.message}),a.dirty()):o.kind==="duration"?hC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"duration",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="ip"?SC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"ip",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="jwt"?PC(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"jwt",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="cidr"?TC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cidr",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="base64"?bC.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"base64",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="base64url"?_C.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"base64url",code:re.invalid_string,message:o.message}),a.dirty()):it.assertNever(o);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(s=>t.test(s),{validation:n,code:re.invalid_string,...Te.errToObj(a)})}_addCheck(t){return new gr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Te.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Te.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Te.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Te.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Te.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Te.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Te.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Te.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Te.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Te.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Te.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Te.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Te.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Te.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Te.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Te.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Te.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Te.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Te.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Te.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Te.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Te.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Te.errToObj(n)})}nonempty(t){return this.min(1,Te.errToObj(t))}trim(){return new gr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gr.create=e=>new gr({checks:[],typeName:$e.ZodString,coerce:e?.coerce??!1,...Ke(e)});function CC(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=n>a?n:a,o=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return o%c/10**s}class oi extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ye.number){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ye.number,received:o.parsedType}),ze}let a;const s=new un;for(const o of this._def.checks)o.kind==="int"?it.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?CC(t.data,o.value)!==0&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_finite,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Te.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Te.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Te.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Te.toString(n))}setLimit(t,n,a,s){return new oi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Te.toString(s)}]})}_addCheck(t){return new oi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Te.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Te.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Te.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Te.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Te.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Te.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&it.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(n)&&Number.isFinite(t)}}oi.create=e=>new oi({checks:[],typeName:$e.ZodNumber,coerce:e?.coerce||!1,...Ke(e)});class li extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ye.bigint)return this._getInvalidInput(t);let a;const s=new un;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.bigint,received:n.parsedType}),ze}gte(t,n){return this.setLimit("min",t,!0,Te.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Te.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Te.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Te.toString(n))}setLimit(t,n,a,s){return new li({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Te.toString(s)}]})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Te.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Te.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}li.create=e=>new li({checks:[],typeName:$e.ZodBigInt,coerce:e?.coerce??!1,...Ke(e)});class Wc extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.boolean,received:a.parsedType}),ze}return Vn(t.data)}}Wc.create=e=>new Wc({typeName:$e.ZodBoolean,coerce:e?.coerce||!1,...Ke(e)});class us extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ye.date,received:o.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_date}),ze}const a=new un;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),a.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),a.dirty()):it.assertNever(o);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new us({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Te.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Te.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}us.create=e=>new us({checks:[],coerce:e?.coerce||!1,typeName:$e.ZodDate,...Ke(e)});class xv extends Je{_parse(t){if(this._getType(t)!==ye.symbol){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.symbol,received:a.parsedType}),ze}return Vn(t.data)}}xv.create=e=>new xv({typeName:$e.ZodSymbol,...Ke(e)});class sf extends Je{_parse(t){if(this._getType(t)!==ye.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.undefined,received:a.parsedType}),ze}return Vn(t.data)}}sf.create=e=>new sf({typeName:$e.ZodUndefined,...Ke(e)});class of extends Je{_parse(t){if(this._getType(t)!==ye.null){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.null,received:a.parsedType}),ze}return Vn(t.data)}}of.create=e=>new of({typeName:$e.ZodNull,...Ke(e)});class Sv extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Sv.create=e=>new Sv({typeName:$e.ZodAny,...Ke(e)});class lf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}lf.create=e=>new lf({typeName:$e.ZodUnknown,...Ke(e)});class Da extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.never,received:n.parsedType}),ze}}Da.create=e=>new Da({typeName:$e.ZodNever,...Ke(e)});class Pv extends Je{_parse(t){if(this._getType(t)!==ye.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.void,received:a.parsedType}),ze}return Vn(t.data)}}Pv.create=e=>new Pv({typeName:$e.ZodVoid,...Ke(e)});class yr extends Je{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),s=this._def;if(n.parsedType!==ye.array)return ce(n,{code:re.invalid_type,expected:ye.array,received:n.parsedType}),ze;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ce(n,{code:c?re.too_big:re.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ce(n,{code:re.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ce(n,{code:re.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new _r(n,c,n.path,u)))).then(c=>un.mergeArray(a,c));const o=[...n.data].map((c,u)=>s.type._parseSync(new _r(n,c,n.path,u)));return un.mergeArray(a,o)}get element(){return this._def.type}min(t,n){return new yr({...this._def,minLength:{value:t,message:Te.toString(n)}})}max(t,n){return new yr({...this._def,maxLength:{value:t,message:Te.toString(n)}})}length(t,n){return new yr({...this._def,exactLength:{value:t,message:Te.toString(n)}})}nonempty(t){return this.min(1,t)}}yr.create=(e,t)=>new yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ke(t)});function es(e){if(e instanceof Rt){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=$r.create(es(a))}return new Rt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:es(e.element)}):e instanceof $r?$r.create(es(e.unwrap())):e instanceof hi?hi.create(es(e.unwrap())):e instanceof ci?ci.create(e.items.map(t=>es(t))):e}class Rt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=it.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ye.object){const f=this._getOrReturnCtx(t);return ce(f,{code:re.invalid_type,expected:ye.object,received:f.parsedType}),ze}const{status:a,ctx:s}=this._processInputParams(t),{shape:o,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Da&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const h=[];for(const f of c){const m=o[f],y=s.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new _r(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Da){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ce(s,{code:re.unrecognized_keys,keys:u}),a.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new _r(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const y=await m.key,b=await m.value;f.push({key:y,value:b,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(a,f)):un.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Te.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{const s=this._def.errorMap?.(n,a).message??a.defaultError;return n.code==="unrecognized_keys"?{message:Te.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const n={};for(const a of it.objectKeys(t))t[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}omit(t){const n={};for(const a of it.objectKeys(this.shape))t[a]||(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}deepPartial(){return es(this)}partial(t){const n={};for(const a of it.objectKeys(this.shape)){const s=this.shape[a];t&&!t[a]?n[a]=s:n[a]=s.optional()}return new Rt({...this._def,shape:()=>n})}required(t){const n={};for(const a of it.objectKeys(this.shape))if(t&&!t[a])n[a]=this.shape[a];else{let o=this.shape[a];for(;o instanceof $r;)o=o._def.innerType;n[a]=o}return new Rt({...this._def,shape:()=>n})}keyof(){return d_(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});class Kc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=o.map(u=>new Hr(u.ctx.common.issues));return ce(n,{code:re.invalid_union,unionErrors:c}),ze}if(n.common.async)return Promise.all(a.map(async o=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let o;const c=[];for(const h of a){const f={...n,common:{...n.common,issues:[]},parent:null},m=h._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=c.map(h=>new Hr(h));return ce(n,{code:re.invalid_union,unionErrors:u}),ze}}get options(){return this._def.options}}Kc.create=(e,t)=>new Kc({options:e,typeName:$e.ZodUnion,...Ke(t)});const zr=e=>e instanceof uf?zr(e.schema):e instanceof di?zr(e.innerType()):e instanceof Yc?[e.value]:e instanceof ui?e.options:e instanceof df?it.objectValues(e.enum):e instanceof Xc?zr(e._def.innerType):e instanceof sf?[void 0]:e instanceof of?[null]:e instanceof $r?[void 0,...zr(e.unwrap())]:e instanceof hi?[null,...zr(e.unwrap())]:e instanceof h_||e instanceof Jc?zr(e.unwrap()):e instanceof Qc?zr(e._def.innerType):[];class cp extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.object)return ce(n,{code:re.invalid_type,expected:ye.object,received:n.parsedType}),ze;const a=this.discriminator,s=n.data[a],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ce(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,a){const s=new Map;for(const o of n){const c=zr(o.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new cp({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ke(a)})}}function cf(e,t){const n=Pa(e),a=Pa(t);if(e===t)return{valid:!0,data:e};if(n===ye.object&&a===ye.object){const s=it.objectKeys(t),o=it.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of o){const h=cf(e[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===ye.array&&a===ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const c=e[o],u=t[o],h=cf(c,u);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return n===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Gc extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),s=(o,c)=>{if(_v(o)||_v(c))return ze;const u=cf(o.value,c.value);return u.valid?((kv(o)||kv(c))&&n.dirty(),{status:n.value,value:u.data}):(ce(a,{code:re.invalid_intersection_types}),ze)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([o,c])=>s(o,c)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Gc.create=(e,t,n)=>new Gc({left:e,right:t,typeName:$e.ZodIntersection,...Ke(n)});class ci extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.array)return ce(a,{code:re.invalid_type,expected:ye.array,received:a.parsedType}),ze;if(a.data.length<this._def.items.length)return ce(a,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&a.data.length>this._def.items.length&&(ce(a,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...a.data].map((c,u)=>{const h=this._def.items[u]||this._def.rest;return h?h._parse(new _r(a,c,a.path,u)):null}).filter(c=>!!c);return a.common.async?Promise.all(o).then(c=>un.mergeArray(n,c)):un.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ci({...this._def,rest:t})}}ci.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:e,typeName:$e.ZodTuple,rest:null,...Ke(t)})};class qc extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.object)return ce(a,{code:re.invalid_type,expected:ye.object,received:a.parsedType}),ze;const s=[],o=this._def.keyType,c=this._def.valueType;for(const u in a.data)s.push({key:o._parse(new _r(a,u,a.path,u)),value:c._parse(new _r(a,a.data[u],a.path,u)),alwaysSet:u in a.data});return a.common.async?un.mergeObjectAsync(n,s):un.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof Je?new qc({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ke(a)}):new qc({keyType:gr.create(),valueType:t,typeName:$e.ZodRecord,...Ke(n)})}}class Tv extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.map)return ce(a,{code:re.invalid_type,expected:ye.map,received:a.parsedType}),ze;const s=this._def.keyType,o=this._def.valueType,c=[...a.data.entries()].map(([u,h],f)=>({key:s._parse(new _r(a,u,a.path,[f,"key"])),value:o._parse(new _r(a,h,a.path,[f,"value"]))}));if(a.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const h of c){const f=await h.key,m=await h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const h of c){const f=h.key,m=h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Tv.create=(e,t,n)=>new Tv({valueType:t,keyType:e,typeName:$e.ZodMap,...Ke(n)});class Mo extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.set)return ce(a,{code:re.invalid_type,expected:ye.set,received:a.parsedType}),ze;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(ce(a,{code:re.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(ce(a,{code:re.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function c(h){const f=new Set;for(const m of h){if(m.status==="aborted")return ze;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...a.data.values()].map((h,f)=>o._parse(new _r(a,h,a.path,f)));return a.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new Mo({...this._def,minSize:{value:t,message:Te.toString(n)}})}max(t,n){return new Mo({...this._def,maxSize:{value:t,message:Te.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Mo.create=(e,t)=>new Mo({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ke(t)});class uf extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}uf.create=(e,t)=>new uf({getter:e,typeName:$e.ZodLazy,...Ke(t)});class Yc extends Je{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ce(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}Yc.create=(e,t)=>new Yc({value:e,typeName:$e.ZodLiteral,...Ke(t)});function d_(e,t){return new ui({values:e,typeName:$e.ZodEnum,...Ke(t)})}class ui extends Je{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{expected:it.joinValues(a),received:n.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{received:n.data,code:re.invalid_enum_value,options:a}),ze}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ui.create(t,{...this._def,...n})}exclude(t,n=this._def){return ui.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}ui.create=d_;class df extends Je{_parse(t){const n=it.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==ye.string&&a.parsedType!==ye.number){const s=it.objectValues(n);return ce(a,{expected:it.joinValues(s),received:a.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(it.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=it.objectValues(n);return ce(a,{received:a.data,code:re.invalid_enum_value,options:s}),ze}return Vn(t.data)}get enum(){return this._def.values}}df.create=(e,t)=>new df({values:e,typeName:$e.ZodNativeEnum,...Ke(t)});class Zc extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.promise&&n.common.async===!1)return ce(n,{code:re.invalid_type,expected:ye.promise,received:n.parsedType}),ze;const a=n.parsedType===ye.promise?n.data:Promise.resolve(n.data);return Vn(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zc.create=(e,t)=>new Zc({type:e,typeName:$e.ZodPromise,...Ke(t)});class di extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:a}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:c=>{ce(a,c),c.fatal?n.abort():n.dirty()},get path(){return a.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const c=s.transform(a.data,o);if(a.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ze;const h=await this._def.schema._parseAsync({data:u,path:a.path,parent:a});return h.status==="aborted"?ze:h.status==="dirty"||n.value==="dirty"?vo(h.value):h});{if(n.value==="aborted")return ze;const u=this._def.schema._parseSync({data:c,path:a.path,parent:a});return u.status==="aborted"?ze:u.status==="dirty"||n.value==="dirty"?vo(u.value):u}}if(s.type==="refinement"){const c=u=>{const h=s.refinement(u,o);if(a.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!cs(c))return ze;const u=s.transform(c.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>cs(c)?Promise.resolve(s.transform(c.value,o)).then(u=>({status:n.value,value:u})):ze);it.assertNever(s)}}di.create=(e,t,n)=>new di({schema:e,typeName:$e.ZodEffects,effect:t,...Ke(n)});di.createWithPreprocess=(e,t,n)=>new di({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ke(n)});class $r extends Je{_parse(t){return this._getType(t)===ye.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:$e.ZodOptional,...Ke(t)});class hi extends Je{_parse(t){return this._getType(t)===ye.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:$e.ZodNullable,...Ke(t)});class Xc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);let a=n.data;return n.parsedType===ye.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Xc.create=(e,t)=>new Xc({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class Qc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Hc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Qc.create=(e,t)=>new Qc({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class Cv extends Je{_parse(t){if(this._getType(t)!==ye.nan){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.nan,received:a.parsedType}),ze}return{status:"valid",value:t.data}}}Cv.create=e=>new Cv({typeName:$e.ZodNaN,...Ke(e)});class h_ extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class up extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),vo(o.value)):this._def.out._parseAsync({data:o.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ze:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(t,n){return new up({in:t,out:n,typeName:$e.ZodPipeline})}}class Jc extends Je{_parse(t){const n=this._def.innerType._parse(t),a=s=>(cs(s)&&(s.value=Object.freeze(s.value)),s);return Hc(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}Jc.create=(e,t)=>new Jc({innerType:e,typeName:$e.ZodReadonly,...Ke(t)});var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const v=gr.create,Q=oi.create;li.create;const Be=Wc.create,dp=us.create,Jt=lf.create;Da.create;const ie=yr.create,C=Rt.create,zn=Kc.create,f_=cp.create;Gc.create;ci.create;const _t=qc.create,Ye=Yc.create,nt=ui.create;Zc.create;$r.create;hi.create;const hf={string:(e=>gr.create({...e,coerce:!0})),number:(e=>oi.create({...e,coerce:!0})),boolean:(e=>Wc.create({...e,coerce:!0})),bigint:(e=>li.create({...e,coerce:!0})),date:(e=>us.create({...e,coerce:!0}))};var fr;(function(e){e.STRING="string",e.DATE="date",e.DATETIME="datetime",e.INTEGER="integer",e.FLOAT="float",e.BOOLEAN="boolean",e.UUID="uuid",e.JSON="json"})(fr||(fr={}));const EC=nt(["CASCADE","RESTRICT","NO ACTION"]),AC=nt(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),RC=nt([fr.STRING,fr.DATE,fr.DATETIME,fr.INTEGER,fr.FLOAT,fr.BOOLEAN,fr.UUID,fr.JSON]),p_=C({referenceTable:v().min(1,"Target table cannot be empty"),referenceColumn:v().min(1,"Target column cannot be empty"),onDelete:AC,onUpdate:EC}),m_=C({columnName:v().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:zn([RC,v()]),defaultValue:v().optional(),isPrimaryKey:Be().optional(),isNullable:Be(),isUnique:Be(),foreignKey:p_.optional()}),g_=C({tableName:v().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:ie(m_).min(1,"At least one column is required"),recordCount:Q().optional(),createdAt:v().optional(),updatedAt:v().optional()}),LC=C({functionName:v(),functionDef:v(),kind:v()}),DC=C({tableName:v(),indexName:v(),indexDef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()}),MC=C({tableName:v(),policyName:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()}),NC=C({tableName:v(),triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v()});g_.pick({tableName:!0,columns:!0}).extend({rlsEnabled:Be().default(!0)});g_.pick({tableName:!0,columns:!0}).extend({message:v(),autoFields:ie(v()),nextActions:v()});C({addColumns:ie(m_.omit({foreignKey:!0})).optional(),dropColumns:ie(v()).optional(),updateColumns:ie(C({columnName:v(),defaultValue:v().optional(),newColumnName:v().min(1,"New column name cannot be empty").max(64,"New column name must be less than 64 characters").optional()})).optional(),addForeignKeys:ie(C({columnName:v().min(1,"Column name is required for adding foreign key"),foreignKey:p_})).optional(),dropForeignKeys:ie(v()).optional(),renameTable:C({newTableName:v().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});C({message:v(),tableName:v(),operations:ie(v())});C({message:v(),tableName:v(),nextActions:v()});C({query:v().min(1,"Query is required"),params:ie(Jt()).optional()});C({rows:ie(_t(v(),Jt())),rowCount:Q().nullable(),fields:ie(C({name:v(),dataTypeID:Q()})).optional()});C({tables:ie(v()).optional(),format:nt(["sql","json"]).default("sql"),includeData:Be().default(!0),includeFunctions:Be().default(!1),includeSequences:Be().default(!1),includeViews:Be().default(!1),rowLimit:Q().int().positive().max(1e4).default(1e3)});const OC=C({timestamp:v(),tables:_t(v(),C({schema:ie(C({columnName:v(),dataType:v(),characterMaximumLength:Q().nullable(),isNullable:v(),columnDefault:v().nullable()})),indexes:ie(C({indexname:v(),indexdef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()})),foreignKeys:ie(C({constraintName:v(),columnName:v(),foreignTableName:v(),foreignColumnName:v(),deleteRule:v().nullable(),updateRule:v().nullable()})),rlsEnabled:Be().optional(),policies:ie(C({policyname:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()})),triggers:ie(C({triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v(),newTable:v().nullable(),oldTable:v().nullable()})),rows:ie(_t(v(),Jt())).optional(),recordCount:Q().optional()})),functions:ie(C({functionName:v(),functionDef:v(),kind:v()})),sequences:ie(C({sequenceName:v(),startValue:v(),increment:v(),minValue:v().nullable(),maxValue:v().nullable(),cycle:v()})),views:ie(C({viewName:v(),definition:v()}))});C({format:nt(["sql","json"]),data:zn([v(),OC]),timestamp:v()});C({truncate:zn([Be(),v().transform(e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});C({success:Be(),message:v(),filename:v(),tables:ie(v()),rowsImported:Q(),fileSize:Q()});C({table:v().min(1,"Table name is required"),upsertKey:v().optional()});C({success:Be(),message:v(),table:v(),rowsAffected:Q(),totalRecords:Q(),filename:v()});C({functions:ie(LC)});C({indexes:ie(DC)});C({policies:ie(MC)});C({triggers:ie(NC)});const IC=C({id:v(),key:v(),isActive:Be(),isReserved:Be(),lastUsedAt:v().nullable(),expiresAt:v().nullable(),createdAt:v(),updatedAt:v()});C({secrets:ie(IC)});C({key:v(),value:v()});C({key:v().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:v().min(1,"Value is required")});C({success:Ye(!0),message:v(),id:v()});C({success:Ye(!0),message:v()});C({success:Ye(!0),message:v()});const jC=C({key:v(),bucket:v(),size:Q(),mimeType:v().optional(),uploadedAt:v(),url:v()}),UC=C({name:v(),public:Be(),createdAt:v()});C({id:v().uuid(),maxFileSizeMb:Q().int().positive(),createdAt:v(),updatedAt:v()});C({bucketName:v().min(1,"Bucket name cannot be empty"),isPublic:Be().default(!0)});C({isPublic:Be()});C({objects:ie(jC),pagination:C({offset:Q(),limit:Q(),total:Q()})});C({filename:v().min(1,"Filename cannot be empty"),contentType:v().optional(),size:Q().optional()});C({method:nt(["presigned","direct"]),uploadUrl:v(),fields:_t(v()).optional(),key:v(),confirmRequired:Be(),confirmUrl:v().optional(),expiresAt:dp().optional()});C({expiresIn:Q().optional().default(3600)});C({method:nt(["presigned","direct"]),url:v(),expiresAt:dp().optional(),headers:_t(v()).optional()});C({size:Q(),contentType:v().optional(),etag:v().optional()});C({maxFileSizeMb:Q().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const wu=v().uuid("Invalid user ID format"),kr=v().email("Invalid email format").toLowerCase().trim(),hp=v(),BC=v().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),FC=nt(["anon","authenticated","project_admin"]),Ev=nt(["code","link"]),y_=C({name:v().optional(),avatar_url:v().url().optional()}).passthrough(),ys=C({id:wu,email:kr,emailVerified:Be(),providers:ie(v()).optional(),createdAt:v(),updatedAt:v(),profile:y_.nullable(),metadata:_t(Jt()).nullable()}),xu=nt(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);C({provider:xu,redirectUri:v().url().optional()});const fp=C({id:v().uuid(),provider:xu,clientId:v().optional(),scopes:ie(v()).optional(),redirectUri:v().optional(),useSharedKey:Be(),createdAt:v(),updatedAt:v()}),VC=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,v_=C({id:v().uuid(),requireEmailVerification:Be(),passwordMinLength:Q().min(4).max(128),requireNumber:Be(),requireLowercase:Be(),requireUppercase:Be(),requireSpecialChar:Be(),verifyEmailMethod:Ev,resetPasswordMethod:Ev,allowedRedirectUrls:ie(v().regex(VC,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:v(),updatedAt:v()});C({sub:wu,email:kr,role:FC,iat:Q().optional(),exp:Q().optional()});const b_=v().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Key must contain only lowercase letters, numbers, hyphens, and underscores"),pp=C({id:v().uuid(),key:b_,name:v().min(1),discoveryEndpoint:v().url(),clientId:v().min(1),createdAt:v(),updatedAt:v()}),zC=C({limit:v().optional(),offset:v().optional()});C({email:kr,password:hp,name:BC.optional(),redirectTo:v().url().optional()});C({email:kr,password:hp});C({refreshToken:v().min(1,"refreshToken is required")});C({code:v()});zC.extend({search:v().optional()}).optional();C({userIds:ie(wu).min(1,"At least one user ID is required")});C({profile:_t(Jt())});C({email:kr,redirectTo:v().url().optional()});C({email:kr,otp:v().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});C({email:kr,redirectTo:v().url().optional()});C({email:kr,code:v().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});C({newPassword:hp,otp:v().min(1,"OTP/token is required")});C({user:ys.optional(),accessToken:v().nullable(),requireEmailVerification:Be().optional(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});C({user:ys,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});C({user:ys,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});C({accessToken:v(),user:ys,csrfToken:v().optional(),refreshToken:v().optional()});C({token:v(),expiresAt:v().datetime()});C({message:v()});C({user:ys});C({id:wu,profile:y_.nullable()});C({data:ie(ys),pagination:C({offset:Q(),limit:Q(),total:Q()})});C({message:v(),deletedCount:Q().int().nonnegative()});C({authUrl:v().url()});fp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()});fp.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()}).partial();const __=/^[A-Za-z0-9._~-]+$/;C({redirect_uri:v().url().optional(),code_challenge:v().min(43,"Code challenge must be at least 43 characters").max(128,"Code challenge must be at most 128 characters").regex(__,"Code challenge must be base64url encoded")});C({code:v().min(1,"Exchange code is required"),code_verifier:v().min(43,"Code verifier must be at least 43 characters").max(128,"Code verifier must be at most 128 characters").regex(__,"Code verifier must be base64url encoded")});C({data:ie(fp),count:Q()});v_.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const $C=C({oAuthProviders:ie(xu),customOAuthProviders:ie(b_),...v_.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});C({error:v(),message:v(),statusCode:Q().int(),nextActions:v().optional()});pp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1,"Client secret is required")});pp.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1).optional()}).partial();C({data:ie(pp),count:Q()});const k_=nt(["system","user"]),w_=C({id:v().uuid(),pattern:v().min(1),description:v().nullable(),webhookUrls:ie(v().url()).nullable(),enabled:Be(),createdAt:v().datetime(),updatedAt:v().datetime()}),HC=C({id:v().uuid(),eventName:v().min(1),channelId:v().uuid().nullable(),channelName:v().min(1),payload:_t(v(),Jt()),senderType:k_,senderId:v().uuid().nullable(),wsAudienceCount:Q().int().min(0),whAudienceCount:Q().int().min(0),whDeliveredCount:Q().int().min(0),createdAt:v().datetime()}),WC=C({retentionDays:Q().int().positive().nullable()});C({channel:v().min(1)});C({channel:v().min(1)});C({channel:v().min(1),event:v().min(1),payload:_t(v(),Jt())});f_("ok",[C({ok:Ye(!0),channel:v().min(1)}),C({ok:Ye(!1),channel:v().min(1),error:C({code:v().min(1),message:v().min(1)})})]);C({channel:v().optional(),code:v().min(1),message:v().min(1)});C({messageId:v().uuid(),channel:v().min(1),eventName:v().min(1),payload:_t(v(),Jt())});const KC=C({channel:v().optional(),messageId:v().uuid(),senderType:k_,senderId:v().uuid().optional(),timestamp:v().datetime()});C({meta:KC}).passthrough();C({pattern:v().min(1,"Channel pattern is required"),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional().default(!0)});C({pattern:v().min(1).optional(),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional()});ie(w_);C({message:v()});C({channelId:v().uuid().optional(),eventName:v().optional(),limit:hf.number().int().min(1).max(1e3).optional().default(100),offset:hf.number().int().min(0).optional().default(0)});ie(HC);C({channelId:v().uuid().optional(),since:hf.date().optional()});C({totalMessages:Q().int().min(0),whDeliveryRate:Q().min(0).max(1),topEvents:ie(C({eventName:v(),count:Q().int().min(0)})),retentionDays:WC.shape.retentionDays});const Av=C({policyName:v(),tableName:v(),command:v(),roles:ie(v()),using:v().nullable(),withCheck:v().nullable()}),GC=C({subscribe:C({policies:ie(Av)}),publish:C({policies:ie(Av)})}),qC=$C,YC=C({tables:ie(C({tableName:v(),recordCount:Q()})),totalSizeInGB:Q(),hint:v().optional()}),ZC=UC.extend({objectCount:Q().optional()}),XC=C({buckets:ie(ZC),totalSizeInGB:Q()}),QC=C({slug:v(),name:v(),description:v().nullable(),status:v()}),JC=C({models:ie(C({inputModality:ie(v()),outputModality:ie(v()),modelId:v()}))}),eE=C({channels:ie(w_),permissions:GC});C({auth:qC,database:YC,storage:XC,aiIntegration:JC.optional(),functions:ie(QC),realtime:eE.optional(),version:v().optional()});const tE=C({host:v(),port:Q(),database:v(),user:v(),password:v(),sslmode:v()});C({connectionURL:v(),parameters:tE});C({databasePassword:v()});C({apiKey:v()});C({projectId:v().nullable()});const ds=nt(["text","image","audio"]),nE=C({inputModality:ie(ds).min(1),outputModality:ie(ds).min(1),provider:v(),modelId:v(),systemPrompt:v().optional()}),x_=nE.extend({id:v().uuid()});x_.extend({usageStats:C({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()}).optional()});const rE=C({configId:v().uuid(),inputTokens:Q().int().optional(),outputTokens:Q().int().optional(),imageCount:Q().int().optional(),imageResolution:v().optional()}),aE=rE.extend({id:v().uuid(),createdAt:dp(),modelId:v().nullable().optional(),model:v().nullable(),provider:v().nullable(),inputModality:ie(ds).nullable(),outputModality:ie(ds).nullable()});C({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()});const iE=C({type:Ye("text"),text:v()}),sE=C({type:Ye("image_url"),image_url:C({url:v(),detail:nt(["auto","low","high"]).optional()})}),oE=C({type:Ye("input_audio"),input_audio:C({data:v(),format:nt(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),lE=C({type:Ye("file"),file:C({filename:v(),file_data:v()})}),cE=zn([iE,sE,oE,lE]),uE=C({name:v(),description:v().optional(),parameters:_t(Jt()).optional()}),dE=C({type:Ye("function"),function:uE}),hE=zn([nt(["auto","none","required"]),C({type:Ye("function"),function:C({name:v()})})]),S_=C({id:v(),type:Ye("function"),function:C({name:v(),arguments:v()})}),fE=C({role:nt(["user","assistant","system","tool"]),content:zn([v(),ie(cE)]).nullable(),images:ie(C({url:v()})).optional(),tool_calls:ie(S_).optional(),tool_call_id:v().optional()}),pE=C({enabled:Be(),engine:nt(["native","exa"]).optional(),maxResults:Q().min(1).max(10).optional(),searchPrompt:v().optional()}),mE=C({enabled:Be(),pdf:C({engine:nt(["pdf-text","mistral-ocr","native"]).optional()}).optional()});C({model:v(),messages:ie(fE),temperature:Q().min(0).max(2).optional(),maxTokens:Q().positive().optional(),topP:Q().min(0).max(1).optional(),stream:Be().optional(),webSearch:pE.optional(),fileParser:mE.optional(),thinking:Be().optional(),tools:ie(dE).optional(),toolChoice:hE.optional(),parallelToolCalls:Be().optional()});const gE=C({type:Ye("url_citation"),urlCitation:C({url:v(),title:v().optional(),content:v().optional(),startIndex:Q().optional(),endIndex:Q().optional()})}),yE=C({type:Ye("file"),file:C({filename:v(),parsedContent:v().optional(),metadata:_t(Jt()).optional()})}),vE=zn([gE,yE]);C({text:v(),tool_calls:ie(S_).optional(),annotations:ie(vE).optional(),metadata:C({model:v(),usage:C({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});C({model:v(),input:zn([v(),ie(v())]),encoding_format:nt(["float","base64"]).optional(),dimensions:Q().int().min(0).optional()});const bE=C({object:Ye("embedding"),embedding:zn([ie(Q()),v()]),index:Q()});C({object:Ye("list"),data:ie(bE),metadata:C({model:v(),usage:C({promptTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});C({model:v(),prompt:v(),images:ie(C({url:v()})).optional()});C({text:v().optional(),images:ie(C({type:Ye("imageUrl"),imageUrl:v()})),metadata:C({model:v(),usage:C({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});C({id:v(),inputModality:ie(ds).min(1),outputModality:ie(ds).min(1),provider:v(),modelId:v(),inputPrice:Q().min(0).optional(),outputPrice:Q().min(0).optional()});x_.omit({id:!0});C({systemPrompt:v().nullable()});C({records:ie(aE),total:Q()});C({startDate:v().datetime().optional(),endDate:v().datetime().optional(),limit:v().regex(/^\d+$/).default("50"),offset:v().regex(/^\d+$/).default("0")});C({configId:v().uuid().optional(),startDate:v().datetime().optional(),endDate:v().datetime().optional()});const _E=nt(["byok","cloud","env","unconfigured"]);C({keySource:_E,hasByokKey:Be(),maskedKey:v().optional()});C({apiKey:v().min(1,"API key is required")});const P_=C({id:v(),actor:v(),action:v(),module:v(),details:_t(Jt()).nullable(),ipAddress:v().nullable(),createdAt:v(),updatedAt:v()});C({id:v(),name:v(),token:v()});const kE=C({id:v(),eventMessage:v(),timestamp:v(),body:_t(v(),Jt()),source:v().optional()});C({source:v(),count:Q(),lastActivity:v()});const wE=C({level:v(),message:v()});C({deploymentId:v(),status:nt(["pending","success","failed"]),logs:ie(wE),createdAt:v()});C({limit:Q().default(100),offset:Q().default(0),actor:v().optional(),action:v().optional(),module:v().optional(),startDate:v().optional(),endDate:v().optional()});C({data:ie(P_),pagination:C({limit:Q(),offset:Q(),total:Q()})});C({days:Q().default(7)});C({totalLogs:Q(),uniqueActors:Q(),uniqueModules:Q(),actionsByModule:_t(Q()),recentActivity:ie(P_)});C({daysToKeep:Q().default(90)});C({message:v(),deleted:Q()});C({logs:ie(kE),total:Q()});const T_=C({id:v(),slug:v(),name:v(),description:v().nullable(),code:v(),status:nt(["draft","active","error"]),createdAt:v(),updatedAt:v(),deployedAt:v().nullable()});C({name:v().min(1,"Name is required"),slug:v().regex(/^[a-zA-Z0-9_-]+$/,"Invalid slug format - must be alphanumeric with hyphens or underscores only").optional(),code:v().min(1),description:v().optional(),status:nt(["draft","active"]).optional().default("active")});C({name:v().optional(),code:v().optional(),description:v().optional(),status:nt(["draft","active"]).optional()});C({functions:ie(T_),runtime:C({status:nt(["running","unavailable"])}),deploymentUrl:v().nullable().optional()});const xE=C({id:v(),status:nt(["success","failed"]),url:v().nullable(),buildLogs:ie(v()).optional()});C({success:Be(),function:T_,deployment:xE.nullable().optional()});const SE=C({type:Ye("APP_ROUTE_CHANGE"),path:v()}),PE=C({type:Ye("AUTH_SUCCESS")}),TE=C({type:Ye("AUTH_ERROR"),message:v()}),CE=C({type:Ye("MCP_CONNECTION_STATUS"),connected:Be(),toolName:v(),timestamp:zn([Q(),v()])}),EE=C({type:Ye("SHOW_ONBOARDING_OVERLAY")}),AE=C({type:Ye("SHOW_SETTINGS_OVERLAY")}),RE=C({type:Ye("ONBOARDING_SUCCESS")}),LE=C({type:Ye("NAVIGATE_TO_USAGE")}),DE=C({type:Ye("SHOW_CONTACT_MODAL")}),ME=C({type:Ye("SHOW_CONNECT_OVERLAY")}),NE=C({type:Ye("SHOW_PLAN_MODAL")}),OE=C({type:Ye("AUTHORIZATION_CODE"),code:v()}),IE=C({type:Ye("ROUTE_CHANGE"),path:v()}),jE=C({type:Ye("REQUEST_PROJECT_INFO")}),UE=C({type:Ye("PROJECT_INFO"),name:v(),instanceType:v(),region:v(),latestVersion:v().optional()}),BE=C({type:Ye("REQUEST_INSTANCE_INFO")}),FE=C({type:Ye("INSTANCE_INFO"),currentInstanceType:v(),planName:v(),computeCredits:Q(),currentOrgComputeCost:Q(),instanceTypes:ie(C({id:v(),name:v(),cpu:v(),ram:v(),pricePerHour:Q(),pricePerMonth:Q()})),projects:ie(C({name:v(),instanceType:v(),monthlyCost:Q(),isCurrent:Be(),status:v()}))}),VE=C({type:Ye("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:v()}),zE=C({type:Ye("INSTANCE_TYPE_CHANGE_RESULT"),success:Be(),instanceType:v().optional(),error:v().optional()});f_("type",[SE,PE,TE,CE,EE,AE,RE,LE,DE,ME,NE,OE,IE,jE,UE,BE,FE,VE,zE]);nt(["db","storage","functions","auth","ai","realtime"]).describe(`
13
+ SDK feature categories:
14
+
15
+ - "db" - Database operations
16
+ - "storage" - File storage
17
+ - "functions" - Edge functions
18
+ - "auth" - User authentication
19
+ - "ai" - AI features
20
+ - "realtime" - Real-time WebSockets
21
+ `);nt(["typescript","swift","kotlin","rest-api"]).describe(`
22
+ SDK languages:
23
+
24
+ - "typescript" - JavaScript/TypeScript SDK
25
+ - "swift" - Swift SDK
26
+ - "kotlin" - Kotlin SDK
27
+ - "rest-api" - REST API
28
+ `);nt(["instructions","auth-sdk","db-sdk","storage-sdk","functions-sdk","ai-integration-sdk","real-time","deployment"]).describe(`
29
+ Documentation type:
30
+ "instructions" (essential backend setup - use FIRST),
31
+ "db-sdk" (database operations),
32
+ "storage-sdk" (file storage),
33
+ "functions-sdk" (edge functions),
34
+ "auth-sdk" (direct SDK methods for custom auth flows),
35
+ "ai-integration-sdk" (AI features),
36
+ "real-time" (real-time pub/sub through WebSockets),
37
+ "deployment" (deploy frontend applications via MCP tool)
38
+ `);const Th=zn([kr,ie(kr).min(1,"At least one email is required").max(50,"Maximum 50 recipients allowed")]);C({to:Th,subject:v().trim().min(1,"Subject is required").max(500,"Subject too long"),html:v().trim().min(1,"HTML content is required"),cc:Th.optional(),bcc:Th.optional(),from:v().trim().max(100,"From name too long").optional(),replyTo:v().email("Reply-To must be a valid email").optional()});C({});const $E=nt(["WAITING","UPLOADING","QUEUED","BUILDING","READY","ERROR","CANCELED"]),HE=C({id:v().uuid(),providerDeploymentId:v().nullable(),provider:v(),status:$E,url:v().nullable(),metadata:_t(Jt()).nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),WE=C({buildCommand:v().nullable().optional(),outputDirectory:v().nullable().optional(),installCommand:v().nullable().optional(),devCommand:v().nullable().optional(),rootDirectory:v().nullable().optional()}),KE=C({key:v(),value:v()});C({id:v().uuid(),uploadUrl:v().url(),uploadFields:_t(v())});C({projectSettings:WE.optional(),envVars:ie(KE).optional(),meta:_t(v()).optional()});C({data:ie(HE),pagination:C({limit:Q(),offset:Q(),total:Q()})});const GE=C({id:v(),key:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()}),qE=C({id:v(),key:v(),value:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()});C({envVars:ie(GE)});C({envVar:qE});const YE=C({key:v().trim().min(1,"key is required"),value:v()});C({envVars:ie(YE).min(1)}).superRefine(({envVars:e},t)=>{const n=new Map;e.forEach((a,s)=>{if(n.get(a.key)!==void 0){t.addIssue({code:re.custom,message:"duplicate environment variable key",path:["envVars",s,"key"]});return}n.set(a.key,s)})});C({success:Ye(!0),message:v()});C({success:Ye(!0),message:v(),count:Q().int().positive()});C({success:Ye(!0),message:v()});C({slug:v().trim().min(3,"slug must be at least 3 characters").max(63,"slug must be at most 63 characters").regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"slug must be lowercase alphanumeric with hyphens, not starting or ending with hyphen").nullable()});C({success:Be(),slug:v().nullable(),domain:v().nullable()});C({currentDeploymentId:v().uuid().nullable(),defaultDomainUrl:v().nullable(),customDomainUrl:v().nullable()});const ZE=C({type:v(),domain:v(),value:v()}),XE=C({domain:v(),apexDomain:v(),verified:Be(),misconfigured:Be(),verification:ie(ZE),cnameTarget:v().nullable(),aRecordValue:v().nullable()});C({domain:v().trim().min(1,"Domain is required").regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/i,"Invalid domain format (e.g. myapp.com or www.myapp.com)").refine(e=>!e.toLowerCase().endsWith(".insforge.site"),{message:"Domains ending with .insforge.site are reserved by InsForge"})});C({domains:ie(XE)});const QE=C({id:v().uuid(),name:v(),cronSchedule:v(),functionUrl:v().url(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).nullable(),body:zn([v(),_t(Jt())]).nullable(),cronJobId:v().nullable(),lastExecutedAt:v().datetime().nullable(),isActive:Be().default(!0),nextRun:v().datetime().nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),JE=C({id:v().uuid(),scheduleId:v().uuid(),executedAt:v().datetime(),statusCode:Q().int(),success:Be(),durationMs:Q().int(),message:v().nullable()}),C_=v().refine(e=>{const t=e.split(" ");return t.length===5||t.length===6},{message:'Invalid cron schedule format. Use 5 or 6 parts (e.g., "* * * * *").'});C({name:v().min(3,"Schedule name must be at least 3 characters long"),cronSchedule:C_,functionUrl:v().url("The function URL must be a valid URL."),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request.")});C({name:v().min(3,"Schedule name must be at least 3 characters long").optional(),cronSchedule:C_.optional(),functionUrl:v().url("The function URL must be a valid URL.").optional(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]).optional(),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request."),isActive:Be().optional().describe("Enable or disable the schedule.")});ie(QE);const eA=JE;C({logs:ie(eA),totalCount:Q().int().nonnegative(),limit:Q().int().positive(),offset:Q().int().nonnegative()});C({id:v().uuid(),cronJobId:v(),message:v()});C({id:v().uuid(),cronJobId:v().optional(),message:v()});C({message:v()});var zt={},qi={},Yi={},Zi={},Xi={},Qi={},tA=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},hs=tA();const nA=hs.fetch,rA=hs.fetch.bind(hs),aA=hs.Headers,iA=hs.Request,sA=hs.Response,oA=Object.freeze(Object.defineProperty({__proto__:null,Headers:aA,Request:iA,Response:sA,default:rA,fetch:nA},Symbol.toStringTag,{value:"Module"})),lA=wP(oA);var hc={},Rv;function E_(){if(Rv)return hc;Rv=1,Object.defineProperty(hc,"__esModule",{value:!0});class e extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.code=n.code}}return hc.default=e,hc}var Lv;function A_(){if(Lv)return Qi;Lv=1;var e=Qi&&Qi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Qi,"__esModule",{value:!0});const t=e(lA),n=e(E_());class a{constructor(o){var c,u;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(c=o.shouldThrowOnError)!==null&&c!==void 0?c:!1,this.signal=o.signal,this.isMaybeSingle=(u=o.isMaybeSingle)!==null&&u!==void 0?u:!1,o.fetch?this.fetch=o.fetch:typeof fetch>"u"?this.fetch=t.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,c){return this.headers=new Headers(this.headers),this.headers.set(o,c),this}then(o,c){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const u=this.fetch;let h=u(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async f=>{var m,y,b,w;let x=null,T=null,P=null,D=f.status,R=f.statusText;if(f.ok){if(this.method!=="HEAD"){const K=await f.text();K===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((m=this.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?T=K:T=JSON.parse(K))}const j=(y=this.headers.get("Prefer"))===null||y===void 0?void 0:y.match(/count=(exact|planned|estimated)/),G=(b=f.headers.get("content-range"))===null||b===void 0?void 0:b.split("/");j&&G&&G.length>1&&(P=parseInt(G[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(T)&&(T.length>1?(x={code:"PGRST116",details:`Results contain ${T.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},T=null,P=null,D=406,R="Not Acceptable"):T.length===1?T=T[0]:T=null)}else{const j=await f.text();try{x=JSON.parse(j),Array.isArray(x)&&f.status===404&&(T=[],x=null,D=200,R="OK")}catch{f.status===404&&j===""?(D=204,R="No Content"):x={message:j}}if(x&&this.isMaybeSingle&&(!((w=x?.details)===null||w===void 0)&&w.includes("0 rows"))&&(x=null,D=200,R="OK"),x&&this.shouldThrowOnError)throw new n.default(x)}return{error:x,data:T,count:P,status:D,statusText:R}});return this.shouldThrowOnError||(h=h.catch(f=>{var m,y,b;return{error:{message:`${(m=f?.name)!==null&&m!==void 0?m:"FetchError"}: ${f?.message}`,details:`${(y=f?.stack)!==null&&y!==void 0?y:""}`,hint:"",code:`${(b=f?.code)!==null&&b!==void 0?b:""}`},data:null,count:null,status:0,statusText:""}})),h.then(o,c)}returns(){return this}overrideTypes(){return this}}return Qi.default=a,Qi}var Dv;function R_(){if(Dv)return Xi;Dv=1;var e=Xi&&Xi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Xi,"__esModule",{value:!0});const t=e(A_());class n extends t.default{select(s){let o=!1;const c=(s??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join("");return this.url.searchParams.set("select",c),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:o=!0,nullsFirst:c,foreignTable:u,referencedTable:h=u}={}){const f=h?`${h}.order`:"order",m=this.url.searchParams.get(f);return this.url.searchParams.set(f,`${m?`${m},`:""}${s}.${o?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:o,referencedTable:c=o}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${s}`),this}range(s,o,{foreignTable:c,referencedTable:u=c}={}){const h=typeof u>"u"?"offset":`${u}.offset`,f=typeof u>"u"?"limit":`${u}.limit`;return this.url.searchParams.set(h,`${s}`),this.url.searchParams.set(f,`${o-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:s=!1,verbose:o=!1,settings:c=!1,buffers:u=!1,wal:h=!1,format:f="text"}={}){var m;const y=[s?"analyze":null,o?"verbose":null,c?"settings":null,u?"buffers":null,h?"wal":null].filter(Boolean).join("|"),b=(m=this.headers.get("Accept"))!==null&&m!==void 0?m:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${f}; for="${b}"; options=${y};`),f==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return Xi.default=n,Xi}var Mv;function mp(){if(Mv)return Zi;Mv=1;var e=Zi&&Zi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zi,"__esModule",{value:!0});const t=e(R_());class n extends t.default{eq(s,o){return this.url.searchParams.append(s,`eq.${o}`),this}neq(s,o){return this.url.searchParams.append(s,`neq.${o}`),this}gt(s,o){return this.url.searchParams.append(s,`gt.${o}`),this}gte(s,o){return this.url.searchParams.append(s,`gte.${o}`),this}lt(s,o){return this.url.searchParams.append(s,`lt.${o}`),this}lte(s,o){return this.url.searchParams.append(s,`lte.${o}`),this}like(s,o){return this.url.searchParams.append(s,`like.${o}`),this}likeAllOf(s,o){return this.url.searchParams.append(s,`like(all).{${o.join(",")}}`),this}likeAnyOf(s,o){return this.url.searchParams.append(s,`like(any).{${o.join(",")}}`),this}ilike(s,o){return this.url.searchParams.append(s,`ilike.${o}`),this}ilikeAllOf(s,o){return this.url.searchParams.append(s,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(s,o){return this.url.searchParams.append(s,`ilike(any).{${o.join(",")}}`),this}is(s,o){return this.url.searchParams.append(s,`is.${o}`),this}in(s,o){const c=Array.from(new Set(o)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(s,`in.(${c})`),this}contains(s,o){return typeof o=="string"?this.url.searchParams.append(s,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(s,`cs.{${o.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(o)}`),this}containedBy(s,o){return typeof o=="string"?this.url.searchParams.append(s,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(s,`cd.{${o.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(o)}`),this}rangeGt(s,o){return this.url.searchParams.append(s,`sr.${o}`),this}rangeGte(s,o){return this.url.searchParams.append(s,`nxl.${o}`),this}rangeLt(s,o){return this.url.searchParams.append(s,`sl.${o}`),this}rangeLte(s,o){return this.url.searchParams.append(s,`nxr.${o}`),this}rangeAdjacent(s,o){return this.url.searchParams.append(s,`adj.${o}`),this}overlaps(s,o){return typeof o=="string"?this.url.searchParams.append(s,`ov.${o}`):this.url.searchParams.append(s,`ov.{${o.join(",")}}`),this}textSearch(s,o,{config:c,type:u}={}){let h="";u==="plain"?h="pl":u==="phrase"?h="ph":u==="websearch"&&(h="w");const f=c===void 0?"":`(${c})`;return this.url.searchParams.append(s,`${h}fts${f}.${o}`),this}match(s){return Object.entries(s).forEach(([o,c])=>{this.url.searchParams.append(o,`eq.${c}`)}),this}not(s,o,c){return this.url.searchParams.append(s,`not.${o}.${c}`),this}or(s,{foreignTable:o,referencedTable:c=o}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${s})`),this}filter(s,o,c){return this.url.searchParams.append(s,`${o}.${c}`),this}}return Zi.default=n,Zi}var Nv;function L_(){if(Nv)return Yi;Nv=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0});const t=e(mp());class n{constructor(s,{headers:o={},schema:c,fetch:u}){this.url=s,this.headers=new Headers(o),this.schema=c,this.fetch=u}select(s,{head:o=!1,count:c}={}){const u=o?"HEAD":"GET";let h=!1;const f=(s??"*").split("").map(m=>/\s/.test(m)&&!h?"":(m==='"'&&(h=!h),m)).join("");return this.url.searchParams.set("select",f),c&&this.headers.append("Prefer",`count=${c}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:o,defaultToNull:c=!0}={}){var u;const h="POST";if(o&&this.headers.append("Prefer",`count=${o}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const f=s.reduce((m,y)=>m.concat(Object.keys(y)),[]);if(f.length>0){const m=[...new Set(f)].map(y=>`"${y}"`);this.url.searchParams.set("columns",m.join(","))}}return new t.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}upsert(s,{onConflict:o,ignoreDuplicates:c=!1,count:u,defaultToNull:h=!0}={}){var f;const m="POST";if(this.headers.append("Prefer",`resolution=${c?"ignore":"merge"}-duplicates`),o!==void 0&&this.url.searchParams.set("on_conflict",o),u&&this.headers.append("Prefer",`count=${u}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const y=s.reduce((b,w)=>b.concat(Object.keys(w)),[]);if(y.length>0){const b=[...new Set(y)].map(w=>`"${w}"`);this.url.searchParams.set("columns",b.join(","))}}return new t.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}update(s,{count:o}={}){var c;const u="PATCH";return o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}delete({count:s}={}){var o;const c="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}}return Yi.default=n,Yi}var Ov;function cA(){if(Ov)return qi;Ov=1;var e=qi&&qi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(qi,"__esModule",{value:!0});const t=e(L_()),n=e(mp());class a{constructor(o,{headers:c={},schema:u,fetch:h}={}){this.url=o,this.headers=new Headers(c),this.schemaName=u,this.fetch=h}from(o){const c=new URL(`${this.url}/${o}`);return new t.default(c,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new a(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,c={},{head:u=!1,get:h=!1,count:f}={}){var m;let y;const b=new URL(`${this.url}/rpc/${o}`);let w;u||h?(y=u?"HEAD":"GET",Object.entries(c).filter(([T,P])=>P!==void 0).map(([T,P])=>[T,Array.isArray(P)?`{${P.join(",")}}`:`${P}`]).forEach(([T,P])=>{b.searchParams.append(T,P)})):(y="POST",w=c);const x=new Headers(this.headers);return f&&x.set("Prefer",`count=${f}`),new n.default({method:y,url:b,headers:x,schema:this.schemaName,body:w,fetch:(m=this.fetch)!==null&&m!==void 0?m:fetch})}}return qi.default=a,qi}var Iv;function uA(){if(Iv)return zt;Iv=1;var e=zt&&zt.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(zt,"__esModule",{value:!0}),zt.PostgrestError=zt.PostgrestBuilder=zt.PostgrestTransformBuilder=zt.PostgrestFilterBuilder=zt.PostgrestQueryBuilder=zt.PostgrestClient=void 0;const t=e(cA());zt.PostgrestClient=t.default;const n=e(L_());zt.PostgrestQueryBuilder=n.default;const a=e(mp());zt.PostgrestFilterBuilder=a.default;const s=e(R_());zt.PostgrestTransformBuilder=s.default;const o=e(A_());zt.PostgrestBuilder=o.default;const c=e(E_());return zt.PostgrestError=c.default,zt.default={PostgrestClient:t.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:o.default,PostgrestError:c.default},zt}var dA=uA();const hA=R0(dA),{PostgrestClient:fA,PostgrestQueryBuilder:Jj,PostgrestFilterBuilder:e4,PostgrestTransformBuilder:t4,PostgrestBuilder:n4,PostgrestError:r4}=hA,wr=Object.create(null);wr.open="0";wr.close="1";wr.ping="2";wr.pong="3";wr.message="4";wr.upgrade="5";wr.noop="6";const Cc=Object.create(null);Object.keys(wr).forEach(e=>{Cc[wr[e]]=e});const ff={type:"error",data:"parser error"},D_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",M_=typeof ArrayBuffer=="function",N_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,gp=({type:e,data:t},n,a)=>D_&&t instanceof Blob?n?a(t):jv(t,a):M_&&(t instanceof ArrayBuffer||N_(t))?n?a(t):jv(new Blob([t]),a):a(wr[e]+(t||"")),jv=(e,t)=>{const n=new FileReader;return n.onload=function(){const a=n.result.split(",")[1];t("b"+(a||""))},n.readAsDataURL(e)};function Uv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ch;function pA(e,t){if(D_&&e.data instanceof Blob)return e.data.arrayBuffer().then(Uv).then(t);if(M_&&(e.data instanceof ArrayBuffer||N_(e.data)))return t(Uv(e.data));gp(e,!1,n=>{Ch||(Ch=new TextEncoder),t(Ch.encode(n))})}const Bv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Bv.length;e++)bo[Bv.charCodeAt(e)]=e;const mA=e=>{let t=e.length*.75,n=e.length,a,s=0,o,c,u,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(a=0;a<n;a+=4)o=bo[e.charCodeAt(a)],c=bo[e.charCodeAt(a+1)],u=bo[e.charCodeAt(a+2)],h=bo[e.charCodeAt(a+3)],m[s++]=o<<2|c>>4,m[s++]=(c&15)<<4|u>>2,m[s++]=(u&3)<<6|h&63;return f},gA=typeof ArrayBuffer=="function",yp=(e,t)=>{if(typeof e!="string")return{type:"message",data:O_(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:yA(e.substring(1),t)}:Cc[n]?e.length>1?{type:Cc[n],data:e.substring(1)}:{type:Cc[n]}:ff},yA=(e,t)=>{if(gA){const n=mA(e);return O_(n,t)}else return{base64:!0,data:e}},O_=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,I_="",vA=(e,t)=>{const n=e.length,a=new Array(n);let s=0;e.forEach((o,c)=>{gp(o,!1,u=>{a[c]=u,++s===n&&t(a.join(I_))})})},bA=(e,t)=>{const n=e.split(I_),a=[];for(let s=0;s<n.length;s++){const o=yp(n[s],t);if(a.push(o),o.type==="error")break}return a};function _A(){return new TransformStream({transform(e,t){pA(e,n=>{const a=n.length;let s;if(a<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,a);else if(a<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,a)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(a))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Eh;function fc(e){return e.reduce((t,n)=>t+n.length,0)}function pc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let a=0;for(let s=0;s<t;s++)n[s]=e[0][a++],a===e[0].length&&(e.shift(),a=0);return e.length&&a<e[0].length&&(e[0]=e[0].slice(a)),n}function kA(e,t){Eh||(Eh=new TextDecoder);const n=[];let a=0,s=-1,o=!1;return new TransformStream({transform(c,u){for(n.push(c);;){if(a===0){if(fc(n)<1)break;const h=pc(n,1);o=(h[0]&128)===128,s=h[0]&127,s<126?a=3:s===126?a=1:a=2}else if(a===1){if(fc(n)<2)break;const h=pc(n,2);s=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),a=3}else if(a===2){if(fc(n)<8)break;const h=pc(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){u.enqueue(ff);break}s=m*Math.pow(2,32)+f.getUint32(4),a=3}else{if(fc(n)<s)break;const h=pc(n,s);u.enqueue(yp(o?h:Eh.decode(h),t)),a=0}if(s===0||s>e){u.enqueue(ff);break}}}})}const j_=4;function Dt(e){if(e)return wA(e)}function wA(e){for(var t in Dt.prototype)e[t]=Dt.prototype[t];return e}Dt.prototype.on=Dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var a,s=0;s<n.length;s++)if(a=n[s],a===t||a.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(n){n=n.slice(0);for(var a=0,s=n.length;a<s;++a)n[a].apply(this,t)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Su=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),On=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),xA="arraybuffer";function U_(e,...t){return t.reduce((n,a)=>(e.hasOwnProperty(a)&&(n[a]=e[a]),n),{})}const SA=On.setTimeout,PA=On.clearTimeout;function Pu(e,t){t.useNativeTimers?(e.setTimeoutFn=SA.bind(On),e.clearTimeoutFn=PA.bind(On)):(e.setTimeoutFn=On.setTimeout.bind(On),e.clearTimeoutFn=On.clearTimeout.bind(On))}const TA=1.33;function CA(e){return typeof e=="string"?EA(e):Math.ceil((e.byteLength||e.size)*TA)}function EA(e){let t=0,n=0;for(let a=0,s=e.length;a<s;a++)t=e.charCodeAt(a),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(a++,n+=4);return n}function B_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function AA(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function RA(e){let t={},n=e.split("&");for(let a=0,s=n.length;a<s;a++){let o=n[a].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class LA extends Error{constructor(t,n,a){super(t),this.description=n,this.context=a,this.type="TransportError"}}class vp extends Dt{constructor(t){super(),this.writable=!1,Pu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,a){return super.emitReserved("error",new LA(t,n,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=yp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=AA(t);return n.length?"?"+n:""}}class DA extends vp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||n()})),this.writable||(a++,this.once("drain",function(){--a||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};bA(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,vA(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=B_()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let F_=!1;try{F_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const MA=F_;function NA(){}class OA extends DA{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let a=location.port;a||(a=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||a!==t.port}}doWrite(t,n){const a=this.request({method:"POST",data:t});a.on("success",n),a.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,a)=>{this.onError("xhr poll error",n,a)}),this.pollXhr=t}}let ls=class Ec extends Dt{constructor(t,n,a){super(),this.createRequest=t,Pu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=n,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var t;const n=U_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(n);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Ec.requestsCount++,Ec.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=NA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ec.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ls.requestsCount=0;ls.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Fv);else if(typeof addEventListener=="function"){const e="onpagehide"in On?"pagehide":"unload";addEventListener(e,Fv,!1)}}function Fv(){for(let e in ls.requests)ls.requests.hasOwnProperty(e)&&ls.requests[e].abort()}const IA=(function(){const e=V_({xdomain:!1});return e&&e.responseType!==null})();class jA extends OA{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=IA&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ls(V_,this.uri(),t)}}function V_(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||MA))return new XMLHttpRequest}catch{}if(!t)try{return new On[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const z_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class UA extends vp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,a=z_?{}:U_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],s=n===t.length-1;gp(a,this.supportsBinary,o=>{try{this.doWrite(a,o)}catch{}s&&Su(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=B_()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ah=On.WebSocket||On.MozWebSocket;class BA extends UA{createSocket(t,n,a){return z_?new Ah(t,n,a):n?new Ah(t,n):new Ah(t)}doWrite(t,n){this.ws.send(n)}}class FA extends vp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=kA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=t.readable.pipeThrough(n).getReader(),s=_A();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{a.read().then(({done:u,value:h})=>{u||(this.onPacket(h),o())}).catch(u=>{})};o();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],s=n===t.length-1;this._writer.write(a).then(()=>{s&&Su(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const VA={websocket:BA,webtransport:FA,polling:jA},zA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$A=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function pf(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),a=e.indexOf("]");n!=-1&&a!=-1&&(e=e.substring(0,n)+e.substring(n,a).replace(/:/g,";")+e.substring(a,e.length));let s=zA.exec(e||""),o={},c=14;for(;c--;)o[$A[c]]=s[c]||"";return n!=-1&&a!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=HA(o,o.path),o.queryKey=WA(o,o.query),o}function HA(e,t){const n=/\/{2,9}/g,a=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&a.splice(0,1),t.slice(-1)=="/"&&a.splice(a.length-1,1),a}function WA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,o){s&&(n[s]=o)}),n}const mf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ac=[];mf&&addEventListener("offline",()=>{Ac.forEach(e=>e())},!1);class La extends Dt{constructor(t,n){if(super(),this.binaryType=xA,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const a=pf(t);n.hostname=a.host,n.secure=a.protocol==="https"||a.protocol==="wss",n.port=a.port,a.query&&(n.query=a.query)}else n.host&&(n.hostname=pf(n.host).host);Pu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(a=>{const s=a.prototype.name;this.transports.push(s),this._transportsByName[s]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=RA(this.opts.query)),mf&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ac.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=j_,n.transport=t,this.id&&(n.sid=this.id);const a=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&La.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",La.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(n+=CA(s)),a>0&&n>this._maxPayload)return this.writeBuffer.slice(0,a);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Su(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,a){return this._sendPacket("message",t,n,a),this}send(t,n,a){return this._sendPacket("message",t,n,a),this}_sendPacket(t,n,a,s){if(typeof n=="function"&&(s=n,n=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const o={type:t,data:n,options:a};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},a=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():t()}):this.upgrading?a():t()),this}_onError(t){if(La.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),mf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Ac.indexOf(this._offlineEventListener);a!==-1&&Ac.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}La.protocol=j_;class KA extends La{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),a=!1;La.priorWebsocketSuccess=!1;const s=()=>{a||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!a)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;La.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=n.name,this.emitReserved("upgradeError",b)}}))};function o(){a||(a=!0,m(),n.close(),n=null)}const c=y=>{const b=new Error("probe error: "+y);b.transport=n.name,o(),this.emitReserved("upgradeError",b)};function u(){c("transport closed")}function h(){c("socket closed")}function f(y){n&&y.name!==n.name&&o()}const m=()=>{n.removeListener("open",s),n.removeListener("error",c),n.removeListener("close",u),this.off("close",h),this.off("upgrading",f)};n.once("open",s),n.once("error",c),n.once("close",u),this.once("close",h),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{a||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let a=0;a<t.length;a++)~this.transports.indexOf(t[a])&&n.push(t[a]);return n}}let GA=class extends KA{constructor(t,n={}){const a=typeof t=="object"?t:n;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(s=>VA[s]).filter(s=>!!s)),super(t,a)}};function qA(e,t="",n){let a=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),a=pf(e)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const o=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+o+":"+a.port+t,a.href=a.protocol+"://"+o+(n&&n.port===a.port?"":":"+a.port),a}const YA=typeof ArrayBuffer=="function",ZA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,$_=Object.prototype.toString,XA=typeof Blob=="function"||typeof Blob<"u"&&$_.call(Blob)==="[object BlobConstructor]",QA=typeof File=="function"||typeof File<"u"&&$_.call(File)==="[object FileConstructor]";function bp(e){return YA&&(e instanceof ArrayBuffer||ZA(e))||XA&&e instanceof Blob||QA&&e instanceof File}function Rc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,a=e.length;n<a;n++)if(Rc(e[n]))return!0;return!1}if(bp(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Rc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Rc(e[n]))return!0;return!1}function JA(e){const t=[],n=e.data,a=e;return a.data=gf(n,t),a.attachments=t.length,{packet:a,buffers:t}}function gf(e,t){if(!e)return e;if(bp(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let a=0;a<e.length;a++)n[a]=gf(e[a],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=gf(e[a],t));return n}return e}function eR(e,t){return e.data=yf(e.data,t),delete e.attachments,e}function yf(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=yf(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=yf(e[n],t));return e}const tR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var tt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(tt||(tt={}));class nR{constructor(t){this.replacer=t}encode(t){return(t.type===tt.EVENT||t.type===tt.ACK)&&Rc(t)?this.encodeAsBinary({type:t.type===tt.EVENT?tt.BINARY_EVENT:tt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===tt.BINARY_EVENT||t.type===tt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=JA(t),a=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(a),s}}class _p extends Dt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const a=n.type===tt.BINARY_EVENT;a||n.type===tt.BINARY_ACK?(n.type=a?tt.EVENT:tt.ACK,this.reconstructor=new rR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bp(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const a={type:Number(t.charAt(0))};if(tt[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===tt.BINARY_EVENT||a.type===tt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(o,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(c);if(!aR(u)||u<0)throw new Error("Illegal attachments");if(u>this.opts.maxAttachments)throw new Error("too many attachments");a.attachments=u}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););a.nsp=t.substring(o,n)}else a.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}a.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(_p.isPayloadValid(a.type,o))a.data=o;else throw new Error("invalid payload")}return a}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case tt.CONNECT:return Vv(n);case tt.DISCONNECT:return n===void 0;case tt.CONNECT_ERROR:return typeof n=="string"||Vv(n);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tR.indexOf(n[0])===-1);case tt.ACK:case tt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rR{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eR(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const aR=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Vv(e){return Object.prototype.toString.call(e)==="[object Object]"}const iR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:_p,Encoder:nR,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function rr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const sR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class H_ extends Dt{constructor(t,n,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[rr(t,"open",this.onopen.bind(this)),rr(t,"packet",this.onpacket.bind(this)),rr(t,"error",this.onerror.bind(this)),rr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var a,s,o;if(sR.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:tt.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,y=n.pop();this._registerAckCallback(m,y),c.id=m}const u=(s=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||s===void 0?void 0:s.writable,h=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!u||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},s),c=(...u)=>{this.io.clearTimeoutFn(o),n.apply(this,u)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((a,s)=>{const o=(c,u)=>c?s(c):a(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(a=>String(a.id)===t)){const a=this.acks[t];delete this.acks[t],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tt.EVENT:case tt.BINARY_EVENT:this.onevent(t);break;case tt.ACK:case tt.BINARY_ACK:this.onack(t);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const a=new Error(t.data.message);a.data=t.data.data,this.emitReserved("connect_error",a);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const a of n)a.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let a=!1;return function(...s){a||(a=!0,n.packet({type:tt.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const a of n)a.apply(this,t.data)}}}function vs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};vs.prototype.reset=function(){this.attempts=0};vs.prototype.setMin=function(e){this.ms=e};vs.prototype.setMax=function(e){this.max=e};vs.prototype.setJitter=function(e){this.jitter=e};class vf extends Dt{constructor(t,n){var a;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Pu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((a=n.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||iR;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new GA(this.uri,this.opts);const n=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=rr(n,"open",function(){a.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},c=rr(n,"error",o);if(this._timeout!==!1){const u=this._timeout,h=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(s),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(rr(t,"ping",this.onping.bind(this)),rr(t,"data",this.ondata.bind(this)),rr(t,"error",this.onerror.bind(this)),rr(t,"close",this.onclose.bind(this)),rr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Su(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let a=this.nsps[t];return a?this._autoConnect&&!a.active&&a.connect():(a=new H_(this,t,n),this.nsps[t]=a),a}_destroy(t){const n=Object.keys(this.nsps);for(const a of n)if(this.nsps[a].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let a=0;a<n.length;a++)this.engine.write(n[a],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fo={};function Lc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=qA(e,t.path||"/socket.io"),a=n.source,s=n.id,o=n.path,c=fo[s]&&o in fo[s].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return u?h=new vf(a,t):(fo[s]||(fo[s]=new vf(a,t)),h=fo[s]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Lc,{Manager:vf,Socket:H_,io:Lc,connect:Lc});var We=class W_ extends Error{constructor(t,n,a,s){super(t),this.name="InsForgeError",this.statusCode=n,this.error=a,this.nextActions=s}static fromApiError(t){return new W_(t.message,t.statusCode,t.error,t.nextActions)}},oR=["authorization","x-api-key","cookie","set-cookie"],lR=["password","token","accesstoken","refreshtoken","authorization","secret","apikey","api_key","email","ssn","creditcard","credit_card"];function cR(e){const t={};for(const[n,a]of Object.entries(e))oR.includes(n.toLowerCase())?t[n]="***REDACTED***":t[n]=a;return t}function wo(e){if(e==null)return e;if(typeof e=="string")try{const t=JSON.parse(e);return wo(t)}catch{return e}if(Array.isArray(e))return e.map(wo);if(typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))lR.includes(n.toLowerCase().replace(/[-_]/g,""))?t[n]="***REDACTED***":t[n]=wo(a);return t}return e}function zv(e){if(e==null)return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}if(typeof FormData<"u"&&e instanceof FormData)return"[FormData]";try{return JSON.stringify(e,null,2)}catch{return"[Unserializable body]"}}var K_=class{constructor(e){typeof e=="function"?(this.enabled=!0,this.customLog=e):(this.enabled=!!e,this.customLog=null)}log(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.log(n,...t)}warn(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.warn(n,...t)}error(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.error(n,...t)}logRequest(e,t,n,a){if(!this.enabled)return;const s=[`→ ${e} ${t}`];n&&Object.keys(n).length>0&&s.push(` Headers: ${JSON.stringify(cR(n))}`);const o=zv(wo(a));if(o){const c=o.length>1e3?o.slice(0,1e3)+"... [truncated]":o;s.push(` Body: ${c}`)}this.log(s.join(`
39
+ `))}logResponse(e,t,n,a,s){if(!this.enabled)return;const o=[`← ${e} ${t} ${n} (${a}ms)`],c=zv(wo(s));if(c){const u=c.length>1e3?c.slice(0,1e3)+"... [truncated]":c;o.push(` Body: ${u}`)}n>=400?this.error(o.join(`
40
+ `)):this.log(o.join(`
41
+ `))}},kp="insforge_csrf_token";function G_(){if(typeof document>"u")return null;const e=document.cookie.split(";").find(t=>t.trim().startsWith(`${kp}=`));return e&&e.split("=")[1]||null}function q_(e){if(typeof document>"u")return;const t=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${kp}=${encodeURIComponent(e)}; path=/; max-age=${t}; SameSite=Lax${n}`}function Y_(){if(typeof document>"u")return;const e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${kp}=; path=/; max-age=0; SameSite=Lax${e}`}var Z_=class{constructor(){this.accessToken=null,this.user=null,this.onTokenChange=null}saveSession(e){const t=e.accessToken!==this.accessToken;this.accessToken=e.accessToken,this.user=e.user,t&&this.onTokenChange&&this.onTokenChange()}getSession(){return!this.accessToken||!this.user?null:{accessToken:this.accessToken,user:this.user}}getAccessToken(){return this.accessToken}setAccessToken(e){const t=e!==this.accessToken;this.accessToken=e,t&&this.onTokenChange&&this.onTokenChange()}getUser(){return this.user}setUser(e){this.user=e}clearSession(){const e=this.accessToken!==null;this.accessToken=null,this.user=null,e&&this.onTokenChange&&this.onTokenChange()}},uR=new Set([500,502,503,504]),dR=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),hR=class{constructor(e,t,n){if(this.userToken=null,this.autoRefreshToken=!0,this.isRefreshing=!1,this.refreshPromise=null,this.refreshToken=null,this.baseUrl=e.baseUrl||"http://localhost:7130",this.autoRefreshToken=e.autoRefreshToken??!0,this.fetch=e.fetch||(globalThis.fetch?globalThis.fetch.bind(globalThis):void 0),this.anonKey=e.anonKey,this.defaultHeaders={...e.headers},this.tokenManager=t??new Z_,this.logger=n||new K_(!1),this.timeout=e.timeout??3e4,this.retryCount=e.retryCount??3,this.retryDelay=e.retryDelay??500,!this.fetch)throw new Error("Fetch is not available. Please provide a fetch implementation in the config.")}buildUrl(e,t){const n=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([a,s])=>{if(a==="select"){let o=s.replace(/\s+/g," ").trim();o=o.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(a,o)}else n.searchParams.append(a,s)}),n.toString()}isRetryableStatus(e){return uR.has(e)}computeRetryDelay(e){const n=this.retryDelay*Math.pow(2,e-1)*(.85+Math.random()*.3);return Math.round(n)}async handleRequest(e,t,n={}){const{params:a,headers:s={},body:o,signal:c,...u}=n,h=this.buildUrl(t,a),f=Date.now(),y=dR.has(e.toUpperCase())||n.idempotent===!0?this.retryCount:0,b={...this.defaultHeaders},w=this.userToken||this.anonKey;w&&(b.Authorization=`Bearer ${w}`);let x;o!==void 0&&(typeof FormData<"u"&&o instanceof FormData?x=o:(e!=="GET"&&(b["Content-Type"]="application/json;charset=UTF-8"),x=JSON.stringify(o))),s instanceof Headers?s.forEach((P,D)=>{b[D]=P}):Array.isArray(s)?s.forEach(([P,D])=>{b[P]=D}):Object.assign(b,s),this.logger.logRequest(e,h,b,x);let T;for(let P=0;P<=y;P++){if(P>0){const L=this.computeRetryDelay(P);if(this.logger.warn(`Retry ${P}/${y} for ${e} ${h} in ${L}ms`),c?.aborted)throw c.reason;await new Promise((j,G)=>{const K=()=>{clearTimeout(H),G(c.reason)},H=setTimeout(()=>{c&&c.removeEventListener("abort",K),j()},L);c&&c.addEventListener("abort",K,{once:!0})})}let D,R;if((this.timeout>0||c)&&(D=new AbortController,this.timeout>0&&(R=setTimeout(()=>D.abort(),this.timeout)),c))if(c.aborted)D.abort(c.reason);else{const L=()=>D.abort(c.reason);c.addEventListener("abort",L,{once:!0}),D.signal.addEventListener("abort",()=>{c.removeEventListener("abort",L)},{once:!0})}try{const L=await this.fetch(h,{method:e,headers:b,body:x,...u,...D?{signal:D.signal}:{}});if(this.isRetryableStatus(L.status)&&P<y){R!==void 0&&clearTimeout(R),await L.body?.cancel(),T=new We(`Server error: ${L.status} ${L.statusText}`,L.status,"SERVER_ERROR");continue}if(L.status===204){R!==void 0&&clearTimeout(R);return}let j;const G=L.headers.get("content-type");try{G?.includes("json")?j=await L.json():j=await L.text()}catch(K){throw R!==void 0&&clearTimeout(R),new We(`Failed to parse response body: ${K?.message||"Unknown error"}`,L.status,L.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(R!==void 0&&clearTimeout(R),!L.ok){if(this.logger.logResponse(e,h,L.status,Date.now()-f,j),j&&typeof j=="object"&&"error"in j){!j.statusCode&&!j.status&&(j.statusCode=L.status);const K=We.fromApiError(j);throw Object.keys(j).forEach(H=>{H!=="error"&&H!=="message"&&H!=="statusCode"&&(K[H]=j[H])}),K}throw new We(`Request failed: ${L.statusText}`,L.status,"REQUEST_FAILED")}return this.logger.logResponse(e,h,L.status,Date.now()-f,j),j}catch(L){if(R!==void 0&&clearTimeout(R),L?.name==="AbortError")throw D&&D.signal.aborted&&this.timeout>0&&!c?.aborted?new We(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):L;if(L instanceof We)throw L;if(P<y){T=L;continue}throw new We(`Network request failed: ${L?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw T||new We("Request failed after all retry attempts",0,"NETWORK_ERROR")}async request(e,t,n={}){try{return await this.handleRequest(e,t,{...n})}catch(a){if(a instanceof We&&a.statusCode===401&&a.error==="INVALID_TOKEN"&&this.autoRefreshToken)try{const s=await this.handleTokenRefresh();return this.setAuthToken(s.accessToken),this.tokenManager.saveSession(s),s.csrfToken&&q_(s.csrfToken),s.refreshToken&&this.setRefreshToken(s.refreshToken),await this.handleRequest(e,t,{...n})}catch(s){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,Y_(),s}throw a}}get(e,t){return this.request("GET",e,t)}post(e,t,n){return this.request("POST",e,{...n,body:t})}put(e,t,n){return this.request("PUT",e,{...n,body:t})}patch(e,t,n){return this.request("PATCH",e,{...n,body:t})}delete(e,t){return this.request("DELETE",e,t)}setAuthToken(e){this.userToken=e}setRefreshToken(e){this.refreshToken=e}getHeaders(){const e={...this.defaultHeaders},t=this.userToken||this.anonKey;return t&&(e.Authorization=`Bearer ${t}`),e}async handleTokenRefresh(){return this.isRefreshing?this.refreshPromise:(this.isRefreshing=!0,this.refreshPromise=(async()=>{try{const e=G_(),t=this.refreshToken?{refreshToken:this.refreshToken}:void 0;return await this.handleRequest("POST","/api/auth/sessions/current",{body:t,headers:e?{"X-CSRF-Token":e}:{},credentials:"include"})}finally{this.isRefreshing=!1,this.refreshPromise=null}})(),this.refreshPromise)}},bf="insforge_pkce_verifier";function X_(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fR(){const e=new Uint8Array(32);return crypto.getRandomValues(e),X_(e)}async function pR(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",n);return X_(new Uint8Array(a))}function mR(e){typeof sessionStorage<"u"&&sessionStorage.setItem(bf,e)}function gR(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(bf);return e&&sessionStorage.removeItem(bf),e}function wn(e,t){return e instanceof We?{data:null,error:e}:{data:null,error:new We(e instanceof Error?e.message:t,500,"UNEXPECTED_ERROR")}}function $v(...e){if(typeof window>"u")return;const t=new URL(window.location.href);e.forEach(n=>t.searchParams.delete(n)),window.history.replaceState({},document.title,t.toString())}var yR=class{constructor(e,t,n={}){this.http=e,this.tokenManager=t,this.options=n,this.authCallbackHandled=this.detectAuthCallback()}isServerMode(){return!!this.options.isServerMode}saveSessionFromResponse(e){if(!e.accessToken||!e.user)return!1;const t={accessToken:e.accessToken,user:e.user};return!this.isServerMode()&&e.csrfToken&&q_(e.csrfToken),this.isServerMode()||this.tokenManager.saveSession(t),this.http.setAuthToken(e.accessToken),this.http.setRefreshToken(e.refreshToken??null),!0}async detectAuthCallback(){if(!(this.isServerMode()||typeof window>"u"))try{const e=new URLSearchParams(window.location.search),t=e.get("error");if(t){$v("error"),console.debug("OAuth callback error:",t);return}const n=e.get("insforge_code");if(n){$v("insforge_code");const{error:a}=await this.exchangeOAuthCode(n);a&&console.debug("OAuth code exchange failed:",a.message);return}}catch(e){console.debug("OAuth callback detection skipped:",e)}}async signUp(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/users?client_type=mobile":"/api/auth/users",e,{credentials:"include"});return t.accessToken&&t.user&&this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred during sign up")}}async signInWithPassword(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/sessions?client_type=mobile":"/api/auth/sessions",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"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()||Y_(),{error:null}}catch{return{error:new We("Failed to sign out",500,"SIGNOUT_ERROR")}}}async signInWithOAuth(e){try{const{provider:t,redirectTo:n,skipBrowserRedirect:a}=e,s=encodeURIComponent(t.toLowerCase()),o=fR(),c=await pR(o);mR(o);const u={code_challenge:c};n&&(u.redirect_uri=n);const f=xu.options.includes(s)?`/api/auth/oauth/${s}`:`/api/auth/oauth/custom/${s}`,m=await this.http.get(f,{params:u});return!this.isServerMode()&&typeof window<"u"&&!a?(window.location.href=m.authUrl,{data:{},error:null}):{data:{url:m.authUrl,provider:s,codeVerifier:o},error:null}}catch(t){return t instanceof We?{data:{},error:t}:{data:{},error:new We("An unexpected error occurred during OAuth initialization",500,"UNEXPECTED_ERROR")}}}async exchangeOAuthCode(e,t){try{const n=t??gR();if(!n)return{data:null,error:new We("PKCE code verifier not found. Ensure signInWithOAuth was called in the same browser session.",400,"PKCE_VERIFIER_MISSING")};const a={code:e,code_verifier:n},s=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",a,{credentials:"include"});return this.saveSessionFromResponse(s),{data:s,error:null}}catch(n){return wn(n,"An unexpected error occurred during OAuth code exchange")}}async signInWithIdToken(e){try{const{provider:t,token:n}=e,a=await this.http.post("/api/auth/id-token?client_type=mobile",{provider:t,token:n},{credentials:"include"});return this.saveSessionFromResponse(a),a.refreshToken&&this.http.setRefreshToken(a.refreshToken),{data:a,error:null}}catch(t){return wn(t,"An unexpected error occurred during ID token sign in")}}async refreshSession(e){try{if(this.isServerMode()&&!e?.refreshToken)return{data:null,error:new We("refreshToken is required when refreshing session in server mode",400,"REFRESH_TOKEN_REQUIRED")};const t=this.isServerMode()?null:G_(),n=await this.http.post(this.isServerMode()?"/api/auth/refresh?client_type=mobile":"/api/auth/refresh",this.isServerMode()?{refresh_token:e?.refreshToken}:void 0,{headers:t?{"X-CSRF-Token":t}:{},credentials:"include"});return n.accessToken&&this.saveSessionFromResponse(n),{data:n,error:null}}catch(t){return wn(t,"An unexpected error occurred during session refresh")}}async getCurrentUser(){await this.authCallbackHandled;try{if(this.isServerMode()){const t=this.tokenManager.getAccessToken();return t?(this.http.setAuthToken(t),{data:{user:(await this.http.get("/api/auth/sessions/current")).user??null},error:null}):{data:{user:null},error:null}}const e=this.tokenManager.getSession();if(e)return this.http.setAuthToken(e.accessToken),{data:{user:e.user},error:null};if(typeof window<"u"){const{data:t,error:n}=await this.refreshSession();if(n)return{data:{user:null},error:n};if(t?.accessToken)return{data:{user:t.user??null},error:null}}return{data:{user:null},error:null}}catch(e){return e instanceof We?{data:{user:null},error:e}:{data:{user:null},error:new We("An unexpected error occurred while getting user",500,"UNEXPECTED_ERROR")}}}async getProfile(e){try{return{data:await this.http.get(`/api/auth/profiles/${e}`),error:null}}catch(t){return wn(t,"An unexpected error occurred while fetching user profile")}}async setProfile(e){try{const t=await this.http.patch("/api/auth/profiles/current",{profile:e}),n=this.tokenManager.getUser();return!this.isServerMode()&&n&&t.profile!==void 0&&this.tokenManager.setUser({...n,profile:t.profile}),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while updating user profile")}}async resendVerificationEmail(e){try{return{data:await this.http.post("/api/auth/email/send-verification",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending verification email")}}async verifyEmail(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/email/verify?client_type=mobile":"/api/auth/email/verify",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying email")}}async sendResetPasswordEmail(e){try{return{data:await this.http.post("/api/auth/email/send-reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending password reset email")}}async exchangeResetPasswordToken(e){try{return{data:await this.http.post("/api/auth/email/exchange-reset-password-token",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying reset code")}}async resetPassword(e){try{return{data:await this.http.post("/api/auth/email/reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while resetting password")}}async getPublicAuthConfig(){try{return{data:await this.http.get("/api/auth/public-config"),error:null}}catch(e){return wn(e,"An unexpected error occurred while fetching auth configuration")}}};function vR(e,t){return async(n,a)=>{const s=typeof n=="string"?n:n.toString(),o=new URL(s),c=o.pathname.slice(1),u=c.match(/^rpc\/(.+)$/),h=u?`/api/database/rpc/${u[1]}`:`/api/database/records/${c}`,f=`${e.baseUrl}${h}${o.search}`,m=t.getAccessToken(),y=e.getHeaders(),b=m||y.Authorization?.replace("Bearer ",""),w=new Headers(a?.headers);return b&&!w.has("Authorization")&&w.set("Authorization",`Bearer ${b}`),await fetch(f,{...a,headers:w})}}var bR=class{constructor(e,t){this.postgrest=new fA("http://dummy",{fetch:vR(e,t),headers:{}})}from(e){return this.postgrest.from(e)}rpc(e,t,n){return this.postgrest.rpc(e,t,n)}},_R=class{constructor(e,t){this.bucketName=e,this.http=t}async upload(e,t){try{const 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 a=new FormData;return a.append("file",t),{data:await this.http.request("PUT",`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(n){return{data:null,error:n instanceof We?n:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadAuto(e){try{const t=e instanceof File?e.name:"file",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 a=new FormData;return a.append("file",e),{data:await this.http.request("POST",`/api/storage/buckets/${this.bucketName}/objects`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(t){return{data:null,error:t instanceof We?t:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadWithPresignedUrl(e,t){try{const n=new FormData;e.fields&&Object.entries(e.fields).forEach(([s,o])=>{n.append(s,o)}),n.append("file",t);const a=await fetch(e.uploadUrl,{method:"POST",body:n});if(!a.ok)throw new We(`Upload to storage failed: ${a.statusText}`,a.status,"STORAGE_ERROR");return e.confirmRequired&&e.confirmUrl?{data:await this.http.post(e.confirmUrl,{size:t.size,contentType:t.type||"application/octet-stream"}),error:null}:{data:{key:e.key,bucket:this.bucketName,size:t.size,mimeType:t.type||"application/octet-stream",uploadedAt:new Date().toISOString(),url:this.getPublicUrl(e.key)},error:null}}catch(n){throw n instanceof We?n:new We("Presigned upload failed",500,"STORAGE_ERROR")}}async download(e){try{const t=await this.http.post(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}/download-strategy`,{expiresIn:3600}),n=t.url,a={};t.method==="direct"&&Object.assign(a,this.http.getHeaders());const s=await fetch(n,{method:"GET",headers:a});if(!s.ok)try{const c=await s.json();throw We.fromApiError(c)}catch{throw new We(`Download failed: ${s.statusText}`,s.status,"STORAGE_ERROR")}return{data:await s.blob(),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Download failed",500,"STORAGE_ERROR")}}}getPublicUrl(e){return`${this.http.baseUrl}/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`}async list(e){try{const t={};return e?.prefix&&(t.prefix=e.prefix),e?.search&&(t.search=e.search),e?.limit&&(t.limit=e.limit.toString()),e?.offset&&(t.offset=e.offset.toString()),{data:await this.http.get(`/api/storage/buckets/${this.bucketName}/objects`,{params:t}),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("List failed",500,"STORAGE_ERROR")}}}async remove(e){try{return{data:await this.http.delete(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Delete failed",500,"STORAGE_ERROR")}}}},kR=class{constructor(e){this.http=e}from(e){return new _R(e,this.http)}},wR=class{constructor(e){this.http=e,this.chat=new xR(e),this.images=new TR(e),this.embeddings=new PR(e)}},xR=class{constructor(e){this.completions=new SR(e)}},SR=class{constructor(e){this.http=e}async create(e){const t={model:e.model,messages:e.messages,temperature:e.temperature,maxTokens:e.maxTokens,topP:e.topP,stream:e.stream,webSearch:e.webSearch,fileParser:e.fileParser,thinking:e.thinking,tools:e.tools,toolChoice:e.toolChoice,parallelToolCalls:e.parallelToolCalls};if(e.stream){const s=this.http.getHeaders();s["Content-Type"]="application/json";const o=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:s,body:JSON.stringify(t)});if(!o.ok){const c=await o.json();throw new Error(c.error||"Stream request failed")}return this.parseSSEStream(o,e.model)}const n=await this.http.post("/api/ai/chat/completion",t),a=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:a,...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(e,t){const n=e.body.getReader(),a=new TextDecoder;let s="";try{for(;;){const{done:o,value:c}=await n.read();if(o)break;s+=a.decode(c,{stream:!0});const u=s.split(`
42
+ `);s=u.pop()||"";for(const h of u)if(h.startsWith("data: ")){const f=h.slice(6).trim();if(f)try{const m=JSON.parse(f);if((m.chunk||m.content)&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{content:m.chunk||m.content},finish_reason:null}]}),m.tool_calls?.length&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{tool_calls:m.tool_calls},finish_reason:"tool_calls"}]}),m.done){n.releaseLock();return}}catch{console.warn("Failed to parse SSE data:",f)}}}}finally{n.releaseLock()}}},PR=class{constructor(e){this.http=e}async create(e){const t=await this.http.post("/api/ai/embeddings",e);return{object:t.object,data:t.data,model:t.metadata?.model,usage:t.metadata?.usage?{prompt_tokens:t.metadata.usage.promptTokens||0,total_tokens:t.metadata.usage.totalTokens||0}:{prompt_tokens:0,total_tokens:0}}}},TR=class{constructor(e){this.http=e}async generate(e){const t=await this.http.post("/api/ai/image/generation",e);let n=[];return t.images&&t.images.length>0?n=t.images.map(a=>({b64_json:a.imageUrl.replace(/^data:image\/\w+;base64,/,""),content:t.text})):t.text&&(n=[{content:t.text}]),{created:Math.floor(Date.now()/1e3),data:n,...t.metadata?.usage&&{usage:{total_tokens:t.metadata.usage.totalTokens||0,input_tokens:t.metadata.usage.promptTokens||0,output_tokens:t.metadata.usage.completionTokens||0}}}}},CR=class Q_{constructor(t,n){this.http=t,this.functionsUrl=n||Q_.deriveSubhostingUrl(t.baseUrl)}static deriveSubhostingUrl(t){try{const{hostname:n}=new URL(t);return n.endsWith(".insforge.app")?`https://${n.split(".")[0]}.functions.insforge.app`:void 0}catch{return}}async invoke(t,n={}){const{method:a="POST",body:s,headers:o={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(a,`${this.functionsUrl}/${t}`,{body:s,headers:o}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;if(!(c instanceof We&&c.statusCode===404))return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}try{const c=`/functions/${t}`;return{data:await this.http.request(a,c,{body:s,headers:o}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}}},Hv=1e4,ER=class{constructor(e,t,n){this.socket=null,this.connectPromise=null,this.subscribedChannels=new Set,this.eventListeners=new Map,this.baseUrl=e,this.tokenManager=t,this.anonKey=n,this.tokenManager.onTokenChange=()=>this.onTokenChange()}notifyListeners(e,t){const n=this.eventListeners.get(e);if(n)for(const a of n)try{a(t)}catch(s){console.error(`Error in ${e} callback:`,s)}}connect(){return this.socket?.connected?Promise.resolve():this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((e,t)=>{const n=this.tokenManager.getAccessToken()??this.anonKey;this.socket=Lc(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let a=!0,s=null;const o=()=>{s&&(clearTimeout(s),s=null)};s=setTimeout(()=>{a&&(a=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,t(new Error(`Connection timeout after ${Hv}ms`)))},Hv),this.socket.on("connect",()=>{o();for(const c of this.subscribedChannels)this.socket.emit("realtime:subscribe",{channel:c});this.notifyListeners("connect"),a&&(a=!1,this.connectPromise=null,e())}),this.socket.on("connect_error",c=>{o(),this.notifyListeners("connect_error",c),a&&(a=!1,this.connectPromise=null,t(c))}),this.socket.on("disconnect",c=>{this.notifyListeners("disconnect",c)}),this.socket.on("realtime:error",c=>{this.notifyListeners("error",c)}),this.socket.onAny((c,u)=>{c!=="realtime:error"&&this.notifyListeners(c,u)})}),this.connectPromise)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null),this.subscribedChannels.clear()}onTokenChange(){const e=this.tokenManager.getAccessToken()??this.anonKey;this.socket&&(this.socket.auth=e?{token:e}:{}),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(e){if(this.subscribedChannels.has(e))return{ok:!0,channel:e};if(!this.socket?.connected)try{await this.connect()}catch(t){const n=t instanceof Error?t.message:"Connection failed";return{ok:!1,channel:e,error:{code:"CONNECTION_FAILED",message:n}}}return new Promise(t=>{this.socket.emit("realtime:subscribe",{channel:e},n=>{n.ok&&this.subscribedChannels.add(e),t(n)})})}unsubscribe(e){this.subscribedChannels.delete(e),this.socket?.connected&&this.socket.emit("realtime:unsubscribe",{channel:e})}async publish(e,t,n){if(!this.socket?.connected)throw new Error("Not connected to realtime server. Call connect() first.");this.socket.emit("realtime:publish",{channel:e,event:t,payload:n})}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){const n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}once(e,t){const n=a=>{this.off(e,n),t(a)};this.on(e,n)}getSubscribedChannels(){return Array.from(this.subscribedChannels)}},AR=class{constructor(e){this.http=e}async send(e){try{return{data:await this.http.post("/api/email/send-raw",e),error:null}}catch(t){if(t instanceof Error&&t.name==="AbortError")throw t;return{data:null,error:t instanceof We?t:new We(t instanceof Error?t.message:"Email send failed",500,"EMAIL_ERROR")}}}},RR=class{constructor(e={}){const t=new K_(e.debug);this.tokenManager=new Z_,this.http=new hR(e,this.tokenManager,t),e.edgeFunctionToken&&(this.http.setAuthToken(e.edgeFunctionToken),this.tokenManager.setAccessToken(e.edgeFunctionToken)),this.auth=new yR(this.http,this.tokenManager,{isServerMode:e.isServerMode??!1}),this.database=new bR(this.http,this.tokenManager),this.storage=new kR(this.http),this.ai=new wR(this.http),this.functions=new CR(this.http,e.functionsUrl),this.realtime=new ER(this.http.baseUrl,this.tokenManager,e.anonKey),this.emails=new AR(this.http)}getHttpClient(){return this.http}};function LR(e){return new RR(e)}const wp={VITE_INSFORGE_ANON_KEY:"ik_9f35735991b684f7cf57fa00bb4d0487",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function fi(){const e=typeof import.meta<"u"?wp:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function J_(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return window.location.origin;const t=typeof import.meta<"u"?wp:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function Tu(){const e=typeof import.meta<"u"?wp:void 0;return(e?.VITE_INSFORGE_ANON_KEY||e?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||"").trim()}function _f(){return!!J_()}let Rh=null;function DR(){return _f()?(Rh||(Rh=LR({baseUrl:J_(),anonKey:Tu()||void 0,autoRefreshToken:!0})),Rh):null}const ek="tokentracker_cloud_sync_enabled",MR="tokentracker_cloud_device_session_v1",xp="tokentracker_cloud_last_sync_ts";let Sp=null;function Pp(){try{localStorage.removeItem(MR)}catch{}}function NR(){if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"}function OR(){try{const e=localStorage.getItem(ek);return e===null||e===""?!1:e==="1"||e==="true"}catch{return!1}}function i4(e){try{localStorage.setItem(ek,e?"1":"0")}catch{}}function tk(){return Pp(),Sp}function IR(e){Sp=e,Pp()}function nk(){Sp=null;try{localStorage.removeItem(xp)}catch{}Pp()}function jR(){try{const e=Number(localStorage.getItem(xp));return Number.isFinite(e)?e:0}catch{return 0}}function rk(e){try{localStorage.setItem(xp,String(e))}catch{}}function Ea(e){if(typeof e!="string")return null;const t=e.trim();return t.length>0?t:null}function UR(e){const t=Ea(e);if(!t)return null;const n=t.split(".");if(n.length<2)return null;const a=n[1];try{const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),o=typeof atob=="function"?atob(s):Buffer.from(s,"base64").toString("utf8"),u=JSON.parse(o)?.exp;return typeof u!="number"||!Number.isFinite(u)||u<=0?null:Math.floor(u*1e3)}catch{return null}}function BR(e){const t=Ea(e);if(!t)return!1;const n=t.split(".");if(n.length!==3)return!1;try{for(let a=0;a<2;a++){const s=n[a];if(!/^[A-Za-z0-9_-]+$/.test(s))return!1;const o=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),c=typeof atob=="function"?atob(o):Buffer.from(o,"base64").toString("utf8");a===1&&JSON.parse(c)}return!0}catch{return!1}}function FR(e,t=3e4){const n=UR(e);return n?n<=Date.now()+Math.max(0,Number(t)||0):!1}async function VR(e){if(!e)return null;if(typeof e=="string")return Ea(e);if(typeof e=="function")try{const t=await e();return Ea(t)}catch{return null}if(typeof e=="object"){if(typeof e.getAccessToken=="function"){try{const t=await e.getAccessToken(),n=Ea(t);if(n)return n}catch{}return Ea(e.accessToken)}return null}return Ea(e)}async function s4(e,t={}){const n=Math.max(1,Math.min(12,Math.floor(Number(t.maxAttempts)||8))),a=Math.max(20,Math.floor(Number(t.baseDelayMs)||50));for(let s=0;s<n;s++){const o=await VR(e);if(o)return o;s<n-1&&await new Promise(c=>setTimeout(c,a*(s+1)))}return null}function o4(e){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")||typeof e=="function"||e&&typeof e=="object"&&typeof e.getAccessToken=="function"?!0:!!Ea(e)}function l4(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function c4(e=new Date){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return 0;const n=t.getTimezoneOffset();return Number.isFinite(n)?-n:0}function ak(e){if(!Number.isFinite(e)||e===0)return"UTC";const t=e>=0?"+":"-",n=Math.abs(e),a=String(Math.floor(n/60)).padStart(2,"0"),s=String(n%60).padStart(2,"0");return`UTC${t}${a}:${s}`}function u4({timeZone:e,offsetMinutes:t}={}){const n=ak(t);return e&&e!=="UTC"?`${e} (${n})`:n}function d4({timeZone:e,offsetMinutes:t}={}){return Number.isFinite(t)?ak(t):e||"UTC"}function h4({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return"";if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=c.year,h=c.month,f=c.day;if(u&&h&&f)return`${u}-${h}-${f}`}catch{}if(typeof t=="number"&&Number.isFinite(t)){const s=new Date(a.getTime()+t*6e4);return $R(s)}return HR(a)}function zR({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return null;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=Number(c.year),h=Number(c.month),f=Number(c.day);if(Number.isFinite(u)&&Number.isFinite(h)&&Number.isFinite(f))return{year:u,month:h,day:f}}catch{}if(typeof t=="number"&&Number.isFinite(t)){const s=new Date(a.getTime()+t*6e4);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}}return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}}function f4({timeZone:e,offsetMinutes:t}={}){return e?`tz:${e}`:typeof t=="number"&&Number.isFinite(t)?`offset:${Math.trunc(t)}`:"utc"}function $R(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),a=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${a}`}function HR(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${a}`}function yt(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())).toISOString().slice(0,10)}function Sr(e){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return"";const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${a}-${s}`}function WR(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const a=Number(n[0]),s=Number(n[1])-1,o=Number(n[2]);if(!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o))return null;const c=new Date(Date.UTC(a,s,o));return Number.isFinite(c.getTime())&&yt(c)===t?c:null}function KR(e){if(!e)return"";const t=e.year,n=String(e.month).padStart(2,"0"),a=String(e.day).padStart(2,"0");return!t||!n||!a?"":`${t}-${n}-${a}`}function GR(e,{timeZone:t,offsetMinutes:n,now:a}={}){const s=a instanceof Date&&Number.isFinite(a.getTime())?a:new Date,o=zR({timeZone:t,offsetMinutes:n,date:s});if(!o){const h=Sr(new Date);return{from:h,to:h}}const c=KR(o),u=WR(c);if(!u)return{from:c,to:c};if(e==="day")return{from:c,to:c};if(e==="week"){const h=new Date(u),m=(h.getUTCDay()+6)%7;h.setUTCDate(h.getUTCDate()-m);const y=new Date(h);return y.setUTCDate(y.getUTCDate()+6),{from:yt(h),to:yt(y)}}if(e==="month"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),1)),f=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()+1,0));return{from:yt(h),to:yt(f)}}if(e==="total"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()-23,1));return{from:yt(h),to:c}}return GR("week")}function ik(){return typeof window>"u"?null:window.localStorage||null}function sk(){return typeof navigator>"u"?null:navigator.clipboard||null}function qR(){return typeof window>"u"?null:window.ClipboardItem||null}function xo(e,{storage:t}={}){const n=t??ik();if(!n||typeof n.getItem!="function")return null;try{return n.getItem(e)}catch{return null}}function So(e,t,{storage:n}={}){const a=n??ik();if(!a||typeof a.setItem!="function")return!1;try{return a.setItem(e,t),!0}catch{return!1}}async function p4(e,{clipboard:t}={}){const n=t??sk();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(e),!0}catch{return!1}}async function m4(e,{clipboard:t}={}){const n=t??sk(),a=qR();if(!e||!n||typeof n.write!="function"||!a)return!1;try{const s=e.type||"image/png",o=e.type&&e.type!==s?e.slice(0,e.size,s):e.type?e:e.slice(0,e.size,s),c=new a({[s]:o});return await n.write([c]),!0}catch{return!1}}const No="USD",Tp=["USD","EUR","GBP","CNY","JPY","HKD"],ok={USD:{symbol:"$",labelKey:"settings.appearance.currency.opt.usd"},EUR:{symbol:"€",labelKey:"settings.appearance.currency.opt.eur"},GBP:{symbol:"£",labelKey:"settings.appearance.currency.opt.gbp"},CNY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.cny"},JPY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.jpy"},HKD:{symbol:"HK$",labelKey:"settings.appearance.currency.opt.hkd"}},Cp={USD:1,EUR:.92,GBP:.79,CNY:7.2,JPY:155,HKD:7.8},lk="tokentracker-currency",ck="tokentracker-exchange-rates",uk="tokentracker-exchange-rate-source",dk="tokentracker-exchange-rate-fetched-at";function eu(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ep(e){if(typeof e!="string")return No;const t=e.trim().toUpperCase();return Tp.includes(t)?t:No}function Dc(e){const t=typeof e=="string"?e.trim().toUpperCase():No;return ok[t]?.symbol??"$"}function g4(){return Tp.map(e=>({code:e,...ok[e]}))}function YR(){return Ep(xo(lk))}function ZR(e){return So(lk,Ep(e))}function hk(e){return e==="fetched"?"fetched":"default"}function XR(e){if(e==null)return null;try{const t=JSON.parse(String(e));if(!t||typeof t!="object")return null;const n={};for(const[a,s]of Object.entries(t)){const o=Number(s);Number.isFinite(o)&&o>0&&(n[a.toUpperCase()]=o)}return n}catch{return null}}function QR(){const e=XR(xo(ck)),t=xo(dk),n=t==null?NaN:Number(t),a=Number.isFinite(n)&&n>0?n:null,s=xo(uk),o=hk(s);return e&&Object.keys(e).length>0?{rates:{USD:1,...e},source:o,fetchedAt:a}:{rates:{...Cp},source:"default",fetchedAt:null}}function JR(e){const{rates:t,source:n,fetchedAt:a}=e;if(!t||typeof t!="object")return!1;const s=So(ck,JSON.stringify(t)),o=So(uk,hk(n)),c=a?So(dk,String(a)):!0;return s&&o&&c}function Lh(e,t){if(t===No)return 1;const n=e?.[t];if(eu(n))return n;const a=Cp[t];return eu(a)?a:1}function y4(e){if(e==null)return"-";try{if(typeof e=="bigint")return new Intl.NumberFormat().format(e);if(typeof e=="number")return new Intl.NumberFormat().format(e);const t=String(e).trim();return/^[0-9]+$/.test(t)?new Intl.NumberFormat().format(BigInt(t)):t}catch{return String(e)}}function v4(e,{thousandSuffix:t="K",millionSuffix:n="M",billionSuffix:a="B",decimals:s=1}={}){const o=Number(String(e));if(!Number.isFinite(o))return"-";const c=o<0?"-":"",u=Math.abs(o),h=Math.max(0,Math.min(6,Math.floor(s)));if(u<1e3)return`${c}${String(u)}`;const f=(w,x)=>{const T=w.toFixed(h),P=Number(T).toString();return`${c}${P}${x}`},m=(w,x,T)=>{const P=w.toFixed(h),D=Number(P);return T&&D>=1e3?f(D/1e3,T):`${c}${D.toString()}${x}`};if(u>=1e9)return f(u/1e9,a);if(u>=1e6)return m(u/1e6,n,a);const y=u/1e3,b=Number(y.toFixed(h));return b>=1e3?f(b/1e3,n):f(b,t)}function fk(e){const t=Number(String(e));return Number.isFinite(t)?t:null}function b4(e,t={}){const{decimals:n=2,currency:a="USD",rate:s=1}=t;if(e==null||typeof e=="string"&&e.trim()==="")return"-";let o;if(typeof e=="number")o=e;else if(typeof e=="bigint")o=Number(e);else{const P=String(e).trim(),D=Number(P);if(!Number.isFinite(D))return P;o=D}if(!Number.isFinite(o))return String(e);const c=Dc(a);a!=="USD"&&typeof s=="number"&&Number.isFinite(s)&&s>0&&(o=o*s);const h=o.toFixed(6).match(/^(-?\d+)(?:\.(\d+))?$/);if(!h)return`${c}${String(o)}`;const f=h[1],m=h[2]||"";let y=f;try{y=new Intl.NumberFormat().format(BigInt(f))}catch{y=f}const b=Math.max(0,Math.min(6,Math.floor(n))),w=b?m.slice(0,b).padEnd(b,"0"):"",x=f.startsWith("-")?"-":"",T=b?`${y.replace("-","")}.${w}`:y.replace("-","");return`${x}${c}${T}`}function tu(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,s=Number(t[3]),o=new Date(Date.UTC(n,a,s));return Number.isFinite(o.getTime())&&yt(o)===e.trim()?o:null}function ni(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function eL(e,t){const n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.floor(n/864e5)}function Dh(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=e.length,a=(n-1)*t,s=Math.floor(a),o=a-s,c=e[s]??e[n-1],u=e[Math.min(n-1,s+1)]??e[n-1];return Math.round(c+(u-c)*o)}function tL(e){return e<=0?0:e>=4?4:e}function pk({weeks:e=52,now:t,weekStartsOn:n="sun"}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date,s=Sr(a),o=tu(s)||new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())),c=n==="mon"?1:0,u=o.getUTCDay(),h=ni(o,-((u-c+7)%7)),f=ni(h,-7*(Math.max(1,e)-1));return{from:yt(f),to:s}}function nL({dailyRows:e,weeks:t=52,to:n,weekStartsOn:a="sun"}={}){const s=tu(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:o}=pk({weeks:t,now:s,weekStartsOn:a}),c=tu(o)||ni(s,-(t*7-1)),u=(()=>{const j=(c.getUTCDay()-(a==="mon"?1:0)+7)%7;return ni(c,-j)})(),h=new Map;for(const R of Array.isArray(e)?e:[]){const L=typeof R?.day=="string"?R.day:null;if(!L)continue;const j=fk(R?.billable_total_tokens??R?.total_tokens)??0;h.set(L,{value:Math.max(0,j),models:R?.models||null})}const f=eL(u,s)+1,m=Math.ceil(f/7),y=[];for(let R=0;R<f;R++){const L=ni(u,R),j=yt(L),G=h.get(j),K=G?G.value:0;K>0&&y.push(K)}y.sort((R,L)=>R-L);const b=Dh(y,.5),w=Dh(y,.75),x=Dh(y,.9);function T(R){return!R||R<=0?0:R<=b?1:R<=w?2:R<=x?3:4}const P=[];for(let R=0;R<m;R++){const L=[];for(let j=0;j<7;j++){const G=R*7+j,K=ni(u,G);if(K.getTime()>s.getTime()){L.push(null);continue}const H=yt(K),S=h.get(H),Z=S?S.value:0,X=S?S.models:null;L.push({day:H,value:Z,level:tL(T(Z)),models:X})}P.push(L)}const D=P.length>t?P.slice(P.length-t):P;return{from:o,to:yt(s),weeks:D,thresholds:{t1:b,t2:w,t3:x}}}function rL({dailyRows:e,to:t}={}){const n=tu(t)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),a=new Map;for(const o of Array.isArray(e)?e:[]){const c=typeof o?.day=="string"?o.day:null;if(!c)continue;const u=fk(o?.billable_total_tokens??o?.total_tokens)??0;a.set(c,Math.max(0,u))}let s=0;for(let o=0;o<370;o++){const c=yt(ni(n,-o));if((a.get(c)??0)>0){s+=1;continue}break}return s}const Cu={},mk="tokentracker",aL=["tokentracker/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],Wv=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function Pn(){if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock")||"").toLowerCase();if(t==="0"||t==="false"||t==="off"||t==="no")return!1;if(t==="1"||t==="true"||t==="on"||t==="yes")return!0}if(typeof import.meta<"u"&&Cu){const e="".toLowerCase();if(e==="1"||e==="true")return!0}return!1}function iL(){if(typeof import.meta<"u"&&Cu){const e="".trim();if(e)return e;const t="".trim();if(t)return t}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_now")||"").trim();if(t)return t;const n=String(e.get("mock_today")||"").trim();if(n)return n}return""}function sL(e){if(!e)return null;const t=String(e).trim();if(!t)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t)){const[a,s,o]=t.split("-").map(Number);if(!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o))return null;const c=new Date(a,s-1,o,12,0,0);return Number.isFinite(c.getTime())?c:null}const n=new Date(t);return Number.isFinite(n.getTime())?n:null}function _4(){return Pn()?sL(iL()):null}function oL(){if(typeof import.meta<"u"&&Cu){const e="".trim();if(e)return e}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_seed")||"").trim();if(t)return t}return mk}function lL(){if(typeof import.meta<"u"&&Cu){const e="".trim(),t=Number(e);if(Number.isFinite(t)&&t>0)return Math.floor(t)}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_missing")||"").trim(),n=Number(t);if(Number.isFinite(n)&&n>0)return Math.floor(n)}return 0}function Wo(e){return(e==null?oL():String(e)).trim()||mk}function Ko(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function cn(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,s=Number(t[3]),o=new Date(Date.UTC(n,a,s));return Number.isFinite(o.getTime())&&yt(o)===e.trim()?o:null}function Oo(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function gk(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1))}function cL(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function fs({from:e,to:t,seed:n}){const a=cn(Sr(new Date))||new Date,s=cn(e)||a,o=cn(t)||s,c=[],u=Wo(n),h=Math.floor((Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)+1;for(let f=0;f<h;f+=1){const m=Oo(s,f),y=yt(m),b=Ko(`${u}:${y}`),w=b%1e3/1e3,x=.6+.4*Math.sin(f/6*Math.PI*.5),T=m.getUTCDay()===0||m.getUTCDay()===6?.65:1,P=18e3+Math.round(12e3*w),D=Math.max(0,Math.round(P*x*T)),R=Math.round(D*.46),L=Math.round(D*.34),j=Math.round(D*.14),G=Math.max(0,D-R-L-j),K={};if(D>0){const H=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],S=1+b%3;let Z=D;for(let X=0;X<S;X++){const me=H[(b+X)%H.length];if(X===S-1)K[me]=Z;else{const oe=Math.round(Z*(.3+.4*((b+X*17)%10)/10));K[me]=oe,Z-=oe}}}c.push({day:y,total_tokens:D,billable_total_tokens:D,input_tokens:R,output_tokens:L,cached_input_tokens:j,reasoning_output_tokens:G,conversation_count:1+b%5,models:K})}return c}function uL({day:e,seed:t}){const n=cn(e)||cn(Sr(new Date))||new Date,a=yt(n),s=Wo(t),o=Array.from({length:48},(u,h)=>{const f=Math.floor(h/2),m=h%2===0?0:30,b=Ko(`${s}:${a}:${f}:${m}`)%1e3/1e3,w=(f+m/60)/24,x=.4+.6*Math.sin(w*Math.PI*2),T=900+Math.round(700*b),P=Math.max(0,Math.round(T*x)),D=Math.round(P*.46),R=Math.round(P*.34),L=Math.round(P*.14),j=Math.max(0,P-D-R-L);return{hour:`${a}T${String(f).padStart(2,"0")}:${String(m).padStart(2,"0")}:00`,total_tokens:P,billable_total_tokens:P,input_tokens:D,output_tokens:R,cached_input_tokens:L,reasoning_output_tokens:j}}),c=Math.max(0,Math.min(48,lL()));if(c>0){const u=Date.now(),h=o.map((y,b)=>{const w=Date.parse(y.hour);return Number.isFinite(w)&&w<=u?{index:b,ts:w}:null}).filter(Boolean),f=Math.max(0,h.length-c),m=h.slice(f);for(const y of m){const b=o[y.index];b&&(o[y.index]={...b,missing:!0})}}return o}function dL({months:e=24,to:t,seed:n}){const a=cn(t)||cn(Sr(new Date))||new Date,s=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),o=Wo(n),c=[];for(let u=e-1;u>=0;u-=1){const h=gk(s,-u),f=cL(h),y=Ko(`${o}:${f}`)%1e3/1e3,b=.7+.3*Math.sin(c.length/6*Math.PI*.5),w=36e4+Math.round(2e5*y),x=Math.max(0,Math.round(w*b)),T=Math.round(x*.46),P=Math.round(x*.34),D=Math.round(x*.14),R=Math.max(0,x-T-P-D);c.push({month:f,total_tokens:x,billable_total_tokens:x,input_tokens:T,output_tokens:P,cached_input_tokens:D,reasoning_output_tokens:R})}return c}function Ap(e){return e.reduce((t,n)=>(t.total_tokens+=Number(n.total_tokens||0),t.billable_total_tokens+=Number(n.billable_total_tokens||n.total_tokens||0),t.input_tokens+=Number(n.input_tokens||0),t.output_tokens+=Number(n.output_tokens||0),t.cached_input_tokens+=Number(n.cached_input_tokens||0),t.reasoning_output_tokens+=Number(n.reasoning_output_tokens||0),t.conversation_count+=Number(n.conversation_count||0),t),{total_tokens:0,billable_total_tokens:0,input_tokens:0,output_tokens:0,cached_input_tokens:0,reasoning_output_tokens:0,conversation_count:0})}function hL(e,t=1.75){const n=Number(e||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*t/1e6).toFixed(6)}function Kv(e,t){const n=Number.isFinite(t)?t:0;return{total_tokens:Math.max(0,Math.round(e.total_tokens*n)),billable_total_tokens:Math.max(0,Math.round((e.billable_total_tokens??e.total_tokens)*n)),input_tokens:Math.max(0,Math.round(e.input_tokens*n)),output_tokens:Math.max(0,Math.round(e.output_tokens*n)),cached_input_tokens:Math.max(0,Math.round(e.cached_input_tokens*n)),reasoning_output_tokens:Math.max(0,Math.round(e.reasoning_output_tokens*n))}}function kf(e){return{...e,total_cost_usd:hL(e.total_tokens)}}function fL({from:e,to:t,seed:n}={}){const a=fs({from:e,to:t,seed:n});return{from:e,to:t,data:a}}function pL({day:e,seed:t}={}){const n=cn(e)||new Date,a=yt(n),s=uL({day:a,seed:t});return{day:a,data:s}}function mL({months:e=24,to:t,seed:n}={}){const a=cn(t)||cn(Sr(new Date))||new Date,s=yt(a),o=dL({months:e,to:s,seed:n}),c=gk(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),-(e-1));return{from:yt(c),to:s,months:e,data:o}}function gL({from:e,to:t,seed:n,rolling:a=!0}={}){const s=fs({from:e,to:t,seed:n}),o=Ap(s),c=kf(o),u=a?yL({to:t,seed:n}):null;return{from:e,to:t,days:s.length,totals:c,...u?{rolling:u}:{}}}function yL({to:e,seed:t}={}){const n=cn(e)||cn(Sr(new Date))||new Date,a=yt(n),s=yt(Oo(n,-6)),o=yt(Oo(n,-29)),c=fs({from:s,to:a,seed:t}),u=fs({from:o,to:a,seed:t});return{last_7d:Gv({rows:c,from:s,to:a}),last_30d:Gv({rows:u,from:o,to:a})}}function Gv({rows:e,from:t,to:n}={}){const a=Ap(e||[]),s=(e||[]).filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,o=s>0?Math.floor(a.billable_total_tokens/s):0;return{from:t,to:n,totals:{billable_total_tokens:a.billable_total_tokens,conversation_count:a.conversation_count},active_days:s,avg_per_active_day:o}}function vL({seed:e,limit:t=3}={}){const n=Wo(e),a=aL.map((s,o)=>{const u=12e4+Ko(`${n}:${s}`)%9e5,h=o%4*4200,f=Math.max(0,u+h),m=Math.max(0,Math.round(f*.96));return{project_key:s,project_ref:`https://github.com/${s}`,total_tokens:String(f),billable_total_tokens:String(m)}}).sort((s,o)=>Number(o.billable_total_tokens)-Number(s.billable_total_tokens)).slice(0,Math.max(1,Math.min(10,Math.floor(Number(t)||3))));return{generated_at:new Date().toISOString(),entries:a}}function bL(e){const t=cn(Sr(new Date))||new Date,n=String(e).trim().toLowerCase()||"week";if(n==="total")return{from:"1970-01-01",to:"9999-12-31"};if(n==="month"){const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)),u=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0));return{from:yt(c),to:yt(u)}}const a=t.getUTCDay(),s=yt(Oo(t,-a)),o=yt(Oo(t,-a+6));return{from:s,to:o}}function yk({seed:e,period:t,metric:n,limit:a=20,offset:s=0}={}){const o=Wo(e),c=Math.max(1,Math.min(100,Math.floor(Number(a)||20))),u=Math.max(0,Math.min(1e4,Math.floor(Number(s)||0))),h=String(n||"all").trim().toLowerCase()||"all",f=String(t||"week").trim().toLowerCase()||"week",m=f==="month"||f==="total"||f==="week"?f:"week",{from:y,to:b}=bL(m),w=250,x=w>0?Math.ceil(w/c):0,T=Math.floor(u/c)+1,P=Array.from({length:w},(H,S)=>{const Z=S+1,X=`00000000-0000-0000-0000-${String(Z).padStart(12,"0")}`,me=Wv[Z%Wv.length],Ae=18e4+Ko(`${o}:${me}:${Z}`)%9e5,fe=Math.max(0,Ae+Z*1200),ue=Math.floor(fe*.28),le=Math.floor(fe*.18),Me=Math.floor(fe*.1),W=Math.floor(fe*.1),Y=Math.floor(fe*.08),$=Math.floor(fe*.03),N=Math.floor(fe*.02),q=Math.floor(fe*.04),xe=Math.floor(fe*.03),Re=Math.max(0,fe-ue-le-Me-W-Y-$-N-q-xe),Se=Z%7!==0;return{id:Z,user_id:X,is_public:Se,is_me:!1,display_name:Se?me:"Anonymous",avatar_url:null,gpt_tokens:ue,claude_tokens:le,gemini_tokens:Me,cursor_tokens:W,opencode_tokens:Y,openclaw_tokens:Re,hermes_tokens:$,kiro_tokens:N,copilot_tokens:q,kimi_tokens:xe,other_tokens:0,total_tokens:fe}}),D=Math.max(0,Math.min(w-1,Math.floor(w*.8)));P[D]&&(P[D].is_me=!0);const R=h==="gpt"||h==="codex"?"gpt_tokens":h==="claude"?"claude_tokens":h==="gemini"?"gemini_tokens":h==="cursor"?"cursor_tokens":h==="opencode"?"opencode_tokens":h==="openclaw"?"openclaw_tokens":h==="hermes"?"hermes_tokens":h==="kiro"?"kiro_tokens":h==="copilot"?"copilot_tokens":h==="kimi"?"kimi_tokens":"total_tokens",L=P.slice().sort((H,S)=>Number(S[R])-Number(H[R])||H.id-S.id).map((H,S)=>({user_id:H.is_public?H.user_id:null,rank:S+1,is_me:!!H.is_me,display_name:H.display_name,avatar_url:H.avatar_url,gpt_tokens:String(H.gpt_tokens),claude_tokens:String(H.claude_tokens),gemini_tokens:String(H.gemini_tokens),cursor_tokens:String(H.cursor_tokens),opencode_tokens:String(H.opencode_tokens),openclaw_tokens:String(H.openclaw_tokens),hermes_tokens:String(H.hermes_tokens??0),kiro_tokens:String(H.kiro_tokens??0),copilot_tokens:String(H.copilot_tokens??0),kimi_tokens:String(H.kimi_tokens??0),other_tokens:String(H.other_tokens??0),total_tokens:String(H.total_tokens),is_public:!!H.is_public})),j=L.find(H=>H?.is_me)||null,G=j?{rank:j.rank,gpt_tokens:j.gpt_tokens,claude_tokens:j.claude_tokens,gemini_tokens:j.gemini_tokens,cursor_tokens:j.cursor_tokens,opencode_tokens:j.opencode_tokens,openclaw_tokens:j.openclaw_tokens,hermes_tokens:j.hermes_tokens,kiro_tokens:j.kiro_tokens,copilot_tokens:j.copilot_tokens,kimi_tokens:j.kimi_tokens,other_tokens:j.other_tokens,total_tokens:j.total_tokens}:{rank:null,gpt_tokens:"0",claude_tokens:"0",gemini_tokens:"0",cursor_tokens:"0",opencode_tokens:"0",openclaw_tokens:"0",hermes_tokens:"0",kiro_tokens:"0",copilot_tokens:"0",kimi_tokens:"0",other_tokens:"0",total_tokens:"0"},K=L.slice(u,u+c);return{period:m,metric:h,from:y,to:b,generated_at:new Date().toISOString(),page:T,limit:c,offset:u,total_entries:w,total_pages:x,entries:K,me:G}}function _L({weeks:e=52,to:t,weekStartsOn:n="sun",seed:a}={}){const s=pk({weeks:e,now:cn(t)||cn(Sr(new Date))||new Date,weekStartsOn:n}),o=fs({from:s.from,to:s.to,seed:a});return{...nL({dailyRows:o,weeks:e,to:s.to,weekStartsOn:n}),week_starts_on:n,active_days:o.filter(u=>Number(u.billable_total_tokens??u.total_tokens)>0).length,streak_days:rL({dailyRows:o,to:s.to})}}function kL({from:e,to:t,seed:n}={}){const a=fs({from:e,to:t,seed:n}),s=Ap(a),c=[{source:"codex",weight:.7,models:[{model:"gpt-5.2-codex",model_id:"gpt-5.2-codex",weight:.2},{model:"unknown",model_id:"unknown",weight:.8}]},{source:"claude",weight:.2,models:[{model:"claude-3.5",model_id:"claude-3.5",weight:.3},{model:"unknown",model_id:"unknown",weight:.7}]},{source:"every-code",weight:.1,models:[{model:"unknown",model_id:"unknown",weight:1}]}].map(u=>{const h=Kv(s,u.weight),f=u.models.map(m=>{const y=Kv(h,m.weight);return{model:m.model,model_id:m.model_id||m.model,totals:kf(y)}});return{source:u.source,totals:kf(h),models:f}});return{from:e,to:t,days:a.length,sources:c,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:Sr(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function wL({from:e,to:t,source:n="claude"}={}){if(n==="codex")return{from:e,to:t,source:"codex",scope:"supported",totals:{input_tokens:142e4,cached_input_tokens:588e4,cache_creation_input_tokens:92e4,output_tokens:256e4,reasoning_output_tokens:61e4,total_tokens:1078e4},session_count:188,message_count:5436,tool_calls_breakdown:{categories:[{name:"Execution",calls:742,totals:{input_tokens:32e4,cached_input_tokens:104e4,cache_creation_input_tokens:11e4,output_tokens:46e4,reasoning_output_tokens:12e4,total_tokens:193e4},tools:[{name:"exec_command",calls:510,totals:{input_tokens:25e4,cached_input_tokens:82e4,cache_creation_input_tokens:8e4,output_tokens:37e4,reasoning_output_tokens:9e4,total_tokens:152e4}},{name:"write_stdin",calls:232,totals:{input_tokens:7e4,cached_input_tokens:22e4,cache_creation_input_tokens:3e4,output_tokens:9e4,reasoning_output_tokens:3e4,total_tokens:41e4}}]},{name:"Browser",calls:406,totals:{input_tokens:21e4,cached_input_tokens:88e4,cache_creation_input_tokens:9e4,output_tokens:42e4,reasoning_output_tokens:1e5,total_tokens:17e5},tools:[{name:"take_snapshot",calls:180,totals:{input_tokens:1e5,cached_input_tokens:4e5,cache_creation_input_tokens:4e4,output_tokens:18e4,reasoning_output_tokens:4e4,total_tokens:76e4}},{name:"click",calls:126,totals:{input_tokens:6e4,cached_input_tokens:25e4,cache_creation_input_tokens:3e4,output_tokens:12e4,reasoning_output_tokens:35e3,total_tokens:495e3}},{name:"evaluate_script",calls:100,totals:{input_tokens:5e4,cached_input_tokens:23e4,cache_creation_input_tokens:2e4,output_tokens:12e4,reasoning_output_tokens:25e3,total_tokens:445e3}}]}],tools_total:363e4,privacy:{includes_inputs:!1,note:"Aggregated tool names only; no tool arguments or outputs are included."}},exec_command_breakdown:{by_type:[{name:"test",calls:168,failures:14,duration_ms:482e3,max_duration_ms:18400,output_chars:45e4,output_lines:8600,totals:{input_tokens:9e4,cached_input_tokens:32e4,output_tokens:16e4,reasoning_output_tokens:42e3,total_tokens:612e3}},{name:"build",calls:116,failures:9,duration_ms:392e3,max_duration_ms:22100,output_chars:31e4,output_lines:5200,totals:{input_tokens:7e4,cached_input_tokens:24e4,output_tokens:13e4,reasoning_output_tokens:3e4,total_tokens:47e4}}],by_exit:[{name:"completed:0",calls:438,failures:0,duration_ms:104e4,max_duration_ms:22100,output_chars:83e4,output_lines:13100,totals:{input_tokens:22e4,cached_input_tokens:78e4,output_tokens:35e4,reasoning_output_tokens:82e3,total_tokens:1432e3}},{name:"completed:1",calls:72,failures:72,duration_ms:155e3,max_duration_ms:11800,output_chars:12e4,output_lines:2300,totals:{input_tokens:3e4,cached_input_tokens:11e4,output_tokens:55e3,reasoning_output_tokens:8e3,total_tokens:195e3}}]}};if(n!=="claude")return{from:e,to:t,source:n,scope:"unsupported",totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},categories:["system_prefix","conversation_history","user_input","tool_calls","subagents","reasoning","assistant_response"].map(c=>({key:c,totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},percent:0})),session_count:0,message_count:0};const a=[{key:"system_prefix",total:12896539},{key:"conversation_history",total:320207200},{key:"user_input",total:998025},{key:"tool_calls",total:4808739},{key:"subagents",total:1022828},{key:"reasoning",total:11073118},{key:"assistant_response",total:1289174}],s=a.reduce((c,u)=>c+u.total,0),o=a.map(({key:c,total:u})=>({key:c,totals:{input_tokens:c==="user_input"?u:0,cached_input_tokens:c==="conversation_history"?Math.round(u*.95):0,cache_creation_input_tokens:c==="system_prefix"?u:c==="conversation_history"?Math.round(u*.05):0,output_tokens:["tool_calls","subagents","reasoning","assistant_response"].includes(c)?u:0,reasoning_output_tokens:c==="reasoning"?u:0,total_tokens:u},percent:Number((u/s*100).toFixed(2))}));return{from:e,to:t,source:"claude",scope:"supported",totals:{input_tokens:998025,cached_input_tokens:Math.round(320207200*.95),cache_creation_input_tokens:12896539+Math.round(320207200*.05),output_tokens:18193859,reasoning_output_tokens:11073118,total_tokens:s},categories:o,session_count:312,message_count:12046}}let Mc=null;function xL(){Mc=null}async function SL(e=fetch){if(Mc)return Mc;const t=await e("/api/local-auth",{method:"GET",headers:{Accept:"application/json"},cache:"no-store"});if(!t.ok)throw new Error(`Local auth request failed with HTTP ${t.status}`);const n=await t.json().catch(()=>null),a=typeof n?.token=="string"?n.token.trim():"";if(!a)throw new Error("Local auth token missing from response");return Mc=a,a}async function Rp(e=fetch){return{"x-tokentracker-local-auth":await SL(e)}}const or={usageSummary:"tokentracker-usage-summary",usageDaily:"tokentracker-usage-daily",usageHourly:"tokentracker-usage-hourly",usageMonthly:"tokentracker-usage-monthly",usageHeatmap:"tokentracker-usage-heatmap",usageModelBreakdown:"tokentracker-usage-model-breakdown",usageCategoryBreakdown:"tokentracker-usage-category-breakdown",projectUsageSummary:"tokentracker-project-usage-summary",userStatus:"tokentracker-user-status",localSync:"tokentracker-local-sync",usageLimits:"tokentracker-usage-limits"};async function Pr(e,t,n){const a=new URL(`/functions/${e}`,window.location.origin);if(t)for(const[o,c]of Object.entries(t))c!=null&&c!==""&&a.searchParams.set(o,String(c));const s=await fetch(a.toString(),{headers:{Accept:"application/json"},cache:"no-store",...n});if(!s.ok){const o=new Error(`Request failed with HTTP ${s.status}`);throw o.status=s.status,o}return s.json()}function Oa({timeZone:e,tzOffsetMinutes:t}={}){const n={},a=typeof e=="string"?e.trim():"";return a&&(n.tz=a),Number.isFinite(t)&&(n.tz_offset_minutes=String(Math.trunc(t))),n}function mi({source:e,model:t}={}){const n={},a=typeof e=="string"?e.trim().toLowerCase():"";a&&(n.source=a);const s=typeof t=="string"?t.trim():"";return s&&(n.model=s),n}async function k4({from:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,rolling:c=!1,accessToken:u}={}){if(Pn())return gL({from:e,to:t,seed:u,rolling:c});const h=Oa({timeZone:s,tzOffsetMinutes:o}),f=mi({source:n,model:a}),m=c?{rolling:"1"}:{};return Pr(or.usageSummary,{from:e,to:t,...f,...h,...m})}async function w4({from:e,to:t,source:n,limit:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Pn())return vL({seed:c,limit:a});const u=Oa({timeZone:s,tzOffsetMinutes:o}),f={...mi({source:n}),...u};return e&&(f.from=e),t&&(f.to=t),a!=null&&(f.limit=String(a)),Pr(or.projectUsageSummary,f)}async function Go(e,t={}){const n=fi();if(!n)throw new Error("InsForge base URL not configured");const a=n.replace(/\/$/,""),s=new URL(`${a}/functions/${e}`);if(t.params)for(const[h,f]of Object.entries(t.params))f!=null&&f!==""&&s.searchParams.set(h,String(f));const o={Accept:"application/json","Content-Type":"application/json"},c=Tu();c&&(o.apikey=c),t.accessToken&&BR(t.accessToken)&&(o.Authorization=`Bearer ${t.accessToken}`);const u=await fetch(s.toString(),{method:t.method||"GET",headers:o,...t.body!=null?{body:JSON.stringify(t.body)}:{}});if(!u.ok){const h=new Error(`Request failed with HTTP ${u.status}`);throw h.status=u.status,h}return u.json()}async function x4({accessToken:e,userId:t,period:n,metric:a,limit:s,offset:o}={}){return Pn()?yk({seed:e||t,period:n,metric:a,limit:s,offset:o}):Go("tokentracker-leaderboard",{params:{period:n,limit:s,offset:o,user_id:t}})}async function qv({accessToken:e}={}){return Go("tokentracker-public-visibility",{accessToken:e,method:"GET"})}async function S4({accessToken:e,enabled:t,anonymous:n,display_name:a,github_url:s,show_github_url:o}={}){const c={};return t!==void 0&&(c.enabled=!!t),n!==void 0&&(c.anonymous=!!n),a!==void 0&&(c.display_name=String(a)),s!==void 0&&(c.github_url=s===null?null:String(s)),o!==void 0&&(c.show_github_url=!!o),Go("tokentracker-public-visibility",{accessToken:e,method:"POST",body:c})}async function P4({accessToken:e,period:t,source:n}={}){const a={};return t&&(a.period=t),typeof n=="string"&&n.trim()&&(a.source=n.trim()),Go("tokentracker-leaderboard-refresh",{accessToken:e,method:"POST",body:a})}async function T4({accessToken:e,userId:t,period:n}={}){if(Pn()){const a=yk({seed:e,period:n,metric:"all",limit:250,offset:0}),o=(Array.isArray(a?.entries)?a.entries:[]).find(c=>c?.user_id===t)||null;return{period:a?.period??"week",from:a?.from??null,to:a?.to??null,generated_at:a?.generated_at??new Date().toISOString(),entry:o}}return Go("tokentracker-leaderboard-profile",{accessToken:e,params:{user_id:t,period:n}})}async function C4(e={}){if(Pn()){const t=new Date().toISOString();return{user_id:"local-user",created_at:t,pro:{active:!1,sources:[],expires_at:null,partial:!1,as_of:t},subscriptions:{partial:!1,as_of:t,items:[]},install:{partial:!1,as_of:t,has_active_device_token:!1,has_active_device:!1,active_device_tokens:0,active_devices:0,latest_token_activity_at:null,latest_device_seen_at:null}}}return Pr(or.userStatus)}async function E4({signal:e}={}){const t=await Rp(),n=await fetch(`/functions/${or.localSync}`,{method:"POST",headers:{Accept:"application/json",...t},cache:"no-store",signal:e}),a=await n.json().catch(()=>({ok:!1,error:`Local sync request failed with HTTP ${n.status}`}));if(!n.ok||a?.ok===!1){const s=a?.error||a?.message||`Local sync request failed with HTTP ${n.status}`,o=new Error(s);throw o.status=n.status,o}return a}async function A4({from:e,to:t,source:n,timeZone:a,tzOffsetMinutes:s,accessToken:o}={}){if(Pn())return kL({from:e,to:t,seed:o});const c=Oa({timeZone:a,tzOffsetMinutes:s}),u=mi({source:n});return Pr(or.usageModelBreakdown,{from:e,to:t,...u,...c})}async function R4({from:e,to:t,source:n="claude",timeZone:a,tzOffsetMinutes:s}={}){if(Pn())return wL({from:e,to:t,source:n});const o=Oa({timeZone:a,tzOffsetMinutes:s});return Pr(or.usageCategoryBreakdown,{from:e,to:t,source:n,...o})}async function L4({from:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Pn())return fL({from:e,to:t,seed:c});const u=Oa({timeZone:s,tzOffsetMinutes:o}),h=mi({source:n,model:a});return Pr(or.usageDaily,{from:e,to:t,...h,...u})}async function D4({day:e,source:t,model:n,timeZone:a,tzOffsetMinutes:s,accessToken:o}={}){if(Pn())return pL({day:e,seed:o});const c=Oa({timeZone:a,tzOffsetMinutes:s}),u=mi({source:t,model:n}),h=e?{day:e,...u,...c}:{...u,...c};return Pr(or.usageHourly,h)}async function M4({months:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Pn())return mL({months:e,to:t,seed:c});const u=Oa({timeZone:s,tzOffsetMinutes:o}),h=mi({source:n,model:a});return Pr(or.usageMonthly,{...e?{months:String(e)}:{},...t?{to:t}:{},...h,...u})}async function N4(e={}){const t=e?.refresh?{refresh:"1"}:void 0;return Pr(or.usageLimits,t)}async function O4({weeks:e,to:t,weekStartsOn:n,source:a,model:s,timeZone:o,tzOffsetMinutes:c,accessToken:u}={}){if(Pn())return _L({weeks:e,to:t,weekStartsOn:n,seed:u});const h=Oa({timeZone:o,tzOffsetMinutes:c}),f=mi({source:a,model:s});return Pr(or.usageHeatmap,{weeks:String(e),to:t,week_starts_on:n,...f,...h})}const vk=k.createContext(null);function PL(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.full_name||t.name||n.name||t.user_name||t.preferred_username;return typeof a=="string"&&a.trim()?a.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Yv(e){if(!e||typeof e!="object")return null;const t=e,n=t.session&&typeof t.session=="object"?t.session:null,a=typeof t.accessToken=="string"&&t.accessToken||typeof t.access_token=="string"&&t.access_token||n&&typeof n.accessToken=="string"&&n.accessToken||n&&typeof n.access_token=="string"&&n.access_token||null;return a&&a.length>0?a:null}async function Mh(e,t={}){if(!e)return null;const n=Math.max(0,Math.floor(Number(t.skewMs)||6e4)),a=e.tokenManager,s=()=>a?.getAccessToken?.()??a?.getSession?.()?.accessToken??null;let o=s();if(!o||FR(o,n)){const{data:c}=await e.auth.refreshSession();if(o=s()??Yv(c)??null,!o&&typeof e.auth.getCurrentUser=="function")try{await e.auth.getCurrentUser(),o=s()??Yv(c)??null}catch{}}return o||null}function TL({children:e}){const[t,n]=k.useState(null),[a,s]=k.useState(null),[o,c]=k.useState(!0);k.useEffect(()=>{if(!_f()){n(null),s(null),c(!1);return}n(DR())},[]),k.useEffect(()=>{if(!t)return;let K=!0;return c(!0),(async()=>{try{let{data:H,error:S}=await t.auth.getCurrentUser();if(!K)return;if(!S&&!H?.user){if(await new Promise(X=>setTimeout(X,150)),!K)return;const Z=await t.auth.getCurrentUser();H=Z.data,S=Z.error}if(S){s(null);return}s(H?.user??null)}catch{K&&s(null)}finally{K&&c(!1)}})(),()=>{K=!1}},[t]);const u=k.useCallback(async()=>{if(t)try{let{data:K,error:H}=await t.auth.getCurrentUser();if(!H&&!K?.user){await new Promise(Z=>setTimeout(Z,150));const S=await t.auth.getCurrentUser();K=S.data,H=S.error}if(H){s(null);return}s(K?.user??null)}catch{s(null)}},[t]),h=k.useCallback(async(K,H)=>{if(!t)return{error:new Error("InsForge client not configured")};const S=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth;if(S){const me=typeof H=="string"&&H.trim()?H.trim():`${window.location.origin}/auth/callback`,oe=await t.auth.signInWithOAuth({provider:K,redirectTo:me,skipBrowserRedirect:!0});if(oe.data?.url){try{const Ae=await Rp();await fetch("/api/auth-bridge/verifier",{method:"PUT",headers:{"Content-Type":"application/json",...Ae},body:JSON.stringify({native:!0})})}catch{}S.postMessage(oe.data.url)}return oe}const Z=typeof H=="string"&&H.trim()?H.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return await t.auth.signInWithOAuth({provider:K,redirectTo:Z})},[t]),f=k.useCallback(async K=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:H,error:S}=await t.auth.signInWithPassword(K);return H?.user&&s(H.user),{data:H,error:S}},[t]),m=k.useCallback(async K=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:H,error:S}=await t.auth.signUp(K);return H?.user&&H?.accessToken&&s(H.user),{data:H,error:S}},[t]),y=k.useCallback(async()=>t?t.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[t]),b=k.useCallback(async()=>{t&&(await t.auth.signOut(),nk(),xL(),s(null))},[t]),w=k.useCallback(async()=>Mh(t),[t]),[x,T]=k.useState(null),[P,D]=k.useState(!1),R=k.useMemo(()=>PL(a),[a]);k.useEffect(()=>{if(!a||!t){T(null),D(!1);return}let K=!0;return(async()=>{try{const H=await Mh(t);if(!K||!H){K&&D(!0);return}const S=await qv({accessToken:H});K&&S?.display_name&&T(S.display_name)}catch{}K&&D(!0)})(),()=>{K=!1}},[a,t]);const L=P?x||R:"",j=k.useCallback(async()=>{if(t)try{const K=await Mh(t);if(!K)return;const H=await qv({accessToken:K});H?.display_name&&T(H.display_name)}catch{}},[t]),G=k.useMemo(()=>!_f()||!t?{enabled:!1,client:null,user:null,signedIn:!1,loading:!1,displayName:"",refreshUser:async()=>{},refreshDisplayName: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:t,user:a,signedIn:!!a,loading:o,displayName:L,refreshUser:u,refreshDisplayName:j,signInWithOAuth:h,signInWithPassword:f,signUp:m,getPublicAuthConfig:y,signOut:b,getAccessToken:w},[t,a,o,L,u,j,h,f,m,y,b,w]);return I.jsx(vk.Provider,{value:G,children:e})}function qo(){return k.useContext(vk)}const CL=`key,module,page,component,slot,text,notes,status
43
+ header.auth.sign_in_aria,shared,*,InsforgeUserHeaderControls,sign_in_aria,"Sign in",,active
44
+ login.back_home,shared,LoginPage,LoginPage,back_home,"Back to home",,active
45
+ login.cloud_only,shared,LoginPage,LoginPage,cloud_only,"Cloud sign-in is not configured. Use the local dashboard on localhost.",,active
46
+ login.title,shared,LoginPage,LoginPage,title,"Sign in",,active
47
+ login.subtitle,shared,LoginPage,LoginPage,subtitle,"Choose email or a connected account.",,active
48
+ login.dismiss,shared,LoginPage,LoginPage,dismiss,"Dismiss",,active
49
+ login.verify_email_success,shared,LoginPage,LoginPage,verify_ok,"Email verified. You can sign in below.",,active
50
+ login.verify_email_pending,shared,LoginPage,LoginPage,verify_pending,"Check your email to verify your account, then sign in.",,active
51
+ login.oauth.continue,shared,LoginPage,LoginPage,oauth_continue,"Continue with {{provider}}",,active
52
+ login.divider,shared,LoginPage,LoginPage,divider,"Or",,active
53
+ login.tab.sign_in,shared,LoginPage,LoginPage,tab_sign_in,"Sign in",,active
54
+ login.tab.sign_up,shared,LoginPage,LoginPage,tab_sign_up,"Create account",,active
55
+ login.field.name,shared,LoginPage,LoginPage,field_name,"Display name",,active
56
+ login.field.name_placeholder,shared,LoginPage,LoginPage,name_placeholder,"Optional",,active
57
+ login.field.email,shared,LoginPage,LoginPage,field_email,"Email",,active
58
+ login.field.password,shared,LoginPage,LoginPage,field_password,"Password",,active
59
+ login.password_hint,shared,LoginPage,LoginPage,pw_hint,"At least {{min}} characters.",,active
60
+ login.submit.sign_in,shared,LoginPage,LoginPage,submit_sign_in,"Sign in with email",,active
61
+ login.submit.sign_up,shared,LoginPage,LoginPage,submit_sign_up,"Create account",,active
62
+ login_modal.subtitle,shared,*,LoginModal,subtitle,"Sign in to join the leaderboard",,active
63
+ login_modal.continue_email,shared,*,LoginModal,continue_email,"Continue with Email",,active
64
+ login_modal.divider_email,shared,*,LoginModal,divider_email,"email",,active
65
+ shared.placeholder.short,shared,*,*,placeholder_short,"--",,active
66
+ shared.unit.percent,shared,*,*,unit_percent,"%",,active
67
+ shared.unit.thousand_abbrev,shared,*,*,unit_thousand_abbrev,"K",,active
68
+ shared.unit.million_abbrev,shared,*,*,unit_million_abbrev,"M",,active
69
+ shared.unit.billion_abbrev,shared,*,*,unit_billion_abbrev,"B",,active
70
+ shared.data_source,shared,*,*,label,"Data source: {{source}}",,active
71
+ shared.error.prefix,shared,*,*,label,"Error: {{error}}",,active
72
+ shared.status.unsynced,shared,*,*,status,"—",,active
73
+ error.boundary.title,shared,*,ErrorBoundary,title,"Something went wrong",,active
74
+ error.boundary.subtitle,shared,*,ErrorBoundary,subtitle,"This view failed to render",,active
75
+ error.boundary.hint,shared,*,ErrorBoundary,hint,"Open the console, then reload the page",,active
76
+ error.boundary.no_details,shared,*,ErrorBoundary,details,"No error details",,active
77
+ error.boundary.action.reload,shared,*,ErrorBoundary,action_reload,"Reload",,active
78
+
79
+ landing.handle.default,landing,LandingPage,LandingPage,handle_default,"VIBE_USER",,active
80
+ landing.handle.special,landing,LandingPage,LandingPage,handle_special,"VOLT",,active
81
+ landing.screenshot.alt,landing,LandingPage,LandingPage,screenshot_alt,"TokenTracker dashboard screenshot",,active
82
+ landing.nav.login,landing,LandingPage,LandingPage,nav_login,"LOGIN",,active
83
+ landing.nav.signup,landing,LandingPage,LandingPage,nav_signup,"SIGN UP",,active
84
+ landing.install.command,landing,LandingPage,LandingPage,install_command,"npx --yes tokentracker-cli",,active
85
+ landing.install.action.copy,landing,LandingPage,LandingPage,install_copy,"COPY COMMAND",,active
86
+ landing.install.action.copied,landing,LandingPage,LandingPage,install_copied,"COPIED",,active
87
+ landing.meta.title,landing,LandingPage,Meta,title,"Token Tracker — Token Usage Tracker for AI Agent CLIs",,active
88
+ landing.meta.description,landing,LandingPage,Meta,description,"Automatically monitor token usage across Claude Code, Cursor, Codex, and more. Local-first, privacy-focused, and zero manual configuration.",,active
89
+ landing.meta.og_site_name,landing,LandingPage,Meta,og_site_name,"Token Tracker",,active
90
+ landing.meta.og_type,landing,LandingPage,Meta,og_type,"website",,active
91
+ landing.meta.og_image,landing,LandingPage,Meta,og_image,"https://www.tokentracker.cc/dashboard-dark.png",,active
92
+ landing.meta.og_url,landing,LandingPage,Meta,og_url,"https://www.tokentracker.cc/",,active
93
+ landing.meta.twitter_card,landing,LandingPage,Meta,twitter_card,"summary_large_image",,active
94
+ share.meta.title,share,SharePage,Meta,title,"Token Tracker Share",,active
95
+ share.meta.description,share,SharePage,Meta,description,"Share a Token Tracker dashboard snapshot with token usage insights across models, projects, and time windows.",,active
96
+ share.meta.og_site_name,share,SharePage,Meta,og_site_name,"Token Tracker",,active
97
+ share.meta.og_type,share,SharePage,Meta,og_type,"website",,active
98
+ share.meta.og_image,share,SharePage,Meta,og_image,"https://www.tokentracker.cc/dashboard-dark.png",,active
99
+ share.meta.og_url,share,SharePage,Meta,og_url,"https://www.tokentracker.cc/share",,active
100
+ share.meta.twitter_card,share,SharePage,Meta,twitter_card,"summary_large_image",,active
101
+ landing.handle.placeholder,landing,LandingPage,LandingPage,handle_placeholder,"TRY '{{handle}}'",,active
102
+ landing.rank.expectation,landing,LandingPage,LandingPage,rank_expectation,"RANK_EXPECTATION: {{rank}}",,active
103
+ landing.rank.singularity,landing,LandingPage,LandingPage,rank_singularity,"APEX",,active
104
+ landing.rank.unranked,landing,LandingPage,LandingPage,rank_unranked,"UNRANKED",,active
105
+ landing.cta.primary,landing,LandingPage,LandingPage,cta_primary,"View Dashboard",,active
106
+ landing.cta.secondary,landing,LandingPage,LandingPage,cta_secondary,"GITHUB SOURCE",,active
107
+
108
+
109
+
110
+
111
+
112
+
113
+ landing.v2.hero.title_line1,landing,LandingPage,MarketingLanding,hero_title_1,"TRACK ALL YOUR",,active
114
+ landing.v2.hero.title_line2,landing,LandingPage,MarketingLanding,hero_title_2,"AI TOKENS",,active
115
+ landing.v2.install.mac_cta,landing,LandingPage,MarketingLanding,mac_cta,"MAC APP (DMG)",,active
116
+ landing.v2.models.title,landing,LandingPage,MarketingLanding,models_title,"SUPPORTED AI CLI TOOLS",,active
117
+ landing.v2.compare.kicker,landing,LandingPage,MarketingLanding,compare_kicker,"SEAMLESS TRACKING",,active
118
+ landing.v2.compare.title,landing,LandingPage,MarketingLanding,compare_title,"Stop guessing your AI usage.",,active
119
+ landing.v2.compare.subtitle,landing,LandingPage,MarketingLanding,compare_subtitle,"AI CLI tools hide your usage data in obscure local files. TokenTracker aggregates them into a single, beautiful dashboard in real-time.",,active
120
+ landing.v2.distill.body,landing,LandingPage,MarketingLanding,distill_body,"100% local processing. No prompts or code are ever collected.",,active
121
+ landing.v2.compare.with.title,landing,LandingPage,MarketingLanding,with_title,"WITH TOKEN TRACKER",,active
122
+ landing.v2.compare.with.p1,landing,LandingPage,MarketingLanding,with_p1,"Centralized usage dashboard",,active
123
+ landing.v2.compare.with.p2,landing,LandingPage,MarketingLanding,with_p2,"Real-time token metrics",,active
124
+ landing.v2.compare.with.p3,landing,LandingPage,MarketingLanding,with_p3,"100% local, privacy-guaranteed",,active
125
+ landing.v2.compare.without.title,landing,LandingPage,MarketingLanding,without_title,"WITHOUT IT",,active
126
+ landing.v2.compare.without.p1,landing,LandingPage,MarketingLanding,without_p1,"Scattered JSON log files",,active
127
+ landing.v2.compare.without.p2,landing,LandingPage,MarketingLanding,without_p2,"Blind to token consumption",,active
128
+ landing.v2.compare.without.p3,landing,LandingPage,MarketingLanding,without_p3,"Unexpected API bills",,active
129
+ landing.v2.footer.line,landing,LandingPage,MarketingLanding,footer_line,"Token Tracker — Made by developers, for developers.",,active
130
+ landing.v2.nav.github,landing,LandingPage,MarketingLanding,nav_github,"GITHUB",,active
131
+ landing.v2.models.agent.codex,landing,LandingPage,MarketingLanding,agent_codex,"CODEX",,active
132
+ landing.v2.models.agent.claude_code,landing,LandingPage,MarketingLanding,agent_claude_code,"CLAUDE CODE",,active
133
+ landing.v2.models.agent.cursor,landing,LandingPage,MarketingLanding,agent_cursor,"CURSOR",,active
134
+ landing.v2.models.agent.gemini,landing,LandingPage,MarketingLanding,agent_gemini,"GEMINI",,active
135
+ landing.v2.models.agent.opencode,landing,LandingPage,MarketingLanding,agent_opencode,"OPENCODE",,active
136
+ landing.v2.models.agent.openclaw,landing,LandingPage,MarketingLanding,agent_openclaw,"OPENCLAW",,active
137
+ landing.v2.cta.primary,landing,LandingPage,MarketingLanding,cta_primary,"Open Dashboard",,active
138
+ landing.v2.hero.subtagline,landing,LandingPage,MarketingLanding,hero_subtagline,"Automatically monitor token usage across Claude Code, Cursor, Codex, and more. Local-first, privacy-focused, and zero manual configuration.",,active
139
+
140
+
141
+
142
+
143
+ identity_card.rank_label,ui,IdentityCard,IdentityCard,rank_label,"Started",,active
144
+ identity_card.streak_label,ui,IdentityCard,IdentityCard,streak_label,"Active days",,active
145
+ identity_card.rank_placeholder,ui,IdentityCard,IdentityCard,rank_placeholder,"—",,active
146
+ identity_card.streak_value,ui,IdentityCard,IdentityCard,streak_value,"{{days}} DAY",,active
147
+
148
+
149
+ dashboard.core_index.collapse_label,dashboard,DashboardPage,UsagePanel,toggle,"▾",,active
150
+ dashboard.core_index.expand_label,dashboard,DashboardPage,UsagePanel,toggle,"▸",,active
151
+ dashboard.core_index.collapse_aria,dashboard,DashboardPage,UsagePanel,toggle_aria,"Collapse model breakdown",,active
152
+ dashboard.core_index.expand_aria,dashboard,DashboardPage,UsagePanel,toggle_aria,"Expand model breakdown",,active
153
+ usage.summary.total,ui,UsagePanel,UsagePanel,summary_label_total,"Total tokens",,active
154
+ usage.metric.total,ui,UsagePanel,UsagePanel,metric_total,"Total",,active
155
+ usage.metric.input,ui,UsagePanel,UsagePanel,metric_input,"Input",,active
156
+ usage.metric.output,ui,UsagePanel,UsagePanel,metric_output,"Output",,active
157
+ usage.metric.cached_input,ui,UsagePanel,UsagePanel,metric_cached_input,"Cached input",,active
158
+ usage.metric.reasoning_output,ui,UsagePanel,UsagePanel,metric_reasoning_output,"Reasoning output",,active
159
+ usage.button.refresh,ui,UsagePanel,UsagePanel,button_refresh,"Refresh",,active
160
+
161
+ dashboard.rolling.title,ui,RollingUsagePanel,RollingUsagePanel,title,"Recent Activity",,active
162
+ dashboard.rolling.last_7d,ui,RollingUsagePanel,RollingUsagePanel,label_last_7d,"Last 7 days",,active
163
+ dashboard.rolling.last_30d,ui,RollingUsagePanel,RollingUsagePanel,label_last_30d,"Last 30 days",,active
164
+ dashboard.rolling.avg_active_day,ui,RollingUsagePanel,RollingUsagePanel,label_avg_active_day,"Daily average",,active
165
+
166
+ dashboard.projects.title,ui,ProjectUsagePanel,ProjectUsagePanel,title,"Project Usage",,active
167
+ dashboard.projects.tokens_label,ui,ProjectUsagePanel,ProjectUsagePanel,tokens_label,"Tokens",,active
168
+ dashboard.projects.stars_label,ui,ProjectUsagePanel,ProjectUsagePanel,stars_label,"STAR",,active
169
+ dashboard.projects.limit_label,ui,ProjectUsagePanel,ProjectUsagePanel,limit_label,"Show",,active
170
+ dashboard.projects.limit_aria,ui,ProjectUsagePanel,ProjectUsagePanel,limit_aria,"Select repository limit",,active
171
+ dashboard.projects.limit_top_3,ui,ProjectUsagePanel,ProjectUsagePanel,limit_top_3,"TOP 3",,active
172
+ dashboard.projects.limit_top_6,ui,ProjectUsagePanel,ProjectUsagePanel,limit_top_6,"TOP 6",,active
173
+ dashboard.projects.limit_top_10,ui,ProjectUsagePanel,ProjectUsagePanel,limit_top_10,"TOP 10",,active
174
+ dashboard.projects.empty,ui,ProjectUsagePanel,ProjectUsagePanel,empty,"No public repositories",,active
175
+ dashboard.widgets.title,dashboard,DashboardPage,WidgetOnboardingCard,title,"Desktop Widgets",,active
176
+ dashboard.widgets.hint,dashboard,DashboardPage,WidgetOnboardingCard,hint,"Right-click your desktop → Edit Widgets → search ""TokenTracker""",,active
177
+ dashboard.widgets.dismiss_aria,dashboard,DashboardPage,WidgetOnboardingCard,dismiss_aria,"Dismiss widget intro",,active
178
+ widgets.page.title,dashboard,WidgetsPage,WidgetsPage,title,"Widgets",,active
179
+ widgets.cta.open_gallery,dashboard,WidgetsPage,WidgetsPage,cta_open_gallery,"Open Widget Gallery",,active
180
+ widgets.cta.download,dashboard,WidgetsPage,WidgetsPage,cta_download,"Download Mac App",,active
181
+ widgets.cta.macos_only,dashboard,WidgetsPage,WidgetsPage,cta_macos_only,"macOS only",,active
182
+ widgets.menubar.section.title,dashboard,WidgetsPage,WidgetsPage,menubar_section_title,"Menu Bar",,active
183
+ widgets.gallery.section.title,dashboard,WidgetsPage,WidgetsPage,gallery_section_title,"Desktop Widgets",,active
184
+ widgets.summary.name,dashboard,WidgetsPage,WidgetsPage,summary_name,"Usage Summary",,active
185
+ widgets.summary.description,dashboard,WidgetsPage,WidgetsPage,summary_desc,"Today and seven-day usage with a compact sparkline.",,active
186
+ widgets.heatmap.name,dashboard,WidgetsPage,WidgetsPage,heatmap_name,"Activity Heatmap",,active
187
+ widgets.heatmap.description,dashboard,WidgetsPage,WidgetsPage,heatmap_desc,"GitHub-style daily calendar. Spot streaks and quiet days at a glance.",,active
188
+ widgets.topModels.name,dashboard,WidgetsPage,WidgetsPage,topmodels_name,"Top Models",,active
189
+ widgets.topModels.description,dashboard,WidgetsPage,WidgetsPage,topmodels_desc,"Your heaviest-used models ranked by token share.",,active
190
+ widgets.limits.name,dashboard,WidgetsPage,WidgetsPage,limits_name,"Usage Limits",,active
191
+ widgets.limits.description,dashboard,WidgetsPage,WidgetsPage,limits_desc,"Live rate-limit progress for Claude, Codex, Cursor, Gemini and more.",,active
192
+ dashboard.cost_breakdown.title,ui,CostAnalysisModal,CostAnalysisModal,title,"Cost Breakdown",,active
193
+ dashboard.cost_breakdown.total_label,ui,CostAnalysisModal,CostAnalysisModal,total_label,"Estimated Total Cost",,active
194
+ dashboard.cost_breakdown.close,ui,CostAnalysisModal,CostAnalysisModal,close_label,"Close",,active
195
+
196
+
197
+ trend.monitor.label,ui,TrendMonitor,TrendMonitor,label,"Usage Trend",,active
198
+
199
+ heatmap.title,ui,ActivityHeatmap,ActivityHeatmap,title,"Activity Heatmap",,active
200
+ heatmap.empty,ui,ActivityHeatmap,ActivityHeatmap,empty_state,"No activity data yet.",,active
201
+ heatmap.legend.less,ui,ActivityHeatmap,ActivityHeatmap,legend_less,"Less",,active
202
+ heatmap.legend.more,ui,ActivityHeatmap,ActivityHeatmap,legend_more,"More",,active
203
+ heatmap.legend.utc,ui,ActivityHeatmap,ActivityHeatmap,legend_utc,"UTC",,active
204
+ heatmap.tooltip,ui,ActivityHeatmap,ActivityHeatmap,tooltip,"{{day}} • {{value}} {{unit}} • {{tz}}",,active
205
+ heatmap.unit.tokens,ui,ActivityHeatmap,ActivityHeatmap,unit_tokens,"tokens",,active
206
+ heatmap.iso.aria,ui,ActivityHeatmap,ActivityHeatmap3D,iso_aria,"3D isometric activity heatmap",,active
207
+ heatmap.view.2d,ui,ActivityHeatmap,ActivityHeatmap,view_2d,"2D",,active
208
+ heatmap.view.3d,ui,ActivityHeatmap,ActivityHeatmap,view_3d,"3D",,active
209
+ heatmap.month.jan,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Jan",,active
210
+ heatmap.month.feb,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Feb",,active
211
+ heatmap.month.mar,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Mar",,active
212
+ heatmap.month.apr,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Apr",,active
213
+ heatmap.month.may,ui,ActivityHeatmap,ActivityHeatmap,month_label,"May",,active
214
+ heatmap.month.jun,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Jun",,active
215
+ heatmap.month.jul,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Jul",,active
216
+ heatmap.month.aug,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Aug",,active
217
+ heatmap.month.sep,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Sep",,active
218
+ heatmap.month.oct,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Oct",,active
219
+ heatmap.month.nov,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Nov",,active
220
+ heatmap.month.dec,ui,ActivityHeatmap,ActivityHeatmap,month_label,"Dec",,active
221
+ heatmap.day.sun,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Sun",,active
222
+ heatmap.day.mon,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Mon",,active
223
+ heatmap.day.tue,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Tue",,active
224
+ heatmap.day.wed,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Wed",,active
225
+ heatmap.day.thu,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Thu",,active
226
+ heatmap.day.fri,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Fri",,active
227
+ heatmap.day.sat,ui,ActivityHeatmap,ActivityHeatmap,day_label,"Sat",,active
228
+
229
+
230
+
231
+
232
+ daily.sort.date.label,dashboard,DashboardPage,DailyTable,sort_label,"Date",,active
233
+ daily.sort.date.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Date",,active
234
+ daily.sort.total.label,dashboard,DashboardPage,DailyTable,sort_label,"Total",,active
235
+ daily.sort.total.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Total",,active
236
+ daily.sort.input.label,dashboard,DashboardPage,DailyTable,sort_label,"Input",,active
237
+ daily.sort.input.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Input",,active
238
+ daily.sort.output.label,dashboard,DashboardPage,DailyTable,sort_label,"Output",,active
239
+ daily.sort.output.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Output",,active
240
+ daily.sort.cached.label,dashboard,DashboardPage,DailyTable,sort_label,"Cached",,active
241
+ daily.sort.cached.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Cached input",,active
242
+ daily.sort.reasoning.label,dashboard,DashboardPage,DailyTable,sort_label,"Reasoning",,active
243
+ daily.sort.reasoning.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Reasoning output",,active
244
+ daily.sort.conversations.label,dashboard,DashboardPage,DailyTable,sort_label,"Convs",,active
245
+ daily.sort.conversations.title,dashboard,DashboardPage,DailyTable,sort_title,"Sort by Conversations",,active
246
+ details.pagination.prev,dashboard,DashboardPage,DailyTable,pagination_prev,"Prev",,active
247
+ details.pagination.next,dashboard,DashboardPage,DailyTable,pagination_next,"Next",,active
248
+
249
+
250
+
251
+ leaderboard.profile.nav.back,dashboard,LeaderboardProfilePage,Header,nav_back,"$ Leaderboard",,active
252
+ leaderboard.title,dashboard,LeaderboardPage,LeaderboardPage,title,"Leaderboard",,active
253
+ leaderboard.range,dashboard,LeaderboardPage,LeaderboardPage,range,"UTC {{period}} · {{from}} – {{to}}",,active
254
+ leaderboard.range_loading,dashboard,LeaderboardPage,LeaderboardPage,range_loading,"UTC {{period}} · …",,active
255
+ leaderboard.range.total,dashboard,LeaderboardPage,LeaderboardPage,range_total,"All time",,active
256
+ leaderboard.generated_at,dashboard,LeaderboardPage,LeaderboardPage,generated_at,"Updated {{ts}}",,active
257
+ leaderboard.period.week,dashboard,LeaderboardPage,LeaderboardPage,period_week,"Week",,active
258
+ leaderboard.period.month,dashboard,LeaderboardPage,LeaderboardPage,period_month,"Month",,active
259
+ leaderboard.period.total,dashboard,LeaderboardPage,LeaderboardPage,period_total,"All",,active
260
+
261
+ leaderboard.me_label,dashboard,LeaderboardPage,LeaderboardPage,me_label,"You",,active
262
+ leaderboard.anon_label,dashboard,LeaderboardPage,LeaderboardPage,anon_label,"Anonymous",,active
263
+ leaderboard.error.unknown,dashboard,LeaderboardPage,LeaderboardPage,error_unknown,"Unknown error",,active
264
+
265
+
266
+
267
+ leaderboard.loading,dashboard,LeaderboardPage,LeaderboardPage,state_loading,"Loading…",,active
268
+ leaderboard.empty,dashboard,LeaderboardPage,LeaderboardPage,state_empty,"No data",,active
269
+
270
+ leaderboard.column.rank,dashboard,LeaderboardPage,LeaderboardPage,column_rank,"Rank",,active
271
+ leaderboard.column.user,dashboard,LeaderboardPage,LeaderboardPage,column_user,"User",,active
272
+ leaderboard.column.total,dashboard,LeaderboardPage,LeaderboardPage,column_total,"Total",,active
273
+ leaderboard.column.codex,dashboard,LeaderboardPage,LeaderboardPage,column_codex,"Codex",,active
274
+ leaderboard.column.claude,dashboard,LeaderboardPage,LeaderboardPage,column_claude,"Claude",,active
275
+ leaderboard.column.gemini,dashboard,LeaderboardPage,LeaderboardPage,column_gemini,"Gemini",,active
276
+ leaderboard.column.cursor,dashboard,LeaderboardPage,LeaderboardPage,column_cursor,"Cursor",,active
277
+ leaderboard.column.opencode,dashboard,LeaderboardPage,LeaderboardPage,column_opencode,"OpenCode",,active
278
+ leaderboard.column.openclaw,dashboard,LeaderboardPage,LeaderboardPage,column_openclaw,"OpenClaw",,active
279
+ leaderboard.column.hermes,dashboard,LeaderboardPage,LeaderboardPage,column_hermes,"Hermes",,active
280
+ leaderboard.column.kiro,dashboard,LeaderboardPage,LeaderboardPage,column_kiro,"Kiro",,active
281
+ leaderboard.column.copilot,dashboard,LeaderboardPage,LeaderboardPage,column_copilot,"GitHub Copilot",,active
282
+ leaderboard.column.kimi,dashboard,LeaderboardPage,LeaderboardPage,column_kimi,"Kimi Code",,active
283
+ leaderboard.column.kilo-cli,dashboard,LeaderboardPage,LeaderboardPage,column_kilo_cli,"Kilo CLI",,active
284
+ leaderboard.column.kilo-code,dashboard,LeaderboardPage,LeaderboardPage,column_kilo_code,"Kilo Code",,active
285
+ limits.copilot.otelHint.title,dashboard,LimitsPage,LimitsPage,otel_hint_title,"Track Copilot token usage",,active
286
+ limits.copilot.otelHint.body,dashboard,LimitsPage,LimitsPage,otel_hint_body,"Limits load via your GitHub OAuth token. To also record per-token usage, enable Copilot's OpenTelemetry export and add these lines to your shell profile (~/.zshrc or ~/.bashrc):",,active
287
+ limits.copilot.otelHint.copy,dashboard,LimitsPage,LimitsPage,otel_hint_copy,"Copy",,active
288
+ limits.copilot.otelHint.copied,dashboard,LimitsPage,LimitsPage,otel_hint_copied,"Copied",,active
289
+ leaderboard.column.supplemental,dashboard,LeaderboardPage,LeaderboardPage,column_supplemental,"Supplemental",,active
290
+
291
+
292
+ leaderboard.pagination.prev,dashboard,LeaderboardPage,LeaderboardPage,pagination_prev,"Previous",,active
293
+ leaderboard.pagination.next,dashboard,LeaderboardPage,LeaderboardPage,pagination_next,"Next",,active
294
+ leaderboard.pagination.ellipsis,dashboard,LeaderboardPage,LeaderboardPage,pagination_ellipsis,"…",,active
295
+ leaderboard.pagination.page_unknown,dashboard,LeaderboardPage,LeaderboardPage,pagination_unknown,"Page {{page}}",,active
296
+
297
+
298
+
299
+
300
+ dashboard.session_expired.copy_label,dashboard,DashboardPage,AsciiBox,body,"run npx --yes tokentracker-cli init",,active
301
+ dashboard.session_expired.copied,dashboard,DashboardPage,AsciiBox,body,"copied",,active
302
+
303
+
304
+ dashboard.install.prompt,dashboard,DashboardPage,AsciiBox,install_prompt,"Install Node.js 18+ then run:",,active
305
+ dashboard.install.cmd.init,dashboard,DashboardPage,AsciiBox,install_cmd,"npx --yes tokentracker-cli init",,active
306
+ dashboard.install.cmd.init_link_code,dashboard,DashboardPage,AsciiBox,install_cmd,"npx --yes tokentracker-cli init --link-code {{link_code}}",,active
307
+ dashboard.install.copy,dashboard,DashboardPage,AsciiBox,install_copy,"Copy install command",,active
308
+ dashboard.install.copy_base,dashboard,DashboardPage,AsciiBox,install_copy,"Copy init command",,active
309
+ dashboard.install.copied,dashboard,DashboardPage,AsciiBox,install_copy,"Copied to clipboard",,active
310
+ dashboard.install.link_code.loading,dashboard,DashboardPage,AsciiBox,install_status,"Generating private code...",,active
311
+ dashboard.install.link_code.failed,dashboard,DashboardPage,AsciiBox,install_status,"Private code unavailable",,active
312
+ dashboard.install.cmd.sync,dashboard,DashboardPage,AsciiBox,install_cmd,"npx --yes tokentracker-cli sync",,active
313
+
314
+
315
+
316
+ dashboard.daily.title,dashboard,DashboardPage,AsciiBox,title,"Daily Breakdown",,active
317
+ dashboard.daily.empty,dashboard,DashboardPage,AsciiBox,empty_state,"No data yet. Use your AI CLI then run {{cmd}}.",,active
318
+
319
+ dashboard.identity.title,dashboard,DashboardPage,IdentityCard,title,"Your Profile",,active
320
+ dashboard.identity.subtitle,dashboard,DashboardPage,IdentityCard,subtitle,"Track your coding journey",,active
321
+ dashboard.identity.fallback,dashboard,DashboardPage,IdentityCard,handle_fallback,"Anonymous",,active
322
+
323
+
324
+ dashboard.screenshot.title_line1,dashboard,DashboardPage,ScreenshotTitle,title_line,"Coding Agent",,active
325
+ dashboard.screenshot.title_line2,dashboard,DashboardPage,ScreenshotTitle,title_line,"2025 Wrapped",,active
326
+ dashboard.screenshot.twitter_button,dashboard,DashboardPage,ScreenshotShare,button_label,"Share on X",,active
327
+ dashboard.screenshot.twitter_label,dashboard,DashboardPage,ScreenshotShare,aria_label,"Share on X",,active
328
+ dashboard.screenshot.twitter_hint,dashboard,DashboardPage,ScreenshotShare,helper_text,"Auto-copies image to clipboard",,active
329
+ dashboard.screenshot.twitter_text,dashboard,DashboardPage,ScreenshotShare,share_text,"{{total_tokens}} tokens on the record.\\n{{model_name}} led with {{model_percent}}%.\\n\\nMy AI usage, unaudited →\\ntokentracker.cc",,active
330
+
331
+ nav.usage,shared,*,Sidebar,nav_usage,"Tokens",,active
332
+ nav.limits,shared,*,Sidebar,nav_limits,"Limits",,active
333
+ nav.widgets,shared,*,Sidebar,nav_widgets,"macOS Widgets",,active
334
+ nav.leaderboard,shared,*,Sidebar,nav_leaderboard,"Leaderboard",,active
335
+ nav.collapse,shared,*,Sidebar,nav_collapse,"Collapse sidebar",,active
336
+ nav.expand,shared,*,Sidebar,nav_expand,"Expand sidebar",,active
337
+ nav.menu,shared,*,Sidebar,nav_menu,"Open navigation menu",,active
338
+ nav.close_menu,shared,*,Sidebar,nav_close_menu,"Close navigation menu",,active
339
+ nav.aside_label,shared,*,Sidebar,aside_label,"Main navigation",,active
340
+ nav.nav_label,shared,*,Sidebar,nav_label,"Primary",,active
341
+ limits.page.subtitle,ui,LimitsPage,LimitsPage,subtitle,"Rate limits and quota usage across your AI tools.",,active
342
+ limits.settings.toggle_visible,ui,LimitsPage,LimitsSettingsPanel,toggle_visible,"Toggle visibility",,active
343
+ limits.page.openSettings,ui,LimitsPage,LimitsPage,open_settings,"Display settings",,active
344
+ nav.group.general,shared,*,Sidebar,group_general,"General",,active
345
+ nav.group.tools,shared,*,Sidebar,group_tools,"Tools",,active
346
+ nav.group.account,shared,*,Sidebar,group_account,"Account",,active
347
+ nav.settings,shared,*,Sidebar,nav_settings,"Settings",,active
348
+ header.auth.open_settings,shared,*,InsforgeUserHeaderControls,open_settings,"Open settings",,active
349
+ settings.page.title,ui,SettingsPage,SettingsPage,title,"Settings",,active
350
+ settings.page.subtitle,ui,SettingsPage,SettingsPage,subtitle,"Manage your account, appearance, and display preferences.",,active
351
+ settings.section.appearance,ui,SettingsPage,SettingsPage,sec_appearance,"Appearance",,active
352
+ settings.section.account,ui,SettingsPage,SettingsPage,sec_account,"Account",,active
353
+ settings.section.limits,ui,SettingsPage,SettingsPage,sec_limits,"Limits Display",,active
354
+ settings.appearance.theme.label,ui,SettingsPage,SettingsPage,theme_label,"Theme",,active
355
+ settings.appearance.theme.hint,ui,SettingsPage,SettingsPage,theme_hint,"Choose how Token Tracker looks across the dashboard.",,active
356
+ settings.appearance.theme.light,ui,SettingsPage,SettingsPage,theme_light,"Light",,active
357
+ settings.appearance.theme.dark,ui,SettingsPage,SettingsPage,theme_dark,"Dark",,active
358
+ settings.appearance.theme.system,ui,SettingsPage,SettingsPage,theme_system,"System",,active
359
+ settings.appearance.currency.label,ui,SettingsPage,SettingsPage,currency_label,"Currency",,active
360
+ settings.appearance.currency.hint,ui,SettingsPage,SettingsPage,currency_hint,"Select the display currency for usage costs.",,active
361
+ settings.appearance.currency.opt.usd,ui,SettingsPage,SettingsPage,currency_opt_usd,"USD ($)",,active
362
+ settings.appearance.currency.opt.eur,ui,SettingsPage,SettingsPage,currency_opt_eur,"EUR (€)",,active
363
+ settings.appearance.currency.opt.gbp,ui,SettingsPage,SettingsPage,currency_opt_gbp,"GBP (£)",,active
364
+ settings.appearance.currency.opt.cny,ui,SettingsPage,SettingsPage,currency_opt_cny,"CNY (¥)",,active
365
+ settings.appearance.currency.opt.jpy,ui,SettingsPage,SettingsPage,currency_opt_jpy,"JPY (¥)",,active
366
+ settings.appearance.currency.opt.hkd,ui,SettingsPage,SettingsPage,currency_opt_hkd,"HKD (HK$)",,active
367
+ settings.appearance.currency.rate_source.default,ui,SettingsPage,SettingsPage,rate_source_default,"Bundled default rate",,active
368
+ settings.appearance.currency.rate_source.fetched,ui,SettingsPage,SettingsPage,rate_source_fetched,"Source: open.er-api.com",,active
369
+ settings.appearance.currency.rate_updated,ui,SettingsPage,SettingsPage,rate_updated,"updated {{when}}",,active
370
+ settings.appearance.currency.rate_never,ui,SettingsPage,SettingsPage,rate_never,"awaiting first refresh",,active
371
+ settings.account.displayName,ui,SettingsPage,SettingsPage,display_name,"Display name",,active
372
+ settings.account.edit,ui,SettingsPage,SettingsPage,edit,"Edit",,active
373
+ settings.account.save,ui,SettingsPage,SettingsPage,save,"Save",,active
374
+ settings.account.saving,ui,SettingsPage,SettingsPage,saving,"Saving...",,active
375
+ settings.account.cancel,ui,SettingsPage,SettingsPage,cancel,"Cancel",,active
376
+ settings.account.userId,ui,SettingsPage,SettingsPage,user_id,"User ID",,active
377
+ settings.account.copyUserId,ui,SettingsPage,SettingsPage,copy_user_id,"Copy user ID",,active
378
+ settings.account.copy,ui,SettingsPage,SettingsPage,copy,"Copy",,active
379
+ settings.account.copied,ui,SettingsPage,SettingsPage,copied,"Copied",,active
380
+ settings.account.cloudSync,ui,SettingsPage,SettingsPage,cloud_sync,"Cloud sync",,active
381
+ settings.account.cloudSyncHint,ui,SettingsPage,SettingsPage,cloud_sync_hint,"Upload local usage to your Token Tracker cloud account.",,active
382
+ settings.account.publicProfile,ui,SettingsPage,SettingsPage,public_profile,"Public profile",,active
383
+ settings.account.publicProfileHint,ui,SettingsPage,SettingsPage,public_profile_hint,"Show your usage on the public leaderboard.",,active
384
+ settings.account.displayNameAnonymousHint,ui,SettingsPage,SettingsPage,display_name_anon_hint,"Anonymous — your name and avatar are hidden on the leaderboard",,active
385
+ settings.account.displayNameDisabledWhileAnon,ui,SettingsPage,SettingsPage,display_name_disabled,"Turn on the switch first to edit your name",,active
386
+ settings.account.githubUrl,ui,SettingsPage,SettingsPage,github_url,"GitHub profile",,active
387
+ settings.account.githubUrlHint,ui,SettingsPage,SettingsPage,github_url_hint,"Show a GitHub link next to your name on the leaderboard.",,active
388
+ settings.account.githubUrlPlaceholder,ui,SettingsPage,SettingsPage,github_url_placeholder,"username or https://github.com/username",,active
389
+ settings.account.githubUrlInvalid,ui,SettingsPage,SettingsPage,github_url_invalid,"Use a GitHub username or https://github.com/username URL.",,active
390
+ leaderboard.github.aria,ui,LeaderboardPage,LeaderboardPage,github_aria,"Open GitHub profile",,active
391
+ auth.callback.processing,ui,*,NativeAuthCallbackPage,processing,"Processing…",,active
392
+ auth.callback.success,ui,*,NativeAuthCallbackPage,success,"Signed in successfully",,active
393
+ auth.callback.redirecting,ui,*,NativeAuthCallbackPage,redirecting,"Returning to TokenTracker…",,active
394
+ auth.callback.failed,ui,*,NativeAuthCallbackPage,failed,"Sign-in incomplete. Please try again.",,active
395
+ auth.callback.close,ui,*,NativeAuthCallbackPage,close,"Close this page",,active
396
+ stats.period.today,ui,DashboardPage,StatsPanel,period_today,"today",,active
397
+ stats.period.week,ui,DashboardPage,StatsPanel,period_week,"week",,active
398
+ stats.period.month,ui,DashboardPage,StatsPanel,period_month,"month",,active
399
+ stats.period.all,ui,DashboardPage,StatsPanel,period_all,"all",,active
400
+ stats.period.convs,ui,DashboardPage,StatsPanel,period_convs,"convs",,active
401
+ leaderboard.column.est_cost,ui,LeaderboardPage,LeaderboardPage,column_est_cost,"Est. Cost",,active
402
+ leaderboard.signin_prompt,ui,LeaderboardPage,LeaderboardPage,signin_prompt,"Sign in to join the leaderboard",,active
403
+ leaderboard.signin_button,ui,LeaderboardPage,LeaderboardPage,signin_button,"Sign In",,active
404
+ leaderboard.sync_prompt,ui,LeaderboardPage,LeaderboardPage,sync_prompt,"Enable Cloud Sync to appear in rankings",,active
405
+ leaderboard.sync_button.idle,ui,LeaderboardPage,LeaderboardPage,sync_button_idle,"Enable & Sync",,active
406
+ leaderboard.sync_button.busy,ui,LeaderboardPage,LeaderboardPage,sync_button_busy,"Syncing...",,active
407
+ leaderboard.pagination.page_size_label,ui,LeaderboardPage,LeaderboardPage,page_size_label,"Rows per page",,active
408
+ leaderboard.github.tooltipAction,ui,LeaderboardPage,LeaderboardPage,github_tooltip_action,"Click to open GitHub profile",,active
409
+ leaderboard.github.tooltipPrefix,ui,LeaderboardPage,LeaderboardPage,github_tooltip_prefix,"Set yours in",,active
410
+ leaderboard.github.tooltipSettingsLink,ui,LeaderboardPage,LeaderboardPage,github_tooltip_link,"Settings",,active
411
+ leaderboard.github.tooltipSuffix,ui,LeaderboardPage,LeaderboardPage,github_tooltip_suffix," to appear here",,active
412
+ leaderboard.summary.percentile,ui,LeaderboardPage,LeaderboardMeChip,summary_percentile,"Top {{p}}%",,active
413
+ leaderboard.summary.jump_to_me,ui,LeaderboardPage,LeaderboardMeChip,summary_jump_to_me,"Jump to my row",,active
414
+ settings.account.signOut,ui,SettingsPage,SettingsPage,sign_out,"Sign out",,active
415
+ settings.account.signIn,ui,SettingsPage,SettingsPage,sign_in,"Sign in",,active
416
+ settings.account.signedOutHint,ui,SettingsPage,SettingsPage,signed_out_hint,"Sign in to manage cloud sync and leaderboard preferences.",,active
417
+ settings.section.menubar,ui,SettingsPage,SettingsPage,sec_menubar,"Menu Bar App",,active
418
+ settings.menubar.showStats,ui,SettingsPage,SettingsPage,mb_show_stats,"Show stats in menu bar",,active
419
+ settings.menubar.showStatsHint,ui,SettingsPage,SettingsPage,mb_show_stats_hint,"Display today's token count and cost beside the menu bar icon.",,active
420
+ settings.menubar.animatedIcon,ui,SettingsPage,SettingsPage,mb_anim,"Animated icon",,active
421
+ settings.menubar.animatedIconHint,ui,SettingsPage,SettingsPage,mb_anim_hint,"Blink the Clawd character and play the syncing animation in the menu bar.",,active
422
+ settings.menubar.launchAtLogin,ui,SettingsPage,SettingsPage,mb_login,"Launch at login",,active
423
+ settings.menubar.launchAtLoginHint,ui,SettingsPage,SettingsPage,mb_login_hint,"Start TokenTrackerBar automatically when you sign in to macOS.",,active
424
+ settings.menubar.syncNow,ui,SettingsPage,SettingsPage,mb_sync_now,"Sync now",,active
425
+ settings.menubar.syncNowHint,ui,SettingsPage,SettingsPage,mb_sync_now_hint,"Trigger an immediate parse and upload of local AI tool logs.",,active
426
+ settings.menubar.syncing,ui,SettingsPage,SettingsPage,mb_syncing,"Syncing…",,active
427
+ settings.menubar.updates,ui,SettingsPage,SettingsPage,mb_updates,"Updates",,active
428
+ settings.menubar.checkUpdates,ui,SettingsPage,SettingsPage,mb_check_updates,"Check for updates",,active
429
+ menubar.slot.primary,ui,WidgetsPage,MenuBarDisplayCard,slot_primary,"Primary slot",,active
430
+ menubar.slot.secondary,ui,WidgetsPage,MenuBarDisplayCard,slot_secondary,"Secondary slot",,active
431
+ menubar.native_only,ui,WidgetsPage,MenuBarDisplayCard,native_only,"Open TokenTrackerBar for macOS to edit the live menu bar display.",,active
432
+ menubar.metric.today_tokens,ui,WidgetsPage,MenuBarDisplayCard,metric_today_tokens,"Today Tokens",,active
433
+ menubar.metric.today_cost,ui,WidgetsPage,MenuBarDisplayCard,metric_today_cost,"Today Cost",,active
434
+ menubar.metric.last_7d_tokens,ui,WidgetsPage,MenuBarDisplayCard,metric_last_7d,"Last 7 Days",,active
435
+ menubar.metric.total_tokens,ui,WidgetsPage,MenuBarDisplayCard,metric_total_tokens,"Total Tokens",,active
436
+ menubar.metric.total_cost,ui,WidgetsPage,MenuBarDisplayCard,metric_total_cost,"Total Cost",,active
437
+ menubar.metric.claude_5h,ui,WidgetsPage,MenuBarDisplayCard,metric_claude_5h,"Claude 5h Limit",,active
438
+ menubar.metric.claude_7d,ui,WidgetsPage,MenuBarDisplayCard,metric_claude_7d,"Claude 7d Limit",,active
439
+ menubar.metric.codex_5h,ui,WidgetsPage,MenuBarDisplayCard,metric_codex_5h,"Codex 5h Limit",,active
440
+ menubar.metric.codex_7d,ui,WidgetsPage,MenuBarDisplayCard,metric_codex_7d,"Codex 7d Limit",,active
441
+ share.modal.title,share,DashboardPage,ShareModal,title,"Share your stats",,active
442
+ share.modal.subtitle,share,DashboardPage,ShareModal,subtitle,"Generate a poster-style card and share anywhere.",,active
443
+ share.modal.close,share,DashboardPage,ShareModal,close,"Close",,active
444
+ share.modal.action.x,share,DashboardPage,ShareModal,action_x,"Share on X",,active
445
+ share.modal.action.download,share,DashboardPage,ShareModal,action_download,"Download",,active
446
+ share.modal.action.copy,share,DashboardPage,ShareModal,action_copy,"Copy image",,active
447
+ share.modal.hint.x,share,DashboardPage,ShareModal,hint_x,"Paste image in tweet",,active
448
+ share.modal.hint.copy,share,DashboardPage,ShareModal,hint_copy,"to clipboard",,active
449
+ share.modal.name_label,share,DashboardPage,ShareModal,name_label,"Display name",,active
450
+ share.modal.name_placeholder,share,DashboardPage,ShareModal,name_placeholder,"Enter your name",,active
451
+ share.modal.footer,share,DashboardPage,ShareModal,footer,"Your data stays local — images are generated in your browser and never uploaded.",,active
452
+ share.button.label,share,DashboardPage,DashboardHeader,share_button,"Share",,active
453
+ share.button.aria,share,DashboardPage,DashboardHeader,share_button_aria,"Open share card",,active
454
+ share.toast.copied,share,DashboardPage,ShareModal,toast_copied,"Image copied to clipboard",,active
455
+ share.toast.downloaded,share,DashboardPage,ShareModal,toast_downloaded,"Image saved",,active
456
+ share.toast.failed,share,DashboardPage,ShareModal,toast_failed,"Couldn't generate image",,active
457
+ share.toast.working,share,DashboardPage,ShareModal,toast_working,"Generating…",,active
458
+ share.modal.style_label,share,DashboardPage,ShareModal,style_label,"Style",,active
459
+ share.variant.neon,share,DashboardPage,ShareModal,variant_neon,"Neon",,active
460
+ share.variant.broadsheet,share,DashboardPage,ShareModal,variant_broadsheet,"Broadsheet",,active
461
+ share.date.month_year,share,DashboardPage,ShareCard,date_month_year,"{{month}} {{year}}",,active
462
+ share.issue.all_time,share,DashboardPage,ShareCard,issue_all_time,"ALL TIME",,active
463
+ share.month_short.jan,share,DashboardPage,ShareCard,month_short,"JAN",,active
464
+ share.month_short.feb,share,DashboardPage,ShareCard,month_short,"FEB",,active
465
+ share.month_short.mar,share,DashboardPage,ShareCard,month_short,"MAR",,active
466
+ share.month_short.apr,share,DashboardPage,ShareCard,month_short,"APR",,active
467
+ share.month_short.may,share,DashboardPage,ShareCard,month_short,"MAY",,active
468
+ share.month_short.jun,share,DashboardPage,ShareCard,month_short,"JUN",,active
469
+ share.month_short.jul,share,DashboardPage,ShareCard,month_short,"JUL",,active
470
+ share.month_short.aug,share,DashboardPage,ShareCard,month_short,"AUG",,active
471
+ share.month_short.sep,share,DashboardPage,ShareCard,month_short,"SEP",,active
472
+ share.month_short.oct,share,DashboardPage,ShareCard,month_short,"OCT",,active
473
+ share.month_short.nov,share,DashboardPage,ShareCard,month_short,"NOV",,active
474
+ share.month_short.dec,share,DashboardPage,ShareCard,month_short,"DEC",,active
475
+ share.hook.top_loyal,share,DashboardPage,ShareCard,hook_top_loyal,"{{percent}}% loyal to {{name}}.",,active
476
+ share.hook.days_record,share,DashboardPage,ShareCard,hook_days_record,"{{days}} days on the record.",,active
477
+ share.hook.top_led,share,DashboardPage,ShareCard,hook_top_led,"Led by {{name}} ({{percent}}%).",,active
478
+ share.hook.multi_models,share,DashboardPage,ShareCard,hook_multi_models,"Across {{count}} models, {{days}} days.",,active
479
+ share.hook.days_with_model,share,DashboardPage,ShareCard,hook_days_with_model,"{{days}} days with {{name}}.",,active
480
+ share.hook.new_chapter,share,DashboardPage,ShareCard,hook_new_chapter,"The beginning of a new chapter.",,active
481
+ share.card.broadsheet.issue,share,DashboardPage,BroadsheetCard,issue_label,"Issue",,active
482
+ share.card.broadsheet.by,share,DashboardPage,BroadsheetCard,by_label,"By",,active
483
+ share.card.broadsheet.tracked_since,share,DashboardPage,BroadsheetCard,tracked_since,"Tracked since",,active
484
+ share.card.broadsheet.total_tokens,share,DashboardPage,BroadsheetCard,total_tokens,"Total tokens",,active
485
+ share.card.broadsheet.estimated_spend,share,DashboardPage,BroadsheetCard,estimated_spend,"Estimated spend",,active
486
+ share.card.broadsheet.billable_days,share,DashboardPage,BroadsheetCard,billable_days,"{{days}} billable days",,active
487
+ share.card.broadsheet.heatmap_title,share,DashboardPage,BroadsheetCard,heatmap_title,"The Year in Print",,active
488
+ share.card.broadsheet.heatmap_days_on_record,share,DashboardPage,BroadsheetCard,heatmap_days,"{{active}} / {{total}} days on record",,active
489
+ share.card.broadsheet.roster_title,share,DashboardPage,BroadsheetCard,roster_title,"The Roster",,active
490
+ share.card.broadsheet.roster_subtitle,share,DashboardPage,BroadsheetCard,roster_subtitle,"Models in regular rotation",,active
491
+ share.card.broadsheet.empty,share,DashboardPage,BroadsheetCard,empty,"An empty week — the press was quiet.",,active
492
+ share.card.broadsheet.global_rank,share,DashboardPage,BroadsheetCard,global_rank,"Global rank",,active
493
+ share.card.broadsheet.active_days,share,DashboardPage,BroadsheetCard,active_days,"Active",,active
494
+ share.card.broadsheet.days_count,share,DashboardPage,BroadsheetCard,days_count,"{{days}} days",,active
495
+ share.card.broadsheet.track_yours,share,DashboardPage,BroadsheetCard,track_yours,"Track yours",,active
496
+ share.card.annual.report_title,share,DashboardPage,AnnualReportCard,report_title,"Token Report",,active
497
+ share.card.annual.less,share,DashboardPage,AnnualReportCard,legend_less,"Less",,active
498
+ share.card.annual.more,share,DashboardPage,AnnualReportCard,legend_more,"More",,active
499
+ share.card.annual.heatmap_title,share,DashboardPage,AnnualReportCard,heatmap_title,"TOKEN USAGE HEATMAP",,active
500
+ share.card.annual.total_tokens,share,DashboardPage,AnnualReportCard,total_tokens,"Total Tokens",,active
501
+ share.card.annual.estimated_cost,share,DashboardPage,AnnualReportCard,estimated_cost,"Estimated Cost",,active
502
+ share.card.annual.longest_streak,share,DashboardPage,AnnualReportCard,longest_streak,"Longest Streak",,active
503
+ share.card.annual.days_count,share,DashboardPage,AnnualReportCard,days_count,"{{days}} days",,active
504
+ share.card.annual.top_model,share,DashboardPage,AnnualReportCard,top_model,"Top Model",,active
505
+ usage.period.day,ui,DashboardPage,UsageOverview,period_day,"Day",,active
506
+ usage.period.week,ui,DashboardPage,UsageOverview,period_week,"Week",,active
507
+ usage.period.month,ui,DashboardPage,UsageOverview,period_month,"Month",,active
508
+ usage.period.total,ui,DashboardPage,UsageOverview,period_total,"Total",,active
509
+ usage.period.custom,ui,DashboardPage,UsageOverview,period_custom,"Custom",,active
510
+ usage.overview.tablist_aria,ui,DashboardPage,UsageOverview,tablist_aria,"Time period",,active
511
+ usage.overview.cost_breakdown_aria,ui,DashboardPage,UsageOverview,cost_breakdown_aria,"View cost breakdown",,active
512
+ usage.overview.distribution_aria,ui,DashboardPage,UsageOverview,distribution_aria,"Provider distribution: {{items}}",,active
513
+ usage.overview.distribution_item,ui,DashboardPage,UsageOverview,distribution_item,"{{label}} {{percent}}%",,active
514
+ usage.overview.provider_card_aria,ui,DashboardPage,UsageOverview,provider_card_aria,"{{provider}}: {{percent}}%, {{tokens}} tokens, {{cost}}. Click to {{action}} details",,active
515
+ usage.overview.expand,ui,DashboardPage,UsageOverview,expand,"expand",,active
516
+ usage.overview.collapse,ui,DashboardPage,UsageOverview,collapse,"collapse",,active
517
+ usage.overview.model_count,ui,DashboardPage,UsageOverview,model_count,"{{count}} models",,active
518
+ usage.overview.model_details_aria,ui,DashboardPage,UsageOverview,model_details_aria,"{{provider}} model details",,active
519
+ usage.overview.antigravity_notice_title,ui,DashboardPage,UsageOverview,antigravity_notice_title,"Estimated tokens",,active
520
+ usage.overview.antigravity_notice_body,ui,DashboardPage,UsageOverview,antigravity_notice_body,"Antigravity transcripts don't record real usage numbers. These counts are estimated from text length (~4 chars/token) and don't reflect Gemini's prompt-cache discount, so treat them as an upper bound, not a billing figure.",,active
521
+ limits.panel.title,ui,LimitsPage,UsageLimitsPanel,title,"Usage Limits",,active
522
+ limits.label.cursor_plan,ui,LimitsPage,UsageLimitsPanel,cursor_plan,"Plan",,active
523
+ limits.label.cursor_auto,ui,LimitsPage,UsageLimitsPanel,cursor_auto,"Auto",,active
524
+ limits.label.cursor_api,ui,LimitsPage,UsageLimitsPanel,cursor_api,"API",,active
525
+ limits.label.kiro_month,ui,LimitsPage,UsageLimitsPanel,kiro_month,"Month",,active
526
+ limits.label.kiro_bonus,ui,LimitsPage,UsageLimitsPanel,kiro_bonus,"Bonus",,active
527
+ limits.label.kimi_weekly,ui,LimitsPage,UsageLimitsPanel,kimi_weekly,"Weekly",,active
528
+ limits.label.kimi_5h,ui,LimitsPage,UsageLimitsPanel,kimi_5h,"5h",,active
529
+ limits.label.kimi_total,ui,LimitsPage,UsageLimitsPanel,kimi_total,"Total",,active
530
+ limits.label.kimi_parallel,ui,LimitsPage,UsageLimitsPanel,kimi_parallel,"Parallel: {{count}}",,active
531
+ limits.label.copilot_premium,ui,LimitsPage,UsageLimitsPanel,copilot_premium,"Premium",,active
532
+ limits.label.copilot_chat,ui,LimitsPage,UsageLimitsPanel,copilot_chat,"Chat",,active
533
+ limits.status.not_connected,ui,LimitsPage,UsageLimitsPanel,status_not_connected,"Not connected",,active
534
+ limits.status.no_data,ui,LimitsPage,UsageLimitsPanel,status_no_data,"No live limit data returned",,active
535
+ limits.status.all_hidden,ui,LimitsPage,UsageLimitsPanel,status_all_hidden,"All limit providers are hidden. Open display settings to show them.",,active
536
+ shared.time.now,shared,*,Shared,time_now,"now",,active
537
+ nav.ip_check,shared,*,Sidebar,nav_ip_check,Claude IP Check,,active
538
+ nav.skills,shared,*,Sidebar,nav_skills,Skills,,active
539
+ skills.page.title,ui,SkillsPage,SkillsPage,title,Skills,,active
540
+ skills.tab.my,ui,SkillsPage,SkillsPage,tab_my,My Skills,,active
541
+ skills.tab.browse,ui,SkillsPage,SkillsPage,tab_browse,Browse,,active
542
+ skills.action.refresh,ui,SkillsPage,SkillsPage,action_refresh,Refresh,,active
543
+ skills.action.install,ui,SkillsPage,SkillCard,action_install,Install,,active
544
+ skills.action.choose_targets,ui,SkillsPage,SkillCard,action_choose_targets,"Choose targets",,active
545
+ skills.target.menu_label,ui,SkillsPage,SkillCard,target_menu_label,"Install to",,active
546
+ skills.target.none,ui,SkillsPage,SkillsPage,target_none,"no targets",,active
547
+ skills.toast.installed,ui,SkillsPage,SkillsPage,toast_installed,"Installed {{name}} to {{targets}}.",,active
548
+ skills.action.remove,ui,SkillsPage,SkillsPage,action_remove,Remove,,active
549
+ skills.action.search,ui,SkillsPage,SkillsPage,action_search,Search,,active
550
+ skills.action.search_aria,ui,SkillsPage,SkillsPage,action_search_aria,"Search skills",,active
551
+ skills.target.synced_summary,ui,SkillsPage,InstalledSkillRow,target_synced_summary,"Synced to {{targets}}",,active
552
+ skills.target.synced_none,ui,SkillsPage,InstalledSkillRow,target_synced_none,"Not synced to any agent",,active
553
+ skills.row.open_details,ui,SkillsPage,InstalledSkillRow,row_open_details,"Open details for {{name}}",,active
554
+ skills.detail.close,ui,SkillsPage,SkillDetailPanel,detail_close,"Close details",,active
555
+ skills.detail.sync_section_title,ui,SkillsPage,SkillDetailPanel,detail_sync_section_title,"Sync to",,active
556
+ skills.detail.remove_button,ui,SkillsPage,SkillDetailPanel,detail_remove_button,"Remove from all agents",,active
557
+ skills.detail.remove_confirm_hint,ui,SkillsPage,SkillDetailPanel,detail_remove_confirm_hint,"This unsyncs the skill from every agent and deletes its local copy.",,active
558
+ skills.filter.agent_label,ui,SkillsPage,SkillsPage,filter_agent_label,"Agent",,active
559
+ skills.filter.agent_all,ui,SkillsPage,SkillsPage,filter_agent_all,"All agents",,active
560
+ skills.filter.clear,ui,SkillsPage,SkillsPage,filter_clear,"Clear filters",,active
561
+ skills.filter.result_count,ui,SkillsPage,SkillsPage,filter_result_count,"{{filtered}} of {{total}} skills",,active
562
+ skills.filter.result_count_browse,ui,SkillsPage,SkillsPage,filter_result_count_browse,"{{count}} results",,active
563
+ skills.empty.no_match,ui,SkillsPage,SkillsPage,empty_no_match,"No skills match the current filters.",,active
564
+ hint.dismiss,ui,shared,DismissibleHint,hint_dismiss,"Dismiss hint",,active
565
+ hint.dismissible_aria,ui,shared,DismissibleHint,hint_dismissible_aria,"Dismissible hint",,active
566
+ skills.card.installed,ui,SkillsPage,SkillCard,card_installed,Installed,,active
567
+ skills.card.targets_prefix,ui,SkillsPage,SkillCard,card_targets_prefix,"Will install to:",,active
568
+ skills.card.targets_change,ui,SkillsPage,SkillCard,card_targets_change,Change,,active
569
+ skills.card.installs,ui,SkillsPage,SkillCard,installs,"{{count}} installs",,active
570
+ skills.source.label,ui,SkillsPage,SkillsPage,source_label,Source,,active
571
+ skills.source.all,ui,SkillsPage,SkillsPage,source_all,All repositories,,active
572
+ skills.mode.repo,ui,SkillsPage,SkillsPage,mode_repo,Repositories,,active
573
+ skills.mode.skillssh,ui,SkillsPage,SkillsPage,mode_skillssh,skills.sh,,active
574
+ skills.browse.placeholder_all,ui,SkillsPage,SkillsPage,browse_placeholder_all,"Search across enabled repositories…",,active
575
+ skills.browse.placeholder_repo,ui,SkillsPage,SkillsPage,browse_placeholder_repo,"Search in {{repo}}…",,active
576
+ skills.browse.placeholder_skillssh,ui,SkillsPage,SkillsPage,browse_placeholder_skillssh,"Search the skills.sh registry…",,active
577
+ skills.browse.empty_sources,ui,SkillsPage,SkillsPage,browse_empty_sources,"Add a GitHub repository below to start browsing skills.",,active
578
+ skills.browse.add_repo_hint,ui,SkillsPage,SkillsPage,browse_add_repo_hint,"Need more skills? Add a GitHub repository.",,active
579
+ skills.browse.manage_sources,ui,SkillsPage,SkillsPage,browse_manage_sources,Manage sources,,active
580
+ skills.browse.hint_skillssh,ui,SkillsPage,SkillsPage,browse_hint_skillssh,"Type at least 2 characters to search skills.sh.",,active
581
+ skills.browse.loading_hint,ui,SkillsPage,SkillsPage,browse_loading_hint,"Fetching skill metadata from GitHub. First load can take up to a minute; results are cached.",,active
582
+ skills.error.generic,ui,SkillsPage,SkillsPage,error_generic,"Skill operation failed.",,active
583
+ skills.confirm.remove_title,ui,SkillsPage,SkillsPage,confirm_remove_title,"Remove {{name}}?",,active
584
+ skills.confirm.remove_managed,ui,SkillsPage,SkillsPage,confirm_remove_managed,"This skill will be removed from every connected AI tool. You'll have a few seconds to undo.",,active
585
+ skills.confirm.remove_local,ui,SkillsPage,SkillsPage,confirm_remove_local,"This will delete the skill folder on disk from every connected AI tool. This cannot be undone.",,active
586
+ skills.toast.removed,ui,SkillsPage,SkillsPage,toast_removed,"Removed {{name}}.",,active
587
+ shared.action.undo,shared,*,Shared,action_undo,"Undo",,active
588
+ shared.action.cancel,shared,*,Shared,action_cancel,"Cancel",,active
589
+ skills.empty.my,ui,SkillsPage,SkillsPage,empty_my,"No skills yet. Open Discover to search and install.",,active
590
+ skills.empty.my_cta,ui,SkillsPage,SkillsPage,empty_my_cta,"Browse",,active
591
+ skills.empty.browse,ui,SkillsPage,SkillsPage,empty_browse,"No skills found for this source.",,active
592
+ skills.empty.search,ui,SkillsPage,SkillsPage,empty_search,"No results. Try a different query.",,active
593
+ skills.repo.placeholder,ui,SkillsPage,SkillsPage,repo_placeholder,"owner/repository",,active
594
+ skills.repo.add,ui,SkillsPage,SkillsPage,repo_add,"Add repository",,active
595
+ skills.repo.invalid,ui,SkillsPage,SkillsPage,repo_invalid,"Use owner/repository or a GitHub repository URL.",,active
596
+ skills.repo.remove,ui,SkillsPage,RepoRow,repo_remove,"Remove repository",,active
597
+ settings.appearance.language.label,ui,SettingsPage,SettingsPage,language_label,Language,,active
598
+ settings.appearance.language.hint,ui,SettingsPage,SettingsPage,language_hint,Use System to follow your computer language by default.,,active
599
+ settings.appearance.language.system,ui,SettingsPage,SettingsPage,language_system,System,,active
600
+ settings.appearance.language.english,ui,SettingsPage,SettingsPage,language_english,English,,active
601
+ settings.appearance.language.chinese,ui,SettingsPage,SettingsPage,language_chinese,Simplified Chinese,,active
602
+ dashboard.context_breakdown.empty,dashboard,DashboardPage,ContextBreakdownPanel,empty,"No Claude Code activity in the selected period.",,active
603
+ dashboard.context_breakdown.empty_codex,dashboard,DashboardPage,ContextBreakdownPanel,empty_codex,"No Codex activity in the selected period.",,active
604
+ dashboard.context_breakdown.error,dashboard,DashboardPage,ContextBreakdownPanel,error,"Couldn't read Claude Code logs for this view.",,active
605
+ dashboard.context_breakdown.error_codex,dashboard,DashboardPage,ContextBreakdownPanel,error_codex,"Couldn't read Codex logs for this view.",,active
606
+ dashboard.context_breakdown.bar_aria,dashboard,DashboardPage,ContextBreakdownPanel,bar_aria,"Token distribution: {{summary}}",,active
607
+ dashboard.context_breakdown.system_prefix_tooltip,dashboard,DashboardPage,ContextBreakdownPanel,tooltip,"System prompt, tools schema, skills, rules, and MCP descriptions are cached together as one prefix and can't be separated from the logs.",,active
608
+ dashboard.context_breakdown.footnote,dashboard,DashboardPage,ContextBreakdownPanel,footnote,"Approximate: cache reads accumulate across turns, so conversation history dominates over time. Only Claude Code logs expose the per-message detail this view requires.",,active
609
+ dashboard.context_breakdown.footnote_codex,dashboard,DashboardPage,ContextBreakdownPanel,footnote_codex,"Codex uses non-overlapping token buckets here. Tool and exec drill-downs are separate heuristic attributions over the same turns.",,active
610
+ dashboard.context_breakdown.category.system_prompt,dashboard,DashboardPage,ContextBreakdownPanel,cat,"System prompt",,active
611
+ dashboard.context_breakdown.category.messages,dashboard,DashboardPage,ContextBreakdownPanel,cat,"Messages",,active
612
+ dashboard.context_breakdown.category.tool_calls,dashboard,DashboardPage,ContextBreakdownPanel,cat,"Tool calls",,active
613
+ dashboard.context_breakdown.category.mcp_servers,dashboard,DashboardPage,ContextBreakdownPanel,cat,"MCP servers",,active
614
+ dashboard.context_breakdown.category.custom_agents,dashboard,DashboardPage,ContextBreakdownPanel,cat,"Custom agents",,active
615
+ dashboard.context_breakdown.category.reasoning,dashboard,DashboardPage,ContextBreakdownPanel,cat,"Reasoning",,active
616
+ dashboard.context_breakdown.category.skills,dashboard,DashboardPage,ContextBreakdownPanel,cat,"Skills",,active
617
+ dashboard.context_breakdown.loading_aria,dashboard,DashboardPage,ContextBreakdownPanel,loading_aria,"Loading context breakdown",,active
618
+ dashboard.context_breakdown.loading_hint,dashboard,DashboardPage,ContextBreakdownPanel,loading_hint,"Scanning session logs…",,active
619
+ dashboard.context_breakdown.tool_details.total_column,dashboard,DashboardPage,ContextBreakdownPanel,tool_details_total_column,"Total",,active
620
+ dashboard.context_breakdown.tool_details.unavailable_codex,dashboard,DashboardPage,ContextBreakdownPanel,tool_details_unavailable_codex,"Tool-level Codex details are unavailable for this period; showing queue totals only.",,active
621
+ dashboard.context_breakdown.message_details.title,dashboard,DashboardPage,ContextBreakdownPanel,message_details_title,"Message details",,active
622
+ dashboard.context_breakdown.message_details.note,dashboard,DashboardPage,ContextBreakdownPanel,message_details_note,"Aggregated only — message text is not stored.",,active
623
+ dashboard.context_breakdown.message_details.category_column,dashboard,DashboardPage,ContextBreakdownPanel,message_details_category_column,"Category",,active
624
+ dashboard.context_breakdown.message_details.user_input,dashboard,DashboardPage,ContextBreakdownPanel,message_details_user_input,"User input",,active
625
+ dashboard.context_breakdown.message_details.conversation_history,dashboard,DashboardPage,ContextBreakdownPanel,message_details_conversation_history,"Conversation history",,active
626
+ dashboard.context_breakdown.message_details.assistant_response,dashboard,DashboardPage,ContextBreakdownPanel,message_details_assistant_response,"Assistant response",,active
627
+ dashboard.context_breakdown.exec_details.title,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_title,"Exec command details",,active
628
+ dashboard.context_breakdown.exec_details.kind_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_kind_column,"Type",,active
629
+ dashboard.context_breakdown.exec_details.calls_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_calls_column,"Calls",,active
630
+ dashboard.context_breakdown.exec_details.failures_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_failures_column,"Fail",,active
631
+ dashboard.context_breakdown.exec_details.duration_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_duration_column,"Duration",,active
632
+ dashboard.context_breakdown.exec_details.max_duration_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_max_duration_column,"Max",,active
633
+ dashboard.context_breakdown.exec_details.output_column,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_output_column,"Lines",,active
634
+ dashboard.context_breakdown.exec_details.group_by_type,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_type,"By type",,active
635
+ dashboard.context_breakdown.exec_details.group_by_executable,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_executable,"Executable",,active
636
+ dashboard.context_breakdown.exec_details.group_by_command,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_command,"Command",,active
637
+ dashboard.context_breakdown.exec_details.group_by_duration,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_duration,"Duration",,active
638
+ dashboard.context_breakdown.exec_details.group_by_output,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_output,"Output",,active
639
+ dashboard.context_breakdown.exec_details.group_by_exit,dashboard,DashboardPage,ContextBreakdownPanel,exec_details_group_by_exit,"By exit",,active
640
+ heatmap.3d.hover_tip,ui,ActivityHeatmap,ActivityHeatmap,hover_tip,"Click to enter 3D fullscreen rotation analysis mode",,active
641
+ heatmap.3d.modal.title,ui,ActivityHeatmap,ActivityHeatmap,title,"Token 3D Perspective",,active
642
+ heatmap.3d.modal.desc,ui,ActivityHeatmap,ActivityHeatmap,desc,"Drag with left mouse button to rotate. Hover to inspect daily activity and multidimensional metrics.",,active
643
+ heatmap.3d.modal.stats.total_tokens,ui,ActivityHeatmap,ActivityHeatmap,stats_total_tokens,"Annual Total Tokens",,active
644
+ heatmap.3d.modal.stats.precision_total_tokens,ui,ActivityHeatmap,ActivityHeatmap,stats_precision_total_tokens,"Precise annual consumption",,active
645
+ heatmap.3d.modal.stats.estimated_cost,ui,ActivityHeatmap,ActivityHeatmap,stats_estimated_cost,"Annual Estimated Cost",,active
646
+ heatmap.3d.modal.stats.active_rate_days,ui,ActivityHeatmap,ActivityHeatmap,stats_active_rate_days,"Active Rate / Days",,active
647
+ heatmap.3d.modal.stats.max_streak,ui,ActivityHeatmap,ActivityHeatmap,stats_max_streak,"Longest Active Streak",,active
648
+ heatmap.3d.modal.stats.days_suffix,ui,ActivityHeatmap,ActivityHeatmap,stats_days_suffix,"Days",,active
649
+ heatmap.3d.modal.stats.peak_day,ui,ActivityHeatmap,ActivityHeatmap,stats_peak_day,"Peak Day Blowout",,active
650
+ heatmap.3d.modal.stats.precision_peak_value,ui,ActivityHeatmap,ActivityHeatmap,stats_precision_peak_value,"Precise daily peak",,active
651
+ heatmap.3d.modal.stats.no_data,ui,ActivityHeatmap,ActivityHeatmap,stats_no_data,"No data",,active
652
+ heatmap.3d.modal.legend.title,ui,ActivityHeatmap,ActivityHeatmap,legend_title,"Activity Levels",,active
653
+ heatmap.3d.modal.palette.emerald,ui,ActivityHeatmap,ActivityHeatmap,palette_emerald,"Emerald City",,active
654
+ heatmap.3d.modal.palette.ocean,ui,ActivityHeatmap,ActivityHeatmap,palette_ocean,"Ocean Abyss",,active
655
+ heatmap.3d.modal.palette.neon,ui,ActivityHeatmap,ActivityHeatmap,palette_neon,"Cyber Neon",,active
656
+ heatmap.3d.modal.palette.amber,ui,ActivityHeatmap,ActivityHeatmap,palette_amber,"Blazing Amber",,active
657
+ heatmap.3d.modal.control.play,ui,ActivityHeatmap,ActivityHeatmap,control_play,"Start slow rotation",,active
658
+ heatmap.3d.modal.control.pause,ui,ActivityHeatmap,ActivityHeatmap,control_pause,"Pause auto-rotation",,active
659
+ heatmap.3d.modal.control.reset,ui,ActivityHeatmap,ActivityHeatmap,control_reset,"Reset 3D view",,active
660
+ heatmap.3d.modal.footer.tip,ui,ActivityHeatmap,ActivityHeatmap,footer_tip,"Pinch to zoom / Scroll to zoom / Drag to rotate 3D chart",,active
661
+ heatmap.3d.modal.ai.title.default,ui,ActivityHeatmap,ActivityHeatmap,ai_title_default,"Persistent Creator",,active
662
+ heatmap.3d.modal.ai.eval.default,ui,ActivityHeatmap,ActivityHeatmap,ai_eval_default,"Persist in the river of technology. Daily coding may not always be majestic, but every tiny active point records your thoughts and exploration. Sparks accumulate, eventually converging into your own digital ocean.",,active
663
+ heatmap.3d.modal.ai.title.peak,ui,ActivityHeatmap,ActivityHeatmap,ai_title_peak,"Peak Contributor",,active
664
+ heatmap.3d.modal.ai.eval.peak,ui,ActivityHeatmap,ActivityHeatmap,ai_eval_peak,"This year, your token output shows extremely high engineering density. This scale of development is equivalent to deeply participating in the refactoring of a medium-to-large system base, with each keystroke converging complex logic into deterministic code. A testament to pure engineering passion.",,active
665
+ heatmap.3d.modal.ai.title.heavy,ui,ActivityHeatmap,ActivityHeatmap,ai_title_heavy,"Heavy Producer",,active
666
+ heatmap.3d.modal.ai.eval.heavy,ui,ActivityHeatmap,ActivityHeatmap,ai_eval_heavy,"Exceptional continuous output. Your accumulated tokens have reached millions, equivalent to the volume of dozens of technical novellas. The highly saturated coding pace demonstrates your great execution in building digital assets.",,active
667
+ heatmap.3d.modal.ai.title.core,ui,ActivityHeatmap,ActivityHeatmap,ai_title_core,"Core Productivity Expert",,active
668
+ heatmap.3d.modal.ai.eval.core,ui,ActivityHeatmap,ActivityHeatmap,ai_eval_core,"Highly resilient long-term commitment. Over the past year, you have steadily maintained a high-intensity development rhythm. With solid code volume and token output, you have silently built the core architecture, a true engineering backbone.",,active
669
+ heatmap.3d.modal.ai.title.steady,ui,ActivityHeatmap,ActivityHeatmap,ai_title_steady,"Steady Developer",,active
670
+ heatmap.3d.modal.ai.eval.steady,ui,ActivityHeatmap,ActivityHeatmap,ai_eval_steady,"Steady and firm accumulation of technology. Every step of token increment is a brick in the foundation of your future. This slow but steady pace is the path for an excellent developer to become an engineering master.",,active
671
+ heatmap.3d.voxel.joke.1,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_joke1,"🔥 Extremely crazy! Produced {{value}} tokens! Are you training a large language model or writing a compiler by hand?",,active
672
+ heatmap.3d.voxel.joke.2,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_joke2,"🚀 Epic output! Total {{value}} tokens. Today's production can circle the earth once, even the AI is amazed by you!",,active
673
+ heatmap.3d.voxel.joke.3,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_joke3,"⚡ Critical Day! {{value}} tokens. Code is gushing out, and the keyboard is starting to smoke!",,active
674
+ heatmap.3d.voxel.level3,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_level3,"⚡ Productivity explosion ({{value}} tokens)! High efficiency and focus, keep up this peak state!",,active
675
+ heatmap.3d.voxel.level2,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_level2,"🌱 Getting into the groove ({{value}} tokens)! Steady output, every keystroke is contributing to the architecture.",,active
676
+ heatmap.3d.voxel.level1,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_level1,"🍃 Every drop counts ({{value}} tokens). Tiny commits are investments in the future, embrace compound interest!",,active
677
+ heatmap.3d.voxel.level0,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_level0,"💤 Recharging. On days without coding, inspiration grows silently.",,active
678
+ `,EL={"header.auth.sign_in_aria":"登录","login.back_home":"返回首页","login.cloud_only":"未配置云端登录。请使用 localhost 上的本地仪表盘。","login.title":"登录","login.subtitle":"选择邮箱或已连接账号。","login.dismiss":"关闭","login.verify_email_success":"邮箱已验证。你现在可以登录。","login.verify_email_pending":"请先在邮箱中完成验证,然后再登录。","login.oauth.continue":"使用 {{provider}} 继续","login.divider":"或","login.tab.sign_in":"登录","login.tab.sign_up":"创建账户","login.field.name":"显示名称","login.field.name_placeholder":"可选","login.field.email":"电子邮件","login.field.password":"密码","login.password_hint":"至少 {{min}} 个字符。","login.submit.sign_in":"使用邮箱登录","login.submit.sign_up":"创建账号","auth.callback.processing":"处理中…","auth.callback.success":"登录成功","auth.callback.redirecting":"正在返回 TokenTracker…","auth.callback.failed":"登录未完成,请重试。","auth.callback.close":"关闭此页","login_modal.subtitle":"登录以加入排行榜","login_modal.continue_email":"使用邮箱继续","login_modal.divider_email":"邮箱","shared.placeholder.short":"--","shared.unit.percent":"%","shared.unit.thousand_abbrev":"K","shared.unit.million_abbrev":"M","shared.unit.billion_abbrev":"B","shared.data_source":"数据来源:{{source}}","shared.error.prefix":"错误:{{error}}","shared.status.unsynced":"—","shared.time.now":"刚刚","error.boundary.title":"出了点问题","error.boundary.subtitle":"这个视图渲染失败了","error.boundary.hint":"打开控制台,然后重新加载页面","error.boundary.no_details":"没有错误详细信息","error.boundary.action.reload":"重新加载","identity_card.rank_label":"排名","identity_card.streak_label":"活跃天数","identity_card.rank_placeholder":"—","identity_card.streak_value":"{{days}} 天","usage.summary.total":"Token 总数","usage.period.day":"日","usage.period.week":"周","usage.period.month":"月","usage.period.total":"总计","usage.period.custom":"自定义","usage.metric.total":"总计","usage.metric.input":"输入","usage.metric.output":"输出","usage.metric.cached_input":"缓存输入","usage.metric.reasoning_output":"推理输出","usage.button.refresh":"刷新","usage.overview.tablist_aria":"时间范围","usage.overview.cost_breakdown_aria":"查看成本明细","usage.overview.distribution_aria":"来源占比:{{items}}","usage.overview.distribution_item":"{{label}} {{percent}}%","usage.overview.provider_card_aria":"{{provider}}:{{percent}}%,{{tokens}} Token,{{cost}}。点击{{action}}详情","usage.overview.expand":"展开","usage.overview.collapse":"收起","usage.overview.model_count":"{{count}} 个模型","usage.overview.model_details_aria":"{{provider}} 模型详情","widgets.page.title":"组件","widgets.cta.open_gallery":"打开小组件库","widgets.cta.download":"下载 Mac 应用","widgets.cta.macos_only":"仅限 macOS","widgets.menubar.section.title":"菜单栏","widgets.gallery.section.title":"桌面小组件","widgets.summary.name":"使用概览","widgets.summary.description":"今天和近 7 天的用量,以及紧凑趋势线。","widgets.heatmap.name":"热力图","widgets.heatmap.description":"像 GitHub 一样,一眼看清活跃和空闲的日子。","widgets.topModels.name":"热门模型","widgets.topModels.description":"你最常用的模型,按 Token 占比排序。","widgets.limits.name":"使用限制","widgets.limits.description":"Claude、Codex、Cursor、Gemini 等的实时速率限制进度。","daily.sort.date.label":"日期","daily.sort.date.title":"按日期排序","daily.sort.total.label":"总计","daily.sort.total.title":"按总计排序","daily.sort.input.label":"输入","daily.sort.input.title":"按输入排序","daily.sort.output.label":"输出","daily.sort.output.title":"按输出排序","daily.sort.cached.label":"缓存","daily.sort.cached.title":"按缓存输入排序","daily.sort.reasoning.label":"推理","daily.sort.reasoning.title":"按推理输出排序","daily.sort.conversations.label":"对话数","daily.sort.conversations.title":"按对话排序","details.pagination.prev":"上一页","details.pagination.next":"下一页","limits.copilot.otelHint.title":"跟踪 Copilot Token 使用情况","limits.copilot.otelHint.body":"限额信息通过你的 GitHub OAuth 令牌读取。如果还想记录逐 Token 用量,请启用 Copilot 的 OpenTelemetry 导出,把下面这段加到你的 shell 配置文件(~/.zshrc 或 ~/.bashrc):","limits.copilot.otelHint.copy":"复制","limits.copilot.otelHint.copied":"已复制","limits.panel.title":"使用限制","limits.label.cursor_plan":"套餐","limits.label.cursor_auto":"自动","limits.label.cursor_api":"API","limits.label.kiro_month":"月度","limits.label.kiro_bonus":"奖励","limits.label.kimi_weekly":"周","limits.label.kimi_5h":"5h","limits.label.kimi_total":"总量","limits.label.kimi_parallel":"并发:{{count}}","limits.label.copilot_premium":"高级","limits.label.copilot_chat":"对话","limits.status.not_connected":"未连接","limits.status.no_data":"未返回实时限额数据","limits.status.all_hidden":"所有限额提供商都已隐藏。请打开显示设置重新显示。","nav.usage":"用量","nav.limits":"限额","nav.widgets":"小组件","nav.skills":"Skills","nav.leaderboard":"排行榜","nav.collapse":"折叠侧边栏","nav.expand":"展开侧边栏","nav.menu":"打开导航菜单","nav.close_menu":"关闭导航菜单","nav.aside_label":"主导航","nav.nav_label":"导航","limits.page.subtitle":"AI 工具的速率限制和配额使用情况。","limits.settings.toggle_visible":"切换可见性","limits.page.openSettings":"显示设置","nav.group.general":"常规","nav.group.tools":"工具","nav.group.account":"账户","nav.settings":"设置","header.auth.open_settings":"打开设置","settings.page.title":"设置","settings.page.subtitle":"管理你的账户、外观和显示偏好。","settings.section.appearance":"外观","settings.section.account":"账户","settings.section.limits":"限制显示","settings.appearance.theme.label":"主题","settings.appearance.theme.hint":"选择 Token Tracker 在仪表盘中的显示方式。","settings.appearance.theme.light":"浅色","settings.appearance.theme.dark":"深色","settings.appearance.theme.system":"系统","settings.account.displayName":"显示名称","settings.account.edit":"编辑","settings.account.save":"保存","settings.account.saving":"保存...","settings.account.cancel":"取消","settings.account.userId":"用户 ID","settings.account.copyUserId":"复制用户 ID","settings.account.copy":"复制","settings.account.copied":"已复制","settings.account.cloudSync":"云同步","settings.account.cloudSyncHint":"将本地用量上传到你的 Token Tracker 云端账号。","settings.account.publicProfile":"公开主页","settings.account.publicProfileHint":"在公开排行榜中展示你的用量。","settings.account.displayNameAnonymousHint":"匿名状态下,排行榜会隐藏你的名字和头像","settings.account.displayNameDisabledWhileAnon":"请先关闭匿名,再编辑名字","settings.account.githubUrl":"GitHub 主页","settings.account.githubUrlHint":"在排行榜名字旁显示 GitHub 链接。","settings.account.githubUrlPlaceholder":"用户名或 https://github.com/用户名","settings.account.githubUrlInvalid":"请输入 GitHub 用户名,或 https://github.com/用户名","leaderboard.github.aria":"打开 GitHub 主页","leaderboard.github.tooltipAction":"点击查看 GitHub 主页","leaderboard.github.tooltipPrefix":"可在","leaderboard.github.tooltipSettingsLink":"设置","leaderboard.github.tooltipSuffix":"中配置你的主页","settings.account.signOut":"退出登录","settings.account.signIn":"登录","settings.account.signedOutHint":"登录后可管理云同步和排行榜偏好。","settings.section.menubar":"菜单栏应用","settings.menubar.showStats":"在菜单栏中显示统计信息","settings.menubar.showStatsHint":"在菜单栏图标旁边显示今天的Token 数量和成本。","settings.menubar.animatedIcon":"动画图标","settings.menubar.animatedIconHint":"闪烁 Clawd 角色并在菜单栏中播放同步动画。","settings.menubar.launchAtLogin":"登录时启动","settings.menubar.launchAtLoginHint":"登录 macOS 时自动启动 TokenTrackerBar。","settings.menubar.syncNow":"立即同步","settings.menubar.syncNowHint":"触发本地AI工具日志立即解析并上传。","settings.menubar.syncing":"正在同步...","settings.menubar.updates":"更新","settings.menubar.checkUpdates":"检查更新","menubar.slot.primary":"第一个位置","menubar.slot.secondary":"第二个位置","menubar.native_only":"打开 macOS 版 TokenTrackerBar 后可编辑菜单栏显示。","menubar.metric.today_tokens":"今日 Token","menubar.metric.today_cost":"今日成本","menubar.metric.last_7d_tokens":"近 7 天 Token","menubar.metric.total_tokens":"总 Token","menubar.metric.total_cost":"总成本","menubar.metric.claude_5h":"Claude 5 小时限额","menubar.metric.claude_7d":"Claude 7 天限额","menubar.metric.codex_5h":"Codex 5 小时限额","menubar.metric.codex_7d":"Codex 7 天限额","nav.ip_check":"Claude IP 检查","skills.page.title":"Skills","skills.tab.my":"我的","skills.tab.browse":"发现","skills.action.refresh":"刷新","skills.action.install":"安装","skills.action.choose_targets":"选择目标","skills.target.menu_label":"安装到","skills.target.none":"未选目标","skills.toast.installed":"已把 {{name}} 安装到 {{targets}}。","skills.action.remove":"移除","skills.action.search":"搜索","skills.action.search_aria":"搜索 skills","skills.target.synced_summary":"已同步到 {{targets}}","skills.target.synced_none":"尚未同步到任何 agent","skills.row.open_details":"查看 {{name}} 详情","skills.detail.close":"关闭详情","skills.detail.sync_section_title":"同步到","skills.detail.remove_button":"从所有 agent 移除","skills.detail.remove_confirm_hint":"这会从每个 agent 取消同步并删除本地副本。","skills.filter.agent_label":"Agent","skills.filter.agent_all":"全部 agent","skills.filter.clear":"清除筛选","skills.filter.result_count":"{{filtered}} / {{total}} 个 skill","skills.filter.result_count_browse":"{{count}} 个结果","skills.empty.no_match":"当前筛选下没有匹配的 skill。","hint.dismiss":"关闭提示","hint.dismissible_aria":"可关闭的提示","skills.card.installed":"已安装","skills.card.targets_prefix":"将安装到:","skills.card.targets_change":"更改","skills.card.installs":"{{count}} 次安装","skills.source.label":"来源","skills.source.all":"全部仓库","skills.mode.repo":"仓库","skills.mode.skillssh":"skills.sh","skills.browse.placeholder_all":"在已启用的仓库里搜索…","skills.browse.placeholder_repo":"在 {{repo}} 中搜索…","skills.browse.placeholder_skillssh":"在 skills.sh 仓库中搜索…","skills.browse.empty_sources":"添加一个 GitHub 仓库以开始浏览技能。","skills.browse.add_repo_hint":"想要更多 skill?添加一个 GitHub 仓库。","skills.browse.manage_sources":"管理来源","skills.browse.hint_skillssh":"至少输入 2 个字符以搜索 skills.sh。","skills.browse.loading_hint":"正在从 GitHub 拉取 skill 信息,首次加载可能需要一分钟,结果会缓存。","skills.error.generic":"Skill 操作失败。","skills.confirm.remove_title":"要移除 {{name}} 吗?","skills.confirm.remove_managed":"这个 skill 将从所有已连接的 AI 工具中移除,几秒内可以撤销。","skills.confirm.remove_local":"将从所有 AI 工具目录中删除该 skill 文件夹。此操作无法撤销。","skills.toast.removed":"已移除 {{name}}。","shared.action.undo":"撤销","shared.action.cancel":"取消","skills.empty.my":"还没有 skill。去「发现」搜索或安装。","skills.empty.my_cta":"去发现","skills.empty.browse":"这个来源下没有找到技能。","skills.empty.search":"没有结果,换个关键词试试。","skills.repo.placeholder":"owner/repository","skills.repo.add":"添加仓库","skills.repo.invalid":"请输入 owner/repository 或 GitHub 仓库 URL。","skills.repo.remove":"移除仓库","settings.appearance.language.label":"语言","settings.appearance.language.hint":"使用“系统”时会默认跟随本机语言。","settings.appearance.language.system":"系统","settings.appearance.language.english":"英语","settings.appearance.language.chinese":"简体中文","settings.appearance.currency.label":"货币","settings.appearance.currency.hint":"选择用量成本的显示币种。","settings.appearance.currency.opt.usd":"美元 ($)","settings.appearance.currency.opt.eur":"欧元 (€)","settings.appearance.currency.opt.gbp":"英镑 (£)","settings.appearance.currency.opt.cny":"人民币 (¥)","settings.appearance.currency.opt.jpy":"日元 (¥)","settings.appearance.currency.opt.hkd":"港币 (HK$)","settings.appearance.currency.rate_source.default":"内置默认汇率","settings.appearance.currency.rate_source.fetched":"数据源:open.er-api.com","settings.appearance.currency.rate_updated":"更新于 {{when}}","settings.appearance.currency.rate_never":"尚未刷新"},AL={"usage.overview.antigravity_notice_title":"Token 为估算值","usage.overview.antigravity_notice_body":"Antigravity 的本地日志没有真实用量字段,这里的数字是按字符长度(约 4 字符/Token)估算出来的,也没有扣除 Gemini 的 prompt cache 折扣。请把它当作上限估算,不要直接对账账单。","stats.period.today":"今日","stats.period.week":"本周","stats.period.month":"本月","stats.period.all":"全部","stats.period.convs":"对话","dashboard.core_index.collapse_label":"▾","dashboard.core_index.expand_label":"▸","dashboard.core_index.collapse_aria":"折叠模型分解","dashboard.core_index.expand_aria":"展开模型细分","dashboard.rolling.title":"最近的活动","dashboard.rolling.last_7d":"过去 7 天","dashboard.rolling.last_30d":"过去 30 天","dashboard.rolling.avg_active_day":"日平均","dashboard.projects.title":"项目用量","dashboard.projects.tokens_label":"Token","dashboard.projects.stars_label":"星标","dashboard.projects.limit_label":"展示","dashboard.projects.limit_aria":"选择仓库显示数量","dashboard.projects.limit_top_3":"前 3 名","dashboard.projects.limit_top_6":"前 6 名","dashboard.projects.limit_top_10":"前 10 名","dashboard.projects.empty":"没有公开仓库","dashboard.widgets.title":"桌面小组件","dashboard.widgets.hint":"右键点按桌面 → 编辑小组件 → 搜索“TokenTracker”","dashboard.widgets.dismiss_aria":"关闭小组件介绍","dashboard.cost_breakdown.title":"成本明细","dashboard.cost_breakdown.total_label":"预计总成本","dashboard.cost_breakdown.close":"关闭","trend.monitor.label":"使用趋势","heatmap.title":"热力图","heatmap.empty":"尚无活动数据。","heatmap.legend.less":"少","heatmap.legend.more":"多","heatmap.legend.utc":"UTC","heatmap.tooltip":"{{day}} • {{value}} {{unit}} • {{tz}}","heatmap.unit.tokens":"Token","heatmap.month.jan":"1月","heatmap.month.feb":"2月","heatmap.month.mar":"3月","heatmap.month.apr":"4月","heatmap.month.may":"5月","heatmap.month.jun":"6月","heatmap.month.jul":"7月","heatmap.month.aug":"8月","heatmap.month.sep":"9月","heatmap.month.oct":"10月","heatmap.month.nov":"11月","heatmap.month.dec":"12月","heatmap.day.sun":"日","heatmap.day.mon":"一","heatmap.day.tue":"二","heatmap.day.wed":"三","heatmap.day.thu":"四","heatmap.day.fri":"五","heatmap.day.sat":"六","dashboard.session_expired.copy_label":"运行 npx --yes tokentracker-cli init","dashboard.session_expired.copied":"已复制","dashboard.install.prompt":"安装 Node.js 18+ 然后运行:","dashboard.install.cmd.init":"npx --yes tokentracker-cli init","dashboard.install.cmd.init_link_code":"npx --yes tokentracker-cli init --link-code {{link_code}}","dashboard.install.copy":"复制安装命令","dashboard.install.copy_base":"复制初始化命令","dashboard.install.copied":"已复制到剪贴板","dashboard.install.link_code.loading":"正在生成专属代码...","dashboard.install.link_code.failed":"专属代码不可用","dashboard.install.cmd.sync":"npx --yes tokentracker-cli sync","dashboard.daily.title":"每日细目","dashboard.daily.empty":"还没有数据。先使用 AI CLI,再运行 {{cmd}}。","dashboard.identity.title":"你的个人资料","dashboard.identity.subtitle":"记录你的编码之旅","dashboard.identity.fallback":"匿名用户","dashboard.screenshot.title_line1":"AI 编程助手","dashboard.screenshot.title_line2":"2025 年度回顾","dashboard.screenshot.twitter_button":"分享到 X","dashboard.screenshot.twitter_label":"分享到 X","dashboard.screenshot.twitter_hint":"自动将图像复制到剪贴板","dashboard.screenshot.twitter_text":"记录中的 {{total_tokens}} Token。\\n{{model_name}} 以 {{model_percent}}% 领先。\\n\\n我的 AI 使用情况,未经审计 →\\ntokentracker.cc","heatmap.3d.hover_tip":"点击进入 3D 全屏旋转分析模式","heatmap.3d.modal.title":"Token 三维透视","heatmap.3d.modal.desc":"按住左键拖拽可任意旋转,悬浮感知每日活跃数据与多维统计。","heatmap.3d.modal.stats.total_tokens":"年度 Token 总量","heatmap.3d.modal.stats.precision_total_tokens":"精准年消耗量","heatmap.3d.modal.stats.estimated_cost":"年度估算费用","heatmap.3d.modal.stats.active_rate_days":"活跃占比 / 天数","heatmap.3d.modal.stats.max_streak":"最长连续活跃","heatmap.3d.modal.stats.days_suffix":"天","heatmap.3d.modal.stats.peak_day":"单日峰值暴击","heatmap.3d.modal.stats.precision_peak_value":"精确单日峰值","heatmap.3d.modal.stats.no_data":"无数据","heatmap.3d.modal.legend.title":"活跃度层级","heatmap.3d.modal.palette.emerald":"翡翠之城","heatmap.3d.modal.palette.ocean":"深海浩瀚","heatmap.3d.modal.palette.neon":"赛博霓虹","heatmap.3d.modal.palette.amber":"烈焰余晖","heatmap.3d.modal.control.play":"启动慢速自转","heatmap.3d.modal.control.pause":"暂停自动旋转","heatmap.3d.modal.control.reset":"重置 3D 视角","heatmap.3d.modal.footer.tip":"双指缩放 / 滚轮缩放 / 鼠标拖拽旋转 3D 图表","heatmap.3d.modal.ai.title.default":"持之以恒的行者","heatmap.3d.modal.ai.eval.default":"在技术的长河中持之以恒。也许日常的编码并不总是波澜壮阔,但每一个微小的活跃点都在记录着您的思考与探索。星火成留,终将汇聚成属于您的数字海洋。","heatmap.3d.modal.ai.title.peak":"极限活跃级贡献者","heatmap.3d.modal.ai.eval.peak":"这一年中,您的 Token 产出表现出极高的工程密度。如此规模 of 开发量相当于深度参与了中大型系统底座的重构,每一次击键都在将复杂的逻辑收敛为确定性的代码。这是极度专注与纯粹工程热爱的最好印证。","heatmap.3d.modal.ai.title.heavy":"高频产出级开发者","heatmap.3d.modal.ai.eval.heavy":"卓越的持续输出。您的 Token 累积量已达数百万字,相当于数十部中篇技术巨著的体量。高饱和度的编码节奏表明您正在以极高的执行力构建属于您的数字资产,展现了卓越的创造力。","heatmap.3d.modal.ai.title.core":"核心生产力专家","heatmap.3d.modal.ai.eval.core":"极具韧性的长期投入。在过去的一年中,您在较长周期内稳定保持着高强度的开发节奏。您用扎实的代码行数与 Token 产出,默默筑起了项目的核心架构,是当之无愧的工程支柱。","heatmap.3d.modal.ai.title.steady":"稳健成长型工程师","heatmap.3d.modal.ai.eval.steady":"踏实而坚定的技术积累。每一次 Token 的递增,都是您在坚实地砌下通往未来的代码基石。这种细水长流的稳健节奏,往往是一个优秀开发者通往工程大师的必经之路。","heatmap.3d.voxel.joke.1":"🔥 极度疯狂!产出 {{value}} tokens!你是在疯狂训练大模型,还是手撸了一个编译器?","heatmap.3d.voxel.joke.2":"🚀 史诗级输出!共 {{value}} tokens。今日产出可绕地球一圈,AI 都在为你惊叹!","heatmap.3d.voxel.joke.3":"⚡ 爆击日!{{value}} tokens。代码如泉涌,键盘已经开始冒烟了!","heatmap.3d.voxel.level3":"⚡ 生产力大爆发({{value}} tokens)!高效专注的黄金时刻,继续保持这个巅峰状态!","heatmap.3d.voxel.level2":"🌱 渐入佳境({{value}} tokens)!稳步产出,每一次敲击键盘都是在为大厦添砖加瓦。","heatmap.3d.voxel.level1":"🍃 聚沙成塔({{value}} tokens)。微小的提交也是对未来的投资,保持复利的力量!","heatmap.3d.voxel.level0":"💤 养精蓄锐。在不写代码的日子里,灵感也在悄悄生长。"},RL={"landing.handle.default":"VIBE_USER","landing.handle.special":"伏特","landing.screenshot.alt":"TokenTracker 仪表板截图","landing.nav.login":"登录","landing.nav.signup":"注册","landing.install.command":"npx --yes tokentracker-cli","landing.install.action.copy":"复制命令","landing.install.action.copied":"已复制","landing.meta.title":"Token Tracker —— AI Coding CLI 的 Token 用量追踪器","landing.meta.description":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","landing.meta.og_site_name":"Token Tracker","landing.meta.og_type":"website","landing.meta.og_image":"https://www.tokentracker.cc/og-image.jpg","landing.meta.og_url":"https://www.tokentracker.cc/","landing.meta.twitter_card":"summary_large_image","share.meta.title":"Token Tracker 分享","share.meta.description":"分享你的 Token Tracker 仪表板快照,包含跨模型、项目和时间窗口的用量洞察。","share.meta.og_site_name":"Token Tracker","share.meta.og_type":"website","share.meta.og_image":"https://www.tokentracker.cc/share-dashboard.jpg","share.meta.og_url":"https://www.tokentracker.cc/share","share.meta.twitter_card":"summary_large_image","landing.handle.placeholder":"试试 “{{handle}}”","landing.rank.expectation":"预期排名:{{rank}}","landing.rank.singularity":"登顶","landing.rank.unranked":"未上榜","landing.cta.primary":"进入仪表板","landing.cta.secondary":"查看 GitHub 源码","landing.v2.hero.title_line1":"追踪你所有的","landing.v2.hero.title_line2":"AI Token","landing.v2.install.mac_cta":"Mac 应用 (DMG)","landing.v2.models.title":"支持的 AI CLI 工具","landing.v2.compare.kicker":"无缝追踪","landing.v2.compare.title":"别再瞎猜你的 AI 用量。","landing.v2.compare.subtitle":"AI CLI 把用量数据藏在零散的本地文件里。TokenTracker 把它们实时聚合到一个清晰的仪表板里。","landing.v2.distill.body":"100% 本地处理,不上传任何 prompt 或代码。","landing.v2.compare.with.title":"用 Token Tracker","landing.v2.compare.with.p1":"集中式用量仪表板","landing.v2.compare.with.p2":"实时 Token 指标","landing.v2.compare.with.p3":"100% 本地,隐私无忧","landing.v2.compare.without.title":"不用","landing.v2.compare.without.p1":"散落的 JSON 日志文件","landing.v2.compare.without.p2":"对 Token 消耗一无所知","landing.v2.compare.without.p3":"突如其来的 API 账单","landing.v2.footer.line":"Token Tracker —— 开发者打造,服务开发者。","landing.v2.nav.github":"GitHub","landing.v2.models.agent.codex":"Codex","landing.v2.models.agent.claude_code":"Claude Code","landing.v2.models.agent.cursor":"Cursor","landing.v2.models.agent.gemini":"Gemini","landing.v2.models.agent.opencode":"OpenCode","landing.v2.models.agent.openclaw":"OpenClaw","landing.v2.cta.primary":"进入仪表板","landing.v2.hero.subtagline":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","leaderboard.profile.nav.back":"$ 排行榜","leaderboard.title":"排行榜","leaderboard.range":"UTC {{period}} · {{from}} – {{to}}","leaderboard.range_loading":"UTC {{period}} · …","leaderboard.range.total":"全部时间","leaderboard.generated_at":"更新于 {{ts}}","leaderboard.period.week":"周","leaderboard.period.month":"月","leaderboard.period.total":"全部","leaderboard.me_label":"你","leaderboard.anon_label":"匿名","leaderboard.error.unknown":"未知错误","leaderboard.loading":"加载中…","leaderboard.empty":"暂无数据","leaderboard.column.rank":"排名","leaderboard.column.user":"用户","leaderboard.column.total":"总计","leaderboard.column.codex":"Codex","leaderboard.column.claude":"Claude","leaderboard.column.gemini":"Gemini","leaderboard.column.cursor":"Cursor","leaderboard.column.opencode":"OpenCode","leaderboard.column.openclaw":"OpenClaw","leaderboard.column.hermes":"Hermes","leaderboard.column.kiro":"Kiro","leaderboard.column.copilot":"Copilot","leaderboard.column.kimi":"Kimi","leaderboard.column.supplemental":"其他","leaderboard.column.est_cost":"预估花费","leaderboard.signin_prompt":"登录后即可上榜","leaderboard.signin_button":"登录","leaderboard.sync_prompt":"开启云同步即可参与排名","leaderboard.sync_button.idle":"开启并同步","leaderboard.sync_button.busy":"同步中…","leaderboard.pagination.page_size_label":"每页显示","leaderboard.pagination.prev":"上一页","leaderboard.pagination.next":"下一页","leaderboard.pagination.ellipsis":"……","leaderboard.pagination.page_unknown":"第 {{page}} 页","share.modal.title":"分享你的数据","share.modal.subtitle":"生成海报卡片,随处分享。","share.modal.close":"关闭","share.modal.action.x":"分享到 X","share.modal.action.download":"下载","share.modal.action.copy":"复制图片","share.modal.hint.x":"把图片粘贴到推文里","share.modal.hint.copy":"到剪贴板","share.modal.name_label":"显示名称","share.modal.name_placeholder":"输入你的名字","share.modal.style_label":"样式","share.modal.footer":"数据始终保留在本地——图片在你的浏览器内生成,绝不上传。","share.button.label":"分享","share.button.aria":"打开分享卡片","share.toast.copied":"图片已复制到剪贴板","share.toast.downloaded":"图片已保存","share.toast.failed":"图片生成失败","share.toast.working":"生成中…","share.variant.neon":"霓虹","share.variant.broadsheet":"特刊","share.date.month_year":"{{year}} 年 {{month}}","share.issue.all_time":"总计","share.month_short.jan":"1 月","share.month_short.feb":"2 月","share.month_short.mar":"3 月","share.month_short.apr":"4 月","share.month_short.may":"5 月","share.month_short.jun":"6 月","share.month_short.jul":"7 月","share.month_short.aug":"8 月","share.month_short.sep":"9 月","share.month_short.oct":"10 月","share.month_short.nov":"11 月","share.month_short.dec":"12 月","share.hook.top_loyal":"{{name}} 占了 {{percent}}% 的用量。","share.hook.days_record":"共记录 {{days}} 天。","share.hook.top_led":"{{name}} 领跑,占比 {{percent}}%。","share.hook.multi_models":"{{days}} 天里用了 {{count}} 个模型。","share.hook.days_with_model":"{{name}} 陪你跑了 {{days}} 天。","share.hook.new_chapter":"新的记录,从这里开始。","share.card.broadsheet.issue":"期号","share.card.broadsheet.by":"分享者","share.card.broadsheet.tracked_since":"追踪起始","share.card.broadsheet.total_tokens":"总 Token 数","share.card.broadsheet.estimated_spend":"预估花费","share.card.broadsheet.billable_days":"{{days}} 个活跃日","share.card.broadsheet.heatmap_title":"年度热图","share.card.broadsheet.heatmap_days_on_record":"{{active}} / {{total}} 天有记录","share.card.broadsheet.roster_title":"模型榜","share.card.broadsheet.roster_subtitle":"常用模型轮换","share.card.broadsheet.empty":"这一周很安静,还没有模型数据。","share.card.broadsheet.global_rank":"全站排名","share.card.broadsheet.active_days":"活跃","share.card.broadsheet.days_count":"{{days}} 天","share.card.broadsheet.track_yours":"追踪你自己的","share.card.annual.report_title":"用量报告","share.card.annual.less":"少","share.card.annual.more":"多","share.card.annual.heatmap_title":"Token 热图","share.card.annual.total_tokens":"总 Token 数","share.card.annual.estimated_cost":"预估成本","share.card.annual.longest_streak":"最长连击","share.card.annual.days_count":"{{days}} 天","share.card.annual.top_model":"热门模型"},bk="tokentracker-locale",ps="system",nu="en",Lp="zh-CN";function _k(e){return typeof e!="string"?nu:/^zh(?:[-_]|$)/i.test(e.trim())?Lp:nu}function Eu(e){return e===ps?ps:_k(e)}function LL(){return typeof navigator>"u"?[]:Array.isArray(navigator.languages)&&navigator.languages.length?navigator.languages.filter(e=>typeof e=="string"):typeof navigator.language=="string"?[navigator.language]:[]}function ru(e,t=LL()){const n=Eu(e);if(n!==ps)return n;const a=t.map(s=>typeof s=="string"?s.trim():"").find(s=>s.length>0);return a&&/^zh(?:[-_]|$)/i.test(a)?Lp:nu}function Dp(){return Eu(xo(bk)||ps)}function DL(e){return So(bk,Eu(e))}const ML=["key","module","page","component","slot","text"],NL={[Lp]:{...EL,...AL,...RL}};let Nh=null,kk=ru(Dp());function OL(e){const t=[];let n=[],a="",s=!1;for(let o=0;o<e.length;o+=1){const c=e[o];if(s){c==='"'?e[o+1]==='"'?(a+='"',o+=1):s=!1:a+=c;continue}if(c==='"'){s=!0;continue}if(c===","){n.push(a),a="";continue}if(c===`
679
+ `){n.push(a),a="",n.every(u=>u.trim()==="")||t.push(n),n=[];continue}c!=="\r"&&(a+=c)}return n.push(a),n.every(o=>o.trim()==="")||t.push(n),t}function IL(e){const t=OL(e);if(!t.length)return{map:new Map,rows:[]};const n=t[0].map(u=>String(u).trim());if(ML.filter(u=>!n.includes(u)).length)return{map:new Map,rows:[]};const s=Object.fromEntries(n.map((u,h)=>[u,h])),o=[],c=new Map;return t.slice(1).forEach((u,h)=>{const f={key:String(u[s.key]||"").trim(),module:String(u[s.module]||"").trim(),page:String(u[s.page]||"").trim(),component:String(u[s.component]||"").trim(),slot:String(u[s.slot]||"").trim(),text:String(u[s.text]??"").trim()};f.key&&(c.has(f.key),c.set(f.key,f),o.push(f))}),{map:c,rows:o}}function jL(){return Nh||(Nh=IL(CL)),Nh}function UL(){return NL[kk]||{}}function BL(e){const t=UL()[String(e)];return typeof t=="string"&&t.trim()?t:null}function FL(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,a)=>t[a]==null?n:String(t[a])):e}function VL(e){return String(e).replace(/\\n/g,`
680
+ `)}function zL(e,t){return BL(t)||e?.text||t}function $L(e){kk=_k(e)}function Fe(e,t){const a=jL().map.get(e);return FL(VL(zL(a,e)),t)}const Zv="tokentracker_native_app";let wk=null;const wf=new Set;typeof window<"u"&&window.addEventListener("native:systemAppearanceChanged",e=>{const t=e?.detail?.isDark;if(typeof t=="boolean"){wk=t;try{const n=document.documentElement;t?n.classList.add("dark"):n.classList.remove("dark")}catch{}wf.forEach(n=>{try{n(t)}catch{}})}});function Xv(){return wk}function HL(e){return wf.add(e),()=>wf.delete(e)}function xk(){if(typeof window>"u")return!1;try{if(new URLSearchParams(window.location.search).get("app")==="1"){try{window.localStorage.setItem(Zv,"1")}catch{}return!0}return window.localStorage.getItem(Zv)==="1"}catch{return!1}}function ar(){return typeof window>"u"?!1:!!window.webkit?.messageHandlers?.nativeBridge}function Sk(){return typeof window>"u"?null:window.webkit?.messageHandlers?.nativeBridge??null}function I4(){return!!Sk()}function Yo(e){const t=Sk();if(!t)return!1;try{return t.postMessage(e),!0}catch(n){return console.warn("[tokentracker] nativeBridge post failed:",n),!1}}function j4(){return Yo({type:"getSettings"})}function Po(e,t){return Yo({type:"setSetting",key:e,value:t})}function U4(e){return Yo({type:"action",name:e})}function WL(){return Yo({type:"getSystemAppearance"})}function KL(e,t){if(!ar())return;Yo({type:"setChromeAppearance",isDark:e==="dark",theme:t??"system"})}function B4(e){if(typeof window>"u")return()=>{};const t=n=>{n&&n.detail&&typeof n.detail=="object"&&e(n.detail)};return window.addEventListener("native:settings",t),()=>window.removeEventListener("native:settings",t)}const Pk=k.createContext(null);function GL(){return ru(Dp())}function qL(e){typeof document>"u"||(document.documentElement.lang=e)}function Qv(e,t){$L(e),t(n=>n===e?n:e)}function YL({children:e}){const[t,n]=k.useState(Dp),[a,s]=k.useState(GL);k.useLayoutEffect(()=>{qL(a)},[a]),k.useLayoutEffect(()=>{ar()&&Po("locale",t)},[t]),k.useLayoutEffect(()=>{if(t!==ps||typeof window>"u")return;const u=()=>Qv(ru(ps),s);return window.addEventListener("languagechange",u),()=>window.removeEventListener("languagechange",u)},[t]);const o=k.useCallback(u=>{const h=Eu(u);Qv(ru(h),s),n(h),DL(h),ar()&&Po("locale",h)},[]),c=k.useMemo(()=>({locale:t,setLocale:o,resolvedLocale:a}),[t,a,o]);return I.jsx(Pk.Provider,{value:c,children:e})}const ZL="https://open.er-api.com/v6/latest/USD",XL=1440*60*1e3,QL=5e3;function JL(e,t=XL,n=Date.now()){return!e||!Number.isFinite(e)?!0:n-e>t}async function eD(e={}){const{timeoutMs:t=QL,fetchImpl:n,url:a=ZL,codes:s=Tp}=e,o=n??(typeof fetch<"u"?fetch:null);if(!o)throw new Error("fetch is not available");const c=typeof AbortController<"u"?new AbortController:null,u=c?setTimeout(()=>c.abort(),t):null;try{const h=await o(a,c?{signal:c.signal}:void 0);if(!h||!h.ok)throw new Error(`exchange rate fetch failed: ${h?.status??"no-response"}`);const m=(await h.json())?.rates;if(!m||typeof m!="object")throw new Error("exchange rate response missing rates");const y={USD:1};for(const b of s){if(b==="USD")continue;const w=m[b];eu(w)&&(y[b]=w)}if(Object.keys(y).length<=1)throw new Error("no supported currency rates in response");return{rates:y,fetchedAt:Date.now()}}finally{u&&clearTimeout(u)}}const tD=k.createContext(null);function Jv(e,t,n){ar()&&(Po("currency",e),Po("currencySymbol",n),eu(t)&&Po("exchangeRate",t))}function nD({children:e}){const[t,n]=k.useState(YR),a=k.useMemo(()=>QR(),[]),[s,o]=k.useState(a.rates),[c,u]=k.useState(a.source),[h,f]=k.useState(a.fetchedAt),m=k.useRef(!1),y=k.useRef(!1),b=k.useCallback((R,L,j)=>{o(R),u(L),f(j),JR({rates:R,source:L,fetchedAt:j})},[]),w=k.useCallback(async()=>{if(!m.current){m.current=!0;try{const{rates:R,fetchedAt:L}=await eD();b({...Cp,...R},"fetched",L)}catch{}finally{m.current=!1}}},[b]),x=k.useCallback(R=>{const L=Ep(R);n(L),ZR(L);const j=Lh(s,L),G=Dc(L);Jv(L,j,G)},[s]);k.useEffect(()=>{y.current||t!==No&&JL(h)&&(y.current=!0,w())},[t,h,w]),k.useEffect(()=>{const R=Lh(s,t),L=Dc(t);Jv(t,R,L)},[t,s]);const T=k.useMemo(()=>Lh(s,t),[s,t]),P=k.useMemo(()=>Dc(t),[t]),D=k.useMemo(()=>({currency:t,rate:T,symbol:P,rates:s,rateSource:c,rateFetchedAt:h,setCurrency:x}),[t,T,P,s,c,h,x]);return I.jsx(tD.Provider,{value:D,children:e})}const rD="modulepreload",aD=function(e){return"/"+e},eb={},$n=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let h=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");s=h(n.map(f=>{if(f=aD(f),f in eb)return;eb[f]=!0;const m=f.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":rD,m||(b.as="script"),b.crossOrigin="",b.href=f,u&&b.setAttribute("nonce",u),document.head.appendChild(b),m)return new Promise((w,x)=>{b.addEventListener("load",w),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return s.then(c=>{for(const u of c||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};var au={},iD=()=>{window.va||(window.va=function(...t){window.vaq||(window.vaq=[]),window.vaq.push(t)})},sD="@vercel/analytics",oD="2.0.1";function Tk(){return typeof window<"u"}function Ck(){try{const e="production"}catch{}return"production"}function lD(e="auto"){if(e==="auto"){window.vam=Ck();return}window.vam=e}function cD(){return(Tk()?window.vam:Ck())||"production"}function Mp(){return cD()==="development"}function uD(e){return e.scriptSrc?rs(e.scriptSrc):Mp()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?rs(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function dD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.analytics,...e}}catch{}lD(a.mode);const s={sdkn:sD+(a.framework?`/${a.framework}`:""),sdkv:oD};return a.disableAutoTrack&&(s.disableAutoTrack="1"),a.viewEndpoint&&(s.viewEndpoint=rs(a.viewEndpoint)),a.eventEndpoint&&(s.eventEndpoint=rs(a.eventEndpoint)),a.sessionEndpoint&&(s.sessionEndpoint=rs(a.sessionEndpoint)),Mp()&&a.debug===!1&&(s.debug="false"),a.dsn&&(s.dsn=a.dsn),a.endpoint?s.endpoint=a.endpoint:a.basePath&&(s.endpoint=rs(`${a.basePath}/insights`)),{beforeSend:a.beforeSend,src:uD(a),dataset:s}}function rs(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function hD(e={debug:!0},t){var n;if(!Tk())return;const{beforeSend:a,src:s,dataset:o}=dD(e,t);if(iD(),a&&((n=window.va)==null||n.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${s}"]`))return;const c=document.createElement("script");c.src=s;for(const[u,h]of Object.entries(o))c.dataset[u]=h;c.defer=!0,c.onerror=()=>{const u=Mp()?"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 ${s}. ${u}`)},document.head.appendChild(c)}function fD({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function pD(){if(!(typeof process>"u"||typeof au>"u"))return au.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function mD(){if(!(typeof process>"u"||typeof au>"u"))return au.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function gD(e){return k.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),k.useEffect(()=>{hD({framework:e.framework||"react",basePath:e.basePath??pD(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??mD())},[]),k.useEffect(()=>{e.route&&e.path&&fD({route:e.route,path:e.path})},[e.route,e.path]),null}var iu={},yD=()=>{window.si||(window.si=function(...t){window.siq=window.siq||[],window.siq.push(t)})},vD="@vercel/speed-insights",bD="2.0.0";function _D(){return typeof window<"u"}function kD(){try{const e="production"}catch{}return"production"}function Ek(){return kD()==="development"}function wD(e){return e.scriptSrc?su(e.scriptSrc):Ek()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?su(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function xD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.speedInsights,...e}}catch{}const s={sdkn:vD+(a.framework?`/${a.framework}`:""),sdkv:bD};return a.sampleRate&&(s.sampleRate=a.sampleRate.toString()),a.route&&(s.route=a.route),Ek()&&a.debug===!1&&(s.debug="false"),a.dsn&&(s.dsn=a.dsn),a.endpoint?s.endpoint=su(a.endpoint):a.basePath&&(s.endpoint=su(`${a.basePath}/speed-insights/vitals`)),{src:wD(a),beforeSend:a.beforeSend,dataset:s}}function su(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function SD(e={},t){var n;if(!_D()||e.route===null)return null;yD();const{beforeSend:a,src:s,dataset:o}=xD(e,t);if(document.head.querySelector(`script[src*="${s}"]`))return null;a&&((n=window.si)==null||n.call(window,"beforeSend",a));const c=document.createElement("script");c.src=s,c.defer=!0;for(const[u,h]of Object.entries(o))c.dataset[u]=h;return c.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${s}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(c),{setRoute:u=>{c.dataset.route=u??void 0}}}function PD(){if(!(typeof process>"u"||typeof iu>"u"))return iu.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function TD(){if(!(typeof process>"u"||typeof iu>"u"))return iu.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function CD(e){k.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const t=k.useRef(null);return k.useEffect(()=>{if(!t.current){const n=SD({framework:e.framework??"react",basePath:e.basePath??PD(),...e},e.configString??TD());n&&(t.current=n.setRoute)}},[e]),k.useEffect(()=>{t.current&&e.route&&t.current(e.route)},[e.route]),null}const Ak=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const ED=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const AD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const tb=e=>{const t=AD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Oh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const RD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},LD=k.createContext({}),DD=()=>k.useContext(LD),MD=k.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:a,className:s="",children:o,iconNode:c,...u},h)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:b="currentColor",className:w=""}=DD()??{},x=a??y?Number(n??m)*24/Number(t??f):n??m;return k.createElement("svg",{ref:h,...Oh,width:t??f??Oh.width,height:t??f??Oh.height,stroke:e??b,strokeWidth:x,className:Ak("lucide",w,s),...!o&&!RD(u)&&{"aria-hidden":"true"},...u},[...c.map(([T,P])=>k.createElement(T,P)),...Array.isArray(o)?o:[o]])});const dn=(e,t)=>{const n=k.forwardRef(({className:a,...s},o)=>k.createElement(MD,{ref:o,iconNode:t,className:Ak(`lucide-${ED(tb(e))}`,`lucide-${e}`,a),...s}));return n.displayName=tb(e),n};const ND=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],OD=dn("chart-column",ND);const ID=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],jD=dn("gauge",ID);const UD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],BD=dn("globe",UD);const FD=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],VD=dn("layout-grid",FD);const zD=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],$D=dn("mail",zD);const HD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],WD=dn("menu",HD);const KD=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],GD=dn("monitor",KD);const qD=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Rk=dn("moon",qD);const YD=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ZD=dn("puzzle",YD);const XD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],QD=dn("refresh-cw",XD);const JD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],eM=dn("settings",JD);const tM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Lk=dn("sun",tM);const nM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],rM=dn("triangle-alert",nM);const aM=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],iM=dn("trophy",aM);const sM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dk=dn("x",sM);function oM({children:e,variant:t="primary",size:n="md",onClick:a,disabled:s=!1,className:o="",as:c="button",...u}){const h="inline-flex items-center justify-center font-medium transition-all duration-200 rounded-md focus:outline-none focus:ring-2 focus:ring-oai-blue/30 active:scale-[0.98] active:duration-100",f={primary:"bg-oai-black dark:bg-oai-white text-white dark:text-oai-black border border-transparent hover:bg-oai-gray-800 dark:hover:bg-oai-gray-200 active:bg-oai-gray-900 dark:active:bg-oai-gray-300 disabled:bg-oai-gray-300 dark:disabled:bg-oai-gray-700 disabled:text-oai-gray-500 dark:disabled:text-oai-gray-400 focus:ring-oai-brand/30 transition-colors duration-200",secondary:"bg-oai-white dark:bg-oai-gray-900 text-oai-black dark:text-oai-white border border-oai-gray-300 dark:border-oai-gray-700 hover:border-oai-brand hover:text-oai-brand active:bg-oai-gray-50 dark:active:bg-oai-gray-800 active:border-oai-brand-dark disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 disabled:border-oai-gray-200 dark:disabled:border-oai-gray-700 focus:ring-oai-brand/30 transition-colors duration-200",ghost:"bg-transparent text-oai-gray-600 dark:text-oai-gray-300 border border-transparent hover:text-oai-brand hover:bg-oai-brand-50/50 dark:hover:bg-oai-brand-950/30 active:bg-oai-brand-50 dark:active:bg-oai-brand-900/50 disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 focus:ring-oai-brand/30 transition-colors duration-200"},m={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},y=s?"cursor-not-allowed opacity-60":"cursor-pointer",b=`${h} ${f[t]} ${m[n]} ${y} ${o}`;return I.jsx(c,{className:b,onClick:a,disabled:s,...u,children:e})}class lM extends Xf.Component{constructor(t){super(t),this.state={error:null},this.handleReload=this.handleReload.bind(this)}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t)}handleReload(){typeof window>"u"||window.location.reload()}render(){const{error:t}=this.state;if(!t)return this.props.children;const n=String(t?.message||t||""),a=n?Fe("shared.error.prefix",{error:n}):Fe("error.boundary.no_details");return I.jsx("div",{className:"flex min-h-screen items-center justify-center bg-oai-white p-6 font-oai text-oai-black antialiased dark:bg-oai-gray-950 dark:text-oai-white",children:I.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-oai-gray-200 bg-white p-6 text-center shadow-sm dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[I.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-amber-50 text-amber-600 dark:bg-amber-950/30 dark:text-amber-300",children:I.jsx(rM,{className:"h-5 w-5","aria-hidden":!0})}),I.jsx("div",{className:"mt-4 text-xs font-medium uppercase text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.title")}),I.jsx("h1",{className:"mt-2 text-xl font-semibold text-oai-black dark:text-white",children:Fe("error.boundary.subtitle")}),I.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.hint")}),I.jsx("div",{className:"mt-4 max-h-32 overflow-auto rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-3 py-2 text-left text-xs leading-5 text-oai-gray-600 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:text-oai-gray-300",children:a}),I.jsxs(oM,{type:"button",size:"md",onClick:this.handleReload,className:"mt-5",children:[I.jsx(QD,{className:"mr-2 h-4 w-4","aria-hidden":!0}),Fe("error.boundary.action.reload")]})]})})}}function Zo(){const e=k.useContext(Pk);if(e===null)throw new Error("useLocale must be used within a LocaleProvider");return e}const xf="tokentracker-theme",Mk=k.createContext(null);function cM(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(xf);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function mc(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function uM(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function dM({children:e}){const[t,n]=k.useState(cM),[a,s]=k.useState(()=>{if(t!=="system")return t;if(ar()){const f=Xv();if(typeof f=="boolean")return f?"dark":"light"}return mc()}),o=k.useRef(t);k.useEffect(()=>{o.current=t},[t]),k.useEffect(()=>{uM(a)},[a]),k.useLayoutEffect(()=>{if(t==="system"){if(ar()){const f=Xv();s(typeof f=="boolean"?f?"dark":"light":mc()),WL();return}s(mc())}else s(t)},[t]),k.useEffect(()=>ar()?HL(m=>{o.current==="system"&&s(m?"dark":"light")}):void 0,[]),k.useEffect(()=>{if(typeof window>"u"||t!=="system"||ar())return;const f=window.matchMedia("(prefers-color-scheme: dark)"),m=y=>{const b=y.matches?"dark":"light";s(b)};return f.addEventListener?(f.addEventListener("change",m),()=>f.removeEventListener("change",m)):(f.addListener(m),()=>f.removeListener(m))},[t]),k.useEffect(()=>{const f=t==="system"&&!ar()?mc():a;KL(f,t)},[a,t]);const c=k.useCallback(f=>{if(n(f),typeof window<"u")try{localStorage.setItem(xf,f)}catch{}},[]),u=k.useCallback(()=>{c(f=>{const m=f==="dark"?"light":"dark";if(typeof window<"u")try{localStorage.setItem(xf,m)}catch{}return m})},[]),h=k.useMemo(()=>({theme:t,setTheme:c,toggleTheme:u,resolvedTheme:a}),[t,c,u,a]);return I.jsx(Mk.Provider,{value:h,children:e})}const Nk=k.createContext({isOpen:!1,openLoginModal:()=>{},closeLoginModal:()=>{}});function hM({children:e}){const[t,n]=k.useState(!1),a=k.useCallback(()=>n(!0),[]),s=k.useCallback(()=>n(!1),[]);return I.jsx(Nk.Provider,{value:{isOpen:t,openLoginModal:a,closeLoginModal:s},children:e})}function Ok(){return k.useContext(Nk)}const Np=k.createContext({});function Op(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const fM=typeof window<"u",Ik=fM?k.useLayoutEffect:k.useEffect,Au=k.createContext(null);function Ip(e,t){e.indexOf(t)===-1&&e.push(t)}function ou(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const xr=(e,t,n)=>n>t?t:n<e?e:n;let jp=()=>{};const Ma={},jk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Uk(e){return typeof e=="object"&&e!==null}const Bk=e=>/^0[^.\s]+$/u.test(e);function Fk(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,pM=(e,t)=>n=>t(e(n)),Xo=(...e)=>e.reduce(pM),Io=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Up{constructor(){this.subscriptions=[]}add(t){return Ip(this.subscriptions,t),()=>ou(this.subscriptions,t)}notify(t,n,a){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,a);else for(let o=0;o<s;o++){const c=this.subscriptions[o];c&&c(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Sn=e=>e*1e3,In=e=>e/1e3;function Vk(e,t){return t?e*(1e3/t):0}const zk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mM=1e-7,gM=12;function yM(e,t,n,a,s){let o,c,u=0;do c=t+(n-t)/2,o=zk(c,a,s)-e,o>0?n=c:t=c;while(Math.abs(o)>mM&&++u<gM);return c}function Qo(e,t,n,a){if(e===t&&n===a)return jn;const s=o=>yM(o,0,1,e,n);return o=>o===0||o===1?o:zk(s(o),t,a)}const $k=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hk=e=>t=>1-e(1-t),Wk=Qo(.33,1.53,.69,.99),Bp=Hk(Wk),Kk=$k(Bp),Gk=e=>e>=1?1:(e*=2)<1?.5*Bp(e):.5*(2-Math.pow(2,-10*(e-1))),Fp=e=>1-Math.sin(Math.acos(e)),qk=Hk(Fp),Yk=$k(Fp),vM=Qo(.42,0,1,1),bM=Qo(0,0,.58,1),Zk=Qo(.42,0,.58,1),_M=e=>Array.isArray(e)&&typeof e[0]!="number",Xk=e=>Array.isArray(e)&&typeof e[0]=="number",kM={linear:jn,easeIn:vM,easeInOut:Zk,easeOut:bM,circIn:Fp,circInOut:Yk,circOut:qk,backIn:Bp,backInOut:Kk,backOut:Wk,anticipate:Gk},wM=e=>typeof e=="string",nb=e=>{if(Xk(e)){jp(e.length===4);const[t,n,a,s]=e;return Qo(t,n,a,s)}else if(wM(e))return kM[e];return e},gc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xM(e,t){let n=new Set,a=new Set,s=!1,o=!1;const c=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function h(m){c.has(m)&&(f.schedule(m),e()),m(u)}const f={schedule:(m,y=!1,b=!1)=>{const x=b&&s?n:a;return y&&c.add(m),x.add(m),m},cancel:m=>{a.delete(m),c.delete(m)},process:m=>{if(u=m,s){o=!0;return}s=!0;const y=n;n=a,a=y,n.forEach(h),n.clear(),s=!1,o&&(o=!1,f.process(m))}};return f}const SM=40;function Qk(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=gc.reduce((L,j)=>(L[j]=xM(o),L),{}),{setup:u,read:h,resolveKeyframes:f,preUpdate:m,update:y,preRender:b,render:w,postRender:x}=c,T=()=>{const L=Ma.useManualTiming,j=L?s.timestamp:performance.now();n=!1,L||(s.delta=a?1e3/60:Math.max(Math.min(j-s.timestamp,SM),1)),s.timestamp=j,s.isProcessing=!0,u.process(s),h.process(s),f.process(s),m.process(s),y.process(s),b.process(s),w.process(s),x.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(T))},P=()=>{n=!0,a=!0,s.isProcessing||e(T)};return{schedule:gc.reduce((L,j)=>{const G=c[j];return L[j]=(K,H=!1,S=!1)=>(n||P(),G.schedule(K,H,S)),L},{}),cancel:L=>{for(let j=0;j<gc.length;j++)c[gc[j]].cancel(L)},state:s,steps:c}}const{schedule:dt,cancel:Na,state:Kt,steps:Ih}=Qk(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let Nc;function PM(){Nc=void 0}const on={now:()=>(Nc===void 0&&on.set(Kt.isProcessing||Ma.useManualTiming?Kt.timestamp:performance.now()),Nc),set:e=>{Nc=e,queueMicrotask(PM)}},Jk=e=>t=>typeof t=="string"&&t.startsWith(e),ew=Jk("--"),TM=Jk("var(--"),Vp=e=>TM(e)?CM.test(e.split("/*")[0].trim()):!1,CM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function rb(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jo={...bs,transform:e=>xr(0,1,e)},yc={...bs,default:1},To=e=>Math.round(e*1e5)/1e5,zp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function EM(e){return e==null}const AM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$p=(e,t)=>n=>!!(typeof n=="string"&&AM.test(n)&&n.startsWith(e)||t&&!EM(n)&&Object.prototype.hasOwnProperty.call(n,t)),tw=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,o,c,u]=a.match(zp);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},RM=e=>xr(0,255,e),jh={...bs,transform:e=>Math.round(RM(e))},ri={test:$p("rgb","red"),parse:tw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+jh.transform(e)+", "+jh.transform(t)+", "+jh.transform(n)+", "+To(jo.transform(a))+")"};function LM(e){let t="",n="",a="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,a+=a,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:s?parseInt(s,16)/255:1}}const Sf={test:$p("#"),parse:LM,transform:ri.transform},Jo=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sa=Jo("deg"),vr=Jo("%"),_e=Jo("px"),DM=Jo("vh"),MM=Jo("vw"),ab={...vr,parse:e=>vr.parse(e)/100,transform:e=>vr.transform(e*100)},as={test:$p("hsl","hue"),parse:tw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+vr.transform(To(t))+", "+vr.transform(To(n))+", "+To(jo.transform(a))+")"},Lt={test:e=>ri.test(e)||Sf.test(e)||as.test(e),parse:e=>ri.test(e)?ri.parse(e):as.test(e)?as.parse(e):Sf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ri.transform(e):as.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},NM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function OM(e){return isNaN(e)&&typeof e=="string"&&(e.match(zp)?.length||0)+(e.match(NM)?.length||0)>0}const nw="number",rw="color",IM="var",jM="var(",ib="${}",UM=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ms(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(UM,h=>(Lt.test(h)?(a.color.push(o),s.push(rw),n.push(Lt.parse(h))):h.startsWith(jM)?(a.var.push(o),s.push(IM),n.push(h)):(a.number.push(o),s.push(nw),n.push(parseFloat(h))),++o,ib)).split(ib);return{values:n,split:u,indexes:a,types:s}}function BM(e){return ms(e).values}function aw({split:e,types:t}){const n=e.length;return a=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],a[o]!==void 0){const c=t[o];c===nw?s+=To(a[o]):c===rw?s+=Lt.transform(a[o]):s+=a[o]}return s}}function FM(e){return aw(ms(e))}const VM=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,zM=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:VM(e);function $M(e){const t=ms(e);return aw(t)(t.values.map((a,s)=>zM(a,t.split[s])))}const sr={test:OM,parse:BM,createTransformer:FM,getAnimatableNone:$M};function Uh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HM({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,o=0,c=0;if(!t)s=o=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;s=Uh(h,u,e+1/3),o=Uh(h,u,e),c=Uh(h,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(c*255),alpha:a}}function lu(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,Bh=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},WM=[Sf,ri,as],KM=e=>WM.find(t=>t.test(e));function sb(e){const t=KM(e);if(!t)return!1;let n=t.parse(e);return t===as&&(n=HM(n)),n}const ob=(e,t)=>{const n=sb(e),a=sb(t);if(!n||!a)return lu(e,t);const s={...n};return o=>(s.red=Bh(n.red,a.red,o),s.green=Bh(n.green,a.green,o),s.blue=Bh(n.blue,a.blue,o),s.alpha=vt(n.alpha,a.alpha,o),ri.transform(s))},Pf=new Set(["none","hidden"]);function GM(e,t){return Pf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qM(e,t){return n=>vt(e,t,n)}function Hp(e){return typeof e=="number"?qM:typeof e=="string"?Vp(e)?lu:Lt.test(e)?ob:XM:Array.isArray(e)?iw:typeof e=="object"?Lt.test(e)?ob:YM:lu}function iw(e,t){const n=[...e],a=n.length,s=e.map((o,c)=>Hp(o)(o,t[c]));return o=>{for(let c=0;c<a;c++)n[c]=s[c](o);return n}}function YM(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=Hp(e[s])(e[s],t[s]));return s=>{for(const o in a)n[o]=a[o](s);return n}}function ZM(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],c=e.indexes[o][a[o]],u=e.values[c]??0;n[s]=u,a[o]++}return n}const XM=(e,t)=>{const n=sr.createTransformer(t),a=ms(e),s=ms(t);return a.indexes.var.length===s.indexes.var.length&&a.indexes.color.length===s.indexes.color.length&&a.indexes.number.length>=s.indexes.number.length?Pf.has(e)&&!s.values.length||Pf.has(t)&&!a.values.length?GM(e,t):Xo(iw(ZM(a,s),s.values),n):lu(e,t)};function sw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):Hp(e)(e,t)}const QM=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Na(t),now:()=>Kt.isProcessing?Kt.timestamp:on.now()}},ow=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)a+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},cu=2e4;function Wp(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<cu;)t+=n,a=e.next(t);return t>=cu?1/0:t}function JM(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(Wp(a),cu);return{type:"keyframes",ease:o=>a.next(s*o).value/t,duration:In(s)}}const St={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Tf(e,t){return e*Math.sqrt(1-t*t)}const e2=12;function t2(e,t,n){let a=n;for(let s=1;s<e2;s++)a=a-e(a)/t(a);return a}const Fh=.001;function n2({duration:e=St.duration,bounce:t=St.bounce,velocity:n=St.velocity,mass:a=St.mass}){let s,o,c=1-t;c=xr(St.minDamping,St.maxDamping,c),e=xr(St.minDuration,St.maxDuration,In(e)),c<1?(s=f=>{const m=f*c,y=m*e,b=m-n,w=Tf(f,c),x=Math.exp(-y);return Fh-b/w*x},o=f=>{const y=f*c*e,b=y*n+n,w=Math.pow(c,2)*Math.pow(f,2)*e,x=Math.exp(-y),T=Tf(Math.pow(f,2),c);return(-s(f)+Fh>0?-1:1)*((b-w)*x)/T}):(s=f=>{const m=Math.exp(-f*e),y=(f-n)*e+1;return-Fh+m*y},o=f=>{const m=Math.exp(-f*e),y=(n-f)*(e*e);return m*y});const u=5/e,h=t2(s,o,u);if(e=Sn(e),isNaN(h))return{stiffness:St.stiffness,damping:St.damping,duration:e};{const f=Math.pow(h,2)*a;return{stiffness:f,damping:c*2*Math.sqrt(a*f),duration:e}}}const r2=["duration","bounce"],a2=["stiffness","damping","mass"];function lb(e,t){return t.some(n=>e[n]!==void 0)}function i2(e){let t={velocity:St.velocity,stiffness:St.stiffness,damping:St.damping,mass:St.mass,isResolvedFromDuration:!1,...e};if(!lb(e,a2)&&lb(e,r2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,o=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:St.mass,stiffness:s,damping:o}}else{const n=n2({...e,velocity:0});t={...t,...n,mass:St.mass},t.isResolvedFromDuration=!0}return t}function uu(e=St.visualDuration,t=St.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const o=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:f,mass:m,duration:y,velocity:b,isResolvedFromDuration:w}=i2({...n,velocity:-In(n.velocity||0)}),x=b||0,T=f/(2*Math.sqrt(h*m)),P=c-o,D=In(Math.sqrt(h/m)),R=Math.abs(P)<5;a||(a=R?St.restSpeed.granular:St.restSpeed.default),s||(s=R?St.restDelta.granular:St.restDelta.default);let L,j,G,K,H,S;if(T<1)G=Tf(D,T),K=(x+T*D*P)/G,L=X=>{const me=Math.exp(-T*D*X);return c-me*(K*Math.sin(G*X)+P*Math.cos(G*X))},H=T*D*K+P*G,S=T*D*P-K*G,j=X=>Math.exp(-T*D*X)*(H*Math.sin(G*X)+S*Math.cos(G*X));else if(T===1){L=me=>c-Math.exp(-D*me)*(P+(x+D*P)*me);const X=x+D*P;j=me=>Math.exp(-D*me)*(D*X*me-x)}else{const X=D*Math.sqrt(T*T-1);L=fe=>{const ue=Math.exp(-T*D*fe),le=Math.min(X*fe,300);return c-ue*((x+T*D*P)*Math.sinh(le)+X*P*Math.cosh(le))/X};const me=(x+T*D*P)/X,oe=T*D*me-P*X,Ae=T*D*P-me*X;j=fe=>{const ue=Math.exp(-T*D*fe),le=Math.min(X*fe,300);return ue*(oe*Math.sinh(le)+Ae*Math.cosh(le))}}const Z={calculatedDuration:w&&y||null,velocity:X=>Sn(j(X)),next:X=>{if(!w&&T<1){const oe=Math.exp(-T*D*X),Ae=Math.sin(G*X),fe=Math.cos(G*X),ue=c-oe*(K*Ae+P*fe),le=Sn(oe*(H*Ae+S*fe));return u.done=Math.abs(le)<=a&&Math.abs(c-ue)<=s,u.value=u.done?c:ue,u}const me=L(X);if(w)u.done=X>=y;else{const oe=Sn(j(X));u.done=Math.abs(oe)<=a&&Math.abs(c-me)<=s}return u.value=u.done?c:me,u},toString:()=>{const X=Math.min(Wp(Z),cu),me=ow(oe=>Z.next(X*oe).value,X,30);return X+"ms "+me},toTransition:()=>{}};return Z}uu.applyToOptions=e=>{const t=JM(e,100,uu);return e.ease=t.ease,e.duration=Sn(t.duration),e.type="keyframes",e};const s2=5;function lw(e,t,n){const a=Math.max(t-s2,0);return Vk(n-e(a),t-a)}function Cf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:c,min:u,max:h,restDelta:f=.5,restSpeed:m}){const y=e[0],b={done:!1,value:y},w=S=>u!==void 0&&S<u||h!==void 0&&S>h,x=S=>u===void 0?h:h===void 0||Math.abs(u-S)<Math.abs(h-S)?u:h;let T=n*t;const P=y+T,D=c===void 0?P:c(P);D!==P&&(T=D-y);const R=S=>-T*Math.exp(-S/a),L=S=>D+R(S),j=S=>{const Z=R(S),X=L(S);b.done=Math.abs(Z)<=f,b.value=b.done?D:X};let G,K;const H=S=>{w(b.value)&&(G=S,K=uu({keyframes:[b.value,x(b.value)],velocity:lw(L,S,b.value),damping:s,stiffness:o,restDelta:f,restSpeed:m}))};return H(0),{calculatedDuration:null,next:S=>{let Z=!1;return!K&&G===void 0&&(Z=!0,j(S),H(S)),G!==void 0&&S>=G?K.next(S-G):(!Z&&j(S),b)}}}function o2(e,t,n){const a=[],s=n||Ma.mix||sw,o=e.length-1;for(let c=0;c<o;c++){let u=s(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;u=Xo(h,u)}a.push(u)}return a}function l2(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const o=e.length;if(jp(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=o2(t,a,s),h=u.length,f=m=>{if(c&&m<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(m<e[y+1]);y++);const b=Io(e[y],e[y+1],m);return u[y](b)};return n?m=>f(xr(e[0],e[o-1],m)):f}function c2(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Io(0,t,a);e.push(vt(n,1,s))}}function u2(e){const t=[0];return c2(t,e.length-1),t}function d2(e,t){return e.map(n=>n*t)}function h2(e,t){return e.map(()=>t||Zk).splice(0,e.length-1)}function Co({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=_M(a)?a.map(nb):nb(a),o={done:!1,value:t[0]},c=d2(n&&n.length===t.length?n:u2(t),e),u=l2(c,t,{ease:Array.isArray(s)?s:h2(t,s)});return{calculatedDuration:e,next:h=>(o.value=u(h),o.done=h>=e,o)}}const f2=e=>e!==null;function Ru(e,{repeat:t,repeatType:n="loop"},a,s=1){const o=e.filter(f2),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||a===void 0?o[u]:a}const p2={decay:Cf,inertia:Cf,tween:Co,keyframes:Co,spring:uu};function cw(e){typeof e.type=="string"&&(e.type=p2[e.type])}class Kp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const m2=e=>e/100;class du extends Kp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==on.now()&&this.tick(on.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cw(t);const{type:n=Co,repeat:a=0,repeatDelay:s=0,repeatType:o,velocity:c=0}=t;let{keyframes:u}=t;const h=n||Co;h!==Co&&typeof u[0]!="number"&&(this.mixKeyframes=Xo(m2,sw(u[0],u[1])),u=[0,100]);const f=h({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Wp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+s,this.totalDuration=this.resolvedDuration*(a+1)-s,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:s,mixKeyframes:o,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:f=0,keyframes:m,repeat:y,repeatType:b,repeatDelay:w,type:x,onUpdate:T,finalKeyframe:P}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-f*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?D<0:D>s;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let L=this.currentTime,j=a;if(y){const S=Math.min(this.currentTime,s)/u;let Z=Math.floor(S),X=S%1;!X&&S>=1&&(X=1),X===1&&Z--,Z=Math.min(Z,y+1),Z%2&&(b==="reverse"?(X=1-X,w&&(X-=w/u)):b==="mirror"&&(j=c)),L=xr(0,1,X)*u}let G;R?(this.delayState.value=m[0],G=this.delayState):G=j.next(L),o&&!R&&(G.value=o(G.value));let{done:K}=G;!R&&h!==null&&(K=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&K);return H&&x!==Cf&&(G.value=Ru(m,this.options,P,this.speed)),T&&T(G.value),H&&this.finish(),G}then(t,n){return this.finished.then(t,n)}get duration(){return In(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(this.currentTime)}set time(t){t=Sn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return lw(a=>this.generator.next(a).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(on.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=In(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=QM,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(on.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function g2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ai=e=>e*180/Math.PI,Ef=e=>{const t=ai(Math.atan2(e[1],e[0]));return Af(t)},y2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ef,rotateZ:Ef,skewX:e=>ai(Math.atan(e[1])),skewY:e=>ai(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Af=e=>(e=e%360,e<0&&(e+=360),e),cb=Ef,ub=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),db=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),v2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ub,scaleY:db,scale:e=>(ub(e)+db(e))/2,rotateX:e=>Af(ai(Math.atan2(e[6],e[5]))),rotateY:e=>Af(ai(Math.atan2(-e[2],e[0]))),rotateZ:cb,rotate:cb,skewX:e=>ai(Math.atan(e[4])),skewY:e=>ai(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Rf(e){return e.includes("scale")?1:0}function Lf(e,t){if(!e||e==="none")return Rf(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=v2,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=y2,s=u}if(!s)return Rf(t);const o=a[t],c=s[1].split(",").map(_2);return typeof o=="function"?o(c):c[o]}const b2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Lf(n,t)};function _2(e){return parseFloat(e.trim())}const _s=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ks=new Set(_s),hb=e=>e===bs||e===_e,k2=new Set(["x","y","z"]),w2=_s.filter(e=>!k2.has(e));function x2(e){const t=[];return w2.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ra={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const s=e.max-e.min;return a==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const s=e.max-e.min;return a==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Lf(t,"x"),y:(e,{transform:t})=>Lf(t,"y")};Ra.translateX=Ra.x;Ra.translateY=Ra.y;const ii=new Set;let Df=!1,Mf=!1,Nf=!1;function uw(){if(Mf){const e=Array.from(ii).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=x2(a);s.length&&(n.set(a,s),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const s=n.get(a);s&&s.forEach(([o,c])=>{a.getValue(o)?.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Mf=!1,Df=!1,ii.forEach(e=>e.complete(Nf)),ii.clear()}function dw(){ii.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mf=!0)})}function S2(){Nf=!0,dw(),uw(),Nf=!1}class Gp{constructor(t,n,a,s,o,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=o,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(ii.add(this),Df||(Df=!0,dt.read(dw),dt.resolveKeyframes(uw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const o=s?.get(),c=t[t.length-1];if(o!==void 0)t[0]=o;else if(a&&n){const u=a.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),s&&o===void 0&&s.set(t[0])}g2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ii.delete(this)}cancel(){this.state==="scheduled"&&(ii.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const P2=e=>e.startsWith("--");function hw(e,t,n){P2(t)?e.style.setProperty(t,n):e.style[t]=n}const T2={};function fw(e,t){const n=Fk(e);return()=>T2[t]??n()}const C2=fw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pw=fw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_o=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,fb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_o([0,.65,.55,1]),circOut:_o([.55,0,1,.45]),backIn:_o([.31,.01,.66,-.59]),backOut:_o([.33,1.53,.69,.99])};function mw(e,t){if(e)return typeof e=="function"?pw()?ow(e,t):"ease-out":Xk(e)?_o(e):Array.isArray(e)?e.map(n=>mw(n,t)||fb.easeOut):fb[e]}function E2(e,t,n,{delay:a=0,duration:s=300,repeat:o=0,repeatType:c="loop",ease:u="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const y=mw(u,s);Array.isArray(y)&&(m.easing=y);const b={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:o+1,direction:c==="reverse"?"alternate":"normal"};return f&&(b.pseudoElement=f),e.animate(m,b)}function gw(e){return typeof e=="function"&&"applyToOptions"in e}function A2({type:e,...t}){return gw(e)&&pw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yw extends Kp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:o,allowFlatten:c=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!o,this.allowFlatten=c,this.options=t,jp(typeof t.type!="string");const f=A2(t);this.animation=E2(n,a,s,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=Ru(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),hw(n,a,m),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return In(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+In(t)}get time(){return In(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Sn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:a,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&C2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),jn):s(this)}}const vw={anticipate:Gk,backInOut:Kk,circInOut:Yk};function R2(e){return e in vw}function L2(e){typeof e.ease=="string"&&R2(e.ease)&&(e.ease=vw[e.ease])}const Vh=10;class D2 extends yw{constructor(t){L2(t),cw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:o,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new du({...c,autoplay:!1}),h=Math.max(Vh,on.now()-this.startTime),f=xr(0,Vh,h-Vh),m=u.sample(h).value,{name:y}=this.options;o&&y&&hw(o,y,m),n.setWithVelocity(u.sample(Math.max(0,h-f)).value,m,f),u.stop()}}const pb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(sr.test(e)||e==="0")&&!e.startsWith("url("));function M2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function N2(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],c=pb(s,t),u=pb(o,t);return!c||!u?!1:M2(e)||(n==="spring"||gw(n))&&a}function Of(e){e.duration=0,e.type="keyframes"}const bw=new Set(["opacity","clipPath","filter","transform"]),O2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function I2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&O2.test(e[t]))return!0;return!1}const j2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),U2=Fk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function B2(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:o,type:c,keyframes:u}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return U2()&&n&&(bw.has(n)||j2.has(n)&&I2(u))&&(n!=="transform"||!m)&&!f&&!a&&s!=="mirror"&&o!==0&&c!=="inertia"}const F2=40;class V2 extends Kp{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:c="loop",keyframes:u,name:h,motionValue:f,element:m,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=on.now();const b={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:o,repeatType:c,name:h,motionValue:f,element:m,...y},w=m?.KeyframeResolver||Gp;this.keyframeResolver=new w(u,(x,T,P)=>this.onKeyframesResolved(x,T,b,!P),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:o,type:c,velocity:u,delay:h,isHandoff:f,onUpdate:m}=a;this.resolvedAt=on.now();let y=!0;N2(t,o,c,u)||(y=!1,(Ma.instantAnimations||!h)&&m?.(Ru(t,a,n)),t[0]=t[t.length-1],Of(a),a.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>F2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},x=y&&!f&&B2(w),T=w.motionValue?.owner?.current;let P;if(x)try{P=new D2({...w,element:T})}catch{P=new du(w)}else P=new du(w);P.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=P.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=P}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),S2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _w(e,t,n,a=0,s=1){const o=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,u=(c-1)*a;return typeof n=="function"?n(o,c):s===1?o*a:u-o*a}const z2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $2(e){const t=z2.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function kw(e,t,n=1){const[a,s]=$2(e);if(!a)return;const o=window.getComputedStyle(t).getPropertyValue(a);if(o){const c=o.trim();return jk(c)?parseFloat(c):c}return Vp(s)?kw(s,t,n+1):s}const H2={type:"spring",stiffness:500,damping:25,restSpeed:10},W2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),K2={type:"keyframes",duration:.8},G2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},q2=(e,{keyframes:t})=>t.length>2?K2:ks.has(e)?e.startsWith("scale")?W2(t[1]):H2:G2;function ww(e,t){if(e?.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function qp(e,t){const n=e?.[t]??e?.default??e;return n!==e?ww(n,e):n}const Y2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Z2(e){for(const t in e)if(!Y2.has(t))return!0;return!1}const Yp=(e,t,n,a={},s,o)=>c=>{const u=qp(a,e)||{},h=u.delay||a.delay||0;let{elapsed:f=0}=a;f=f-Sn(h);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:b=>{t.set(b),u.onUpdate&&u.onUpdate(b)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Z2(u)||Object.assign(m,q2(e,m)),m.duration&&(m.duration=Sn(m.duration)),m.repeatDelay&&(m.repeatDelay=Sn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let y=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(Of(m),m.delay===0&&(y=!0)),(Ma.instantAnimations||Ma.skipAnimations||s?.shouldSkipAnimations)&&(y=!0,Of(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!o&&t.get()!==void 0){const b=Ru(m.keyframes,u);if(b!==void 0){dt.update(()=>{m.onUpdate(b),m.onComplete()});return}}return u.isSync?new du(m):new V2(m)};function mb(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Zp(e,t,n,a){if(typeof t=="function"){const[s,o]=mb(a);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=mb(a);t=t(n!==void 0?n:e.custom,s,o)}return t}function si(e,t,n){const a=e.getProps();return Zp(a,t,n!==void 0?n:a.custom,e)}const xw=new Set(["width","height","top","left","right","bottom",..._s]),gb=30,X2=e=>!isNaN(parseFloat(e)),yb={current:void 0};class Q2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=on.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=on.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=X2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Up);const a=this.events[t].add(n);return t==="change"?()=>{a(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return yb.current&&yb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=on.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gb);return Vk(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gs(e,t){return new Q2(e,t)}const If=e=>Array.isArray(e);function J2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gs(n))}function eN(e){return If(e)?e[e.length-1]||0:e}function tN(e,t){const n=si(e,t);let{transitionEnd:a={},transition:s={},...o}=n||{};o={...o,...a};for(const c in o){const u=eN(o[c]);J2(e,c,u)}}const Gt=e=>!!(e&&e.getVelocity);function nN(e){return!!(Gt(e)&&e.add)}function jf(e,t){const n=e.getValue("willChange");if(nN(n))return n.add(t);if(!n&&Ma.WillChange){const a=new Ma.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Xp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const rN="framerAppearId",Sw="data-"+Xp(rN);function Pw(e){return e.props[Sw]}function aN({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Tw(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:o,transitionEnd:c,...u}=t;const h=e.getDefaultTransition();o=o?ww(o,h):h;const f=o?.reduceMotion;a&&(o=a);const m=[],y=s&&e.animationState&&e.animationState.getState()[s];for(const b in u){const w=e.getValue(b,e.latestValues[b]??null),x=u[b];if(x===void 0||y&&aN(y,b))continue;const T={delay:n,...qp(o||{},b)},P=w.get();if(P!==void 0&&!w.isAnimating()&&!Array.isArray(x)&&x===P&&!T.velocity){dt.update(()=>w.set(x));continue}let D=!1;if(window.MotionHandoffAnimation){const j=Pw(e);if(j){const G=window.MotionHandoffAnimation(j,b,dt);G!==null&&(T.startTime=G,D=!0)}}jf(e,b);const R=f??e.shouldReduceMotion;w.start(Yp(b,w,x,R&&xw.has(b)?{type:!1}:T,e,D));const L=w.animation;L&&m.push(L)}if(c){const b=()=>dt.update(()=>{c&&tN(e,c)});m.length?Promise.all(m).then(b):b()}return m}function Uf(e,t,n={}){const a=si(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const o=a?()=>Promise.all(Tw(e,a,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:y}=s;return iN(e,t,h,f,m,y,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[h,f]=u==="beforeChildren"?[o,c]:[c,o];return h().then(()=>f())}else return Promise.all([o(),c(n.delay)])}function iN(e,t,n=0,a=0,s=0,o=1,c){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(Uf(h,t,{...c,delay:n+(typeof a=="function"?0:a)+_w(e.variantChildren,h,a,s,o)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function sN(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(o=>Uf(e,o,n));a=Promise.all(s)}else if(typeof t=="string")a=Uf(e,t,n);else{const s=typeof t=="function"?si(e,t,n.custom):t;a=Promise.all(Tw(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const oN={test:e=>e==="auto",parse:e=>e},Cw=e=>t=>t.test(e),Ew=[bs,_e,vr,Sa,MM,DM,oN],vb=e=>Ew.find(Cw(e));function lN(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Bk(e):!0}const cN=new Set(["brightness","contrast","saturate","opacity"]);function uN(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(zp)||[];if(!a)return e;const s=n.replace(a,"");let o=cN.has(t)?1:0;return a!==n&&(o*=100),t+"("+o+s+")"}const dN=/\b([a-z-]*)\(.*?\)/gu,Bf={...sr,getAnimatableNone:e=>{const t=e.match(dN);return t?t.map(uN).join(" "):e}},Ff={...sr,getAnimatableNone:e=>{const t=sr.parse(e);return sr.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bb={...bs,transform:Math.round},hN={rotate:Sa,rotateX:Sa,rotateY:Sa,rotateZ:Sa,scale:yc,scaleX:yc,scaleY:yc,scaleZ:yc,skew:Sa,skewX:Sa,skewY:Sa,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:jo,originX:ab,originY:ab,originZ:_e},Qp={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,inset:_e,insetBlock:_e,insetBlockStart:_e,insetBlockEnd:_e,insetInline:_e,insetInlineStart:_e,insetInlineEnd:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockStart:_e,paddingBlockEnd:_e,paddingInline:_e,paddingInlineStart:_e,paddingInlineEnd:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockStart:_e,marginBlockEnd:_e,marginInline:_e,marginInlineStart:_e,marginInlineEnd:_e,fontSize:_e,backgroundPositionX:_e,backgroundPositionY:_e,...hN,zIndex:bb,fillOpacity:jo,strokeOpacity:jo,numOctaves:bb},fN={...Qp,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Bf,WebkitFilter:Bf,mask:Ff,WebkitMask:Ff},Aw=e=>fN[e],pN=new Set([Bf,Ff]);function Rw(e,t){let n=Aw(e);return pN.has(n)||(n=sr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mN=new Set(["auto","none","0"]);function gN(e,t,n){let a=0,s;for(;a<e.length&&!s;){const o=e[a];typeof o=="string"&&!mN.has(o)&&ms(o).values.length&&(s=e[a]),a++}if(s&&n)for(const o of t)e[o]=Rw(n,s)}class yN extends Gp{constructor(t,n,a,s,o){super(t,n,a,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let y=t[m];if(typeof y=="string"&&(y=y.trim(),Vp(y))){const b=kw(y,n.current);b!==void 0&&(t[m]=b),m===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!xw.has(a)||t.length!==2)return;const[s,o]=t,c=vb(s),u=vb(o),h=rb(s),f=rb(o);if(h!==f&&Ra[a]){this.needsMeasurement=!0;return}if(c!==u)if(hb(c)&&hb(u))for(let m=0;m<t.length;m++){const y=t[m];typeof y=="string"&&(t[m]=parseFloat(y))}else Ra[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||lN(t[s]))&&a.push(s);a.length&&gN(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ra[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=a.length-1,c=a[o];a[o]=Ra[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([u,h])=>{t.getValue(u).set(h)}),this.resolveNoneKeyframes()}}function Lw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const s=n?.[e]??a.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(a=>a!=null)}const Dw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Oc(e){return Uk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Jp}=Qk(queueMicrotask,!1),nr={x:!1,y:!1};function Mw(){return nr.x||nr.y}function vN(e){return e==="x"||e==="y"?nr[e]?null:(nr[e]=!0,()=>{nr[e]=!1}):nr.x||nr.y?null:(nr.x=nr.y=!0,()=>{nr.x=nr.y=!1})}function Nw(e,t){const n=Lw(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function bN(e){return!(e.pointerType==="touch"||Mw())}function _N(e,t,n={}){const[a,s,o]=Nw(e,n);return a.forEach(c=>{let u=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",x)},y=P=>{f&&(f(P),f=void 0),m()},b=P=>{u=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),h&&(h=!1,y(P))},w=()=>{u=!0,window.addEventListener("pointerup",b,s),window.addEventListener("pointercancel",b,s)},x=P=>{if(P.pointerType!=="touch"){if(u){h=!0;return}y(P)}},T=P=>{if(!bN(P))return;h=!1;const D=t(c,P);typeof D=="function"&&(f=D,c.addEventListener("pointerleave",x,s))};c.addEventListener("pointerenter",T,s),c.addEventListener("pointerdown",w,s)}),o}const Ow=(e,t)=>t?e===t?!0:Ow(e,t.parentElement):!1,em=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,kN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wN(e){return kN.has(e.tagName)||e.isContentEditable===!0}const xN=new Set(["INPUT","SELECT","TEXTAREA"]);function SN(e){return xN.has(e.tagName)||e.isContentEditable===!0}const Ic=new WeakSet;function _b(e){return t=>{t.key==="Enter"&&e(t)}}function zh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const PN=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=_b(()=>{if(Ic.has(n))return;zh(n,"down");const s=_b(()=>{zh(n,"up")}),o=()=>zh(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function kb(e){return em(e)&&!Mw()}const wb=new WeakSet;function TN(e,t,n={}){const[a,s,o]=Nw(e,n),c=u=>{const h=u.currentTarget;if(!kb(u)||wb.has(u))return;Ic.add(h),n.stopPropagation&&wb.add(u);const f=t(h,u),m=(w,x)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),Ic.has(h)&&Ic.delete(h),kb(w)&&typeof f=="function"&&f(w,{success:x})},y=w=>{m(w,h===window||h===document||n.useGlobalTarget||Ow(h,w.target))},b=w=>{m(w,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",b,s)};return a.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,s),Oc(u)&&(u.addEventListener("focus",f=>PN(f,s)),!wN(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}function tm(e){return Uk(e)&&"ownerSVGElement"in e}const jc=new WeakMap;let Uc;const Iw=(e,t,n)=>(a,s)=>s&&s[0]?s[0][e+"Size"]:tm(a)&&"getBBox"in a?a.getBBox()[t]:a[n],CN=Iw("inline","width","offsetWidth"),EN=Iw("block","height","offsetHeight");function AN({target:e,borderBoxSize:t}){jc.get(e)?.forEach(n=>{n(e,{get width(){return CN(e,t)},get height(){return EN(e,t)}})})}function RN(e){e.forEach(AN)}function LN(){typeof ResizeObserver>"u"||(Uc=new ResizeObserver(RN))}function DN(e,t){Uc||LN();const n=Lw(e);return n.forEach(a=>{let s=jc.get(a);s||(s=new Set,jc.set(a,s)),s.add(t),Uc?.observe(a)}),()=>{n.forEach(a=>{const s=jc.get(a);s?.delete(t),s?.size||Uc?.unobserve(a)})}}const Bc=new Set;let is;function MN(){is=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Bc.forEach(t=>t(e))},window.addEventListener("resize",is)}function NN(e){return Bc.add(e),is||MN(),()=>{Bc.delete(e),!Bc.size&&typeof is=="function"&&(window.removeEventListener("resize",is),is=void 0)}}function xb(e,t){return typeof e=="function"?NN(e):DN(e,t)}function ON(e){return tm(e)&&e.tagName==="svg"}const IN=[...Ew,Lt,sr],jN=e=>IN.find(Cw(e)),Sb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ss=()=>({x:Sb(),y:Sb()}),Pb=()=>({min:0,max:0}),It=()=>({x:Pb(),y:Pb()}),UN=new WeakMap;function Lu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Uo(e){return typeof e=="string"||Array.isArray(e)}const nm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rm=["initial",...nm];function Du(e){return Lu(e.animate)||rm.some(t=>Uo(e[t]))}function jw(e){return!!(Du(e)||e.variants)}function BN(e,t,n){for(const a in t){const s=t[a],o=n[a];if(Gt(s))e.addValue(a,s);else if(Gt(o))e.addValue(a,gs(s,{owner:e}));else if(o!==s)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(s):c.hasAnimated||c.set(s)}else{const c=e.getStaticValue(a);e.addValue(a,gs(c!==void 0?c:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const Vf={current:null},Uw={current:!1},FN=typeof window<"u";function VN(){if(Uw.current=!0,!!FN)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Vf.current=e.matches;e.addEventListener("change",t),t()}else Vf.current=!1}const Tb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hu={};function Bw(e){hu=e}function zN(){return hu}class $N{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:c,visualState:u},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=on.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,dt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=Du(n),this.isVariantNode=jw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in b){const x=b[w];f[w]!==void 0&&Gt(x)&&x.set(f[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,UN.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Uw.current||VN(),this.shouldReduceMotion=Vf.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Na(this.notifyUpdate),Na(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&bw.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:h,ease:f,duration:m}=n.accelerate,y=new yw({element:this.current,name:t,keyframes:u,times:h,ease:f,duration:Sn(m)}),b=c(y);this.valueSubscriptions.set(t,()=>{b(),y.cancel()});return}const a=ks.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&dt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in hu){const n=hu[t];if(!n)continue;const{isEnabled:a,Feature:s}=n;if(!this.features[t]&&s&&a(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):It()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<Tb.length;a++){const s=Tb[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,c=t[o];c&&(this.propEventSubscriptions[s]=this.on(s,c))}this.prevMotionValues=BN(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=gs(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(jk(a)||Bk(a))?a=parseFloat(a):!jN(a)&&sr.test(n)&&(a=Rw(t,n)),this.setBaseTarget(t,Gt(a)?a.get():a)),Gt(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const o=Zp(this.props,n,this.presenceContext?.custom);o&&(a=o[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Gt(s)?s:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Up),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Jp.render(this.render)}}class Fw extends $N{constructor(){super(...arguments),this.KeyframeResolver=yN}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ia{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Vw({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function HN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function $h(e){return e===void 0||e===1}function zf({scale:e,scaleX:t,scaleY:n}){return!$h(e)||!$h(t)||!$h(n)}function ei(e){return zf(e)||zw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zw(e){return Cb(e.x)||Cb(e.y)}function Cb(e){return e&&e!=="0%"}function fu(e,t,n){const a=e-n,s=t*a;return n+s}function Eb(e,t,n,a,s){return s!==void 0&&(e=fu(e,s,a)),fu(e,n,a)+t}function $f(e,t=0,n=1,a,s){e.min=Eb(e.min,t,n,a,s),e.max=Eb(e.max,t,n,a,s)}function $w(e,{x:t,y:n}){$f(e.x,t.translate,t.scale,t.originPoint),$f(e.y,n.translate,n.scale,n.originPoint)}const Ab=.999999999999,Rb=1.0000000000001;function KN(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,c;for(let u=0;u<s;u++){o=n[u],c=o.projectionDelta;const{visualElement:h}=o.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(mr(e.x,-o.scroll.offset.x),mr(e.y,-o.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,$w(e,c)),a&&ei(o.latestValues)&&Fc(e,o.latestValues,o.layout?.layoutBox))}t.x<Rb&&t.x>Ab&&(t.x=1),t.y<Rb&&t.y>Ab&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function Lb(e,t,n,a,s=.5){const o=vt(e.min,e.max,s);$f(e,t,n,o,a)}function Db(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Fc(e,t,n){const a=n??e;Lb(e.x,Db(t.x,a.x),t.scaleX,t.scale,t.originX),Lb(e.y,Db(t.y,a.y),t.scaleY,t.scale,t.originY)}function Hw(e,t){return Vw(WN(e.getBoundingClientRect(),t))}function GN(e,t,n){const a=Hw(e,n),{scroll:s}=t;return s&&(mr(a.x,s.offset.x),mr(a.y,s.offset.y)),a}const qN={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},YN=_s.length;function ZN(e,t,n){let a="",s=!0;for(let o=0;o<YN;o++){const c=_s[o],u=e[c];if(u===void 0)continue;let h=!0;if(typeof u=="number")h=u===(c.startsWith("scale")?1:0);else{const f=parseFloat(u);h=c.startsWith("scale")?f===1:f===0}if(!h||n){const f=Dw(u,Qp[c]);if(!h){s=!1;const m=qN[c]||c;a+=`${m}(${f}) `}n&&(t[c]=f)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function am(e,t,n){const{style:a,vars:s,transformOrigin:o}=e;let c=!1,u=!1;for(const h in t){const f=t[h];if(ks.has(h)){c=!0;continue}else if(ew(h)){s[h]=f;continue}else{const m=Dw(f,Qp[h]);h.startsWith("origin")?(u=!0,o[h]=m):a[h]=m}}if(t.transform||(c||n?a.transform=ZN(t,e.transform,n):a.transform&&(a.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:m=0}=o;a.transformOrigin=`${h} ${f} ${m}`}}function Ww(e,{style:t,vars:n},a,s){const o=e.style;let c;for(c in t)o[c]=t[c];s?.applyProjectionStyles(o,a);for(c in n)o.setProperty(c,n[c])}function Mb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const po={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Mb(e,t.target.x),a=Mb(e,t.target.y);return`${n}% ${a}%`}},XN={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=sr.parse(e);if(s.length>5)return a;const o=sr.createTransformer(e),c=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;s[0+c]/=u,s[1+c]/=h;const f=vt(u,h,.5);return typeof s[2+c]=="number"&&(s[2+c]/=f),typeof s[3+c]=="number"&&(s[3+c]/=f),o(s)}},Hf={borderRadius:{...po,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:po,borderTopRightRadius:po,borderBottomLeftRadius:po,borderBottomRightRadius:po,boxShadow:XN};function Kw(e,{layout:t,layoutId:n}){return ks.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Hf[e]||e==="opacity")}function im(e,t,n){const a=e.style,s=t?.style,o={};if(!a)return o;for(const c in a)(Gt(a[c])||s&&Gt(s[c])||Kw(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(o[c]=a[c]);return o}function QN(e){return window.getComputedStyle(e)}class JN extends Fw{constructor(){super(...arguments),this.type="html",this.renderInstance=Ww}readValueFromInstance(t,n){if(ks.has(n))return this.projection?.isProjecting?Rf(n):b2(t,n);{const a=QN(t),s=(ew(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Hw(t,n)}build(t,n,a){am(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return im(t,n,a)}}const eO={offset:"stroke-dashoffset",array:"stroke-dasharray"},tO={offset:"strokeDashoffset",array:"strokeDasharray"};function nO(e,t,n=1,a=0,s=!0){e.pathLength=1;const o=s?eO:tO;e[o.offset]=`${-a}`,e[o.array]=`${t} ${n}`}const rO=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gw(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:o=1,pathOffset:c=0,...u},h,f,m){if(am(e,u,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:b}=e;y.transform&&(b.transform=y.transform,delete y.transform),(b.transform||y.transformOrigin)&&(b.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),b.transform&&(b.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const w of rO)y[w]!==void 0&&(b[w]=y[w],delete y[w]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&nO(y,s,o,c,!1)}const qw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Yw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aO(e,t,n,a){Ww(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(qw.has(s)?s:Xp(s),t.attrs[s])}function Zw(e,t,n){const a=im(e,t,n);for(const s in e)if(Gt(e[s])||Gt(t[s])){const o=_s.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[o]=e[s]}return a}class iO extends Fw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=It}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ks.has(n)){const a=Aw(n);return a&&a.default||0}return n=qw.has(n)?n:Xp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Zw(t,n,a)}build(t,n,a){Gw(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){aO(t,n,a,s)}mount(t){this.isSVGTag=Yw(t.tagName),super.mount(t)}}const sO=rm.length;function Xw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Xw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sO;n++){const a=rm[n],s=e.props[a];(Uo(s)||s===!1)&&(t[a]=s)}return t}function Qw(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const oO=[...nm].reverse(),lO=nm.length;function cO(e){return t=>Promise.all(t.map(({animation:n,options:a})=>sN(e,n,a)))}function uO(e){let t=cO(e),n=Nb(),a=!0,s=!1;const o=f=>(m,y)=>{const b=si(e,y,f==="exit"?e.presenceContext?.custom:void 0);if(b){const{transition:w,transitionEnd:x,...T}=b;m={...m,...T,...x}}return m};function c(f){t=f(e)}function u(f){const{props:m}=e,y=Xw(e.parent)||{},b=[],w=new Set;let x={},T=1/0;for(let D=0;D<lO;D++){const R=oO[D],L=n[R],j=m[R]!==void 0?m[R]:y[R],G=Uo(j),K=R===f?L.isActive:null;K===!1&&(T=D);let H=j===y[R]&&j!==m[R]&&G;if(H&&(a||s)&&e.manuallyAnimateOnMount&&(H=!1),L.protectedKeys={...x},!L.isActive&&K===null||!j&&!L.prevProp||Lu(j)||typeof j=="boolean")continue;if(R==="exit"&&L.isActive&&K!==!0){L.prevResolvedValues&&(x={...x,...L.prevResolvedValues});continue}const S=dO(L.prevProp,j);let Z=S||R===f&&L.isActive&&!H&&G||D>T&&G,X=!1;const me=Array.isArray(j)?j:[j];let oe=me.reduce(o(R),{});K===!1&&(oe={});const{prevResolvedValues:Ae={}}=L,fe={...Ae,...oe},ue=W=>{Z=!0,w.has(W)&&(X=!0,w.delete(W)),L.needsAnimating[W]=!0;const Y=e.getValue(W);Y&&(Y.liveStyle=!1)};for(const W in fe){const Y=oe[W],$=Ae[W];if(x.hasOwnProperty(W))continue;let N=!1;If(Y)&&If($)?N=!Qw(Y,$):N=Y!==$,N?Y!=null?ue(W):w.add(W):Y!==void 0&&w.has(W)?ue(W):L.protectedKeys[W]=!0}L.prevProp=j,L.prevResolvedValues=oe,L.isActive&&(x={...x,...oe}),(a||s)&&e.blockInitialAnimation&&(Z=!1);const le=H&&S;Z&&(!le||X)&&b.push(...me.map(W=>{const Y={type:R};if(typeof W=="string"&&(a||s)&&!le&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,N=si($,W);if($.enteringChildren&&N){const{delayChildren:q}=N.transition||{};Y.delay=_w($.enteringChildren,e,q)}}return{animation:W,options:Y}}))}if(w.size){const D={};if(typeof m.initial!="boolean"){const R=si(e,Array.isArray(m.initial)?m.initial[0]:m.initial);R&&R.transition&&(D.transition=R.transition)}w.forEach(R=>{const L=e.getBaseTarget(R),j=e.getValue(R);j&&(j.liveStyle=!0),D[R]=L??null}),b.push({animation:D})}let P=!!b.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(P=!1),a=!1,s=!1,P?t(b):Promise.resolve()}function h(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(b=>b.animationState?.setActive(f,m)),n[f].isActive=m;const y=u(f);for(const b in n)n[b].protectedKeys={};return y}return{animateChanges:u,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Nb(),s=!0}}}function dO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Qw(t,e):!1}function Qa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nb(){return{animate:Qa(!0),whileInView:Qa(),whileHover:Qa(),whileTap:Qa(),whileDrag:Qa(),whileFocus:Qa(),exit:Qa()}}function Wf(e,t){e.min=t.min,e.max=t.max}function tr(e,t){Wf(e.x,t.x),Wf(e.y,t.y)}function Ob(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Jw=1e-4,hO=1-Jw,fO=1+Jw,ex=.01,pO=0-ex,mO=0+ex;function ln(e){return e.max-e.min}function gO(e,t,n){return Math.abs(e-t)<=n}function Ib(e,t,n,a=.5){e.origin=a,e.originPoint=vt(t.min,t.max,e.origin),e.scale=ln(n)/ln(t),e.translate=vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hO&&e.scale<=fO||isNaN(e.scale))&&(e.scale=1),(e.translate>=pO&&e.translate<=mO||isNaN(e.translate))&&(e.translate=0)}function Eo(e,t,n,a){Ib(e.x,t.x,n.x,a?a.originX:void 0),Ib(e.y,t.y,n.y,a?a.originY:void 0)}function jb(e,t,n,a=0){const s=a?vt(n.min,n.max,a):n.min;e.min=s+t.min,e.max=e.min+ln(t)}function yO(e,t,n,a){jb(e.x,t.x,n.x,a?.x),jb(e.y,t.y,n.y,a?.y)}function Ub(e,t,n,a=0){const s=a?vt(n.min,n.max,a):n.min;e.min=t.min-s,e.max=e.min+ln(t)}function pu(e,t,n,a){Ub(e.x,t.x,n.x,a?.x),Ub(e.y,t.y,n.y,a?.y)}function Bb(e,t,n,a,s){return e-=t,e=fu(e,1/n,a),s!==void 0&&(e=fu(e,1/s,a)),e}function vO(e,t=0,n=1,a=.5,s,o=e,c=e){if(vr.test(t)&&(t=parseFloat(t),t=vt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=vt(o.min,o.max,a);e===o&&(u-=t),e.min=Bb(e.min,t,n,u,s),e.max=Bb(e.max,t,n,u,s)}function Fb(e,t,[n,a,s],o,c){vO(e,t[n],t[a],t[s],t.scale,o,c)}const bO=["x","scaleX","originX"],_O=["y","scaleY","originY"];function Vb(e,t,n,a){Fb(e.x,t,bO,n?n.x:void 0,a?a.x:void 0),Fb(e.y,t,_O,n?n.y:void 0,a?a.y:void 0)}function zb(e){return e.translate===0&&e.scale===1}function tx(e){return zb(e.x)&&zb(e.y)}function $b(e,t){return e.min===t.min&&e.max===t.max}function kO(e,t){return $b(e.x,t.x)&&$b(e.y,t.y)}function Hb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nx(e,t){return Hb(e.x,t.x)&&Hb(e.y,t.y)}function Wb(e){return ln(e.x)/ln(e.y)}function Kb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pr(e){return[e("x"),e("y")]}function wO(e,t,n){let a="";const s=e.x.translate/t.x,o=e.y.translate/t.y,c=n?.z||0;if((s||o||c)&&(a=`translate3d(${s}px, ${o}px, ${c}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,rotateX:y,rotateY:b,skewX:w,skewY:x}=n;f&&(a=`perspective(${f}px) ${a}`),m&&(a+=`rotate(${m}deg) `),y&&(a+=`rotateX(${y}deg) `),b&&(a+=`rotateY(${b}deg) `),w&&(a+=`skewX(${w}deg) `),x&&(a+=`skewY(${x}deg) `)}const u=e.x.scale*t.x,h=e.y.scale*t.y;return(u!==1||h!==1)&&(a+=`scale(${u}, ${h})`),a||"none"}const rx=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],xO=rx.length,Gb=e=>typeof e=="string"?parseFloat(e):e,qb=e=>typeof e=="number"||_e.test(e);function SO(e,t,n,a,s,o){s?(e.opacity=vt(0,n.opacity??1,PO(a)),e.opacityExit=vt(t.opacity??1,0,TO(a))):o&&(e.opacity=vt(t.opacity??1,n.opacity??1,a));for(let c=0;c<xO;c++){const u=rx[c];let h=Yb(t,u),f=Yb(n,u);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||qb(h)===qb(f)?(e[u]=Math.max(vt(Gb(h),Gb(f),a),0),(vr.test(f)||vr.test(h))&&(e[u]+="%")):e[u]=f}(t.rotate||n.rotate)&&(e.rotate=vt(t.rotate||0,n.rotate||0,a))}function Yb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const PO=ax(0,.5,qk),TO=ax(.5,.95,jn);function ax(e,t,n){return a=>a<e?0:a>t?1:n(Io(e,t,a))}function CO(e,t,n){const a=Gt(e)?e:gs(e);return a.start(Yp("",a,t,n)),a.animation}function Bo(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const EO=(e,t)=>e.depth-t.depth;class AO{constructor(){this.children=[],this.isDirty=!1}add(t){Ip(this.children,t),this.isDirty=!0}remove(t){ou(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(EO),this.isDirty=!1,this.children.forEach(t)}}function RO(e,t){const n=on.now(),a=({timestamp:s})=>{const o=s-n;o>=t&&(Na(a),e(o-t))};return dt.setup(a,!0),()=>Na(a)}function Vc(e){return Gt(e)?e.get():e}class LO{constructor(){this.members=[]}add(t){Ip(this.members,t);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===t||a===this.lead||a===this.prevLead)continue;const s=a.instance;(!s||s.isConnected===!1)&&!a.snapshot&&(ou(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(ou(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=a.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const zc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hh=["","X","Y","Z"],DO=1e3;let MO=0;function Wh(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function ix(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Pw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(s||o))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&ix(a)}function sx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(c={},u=t?.()){this.id=MO++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(IO),this.nodes.forEach(zO),this.nodes.forEach($O),this.nodes.forEach(jO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new AO)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Up),this.eventHandlers.get(c).add(u)}notifyListeners(c,...u){const h=this.eventHandlers.get(c);h&&h.notify(...u)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=tm(c)&&!ON(c),this.instance=c;const{layoutId:u,layout:h,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||u)&&(this.isLayoutDirty=!0),e){let m,y=0;const b=()=>this.root.updateBlockedByResize=!1;dt.read(()=>{y=window.innerWidth}),e(c,()=>{const w=window.innerWidth;w!==y&&(y=w,this.root.updateBlockedByResize=!0,m&&m(),m=RO(b,250),zc.hasAnimatedSinceResize&&(zc.hasAnimatedSinceResize=!1,this.nodes.forEach(Qb)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:b,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||qO,{onLayoutAnimationStart:T,onLayoutAnimationComplete:P}=f.getProps(),D=!this.targetLayout||!nx(this.targetLayout,w),R=!y&&b;if(this.options.layoutRoot||this.resumeFrom||R||y&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...qp(x,"layout"),onPlay:T,onComplete:P};(f.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(m,R)}else y||Qb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Na(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(HO),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ix(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const y=this.path[m];y.shouldResetTransform=!0,(typeof y.latestValues.x=="string"||typeof y.latestValues.y=="string")&&(y.isLayoutDirty=!0),y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach(BO),this.nodes.forEach(Zb);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xb);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(FO),this.nodes.forEach(VO),this.nodes.forEach(NO),this.nodes.forEach(OO)):this.nodes.forEach(Xb),this.clearAllSnapshots();const u=on.now();Kt.delta=xr(0,1e3/60,u-Kt.timestamp),Kt.timestamp=u,Kt.isProcessing=!0,Ih.update.process(Kt),Ih.preRender.process(Kt),Ih.render.process(Kt),Kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Jp.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(UO),this.sharedNodes.forEach(WO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ln(this.snapshot.measuredBox.x)&&!ln(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=It()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(u=!1),u&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!tx(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(u||ei(this.latestValues)||m)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return c&&(h=this.removeTransform(h)),YO(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return It();const u=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ZO))){const{scroll:f}=this.root;f&&(mr(u.x,f.offset.x),mr(u.y,f.offset.y))}return u}removeElementScroll(c){const u=It();if(tr(u,c),this.scroll?.wasRoot)return u;for(let h=0;h<this.path.length;h++){const f=this.path[h],{scroll:m,options:y}=f;f!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&tr(u,c),mr(u.x,m.offset.x),mr(u.y,m.offset.y))}return u}applyTransform(c,u=!1,h){const f=h||It();tr(f,c);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(mr(f.x,-y.scroll.offset.x),mr(f.y,-y.scroll.offset.y)),ei(y.latestValues)&&Fc(f,y.latestValues,y.layout?.layoutBox)}return ei(this.latestValues)&&Fc(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const u=It();tr(u,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!ei(f.latestValues))continue;let m;f.instance&&(zf(f.latestValues)&&f.updateSnapshot(),m=It(),tr(m,f.measurePageBox())),Vb(u,f.latestValues,f.snapshot?.layoutBox,m)}return ei(this.latestValues)&&Vb(u,this.latestValues),u}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==u;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!this.layout||!(m||y))return;this.resolvedRelativeTargetAt=Kt.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=It(),this.targetWithTransforms=It()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tr(this.target,this.layout.layoutBox),$w(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||zf(this.parent.latestValues)||zw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,u,h){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=It(),this.relativeTargetOrigin=It(),pu(this.relativeTargetOrigin,u,h,this.options.layoutAnchor||void 0),tr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),u=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Kt.timestamp&&(h=!1),h)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;tr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,b=this.treeScale.y;KN(this.layoutCorrected,this.treeScale,this.path,u),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=It());const{target:w}=c;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ob(this.prevProjectionDelta.x,this.projectionDelta.x),Ob(this.prevProjectionDelta.y,this.projectionDelta.y)),Eo(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==b||!Kb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Kb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ss(),this.projectionDelta=ss(),this.projectionDeltaWithTransform=ss()}setAnimationOrigin(c,u=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},y=ss();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const b=It(),w=h?h.source:void 0,x=this.layout?this.layout.source:void 0,T=w!==x,P=this.getStack(),D=!P||P.members.length<=1,R=!!(T&&!D&&this.options.crossfade===!0&&!this.path.some(GO));this.animationProgress=0;let L;this.mixTargetDelta=j=>{const G=j/1e3;Jb(y.x,c.x,G),Jb(y.y,c.y,G),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pu(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),KO(this.relativeTarget,this.relativeTargetOrigin,b,G),L&&kO(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=It()),tr(L,this.relativeTarget)),T&&(this.animationValues=m,SO(m,f,this.latestValues,G,R,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=G},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Na(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{zc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gs(0)),this.motionValue.jump(0,!1),this.currentAnimation=CO(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),c.onUpdate&&c.onUpdate(u)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:h,layout:f,latestValues:m}=c;if(!(!u||!h||!f)){if(this!==c&&this.layout&&f&&ox(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||It();const y=ln(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const b=ln(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+b}tr(u,h),Fc(u,m),Eo(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new LO),this.sharedNodes.get(c).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:h}={}){const f=this.getStack();f&&f.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const f={};h.z&&Wh("z",c,f,this.animationValues);for(let m=0;m<Hh.length;m++)Wh(`rotate${Hh[m]}`,c,f,this.animationValues),Wh(`skew${Hh[m]}`,c,f,this.animationValues);c.render();for(const m in f)c.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);c.scheduleRender()}applyProjectionStyles(c,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Vc(u?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Vc(u?.pointerEvents)||""),this.hasProjected&&!ei(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let y=wO(this.projectionDeltaWithTransform,this.treeScale,m);h&&(y=h(m,y)),c.transform=y;const{x:b,y:w}=this.projectionDelta;c.transformOrigin=`${b.origin*100}% ${w.origin*100}% 0`,f.animationValues?c.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:c.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Hf){if(m[x]===void 0)continue;const{correct:T,applyTo:P,isCSSVariable:D}=Hf[x],R=y==="none"?m[x]:T(m[x],f);if(P){const L=P.length;for(let j=0;j<L;j++)c[P[j]]=R}else D?this.options.visualElement.renderState.vars[x]=R:c[x]=R}this.options.layoutId&&(c.pointerEvents=f===this?Vc(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Zb),this.root.sharedNodes.clear()}}}function NO(e){e.updateLayout()}function OO(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")pr(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],b=ln(y);y.min=n[m].min,y.max=y.min+b});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";Wf(o?t.measuredBox[m]:t.layoutBox[m],n[m])}else ox(s,t.layoutBox,n)&&pr(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],b=ln(n[m]);y.max=y.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+b)});const c=ss();Eo(c,n,t.layoutBox);const u=ss();o?Eo(u,e.applyTransform(a,!0),t.measuredBox):Eo(u,n,t.layoutBox);const h=!tx(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:b}=m;if(y&&b){const w=e.options.layoutAnchor||void 0,x=It();pu(x,t.layoutBox,y.layoutBox,w);const T=It();pu(T,n,b.layoutBox,w),nx(x,T)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function IO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function UO(e){e.clearSnapshot()}function Zb(e){e.clearMeasurements()}function BO(e){e.isLayoutDirty=!0,e.updateLayout()}function Xb(e){e.isLayoutDirty=!1}function FO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function VO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Qb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zO(e){e.resolveTargetDelta()}function $O(e){e.calcProjection()}function HO(e){e.resetSkewAndRotation()}function WO(e){e.removeLeadSnapshot()}function Jb(e,t,n){e.translate=vt(t.translate,0,n),e.scale=vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function e0(e,t,n,a){e.min=vt(t.min,n.min,a),e.max=vt(t.max,n.max,a)}function KO(e,t,n,a){e0(e.x,t.x,n.x,a),e0(e.y,t.y,n.y,a)}function GO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qO={duration:.45,ease:[.4,0,.1,1]},t0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),n0=t0("applewebkit/")&&!t0("chrome/")?Math.round:jn;function r0(e){e.min=n0(e.min),e.max=n0(e.max)}function YO(e){r0(e.x),r0(e.y)}function ox(e,t,n){return e==="position"||e==="preserve-aspect"&&!gO(Wb(t),Wb(n),.2)}function ZO(e){return e!==e.root&&e.scroll?.wasRoot}const XO=sx({attachResizeListener:(e,t)=>Bo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Kh={current:void 0},lx=sx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kh.current){const e=new XO({});e.mount(window),e.setOptions({layoutScroll:!0}),Kh.current=e}return Kh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),sm=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function a0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QO(...e){return t=>{let n=!1;const a=e.map(s=>{const o=a0(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<a.length;s++){const o=a[s];typeof o=="function"?o():a0(e[s],null)}}}}function JO(...e){return k.useCallback(QO(...e),e)}class eI extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Oc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,s=Oc(a)&&a.offsetWidth||0,o=Oc(a)&&a.offsetHeight||0,c=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(c.height),u.width=parseFloat(c.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function tI({children:e,isPresent:t,anchorX:n,anchorY:a,root:s,pop:o}){const c=k.useId(),u=k.useRef(null),h=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=k.useContext(sm),m=e.props?.ref??e?.ref,y=JO(u,m);return k.useInsertionEffect(()=>{const{width:b,height:w,top:x,left:T,right:P,bottom:D}=h.current;if(t||o===!1||!u.current||!b||!w)return;const R=n==="left"?`left: ${T}`:`right: ${P}`,L=a==="bottom"?`bottom: ${D}`:`top: ${x}`;u.current.dataset.motionPopId=c;const j=document.createElement("style");f&&(j.nonce=f);const G=s??document.head;return G.appendChild(j),j.sheet&&j.sheet.insertRule(`
681
+ [data-motion-pop-id="${c}"] {
682
+ position: absolute !important;
683
+ width: ${b}px !important;
684
+ height: ${w}px !important;
685
+ ${R}px !important;
686
+ ${L}px !important;
687
+ }
688
+ `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(j)&&G.removeChild(j)}},[t]),I.jsx(eI,{isPresent:t,childRef:u,sizeRef:h,pop:o,children:o===!1?e:k.cloneElement(e,{ref:y})})}const nI=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:o,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=Op(rI),y=k.useId();let b=!0,w=k.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:x=>{m.set(x,!0);for(const T of m.values())if(!T)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return o&&b&&(w={...w}),k.useMemo(()=>{m.forEach((x,T)=>m.set(T,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=I.jsx(tI,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),I.jsx(Au.Provider,{value:w,children:e})};function rI(){return new Map}function cx(e=!0){const t=k.useContext(Au);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,o=k.useId();k.useEffect(()=>{if(e)return s(o)},[e]);const c=k.useCallback(()=>e&&a&&a(o),[o,a,e]);return!n&&a?[!1,c]:[!0]}const vc=e=>e.key||"";function i0(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const aI=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:o="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=cx(c),b=k.useMemo(()=>i0(e),[e]),w=c&&!m?[]:b.map(vc),x=k.useRef(!0),T=k.useRef(b),P=Op(()=>new Map),D=k.useRef(new Set),[R,L]=k.useState(b),[j,G]=k.useState(b);Ik(()=>{x.current=!1,T.current=b;for(let S=0;S<j.length;S++){const Z=vc(j[S]);w.includes(Z)?(P.delete(Z),D.current.delete(Z)):P.get(Z)!==!0&&P.set(Z,!1)}},[j,w.length,w.join("-")]);const K=[];if(b!==R){let S=[...b];for(let Z=0;Z<j.length;Z++){const X=j[Z],me=vc(X);w.includes(me)||(S.splice(Z,0,X),K.push(X))}return o==="wait"&&K.length&&(S=K),G(i0(S)),L(b),null}const{forceRender:H}=k.useContext(Np);return I.jsx(I.Fragment,{children:j.map(S=>{const Z=vc(S),X=c&&!m?!1:b===j||w.includes(Z),me=()=>{if(D.current.has(Z))return;if(P.has(Z))D.current.add(Z),P.set(Z,!0);else return;let oe=!0;P.forEach(Ae=>{Ae||(oe=!1)}),oe&&(H?.(),G(T.current),c&&y?.(),a&&a())};return I.jsx(nI,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:f,onExitComplete:X?void 0:me,anchorX:u,anchorY:h,children:S},Z)})})},ux=k.createContext({strict:!1}),s0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let o0=!1;function iI(){if(o0)return;const e={};for(const t in s0)e[t]={isEnabled:n=>s0[t].some(a=>!!n[a])};Bw(e),o0=!0}function dx(){return iI(),zN()}function sI(e){const t=dx();for(const n in e)t[n]={...t[n],...e[n]};Bw(t)}const oI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function mu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||oI.has(e)}let hx=e=>!mu(e);function lI(e){typeof e=="function"&&(hx=t=>t.startsWith("on")?!mu(t):e(t))}try{lI(require("@emotion/is-prop-valid").default)}catch{}function cI(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||Gt(e[s])||(hx(s)||n===!0&&mu(s)||!t&&!mu(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Mu=k.createContext({});function uI(e,t){if(Du(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Uo(n)?n:void 0,animate:Uo(a)?a:void 0}}return e.inherit!==!1?t:{}}function dI(e){const{initial:t,animate:n}=uI(e,k.useContext(Mu));return k.useMemo(()=>({initial:t,animate:n}),[l0(t),l0(n)])}function l0(e){return Array.isArray(e)?e.join(" "):e}const om=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fx(e,t,n){for(const a in t)!Gt(t[a])&&!Kw(a,n)&&(e[a]=t[a])}function hI({transformTemplate:e},t){return k.useMemo(()=>{const n=om();return am(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fI(e,t){const n=e.style||{},a={};return fx(a,n,e),Object.assign(a,hI(e,t)),a}function pI(e,t){const n={},a=fI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const px=()=>({...om(),attrs:{}});function mI(e,t,n,a){const s=k.useMemo(()=>{const o=px();return Gw(o,t,Yw(a),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};fx(o,e.style,e),s.style={...o,...s.style}}return s}const gI=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lm(e){return typeof e!="string"||e.includes("-")?!1:!!(gI.indexOf(e)>-1||/[A-Z]/u.test(e))}function yI(e,t,n,{latestValues:a},s,o=!1,c){const h=(c??lm(e)?mI:pI)(t,a,s,e),f=cI(t,typeof e=="string",o),m=e!==k.Fragment?{...f,...h,ref:n}:{},{children:y}=t,b=k.useMemo(()=>Gt(y)?y.get():y,[y]);return k.createElement(e,{...m,children:b})}function vI({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:bI(n,a,s,e),renderState:t()}}function bI(e,t,n,a){const s={},o=a(e,{});for(const b in o)s[b]=Vc(o[b]);let{initial:c,animate:u}=e;const h=Du(e),f=jw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Lu(y)){const b=Array.isArray(y)?y:[y];for(let w=0;w<b.length;w++){const x=Zp(e,b[w]);if(x){const{transitionEnd:T,transition:P,...D}=x;for(const R in D){let L=D[R];if(Array.isArray(L)){const j=m?L.length-1:0;L=L[j]}L!==null&&(s[R]=L)}for(const R in T)s[R]=T[R]}}}return s}const mx=e=>(t,n)=>{const a=k.useContext(Mu),s=k.useContext(Au),o=()=>vI(e,t,a,s);return n?o():Op(o)},_I=mx({scrapeMotionValuesFromProps:im,createRenderState:om}),kI=mx({scrapeMotionValuesFromProps:Zw,createRenderState:px}),wI=Symbol.for("motionComponentSymbol");function xI(e,t,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const s=k.useRef(null);return k.useCallback(o=>{o&&e.onMount?.(o);const c=a.current;if(typeof c=="function")if(o){const u=c(o);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):c(o);else c&&(c.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const gx=k.createContext({});function ts(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SI(e,t,n,a,s,o){const{visualElement:c}=k.useContext(Mu),u=k.useContext(ux),h=k.useContext(Au),f=k.useContext(sm),m=f.reducedMotion,y=f.skipAnimations,b=k.useRef(null),w=k.useRef(!1);a=a||u.renderer,!b.current&&a&&(b.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:o}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const x=b.current,T=k.useContext(gx);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&PI(b.current,n,s,T);const P=k.useRef(!1);k.useInsertionEffect(()=>{x&&P.current&&x.update(n,h)});const D=n[Sw],R=k.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return Ik(()=>{w.current=!0,x&&(P.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),R.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!R.current&&x.animationState&&x.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),R.current=!1),x.enteringChildren=void 0)}),x}function PI(e,t,n,a){const{layoutId:s,layout:o,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yx(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!c||u&&ts(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function yx(e){if(e)return e.options.allowProjection!==!1?e.projection:yx(e.parent)}function Gh(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&sI(a);const o=n?n==="svg":lm(e),c=o?kI:_I;function u(f,m){let y;const b={...k.useContext(sm),...f,layoutId:TI(f)},{isStatic:w}=b,x=dI(f),T=c(f,w);if(!w&&typeof window<"u"){CI();const P=EI(b);y=P.MeasureLayout,x.visualElement=SI(e,T,b,s,P.ProjectionNode,o)}return I.jsxs(Mu.Provider,{value:x,children:[y&&x.visualElement?I.jsx(y,{visualElement:x.visualElement,...b}):null,yI(e,f,xI(T,x.visualElement,m),T,w,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=k.forwardRef(u);return h[wI]=e,h}function TI({layoutId:e}){const t=k.useContext(Np).id;return t&&e!==void 0?t+"-"+e:e}function CI(e,t){k.useContext(ux).strict}function EI(e){const t=dx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function AI(e,t){if(typeof Proxy>"u")return Gh;const n=new Map,a=(o,c)=>Gh(o,c,e,t),s=(o,c)=>a(o,c);return new Proxy(s,{get:(o,c)=>c==="create"?a:(n.has(c)||n.set(c,Gh(c,void 0,e,t)),n.get(c))})}const RI=(e,t)=>t.isSVG??lm(e)?new iO(t):new JN(t,{allowProjection:e!==k.Fragment});class LI extends Ia{constructor(t){super(t),t.animationState||(t.animationState=uO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Lu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let DI=0;class MI extends Ia{constructor(){super(...arguments),this.id=DI++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:o,custom:c}=this.node.getProps();if(typeof o=="string"){const u=si(this.node,o,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const NI={animation:{Feature:LI},exit:{Feature:MI}};function el(e){return{point:{x:e.pageX,y:e.pageY}}}const OI=e=>t=>em(t)&&e(t,el(t));function Ao(e,t,n,a){return Bo(e,t,OI(n),a)}const vx=({current:e})=>e?e.ownerDocument.defaultView:null,c0=(e,t)=>Math.abs(e-t);function II(e,t){const n=c0(e.x,t.x),a=c0(e.y,t.y);return Math.sqrt(n**2+a**2)}const u0=new Set(["auto","scroll"]);class bx{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=qh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,T=II(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!T)return;const{point:P}=w,{timestamp:D}=Kt;this.history.push({...P,timestamp:D});const{onStart:R,onMove:L}=this.handlers;x||(R&&R(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:T,onSessionEnd:P,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=qh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&T&&T(w,R),P&&P(w,R)},!em(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=s||window;const h=el(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:b}=n;b&&b(t,qh(f,this.history)),this.removeListeners=Xo(Ao(this.contextWindow,"pointermove",this.handlePointerMove),Ao(this.contextWindow,"pointerup",this.handlePointerUp),Ao(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(u0.has(a.overflowX)||u0.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function d0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qh({point:e},t){return{point:e,delta:d0(e,_x(t)),offset:d0(e,jI(t)),velocity:UI(t,.1)}}function jI(e){return e[0]}function _x(e){return e[e.length-1]}function UI(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=_x(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>Sn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&s.timestamp-a.timestamp>Sn(t)*2&&(a=e[1]);const o=In(s.timestamp-a.timestamp);if(o===0)return{x:0,y:0};const c={x:(s.x-a.x)/o,y:(s.y-a.y)/o};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function BI(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function h0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function FI(e,{top:t,left:n,bottom:a,right:s}){return{x:h0(e.x,n,s),y:h0(e.y,t,a)}}function f0(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function VI(e,t){return{x:f0(e.x,t.x),y:f0(e.y,t.y)}}function zI(e,t){let n=.5;const a=ln(e),s=ln(t);return s>a?n=Io(t.min,t.max-a,e.min):a>s&&(n=Io(e.min,e.max-s,t.min)),xr(0,1,n)}function $I(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Kf=.35;function HI(e=Kf){return e===!1?e=0:e===!0&&(e=Kf),{x:p0(e,"left","right"),y:p0(e,"top","bottom")}}function p0(e,t,n){return{min:m0(e,t),max:m0(e,n)}}function m0(e,t){return typeof e=="number"?e:e[t]||0}const WI=new WeakMap;class KI{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=It(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=y=>{n&&this.snapToCursor(el(y).point),this.stopAnimation()},c=(y,b)=>{const{drag:w,dragPropagation:x,onDragStart:T}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vN(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let R=this.getAxisMotionValue(D).get()||0;if(vr.test(R)){const{projection:L}=this.visualElement;if(L&&L.layout){const j=L.layout.layoutBox[D];j&&(R=ln(j)*(parseFloat(R)/100))}}this.originPoint[D]=R}),T&&dt.update(()=>T(y,b),!1,!0),jf(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},u=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:T,onDrag:P}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=b;if(x&&this.currentDirection===null){this.currentDirection=qI(D),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,D),this.updateAxis("y",b.point,D),this.visualElement.render(),P&&dt.update(()=>P(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new bx(t,{onSessionStart:o,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:vx(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!a)return;const{velocity:c}=s;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:s}=this.getProps();if(!a||!_c(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=BI(c,this.constraints[t],this.elastic[t])),o.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&ts(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=FI(a.layoutBox,t):this.constraints=!1,this.elastic=HI(n),s!==this.constraints&&!ts(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=$I(a.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ts(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=GN(a,s.root,this.visualElement.getTransformPagePoint());let c=VI(s.layout.layoutBox,o);if(n){const u=n(HN(c));this.hasMutatedConstraints=!!u,u&&(c=Vw(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:o,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!_c(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const b=s?200:1e6,w=s?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:b,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return jf(this.visualElement,t),a.start(Yp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!_c(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:c,max:u}=s.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ts(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();s[c]=zI({min:h,max:h},this.constraints[c])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!_c(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,s[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;WI.set(this.visualElement,this);const t=this.visualElement.current,n=Ao(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),b=f.target,w=b!==t&&SN(b);m&&y&&!w&&this.start(f)});let a;const s=()=>{const{dragConstraints:f}=this.getProps();ts(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=GI(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,c=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dt.read(s);const u=Bo(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=f[y].translate,b.set(b.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:c=Kf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:o,dragElastic:c,dragMomentum:u}}}function g0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function GI(e,t,n){const a=xb(e,g0(n)),s=xb(t,g0(n));return()=>{a(),s()}}function _c(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qI(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class YI extends Ia{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new KI(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Yh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class ZI extends Ia{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new bx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yh(t),onStart:Yh(n),onMove:Yh(a),onEnd:(o,c)=>{delete this.session,s&&dt.postRender(()=>s(o,c))}}}mount(){this.removePointerDownListener=Ao(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Zh=!1;class XI extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),a&&a.register&&s&&a.register(o),Zh&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:o}=this.props,{projection:c}=a;return c&&(c.isPresent=o,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Zh=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?c.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Jp.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;Zh=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function kx(e){const[t,n]=cx(),a=k.useContext(Np);return I.jsx(XI,{...e,layoutGroup:a,switchLayoutGroup:k.useContext(gx),isPresent:t,safeToRemove:n})}const QI={pan:{Feature:ZI},drag:{Feature:YI,ProjectionNode:lx,MeasureLayout:kx}};function y0(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=a[s];o&&dt.postRender(()=>o(t,el(t)))}class JI extends Ia{mount(){const{current:t}=this.node;t&&(this.unmount=_N(t,(n,a)=>(y0(this.node,a,"Start"),s=>y0(this.node,s,"End"))))}unmount(){}}class e3 extends Ia{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xo(Bo(this.node.current,"focus",()=>this.onFocus()),Bo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function v0(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=a[s];o&&dt.postRender(()=>o(t,el(t)))}class t3 extends Ia{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=TN(t,(s,o)=>(v0(this.node,o,"Start"),(c,{success:u})=>v0(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Gf=new WeakMap,Xh=new WeakMap,n3=e=>{const t=Gf.get(e.target);t&&t(e)},r3=e=>{e.forEach(n3)};function a3({root:e,...t}){const n=e||document;Xh.has(n)||Xh.set(n,{});const a=Xh.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(r3,{root:e,...t})),a[s]}function i3(e,t,n){const a=a3(t);return Gf.set(e,n),a.observe(e),()=>{Gf.delete(e),a.unobserve(e)}}const s3={some:0,all:1};class o3 extends Ia{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:o}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:s3[s]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),b=f?m:y;b&&b(h)};this.stopObserver=i3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(l3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function l3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const c3={inView:{Feature:o3},tap:{Feature:t3},focus:{Feature:e3},hover:{Feature:JI}},u3={layout:{ProjectionNode:lx,MeasureLayout:kx}},d3={...NI,...c3,...QI,...u3},Qh=AI(d3,RI);function wx(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=wx(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function h3(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=wx(e))&&(a&&(a+=" "),a+=t);return a}const f3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},p3=(e,t)=>({classGroupId:e,validator:t}),xx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gu="-",b0=[],m3="arbitrary..",g3=e=>{const t=v3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return y3(c);const u=c.split(gu),h=u[0]===""&&u.length>1?1:0;return Sx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?f3(f,h):h:f||b0}return n[c]||b0}}},Sx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const f=Sx(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(gu):e.slice(t).join(gu),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},y3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?m3+a:void 0})(),v3=e=>{const{theme:t,classGroups:n}=e;return b3(n,t)},b3=(e,t)=>{const n=xx();for(const a in e){const s=e[a];cm(s,n,a,t)}return n},cm=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const c=e[o];_3(c,t,n,a)}},_3=(e,t,n,a)=>{if(typeof e=="string"){k3(e,t,n);return}if(typeof e=="function"){w3(e,t,n,a);return}x3(e,t,n,a)},k3=(e,t,n)=>{const a=e===""?t:Px(t,e);a.classGroupId=n},w3=(e,t,n,a)=>{if(S3(e)){cm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(p3(n,e))},x3=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let c=0;c<o;c++){const[u,h]=s[c];cm(h,Px(t,u),n,a)}},Px=(e,t)=>{let n=e;const a=t.split(gu),s=a.length;for(let o=0;o<s;o++){const c=a[o];let u=n.nextPart.get(c);u||(u=xx(),n.nextPart.set(c,u)),n=u}return n},S3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,P3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return s(o,c),c},set(o,c){o in n?n[o]=c:s(o,c)}}},qf="!",_0=":",T3=[],k0=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),C3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let c=0,u=0,h=0,f;const m=s.length;for(let T=0;T<m;T++){const P=s[T];if(c===0&&u===0){if(P===_0){o.push(s.slice(h,T)),h=T+1;continue}if(P==="/"){f=T;continue}}P==="["?c++:P==="]"?c--:P==="("?u++:P===")"&&u--}const y=o.length===0?s:s.slice(h);let b=y,w=!1;y.endsWith(qf)?(b=y.slice(0,-1),w=!0):y.startsWith(qf)&&(b=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return k0(o,w,b,x)};if(t){const s=t+_0,o=a;a=c=>c.startsWith(s)?o(c.slice(s.length)):k0(T3,!1,c,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},E3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let o=0;o<n.length;o++){const c=n[o],u=c[0]==="[",h=t.has(c);u||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(c)):s.push(c)}return s.length>0&&(s.sort(),a.push(...s)),a}},A3=e=>({cache:P3(e.cacheSize),parseClassName:C3(e),sortModifiers:E3(e),...g3(e)}),R3=/\s+/,L3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,c=[],u=e.trim().split(R3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:b,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:T}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let P=!!T,D=a(P?x.substring(0,T):x);if(!D){if(!P){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}P=!1}const R=b.length===0?"":b.length===1?b[0]:o(b).join(":"),L=w?R+qf:R,j=L+D;if(c.indexOf(j)>-1)continue;c.push(j);const G=s(D,P);for(let K=0;K<G.length;++K){const H=G[K];c.push(L+H)}h=m+(h.length>0?" "+h:h)}return h},D3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=Tx(n))&&(s&&(s+=" "),s+=a);return s},Tx=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Tx(e[a]))&&(n&&(n+=" "),n+=t);return n},M3=(e,...t)=>{let n,a,s,o;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=A3(f),a=n.cache.get,s=n.cache.set,o=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=L3(h,n);return s(h,m),m};return o=c,(...h)=>o(D3(...h))},N3=[],Ot=e=>{const t=n=>n[e]||N3;return t.isThemeGetter=!0,t},Cx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,O3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,I3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,U3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=e=>O3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),xa=e=>!!e&&Number.isInteger(Number(e)),Jh=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>I3.test(e),Ax=()=>!0,V3=e=>j3.test(e)&&!U3.test(e),um=()=>!1,z3=e=>B3.test(e),$3=e=>F3.test(e),H3=e=>!be(e)&&!ke(e),W3=e=>ja(e,Dx,um),be=e=>Cx.test(e),Ja=e=>ja(e,Mx,V3),w0=e=>ja(e,J3,qe),K3=e=>ja(e,Ox,Ax),G3=e=>ja(e,Nx,um),x0=e=>ja(e,Rx,um),q3=e=>ja(e,Lx,$3),kc=e=>ja(e,Ix,z3),ke=e=>Ex.test(e),mo=e=>gi(e,Mx),Y3=e=>gi(e,Nx),S0=e=>gi(e,Rx),Z3=e=>gi(e,Dx),X3=e=>gi(e,Lx),wc=e=>gi(e,Ix,!0),Q3=e=>gi(e,Ox,!0),ja=(e,t,n)=>{const a=Cx.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Ex.exec(e);return a?a[1]?t(a[1]):n:!1},Rx=e=>e==="position"||e==="percentage",Lx=e=>e==="image"||e==="url",Dx=e=>e==="length"||e==="size"||e==="bg-size",Mx=e=>e==="length",J3=e=>e==="number",Nx=e=>e==="family-name",Ox=e=>e==="number"||e==="weight",Ix=e=>e==="shadow",ej=()=>{const e=Ot("color"),t=Ot("font"),n=Ot("text"),a=Ot("font-weight"),s=Ot("tracking"),o=Ot("leading"),c=Ot("breakpoint"),u=Ot("container"),h=Ot("spacing"),f=Ot("radius"),m=Ot("shadow"),y=Ot("inset-shadow"),b=Ot("text-shadow"),w=Ot("drop-shadow"),x=Ot("blur"),T=Ot("perspective"),P=Ot("aspect"),D=Ot("ease"),R=Ot("animate"),L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...j(),ke,be],K=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],S=()=>[ke,be,h],Z=()=>[wa,"full","auto",...S()],X=()=>[xa,"none","subgrid",ke,be],me=()=>["auto",{span:["full",xa,ke,be]},xa,ke,be],oe=()=>[xa,"auto",ke,be],Ae=()=>["auto","min","max","fr",ke,be],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ue=()=>["start","end","center","stretch","center-safe","end-safe"],le=()=>["auto",...S()],Me=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],W=()=>[wa,"screen","full","dvw","lvw","svw","min","max","fit",...S()],Y=()=>[wa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],$=()=>[e,ke,be],N=()=>[...j(),S0,x0,{position:[ke,be]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",Z3,W3,{size:[ke,be]}],Re=()=>[Jh,mo,Ja],Se=()=>["","none","full",f,ke,be],Ce=()=>["",qe,mo,Ja],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,Jh,S0,x0],jt=()=>["","none",x,ke,be],Hn=()=>["none",qe,ke,be],Tr=()=>["none",qe,ke,be],pt=()=>[qe,ke,be],en=()=>[wa,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Ax],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[H3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,be,ke,P]}],container:["container"],columns:[{columns:[qe,be,ke,u]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",ke,be]}],basis:[{basis:[wa,"full","auto",u,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,wa,"auto","initial","none",be]}],grow:[{grow:["",qe,ke,be]}],shrink:[{shrink:["",qe,ke,be]}],order:[{order:[xa,"first","last","none",ke,be]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ue(),"normal"]}],"justify-self":[{"justify-self":["auto",...ue()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ue(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ue(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ue(),"baseline"]}],"place-self":[{"place-self":["auto",...ue()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:le()}],mx:[{mx:le()}],my:[{my:le()}],ms:[{ms:le()}],me:[{me:le()}],mbs:[{mbs:le()}],mbe:[{mbe:le()}],mt:[{mt:le()}],mr:[{mr:le()}],mb:[{mb:le()}],ml:[{ml:le()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Me()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[u,"screen",...Me()]}],"min-w":[{"min-w":[u,"screen","none",...Me()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Me()]}],h:[{h:["screen","lh",...Me()]}],"min-h":[{"min-h":["screen","lh","none",...Me()]}],"max-h":[{"max-h":["screen","lh",...Me()]}],"font-size":[{text:["base",n,mo,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Q3,K3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jh,be]}],"font-family":[{font:[Y3,G3,t]}],"font-features":[{"font-features":[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ke,be]}],"line-clamp":[{"line-clamp":[qe,"none",ke,w0]}],leading:[{leading:[o,...S()]}],"list-image":[{"list-image":["none",ke,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",ke,Ja]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[qe,"auto",ke,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,ke,be],radial:["",ke,be],conic:[xa,ke,be]},X3,q3]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:Ce()}],"border-w-x":[{"border-x":Ce()}],"border-w-y":[{"border-y":Ce()}],"border-w-s":[{"border-s":Ce()}],"border-w-e":[{"border-e":Ce()}],"border-w-bs":[{"border-bs":Ce()}],"border-w-be":[{"border-be":Ce()}],"border-w-t":[{"border-t":Ce()}],"border-w-r":[{"border-r":Ce()}],"border-w-b":[{"border-b":Ce()}],"border-w-l":[{"border-l":Ce()}],"divide-x":[{"divide-x":Ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,ke,be]}],"outline-w":[{outline:["",qe,mo,Ja]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",m,wc,kc]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",y,wc,kc]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[qe,Ja]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Ce()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",b,wc,kc]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[qe,ke,be]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ke,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,be]}],filter:[{filter:["","none",ke,be]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,ke,be]}],contrast:[{contrast:[qe,ke,be]}],"drop-shadow":[{"drop-shadow":["","none",w,wc,kc]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",qe,ke,be]}],"hue-rotate":[{"hue-rotate":[qe,ke,be]}],invert:[{invert:["",qe,ke,be]}],saturate:[{saturate:[qe,ke,be]}],sepia:[{sepia:["",qe,ke,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,be]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,ke,be]}],"backdrop-contrast":[{"backdrop-contrast":[qe,ke,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,ke,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,ke,be]}],"backdrop-invert":[{"backdrop-invert":["",qe,ke,be]}],"backdrop-opacity":[{"backdrop-opacity":[qe,ke,be]}],"backdrop-saturate":[{"backdrop-saturate":[qe,ke,be]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,ke,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",ke,be]}],ease:[{ease:["linear","initial",D,ke,be]}],delay:[{delay:[qe,ke,be]}],animate:[{animate:["none",R,ke,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ke,be]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Tr()}],"scale-x":[{"scale-x":Tr()}],"scale-y":[{"scale-y":Tr()}],"scale-z":[{"scale-z":Tr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[ke,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,be]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[qe,mo,Ja,w0]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tj=M3(ej);function Ct(...e){return tj(h3(e))}const nj=I.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[I.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),I.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),I.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),I.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),rj=I.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:I.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),aj={google:nj,github:rj},ij={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function sj(e){return ij[e]||String(e||"").replace(/-/g," ")}function oj(){Zo();const{isOpen:e,closeLoginModal:t}=Ok(),{enabled:n,signedIn:a,refreshUser:s,signInWithPassword:o,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=qo(),[f,m]=k.useState("signin"),[y,b]=k.useState(""),[w,x]=k.useState(""),[T,P]=k.useState(""),[D,R]=k.useState(!1),[L,j]=k.useState(null),[G,K]=k.useState(null),[H,S]=k.useState(!1),[Z,X]=k.useState(!0),[me,oe]=k.useState([]),[Ae,fe]=k.useState(8);k.useEffect(()=>{e&&(j(null),K(null),m("signin"),b(""),x(""),P(""),S(!1))},[e]),k.useEffect(()=>{if(!e||!n){X(!1);return}let W=!0;return(async()=>{const{data:Y,error:$}=await h();if(W){if($||!Y)oe(["google","github"]);else{const N=Array.isArray(Y.oAuthProviders)?Y.oAuthProviders:[],q=Array.isArray(Y.customOAuthProviders)?Y.customOAuthProviders:[];oe([...N,...q]),typeof Y.passwordMinLength=="number"&&Y.passwordMinLength>0&&fe(Y.passwordMinLength)}X(!1)}})(),()=>{W=!1}},[e,n,h]),k.useEffect(()=>{e&&a&&t()},[e,a,t]);const ue=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),le=k.useCallback(async W=>{j(null),R(!0);try{const{error:Y}=await u(W,ue);Y&&j(Y.message||String(Y))}finally{R(!1)}},[u,ue]),Me=k.useCallback(async W=>{W.preventDefault(),j(null),R(!0);try{if(f==="signup"){const{data:$,error:N}=await c({email:y.trim(),password:w,name:T.trim()||void 0});if(N){j(N.message||String(N));return}if($?.requireEmailVerification){K(Fe("login.verify_email_pending")),m("signin");return}await s();return}const{error:Y}=await o({email:y.trim(),password:w});if(Y){j(Y.message||String(Y));return}await s()}finally{R(!1)}},[f,y,w,T,c,o,s]);return k.useEffect(()=>{if(!e)return;const W=Y=>{Y.key==="Escape"&&t()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[e,t]),n?I.jsx(aI,{children:e&&I.jsxs(Qh.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[I.jsx(Qh.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),I.jsxs(Qh.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:W=>W.stopPropagation(),children:[I.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:I.jsx(Dk,{className:"h-5 w-5"})}),I.jsxs("div",{className:"text-center mb-6",children:[I.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),I.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),I.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&I.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),L&&I.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:L}),I.jsx("div",{className:"space-y-2.5 mb-5",children:Z?I.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):me.map(W=>I.jsxs("button",{type:"button",disabled:D,onClick:()=>le(W),className:Ct("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[aj[W]||null,Fe("login.oauth.continue",{provider:sj(W)})]},W))}),H?I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),I.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),j(null)},children:Fe("login.tab.sign_in")}),I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),j(null)},children:Fe("login.tab.sign_up")})]}),I.jsxs("form",{onSubmit:Me,className:"space-y-3",children:[f==="signup"&&I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),I.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:T,onChange:W=>P(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),I.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:W=>b(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),I.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:W=>x(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&I.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),I.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),I.jsxs("button",{type:"button",onClick:()=>S(!0),className:Ct("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[I.jsx($D,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const lj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function cj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?lj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||"").trim()}function V4(){return fi()}function uj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const dj=300*1e3,hj=720*60*1e3;function dm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function fj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+hj<=t:!0}async function jx(e,t){const n=fi();if(!dm(n)||!e)return;const a=n.replace(/\/$/,""),s=Tu(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};s&&(o.apikey=s);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:o,body:JSON.stringify({period:"week",source:t})})}catch{}}async function pj(e){const t=fi();if(!dm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Tu(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(s.apikey=a);const o=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:s,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:o})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function P0(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},s=n||fi();dm(s)&&(a.insforgeBaseUrl=s.trim());const o=await Rp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...o},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function T0(e){const t=await e();if(!t)return null;const n=tk();if(n&&!fj(n))return n;const a=await pj(t);return a?(IR(a),a):null}async function Ux(e){let t=await e();if(!t)return null;let n=await T0(async()=>t);if(!n)return t;try{return await P0({deviceToken:n.token,insforgeBaseUrl:fi()}),t}catch(a){if(!tk()||(nk(),t=await e(),!t)||(n=await T0(async()=>t),!n))throw a;return await P0({deviceToken:n.token,insforgeBaseUrl:fi()}),t}}async function mj(e){const t=jR();if(Date.now()-t<dj)return;const n=await Ux(e);n&&(rk(Date.now()),await jx(n,"cloud-sync-auto"))}async function z4(e){const t=await Ux(e);t&&(rk(Date.now()),await jx(t,"cloud-sync-now"))}function gj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function yj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||gj(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function vj(){const e=Fn(),t=qo(),n=k.useRef(!1);k.useEffect(()=>{if(!NR()||!yj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!OR())return;let a=!1;const s=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await mj(()=>t.getAccessToken())}catch(o){console.warn("[tokentracker] cloud usage sync:",o)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(s)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function bj(){const e=k.useContext(Mk);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function _j({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function kj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function C0(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function E0({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Zo();const s=t==="sidebar",{enabled:o,loading:c,signedIn:u,user:h,displayName:f}=qo(),{openLoginModal:m}=Ok(),y=bu(),b=k.useMemo(()=>kj(h),[h]);if(!o)return null;if(c)return I.jsx("div",{className:Ct("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return s?I.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Ct("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&I.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):I.jsx("button",{type:"button",onClick:m,className:Ct("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const w=()=>{y("/settings"),a?.()};return I.jsx("div",{className:Ct(s?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:I.jsxs("button",{type:"button",onClick:w,className:Ct(s?Ct("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:s&&n?f:void 0,children:[s?I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:b?I.jsx("img",{src:b,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):I.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:C0(f)})}):b?I.jsx("img",{src:b,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer"}):I.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:C0(f)}),s?!n&&I.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):I.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Yf="tt.sidebarCollapsed";function wj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:OD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:jD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:iM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:VD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:ZD,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:BD,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:eM,label:Fe("nav.settings")}]}]}function xj(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Yf)==="1"}catch{return!1}}function Sj(){const[e,t]=k.useState(xj),n=k.useCallback(()=>{t(a=>{const s=!a;try{typeof window<"u"&&window.localStorage.setItem(Yf,s?"1":"0")}catch{}return s})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===Yf&&t(s.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Pj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Tj({label:e,collapsed:t,first:n}){return t?n?null:I.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):I.jsx("div",{className:Ct("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Cj({item:e,collapsed:t,active:n,onClick:a}){const s=e.icon;return I.jsxs(ku,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Ct("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx(s,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&I.jsx("span",{className:"truncate",children:e.label})]})}function Ej({as:e="button",title:t,onClick:n,href:a,children:s,className:o,...c}){const u=Ct("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",o);return e==="a"?I.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:s}):I.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:s})}function Aj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;_j({prefersReducedMotion:s,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(o=>o.json()).then(o=>{o&&typeof o.stargazers_count=="number"&&a(o.stargazers_count)}).catch(()=>{})},[e]),I.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Ct("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[I.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:I.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"})}),I.jsx("span",{children:"Star"}),n!==null&&I.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Rj=[{value:"light",label:"Light",Icon:Lk},{value:"dark",label:"Dark",Icon:Rk},{value:"system",label:"System",Icon:GD}];function Lj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[s,o]=k.useState(!1),c=k.useRef(null),u=t==="dark"?Rk:Lk;return k.useEffect(()=>{if(!s)return;const h=m=>{c.current&&!c.current.contains(m.target)&&o(!1)},f=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[s]),I.jsxs("div",{ref:c,className:"relative",children:[I.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":s,"aria-haspopup":"menu",title:"Theme",onClick:()=>o(h=>!h),className:Ct("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:I.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s&&I.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Rj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return I.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),o(!1)},className:Ct("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[I.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),I.jsx("span",{children:f})]},h)})})]})}function Bx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:s,glassChrome:o=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=bj(),{resolvedLocale:y}=Zo(),b=k.useMemo(()=>wj(),[y]);return I.jsxs(I.Fragment,{children:[I.jsx("div",{className:Ct("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("div",{className:"flex-1 min-w-0",children:I.jsx(E0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("button",{type:"button",onClick:s,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:I.jsx(Dk,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):I.jsx(E0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:b.map((w,x)=>I.jsxs("div",{className:"flex flex-col",children:[I.jsx(Tj,{label:w.label,collapsed:e,first:x===0}),I.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(T=>I.jsx(Cj,{item:T,collapsed:e,active:Pj(u,T.to),onClick:n},T.id))})]},w.id))}),I.jsxs("div",{className:Ct("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[I.jsx(Lj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:o}),I.jsx("div",{className:"flex items-center gap-1.5",children:!e&&I.jsx(Aj,{glassChrome:o})})]})]})}function Dj({collapsed:e,onToggleCollapsed:t}){const n=k.useMemo(()=>typeof window>"u"?!1:ar()||xk(),[]);return I.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Ct("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:I.jsx(Bx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Mj({open:e,onClose:t}){return k.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),k.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?I.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[I.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),I.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:I.jsx(Bx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Nj({onOpenDrawer:e}){return I.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[I.jsx(Ej,{title:Fe("nav.menu"),onClick:e,children:I.jsx(WD,{className:"h-5 w-5","aria-hidden":!0})}),I.jsxs(ku,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),I.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),I.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Oj({children:e}){const{collapsed:t,toggle:n}=Sj(),[a,s]=k.useState(!1),o=k.useCallback(()=>s(!0),[]),c=k.useCallback(()=>s(!1),[]),u=k.useMemo(()=>typeof window>"u"?!1:ar()||xk(),[]);return I.jsxs("div",{className:Ct("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&I.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),I.jsxs("div",{className:"flex-1 min-h-0 flex",children:[I.jsx(Dj,{collapsed:t,onToggleCollapsed:n}),I.jsx(Mj,{open:a,onClose:c}),I.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:I.jsxs("div",{className:Ct("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[I.jsx(Nj,{onOpenDrawer:o}),I.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const Ij=typeof window<"u"?window.location.search:"",A0=new URLSearchParams(Ij),xc=A0.get("insforge_code")||A0.get("code")||null;function jj(){Zo();const{loading:e,signedIn:t}=qo(),n=bu(),[a,s]=k.useState("processing"),[o,c]=k.useState(null),u=k.useRef(!1);k.useEffect(()=>{!xc||u.current||(u.current=!0,(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})())},[]),k.useEffect(()=>{if(o!==!0||!xc)return;s("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(xc)}`},200);return()=>clearTimeout(f)},[o]),k.useEffect(()=>{if(o!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||s("failed")},5e3);return()=>clearTimeout(f)},[o,e,t,n]),k.useEffect(()=>{if(!xc&&o===null){const f=setTimeout(()=>s("failed"),3e3);return()=>clearTimeout(f)}},[o]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&o!==!0&&(o===null||o===!1&&e)?I.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):I.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:I.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),I.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:I.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:I.jsx("path",{d:"M20 6 9 17l-5-5"})})}),I.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),I.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&I.jsxs("div",{className:"space-y-3",children:[I.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),I.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Uj=k.lazy(()=>$n(()=>import("./DashboardPage-DCixFQNF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.DashboardPage}))),Bj=k.lazy(()=>$n(()=>import("./IpCheckPage-BscvPch9.js"),[])),Fj=k.lazy(()=>$n(()=>import("./LandingPage-Bv5OIhRJ.js"),__vite__mapDeps([9,10,6])).then(e=>({default:e.LandingPage}))),Vj=k.lazy(()=>$n(()=>import("./LeaderboardPage-ea_pS5m7.js"),__vite__mapDeps([11,7,2,12,13])).then(e=>({default:e.LeaderboardPage}))),zj=k.lazy(()=>$n(()=>import("./LeaderboardProfilePage-DMzZmwP4.js"),__vite__mapDeps([14,10,12])).then(e=>({default:e.LeaderboardProfilePage}))),$j=k.lazy(()=>$n(()=>import("./LimitsPage-CWaDaTZ9.js"),__vite__mapDeps([15,1,16,5,8,6])).then(e=>({default:e.LimitsPage}))),Hj=k.lazy(()=>$n(()=>import("./LoginPage-BhmcrPVS.js"),[]).then(e=>({default:e.LoginPage}))),Wj=k.lazy(()=>$n(()=>import("./DevicePage-C-d4jlSG.js"),[])),Kj=k.lazy(()=>$n(()=>import("./WrappedPage-Chw83YEb.js"),[])),Gj=k.lazy(()=>$n(()=>import("./SettingsPage-Dw5iy_IJ.js"),__vite__mapDeps([17,16,18,5,19,2,13,3,20])).then(e=>({default:e.SettingsPage}))),qj=k.lazy(()=>$n(()=>import("./SkillsPage-Dz1X6g_o.js"),__vite__mapDeps([21,5,4,3,7,19,6,13,20])).then(e=>({default:e.SkillsPage}))),Yj=k.lazy(()=>$n(()=>import("./WidgetsPage-D8RbtXHy.js"),__vite__mapDeps([22,18,5,8,6,20,13])).then(e=>({default:e.WidgetsPage})));function Zj(){const{resolvedLocale:e}=Zo(),t=Fn(),n=qo();vj();const a=Pn(),s=k.useMemo(()=>typeof window>"u"?!1:uj(window.location.search),[]),o=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,b=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=o.replace(/\/+$/,"")||"/",T=x.match(/^\/leaderboard\/u\/([^/]+)$/i),P=T?T[1]:null,D=x==="/leaderboard"||!!P,R=!!(n.enabled&&n.signedIn),L=w||R,j=!1,G=cj(),K=k.useMemo(()=>!n.enabled||!R?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[R,n]);let H=w||a||s?"dashboard":"landing";x==="/landing"&&(H="landing"),x==="/dashboard"&&(H="dashboard"),D&&(H="dashboard");const S=x==="/limits",Z=x==="/settings",X=x==="/skills",me=x==="/widgets",oe=x==="/ip-check";(S||Z||X||me||oe)&&(H="dashboard");let Ae=Uj;P?Ae=zj:x==="/leaderboard"?Ae=Vj:S?Ae=$j:Z?Ae=Gj:X?Ae=qj:me?Ae=Yj:oe&&(Ae=Bj);const ue=!b&&(x==="/dashboard"||x==="/"||x==="/leaderboard"||S||Z||X||me||oe);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=I.jsx(jj,{});else if(x==="/login")le=I.jsx(Hj,{});else if(x==="/device")le=I.jsx(Wj,{});else if(x==="/wrapped")le=I.jsx(Kj,{});else if(H==="landing")le=I.jsx(Fj,{signInUrl:"/login",signUpUrl:"/login"});else{const Me=I.jsx(Ae,{baseUrl:G,auth:K,signedIn:L,sessionSoftExpired:j,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:b,publicToken:y,userId:P,signInUrl:"/login",signUpUrl:"/login"},e);ue?le=I.jsx(Oj,{children:Me}):le=Me}return I.jsx(lM,{children:I.jsx(dM,{children:I.jsxs(hM,{children:[I.jsx(k.Suspense,{fallback:null,children:le}),I.jsx(oj,{}),I.jsx(gD,{}),I.jsx(CD,{})]})})})}const Xj=$T([{path:"*",element:I.jsx(Zj,{})}]);LP.createRoot(document.getElementById("root")).render(I.jsx(Xf.StrictMode,{children:I.jsx(YL,{children:I.jsx(nD,{children:I.jsx(TL,{children:I.jsx(nC,{router:Xj})})})})}));export{C4 as $,fk as A,Fe as B,I as C,bj as D,b4 as E,v4 as F,Qh as G,Dc as H,No as I,du as J,oM as K,ku as L,sm as M,R4 as N,c4 as O,l4 as P,aI as Q,Xf as R,Ok as S,qo as T,m4 as U,x4 as V,Zo as W,Dk as X,uj as Y,Ea as Z,$n as _,Gt as a,_4 as a0,GR as a1,u4 as a2,d4 as a3,E4 as a4,y4 as a5,p4 as a6,Ct as a7,E0 as a8,tC as a9,tD as aA,Cp as aB,Rp as aC,TP as aD,Zf as aE,U4 as aF,ar as aG,xk as aH,I4 as aI,B4 as aJ,j4 as aK,Po as aL,Uw as aM,VN as aN,Vf as aO,Fn as aa,bu as ab,V4 as ac,OR as ad,i4 as ae,z4 as af,s4 as ag,P4 as ah,T4 as ai,_j as aj,eM as ak,N4 as al,Qj as am,DR as an,Np as ao,NR as ap,qv as aq,S4 as ar,Lk as as,Rk as at,GD as au,ps as av,nu as aw,Lp as ax,g4 as ay,QD as az,Ik as b,dn as c,Na as d,yb as e,dt as f,pk as g,Pn as h,l2 as i,o4 as j,VR as k,O4 as l,gs as m,nL as n,rL as o,L4 as p,f4 as q,k as r,w4 as s,D4 as t,Op as u,M4 as v,h4 as w,yt as x,k4 as y,A4 as z};