tokentracker-cli 0.26.7 → 0.27.0

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 (41) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-DCtix3Fg.js → ActivityHeatmap-ByU2hUad.js} +1 -1
  2. package/dashboard/dist/assets/{Card-rmGtcsWP.js → Card-Ca3xp-bE.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-CE6rXaDb.js → DashboardPage-Bcw_9-IO.js} +1 -1
  4. package/dashboard/dist/assets/{DevicePage-C20ToZWK.js → DevicePage-Ck-viWfZ.js} +1 -1
  5. package/dashboard/dist/assets/{DialogTitle-DGydnL9k.js → DialogTitle-BL4bLqSk.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-C37UQkCL.js → FadeIn-CzwCZV5v.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-91HwEGxF.js → HeaderGithubStar-DMVEHsGB.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-w_9rNG-h.js → IpCheckPage-Kue6GQzA.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-DgoBKDAF.js → LandingPage-DMM_pvjg.js} +1 -1
  10. package/dashboard/dist/assets/{LeaderboardAvatar-Dt6vB6xL.js → LeaderboardAvatar-eipAcwXo.js} +1 -1
  11. package/dashboard/dist/assets/{LeaderboardPage-7NZW_w9s.js → LeaderboardPage-Dr-vs4Wk.js} +3 -3
  12. package/dashboard/dist/assets/LeaderboardProfileModal-CuALURRh.js +72 -0
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-CPRBCIpv.js → LeaderboardProfilePage-ZXEbQGx5.js} +1 -1
  14. package/dashboard/dist/assets/{LimitsPage-Owevo_3t.js → LimitsPage-C7BNYXFU.js} +1 -1
  15. package/dashboard/dist/assets/{LocalOnlyNotice-BucYk8jA.js → LocalOnlyNotice-BQZX-oGe.js} +1 -1
  16. package/dashboard/dist/assets/{LoginPage-WfWomtGZ.js → LoginPage-DCeTFjDp.js} +1 -1
  17. package/dashboard/dist/assets/{PopoverPopup-BY_zkZxd.js → PopoverPopup-CkuS9QnS.js} +1 -1
  18. package/dashboard/dist/assets/{ProviderIcon-DL1MI9yC.js → ProviderIcon-L6z81yHi.js} +1 -1
  19. package/dashboard/dist/assets/{SettingsPage-C2uIIIOc.js → SettingsPage-Dwz2e9_F.js} +1 -1
  20. package/dashboard/dist/assets/{SkillsPage-JcjtKJsW.js → SkillsPage-DRENeHeR.js} +1 -1
  21. package/dashboard/dist/assets/{WidgetsPage-De3IzSrW.js → WidgetsPage-CzGqO3Nj.js} +1 -1
  22. package/dashboard/dist/assets/{WrappedPage-N2OH7zP0.js → WrappedPage-BklzxKVW.js} +1 -1
  23. package/dashboard/dist/assets/{arrow-up-right-BpkaVOUi.js → arrow-up-right-DVWbxoR_.js} +1 -1
  24. package/dashboard/dist/assets/check-CQ-rAjt3.js +1 -0
  25. package/dashboard/dist/assets/{chevron-down-CliOiFa9.js → chevron-down-DtOT9b1q.js} +1 -1
  26. package/dashboard/dist/assets/{download-CNrfR68J.js → download-CMXwYo7E.js} +1 -1
  27. package/dashboard/dist/assets/{info-Ca5iFYxD.js → info-CxuBFHAT.js} +1 -1
  28. package/dashboard/dist/assets/main-DUAOJz8d.css +1 -0
  29. package/dashboard/dist/assets/{main-DI2Gl9e0.js → main-ucQlYWcW.js} +17 -15
  30. package/dashboard/dist/assets/{use-limits-display-prefs-BZeGceRd.js → use-limits-display-prefs-B6zAQQ9V.js} +1 -1
  31. package/dashboard/dist/assets/{use-native-settings-DII_ai46.js → use-native-settings-C0ZhPtTY.js} +1 -1
  32. package/dashboard/dist/assets/{use-reduced-motion-DpLyEiXC.js → use-reduced-motion-Y1TUDKSE.js} +1 -1
  33. package/dashboard/dist/assets/{use-usage-limits-C6DfageK.js → use-usage-limits-D1NiUjpg.js} +1 -1
  34. package/dashboard/dist/assets/{useCurrency-LcLMm64X.js → useCurrency-BCgpAcqK.js} +1 -1
  35. package/dashboard/dist/index.html +2 -2
  36. package/dashboard/dist/share.html +2 -2
  37. package/package.json +1 -1
  38. package/src/lib/pricing/seed-snapshot.json +1 -1
  39. package/dashboard/dist/assets/LeaderboardProfileModal-Ch0SIvQ9.js +0 -32
  40. package/dashboard/dist/assets/check-D-bd9C0B.js +0 -1
  41. package/dashboard/dist/assets/main-CmW2A4J4.css +0 -1
@@ -1,15 +1,15 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CE6rXaDb.js","assets/use-usage-limits-C6DfageK.js","assets/useCurrency-LcLMm64X.js","assets/ActivityHeatmap-DCtix3Fg.js","assets/info-Ca5iFYxD.js","assets/DialogTitle-DGydnL9k.js","assets/PopoverPopup-BY_zkZxd.js","assets/Card-rmGtcsWP.js","assets/use-reduced-motion-DpLyEiXC.js","assets/ProviderIcon-DL1MI9yC.js","assets/FadeIn-C37UQkCL.js","assets/LandingPage-DgoBKDAF.js","assets/HeaderGithubStar-91HwEGxF.js","assets/LeaderboardPage-7NZW_w9s.js","assets/LeaderboardAvatar-Dt6vB6xL.js","assets/chevron-down-CliOiFa9.js","assets/LeaderboardProfilePage-CPRBCIpv.js","assets/LeaderboardProfileModal-Ch0SIvQ9.js","assets/arrow-up-right-BpkaVOUi.js","assets/LimitsPage-Owevo_3t.js","assets/use-limits-display-prefs-BZeGceRd.js","assets/LocalOnlyNotice-BucYk8jA.js","assets/download-CNrfR68J.js","assets/SettingsPage-C2uIIIOc.js","assets/use-native-settings-DII_ai46.js","assets/check-D-bd9C0B.js","assets/SkillsPage-JcjtKJsW.js","assets/WidgetsPage-De3IzSrW.js"])))=>i.map(i=>d[i]);
2
- function xS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function PS(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var gh={exports:{}},cs={},yh={exports:{}},Ze={};var jy;function SS(){if(jy)return Ze;jy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function S(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}S.prototype.isReactComponent={},S.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=S.prototype;function L(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}var R=L.prototype=new D;R.constructor=L,x(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray,G=Object.prototype.hasOwnProperty,W={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function P(I,q,xe){var Re,Pe={},Te=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Te=""+q.key),q)G.call(q,Re)&&!z.hasOwnProperty(Re)&&(Pe[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Pe.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Pe.children=Ue}if(I&&I.defaultProps)for(Re in Qe=I.defaultProps,Qe)Pe[Re]===void 0&&(Pe[Re]=Qe[Re]);return{$$typeof:e,type:I,key:Te,ref:Ge,props:Pe,_owner:W.current}}function Y(I,q){return{$$typeof:e,type:I.type,key:q,ref:I.ref,props:I.props,_owner:I._owner}}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ue(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(xe){return q[xe]})}var se=/\/+/g;function Ae(I,q){return typeof I=="object"&&I!==null&&I.key!=null?ue(""+I.key):q.toString(36)}function fe(I,q,xe,Re,Pe){var Te=typeof I;(Te==="undefined"||Te==="boolean")&&(I=null);var Ge=!1;if(I===null)Ge=!0;else switch(Te){case"string":case"number":Ge=!0;break;case"object":switch(I.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=I,Pe=Pe(Ge),I=Re===""?"."+Ae(Ge,0):Re,O(Pe)?(xe="",I!=null&&(xe=I.replace(se,"$&/")+"/"),fe(Pe,q,xe,"",function(jt){return jt})):Pe!=null&&(X(Pe)&&(Pe=Y(Pe,xe+(!Pe.key||Ge&&Ge.key===Pe.key?"":(""+Pe.key).replace(se,"$&/")+"/")+I)),q.push(Pe)),1;if(Ge=0,Re=Re===""?".":Re+":",O(I))for(var Qe=0;Qe<I.length;Qe++){Te=I[Qe];var Ue=Re+Ae(Te,Qe);Ge+=fe(Te,q,xe,Ue,Pe)}else if(Ue=k(I),typeof Ue=="function")for(I=Ue.call(I),Qe=0;!(Te=I.next()).done;)Te=Te.value,Ue=Re+Ae(Te,Qe++),Ge+=fe(Te,q,xe,Ue,Pe);else if(Te==="object")throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function le(I,q,xe){if(I==null)return I;var Re=[],Pe=0;return fe(I,Re,"","",function(Te){return q.call(xe,Te,Pe++)}),Re}function pe(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(xe){(I._status===0||I._status===-1)&&(I._status=1,I._result=xe)},function(xe){(I._status===0||I._status===-1)&&(I._status=2,I._result=xe)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Ne={current:null},K={transition:null},Z={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:W};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:le,forEach:function(I,q,xe){le(I,function(){q.apply(this,arguments)},xe)},count:function(I){var q=0;return le(I,function(){q++}),q},toArray:function(I){return le(I,function(q){return q})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=S,Ze.Fragment=n,Ze.Profiler=o,Ze.PureComponent=L,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ze.act=H,Ze.cloneElement=function(I,q,xe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var Re=x({},I.props),Pe=I.key,Te=I.ref,Ge=I._owner;if(q!=null){if(q.ref!==void 0&&(Te=q.ref,Ge=W.current),q.key!==void 0&&(Pe=""+q.key),I.type&&I.type.defaultProps)var Qe=I.type.defaultProps;for(Ue in q)G.call(q,Ue)&&!z.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:I.type,key:Pe,ref:Te,props:Re,_owner:Ge}},Ze.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},Ze.createElement=P,Ze.createFactory=function(I){var q=P.bind(null,I);return q.type=I,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:u,render:I}},Ze.isValidElement=X,Ze.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:pe}},Ze.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},Ze.startTransition=function(I){var q=K.transition;K.transition={};try{I()}finally{K.transition=q}},Ze.unstable_act=H,Ze.useCallback=function(I,q){return Ne.current.useCallback(I,q)},Ze.useContext=function(I){return Ne.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return Ne.current.useDeferredValue(I)},Ze.useEffect=function(I,q){return Ne.current.useEffect(I,q)},Ze.useId=function(){return Ne.current.useId()},Ze.useImperativeHandle=function(I,q,xe){return Ne.current.useImperativeHandle(I,q,xe)},Ze.useInsertionEffect=function(I,q){return Ne.current.useInsertionEffect(I,q)},Ze.useLayoutEffect=function(I,q){return Ne.current.useLayoutEffect(I,q)},Ze.useMemo=function(I,q){return Ne.current.useMemo(I,q)},Ze.useReducer=function(I,q,xe){return Ne.current.useReducer(I,q,xe)},Ze.useRef=function(I){return Ne.current.useRef(I)},Ze.useState=function(I){return Ne.current.useState(I)},Ze.useSyncExternalStore=function(I,q,xe){return Ne.current.useSyncExternalStore(I,q,xe)},Ze.useTransition=function(){return Ne.current.useTransition()},Ze.version="18.3.1",Ze}var Uy;function Qf(){return Uy||(Uy=1,yh.exports=SS()),yh.exports}var By;function CS(){if(By)return cs;By=1;var e=Qf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},k=null,w=null;f!==void 0&&(k=""+f),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!s.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:k,ref:w,props:y,_owner:o.current}}return cs.Fragment=n,cs.jsx=c,cs.jsxs=c,cs}var Fy;function TS(){return Fy||(Fy=1,gh.exports=CS()),gh.exports}var N=TS(),b=Qf();const Rs=L_(b),ES=xS({__proto__:null,default:Rs},[b]);var uc={},vh={exports:{}},yn={},kh={exports:{}},_h={};var Vy;function AS(){return Vy||(Vy=1,(function(e){function t(K,Z){var H=K.length;K.push(Z);e:for(;0<H;){var I=H-1>>>1,q=K[I];if(0<o(q,Z))K[I]=Z,K[H]=q,H=I;else break e}}function n(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var Z=K[0],H=K.pop();if(H!==Z){K[0]=H;e:for(var I=0,q=K.length,xe=q>>>1;I<xe;){var Re=2*(I+1)-1,Pe=K[Re],Te=Re+1,Ge=K[Te];if(0>o(Pe,H))Te<q&&0>o(Ge,Pe)?(K[I]=Ge,K[Te]=H,I=Te):(K[I]=Pe,K[Re]=H,I=Re);else if(Te<q&&0>o(Ge,H))K[I]=Ge,K[Te]=H,I=Te;else break e}}return Z}function o(K,Z){var H=K.sortIndex-Z.sortIndex;return H!==0?H:K.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,k=3,w=!1,x=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(K){for(var Z=n(f);Z!==null;){if(Z.callback===null)a(f);else if(Z.startTime<=K)a(f),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(f)}}function O(K){if(C=!1,R(K),!x)if(n(h)!==null)x=!0,pe(G);else{var Z=n(f);Z!==null&&Ne(O,Z.startTime-K)}}function G(K,Z){x=!1,C&&(C=!1,D(P),P=-1),w=!0;var H=k;try{for(R(Z),y=n(h);y!==null&&(!(y.expirationTime>Z)||K&&!ue());){var I=y.callback;if(typeof I=="function"){y.callback=null,k=y.priorityLevel;var q=I(y.expirationTime<=Z);Z=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),R(Z)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Ne(O,Re.startTime-Z),xe=!1}return xe}finally{y=null,k=H,w=!1}}var W=!1,z=null,P=-1,Y=5,X=-1;function ue(){return!(e.unstable_now()-X<Y)}function se(){if(z!==null){var K=e.unstable_now();X=K;var Z=!0;try{Z=z(!0,K)}finally{Z?Ae():(W=!1,z=null)}}else W=!1}var Ae;if(typeof L=="function")Ae=function(){L(se)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,le=fe.port2;fe.port1.onmessage=se,Ae=function(){le.postMessage(null)}}else Ae=function(){S(se,0)};function pe(K){z=K,W||(W=!0,Ae())}function Ne(K,Z){P=S(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,pe(G))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(K){switch(k){case 1:case 2:case 3:var Z=3;break;default:Z=k}var H=k;k=Z;try{return K()}finally{k=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var H=k;k=K;try{return Z()}finally{k=H}},e.unstable_scheduleCallback=function(K,Z,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,K){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,K={id:m++,callback:Z,priorityLevel:K,startTime:H,expirationTime:q,sortIndex:-1},H>I?(K.sortIndex=H,t(f,K),n(h)===null&&K===n(f)&&(C?(D(P),P=-1):C=!0,Ne(O,H-I))):(K.sortIndex=q,t(h,K),x||w||(x=!0,pe(G))),K},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(K){var Z=k;return function(){var H=k;k=Z;try{return K.apply(this,arguments)}finally{k=H}}}})(_h)),_h}var zy;function RS(){return zy||(zy=1,kh.exports=AS()),kh.exports}var $y;function LS(){if($y)return yn;$y=1;var e=Qf(),t=RS();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function s(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(o[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function k(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function C(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];S[i]=new C(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function R(r,i,l,d){var p=S.hasOwnProperty(i)?S[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,l,p,d)&&(l=null),d||p===null?k(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),W=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),ue=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Object.assign,I;function q(r){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-Bcw_9-IO.js","assets/use-usage-limits-D1NiUjpg.js","assets/useCurrency-BCgpAcqK.js","assets/ActivityHeatmap-ByU2hUad.js","assets/info-CxuBFHAT.js","assets/DialogTitle-BL4bLqSk.js","assets/PopoverPopup-CkuS9QnS.js","assets/Card-Ca3xp-bE.js","assets/use-reduced-motion-Y1TUDKSE.js","assets/ProviderIcon-L6z81yHi.js","assets/FadeIn-CzwCZV5v.js","assets/LandingPage-DMM_pvjg.js","assets/HeaderGithubStar-DMVEHsGB.js","assets/LeaderboardPage-Dr-vs4Wk.js","assets/LeaderboardAvatar-eipAcwXo.js","assets/chevron-down-DtOT9b1q.js","assets/LeaderboardProfilePage-ZXEbQGx5.js","assets/LeaderboardProfileModal-CuALURRh.js","assets/arrow-up-right-DVWbxoR_.js","assets/LimitsPage-C7BNYXFU.js","assets/use-limits-display-prefs-B6zAQQ9V.js","assets/LocalOnlyNotice-BQZX-oGe.js","assets/download-CMXwYo7E.js","assets/SettingsPage-Dwz2e9_F.js","assets/use-native-settings-C0ZhPtTY.js","assets/check-CQ-rAjt3.js","assets/SkillsPage-DRENeHeR.js","assets/WidgetsPage-CzGqO3Nj.js"])))=>i.map(i=>d[i]);
2
+ function PS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SS(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var gh={exports:{}},us={},yh={exports:{}},Ze={};var jy;function CS(){if(jy)return Ze;jy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function S(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}S.prototype.isReactComponent={},S.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=S.prototype;function L(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}var R=L.prototype=new D;R.constructor=L,x(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray,G=Object.prototype.hasOwnProperty,W={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function P(I,q,xe){var Re,Pe={},Te=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Te=""+q.key),q)G.call(q,Re)&&!z.hasOwnProperty(Re)&&(Pe[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Pe.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Pe.children=Ue}if(I&&I.defaultProps)for(Re in Qe=I.defaultProps,Qe)Pe[Re]===void 0&&(Pe[Re]=Qe[Re]);return{$$typeof:e,type:I,key:Te,ref:Ge,props:Pe,_owner:W.current}}function Y(I,q){return{$$typeof:e,type:I.type,key:q,ref:I.ref,props:I.props,_owner:I._owner}}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ue(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(xe){return q[xe]})}var se=/\/+/g;function Ae(I,q){return typeof I=="object"&&I!==null&&I.key!=null?ue(""+I.key):q.toString(36)}function fe(I,q,xe,Re,Pe){var Te=typeof I;(Te==="undefined"||Te==="boolean")&&(I=null);var Ge=!1;if(I===null)Ge=!0;else switch(Te){case"string":case"number":Ge=!0;break;case"object":switch(I.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=I,Pe=Pe(Ge),I=Re===""?"."+Ae(Ge,0):Re,O(Pe)?(xe="",I!=null&&(xe=I.replace(se,"$&/")+"/"),fe(Pe,q,xe,"",function(jt){return jt})):Pe!=null&&(X(Pe)&&(Pe=Y(Pe,xe+(!Pe.key||Ge&&Ge.key===Pe.key?"":(""+Pe.key).replace(se,"$&/")+"/")+I)),q.push(Pe)),1;if(Ge=0,Re=Re===""?".":Re+":",O(I))for(var Qe=0;Qe<I.length;Qe++){Te=I[Qe];var Ue=Re+Ae(Te,Qe);Ge+=fe(Te,q,xe,Ue,Pe)}else if(Ue=k(I),typeof Ue=="function")for(I=Ue.call(I),Qe=0;!(Te=I.next()).done;)Te=Te.value,Ue=Re+Ae(Te,Qe++),Ge+=fe(Te,q,xe,Ue,Pe);else if(Te==="object")throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function le(I,q,xe){if(I==null)return I;var Re=[],Pe=0;return fe(I,Re,"","",function(Te){return q.call(xe,Te,Pe++)}),Re}function pe(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(xe){(I._status===0||I._status===-1)&&(I._status=1,I._result=xe)},function(xe){(I._status===0||I._status===-1)&&(I._status=2,I._result=xe)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Ne={current:null},K={transition:null},Z={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:W};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:le,forEach:function(I,q,xe){le(I,function(){q.apply(this,arguments)},xe)},count:function(I){var q=0;return le(I,function(){q++}),q},toArray:function(I){return le(I,function(q){return q})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=S,Ze.Fragment=n,Ze.Profiler=o,Ze.PureComponent=L,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ze.act=H,Ze.cloneElement=function(I,q,xe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var Re=x({},I.props),Pe=I.key,Te=I.ref,Ge=I._owner;if(q!=null){if(q.ref!==void 0&&(Te=q.ref,Ge=W.current),q.key!==void 0&&(Pe=""+q.key),I.type&&I.type.defaultProps)var Qe=I.type.defaultProps;for(Ue in q)G.call(q,Ue)&&!z.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:I.type,key:Pe,ref:Te,props:Re,_owner:Ge}},Ze.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},Ze.createElement=P,Ze.createFactory=function(I){var q=P.bind(null,I);return q.type=I,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:u,render:I}},Ze.isValidElement=X,Ze.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:pe}},Ze.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},Ze.startTransition=function(I){var q=K.transition;K.transition={};try{I()}finally{K.transition=q}},Ze.unstable_act=H,Ze.useCallback=function(I,q){return Ne.current.useCallback(I,q)},Ze.useContext=function(I){return Ne.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return Ne.current.useDeferredValue(I)},Ze.useEffect=function(I,q){return Ne.current.useEffect(I,q)},Ze.useId=function(){return Ne.current.useId()},Ze.useImperativeHandle=function(I,q,xe){return Ne.current.useImperativeHandle(I,q,xe)},Ze.useInsertionEffect=function(I,q){return Ne.current.useInsertionEffect(I,q)},Ze.useLayoutEffect=function(I,q){return Ne.current.useLayoutEffect(I,q)},Ze.useMemo=function(I,q){return Ne.current.useMemo(I,q)},Ze.useReducer=function(I,q,xe){return Ne.current.useReducer(I,q,xe)},Ze.useRef=function(I){return Ne.current.useRef(I)},Ze.useState=function(I){return Ne.current.useState(I)},Ze.useSyncExternalStore=function(I,q,xe){return Ne.current.useSyncExternalStore(I,q,xe)},Ze.useTransition=function(){return Ne.current.useTransition()},Ze.version="18.3.1",Ze}var Uy;function Qf(){return Uy||(Uy=1,yh.exports=CS()),yh.exports}var By;function TS(){if(By)return us;By=1;var e=Qf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},k=null,w=null;f!==void 0&&(k=""+f),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!s.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:k,ref:w,props:y,_owner:o.current}}return us.Fragment=n,us.jsx=c,us.jsxs=c,us}var Fy;function ES(){return Fy||(Fy=1,gh.exports=TS()),gh.exports}var N=ES(),b=Qf();const Ls=L_(b),AS=PS({__proto__:null,default:Ls},[b]);var uc={},vh={exports:{}},vn={},kh={exports:{}},_h={};var Vy;function RS(){return Vy||(Vy=1,(function(e){function t(K,Z){var H=K.length;K.push(Z);e:for(;0<H;){var I=H-1>>>1,q=K[I];if(0<o(q,Z))K[I]=Z,K[H]=q,H=I;else break e}}function n(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var Z=K[0],H=K.pop();if(H!==Z){K[0]=H;e:for(var I=0,q=K.length,xe=q>>>1;I<xe;){var Re=2*(I+1)-1,Pe=K[Re],Te=Re+1,Ge=K[Te];if(0>o(Pe,H))Te<q&&0>o(Ge,Pe)?(K[I]=Ge,K[Te]=H,I=Te):(K[I]=Pe,K[Re]=H,I=Re);else if(Te<q&&0>o(Ge,H))K[I]=Ge,K[Te]=H,I=Te;else break e}}return Z}function o(K,Z){var H=K.sortIndex-Z.sortIndex;return H!==0?H:K.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,k=3,w=!1,x=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(K){for(var Z=n(f);Z!==null;){if(Z.callback===null)a(f);else if(Z.startTime<=K)a(f),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(f)}}function O(K){if(C=!1,R(K),!x)if(n(h)!==null)x=!0,pe(G);else{var Z=n(f);Z!==null&&Ne(O,Z.startTime-K)}}function G(K,Z){x=!1,C&&(C=!1,D(P),P=-1),w=!0;var H=k;try{for(R(Z),y=n(h);y!==null&&(!(y.expirationTime>Z)||K&&!ue());){var I=y.callback;if(typeof I=="function"){y.callback=null,k=y.priorityLevel;var q=I(y.expirationTime<=Z);Z=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),R(Z)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Ne(O,Re.startTime-Z),xe=!1}return xe}finally{y=null,k=H,w=!1}}var W=!1,z=null,P=-1,Y=5,X=-1;function ue(){return!(e.unstable_now()-X<Y)}function se(){if(z!==null){var K=e.unstable_now();X=K;var Z=!0;try{Z=z(!0,K)}finally{Z?Ae():(W=!1,z=null)}}else W=!1}var Ae;if(typeof L=="function")Ae=function(){L(se)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,le=fe.port2;fe.port1.onmessage=se,Ae=function(){le.postMessage(null)}}else Ae=function(){S(se,0)};function pe(K){z=K,W||(W=!0,Ae())}function Ne(K,Z){P=S(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,pe(G))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(K){switch(k){case 1:case 2:case 3:var Z=3;break;default:Z=k}var H=k;k=Z;try{return K()}finally{k=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var H=k;k=K;try{return Z()}finally{k=H}},e.unstable_scheduleCallback=function(K,Z,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,K){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,K={id:m++,callback:Z,priorityLevel:K,startTime:H,expirationTime:q,sortIndex:-1},H>I?(K.sortIndex=H,t(f,K),n(h)===null&&K===n(f)&&(C?(D(P),P=-1):C=!0,Ne(O,H-I))):(K.sortIndex=q,t(h,K),x||w||(x=!0,pe(G))),K},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(K){var Z=k;return function(){var H=k;k=Z;try{return K.apply(this,arguments)}finally{k=H}}}})(_h)),_h}var zy;function LS(){return zy||(zy=1,kh.exports=RS()),kh.exports}var $y;function DS(){if($y)return vn;$y=1;var e=Qf(),t=LS();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function s(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(o[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function k(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function C(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];S[i]=new C(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function R(r,i,l,d){var p=S.hasOwnProperty(i)?S[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,l,p,d)&&(l=null),d||p===null?k(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),W=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),ue=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Object.assign,I;function q(r){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
3
3
  `+I+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch($){var d=$}Reflect.construct(r,[],i)}else{try{i.call()}catch($){d=$}r.call(i.prototype)}else{try{throw Error()}catch($){d=$}r()}}catch($){if($&&d&&typeof $.stack=="string"){for(var p=$.stack.split(`
4
4
  `),g=d.stack.split(`
5
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 Pe(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 Te(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 z:return"Fragment";case W:return"Portal";case Y:return"Profiler";case P:return"StrictMode";case Ae:return"Suspense";case fe:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ue:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case se:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case le:return i=r.displayName||null,i!==null?i:Te(r.type)||"Memo";case pe:i=r._payload,r=r._init;try{return Te(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 Te(i);case 8:return i===P?"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 Cr(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 H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function xo(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 rl(r,i){i=i.checked,i!=null&&R(r,"checked",i,!1)}function Wn(r,i){rl(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")?Po(r,i.type,l):i.hasOwnProperty("defaultValue")&&Po(r,i.type,Qe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function al(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 Po(r,i,l){(i!=="number"||pt(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var qr=Array.isArray;function Yr(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 So(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function il(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(qr(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 ol(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 Zr(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"?Zr(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Xr,Cn=(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(Xr=Xr||document.createElement("div"),Xr.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Xr.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 Qr={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},Ou=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach(function(r){Ou.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Qr[i]=Qr[r]})});function vi(r,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Qr.hasOwnProperty(r)&&Qr[r]?(""+i).trim():i+"px"}function sl(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=H({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 ki(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 bi=null;function Co(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wi=null,Gn=null,Tr=null;function xi(r){if(r=qo(r)){if(typeof wi!="function")throw Error(n(280));var i=r.stateNode;i&&(i=Sl(i),wi(r.stateNode,r.type,i))}}function ll(r){Gn?Tr?Tr.push(r):Tr=[r]:Gn=r}function To(){if(Gn){var r=Gn,i=Tr;if(Tr=Gn=null,xi(r),i)for(r=0;r<i.length;r++)xi(i[r])}}function cl(r,i){return r(i)}function Eo(){}var Jr=!1;function Ba(r,i,l){if(Jr)return r(i,l);Jr=!0;try{return cl(r,i,l)}finally{Jr=!1,(Gn!==null||Tr!==null)&&(Eo(),To())}}function ea(r,i){var l=r.stateNode;if(l===null)return null;var d=Sl(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 Ao=!1;if(u)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{Ao=!1}function A(r,i,l,d,p,g,_,E,M){var $=Array.prototype.slice.call(arguments,3);try{i.apply(l,$)}catch(ee){this.onError(ee)}}var U=!1,V=null,te=!1,ae=null,Ee={onError:function(r){U=!0,V=r}};function me(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(me.apply(this,arguments),U){if(U){var $=V;U=!1,V=null}else throw Error(n(198));te||(te=!0,ae=$)}}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 Me(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 Ie(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 Ie(p),r;if(g===d)return Ie(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 ot(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,St=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,Ro=t.unstable_LowPriority,ta=t.unstable_IdlePriority,Tn=null,rn=null;function Pi(r){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Rr,Ut=Math.log,na=Math.LN2;function Rr(r){return r>>>=0,r===0?32:31-(Ut(r)/na|0)|0}var ut=64,Lr=4194304;function ra(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 Si(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=ra(E):(g&=_,g!==0&&(d=ra(g)))}else _=l&~p,_!==0?d=ra(_):g!==0&&(d=ra(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 zx(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 $x(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[_]=zx(E,i)):M<=i&&(r.expiredLanes|=E),g&=~E}}function ju(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function pm(){var r=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),r}function Uu(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Lo(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 Hx(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 Bu(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 mm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var gm,Fu,ym,vm,km,Vu=!1,ul=[],aa=null,ia=null,oa=null,Do=new Map,Mo=new Map,sa=[],Wx="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 _m(r,i){switch(r){case"focusin":case"focusout":aa=null;break;case"dragenter":case"dragleave":ia=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":Do.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(i.pointerId)}}function Io(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=qo(i),i!==null&&Fu(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Kx(r,i,l,d,p){switch(i){case"focusin":return aa=Io(aa,r,i,l,d,p),!0;case"dragenter":return ia=Io(ia,r,i,l,d,p),!0;case"mouseover":return oa=Io(oa,r,i,l,d,p),!0;case"pointerover":var g=p.pointerId;return Do.set(g,Io(Do.get(g)||null,r,i,l,d,p)),!0;case"gotpointercapture":return g=p.pointerId,Mo.set(g,Io(Mo.get(g)||null,r,i,l,d,p)),!0}return!1}function bm(r){var i=Va(r.target);if(i!==null){var l=he(i);if(l!==null){if(i=l.tag,i===13){if(i=Me(l),i!==null){r.blockedOn=i,km(r.priority,function(){ym(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 dl(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=$u(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);bi=d,l.target.dispatchEvent(d),bi=null}else return i=qo(l),i!==null&&Fu(i),r.blockedOn=l,!1;i.shift()}return!0}function wm(r,i,l){dl(r)&&l.delete(i)}function Gx(){Vu=!1,aa!==null&&dl(aa)&&(aa=null),ia!==null&&dl(ia)&&(ia=null),oa!==null&&dl(oa)&&(oa=null),Do.forEach(wm),Mo.forEach(wm)}function No(r,i){r.blockedOn===i&&(r.blockedOn=null,Vu||(Vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gx)))}function Oo(r){function i(p){return No(p,r)}if(0<ul.length){No(ul[0],r);for(var l=1;l<ul.length;l++){var d=ul[l];d.blockedOn===r&&(d.blockedOn=null)}}for(aa!==null&&No(aa,r),ia!==null&&No(ia,r),oa!==null&&No(oa,r),Do.forEach(i),Mo.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 Ci=O.ReactCurrentBatchConfig,hl=!0;function qx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=1,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function Yx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=4,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function zu(r,i,l,d){if(hl){var p=$u(r,i,l,d);if(p===null)od(r,i,d,fl,l),_m(r,d);else if(Kx(p,r,i,l,d))d.stopPropagation();else if(_m(r,d),i&4&&-1<Wx.indexOf(r)){for(;p!==null;){var g=qo(p);if(g!==null&&gm(g),g=$u(r,i,l,d),g===null&&od(r,i,d,fl,l),g===p)break;p=g}p!==null&&d.stopPropagation()}else od(r,i,d,null,l)}}var fl=null;function $u(r,i,l,d){if(fl=null,r=Co(d),r=Va(r),r!==null)if(i=he(r),i===null)r=null;else if(l=i.tag,l===13){if(r=Me(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 fl=r,null}function xm(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 Ro:return 16;case ta:return 536870912;default:return 16}default:return 16}}var la=null,Hu=null,pl=null;function Pm(){if(pl)return pl;var r,i=Hu,l=i.length,d,p="value"in la?la.value:la.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 pl=p.slice(r,1<d?1-d:void 0)}function ml(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 gl(){return!0}function Sm(){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)?gl:Sm,this.isPropagationStopped=Sm,this}return H(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=gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),i}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=vn(Ti),jo=H({},Ti,{view:0,detail:0}),Zx=vn(jo),Ku,Gu,Uo,yl=H({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yu,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!==Uo&&(Uo&&r.type==="mousemove"?(Ku=r.screenX-Uo.screenX,Gu=r.screenY-Uo.screenY):Gu=Ku=0,Uo=r),Ku)},movementY:function(r){return"movementY"in r?r.movementY:Gu}}),Cm=vn(yl),Xx=H({},yl,{dataTransfer:0}),Qx=vn(Xx),Jx=H({},jo,{relatedTarget:0}),qu=vn(Jx),eP=H({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),tP=vn(eP),nP=H({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),rP=vn(nP),aP=H({},Ti,{data:0}),Tm=vn(aP),iP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oP={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"},sP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lP(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=sP[r])?!!i[r]:!1}function Yu(){return lP}var cP=H({},jo,{key:function(r){if(r.key){var i=iP[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ml(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?oP[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yu,charCode:function(r){return r.type==="keypress"?ml(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ml(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),uP=vn(cP),dP=H({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=vn(dP),hP=H({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yu}),fP=vn(hP),pP=H({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),mP=vn(pP),gP=H({},yl,{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}),yP=vn(gP),vP=[9,13,27,32],Zu=u&&"CompositionEvent"in window,Bo=null;u&&"documentMode"in document&&(Bo=document.documentMode);var kP=u&&"TextEvent"in window&&!Bo,Am=u&&(!Zu||Bo&&8<Bo&&11>=Bo),Rm=" ",Lm=!1;function Dm(r,i){switch(r){case"keyup":return vP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ei=!1;function _P(r,i){switch(r){case"compositionend":return Mm(i);case"keypress":return i.which!==32?null:(Lm=!0,Rm);case"textInput":return r=i.data,r===Rm&&Lm?null:r;default:return null}}function bP(r,i){if(Ei)return r==="compositionend"||!Zu&&Dm(r,i)?(r=Pm(),pl=Hu=la=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 Am&&i.locale!=="ko"?null:i.data;default:return null}}var wP={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 Im(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!wP[r.type]:i==="textarea"}function Nm(r,i,l,d){ll(d),i=wl(i,"onChange"),0<i.length&&(l=new Wu("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var Fo=null,Vo=null;function xP(r){Jm(r,0)}function vl(r){var i=Mi(r);if(Cr(i))return r}function PP(r,i){if(r==="change")return i}var Om=!1;if(u){var Xu;if(u){var Qu="oninput"in document;if(!Qu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Qu=typeof jm.oninput=="function"}Xu=Qu}else Xu=!1;Om=Xu&&(!document.documentMode||9<document.documentMode)}function Um(){Fo&&(Fo.detachEvent("onpropertychange",Bm),Vo=Fo=null)}function Bm(r){if(r.propertyName==="value"&&vl(Vo)){var i=[];Nm(i,Vo,r,Co(r)),Ba(xP,i)}}function SP(r,i,l){r==="focusin"?(Um(),Fo=i,Vo=l,Fo.attachEvent("onpropertychange",Bm)):r==="focusout"&&Um()}function CP(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vl(Vo)}function TP(r,i){if(r==="click")return vl(i)}function EP(r,i){if(r==="input"||r==="change")return vl(i)}function AP(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:AP;function zo(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 Fm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Vm(r,i){var l=Fm(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=Fm(l)}}function zm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?zm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $m(){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 Ju(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 RP(r){var i=$m(),l=r.focusedElem,d=r.selectionRange;if(i!==l&&l&&l.ownerDocument&&zm(l.ownerDocument.documentElement,l)){if(d!==null&&Ju(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=Vm(l,g);var _=Vm(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 LP=u&&"documentMode"in document&&11>=document.documentMode,Ai=null,ed=null,$o=null,td=!1;function Hm(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;td||Ai==null||Ai!==pt(d)||(d=Ai,"selectionStart"in d&&Ju(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}),$o&&zo($o,d)||($o=d,d=wl(ed,"onSelect"),0<d.length&&(i=new Wu("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Ai)))}function kl(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Ri={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},nd={},Wm={};u&&(Wm=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 _l(r){if(nd[r])return nd[r];if(!Ri[r])return r;var i=Ri[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Wm)return nd[r]=i[l];return r}var Km=_l("animationend"),Gm=_l("animationiteration"),qm=_l("animationstart"),Ym=_l("transitionend"),Zm=new Map,Xm="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 ca(r,i){Zm.set(r,i),s(i,[r])}for(var rd=0;rd<Xm.length;rd++){var ad=Xm[rd],DP=ad.toLowerCase(),MP=ad[0].toUpperCase()+ad.slice(1);ca(DP,"on"+MP)}ca(Km,"onAnimationEnd"),ca(Gm,"onAnimationIteration"),ca(qm,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(Ym,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="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(" "),IP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ho));function Qm(r,i,l){var d=r.type||"unknown-event";r.currentTarget=l,De(d,i,void 0,r),r.currentTarget=null}function Jm(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,$=E.currentTarget;if(E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}else for(_=0;_<d.length;_++){if(E=d[_],M=E.instance,$=E.currentTarget,E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}}}if(te)throw r=ae,te=!1,ae=null,r}function mt(r,i){var l=i[hd];l===void 0&&(l=i[hd]=new Set);var d=r+"__bubble";l.has(d)||(eg(i,r,2,!1),l.add(d))}function id(r,i,l){var d=0;i&&(d|=4),eg(l,r,d,i)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Wo(r){if(!r[bl]){r[bl]=!0,a.forEach(function(l){l!=="selectionchange"&&(IP.has(l)||id(l,!1,r),id(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[bl]||(i[bl]=!0,id("selectionchange",!1,i))}}function eg(r,i,l,d){switch(xm(i)){case 1:var p=qx;break;case 4:p=Yx;break;default:p=zu}l=p.bind(null,i,l,r),p=void 0,!Ao||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 od(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(_=Va(E),_===null)return;if(M=_.tag,M===5||M===6){d=g=_;continue e}E=E.parentNode}}d=d.return}Ba(function(){var $=g,ee=Co(l),ne=[];e:{var J=Zm.get(r);if(J!==void 0){var de=Wu,ve=r;switch(r){case"keypress":if(ml(l)===0)break e;case"keydown":case"keyup":de=uP;break;case"focusin":ve="focus",de=qu;break;case"focusout":ve="blur",de=qu;break;case"beforeblur":case"afterblur":de=qu;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=Cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Qx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=fP;break;case Km:case Gm:case qm:de=tP;break;case Ym:de=mP;break;case"scroll":de=Zx;break;case"wheel":de=yP;break;case"copy":case"cut":case"paste":de=rP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Em}var we=(i&4)!==0,Ct=!we&&r==="scroll",B=we?J!==null?J+"Capture":null:J;we=[];for(var j=$,F;j!==null;){F=j;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,B!==null&&(oe=ea(j,B),oe!=null&&we.push(Ko(j,oe,F)))),Ct)break;j=j.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!==bi&&(ve=l.relatedTarget||l.fromElement)&&(Va(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=$,ve=ve?Va(ve):null,ve!==null&&(Ct=he(ve),ve!==Ct||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(de=null,ve=$),de!==ve)){if(we=Cm,oe="onMouseLeave",B="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(we=Em,oe="onPointerLeave",B="onPointerEnter",j="pointer"),Ct=de==null?J:Mi(de),F=ve==null?J:Mi(ve),J=new we(oe,j+"leave",de,l,ee),J.target=Ct,J.relatedTarget=F,oe=null,Va(ee)===$&&(we=new we(B,j+"enter",ve,l,ee),we.target=F,we.relatedTarget=Ct,oe=we),Ct=oe,de&&ve)t:{for(we=de,B=ve,j=0,F=we;F;F=Li(F))j++;for(F=0,oe=B;oe;oe=Li(oe))F++;for(;0<j-F;)we=Li(we),j--;for(;0<F-j;)B=Li(B),F--;for(;j--;){if(we===B||B!==null&&we===B.alternate)break t;we=Li(we),B=Li(B)}we=null}else we=null;de!==null&&tg(ne,J,de,we,!1),ve!==null&&Ct!==null&&tg(ne,Ct,ve,we,!0)}}e:{if(J=$?Mi($):window,de=J.nodeName&&J.nodeName.toLowerCase(),de==="select"||de==="input"&&J.type==="file")var Se=PP;else if(Im(J))if(Om)Se=EP;else{Se=CP;var Oe=SP}else(de=J.nodeName)&&de.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Se=TP);if(Se&&(Se=Se(r,$))){Nm(ne,Se,l,ee);break e}Oe&&Oe(r,J,$),r==="focusout"&&(Oe=J._wrapperState)&&Oe.controlled&&J.type==="number"&&Po(J,"number",J.value)}switch(Oe=$?Mi($):window,r){case"focusin":(Im(Oe)||Oe.contentEditable==="true")&&(Ai=Oe,ed=$,$o=null);break;case"focusout":$o=ed=Ai=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Hm(ne,l,ee);break;case"selectionchange":if(LP)break;case"keydown":case"keyup":Hm(ne,l,ee)}var je;if(Zu)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?Dm(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Am&&l.locale!=="ko"&&(Ei||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ei&&(je=Pm()):(la=ee,Hu="value"in la?la.value:la.textContent,Ei=!0)),Oe=wl($,Ve),0<Oe.length&&(Ve=new Tm(Ve,r,null,l,ee),ne.push({event:Ve,listeners:Oe}),je?Ve.data=je:(je=Mm(l),je!==null&&(Ve.data=je)))),(je=kP?_P(r,l):bP(r,l))&&($=wl($,"onBeforeInput"),0<$.length&&(ee=new Tm("onBeforeInput","beforeinput",null,l,ee),ne.push({event:ee,listeners:$}),ee.data=je))}Jm(ne,i)})}function Ko(r,i,l){return{instance:r,listener:i,currentTarget:l}}function wl(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=ea(r,l),g!=null&&d.unshift(Ko(r,g,p)),g=ea(r,i),g!=null&&d.push(Ko(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 tg(r,i,l,d,p){for(var g=i._reactName,_=[];l!==null&&l!==d;){var E=l,M=E.alternate,$=E.stateNode;if(M!==null&&M===d)break;E.tag===5&&$!==null&&(E=$,p?(M=ea(l,g),M!=null&&_.unshift(Ko(l,M,E))):p||(M=ea(l,g),M!=null&&_.push(Ko(l,M,E)))),l=l.return}_.length!==0&&r.push({event:i,listeners:_})}var NP=/\r\n?/g,OP=/\u0000|\uFFFD/g;function ng(r){return(typeof r=="string"?r:""+r).replace(NP,`
7
- `).replace(OP,"")}function xl(r,i,l){if(i=ng(i),ng(r)!==i&&l)throw Error(n(425))}function Pl(){}var sd=null,ld=null;function cd(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 ud=typeof setTimeout=="function"?setTimeout:void 0,jP=typeof clearTimeout=="function"?clearTimeout:void 0,rg=typeof Promise=="function"?Promise:void 0,UP=typeof queueMicrotask=="function"?queueMicrotask:typeof rg<"u"?function(r){return rg.resolve(null).then(r).catch(BP)}:ud;function BP(r){setTimeout(function(){throw r})}function dd(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),Oo(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);Oo(i)}function ua(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 ag(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,Go="__reactProps$"+Di,Dr="__reactContainer$"+Di,hd="__reactEvents$"+Di,FP="__reactListeners$"+Di,VP="__reactHandles$"+Di;function Va(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=ag(r);r!==null;){if(l=r[cr])return l;r=ag(r)}return i}r=l,l=r.parentNode}return null}function qo(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 Sl(r){return r[Go]||null}var fd=[],Ii=-1;function da(r){return{current:r}}function gt(r){0>Ii||(r.current=fd[Ii],fd[Ii]=null,Ii--)}function ft(r,i){Ii++,fd[Ii]=r.current,r.current=i}var ha={},qt=da(ha),hn=da(!1),za=ha;function Ni(r,i){var l=r.type.contextTypes;if(!l)return ha;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 Cl(){gt(hn),gt(qt)}function ig(r,i,l){if(qt.current!==ha)throw Error(n(168));ft(qt,i),ft(hn,l)}function og(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 H({},l,d)}function Tl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ha,za=qt.current,ft(qt,r),ft(hn,hn.current),!0}function sg(r,i,l){var d=r.stateNode;if(!d)throw Error(n(169));l?(r=og(r,i,za),d.__reactInternalMemoizedMergedChildContext=r,gt(hn),gt(qt),ft(qt,r)):gt(hn),ft(hn,l)}var Mr=null,El=!1,pd=!1;function lg(r){Mr===null?Mr=[r]:Mr.push(r)}function zP(r){El=!0,lg(r)}function fa(){if(!pd&&Mr!==null){pd=!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,El=!1}catch(p){throw Mr!==null&&(Mr=Mr.slice(r+1)),ht(Ar,fa),p}finally{ct=i,pd=!1}}return null}var Oi=[],ji=0,Al=null,Rl=0,En=[],An=0,$a=null,Ir=1,Nr="";function Ha(r,i){Oi[ji++]=Rl,Oi[ji++]=Al,Al=r,Rl=i}function cg(r,i,l){En[An++]=Ir,En[An++]=Nr,En[An++]=$a,$a=r;var d=Ir;r=Nr;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-=_,Ir=1<<32-He(i)+p|l<<p|d,Nr=g+r}else Ir=1<<g|l<<p|d,Nr=r}function md(r){r.return!==null&&(Ha(r,1),cg(r,1,0))}function gd(r){for(;r===Al;)Al=Oi[--ji],Oi[ji]=null,Rl=Oi[--ji],Oi[ji]=null;for(;r===$a;)$a=En[--An],En[An]=null,Nr=En[--An],En[An]=null,Ir=En[--An],En[An]=null}var kn=null,_n=null,kt=!1,Zn=null;function ug(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 dg(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,kn=r,_n=ua(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,kn=r,_n=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=$a!==null?{id:Ir,overflow:Nr}:null,r.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Mn(18,null,null,0),l.stateNode=i,l.return=r,r.child=l,kn=r,_n=null,!0):!1;default:return!1}}function yd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function vd(r){if(kt){var i=_n;if(i){var l=i;if(!dg(r,i)){if(yd(r))throw Error(n(418));i=ua(l.nextSibling);var d=kn;i&&dg(r,i)?ug(d,l):(r.flags=r.flags&-4097|2,kt=!1,kn=r)}}else{if(yd(r))throw Error(n(418));r.flags=r.flags&-4097|2,kt=!1,kn=r}}}function hg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;kn=r}function Ll(r){if(r!==kn)return!1;if(!kt)return hg(r),kt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!cd(r.type,r.memoizedProps)),i&&(i=_n)){if(yd(r))throw fg(),Error(n(418));for(;i;)ug(r,i),i=ua(i.nextSibling)}if(hg(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=ua(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}r=r.nextSibling}_n=null}}else _n=kn?ua(r.stateNode.nextSibling):null;return!0}function fg(){for(var r=_n;r;)r=ua(r.nextSibling)}function Ui(){_n=kn=null,kt=!1}function kd(r){Zn===null?Zn=[r]:Zn.push(r)}var $P=O.ReactCurrentBatchConfig;function Yo(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 Dl(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function pg(r){var i=r._init;return i(r._payload)}function mg(r){function i(B,j){if(r){var F=B.deletions;F===null?(B.deletions=[j],B.flags|=16):F.push(j)}}function l(B,j){if(!r)return null;for(;j!==null;)i(B,j),j=j.sibling;return null}function d(B,j){for(B=new Map;j!==null;)j.key!==null?B.set(j.key,j):B.set(j.index,j),j=j.sibling;return B}function p(B,j){return B=ba(B,j),B.index=0,B.sibling=null,B}function g(B,j,F){return B.index=F,r?(F=B.alternate,F!==null?(F=F.index,F<j?(B.flags|=2,j):F):(B.flags|=2,j)):(B.flags|=1048576,j)}function _(B){return r&&B.alternate===null&&(B.flags|=2),B}function E(B,j,F,oe){return j===null||j.tag!==6?(j=uh(F,B.mode,oe),j.return=B,j):(j=p(j,F),j.return=B,j)}function M(B,j,F,oe){var Se=F.type;return Se===z?ee(B,j,F.props.children,oe,F.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===j.type)?(oe=p(j,F.props),oe.ref=Yo(B,j,F),oe.return=B,oe):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Yo(B,j,F),oe.return=B,oe)}function $(B,j,F,oe){return j===null||j.tag!==4||j.stateNode.containerInfo!==F.containerInfo||j.stateNode.implementation!==F.implementation?(j=dh(F,B.mode,oe),j.return=B,j):(j=p(j,F.children||[]),j.return=B,j)}function ee(B,j,F,oe,Se){return j===null||j.tag!==7?(j=Qa(F,B.mode,oe,Se),j.return=B,j):(j=p(j,F),j.return=B,j)}function ne(B,j,F){if(typeof j=="string"&&j!==""||typeof j=="number")return j=uh(""+j,B.mode,F),j.return=B,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case G:return F=nc(j.type,j.key,j.props,null,B.mode,F),F.ref=Yo(B,null,j),F.return=B,F;case W:return j=dh(j,B.mode,F),j.return=B,j;case pe:var oe=j._init;return ne(B,oe(j._payload),F)}if(qr(j)||Z(j))return j=Qa(j,B.mode,F,null),j.return=B,j;Dl(B,j)}return null}function J(B,j,F,oe){var Se=j!==null?j.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:E(B,j,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case G:return F.key===Se?M(B,j,F,oe):null;case W:return F.key===Se?$(B,j,F,oe):null;case pe:return Se=F._init,J(B,j,Se(F._payload),oe)}if(qr(F)||Z(F))return Se!==null?null:ee(B,j,F,oe,null);Dl(B,F)}return null}function de(B,j,F,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return B=B.get(F)||null,E(j,B,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case G:return B=B.get(oe.key===null?F:oe.key)||null,M(j,B,oe,Se);case W:return B=B.get(oe.key===null?F:oe.key)||null,$(j,B,oe,Se);case pe:var Oe=oe._init;return de(B,j,F,Oe(oe._payload),Se)}if(qr(oe)||Z(oe))return B=B.get(F)||null,ee(j,B,oe,Se,null);Dl(j,oe)}return null}function ve(B,j,F,oe){for(var Se=null,Oe=null,je=j,Ve=j=0,Vt=null;je!==null&&Ve<F.length;Ve++){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var st=J(B,je,F[Ve],oe);if(st===null){je===null&&(je=Vt);break}r&&je&&st.alternate===null&&i(B,je),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st,je=Vt}if(Ve===F.length)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;Ve<F.length;Ve++)je=ne(B,F[Ve],oe),je!==null&&(j=g(je,j,Ve),Oe===null?Se=je:Oe.sibling=je,Oe=je);return kt&&Ha(B,Ve),Se}for(je=d(B,je);Ve<F.length;Ve++)Vt=de(je,B,Ve,F[Ve],oe),Vt!==null&&(r&&Vt.alternate!==null&&je.delete(Vt.key===null?Ve:Vt.key),j=g(Vt,j,Ve),Oe===null?Se=Vt:Oe.sibling=Vt,Oe=Vt);return r&&je.forEach(function(wa){return i(B,wa)}),kt&&Ha(B,Ve),Se}function we(B,j,F,oe){var Se=Z(F);if(typeof Se!="function")throw Error(n(150));if(F=Se.call(F),F==null)throw Error(n(151));for(var Oe=Se=null,je=j,Ve=j=0,Vt=null,st=F.next();je!==null&&!st.done;Ve++,st=F.next()){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var wa=J(B,je,st.value,oe);if(wa===null){je===null&&(je=Vt);break}r&&je&&wa.alternate===null&&i(B,je),j=g(wa,j,Ve),Oe===null?Se=wa:Oe.sibling=wa,Oe=wa,je=Vt}if(st.done)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;!st.done;Ve++,st=F.next())st=ne(B,st.value,oe),st!==null&&(j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return kt&&Ha(B,Ve),Se}for(je=d(B,je);!st.done;Ve++,st=F.next())st=de(je,B,Ve,st.value,oe),st!==null&&(r&&st.alternate!==null&&je.delete(st.key===null?Ve:st.key),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return r&&je.forEach(function(wS){return i(B,wS)}),kt&&Ha(B,Ve),Se}function Ct(B,j,F,oe){if(typeof F=="object"&&F!==null&&F.type===z&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case G:e:{for(var Se=F.key,Oe=j;Oe!==null;){if(Oe.key===Se){if(Se=F.type,Se===z){if(Oe.tag===7){l(B,Oe.sibling),j=p(Oe,F.props.children),j.return=B,B=j;break e}}else if(Oe.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===Oe.type){l(B,Oe.sibling),j=p(Oe,F.props),j.ref=Yo(B,Oe,F),j.return=B,B=j;break e}l(B,Oe);break}else i(B,Oe);Oe=Oe.sibling}F.type===z?(j=Qa(F.props.children,B.mode,oe,F.key),j.return=B,B=j):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Yo(B,j,F),oe.return=B,B=oe)}return _(B);case W:e:{for(Oe=F.key;j!==null;){if(j.key===Oe)if(j.tag===4&&j.stateNode.containerInfo===F.containerInfo&&j.stateNode.implementation===F.implementation){l(B,j.sibling),j=p(j,F.children||[]),j.return=B,B=j;break e}else{l(B,j);break}else i(B,j);j=j.sibling}j=dh(F,B.mode,oe),j.return=B,B=j}return _(B);case pe:return Oe=F._init,Ct(B,j,Oe(F._payload),oe)}if(qr(F))return ve(B,j,F,oe);if(Z(F))return we(B,j,F,oe);Dl(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,j!==null&&j.tag===6?(l(B,j.sibling),j=p(j,F),j.return=B,B=j):(l(B,j),j=uh(F,B.mode,oe),j.return=B,B=j),_(B)):l(B,j)}return Ct}var Bi=mg(!0),gg=mg(!1),Ml=da(null),Il=null,Fi=null,_d=null;function bd(){_d=Fi=Il=null}function wd(r){var i=Ml.current;gt(Ml),r._currentValue=i}function xd(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){Il=r,_d=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(_d!==r)if(r={context:r,memoizedValue:i,next:null},Fi===null){if(Il===null)throw Error(n(308));Fi=r,Il.dependencies={lanes:0,firstContext:r}}else Fi=Fi.next=r;return i}var Wa=null;function Pd(r){Wa===null?Wa=[r]:Wa.push(r)}function yg(r,i,l,d){var p=i.interleaved;return p===null?(l.next=l,Pd(i)):(l.next=p.next,p.next=l),i.interleaved=l,Or(r,d)}function Or(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 pa=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vg(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 ma(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,Or(r,l)}return p=d.interleaved,p===null?(i.next=i,Pd(d)):(i.next=p.next,p.next=i),d.interleaved=i,Or(r,l)}function Nl(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,Bu(r,l)}}function kg(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 Ol(r,i,l,d){var p=r.updateQueue;pa=!1;var g=p.firstBaseUpdate,_=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var M=E,$=M.next;M.next=null,_===null?g=$:_.next=$,_=M;var ee=r.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==_&&(E===null?ee.firstBaseUpdate=$:E.next=$,ee.lastBaseUpdate=M))}if(g!==null){var ne=p.baseState;_=0,ee=$=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=H({},ne,J);break e;case 2:pa=!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?($=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=$,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);qa|=_,r.lanes=_,r.memoizedState=ne}}function _g(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 Zo={},ur=da(Zo),Xo=da(Zo),Qo=da(Zo);function Ka(r){if(r===Zo)throw Error(n(174));return r}function Cd(r,i){switch(ft(Qo,i),ft(Xo,r),ft(ur,Zo),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(Xo),gt(Qo)}function bg(r){Ka(Qo.current);var i=Ka(ur.current),l=yi(i,r.type);i!==l&&(ft(Xo,r),ft(ur,l))}function Td(r){Xo.current===r&&(gt(ur),gt(Xo))}var bt=da(0);function jl(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 Ed=[];function Ad(){for(var r=0;r<Ed.length;r++)Ed[r]._workInProgressVersionPrimary=null;Ed.length=0}var Ul=O.ReactCurrentDispatcher,Rd=O.ReactCurrentBatchConfig,Ga=0,wt=null,Mt=null,Bt=null,Bl=!1,Jo=!1,es=0,HP=0;function Yt(){throw Error(n(321))}function Ld(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 Dd(r,i,l,d,p,g){if(Ga=g,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Ul.current=r===null||r.memoizedState===null?qP:YP,r=l(d,p),Jo){g=0;do{if(Jo=!1,es=0,25<=g)throw Error(n(301));g+=1,Bt=Mt=null,i.updateQueue=null,Ul.current=ZP,r=l(d,p)}while(Jo)}if(Ul.current=zl,i=Mt!==null&&Mt.next!==null,Ga=0,Bt=Mt=wt=null,Bl=!1,i)throw Error(n(300));return r}function Md(){var r=es!==0;return es=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 ts(r,i){return typeof i=="function"?i(r):i}function Id(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,$=g;do{var ee=$.lane;if((Ga&ee)===ee)M!==null&&(M=M.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),d=$.hasEagerState?$.eagerState:r(d,$.action);else{var ne={lane:ee,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};M===null?(E=M=ne,_=d):M=M.next=ne,wt.lanes|=ee,qa|=ee}$=$.next}while($!==null&&$!==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,qa|=g,p=p.next;while(p!==r)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Nd(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 wg(){}function xg(r,i){var l=wt,d=Ln(),p=i(),g=!Yn(d.memoizedState,p);if(g&&(d.memoizedState=p,pn=!0),d=d.queue,Od(Cg.bind(null,l,d,r),[r]),d.getSnapshot!==i||g||Bt!==null&&Bt.memoizedState.tag&1){if(l.flags|=2048,ns(9,Sg.bind(null,l,d,p,i),void 0,null),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(l,i,p)}return p}function Pg(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 Sg(r,i,l,d){i.value=l,i.getSnapshot=d,Tg(i)&&Eg(r)}function Cg(r,i,l){return l(function(){Tg(i)&&Eg(r)})}function Tg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Yn(r,l)}catch{return!0}}function Eg(r){var i=Or(r,1);i!==null&&er(i,r,1,-1)}function Ag(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:ts,lastRenderedState:r},i.queue=r,r=r.dispatch=GP.bind(null,wt,r),[i.memoizedState,r]}function ns(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 Rg(){return Ln().memoizedState}function Fl(r,i,l,d){var p=dr();wt.flags|=r,p.memoizedState=ns(1|i,l,void 0,d===void 0?null:d)}function Vl(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&&Ld(d,_.deps)){p.memoizedState=ns(i,l,g,d);return}}wt.flags|=r,p.memoizedState=ns(1|i,l,g,d)}function Lg(r,i){return Fl(8390656,8,r,i)}function Od(r,i){return Vl(2048,8,r,i)}function Dg(r,i){return Vl(4,2,r,i)}function Mg(r,i){return Vl(4,4,r,i)}function Ig(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 Ng(r,i,l){return l=l!=null?l.concat([r]):null,Vl(4,4,Ig.bind(null,i,r),l)}function jd(){}function Og(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function jg(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(r=r(),l.memoizedState=[r,i],r)}function Ug(r,i,l){return(Ga&21)===0?(r.baseState&&(r.baseState=!1,pn=!0),r.memoizedState=l):(Yn(l,i)||(l=pm(),wt.lanes|=l,qa|=l,r.baseState=!0),i)}function WP(r,i){var l=ct;ct=l!==0&&4>l?l:4,r(!0);var d=Rd.transition;Rd.transition={};try{r(!1),i()}finally{ct=l,Rd.transition=d}}function Bg(){return Ln().memoizedState}function KP(r,i,l){var d=ka(r);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Fg(r))Vg(i,l);else if(l=yg(r,i,l,d),l!==null){var p=on();er(l,r,d,p),zg(l,i,d)}}function GP(r,i,l){var d=ka(r),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fg(r))Vg(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,Pd(i)):(p.next=M.next,M.next=p),i.interleaved=p;return}}catch{}l=yg(r,i,p,d),l!==null&&(p=on(),er(l,r,d,p),zg(l,i,d))}}function Fg(r){var i=r.alternate;return r===wt||i!==null&&i===wt}function Vg(r,i){Jo=Bl=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function zg(r,i,l){if((l&4194240)!==0){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}var zl={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},qP={readContext:Rn,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:Lg,useImperativeHandle:function(r,i,l){return l=l!=null?l.concat([r]):null,Fl(4194308,4,Ig.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Fl(4194308,4,r,i)},useInsertionEffect:function(r,i){return Fl(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=KP.bind(null,wt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:Ag,useDebugValue:jd,useDeferredValue:function(r){return dr().memoizedState=r},useTransition:function(){var r=Ag(!1),i=r[0];return r=WP.bind(null,r[1]),dr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,l){var d=wt,p=dr();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(d,i,l)}p.memoizedState=l;var g={value:l,getSnapshot:i};return p.queue=g,Lg(Cg.bind(null,d,g,r),[r]),d.flags|=2048,ns(9,Sg.bind(null,d,g,l,i),void 0,null),l},useId:function(){var r=dr(),i=Ft.identifierPrefix;if(kt){var l=Nr,d=Ir;l=(d&~(1<<32-He(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=es++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=HP++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},YP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Id,useRef:Rg,useState:function(){return Id(ts)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Id(ts)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1},ZP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Nd,useRef:Rg,useState:function(){return Nd(ts)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Mt===null?i.memoizedState=r:Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Nd(ts)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1};function Xn(r,i){if(r&&r.defaultProps){i=H({},i),r=r.defaultProps;for(var l in r)i[l]===void 0&&(i[l]=r[l]);return i}return i}function Ud(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:H({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var $l={isMounted:function(r){return(r=r._reactInternals)?he(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=on(),d=ka(r),p=jr(l,d);p.tag=2,i!=null&&(p.callback=i),i=ma(r,p,d),i!==null&&(er(i,r,d,l),Nl(i,r,d))}};function $g(r,i,l,d,p,g,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,_):i.prototype&&i.prototype.isPureReactComponent?!zo(l,d)||!zo(p,g):!0}function Hg(r,i,l){var d=!1,p=ha,g=i.contextType;return typeof g=="object"&&g!==null?g=Rn(g):(p=fn(i)?za:qt.current,d=i.contextTypes,g=(d=d!=null)?Ni(r,p):ha),i=new i(l,g),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=$l,r.stateNode=i,i._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=p,r.__reactInternalMemoizedMaskedChildContext=g),i}function Wg(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&&$l.enqueueReplaceState(i,i.state,null)}function Bd(r,i,l,d){var p=r.stateNode;p.props=l,p.state=r.memoizedState,p.refs={},Sd(r);var g=i.contextType;typeof g=="object"&&g!==null?p.context=Rn(g):(g=fn(i)?za:qt.current,p.context=Ni(r,g)),p.state=r.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Ud(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&&$l.enqueueReplaceState(p,p.state,null),Ol(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+=Pe(d),d=d.return;while(d);var p=l}catch(g){p=`
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 Pe(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 Te(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 z:return"Fragment";case W:return"Portal";case Y:return"Profiler";case P:return"StrictMode";case Ae:return"Suspense";case fe:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ue:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case se:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case le:return i=r.displayName||null,i!==null?i:Te(r.type)||"Memo";case pe:i=r._payload,r=r._init;try{return Te(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 Te(i);case 8:return i===P?"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 Cr(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 H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function Po(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 rl(r,i){i=i.checked,i!=null&&R(r,"checked",i,!1)}function Wn(r,i){rl(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")?So(r,i.type,l):i.hasOwnProperty("defaultValue")&&So(r,i.type,Qe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function al(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 So(r,i,l){(i!=="number"||pt(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var qr=Array.isArray;function Yr(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 Co(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function il(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(qr(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 ol(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 Zr(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 vi(r,i){return r==null||r==="http://www.w3.org/1999/xhtml"?Zr(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Xr,Cn=(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(Xr=Xr||document.createElement("div"),Xr.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Xr.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 Qr={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},Ou=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach(function(r){Ou.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Qr[i]=Qr[r]})});function ki(r,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Qr.hasOwnProperty(r)&&Qr[r]?(""+i).trim():i+"px"}function sl(r,i){r=r.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,p=ki(l,i[l],d);l==="float"&&(l="cssFloat"),d?r.setProperty(l,p):r[l]=p}}var Kn=H({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 _i(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 bi(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 wi=null;function To(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var xi=null,Gn=null,Tr=null;function Pi(r){if(r=Yo(r)){if(typeof xi!="function")throw Error(n(280));var i=r.stateNode;i&&(i=Sl(i),xi(r.stateNode,r.type,i))}}function ll(r){Gn?Tr?Tr.push(r):Tr=[r]:Gn=r}function Eo(){if(Gn){var r=Gn,i=Tr;if(Tr=Gn=null,Pi(r),i)for(r=0;r<i.length;r++)Pi(i[r])}}function cl(r,i){return r(i)}function Ao(){}var Jr=!1;function Ba(r,i,l){if(Jr)return r(i,l);Jr=!0;try{return cl(r,i,l)}finally{Jr=!1,(Gn!==null||Tr!==null)&&(Ao(),Eo())}}function ea(r,i){var l=r.stateNode;if(l===null)return null;var d=Sl(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 Ro=!1;if(u)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){Ro=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{Ro=!1}function A(r,i,l,d,p,g,_,E,M){var $=Array.prototype.slice.call(arguments,3);try{i.apply(l,$)}catch(ee){this.onError(ee)}}var U=!1,V=null,te=!1,ae=null,Ee={onError:function(r){U=!0,V=r}};function me(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(me.apply(this,arguments),U){if(U){var $=V;U=!1,V=null}else throw Error(n(198));te||(te=!0,ae=$)}}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 Me(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 Ie(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 Ie(p),r;if(g===d)return Ie(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 ot(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,St=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,Lo=t.unstable_LowPriority,ta=t.unstable_IdlePriority,Tn=null,rn=null;function Si(r){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Rr,Ut=Math.log,na=Math.LN2;function Rr(r){return r>>>=0,r===0?32:31-(Ut(r)/na|0)|0}var ut=64,Lr=4194304;function ra(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 Ci(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=ra(E):(g&=_,g!==0&&(d=ra(g)))}else _=l&~p,_!==0?d=ra(_):g!==0&&(d=ra(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 $x(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 Hx(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[_]=$x(E,i)):M<=i&&(r.expiredLanes|=E),g&=~E}}function ju(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function pm(){var r=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),r}function Uu(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Do(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 Wx(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 Bu(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 mm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var gm,Fu,ym,vm,km,Vu=!1,ul=[],aa=null,ia=null,oa=null,Mo=new Map,Io=new Map,sa=[],Kx="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 _m(r,i){switch(r){case"focusin":case"focusout":aa=null;break;case"dragenter":case"dragleave":ia=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":Mo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(i.pointerId)}}function No(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=Yo(i),i!==null&&Fu(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Gx(r,i,l,d,p){switch(i){case"focusin":return aa=No(aa,r,i,l,d,p),!0;case"dragenter":return ia=No(ia,r,i,l,d,p),!0;case"mouseover":return oa=No(oa,r,i,l,d,p),!0;case"pointerover":var g=p.pointerId;return Mo.set(g,No(Mo.get(g)||null,r,i,l,d,p)),!0;case"gotpointercapture":return g=p.pointerId,Io.set(g,No(Io.get(g)||null,r,i,l,d,p)),!0}return!1}function bm(r){var i=Va(r.target);if(i!==null){var l=he(i);if(l!==null){if(i=l.tag,i===13){if(i=Me(l),i!==null){r.blockedOn=i,km(r.priority,function(){ym(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 dl(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=$u(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);wi=d,l.target.dispatchEvent(d),wi=null}else return i=Yo(l),i!==null&&Fu(i),r.blockedOn=l,!1;i.shift()}return!0}function wm(r,i,l){dl(r)&&l.delete(i)}function qx(){Vu=!1,aa!==null&&dl(aa)&&(aa=null),ia!==null&&dl(ia)&&(ia=null),oa!==null&&dl(oa)&&(oa=null),Mo.forEach(wm),Io.forEach(wm)}function Oo(r,i){r.blockedOn===i&&(r.blockedOn=null,Vu||(Vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qx)))}function jo(r){function i(p){return Oo(p,r)}if(0<ul.length){Oo(ul[0],r);for(var l=1;l<ul.length;l++){var d=ul[l];d.blockedOn===r&&(d.blockedOn=null)}}for(aa!==null&&Oo(aa,r),ia!==null&&Oo(ia,r),oa!==null&&Oo(oa,r),Mo.forEach(i),Io.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=O.ReactCurrentBatchConfig,hl=!0;function Yx(r,i,l,d){var p=ct,g=Ti.transition;Ti.transition=null;try{ct=1,zu(r,i,l,d)}finally{ct=p,Ti.transition=g}}function Zx(r,i,l,d){var p=ct,g=Ti.transition;Ti.transition=null;try{ct=4,zu(r,i,l,d)}finally{ct=p,Ti.transition=g}}function zu(r,i,l,d){if(hl){var p=$u(r,i,l,d);if(p===null)od(r,i,d,fl,l),_m(r,d);else if(Gx(p,r,i,l,d))d.stopPropagation();else if(_m(r,d),i&4&&-1<Kx.indexOf(r)){for(;p!==null;){var g=Yo(p);if(g!==null&&gm(g),g=$u(r,i,l,d),g===null&&od(r,i,d,fl,l),g===p)break;p=g}p!==null&&d.stopPropagation()}else od(r,i,d,null,l)}}var fl=null;function $u(r,i,l,d){if(fl=null,r=To(d),r=Va(r),r!==null)if(i=he(r),i===null)r=null;else if(l=i.tag,l===13){if(r=Me(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 fl=r,null}function xm(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 Lo:return 16;case ta:return 536870912;default:return 16}default:return 16}}var la=null,Hu=null,pl=null;function Pm(){if(pl)return pl;var r,i=Hu,l=i.length,d,p="value"in la?la.value:la.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 pl=p.slice(r,1<d?1-d:void 0)}function ml(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 gl(){return!0}function Sm(){return!1}function kn(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)?gl:Sm,this.isPropagationStopped=Sm,this}return H(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=gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),i}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=kn(Ei),Uo=H({},Ei,{view:0,detail:0}),Xx=kn(Uo),Ku,Gu,Bo,yl=H({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yu,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!==Bo&&(Bo&&r.type==="mousemove"?(Ku=r.screenX-Bo.screenX,Gu=r.screenY-Bo.screenY):Gu=Ku=0,Bo=r),Ku)},movementY:function(r){return"movementY"in r?r.movementY:Gu}}),Cm=kn(yl),Qx=H({},yl,{dataTransfer:0}),Jx=kn(Qx),eP=H({},Uo,{relatedTarget:0}),qu=kn(eP),tP=H({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),nP=kn(tP),rP=H({},Ei,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),aP=kn(rP),iP=H({},Ei,{data:0}),Tm=kn(iP),oP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sP={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"},lP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cP(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=lP[r])?!!i[r]:!1}function Yu(){return cP}var uP=H({},Uo,{key:function(r){if(r.key){var i=oP[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ml(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?sP[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yu,charCode:function(r){return r.type==="keypress"?ml(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ml(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),dP=kn(uP),hP=H({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=kn(hP),fP=H({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yu}),pP=kn(fP),mP=H({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),gP=kn(mP),yP=H({},yl,{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}),vP=kn(yP),kP=[9,13,27,32],Zu=u&&"CompositionEvent"in window,Fo=null;u&&"documentMode"in document&&(Fo=document.documentMode);var _P=u&&"TextEvent"in window&&!Fo,Am=u&&(!Zu||Fo&&8<Fo&&11>=Fo),Rm=" ",Lm=!1;function Dm(r,i){switch(r){case"keyup":return kP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ai=!1;function bP(r,i){switch(r){case"compositionend":return Mm(i);case"keypress":return i.which!==32?null:(Lm=!0,Rm);case"textInput":return r=i.data,r===Rm&&Lm?null:r;default:return null}}function wP(r,i){if(Ai)return r==="compositionend"||!Zu&&Dm(r,i)?(r=Pm(),pl=Hu=la=null,Ai=!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 Am&&i.locale!=="ko"?null:i.data;default:return null}}var xP={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 Im(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!xP[r.type]:i==="textarea"}function Nm(r,i,l,d){ll(d),i=wl(i,"onChange"),0<i.length&&(l=new Wu("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var Vo=null,zo=null;function PP(r){Jm(r,0)}function vl(r){var i=Ii(r);if(Cr(i))return r}function SP(r,i){if(r==="change")return i}var Om=!1;if(u){var Xu;if(u){var Qu="oninput"in document;if(!Qu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Qu=typeof jm.oninput=="function"}Xu=Qu}else Xu=!1;Om=Xu&&(!document.documentMode||9<document.documentMode)}function Um(){Vo&&(Vo.detachEvent("onpropertychange",Bm),zo=Vo=null)}function Bm(r){if(r.propertyName==="value"&&vl(zo)){var i=[];Nm(i,zo,r,To(r)),Ba(PP,i)}}function CP(r,i,l){r==="focusin"?(Um(),Vo=i,zo=l,Vo.attachEvent("onpropertychange",Bm)):r==="focusout"&&Um()}function TP(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vl(zo)}function EP(r,i){if(r==="click")return vl(i)}function AP(r,i){if(r==="input"||r==="change")return vl(i)}function RP(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:RP;function $o(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 Fm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Vm(r,i){var l=Fm(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=Fm(l)}}function zm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?zm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $m(){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 Ju(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 LP(r){var i=$m(),l=r.focusedElem,d=r.selectionRange;if(i!==l&&l&&l.ownerDocument&&zm(l.ownerDocument.documentElement,l)){if(d!==null&&Ju(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=Vm(l,g);var _=Vm(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 DP=u&&"documentMode"in document&&11>=document.documentMode,Ri=null,ed=null,Ho=null,td=!1;function Hm(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;td||Ri==null||Ri!==pt(d)||(d=Ri,"selectionStart"in d&&Ju(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}),Ho&&$o(Ho,d)||(Ho=d,d=wl(ed,"onSelect"),0<d.length&&(i=new Wu("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Ri)))}function kl(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Li={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},nd={},Wm={};u&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Li.animationend.animation,delete Li.animationiteration.animation,delete Li.animationstart.animation),"TransitionEvent"in window||delete Li.transitionend.transition);function _l(r){if(nd[r])return nd[r];if(!Li[r])return r;var i=Li[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Wm)return nd[r]=i[l];return r}var Km=_l("animationend"),Gm=_l("animationiteration"),qm=_l("animationstart"),Ym=_l("transitionend"),Zm=new Map,Xm="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 ca(r,i){Zm.set(r,i),s(i,[r])}for(var rd=0;rd<Xm.length;rd++){var ad=Xm[rd],MP=ad.toLowerCase(),IP=ad[0].toUpperCase()+ad.slice(1);ca(MP,"on"+IP)}ca(Km,"onAnimationEnd"),ca(Gm,"onAnimationIteration"),ca(qm,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(Ym,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wo="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(" "),NP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wo));function Qm(r,i,l){var d=r.type||"unknown-event";r.currentTarget=l,De(d,i,void 0,r),r.currentTarget=null}function Jm(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,$=E.currentTarget;if(E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}else for(_=0;_<d.length;_++){if(E=d[_],M=E.instance,$=E.currentTarget,E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}}}if(te)throw r=ae,te=!1,ae=null,r}function mt(r,i){var l=i[hd];l===void 0&&(l=i[hd]=new Set);var d=r+"__bubble";l.has(d)||(eg(i,r,2,!1),l.add(d))}function id(r,i,l){var d=0;i&&(d|=4),eg(l,r,d,i)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Ko(r){if(!r[bl]){r[bl]=!0,a.forEach(function(l){l!=="selectionchange"&&(NP.has(l)||id(l,!1,r),id(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[bl]||(i[bl]=!0,id("selectionchange",!1,i))}}function eg(r,i,l,d){switch(xm(i)){case 1:var p=Yx;break;case 4:p=Zx;break;default:p=zu}l=p.bind(null,i,l,r),p=void 0,!Ro||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 od(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(_=Va(E),_===null)return;if(M=_.tag,M===5||M===6){d=g=_;continue e}E=E.parentNode}}d=d.return}Ba(function(){var $=g,ee=To(l),ne=[];e:{var J=Zm.get(r);if(J!==void 0){var de=Wu,ve=r;switch(r){case"keypress":if(ml(l)===0)break e;case"keydown":case"keyup":de=dP;break;case"focusin":ve="focus",de=qu;break;case"focusout":ve="blur",de=qu;break;case"beforeblur":case"afterblur":de=qu;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=Cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Jx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=pP;break;case Km:case Gm:case qm:de=nP;break;case Ym:de=gP;break;case"scroll":de=Xx;break;case"wheel":de=vP;break;case"copy":case"cut":case"paste":de=aP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Em}var we=(i&4)!==0,Ct=!we&&r==="scroll",B=we?J!==null?J+"Capture":null:J;we=[];for(var j=$,F;j!==null;){F=j;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,B!==null&&(oe=ea(j,B),oe!=null&&we.push(Go(j,oe,F)))),Ct)break;j=j.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!==wi&&(ve=l.relatedTarget||l.fromElement)&&(Va(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=$,ve=ve?Va(ve):null,ve!==null&&(Ct=he(ve),ve!==Ct||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(de=null,ve=$),de!==ve)){if(we=Cm,oe="onMouseLeave",B="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(we=Em,oe="onPointerLeave",B="onPointerEnter",j="pointer"),Ct=de==null?J:Ii(de),F=ve==null?J:Ii(ve),J=new we(oe,j+"leave",de,l,ee),J.target=Ct,J.relatedTarget=F,oe=null,Va(ee)===$&&(we=new we(B,j+"enter",ve,l,ee),we.target=F,we.relatedTarget=Ct,oe=we),Ct=oe,de&&ve)t:{for(we=de,B=ve,j=0,F=we;F;F=Di(F))j++;for(F=0,oe=B;oe;oe=Di(oe))F++;for(;0<j-F;)we=Di(we),j--;for(;0<F-j;)B=Di(B),F--;for(;j--;){if(we===B||B!==null&&we===B.alternate)break t;we=Di(we),B=Di(B)}we=null}else we=null;de!==null&&tg(ne,J,de,we,!1),ve!==null&&Ct!==null&&tg(ne,Ct,ve,we,!0)}}e:{if(J=$?Ii($):window,de=J.nodeName&&J.nodeName.toLowerCase(),de==="select"||de==="input"&&J.type==="file")var Se=SP;else if(Im(J))if(Om)Se=AP;else{Se=TP;var Oe=CP}else(de=J.nodeName)&&de.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Se=EP);if(Se&&(Se=Se(r,$))){Nm(ne,Se,l,ee);break e}Oe&&Oe(r,J,$),r==="focusout"&&(Oe=J._wrapperState)&&Oe.controlled&&J.type==="number"&&So(J,"number",J.value)}switch(Oe=$?Ii($):window,r){case"focusin":(Im(Oe)||Oe.contentEditable==="true")&&(Ri=Oe,ed=$,Ho=null);break;case"focusout":Ho=ed=Ri=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Hm(ne,l,ee);break;case"selectionchange":if(DP)break;case"keydown":case"keyup":Hm(ne,l,ee)}var je;if(Zu)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 Ai?Dm(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Am&&l.locale!=="ko"&&(Ai||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ai&&(je=Pm()):(la=ee,Hu="value"in la?la.value:la.textContent,Ai=!0)),Oe=wl($,Ve),0<Oe.length&&(Ve=new Tm(Ve,r,null,l,ee),ne.push({event:Ve,listeners:Oe}),je?Ve.data=je:(je=Mm(l),je!==null&&(Ve.data=je)))),(je=_P?bP(r,l):wP(r,l))&&($=wl($,"onBeforeInput"),0<$.length&&(ee=new Tm("onBeforeInput","beforeinput",null,l,ee),ne.push({event:ee,listeners:$}),ee.data=je))}Jm(ne,i)})}function Go(r,i,l){return{instance:r,listener:i,currentTarget:l}}function wl(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=ea(r,l),g!=null&&d.unshift(Go(r,g,p)),g=ea(r,i),g!=null&&d.push(Go(r,g,p))),r=r.return}return d}function Di(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function tg(r,i,l,d,p){for(var g=i._reactName,_=[];l!==null&&l!==d;){var E=l,M=E.alternate,$=E.stateNode;if(M!==null&&M===d)break;E.tag===5&&$!==null&&(E=$,p?(M=ea(l,g),M!=null&&_.unshift(Go(l,M,E))):p||(M=ea(l,g),M!=null&&_.push(Go(l,M,E)))),l=l.return}_.length!==0&&r.push({event:i,listeners:_})}var OP=/\r\n?/g,jP=/\u0000|\uFFFD/g;function ng(r){return(typeof r=="string"?r:""+r).replace(OP,`
7
+ `).replace(jP,"")}function xl(r,i,l){if(i=ng(i),ng(r)!==i&&l)throw Error(n(425))}function Pl(){}var sd=null,ld=null;function cd(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 ud=typeof setTimeout=="function"?setTimeout:void 0,UP=typeof clearTimeout=="function"?clearTimeout:void 0,rg=typeof Promise=="function"?Promise:void 0,BP=typeof queueMicrotask=="function"?queueMicrotask:typeof rg<"u"?function(r){return rg.resolve(null).then(r).catch(FP)}:ud;function FP(r){setTimeout(function(){throw r})}function dd(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),jo(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);jo(i)}function ua(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 ag(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 Mi=Math.random().toString(36).slice(2),cr="__reactFiber$"+Mi,qo="__reactProps$"+Mi,Dr="__reactContainer$"+Mi,hd="__reactEvents$"+Mi,VP="__reactListeners$"+Mi,zP="__reactHandles$"+Mi;function Va(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=ag(r);r!==null;){if(l=r[cr])return l;r=ag(r)}return i}r=l,l=r.parentNode}return null}function Yo(r){return r=r[cr]||r[Dr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ii(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Sl(r){return r[qo]||null}var fd=[],Ni=-1;function da(r){return{current:r}}function gt(r){0>Ni||(r.current=fd[Ni],fd[Ni]=null,Ni--)}function ft(r,i){Ni++,fd[Ni]=r.current,r.current=i}var ha={},qt=da(ha),fn=da(!1),za=ha;function Oi(r,i){var l=r.type.contextTypes;if(!l)return ha;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 pn(r){return r=r.childContextTypes,r!=null}function Cl(){gt(fn),gt(qt)}function ig(r,i,l){if(qt.current!==ha)throw Error(n(168));ft(qt,i),ft(fn,l)}function og(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 H({},l,d)}function Tl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ha,za=qt.current,ft(qt,r),ft(fn,fn.current),!0}function sg(r,i,l){var d=r.stateNode;if(!d)throw Error(n(169));l?(r=og(r,i,za),d.__reactInternalMemoizedMergedChildContext=r,gt(fn),gt(qt),ft(qt,r)):gt(fn),ft(fn,l)}var Mr=null,El=!1,pd=!1;function lg(r){Mr===null?Mr=[r]:Mr.push(r)}function $P(r){El=!0,lg(r)}function fa(){if(!pd&&Mr!==null){pd=!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,El=!1}catch(p){throw Mr!==null&&(Mr=Mr.slice(r+1)),ht(Ar,fa),p}finally{ct=i,pd=!1}}return null}var ji=[],Ui=0,Al=null,Rl=0,En=[],An=0,$a=null,Ir=1,Nr="";function Ha(r,i){ji[Ui++]=Rl,ji[Ui++]=Al,Al=r,Rl=i}function cg(r,i,l){En[An++]=Ir,En[An++]=Nr,En[An++]=$a,$a=r;var d=Ir;r=Nr;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-=_,Ir=1<<32-He(i)+p|l<<p|d,Nr=g+r}else Ir=1<<g|l<<p|d,Nr=r}function md(r){r.return!==null&&(Ha(r,1),cg(r,1,0))}function gd(r){for(;r===Al;)Al=ji[--Ui],ji[Ui]=null,Rl=ji[--Ui],ji[Ui]=null;for(;r===$a;)$a=En[--An],En[An]=null,Nr=En[--An],En[An]=null,Ir=En[--An],En[An]=null}var _n=null,bn=null,kt=!1,Zn=null;function ug(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 dg(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,_n=r,bn=ua(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,_n=r,bn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=$a!==null?{id:Ir,overflow:Nr}:null,r.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Mn(18,null,null,0),l.stateNode=i,l.return=r,r.child=l,_n=r,bn=null,!0):!1;default:return!1}}function yd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function vd(r){if(kt){var i=bn;if(i){var l=i;if(!dg(r,i)){if(yd(r))throw Error(n(418));i=ua(l.nextSibling);var d=_n;i&&dg(r,i)?ug(d,l):(r.flags=r.flags&-4097|2,kt=!1,_n=r)}}else{if(yd(r))throw Error(n(418));r.flags=r.flags&-4097|2,kt=!1,_n=r}}}function hg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;_n=r}function Ll(r){if(r!==_n)return!1;if(!kt)return hg(r),kt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!cd(r.type,r.memoizedProps)),i&&(i=bn)){if(yd(r))throw fg(),Error(n(418));for(;i;)ug(r,i),i=ua(i.nextSibling)}if(hg(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){bn=ua(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}r=r.nextSibling}bn=null}}else bn=_n?ua(r.stateNode.nextSibling):null;return!0}function fg(){for(var r=bn;r;)r=ua(r.nextSibling)}function Bi(){bn=_n=null,kt=!1}function kd(r){Zn===null?Zn=[r]:Zn.push(r)}var HP=O.ReactCurrentBatchConfig;function Zo(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 Dl(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function pg(r){var i=r._init;return i(r._payload)}function mg(r){function i(B,j){if(r){var F=B.deletions;F===null?(B.deletions=[j],B.flags|=16):F.push(j)}}function l(B,j){if(!r)return null;for(;j!==null;)i(B,j),j=j.sibling;return null}function d(B,j){for(B=new Map;j!==null;)j.key!==null?B.set(j.key,j):B.set(j.index,j),j=j.sibling;return B}function p(B,j){return B=ba(B,j),B.index=0,B.sibling=null,B}function g(B,j,F){return B.index=F,r?(F=B.alternate,F!==null?(F=F.index,F<j?(B.flags|=2,j):F):(B.flags|=2,j)):(B.flags|=1048576,j)}function _(B){return r&&B.alternate===null&&(B.flags|=2),B}function E(B,j,F,oe){return j===null||j.tag!==6?(j=uh(F,B.mode,oe),j.return=B,j):(j=p(j,F),j.return=B,j)}function M(B,j,F,oe){var Se=F.type;return Se===z?ee(B,j,F.props.children,oe,F.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===j.type)?(oe=p(j,F.props),oe.ref=Zo(B,j,F),oe.return=B,oe):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Zo(B,j,F),oe.return=B,oe)}function $(B,j,F,oe){return j===null||j.tag!==4||j.stateNode.containerInfo!==F.containerInfo||j.stateNode.implementation!==F.implementation?(j=dh(F,B.mode,oe),j.return=B,j):(j=p(j,F.children||[]),j.return=B,j)}function ee(B,j,F,oe,Se){return j===null||j.tag!==7?(j=Qa(F,B.mode,oe,Se),j.return=B,j):(j=p(j,F),j.return=B,j)}function ne(B,j,F){if(typeof j=="string"&&j!==""||typeof j=="number")return j=uh(""+j,B.mode,F),j.return=B,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case G:return F=nc(j.type,j.key,j.props,null,B.mode,F),F.ref=Zo(B,null,j),F.return=B,F;case W:return j=dh(j,B.mode,F),j.return=B,j;case pe:var oe=j._init;return ne(B,oe(j._payload),F)}if(qr(j)||Z(j))return j=Qa(j,B.mode,F,null),j.return=B,j;Dl(B,j)}return null}function J(B,j,F,oe){var Se=j!==null?j.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:E(B,j,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case G:return F.key===Se?M(B,j,F,oe):null;case W:return F.key===Se?$(B,j,F,oe):null;case pe:return Se=F._init,J(B,j,Se(F._payload),oe)}if(qr(F)||Z(F))return Se!==null?null:ee(B,j,F,oe,null);Dl(B,F)}return null}function de(B,j,F,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return B=B.get(F)||null,E(j,B,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case G:return B=B.get(oe.key===null?F:oe.key)||null,M(j,B,oe,Se);case W:return B=B.get(oe.key===null?F:oe.key)||null,$(j,B,oe,Se);case pe:var Oe=oe._init;return de(B,j,F,Oe(oe._payload),Se)}if(qr(oe)||Z(oe))return B=B.get(F)||null,ee(j,B,oe,Se,null);Dl(j,oe)}return null}function ve(B,j,F,oe){for(var Se=null,Oe=null,je=j,Ve=j=0,Vt=null;je!==null&&Ve<F.length;Ve++){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var st=J(B,je,F[Ve],oe);if(st===null){je===null&&(je=Vt);break}r&&je&&st.alternate===null&&i(B,je),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st,je=Vt}if(Ve===F.length)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;Ve<F.length;Ve++)je=ne(B,F[Ve],oe),je!==null&&(j=g(je,j,Ve),Oe===null?Se=je:Oe.sibling=je,Oe=je);return kt&&Ha(B,Ve),Se}for(je=d(B,je);Ve<F.length;Ve++)Vt=de(je,B,Ve,F[Ve],oe),Vt!==null&&(r&&Vt.alternate!==null&&je.delete(Vt.key===null?Ve:Vt.key),j=g(Vt,j,Ve),Oe===null?Se=Vt:Oe.sibling=Vt,Oe=Vt);return r&&je.forEach(function(wa){return i(B,wa)}),kt&&Ha(B,Ve),Se}function we(B,j,F,oe){var Se=Z(F);if(typeof Se!="function")throw Error(n(150));if(F=Se.call(F),F==null)throw Error(n(151));for(var Oe=Se=null,je=j,Ve=j=0,Vt=null,st=F.next();je!==null&&!st.done;Ve++,st=F.next()){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var wa=J(B,je,st.value,oe);if(wa===null){je===null&&(je=Vt);break}r&&je&&wa.alternate===null&&i(B,je),j=g(wa,j,Ve),Oe===null?Se=wa:Oe.sibling=wa,Oe=wa,je=Vt}if(st.done)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;!st.done;Ve++,st=F.next())st=ne(B,st.value,oe),st!==null&&(j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return kt&&Ha(B,Ve),Se}for(je=d(B,je);!st.done;Ve++,st=F.next())st=de(je,B,Ve,st.value,oe),st!==null&&(r&&st.alternate!==null&&je.delete(st.key===null?Ve:st.key),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return r&&je.forEach(function(xS){return i(B,xS)}),kt&&Ha(B,Ve),Se}function Ct(B,j,F,oe){if(typeof F=="object"&&F!==null&&F.type===z&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case G:e:{for(var Se=F.key,Oe=j;Oe!==null;){if(Oe.key===Se){if(Se=F.type,Se===z){if(Oe.tag===7){l(B,Oe.sibling),j=p(Oe,F.props.children),j.return=B,B=j;break e}}else if(Oe.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===Oe.type){l(B,Oe.sibling),j=p(Oe,F.props),j.ref=Zo(B,Oe,F),j.return=B,B=j;break e}l(B,Oe);break}else i(B,Oe);Oe=Oe.sibling}F.type===z?(j=Qa(F.props.children,B.mode,oe,F.key),j.return=B,B=j):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Zo(B,j,F),oe.return=B,B=oe)}return _(B);case W:e:{for(Oe=F.key;j!==null;){if(j.key===Oe)if(j.tag===4&&j.stateNode.containerInfo===F.containerInfo&&j.stateNode.implementation===F.implementation){l(B,j.sibling),j=p(j,F.children||[]),j.return=B,B=j;break e}else{l(B,j);break}else i(B,j);j=j.sibling}j=dh(F,B.mode,oe),j.return=B,B=j}return _(B);case pe:return Oe=F._init,Ct(B,j,Oe(F._payload),oe)}if(qr(F))return ve(B,j,F,oe);if(Z(F))return we(B,j,F,oe);Dl(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,j!==null&&j.tag===6?(l(B,j.sibling),j=p(j,F),j.return=B,B=j):(l(B,j),j=uh(F,B.mode,oe),j.return=B,B=j),_(B)):l(B,j)}return Ct}var Fi=mg(!0),gg=mg(!1),Ml=da(null),Il=null,Vi=null,_d=null;function bd(){_d=Vi=Il=null}function wd(r){var i=Ml.current;gt(Ml),r._currentValue=i}function xd(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 zi(r,i){Il=r,_d=Vi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&i)!==0&&(mn=!0),r.firstContext=null)}function Rn(r){var i=r._currentValue;if(_d!==r)if(r={context:r,memoizedValue:i,next:null},Vi===null){if(Il===null)throw Error(n(308));Vi=r,Il.dependencies={lanes:0,firstContext:r}}else Vi=Vi.next=r;return i}var Wa=null;function Pd(r){Wa===null?Wa=[r]:Wa.push(r)}function yg(r,i,l,d){var p=i.interleaved;return p===null?(l.next=l,Pd(i)):(l.next=p.next,p.next=l),i.interleaved=l,Or(r,d)}function Or(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 pa=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vg(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 ma(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,Or(r,l)}return p=d.interleaved,p===null?(i.next=i,Pd(d)):(i.next=p.next,p.next=i),d.interleaved=i,Or(r,l)}function Nl(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,Bu(r,l)}}function kg(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 Ol(r,i,l,d){var p=r.updateQueue;pa=!1;var g=p.firstBaseUpdate,_=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var M=E,$=M.next;M.next=null,_===null?g=$:_.next=$,_=M;var ee=r.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==_&&(E===null?ee.firstBaseUpdate=$:E.next=$,ee.lastBaseUpdate=M))}if(g!==null){var ne=p.baseState;_=0,ee=$=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=H({},ne,J);break e;case 2:pa=!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?($=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=$,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);qa|=_,r.lanes=_,r.memoizedState=ne}}function _g(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 Xo={},ur=da(Xo),Qo=da(Xo),Jo=da(Xo);function Ka(r){if(r===Xo)throw Error(n(174));return r}function Cd(r,i){switch(ft(Jo,i),ft(Qo,r),ft(ur,Xo),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:vi(null,"");break;default:r=r===8?i.parentNode:i,i=r.namespaceURI||null,r=r.tagName,i=vi(i,r)}gt(ur),ft(ur,i)}function $i(){gt(ur),gt(Qo),gt(Jo)}function bg(r){Ka(Jo.current);var i=Ka(ur.current),l=vi(i,r.type);i!==l&&(ft(Qo,r),ft(ur,l))}function Td(r){Qo.current===r&&(gt(ur),gt(Qo))}var bt=da(0);function jl(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 Ed=[];function Ad(){for(var r=0;r<Ed.length;r++)Ed[r]._workInProgressVersionPrimary=null;Ed.length=0}var Ul=O.ReactCurrentDispatcher,Rd=O.ReactCurrentBatchConfig,Ga=0,wt=null,Mt=null,Bt=null,Bl=!1,es=!1,ts=0,WP=0;function Yt(){throw Error(n(321))}function Ld(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 Dd(r,i,l,d,p,g){if(Ga=g,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Ul.current=r===null||r.memoizedState===null?YP:ZP,r=l(d,p),es){g=0;do{if(es=!1,ts=0,25<=g)throw Error(n(301));g+=1,Bt=Mt=null,i.updateQueue=null,Ul.current=XP,r=l(d,p)}while(es)}if(Ul.current=zl,i=Mt!==null&&Mt.next!==null,Ga=0,Bt=Mt=wt=null,Bl=!1,i)throw Error(n(300));return r}function Md(){var r=ts!==0;return ts=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 ns(r,i){return typeof i=="function"?i(r):i}function Id(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,$=g;do{var ee=$.lane;if((Ga&ee)===ee)M!==null&&(M=M.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),d=$.hasEagerState?$.eagerState:r(d,$.action);else{var ne={lane:ee,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};M===null?(E=M=ne,_=d):M=M.next=ne,wt.lanes|=ee,qa|=ee}$=$.next}while($!==null&&$!==g);M===null?_=d:M.next=E,Yn(d,i.memoizedState)||(mn=!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,qa|=g,p=p.next;while(p!==r)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Nd(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)||(mn=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function wg(){}function xg(r,i){var l=wt,d=Ln(),p=i(),g=!Yn(d.memoizedState,p);if(g&&(d.memoizedState=p,mn=!0),d=d.queue,Od(Cg.bind(null,l,d,r),[r]),d.getSnapshot!==i||g||Bt!==null&&Bt.memoizedState.tag&1){if(l.flags|=2048,rs(9,Sg.bind(null,l,d,p,i),void 0,null),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(l,i,p)}return p}function Pg(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 Sg(r,i,l,d){i.value=l,i.getSnapshot=d,Tg(i)&&Eg(r)}function Cg(r,i,l){return l(function(){Tg(i)&&Eg(r)})}function Tg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Yn(r,l)}catch{return!0}}function Eg(r){var i=Or(r,1);i!==null&&er(i,r,1,-1)}function Ag(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:ns,lastRenderedState:r},i.queue=r,r=r.dispatch=qP.bind(null,wt,r),[i.memoizedState,r]}function rs(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 Rg(){return Ln().memoizedState}function Fl(r,i,l,d){var p=dr();wt.flags|=r,p.memoizedState=rs(1|i,l,void 0,d===void 0?null:d)}function Vl(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&&Ld(d,_.deps)){p.memoizedState=rs(i,l,g,d);return}}wt.flags|=r,p.memoizedState=rs(1|i,l,g,d)}function Lg(r,i){return Fl(8390656,8,r,i)}function Od(r,i){return Vl(2048,8,r,i)}function Dg(r,i){return Vl(4,2,r,i)}function Mg(r,i){return Vl(4,4,r,i)}function Ig(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 Ng(r,i,l){return l=l!=null?l.concat([r]):null,Vl(4,4,Ig.bind(null,i,r),l)}function jd(){}function Og(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function jg(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(r=r(),l.memoizedState=[r,i],r)}function Ug(r,i,l){return(Ga&21)===0?(r.baseState&&(r.baseState=!1,mn=!0),r.memoizedState=l):(Yn(l,i)||(l=pm(),wt.lanes|=l,qa|=l,r.baseState=!0),i)}function KP(r,i){var l=ct;ct=l!==0&&4>l?l:4,r(!0);var d=Rd.transition;Rd.transition={};try{r(!1),i()}finally{ct=l,Rd.transition=d}}function Bg(){return Ln().memoizedState}function GP(r,i,l){var d=ka(r);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Fg(r))Vg(i,l);else if(l=yg(r,i,l,d),l!==null){var p=on();er(l,r,d,p),zg(l,i,d)}}function qP(r,i,l){var d=ka(r),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fg(r))Vg(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,Pd(i)):(p.next=M.next,M.next=p),i.interleaved=p;return}}catch{}l=yg(r,i,p,d),l!==null&&(p=on(),er(l,r,d,p),zg(l,i,d))}}function Fg(r){var i=r.alternate;return r===wt||i!==null&&i===wt}function Vg(r,i){es=Bl=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function zg(r,i,l){if((l&4194240)!==0){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}var zl={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},YP={readContext:Rn,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:Lg,useImperativeHandle:function(r,i,l){return l=l!=null?l.concat([r]):null,Fl(4194308,4,Ig.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Fl(4194308,4,r,i)},useInsertionEffect:function(r,i){return Fl(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=GP.bind(null,wt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:Ag,useDebugValue:jd,useDeferredValue:function(r){return dr().memoizedState=r},useTransition:function(){var r=Ag(!1),i=r[0];return r=KP.bind(null,r[1]),dr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,l){var d=wt,p=dr();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(d,i,l)}p.memoizedState=l;var g={value:l,getSnapshot:i};return p.queue=g,Lg(Cg.bind(null,d,g,r),[r]),d.flags|=2048,rs(9,Sg.bind(null,d,g,l,i),void 0,null),l},useId:function(){var r=dr(),i=Ft.identifierPrefix;if(kt){var l=Nr,d=Ir;l=(d&~(1<<32-He(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=ts++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=WP++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},ZP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Id,useRef:Rg,useState:function(){return Id(ns)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Id(ns)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1},XP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Nd,useRef:Rg,useState:function(){return Nd(ns)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Mt===null?i.memoizedState=r:Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Nd(ns)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1};function Xn(r,i){if(r&&r.defaultProps){i=H({},i),r=r.defaultProps;for(var l in r)i[l]===void 0&&(i[l]=r[l]);return i}return i}function Ud(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:H({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var $l={isMounted:function(r){return(r=r._reactInternals)?he(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=on(),d=ka(r),p=jr(l,d);p.tag=2,i!=null&&(p.callback=i),i=ma(r,p,d),i!==null&&(er(i,r,d,l),Nl(i,r,d))}};function $g(r,i,l,d,p,g,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,_):i.prototype&&i.prototype.isPureReactComponent?!$o(l,d)||!$o(p,g):!0}function Hg(r,i,l){var d=!1,p=ha,g=i.contextType;return typeof g=="object"&&g!==null?g=Rn(g):(p=pn(i)?za:qt.current,d=i.contextTypes,g=(d=d!=null)?Oi(r,p):ha),i=new i(l,g),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=$l,r.stateNode=i,i._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=p,r.__reactInternalMemoizedMaskedChildContext=g),i}function Wg(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&&$l.enqueueReplaceState(i,i.state,null)}function Bd(r,i,l,d){var p=r.stateNode;p.props=l,p.state=r.memoizedState,p.refs={},Sd(r);var g=i.contextType;typeof g=="object"&&g!==null?p.context=Rn(g):(g=pn(i)?za:qt.current,p.context=Oi(r,g)),p.state=r.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Ud(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&&$l.enqueueReplaceState(p,p.state,null),Ol(r,l,p,d),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308)}function Hi(r,i){try{var l="",d=i;do l+=Pe(d),d=d.return;while(d);var p=l}catch(g){p=`
8
8
  Error generating stack: `+g.message+`
9
- `+g.stack}return{value:r,source:i,stack:p,digest:null}}function Fd(r,i,l){return{value:r,source:null,stack:l??null,digest:i??null}}function Vd(r,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var XP=typeof WeakMap=="function"?WeakMap:Map;function Kg(r,i,l){l=jr(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Zl||(Zl=!0,nh=d),Vd(r,i)},l}function Gg(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(){Vd(r,i)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){Vd(r,i),typeof d!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function qg(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new XP;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=dS.bind(null,r,i,l),i.then(r,r))}function Yg(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 Zg(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,ma(l,i,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=p,r)}var QP=O.ReactCurrentOwner,pn=!1;function an(r,i,l,d){i.child=r===null?gg(i,null,l,d):Bi(i,r.child,l,d)}function Xg(r,i,l,d,p){l=l.render;var g=i.ref;return Vi(i,p),d=Dd(r,i,l,d,g,p),l=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&l&&md(i),i.flags|=1,an(r,i,d,p),i.child)}function Qg(r,i,l,d,p){if(r===null){var g=l.type;return typeof g=="function"&&!ch(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=g,Jg(r,i,g,d,p)):(r=nc(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:zo,l(_,d)&&r.ref===i.ref)return Ur(r,i,p)}return i.flags|=1,r=ba(g,d),r.ref=i.ref,r.return=i,i.child=r}function Jg(r,i,l,d,p){if(r!==null){var g=r.memoizedProps;if(zo(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 zd(r,i,l,d,p)}function ey(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,bn),bn|=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,bn),bn|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=g!==null?g.baseLanes:l,ft(Wi,bn),bn|=d}else g!==null?(d=g.baseLanes|l,i.memoizedState=null):d=l,ft(Wi,bn),bn|=d;return an(r,i,p,l),i.child}function ty(r,i){var l=i.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function zd(r,i,l,d,p){var g=fn(l)?za:qt.current;return g=Ni(i,g),Vi(i,p),l=Dd(r,i,l,d,g,p),d=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&d&&md(i),i.flags|=1,an(r,i,l,p),i.child)}function ny(r,i,l,d,p){if(fn(l)){var g=!0;Tl(i)}else g=!1;if(Vi(i,p),i.stateNode===null)Wl(r,i),Hg(i,l,d),Bd(i,l,d,p),d=!0;else if(r===null){var _=i.stateNode,E=i.memoizedProps;_.props=E;var M=_.context,$=l.contextType;typeof $=="object"&&$!==null?$=Rn($):($=fn(l)?za:qt.current,$=Ni(i,$));var ee=l.getDerivedStateFromProps,ne=typeof ee=="function"||typeof _.getSnapshotBeforeUpdate=="function";ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==d||M!==$)&&Wg(i,_,d,$),pa=!1;var J=i.memoizedState;_.state=J,Ol(i,d,_,p),M=i.memoizedState,E!==d||J!==M||hn.current||pa?(typeof ee=="function"&&(Ud(i,l,ee,d),M=i.memoizedState),(E=pa||$g(i,l,E,d,J,M,$))?(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=$,d=E):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,vg(r,i),E=i.memoizedProps,$=i.type===i.elementType?E:Xn(i.type,E),_.props=$,ne=i.pendingProps,J=_.context,M=l.contextType,typeof M=="object"&&M!==null?M=Rn(M):(M=fn(l)?za:qt.current,M=Ni(i,M));var de=l.getDerivedStateFromProps;(ee=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==ne||J!==M)&&Wg(i,_,d,M),pa=!1,J=i.memoizedState,_.state=J,Ol(i,d,_,p);var ve=i.memoizedState;E!==ne||J!==ve||hn.current||pa?(typeof de=="function"&&(Ud(i,l,de,d),ve=i.memoizedState),($=pa||$g(i,l,$,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=$):(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 $d(r,i,l,d,g,p)}function $d(r,i,l,d,p,g){ty(r,i);var _=(i.flags&128)!==0;if(!d&&!_)return p&&sg(i,l,!1),Ur(r,i,g);d=i.stateNode,QP.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&&sg(i,l,!0),i.child}function ry(r){var i=r.stateNode;i.pendingContext?ig(r,i.pendingContext,i.pendingContext!==i.context):i.context&&ig(r,i.context,!1),Cd(r,i.containerInfo)}function ay(r,i,l,d,p){return Ui(),kd(p),i.flags|=256,an(r,i,l,d),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0};function Wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function iy(r,i,l){var d=i.pendingProps,p=bt.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(bt,p&1),r===null)return vd(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=rc(_,d,0,null),r=Qa(r,d,l,null),g.return=i,r.return=i,g.sibling=r,i.child=g,i.child.memoizedState=Wd(l),i.memoizedState=Hd,r):Kd(i,_));if(p=r.memoizedState,p!==null&&(E=p.dehydrated,E!==null))return JP(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=ba(p,M),d.subtreeFlags=p.subtreeFlags&14680064),E!==null?g=ba(E,g):(g=Qa(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?Wd(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},g.memoizedState=_,g.childLanes=r.childLanes&~l,i.memoizedState=Hd,d}return g=r.child,r=g.sibling,d=ba(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 Kd(r,i){return i=rc({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function Hl(r,i,l,d){return d!==null&&kd(d),Bi(i,r.child,null,l),r=Kd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function JP(r,i,l,d,p,g,_){if(l)return i.flags&256?(i.flags&=-257,d=Fd(Error(n(422))),Hl(r,i,_,d)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(g=d.fallback,p=i.mode,d=rc({mode:"visible",children:d.children},p,0,null),g=Qa(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=Wd(_),i.memoizedState=Hd,g);if((i.mode&1)===0)return Hl(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=Fd(g,d,void 0),Hl(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,Or(r,p),er(d,r,p,-1))}return lh(),d=Fd(Error(n(421))),Hl(r,i,_,d)}return p.data==="$?"?(i.flags|=128,i.child=r.child,i=hS.bind(null,r),p._reactRetry=i,null):(r=g.treeContext,_n=ua(p.nextSibling),kn=i,kt=!0,Zn=null,r!==null&&(En[An++]=Ir,En[An++]=Nr,En[An++]=$a,Ir=r.id,Nr=r.overflow,$a=i),i=Kd(i,d.children),i.flags|=4096,i)}function oy(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xd(r.return,i,l)}function Gd(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 sy(r,i,l){var d=i.pendingProps,p=d.revealOrder,g=d.tail;if(an(r,i,d.children,l),d=bt.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&&oy(r,l,i);else if(r.tag===19)oy(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(bt,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&&jl(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Gd(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&&jl(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Gd(i,!0,l,null,g);break;case"together":Gd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Wl(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),qa|=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=ba(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=ba(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function eS(r,i,l){switch(i.tag){case 3:ry(i),Ui();break;case 5:bg(i);break;case 1:fn(i.type)&&Tl(i);break;case 4:Cd(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;ft(Ml,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(ft(bt,bt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?iy(r,i,l):(ft(bt,bt.current&1),r=Ur(r,i,l),r!==null?r.sibling:null);ft(bt,bt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(r.flags&128)!==0){if(d)return sy(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(bt,bt.current),d)break;return null;case 22:case 23:return i.lanes=0,ey(r,i,l)}return Ur(r,i,l)}var ly,qd,cy,uy;ly=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}},qd=function(){},cy=function(r,i,l,d){var p=r.memoizedProps;if(p!==d){r=i.stateNode,Ka(ur.current);var g=null;switch(l){case"input":p=en(r,p),d=en(r,d),g=[];break;case"select":p=H({},p,{value:void 0}),d=H({},d,{value:void 0}),g=[];break;case"textarea":p=So(r,p),d=So(r,d),g=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=Pl)}ki(l,d);var _;l=null;for($ in p)if(!d.hasOwnProperty($)&&p.hasOwnProperty($)&&p[$]!=null)if($==="style"){var E=p[$];for(_ in E)E.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(o.hasOwnProperty($)?g||(g=[]):(g=g||[]).push($,null));for($ in d){var M=d[$];if(E=p?.[$],d.hasOwnProperty($)&&M!==E&&(M!=null||E!=null))if($==="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($,l)),l=M;else $==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,E=E?E.__html:void 0,M!=null&&E!==M&&(g=g||[]).push($,M)):$==="children"?typeof M!="string"&&typeof M!="number"||(g=g||[]).push($,""+M):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(o.hasOwnProperty($)?(M!=null&&$==="onScroll"&&mt("scroll",r),g||E===M||(g=[])):(g=g||[]).push($,M))}l&&(g=g||[]).push("style",l);var $=g;(i.updateQueue=$)&&(i.flags|=4)}},uy=function(r,i,l,d){l!==d&&(i.flags|=4)};function rs(r,i){if(!kt)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 tS(r,i,l){var d=i.pendingProps;switch(gd(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)&&Cl(),Zt(i),null;case 3:return d=i.stateNode,zi(),gt(hn),gt(qt),Ad(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Ll(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zn!==null&&(ih(Zn),Zn=null))),qd(r,i),Zt(i),null;case 5:Td(i);var p=Ka(Qo.current);if(l=i.type,r!==null&&i.stateNode!=null)cy(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=Ka(ur.current),Ll(i)){d=i.stateNode,l=i.type;var g=i.memoizedProps;switch(d[cr]=i,d[Go]=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<Ho.length;p++)mt(Ho[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":xo(d,g),mt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!g.multiple},mt("invalid",d);break;case"textarea":il(d,g),mt("invalid",d)}ki(l,g),p=null;for(var _ in g)if(g.hasOwnProperty(_)){var E=g[_];_==="children"?typeof E=="string"?d.textContent!==E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",E]):typeof E=="number"&&d.textContent!==""+E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",""+E]):o.hasOwnProperty(_)&&E!=null&&_==="onScroll"&&mt("scroll",d)}switch(l){case"input":Hn(d),al(d,g,!0);break;case"textarea":Hn(d),lr(d);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(d.onclick=Pl)}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=Zr(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[Go]=d,ly(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<Ho.length;p++)mt(Ho[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":xo(r,d),p=en(r,d),mt("invalid",r);break;case"option":p=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},p=H({},d,{value:void 0}),mt("invalid",r);break;case"textarea":il(r,d),p=So(r,d),mt("invalid",r);break;default:p=d}ki(l,p),E=p;for(g in E)if(E.hasOwnProperty(g)){var M=E[g];g==="style"?sl(r,M):g==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Cn(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"&&(o.hasOwnProperty(g)?M!=null&&g==="onScroll"&&mt("scroll",r):M!=null&&R(r,g,M,_))}switch(l){case"input":Hn(r),al(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?Yr(r,!!d.multiple,g,!1):d.defaultValue!=null&&Yr(r,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(r.onclick=Pl)}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)uy(r,i,r.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(l=Ka(Qo.current),Ka(ur.current),Ll(i)){if(d=i.stateNode,l=i.memoizedProps,d[cr]=i,(g=d.nodeValue!==l)&&(r=kn,r!==null))switch(r.tag){case 3:xl(d.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&xl(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(bt),d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(kt&&_n!==null&&(i.mode&1)!==0&&(i.flags&128)===0)fg(),Ui(),i.flags|=98560,g=!1;else if(g=Ll(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&&(ih(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||(bt.current&1)!==0?It===0&&(It=3):lh())),i.updateQueue!==null&&(i.flags|=4),Zt(i),null);case 4:return zi(),qd(r,i),r===null&&Wo(i.stateNode.containerInfo),Zt(i),null;case 10:return wd(i.type._context),Zt(i),null;case 17:return fn(i.type)&&Cl(),Zt(i),null;case 19:if(gt(bt),g=i.memoizedState,g===null)return Zt(i),null;if(d=(i.flags&128)!==0,_=g.rendering,_===null)if(d)rs(g,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(_=jl(r),_!==null){for(i.flags|=128,rs(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(bt,bt.current&1|2),i.child}r=r.sibling}g.tail!==null&&rt()>Ki&&(i.flags|=128,d=!0,rs(g,!1),i.lanes=4194304)}else{if(!d)if(r=jl(_),r!==null){if(i.flags|=128,d=!0,l=r.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),rs(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!kt)return Zt(i),null}else 2*rt()-g.renderingStartTime>Ki&&l!==1073741824&&(i.flags|=128,d=!0,rs(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=bt.current,ft(bt,d?l&1|2:l&1),i):(Zt(i),null);case 22:case 23:return sh(),d=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(bn&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 nS(r,i){switch(gd(i),i.tag){case 1:return fn(i.type)&&Cl(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return zi(),gt(hn),gt(qt),Ad(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return Td(i),null;case 13:if(gt(bt),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(bt),null;case 4:return zi(),null;case 10:return wd(i.type._context),null;case 22:case 23:return sh(),null;case 24:return null;default:return null}}var Kl=!1,Xt=!1,rS=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 Yd(r,i,l){try{l()}catch(d){xt(r,i,d)}}var dy=!1;function aS(r,i){if(sd=hl,r=$m(),Ju(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,$=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&&++$===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(ld={focusedElem:r,selectionRange:l},hl=!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,Ct=ve.memoizedState,B=i.stateNode,j=B.getSnapshotBeforeUpdate(i.elementType===i.type?we:Xn(i.type,we),Ct);B.__reactInternalSnapshotBeforeUpdate=j}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(oe){xt(i,i.return,oe)}if(r=i.sibling,r!==null){r.return=i.return,ge=r;break}ge=i.return}return ve=dy,dy=!1,ve}function as(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&&Yd(i,l,g)}p=p.next}while(p!==d)}}function Gl(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 Zd(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 hy(r){var i=r.alternate;i!==null&&(r.alternate=null,hy(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[cr],delete i[Go],delete i[hd],delete i[FP],delete i[VP])),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 fy(r){return r.tag===5||r.tag===3||r.tag===4}function py(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fy(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 Xd(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=Pl));else if(d!==4&&(r=r.child,r!==null))for(Xd(r,i,l),r=r.sibling;r!==null;)Xd(r,i,l),r=r.sibling}function Qd(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(Qd(r,i,l),r=r.sibling;r!==null;)Qd(r,i,l),r=r.sibling}var Ht=null,Qn=!1;function ga(r,i,l){for(l=l.child;l!==null;)my(r,i,l),l=l.sibling}function my(r,i,l){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Tn,l)}catch{}switch(l.tag){case 5:Xt||Hi(l,i);case 6:var d=Ht,p=Qn;Ht=null,ga(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?dd(r.parentNode,l):r.nodeType===1&&dd(r,l),Oo(r)):dd(Ht,l.stateNode));break;case 4:d=Ht,p=Qn,Ht=l.stateNode.containerInfo,Qn=!0,ga(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)&&Yd(l,i,_),p=p.next}while(p!==d)}ga(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)}ga(r,i,l);break;case 21:ga(r,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ga(r,i,l),Xt=d):ga(r,i,l);break;default:ga(r,i,l)}}function gy(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new rS),i.forEach(function(d){var p=fS.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));my(g,_,p),Ht=null,Qn=!1;var M=p.alternate;M!==null&&(M.return=null),p.return=null}catch($){xt(p,i,$)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)yy(i,r),i=i.sibling}function yy(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{as(3,r,r.return),Gl(3,r)}catch(we){xt(r,r.return,we)}try{as(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&&rl(p,g),_i(E,_);var $=_i(E,g);for(_=0;_<M.length;_+=2){var ee=M[_],ne=M[_+1];ee==="style"?sl(p,ne):ee==="dangerouslySetInnerHTML"?Cn(p,ne):ee==="children"?tn(p,ne):R(p,ee,ne,$)}switch(E){case"input":Wn(p,g);break;case"textarea":ol(p,g);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var de=g.value;de!=null?Yr(p,!!g.multiple,de,!1):J!==!!g.multiple&&(g.defaultValue!=null?Yr(p,!!g.multiple,g.defaultValue,!0):Yr(p,!!g.multiple,g.multiple?[]:"",!1))}p[Go]=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{Oo(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||(th=rt())),d&4&&gy(r);break;case 22:if(ee=l!==null&&l.memoizedState!==null,r.mode&1?(Xt=($=Xt)||ee,Jn(i,r),Xt=$):Jn(i,r),hr(r),d&8192){if($=r.memoizedState!==null,(r.stateNode.isHidden=$)&&!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:as(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){_y(ne);continue}}de!==null?(de.return=J,ge=de):_y(ne)}ee=ee.sibling}e:for(ee=null,ne=r;;){if(ne.tag===5){if(ee===null){ee=ne;try{p=ne.stateNode,$?(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=$?"":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&&gy(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(fy(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=py(r);Qd(r,g,p);break;case 3:case 4:var _=d.stateNode.containerInfo,E=py(r);Xd(r,E,_);break;default:throw Error(n(161))}}catch(M){xt(r,r.return,M)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function iS(r,i,l){ge=r,vy(r)}function vy(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||Kl;if(!_){var E=p.alternate,M=E!==null&&E.memoizedState!==null||Xt;E=Kl;var $=Xt;if(Kl=_,(Xt=M)&&!$)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,vy(g),g=g.sibling;ge=p,Kl=E,Xt=$}ky(r)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,ge=g):ky(r)}}function ky(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||Gl(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&&_g(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}_g(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 $=i.alternate;if($!==null){var ee=$.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Oo(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xt||i.flags&512&&Zd(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 _y(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{Gl(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{Zd(i)}catch(M){xt(i,g,M)}break;case 5:var _=i.return;try{Zd(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 oS=Math.ceil,ql=O.ReactCurrentDispatcher,Jd=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,at=0,Ft=null,At=null,Wt=0,bn=0,Wi=da(0),It=0,is=null,qa=0,Yl=0,eh=0,os=null,mn=null,th=0,Ki=1/0,Br=null,Zl=!1,nh=null,ya=null,Xl=!1,va=null,Ql=0,ss=0,rh=null,Jl=-1,ec=0;function on(){return(at&6)!==0?rt():Jl!==-1?Jl:Jl=rt()}function ka(r){return(r.mode&1)===0?1:(at&2)!==0&&Wt!==0?Wt&-Wt:$P.transition!==null?(ec===0&&(ec=pm()),ec):(r=ct,r!==0||(r=window.event,r=r===void 0?16:xm(r.type)),r)}function er(r,i,l,d){if(50<ss)throw ss=0,rh=null,Error(n(185));Lo(r,l,d),((at&2)===0||r!==Ft)&&(r===Ft&&((at&2)===0&&(Yl|=l),It===4&&_a(r,Wt)),gn(r,d),l===1&&at===0&&(i.mode&1)===0&&(Ki=rt()+500,El&&fa()))}function gn(r,i){var l=r.callbackNode;$x(r,i);var d=Si(r,r===Ft?Wt:0);if(d===0)l!==null&&St(l),r.callbackNode=null,r.callbackPriority=0;else if(i=d&-d,r.callbackPriority!==i){if(l!=null&&St(l),i===1)r.tag===0?zP(xy.bind(null,r)):lg(xy.bind(null,r)),UP(function(){(at&6)===0&&fa()}),l=null;else{switch(mm(d)){case 1:l=Ar;break;case 4:l=qn;break;case 16:l=nn;break;case 536870912:l=ta;break;default:l=nn}l=Ly(l,wy.bind(null,r))}r.callbackPriority=i,r.callbackNode=l}}function wy(r,i){if(Jl=-1,ec=0,(at&6)!==0)throw Error(n(327));var l=r.callbackNode;if(Gi()&&r.callbackNode!==l)return null;var d=Si(r,r===Ft?Wt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||i)i=tc(r,d);else{i=d;var p=at;at|=2;var g=Sy();(Ft!==r||Wt!==i)&&(Br=null,Ki=rt()+500,Za(r,i));do try{cS();break}catch(E){Py(r,E)}while(!0);bd(),ql.current=g,at=p,At!==null?i=0:(Ft=null,Wt=0,i=It)}if(i!==0){if(i===2&&(p=ju(r),p!==0&&(d=p,i=ah(r,p))),i===1)throw l=is,Za(r,0),_a(r,d),gn(r,rt()),l;if(i===6)_a(r,d);else{if(p=r.current.alternate,(d&30)===0&&!sS(p)&&(i=tc(r,d),i===2&&(g=ju(r),g!==0&&(d=g,i=ah(r,g))),i===1))throw l=is,Za(r,0),_a(r,d),gn(r,rt()),l;switch(r.finishedWork=p,r.finishedLanes=d,i){case 0:case 1:throw Error(n(345));case 2:Xa(r,mn,Br);break;case 3:if(_a(r,d),(d&130023424)===d&&(i=th+500-rt(),10<i)){if(Si(r,0)!==0)break;if(p=r.suspendedLanes,(p&d)!==d){on(),r.pingedLanes|=r.suspendedLanes&p;break}r.timeoutHandle=ud(Xa.bind(null,r,mn,Br),i);break}Xa(r,mn,Br);break;case 4:if(_a(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*oS(d/1960))-d,10<d){r.timeoutHandle=ud(Xa.bind(null,r,mn,Br),d);break}Xa(r,mn,Br);break;case 5:Xa(r,mn,Br);break;default:throw Error(n(329))}}}return gn(r,rt()),r.callbackNode===l?wy.bind(null,r):null}function ah(r,i){var l=os;return r.current.memoizedState.isDehydrated&&(Za(r,i).flags|=256),r=tc(r,i),r!==2&&(i=mn,mn=l,i!==null&&ih(i)),r}function ih(r){mn===null?mn=r:mn.push.apply(mn,r)}function sS(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 _a(r,i){for(i&=~eh,i&=~Yl,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 xy(r){if((at&6)!==0)throw Error(n(327));Gi();var i=Si(r,0);if((i&1)===0)return gn(r,rt()),null;var l=tc(r,i);if(r.tag!==0&&l===2){var d=ju(r);d!==0&&(i=d,l=ah(r,d))}if(l===1)throw l=is,Za(r,0),_a(r,i),gn(r,rt()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Xa(r,mn,Br),gn(r,rt()),null}function oh(r,i){var l=at;at|=1;try{return r(i)}finally{at=l,at===0&&(Ki=rt()+500,El&&fa())}}function Ya(r){va!==null&&va.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&&fa()}}function sh(){bn=Wi.current,gt(Wi)}function Za(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,jP(l)),At!==null)for(l=At.return;l!==null;){var d=l;switch(gd(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Cl();break;case 3:zi(),gt(hn),gt(qt),Ad();break;case 5:Td(d);break;case 4:zi();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:wd(d.type._context);break;case 22:case 23:sh()}l=l.return}if(Ft=r,At=r=ba(r.current,null),Wt=bn=i,It=0,is=null,eh=Yl=qa=0,mn=os=null,Wa!==null){for(i=0;i<Wa.length;i++)if(l=Wa[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}Wa=null}return r}function Py(r,i){do{var l=At;try{if(bd(),Ul.current=zl,Bl){for(var d=wt.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}Bl=!1}if(Ga=0,Bt=Mt=wt=null,Jo=!1,es=0,Jd.current=null,l===null||l.return===null){It=1,is=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 $=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=Yg(_);if(de!==null){de.flags&=-257,Zg(de,_,E,g,i),de.mode&1&&qg(g,$,i),i=de,M=$;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){qg(g,$,i),lh();break e}M=Error(n(426))}}else if(kt&&E.mode&1){var Ct=Yg(_);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),Zg(Ct,_,E,g,i),kd($i(M,E));break e}}g=M=$i(M,E),It!==4&&(It=2),os===null?os=[g]:os.push(g),g=_;do{switch(g.tag){case 3:g.flags|=65536,i&=-i,g.lanes|=i;var B=Kg(g,M,i);kg(g,B);break e;case 1:E=M;var j=g.type,F=g.stateNode;if((g.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ya===null||!ya.has(F)))){g.flags|=65536,i&=-i,g.lanes|=i;var oe=Gg(g,E,i);kg(g,oe);break e}}g=g.return}while(g!==null)}Ty(l)}catch(Se){i=Se,At===l&&l!==null&&(At=l=l.return);continue}break}while(!0)}function Sy(){var r=ql.current;return ql.current=zl,r===null?zl:r}function lh(){(It===0||It===3||It===2)&&(It=4),Ft===null||(qa&268435455)===0&&(Yl&268435455)===0||_a(Ft,Wt)}function tc(r,i){var l=at;at|=2;var d=Sy();(Ft!==r||Wt!==i)&&(Br=null,Za(r,i));do try{lS();break}catch(p){Py(r,p)}while(!0);if(bd(),at=l,ql.current=d,At!==null)throw Error(n(261));return Ft=null,Wt=0,It}function lS(){for(;At!==null;)Cy(At)}function cS(){for(;At!==null&&!$t();)Cy(At)}function Cy(r){var i=Ry(r.alternate,r,bn);r.memoizedProps=r.pendingProps,i===null?Ty(r):At=i,Jd.current=null}function Ty(r){var i=r;do{var l=i.alternate;if(r=i.return,(i.flags&32768)===0){if(l=tS(l,i,bn),l!==null){At=l;return}}else{if(l=nS(l,i),l!==null){l.flags&=32767,At=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{It=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=r}while(i!==null);It===0&&(It=5)}function Xa(r,i,l){var d=ct,p=Dn.transition;try{Dn.transition=null,ct=1,uS(r,i,l,d)}finally{Dn.transition=p,ct=d}return null}function uS(r,i,l,d){do Gi();while(va!==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(Hx(r,g),r===Ft&&(At=Ft=null,Wt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Xl||(Xl=!0,Ly(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,Jd.current=null,aS(r,l),yy(l,r),RP(ld),hl=!!sd,ld=sd=null,r.current=l,iS(l),lt(),at=E,ct=_,Dn.transition=g}else r.current=l;if(Xl&&(Xl=!1,va=r,Ql=p),g=r.pendingLanes,g===0&&(ya=null),Pi(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(Zl)throw Zl=!1,r=nh,nh=null,r;return(Ql&1)!==0&&r.tag!==0&&Gi(),g=r.pendingLanes,(g&1)!==0?r===rh?ss++:(ss=0,rh=r):ss=0,fa(),null}function Gi(){if(va!==null){var r=mm(Ql),i=Dn.transition,l=ct;try{if(Dn.transition=null,ct=16>r?16:r,va===null)var d=!1;else{if(r=va,va=null,Ql=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 $=E[M];for(ge=$;ge!==null;){var ee=ge;switch(ee.tag){case 0:case 11:case 15:as(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(hy(ee),ee===$){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 Ct=we.sibling;we.sibling=null,we=Ct}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:as(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,ge=B;break e}ge=g.return}}var j=r.current;for(ge=j;ge!==null;){_=ge;var F=_.child;if((_.subtreeFlags&2064)!==0&&F!==null)F.return=_,ge=F;else e:for(_=j;ge!==null;){if(E=ge,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Gl(9,E)}}catch(Se){xt(E,E.return,Se)}if(E===_){ge=null;break e}var oe=E.sibling;if(oe!==null){oe.return=E.return,ge=oe;break e}ge=E.return}}if(at=p,fa(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Tn,r)}catch{}d=!0}return d}finally{ct=l,Dn.transition=i}}return!1}function Ey(r,i,l){i=$i(l,i),i=Kg(r,i,1),r=ma(r,i,1),i=on(),r!==null&&(Lo(r,1,i),gn(r,i))}function xt(r,i,l){if(r.tag===3)Ey(r,r,l);else for(;i!==null;){if(i.tag===3){Ey(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ya===null||!ya.has(d))){r=$i(l,r),r=Gg(i,r,1),i=ma(i,r,1),r=on(),i!==null&&(Lo(i,1,r),gn(i,r));break}}i=i.return}}function dS(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),i=on(),r.pingedLanes|=r.suspendedLanes&l,Ft===r&&(Wt&l)===l&&(It===4||It===3&&(Wt&130023424)===Wt&&500>rt()-th?Za(r,0):eh|=l),gn(r,i)}function Ay(r,i){i===0&&((r.mode&1)===0?i=1:(i=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var l=on();r=Or(r,i),r!==null&&(Lo(r,i,l),gn(r,l))}function hS(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Ay(r,l)}function fS(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),Ay(r,l)}var Ry;Ry=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,eS(r,i,l);pn=(r.flags&131072)!==0}else pn=!1,kt&&(i.flags&1048576)!==0&&cg(i,Rl,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Wl(r,i),r=i.pendingProps;var p=Ni(i,qt.current);Vi(i,l),p=Dd(null,i,d,r,p,l);var g=Md();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,Tl(i)):g=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Sd(i),p.updater=$l,i.stateNode=p,p._reactInternals=i,Bd(i,d,r,l),i=$d(null,i,d,!0,g,l)):(i.tag=0,kt&&g&&md(i),an(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Wl(r,i),r=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=mS(d),r=Xn(d,r),p){case 0:i=zd(null,i,d,r,l);break e;case 1:i=ny(null,i,d,r,l);break e;case 11:i=Xg(null,i,d,r,l);break e;case 14:i=Qg(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),zd(r,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),ny(r,i,d,p,l);case 3:e:{if(ry(i),r===null)throw Error(n(387));d=i.pendingProps,g=i.memoizedState,p=g.element,vg(r,i),Ol(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=ay(r,i,d,l,p);break e}else if(d!==p){p=$i(Error(n(424)),i),i=ay(r,i,d,l,p);break e}else for(_n=ua(i.stateNode.containerInfo.firstChild),kn=i,kt=!0,Zn=null,l=gg(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&&vd(i),d=i.type,p=i.pendingProps,g=r!==null?r.memoizedProps:null,_=p.children,cd(d,p)?_=null:g!==null&&cd(d,g)&&(i.flags|=32),ty(r,i),an(r,i,_,l),i.child;case 6:return r===null&&vd(i),null;case 13:return iy(r,i,l);case 4:return Cd(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),Xg(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(Ml,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 $=g.updateQueue;if($!==null){$=$.shared;var ee=$.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),$.pending=M}}g.lanes|=l,M=g.alternate,M!==null&&(M.lanes|=l),xd(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),xd(_,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),Qg(r,i,d,p,l);case 15:return Jg(r,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Wl(r,i),i.tag=1,fn(d)?(r=!0,Tl(i)):r=!1,Vi(i,l),Hg(i,d,p),Bd(i,d,p,l),$d(null,i,d,!0,r,l);case 19:return sy(r,i,l);case 22:return ey(r,i,l)}throw Error(n(156,i.tag))};function Ly(r,i){return ht(r,i)}function pS(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 pS(r,i,l,d)}function ch(r){return r=r.prototype,!(!r||!r.isReactComponent)}function mS(r){if(typeof r=="function")return ch(r)?1:0;if(r!=null){if(r=r.$$typeof,r===se)return 11;if(r===le)return 14}return 2}function ba(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 nc(r,i,l,d,p,g){var _=2;if(d=r,typeof r=="function")ch(r)&&(_=1);else if(typeof r=="string")_=5;else e:switch(r){case z:return Qa(l.children,p,g,i);case P:_=8,p|=8;break;case Y:return r=Mn(12,l,i,p|2),r.elementType=Y,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 Ne:return rc(l,p,g,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:_=10;break e;case ue:_=9;break e;case se:_=11;break e;case le:_=14;break e;case pe:_=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 Qa(r,i,l,d){return r=Mn(7,r,d,i),r.lanes=l,r}function rc(r,i,l,d){return r=Mn(22,r,d,i),r.elementType=Ne,r.lanes=l,r.stateNode={isHidden:!1},r}function uh(r,i,l){return r=Mn(6,r,null,i),r.lanes=l,r}function dh(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 gS(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=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function hh(r,i,l,d,p,g,_,E,M){return r=new gS(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},Sd(g),r}function yS(r,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:d==null?null:""+d,children:r,containerInfo:i,implementation:l}}function Dy(r){if(!r)return ha;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 og(r,l,i)}return i}function My(r,i,l,d,p,g,_,E,M){return r=hh(l,d,!0,r,p,g,_,E,M),r.context=Dy(null),l=r.current,d=on(),p=ka(l),g=jr(d,p),g.callback=i??null,ma(l,g,p),r.current.lanes=p,Lo(r,p,d),gn(r,d),r}function ac(r,i,l,d){var p=i.current,g=on(),_=ka(p);return l=Dy(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=ma(p,i,_),r!==null&&(er(r,p,_,g),Nl(r,p,_)),_}function ic(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Iy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function fh(r,i){Iy(r,i),(r=r.alternate)&&Iy(r,i)}function vS(){return null}var Ny=typeof reportError=="function"?reportError:function(r){console.error(r)};function ph(r){this._internalRoot=r}oc.prototype.render=ph.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));ac(r,i,null,null)},oc.prototype.unmount=ph.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Ya(function(){ac(null,r,null,null)}),i[Dr]=null}};function oc(r){this._internalRoot=r}oc.prototype.unstable_scheduleHydration=function(r){if(r){var i=vm();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 mh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function sc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Oy(){}function kS(r,i,l,d,p){if(p){if(typeof d=="function"){var g=d;d=function(){var $=ic(_);g.call($)}}var _=My(i,d,r,0,null,!1,!1,"",Oy);return r._reactRootContainer=_,r[Dr]=_.current,Wo(r.nodeType===8?r.parentNode:r),Ya(),_}for(;p=r.lastChild;)r.removeChild(p);if(typeof d=="function"){var E=d;d=function(){var $=ic(M);E.call($)}}var M=hh(r,0,!1,null,null,!1,!1,"",Oy);return r._reactRootContainer=M,r[Dr]=M.current,Wo(r.nodeType===8?r.parentNode:r),Ya(function(){ac(i,M,l,d)}),M}function lc(r,i,l,d,p){var g=l._reactRootContainer;if(g){var _=g;if(typeof p=="function"){var E=p;p=function(){var M=ic(_);E.call(M)}}ac(i,_,r,p)}else _=kS(l,i,r,p,d);return ic(_)}gm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var l=ra(i.pendingLanes);l!==0&&(Bu(i,l|1),gn(i,rt()),(at&6)===0&&(Ki=rt()+500,fa()))}break;case 13:Ya(function(){var d=Or(r,1);if(d!==null){var p=on();er(d,r,1,p)}}),fh(r,1)}},Fu=function(r){if(r.tag===13){var i=Or(r,134217728);if(i!==null){var l=on();er(i,r,134217728,l)}fh(r,134217728)}},ym=function(r){if(r.tag===13){var i=ka(r),l=Or(r,i);if(l!==null){var d=on();er(l,r,i,d)}fh(r,i)}},vm=function(){return ct},km=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=Sl(d);if(!p)throw Error(n(90));Cr(d),Wn(d,p)}}}break;case"textarea":ol(r,l);break;case"select":i=l.value,i!=null&&Yr(r,!!l.multiple,i,!1)}},cl=oh,Eo=Ya;var _S={usingClientEntryPoint:!1,Events:[qo,Mi,Sl,ll,To,oh]},ls={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bS={bundleType:ls.bundleType,version:ls.version,rendererPackageName:ls.rendererPackageName,rendererConfig:ls.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ot(r),r===null?null:r.stateNode},findFiberByHostInstance:ls.findFiberByHostInstance||vS,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 cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cc.isDisabled&&cc.supportsFiber)try{Tn=cc.inject(bS),rn=cc}catch{}}return yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_S,yn.createPortal=function(r,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mh(i))throw Error(n(200));return yS(r,i,null,l)},yn.createRoot=function(r,i){if(!mh(r))throw Error(n(299));var l=!1,d="",p=Ny;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=hh(r,1,!1,null,null,l,!1,d,p),r[Dr]=i.current,Wo(r.nodeType===8?r.parentNode:r),new ph(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=ot(i),r=r===null?null:r.stateNode,r},yn.flushSync=function(r){return Ya(r)},yn.hydrate=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!0,l)},yn.hydrateRoot=function(r,i,l){if(!mh(r))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,p=!1,g="",_=Ny;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=My(i,null,r,1,l??null,p,!1,g,_),r[Dr]=i.current,Wo(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 oc(i)},yn.render=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!1,l)},yn.unmountComponentAtNode=function(r){if(!sc(r))throw Error(n(40));return r._reactRootContainer?(Ya(function(){lc(null,null,r,!1,function(){r._reactRootContainer=null,r[Dr]=null})}),!0):!1},yn.unstable_batchedUpdates=oh,yn.unstable_renderSubtreeIntoContainer=function(r,i,l,d){if(!sc(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return lc(r,i,l,!1,d)},yn.version="18.3.1-next-f1338f8080-20240426",yn}var Hy;function D_(){if(Hy)return vh.exports;Hy=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(),vh.exports=LS(),vh.exports}var Wy;function DS(){if(Wy)return uc;Wy=1;var e=D_();return uc.createRoot=e.createRoot,uc.hydrateRoot=e.hydrateRoot,uc}var MS=DS();var M_=e=>{throw TypeError(e)},IS=(e,t,n)=>t.has(e)||M_("Cannot "+n),bh=(e,t,n)=>(IS(e,t,"read from private field"),n?n.call(e):t.get(e)),NS=(e,t,n)=>t.has(e)?M_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ky="popstate";function Gy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function OS(e={}){function t(a,o){let s=o.state?.masked,{pathname:c,search:u,hash:h}=s||a.location;return Ls("",{pathname:c,search:u,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,o){return typeof o=="string"?o:kr(o)}return US(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 jS(){return Math.random().toString(36).substring(2,10)}function qy(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 Ls(e,t,n=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Kr(t):t,state:n,key:t&&t.key||a||jS(),unstable_mask:o}}function kr({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 Kr(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 US(e,t,n,a={}){let{window:o=document.defaultView,v5Compat:s=!1}=a,c=o.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 S=m(),D=S==null?null:S-f;f=S,h&&h({action:u,location:C.location,delta:D})}function k(S,D){u="PUSH";let L=Gy(S)?S:Ls(C.location,S,D);f=m()+1;let R=qy(L,f),O=C.createHref(L.unstable_mask||L);try{c.pushState(R,"",O)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;o.location.assign(O)}s&&h&&h({action:u,location:C.location,delta:1})}function w(S,D){u="REPLACE";let L=Gy(S)?S:Ls(C.location,S,D);f=m();let R=qy(L,f),O=C.createHref(L.unstable_mask||L);c.replaceState(R,"",O),s&&h&&h({action:u,location:C.location,delta:0})}function x(S){return I_(S)}let C={get action(){return u},get location(){return e(o,c)},listen(S){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Ky,y),h=S,()=>{o.removeEventListener(Ky,y),h=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let D=x(S);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:k,replace:w,go(S){return c.go(S)}};return C}function I_(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:kr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var gs,Yy=class{constructor(e){if(NS(this,gs,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bh(this,gs).has(e))return bh(this,gs).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bh(this,gs).set(e,t)}};gs=new WeakMap;var BS=new Set(["lazy","caseSensitive","path","id","index","children"]);function FS(e){return BS.has(e)}var VS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zS(e){return VS.has(e)}function $S(e){return e.index===!0}function Ds(e,t,n=[],a={},o=!1){return e.map((s,c)=>{let u=[...n,String(c)],h=typeof s.id=="string"?s.id:u.join("-");if(Xe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Xe(o||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),$S(s)){let f={...s,id:h};return a[h]=Zy(f,t(f)),f}else{let f={...s,id:h,children:void 0};return a[h]=Zy(f,t(f)),s.children&&(f.children=Ds(s.children,t,u,a,o)),f}})}function Zy(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 ys(e,t,n,!1)}function ys(e,t,n,a){let o=typeof t=="string"?Kr(t):t,s=Un(o.pathname||"/",n);if(s==null)return null;let c=N_(e);WS(c);let u=null;for(let h=0;u==null&&h<c.length;++h){let f=nC(s);u=eC(c[h],f,a)}return u}function HS(e,t){let{route:n,pathname:a,params:o}=e;return{id:n.id,pathname:a,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N_(e,t=[],n=[],a="",o=!1){let s=(c,u,h=o,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]),k=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}".`),N_(c.children,t,k,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:QS(y,c.index),routesMeta:k})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))s(c,u);else for(let h of O_(c.path))s(c,u,!0,h)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return o?[s,""]:[s];let c=O_(a.join("/")),u=[];return u.push(...c.map(h=>h===""?s:[s,h].join("/"))),o&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function WS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:JS(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var KS=/^:[\w-]+$/,GS=3,qS=2,YS=1,ZS=10,XS=-2,Xy=e=>e==="*";function QS(e,t){let n=e.split("/"),a=n.length;return n.some(Xy)&&(a+=XS),t&&(a+=qS),n.filter(o=>!Xy(o)).reduce((o,s)=>o+(KS.test(s)?GS:s===""?YS:ZS),a)}function JS(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function eC(e,t,n=!1){let{routesMeta:a}=e,o={},s="/",c=[];for(let u=0;u<a.length;++u){let h=a[u],f=u===a.length-1,m=s==="/"?t:t.slice(s.length)||"/",y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),k=h.route;if(!y&&f&&n&&!a[a.length-1].route.index&&(y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:ir([s,y.pathname]),pathnameBase:iC(ir([s,y.pathnameBase])),route:k}),y.pathnameBase!=="/"&&(s=ir([s,y.pathnameBase]))}return c}function Kc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=tC(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:a.reduce((f,{paramName:m,isOptional:y},k)=>{if(m==="*"){let x=u[k]||"";c=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const w=u[k];return y&&!w?f[m]=void 0:f[m]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:c,pattern:e}}function tC(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=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function nC(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 rC({basename:e,pathname:t}){return t==="/"?e:ir([e,t])}var j_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jf=e=>j_.test(e);function aC(e,t="/"){let{pathname:n,search:a="",hash:o=""}=typeof e=="string"?Kr(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=Qy(n.substring(1),"/"):s=Qy(n,t)):s=t,{pathname:s,search:oC(a),hash:sC(o)}}function Qy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function wh(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 U_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ep(e){let t=U_(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function _u(e,t,n,a=!1){let o;typeof e=="string"?o=Kr(e):(o={...e},Xe(!o.pathname||!o.pathname.includes("?"),wh("?","pathname","search",o)),Xe(!o.pathname||!o.pathname.includes("#"),wh("#","pathname","hash",o)),Xe(!o.search||!o.search.includes("#"),wh("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let k=c.split("/");for(;k[0]==="..";)k.shift(),y-=1;o.pathname=k.join("/")}u=y>=0?t[y]:"/"}let h=aC(o,u),f=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var ir=e=>e.join("/").replace(/\/\/+/g,"/"),iC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),oC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Vs=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 Ms(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zs(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(e,t){let n=e;if(typeof n!="string"||!j_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,o=!1;if(B_)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=Un(c.pathname,t);c.origin===s.origin&&u!=null?n=u+c.search+c.hash:o=!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:o,to:n}}var Ra=Symbol("Uninstrumented");function lC(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let u of c)s[u]&&n[u].push(s[u])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=no(n.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(s=>{let c=o[s],u=n[`lazy.${s}`];if(typeof c=="function"&&u.length>0){let h=no(u,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[s]:h}))}})}return["loader","action"].forEach(o=>{let s=t[o];if(typeof s=="function"&&n[o].length>0){let c=s[Ra]??s,u=no(n[o],c,(...h)=>Jy(h[0]));u&&(o==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Ra]=c,a[o]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let s=o[Ra]??o,c=no(n.middleware,s,(...u)=>Jy(u[0]));return c?(c[Ra]=s,c):o})),a}function cC(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let s=Object.keys(o);for(let c of s)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let a=e.navigate[Ra]??e.navigate,o=no(n.navigate,a,(...s)=>{let[c,u]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?kr(c):".",...ev(e,u??{})}});o&&(o[Ra]=a,e.navigate=o)}if(n.fetch.length>0){let a=e.fetch[Ra]??e.fetch,o=no(n.fetch,a,(...s)=>{let[c,,u,h]=s;return{href:u??".",fetcherKey:c,...ev(e,h??{})}});o&&(o[Ra]=a,e.fetch=o)}return e}function no(e,t,n){return e.length===0?null:async(...a)=>{let o=await V_(e,n(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function V_(e,t,n,a){let o=e[a],s;if(o){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=V_(e,t,n,a-1),s=await c,Xe(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await o(u,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await u(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Jy(e){let{request:t,context:n,params:a,unstable_pattern:o}=e;return{request:uC(t),params:{...a},unstable_pattern:o,context:dC(n)}}function ev(e,t){return{currentUrl:kr(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 uC(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function dC(e){if(fC(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var hC=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fC(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")===hC}var z_=["POST","PUT","PATCH","DELETE"],pC=new Set(z_),mC=["GET",...z_],gC=new Set(mC),$_=new Set([301,302,303,307,308]),yC=new Set([307,308]),xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},us={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},kC=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),H_="remix-router-transitions",W_=Symbol("ResetLoaderData");function _C(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||[],o=e.mapRouteProperties||kC,s=o;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;s=U=>({...o(U),...lC(A.map(V=>V.route).filter(Boolean),U)})}let c={},u=Ds(e.routes,s,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||SC,y={...e.future},k=null,w=new Set,x=null,C=null,S=null,D=e.hydrationData!=null,L=Ta(u,e.history.location,f),R=!1,O=null,G,W;if(L==null&&!e.patchRoutesOnNavigation){let A=In(404,{pathname:e.history.location.pathname}),{matches:U,route:V}=dc(u);G=!0,W=!G,L=U,O={[V.id]:A}}else if(L&&!e.hydrationData&&Jr(L,u,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))G=!1,W=!G;else if(!L.some(A=>tp(A.route)))G=!0,W=!G;else{let A=e.hydrationData?e.hydrationData.loaderData:null,U=e.hydrationData?e.hydrationData.errors:null,V=L;if(U){let te=L.findIndex(ae=>U[ae.route.id]!==void 0);V=V.slice(0,te+1)}W=!1,G=V.every(te=>{let ae=K_(te.route,A,U);return W=W||ae.renderFallback,!ae.shouldLoad})}else{G=!1,W=!G,L=[];let A=Jr(null,u,e.history.location.pathname);A.active&&A.matches&&(R=!0,L=A.matches)}let z,P={historyAction:e.history.action,location:e.history.location,matches:L,initialized:G,renderFallback:W,navigation:xh,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||O,fetchers:new Map,blockers:new Map},Y="POP",X=null,ue=!1,se,Ae=!1,fe=new Map,le=null,pe=!1,Ne=!1,K=new Set,Z=new Map,H=0,I=-1,q=new Map,xe=new Set,Re=new Map,Pe=new Map,Te=new Set,Ge=new Map,Qe,Ue=null;function jt(){if(k=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=Tr({currentLocation:P.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(P.blockers);Ee.set(te,us),pt({blockers:Ee})}}),X?.resolve(),X=null;return}return Wn(A,U)}),n){$C(t,fe);let A=()=>HC(t,fe);t.addEventListener("pagehide",A),le=()=>t.removeEventListener("pagehide",A)}return P.initialized||Wn("POP",P.location,{initialHydration:!0}),z}function Hn(){k&&k(),le&&le(),w.clear(),se&&se.abort(),P.fetchers.forEach((A,U)=>vi(U)),P.blockers.forEach((A,U)=>wi(U))}function Cr(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],me=ae.route;return me.element!==Ee.element||me.errorElement!==Ee.errorElement||me.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ae,route:Ee}:ae})),P={...P,...A};let V=[],te=[];P.fetchers.forEach((ae,Ee)=>{ae.state==="idle"&&(Te.has(Ee)?V.push(Ee):te.push(Ee))}),Te.forEach(ae=>{!P.fetchers.has(ae)&&!Z.has(ae)&&V.push(ae)}),[...w].forEach(ae=>ae(P,{deletedFetchers:V,newErrors:A.errors??null,viewTransitionOpts:U.viewTransitionOpts,flushSync:U.flushSync===!0})),V.forEach(ae=>vi(ae)),te.forEach(ae=>P.fetchers.delete(ae))}function en(A,U,{flushSync:V}={}){let te=P.actionData!=null&&P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&P.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;U.actionData?Object.keys(U.actionData).length>0?ae=U.actionData:ae=null:te?ae=P.actionData:ae=null;let Ee=U.loaderData?uv(P.loaderData,U.loaderData,U.matches||[],U.errors):P.loaderData,me=P.blockers;me.size>0&&(me=new Map(me),me.forEach((Ie,Le)=>me.set(Le,us)));let De=pe?!1:Eo(A,U.matches||P.matches),he=ue===!0||P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&A.state?._isRedirect!==!0;h&&(u=h,h=void 0),pe||Y==="POP"||(Y==="PUSH"?e.history.push(A,A.state):Y==="REPLACE"&&e.history.replace(A,A.state));let Me;if(Y==="POP"){let Ie=fe.get(P.location.pathname);Ie&&Ie.has(A.pathname)?Me={currentLocation:P.location,nextLocation:A}:fe.has(A.pathname)&&(Me={currentLocation:A,nextLocation:P.location})}else if(Ae){let Ie=fe.get(P.location.pathname);Ie?Ie.add(A.pathname):(Ie=new Set([A.pathname]),fe.set(P.location.pathname,Ie)),Me={currentLocation:P.location,nextLocation:A}}pt({...U,actionData:ae,loaderData:Ee,historyAction:Y,location:A,initialized:!0,renderFallback:!1,navigation:xh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:he,blockers:me},{viewTransitionOpts:Me,flushSync:V===!0}),Y="POP",ue=!1,Ae=!1,pe=!1,Ne=!1,X?.resolve(),X=null,Ue?.resolve(),Ue=null}async function xo(A,U){if(X?.resolve(),X=null,typeof A=="number"){X||(X=pv());let ht=X.promise;return e.history.go(A),ht}let V=nf(P.location,P.matches,f,A,U?.fromRouteId,U?.relative),{path:te,submission:ae,error:Ee}=tv(!1,V,U),me;U?.unstable_mask&&(me={pathname:"",search:"",hash:"",...typeof U.unstable_mask=="string"?Kr(U.unstable_mask):{...P.location.unstable_mask,...U.unstable_mask}});let De=P.location,he=Ls(De,te,U&&U.state,void 0,me);he={...he,...e.history.encodeLocation(he)};let Me=U&&U.replace!=null?U.replace:void 0,Ie="PUSH";Me===!0?Ie="REPLACE":Me===!1||ae!=null&&Qt(ae.formMethod)&&ae.formAction===P.location.pathname+P.location.search&&(Ie="REPLACE");let Le=U&&"preventScrollReset"in U?U.preventScrollReset===!0:void 0,ot=(U&&U.flushSync)===!0,et=Tr({currentLocation:De,nextLocation:he,historyAction:Ie});if(et){Gn(et,{state:"blocked",location:he,proceed(){Gn(et,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),xo(A,U)},reset(){let ht=new Map(P.blockers);ht.set(et,us),pt({blockers:ht})}});return}await Wn(Ie,he,{submission:ae,pendingError:Ee,preventScrollReset:Le,replace:U&&U.replace,enableViewTransition:U&&U.viewTransition,flushSync:ot,callSiteDefaultShouldRevalidate:U&&U.unstable_defaultShouldRevalidate})}function rl(){Ue||(Ue=pv()),Xr(),pt({revalidation:"loading"});let A=Ue.promise;return P.navigation.state==="submitting"?A:P.navigation.state==="idle"?(Wn(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),A):(Wn(Y||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:Ae===!0}),A)}async function Wn(A,U,V){se&&se.abort(),se=null,Y=A,pe=(V&&V.startUninterruptedRevalidation)===!0,cl(P.location,P.matches),ue=(V&&V.preventScrollReset)===!0,Ae=(V&&V.enableViewTransition)===!0;let te=h||u,ae=V&&V.overrideNavigation,Ee=V?.initialHydration&&P.matches&&P.matches.length>0&&!R?P.matches:Ta(te,U,f),me=(V&&V.flushSync)===!0;if(Ee&&P.initialized&&!Ne&&MC(P.location,U)&&!(V&&V.submission&&Qt(V.submission.formMethod))){en(U,{matches:Ee},{flushSync:me});return}let De=Jr(Ee,te,U.pathname);if(De.active&&De.matches&&(Ee=De.matches),!Ee){let{error:St,notFoundMatches:$t,route:lt}=xi(U.pathname);en(U,{matches:$t,loaderData:{},errors:{[lt.id]:St}},{flushSync:me});return}se=new AbortController;let he=Ji(e.history,U,se.signal,V&&V.submission),Me=e.getContext?await e.getContext():new Yy,Ie;if(V&&V.pendingError)Ie=[Ea(Ee).route.id,{type:"error",error:V.pendingError}];else if(V&&V.submission&&Qt(V.submission.formMethod)){let St=await al(he,U,V.submission,Ee,Me,De.active,V&&V.initialHydration===!0,{replace:V.replace,flushSync:me});if(St.shortCircuited)return;if(St.pendingActionResult){let[$t,lt]=St.pendingActionResult;if(xn(lt)&&Ms(lt.error)&&lt.error.status===404){se=null,en(U,{matches:St.matches,loaderData:{},errors:{[$t]:lt.error}});return}}Ee=St.matches||Ee,Ie=St.pendingActionResult,ae=Ph(U,V.submission),me=!1,De.active=!1,he=Ji(e.history,he.url,he.signal)}let{shortCircuited:Le,matches:ot,loaderData:et,errors:ht}=await Po(he,U,Ee,Me,De.active,ae,V&&V.submission,V&&V.fetcherSubmission,V&&V.replace,V&&V.initialHydration===!0,me,Ie,V&&V.callSiteDefaultShouldRevalidate);Le||(se=null,en(U,{matches:ot||Ee,...dv(Ie),loaderData:et,errors:ht}))}async function al(A,U,V,te,ae,Ee,me,De={}){Xr();let he=VC(U,V);if(pt({navigation:he},{flushSync:De.flushSync===!0}),Ee){let Le=await Ba(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}=dc(u);return{matches:et,pendingActionResult:[ht.id,{type:"error",error:Le.error}]}}let ot=Ea(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[ot,{type:"error",error:Le.error}]}}else if(Le.matches)te=Le.matches;else{let{notFoundMatches:ot,error:et,route:ht}=xi(U.pathname);return{matches:ot,pendingActionResult:[ht.id,{type:"error",error:et}]}}}let Me,Ie=Tc(te,U);if(!Ie.route.action&&!Ie.route.lazy)Me={type:"error",error:In(405,{method:A.method,pathname:U.pathname,routeId:Ie.route.id})};else{let Le=so(s,c,A,te,Ie,me?[]:a,ae),ot=await Zr(A,Le,ae,null);if(Me=ot[Ie.route.id],!Me){for(let et of te)if(ot[et.route.id]){Me=ot[et.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ni(Me)){let Le;return De&&De.replace!=null?Le=De.replace:Le=sv(Me.response.headers.get("Location"),new URL(A.url),f,e.history)===P.location.pathname+P.location.search,await lr(A,Me,!0,{submission:V,replace:Le}),{shortCircuited:!0}}if(xn(Me)){let Le=Ea(te,Ie.route.id);return(De&&De.replace)!==!0&&(Y="PUSH"),{matches:te,pendingActionResult:[Le.route.id,Me,Ie.route.id]}}return{matches:te,pendingActionResult:[Ie.route.id,Me]}}async function Po(A,U,V,te,ae,Ee,me,De,he,Me,Ie,Le,ot){let et=Ee||Ph(U,me),ht=me||De||fv(et),St=!pe&&!Me;if(ae){if(St){let Ut=qr(Le);pt({navigation:et,...Ut!==void 0?{actionData:Ut}:{}},{flushSync:Ie})}let He=await Ba(V,U.pathname,A.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:na,route:Rr}=dc(u);return{matches:na,loaderData:{},errors:{[Rr.id]:He.error}}}let Ut=Ea(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:na,route:Rr}=xi(U.pathname);return{matches:na,loaderData:{},errors:{[Rr.id]:Ut}}}}let $t=h||u,{dsMatches:lt,revalidatingFetchers:rt}=nv(A,te,s,c,e.history,P,V,ht,U,Me?[]:a,Me===!0,Ne,K,Te,Re,xe,$t,f,e.patchRoutesOnNavigation!=null,Le,ot);if(I=++H,!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,...dv(Le),...He?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Ie}),{shortCircuited:!0}}if(St){let He={};if(!ae){He.navigation=et;let Ut=qr(Le);Ut!==void 0&&(He.actionData=Ut)}rt.length>0&&(He.fetchers=Yr(rt)),pt(He,{flushSync:Ie})}rt.forEach(He=>{Kn(He.key),He.controller&&Z.set(He.key,He.controller)});let Er=()=>rt.forEach(He=>Kn(He.key));se&&se.signal.addEventListener("abort",Er);let{loaderResults:Ar,fetcherResults:qn}=await yi(lt,rt,A,te);if(A.signal.aborted)return{shortCircuited:!0};se&&se.signal.removeEventListener("abort",Er),rt.forEach(He=>Z.delete(He.key));let nn=hc(Ar);if(nn)return await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};if(nn=hc(qn),nn)return xe.add(nn.key),await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Ro,errors:ta}=cv(P,V,Ar,Le,rt,qn);Me&&P.errors&&(ta={...P.errors,...ta});let Tn=_i(),rn=bi(I),Pi=Tn||rn||rt.length>0;return{matches:V,loaderData:Ro,errors:ta,...Pi?{fetchers:new Map(P.fetchers)}:{}}}function qr(A){if(A&&!xn(A[1]))return{[A[0]]:A[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function Yr(A){return A.forEach(U=>{let V=P.fetchers.get(U.key),te=ds(void 0,V?V.data:void 0);P.fetchers.set(U.key,te)}),new Map(P.fetchers)}async function So(A,U,V,te){Kn(A);let ae=(te&&te.flushSync)===!0,Ee=h||u,me=nf(P.location,P.matches,f,V,U,te?.relative),De=Ta(Ee,me,f),he=Jr(De,Ee,me);if(he.active&&he.matches&&(De=he.matches),!De){tn(A,U,In(404,{pathname:me}),{flushSync:ae});return}let{path:Me,submission:Ie,error:Le}=tv(!0,me,te);if(Le){tn(A,U,Le,{flushSync:ae});return}let ot=e.getContext?await e.getContext():new Yy,et=(te&&te.preventScrollReset)===!0;if(Ie&&Qt(Ie.formMethod)){await il(A,U,Me,De,ot,he.active,ae,et,Ie,te&&te.unstable_defaultShouldRevalidate);return}Re.set(A,{routeId:U,path:Me}),await ol(A,U,Me,De,ot,he.active,ae,et,Ie)}async function il(A,U,V,te,ae,Ee,me,De,he,Me){Xr(),Re.delete(A);let Ie=P.fetchers.get(A);Cn(A,zC(he,Ie),{flushSync:me});let Le=new AbortController,ot=Ji(e.history,V,Le.signal,he);if(Ee){let ut=await Ba(te,new URL(ot.url).pathname,ot.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){tn(A,U,ut.error,{flushSync:me});return}else if(ut.matches)te=ut.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let et=Tc(te,V);if(!et.route.action&&!et.route.lazy){let ut=In(405,{method:he.formMethod,pathname:V,routeId:U});tn(A,U,ut,{flushSync:me});return}Z.set(A,Le);let ht=H,St=so(s,c,ot,te,et,a,ae),$t=await Zr(ot,St,ae,A),lt=$t[et.route.id];if(!lt){for(let ut of St)if($t[ut.route.id]){lt=$t[ut.route.id];break}}if(ot.signal.aborted){Z.get(A)===Le&&Z.delete(A);return}if(Te.has(A)){if(ni(lt)||xn(lt)){Cn(A,Vr(void 0));return}}else{if(ni(lt))if(Z.delete(A),I>ht){Cn(A,Vr(void 0));return}else return xe.add(A),Cn(A,ds(he)),lr(ot,lt,!1,{fetcherSubmission:he,preventScrollReset:De});if(xn(lt)){tn(A,U,lt.error);return}}let rt=P.navigation.location||P.location,Er=Ji(e.history,rt,Le.signal),Ar=h||u,qn=P.navigation.state!=="idle"?Ta(Ar,P.navigation.location,f):P.matches;Xe(qn,"Didn't find any matches after fetcher action");let nn=++H;q.set(A,nn);let Ro=ds(he,lt.data);P.fetchers.set(A,Ro);let{dsMatches:ta,revalidatingFetchers:Tn}=nv(Er,ae,s,c,e.history,P,qn,he,rt,a,!1,Ne,K,Te,Re,xe,Ar,f,e.patchRoutesOnNavigation!=null,[et.route.id,lt],Me);Tn.filter(ut=>ut.key!==A).forEach(ut=>{let Lr=ut.key,ra=P.fetchers.get(Lr),Si=ds(void 0,ra?ra.data:void 0);P.fetchers.set(Lr,Si),Kn(Lr),ut.controller&&Z.set(Lr,ut.controller)}),pt({fetchers:new Map(P.fetchers)});let rn=()=>Tn.forEach(ut=>Kn(ut.key));Le.signal.addEventListener("abort",rn);let{loaderResults:Pi,fetcherResults:He}=await yi(ta,Tn,Er,ae);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",rn),q.delete(A),Z.delete(A),Tn.forEach(ut=>Z.delete(ut.key)),P.fetchers.has(A)){let ut=Vr(lt.data);P.fetchers.set(A,ut)}let Ut=hc(Pi);if(Ut)return lr(Er,Ut.result,!1,{preventScrollReset:De});if(Ut=hc(He),Ut)return xe.add(Ut.key),lr(Er,Ut.result,!1,{preventScrollReset:De});let{loaderData:na,errors:Rr}=cv(P,qn,Pi,void 0,Tn,He);bi(nn),P.navigation.state==="loading"&&nn>I?(Xe(Y,"Expected pending action"),se&&se.abort(),en(P.navigation.location,{matches:qn,loaderData:na,errors:Rr,fetchers:new Map(P.fetchers)})):(pt({errors:Rr,loaderData:uv(P.loaderData,na,qn,Rr),fetchers:new Map(P.fetchers)}),Ne=!1)}async function ol(A,U,V,te,ae,Ee,me,De,he){let Me=P.fetchers.get(A);Cn(A,ds(he,Me?Me.data:void 0),{flushSync:me});let Ie=new AbortController,Le=Ji(e.history,V,Ie.signal);if(Ee){let lt=await Ba(te,new URL(Le.url).pathname,Le.signal,A);if(lt.type==="aborted")return;if(lt.type==="error"){tn(A,U,lt.error,{flushSync:me});return}else if(lt.matches)te=lt.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let ot=Tc(te,V);Z.set(A,Ie);let et=H,ht=so(s,c,Le,te,ot,a,ae),$t=(await Zr(Le,ht,ae,A))[ot.route.id];if(Z.get(A)===Ie&&Z.delete(A),!Le.signal.aborted){if(Te.has(A)){Cn(A,Vr(void 0));return}if(ni($t))if(I>et){Cn(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}Cn(A,Vr($t.data))}}async function lr(A,U,V,{submission:te,fetcherSubmission:ae,preventScrollReset:Ee,replace:me}={}){V||(X?.resolve(),X=null),U.response.headers.has("X-Remix-Revalidate")&&(Ne=!0);let De=U.response.headers.get("Location");Xe(De,"Expected a Location header on the redirect Response"),De=sv(De,new URL(A.url),f,e.history);let he=Ls(P.location,De,{_isRedirect:!0});if(n){let ht=!1;if(U.response.headers.has("X-Remix-Reload-Document"))ht=!0;else if(Jf(De)){const St=I_(De,!0);ht=St.origin!==t.location.origin||Un(St.pathname,f)==null}if(ht){me?t.location.replace(De):t.location.assign(De);return}}se=null;let Me=me===!0||U.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ie,formAction:Le,formEncType:ot}=P.navigation;!te&&!ae&&Ie&&Le&&ot&&(te=fv(P.navigation));let et=te||ae;if(yC.has(U.response.status)&&et&&Qt(et.formMethod))await Wn(Me,he,{submission:{...et,formAction:De},preventScrollReset:Ee||ue,enableViewTransition:V?Ae:void 0});else{let ht=Ph(he,te);await Wn(Me,he,{overrideNavigation:ht,fetcherSubmission:ae,preventScrollReset:Ee||ue,enableViewTransition:V?Ae:void 0})}}async function Zr(A,U,V,te){let ae,Ee={};try{ae=await TC(m,A,U,te,V,!1)}catch(me){return U.filter(De=>De.shouldLoad).forEach(De=>{Ee[De.route.id]={type:"error",error:me}}),Ee}if(A.signal.aborted)return Ee;if(!Qt(A.method))for(let me of U){if(ae[me.route.id]?.type==="error")break;!ae.hasOwnProperty(me.route.id)&&!P.loaderData.hasOwnProperty(me.route.id)&&(!P.errors||!P.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(ae[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,De]of Object.entries(ae))if(jC(De)){let he=De.result;Ee[me]={type:"redirect",response:LC(he,A,me,U,f)}}else Ee[me]=await RC(De);return Ee}async function yi(A,U,V,te){let ae=Zr(V,A,te,null),Ee=Promise.all(U.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ie=(await Zr(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:Ie}}else return Promise.resolve({[he.key]:{type:"error",error:In(404,{pathname:he.path})}})})),me=await ae,De=(await Ee).reduce((he,Me)=>Object.assign(he,Me),{});return{loaderResults:me,fetcherResults:De}}function Xr(){Ne=!0,Re.forEach((A,U)=>{Z.has(U)&&K.add(U),Kn(U)})}function Cn(A,U,V={}){P.fetchers.set(A,U),pt({fetchers:new Map(P.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function tn(A,U,V,te={}){let ae=Ea(P.matches,U);vi(A),pt({errors:{[ae.route.id]:V},fetchers:new Map(P.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Qr(A){return Pe.set(A,(Pe.get(A)||0)+1),Te.has(A)&&Te.delete(A),P.fetchers.get(A)||vC}function Ou(A,U){Kn(A,U?.reason),Cn(A,Vr(null))}function vi(A){let U=P.fetchers.get(A);Z.has(A)&&!(U&&U.state==="loading"&&q.has(A))&&Kn(A),Re.delete(A),q.delete(A),xe.delete(A),Te.delete(A),K.delete(A),P.fetchers.delete(A)}function sl(A){let U=(Pe.get(A)||0)-1;U<=0?(Pe.delete(A),Te.add(A)):Pe.set(A,U),pt({fetchers:new Map(P.fetchers)})}function Kn(A,U){let V=Z.get(A);V&&(V.abort(U),Z.delete(A))}function ki(A){for(let U of A){let V=Qr(U),te=Vr(V.data);P.fetchers.set(U,te)}}function _i(){let A=[],U=!1;for(let V of xe){let te=P.fetchers.get(V);Xe(te,`Expected fetcher: ${V}`),te.state==="loading"&&(xe.delete(V),A.push(V),U=!0)}return ki(A),U}function bi(A){let U=[];for(let[V,te]of q)if(te<A){let ae=P.fetchers.get(V);Xe(ae,`Expected fetcher: ${V}`),ae.state==="loading"&&(Kn(V),q.delete(V),U.push(V))}return ki(U),U.length>0}function Co(A,U){let V=P.blockers.get(A)||us;return Ge.get(A)!==U&&Ge.set(A,U),V}function wi(A){P.blockers.delete(A),Ge.delete(A)}function Gn(A,U){let V=P.blockers.get(A)||us;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(P.blockers);te.set(A,U),pt({blockers:te})}function Tr({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],me=P.blockers.get(ae);if(!(me&&me.state==="proceeding")&&Ee({currentLocation:A,nextLocation:U,historyAction:V}))return ae}function xi(A){let U=In(404,{pathname:A}),V=h||u,{matches:te,route:ae}=dc(V);return{notFoundMatches:te,route:ae,error:U}}function ll(A,U,V){if(x=A,S=U,C=V||null,!D&&P.navigation===xh){D=!0;let te=Eo(P.location,P.matches);te!=null&&pt({restoreScrollPosition:te})}return()=>{x=null,S=null,C=null}}function To(A,U){return C&&C(A,U.map(te=>HS(te,P.loaderData)))||A.key}function cl(A,U){if(x&&S){let V=To(A,U);x[V]=S()}}function Eo(A,U){if(x){let V=To(A,U),te=x[V];if(typeof te=="number")return te}return null}function Jr(A,U,V){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:ys(U,V,f,!0)}}else return{active:!0,matches:ys(U,V,f,!0)||[]};return{active:!1,matches:null}}async function Ba(A,U,V,te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let Ee=h==null,me=h||u,De=c;try{await e.patchRoutesOnNavigation({signal:V,path:U,matches:ae,fetcherKey:te,patch:(Ie,Le)=>{V.aborted||rv(Ie,Le,me,De,s,!1)}})}catch(Ie){return{type:"error",error:Ie,partialMatches:ae}}finally{Ee&&!V.aborted&&(u=[...u])}if(V.aborted)return{type:"aborted"};let he=Ta(me,U,f),Me=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(Me=ys(me,U,f,!0),!(Me&&ae.length<Me.length&&ea(ae,Me.slice(0,ae.length))))return{type:"success",matches:he}}if(Me||(Me=ys(me,U,f,!0)),!Me||ea(ae,Me))return{type:"success",matches:null};ae=Me}}function ea(A,U){return A.length===U.length&&A.every((V,te)=>V.route.id===U[te].route.id)}function Ao(A){c={},h=Ds(A,s,void 0,c)}function Fa(A,U,V=!1){let te=h==null;rv(A,U,h||u,c,s,V),te&&(u=[...u],pt({}))}return z={get basename(){return f},get future(){return y},get state(){return P},get routes(){return u},get window(){return t},initialize:jt,subscribe:Cr,enableScrollRestoration:ll,navigate:xo,fetch:So,revalidate:rl,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Qr,resetFetcher:Ou,deleteFetcher:sl,dispose:Hn,getBlocker:Co,deleteBlocker:wi,patchRoutes:Fa,_internalFetchControllers:Z,_internalSetRoutes:Ao,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){pt(A)}},e.unstable_instrumentations&&(z=cC(z,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),z}function bC(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nf(e,t,n,a,o,s){let c,u;if(o){c=[];for(let f of t)if(c.push(f),f.route.id===o){u=f;break}}else c=t,u=t[t.length-1];let h=_u(a||".",ep(c),Un(e.pathname,n)||e.pathname,s==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&u){let f=rp(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 k=m.toString();h.search=k?`?${k}`:""}}return n!=="/"&&(h.pathname=rC({basename:n,pathname:h.pathname})),kr(h)}function tv(e,t,n){if(!n||!bC(n))return{path:t};if(n.formMethod&&!FC(n.formMethod))return{path:t,error:In(405,{method:n.formMethod})};let a=()=>({path:t,error:In(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=Q_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Qt(s))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((k,[w,x])=>`${k}${w}=${x}
10
- `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Qt(s))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,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=af(n.formData),h=n.formData;else if(n.body instanceof FormData)u=af(n.body),h=n.body;else if(n.body instanceof URLSearchParams)u=n.body,h=lv(u);else if(n.body==null)u=new URLSearchParams,h=new FormData;else try{u=new URLSearchParams(n.body),h=lv(u)}catch{return a()}let f={formMethod:s,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=Kr(t);return e&&m.search&&rp(m.search)&&u.append("index",""),m.search=`?${u}`,{path:kr(m),submission:f}}function nv(e,t,n,a,o,s,c,u,h,f,m,y,k,w,x,C,S,D,L,R,O){let G=R?xn(R[1])?R[1].error:R[1].data:void 0,W=o.createURL(s.location),z=o.createURL(h),P;if(m&&s.errors){let le=Object.keys(s.errors)[0];P=c.findIndex(pe=>pe.route.id===le)}else if(R&&xn(R[1])){let le=R[0];P=c.findIndex(pe=>pe.route.id===le)-1}let Y=R?R[1].statusCode:void 0,X=Y&&Y>=400,ue={currentUrl:W,currentParams:s.matches[0]?.params||{},nextUrl:z,nextParams:c[0].params,...u,actionResult:G,actionStatus:Y},se=zs(c),Ae=c.map((le,pe)=>{let{route:Ne}=le,K=null;if(P!=null&&pe>P)K=!1;else if(Ne.lazy)K=!0;else if(!tp(Ne))K=!1;else if(m){let{shouldLoad:q}=K_(Ne,s.loaderData,s.errors);K=q}else wC(s.loaderData,s.matches[pe],le)&&(K=!0);if(K!==null)return rf(n,a,e,se,le,f,t,K);let Z=!1;typeof O=="boolean"?Z=O:X?Z=!1:(y||W.pathname+W.search===z.pathname+z.search||W.search!==z.search||xC(s.matches[pe],le))&&(Z=!0);let H={...ue,defaultShouldRevalidate:Z},I=bs(le,H);return rf(n,a,e,se,le,f,t,I,H,O)}),fe=[];return x.forEach((le,pe)=>{if(m||!c.some(Re=>Re.route.id===le.routeId)||w.has(pe))return;let Ne=s.fetchers.get(pe),K=Ne&&Ne.state!=="idle"&&Ne.data===void 0,Z=Ta(S,le.path,D);if(!Z){if(L&&K)return;fe.push({key:pe,routeId:le.routeId,path:le.path,matches:null,match:null,request:null,controller:null});return}if(C.has(pe))return;let H=Tc(Z,le.path),I=new AbortController,q=Ji(o,le.path,I.signal),xe=null;if(k.has(pe))k.delete(pe),xe=so(n,a,q,Z,H,f,t);else if(K)y&&(xe=so(n,a,q,Z,H,f,t));else{let Re;typeof O=="boolean"?Re=O:X?Re=!1:Re=y;let Pe={...ue,defaultShouldRevalidate:Re};bs(H,Pe)&&(xe=so(n,a,q,Z,H,f,t,Pe))}xe&&fe.push({key:pe,routeId:le.routeId,path:le.path,matches:xe,match:H,request:q,controller:I})}),{dsMatches:Ae,revalidatingFetchers:fe}}function tp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function K_(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!tp(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let s=!a&&!o;return{shouldLoad:s,renderFallback:s}}function wC(e,t,n){let a=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return a||o}function xC(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function bs(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function rv(e,t,n,a,o,s){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=>G_(f,y));m?h.push({existingRoute:m,newRoute:f}):u.push(f)}),u.length>0){let f=Ds(u,o,[e||"_","patch",String(c?.length||"0")],a);c.push(...f)}if(s&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:y}=h[f],k=m,[w]=Ds([y],o,[],{},!0);Object.assign(k,{element:w.element?w.element:k.element,errorElement:w.errorElement?w.errorElement:k.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:k.hydrateFallbackElement})}}function G_(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(o=>G_(n,o)))??!1:!1}var av=new WeakMap,q_=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let o=n[t.id];if(Xe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=av.get(o);c||(c={},av.set(o,c));let u=c[e];if(u)return u;let h=(async()=>{let f=FS(e),y=o[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 "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let k=await s();k!=null&&(Object.assign(o,{[e]:k}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(k=>k===void 0)&&(o.lazy=void 0))})();return c[e]=h,h},iv=new WeakMap;function PC(e,t,n,a,o){let s=n[e.id];if(Xe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=iv.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{Xe(typeof e.lazy=="function","No lazy route function found");let k=await e.lazy(),w={};for(let x in k){let C=k[x];if(C===void 0)continue;let S=zS(x),L=s[x]!==void 0&&x!=="hasErrorBoundary";S?Et(!S,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?Et(!L,`Route "${s.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]=C}Object.assign(s,w),Object.assign(s,{...a(s),lazy:void 0})})();return iv.set(s,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],h;for(let m of c){if(o&&o.includes(m))continue;let y=q_({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 ov(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function SC(e){return e.matches.some(t=>t.route.middleware)?Y_(e,()=>ov(e)):ov(e)}function Y_(e,t){return CC(e,t,a=>{if(BC(a))throw a;return a},NC,n);function n(a,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:a}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(f=>f.route.id===o),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=Ea(c,c[u].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function CC(e,t,n,a,o){let{matches:s,request:c,params:u,context:h,unstable_pattern:f}=e,m=s.flatMap(k=>k.route.middleware?k.route.middleware.map(w=>[k.route.id,w]):[]);return await Z_({request:c,params:u,context:h,unstable_pattern:f},m,t,n,a,o)}async function Z_(e,t,n,a,o,s,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,k=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Z_(e,t,n,a,o,s,c+1)},y.value}catch(w){return y={value:await s(w,f,y)},y.value}};try{let w=await m(e,k),x=w!=null?a(w):void 0;return o(x)?x:y?x??y.value:(y={value:await k()},y.value)}catch(w){return await s(w,f,y)}}function X_(e,t,n,a,o){let s=q_({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=PC(a.route,Qt(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function rf(e,t,n,a,o,s,c,u,h=null,f){let m=!1,y=X_(e,t,n,o,s);return{...o,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:h,shouldCallHandler(k){return m=!0,h?typeof f=="boolean"?bs(o,{...h,defaultShouldRevalidate:f}):typeof k=="boolean"?bs(o,{...h,defaultShouldRevalidate:k}):bs(o,h):u},resolve(k){let{lazy:w,loader:x,middleware:C}=o.route,S=m||u||k&&!Qt(n.method)&&(w||x),D=C&&C.length>0&&!x&&!w;return S&&(Qt(n.method)||!D)?EC({request:n,unstable_pattern:a,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:k,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function so(e,t,n,a,o,s,c,u=null){return a.map(h=>h.route.id!==o.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:X_(e,t,n,h,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rf(e,t,n,zs(a),h,s,c,!0,u))}async function TC(e,t,n,a,o,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:zs(n),params:n[0].params,context:o,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let m=c;return Y_(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 EC({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let u,h,f=Qt(e.method),m=f?"action":"loader",y=k=>{let w,x=new Promise((D,L)=>w=L);h=()=>w(),e.signal.addEventListener("abort",h);let C=D=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):k({request:e,unstable_pattern:t,params:n.params,context:c},...D!==void 0?[D]:[]),S=(async()=>{try{return{type:"data",result:await(s?s(L=>C(L)):C())}}catch(D){return{type:"error",result:D}}})();return Promise.race([S,x])};try{let k=f?n.route.action:n.route.loader;if(a||o)if(k){let w,[x]=await Promise.all([y(k).catch(C=>{w=C}),a,o]);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),o]);else if(m==="action"){let x=new URL(e.url),C=x.pathname+x.search;throw In(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(k)u=await y(k);else{let w=new URL(e.url),x=w.pathname+w.search;throw In(404,{pathname:x})}}catch(k){return{type:"error",result:k}}finally{h&&e.signal.removeEventListener("abort",h)}return u}async function AC(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 RC(e){let{result:t,type:n}=e;if(np(t)){let a;try{a=await AC(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new Vs(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return n==="error"?hv(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:IC(t),statusCode:Ms(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ms(t)?t.status:void 0}:hv(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 LC(e,t,n,a,o){let s=e.headers.get("Location");if(Xe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jf(s)){let c=a.slice(0,a.findIndex(u=>u.route.id===n)+1);s=nf(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function sv(e,t,n,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jf(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(o.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 s=a.createURL(e);if(o.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ji(e,t,n,a){let o=e.createURL(Q_(t)).toString(),s={signal:n};if(a&&Qt(a.formMethod)){let{formMethod:c,formEncType:u}=a;s.method=c.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(a.json)):u==="text/plain"?s.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?s.body=af(a.formData):s.body=a.formData}return new Request(o,s)}function af(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function lv(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function DC(e,t,n,a=!1,o=!1){let s={},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 k=y.route.id,w=t[k];if(Xe(!ni(w),"Cannot handle redirect results in processLoaderData"),xn(w)){let x=w.error;if(m!==void 0&&(x=m,m=void 0),c=c||{},o)c[k]=x;else{let C=Ea(e,k);c[C.route.id]==null&&(c[C.route.id]=x)}a||(s[k]=W_),h||(h=!0,u=Ms(w.error)?w.error.status:500),w.headers&&(f[k]=w.headers)}else s[k]=w.data,w.statusCode&&w.statusCode!==200&&!h&&(u=w.statusCode),w.headers&&(f[k]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:f}}function cv(e,t,n,a,o,s){let{loaderData:c,errors:u}=DC(t,n,a);return o.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 k=s[f];if(Xe(k,"Did not find corresponding fetcher result"),xn(k)){let w=Ea(e.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:k.error}),e.fetchers.delete(f)}else if(ni(k))Xe(!1,"Unhandled fetcher revalidation redirect");else{let w=Vr(k.data);e.fetchers.set(f,w)}}),{loaderData:c,errors:u}}function uv(e,t,n,a){let o=Object.entries(t).filter(([,s])=>s!==W_).reduce((s,[c,u])=>(s[c]=u,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),a&&a.hasOwnProperty(c))break}return o}function dv(e){return e?xn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ea(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 dc(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 In(e,{pathname:t,routeId:n,method:a,type:o,message:s}={}){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.`:o==="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 Vs(e||500,c,new Error(u),!0)}function hc(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,o]=t[n];if(ni(o))return{key:a,result:o}}}function Q_(e){let t=typeof e=="string"?Kr(e):e;return kr({...t,hash:""})}function MC(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function IC(e){return new Vs(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function NC(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&OC(n))}function OC(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function jC(e){return np(e.result)&&$_.has(e.result.status)}function xn(e){return e.type==="error"}function ni(e){return(e&&e.type)==="redirect"}function hv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function np(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function UC(e){return $_.has(e)}function BC(e){return np(e)&&UC(e.status)&&e.headers.has("Location")}function FC(e){return gC.has(e.toUpperCase())}function Qt(e){return pC.has(e.toUpperCase())}function rp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Tc(e,t){let n=typeof t=="string"?Kr(t).search:t.search;if(e[e.length-1].route.index&&rp(n||""))return e[e.length-1];let a=U_(e);return a[a.length-1]}function fv(e){let{formMethod:t,formAction:n,formEncType:a,text:o,formData:s,json:c}=e;if(!(!t||!n||!a)){if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,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 Ph(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 VC(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 ds(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 zC(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 $C(e,t){try{let n=e.sessionStorage.getItem(H_);if(n){let a=JSON.parse(n);for(let[o,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function HC(e,t){if(t.size>0){let n={};for(let[a,o]of t)n[a]=[...o];try{e.sessionStorage.setItem(H_,JSON.stringify(n))}catch(a){Et(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function pv(){let e,t,n=new Promise((a,o)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var pi=b.createContext(null);pi.displayName="DataRouter";var $s=b.createContext(null);$s.displayName="DataRouterState";var J_=b.createContext(!1);function WC(){return b.useContext(J_)}var ap=b.createContext({isTransitioning:!1});ap.displayName="ViewTransition";var eb=b.createContext(new Map);eb.displayName="Fetchers";var KC=b.createContext(null);KC.displayName="Await";var Bn=b.createContext(null);Bn.displayName="Navigation";var bu=b.createContext(null);bu.displayName="Location";var Gr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Gr.displayName="Route";var ip=b.createContext(null);ip.displayName="RouteError";var tb="REACT_ROUTER_ERROR",GC="REDIRECT",qC="ROUTE_ERROR_RESPONSE";function YC(e){if(e.startsWith(`${tb}:${GC}:{`))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 ZC(e){if(e.startsWith(`${tb}:${qC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Vs(t.status,t.statusText,t.data)}catch{}}function XC(e,{relative:t}={}){Xe(Hs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(Bn),{hash:o,pathname:s,search:c}=Ws(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ir([n,s])),a.createHref({pathname:u,search:c,hash:o})}function Hs(){return b.useContext(bu)!=null}function Fn(){return Xe(Hs(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(bu).location}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rb(e){b.useContext(Bn).static||b.useLayoutEffect(e)}function wu(){let{isDataRoute:e}=b.useContext(Gr);return e?u1():QC()}function QC(){Xe(Hs(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(pi),{basename:t,navigator:n}=b.useContext(Bn),{matches:a}=b.useContext(Gr),{pathname:o}=Fn(),s=JSON.stringify(ep(a)),c=b.useRef(!1);return rb(()=>{c.current=!0}),b.useCallback((h,f={})=>{if(Et(c.current,nb),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=_u(h,JSON.parse(s),o,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,s,o,e])}b.createContext(null);function Ws(e,{relative:t}={}){let{matches:n}=b.useContext(Gr),{pathname:a}=Fn(),o=JSON.stringify(ep(n));return b.useMemo(()=>_u(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function JC(e,t,n){Xe(Hs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(Bn),{matches:o}=b.useContext(Gr),s=o[o.length-1],c=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",f=s&&s.route;{let S=f&&f.path||"";ib(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
9
+ `+g.stack}return{value:r,source:i,stack:p,digest:null}}function Fd(r,i,l){return{value:r,source:null,stack:l??null,digest:i??null}}function Vd(r,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var QP=typeof WeakMap=="function"?WeakMap:Map;function Kg(r,i,l){l=jr(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Zl||(Zl=!0,nh=d),Vd(r,i)},l}function Gg(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(){Vd(r,i)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){Vd(r,i),typeof d!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function qg(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new QP;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=hS.bind(null,r,i,l),i.then(r,r))}function Yg(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 Zg(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,ma(l,i,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=p,r)}var JP=O.ReactCurrentOwner,mn=!1;function an(r,i,l,d){i.child=r===null?gg(i,null,l,d):Fi(i,r.child,l,d)}function Xg(r,i,l,d,p){l=l.render;var g=i.ref;return zi(i,p),d=Dd(r,i,l,d,g,p),l=Md(),r!==null&&!mn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&l&&md(i),i.flags|=1,an(r,i,d,p),i.child)}function Qg(r,i,l,d,p){if(r===null){var g=l.type;return typeof g=="function"&&!ch(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=g,Jg(r,i,g,d,p)):(r=nc(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:$o,l(_,d)&&r.ref===i.ref)return Ur(r,i,p)}return i.flags|=1,r=ba(g,d),r.ref=i.ref,r.return=i,i.child=r}function Jg(r,i,l,d,p){if(r!==null){var g=r.memoizedProps;if($o(g,d)&&r.ref===i.ref)if(mn=!1,i.pendingProps=d=g,(r.lanes&p)!==0)(r.flags&131072)!==0&&(mn=!0);else return i.lanes=r.lanes,Ur(r,i,p)}return zd(r,i,l,d,p)}function ey(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(Ki,wn),wn|=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(Ki,wn),wn|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=g!==null?g.baseLanes:l,ft(Ki,wn),wn|=d}else g!==null?(d=g.baseLanes|l,i.memoizedState=null):d=l,ft(Ki,wn),wn|=d;return an(r,i,p,l),i.child}function ty(r,i){var l=i.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function zd(r,i,l,d,p){var g=pn(l)?za:qt.current;return g=Oi(i,g),zi(i,p),l=Dd(r,i,l,d,g,p),d=Md(),r!==null&&!mn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&d&&md(i),i.flags|=1,an(r,i,l,p),i.child)}function ny(r,i,l,d,p){if(pn(l)){var g=!0;Tl(i)}else g=!1;if(zi(i,p),i.stateNode===null)Wl(r,i),Hg(i,l,d),Bd(i,l,d,p),d=!0;else if(r===null){var _=i.stateNode,E=i.memoizedProps;_.props=E;var M=_.context,$=l.contextType;typeof $=="object"&&$!==null?$=Rn($):($=pn(l)?za:qt.current,$=Oi(i,$));var ee=l.getDerivedStateFromProps,ne=typeof ee=="function"||typeof _.getSnapshotBeforeUpdate=="function";ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==d||M!==$)&&Wg(i,_,d,$),pa=!1;var J=i.memoizedState;_.state=J,Ol(i,d,_,p),M=i.memoizedState,E!==d||J!==M||fn.current||pa?(typeof ee=="function"&&(Ud(i,l,ee,d),M=i.memoizedState),(E=pa||$g(i,l,E,d,J,M,$))?(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=$,d=E):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,vg(r,i),E=i.memoizedProps,$=i.type===i.elementType?E:Xn(i.type,E),_.props=$,ne=i.pendingProps,J=_.context,M=l.contextType,typeof M=="object"&&M!==null?M=Rn(M):(M=pn(l)?za: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)&&Wg(i,_,d,M),pa=!1,J=i.memoizedState,_.state=J,Ol(i,d,_,p);var ve=i.memoizedState;E!==ne||J!==ve||fn.current||pa?(typeof de=="function"&&(Ud(i,l,de,d),ve=i.memoizedState),($=pa||$g(i,l,$,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=$):(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 $d(r,i,l,d,g,p)}function $d(r,i,l,d,p,g){ty(r,i);var _=(i.flags&128)!==0;if(!d&&!_)return p&&sg(i,l,!1),Ur(r,i,g);d=i.stateNode,JP.current=i;var E=_&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,r!==null&&_?(i.child=Fi(i,r.child,null,g),i.child=Fi(i,null,E,g)):an(r,i,E,g),i.memoizedState=d.state,p&&sg(i,l,!0),i.child}function ry(r){var i=r.stateNode;i.pendingContext?ig(r,i.pendingContext,i.pendingContext!==i.context):i.context&&ig(r,i.context,!1),Cd(r,i.containerInfo)}function ay(r,i,l,d,p){return Bi(),kd(p),i.flags|=256,an(r,i,l,d),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0};function Wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function iy(r,i,l){var d=i.pendingProps,p=bt.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(bt,p&1),r===null)return vd(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=rc(_,d,0,null),r=Qa(r,d,l,null),g.return=i,r.return=i,g.sibling=r,i.child=g,i.child.memoizedState=Wd(l),i.memoizedState=Hd,r):Kd(i,_));if(p=r.memoizedState,p!==null&&(E=p.dehydrated,E!==null))return eS(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=ba(p,M),d.subtreeFlags=p.subtreeFlags&14680064),E!==null?g=ba(E,g):(g=Qa(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?Wd(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},g.memoizedState=_,g.childLanes=r.childLanes&~l,i.memoizedState=Hd,d}return g=r.child,r=g.sibling,d=ba(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 Kd(r,i){return i=rc({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function Hl(r,i,l,d){return d!==null&&kd(d),Fi(i,r.child,null,l),r=Kd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function eS(r,i,l,d,p,g,_){if(l)return i.flags&256?(i.flags&=-257,d=Fd(Error(n(422))),Hl(r,i,_,d)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(g=d.fallback,p=i.mode,d=rc({mode:"visible",children:d.children},p,0,null),g=Qa(g,p,_,null),g.flags|=2,d.return=i,g.return=i,d.sibling=g,i.child=d,(i.mode&1)!==0&&Fi(i,r.child,null,_),i.child.memoizedState=Wd(_),i.memoizedState=Hd,g);if((i.mode&1)===0)return Hl(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=Fd(g,d,void 0),Hl(r,i,_,d)}if(E=(_&r.childLanes)!==0,mn||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,Or(r,p),er(d,r,p,-1))}return lh(),d=Fd(Error(n(421))),Hl(r,i,_,d)}return p.data==="$?"?(i.flags|=128,i.child=r.child,i=fS.bind(null,r),p._reactRetry=i,null):(r=g.treeContext,bn=ua(p.nextSibling),_n=i,kt=!0,Zn=null,r!==null&&(En[An++]=Ir,En[An++]=Nr,En[An++]=$a,Ir=r.id,Nr=r.overflow,$a=i),i=Kd(i,d.children),i.flags|=4096,i)}function oy(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xd(r.return,i,l)}function Gd(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 sy(r,i,l){var d=i.pendingProps,p=d.revealOrder,g=d.tail;if(an(r,i,d.children,l),d=bt.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&&oy(r,l,i);else if(r.tag===19)oy(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(bt,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&&jl(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Gd(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&&jl(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Gd(i,!0,l,null,g);break;case"together":Gd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Wl(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),qa|=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=ba(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=ba(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function tS(r,i,l){switch(i.tag){case 3:ry(i),Bi();break;case 5:bg(i);break;case 1:pn(i.type)&&Tl(i);break;case 4:Cd(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;ft(Ml,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(ft(bt,bt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?iy(r,i,l):(ft(bt,bt.current&1),r=Ur(r,i,l),r!==null?r.sibling:null);ft(bt,bt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(r.flags&128)!==0){if(d)return sy(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(bt,bt.current),d)break;return null;case 22:case 23:return i.lanes=0,ey(r,i,l)}return Ur(r,i,l)}var ly,qd,cy,uy;ly=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}},qd=function(){},cy=function(r,i,l,d){var p=r.memoizedProps;if(p!==d){r=i.stateNode,Ka(ur.current);var g=null;switch(l){case"input":p=en(r,p),d=en(r,d),g=[];break;case"select":p=H({},p,{value:void 0}),d=H({},d,{value:void 0}),g=[];break;case"textarea":p=Co(r,p),d=Co(r,d),g=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=Pl)}_i(l,d);var _;l=null;for($ in p)if(!d.hasOwnProperty($)&&p.hasOwnProperty($)&&p[$]!=null)if($==="style"){var E=p[$];for(_ in E)E.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(o.hasOwnProperty($)?g||(g=[]):(g=g||[]).push($,null));for($ in d){var M=d[$];if(E=p?.[$],d.hasOwnProperty($)&&M!==E&&(M!=null||E!=null))if($==="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($,l)),l=M;else $==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,E=E?E.__html:void 0,M!=null&&E!==M&&(g=g||[]).push($,M)):$==="children"?typeof M!="string"&&typeof M!="number"||(g=g||[]).push($,""+M):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(o.hasOwnProperty($)?(M!=null&&$==="onScroll"&&mt("scroll",r),g||E===M||(g=[])):(g=g||[]).push($,M))}l&&(g=g||[]).push("style",l);var $=g;(i.updateQueue=$)&&(i.flags|=4)}},uy=function(r,i,l,d){l!==d&&(i.flags|=4)};function as(r,i){if(!kt)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 nS(r,i,l){var d=i.pendingProps;switch(gd(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 pn(i.type)&&Cl(),Zt(i),null;case 3:return d=i.stateNode,$i(),gt(fn),gt(qt),Ad(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Ll(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zn!==null&&(ih(Zn),Zn=null))),qd(r,i),Zt(i),null;case 5:Td(i);var p=Ka(Jo.current);if(l=i.type,r!==null&&i.stateNode!=null)cy(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=Ka(ur.current),Ll(i)){d=i.stateNode,l=i.type;var g=i.memoizedProps;switch(d[cr]=i,d[qo]=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<Wo.length;p++)mt(Wo[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":Po(d,g),mt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!g.multiple},mt("invalid",d);break;case"textarea":il(d,g),mt("invalid",d)}_i(l,g),p=null;for(var _ in g)if(g.hasOwnProperty(_)){var E=g[_];_==="children"?typeof E=="string"?d.textContent!==E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",E]):typeof E=="number"&&d.textContent!==""+E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",""+E]):o.hasOwnProperty(_)&&E!=null&&_==="onScroll"&&mt("scroll",d)}switch(l){case"input":Hn(d),al(d,g,!0);break;case"textarea":Hn(d),lr(d);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(d.onclick=Pl)}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=Zr(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[qo]=d,ly(r,i,!1,!1),i.stateNode=r;e:{switch(_=bi(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<Wo.length;p++)mt(Wo[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":Po(r,d),p=en(r,d),mt("invalid",r);break;case"option":p=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},p=H({},d,{value:void 0}),mt("invalid",r);break;case"textarea":il(r,d),p=Co(r,d),mt("invalid",r);break;default:p=d}_i(l,p),E=p;for(g in E)if(E.hasOwnProperty(g)){var M=E[g];g==="style"?sl(r,M):g==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Cn(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"&&(o.hasOwnProperty(g)?M!=null&&g==="onScroll"&&mt("scroll",r):M!=null&&R(r,g,M,_))}switch(l){case"input":Hn(r),al(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?Yr(r,!!d.multiple,g,!1):d.defaultValue!=null&&Yr(r,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(r.onclick=Pl)}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)uy(r,i,r.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(l=Ka(Jo.current),Ka(ur.current),Ll(i)){if(d=i.stateNode,l=i.memoizedProps,d[cr]=i,(g=d.nodeValue!==l)&&(r=_n,r!==null))switch(r.tag){case 3:xl(d.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&xl(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(bt),d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(kt&&bn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)fg(),Bi(),i.flags|=98560,g=!1;else if(g=Ll(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 Bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),g=!1}else Zn!==null&&(ih(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||(bt.current&1)!==0?It===0&&(It=3):lh())),i.updateQueue!==null&&(i.flags|=4),Zt(i),null);case 4:return $i(),qd(r,i),r===null&&Ko(i.stateNode.containerInfo),Zt(i),null;case 10:return wd(i.type._context),Zt(i),null;case 17:return pn(i.type)&&Cl(),Zt(i),null;case 19:if(gt(bt),g=i.memoizedState,g===null)return Zt(i),null;if(d=(i.flags&128)!==0,_=g.rendering,_===null)if(d)as(g,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(_=jl(r),_!==null){for(i.flags|=128,as(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(bt,bt.current&1|2),i.child}r=r.sibling}g.tail!==null&&rt()>Gi&&(i.flags|=128,d=!0,as(g,!1),i.lanes=4194304)}else{if(!d)if(r=jl(_),r!==null){if(i.flags|=128,d=!0,l=r.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),as(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!kt)return Zt(i),null}else 2*rt()-g.renderingStartTime>Gi&&l!==1073741824&&(i.flags|=128,d=!0,as(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=bt.current,ft(bt,d?l&1|2:l&1),i):(Zt(i),null);case 22:case 23:return sh(),d=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(wn&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 rS(r,i){switch(gd(i),i.tag){case 1:return pn(i.type)&&Cl(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return $i(),gt(fn),gt(qt),Ad(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return Td(i),null;case 13:if(gt(bt),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return gt(bt),null;case 4:return $i(),null;case 10:return wd(i.type._context),null;case 22:case 23:return sh(),null;case 24:return null;default:return null}}var Kl=!1,Xt=!1,aS=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Wi(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 Yd(r,i,l){try{l()}catch(d){xt(r,i,d)}}var dy=!1;function iS(r,i){if(sd=hl,r=$m(),Ju(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,$=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&&++$===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(ld={focusedElem:r,selectionRange:l},hl=!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,Ct=ve.memoizedState,B=i.stateNode,j=B.getSnapshotBeforeUpdate(i.elementType===i.type?we:Xn(i.type,we),Ct);B.__reactInternalSnapshotBeforeUpdate=j}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(oe){xt(i,i.return,oe)}if(r=i.sibling,r!==null){r.return=i.return,ge=r;break}ge=i.return}return ve=dy,dy=!1,ve}function is(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&&Yd(i,l,g)}p=p.next}while(p!==d)}}function Gl(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 Zd(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 hy(r){var i=r.alternate;i!==null&&(r.alternate=null,hy(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[cr],delete i[qo],delete i[hd],delete i[VP],delete i[zP])),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 fy(r){return r.tag===5||r.tag===3||r.tag===4}function py(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fy(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 Xd(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=Pl));else if(d!==4&&(r=r.child,r!==null))for(Xd(r,i,l),r=r.sibling;r!==null;)Xd(r,i,l),r=r.sibling}function Qd(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(Qd(r,i,l),r=r.sibling;r!==null;)Qd(r,i,l),r=r.sibling}var Ht=null,Qn=!1;function ga(r,i,l){for(l=l.child;l!==null;)my(r,i,l),l=l.sibling}function my(r,i,l){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Tn,l)}catch{}switch(l.tag){case 5:Xt||Wi(l,i);case 6:var d=Ht,p=Qn;Ht=null,ga(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?dd(r.parentNode,l):r.nodeType===1&&dd(r,l),jo(r)):dd(Ht,l.stateNode));break;case 4:d=Ht,p=Qn,Ht=l.stateNode.containerInfo,Qn=!0,ga(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)&&Yd(l,i,_),p=p.next}while(p!==d)}ga(r,i,l);break;case 1:if(!Xt&&(Wi(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)}ga(r,i,l);break;case 21:ga(r,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ga(r,i,l),Xt=d):ga(r,i,l);break;default:ga(r,i,l)}}function gy(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new aS),i.forEach(function(d){var p=pS.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));my(g,_,p),Ht=null,Qn=!1;var M=p.alternate;M!==null&&(M.return=null),p.return=null}catch($){xt(p,i,$)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)yy(i,r),i=i.sibling}function yy(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{is(3,r,r.return),Gl(3,r)}catch(we){xt(r,r.return,we)}try{is(5,r,r.return)}catch(we){xt(r,r.return,we)}}break;case 1:Jn(i,r),hr(r),d&512&&l!==null&&Wi(l,l.return);break;case 5:if(Jn(i,r),hr(r),d&512&&l!==null&&Wi(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&&rl(p,g),bi(E,_);var $=bi(E,g);for(_=0;_<M.length;_+=2){var ee=M[_],ne=M[_+1];ee==="style"?sl(p,ne):ee==="dangerouslySetInnerHTML"?Cn(p,ne):ee==="children"?tn(p,ne):R(p,ee,ne,$)}switch(E){case"input":Wn(p,g);break;case"textarea":ol(p,g);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var de=g.value;de!=null?Yr(p,!!g.multiple,de,!1):J!==!!g.multiple&&(g.defaultValue!=null?Yr(p,!!g.multiple,g.defaultValue,!0):Yr(p,!!g.multiple,g.multiple?[]:"",!1))}p[qo]=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{jo(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||(th=rt())),d&4&&gy(r);break;case 22:if(ee=l!==null&&l.memoizedState!==null,r.mode&1?(Xt=($=Xt)||ee,Jn(i,r),Xt=$):Jn(i,r),hr(r),d&8192){if($=r.memoizedState!==null,(r.stateNode.isHidden=$)&&!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:is(4,J,J.return);break;case 1:Wi(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:Wi(J,J.return);break;case 22:if(J.memoizedState!==null){_y(ne);continue}}de!==null?(de.return=J,ge=de):_y(ne)}ee=ee.sibling}e:for(ee=null,ne=r;;){if(ne.tag===5){if(ee===null){ee=ne;try{p=ne.stateNode,$?(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=ki("display",_))}catch(we){xt(r,r.return,we)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=$?"":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&&gy(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(fy(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=py(r);Qd(r,g,p);break;case 3:case 4:var _=d.stateNode.containerInfo,E=py(r);Xd(r,E,_);break;default:throw Error(n(161))}}catch(M){xt(r,r.return,M)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function oS(r,i,l){ge=r,vy(r)}function vy(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||Kl;if(!_){var E=p.alternate,M=E!==null&&E.memoizedState!==null||Xt;E=Kl;var $=Xt;if(Kl=_,(Xt=M)&&!$)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,vy(g),g=g.sibling;ge=p,Kl=E,Xt=$}ky(r)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,ge=g):ky(r)}}function ky(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||Gl(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&&_g(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}_g(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 $=i.alternate;if($!==null){var ee=$.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&jo(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xt||i.flags&512&&Zd(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 _y(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{Gl(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{Zd(i)}catch(M){xt(i,g,M)}break;case 5:var _=i.return;try{Zd(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 sS=Math.ceil,ql=O.ReactCurrentDispatcher,Jd=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,at=0,Ft=null,At=null,Wt=0,wn=0,Ki=da(0),It=0,os=null,qa=0,Yl=0,eh=0,ss=null,gn=null,th=0,Gi=1/0,Br=null,Zl=!1,nh=null,ya=null,Xl=!1,va=null,Ql=0,ls=0,rh=null,Jl=-1,ec=0;function on(){return(at&6)!==0?rt():Jl!==-1?Jl:Jl=rt()}function ka(r){return(r.mode&1)===0?1:(at&2)!==0&&Wt!==0?Wt&-Wt:HP.transition!==null?(ec===0&&(ec=pm()),ec):(r=ct,r!==0||(r=window.event,r=r===void 0?16:xm(r.type)),r)}function er(r,i,l,d){if(50<ls)throw ls=0,rh=null,Error(n(185));Do(r,l,d),((at&2)===0||r!==Ft)&&(r===Ft&&((at&2)===0&&(Yl|=l),It===4&&_a(r,Wt)),yn(r,d),l===1&&at===0&&(i.mode&1)===0&&(Gi=rt()+500,El&&fa()))}function yn(r,i){var l=r.callbackNode;Hx(r,i);var d=Ci(r,r===Ft?Wt:0);if(d===0)l!==null&&St(l),r.callbackNode=null,r.callbackPriority=0;else if(i=d&-d,r.callbackPriority!==i){if(l!=null&&St(l),i===1)r.tag===0?$P(xy.bind(null,r)):lg(xy.bind(null,r)),BP(function(){(at&6)===0&&fa()}),l=null;else{switch(mm(d)){case 1:l=Ar;break;case 4:l=qn;break;case 16:l=nn;break;case 536870912:l=ta;break;default:l=nn}l=Ly(l,wy.bind(null,r))}r.callbackPriority=i,r.callbackNode=l}}function wy(r,i){if(Jl=-1,ec=0,(at&6)!==0)throw Error(n(327));var l=r.callbackNode;if(qi()&&r.callbackNode!==l)return null;var d=Ci(r,r===Ft?Wt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||i)i=tc(r,d);else{i=d;var p=at;at|=2;var g=Sy();(Ft!==r||Wt!==i)&&(Br=null,Gi=rt()+500,Za(r,i));do try{uS();break}catch(E){Py(r,E)}while(!0);bd(),ql.current=g,at=p,At!==null?i=0:(Ft=null,Wt=0,i=It)}if(i!==0){if(i===2&&(p=ju(r),p!==0&&(d=p,i=ah(r,p))),i===1)throw l=os,Za(r,0),_a(r,d),yn(r,rt()),l;if(i===6)_a(r,d);else{if(p=r.current.alternate,(d&30)===0&&!lS(p)&&(i=tc(r,d),i===2&&(g=ju(r),g!==0&&(d=g,i=ah(r,g))),i===1))throw l=os,Za(r,0),_a(r,d),yn(r,rt()),l;switch(r.finishedWork=p,r.finishedLanes=d,i){case 0:case 1:throw Error(n(345));case 2:Xa(r,gn,Br);break;case 3:if(_a(r,d),(d&130023424)===d&&(i=th+500-rt(),10<i)){if(Ci(r,0)!==0)break;if(p=r.suspendedLanes,(p&d)!==d){on(),r.pingedLanes|=r.suspendedLanes&p;break}r.timeoutHandle=ud(Xa.bind(null,r,gn,Br),i);break}Xa(r,gn,Br);break;case 4:if(_a(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*sS(d/1960))-d,10<d){r.timeoutHandle=ud(Xa.bind(null,r,gn,Br),d);break}Xa(r,gn,Br);break;case 5:Xa(r,gn,Br);break;default:throw Error(n(329))}}}return yn(r,rt()),r.callbackNode===l?wy.bind(null,r):null}function ah(r,i){var l=ss;return r.current.memoizedState.isDehydrated&&(Za(r,i).flags|=256),r=tc(r,i),r!==2&&(i=gn,gn=l,i!==null&&ih(i)),r}function ih(r){gn===null?gn=r:gn.push.apply(gn,r)}function lS(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 _a(r,i){for(i&=~eh,i&=~Yl,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 xy(r){if((at&6)!==0)throw Error(n(327));qi();var i=Ci(r,0);if((i&1)===0)return yn(r,rt()),null;var l=tc(r,i);if(r.tag!==0&&l===2){var d=ju(r);d!==0&&(i=d,l=ah(r,d))}if(l===1)throw l=os,Za(r,0),_a(r,i),yn(r,rt()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Xa(r,gn,Br),yn(r,rt()),null}function oh(r,i){var l=at;at|=1;try{return r(i)}finally{at=l,at===0&&(Gi=rt()+500,El&&fa())}}function Ya(r){va!==null&&va.tag===0&&(at&6)===0&&qi();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&&fa()}}function sh(){wn=Ki.current,gt(Ki)}function Za(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,UP(l)),At!==null)for(l=At.return;l!==null;){var d=l;switch(gd(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Cl();break;case 3:$i(),gt(fn),gt(qt),Ad();break;case 5:Td(d);break;case 4:$i();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:wd(d.type._context);break;case 22:case 23:sh()}l=l.return}if(Ft=r,At=r=ba(r.current,null),Wt=wn=i,It=0,os=null,eh=Yl=qa=0,gn=ss=null,Wa!==null){for(i=0;i<Wa.length;i++)if(l=Wa[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}Wa=null}return r}function Py(r,i){do{var l=At;try{if(bd(),Ul.current=zl,Bl){for(var d=wt.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}Bl=!1}if(Ga=0,Bt=Mt=wt=null,es=!1,ts=0,Jd.current=null,l===null||l.return===null){It=1,os=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 $=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=Yg(_);if(de!==null){de.flags&=-257,Zg(de,_,E,g,i),de.mode&1&&qg(g,$,i),i=de,M=$;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){qg(g,$,i),lh();break e}M=Error(n(426))}}else if(kt&&E.mode&1){var Ct=Yg(_);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),Zg(Ct,_,E,g,i),kd(Hi(M,E));break e}}g=M=Hi(M,E),It!==4&&(It=2),ss===null?ss=[g]:ss.push(g),g=_;do{switch(g.tag){case 3:g.flags|=65536,i&=-i,g.lanes|=i;var B=Kg(g,M,i);kg(g,B);break e;case 1:E=M;var j=g.type,F=g.stateNode;if((g.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ya===null||!ya.has(F)))){g.flags|=65536,i&=-i,g.lanes|=i;var oe=Gg(g,E,i);kg(g,oe);break e}}g=g.return}while(g!==null)}Ty(l)}catch(Se){i=Se,At===l&&l!==null&&(At=l=l.return);continue}break}while(!0)}function Sy(){var r=ql.current;return ql.current=zl,r===null?zl:r}function lh(){(It===0||It===3||It===2)&&(It=4),Ft===null||(qa&268435455)===0&&(Yl&268435455)===0||_a(Ft,Wt)}function tc(r,i){var l=at;at|=2;var d=Sy();(Ft!==r||Wt!==i)&&(Br=null,Za(r,i));do try{cS();break}catch(p){Py(r,p)}while(!0);if(bd(),at=l,ql.current=d,At!==null)throw Error(n(261));return Ft=null,Wt=0,It}function cS(){for(;At!==null;)Cy(At)}function uS(){for(;At!==null&&!$t();)Cy(At)}function Cy(r){var i=Ry(r.alternate,r,wn);r.memoizedProps=r.pendingProps,i===null?Ty(r):At=i,Jd.current=null}function Ty(r){var i=r;do{var l=i.alternate;if(r=i.return,(i.flags&32768)===0){if(l=nS(l,i,wn),l!==null){At=l;return}}else{if(l=rS(l,i),l!==null){l.flags&=32767,At=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{It=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=r}while(i!==null);It===0&&(It=5)}function Xa(r,i,l){var d=ct,p=Dn.transition;try{Dn.transition=null,ct=1,dS(r,i,l,d)}finally{Dn.transition=p,ct=d}return null}function dS(r,i,l,d){do qi();while(va!==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(Wx(r,g),r===Ft&&(At=Ft=null,Wt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Xl||(Xl=!0,Ly(nn,function(){return qi(),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,Jd.current=null,iS(r,l),yy(l,r),LP(ld),hl=!!sd,ld=sd=null,r.current=l,oS(l),lt(),at=E,ct=_,Dn.transition=g}else r.current=l;if(Xl&&(Xl=!1,va=r,Ql=p),g=r.pendingLanes,g===0&&(ya=null),Si(l.stateNode),yn(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(Zl)throw Zl=!1,r=nh,nh=null,r;return(Ql&1)!==0&&r.tag!==0&&qi(),g=r.pendingLanes,(g&1)!==0?r===rh?ls++:(ls=0,rh=r):ls=0,fa(),null}function qi(){if(va!==null){var r=mm(Ql),i=Dn.transition,l=ct;try{if(Dn.transition=null,ct=16>r?16:r,va===null)var d=!1;else{if(r=va,va=null,Ql=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 $=E[M];for(ge=$;ge!==null;){var ee=ge;switch(ee.tag){case 0:case 11:case 15:is(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(hy(ee),ee===$){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 Ct=we.sibling;we.sibling=null,we=Ct}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:is(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,ge=B;break e}ge=g.return}}var j=r.current;for(ge=j;ge!==null;){_=ge;var F=_.child;if((_.subtreeFlags&2064)!==0&&F!==null)F.return=_,ge=F;else e:for(_=j;ge!==null;){if(E=ge,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Gl(9,E)}}catch(Se){xt(E,E.return,Se)}if(E===_){ge=null;break e}var oe=E.sibling;if(oe!==null){oe.return=E.return,ge=oe;break e}ge=E.return}}if(at=p,fa(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Tn,r)}catch{}d=!0}return d}finally{ct=l,Dn.transition=i}}return!1}function Ey(r,i,l){i=Hi(l,i),i=Kg(r,i,1),r=ma(r,i,1),i=on(),r!==null&&(Do(r,1,i),yn(r,i))}function xt(r,i,l){if(r.tag===3)Ey(r,r,l);else for(;i!==null;){if(i.tag===3){Ey(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ya===null||!ya.has(d))){r=Hi(l,r),r=Gg(i,r,1),i=ma(i,r,1),r=on(),i!==null&&(Do(i,1,r),yn(i,r));break}}i=i.return}}function hS(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),i=on(),r.pingedLanes|=r.suspendedLanes&l,Ft===r&&(Wt&l)===l&&(It===4||It===3&&(Wt&130023424)===Wt&&500>rt()-th?Za(r,0):eh|=l),yn(r,i)}function Ay(r,i){i===0&&((r.mode&1)===0?i=1:(i=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var l=on();r=Or(r,i),r!==null&&(Do(r,i,l),yn(r,l))}function fS(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Ay(r,l)}function pS(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),Ay(r,l)}var Ry;Ry=function(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps||fn.current)mn=!0;else{if((r.lanes&l)===0&&(i.flags&128)===0)return mn=!1,tS(r,i,l);mn=(r.flags&131072)!==0}else mn=!1,kt&&(i.flags&1048576)!==0&&cg(i,Rl,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Wl(r,i),r=i.pendingProps;var p=Oi(i,qt.current);zi(i,l),p=Dd(null,i,d,r,p,l);var g=Md();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,pn(d)?(g=!0,Tl(i)):g=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Sd(i),p.updater=$l,i.stateNode=p,p._reactInternals=i,Bd(i,d,r,l),i=$d(null,i,d,!0,g,l)):(i.tag=0,kt&&g&&md(i),an(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Wl(r,i),r=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=gS(d),r=Xn(d,r),p){case 0:i=zd(null,i,d,r,l);break e;case 1:i=ny(null,i,d,r,l);break e;case 11:i=Xg(null,i,d,r,l);break e;case 14:i=Qg(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),zd(r,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),ny(r,i,d,p,l);case 3:e:{if(ry(i),r===null)throw Error(n(387));d=i.pendingProps,g=i.memoizedState,p=g.element,vg(r,i),Ol(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=Hi(Error(n(423)),i),i=ay(r,i,d,l,p);break e}else if(d!==p){p=Hi(Error(n(424)),i),i=ay(r,i,d,l,p);break e}else for(bn=ua(i.stateNode.containerInfo.firstChild),_n=i,kt=!0,Zn=null,l=gg(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Bi(),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&&vd(i),d=i.type,p=i.pendingProps,g=r!==null?r.memoizedProps:null,_=p.children,cd(d,p)?_=null:g!==null&&cd(d,g)&&(i.flags|=32),ty(r,i),an(r,i,_,l),i.child;case 6:return r===null&&vd(i),null;case 13:return iy(r,i,l);case 4:return Cd(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Fi(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),Xg(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(Ml,d._currentValue),d._currentValue=_,g!==null)if(Yn(g.value,_)){if(g.children===p.children&&!fn.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 $=g.updateQueue;if($!==null){$=$.shared;var ee=$.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),$.pending=M}}g.lanes|=l,M=g.alternate,M!==null&&(M.lanes|=l),xd(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),xd(_,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,zi(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),Qg(r,i,d,p,l);case 15:return Jg(r,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Wl(r,i),i.tag=1,pn(d)?(r=!0,Tl(i)):r=!1,zi(i,l),Hg(i,d,p),Bd(i,d,p,l),$d(null,i,d,!0,r,l);case 19:return sy(r,i,l);case 22:return ey(r,i,l)}throw Error(n(156,i.tag))};function Ly(r,i){return ht(r,i)}function mS(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 mS(r,i,l,d)}function ch(r){return r=r.prototype,!(!r||!r.isReactComponent)}function gS(r){if(typeof r=="function")return ch(r)?1:0;if(r!=null){if(r=r.$$typeof,r===se)return 11;if(r===le)return 14}return 2}function ba(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 nc(r,i,l,d,p,g){var _=2;if(d=r,typeof r=="function")ch(r)&&(_=1);else if(typeof r=="string")_=5;else e:switch(r){case z:return Qa(l.children,p,g,i);case P:_=8,p|=8;break;case Y:return r=Mn(12,l,i,p|2),r.elementType=Y,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 Ne:return rc(l,p,g,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:_=10;break e;case ue:_=9;break e;case se:_=11;break e;case le:_=14;break e;case pe:_=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 Qa(r,i,l,d){return r=Mn(7,r,d,i),r.lanes=l,r}function rc(r,i,l,d){return r=Mn(22,r,d,i),r.elementType=Ne,r.lanes=l,r.stateNode={isHidden:!1},r}function uh(r,i,l){return r=Mn(6,r,null,i),r.lanes=l,r}function dh(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 yS(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=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function hh(r,i,l,d,p,g,_,E,M){return r=new yS(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},Sd(g),r}function vS(r,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:d==null?null:""+d,children:r,containerInfo:i,implementation:l}}function Dy(r){if(!r)return ha;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(pn(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(pn(l))return og(r,l,i)}return i}function My(r,i,l,d,p,g,_,E,M){return r=hh(l,d,!0,r,p,g,_,E,M),r.context=Dy(null),l=r.current,d=on(),p=ka(l),g=jr(d,p),g.callback=i??null,ma(l,g,p),r.current.lanes=p,Do(r,p,d),yn(r,d),r}function ac(r,i,l,d){var p=i.current,g=on(),_=ka(p);return l=Dy(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=ma(p,i,_),r!==null&&(er(r,p,_,g),Nl(r,p,_)),_}function ic(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Iy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function fh(r,i){Iy(r,i),(r=r.alternate)&&Iy(r,i)}function kS(){return null}var Ny=typeof reportError=="function"?reportError:function(r){console.error(r)};function ph(r){this._internalRoot=r}oc.prototype.render=ph.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));ac(r,i,null,null)},oc.prototype.unmount=ph.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Ya(function(){ac(null,r,null,null)}),i[Dr]=null}};function oc(r){this._internalRoot=r}oc.prototype.unstable_scheduleHydration=function(r){if(r){var i=vm();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 mh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function sc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Oy(){}function _S(r,i,l,d,p){if(p){if(typeof d=="function"){var g=d;d=function(){var $=ic(_);g.call($)}}var _=My(i,d,r,0,null,!1,!1,"",Oy);return r._reactRootContainer=_,r[Dr]=_.current,Ko(r.nodeType===8?r.parentNode:r),Ya(),_}for(;p=r.lastChild;)r.removeChild(p);if(typeof d=="function"){var E=d;d=function(){var $=ic(M);E.call($)}}var M=hh(r,0,!1,null,null,!1,!1,"",Oy);return r._reactRootContainer=M,r[Dr]=M.current,Ko(r.nodeType===8?r.parentNode:r),Ya(function(){ac(i,M,l,d)}),M}function lc(r,i,l,d,p){var g=l._reactRootContainer;if(g){var _=g;if(typeof p=="function"){var E=p;p=function(){var M=ic(_);E.call(M)}}ac(i,_,r,p)}else _=_S(l,i,r,p,d);return ic(_)}gm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var l=ra(i.pendingLanes);l!==0&&(Bu(i,l|1),yn(i,rt()),(at&6)===0&&(Gi=rt()+500,fa()))}break;case 13:Ya(function(){var d=Or(r,1);if(d!==null){var p=on();er(d,r,1,p)}}),fh(r,1)}},Fu=function(r){if(r.tag===13){var i=Or(r,134217728);if(i!==null){var l=on();er(i,r,134217728,l)}fh(r,134217728)}},ym=function(r){if(r.tag===13){var i=ka(r),l=Or(r,i);if(l!==null){var d=on();er(l,r,i,d)}fh(r,i)}},vm=function(){return ct},km=function(r,i){var l=ct;try{return ct=r,i()}finally{ct=l}},xi=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=Sl(d);if(!p)throw Error(n(90));Cr(d),Wn(d,p)}}}break;case"textarea":ol(r,l);break;case"select":i=l.value,i!=null&&Yr(r,!!l.multiple,i,!1)}},cl=oh,Ao=Ya;var bS={usingClientEntryPoint:!1,Events:[Yo,Ii,Sl,ll,Eo,oh]},cs={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wS={bundleType:cs.bundleType,version:cs.version,rendererPackageName:cs.rendererPackageName,rendererConfig:cs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ot(r),r===null?null:r.stateNode},findFiberByHostInstance:cs.findFiberByHostInstance||kS,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 cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cc.isDisabled&&cc.supportsFiber)try{Tn=cc.inject(wS),rn=cc}catch{}}return vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bS,vn.createPortal=function(r,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mh(i))throw Error(n(200));return vS(r,i,null,l)},vn.createRoot=function(r,i){if(!mh(r))throw Error(n(299));var l=!1,d="",p=Ny;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=hh(r,1,!1,null,null,l,!1,d,p),r[Dr]=i.current,Ko(r.nodeType===8?r.parentNode:r),new ph(i)},vn.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=ot(i),r=r===null?null:r.stateNode,r},vn.flushSync=function(r){return Ya(r)},vn.hydrate=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!0,l)},vn.hydrateRoot=function(r,i,l){if(!mh(r))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,p=!1,g="",_=Ny;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=My(i,null,r,1,l??null,p,!1,g,_),r[Dr]=i.current,Ko(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 oc(i)},vn.render=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!1,l)},vn.unmountComponentAtNode=function(r){if(!sc(r))throw Error(n(40));return r._reactRootContainer?(Ya(function(){lc(null,null,r,!1,function(){r._reactRootContainer=null,r[Dr]=null})}),!0):!1},vn.unstable_batchedUpdates=oh,vn.unstable_renderSubtreeIntoContainer=function(r,i,l,d){if(!sc(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return lc(r,i,l,!1,d)},vn.version="18.3.1-next-f1338f8080-20240426",vn}var Hy;function D_(){if(Hy)return vh.exports;Hy=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(),vh.exports=DS(),vh.exports}var Wy;function MS(){if(Wy)return uc;Wy=1;var e=D_();return uc.createRoot=e.createRoot,uc.hydrateRoot=e.hydrateRoot,uc}var IS=MS();var M_=e=>{throw TypeError(e)},NS=(e,t,n)=>t.has(e)||M_("Cannot "+n),bh=(e,t,n)=>(NS(e,t,"read from private field"),n?n.call(e):t.get(e)),OS=(e,t,n)=>t.has(e)?M_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ky="popstate";function Gy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jS(e={}){function t(a,o){let s=o.state?.masked,{pathname:c,search:u,hash:h}=s||a.location;return Ds("",{pathname:c,search:u,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,o){return typeof o=="string"?o:kr(o)}return BS(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 US(){return Math.random().toString(36).substring(2,10)}function qy(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 Ds(e,t,n=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Kr(t):t,state:n,key:t&&t.key||a||US(),unstable_mask:o}}function kr({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 Kr(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 BS(e,t,n,a={}){let{window:o=document.defaultView,v5Compat:s=!1}=a,c=o.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 S=m(),D=S==null?null:S-f;f=S,h&&h({action:u,location:C.location,delta:D})}function k(S,D){u="PUSH";let L=Gy(S)?S:Ds(C.location,S,D);f=m()+1;let R=qy(L,f),O=C.createHref(L.unstable_mask||L);try{c.pushState(R,"",O)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;o.location.assign(O)}s&&h&&h({action:u,location:C.location,delta:1})}function w(S,D){u="REPLACE";let L=Gy(S)?S:Ds(C.location,S,D);f=m();let R=qy(L,f),O=C.createHref(L.unstable_mask||L);c.replaceState(R,"",O),s&&h&&h({action:u,location:C.location,delta:0})}function x(S){return I_(S)}let C={get action(){return u},get location(){return e(o,c)},listen(S){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Ky,y),h=S,()=>{o.removeEventListener(Ky,y),h=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let D=x(S);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:k,replace:w,go(S){return c.go(S)}};return C}function I_(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:kr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var ys,Yy=class{constructor(e){if(OS(this,ys,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bh(this,ys).has(e))return bh(this,ys).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bh(this,ys).set(e,t)}};ys=new WeakMap;var FS=new Set(["lazy","caseSensitive","path","id","index","children"]);function VS(e){return FS.has(e)}var zS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function $S(e){return zS.has(e)}function HS(e){return e.index===!0}function Ms(e,t,n=[],a={},o=!1){return e.map((s,c)=>{let u=[...n,String(c)],h=typeof s.id=="string"?s.id:u.join("-");if(Xe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Xe(o||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),HS(s)){let f={...s,id:h};return a[h]=Zy(f,t(f)),f}else{let f={...s,id:h,children:void 0};return a[h]=Zy(f,t(f)),s.children&&(f.children=Ms(s.children,t,u,a,o)),f}})}function Zy(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 vs(e,t,n,!1)}function vs(e,t,n,a){let o=typeof t=="string"?Kr(t):t,s=Un(o.pathname||"/",n);if(s==null)return null;let c=N_(e);KS(c);let u=null;for(let h=0;u==null&&h<c.length;++h){let f=rC(s);u=tC(c[h],f,a)}return u}function WS(e,t){let{route:n,pathname:a,params:o}=e;return{id:n.id,pathname:a,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N_(e,t=[],n=[],a="",o=!1){let s=(c,u,h=o,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]),k=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}".`),N_(c.children,t,k,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:JS(y,c.index),routesMeta:k})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))s(c,u);else for(let h of O_(c.path))s(c,u,!0,h)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return o?[s,""]:[s];let c=O_(a.join("/")),u=[];return u.push(...c.map(h=>h===""?s:[s,h].join("/"))),o&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function KS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:eC(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var GS=/^:[\w-]+$/,qS=3,YS=2,ZS=1,XS=10,QS=-2,Xy=e=>e==="*";function JS(e,t){let n=e.split("/"),a=n.length;return n.some(Xy)&&(a+=QS),t&&(a+=YS),n.filter(o=>!Xy(o)).reduce((o,s)=>o+(GS.test(s)?qS:s===""?ZS:XS),a)}function eC(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function tC(e,t,n=!1){let{routesMeta:a}=e,o={},s="/",c=[];for(let u=0;u<a.length;++u){let h=a[u],f=u===a.length-1,m=s==="/"?t:t.slice(s.length)||"/",y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),k=h.route;if(!y&&f&&n&&!a[a.length-1].route.index&&(y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:ir([s,y.pathname]),pathnameBase:oC(ir([s,y.pathnameBase])),route:k}),y.pathnameBase!=="/"&&(s=ir([s,y.pathnameBase]))}return c}function Kc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=nC(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:a.reduce((f,{paramName:m,isOptional:y},k)=>{if(m==="*"){let x=u[k]||"";c=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const w=u[k];return y&&!w?f[m]=void 0:f[m]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:c,pattern:e}}function nC(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=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function rC(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 aC({basename:e,pathname:t}){return t==="/"?e:ir([e,t])}var j_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jf=e=>j_.test(e);function iC(e,t="/"){let{pathname:n,search:a="",hash:o=""}=typeof e=="string"?Kr(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=Qy(n.substring(1),"/"):s=Qy(n,t)):s=t,{pathname:s,search:sC(a),hash:lC(o)}}function Qy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function wh(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 U_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ep(e){let t=U_(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function _u(e,t,n,a=!1){let o;typeof e=="string"?o=Kr(e):(o={...e},Xe(!o.pathname||!o.pathname.includes("?"),wh("?","pathname","search",o)),Xe(!o.pathname||!o.pathname.includes("#"),wh("#","pathname","hash",o)),Xe(!o.search||!o.search.includes("#"),wh("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let k=c.split("/");for(;k[0]==="..";)k.shift(),y-=1;o.pathname=k.join("/")}u=y>=0?t[y]:"/"}let h=iC(o,u),f=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var ir=e=>e.join("/").replace(/\/\/+/g,"/"),oC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,lC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zs=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 Is(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $s(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(e,t){let n=e;if(typeof n!="string"||!j_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,o=!1;if(B_)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=Un(c.pathname,t);c.origin===s.origin&&u!=null?n=u+c.search+c.hash:o=!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:o,to:n}}var Ra=Symbol("Uninstrumented");function cC(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let u of c)s[u]&&n[u].push(s[u])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=ro(n.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(s=>{let c=o[s],u=n[`lazy.${s}`];if(typeof c=="function"&&u.length>0){let h=ro(u,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[s]:h}))}})}return["loader","action"].forEach(o=>{let s=t[o];if(typeof s=="function"&&n[o].length>0){let c=s[Ra]??s,u=ro(n[o],c,(...h)=>Jy(h[0]));u&&(o==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Ra]=c,a[o]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let s=o[Ra]??o,c=ro(n.middleware,s,(...u)=>Jy(u[0]));return c?(c[Ra]=s,c):o})),a}function uC(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let s=Object.keys(o);for(let c of s)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let a=e.navigate[Ra]??e.navigate,o=ro(n.navigate,a,(...s)=>{let[c,u]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?kr(c):".",...ev(e,u??{})}});o&&(o[Ra]=a,e.navigate=o)}if(n.fetch.length>0){let a=e.fetch[Ra]??e.fetch,o=ro(n.fetch,a,(...s)=>{let[c,,u,h]=s;return{href:u??".",fetcherKey:c,...ev(e,h??{})}});o&&(o[Ra]=a,e.fetch=o)}return e}function ro(e,t,n){return e.length===0?null:async(...a)=>{let o=await V_(e,n(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function V_(e,t,n,a){let o=e[a],s;if(o){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=V_(e,t,n,a-1),s=await c,Xe(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await o(u,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await u(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Jy(e){let{request:t,context:n,params:a,unstable_pattern:o}=e;return{request:dC(t),params:{...a},unstable_pattern:o,context:hC(n)}}function ev(e,t){return{currentUrl:kr(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 dC(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function hC(e){if(pC(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var fC=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function pC(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")===fC}var z_=["POST","PUT","PATCH","DELETE"],mC=new Set(z_),gC=["GET",...z_],yC=new Set(gC),$_=new Set([301,302,303,307,308]),vC=new Set([307,308]),xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ds={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},_C=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),H_="remix-router-transitions",W_=Symbol("ResetLoaderData");function bC(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||[],o=e.mapRouteProperties||_C,s=o;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;s=U=>({...o(U),...cC(A.map(V=>V.route).filter(Boolean),U)})}let c={},u=Ms(e.routes,s,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||CC,y={...e.future},k=null,w=new Set,x=null,C=null,S=null,D=e.hydrationData!=null,L=Ta(u,e.history.location,f),R=!1,O=null,G,W;if(L==null&&!e.patchRoutesOnNavigation){let A=In(404,{pathname:e.history.location.pathname}),{matches:U,route:V}=dc(u);G=!0,W=!G,L=U,O={[V.id]:A}}else if(L&&!e.hydrationData&&Jr(L,u,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))G=!1,W=!G;else if(!L.some(A=>tp(A.route)))G=!0,W=!G;else{let A=e.hydrationData?e.hydrationData.loaderData:null,U=e.hydrationData?e.hydrationData.errors:null,V=L;if(U){let te=L.findIndex(ae=>U[ae.route.id]!==void 0);V=V.slice(0,te+1)}W=!1,G=V.every(te=>{let ae=K_(te.route,A,U);return W=W||ae.renderFallback,!ae.shouldLoad})}else{G=!1,W=!G,L=[];let A=Jr(null,u,e.history.location.pathname);A.active&&A.matches&&(R=!0,L=A.matches)}let z,P={historyAction:e.history.action,location:e.history.location,matches:L,initialized:G,renderFallback:W,navigation:xh,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||O,fetchers:new Map,blockers:new Map},Y="POP",X=null,ue=!1,se,Ae=!1,fe=new Map,le=null,pe=!1,Ne=!1,K=new Set,Z=new Map,H=0,I=-1,q=new Map,xe=new Set,Re=new Map,Pe=new Map,Te=new Set,Ge=new Map,Qe,Ue=null;function jt(){if(k=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=Tr({currentLocation:P.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(P.blockers);Ee.set(te,ds),pt({blockers:Ee})}}),X?.resolve(),X=null;return}return Wn(A,U)}),n){HC(t,fe);let A=()=>WC(t,fe);t.addEventListener("pagehide",A),le=()=>t.removeEventListener("pagehide",A)}return P.initialized||Wn("POP",P.location,{initialHydration:!0}),z}function Hn(){k&&k(),le&&le(),w.clear(),se&&se.abort(),P.fetchers.forEach((A,U)=>ki(U)),P.blockers.forEach((A,U)=>xi(U))}function Cr(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],me=ae.route;return me.element!==Ee.element||me.errorElement!==Ee.errorElement||me.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ae,route:Ee}:ae})),P={...P,...A};let V=[],te=[];P.fetchers.forEach((ae,Ee)=>{ae.state==="idle"&&(Te.has(Ee)?V.push(Ee):te.push(Ee))}),Te.forEach(ae=>{!P.fetchers.has(ae)&&!Z.has(ae)&&V.push(ae)}),[...w].forEach(ae=>ae(P,{deletedFetchers:V,newErrors:A.errors??null,viewTransitionOpts:U.viewTransitionOpts,flushSync:U.flushSync===!0})),V.forEach(ae=>ki(ae)),te.forEach(ae=>P.fetchers.delete(ae))}function en(A,U,{flushSync:V}={}){let te=P.actionData!=null&&P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&P.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;U.actionData?Object.keys(U.actionData).length>0?ae=U.actionData:ae=null:te?ae=P.actionData:ae=null;let Ee=U.loaderData?uv(P.loaderData,U.loaderData,U.matches||[],U.errors):P.loaderData,me=P.blockers;me.size>0&&(me=new Map(me),me.forEach((Ie,Le)=>me.set(Le,ds)));let De=pe?!1:Ao(A,U.matches||P.matches),he=ue===!0||P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&A.state?._isRedirect!==!0;h&&(u=h,h=void 0),pe||Y==="POP"||(Y==="PUSH"?e.history.push(A,A.state):Y==="REPLACE"&&e.history.replace(A,A.state));let Me;if(Y==="POP"){let Ie=fe.get(P.location.pathname);Ie&&Ie.has(A.pathname)?Me={currentLocation:P.location,nextLocation:A}:fe.has(A.pathname)&&(Me={currentLocation:A,nextLocation:P.location})}else if(Ae){let Ie=fe.get(P.location.pathname);Ie?Ie.add(A.pathname):(Ie=new Set([A.pathname]),fe.set(P.location.pathname,Ie)),Me={currentLocation:P.location,nextLocation:A}}pt({...U,actionData:ae,loaderData:Ee,historyAction:Y,location:A,initialized:!0,renderFallback:!1,navigation:xh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:he,blockers:me},{viewTransitionOpts:Me,flushSync:V===!0}),Y="POP",ue=!1,Ae=!1,pe=!1,Ne=!1,X?.resolve(),X=null,Ue?.resolve(),Ue=null}async function Po(A,U){if(X?.resolve(),X=null,typeof A=="number"){X||(X=pv());let ht=X.promise;return e.history.go(A),ht}let V=nf(P.location,P.matches,f,A,U?.fromRouteId,U?.relative),{path:te,submission:ae,error:Ee}=tv(!1,V,U),me;U?.unstable_mask&&(me={pathname:"",search:"",hash:"",...typeof U.unstable_mask=="string"?Kr(U.unstable_mask):{...P.location.unstable_mask,...U.unstable_mask}});let De=P.location,he=Ds(De,te,U&&U.state,void 0,me);he={...he,...e.history.encodeLocation(he)};let Me=U&&U.replace!=null?U.replace:void 0,Ie="PUSH";Me===!0?Ie="REPLACE":Me===!1||ae!=null&&Qt(ae.formMethod)&&ae.formAction===P.location.pathname+P.location.search&&(Ie="REPLACE");let Le=U&&"preventScrollReset"in U?U.preventScrollReset===!0:void 0,ot=(U&&U.flushSync)===!0,et=Tr({currentLocation:De,nextLocation:he,historyAction:Ie});if(et){Gn(et,{state:"blocked",location:he,proceed(){Gn(et,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),Po(A,U)},reset(){let ht=new Map(P.blockers);ht.set(et,ds),pt({blockers:ht})}});return}await Wn(Ie,he,{submission:ae,pendingError:Ee,preventScrollReset:Le,replace:U&&U.replace,enableViewTransition:U&&U.viewTransition,flushSync:ot,callSiteDefaultShouldRevalidate:U&&U.unstable_defaultShouldRevalidate})}function rl(){Ue||(Ue=pv()),Xr(),pt({revalidation:"loading"});let A=Ue.promise;return P.navigation.state==="submitting"?A:P.navigation.state==="idle"?(Wn(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),A):(Wn(Y||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:Ae===!0}),A)}async function Wn(A,U,V){se&&se.abort(),se=null,Y=A,pe=(V&&V.startUninterruptedRevalidation)===!0,cl(P.location,P.matches),ue=(V&&V.preventScrollReset)===!0,Ae=(V&&V.enableViewTransition)===!0;let te=h||u,ae=V&&V.overrideNavigation,Ee=V?.initialHydration&&P.matches&&P.matches.length>0&&!R?P.matches:Ta(te,U,f),me=(V&&V.flushSync)===!0;if(Ee&&P.initialized&&!Ne&&IC(P.location,U)&&!(V&&V.submission&&Qt(V.submission.formMethod))){en(U,{matches:Ee},{flushSync:me});return}let De=Jr(Ee,te,U.pathname);if(De.active&&De.matches&&(Ee=De.matches),!Ee){let{error:St,notFoundMatches:$t,route:lt}=Pi(U.pathname);en(U,{matches:$t,loaderData:{},errors:{[lt.id]:St}},{flushSync:me});return}se=new AbortController;let he=eo(e.history,U,se.signal,V&&V.submission),Me=e.getContext?await e.getContext():new Yy,Ie;if(V&&V.pendingError)Ie=[Ea(Ee).route.id,{type:"error",error:V.pendingError}];else if(V&&V.submission&&Qt(V.submission.formMethod)){let St=await al(he,U,V.submission,Ee,Me,De.active,V&&V.initialHydration===!0,{replace:V.replace,flushSync:me});if(St.shortCircuited)return;if(St.pendingActionResult){let[$t,lt]=St.pendingActionResult;if(Pn(lt)&&Is(lt.error)&&lt.error.status===404){se=null,en(U,{matches:St.matches,loaderData:{},errors:{[$t]:lt.error}});return}}Ee=St.matches||Ee,Ie=St.pendingActionResult,ae=Ph(U,V.submission),me=!1,De.active=!1,he=eo(e.history,he.url,he.signal)}let{shortCircuited:Le,matches:ot,loaderData:et,errors:ht}=await So(he,U,Ee,Me,De.active,ae,V&&V.submission,V&&V.fetcherSubmission,V&&V.replace,V&&V.initialHydration===!0,me,Ie,V&&V.callSiteDefaultShouldRevalidate);Le||(se=null,en(U,{matches:ot||Ee,...dv(Ie),loaderData:et,errors:ht}))}async function al(A,U,V,te,ae,Ee,me,De={}){Xr();let he=zC(U,V);if(pt({navigation:he},{flushSync:De.flushSync===!0}),Ee){let Le=await Ba(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}=dc(u);return{matches:et,pendingActionResult:[ht.id,{type:"error",error:Le.error}]}}let ot=Ea(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[ot,{type:"error",error:Le.error}]}}else if(Le.matches)te=Le.matches;else{let{notFoundMatches:ot,error:et,route:ht}=Pi(U.pathname);return{matches:ot,pendingActionResult:[ht.id,{type:"error",error:et}]}}}let Me,Ie=Tc(te,U);if(!Ie.route.action&&!Ie.route.lazy)Me={type:"error",error:In(405,{method:A.method,pathname:U.pathname,routeId:Ie.route.id})};else{let Le=lo(s,c,A,te,Ie,me?[]:a,ae),ot=await Zr(A,Le,ae,null);if(Me=ot[Ie.route.id],!Me){for(let et of te)if(ot[et.route.id]){Me=ot[et.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ni(Me)){let Le;return De&&De.replace!=null?Le=De.replace:Le=sv(Me.response.headers.get("Location"),new URL(A.url),f,e.history)===P.location.pathname+P.location.search,await lr(A,Me,!0,{submission:V,replace:Le}),{shortCircuited:!0}}if(Pn(Me)){let Le=Ea(te,Ie.route.id);return(De&&De.replace)!==!0&&(Y="PUSH"),{matches:te,pendingActionResult:[Le.route.id,Me,Ie.route.id]}}return{matches:te,pendingActionResult:[Ie.route.id,Me]}}async function So(A,U,V,te,ae,Ee,me,De,he,Me,Ie,Le,ot){let et=Ee||Ph(U,me),ht=me||De||fv(et),St=!pe&&!Me;if(ae){if(St){let Ut=qr(Le);pt({navigation:et,...Ut!==void 0?{actionData:Ut}:{}},{flushSync:Ie})}let He=await Ba(V,U.pathname,A.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:na,route:Rr}=dc(u);return{matches:na,loaderData:{},errors:{[Rr.id]:He.error}}}let Ut=Ea(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:na,route:Rr}=Pi(U.pathname);return{matches:na,loaderData:{},errors:{[Rr.id]:Ut}}}}let $t=h||u,{dsMatches:lt,revalidatingFetchers:rt}=nv(A,te,s,c,e.history,P,V,ht,U,Me?[]:a,Me===!0,Ne,K,Te,Re,xe,$t,f,e.patchRoutesOnNavigation!=null,Le,ot);if(I=++H,!e.dataStrategy&&!lt.some(He=>He.shouldLoad)&&!lt.some(He=>He.route.middleware&&He.route.middleware.length>0)&&rt.length===0){let He=bi();return en(U,{matches:V,loaderData:{},errors:Le&&Pn(Le[1])?{[Le[0]]:Le[1].error}:null,...dv(Le),...He?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Ie}),{shortCircuited:!0}}if(St){let He={};if(!ae){He.navigation=et;let Ut=qr(Le);Ut!==void 0&&(He.actionData=Ut)}rt.length>0&&(He.fetchers=Yr(rt)),pt(He,{flushSync:Ie})}rt.forEach(He=>{Kn(He.key),He.controller&&Z.set(He.key,He.controller)});let Er=()=>rt.forEach(He=>Kn(He.key));se&&se.signal.addEventListener("abort",Er);let{loaderResults:Ar,fetcherResults:qn}=await vi(lt,rt,A,te);if(A.signal.aborted)return{shortCircuited:!0};se&&se.signal.removeEventListener("abort",Er),rt.forEach(He=>Z.delete(He.key));let nn=hc(Ar);if(nn)return await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};if(nn=hc(qn),nn)return xe.add(nn.key),await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Lo,errors:ta}=cv(P,V,Ar,Le,rt,qn);Me&&P.errors&&(ta={...P.errors,...ta});let Tn=bi(),rn=wi(I),Si=Tn||rn||rt.length>0;return{matches:V,loaderData:Lo,errors:ta,...Si?{fetchers:new Map(P.fetchers)}:{}}}function qr(A){if(A&&!Pn(A[1]))return{[A[0]]:A[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function Yr(A){return A.forEach(U=>{let V=P.fetchers.get(U.key),te=hs(void 0,V?V.data:void 0);P.fetchers.set(U.key,te)}),new Map(P.fetchers)}async function Co(A,U,V,te){Kn(A);let ae=(te&&te.flushSync)===!0,Ee=h||u,me=nf(P.location,P.matches,f,V,U,te?.relative),De=Ta(Ee,me,f),he=Jr(De,Ee,me);if(he.active&&he.matches&&(De=he.matches),!De){tn(A,U,In(404,{pathname:me}),{flushSync:ae});return}let{path:Me,submission:Ie,error:Le}=tv(!0,me,te);if(Le){tn(A,U,Le,{flushSync:ae});return}let ot=e.getContext?await e.getContext():new Yy,et=(te&&te.preventScrollReset)===!0;if(Ie&&Qt(Ie.formMethod)){await il(A,U,Me,De,ot,he.active,ae,et,Ie,te&&te.unstable_defaultShouldRevalidate);return}Re.set(A,{routeId:U,path:Me}),await ol(A,U,Me,De,ot,he.active,ae,et,Ie)}async function il(A,U,V,te,ae,Ee,me,De,he,Me){Xr(),Re.delete(A);let Ie=P.fetchers.get(A);Cn(A,$C(he,Ie),{flushSync:me});let Le=new AbortController,ot=eo(e.history,V,Le.signal,he);if(Ee){let ut=await Ba(te,new URL(ot.url).pathname,ot.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){tn(A,U,ut.error,{flushSync:me});return}else if(ut.matches)te=ut.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let et=Tc(te,V);if(!et.route.action&&!et.route.lazy){let ut=In(405,{method:he.formMethod,pathname:V,routeId:U});tn(A,U,ut,{flushSync:me});return}Z.set(A,Le);let ht=H,St=lo(s,c,ot,te,et,a,ae),$t=await Zr(ot,St,ae,A),lt=$t[et.route.id];if(!lt){for(let ut of St)if($t[ut.route.id]){lt=$t[ut.route.id];break}}if(ot.signal.aborted){Z.get(A)===Le&&Z.delete(A);return}if(Te.has(A)){if(ni(lt)||Pn(lt)){Cn(A,Vr(void 0));return}}else{if(ni(lt))if(Z.delete(A),I>ht){Cn(A,Vr(void 0));return}else return xe.add(A),Cn(A,hs(he)),lr(ot,lt,!1,{fetcherSubmission:he,preventScrollReset:De});if(Pn(lt)){tn(A,U,lt.error);return}}let rt=P.navigation.location||P.location,Er=eo(e.history,rt,Le.signal),Ar=h||u,qn=P.navigation.state!=="idle"?Ta(Ar,P.navigation.location,f):P.matches;Xe(qn,"Didn't find any matches after fetcher action");let nn=++H;q.set(A,nn);let Lo=hs(he,lt.data);P.fetchers.set(A,Lo);let{dsMatches:ta,revalidatingFetchers:Tn}=nv(Er,ae,s,c,e.history,P,qn,he,rt,a,!1,Ne,K,Te,Re,xe,Ar,f,e.patchRoutesOnNavigation!=null,[et.route.id,lt],Me);Tn.filter(ut=>ut.key!==A).forEach(ut=>{let Lr=ut.key,ra=P.fetchers.get(Lr),Ci=hs(void 0,ra?ra.data:void 0);P.fetchers.set(Lr,Ci),Kn(Lr),ut.controller&&Z.set(Lr,ut.controller)}),pt({fetchers:new Map(P.fetchers)});let rn=()=>Tn.forEach(ut=>Kn(ut.key));Le.signal.addEventListener("abort",rn);let{loaderResults:Si,fetcherResults:He}=await vi(ta,Tn,Er,ae);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",rn),q.delete(A),Z.delete(A),Tn.forEach(ut=>Z.delete(ut.key)),P.fetchers.has(A)){let ut=Vr(lt.data);P.fetchers.set(A,ut)}let Ut=hc(Si);if(Ut)return lr(Er,Ut.result,!1,{preventScrollReset:De});if(Ut=hc(He),Ut)return xe.add(Ut.key),lr(Er,Ut.result,!1,{preventScrollReset:De});let{loaderData:na,errors:Rr}=cv(P,qn,Si,void 0,Tn,He);wi(nn),P.navigation.state==="loading"&&nn>I?(Xe(Y,"Expected pending action"),se&&se.abort(),en(P.navigation.location,{matches:qn,loaderData:na,errors:Rr,fetchers:new Map(P.fetchers)})):(pt({errors:Rr,loaderData:uv(P.loaderData,na,qn,Rr),fetchers:new Map(P.fetchers)}),Ne=!1)}async function ol(A,U,V,te,ae,Ee,me,De,he){let Me=P.fetchers.get(A);Cn(A,hs(he,Me?Me.data:void 0),{flushSync:me});let Ie=new AbortController,Le=eo(e.history,V,Ie.signal);if(Ee){let lt=await Ba(te,new URL(Le.url).pathname,Le.signal,A);if(lt.type==="aborted")return;if(lt.type==="error"){tn(A,U,lt.error,{flushSync:me});return}else if(lt.matches)te=lt.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let ot=Tc(te,V);Z.set(A,Ie);let et=H,ht=lo(s,c,Le,te,ot,a,ae),$t=(await Zr(Le,ht,ae,A))[ot.route.id];if(Z.get(A)===Ie&&Z.delete(A),!Le.signal.aborted){if(Te.has(A)){Cn(A,Vr(void 0));return}if(ni($t))if(I>et){Cn(A,Vr(void 0));return}else{xe.add(A),await lr(Le,$t,!1,{preventScrollReset:De});return}if(Pn($t)){tn(A,U,$t.error);return}Cn(A,Vr($t.data))}}async function lr(A,U,V,{submission:te,fetcherSubmission:ae,preventScrollReset:Ee,replace:me}={}){V||(X?.resolve(),X=null),U.response.headers.has("X-Remix-Revalidate")&&(Ne=!0);let De=U.response.headers.get("Location");Xe(De,"Expected a Location header on the redirect Response"),De=sv(De,new URL(A.url),f,e.history);let he=Ds(P.location,De,{_isRedirect:!0});if(n){let ht=!1;if(U.response.headers.has("X-Remix-Reload-Document"))ht=!0;else if(Jf(De)){const St=I_(De,!0);ht=St.origin!==t.location.origin||Un(St.pathname,f)==null}if(ht){me?t.location.replace(De):t.location.assign(De);return}}se=null;let Me=me===!0||U.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ie,formAction:Le,formEncType:ot}=P.navigation;!te&&!ae&&Ie&&Le&&ot&&(te=fv(P.navigation));let et=te||ae;if(vC.has(U.response.status)&&et&&Qt(et.formMethod))await Wn(Me,he,{submission:{...et,formAction:De},preventScrollReset:Ee||ue,enableViewTransition:V?Ae:void 0});else{let ht=Ph(he,te);await Wn(Me,he,{overrideNavigation:ht,fetcherSubmission:ae,preventScrollReset:Ee||ue,enableViewTransition:V?Ae:void 0})}}async function Zr(A,U,V,te){let ae,Ee={};try{ae=await EC(m,A,U,te,V,!1)}catch(me){return U.filter(De=>De.shouldLoad).forEach(De=>{Ee[De.route.id]={type:"error",error:me}}),Ee}if(A.signal.aborted)return Ee;if(!Qt(A.method))for(let me of U){if(ae[me.route.id]?.type==="error")break;!ae.hasOwnProperty(me.route.id)&&!P.loaderData.hasOwnProperty(me.route.id)&&(!P.errors||!P.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(ae[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,De]of Object.entries(ae))if(UC(De)){let he=De.result;Ee[me]={type:"redirect",response:DC(he,A,me,U,f)}}else Ee[me]=await LC(De);return Ee}async function vi(A,U,V,te){let ae=Zr(V,A,te,null),Ee=Promise.all(U.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ie=(await Zr(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:Ie}}else return Promise.resolve({[he.key]:{type:"error",error:In(404,{pathname:he.path})}})})),me=await ae,De=(await Ee).reduce((he,Me)=>Object.assign(he,Me),{});return{loaderResults:me,fetcherResults:De}}function Xr(){Ne=!0,Re.forEach((A,U)=>{Z.has(U)&&K.add(U),Kn(U)})}function Cn(A,U,V={}){P.fetchers.set(A,U),pt({fetchers:new Map(P.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function tn(A,U,V,te={}){let ae=Ea(P.matches,U);ki(A),pt({errors:{[ae.route.id]:V},fetchers:new Map(P.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Qr(A){return Pe.set(A,(Pe.get(A)||0)+1),Te.has(A)&&Te.delete(A),P.fetchers.get(A)||kC}function Ou(A,U){Kn(A,U?.reason),Cn(A,Vr(null))}function ki(A){let U=P.fetchers.get(A);Z.has(A)&&!(U&&U.state==="loading"&&q.has(A))&&Kn(A),Re.delete(A),q.delete(A),xe.delete(A),Te.delete(A),K.delete(A),P.fetchers.delete(A)}function sl(A){let U=(Pe.get(A)||0)-1;U<=0?(Pe.delete(A),Te.add(A)):Pe.set(A,U),pt({fetchers:new Map(P.fetchers)})}function Kn(A,U){let V=Z.get(A);V&&(V.abort(U),Z.delete(A))}function _i(A){for(let U of A){let V=Qr(U),te=Vr(V.data);P.fetchers.set(U,te)}}function bi(){let A=[],U=!1;for(let V of xe){let te=P.fetchers.get(V);Xe(te,`Expected fetcher: ${V}`),te.state==="loading"&&(xe.delete(V),A.push(V),U=!0)}return _i(A),U}function wi(A){let U=[];for(let[V,te]of q)if(te<A){let ae=P.fetchers.get(V);Xe(ae,`Expected fetcher: ${V}`),ae.state==="loading"&&(Kn(V),q.delete(V),U.push(V))}return _i(U),U.length>0}function To(A,U){let V=P.blockers.get(A)||ds;return Ge.get(A)!==U&&Ge.set(A,U),V}function xi(A){P.blockers.delete(A),Ge.delete(A)}function Gn(A,U){let V=P.blockers.get(A)||ds;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(P.blockers);te.set(A,U),pt({blockers:te})}function Tr({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],me=P.blockers.get(ae);if(!(me&&me.state==="proceeding")&&Ee({currentLocation:A,nextLocation:U,historyAction:V}))return ae}function Pi(A){let U=In(404,{pathname:A}),V=h||u,{matches:te,route:ae}=dc(V);return{notFoundMatches:te,route:ae,error:U}}function ll(A,U,V){if(x=A,S=U,C=V||null,!D&&P.navigation===xh){D=!0;let te=Ao(P.location,P.matches);te!=null&&pt({restoreScrollPosition:te})}return()=>{x=null,S=null,C=null}}function Eo(A,U){return C&&C(A,U.map(te=>WS(te,P.loaderData)))||A.key}function cl(A,U){if(x&&S){let V=Eo(A,U);x[V]=S()}}function Ao(A,U){if(x){let V=Eo(A,U),te=x[V];if(typeof te=="number")return te}return null}function Jr(A,U,V){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:vs(U,V,f,!0)}}else return{active:!0,matches:vs(U,V,f,!0)||[]};return{active:!1,matches:null}}async function Ba(A,U,V,te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let Ee=h==null,me=h||u,De=c;try{await e.patchRoutesOnNavigation({signal:V,path:U,matches:ae,fetcherKey:te,patch:(Ie,Le)=>{V.aborted||rv(Ie,Le,me,De,s,!1)}})}catch(Ie){return{type:"error",error:Ie,partialMatches:ae}}finally{Ee&&!V.aborted&&(u=[...u])}if(V.aborted)return{type:"aborted"};let he=Ta(me,U,f),Me=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(Me=vs(me,U,f,!0),!(Me&&ae.length<Me.length&&ea(ae,Me.slice(0,ae.length))))return{type:"success",matches:he}}if(Me||(Me=vs(me,U,f,!0)),!Me||ea(ae,Me))return{type:"success",matches:null};ae=Me}}function ea(A,U){return A.length===U.length&&A.every((V,te)=>V.route.id===U[te].route.id)}function Ro(A){c={},h=Ms(A,s,void 0,c)}function Fa(A,U,V=!1){let te=h==null;rv(A,U,h||u,c,s,V),te&&(u=[...u],pt({}))}return z={get basename(){return f},get future(){return y},get state(){return P},get routes(){return u},get window(){return t},initialize:jt,subscribe:Cr,enableScrollRestoration:ll,navigate:Po,fetch:Co,revalidate:rl,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Qr,resetFetcher:Ou,deleteFetcher:sl,dispose:Hn,getBlocker:To,deleteBlocker:xi,patchRoutes:Fa,_internalFetchControllers:Z,_internalSetRoutes:Ro,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){pt(A)}},e.unstable_instrumentations&&(z=uC(z,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),z}function wC(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nf(e,t,n,a,o,s){let c,u;if(o){c=[];for(let f of t)if(c.push(f),f.route.id===o){u=f;break}}else c=t,u=t[t.length-1];let h=_u(a||".",ep(c),Un(e.pathname,n)||e.pathname,s==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&u){let f=rp(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 k=m.toString();h.search=k?`?${k}`:""}}return n!=="/"&&(h.pathname=aC({basename:n,pathname:h.pathname})),kr(h)}function tv(e,t,n){if(!n||!wC(n))return{path:t};if(n.formMethod&&!VC(n.formMethod))return{path:t,error:In(405,{method:n.formMethod})};let a=()=>({path:t,error:In(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=Q_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Qt(s))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((k,[w,x])=>`${k}${w}=${x}
10
+ `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Qt(s))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,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=af(n.formData),h=n.formData;else if(n.body instanceof FormData)u=af(n.body),h=n.body;else if(n.body instanceof URLSearchParams)u=n.body,h=lv(u);else if(n.body==null)u=new URLSearchParams,h=new FormData;else try{u=new URLSearchParams(n.body),h=lv(u)}catch{return a()}let f={formMethod:s,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=Kr(t);return e&&m.search&&rp(m.search)&&u.append("index",""),m.search=`?${u}`,{path:kr(m),submission:f}}function nv(e,t,n,a,o,s,c,u,h,f,m,y,k,w,x,C,S,D,L,R,O){let G=R?Pn(R[1])?R[1].error:R[1].data:void 0,W=o.createURL(s.location),z=o.createURL(h),P;if(m&&s.errors){let le=Object.keys(s.errors)[0];P=c.findIndex(pe=>pe.route.id===le)}else if(R&&Pn(R[1])){let le=R[0];P=c.findIndex(pe=>pe.route.id===le)-1}let Y=R?R[1].statusCode:void 0,X=Y&&Y>=400,ue={currentUrl:W,currentParams:s.matches[0]?.params||{},nextUrl:z,nextParams:c[0].params,...u,actionResult:G,actionStatus:Y},se=$s(c),Ae=c.map((le,pe)=>{let{route:Ne}=le,K=null;if(P!=null&&pe>P)K=!1;else if(Ne.lazy)K=!0;else if(!tp(Ne))K=!1;else if(m){let{shouldLoad:q}=K_(Ne,s.loaderData,s.errors);K=q}else xC(s.loaderData,s.matches[pe],le)&&(K=!0);if(K!==null)return rf(n,a,e,se,le,f,t,K);let Z=!1;typeof O=="boolean"?Z=O:X?Z=!1:(y||W.pathname+W.search===z.pathname+z.search||W.search!==z.search||PC(s.matches[pe],le))&&(Z=!0);let H={...ue,defaultShouldRevalidate:Z},I=ws(le,H);return rf(n,a,e,se,le,f,t,I,H,O)}),fe=[];return x.forEach((le,pe)=>{if(m||!c.some(Re=>Re.route.id===le.routeId)||w.has(pe))return;let Ne=s.fetchers.get(pe),K=Ne&&Ne.state!=="idle"&&Ne.data===void 0,Z=Ta(S,le.path,D);if(!Z){if(L&&K)return;fe.push({key:pe,routeId:le.routeId,path:le.path,matches:null,match:null,request:null,controller:null});return}if(C.has(pe))return;let H=Tc(Z,le.path),I=new AbortController,q=eo(o,le.path,I.signal),xe=null;if(k.has(pe))k.delete(pe),xe=lo(n,a,q,Z,H,f,t);else if(K)y&&(xe=lo(n,a,q,Z,H,f,t));else{let Re;typeof O=="boolean"?Re=O:X?Re=!1:Re=y;let Pe={...ue,defaultShouldRevalidate:Re};ws(H,Pe)&&(xe=lo(n,a,q,Z,H,f,t,Pe))}xe&&fe.push({key:pe,routeId:le.routeId,path:le.path,matches:xe,match:H,request:q,controller:I})}),{dsMatches:Ae,revalidatingFetchers:fe}}function tp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function K_(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!tp(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let s=!a&&!o;return{shouldLoad:s,renderFallback:s}}function xC(e,t,n){let a=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return a||o}function PC(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ws(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function rv(e,t,n,a,o,s){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=>G_(f,y));m?h.push({existingRoute:m,newRoute:f}):u.push(f)}),u.length>0){let f=Ms(u,o,[e||"_","patch",String(c?.length||"0")],a);c.push(...f)}if(s&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:y}=h[f],k=m,[w]=Ms([y],o,[],{},!0);Object.assign(k,{element:w.element?w.element:k.element,errorElement:w.errorElement?w.errorElement:k.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:k.hydrateFallbackElement})}}function G_(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(o=>G_(n,o)))??!1:!1}var av=new WeakMap,q_=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let o=n[t.id];if(Xe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=av.get(o);c||(c={},av.set(o,c));let u=c[e];if(u)return u;let h=(async()=>{let f=VS(e),y=o[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 "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let k=await s();k!=null&&(Object.assign(o,{[e]:k}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(k=>k===void 0)&&(o.lazy=void 0))})();return c[e]=h,h},iv=new WeakMap;function SC(e,t,n,a,o){let s=n[e.id];if(Xe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=iv.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{Xe(typeof e.lazy=="function","No lazy route function found");let k=await e.lazy(),w={};for(let x in k){let C=k[x];if(C===void 0)continue;let S=$S(x),L=s[x]!==void 0&&x!=="hasErrorBoundary";S?Et(!S,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?Et(!L,`Route "${s.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]=C}Object.assign(s,w),Object.assign(s,{...a(s),lazy:void 0})})();return iv.set(s,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],h;for(let m of c){if(o&&o.includes(m))continue;let y=q_({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 ov(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function CC(e){return e.matches.some(t=>t.route.middleware)?Y_(e,()=>ov(e)):ov(e)}function Y_(e,t){return TC(e,t,a=>{if(FC(a))throw a;return a},OC,n);function n(a,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:a}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(f=>f.route.id===o),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=Ea(c,c[u].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function TC(e,t,n,a,o){let{matches:s,request:c,params:u,context:h,unstable_pattern:f}=e,m=s.flatMap(k=>k.route.middleware?k.route.middleware.map(w=>[k.route.id,w]):[]);return await Z_({request:c,params:u,context:h,unstable_pattern:f},m,t,n,a,o)}async function Z_(e,t,n,a,o,s,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,k=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Z_(e,t,n,a,o,s,c+1)},y.value}catch(w){return y={value:await s(w,f,y)},y.value}};try{let w=await m(e,k),x=w!=null?a(w):void 0;return o(x)?x:y?x??y.value:(y={value:await k()},y.value)}catch(w){return await s(w,f,y)}}function X_(e,t,n,a,o){let s=q_({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=SC(a.route,Qt(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function rf(e,t,n,a,o,s,c,u,h=null,f){let m=!1,y=X_(e,t,n,o,s);return{...o,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:h,shouldCallHandler(k){return m=!0,h?typeof f=="boolean"?ws(o,{...h,defaultShouldRevalidate:f}):typeof k=="boolean"?ws(o,{...h,defaultShouldRevalidate:k}):ws(o,h):u},resolve(k){let{lazy:w,loader:x,middleware:C}=o.route,S=m||u||k&&!Qt(n.method)&&(w||x),D=C&&C.length>0&&!x&&!w;return S&&(Qt(n.method)||!D)?AC({request:n,unstable_pattern:a,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:k,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function lo(e,t,n,a,o,s,c,u=null){return a.map(h=>h.route.id!==o.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:X_(e,t,n,h,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rf(e,t,n,$s(a),h,s,c,!0,u))}async function EC(e,t,n,a,o,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:$s(n),params:n[0].params,context:o,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let m=c;return Y_(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 AC({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let u,h,f=Qt(e.method),m=f?"action":"loader",y=k=>{let w,x=new Promise((D,L)=>w=L);h=()=>w(),e.signal.addEventListener("abort",h);let C=D=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):k({request:e,unstable_pattern:t,params:n.params,context:c},...D!==void 0?[D]:[]),S=(async()=>{try{return{type:"data",result:await(s?s(L=>C(L)):C())}}catch(D){return{type:"error",result:D}}})();return Promise.race([S,x])};try{let k=f?n.route.action:n.route.loader;if(a||o)if(k){let w,[x]=await Promise.all([y(k).catch(C=>{w=C}),a,o]);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),o]);else if(m==="action"){let x=new URL(e.url),C=x.pathname+x.search;throw In(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(k)u=await y(k);else{let w=new URL(e.url),x=w.pathname+w.search;throw In(404,{pathname:x})}}catch(k){return{type:"error",result:k}}finally{h&&e.signal.removeEventListener("abort",h)}return u}async function RC(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 LC(e){let{result:t,type:n}=e;if(np(t)){let a;try{a=await RC(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new zs(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return n==="error"?hv(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:NC(t),statusCode:Is(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Is(t)?t.status:void 0}:hv(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 DC(e,t,n,a,o){let s=e.headers.get("Location");if(Xe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jf(s)){let c=a.slice(0,a.findIndex(u=>u.route.id===n)+1);s=nf(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function sv(e,t,n,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jf(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(o.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 s=a.createURL(e);if(o.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function eo(e,t,n,a){let o=e.createURL(Q_(t)).toString(),s={signal:n};if(a&&Qt(a.formMethod)){let{formMethod:c,formEncType:u}=a;s.method=c.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(a.json)):u==="text/plain"?s.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?s.body=af(a.formData):s.body=a.formData}return new Request(o,s)}function af(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function lv(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function MC(e,t,n,a=!1,o=!1){let s={},c=null,u,h=!1,f={},m=n&&Pn(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let k=y.route.id,w=t[k];if(Xe(!ni(w),"Cannot handle redirect results in processLoaderData"),Pn(w)){let x=w.error;if(m!==void 0&&(x=m,m=void 0),c=c||{},o)c[k]=x;else{let C=Ea(e,k);c[C.route.id]==null&&(c[C.route.id]=x)}a||(s[k]=W_),h||(h=!0,u=Is(w.error)?w.error.status:500),w.headers&&(f[k]=w.headers)}else s[k]=w.data,w.statusCode&&w.statusCode!==200&&!h&&(u=w.statusCode),w.headers&&(f[k]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:f}}function cv(e,t,n,a,o,s){let{loaderData:c,errors:u}=MC(t,n,a);return o.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 k=s[f];if(Xe(k,"Did not find corresponding fetcher result"),Pn(k)){let w=Ea(e.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:k.error}),e.fetchers.delete(f)}else if(ni(k))Xe(!1,"Unhandled fetcher revalidation redirect");else{let w=Vr(k.data);e.fetchers.set(f,w)}}),{loaderData:c,errors:u}}function uv(e,t,n,a){let o=Object.entries(t).filter(([,s])=>s!==W_).reduce((s,[c,u])=>(s[c]=u,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),a&&a.hasOwnProperty(c))break}return o}function dv(e){return e?Pn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ea(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 dc(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 In(e,{pathname:t,routeId:n,method:a,type:o,message:s}={}){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.`:o==="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 zs(e||500,c,new Error(u),!0)}function hc(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,o]=t[n];if(ni(o))return{key:a,result:o}}}function Q_(e){let t=typeof e=="string"?Kr(e):e;return kr({...t,hash:""})}function IC(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function NC(e){return new zs(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function OC(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&jC(n))}function jC(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function UC(e){return np(e.result)&&$_.has(e.result.status)}function Pn(e){return e.type==="error"}function ni(e){return(e&&e.type)==="redirect"}function hv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function np(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function BC(e){return $_.has(e)}function FC(e){return np(e)&&BC(e.status)&&e.headers.has("Location")}function VC(e){return yC.has(e.toUpperCase())}function Qt(e){return mC.has(e.toUpperCase())}function rp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Tc(e,t){let n=typeof t=="string"?Kr(t).search:t.search;if(e[e.length-1].route.index&&rp(n||""))return e[e.length-1];let a=U_(e);return a[a.length-1]}function fv(e){let{formMethod:t,formAction:n,formEncType:a,text:o,formData:s,json:c}=e;if(!(!t||!n||!a)){if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,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 Ph(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 zC(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 hs(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 $C(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 HC(e,t){try{let n=e.sessionStorage.getItem(H_);if(n){let a=JSON.parse(n);for(let[o,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function WC(e,t){if(t.size>0){let n={};for(let[a,o]of t)n[a]=[...o];try{e.sessionStorage.setItem(H_,JSON.stringify(n))}catch(a){Et(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function pv(){let e,t,n=new Promise((a,o)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var pi=b.createContext(null);pi.displayName="DataRouter";var Hs=b.createContext(null);Hs.displayName="DataRouterState";var J_=b.createContext(!1);function KC(){return b.useContext(J_)}var ap=b.createContext({isTransitioning:!1});ap.displayName="ViewTransition";var eb=b.createContext(new Map);eb.displayName="Fetchers";var GC=b.createContext(null);GC.displayName="Await";var Bn=b.createContext(null);Bn.displayName="Navigation";var bu=b.createContext(null);bu.displayName="Location";var Gr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Gr.displayName="Route";var ip=b.createContext(null);ip.displayName="RouteError";var tb="REACT_ROUTER_ERROR",qC="REDIRECT",YC="ROUTE_ERROR_RESPONSE";function ZC(e){if(e.startsWith(`${tb}:${qC}:{`))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 XC(e){if(e.startsWith(`${tb}:${YC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new zs(t.status,t.statusText,t.data)}catch{}}function QC(e,{relative:t}={}){Xe(Ws(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(Bn),{hash:o,pathname:s,search:c}=Ks(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ir([n,s])),a.createHref({pathname:u,search:c,hash:o})}function Ws(){return b.useContext(bu)!=null}function Fn(){return Xe(Ws(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(bu).location}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rb(e){b.useContext(Bn).static||b.useLayoutEffect(e)}function wu(){let{isDataRoute:e}=b.useContext(Gr);return e?d1():JC()}function JC(){Xe(Ws(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(pi),{basename:t,navigator:n}=b.useContext(Bn),{matches:a}=b.useContext(Gr),{pathname:o}=Fn(),s=JSON.stringify(ep(a)),c=b.useRef(!1);return rb(()=>{c.current=!0}),b.useCallback((h,f={})=>{if(Et(c.current,nb),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=_u(h,JSON.parse(s),o,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,s,o,e])}b.createContext(null);function Ks(e,{relative:t}={}){let{matches:n}=b.useContext(Gr),{pathname:a}=Fn(),o=JSON.stringify(ep(n));return b.useMemo(()=>_u(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function e1(e,t,n){Xe(Ws(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(Bn),{matches:o}=b.useContext(Gr),s=o[o.length-1],c=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",f=s&&s.route;{let S=f&&f.path||"";ib(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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
11
 
12
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=Fn(),y;y=m;let k=y.pathname||"/",w=k;if(h!=="/"){let S=h.replace(/^\//,"").split("/");w="/"+k.replace(/^\//,"").split("/").slice(S.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.`),a1(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:ir([h,a.encodeLocation?a.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:ir([h,a.encodeLocation?a.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,n)}function e1(){let e=c1(),t=Ms(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)",o={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:o},n):null,c)}var t1=b.createElement(e1,null),ab=class extends b.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=ZC(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Gr.Provider,{value:this.props.routeContext},b.createElement(ip.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(n1,{error:e},t):t}};ab.contextType=J_;var Sh=new WeakMap;function n1({children:e,error:t}){let{basename:n}=b.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=YC(t.digest);if(a){let o=Sh.get(t);if(o)throw o;let s=F_(a.location,n);if(B_&&!Sh.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw Sh.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function r1({routeContext:e,match:t,children:n}){let a=b.useContext(pi);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Gr.Provider,{value:e},n)}function a1(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 o=e,s=a?.errors;if(s!=null){let m=o.findIndex(y=>y.route.id&&s?.[y.route.id]!==void 0);Xe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,u=-1;if(n&&a){c=a.renderFallback;for(let m=0;m<o.length;m++){let y=o[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(u=m),y.route.id){let{loaderData:k,errors:w}=a,x=y.route.loader&&!k.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||x){n.isStatic&&(c=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let h=n?.onError,f=a&&h?(m,y)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:zs(a.matches),errorInfo:y})}:void 0;return o.reduceRight((m,y,k)=>{let w,x=!1,C=null,S=null;a&&(w=s&&y.route.id?s[y.route.id]:void 0,C=y.route.errorElement||t1,c&&(u<0&&k===0?(ib("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):u===k&&(x=!0,S=y.route.hydrateFallbackElement||null)));let D=t.concat(o.slice(0,k+1)),L=()=>{let R;return w?R=C:x?R=S:y.route.Component?R=b.createElement(y.route.Component,null):y.route.element?R=y.route.element:R=m,b.createElement(r1,{match:y,routeContext:{outlet:m,matches:D,isDataRoute:a!=null},children:R})};return a&&(y.route.ErrorBoundary||y.route.errorElement||k===0)?b.createElement(ab,{location:a.location,revalidation:a.revalidation,component:C,error:w,children:L(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:f}):L()},null)}function op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function i1(e){let t=b.useContext(pi);return Xe(t,op(e)),t}function o1(e){let t=b.useContext($s);return Xe(t,op(e)),t}function s1(e){let t=b.useContext(Gr);return Xe(t,op(e)),t}function sp(e){let t=s1(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 l1(){return sp("useRouteId")}function c1(){let e=b.useContext(ip),t=o1("useRouteError"),n=sp("useRouteError");return e!==void 0?e:t.errors?.[n]}function u1(){let{router:e}=i1("useNavigate"),t=sp("useNavigate"),n=b.useRef(!1);return rb(()=>{n.current=!0}),b.useCallback(async(o,s={})=>{Et(n.current,nb),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var mv={};function ib(e,t,n){!t&&!mv[e]&&(mv[e]=!0,Et(!1,n))}var gv={};function yv(e,t){!e&&!gv[t]&&(gv[t]=!0,console.warn(t))}var d1="useOptimistic",vv=ES[d1],h1=()=>{};function f1(e){return vv?vv(e):[e,h1]}function p1(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:b.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:b.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:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var m1=["HydrateFallback","hydrateFallbackElement"],g1=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 y1({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=WC()||a;let[s,c]=b.useState(e.state),[u,h]=f1(s),[f,m]=b.useState(),[y,k]=b.useState({isTransitioning:!1}),[w,x]=b.useState(),[C,S]=b.useState(),[D,L]=b.useState(),R=b.useRef(new Map),O=b.useCallback((P,{deletedFetchers:Y,newErrors:X,flushSync:ue,viewTransitionOpts:se})=>{X&&n&&Object.values(X).forEach(fe=>n(fe,{location:P.location,params:P.matches[0]?.params??{},unstable_pattern:zs(P.matches)})),P.fetchers.forEach((fe,le)=>{fe.data!==void 0&&R.current.set(le,fe.data)}),Y.forEach(fe=>R.current.delete(fe)),yv(ue===!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(yv(se==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."),!se||!Ae){t&&ue?t(()=>c(P)):a===!1?c(P):b.startTransition(()=>{a===!0&&h(fe=>kv(fe,P)),c(P)});return}if(t&&ue){t(()=>{C&&(w?.resolve(),C.skipTransition()),k({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let fe=e.window.document.startViewTransition(()=>{t(()=>c(P))});fe.finished.finally(()=>{t(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})})}),t(()=>S(fe));return}C?(w?.resolve(),C.skipTransition(),L({state:P,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(m(P),k({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[e.window,t,C,w,a,h,n]);b.useLayoutEffect(()=>e.subscribe(O),[e,O]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&x(new g1)},[y]),b.useEffect(()=>{if(w&&f&&e.window){let P=f,Y=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?c(P):b.startTransition(()=>{a===!0&&h(ue=>kv(ue,P)),c(P)}),await Y});X.finished.finally(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})}),S(X)}},[f,w,e.window,a,h]),b.useEffect(()=>{w&&f&&u.location.key===f.location.key&&w.resolve()},[w,C,u.location,f]),b.useEffect(()=>{!y.isTransitioning&&D&&(m(D.state),k({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),L(void 0))},[y.isTransitioning,D]);let G=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,Y,X)=>e.navigate(P,{state:Y,preventScrollReset:X?.preventScrollReset}),replace:(P,Y,X)=>e.navigate(P,{replace:!0,state:Y,preventScrollReset:X?.preventScrollReset})}),[e]),W=e.basename||"/",z=b.useMemo(()=>({router:e,navigator:G,static:!1,basename:W,onError:n}),[e,G,W,n]);return b.createElement(b.Fragment,null,b.createElement(pi.Provider,{value:z},b.createElement($s.Provider,{value:u},b.createElement(eb.Provider,{value:R.current},b.createElement(ap.Provider,{value:y},b.createElement(_1,{basename:W,location:u.location,navigationType:u.historyAction,navigator:G,unstable_useTransitions:a},b.createElement(v1,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function kv(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 v1=b.memo(k1);function k1({routes:e,future:t,state:n,isStatic:a,onError:o}){return JC(e,void 0,{state:n,isStatic:a,onError:o})}function _1({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){Xe(!Hs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[u,o,s,c]);typeof n=="string"&&(n=Kr(n));let{pathname:f="/",search:m="",hash:y="",state:k=null,key:w="default",unstable_mask:x}=n,C=b.useMemo(()=>{let S=Un(f,u);return S==null?null:{location:{pathname:S,search:m,hash:y,state:k,key:w,unstable_mask:x},navigationType:a}},[u,f,m,y,k,w,a,x]);return Et(C!=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.`),C==null?null:b.createElement(Bn.Provider,{value:h},b.createElement(bu.Provider,{children:t,value:C}))}var Ec="get",Ac="application/x-www-form-urlencoded";function xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function b1(e){return xu(e)&&e.tagName.toLowerCase()==="button"}function w1(e){return xu(e)&&e.tagName.toLowerCase()==="form"}function x1(e){return xu(e)&&e.tagName.toLowerCase()==="input"}function P1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S1(e,t){return e.button===0&&(!t||t==="_self")&&!P1(e)}function of(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(o=>[n,o]):[[n,a]])},[]))}function C1(e,t){let n=of(e);return t&&t.forEach((a,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var fc=null;function T1(){if(fc===null)try{new FormData(document.createElement("form"),0),fc=!1}catch{fc=!0}return fc}var E1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ch(e){return e!=null&&!E1.has(e)?(Et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ac}"`),null):e}function A1(e,t){let n,a,o,s,c;if(w1(e)){let u=e.getAttribute("action");a=u?Un(u,t):null,n=e.getAttribute("method")||Ec,o=Ch(e.getAttribute("enctype"))||Ac,s=new FormData(e)}else if(b1(e)||x1(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")||Ec,o=Ch(e.getAttribute("formenctype"))||Ch(u.getAttribute("enctype"))||Ac,s=new FormData(u,e),!T1()){let{name:f,type:m,value:y}=e;if(m==="image"){let k=f?`${f}.`:"";s.append(`${k}x`,"0"),s.append(`${k}y`,"0")}else f&&s.append(f,y)}}else{if(xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ec,a=null,o=Ac,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:a,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function R1(e,t,n,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&Un(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function L1(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 D1(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 M1(e,t,n){let a=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await L1(s,n);return c.links?c.links():[]}return[]}));return j1(a.flat(1).filter(D1).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function _v(e,t,n,a,o,s){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 s==="assets"?t.filter((h,f)=>c(h,f)||u(h,f)):s==="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(o.pathname+o.search+o.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 I1(e,t,{includeHydrateFallback:n}={}){return N1(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function N1(e){return[...new Set(e)]}function O1(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function j1(e,t){let n=new Set;return new Set(t),e.reduce((a,o)=>{let s=JSON.stringify(O1(o));return n.has(s)||(n.add(s),a.push({key:s,link:o})),a},[])}function ob(){let e=b.useContext(pi);return lp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function U1(){let e=b.useContext($s);return lp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cp=b.createContext(void 0);cp.displayName="FrameworkContext";function sb(){let e=b.useContext(cp);return lp(e,"You must render this element inside a <HydratedRouter> element"),e}function B1(e,t){let n=b.useContext(cp),[a,o]=b.useState(!1),[s,c]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:y}=t,k=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=D=>{D.forEach(L=>{c(L.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return k.current&&S.observe(k.current),()=>{S.disconnect()}}},[e]),b.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let w=()=>{o(!0)},x=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,k,{}]:[s,k,{onFocus:hs(u,w),onBlur:hs(h,x),onMouseEnter:hs(f,w),onMouseLeave:hs(m,x),onTouchStart:hs(y,w)}]:[!1,k,{}]}function hs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function F1({page:e,...t}){let{router:n}=ob(),a=b.useMemo(()=>Ta(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(z1,{page:e,matches:a,...t}):null}function V1(e){let{manifest:t,routeModules:n}=sb(),[a,o]=b.useState([]);return b.useEffect(()=>{let s=!1;return M1(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),a}function z1({page:e,matches:t,...n}){let a=Fn(),{future:o,manifest:s,routeModules:c}=sb(),{basename:u}=ob(),{loaderData:h,matches:f}=U1(),m=b.useMemo(()=>_v(e,t,f,s,a,"data"),[e,t,f,s,a]),y=b.useMemo(()=>_v(e,t,f,s,a,"assets"),[e,t,f,s,a]),k=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,S=!1;if(t.forEach(L=>{let R=s.routes[L.route.id];!R||!R.hasLoader||(!m.some(O=>O.route.id===L.route.id)&&L.route.id in h&&c[L.route.id]?.shouldRevalidate||R.hasClientLoader?S=!0:C.add(L.route.id))}),C.size===0)return[];let D=R1(e,u,o.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&D.searchParams.set("_routes",t.filter(L=>C.has(L.route.id)).map(L=>L.route.id).join(",")),[D.pathname+D.search]},[u,o.unstable_trailingSlashAwareDataRequests,h,a,s,m,t,e,c]),w=b.useMemo(()=>I1(y,s),[y,s]),x=V1(y);return b.createElement(b.Fragment,null,k.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),w.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),x.map(({key:C,link:S})=>b.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function $1(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var H1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H1&&(window.__reactRouterVersion="7.13.1")}catch{}function W1(e,t){return _C({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:OS({window:t?.window}),hydrationData:K1(),routes:e,mapRouteProperties:p1,hydrationRouteProperties:m1,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function K1(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:G1(e.errors)}),e}function G1(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,o]of t)if(o&&o.__type==="RouteErrorResponse")n[a]=new Vs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let s=new Error(o.message);s.stack="",n[a]=s}}else n[a]=o;return n}var lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pu=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:o,reloadDocument:s,replace:c,unstable_mask:u,state:h,target:f,to:m,preventScrollReset:y,viewTransition:k,unstable_defaultShouldRevalidate:w,...x},C){let{basename:S,navigator:D,unstable_useTransitions:L}=b.useContext(Bn),R=typeof m=="string"&&lb.test(m),O=F_(m,S);m=O.to;let G=XC(m,{relative:o}),W=Fn(),z=null;if(u){let le=_u(u,[],W.unstable_mask?W.unstable_mask.pathname:"/",!0);S!=="/"&&(le.pathname=le.pathname==="/"?S:ir([S,le.pathname])),z=D.createHref(le)}let[P,Y,X]=B1(a,x),ue=X1(m,{replace:c,unstable_mask:u,state:h,target:f,preventScrollReset:y,relative:o,viewTransition:k,unstable_defaultShouldRevalidate:w,unstable_useTransitions:L});function se(le){t&&t(le),le.defaultPrevented||ue(le)}let Ae=!(O.isExternal||s),fe=b.createElement("a",{...x,...X,href:(Ae?z:void 0)||O.absoluteURL||G,onClick:Ae?se:t,ref:$1(C,Y),target:f,"data-discover":!R&&n==="render"?"true":void 0});return P&&!R?b.createElement(b.Fragment,null,fe,b.createElement(F1,{page:G})):fe});Pu.displayName="Link";var q1=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:s,to:c,viewTransition:u,children:h,...f},m){let y=Ws(c,{relative:f.relative}),k=Fn(),w=b.useContext($s),{navigator:x,basename:C}=b.useContext(Bn),S=w!=null&&nT(y)&&u===!0,D=x.encodeLocation?x.encodeLocation(y).pathname:y.pathname,L=k.pathname,R=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(L=L.toLowerCase(),R=R?R.toLowerCase():null,D=D.toLowerCase()),R&&C&&(R=Un(R,C)||R);const O=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let G=L===D||!o&&L.startsWith(D)&&L.charAt(O)==="/",W=R!=null&&(R===D||!o&&R.startsWith(D)&&R.charAt(D.length)==="/"),z={isActive:G,isPending:W,isTransitioning:S},P=G?t:void 0,Y;typeof a=="function"?Y=a(z):Y=[a,G?"active":null,W?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(z):s;return b.createElement(Pu,{...f,"aria-current":P,className:Y,ref:m,style:X,to:c,viewTransition:u},typeof h=="function"?h(z):h)});q1.displayName="NavLink";var Y1=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=Ec,action:u,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},x)=>{let{unstable_useTransitions:C}=b.useContext(Bn),S=eT(),D=tT(u,{relative:f}),L=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&lb.test(u),O=G=>{if(h&&h(G),G.defaultPrevented)return;G.preventDefault();let W=G.nativeEvent.submitter,z=W?.getAttribute("formmethod")||c,P=()=>S(W||G.currentTarget,{fetcherKey:t,method:z,navigate:n,replace:o,state:s,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k});C&&n!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:x,method:L,action:D,onSubmit:a?h:O,...w,"data-discover":!R&&e==="render"?"true":void 0})});Y1.displayName="Form";function Z1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(e){let t=b.useContext(pi);return Xe(t,Z1(e)),t}function X1(e,{target:t,replace:n,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:f}={}){let m=wu(),y=Fn(),k=Ws(e,{relative:c});return b.useCallback(w=>{if(S1(w,t)){w.preventDefault();let x=n!==void 0?n:kr(y)===kr(k),C=()=>m(e,{replace:x,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h});f?b.startTransition(()=>C()):C()}},[y,m,k,n,a,o,t,e,s,c,u,h,f])}function a4(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=b.useRef(of(e)),n=b.useRef(!1),a=Fn(),o=b.useMemo(()=>C1(a.search,n.current?null:t.current),[a.search]),s=wu(),c=b.useCallback((u,h)=>{const f=of(typeof u=="function"?u(new URLSearchParams(o)):u);n.current=!0,s("?"+f,h)},[s,o]);return[o,c]}var Q1=0,J1=()=>`__${String(++Q1)}__`;function eT(){let{router:e}=cb("useSubmit"),{basename:t}=b.useContext(Bn),n=l1(),a=e.fetch,o=e.navigate;return b.useCallback(async(s,c={})=>{let{action:u,method:h,encType:f,formData:m,body:y}=A1(s,t);if(c.navigate===!1){let k=c.fetcherKey||J1();await a(k,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 o(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,o,t,n])}function tT(e,{relative:t}={}){let{basename:n}=b.useContext(Bn),a=b.useContext(Gr);Xe(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),s={...Ws(e||".",{relative:t})},c=Fn();if(e==null){s.search=c.search;let u=new URLSearchParams(s.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();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ir([n,s.pathname])),kr(s)}function nT(e,{relative:t}={}){let n=b.useContext(ap);Xe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cb("useViewTransitionState"),o=Ws(e,{relative:t});if(!n.isTransitioning)return!1;let s=Un(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Un(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Kc(o.pathname,c)!=null||Kc(o.pathname,s)!=null}var rT=D_();function aT(e){return b.createElement(y1,{flushSync:rT.flushSync,...e})}var it;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const c of o)s[c]=c;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),c={};for(const u of s)c[u]=o[u];return e.objectValues(c)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},e.find=(o,s)=>{for(const c of o)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function a(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=a,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(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"]),Ca=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(s){return s.message},a={_errors:[]},o=s=>{for(const c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(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 o(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 o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else a.push(t(o));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const sf=(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 iT=sf;function oT(){return iT}const sT=e=>{const{data:t,path:n,errorMaps:a,issueData:o}=e,s=[...n,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.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{...o,path:s,message:u}};function ce(e,t){const n=oT(),a=sT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===sf?void 0:sf].filter(o=>!!o)});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 o of n){if(o.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),a.push(o.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const o of n){const s=await o.key,c=await o.value;a.push({key:s,value:c})}return un.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const o of n){const{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return ze;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(a[s.value]=c.value)}return{status:t.value,value:a}}}const ze=Object.freeze({status:"aborted"}),vs=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),wv=e=>e.status==="aborted",xv=e=>e.status==="dirty",co=e=>e.status==="valid",Gc=e=>typeof Promise<"u"&&e instanceof Promise;var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ce||(Ce={}));class _r{constructor(t,n,a,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=o}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 Pv=(e,t)=>{if(co(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:o}=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:o}:{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:o}}class Je{get description(){return this._def.description}_getType(t){return Ca(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ca(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:Ca(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Gc(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:Ca(t)},o=this._parseSync({data:t,path:a.path,parent:a});return Pv(a,o)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ca(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return co(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=>co(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:Ca(t)},o=this._parse({data:t,path:a.path,parent:a}),s=await(Gc(o)?o:Promise.resolve(o));return Pv(a,s)}refine(t,n){const a=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const c=t(o),u=()=>s.addIssue({code:re.custom,...a(o)});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,o)=>t(a)?!0:(o.addIssue(typeof n=="function"?n(a,o):n),!1))}_refinement(t){return new hi({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 fi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Jc.create(this,this._def)}or(t){return Yc.create([this,t],this._def)}and(t){return Zc.create(this,t,this._def)}transform(t){return new hi({...Ke(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new eu({...Ke(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new fb({typeName:$e.ZodBranded,type:this,...Ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new tu({...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 dp.create(this,t)}readonly(){return nu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const lT=/^c[^\s-]{8,}$/i,cT=/^[0-9a-z]+$/,uT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dT=/^[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,hT=/^[a-z0-9_-]{21}$/i,fT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pT=/^[-+]?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)?)??$/,mT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Th;const yT=/^(?:(?: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])$/,vT=/^(?:(?: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])$/,kT=/^(([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]))$/,_T=/^(([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])$/,bT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\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])))",xT=new RegExp(`^${ub}$`);function db(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 PT(e){return new RegExp(`^${db(e)}$`)}function ST(e){let t=`${ub}T${db(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 CT(e,t){return!!((t==="v4"||!t)&&yT.test(e)||(t==="v6"||!t)&&kT.test(e))}function TT(e,t){if(!fT.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,"="),o=JSON.parse(atob(a));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function ET(e,t){return!!((t==="v4"||!t)&&vT.test(e)||(t==="v6"||!t)&&_T.test(e))}class gr extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.string,received:s.parsedType}),ze}const a=new un;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const c=t.data.length>s.value,u=t.data.length<s.value;(c||u)&&(o=this._getOrReturnCtx(t,o),c?ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")mT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Th||(Th=new RegExp(gT,"u")),Th.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")dT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")hT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")lT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")cT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")uT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:re.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:re.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?ST(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?xT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?PT(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?pT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?CT(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?TT(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?ET(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?bT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?wT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:re.invalid_string,message:s.message}),a.dirty()):it.assertNever(s);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(o=>t.test(o),{validation:n,code:re.invalid_string,...Ce.errToObj(a)})}_addCheck(t){return new gr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ce.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,...Ce.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,...Ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ce.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ce.errToObj(n)})}nonempty(t){return this.min(1,Ce.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 AT(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,o=n>a?n:a,s=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return s%c/10**o}class li 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 s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.number,received:s.parsedType}),ze}let a;const o=new un;for(const s of this._def.checks)s.kind==="int"?it.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?AT(t.data,s.value)!==0&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_finite,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new li({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.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)}}li.create=e=>new li({checks:[],typeName:$e.ZodNumber,coerce:e?.coerce||!1,...Ke(e)});class ci 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 o=new un;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.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,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new ci({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new ci({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.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}}ci.create=e=>new ci({checks:[],typeName:$e.ZodBigInt,coerce:e?.coerce??!1,...Ke(e)});class qc 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)}}qc.create=e=>new qc({typeName:$e.ZodBoolean,coerce:e?.coerce||!1,...Ke(e)});class uo extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.date,received:s.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_date}),ze}const a=new un;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):it.assertNever(s);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.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}}uo.create=e=>new uo({checks:[],coerce:e?.coerce||!1,typeName:$e.ZodDate,...Ke(e)});class Sv 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)}}Sv.create=e=>new Sv({typeName:$e.ZodSymbol,...Ke(e)});class lf 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)}}lf.create=e=>new lf({typeName:$e.ZodUndefined,...Ke(e)});class cf 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)}}cf.create=e=>new cf({typeName:$e.ZodNull,...Ke(e)});class Cv extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Cv.create=e=>new Cv({typeName:$e.ZodAny,...Ke(e)});class uf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}uf.create=e=>new uf({typeName:$e.ZodUnknown,...Ke(e)});class Ma extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.never,received:n.parsedType}),ze}}Ma.create=e=>new Ma({typeName:$e.ZodNever,...Ke(e)});class Tv 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)}}Tv.create=e=>new Tv({typeName:$e.ZodVoid,...Ke(e)});class yr extends Je{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),o=this._def;if(n.parsedType!==ye.array)return ce(n,{code:re.invalid_type,expected:ye.array,received:n.parsedType}),ze;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(c||u)&&(ce(n,{code:c?re.too_big:re.too_small,minimum:u?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),a.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ce(n,{code:re.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),a.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ce(n,{code:re.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>o.type._parseAsync(new _r(n,c,n.path,u)))).then(c=>un.mergeArray(a,c));const s=[...n.data].map((c,u)=>o.type._parseSync(new _r(n,c,n.path,u)));return un.mergeArray(a,s)}get element(){return this._def.type}min(t,n){return new yr({...this._def,minLength:{value:t,message:Ce.toString(n)}})}max(t,n){return new yr({...this._def,maxLength:{value:t,message:Ce.toString(n)}})}length(t,n){return new yr({...this._def,exactLength:{value:t,message:Ce.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 eo(e){if(e instanceof Rt){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=$r.create(eo(a))}return new Rt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:eo(e.element)}):e instanceof $r?$r.create(eo(e.unwrap())):e instanceof fi?fi.create(eo(e.unwrap())):e instanceof ui?ui.create(e.items.map(t=>eo(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:o}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ma&&this._def.unknownKeys==="strip"))for(const f in o.data)c.includes(f)||u.push(f);const h=[];for(const f of c){const m=s[f],y=o.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new _r(o,y,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Ma){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(f==="strict")u.length>0&&(ce(o,{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=o.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new _r(o,y,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const y=await m.key,k=await m.value;f.push({key:y,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(a,f)):un.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{const o=this._def.errorMap?.(n,a).message??a.defaultError;return n.code==="unrecognized_keys"?{message:Ce.errToObj(t).message??o}:{message:o}}}:{}})}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 eo(this)}partial(t){const n={};for(const a of it.objectKeys(this.shape)){const o=this.shape[a];t&&!t[a]?n[a]=o:n[a]=o.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 s=this.shape[a];for(;s instanceof $r;)s=s._def.innerType;n[a]=s}return new Rt({...this._def,shape:()=>n})}keyof(){return hb(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});class Yc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function o(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=s.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 s=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let s;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"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.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}}Yc.create=(e,t)=>new Yc({options:e,typeName:$e.ZodUnion,...Ke(t)});const zr=e=>e instanceof hf?zr(e.schema):e instanceof hi?zr(e.innerType()):e instanceof Qc?[e.value]:e instanceof di?e.options:e instanceof ff?it.objectValues(e.enum):e instanceof eu?zr(e._def.innerType):e instanceof lf?[void 0]:e instanceof cf?[null]:e instanceof $r?[void 0,...zr(e.unwrap())]:e instanceof fi?[null,...zr(e.unwrap())]:e instanceof fb||e instanceof nu?zr(e.unwrap()):e instanceof tu?zr(e._def.innerType):[];class up 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,o=n.data[a],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._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 o=new Map;for(const s of n){const c=zr(s.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(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,s)}}return new up({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Ke(a)})}}function df(e,t){const n=Ca(e),a=Ca(t);if(e===t)return{valid:!0,data:e};if(n===ye.object&&a===ye.object){const o=it.objectKeys(t),s=it.objectKeys(e).filter(u=>o.indexOf(u)!==-1),c={...e,...t};for(const u of s){const h=df(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 o=[];for(let s=0;s<e.length;s++){const c=e[s],u=t[s],h=df(c,u);if(!h.valid)return{valid:!1};o.push(h.data)}return{valid:!0,data:o}}else return n===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Zc extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),o=(s,c)=>{if(wv(s)||wv(c))return ze;const u=df(s.value,c.value);return u.valid?((xv(s)||xv(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(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Zc.create=(e,t,n)=>new Zc({left:e,right:t,typeName:$e.ZodIntersection,...Ke(n)});class ui 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 s=[...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(s).then(c=>un.mergeArray(n,c)):un.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new ui({...this._def,rest:t})}}ui.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:e,typeName:$e.ZodTuple,rest:null,...Ke(t)})};class Xc 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 o=[],s=this._def.keyType,c=this._def.valueType;for(const u in a.data)o.push({key:s._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,o):un.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof Je?new Xc({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ke(a)}):new Xc({keyType:gr.create(),valueType:t,typeName:$e.ZodRecord,...Ke(n)})}}class Ev 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 o=this._def.keyType,s=this._def.valueType,c=[...a.data.entries()].map(([u,h],f)=>({key:o._parse(new _r(a,u,a.path,[f,"key"])),value:s._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}}}}Ev.create=(e,t,n)=>new Ev({valueType:t,keyType:e,typeName:$e.ZodMap,...Ke(n)});class Is 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 o=this._def;o.minSize!==null&&a.data.size<o.minSize.value&&(ce(a,{code:re.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&a.data.size>o.maxSize.value&&(ce(a,{code:re.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=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)=>s._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 Is({...this._def,minSize:{value:t,message:Ce.toString(n)}})}max(t,n){return new Is({...this._def,maxSize:{value:t,message:Ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Is.create=(e,t)=>new Is({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ke(t)});class hf 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})}}hf.create=(e,t)=>new hf({getter:e,typeName:$e.ZodLazy,...Ke(t)});class Qc 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}}Qc.create=(e,t)=>new Qc({value:e,typeName:$e.ZodLiteral,...Ke(t)});function hb(e,t){return new di({values:e,typeName:$e.ZodEnum,...Ke(t)})}class di 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 di.create(t,{...this._def,...n})}exclude(t,n=this._def){return di.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}di.create=hb;class ff 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 o=it.objectValues(n);return ce(a,{expected:it.joinValues(o),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 o=it.objectValues(n);return ce(a,{received:a.data,code:re.invalid_enum_value,options:o}),ze}return Vn(t.data)}get enum(){return this._def.values}}ff.create=(e,t)=>new ff({values:e,typeName:$e.ZodNativeEnum,...Ke(t)});class Jc 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(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Jc.create=(e,t)=>new Jc({type:e,typeName:$e.ZodPromise,...Ke(t)});class hi 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),o=this._def.effect||null,s={addIssue:c=>{ce(a,c),c.fatal?n.abort():n.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const c=o.transform(a.data,s);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"?vs(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"?vs(u.value):u}}if(o.type==="refinement"){const c=u=>{const h=o.refinement(u,s);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(o.type==="transform")if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!co(c))return ze;const u=o.transform(c.value,s);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=>co(c)?Promise.resolve(o.transform(c.value,s)).then(u=>({status:n.value,value:u})):ze);it.assertNever(o)}}hi.create=(e,t,n)=>new hi({schema:e,typeName:$e.ZodEffects,effect:t,...Ke(n)});hi.createWithPreprocess=(e,t,n)=>new hi({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 fi extends Je{_parse(t){return this._getType(t)===ye.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fi.create=(e,t)=>new fi({innerType:e,typeName:$e.ZodNullable,...Ke(t)});class eu 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}}eu.create=(e,t)=>new eu({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class tu extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Gc(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}tu.create=(e,t)=>new tu({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class Av 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}}}Av.create=e=>new Av({typeName:$e.ZodNaN,...Ke(e)});class fb 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 dp extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ze:s.status==="dirty"?(n.dirty(),vs(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const o=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:a.path,parent:a})}}static create(t,n){return new dp({in:t,out:n,typeName:$e.ZodPipeline})}}class nu extends Je{_parse(t){const n=this._def.innerType._parse(t),a=o=>(co(o)&&(o.value=Object.freeze(o.value)),o);return Gc(n)?n.then(o=>a(o)):a(n)}unwrap(){return this._def.innerType}}nu.create=(e,t)=>new nu({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=li.create;ci.create;const Be=qc.create,hp=uo.create,Jt=uf.create;Ma.create;const ie=yr.create,T=Rt.create,zn=Yc.create,pb=up.create;Zc.create;ui.create;const _t=Xc.create,Ye=Qc.create,nt=di.create;Jc.create;$r.create;fi.create;const pf={string:(e=>gr.create({...e,coerce:!0})),number:(e=>li.create({...e,coerce:!0})),boolean:(e=>qc.create({...e,coerce:!0})),bigint:(e=>ci.create({...e,coerce:!0})),date:(e=>uo.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 RT=nt(["CASCADE","RESTRICT","NO ACTION"]),LT=nt(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),DT=nt([fr.STRING,fr.DATE,fr.DATETIME,fr.INTEGER,fr.FLOAT,fr.BOOLEAN,fr.UUID,fr.JSON]),mb=T({referenceTable:v().min(1,"Target table cannot be empty"),referenceColumn:v().min(1,"Target column cannot be empty"),onDelete:LT,onUpdate:RT}),gb=T({columnName:v().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:zn([DT,v()]),defaultValue:v().optional(),isPrimaryKey:Be().optional(),isNullable:Be(),isUnique:Be(),foreignKey:mb.optional()}),yb=T({tableName:v().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:ie(gb).min(1,"At least one column is required"),recordCount:Q().optional(),createdAt:v().optional(),updatedAt:v().optional()}),MT=T({functionName:v(),functionDef:v(),kind:v()}),IT=T({tableName:v(),indexName:v(),indexDef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()}),NT=T({tableName:v(),policyName:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()}),OT=T({tableName:v(),triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v()});yb.pick({tableName:!0,columns:!0}).extend({rlsEnabled:Be().default(!0)});yb.pick({tableName:!0,columns:!0}).extend({message:v(),autoFields:ie(v()),nextActions:v()});T({addColumns:ie(gb.omit({foreignKey:!0})).optional(),dropColumns:ie(v()).optional(),updateColumns:ie(T({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(T({columnName:v().min(1,"Column name is required for adding foreign key"),foreignKey:mb})).optional(),dropForeignKeys:ie(v()).optional(),renameTable:T({newTableName:v().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});T({message:v(),tableName:v(),operations:ie(v())});T({message:v(),tableName:v(),nextActions:v()});T({query:v().min(1,"Query is required"),params:ie(Jt()).optional()});T({rows:ie(_t(v(),Jt())),rowCount:Q().nullable(),fields:ie(T({name:v(),dataTypeID:Q()})).optional()});T({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 jT=T({timestamp:v(),tables:_t(v(),T({schema:ie(T({columnName:v(),dataType:v(),characterMaximumLength:Q().nullable(),isNullable:v(),columnDefault:v().nullable()})),indexes:ie(T({indexname:v(),indexdef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()})),foreignKeys:ie(T({constraintName:v(),columnName:v(),foreignTableName:v(),foreignColumnName:v(),deleteRule:v().nullable(),updateRule:v().nullable()})),rlsEnabled:Be().optional(),policies:ie(T({policyname:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()})),triggers:ie(T({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(T({functionName:v(),functionDef:v(),kind:v()})),sequences:ie(T({sequenceName:v(),startValue:v(),increment:v(),minValue:v().nullable(),maxValue:v().nullable(),cycle:v()})),views:ie(T({viewName:v(),definition:v()}))});T({format:nt(["sql","json"]),data:zn([v(),jT]),timestamp:v()});T({truncate:zn([Be(),v().transform(e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});T({success:Be(),message:v(),filename:v(),tables:ie(v()),rowsImported:Q(),fileSize:Q()});T({table:v().min(1,"Table name is required"),upsertKey:v().optional()});T({success:Be(),message:v(),table:v(),rowsAffected:Q(),totalRecords:Q(),filename:v()});T({functions:ie(MT)});T({indexes:ie(IT)});T({policies:ie(NT)});T({triggers:ie(OT)});const UT=T({id:v(),key:v(),isActive:Be(),isReserved:Be(),lastUsedAt:v().nullable(),expiresAt:v().nullable(),createdAt:v(),updatedAt:v()});T({secrets:ie(UT)});T({key:v(),value:v()});T({key:v().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:v().min(1,"Value is required")});T({success:Ye(!0),message:v(),id:v()});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v()});const BT=T({key:v(),bucket:v(),size:Q(),mimeType:v().optional(),uploadedAt:v(),url:v()}),FT=T({name:v(),public:Be(),createdAt:v()});T({id:v().uuid(),maxFileSizeMb:Q().int().positive(),createdAt:v(),updatedAt:v()});T({bucketName:v().min(1,"Bucket name cannot be empty"),isPublic:Be().default(!0)});T({isPublic:Be()});T({objects:ie(BT),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({filename:v().min(1,"Filename cannot be empty"),contentType:v().optional(),size:Q().optional()});T({method:nt(["presigned","direct"]),uploadUrl:v(),fields:_t(v()).optional(),key:v(),confirmRequired:Be(),confirmUrl:v().optional(),expiresAt:hp().optional()});T({expiresIn:Q().optional().default(3600)});T({method:nt(["presigned","direct"]),url:v(),expiresAt:hp().optional(),headers:_t(v()).optional()});T({size:Q(),contentType:v().optional(),etag:v().optional()});T({maxFileSizeMb:Q().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const Su=v().uuid("Invalid user ID format"),br=v().email("Invalid email format").toLowerCase().trim(),fp=v(),VT=v().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),zT=nt(["anon","authenticated","project_admin"]),Rv=nt(["code","link"]),vb=T({name:v().optional(),avatar_url:v().url().optional()}).passthrough(),vo=T({id:Su,email:br,emailVerified:Be(),providers:ie(v()).optional(),createdAt:v(),updatedAt:v(),profile:vb.nullable(),metadata:_t(Jt()).nullable()}),Cu=nt(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);T({provider:Cu,redirectUri:v().url().optional()});const pp=T({id:v().uuid(),provider:Cu,clientId:v().optional(),scopes:ie(v()).optional(),redirectUri:v().optional(),useSharedKey:Be(),createdAt:v(),updatedAt:v()}),$T=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,kb=T({id:v().uuid(),requireEmailVerification:Be(),passwordMinLength:Q().min(4).max(128),requireNumber:Be(),requireLowercase:Be(),requireUppercase:Be(),requireSpecialChar:Be(),verifyEmailMethod:Rv,resetPasswordMethod:Rv,allowedRedirectUrls:ie(v().regex($T,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:v(),updatedAt:v()});T({sub:Su,email:br,role:zT,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"),mp=T({id:v().uuid(),key:_b,name:v().min(1),discoveryEndpoint:v().url(),clientId:v().min(1),createdAt:v(),updatedAt:v()}),HT=T({limit:v().optional(),offset:v().optional()});T({email:br,password:fp,name:VT.optional(),redirectTo:v().url().optional()});T({email:br,password:fp});T({refreshToken:v().min(1,"refreshToken is required")});T({code:v()});HT.extend({search:v().optional()}).optional();T({userIds:ie(Su).min(1,"At least one user ID is required")});T({profile:_t(Jt())});T({email:br,redirectTo:v().url().optional()});T({email:br,otp:v().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});T({email:br,redirectTo:v().url().optional()});T({email:br,code:v().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});T({newPassword:fp,otp:v().min(1,"OTP/token is required")});T({user:vo.optional(),accessToken:v().nullable(),requireEmailVerification:Be().optional(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:vo,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:vo,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({accessToken:v(),user:vo,csrfToken:v().optional(),refreshToken:v().optional()});T({token:v(),expiresAt:v().datetime()});T({message:v()});T({user:vo});T({id:Su,profile:vb.nullable()});T({data:ie(vo),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({message:v(),deletedCount:Q().int().nonnegative()});T({authUrl:v().url()});pp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()});pp.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()}).partial();const bb=/^[A-Za-z0-9._~-]+$/;T({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(bb,"Code challenge must be base64url encoded")});T({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(bb,"Code verifier must be base64url encoded")});T({data:ie(pp),count:Q()});kb.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const WT=T({oAuthProviders:ie(Cu),customOAuthProviders:ie(_b),...kb.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});T({error:v(),message:v(),statusCode:Q().int(),nextActions:v().optional()});mp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1,"Client secret is required")});mp.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1).optional()}).partial();T({data:ie(mp),count:Q()});const wb=nt(["system","user"]),xb=T({id:v().uuid(),pattern:v().min(1),description:v().nullable(),webhookUrls:ie(v().url()).nullable(),enabled:Be(),createdAt:v().datetime(),updatedAt:v().datetime()}),KT=T({id:v().uuid(),eventName:v().min(1),channelId:v().uuid().nullable(),channelName:v().min(1),payload:_t(v(),Jt()),senderType:wb,senderId:v().uuid().nullable(),wsAudienceCount:Q().int().min(0),whAudienceCount:Q().int().min(0),whDeliveredCount:Q().int().min(0),createdAt:v().datetime()}),GT=T({retentionDays:Q().int().positive().nullable()});T({channel:v().min(1)});T({channel:v().min(1)});T({channel:v().min(1),event:v().min(1),payload:_t(v(),Jt())});pb("ok",[T({ok:Ye(!0),channel:v().min(1)}),T({ok:Ye(!1),channel:v().min(1),error:T({code:v().min(1),message:v().min(1)})})]);T({channel:v().optional(),code:v().min(1),message:v().min(1)});T({messageId:v().uuid(),channel:v().min(1),eventName:v().min(1),payload:_t(v(),Jt())});const qT=T({channel:v().optional(),messageId:v().uuid(),senderType:wb,senderId:v().uuid().optional(),timestamp:v().datetime()});T({meta:qT}).passthrough();T({pattern:v().min(1,"Channel pattern is required"),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional().default(!0)});T({pattern:v().min(1).optional(),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional()});ie(xb);T({message:v()});T({channelId:v().uuid().optional(),eventName:v().optional(),limit:pf.number().int().min(1).max(1e3).optional().default(100),offset:pf.number().int().min(0).optional().default(0)});ie(KT);T({channelId:v().uuid().optional(),since:pf.date().optional()});T({totalMessages:Q().int().min(0),whDeliveryRate:Q().min(0).max(1),topEvents:ie(T({eventName:v(),count:Q().int().min(0)})),retentionDays:GT.shape.retentionDays});const Lv=T({policyName:v(),tableName:v(),command:v(),roles:ie(v()),using:v().nullable(),withCheck:v().nullable()}),YT=T({subscribe:T({policies:ie(Lv)}),publish:T({policies:ie(Lv)})}),ZT=WT,XT=T({tables:ie(T({tableName:v(),recordCount:Q()})),totalSizeInGB:Q(),hint:v().optional()}),QT=FT.extend({objectCount:Q().optional()}),JT=T({buckets:ie(QT),totalSizeInGB:Q()}),eE=T({slug:v(),name:v(),description:v().nullable(),status:v()}),tE=T({models:ie(T({inputModality:ie(v()),outputModality:ie(v()),modelId:v()}))}),nE=T({channels:ie(xb),permissions:YT});T({auth:ZT,database:XT,storage:JT,aiIntegration:tE.optional(),functions:ie(eE),realtime:nE.optional(),version:v().optional()});const rE=T({host:v(),port:Q(),database:v(),user:v(),password:v(),sslmode:v()});T({connectionURL:v(),parameters:rE});T({databasePassword:v()});T({apiKey:v()});T({projectId:v().nullable()});const ho=nt(["text","image","audio"]),aE=T({inputModality:ie(ho).min(1),outputModality:ie(ho).min(1),provider:v(),modelId:v(),systemPrompt:v().optional()}),Pb=aE.extend({id:v().uuid()});Pb.extend({usageStats:T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()}).optional()});const iE=T({configId:v().uuid(),inputTokens:Q().int().optional(),outputTokens:Q().int().optional(),imageCount:Q().int().optional(),imageResolution:v().optional()}),oE=iE.extend({id:v().uuid(),createdAt:hp(),modelId:v().nullable().optional(),model:v().nullable(),provider:v().nullable(),inputModality:ie(ho).nullable(),outputModality:ie(ho).nullable()});T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()});const sE=T({type:Ye("text"),text:v()}),lE=T({type:Ye("image_url"),image_url:T({url:v(),detail:nt(["auto","low","high"]).optional()})}),cE=T({type:Ye("input_audio"),input_audio:T({data:v(),format:nt(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),uE=T({type:Ye("file"),file:T({filename:v(),file_data:v()})}),dE=zn([sE,lE,cE,uE]),hE=T({name:v(),description:v().optional(),parameters:_t(Jt()).optional()}),fE=T({type:Ye("function"),function:hE}),pE=zn([nt(["auto","none","required"]),T({type:Ye("function"),function:T({name:v()})})]),Sb=T({id:v(),type:Ye("function"),function:T({name:v(),arguments:v()})}),mE=T({role:nt(["user","assistant","system","tool"]),content:zn([v(),ie(dE)]).nullable(),images:ie(T({url:v()})).optional(),tool_calls:ie(Sb).optional(),tool_call_id:v().optional()}),gE=T({enabled:Be(),engine:nt(["native","exa"]).optional(),maxResults:Q().min(1).max(10).optional(),searchPrompt:v().optional()}),yE=T({enabled:Be(),pdf:T({engine:nt(["pdf-text","mistral-ocr","native"]).optional()}).optional()});T({model:v(),messages:ie(mE),temperature:Q().min(0).max(2).optional(),maxTokens:Q().positive().optional(),topP:Q().min(0).max(1).optional(),stream:Be().optional(),webSearch:gE.optional(),fileParser:yE.optional(),thinking:Be().optional(),tools:ie(fE).optional(),toolChoice:pE.optional(),parallelToolCalls:Be().optional()});const vE=T({type:Ye("url_citation"),urlCitation:T({url:v(),title:v().optional(),content:v().optional(),startIndex:Q().optional(),endIndex:Q().optional()})}),kE=T({type:Ye("file"),file:T({filename:v(),parsedContent:v().optional(),metadata:_t(Jt()).optional()})}),_E=zn([vE,kE]);T({text:v(),tool_calls:ie(Sb).optional(),annotations:ie(_E).optional(),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),input:zn([v(),ie(v())]),encoding_format:nt(["float","base64"]).optional(),dimensions:Q().int().min(0).optional()});const bE=T({object:Ye("embedding"),embedding:zn([ie(Q()),v()]),index:Q()});T({object:Ye("list"),data:ie(bE),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),prompt:v(),images:ie(T({url:v()})).optional()});T({text:v().optional(),images:ie(T({type:Ye("imageUrl"),imageUrl:v()})),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({id:v(),inputModality:ie(ho).min(1),outputModality:ie(ho).min(1),provider:v(),modelId:v(),inputPrice:Q().min(0).optional(),outputPrice:Q().min(0).optional()});Pb.omit({id:!0});T({systemPrompt:v().nullable()});T({records:ie(oE),total:Q()});T({startDate:v().datetime().optional(),endDate:v().datetime().optional(),limit:v().regex(/^\d+$/).default("50"),offset:v().regex(/^\d+$/).default("0")});T({configId:v().uuid().optional(),startDate:v().datetime().optional(),endDate:v().datetime().optional()});const wE=nt(["byok","cloud","env","unconfigured"]);T({keySource:wE,hasByokKey:Be(),maskedKey:v().optional()});T({apiKey:v().min(1,"API key is required")});const Cb=T({id:v(),actor:v(),action:v(),module:v(),details:_t(Jt()).nullable(),ipAddress:v().nullable(),createdAt:v(),updatedAt:v()});T({id:v(),name:v(),token:v()});const xE=T({id:v(),eventMessage:v(),timestamp:v(),body:_t(v(),Jt()),source:v().optional()});T({source:v(),count:Q(),lastActivity:v()});const PE=T({level:v(),message:v()});T({deploymentId:v(),status:nt(["pending","success","failed"]),logs:ie(PE),createdAt:v()});T({limit:Q().default(100),offset:Q().default(0),actor:v().optional(),action:v().optional(),module:v().optional(),startDate:v().optional(),endDate:v().optional()});T({data:ie(Cb),pagination:T({limit:Q(),offset:Q(),total:Q()})});T({days:Q().default(7)});T({totalLogs:Q(),uniqueActors:Q(),uniqueModules:Q(),actionsByModule:_t(Q()),recentActivity:ie(Cb)});T({daysToKeep:Q().default(90)});T({message:v(),deleted:Q()});T({logs:ie(xE),total:Q()});const Tb=T({id:v(),slug:v(),name:v(),description:v().nullable(),code:v(),status:nt(["draft","active","error"]),createdAt:v(),updatedAt:v(),deployedAt:v().nullable()});T({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")});T({name:v().optional(),code:v().optional(),description:v().optional(),status:nt(["draft","active"]).optional()});T({functions:ie(Tb),runtime:T({status:nt(["running","unavailable"])}),deploymentUrl:v().nullable().optional()});const SE=T({id:v(),status:nt(["success","failed"]),url:v().nullable(),buildLogs:ie(v()).optional()});T({success:Be(),function:Tb,deployment:SE.nullable().optional()});const CE=T({type:Ye("APP_ROUTE_CHANGE"),path:v()}),TE=T({type:Ye("AUTH_SUCCESS")}),EE=T({type:Ye("AUTH_ERROR"),message:v()}),AE=T({type:Ye("MCP_CONNECTION_STATUS"),connected:Be(),toolName:v(),timestamp:zn([Q(),v()])}),RE=T({type:Ye("SHOW_ONBOARDING_OVERLAY")}),LE=T({type:Ye("SHOW_SETTINGS_OVERLAY")}),DE=T({type:Ye("ONBOARDING_SUCCESS")}),ME=T({type:Ye("NAVIGATE_TO_USAGE")}),IE=T({type:Ye("SHOW_CONTACT_MODAL")}),NE=T({type:Ye("SHOW_CONNECT_OVERLAY")}),OE=T({type:Ye("SHOW_PLAN_MODAL")}),jE=T({type:Ye("AUTHORIZATION_CODE"),code:v()}),UE=T({type:Ye("ROUTE_CHANGE"),path:v()}),BE=T({type:Ye("REQUEST_PROJECT_INFO")}),FE=T({type:Ye("PROJECT_INFO"),name:v(),instanceType:v(),region:v(),latestVersion:v().optional()}),VE=T({type:Ye("REQUEST_INSTANCE_INFO")}),zE=T({type:Ye("INSTANCE_INFO"),currentInstanceType:v(),planName:v(),computeCredits:Q(),currentOrgComputeCost:Q(),instanceTypes:ie(T({id:v(),name:v(),cpu:v(),ram:v(),pricePerHour:Q(),pricePerMonth:Q()})),projects:ie(T({name:v(),instanceType:v(),monthlyCost:Q(),isCurrent:Be(),status:v()}))}),$E=T({type:Ye("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:v()}),HE=T({type:Ye("INSTANCE_TYPE_CHANGE_RESULT"),success:Be(),instanceType:v().optional(),error:v().optional()});pb("type",[CE,TE,EE,AE,RE,LE,DE,ME,IE,NE,OE,jE,UE,BE,FE,VE,zE,$E,HE]);nt(["db","storage","functions","auth","ai","realtime"]).describe(`
12
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=Fn(),y;y=m;let k=y.pathname||"/",w=k;if(h!=="/"){let S=h.replace(/^\//,"").split("/");w="/"+k.replace(/^\//,"").split("/").slice(S.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.`),i1(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:ir([h,a.encodeLocation?a.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:ir([h,a.encodeLocation?a.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,n)}function t1(){let e=u1(),t=Is(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)",o={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:o},n):null,c)}var n1=b.createElement(t1,null),ab=class extends b.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=XC(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Gr.Provider,{value:this.props.routeContext},b.createElement(ip.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(r1,{error:e},t):t}};ab.contextType=J_;var Sh=new WeakMap;function r1({children:e,error:t}){let{basename:n}=b.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=ZC(t.digest);if(a){let o=Sh.get(t);if(o)throw o;let s=F_(a.location,n);if(B_&&!Sh.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw Sh.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function a1({routeContext:e,match:t,children:n}){let a=b.useContext(pi);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Gr.Provider,{value:e},n)}function i1(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 o=e,s=a?.errors;if(s!=null){let m=o.findIndex(y=>y.route.id&&s?.[y.route.id]!==void 0);Xe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,u=-1;if(n&&a){c=a.renderFallback;for(let m=0;m<o.length;m++){let y=o[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(u=m),y.route.id){let{loaderData:k,errors:w}=a,x=y.route.loader&&!k.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||x){n.isStatic&&(c=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let h=n?.onError,f=a&&h?(m,y)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:$s(a.matches),errorInfo:y})}:void 0;return o.reduceRight((m,y,k)=>{let w,x=!1,C=null,S=null;a&&(w=s&&y.route.id?s[y.route.id]:void 0,C=y.route.errorElement||n1,c&&(u<0&&k===0?(ib("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):u===k&&(x=!0,S=y.route.hydrateFallbackElement||null)));let D=t.concat(o.slice(0,k+1)),L=()=>{let R;return w?R=C:x?R=S:y.route.Component?R=b.createElement(y.route.Component,null):y.route.element?R=y.route.element:R=m,b.createElement(a1,{match:y,routeContext:{outlet:m,matches:D,isDataRoute:a!=null},children:R})};return a&&(y.route.ErrorBoundary||y.route.errorElement||k===0)?b.createElement(ab,{location:a.location,revalidation:a.revalidation,component:C,error:w,children:L(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:f}):L()},null)}function op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function o1(e){let t=b.useContext(pi);return Xe(t,op(e)),t}function s1(e){let t=b.useContext(Hs);return Xe(t,op(e)),t}function l1(e){let t=b.useContext(Gr);return Xe(t,op(e)),t}function sp(e){let t=l1(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 c1(){return sp("useRouteId")}function u1(){let e=b.useContext(ip),t=s1("useRouteError"),n=sp("useRouteError");return e!==void 0?e:t.errors?.[n]}function d1(){let{router:e}=o1("useNavigate"),t=sp("useNavigate"),n=b.useRef(!1);return rb(()=>{n.current=!0}),b.useCallback(async(o,s={})=>{Et(n.current,nb),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var mv={};function ib(e,t,n){!t&&!mv[e]&&(mv[e]=!0,Et(!1,n))}var gv={};function yv(e,t){!e&&!gv[t]&&(gv[t]=!0,console.warn(t))}var h1="useOptimistic",vv=AS[h1],f1=()=>{};function p1(e){return vv?vv(e):[e,f1]}function m1(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:b.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:b.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:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var g1=["HydrateFallback","hydrateFallbackElement"],y1=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 v1({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=KC()||a;let[s,c]=b.useState(e.state),[u,h]=p1(s),[f,m]=b.useState(),[y,k]=b.useState({isTransitioning:!1}),[w,x]=b.useState(),[C,S]=b.useState(),[D,L]=b.useState(),R=b.useRef(new Map),O=b.useCallback((P,{deletedFetchers:Y,newErrors:X,flushSync:ue,viewTransitionOpts:se})=>{X&&n&&Object.values(X).forEach(fe=>n(fe,{location:P.location,params:P.matches[0]?.params??{},unstable_pattern:$s(P.matches)})),P.fetchers.forEach((fe,le)=>{fe.data!==void 0&&R.current.set(le,fe.data)}),Y.forEach(fe=>R.current.delete(fe)),yv(ue===!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(yv(se==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."),!se||!Ae){t&&ue?t(()=>c(P)):a===!1?c(P):b.startTransition(()=>{a===!0&&h(fe=>kv(fe,P)),c(P)});return}if(t&&ue){t(()=>{C&&(w?.resolve(),C.skipTransition()),k({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let fe=e.window.document.startViewTransition(()=>{t(()=>c(P))});fe.finished.finally(()=>{t(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})})}),t(()=>S(fe));return}C?(w?.resolve(),C.skipTransition(),L({state:P,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(m(P),k({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[e.window,t,C,w,a,h,n]);b.useLayoutEffect(()=>e.subscribe(O),[e,O]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&x(new y1)},[y]),b.useEffect(()=>{if(w&&f&&e.window){let P=f,Y=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?c(P):b.startTransition(()=>{a===!0&&h(ue=>kv(ue,P)),c(P)}),await Y});X.finished.finally(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})}),S(X)}},[f,w,e.window,a,h]),b.useEffect(()=>{w&&f&&u.location.key===f.location.key&&w.resolve()},[w,C,u.location,f]),b.useEffect(()=>{!y.isTransitioning&&D&&(m(D.state),k({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),L(void 0))},[y.isTransitioning,D]);let G=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,Y,X)=>e.navigate(P,{state:Y,preventScrollReset:X?.preventScrollReset}),replace:(P,Y,X)=>e.navigate(P,{replace:!0,state:Y,preventScrollReset:X?.preventScrollReset})}),[e]),W=e.basename||"/",z=b.useMemo(()=>({router:e,navigator:G,static:!1,basename:W,onError:n}),[e,G,W,n]);return b.createElement(b.Fragment,null,b.createElement(pi.Provider,{value:z},b.createElement(Hs.Provider,{value:u},b.createElement(eb.Provider,{value:R.current},b.createElement(ap.Provider,{value:y},b.createElement(b1,{basename:W,location:u.location,navigationType:u.historyAction,navigator:G,unstable_useTransitions:a},b.createElement(k1,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function kv(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 k1=b.memo(_1);function _1({routes:e,future:t,state:n,isStatic:a,onError:o}){return e1(e,void 0,{state:n,isStatic:a,onError:o})}function b1({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){Xe(!Ws(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[u,o,s,c]);typeof n=="string"&&(n=Kr(n));let{pathname:f="/",search:m="",hash:y="",state:k=null,key:w="default",unstable_mask:x}=n,C=b.useMemo(()=>{let S=Un(f,u);return S==null?null:{location:{pathname:S,search:m,hash:y,state:k,key:w,unstable_mask:x},navigationType:a}},[u,f,m,y,k,w,a,x]);return Et(C!=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.`),C==null?null:b.createElement(Bn.Provider,{value:h},b.createElement(bu.Provider,{children:t,value:C}))}var Ec="get",Ac="application/x-www-form-urlencoded";function xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function w1(e){return xu(e)&&e.tagName.toLowerCase()==="button"}function x1(e){return xu(e)&&e.tagName.toLowerCase()==="form"}function P1(e){return xu(e)&&e.tagName.toLowerCase()==="input"}function S1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C1(e,t){return e.button===0&&(!t||t==="_self")&&!S1(e)}function of(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(o=>[n,o]):[[n,a]])},[]))}function T1(e,t){let n=of(e);return t&&t.forEach((a,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var fc=null;function E1(){if(fc===null)try{new FormData(document.createElement("form"),0),fc=!1}catch{fc=!0}return fc}var A1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ch(e){return e!=null&&!A1.has(e)?(Et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ac}"`),null):e}function R1(e,t){let n,a,o,s,c;if(x1(e)){let u=e.getAttribute("action");a=u?Un(u,t):null,n=e.getAttribute("method")||Ec,o=Ch(e.getAttribute("enctype"))||Ac,s=new FormData(e)}else if(w1(e)||P1(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")||Ec,o=Ch(e.getAttribute("formenctype"))||Ch(u.getAttribute("enctype"))||Ac,s=new FormData(u,e),!E1()){let{name:f,type:m,value:y}=e;if(m==="image"){let k=f?`${f}.`:"";s.append(`${k}x`,"0"),s.append(`${k}y`,"0")}else f&&s.append(f,y)}}else{if(xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ec,a=null,o=Ac,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:a,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function L1(e,t,n,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&Un(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function D1(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 M1(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 I1(e,t,n){let a=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await D1(s,n);return c.links?c.links():[]}return[]}));return U1(a.flat(1).filter(M1).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function _v(e,t,n,a,o,s){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 s==="assets"?t.filter((h,f)=>c(h,f)||u(h,f)):s==="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(o.pathname+o.search+o.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 N1(e,t,{includeHydrateFallback:n}={}){return O1(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function O1(e){return[...new Set(e)]}function j1(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function U1(e,t){let n=new Set;return new Set(t),e.reduce((a,o)=>{let s=JSON.stringify(j1(o));return n.has(s)||(n.add(s),a.push({key:s,link:o})),a},[])}function ob(){let e=b.useContext(pi);return lp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function B1(){let e=b.useContext(Hs);return lp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cp=b.createContext(void 0);cp.displayName="FrameworkContext";function sb(){let e=b.useContext(cp);return lp(e,"You must render this element inside a <HydratedRouter> element"),e}function F1(e,t){let n=b.useContext(cp),[a,o]=b.useState(!1),[s,c]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:y}=t,k=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=D=>{D.forEach(L=>{c(L.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return k.current&&S.observe(k.current),()=>{S.disconnect()}}},[e]),b.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let w=()=>{o(!0)},x=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,k,{}]:[s,k,{onFocus:fs(u,w),onBlur:fs(h,x),onMouseEnter:fs(f,w),onMouseLeave:fs(m,x),onTouchStart:fs(y,w)}]:[!1,k,{}]}function fs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function V1({page:e,...t}){let{router:n}=ob(),a=b.useMemo(()=>Ta(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement($1,{page:e,matches:a,...t}):null}function z1(e){let{manifest:t,routeModules:n}=sb(),[a,o]=b.useState([]);return b.useEffect(()=>{let s=!1;return I1(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),a}function $1({page:e,matches:t,...n}){let a=Fn(),{future:o,manifest:s,routeModules:c}=sb(),{basename:u}=ob(),{loaderData:h,matches:f}=B1(),m=b.useMemo(()=>_v(e,t,f,s,a,"data"),[e,t,f,s,a]),y=b.useMemo(()=>_v(e,t,f,s,a,"assets"),[e,t,f,s,a]),k=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,S=!1;if(t.forEach(L=>{let R=s.routes[L.route.id];!R||!R.hasLoader||(!m.some(O=>O.route.id===L.route.id)&&L.route.id in h&&c[L.route.id]?.shouldRevalidate||R.hasClientLoader?S=!0:C.add(L.route.id))}),C.size===0)return[];let D=L1(e,u,o.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&D.searchParams.set("_routes",t.filter(L=>C.has(L.route.id)).map(L=>L.route.id).join(",")),[D.pathname+D.search]},[u,o.unstable_trailingSlashAwareDataRequests,h,a,s,m,t,e,c]),w=b.useMemo(()=>N1(y,s),[y,s]),x=z1(y);return b.createElement(b.Fragment,null,k.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),w.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),x.map(({key:C,link:S})=>b.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function H1(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var W1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{W1&&(window.__reactRouterVersion="7.13.1")}catch{}function K1(e,t){return bC({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:jS({window:t?.window}),hydrationData:G1(),routes:e,mapRouteProperties:m1,hydrationRouteProperties:g1,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function G1(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:q1(e.errors)}),e}function q1(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,o]of t)if(o&&o.__type==="RouteErrorResponse")n[a]=new zs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let s=new Error(o.message);s.stack="",n[a]=s}}else n[a]=o;return n}var lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pu=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:o,reloadDocument:s,replace:c,unstable_mask:u,state:h,target:f,to:m,preventScrollReset:y,viewTransition:k,unstable_defaultShouldRevalidate:w,...x},C){let{basename:S,navigator:D,unstable_useTransitions:L}=b.useContext(Bn),R=typeof m=="string"&&lb.test(m),O=F_(m,S);m=O.to;let G=QC(m,{relative:o}),W=Fn(),z=null;if(u){let le=_u(u,[],W.unstable_mask?W.unstable_mask.pathname:"/",!0);S!=="/"&&(le.pathname=le.pathname==="/"?S:ir([S,le.pathname])),z=D.createHref(le)}let[P,Y,X]=F1(a,x),ue=Q1(m,{replace:c,unstable_mask:u,state:h,target:f,preventScrollReset:y,relative:o,viewTransition:k,unstable_defaultShouldRevalidate:w,unstable_useTransitions:L});function se(le){t&&t(le),le.defaultPrevented||ue(le)}let Ae=!(O.isExternal||s),fe=b.createElement("a",{...x,...X,href:(Ae?z:void 0)||O.absoluteURL||G,onClick:Ae?se:t,ref:H1(C,Y),target:f,"data-discover":!R&&n==="render"?"true":void 0});return P&&!R?b.createElement(b.Fragment,null,fe,b.createElement(V1,{page:G})):fe});Pu.displayName="Link";var Y1=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:s,to:c,viewTransition:u,children:h,...f},m){let y=Ks(c,{relative:f.relative}),k=Fn(),w=b.useContext(Hs),{navigator:x,basename:C}=b.useContext(Bn),S=w!=null&&rT(y)&&u===!0,D=x.encodeLocation?x.encodeLocation(y).pathname:y.pathname,L=k.pathname,R=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(L=L.toLowerCase(),R=R?R.toLowerCase():null,D=D.toLowerCase()),R&&C&&(R=Un(R,C)||R);const O=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let G=L===D||!o&&L.startsWith(D)&&L.charAt(O)==="/",W=R!=null&&(R===D||!o&&R.startsWith(D)&&R.charAt(D.length)==="/"),z={isActive:G,isPending:W,isTransitioning:S},P=G?t:void 0,Y;typeof a=="function"?Y=a(z):Y=[a,G?"active":null,W?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(z):s;return b.createElement(Pu,{...f,"aria-current":P,className:Y,ref:m,style:X,to:c,viewTransition:u},typeof h=="function"?h(z):h)});Y1.displayName="NavLink";var Z1=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=Ec,action:u,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},x)=>{let{unstable_useTransitions:C}=b.useContext(Bn),S=tT(),D=nT(u,{relative:f}),L=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&lb.test(u),O=G=>{if(h&&h(G),G.defaultPrevented)return;G.preventDefault();let W=G.nativeEvent.submitter,z=W?.getAttribute("formmethod")||c,P=()=>S(W||G.currentTarget,{fetcherKey:t,method:z,navigate:n,replace:o,state:s,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k});C&&n!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:x,method:L,action:D,onSubmit:a?h:O,...w,"data-discover":!R&&e==="render"?"true":void 0})});Z1.displayName="Form";function X1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(e){let t=b.useContext(pi);return Xe(t,X1(e)),t}function Q1(e,{target:t,replace:n,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:f}={}){let m=wu(),y=Fn(),k=Ks(e,{relative:c});return b.useCallback(w=>{if(C1(w,t)){w.preventDefault();let x=n!==void 0?n:kr(y)===kr(k),C=()=>m(e,{replace:x,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h});f?b.startTransition(()=>C()):C()}},[y,m,k,n,a,o,t,e,s,c,u,h,f])}function i4(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=b.useRef(of(e)),n=b.useRef(!1),a=Fn(),o=b.useMemo(()=>T1(a.search,n.current?null:t.current),[a.search]),s=wu(),c=b.useCallback((u,h)=>{const f=of(typeof u=="function"?u(new URLSearchParams(o)):u);n.current=!0,s("?"+f,h)},[s,o]);return[o,c]}var J1=0,eT=()=>`__${String(++J1)}__`;function tT(){let{router:e}=cb("useSubmit"),{basename:t}=b.useContext(Bn),n=c1(),a=e.fetch,o=e.navigate;return b.useCallback(async(s,c={})=>{let{action:u,method:h,encType:f,formData:m,body:y}=R1(s,t);if(c.navigate===!1){let k=c.fetcherKey||eT();await a(k,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 o(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,o,t,n])}function nT(e,{relative:t}={}){let{basename:n}=b.useContext(Bn),a=b.useContext(Gr);Xe(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),s={...Ks(e||".",{relative:t})},c=Fn();if(e==null){s.search=c.search;let u=new URLSearchParams(s.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();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ir([n,s.pathname])),kr(s)}function rT(e,{relative:t}={}){let n=b.useContext(ap);Xe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cb("useViewTransitionState"),o=Ks(e,{relative:t});if(!n.isTransitioning)return!1;let s=Un(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Un(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Kc(o.pathname,c)!=null||Kc(o.pathname,s)!=null}var aT=D_();function iT(e){return b.createElement(v1,{flushSync:aT.flushSync,...e})}var it;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const c of o)s[c]=c;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),c={};for(const u of s)c[u]=o[u];return e.objectValues(c)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},e.find=(o,s)=>{for(const c of o)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function a(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=a,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(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"]),Ca=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(s){return s.message},a={_errors:[]},o=s=>{for(const c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(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 o(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 o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else a.push(t(o));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const sf=(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 oT=sf;function sT(){return oT}const lT=e=>{const{data:t,path:n,errorMaps:a,issueData:o}=e,s=[...n,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.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{...o,path:s,message:u}};function ce(e,t){const n=sT(),a=lT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===sf?void 0:sf].filter(o=>!!o)});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 o of n){if(o.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),a.push(o.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const o of n){const s=await o.key,c=await o.value;a.push({key:s,value:c})}return un.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const o of n){const{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return ze;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(a[s.value]=c.value)}return{status:t.value,value:a}}}const ze=Object.freeze({status:"aborted"}),ks=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),wv=e=>e.status==="aborted",xv=e=>e.status==="dirty",uo=e=>e.status==="valid",Gc=e=>typeof Promise<"u"&&e instanceof Promise;var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ce||(Ce={}));class _r{constructor(t,n,a,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=o}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 Pv=(e,t)=>{if(uo(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:o}=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:o}:{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:o}}class Je{get description(){return this._def.description}_getType(t){return Ca(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ca(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:Ca(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Gc(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:Ca(t)},o=this._parseSync({data:t,path:a.path,parent:a});return Pv(a,o)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ca(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return uo(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=>uo(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:Ca(t)},o=this._parse({data:t,path:a.path,parent:a}),s=await(Gc(o)?o:Promise.resolve(o));return Pv(a,s)}refine(t,n){const a=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const c=t(o),u=()=>s.addIssue({code:re.custom,...a(o)});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,o)=>t(a)?!0:(o.addIssue(typeof n=="function"?n(a,o):n),!1))}_refinement(t){return new hi({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 fi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Jc.create(this,this._def)}or(t){return Yc.create([this,t],this._def)}and(t){return Zc.create(this,t,this._def)}transform(t){return new hi({...Ke(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new eu({...Ke(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new fb({typeName:$e.ZodBranded,type:this,...Ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new tu({...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 dp.create(this,t)}readonly(){return nu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cT=/^c[^\s-]{8,}$/i,uT=/^[0-9a-z]+$/,dT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hT=/^[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,fT=/^[a-z0-9_-]{21}$/i,pT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mT=/^[-+]?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)?)??$/,gT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Th;const vT=/^(?:(?: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])$/,kT=/^(?:(?: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])$/,_T=/^(([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]))$/,bT=/^(([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])$/,wT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\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])))",PT=new RegExp(`^${ub}$`);function db(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 ST(e){return new RegExp(`^${db(e)}$`)}function CT(e){let t=`${ub}T${db(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 TT(e,t){return!!((t==="v4"||!t)&&vT.test(e)||(t==="v6"||!t)&&_T.test(e))}function ET(e,t){if(!pT.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,"="),o=JSON.parse(atob(a));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function AT(e,t){return!!((t==="v4"||!t)&&kT.test(e)||(t==="v6"||!t)&&bT.test(e))}class gr extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.string,received:s.parsedType}),ze}const a=new un;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const c=t.data.length>s.value,u=t.data.length<s.value;(c||u)&&(o=this._getOrReturnCtx(t,o),c?ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")gT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Th||(Th=new RegExp(yT,"u")),Th.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")hT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")fT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")cT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")uT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")dT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:re.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:re.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?CT(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?PT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?ST(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?mT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?TT(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?ET(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?AT(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?wT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?xT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:re.invalid_string,message:s.message}),a.dirty()):it.assertNever(s);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(o=>t.test(o),{validation:n,code:re.invalid_string,...Ce.errToObj(a)})}_addCheck(t){return new gr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ce.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,...Ce.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,...Ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ce.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ce.errToObj(n)})}nonempty(t){return this.min(1,Ce.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 RT(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,o=n>a?n:a,s=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return s%c/10**o}class li 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 s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.number,received:s.parsedType}),ze}let a;const o=new un;for(const s of this._def.checks)s.kind==="int"?it.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?RT(t.data,s.value)!==0&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_finite,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new li({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.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)}}li.create=e=>new li({checks:[],typeName:$e.ZodNumber,coerce:e?.coerce||!1,...Ke(e)});class ci 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 o=new un;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.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,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new ci({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new ci({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.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}}ci.create=e=>new ci({checks:[],typeName:$e.ZodBigInt,coerce:e?.coerce??!1,...Ke(e)});class qc 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)}}qc.create=e=>new qc({typeName:$e.ZodBoolean,coerce:e?.coerce||!1,...Ke(e)});class ho extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.date,received:s.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_date}),ze}const a=new un;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):it.assertNever(s);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.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}}ho.create=e=>new ho({checks:[],coerce:e?.coerce||!1,typeName:$e.ZodDate,...Ke(e)});class Sv 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)}}Sv.create=e=>new Sv({typeName:$e.ZodSymbol,...Ke(e)});class lf 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)}}lf.create=e=>new lf({typeName:$e.ZodUndefined,...Ke(e)});class cf 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)}}cf.create=e=>new cf({typeName:$e.ZodNull,...Ke(e)});class Cv extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Cv.create=e=>new Cv({typeName:$e.ZodAny,...Ke(e)});class uf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}uf.create=e=>new uf({typeName:$e.ZodUnknown,...Ke(e)});class Ma extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.never,received:n.parsedType}),ze}}Ma.create=e=>new Ma({typeName:$e.ZodNever,...Ke(e)});class Tv 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)}}Tv.create=e=>new Tv({typeName:$e.ZodVoid,...Ke(e)});class yr extends Je{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),o=this._def;if(n.parsedType!==ye.array)return ce(n,{code:re.invalid_type,expected:ye.array,received:n.parsedType}),ze;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(c||u)&&(ce(n,{code:c?re.too_big:re.too_small,minimum:u?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),a.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ce(n,{code:re.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),a.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ce(n,{code:re.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>o.type._parseAsync(new _r(n,c,n.path,u)))).then(c=>un.mergeArray(a,c));const s=[...n.data].map((c,u)=>o.type._parseSync(new _r(n,c,n.path,u)));return un.mergeArray(a,s)}get element(){return this._def.type}min(t,n){return new yr({...this._def,minLength:{value:t,message:Ce.toString(n)}})}max(t,n){return new yr({...this._def,maxLength:{value:t,message:Ce.toString(n)}})}length(t,n){return new yr({...this._def,exactLength:{value:t,message:Ce.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 to(e){if(e instanceof Rt){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=$r.create(to(a))}return new Rt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:to(e.element)}):e instanceof $r?$r.create(to(e.unwrap())):e instanceof fi?fi.create(to(e.unwrap())):e instanceof ui?ui.create(e.items.map(t=>to(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:o}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ma&&this._def.unknownKeys==="strip"))for(const f in o.data)c.includes(f)||u.push(f);const h=[];for(const f of c){const m=s[f],y=o.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new _r(o,y,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Ma){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(f==="strict")u.length>0&&(ce(o,{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=o.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new _r(o,y,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const y=await m.key,k=await m.value;f.push({key:y,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(a,f)):un.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{const o=this._def.errorMap?.(n,a).message??a.defaultError;return n.code==="unrecognized_keys"?{message:Ce.errToObj(t).message??o}:{message:o}}}:{}})}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 to(this)}partial(t){const n={};for(const a of it.objectKeys(this.shape)){const o=this.shape[a];t&&!t[a]?n[a]=o:n[a]=o.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 s=this.shape[a];for(;s instanceof $r;)s=s._def.innerType;n[a]=s}return new Rt({...this._def,shape:()=>n})}keyof(){return hb(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});class Yc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function o(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=s.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 s=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let s;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"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.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}}Yc.create=(e,t)=>new Yc({options:e,typeName:$e.ZodUnion,...Ke(t)});const zr=e=>e instanceof hf?zr(e.schema):e instanceof hi?zr(e.innerType()):e instanceof Qc?[e.value]:e instanceof di?e.options:e instanceof ff?it.objectValues(e.enum):e instanceof eu?zr(e._def.innerType):e instanceof lf?[void 0]:e instanceof cf?[null]:e instanceof $r?[void 0,...zr(e.unwrap())]:e instanceof fi?[null,...zr(e.unwrap())]:e instanceof fb||e instanceof nu?zr(e.unwrap()):e instanceof tu?zr(e._def.innerType):[];class up 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,o=n.data[a],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._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 o=new Map;for(const s of n){const c=zr(s.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(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,s)}}return new up({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Ke(a)})}}function df(e,t){const n=Ca(e),a=Ca(t);if(e===t)return{valid:!0,data:e};if(n===ye.object&&a===ye.object){const o=it.objectKeys(t),s=it.objectKeys(e).filter(u=>o.indexOf(u)!==-1),c={...e,...t};for(const u of s){const h=df(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 o=[];for(let s=0;s<e.length;s++){const c=e[s],u=t[s],h=df(c,u);if(!h.valid)return{valid:!1};o.push(h.data)}return{valid:!0,data:o}}else return n===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Zc extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),o=(s,c)=>{if(wv(s)||wv(c))return ze;const u=df(s.value,c.value);return u.valid?((xv(s)||xv(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(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Zc.create=(e,t,n)=>new Zc({left:e,right:t,typeName:$e.ZodIntersection,...Ke(n)});class ui 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 s=[...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(s).then(c=>un.mergeArray(n,c)):un.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new ui({...this._def,rest:t})}}ui.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:e,typeName:$e.ZodTuple,rest:null,...Ke(t)})};class Xc 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 o=[],s=this._def.keyType,c=this._def.valueType;for(const u in a.data)o.push({key:s._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,o):un.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof Je?new Xc({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ke(a)}):new Xc({keyType:gr.create(),valueType:t,typeName:$e.ZodRecord,...Ke(n)})}}class Ev 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 o=this._def.keyType,s=this._def.valueType,c=[...a.data.entries()].map(([u,h],f)=>({key:o._parse(new _r(a,u,a.path,[f,"key"])),value:s._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}}}}Ev.create=(e,t,n)=>new Ev({valueType:t,keyType:e,typeName:$e.ZodMap,...Ke(n)});class Ns 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 o=this._def;o.minSize!==null&&a.data.size<o.minSize.value&&(ce(a,{code:re.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&a.data.size>o.maxSize.value&&(ce(a,{code:re.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=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)=>s._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 Ns({...this._def,minSize:{value:t,message:Ce.toString(n)}})}max(t,n){return new Ns({...this._def,maxSize:{value:t,message:Ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ns.create=(e,t)=>new Ns({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ke(t)});class hf 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})}}hf.create=(e,t)=>new hf({getter:e,typeName:$e.ZodLazy,...Ke(t)});class Qc 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}}Qc.create=(e,t)=>new Qc({value:e,typeName:$e.ZodLiteral,...Ke(t)});function hb(e,t){return new di({values:e,typeName:$e.ZodEnum,...Ke(t)})}class di 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 di.create(t,{...this._def,...n})}exclude(t,n=this._def){return di.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}di.create=hb;class ff 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 o=it.objectValues(n);return ce(a,{expected:it.joinValues(o),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 o=it.objectValues(n);return ce(a,{received:a.data,code:re.invalid_enum_value,options:o}),ze}return Vn(t.data)}get enum(){return this._def.values}}ff.create=(e,t)=>new ff({values:e,typeName:$e.ZodNativeEnum,...Ke(t)});class Jc 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(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Jc.create=(e,t)=>new Jc({type:e,typeName:$e.ZodPromise,...Ke(t)});class hi 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),o=this._def.effect||null,s={addIssue:c=>{ce(a,c),c.fatal?n.abort():n.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const c=o.transform(a.data,s);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"?ks(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"?ks(u.value):u}}if(o.type==="refinement"){const c=u=>{const h=o.refinement(u,s);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(o.type==="transform")if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!uo(c))return ze;const u=o.transform(c.value,s);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=>uo(c)?Promise.resolve(o.transform(c.value,s)).then(u=>({status:n.value,value:u})):ze);it.assertNever(o)}}hi.create=(e,t,n)=>new hi({schema:e,typeName:$e.ZodEffects,effect:t,...Ke(n)});hi.createWithPreprocess=(e,t,n)=>new hi({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 fi extends Je{_parse(t){return this._getType(t)===ye.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fi.create=(e,t)=>new fi({innerType:e,typeName:$e.ZodNullable,...Ke(t)});class eu 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}}eu.create=(e,t)=>new eu({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class tu extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Gc(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}tu.create=(e,t)=>new tu({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class Av 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}}}Av.create=e=>new Av({typeName:$e.ZodNaN,...Ke(e)});class fb 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 dp extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ze:s.status==="dirty"?(n.dirty(),ks(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const o=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:a.path,parent:a})}}static create(t,n){return new dp({in:t,out:n,typeName:$e.ZodPipeline})}}class nu extends Je{_parse(t){const n=this._def.innerType._parse(t),a=o=>(uo(o)&&(o.value=Object.freeze(o.value)),o);return Gc(n)?n.then(o=>a(o)):a(n)}unwrap(){return this._def.innerType}}nu.create=(e,t)=>new nu({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=li.create;ci.create;const Be=qc.create,hp=ho.create,Jt=uf.create;Ma.create;const ie=yr.create,T=Rt.create,zn=Yc.create,pb=up.create;Zc.create;ui.create;const _t=Xc.create,Ye=Qc.create,nt=di.create;Jc.create;$r.create;fi.create;const pf={string:(e=>gr.create({...e,coerce:!0})),number:(e=>li.create({...e,coerce:!0})),boolean:(e=>qc.create({...e,coerce:!0})),bigint:(e=>ci.create({...e,coerce:!0})),date:(e=>ho.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 LT=nt(["CASCADE","RESTRICT","NO ACTION"]),DT=nt(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),MT=nt([fr.STRING,fr.DATE,fr.DATETIME,fr.INTEGER,fr.FLOAT,fr.BOOLEAN,fr.UUID,fr.JSON]),mb=T({referenceTable:v().min(1,"Target table cannot be empty"),referenceColumn:v().min(1,"Target column cannot be empty"),onDelete:DT,onUpdate:LT}),gb=T({columnName:v().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:zn([MT,v()]),defaultValue:v().optional(),isPrimaryKey:Be().optional(),isNullable:Be(),isUnique:Be(),foreignKey:mb.optional()}),yb=T({tableName:v().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:ie(gb).min(1,"At least one column is required"),recordCount:Q().optional(),createdAt:v().optional(),updatedAt:v().optional()}),IT=T({functionName:v(),functionDef:v(),kind:v()}),NT=T({tableName:v(),indexName:v(),indexDef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()}),OT=T({tableName:v(),policyName:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()}),jT=T({tableName:v(),triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v()});yb.pick({tableName:!0,columns:!0}).extend({rlsEnabled:Be().default(!0)});yb.pick({tableName:!0,columns:!0}).extend({message:v(),autoFields:ie(v()),nextActions:v()});T({addColumns:ie(gb.omit({foreignKey:!0})).optional(),dropColumns:ie(v()).optional(),updateColumns:ie(T({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(T({columnName:v().min(1,"Column name is required for adding foreign key"),foreignKey:mb})).optional(),dropForeignKeys:ie(v()).optional(),renameTable:T({newTableName:v().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});T({message:v(),tableName:v(),operations:ie(v())});T({message:v(),tableName:v(),nextActions:v()});T({query:v().min(1,"Query is required"),params:ie(Jt()).optional()});T({rows:ie(_t(v(),Jt())),rowCount:Q().nullable(),fields:ie(T({name:v(),dataTypeID:Q()})).optional()});T({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 UT=T({timestamp:v(),tables:_t(v(),T({schema:ie(T({columnName:v(),dataType:v(),characterMaximumLength:Q().nullable(),isNullable:v(),columnDefault:v().nullable()})),indexes:ie(T({indexname:v(),indexdef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()})),foreignKeys:ie(T({constraintName:v(),columnName:v(),foreignTableName:v(),foreignColumnName:v(),deleteRule:v().nullable(),updateRule:v().nullable()})),rlsEnabled:Be().optional(),policies:ie(T({policyname:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()})),triggers:ie(T({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(T({functionName:v(),functionDef:v(),kind:v()})),sequences:ie(T({sequenceName:v(),startValue:v(),increment:v(),minValue:v().nullable(),maxValue:v().nullable(),cycle:v()})),views:ie(T({viewName:v(),definition:v()}))});T({format:nt(["sql","json"]),data:zn([v(),UT]),timestamp:v()});T({truncate:zn([Be(),v().transform(e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});T({success:Be(),message:v(),filename:v(),tables:ie(v()),rowsImported:Q(),fileSize:Q()});T({table:v().min(1,"Table name is required"),upsertKey:v().optional()});T({success:Be(),message:v(),table:v(),rowsAffected:Q(),totalRecords:Q(),filename:v()});T({functions:ie(IT)});T({indexes:ie(NT)});T({policies:ie(OT)});T({triggers:ie(jT)});const BT=T({id:v(),key:v(),isActive:Be(),isReserved:Be(),lastUsedAt:v().nullable(),expiresAt:v().nullable(),createdAt:v(),updatedAt:v()});T({secrets:ie(BT)});T({key:v(),value:v()});T({key:v().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:v().min(1,"Value is required")});T({success:Ye(!0),message:v(),id:v()});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v()});const FT=T({key:v(),bucket:v(),size:Q(),mimeType:v().optional(),uploadedAt:v(),url:v()}),VT=T({name:v(),public:Be(),createdAt:v()});T({id:v().uuid(),maxFileSizeMb:Q().int().positive(),createdAt:v(),updatedAt:v()});T({bucketName:v().min(1,"Bucket name cannot be empty"),isPublic:Be().default(!0)});T({isPublic:Be()});T({objects:ie(FT),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({filename:v().min(1,"Filename cannot be empty"),contentType:v().optional(),size:Q().optional()});T({method:nt(["presigned","direct"]),uploadUrl:v(),fields:_t(v()).optional(),key:v(),confirmRequired:Be(),confirmUrl:v().optional(),expiresAt:hp().optional()});T({expiresIn:Q().optional().default(3600)});T({method:nt(["presigned","direct"]),url:v(),expiresAt:hp().optional(),headers:_t(v()).optional()});T({size:Q(),contentType:v().optional(),etag:v().optional()});T({maxFileSizeMb:Q().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const Su=v().uuid("Invalid user ID format"),br=v().email("Invalid email format").toLowerCase().trim(),fp=v(),zT=v().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),$T=nt(["anon","authenticated","project_admin"]),Rv=nt(["code","link"]),vb=T({name:v().optional(),avatar_url:v().url().optional()}).passthrough(),ko=T({id:Su,email:br,emailVerified:Be(),providers:ie(v()).optional(),createdAt:v(),updatedAt:v(),profile:vb.nullable(),metadata:_t(Jt()).nullable()}),Cu=nt(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);T({provider:Cu,redirectUri:v().url().optional()});const pp=T({id:v().uuid(),provider:Cu,clientId:v().optional(),scopes:ie(v()).optional(),redirectUri:v().optional(),useSharedKey:Be(),createdAt:v(),updatedAt:v()}),HT=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,kb=T({id:v().uuid(),requireEmailVerification:Be(),passwordMinLength:Q().min(4).max(128),requireNumber:Be(),requireLowercase:Be(),requireUppercase:Be(),requireSpecialChar:Be(),verifyEmailMethod:Rv,resetPasswordMethod:Rv,allowedRedirectUrls:ie(v().regex(HT,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:v(),updatedAt:v()});T({sub:Su,email:br,role:$T,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"),mp=T({id:v().uuid(),key:_b,name:v().min(1),discoveryEndpoint:v().url(),clientId:v().min(1),createdAt:v(),updatedAt:v()}),WT=T({limit:v().optional(),offset:v().optional()});T({email:br,password:fp,name:zT.optional(),redirectTo:v().url().optional()});T({email:br,password:fp});T({refreshToken:v().min(1,"refreshToken is required")});T({code:v()});WT.extend({search:v().optional()}).optional();T({userIds:ie(Su).min(1,"At least one user ID is required")});T({profile:_t(Jt())});T({email:br,redirectTo:v().url().optional()});T({email:br,otp:v().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});T({email:br,redirectTo:v().url().optional()});T({email:br,code:v().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});T({newPassword:fp,otp:v().min(1,"OTP/token is required")});T({user:ko.optional(),accessToken:v().nullable(),requireEmailVerification:Be().optional(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:ko,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:ko,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({accessToken:v(),user:ko,csrfToken:v().optional(),refreshToken:v().optional()});T({token:v(),expiresAt:v().datetime()});T({message:v()});T({user:ko});T({id:Su,profile:vb.nullable()});T({data:ie(ko),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({message:v(),deletedCount:Q().int().nonnegative()});T({authUrl:v().url()});pp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()});pp.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()}).partial();const bb=/^[A-Za-z0-9._~-]+$/;T({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(bb,"Code challenge must be base64url encoded")});T({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(bb,"Code verifier must be base64url encoded")});T({data:ie(pp),count:Q()});kb.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const KT=T({oAuthProviders:ie(Cu),customOAuthProviders:ie(_b),...kb.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});T({error:v(),message:v(),statusCode:Q().int(),nextActions:v().optional()});mp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1,"Client secret is required")});mp.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1).optional()}).partial();T({data:ie(mp),count:Q()});const wb=nt(["system","user"]),xb=T({id:v().uuid(),pattern:v().min(1),description:v().nullable(),webhookUrls:ie(v().url()).nullable(),enabled:Be(),createdAt:v().datetime(),updatedAt:v().datetime()}),GT=T({id:v().uuid(),eventName:v().min(1),channelId:v().uuid().nullable(),channelName:v().min(1),payload:_t(v(),Jt()),senderType:wb,senderId:v().uuid().nullable(),wsAudienceCount:Q().int().min(0),whAudienceCount:Q().int().min(0),whDeliveredCount:Q().int().min(0),createdAt:v().datetime()}),qT=T({retentionDays:Q().int().positive().nullable()});T({channel:v().min(1)});T({channel:v().min(1)});T({channel:v().min(1),event:v().min(1),payload:_t(v(),Jt())});pb("ok",[T({ok:Ye(!0),channel:v().min(1)}),T({ok:Ye(!1),channel:v().min(1),error:T({code:v().min(1),message:v().min(1)})})]);T({channel:v().optional(),code:v().min(1),message:v().min(1)});T({messageId:v().uuid(),channel:v().min(1),eventName:v().min(1),payload:_t(v(),Jt())});const YT=T({channel:v().optional(),messageId:v().uuid(),senderType:wb,senderId:v().uuid().optional(),timestamp:v().datetime()});T({meta:YT}).passthrough();T({pattern:v().min(1,"Channel pattern is required"),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional().default(!0)});T({pattern:v().min(1).optional(),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional()});ie(xb);T({message:v()});T({channelId:v().uuid().optional(),eventName:v().optional(),limit:pf.number().int().min(1).max(1e3).optional().default(100),offset:pf.number().int().min(0).optional().default(0)});ie(GT);T({channelId:v().uuid().optional(),since:pf.date().optional()});T({totalMessages:Q().int().min(0),whDeliveryRate:Q().min(0).max(1),topEvents:ie(T({eventName:v(),count:Q().int().min(0)})),retentionDays:qT.shape.retentionDays});const Lv=T({policyName:v(),tableName:v(),command:v(),roles:ie(v()),using:v().nullable(),withCheck:v().nullable()}),ZT=T({subscribe:T({policies:ie(Lv)}),publish:T({policies:ie(Lv)})}),XT=KT,QT=T({tables:ie(T({tableName:v(),recordCount:Q()})),totalSizeInGB:Q(),hint:v().optional()}),JT=VT.extend({objectCount:Q().optional()}),eE=T({buckets:ie(JT),totalSizeInGB:Q()}),tE=T({slug:v(),name:v(),description:v().nullable(),status:v()}),nE=T({models:ie(T({inputModality:ie(v()),outputModality:ie(v()),modelId:v()}))}),rE=T({channels:ie(xb),permissions:ZT});T({auth:XT,database:QT,storage:eE,aiIntegration:nE.optional(),functions:ie(tE),realtime:rE.optional(),version:v().optional()});const aE=T({host:v(),port:Q(),database:v(),user:v(),password:v(),sslmode:v()});T({connectionURL:v(),parameters:aE});T({databasePassword:v()});T({apiKey:v()});T({projectId:v().nullable()});const fo=nt(["text","image","audio"]),iE=T({inputModality:ie(fo).min(1),outputModality:ie(fo).min(1),provider:v(),modelId:v(),systemPrompt:v().optional()}),Pb=iE.extend({id:v().uuid()});Pb.extend({usageStats:T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()}).optional()});const oE=T({configId:v().uuid(),inputTokens:Q().int().optional(),outputTokens:Q().int().optional(),imageCount:Q().int().optional(),imageResolution:v().optional()}),sE=oE.extend({id:v().uuid(),createdAt:hp(),modelId:v().nullable().optional(),model:v().nullable(),provider:v().nullable(),inputModality:ie(fo).nullable(),outputModality:ie(fo).nullable()});T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()});const lE=T({type:Ye("text"),text:v()}),cE=T({type:Ye("image_url"),image_url:T({url:v(),detail:nt(["auto","low","high"]).optional()})}),uE=T({type:Ye("input_audio"),input_audio:T({data:v(),format:nt(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),dE=T({type:Ye("file"),file:T({filename:v(),file_data:v()})}),hE=zn([lE,cE,uE,dE]),fE=T({name:v(),description:v().optional(),parameters:_t(Jt()).optional()}),pE=T({type:Ye("function"),function:fE}),mE=zn([nt(["auto","none","required"]),T({type:Ye("function"),function:T({name:v()})})]),Sb=T({id:v(),type:Ye("function"),function:T({name:v(),arguments:v()})}),gE=T({role:nt(["user","assistant","system","tool"]),content:zn([v(),ie(hE)]).nullable(),images:ie(T({url:v()})).optional(),tool_calls:ie(Sb).optional(),tool_call_id:v().optional()}),yE=T({enabled:Be(),engine:nt(["native","exa"]).optional(),maxResults:Q().min(1).max(10).optional(),searchPrompt:v().optional()}),vE=T({enabled:Be(),pdf:T({engine:nt(["pdf-text","mistral-ocr","native"]).optional()}).optional()});T({model:v(),messages:ie(gE),temperature:Q().min(0).max(2).optional(),maxTokens:Q().positive().optional(),topP:Q().min(0).max(1).optional(),stream:Be().optional(),webSearch:yE.optional(),fileParser:vE.optional(),thinking:Be().optional(),tools:ie(pE).optional(),toolChoice:mE.optional(),parallelToolCalls:Be().optional()});const kE=T({type:Ye("url_citation"),urlCitation:T({url:v(),title:v().optional(),content:v().optional(),startIndex:Q().optional(),endIndex:Q().optional()})}),_E=T({type:Ye("file"),file:T({filename:v(),parsedContent:v().optional(),metadata:_t(Jt()).optional()})}),bE=zn([kE,_E]);T({text:v(),tool_calls:ie(Sb).optional(),annotations:ie(bE).optional(),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),input:zn([v(),ie(v())]),encoding_format:nt(["float","base64"]).optional(),dimensions:Q().int().min(0).optional()});const wE=T({object:Ye("embedding"),embedding:zn([ie(Q()),v()]),index:Q()});T({object:Ye("list"),data:ie(wE),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),prompt:v(),images:ie(T({url:v()})).optional()});T({text:v().optional(),images:ie(T({type:Ye("imageUrl"),imageUrl:v()})),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({id:v(),inputModality:ie(fo).min(1),outputModality:ie(fo).min(1),provider:v(),modelId:v(),inputPrice:Q().min(0).optional(),outputPrice:Q().min(0).optional()});Pb.omit({id:!0});T({systemPrompt:v().nullable()});T({records:ie(sE),total:Q()});T({startDate:v().datetime().optional(),endDate:v().datetime().optional(),limit:v().regex(/^\d+$/).default("50"),offset:v().regex(/^\d+$/).default("0")});T({configId:v().uuid().optional(),startDate:v().datetime().optional(),endDate:v().datetime().optional()});const xE=nt(["byok","cloud","env","unconfigured"]);T({keySource:xE,hasByokKey:Be(),maskedKey:v().optional()});T({apiKey:v().min(1,"API key is required")});const Cb=T({id:v(),actor:v(),action:v(),module:v(),details:_t(Jt()).nullable(),ipAddress:v().nullable(),createdAt:v(),updatedAt:v()});T({id:v(),name:v(),token:v()});const PE=T({id:v(),eventMessage:v(),timestamp:v(),body:_t(v(),Jt()),source:v().optional()});T({source:v(),count:Q(),lastActivity:v()});const SE=T({level:v(),message:v()});T({deploymentId:v(),status:nt(["pending","success","failed"]),logs:ie(SE),createdAt:v()});T({limit:Q().default(100),offset:Q().default(0),actor:v().optional(),action:v().optional(),module:v().optional(),startDate:v().optional(),endDate:v().optional()});T({data:ie(Cb),pagination:T({limit:Q(),offset:Q(),total:Q()})});T({days:Q().default(7)});T({totalLogs:Q(),uniqueActors:Q(),uniqueModules:Q(),actionsByModule:_t(Q()),recentActivity:ie(Cb)});T({daysToKeep:Q().default(90)});T({message:v(),deleted:Q()});T({logs:ie(PE),total:Q()});const Tb=T({id:v(),slug:v(),name:v(),description:v().nullable(),code:v(),status:nt(["draft","active","error"]),createdAt:v(),updatedAt:v(),deployedAt:v().nullable()});T({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")});T({name:v().optional(),code:v().optional(),description:v().optional(),status:nt(["draft","active"]).optional()});T({functions:ie(Tb),runtime:T({status:nt(["running","unavailable"])}),deploymentUrl:v().nullable().optional()});const CE=T({id:v(),status:nt(["success","failed"]),url:v().nullable(),buildLogs:ie(v()).optional()});T({success:Be(),function:Tb,deployment:CE.nullable().optional()});const TE=T({type:Ye("APP_ROUTE_CHANGE"),path:v()}),EE=T({type:Ye("AUTH_SUCCESS")}),AE=T({type:Ye("AUTH_ERROR"),message:v()}),RE=T({type:Ye("MCP_CONNECTION_STATUS"),connected:Be(),toolName:v(),timestamp:zn([Q(),v()])}),LE=T({type:Ye("SHOW_ONBOARDING_OVERLAY")}),DE=T({type:Ye("SHOW_SETTINGS_OVERLAY")}),ME=T({type:Ye("ONBOARDING_SUCCESS")}),IE=T({type:Ye("NAVIGATE_TO_USAGE")}),NE=T({type:Ye("SHOW_CONTACT_MODAL")}),OE=T({type:Ye("SHOW_CONNECT_OVERLAY")}),jE=T({type:Ye("SHOW_PLAN_MODAL")}),UE=T({type:Ye("AUTHORIZATION_CODE"),code:v()}),BE=T({type:Ye("ROUTE_CHANGE"),path:v()}),FE=T({type:Ye("REQUEST_PROJECT_INFO")}),VE=T({type:Ye("PROJECT_INFO"),name:v(),instanceType:v(),region:v(),latestVersion:v().optional()}),zE=T({type:Ye("REQUEST_INSTANCE_INFO")}),$E=T({type:Ye("INSTANCE_INFO"),currentInstanceType:v(),planName:v(),computeCredits:Q(),currentOrgComputeCost:Q(),instanceTypes:ie(T({id:v(),name:v(),cpu:v(),ram:v(),pricePerHour:Q(),pricePerMonth:Q()})),projects:ie(T({name:v(),instanceType:v(),monthlyCost:Q(),isCurrent:Be(),status:v()}))}),HE=T({type:Ye("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:v()}),WE=T({type:Ye("INSTANCE_TYPE_CHANGE_RESULT"),success:Be(),instanceType:v().optional(),error:v().optional()});pb("type",[TE,EE,AE,RE,LE,DE,ME,IE,NE,OE,jE,UE,BE,FE,VE,zE,$E,HE,WE]);nt(["db","storage","functions","auth","ai","realtime"]).describe(`
13
13
  SDK feature categories:
14
14
 
15
15
  - "db" - Database operations
@@ -35,11 +35,11 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
35
35
  "ai-integration-sdk" (AI features),
36
36
  "real-time" (real-time pub/sub through WebSockets),
37
37
  "deployment" (deploy frontend applications via MCP tool)
38
- `);const Eh=zn([br,ie(br).min(1,"At least one email is required").max(50,"Maximum 50 recipients allowed")]);T({to:Eh,subject:v().trim().min(1,"Subject is required").max(500,"Subject too long"),html:v().trim().min(1,"HTML content is required"),cc:Eh.optional(),bcc:Eh.optional(),from:v().trim().max(100,"From name too long").optional(),replyTo:v().email("Reply-To must be a valid email").optional()});T({});const WE=nt(["WAITING","UPLOADING","QUEUED","BUILDING","READY","ERROR","CANCELED"]),KE=T({id:v().uuid(),providerDeploymentId:v().nullable(),provider:v(),status:WE,url:v().nullable(),metadata:_t(Jt()).nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),GE=T({buildCommand:v().nullable().optional(),outputDirectory:v().nullable().optional(),installCommand:v().nullable().optional(),devCommand:v().nullable().optional(),rootDirectory:v().nullable().optional()}),qE=T({key:v(),value:v()});T({id:v().uuid(),uploadUrl:v().url(),uploadFields:_t(v())});T({projectSettings:GE.optional(),envVars:ie(qE).optional(),meta:_t(v()).optional()});T({data:ie(KE),pagination:T({limit:Q(),offset:Q(),total:Q()})});const YE=T({id:v(),key:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()}),ZE=T({id:v(),key:v(),value:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()});T({envVars:ie(YE)});T({envVar:ZE});const XE=T({key:v().trim().min(1,"key is required"),value:v()});T({envVars:ie(XE).min(1)}).superRefine(({envVars:e},t)=>{const n=new Map;e.forEach((a,o)=>{if(n.get(a.key)!==void 0){t.addIssue({code:re.custom,message:"duplicate environment variable key",path:["envVars",o,"key"]});return}n.set(a.key,o)})});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v(),count:Q().int().positive()});T({success:Ye(!0),message:v()});T({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()});T({success:Be(),slug:v().nullable(),domain:v().nullable()});T({currentDeploymentId:v().uuid().nullable(),defaultDomainUrl:v().nullable(),customDomainUrl:v().nullable()});const QE=T({type:v(),domain:v(),value:v()}),JE=T({domain:v(),apexDomain:v(),verified:Be(),misconfigured:Be(),verification:ie(QE),cnameTarget:v().nullable(),aRecordValue:v().nullable()});T({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"})});T({domains:ie(JE)});const eA=T({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()}),tA=T({id:v().uuid(),scheduleId:v().uuid(),executedAt:v().datetime(),statusCode:Q().int(),success:Be(),durationMs:Q().int(),message:v().nullable()}),Eb=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., "* * * * *").'});T({name:v().min(3,"Schedule name must be at least 3 characters long"),cronSchedule:Eb,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.")});T({name:v().min(3,"Schedule name must be at least 3 characters long").optional(),cronSchedule:Eb.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(eA);const nA=tA;T({logs:ie(nA),totalCount:Q().int().nonnegative(),limit:Q().int().positive(),offset:Q().int().nonnegative()});T({id:v().uuid(),cronJobId:v(),message:v()});T({id:v().uuid(),cronJobId:v().optional(),message:v()});T({message:v()});var zt={},qi={},Yi={},Zi={},Xi={},Qi={},rA=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")},fo=rA();const aA=fo.fetch,iA=fo.fetch.bind(fo),oA=fo.Headers,sA=fo.Request,lA=fo.Response,cA=Object.freeze(Object.defineProperty({__proto__:null,Headers:oA,Request:sA,Response:lA,default:iA,fetch:aA},Symbol.toStringTag,{value:"Module"})),uA=PS(cA);var pc={},Dv;function Ab(){if(Dv)return pc;Dv=1,Object.defineProperty(pc,"__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 pc.default=e,pc}var Mv;function Rb(){if(Mv)return Qi;Mv=1;var e=Qi&&Qi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Qi,"__esModule",{value:!0});const t=e(uA),n=e(Ab());class a{constructor(s){var c,u;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(c=s.shouldThrowOnError)!==null&&c!==void 0?c:!1,this.signal=s.signal,this.isMaybeSingle=(u=s.isMaybeSingle)!==null&&u!==void 0?u:!1,s.fetch?this.fetch=s.fetch:typeof fetch>"u"?this.fetch=t.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,c){return this.headers=new Headers(this.headers),this.headers.set(s,c),this}then(s,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,k,w;let x=null,C=null,S=null,D=f.status,L=f.statusText;if(f.ok){if(this.method!=="HEAD"){const W=await f.text();W===""||(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"))?C=W:C=JSON.parse(W))}const O=(y=this.headers.get("Prefer"))===null||y===void 0?void 0:y.match(/count=(exact|planned|estimated)/),G=(k=f.headers.get("content-range"))===null||k===void 0?void 0:k.split("/");O&&G&&G.length>1&&(S=parseInt(G[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(C)&&(C.length>1?(x={code:"PGRST116",details:`Results contain ${C.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},C=null,S=null,D=406,L="Not Acceptable"):C.length===1?C=C[0]:C=null)}else{const O=await f.text();try{x=JSON.parse(O),Array.isArray(x)&&f.status===404&&(C=[],x=null,D=200,L="OK")}catch{f.status===404&&O===""?(D=204,L="No Content"):x={message:O}}if(x&&this.isMaybeSingle&&(!((w=x?.details)===null||w===void 0)&&w.includes("0 rows"))&&(x=null,D=200,L="OK"),x&&this.shouldThrowOnError)throw new n.default(x)}return{error:x,data:C,count:S,status:D,statusText:L}});return this.shouldThrowOnError||(h=h.catch(f=>{var m,y,k;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:`${(k=f?.code)!==null&&k!==void 0?k:""}`},data:null,count:null,status:0,statusText:""}})),h.then(s,c)}returns(){return this}overrideTypes(){return this}}return Qi.default=a,Qi}var Iv;function Lb(){if(Iv)return Xi;Iv=1;var e=Xi&&Xi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Xi,"__esModule",{value:!0});const t=e(Rb());class n extends t.default{select(o){let s=!1;const c=(o??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join("");return this.url.searchParams.set("select",c),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!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},`:""}${o}.${s?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:c=s}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${o}`),this}range(o,s,{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,`${o}`),this.url.searchParams.set(f,`${s-o+1}`),this}abortSignal(o){return this.signal=o,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:o=!1,verbose:s=!1,settings:c=!1,buffers:u=!1,wal:h=!1,format:f="text"}={}){var m;const y=[o?"analyze":null,s?"verbose":null,c?"settings":null,u?"buffers":null,h?"wal":null].filter(Boolean).join("|"),k=(m=this.headers.get("Accept"))!==null&&m!==void 0?m:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${f}; for="${k}"; options=${y};`),f==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}}return Xi.default=n,Xi}var Nv;function gp(){if(Nv)return Zi;Nv=1;var e=Zi&&Zi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zi,"__esModule",{value:!0});const t=e(Lb());class n extends t.default{eq(o,s){return this.url.searchParams.append(o,`eq.${s}`),this}neq(o,s){return this.url.searchParams.append(o,`neq.${s}`),this}gt(o,s){return this.url.searchParams.append(o,`gt.${s}`),this}gte(o,s){return this.url.searchParams.append(o,`gte.${s}`),this}lt(o,s){return this.url.searchParams.append(o,`lt.${s}`),this}lte(o,s){return this.url.searchParams.append(o,`lte.${s}`),this}like(o,s){return this.url.searchParams.append(o,`like.${s}`),this}likeAllOf(o,s){return this.url.searchParams.append(o,`like(all).{${s.join(",")}}`),this}likeAnyOf(o,s){return this.url.searchParams.append(o,`like(any).{${s.join(",")}}`),this}ilike(o,s){return this.url.searchParams.append(o,`ilike.${s}`),this}ilikeAllOf(o,s){return this.url.searchParams.append(o,`ilike(all).{${s.join(",")}}`),this}ilikeAnyOf(o,s){return this.url.searchParams.append(o,`ilike(any).{${s.join(",")}}`),this}is(o,s){return this.url.searchParams.append(o,`is.${s}`),this}in(o,s){const c=Array.from(new Set(s)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(o,`in.(${c})`),this}contains(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cs.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cs.{${s.join(",")}}`):this.url.searchParams.append(o,`cs.${JSON.stringify(s)}`),this}containedBy(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cd.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cd.{${s.join(",")}}`):this.url.searchParams.append(o,`cd.${JSON.stringify(s)}`),this}rangeGt(o,s){return this.url.searchParams.append(o,`sr.${s}`),this}rangeGte(o,s){return this.url.searchParams.append(o,`nxl.${s}`),this}rangeLt(o,s){return this.url.searchParams.append(o,`sl.${s}`),this}rangeLte(o,s){return this.url.searchParams.append(o,`nxr.${s}`),this}rangeAdjacent(o,s){return this.url.searchParams.append(o,`adj.${s}`),this}overlaps(o,s){return typeof s=="string"?this.url.searchParams.append(o,`ov.${s}`):this.url.searchParams.append(o,`ov.{${s.join(",")}}`),this}textSearch(o,s,{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(o,`${h}fts${f}.${s}`),this}match(o){return Object.entries(o).forEach(([s,c])=>{this.url.searchParams.append(s,`eq.${c}`)}),this}not(o,s,c){return this.url.searchParams.append(o,`not.${s}.${c}`),this}or(o,{foreignTable:s,referencedTable:c=s}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${o})`),this}filter(o,s,c){return this.url.searchParams.append(o,`${s}.${c}`),this}}return Zi.default=n,Zi}var Ov;function Db(){if(Ov)return Yi;Ov=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0});const t=e(gp());class n{constructor(o,{headers:s={},schema:c,fetch:u}){this.url=o,this.headers=new Headers(s),this.schema=c,this.fetch=u}select(o,{head:s=!1,count:c}={}){const u=s?"HEAD":"GET";let h=!1;const f=(o??"*").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(o,{count:s,defaultToNull:c=!0}={}){var u;const h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const f=o.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:o,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:c=!1,count:u,defaultToNull:h=!0}={}){var f;const m="POST";if(this.headers.append("Prefer",`resolution=${c?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),u&&this.headers.append("Prefer",`count=${u}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const y=o.reduce((k,w)=>k.concat(Object.keys(w)),[]);if(y.length>0){const k=[...new Set(y)].map(w=>`"${w}"`);this.url.searchParams.set("columns",k.join(","))}}return new t.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}update(o,{count:s}={}){var c;const u="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}delete({count:o}={}){var s;const c="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}}return Yi.default=n,Yi}var jv;function dA(){if(jv)return qi;jv=1;var e=qi&&qi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(qi,"__esModule",{value:!0});const t=e(Db()),n=e(gp());class a{constructor(s,{headers:c={},schema:u,fetch:h}={}){this.url=s,this.headers=new Headers(c),this.schemaName=u,this.fetch=h}from(s){const c=new URL(`${this.url}/${s}`);return new t.default(c,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(s){return new a(this.url,{headers:this.headers,schema:s,fetch:this.fetch})}rpc(s,c={},{head:u=!1,get:h=!1,count:f}={}){var m;let y;const k=new URL(`${this.url}/rpc/${s}`);let w;u||h?(y=u?"HEAD":"GET",Object.entries(c).filter(([C,S])=>S!==void 0).map(([C,S])=>[C,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([C,S])=>{k.searchParams.append(C,S)})):(y="POST",w=c);const x=new Headers(this.headers);return f&&x.set("Prefer",`count=${f}`),new n.default({method:y,url:k,headers:x,schema:this.schemaName,body:w,fetch:(m=this.fetch)!==null&&m!==void 0?m:fetch})}}return qi.default=a,qi}var Uv;function hA(){if(Uv)return zt;Uv=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(dA());zt.PostgrestClient=t.default;const n=e(Db());zt.PostgrestQueryBuilder=n.default;const a=e(gp());zt.PostgrestFilterBuilder=a.default;const o=e(Lb());zt.PostgrestTransformBuilder=o.default;const s=e(Rb());zt.PostgrestBuilder=s.default;const c=e(Ab());return zt.PostgrestError=c.default,zt.default={PostgrestClient:t.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:o.default,PostgrestBuilder:s.default,PostgrestError:c.default},zt}var fA=hA();const pA=L_(fA),{PostgrestClient:mA,PostgrestQueryBuilder:i4,PostgrestFilterBuilder:o4,PostgrestTransformBuilder:s4,PostgrestBuilder:l4,PostgrestError:c4}=pA,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 Rc=Object.create(null);Object.keys(wr).forEach(e=>{Rc[wr[e]]=e});const mf={type:"error",data:"parser error"},Mb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ib=typeof ArrayBuffer=="function",Nb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yp=({type:e,data:t},n,a)=>Mb&&t instanceof Blob?n?a(t):Bv(t,a):Ib&&(t instanceof ArrayBuffer||Nb(t))?n?a(t):Bv(new Blob([t]),a):a(wr[e]+(t||"")),Bv=(e,t)=>{const n=new FileReader;return n.onload=function(){const a=n.result.split(",")[1];t("b"+(a||""))},n.readAsDataURL(e)};function Fv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ah;function gA(e,t){if(Mb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Fv).then(t);if(Ib&&(e.data instanceof ArrayBuffer||Nb(e.data)))return t(Fv(e.data));yp(e,!1,n=>{Ah||(Ah=new TextEncoder),t(Ah.encode(n))})}const Vv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ks=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Vv.length;e++)ks[Vv.charCodeAt(e)]=e;const yA=e=>{let t=e.length*.75,n=e.length,a,o=0,s,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)s=ks[e.charCodeAt(a)],c=ks[e.charCodeAt(a+1)],u=ks[e.charCodeAt(a+2)],h=ks[e.charCodeAt(a+3)],m[o++]=s<<2|c>>4,m[o++]=(c&15)<<4|u>>2,m[o++]=(u&3)<<6|h&63;return f},vA=typeof ArrayBuffer=="function",vp=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ob(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:kA(e.substring(1),t)}:Rc[n]?e.length>1?{type:Rc[n],data:e.substring(1)}:{type:Rc[n]}:mf},kA=(e,t)=>{if(vA){const n=yA(e);return Ob(n,t)}else return{base64:!0,data:e}},Ob=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,jb="",_A=(e,t)=>{const n=e.length,a=new Array(n);let o=0;e.forEach((s,c)=>{yp(s,!1,u=>{a[c]=u,++o===n&&t(a.join(jb))})})},bA=(e,t)=>{const n=e.split(jb),a=[];for(let o=0;o<n.length;o++){const s=vp(n[o],t);if(a.push(s),s.type==="error")break}return a};function wA(){return new TransformStream({transform(e,t){gA(e,n=>{const a=n.length;let o;if(a<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,a);else if(a<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,a)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(a))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Rh;function mc(e){return e.reduce((t,n)=>t+n.length,0)}function gc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let a=0;for(let o=0;o<t;o++)n[o]=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 xA(e,t){Rh||(Rh=new TextDecoder);const n=[];let a=0,o=-1,s=!1;return new TransformStream({transform(c,u){for(n.push(c);;){if(a===0){if(mc(n)<1)break;const h=gc(n,1);s=(h[0]&128)===128,o=h[0]&127,o<126?a=3:o===126?a=1:a=2}else if(a===1){if(mc(n)<2)break;const h=gc(n,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),a=3}else if(a===2){if(mc(n)<8)break;const h=gc(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){u.enqueue(mf);break}o=m*Math.pow(2,32)+f.getUint32(4),a=3}else{if(mc(n)<o)break;const h=gc(n,o);u.enqueue(vp(s?h:Rh.decode(h),t)),a=0}if(o===0||o>e){u.enqueue(mf);break}}}})}const Ub=4;function Dt(e){if(e)return PA(e)}function PA(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,o=0;o<n.length;o++)if(a=n[o],a===t||a.fn===t){n.splice(o,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,o=n.length;a<o;++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 Tu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),SA="arraybuffer";function Bb(e,...t){return t.reduce((n,a)=>(e.hasOwnProperty(a)&&(n[a]=e[a]),n),{})}const CA=Nn.setTimeout,TA=Nn.clearTimeout;function Eu(e,t){t.useNativeTimers?(e.setTimeoutFn=CA.bind(Nn),e.clearTimeoutFn=TA.bind(Nn)):(e.setTimeoutFn=Nn.setTimeout.bind(Nn),e.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const EA=1.33;function AA(e){return typeof e=="string"?RA(e):Math.ceil((e.byteLength||e.size)*EA)}function RA(e){let t=0,n=0;for(let a=0,o=e.length;a<o;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 Fb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function LA(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function DA(e){let t={},n=e.split("&");for(let a=0,o=n.length;a<o;a++){let s=n[a].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class MA extends Error{constructor(t,n,a){super(t),this.description=n,this.context=a,this.type="TransportError"}}class kp extends Dt{constructor(t){super(),this.writable=!1,Eu(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 MA(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=vp(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=LA(t);return n.length?"?"+n:""}}class IA extends kp{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,_A(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]=Fb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Vb=!1;try{Vb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const NA=Vb;function OA(){}class jA extends IA{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",(o,s)=>{this.onError("xhr post error",o,s)})}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 lo=class Lc extends Dt{constructor(t,n,a){super(),this.createRequest=t,Eu(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=Bb(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 o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&a.setRequestHeader(o,this._opts.extraHeaders[o])}}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 o;a.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.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(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Lc.requestsCount++,Lc.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=OA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Lc.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()}};lo.requestsCount=0;lo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zv);else if(typeof addEventListener=="function"){const e="onpagehide"in Nn?"pagehide":"unload";addEventListener(e,zv,!1)}}function zv(){for(let e in lo.requests)lo.requests.hasOwnProperty(e)&&lo.requests[e].abort()}const UA=(function(){const e=zb({xdomain:!1});return e&&e.responseType!==null})();class BA extends jA{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=UA&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new lo(zb,this.uri(),t)}}function zb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||NA))return new XMLHttpRequest}catch{}if(!t)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $b=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class FA extends kp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,a=$b?{}:Bb(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(o){return this.emitReserved("error",o)}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],o=n===t.length-1;yp(a,this.supportsBinary,s=>{try{this.doWrite(a,s)}catch{}o&&Tu(()=>{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]=Fb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lh=Nn.WebSocket||Nn.MozWebSocket;class VA extends FA{createSocket(t,n,a){return $b?new Lh(t,n,a):n?new Lh(t,n):new Lh(t)}doWrite(t,n){this.ws.send(n)}}class zA extends kp{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=xA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=t.readable.pipeThrough(n).getReader(),o=wA();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{a.read().then(({done:u,value:h})=>{u||(this.onPacket(h),s())}).catch(u=>{})};s();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],o=n===t.length-1;this._writer.write(a).then(()=>{o&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const $A={websocket:VA,webtransport:zA,polling:BA},HA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,WA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gf(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 o=HA.exec(e||""),s={},c=14;for(;c--;)s[WA[c]]=o[c]||"";return n!=-1&&a!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=KA(s,s.path),s.queryKey=GA(s,s.query),s}function KA(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 GA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,o,s){o&&(n[o]=s)}),n}const yf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dc=[];yf&&addEventListener("offline",()=>{Dc.forEach(e=>e())},!1);class Da extends Dt{constructor(t,n){if(super(),this.binaryType=SA,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=gf(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=gf(n.host).host);Eu(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 o=a.prototype.name;this.transports.push(o),this._transportsByName[o]=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=DA(this.opts.query)),yf&&(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"})},Dc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Ub,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&&Da.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",Da.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 o=this.writeBuffer[a].data;if(o&&(n+=AA(o)),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,Tu(()=>{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,o){if(typeof n=="function"&&(o=n,n=void 0),typeof a=="function"&&(o=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const s={type:t,data:n,options:a};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),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(Da.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(),yf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Dc.indexOf(this._offlineEventListener);a!==-1&&Dc.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Da.protocol=Ub;class qA extends Da{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;Da.priorWebsocketSuccess=!1;const o=()=>{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;Da.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 k=new Error("probe error");k.transport=n.name,this.emitReserved("upgradeError",k)}}))};function s(){a||(a=!0,m(),n.close(),n=null)}const c=y=>{const k=new Error("probe error: "+y);k.transport=n.name,s(),this.emitReserved("upgradeError",k)};function u(){c("transport closed")}function h(){c("socket closed")}function f(y){n&&y.name!==n.name&&s()}const m=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",u),this.off("close",h),this.off("upgrading",f)};n.once("open",o),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 YA=class extends qA{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(o=>$A[o]).filter(o=>!!o)),super(t,a)}};function ZA(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=gf(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 s=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+s+":"+a.port+t,a.href=a.protocol+"://"+s+(n&&n.port===a.port?"":":"+a.port),a}const XA=typeof ArrayBuffer=="function",QA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Hb=Object.prototype.toString,JA=typeof Blob=="function"||typeof Blob<"u"&&Hb.call(Blob)==="[object BlobConstructor]",eR=typeof File=="function"||typeof File<"u"&&Hb.call(File)==="[object FileConstructor]";function _p(e){return XA&&(e instanceof ArrayBuffer||QA(e))||JA&&e instanceof Blob||eR&&e instanceof File}function Mc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,a=e.length;n<a;n++)if(Mc(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mc(e[n]))return!0;return!1}function tR(e){const t=[],n=e.data,a=e;return a.data=vf(n,t),a.attachments=t.length,{packet:a,buffers:t}}function vf(e,t){if(!e)return e;if(_p(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]=vf(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]=vf(e[a],t));return n}return e}function nR(e,t){return e.data=kf(e.data,t),delete e.attachments,e}function kf(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]=kf(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kf(e[n],t));return e}const rR=["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 aR{constructor(t){this.replacer=t}encode(t){return(t.type===tt.EVENT||t.type===tt.ACK)&&Mc(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=tR(t),a=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(a),o}}class bp 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 iR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(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 s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(s,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(c);if(!oR(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 s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););a.nsp=t.substring(s,n)}else a.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const s=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(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(bp.isPayloadValid(a.type,s))a.data=s;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 $v(n);case tt.DISCONNECT:return n===void 0;case tt.CONNECT_ERROR:return typeof n=="string"||$v(n);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&rR.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 iR{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=nR(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const oR=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function $v(e){return Object.prototype.toString.call(e)==="[object Object]"}const sR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bp,Encoder:aR,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function rr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const lR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wb 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,o,s;if(lR.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=(o=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._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 o=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const s=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"))},o),c=(...u)=>{this.io.clearTimeoutFn(s),n.apply(this,u)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((a,o)=>{const s=(c,u)=>c?o(c):a(u);s.withError=!0,n.push(s),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((o,...s)=>(this._queue[0],o!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...s)),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(...o){a||(a=!0,n.packet({type:tt.ACK,id:t,data:o}))}}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 ko(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}ko.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};ko.prototype.reset=function(){this.attempts=0};ko.prototype.setMin=function(e){this.ms=e};ko.prototype.setMax=function(e){this.max=e};ko.prototype.setJitter=function(e){this.jitter=e};class _f 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,Eu(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 ko({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||sR;this.encoder=new o.Encoder,this.decoder=new o.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 YA(this.uri,this.opts);const n=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const o=rr(n,"open",function(){a.onopen(),t&&t()}),s=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},c=rr(n,"error",s);if(this._timeout!==!1){const u=this._timeout,h=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),n.close()},u);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),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){Tu(()=>{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 Wb(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(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):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 fs={};function Ic(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ZA(e,t.path||"/socket.io"),a=n.source,o=n.id,s=n.path,c=fs[o]&&s in fs[o].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return u?h=new _f(a,t):(fs[o]||(fs[o]=new _f(a,t)),h=fs[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Ic,{Manager:_f,Socket:Wb,io:Ic,connect:Ic});var We=class Kb extends Error{constructor(t,n,a,o){super(t),this.name="InsForgeError",this.statusCode=n,this.error=a,this.nextActions=o}static fromApiError(t){return new Kb(t.message,t.statusCode,t.error,t.nextActions)}},cR=["authorization","x-api-key","cookie","set-cookie"],uR=["password","token","accesstoken","refreshtoken","authorization","secret","apikey","api_key","email","ssn","creditcard","credit_card"];function dR(e){const t={};for(const[n,a]of Object.entries(e))cR.includes(n.toLowerCase())?t[n]="***REDACTED***":t[n]=a;return t}function ws(e){if(e==null)return e;if(typeof e=="string")try{const t=JSON.parse(e);return ws(t)}catch{return e}if(Array.isArray(e))return e.map(ws);if(typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))uR.includes(n.toLowerCase().replace(/[-_]/g,""))?t[n]="***REDACTED***":t[n]=ws(a);return t}return e}function Hv(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 Gb=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 o=[`→ ${e} ${t}`];n&&Object.keys(n).length>0&&o.push(` Headers: ${JSON.stringify(dR(n))}`);const s=Hv(ws(a));if(s){const c=s.length>1e3?s.slice(0,1e3)+"... [truncated]":s;o.push(` Body: ${c}`)}this.log(o.join(`
39
- `))}logResponse(e,t,n,a,o){if(!this.enabled)return;const s=[`← ${e} ${t} ${n} (${a}ms)`],c=Hv(ws(o));if(c){const u=c.length>1e3?c.slice(0,1e3)+"... [truncated]":c;s.push(` Body: ${u}`)}n>=400?this.error(s.join(`
38
+ `);const Eh=zn([br,ie(br).min(1,"At least one email is required").max(50,"Maximum 50 recipients allowed")]);T({to:Eh,subject:v().trim().min(1,"Subject is required").max(500,"Subject too long"),html:v().trim().min(1,"HTML content is required"),cc:Eh.optional(),bcc:Eh.optional(),from:v().trim().max(100,"From name too long").optional(),replyTo:v().email("Reply-To must be a valid email").optional()});T({});const KE=nt(["WAITING","UPLOADING","QUEUED","BUILDING","READY","ERROR","CANCELED"]),GE=T({id:v().uuid(),providerDeploymentId:v().nullable(),provider:v(),status:KE,url:v().nullable(),metadata:_t(Jt()).nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),qE=T({buildCommand:v().nullable().optional(),outputDirectory:v().nullable().optional(),installCommand:v().nullable().optional(),devCommand:v().nullable().optional(),rootDirectory:v().nullable().optional()}),YE=T({key:v(),value:v()});T({id:v().uuid(),uploadUrl:v().url(),uploadFields:_t(v())});T({projectSettings:qE.optional(),envVars:ie(YE).optional(),meta:_t(v()).optional()});T({data:ie(GE),pagination:T({limit:Q(),offset:Q(),total:Q()})});const ZE=T({id:v(),key:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()}),XE=T({id:v(),key:v(),value:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()});T({envVars:ie(ZE)});T({envVar:XE});const QE=T({key:v().trim().min(1,"key is required"),value:v()});T({envVars:ie(QE).min(1)}).superRefine(({envVars:e},t)=>{const n=new Map;e.forEach((a,o)=>{if(n.get(a.key)!==void 0){t.addIssue({code:re.custom,message:"duplicate environment variable key",path:["envVars",o,"key"]});return}n.set(a.key,o)})});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v(),count:Q().int().positive()});T({success:Ye(!0),message:v()});T({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()});T({success:Be(),slug:v().nullable(),domain:v().nullable()});T({currentDeploymentId:v().uuid().nullable(),defaultDomainUrl:v().nullable(),customDomainUrl:v().nullable()});const JE=T({type:v(),domain:v(),value:v()}),eA=T({domain:v(),apexDomain:v(),verified:Be(),misconfigured:Be(),verification:ie(JE),cnameTarget:v().nullable(),aRecordValue:v().nullable()});T({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"})});T({domains:ie(eA)});const tA=T({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()}),nA=T({id:v().uuid(),scheduleId:v().uuid(),executedAt:v().datetime(),statusCode:Q().int(),success:Be(),durationMs:Q().int(),message:v().nullable()}),Eb=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., "* * * * *").'});T({name:v().min(3,"Schedule name must be at least 3 characters long"),cronSchedule:Eb,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.")});T({name:v().min(3,"Schedule name must be at least 3 characters long").optional(),cronSchedule:Eb.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(tA);const rA=nA;T({logs:ie(rA),totalCount:Q().int().nonnegative(),limit:Q().int().positive(),offset:Q().int().nonnegative()});T({id:v().uuid(),cronJobId:v(),message:v()});T({id:v().uuid(),cronJobId:v().optional(),message:v()});T({message:v()});var zt={},Yi={},Zi={},Xi={},Qi={},Ji={},aA=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")},po=aA();const iA=po.fetch,oA=po.fetch.bind(po),sA=po.Headers,lA=po.Request,cA=po.Response,uA=Object.freeze(Object.defineProperty({__proto__:null,Headers:sA,Request:lA,Response:cA,default:oA,fetch:iA},Symbol.toStringTag,{value:"Module"})),dA=SS(uA);var pc={},Dv;function Ab(){if(Dv)return pc;Dv=1,Object.defineProperty(pc,"__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 pc.default=e,pc}var Mv;function Rb(){if(Mv)return Ji;Mv=1;var e=Ji&&Ji.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ji,"__esModule",{value:!0});const t=e(dA),n=e(Ab());class a{constructor(s){var c,u;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(c=s.shouldThrowOnError)!==null&&c!==void 0?c:!1,this.signal=s.signal,this.isMaybeSingle=(u=s.isMaybeSingle)!==null&&u!==void 0?u:!1,s.fetch?this.fetch=s.fetch:typeof fetch>"u"?this.fetch=t.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,c){return this.headers=new Headers(this.headers),this.headers.set(s,c),this}then(s,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,k,w;let x=null,C=null,S=null,D=f.status,L=f.statusText;if(f.ok){if(this.method!=="HEAD"){const W=await f.text();W===""||(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"))?C=W:C=JSON.parse(W))}const O=(y=this.headers.get("Prefer"))===null||y===void 0?void 0:y.match(/count=(exact|planned|estimated)/),G=(k=f.headers.get("content-range"))===null||k===void 0?void 0:k.split("/");O&&G&&G.length>1&&(S=parseInt(G[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(C)&&(C.length>1?(x={code:"PGRST116",details:`Results contain ${C.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},C=null,S=null,D=406,L="Not Acceptable"):C.length===1?C=C[0]:C=null)}else{const O=await f.text();try{x=JSON.parse(O),Array.isArray(x)&&f.status===404&&(C=[],x=null,D=200,L="OK")}catch{f.status===404&&O===""?(D=204,L="No Content"):x={message:O}}if(x&&this.isMaybeSingle&&(!((w=x?.details)===null||w===void 0)&&w.includes("0 rows"))&&(x=null,D=200,L="OK"),x&&this.shouldThrowOnError)throw new n.default(x)}return{error:x,data:C,count:S,status:D,statusText:L}});return this.shouldThrowOnError||(h=h.catch(f=>{var m,y,k;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:`${(k=f?.code)!==null&&k!==void 0?k:""}`},data:null,count:null,status:0,statusText:""}})),h.then(s,c)}returns(){return this}overrideTypes(){return this}}return Ji.default=a,Ji}var Iv;function Lb(){if(Iv)return Qi;Iv=1;var e=Qi&&Qi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Qi,"__esModule",{value:!0});const t=e(Rb());class n extends t.default{select(o){let s=!1;const c=(o??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join("");return this.url.searchParams.set("select",c),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!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},`:""}${o}.${s?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:c=s}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${o}`),this}range(o,s,{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,`${o}`),this.url.searchParams.set(f,`${s-o+1}`),this}abortSignal(o){return this.signal=o,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:o=!1,verbose:s=!1,settings:c=!1,buffers:u=!1,wal:h=!1,format:f="text"}={}){var m;const y=[o?"analyze":null,s?"verbose":null,c?"settings":null,u?"buffers":null,h?"wal":null].filter(Boolean).join("|"),k=(m=this.headers.get("Accept"))!==null&&m!==void 0?m:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${f}; for="${k}"; options=${y};`),f==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}}return Qi.default=n,Qi}var Nv;function gp(){if(Nv)return Xi;Nv=1;var e=Xi&&Xi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Xi,"__esModule",{value:!0});const t=e(Lb());class n extends t.default{eq(o,s){return this.url.searchParams.append(o,`eq.${s}`),this}neq(o,s){return this.url.searchParams.append(o,`neq.${s}`),this}gt(o,s){return this.url.searchParams.append(o,`gt.${s}`),this}gte(o,s){return this.url.searchParams.append(o,`gte.${s}`),this}lt(o,s){return this.url.searchParams.append(o,`lt.${s}`),this}lte(o,s){return this.url.searchParams.append(o,`lte.${s}`),this}like(o,s){return this.url.searchParams.append(o,`like.${s}`),this}likeAllOf(o,s){return this.url.searchParams.append(o,`like(all).{${s.join(",")}}`),this}likeAnyOf(o,s){return this.url.searchParams.append(o,`like(any).{${s.join(",")}}`),this}ilike(o,s){return this.url.searchParams.append(o,`ilike.${s}`),this}ilikeAllOf(o,s){return this.url.searchParams.append(o,`ilike(all).{${s.join(",")}}`),this}ilikeAnyOf(o,s){return this.url.searchParams.append(o,`ilike(any).{${s.join(",")}}`),this}is(o,s){return this.url.searchParams.append(o,`is.${s}`),this}in(o,s){const c=Array.from(new Set(s)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(o,`in.(${c})`),this}contains(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cs.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cs.{${s.join(",")}}`):this.url.searchParams.append(o,`cs.${JSON.stringify(s)}`),this}containedBy(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cd.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cd.{${s.join(",")}}`):this.url.searchParams.append(o,`cd.${JSON.stringify(s)}`),this}rangeGt(o,s){return this.url.searchParams.append(o,`sr.${s}`),this}rangeGte(o,s){return this.url.searchParams.append(o,`nxl.${s}`),this}rangeLt(o,s){return this.url.searchParams.append(o,`sl.${s}`),this}rangeLte(o,s){return this.url.searchParams.append(o,`nxr.${s}`),this}rangeAdjacent(o,s){return this.url.searchParams.append(o,`adj.${s}`),this}overlaps(o,s){return typeof s=="string"?this.url.searchParams.append(o,`ov.${s}`):this.url.searchParams.append(o,`ov.{${s.join(",")}}`),this}textSearch(o,s,{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(o,`${h}fts${f}.${s}`),this}match(o){return Object.entries(o).forEach(([s,c])=>{this.url.searchParams.append(s,`eq.${c}`)}),this}not(o,s,c){return this.url.searchParams.append(o,`not.${s}.${c}`),this}or(o,{foreignTable:s,referencedTable:c=s}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${o})`),this}filter(o,s,c){return this.url.searchParams.append(o,`${s}.${c}`),this}}return Xi.default=n,Xi}var Ov;function Db(){if(Ov)return Zi;Ov=1;var e=Zi&&Zi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zi,"__esModule",{value:!0});const t=e(gp());class n{constructor(o,{headers:s={},schema:c,fetch:u}){this.url=o,this.headers=new Headers(s),this.schema=c,this.fetch=u}select(o,{head:s=!1,count:c}={}){const u=s?"HEAD":"GET";let h=!1;const f=(o??"*").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(o,{count:s,defaultToNull:c=!0}={}){var u;const h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const f=o.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:o,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:c=!1,count:u,defaultToNull:h=!0}={}){var f;const m="POST";if(this.headers.append("Prefer",`resolution=${c?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),u&&this.headers.append("Prefer",`count=${u}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const y=o.reduce((k,w)=>k.concat(Object.keys(w)),[]);if(y.length>0){const k=[...new Set(y)].map(w=>`"${w}"`);this.url.searchParams.set("columns",k.join(","))}}return new t.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}update(o,{count:s}={}){var c;const u="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}delete({count:o}={}){var s;const c="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}}return Zi.default=n,Zi}var jv;function hA(){if(jv)return Yi;jv=1;var e=Yi&&Yi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Yi,"__esModule",{value:!0});const t=e(Db()),n=e(gp());class a{constructor(s,{headers:c={},schema:u,fetch:h}={}){this.url=s,this.headers=new Headers(c),this.schemaName=u,this.fetch=h}from(s){const c=new URL(`${this.url}/${s}`);return new t.default(c,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(s){return new a(this.url,{headers:this.headers,schema:s,fetch:this.fetch})}rpc(s,c={},{head:u=!1,get:h=!1,count:f}={}){var m;let y;const k=new URL(`${this.url}/rpc/${s}`);let w;u||h?(y=u?"HEAD":"GET",Object.entries(c).filter(([C,S])=>S!==void 0).map(([C,S])=>[C,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([C,S])=>{k.searchParams.append(C,S)})):(y="POST",w=c);const x=new Headers(this.headers);return f&&x.set("Prefer",`count=${f}`),new n.default({method:y,url:k,headers:x,schema:this.schemaName,body:w,fetch:(m=this.fetch)!==null&&m!==void 0?m:fetch})}}return Yi.default=a,Yi}var Uv;function fA(){if(Uv)return zt;Uv=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(hA());zt.PostgrestClient=t.default;const n=e(Db());zt.PostgrestQueryBuilder=n.default;const a=e(gp());zt.PostgrestFilterBuilder=a.default;const o=e(Lb());zt.PostgrestTransformBuilder=o.default;const s=e(Rb());zt.PostgrestBuilder=s.default;const c=e(Ab());return zt.PostgrestError=c.default,zt.default={PostgrestClient:t.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:o.default,PostgrestBuilder:s.default,PostgrestError:c.default},zt}var pA=fA();const mA=L_(pA),{PostgrestClient:gA,PostgrestQueryBuilder:o4,PostgrestFilterBuilder:s4,PostgrestTransformBuilder:l4,PostgrestBuilder:c4,PostgrestError:u4}=mA,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 Rc=Object.create(null);Object.keys(wr).forEach(e=>{Rc[wr[e]]=e});const mf={type:"error",data:"parser error"},Mb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ib=typeof ArrayBuffer=="function",Nb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yp=({type:e,data:t},n,a)=>Mb&&t instanceof Blob?n?a(t):Bv(t,a):Ib&&(t instanceof ArrayBuffer||Nb(t))?n?a(t):Bv(new Blob([t]),a):a(wr[e]+(t||"")),Bv=(e,t)=>{const n=new FileReader;return n.onload=function(){const a=n.result.split(",")[1];t("b"+(a||""))},n.readAsDataURL(e)};function Fv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ah;function yA(e,t){if(Mb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Fv).then(t);if(Ib&&(e.data instanceof ArrayBuffer||Nb(e.data)))return t(Fv(e.data));yp(e,!1,n=>{Ah||(Ah=new TextEncoder),t(Ah.encode(n))})}const Vv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_s=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Vv.length;e++)_s[Vv.charCodeAt(e)]=e;const vA=e=>{let t=e.length*.75,n=e.length,a,o=0,s,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)s=_s[e.charCodeAt(a)],c=_s[e.charCodeAt(a+1)],u=_s[e.charCodeAt(a+2)],h=_s[e.charCodeAt(a+3)],m[o++]=s<<2|c>>4,m[o++]=(c&15)<<4|u>>2,m[o++]=(u&3)<<6|h&63;return f},kA=typeof ArrayBuffer=="function",vp=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ob(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:_A(e.substring(1),t)}:Rc[n]?e.length>1?{type:Rc[n],data:e.substring(1)}:{type:Rc[n]}:mf},_A=(e,t)=>{if(kA){const n=vA(e);return Ob(n,t)}else return{base64:!0,data:e}},Ob=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,jb="",bA=(e,t)=>{const n=e.length,a=new Array(n);let o=0;e.forEach((s,c)=>{yp(s,!1,u=>{a[c]=u,++o===n&&t(a.join(jb))})})},wA=(e,t)=>{const n=e.split(jb),a=[];for(let o=0;o<n.length;o++){const s=vp(n[o],t);if(a.push(s),s.type==="error")break}return a};function xA(){return new TransformStream({transform(e,t){yA(e,n=>{const a=n.length;let o;if(a<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,a);else if(a<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,a)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(a))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Rh;function mc(e){return e.reduce((t,n)=>t+n.length,0)}function gc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let a=0;for(let o=0;o<t;o++)n[o]=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 PA(e,t){Rh||(Rh=new TextDecoder);const n=[];let a=0,o=-1,s=!1;return new TransformStream({transform(c,u){for(n.push(c);;){if(a===0){if(mc(n)<1)break;const h=gc(n,1);s=(h[0]&128)===128,o=h[0]&127,o<126?a=3:o===126?a=1:a=2}else if(a===1){if(mc(n)<2)break;const h=gc(n,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),a=3}else if(a===2){if(mc(n)<8)break;const h=gc(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){u.enqueue(mf);break}o=m*Math.pow(2,32)+f.getUint32(4),a=3}else{if(mc(n)<o)break;const h=gc(n,o);u.enqueue(vp(s?h:Rh.decode(h),t)),a=0}if(o===0||o>e){u.enqueue(mf);break}}}})}const Ub=4;function Dt(e){if(e)return SA(e)}function SA(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,o=0;o<n.length;o++)if(a=n[o],a===t||a.fn===t){n.splice(o,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,o=n.length;a<o;++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 Tu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),CA="arraybuffer";function Bb(e,...t){return t.reduce((n,a)=>(e.hasOwnProperty(a)&&(n[a]=e[a]),n),{})}const TA=Nn.setTimeout,EA=Nn.clearTimeout;function Eu(e,t){t.useNativeTimers?(e.setTimeoutFn=TA.bind(Nn),e.clearTimeoutFn=EA.bind(Nn)):(e.setTimeoutFn=Nn.setTimeout.bind(Nn),e.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const AA=1.33;function RA(e){return typeof e=="string"?LA(e):Math.ceil((e.byteLength||e.size)*AA)}function LA(e){let t=0,n=0;for(let a=0,o=e.length;a<o;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 Fb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function DA(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function MA(e){let t={},n=e.split("&");for(let a=0,o=n.length;a<o;a++){let s=n[a].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class IA extends Error{constructor(t,n,a){super(t),this.description=n,this.context=a,this.type="TransportError"}}class kp extends Dt{constructor(t){super(),this.writable=!1,Eu(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 IA(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=vp(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=DA(t);return n.length?"?"+n:""}}class NA extends kp{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)};wA(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,bA(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]=Fb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Vb=!1;try{Vb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const OA=Vb;function jA(){}class UA extends NA{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",(o,s)=>{this.onError("xhr post error",o,s)})}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 co=class Lc extends Dt{constructor(t,n,a){super(),this.createRequest=t,Eu(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=Bb(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 o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&a.setRequestHeader(o,this._opts.extraHeaders[o])}}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 o;a.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.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(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Lc.requestsCount++,Lc.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=jA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Lc.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()}};co.requestsCount=0;co.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zv);else if(typeof addEventListener=="function"){const e="onpagehide"in Nn?"pagehide":"unload";addEventListener(e,zv,!1)}}function zv(){for(let e in co.requests)co.requests.hasOwnProperty(e)&&co.requests[e].abort()}const BA=(function(){const e=zb({xdomain:!1});return e&&e.responseType!==null})();class FA extends UA{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=BA&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new co(zb,this.uri(),t)}}function zb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||OA))return new XMLHttpRequest}catch{}if(!t)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $b=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class VA extends kp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,a=$b?{}:Bb(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(o){return this.emitReserved("error",o)}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],o=n===t.length-1;yp(a,this.supportsBinary,s=>{try{this.doWrite(a,s)}catch{}o&&Tu(()=>{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]=Fb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lh=Nn.WebSocket||Nn.MozWebSocket;class zA extends VA{createSocket(t,n,a){return $b?new Lh(t,n,a):n?new Lh(t,n):new Lh(t)}doWrite(t,n){this.ws.send(n)}}class $A extends kp{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=PA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=t.readable.pipeThrough(n).getReader(),o=xA();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{a.read().then(({done:u,value:h})=>{u||(this.onPacket(h),s())}).catch(u=>{})};s();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],o=n===t.length-1;this._writer.write(a).then(()=>{o&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const HA={websocket:zA,webtransport:$A,polling:FA},WA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,KA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gf(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 o=WA.exec(e||""),s={},c=14;for(;c--;)s[KA[c]]=o[c]||"";return n!=-1&&a!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=GA(s,s.path),s.queryKey=qA(s,s.query),s}function GA(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 qA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,o,s){o&&(n[o]=s)}),n}const yf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dc=[];yf&&addEventListener("offline",()=>{Dc.forEach(e=>e())},!1);class Da extends Dt{constructor(t,n){if(super(),this.binaryType=CA,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=gf(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=gf(n.host).host);Eu(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 o=a.prototype.name;this.transports.push(o),this._transportsByName[o]=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=MA(this.opts.query)),yf&&(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"})},Dc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Ub,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&&Da.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",Da.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 o=this.writeBuffer[a].data;if(o&&(n+=RA(o)),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,Tu(()=>{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,o){if(typeof n=="function"&&(o=n,n=void 0),typeof a=="function"&&(o=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const s={type:t,data:n,options:a};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),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(Da.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(),yf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Dc.indexOf(this._offlineEventListener);a!==-1&&Dc.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Da.protocol=Ub;class YA extends Da{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;Da.priorWebsocketSuccess=!1;const o=()=>{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;Da.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 k=new Error("probe error");k.transport=n.name,this.emitReserved("upgradeError",k)}}))};function s(){a||(a=!0,m(),n.close(),n=null)}const c=y=>{const k=new Error("probe error: "+y);k.transport=n.name,s(),this.emitReserved("upgradeError",k)};function u(){c("transport closed")}function h(){c("socket closed")}function f(y){n&&y.name!==n.name&&s()}const m=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",u),this.off("close",h),this.off("upgrading",f)};n.once("open",o),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 ZA=class extends YA{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(o=>HA[o]).filter(o=>!!o)),super(t,a)}};function XA(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=gf(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 s=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+s+":"+a.port+t,a.href=a.protocol+"://"+s+(n&&n.port===a.port?"":":"+a.port),a}const QA=typeof ArrayBuffer=="function",JA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Hb=Object.prototype.toString,eR=typeof Blob=="function"||typeof Blob<"u"&&Hb.call(Blob)==="[object BlobConstructor]",tR=typeof File=="function"||typeof File<"u"&&Hb.call(File)==="[object FileConstructor]";function _p(e){return QA&&(e instanceof ArrayBuffer||JA(e))||eR&&e instanceof Blob||tR&&e instanceof File}function Mc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,a=e.length;n<a;n++)if(Mc(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mc(e[n]))return!0;return!1}function nR(e){const t=[],n=e.data,a=e;return a.data=vf(n,t),a.attachments=t.length,{packet:a,buffers:t}}function vf(e,t){if(!e)return e;if(_p(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]=vf(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]=vf(e[a],t));return n}return e}function rR(e,t){return e.data=kf(e.data,t),delete e.attachments,e}function kf(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]=kf(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kf(e[n],t));return e}const aR=["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 iR{constructor(t){this.replacer=t}encode(t){return(t.type===tt.EVENT||t.type===tt.ACK)&&Mc(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=nR(t),a=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(a),o}}class bp 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 oR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(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 s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(s,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(c);if(!sR(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 s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););a.nsp=t.substring(s,n)}else a.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const s=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(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(bp.isPayloadValid(a.type,s))a.data=s;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 $v(n);case tt.DISCONNECT:return n===void 0;case tt.CONNECT_ERROR:return typeof n=="string"||$v(n);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&aR.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 oR{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=rR(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const sR=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function $v(e){return Object.prototype.toString.call(e)==="[object Object]"}const lR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bp,Encoder:iR,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function rr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const cR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wb 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,o,s;if(cR.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=(o=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._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 o=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const s=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"))},o),c=(...u)=>{this.io.clearTimeoutFn(s),n.apply(this,u)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((a,o)=>{const s=(c,u)=>c?o(c):a(u);s.withError=!0,n.push(s),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((o,...s)=>(this._queue[0],o!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...s)),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(...o){a||(a=!0,n.packet({type:tt.ACK,id:t,data:o}))}}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 _o(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}_o.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};_o.prototype.reset=function(){this.attempts=0};_o.prototype.setMin=function(e){this.ms=e};_o.prototype.setMax=function(e){this.max=e};_o.prototype.setJitter=function(e){this.jitter=e};class _f 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,Eu(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 _o({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||lR;this.encoder=new o.Encoder,this.decoder=new o.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 ZA(this.uri,this.opts);const n=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const o=rr(n,"open",function(){a.onopen(),t&&t()}),s=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},c=rr(n,"error",s);if(this._timeout!==!1){const u=this._timeout,h=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),n.close()},u);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),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){Tu(()=>{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 Wb(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(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):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 ps={};function Ic(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=XA(e,t.path||"/socket.io"),a=n.source,o=n.id,s=n.path,c=ps[o]&&s in ps[o].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return u?h=new _f(a,t):(ps[o]||(ps[o]=new _f(a,t)),h=ps[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Ic,{Manager:_f,Socket:Wb,io:Ic,connect:Ic});var We=class Kb extends Error{constructor(t,n,a,o){super(t),this.name="InsForgeError",this.statusCode=n,this.error=a,this.nextActions=o}static fromApiError(t){return new Kb(t.message,t.statusCode,t.error,t.nextActions)}},uR=["authorization","x-api-key","cookie","set-cookie"],dR=["password","token","accesstoken","refreshtoken","authorization","secret","apikey","api_key","email","ssn","creditcard","credit_card"];function hR(e){const t={};for(const[n,a]of Object.entries(e))uR.includes(n.toLowerCase())?t[n]="***REDACTED***":t[n]=a;return t}function xs(e){if(e==null)return e;if(typeof e=="string")try{const t=JSON.parse(e);return xs(t)}catch{return e}if(Array.isArray(e))return e.map(xs);if(typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))dR.includes(n.toLowerCase().replace(/[-_]/g,""))?t[n]="***REDACTED***":t[n]=xs(a);return t}return e}function Hv(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 Gb=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 o=[`→ ${e} ${t}`];n&&Object.keys(n).length>0&&o.push(` Headers: ${JSON.stringify(hR(n))}`);const s=Hv(xs(a));if(s){const c=s.length>1e3?s.slice(0,1e3)+"... [truncated]":s;o.push(` Body: ${c}`)}this.log(o.join(`
39
+ `))}logResponse(e,t,n,a,o){if(!this.enabled)return;const s=[`← ${e} ${t} ${n} (${a}ms)`],c=Hv(xs(o));if(c){const u=c.length>1e3?c.slice(0,1e3)+"... [truncated]":c;s.push(` Body: ${u}`)}n>=400?this.error(s.join(`
40
40
  `)):this.log(s.join(`
41
- `))}},wp="insforge_csrf_token";function qb(){if(typeof document>"u")return null;const e=document.cookie.split(";").find(t=>t.trim().startsWith(`${wp}=`));return e&&e.split("=")[1]||null}function Yb(e){if(typeof document>"u")return;const t=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=${encodeURIComponent(e)}; path=/; max-age=${t}; SameSite=Lax${n}`}function Zb(){if(typeof document>"u")return;const e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=; path=/; max-age=0; SameSite=Lax${e}`}var Xb=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()}},hR=new Set([500,502,503,504]),fR=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),pR=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 Xb,this.logger=n||new Gb(!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,o])=>{if(a==="select"){let s=o.replace(/\s+/g," ").trim();s=s.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(a,s)}else n.searchParams.append(a,o)}),n.toString()}isRetryableStatus(e){return hR.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:o={},body:s,signal:c,...u}=n,h=this.buildUrl(t,a),f=Date.now(),y=fR.has(e.toUpperCase())||n.idempotent===!0?this.retryCount:0,k={...this.defaultHeaders},w=this.userToken||this.anonKey;w&&(k.Authorization=`Bearer ${w}`);let x;s!==void 0&&(typeof FormData<"u"&&s instanceof FormData?x=s:(e!=="GET"&&(k["Content-Type"]="application/json;charset=UTF-8"),x=JSON.stringify(s))),o instanceof Headers?o.forEach((S,D)=>{k[D]=S}):Array.isArray(o)?o.forEach(([S,D])=>{k[S]=D}):Object.assign(k,o),this.logger.logRequest(e,h,k,x);let C;for(let S=0;S<=y;S++){if(S>0){const R=this.computeRetryDelay(S);if(this.logger.warn(`Retry ${S}/${y} for ${e} ${h} in ${R}ms`),c?.aborted)throw c.reason;await new Promise((O,G)=>{const W=()=>{clearTimeout(z),G(c.reason)},z=setTimeout(()=>{c&&c.removeEventListener("abort",W),O()},R);c&&c.addEventListener("abort",W,{once:!0})})}let D,L;if((this.timeout>0||c)&&(D=new AbortController,this.timeout>0&&(L=setTimeout(()=>D.abort(),this.timeout)),c))if(c.aborted)D.abort(c.reason);else{const R=()=>D.abort(c.reason);c.addEventListener("abort",R,{once:!0}),D.signal.addEventListener("abort",()=>{c.removeEventListener("abort",R)},{once:!0})}try{const R=await this.fetch(h,{method:e,headers:k,body:x,...u,...D?{signal:D.signal}:{}});if(this.isRetryableStatus(R.status)&&S<y){L!==void 0&&clearTimeout(L),await R.body?.cancel(),C=new We(`Server error: ${R.status} ${R.statusText}`,R.status,"SERVER_ERROR");continue}if(R.status===204){L!==void 0&&clearTimeout(L);return}let O;const G=R.headers.get("content-type");try{G?.includes("json")?O=await R.json():O=await R.text()}catch(W){throw L!==void 0&&clearTimeout(L),new We(`Failed to parse response body: ${W?.message||"Unknown error"}`,R.status,R.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(L!==void 0&&clearTimeout(L),!R.ok){if(this.logger.logResponse(e,h,R.status,Date.now()-f,O),O&&typeof O=="object"&&"error"in O){!O.statusCode&&!O.status&&(O.statusCode=R.status);const W=We.fromApiError(O);throw Object.keys(O).forEach(z=>{z!=="error"&&z!=="message"&&z!=="statusCode"&&(W[z]=O[z])}),W}throw new We(`Request failed: ${R.statusText}`,R.status,"REQUEST_FAILED")}return this.logger.logResponse(e,h,R.status,Date.now()-f,O),O}catch(R){if(L!==void 0&&clearTimeout(L),R?.name==="AbortError")throw D&&D.signal.aborted&&this.timeout>0&&!c?.aborted?new We(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):R;if(R instanceof We)throw R;if(S<y){C=R;continue}throw new We(`Network request failed: ${R?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw C||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 o=await this.handleTokenRefresh();return this.setAuthToken(o.accessToken),this.tokenManager.saveSession(o),o.csrfToken&&Yb(o.csrfToken),o.refreshToken&&this.setRefreshToken(o.refreshToken),await this.handleRequest(e,t,{...n})}catch(o){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,Zb(),o}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=qb(),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 Qb(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mR(){const e=new Uint8Array(32);return crypto.getRandomValues(e),Qb(e)}async function gR(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",n);return Qb(new Uint8Array(a))}function yR(e){typeof sessionStorage<"u"&&sessionStorage.setItem(bf,e)}function vR(){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 Wv(...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 kR=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&&Yb(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){Wv("error"),console.debug("OAuth callback error:",t);return}const n=e.get("insforge_code");if(n){Wv("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()||Zb(),{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,o=encodeURIComponent(t.toLowerCase()),s=mR(),c=await gR(s);yR(s);const u={code_challenge:c};n&&(u.redirect_uri=n);const f=Cu.options.includes(o)?`/api/auth/oauth/${o}`:`/api/auth/oauth/custom/${o}`,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:o,codeVerifier:s},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??vR();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},o=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",a,{credentials:"include"});return this.saveSessionFromResponse(o),{data:o,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:qb(),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 _R(e,t){return async(n,a)=>{const o=typeof n=="string"?n:n.toString(),s=new URL(o),c=s.pathname.slice(1),u=c.match(/^rpc\/(.+)$/),h=u?`/api/database/rpc/${u[1]}`:`/api/database/records/${c}`,f=`${e.baseUrl}${h}${s.search}`,m=t.getAccessToken(),y=e.getHeaders(),k=m||y.Authorization?.replace("Bearer ",""),w=new Headers(a?.headers);return k&&!w.has("Authorization")&&w.set("Authorization",`Bearer ${k}`),await fetch(f,{...a,headers:w})}}var bR=class{constructor(e,t){this.postgrest=new mA("http://dummy",{fetch:_R(e,t),headers:{}})}from(e){return this.postgrest.from(e)}rpc(e,t,n){return this.postgrest.rpc(e,t,n)}},wR=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(([o,s])=>{n.append(o,s)}),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 o=await fetch(n,{method:"GET",headers:a});if(!o.ok)try{const c=await o.json();throw We.fromApiError(c)}catch{throw new We(`Download failed: ${o.statusText}`,o.status,"STORAGE_ERROR")}return{data:await o.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")}}}},xR=class{constructor(e){this.http=e}from(e){return new wR(e,this.http)}},PR=class{constructor(e){this.http=e,this.chat=new SR(e),this.images=new ER(e),this.embeddings=new TR(e)}},SR=class{constructor(e){this.completions=new CR(e)}},CR=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 o=this.http.getHeaders();o["Content-Type"]="application/json";const s=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:o,body:JSON.stringify(t)});if(!s.ok){const c=await s.json();throw new Error(c.error||"Stream request failed")}return this.parseSSEStream(s,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 o="";try{for(;;){const{done:s,value:c}=await n.read();if(s)break;o+=a.decode(c,{stream:!0});const u=o.split(`
42
- `);o=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()}}},TR=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}}}},ER=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}}}}},AR=class Jb{constructor(t,n){this.http=t,this.functionsUrl=n||Jb.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:o,headers:s={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(a,`${this.functionsUrl}/${t}`,{body:o,headers:s}),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:o,headers:s}),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")}}}},Kv=1e4,RR=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(o){console.error(`Error in ${e} callback:`,o)}}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=Ic(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let a=!0,o=null;const s=()=>{o&&(clearTimeout(o),o=null)};o=setTimeout(()=>{a&&(a=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,t(new Error(`Connection timeout after ${Kv}ms`)))},Kv),this.socket.on("connect",()=>{s();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=>{s(),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)}},LR=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")}}}},DR=class{constructor(e={}){const t=new Gb(e.debug);this.tokenManager=new Xb,this.http=new pR(e,this.tokenManager,t),e.edgeFunctionToken&&(this.http.setAuthToken(e.edgeFunctionToken),this.tokenManager.setAccessToken(e.edgeFunctionToken)),this.auth=new kR(this.http,this.tokenManager,{isServerMode:e.isServerMode??!1}),this.database=new bR(this.http,this.tokenManager),this.storage=new xR(this.http),this.ai=new PR(this.http),this.functions=new AR(this.http,e.functionsUrl),this.realtime=new RR(this.http.baseUrl,this.tokenManager,e.anonKey),this.emails=new LR(this.http)}getHttpClient(){return this.http}};function MR(e){return new DR(e)}const xp={VITE_INSFORGE_ANON_KEY:"ik_9f35735991b684f7cf57fa00bb4d0487",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},e0="https://srctyff5.us-east.insforge.app",IR="ik_9f35735991b684f7cf57fa00bb4d0487";function Wr(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function t0(){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"?xp:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function Ks(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_ANON_KEY||e?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||IR).trim()}function wf(){return!!t0()}let Dh=null;function NR(){return wf()?(Dh||(Dh=MR({baseUrl:t0(),anonKey:Ks()||void 0,autoRefreshToken:!0})),Dh):null}const n0="tokentracker_cloud_sync_enabled",OR="tokentracker_cloud_device_session_v1",Pp="tokentracker_cloud_last_sync_ts";let Sp=null;function Cp(){try{localStorage.removeItem(OR)}catch{}}function jR(){if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"}function UR(){try{const e=localStorage.getItem(n0);return e===null||e===""?!1:e==="1"||e==="true"}catch{return!1}}function d4(e){try{localStorage.setItem(n0,e?"1":"0")}catch{}}function r0(){return Cp(),Sp}function BR(e){Sp=e,Cp()}function a0(){Sp=null;try{localStorage.removeItem(Pp)}catch{}Cp()}function FR(){try{const e=Number(localStorage.getItem(Pp));return Number.isFinite(e)?e:0}catch{return 0}}function i0(e){try{localStorage.setItem(Pp,String(e))}catch{}}function Aa(e){if(typeof e!="string")return null;const t=e.trim();return t.length>0?t:null}function VR(e){const t=Aa(e);if(!t)return null;const n=t.split(".");if(n.length<2)return null;const a=n[1];try{const o=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),s=typeof atob=="function"?atob(o):Buffer.from(o,"base64").toString("utf8"),u=JSON.parse(s)?.exp;return typeof u!="number"||!Number.isFinite(u)||u<=0?null:Math.floor(u*1e3)}catch{return null}}function o0(e){const t=Aa(e);if(!t)return!1;const n=t.split(".");if(n.length!==3)return!1;try{for(let a=0;a<2;a++){const o=n[a];if(!/^[A-Za-z0-9_-]+$/.test(o))return!1;const s=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),c=typeof atob=="function"?atob(s):Buffer.from(s,"base64").toString("utf8");a===1&&JSON.parse(c)}return!0}catch{return!1}}function zR(e,t=3e4){const n=VR(e);return n?n<=Date.now()+Math.max(0,Number(t)||0):!1}async function $R(e){if(!e)return null;if(typeof e=="string")return Aa(e);if(typeof e=="function")try{const t=await e();return Aa(t)}catch{return null}if(typeof e=="object"){if(typeof e.getAccessToken=="function"){try{const t=await e.getAccessToken(),n=Aa(t);if(n)return n}catch{}return Aa(e.accessToken)}return null}return Aa(e)}async function h4(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 o=0;o<n;o++){const s=await $R(e);if(s)return s;o<n-1&&await new Promise(c=>setTimeout(c,a*(o+1)))}return null}function f4(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:!!Aa(e)}function p4(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function m4(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 s0(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"),o=String(n%60).padStart(2,"0");return`UTC${t}${a}:${o}`}function g4({timeZone:e,offsetMinutes:t}={}){const n=s0(t);return e&&e!=="UTC"?`${e} (${n})`:n}function y4({timeZone:e,offsetMinutes:t}={}){return Number.isFinite(t)?s0(t):e||"UTC"}function v4({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 o=new Date(a.getTime()+t*6e4);return WR(o)}return KR(a)}function HR({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 o=new Date(a.getTime()+t*6e4);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()}}return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}}function k4({timeZone:e,offsetMinutes:t}={}){return e?`tz:${e}`:typeof t=="number"&&Number.isFinite(t)?`offset:${Math.trunc(t)}`:"utc"}function WR(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 KR(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 Pr(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"),o=String(t.getDate()).padStart(2,"0");return`${n}-${a}-${o}`}function GR(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const a=Number(n[0]),o=Number(n[1])-1,s=Number(n[2]);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(Date.UTC(a,o,s));return Number.isFinite(c.getTime())&&yt(c)===t?c:null}function qR(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 YR(e,{timeZone:t,offsetMinutes:n,now:a}={}){const o=a instanceof Date&&Number.isFinite(a.getTime())?a:new Date,s=HR({timeZone:t,offsetMinutes:n,date:o});if(!s){const h=Pr(new Date);return{from:h,to:h}}const c=qR(s),u=GR(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 YR("week")}function l0(){return typeof window>"u"?null:window.localStorage||null}function c0(){return typeof navigator>"u"?null:navigator.clipboard||null}function ZR(){return typeof window>"u"?null:window.ClipboardItem||null}function xs(e,{storage:t}={}){const n=t??l0();if(!n||typeof n.getItem!="function")return null;try{return n.getItem(e)}catch{return null}}function Ps(e,t,{storage:n}={}){const a=n??l0();if(!a||typeof a.setItem!="function")return!1;try{return a.setItem(e,t),!0}catch{return!1}}async function _4(e,{clipboard:t}={}){const n=t??c0();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(e),!0}catch{return!1}}async function b4(e,{clipboard:t}={}){const n=t??c0(),a=ZR();if(!e||!n||typeof n.write!="function"||!a)return!1;try{const o=e.type||"image/png",s=e.type&&e.type!==o?e.slice(0,e.size,o):e.type?e:e.slice(0,e.size,o),c=new a({[o]:s});return await n.write([c]),!0}catch{return!1}}const Ns="USD",Tp=["USD","EUR","GBP","CNY","JPY","HKD"],u0={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"}},Ep={USD:1,EUR:.92,GBP:.79,CNY:7.2,JPY:155,HKD:7.8},d0="tokentracker-currency",h0="tokentracker-exchange-rates",f0="tokentracker-exchange-rate-source",p0="tokentracker-exchange-rate-fetched-at";function ru(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ap(e){if(typeof e!="string")return Ns;const t=e.trim().toUpperCase();return Tp.includes(t)?t:Ns}function Nc(e){const t=typeof e=="string"?e.trim().toUpperCase():Ns;return u0[t]?.symbol??"$"}function w4(){return Tp.map(e=>({code:e,...u0[e]}))}function XR(){return Ap(xs(d0))}function QR(e){return Ps(d0,Ap(e))}function m0(e){return e==="fetched"?"fetched":"default"}function JR(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,o]of Object.entries(t)){const s=Number(o);Number.isFinite(s)&&s>0&&(n[a.toUpperCase()]=s)}return n}catch{return null}}function eL(){const e=JR(xs(h0)),t=xs(p0),n=t==null?NaN:Number(t),a=Number.isFinite(n)&&n>0?n:null,o=xs(f0),s=m0(o);return e&&Object.keys(e).length>0?{rates:{USD:1,...e},source:s,fetchedAt:a}:{rates:{...Ep},source:"default",fetchedAt:null}}function tL(e){const{rates:t,source:n,fetchedAt:a}=e;if(!t||typeof t!="object")return!1;const o=Ps(h0,JSON.stringify(t)),s=Ps(f0,m0(n)),c=a?Ps(p0,String(a)):!0;return o&&s&&c}function Mh(e,t){if(t===Ns)return 1;const n=e?.[t];if(ru(n))return n;const a=Ep[t];return ru(a)?a:1}function x4(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 P4(e,{thousandSuffix:t="K",millionSuffix:n="M",billionSuffix:a="B",decimals:o=1}={}){const s=Number(String(e));if(!Number.isFinite(s))return"-";const c=s<0?"-":"",u=Math.abs(s),h=Math.max(0,Math.min(6,Math.floor(o)));if(u<1e3)return`${c}${String(u)}`;const f=(w,x)=>{const C=w.toFixed(h),S=Number(C).toString();return`${c}${S}${x}`},m=(w,x,C)=>{const S=w.toFixed(h),D=Number(S);return C&&D>=1e3?f(D/1e3,C):`${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,k=Number(y.toFixed(h));return k>=1e3?f(k/1e3,n):f(k,t)}function g0(e){const t=Number(String(e));return Number.isFinite(t)?t:null}function S4(e,t={}){const{decimals:n=2,currency:a="USD",rate:o=1}=t;if(e==null||typeof e=="string"&&e.trim()==="")return"-";let s;if(typeof e=="number")s=e;else if(typeof e=="bigint")s=Number(e);else{const S=String(e).trim(),D=Number(S);if(!Number.isFinite(D))return S;s=D}if(!Number.isFinite(s))return String(e);const c=Nc(a);a!=="USD"&&typeof o=="number"&&Number.isFinite(o)&&o>0&&(s=s*o);const h=s.toFixed(6).match(/^(-?\d+)(?:\.(\d+))?$/);if(!h)return`${c}${String(s)}`;const f=h[1],m=h[2]||"";let y=f;try{y=new Intl.NumberFormat().format(BigInt(f))}catch{y=f}const k=Math.max(0,Math.min(6,Math.floor(n))),w=k?m.slice(0,k).padEnd(k,"0"):"",x=f.startsWith("-")?"-":"",C=k?`${y.replace("-","")}.${w}`:y.replace("-","");return`${x}${c}${C}`}function au(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,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function ri(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function nL(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 Ih(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=e.length,a=(n-1)*t,o=Math.floor(a),s=a-o,c=e[o]??e[n-1],u=e[Math.min(n-1,o+1)]??e[n-1];return Math.round(c+(u-c)*s)}function rL(e){return e<=0?0:e>=4?4:e}function y0({weeks:e=52,now:t,weekStartsOn:n="sun"}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date,o=Pr(a),s=au(o)||new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())),c=n==="mon"?1:0,u=s.getUTCDay(),h=ri(s,-((u-c+7)%7)),f=ri(h,-7*(Math.max(1,e)-1));return{from:yt(f),to:o}}function aL({dailyRows:e,weeks:t=52,to:n,weekStartsOn:a="sun"}={}){const o=au(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:s}=y0({weeks:t,now:o,weekStartsOn:a}),c=au(s)||ri(o,-(t*7-1)),u=(()=>{const O=(c.getUTCDay()-(a==="mon"?1:0)+7)%7;return ri(c,-O)})(),h=new Map;for(const L of Array.isArray(e)?e:[]){const R=typeof L?.day=="string"?L.day:null;if(!R)continue;const O=g0(L?.billable_total_tokens??L?.total_tokens)??0;h.set(R,{value:Math.max(0,O),models:L?.models||null})}const f=nL(u,o)+1,m=Math.ceil(f/7),y=[];for(let L=0;L<f;L++){const R=ri(u,L),O=yt(R),G=h.get(O),W=G?G.value:0;W>0&&y.push(W)}y.sort((L,R)=>L-R);const k=Ih(y,.5),w=Ih(y,.75),x=Ih(y,.9);function C(L){return!L||L<=0?0:L<=k?1:L<=w?2:L<=x?3:4}const S=[];for(let L=0;L<m;L++){const R=[];for(let O=0;O<7;O++){const G=L*7+O,W=ri(u,G);if(W.getTime()>o.getTime()){R.push(null);continue}const z=yt(W),P=h.get(z),Y=P?P.value:0,X=P?P.models:null;R.push({day:z,value:Y,level:rL(C(Y)),models:X})}S.push(R)}const D=S.length>t?S.slice(S.length-t):S;return{from:s,to:yt(o),weeks:D,thresholds:{t1:k,t2:w,t3:x}}}function iL({dailyRows:e,to:t}={}){const n=au(t)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),a=new Map;for(const s of Array.isArray(e)?e:[]){const c=typeof s?.day=="string"?s.day:null;if(!c)continue;const u=g0(s?.billable_total_tokens??s?.total_tokens)??0;a.set(c,Math.max(0,u))}let o=0;for(let s=0;s<370;s++){const c=yt(ri(n,-s));if((a.get(c)??0)>0){o+=1;continue}break}return o}const Au={},v0="tokentracker",oL=["tokentracker/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],Gv=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function Sn(){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"&&Au){const e="".toLowerCase();if(e==="1"||e==="true")return!0}return!1}function sL(){if(typeof import.meta<"u"&&Au){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 lL(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,o,s]=t.split("-").map(Number);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(a,o-1,s,12,0,0);return Number.isFinite(c.getTime())?c:null}const n=new Date(t);return Number.isFinite(n.getTime())?n:null}function C4(){return Sn()?lL(sL()):null}function cL(){if(typeof import.meta<"u"&&Au){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 v0}function uL(){if(typeof import.meta<"u"&&Au){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 Gs(e){return(e==null?cL():String(e)).trim()||v0}function qs(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,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function Os(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function k0(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1))}function dL(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function po({from:e,to:t,seed:n}){const a=cn(Pr(new Date))||new Date,o=cn(e)||a,s=cn(t)||o,c=[],u=Gs(n),h=Math.floor((Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate())-Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()))/864e5)+1;for(let f=0;f<h;f+=1){const m=Os(o,f),y=yt(m),k=qs(`${u}:${y}`),w=k%1e3/1e3,x=.6+.4*Math.sin(f/6*Math.PI*.5),C=m.getUTCDay()===0||m.getUTCDay()===6?.65:1,S=18e3+Math.round(12e3*w),D=Math.max(0,Math.round(S*x*C)),L=Math.round(D*.46),R=Math.round(D*.34),O=Math.round(D*.14),G=Math.max(0,D-L-R-O),W={};if(D>0){const z=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],P=1+k%3;let Y=D;for(let X=0;X<P;X++){const ue=z[(k+X)%z.length];if(X===P-1)W[ue]=Y;else{const se=Math.round(Y*(.3+.4*((k+X*17)%10)/10));W[ue]=se,Y-=se}}}c.push({day:y,total_tokens:D,billable_total_tokens:D,input_tokens:L,output_tokens:R,cached_input_tokens:O,reasoning_output_tokens:G,conversation_count:1+k%5,models:W})}return c}function hL({day:e,seed:t}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=Gs(t),s=Array.from({length:48},(u,h)=>{const f=Math.floor(h/2),m=h%2===0?0:30,y=qs(`${o}:${a}:${f}:${m}`),k=y%1e3/1e3,w=(f+m/60)/24,x=.4+.6*Math.sin(w*Math.PI*2),C=900+Math.round(700*k),S=Math.max(0,Math.round(C*x)),D=Math.round(S*.46),L=Math.round(S*.34),R=Math.round(S*.14),O=Math.max(0,S-D-L-R),G={};if(S>0){const W=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],z=1+y%2;let P=S;for(let Y=0;Y<z;Y++){const X=W[(y+Y)%W.length];if(Y===z-1)G[X]=P;else{const ue=Math.round(P*(.3+.4*((y+Y*17)%10)/10));G[X]=ue,P-=ue}}}return{hour:`${a}T${String(f).padStart(2,"0")}:${String(m).padStart(2,"0")}:00`,total_tokens:S,billable_total_tokens:S,input_tokens:D,output_tokens:L,cached_input_tokens:R,reasoning_output_tokens:O,models:G}}),c=Math.max(0,Math.min(48,uL()));if(c>0){const u=Date.now(),h=s.map((y,k)=>{const w=Date.parse(y.hour);return Number.isFinite(w)&&w<=u?{index:k,ts:w}:null}).filter(Boolean),f=Math.max(0,h.length-c),m=h.slice(f);for(const y of m){const k=s[y.index];k&&(s[y.index]={...k,missing:!0})}}return s}function fL({months:e=24,to:t,seed:n}){const a=cn(t)||cn(Pr(new Date))||new Date,o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),s=Gs(n),c=[];for(let u=e-1;u>=0;u-=1){const h=k0(o,-u),f=dL(h),m=qs(`${s}:${f}`),y=m%1e3/1e3,k=.7+.3*Math.sin(c.length/6*Math.PI*.5),w=36e4+Math.round(2e5*y),x=Math.max(0,Math.round(w*k)),C=Math.round(x*.46),S=Math.round(x*.34),D=Math.round(x*.14),L=Math.max(0,x-C-S-D),R={};if(x>0){const O=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],G=1+m%3;let W=x;for(let z=0;z<G;z++){const P=O[(m+z)%O.length];if(z===G-1)R[P]=W;else{const Y=Math.round(W*(.3+.4*((m+z*17)%10)/10));R[P]=Y,W-=Y}}}c.push({month:f,total_tokens:x,billable_total_tokens:x,input_tokens:C,output_tokens:S,cached_input_tokens:D,reasoning_output_tokens:L,models:R})}return c}function Rp(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 pL(e,t=1.75){const n=Number(e||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*t/1e6).toFixed(6)}function qv(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 xf(e){return{...e,total_cost_usd:pL(e.total_tokens)}}function mL({from:e,to:t,seed:n}={}){const a=po({from:e,to:t,seed:n});return{from:e,to:t,data:a}}function gL({day:e,seed:t}={}){const n=cn(e)||new Date,a=yt(n),o=hL({day:a,seed:t});return{day:a,data:o}}function yL({months:e=24,to:t,seed:n}={}){const a=cn(t)||cn(Pr(new Date))||new Date,o=yt(a),s=fL({months:e,to:o,seed:n}),c=k0(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),-(e-1));return{from:yt(c),to:o,months:e,data:s}}function vL({from:e,to:t,seed:n,rolling:a=!0}={}){const o=po({from:e,to:t,seed:n}),s=Rp(o),c=xf(s),u=a?kL({to:t,seed:n}):null;return{from:e,to:t,days:o.length,totals:c,...u?{rolling:u}:{}}}function kL({to:e,seed:t}={}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=yt(Os(n,-6)),s=yt(Os(n,-29)),c=po({from:o,to:a,seed:t}),u=po({from:s,to:a,seed:t});return{last_7d:Yv({rows:c,from:o,to:a}),last_30d:Yv({rows:u,from:s,to:a})}}function Yv({rows:e,from:t,to:n}={}){const a=Rp(e||[]),o=(e||[]).filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,s=o>0?Math.floor(a.billable_total_tokens/o):0;return{from:t,to:n,totals:{billable_total_tokens:a.billable_total_tokens,conversation_count:a.conversation_count},active_days:o,avg_per_active_day:s}}function _L({seed:e,limit:t=3}={}){const n=Gs(e),a=oL.map((o,s)=>{const u=12e4+qs(`${n}:${o}`)%9e5,h=s%4*4200,f=Math.max(0,u+h),m=Math.max(0,Math.round(f*.96));return{project_key:o,project_ref:`https://github.com/${o}`,total_tokens:String(f),billable_total_tokens:String(m)}}).sort((o,s)=>Number(s.billable_total_tokens)-Number(o.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(Pr(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(),o=yt(Os(t,-a)),s=yt(Os(t,-a+6));return{from:o,to:s}}function _0({seed:e,period:t,metric:n,limit:a=20,offset:o=0}={}){const s=Gs(e),c=Math.max(1,Math.min(100,Math.floor(Number(a)||20))),u=Math.max(0,Math.min(1e4,Math.floor(Number(o)||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:k}=bL(m),w=250,x=w>0?Math.ceil(w/c):0,C=Math.floor(u/c)+1,S=Array.from({length:w},(z,P)=>{const Y=P+1,X=`00000000-0000-0000-0000-${String(Y).padStart(12,"0")}`,ue=Gv[Y%Gv.length],Ae=18e4+qs(`${s}:${ue}:${Y}`)%9e5,fe=Math.max(0,Ae+Y*1200),le=Math.floor(fe*.28),pe=Math.floor(fe*.18),Ne=Math.floor(fe*.1),K=Math.floor(fe*.1),Z=Math.floor(fe*.08),H=Math.floor(fe*.03),I=Math.floor(fe*.02),q=Math.floor(fe*.04),xe=Math.floor(fe*.03),Re=Math.max(0,fe-le-pe-Ne-K-Z-H-I-q-xe),Pe=Y%7!==0;return{id:Y,user_id:X,is_public:Pe,is_me:!1,display_name:Pe?ue:"Anonymous",avatar_url:null,gpt_tokens:le,claude_tokens:pe,gemini_tokens:Ne,cursor_tokens:K,opencode_tokens:Z,openclaw_tokens:Re,hermes_tokens:H,kiro_tokens:I,copilot_tokens:q,kimi_tokens:xe,other_tokens:0,total_tokens:fe}}),D=Math.max(0,Math.min(w-1,Math.floor(w*.8)));S[D]&&(S[D].is_me=!0);const L=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",R=S.slice().sort((z,P)=>Number(P[L])-Number(z[L])||z.id-P.id).map((z,P)=>({user_id:z.is_public?z.user_id:null,rank:P+1,is_me:!!z.is_me,display_name:z.display_name,avatar_url:z.avatar_url,gpt_tokens:String(z.gpt_tokens),claude_tokens:String(z.claude_tokens),gemini_tokens:String(z.gemini_tokens),cursor_tokens:String(z.cursor_tokens),opencode_tokens:String(z.opencode_tokens),openclaw_tokens:String(z.openclaw_tokens),hermes_tokens:String(z.hermes_tokens??0),kiro_tokens:String(z.kiro_tokens??0),copilot_tokens:String(z.copilot_tokens??0),kimi_tokens:String(z.kimi_tokens??0),other_tokens:String(z.other_tokens??0),total_tokens:String(z.total_tokens),is_public:!!z.is_public})),O=R.find(z=>z?.is_me)||null,G=O?{rank:O.rank,gpt_tokens:O.gpt_tokens,claude_tokens:O.claude_tokens,gemini_tokens:O.gemini_tokens,cursor_tokens:O.cursor_tokens,opencode_tokens:O.opencode_tokens,openclaw_tokens:O.openclaw_tokens,hermes_tokens:O.hermes_tokens,kiro_tokens:O.kiro_tokens,copilot_tokens:O.copilot_tokens,kimi_tokens:O.kimi_tokens,other_tokens:O.other_tokens,total_tokens:O.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"},W=R.slice(u,u+c);return{period:m,metric:h,from:y,to:k,generated_at:new Date().toISOString(),page:C,limit:c,offset:u,total_entries:w,total_pages:x,entries:W,me:G}}function wL({weeks:e=52,to:t,weekStartsOn:n="sun",seed:a}={}){const o=y0({weeks:e,now:cn(t)||cn(Pr(new Date))||new Date,weekStartsOn:n}),s=po({from:o.from,to:o.to,seed:a});return{...aL({dailyRows:s,weeks:e,to:o.to,weekStartsOn:n}),week_starts_on:n,active_days:s.filter(u=>Number(u.billable_total_tokens??u.total_tokens)>0).length,streak_days:iL({dailyRows:s,to:o.to})}}function xL({from:e,to:t,seed:n}={}){const a=po({from:e,to:t,seed:n}),o=Rp(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=qv(o,u.weight),f=u.models.map(m=>{const y=qv(h,m.weight);return{model:m.model,model_id:m.model_id||m.model,totals:xf(y)}});return{source:u.source,totals:xf(h),models:f}});return{from:e,to:t,days:a.length,sources:c,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:Pr(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function PL({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}],o=a.reduce((c,u)=>c+u.total,0),s=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/o*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:o},categories:s,session_count:312,message_count:12046}}let Oc=null;function SL(){Oc=null}async function CL(e=fetch){if(Oc)return Oc;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 Oc=a,a}async function Lp(e=fetch){return{"x-tokentracker-local-auth":await CL(e)}}const sr={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"},TL={"tokentracker-usage-summary":"tokentracker-account-summary","tokentracker-usage-daily":"tokentracker-account-daily","tokentracker-usage-hourly":"tokentracker-account-hourly","tokentracker-usage-monthly":"tokentracker-account-monthly","tokentracker-usage-heatmap":"tokentracker-account-heatmap","tokentracker-usage-model-breakdown":"tokentracker-account-model-breakdown"};function EL(){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")}async function Sr(e,t,n){const a=n?.accessToken,o=TL[e];if(!EL()&&a&&o){const f=Wr().replace(/\/$/,""),m=new URL(`${f}/functions/${o}`);if(t)for(const[x,C]of Object.entries(t))C!=null&&C!==""&&m.searchParams.set(x,String(C));const y={Accept:"application/json"},k=Ks();k&&(y.apikey=k),o0(a)&&(y.Authorization=`Bearer ${a}`);const w=await fetch(m.toString(),{headers:y,cache:"no-store"});if(!w.ok){const x=new Error(`Request failed with HTTP ${w.status}`);throw x.status=w.status,x}return w.json()}const s=new URL(`/functions/${e}`,window.location.origin);if(t)for(const[f,m]of Object.entries(t))m!=null&&m!==""&&s.searchParams.set(f,String(m));const{accessToken:c,...u}=n||{},h=await fetch(s.toString(),{headers:{Accept:"application/json"},cache:"no-store",...u});if(!h.ok){const f=new Error(`Request failed with HTTP ${h.status}`);throw f.status=h.status,f}return h.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 o=typeof t=="string"?t.trim():"";return o&&(n.model=o),n}async function T4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,rolling:c=!1,accessToken:u}={}){if(Sn())return vL({from:e,to:t,seed:u,rolling:c});const h=Oa({timeZone:o,tzOffsetMinutes:s}),f=mi({source:n,model:a}),m=c?{rolling:"1"}:{};return Sr(sr.usageSummary,{from:e,to:t,...f,...h,...m},{accessToken:u})}async function E4({from:e,to:t,source:n,limit:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return _L({seed:c,limit:a});const u=Oa({timeZone:o,tzOffsetMinutes:s}),f={...mi({source:n}),...u};return e&&(f.from=e),t&&(f.to=t),a!=null&&(f.limit=String(a)),Sr(sr.projectUsageSummary,f)}async function Ys(e,t={}){const n=Wr();if(!n)throw new Error("InsForge base URL not configured");const a=n.replace(/\/$/,""),o=new URL(`${a}/functions/${e}`);if(t.params)for(const[h,f]of Object.entries(t.params))f!=null&&f!==""&&o.searchParams.set(h,String(f));const s={Accept:"application/json","Content-Type":"application/json"},c=Ks();c&&(s.apikey=c),t.accessToken&&o0(t.accessToken)&&(s.Authorization=`Bearer ${t.accessToken}`);const u=await fetch(o.toString(),{method:t.method||"GET",headers:s,...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 A4({accessToken:e,userId:t,period:n,metric:a,limit:o,offset:s}={}){return Sn()?_0({seed:e||t,period:n,metric:a,limit:o,offset:s}):Ys("tokentracker-leaderboard",{params:{period:n,limit:o,offset:s,user_id:t}})}async function Zv({accessToken:e}={}){return Ys("tokentracker-public-visibility",{accessToken:e,method:"GET"})}async function R4({accessToken:e,enabled:t,anonymous:n,display_name:a,github_url:o,show_github_url:s}={}){const c={};return t!==void 0&&(c.enabled=!!t),n!==void 0&&(c.anonymous=!!n),a!==void 0&&(c.display_name=String(a)),o!==void 0&&(c.github_url=o===null?null:String(o)),s!==void 0&&(c.show_github_url=!!s),Ys("tokentracker-public-visibility",{accessToken:e,method:"POST",body:c})}async function L4({accessToken:e,period:t,source:n}={}){const a={};return t&&(a.period=t),typeof n=="string"&&n.trim()&&(a.source=n.trim()),Ys("tokentracker-leaderboard-refresh",{accessToken:e,method:"POST",body:a})}async function D4({accessToken:e,userId:t,period:n}={}){if(Sn()){const a=_0({seed:e,period:n,metric:"all",limit:250,offset:0}),o=Array.isArray(a?.entries)?a.entries:[],s=o.find(m=>m?.user_id===t)||o[0]||null,c=Number(s?.total_tokens)||0,u=new Date,h=Array.from({length:365}).map((m,y)=>{const k=new Date(u);return k.setUTCDate(k.getUTCDate()-(364-y)),{date:k.toISOString().slice(0,10),total_tokens:y%7===0?Math.floor(c/365):0}}),f=h.slice(-7);return{user:{user_id:t,display_name:s?.display_name||"Mock User",avatar_url:s?.avatar_url||null,github_url:s?.github_url||null,is_anonymous:!1,rank:s?.rank??null},period:{kind:n||"week",from:a?.from??null,to:a?.to??null,generated_at:a?.generated_at??new Date().toISOString()},totals:{total_tokens:c,estimated_cost_usd:Number(s?.estimated_cost_usd)||0,active_days:53,avg_per_day_usd:0},streak:{current_days:3,longest_days:12},best_day:c?{date:u.toISOString().slice(0,10),total_tokens:Math.floor(c/30),estimated_cost_usd:0}:null,models:{count:5,favorite:{model_name:"claude-opus-4-7",total_tokens:Math.floor(c/2)}},by_provider:[],heatmap:h,daily_trend:f}}return Ys("tokentracker-leaderboard-profile",{accessToken:e,params:{user_id:t,period:n}})}async function M4(e={}){if(Sn()){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 Sr(sr.userStatus)}async function I4({signal:e}={}){const t=await Lp(),n=await fetch(`/functions/${sr.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 o=a?.error||a?.message||`Local sync request failed with HTTP ${n.status}`,s=new Error(o);throw s.status=n.status,s}return a}async function N4({from:e,to:t,source:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(Sn())return xL({from:e,to:t,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:n});return Sr(sr.usageModelBreakdown,{from:e,to:t,...u,...c},{accessToken:s})}async function O4({from:e,to:t,source:n="claude",timeZone:a,tzOffsetMinutes:o}={}){if(Sn())return PL({from:e,to:t,source:n});const s=Oa({timeZone:a,tzOffsetMinutes:o});return Sr(sr.usageCategoryBreakdown,{from:e,to:t,source:n,...s})}async function j4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return mL({from:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageDaily,{from:e,to:t,...h,...u},{accessToken:c})}async function U4({day:e,source:t,model:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(Sn())return gL({day:e,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:t,model:n}),h=e?{day:e,...u,...c}:{...u,...c};return Sr(sr.usageHourly,h,{accessToken:s})}async function B4({months:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return yL({months:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageMonthly,{...e?{months:String(e)}:{},...t?{to:t}:{},...h,...u},{accessToken:c})}async function F4(e={}){const t=e?.refresh?{refresh:"1"}:void 0;return Sr(sr.usageLimits,t)}async function V4({weeks:e,to:t,weekStartsOn:n,source:a,model:o,timeZone:s,tzOffsetMinutes:c,accessToken:u}={}){if(Sn())return wL({weeks:e,to:t,weekStartsOn:n,seed:u});const h=Oa({timeZone:s,tzOffsetMinutes:c}),f=mi({source:a,model:o});return Sr(sr.usageHeatmap,{weeks:String(e),to:t,week_starts_on:n,...f,...h},{accessToken:u})}const b0=b.createContext(null);function AL(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 Xv(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 Nh(e,t={}){if(!e)return null;const n=Math.max(0,Math.floor(Number(t.skewMs)||6e4)),a=e.tokenManager,o=()=>a?.getAccessToken?.()??a?.getSession?.()?.accessToken??null;let s=o();if(!s||zR(s,n)){const{data:c}=await e.auth.refreshSession();if(s=o()??Xv(c)??null,!s&&typeof e.auth.getCurrentUser=="function")try{await e.auth.getCurrentUser(),s=o()??Xv(c)??null}catch{}}return s||null}function RL({children:e}){const[t,n]=b.useState(null),[a,o]=b.useState(null),[s,c]=b.useState(!0);b.useEffect(()=>{if(!wf()){n(null),o(null),c(!1);return}n(NR())},[]),b.useEffect(()=>{if(!t)return;let W=!0;return c(!0),(async()=>{try{let{data:z,error:P}=await t.auth.getCurrentUser();if(!W)return;if(!P&&!z?.user){if(await new Promise(X=>setTimeout(X,150)),!W)return;const Y=await t.auth.getCurrentUser();z=Y.data,P=Y.error}if(P){o(null);return}o(z?.user??null)}catch{W&&o(null)}finally{W&&c(!1)}})(),()=>{W=!1}},[t]);const u=b.useCallback(async()=>{if(t)try{let{data:W,error:z}=await t.auth.getCurrentUser();if(!z&&!W?.user){await new Promise(Y=>setTimeout(Y,150));const P=await t.auth.getCurrentUser();W=P.data,z=P.error}if(z){o(null);return}o(W?.user??null)}catch{o(null)}},[t]),h=b.useCallback(async(W,z)=>{if(!t)return{error:new Error("InsForge client not configured")};const P=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth;if(P){const ue=typeof z=="string"&&z.trim()?z.trim():`${window.location.origin}/auth/callback`,se=await t.auth.signInWithOAuth({provider:W,redirectTo:ue,skipBrowserRedirect:!0});if(se.data?.url){try{const Ae=await Lp();await fetch("/api/auth-bridge/verifier",{method:"PUT",headers:{"Content-Type":"application/json",...Ae},body:JSON.stringify({native:!0})})}catch{}P.postMessage(se.data.url)}return se}const Y=typeof z=="string"&&z.trim()?z.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return await t.auth.signInWithOAuth({provider:W,redirectTo:Y})},[t]),f=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signInWithPassword(W);return z?.user&&o(z.user),{data:z,error:P}},[t]),m=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signUp(W);return z?.user&&z?.accessToken&&o(z.user),{data:z,error:P}},[t]),y=b.useCallback(async()=>t?t.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[t]),k=b.useCallback(async()=>{t&&(await t.auth.signOut(),a0(),SL(),o(null))},[t]),w=b.useCallback(async()=>Nh(t),[t]),[x,C]=b.useState(null),[S,D]=b.useState(!1),L=b.useMemo(()=>AL(a),[a]);b.useEffect(()=>{if(!a||!t){C(null),D(!1);return}let W=!0;return(async()=>{try{const z=await Nh(t);if(!W||!z){W&&D(!0);return}const P=await Zv({accessToken:z});W&&P?.display_name&&C(P.display_name)}catch{}W&&D(!0)})(),()=>{W=!1}},[a,t]);const R=S?x||L:"",O=b.useCallback(async()=>{if(t)try{const W=await Nh(t);if(!W)return;const z=await Zv({accessToken:W});z?.display_name&&C(z.display_name)}catch{}},[t]),G=b.useMemo(()=>!wf()||!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:s,displayName:R,refreshUser:u,refreshDisplayName:O,signInWithOAuth:h,signInWithPassword:f,signUp:m,getPublicAuthConfig:y,signOut:k,getAccessToken:w},[t,a,s,R,u,O,h,f,m,y,k,w]);return N.jsx(b0.Provider,{value:G,children:e})}function Zs(){return b.useContext(b0)}const LL=`key,module,page,component,slot,text,notes,status
41
+ `))}},wp="insforge_csrf_token";function qb(){if(typeof document>"u")return null;const e=document.cookie.split(";").find(t=>t.trim().startsWith(`${wp}=`));return e&&e.split("=")[1]||null}function Yb(e){if(typeof document>"u")return;const t=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=${encodeURIComponent(e)}; path=/; max-age=${t}; SameSite=Lax${n}`}function Zb(){if(typeof document>"u")return;const e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=; path=/; max-age=0; SameSite=Lax${e}`}var Xb=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()}},fR=new Set([500,502,503,504]),pR=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),mR=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 Xb,this.logger=n||new Gb(!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,o])=>{if(a==="select"){let s=o.replace(/\s+/g," ").trim();s=s.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(a,s)}else n.searchParams.append(a,o)}),n.toString()}isRetryableStatus(e){return fR.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:o={},body:s,signal:c,...u}=n,h=this.buildUrl(t,a),f=Date.now(),y=pR.has(e.toUpperCase())||n.idempotent===!0?this.retryCount:0,k={...this.defaultHeaders},w=this.userToken||this.anonKey;w&&(k.Authorization=`Bearer ${w}`);let x;s!==void 0&&(typeof FormData<"u"&&s instanceof FormData?x=s:(e!=="GET"&&(k["Content-Type"]="application/json;charset=UTF-8"),x=JSON.stringify(s))),o instanceof Headers?o.forEach((S,D)=>{k[D]=S}):Array.isArray(o)?o.forEach(([S,D])=>{k[S]=D}):Object.assign(k,o),this.logger.logRequest(e,h,k,x);let C;for(let S=0;S<=y;S++){if(S>0){const R=this.computeRetryDelay(S);if(this.logger.warn(`Retry ${S}/${y} for ${e} ${h} in ${R}ms`),c?.aborted)throw c.reason;await new Promise((O,G)=>{const W=()=>{clearTimeout(z),G(c.reason)},z=setTimeout(()=>{c&&c.removeEventListener("abort",W),O()},R);c&&c.addEventListener("abort",W,{once:!0})})}let D,L;if((this.timeout>0||c)&&(D=new AbortController,this.timeout>0&&(L=setTimeout(()=>D.abort(),this.timeout)),c))if(c.aborted)D.abort(c.reason);else{const R=()=>D.abort(c.reason);c.addEventListener("abort",R,{once:!0}),D.signal.addEventListener("abort",()=>{c.removeEventListener("abort",R)},{once:!0})}try{const R=await this.fetch(h,{method:e,headers:k,body:x,...u,...D?{signal:D.signal}:{}});if(this.isRetryableStatus(R.status)&&S<y){L!==void 0&&clearTimeout(L),await R.body?.cancel(),C=new We(`Server error: ${R.status} ${R.statusText}`,R.status,"SERVER_ERROR");continue}if(R.status===204){L!==void 0&&clearTimeout(L);return}let O;const G=R.headers.get("content-type");try{G?.includes("json")?O=await R.json():O=await R.text()}catch(W){throw L!==void 0&&clearTimeout(L),new We(`Failed to parse response body: ${W?.message||"Unknown error"}`,R.status,R.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(L!==void 0&&clearTimeout(L),!R.ok){if(this.logger.logResponse(e,h,R.status,Date.now()-f,O),O&&typeof O=="object"&&"error"in O){!O.statusCode&&!O.status&&(O.statusCode=R.status);const W=We.fromApiError(O);throw Object.keys(O).forEach(z=>{z!=="error"&&z!=="message"&&z!=="statusCode"&&(W[z]=O[z])}),W}throw new We(`Request failed: ${R.statusText}`,R.status,"REQUEST_FAILED")}return this.logger.logResponse(e,h,R.status,Date.now()-f,O),O}catch(R){if(L!==void 0&&clearTimeout(L),R?.name==="AbortError")throw D&&D.signal.aborted&&this.timeout>0&&!c?.aborted?new We(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):R;if(R instanceof We)throw R;if(S<y){C=R;continue}throw new We(`Network request failed: ${R?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw C||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 o=await this.handleTokenRefresh();return this.setAuthToken(o.accessToken),this.tokenManager.saveSession(o),o.csrfToken&&Yb(o.csrfToken),o.refreshToken&&this.setRefreshToken(o.refreshToken),await this.handleRequest(e,t,{...n})}catch(o){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,Zb(),o}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=qb(),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 Qb(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function gR(){const e=new Uint8Array(32);return crypto.getRandomValues(e),Qb(e)}async function yR(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",n);return Qb(new Uint8Array(a))}function vR(e){typeof sessionStorage<"u"&&sessionStorage.setItem(bf,e)}function kR(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(bf);return e&&sessionStorage.removeItem(bf),e}function xn(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 Wv(...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 _R=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&&Yb(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){Wv("error"),console.debug("OAuth callback error:",t);return}const n=e.get("insforge_code");if(n){Wv("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 xn(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 xn(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()||Zb(),{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,o=encodeURIComponent(t.toLowerCase()),s=gR(),c=await yR(s);vR(s);const u={code_challenge:c};n&&(u.redirect_uri=n);const f=Cu.options.includes(o)?`/api/auth/oauth/${o}`:`/api/auth/oauth/custom/${o}`,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:o,codeVerifier:s},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??kR();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},o=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",a,{credentials:"include"});return this.saveSessionFromResponse(o),{data:o,error:null}}catch(n){return xn(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 xn(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:qb(),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 xn(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 xn(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 xn(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 xn(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 xn(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 xn(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 xn(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 xn(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 xn(e,"An unexpected error occurred while fetching auth configuration")}}};function bR(e,t){return async(n,a)=>{const o=typeof n=="string"?n:n.toString(),s=new URL(o),c=s.pathname.slice(1),u=c.match(/^rpc\/(.+)$/),h=u?`/api/database/rpc/${u[1]}`:`/api/database/records/${c}`,f=`${e.baseUrl}${h}${s.search}`,m=t.getAccessToken(),y=e.getHeaders(),k=m||y.Authorization?.replace("Bearer ",""),w=new Headers(a?.headers);return k&&!w.has("Authorization")&&w.set("Authorization",`Bearer ${k}`),await fetch(f,{...a,headers:w})}}var wR=class{constructor(e,t){this.postgrest=new gA("http://dummy",{fetch:bR(e,t),headers:{}})}from(e){return this.postgrest.from(e)}rpc(e,t,n){return this.postgrest.rpc(e,t,n)}},xR=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(([o,s])=>{n.append(o,s)}),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 o=await fetch(n,{method:"GET",headers:a});if(!o.ok)try{const c=await o.json();throw We.fromApiError(c)}catch{throw new We(`Download failed: ${o.statusText}`,o.status,"STORAGE_ERROR")}return{data:await o.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")}}}},PR=class{constructor(e){this.http=e}from(e){return new xR(e,this.http)}},SR=class{constructor(e){this.http=e,this.chat=new CR(e),this.images=new AR(e),this.embeddings=new ER(e)}},CR=class{constructor(e){this.completions=new TR(e)}},TR=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 o=this.http.getHeaders();o["Content-Type"]="application/json";const s=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:o,body:JSON.stringify(t)});if(!s.ok){const c=await s.json();throw new Error(c.error||"Stream request failed")}return this.parseSSEStream(s,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 o="";try{for(;;){const{done:s,value:c}=await n.read();if(s)break;o+=a.decode(c,{stream:!0});const u=o.split(`
42
+ `);o=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()}}},ER=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}}}},AR=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}}}}},RR=class Jb{constructor(t,n){this.http=t,this.functionsUrl=n||Jb.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:o,headers:s={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(a,`${this.functionsUrl}/${t}`,{body:o,headers:s}),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:o,headers:s}),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")}}}},Kv=1e4,LR=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(o){console.error(`Error in ${e} callback:`,o)}}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=Ic(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let a=!0,o=null;const s=()=>{o&&(clearTimeout(o),o=null)};o=setTimeout(()=>{a&&(a=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,t(new Error(`Connection timeout after ${Kv}ms`)))},Kv),this.socket.on("connect",()=>{s();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=>{s(),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)}},DR=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")}}}},MR=class{constructor(e={}){const t=new Gb(e.debug);this.tokenManager=new Xb,this.http=new mR(e,this.tokenManager,t),e.edgeFunctionToken&&(this.http.setAuthToken(e.edgeFunctionToken),this.tokenManager.setAccessToken(e.edgeFunctionToken)),this.auth=new _R(this.http,this.tokenManager,{isServerMode:e.isServerMode??!1}),this.database=new wR(this.http,this.tokenManager),this.storage=new PR(this.http),this.ai=new SR(this.http),this.functions=new RR(this.http,e.functionsUrl),this.realtime=new LR(this.http.baseUrl,this.tokenManager,e.anonKey),this.emails=new DR(this.http)}getHttpClient(){return this.http}};function IR(e){return new MR(e)}const xp={VITE_INSFORGE_ANON_KEY:"ik_9f35735991b684f7cf57fa00bb4d0487",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},e0="https://srctyff5.us-east.insforge.app",NR="ik_9f35735991b684f7cf57fa00bb4d0487";function Wr(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function t0(){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"?xp:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function Gs(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_ANON_KEY||e?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||NR).trim()}function wf(){return!!t0()}let Dh=null;function OR(){return wf()?(Dh||(Dh=IR({baseUrl:t0(),anonKey:Gs()||void 0,autoRefreshToken:!0})),Dh):null}const n0="tokentracker_cloud_sync_enabled",jR="tokentracker_cloud_device_session_v1",Pp="tokentracker_cloud_last_sync_ts";let Sp=null;function Cp(){try{localStorage.removeItem(jR)}catch{}}function UR(){if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"}function BR(){try{const e=localStorage.getItem(n0);return e===null||e===""?!1:e==="1"||e==="true"}catch{return!1}}function h4(e){try{localStorage.setItem(n0,e?"1":"0")}catch{}}function r0(){return Cp(),Sp}function FR(e){Sp=e,Cp()}function a0(){Sp=null;try{localStorage.removeItem(Pp)}catch{}Cp()}function VR(){try{const e=Number(localStorage.getItem(Pp));return Number.isFinite(e)?e:0}catch{return 0}}function i0(e){try{localStorage.setItem(Pp,String(e))}catch{}}function Aa(e){if(typeof e!="string")return null;const t=e.trim();return t.length>0?t:null}function zR(e){const t=Aa(e);if(!t)return null;const n=t.split(".");if(n.length<2)return null;const a=n[1];try{const o=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),s=typeof atob=="function"?atob(o):Buffer.from(o,"base64").toString("utf8"),u=JSON.parse(s)?.exp;return typeof u!="number"||!Number.isFinite(u)||u<=0?null:Math.floor(u*1e3)}catch{return null}}function o0(e){const t=Aa(e);if(!t)return!1;const n=t.split(".");if(n.length!==3)return!1;try{for(let a=0;a<2;a++){const o=n[a];if(!/^[A-Za-z0-9_-]+$/.test(o))return!1;const s=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),c=typeof atob=="function"?atob(s):Buffer.from(s,"base64").toString("utf8");a===1&&JSON.parse(c)}return!0}catch{return!1}}function $R(e,t=3e4){const n=zR(e);return n?n<=Date.now()+Math.max(0,Number(t)||0):!1}async function HR(e){if(!e)return null;if(typeof e=="string")return Aa(e);if(typeof e=="function")try{const t=await e();return Aa(t)}catch{return null}if(typeof e=="object"){if(typeof e.getAccessToken=="function"){try{const t=await e.getAccessToken(),n=Aa(t);if(n)return n}catch{}return Aa(e.accessToken)}return null}return Aa(e)}async function f4(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 o=0;o<n;o++){const s=await HR(e);if(s)return s;o<n-1&&await new Promise(c=>setTimeout(c,a*(o+1)))}return null}function p4(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:!!Aa(e)}function m4(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function g4(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 s0(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"),o=String(n%60).padStart(2,"0");return`UTC${t}${a}:${o}`}function y4({timeZone:e,offsetMinutes:t}={}){const n=s0(t);return e&&e!=="UTC"?`${e} (${n})`:n}function v4({timeZone:e,offsetMinutes:t}={}){return Number.isFinite(t)?s0(t):e||"UTC"}function k4({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 o=new Date(a.getTime()+t*6e4);return KR(o)}return GR(a)}function WR({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 o=new Date(a.getTime()+t*6e4);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()}}return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}}function _4({timeZone:e,offsetMinutes:t}={}){return e?`tz:${e}`:typeof t=="number"&&Number.isFinite(t)?`offset:${Math.trunc(t)}`:"utc"}function KR(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 GR(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 Pr(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"),o=String(t.getDate()).padStart(2,"0");return`${n}-${a}-${o}`}function qR(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const a=Number(n[0]),o=Number(n[1])-1,s=Number(n[2]);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(Date.UTC(a,o,s));return Number.isFinite(c.getTime())&&yt(c)===t?c:null}function YR(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 ZR(e,{timeZone:t,offsetMinutes:n,now:a}={}){const o=a instanceof Date&&Number.isFinite(a.getTime())?a:new Date,s=WR({timeZone:t,offsetMinutes:n,date:o});if(!s){const h=Pr(new Date);return{from:h,to:h}}const c=YR(s),u=qR(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 ZR("week")}function l0(){return typeof window>"u"?null:window.localStorage||null}function c0(){return typeof navigator>"u"?null:navigator.clipboard||null}function XR(){return typeof window>"u"?null:window.ClipboardItem||null}function Ps(e,{storage:t}={}){const n=t??l0();if(!n||typeof n.getItem!="function")return null;try{return n.getItem(e)}catch{return null}}function Ss(e,t,{storage:n}={}){const a=n??l0();if(!a||typeof a.setItem!="function")return!1;try{return a.setItem(e,t),!0}catch{return!1}}async function b4(e,{clipboard:t}={}){const n=t??c0();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(e),!0}catch{return!1}}async function w4(e,{clipboard:t}={}){const n=t??c0(),a=XR();if(!e||!n||typeof n.write!="function"||!a)return!1;try{const o=e.type||"image/png",s=e.type&&e.type!==o?e.slice(0,e.size,o):e.type?e:e.slice(0,e.size,o),c=new a({[o]:s});return await n.write([c]),!0}catch{return!1}}const Os="USD",Tp=["USD","EUR","GBP","CNY","JPY","HKD"],u0={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"}},Ep={USD:1,EUR:.92,GBP:.79,CNY:7.2,JPY:155,HKD:7.8},d0="tokentracker-currency",h0="tokentracker-exchange-rates",f0="tokentracker-exchange-rate-source",p0="tokentracker-exchange-rate-fetched-at";function ru(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ap(e){if(typeof e!="string")return Os;const t=e.trim().toUpperCase();return Tp.includes(t)?t:Os}function Nc(e){const t=typeof e=="string"?e.trim().toUpperCase():Os;return u0[t]?.symbol??"$"}function x4(){return Tp.map(e=>({code:e,...u0[e]}))}function QR(){return Ap(Ps(d0))}function JR(e){return Ss(d0,Ap(e))}function m0(e){return e==="fetched"?"fetched":"default"}function eL(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,o]of Object.entries(t)){const s=Number(o);Number.isFinite(s)&&s>0&&(n[a.toUpperCase()]=s)}return n}catch{return null}}function tL(){const e=eL(Ps(h0)),t=Ps(p0),n=t==null?NaN:Number(t),a=Number.isFinite(n)&&n>0?n:null,o=Ps(f0),s=m0(o);return e&&Object.keys(e).length>0?{rates:{USD:1,...e},source:s,fetchedAt:a}:{rates:{...Ep},source:"default",fetchedAt:null}}function nL(e){const{rates:t,source:n,fetchedAt:a}=e;if(!t||typeof t!="object")return!1;const o=Ss(h0,JSON.stringify(t)),s=Ss(f0,m0(n)),c=a?Ss(p0,String(a)):!0;return o&&s&&c}function Mh(e,t){if(t===Os)return 1;const n=e?.[t];if(ru(n))return n;const a=Ep[t];return ru(a)?a:1}function P4(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 S4(e,{thousandSuffix:t="K",millionSuffix:n="M",billionSuffix:a="B",decimals:o=1}={}){const s=Number(String(e));if(!Number.isFinite(s))return"-";const c=s<0?"-":"",u=Math.abs(s),h=Math.max(0,Math.min(6,Math.floor(o)));if(u<1e3)return`${c}${String(u)}`;const f=(w,x)=>{const C=w.toFixed(h),S=Number(C).toString();return`${c}${S}${x}`},m=(w,x,C)=>{const S=w.toFixed(h),D=Number(S);return C&&D>=1e3?f(D/1e3,C):`${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,k=Number(y.toFixed(h));return k>=1e3?f(k/1e3,n):f(k,t)}function g0(e){const t=Number(String(e));return Number.isFinite(t)?t:null}function C4(e,t={}){const{decimals:n=2,currency:a="USD",rate:o=1}=t;if(e==null||typeof e=="string"&&e.trim()==="")return"-";let s;if(typeof e=="number")s=e;else if(typeof e=="bigint")s=Number(e);else{const S=String(e).trim(),D=Number(S);if(!Number.isFinite(D))return S;s=D}if(!Number.isFinite(s))return String(e);const c=Nc(a);a!=="USD"&&typeof o=="number"&&Number.isFinite(o)&&o>0&&(s=s*o);const h=s.toFixed(6).match(/^(-?\d+)(?:\.(\d+))?$/);if(!h)return`${c}${String(s)}`;const f=h[1],m=h[2]||"";let y=f;try{y=new Intl.NumberFormat().format(BigInt(f))}catch{y=f}const k=Math.max(0,Math.min(6,Math.floor(n))),w=k?m.slice(0,k).padEnd(k,"0"):"",x=f.startsWith("-")?"-":"",C=k?`${y.replace("-","")}.${w}`:y.replace("-","");return`${x}${c}${C}`}function au(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,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function ri(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function rL(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 Ih(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=e.length,a=(n-1)*t,o=Math.floor(a),s=a-o,c=e[o]??e[n-1],u=e[Math.min(n-1,o+1)]??e[n-1];return Math.round(c+(u-c)*s)}function aL(e){return e<=0?0:e>=4?4:e}function y0({weeks:e=52,now:t,weekStartsOn:n="sun"}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date,o=Pr(a),s=au(o)||new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())),c=n==="mon"?1:0,u=s.getUTCDay(),h=ri(s,-((u-c+7)%7)),f=ri(h,-7*(Math.max(1,e)-1));return{from:yt(f),to:o}}function iL({dailyRows:e,weeks:t=52,to:n,weekStartsOn:a="sun"}={}){const o=au(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:s}=y0({weeks:t,now:o,weekStartsOn:a}),c=au(s)||ri(o,-(t*7-1)),u=(()=>{const O=(c.getUTCDay()-(a==="mon"?1:0)+7)%7;return ri(c,-O)})(),h=new Map;for(const L of Array.isArray(e)?e:[]){const R=typeof L?.day=="string"?L.day:null;if(!R)continue;const O=g0(L?.billable_total_tokens??L?.total_tokens)??0;h.set(R,{value:Math.max(0,O),models:L?.models||null})}const f=rL(u,o)+1,m=Math.ceil(f/7),y=[];for(let L=0;L<f;L++){const R=ri(u,L),O=yt(R),G=h.get(O),W=G?G.value:0;W>0&&y.push(W)}y.sort((L,R)=>L-R);const k=Ih(y,.5),w=Ih(y,.75),x=Ih(y,.9);function C(L){return!L||L<=0?0:L<=k?1:L<=w?2:L<=x?3:4}const S=[];for(let L=0;L<m;L++){const R=[];for(let O=0;O<7;O++){const G=L*7+O,W=ri(u,G);if(W.getTime()>o.getTime()){R.push(null);continue}const z=yt(W),P=h.get(z),Y=P?P.value:0,X=P?P.models:null;R.push({day:z,value:Y,level:aL(C(Y)),models:X})}S.push(R)}const D=S.length>t?S.slice(S.length-t):S;return{from:s,to:yt(o),weeks:D,thresholds:{t1:k,t2:w,t3:x}}}function oL({dailyRows:e,to:t}={}){const n=au(t)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),a=new Map;for(const s of Array.isArray(e)?e:[]){const c=typeof s?.day=="string"?s.day:null;if(!c)continue;const u=g0(s?.billable_total_tokens??s?.total_tokens)??0;a.set(c,Math.max(0,u))}let o=0;for(let s=0;s<370;s++){const c=yt(ri(n,-s));if((a.get(c)??0)>0){o+=1;continue}break}return o}const Au={},v0="tokentracker",sL=["tokentracker/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],Gv=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function dn(){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"&&Au){const e="".toLowerCase();if(e==="1"||e==="true")return!0}return!1}function lL(){if(typeof import.meta<"u"&&Au){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 cL(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,o,s]=t.split("-").map(Number);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(a,o-1,s,12,0,0);return Number.isFinite(c.getTime())?c:null}const n=new Date(t);return Number.isFinite(n.getTime())?n:null}function T4(){return dn()?cL(lL()):null}function uL(){if(typeof import.meta<"u"&&Au){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 v0}function dL(){if(typeof import.meta<"u"&&Au){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 qs(e){return(e==null?uL():String(e)).trim()||v0}function Ys(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,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function js(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function k0(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1))}function hL(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function mo({from:e,to:t,seed:n}){const a=cn(Pr(new Date))||new Date,o=cn(e)||a,s=cn(t)||o,c=[],u=qs(n),h=Math.floor((Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate())-Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()))/864e5)+1;for(let f=0;f<h;f+=1){const m=js(o,f),y=yt(m),k=Ys(`${u}:${y}`),w=k%1e3/1e3,x=.6+.4*Math.sin(f/6*Math.PI*.5),C=m.getUTCDay()===0||m.getUTCDay()===6?.65:1,S=18e3+Math.round(12e3*w),D=Math.max(0,Math.round(S*x*C)),L=Math.round(D*.46),R=Math.round(D*.34),O=Math.round(D*.14),G=Math.max(0,D-L-R-O),W={};if(D>0){const z=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],P=1+k%3;let Y=D;for(let X=0;X<P;X++){const ue=z[(k+X)%z.length];if(X===P-1)W[ue]=Y;else{const se=Math.round(Y*(.3+.4*((k+X*17)%10)/10));W[ue]=se,Y-=se}}}c.push({day:y,total_tokens:D,billable_total_tokens:D,input_tokens:L,output_tokens:R,cached_input_tokens:O,reasoning_output_tokens:G,conversation_count:1+k%5,models:W})}return c}function fL({day:e,seed:t}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=qs(t),s=Array.from({length:48},(u,h)=>{const f=Math.floor(h/2),m=h%2===0?0:30,y=Ys(`${o}:${a}:${f}:${m}`),k=y%1e3/1e3,w=(f+m/60)/24,x=.4+.6*Math.sin(w*Math.PI*2),C=900+Math.round(700*k),S=Math.max(0,Math.round(C*x)),D=Math.round(S*.46),L=Math.round(S*.34),R=Math.round(S*.14),O=Math.max(0,S-D-L-R),G={};if(S>0){const W=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],z=1+y%2;let P=S;for(let Y=0;Y<z;Y++){const X=W[(y+Y)%W.length];if(Y===z-1)G[X]=P;else{const ue=Math.round(P*(.3+.4*((y+Y*17)%10)/10));G[X]=ue,P-=ue}}}return{hour:`${a}T${String(f).padStart(2,"0")}:${String(m).padStart(2,"0")}:00`,total_tokens:S,billable_total_tokens:S,input_tokens:D,output_tokens:L,cached_input_tokens:R,reasoning_output_tokens:O,models:G}}),c=Math.max(0,Math.min(48,dL()));if(c>0){const u=Date.now(),h=s.map((y,k)=>{const w=Date.parse(y.hour);return Number.isFinite(w)&&w<=u?{index:k,ts:w}:null}).filter(Boolean),f=Math.max(0,h.length-c),m=h.slice(f);for(const y of m){const k=s[y.index];k&&(s[y.index]={...k,missing:!0})}}return s}function pL({months:e=24,to:t,seed:n}){const a=cn(t)||cn(Pr(new Date))||new Date,o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),s=qs(n),c=[];for(let u=e-1;u>=0;u-=1){const h=k0(o,-u),f=hL(h),m=Ys(`${s}:${f}`),y=m%1e3/1e3,k=.7+.3*Math.sin(c.length/6*Math.PI*.5),w=36e4+Math.round(2e5*y),x=Math.max(0,Math.round(w*k)),C=Math.round(x*.46),S=Math.round(x*.34),D=Math.round(x*.14),L=Math.max(0,x-C-S-D),R={};if(x>0){const O=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],G=1+m%3;let W=x;for(let z=0;z<G;z++){const P=O[(m+z)%O.length];if(z===G-1)R[P]=W;else{const Y=Math.round(W*(.3+.4*((m+z*17)%10)/10));R[P]=Y,W-=Y}}}c.push({month:f,total_tokens:x,billable_total_tokens:x,input_tokens:C,output_tokens:S,cached_input_tokens:D,reasoning_output_tokens:L,models:R})}return c}function Rp(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 mL(e,t=1.75){const n=Number(e||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*t/1e6).toFixed(6)}function qv(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 xf(e){return{...e,total_cost_usd:mL(e.total_tokens)}}function gL({from:e,to:t,seed:n}={}){const a=mo({from:e,to:t,seed:n});return{from:e,to:t,data:a}}function yL({day:e,seed:t}={}){const n=cn(e)||new Date,a=yt(n),o=fL({day:a,seed:t});return{day:a,data:o}}function vL({months:e=24,to:t,seed:n}={}){const a=cn(t)||cn(Pr(new Date))||new Date,o=yt(a),s=pL({months:e,to:o,seed:n}),c=k0(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),-(e-1));return{from:yt(c),to:o,months:e,data:s}}function kL({from:e,to:t,seed:n,rolling:a=!0}={}){const o=mo({from:e,to:t,seed:n}),s=Rp(o),c=xf(s),u=a?_L({to:t,seed:n}):null;return{from:e,to:t,days:o.length,totals:c,...u?{rolling:u}:{}}}function _L({to:e,seed:t}={}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=yt(js(n,-6)),s=yt(js(n,-29)),c=mo({from:o,to:a,seed:t}),u=mo({from:s,to:a,seed:t});return{last_7d:Yv({rows:c,from:o,to:a}),last_30d:Yv({rows:u,from:s,to:a})}}function Yv({rows:e,from:t,to:n}={}){const a=Rp(e||[]),o=(e||[]).filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,s=o>0?Math.floor(a.billable_total_tokens/o):0;return{from:t,to:n,totals:{billable_total_tokens:a.billable_total_tokens,conversation_count:a.conversation_count},active_days:o,avg_per_active_day:s}}function bL({seed:e,limit:t=3}={}){const n=qs(e),a=sL.map((o,s)=>{const u=12e4+Ys(`${n}:${o}`)%9e5,h=s%4*4200,f=Math.max(0,u+h),m=Math.max(0,Math.round(f*.96));return{project_key:o,project_ref:`https://github.com/${o}`,total_tokens:String(f),billable_total_tokens:String(m)}}).sort((o,s)=>Number(s.billable_total_tokens)-Number(o.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 wL(e){const t=cn(Pr(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(),o=yt(js(t,-a)),s=yt(js(t,-a+6));return{from:o,to:s}}function _0({seed:e,period:t,metric:n,limit:a=20,offset:o=0}={}){const s=qs(e),c=Math.max(1,Math.min(100,Math.floor(Number(a)||20))),u=Math.max(0,Math.min(1e4,Math.floor(Number(o)||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:k}=wL(m),w=250,x=w>0?Math.ceil(w/c):0,C=Math.floor(u/c)+1,S=Array.from({length:w},(z,P)=>{const Y=P+1,X=`00000000-0000-0000-0000-${String(Y).padStart(12,"0")}`,ue=Gv[Y%Gv.length],Ae=18e4+Ys(`${s}:${ue}:${Y}`)%9e5,fe=Math.max(0,Ae+Y*1200),le=Math.floor(fe*.28),pe=Math.floor(fe*.18),Ne=Math.floor(fe*.1),K=Math.floor(fe*.1),Z=Math.floor(fe*.08),H=Math.floor(fe*.03),I=Math.floor(fe*.02),q=Math.floor(fe*.04),xe=Math.floor(fe*.03),Re=Math.max(0,fe-le-pe-Ne-K-Z-H-I-q-xe),Pe=Y%7!==0;return{id:Y,user_id:X,is_public:Pe,is_me:!1,display_name:Pe?ue:"Anonymous",avatar_url:null,gpt_tokens:le,claude_tokens:pe,gemini_tokens:Ne,cursor_tokens:K,opencode_tokens:Z,openclaw_tokens:Re,hermes_tokens:H,kiro_tokens:I,copilot_tokens:q,kimi_tokens:xe,other_tokens:0,total_tokens:fe}}),D=Math.max(0,Math.min(w-1,Math.floor(w*.8)));S[D]&&(S[D].is_me=!0);const L=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",R=S.slice().sort((z,P)=>Number(P[L])-Number(z[L])||z.id-P.id).map((z,P)=>({user_id:z.is_public?z.user_id:null,rank:P+1,is_me:!!z.is_me,display_name:z.display_name,avatar_url:z.avatar_url,gpt_tokens:String(z.gpt_tokens),claude_tokens:String(z.claude_tokens),gemini_tokens:String(z.gemini_tokens),cursor_tokens:String(z.cursor_tokens),opencode_tokens:String(z.opencode_tokens),openclaw_tokens:String(z.openclaw_tokens),hermes_tokens:String(z.hermes_tokens??0),kiro_tokens:String(z.kiro_tokens??0),copilot_tokens:String(z.copilot_tokens??0),kimi_tokens:String(z.kimi_tokens??0),other_tokens:String(z.other_tokens??0),total_tokens:String(z.total_tokens),is_public:!!z.is_public})),O=R.find(z=>z?.is_me)||null,G=O?{rank:O.rank,gpt_tokens:O.gpt_tokens,claude_tokens:O.claude_tokens,gemini_tokens:O.gemini_tokens,cursor_tokens:O.cursor_tokens,opencode_tokens:O.opencode_tokens,openclaw_tokens:O.openclaw_tokens,hermes_tokens:O.hermes_tokens,kiro_tokens:O.kiro_tokens,copilot_tokens:O.copilot_tokens,kimi_tokens:O.kimi_tokens,other_tokens:O.other_tokens,total_tokens:O.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"},W=R.slice(u,u+c);return{period:m,metric:h,from:y,to:k,generated_at:new Date().toISOString(),page:C,limit:c,offset:u,total_entries:w,total_pages:x,entries:W,me:G}}function xL({weeks:e=52,to:t,weekStartsOn:n="sun",seed:a}={}){const o=y0({weeks:e,now:cn(t)||cn(Pr(new Date))||new Date,weekStartsOn:n}),s=mo({from:o.from,to:o.to,seed:a});return{...iL({dailyRows:s,weeks:e,to:o.to,weekStartsOn:n}),week_starts_on:n,active_days:s.filter(u=>Number(u.billable_total_tokens??u.total_tokens)>0).length,streak_days:oL({dailyRows:s,to:o.to})}}function PL({from:e,to:t,seed:n}={}){const a=mo({from:e,to:t,seed:n}),o=Rp(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=qv(o,u.weight),f=u.models.map(m=>{const y=qv(h,m.weight);return{model:m.model,model_id:m.model_id||m.model,totals:xf(y)}});return{source:u.source,totals:xf(h),models:f}});return{from:e,to:t,days:a.length,sources:c,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:Pr(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function SL({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}],o=a.reduce((c,u)=>c+u.total,0),s=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/o*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:o},categories:s,session_count:312,message_count:12046}}let Oc=null;function CL(){Oc=null}async function TL(e=fetch){if(Oc)return Oc;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 Oc=a,a}async function Lp(e=fetch){return{"x-tokentracker-local-auth":await TL(e)}}const sr={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"},EL={"tokentracker-usage-summary":"tokentracker-account-summary","tokentracker-usage-daily":"tokentracker-account-daily","tokentracker-usage-hourly":"tokentracker-account-hourly","tokentracker-usage-monthly":"tokentracker-account-monthly","tokentracker-usage-heatmap":"tokentracker-account-heatmap","tokentracker-usage-model-breakdown":"tokentracker-account-model-breakdown"};function AL(){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")}async function Sr(e,t,n){const a=n?.accessToken,o=EL[e];if(!AL()&&a&&o){const f=Wr().replace(/\/$/,""),m=new URL(`${f}/functions/${o}`);if(t)for(const[x,C]of Object.entries(t))C!=null&&C!==""&&m.searchParams.set(x,String(C));const y={Accept:"application/json"},k=Gs();k&&(y.apikey=k),o0(a)&&(y.Authorization=`Bearer ${a}`);const w=await fetch(m.toString(),{headers:y,cache:"no-store"});if(!w.ok){const x=new Error(`Request failed with HTTP ${w.status}`);throw x.status=w.status,x}return w.json()}const s=new URL(`/functions/${e}`,window.location.origin);if(t)for(const[f,m]of Object.entries(t))m!=null&&m!==""&&s.searchParams.set(f,String(m));const{accessToken:c,...u}=n||{},h=await fetch(s.toString(),{headers:{Accept:"application/json"},cache:"no-store",...u});if(!h.ok){const f=new Error(`Request failed with HTTP ${h.status}`);throw f.status=h.status,f}return h.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 o=typeof t=="string"?t.trim():"";return o&&(n.model=o),n}async function E4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,rolling:c=!1,accessToken:u}={}){if(dn())return kL({from:e,to:t,seed:u,rolling:c});const h=Oa({timeZone:o,tzOffsetMinutes:s}),f=mi({source:n,model:a}),m=c?{rolling:"1"}:{};return Sr(sr.usageSummary,{from:e,to:t,...f,...h,...m},{accessToken:u})}async function A4({from:e,to:t,source:n,limit:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(dn())return bL({seed:c,limit:a});const u=Oa({timeZone:o,tzOffsetMinutes:s}),f={...mi({source:n}),...u};return e&&(f.from=e),t&&(f.to=t),a!=null&&(f.limit=String(a)),Sr(sr.projectUsageSummary,f)}async function gi(e,t={}){const n=Wr();if(!n)throw new Error("InsForge base URL not configured");const a=n.replace(/\/$/,""),o=new URL(`${a}/functions/${e}`);if(t.params)for(const[h,f]of Object.entries(t.params))f!=null&&f!==""&&o.searchParams.set(h,String(f));const s={Accept:"application/json","Content-Type":"application/json"},c=Gs();c&&(s.apikey=c),t.accessToken&&o0(t.accessToken)&&(s.Authorization=`Bearer ${t.accessToken}`);const u=await fetch(o.toString(),{method:t.method||"GET",headers:s,...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 R4({accessToken:e,userId:t,period:n,metric:a,limit:o,offset:s}={}){return dn()?_0({seed:e||t,period:n,metric:a,limit:o,offset:s}):gi("tokentracker-leaderboard",{params:{period:n,limit:o,offset:s,user_id:t}})}async function Zv({accessToken:e}={}){return gi("tokentracker-public-visibility",{accessToken:e,method:"GET"})}async function L4({accessToken:e,enabled:t,anonymous:n,display_name:a,github_url:o,show_github_url:s}={}){const c={};return t!==void 0&&(c.enabled=!!t),n!==void 0&&(c.anonymous=!!n),a!==void 0&&(c.display_name=String(a)),o!==void 0&&(c.github_url=o===null?null:String(o)),s!==void 0&&(c.show_github_url=!!s),gi("tokentracker-public-visibility",{accessToken:e,method:"POST",body:c})}async function D4({accessToken:e,period:t,source:n}={}){const a={};return t&&(a.period=t),typeof n=="string"&&n.trim()&&(a.source=n.trim()),gi("tokentracker-leaderboard-refresh",{accessToken:e,method:"POST",body:a})}async function M4({accessToken:e,userId:t,period:n}={}){if(dn()){const a=_0({seed:e,period:n,metric:"all",limit:250,offset:0}),o=Array.isArray(a?.entries)?a.entries:[],s=o.find(m=>m?.user_id===t)||o[0]||null,c=Number(s?.total_tokens)||0,u=new Date,h=Array.from({length:365}).map((m,y)=>{const k=new Date(u);return k.setUTCDate(k.getUTCDate()-(364-y)),{date:k.toISOString().slice(0,10),total_tokens:y%7===0?Math.floor(c/365):0}}),f=h.slice(-7);return{user:{user_id:t,display_name:s?.display_name||"Mock User",avatar_url:s?.avatar_url||null,github_url:s?.github_url||null,is_anonymous:!1,rank:s?.rank??null},period:{kind:n||"week",from:a?.from??null,to:a?.to??null,generated_at:a?.generated_at??new Date().toISOString()},totals:{total_tokens:c,estimated_cost_usd:Number(s?.estimated_cost_usd)||0,active_days:53,avg_per_day_usd:0},streak:{current_days:3,longest_days:12},best_day:c?{date:u.toISOString().slice(0,10),total_tokens:Math.floor(c/30),estimated_cost_usd:0}:null,models:{count:5,favorite:{model_name:"claude-opus-4-7",total_tokens:Math.floor(c/2)}},by_provider:[],heatmap:h,daily_trend:f}}return gi("tokentracker-leaderboard-profile",{accessToken:e,params:{user_id:t,period:n}})}function b0(e){if(!e)return 0;let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t%165)+24}async function I4({userId:e}={}){return dn()?{count:b0(e)}:gi("tokentracker-profile-likes",{params:{user_id:e}})}async function N4({userId:e,delta:t,accessToken:n}={}){return dn()?{count:Math.max(0,b0(e)+Number(t||0))}:gi("tokentracker-profile-likes",{accessToken:n,method:"POST",body:{user_id:e,delta:t}})}async function O4(e={}){if(dn()){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 Sr(sr.userStatus)}async function j4({signal:e}={}){const t=await Lp(),n=await fetch(`/functions/${sr.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 o=a?.error||a?.message||`Local sync request failed with HTTP ${n.status}`,s=new Error(o);throw s.status=n.status,s}return a}async function U4({from:e,to:t,source:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(dn())return PL({from:e,to:t,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:n});return Sr(sr.usageModelBreakdown,{from:e,to:t,...u,...c},{accessToken:s})}async function B4({from:e,to:t,source:n="claude",timeZone:a,tzOffsetMinutes:o}={}){if(dn())return SL({from:e,to:t,source:n});const s=Oa({timeZone:a,tzOffsetMinutes:o});return Sr(sr.usageCategoryBreakdown,{from:e,to:t,source:n,...s})}async function F4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(dn())return gL({from:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageDaily,{from:e,to:t,...h,...u},{accessToken:c})}async function V4({day:e,source:t,model:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(dn())return yL({day:e,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:t,model:n}),h=e?{day:e,...u,...c}:{...u,...c};return Sr(sr.usageHourly,h,{accessToken:s})}async function z4({months:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(dn())return vL({months:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageMonthly,{...e?{months:String(e)}:{},...t?{to:t}:{},...h,...u},{accessToken:c})}async function $4(e={}){const t=e?.refresh?{refresh:"1"}:void 0;return Sr(sr.usageLimits,t)}async function H4({weeks:e,to:t,weekStartsOn:n,source:a,model:o,timeZone:s,tzOffsetMinutes:c,accessToken:u}={}){if(dn())return xL({weeks:e,to:t,weekStartsOn:n,seed:u});const h=Oa({timeZone:s,tzOffsetMinutes:c}),f=mi({source:a,model:o});return Sr(sr.usageHeatmap,{weeks:String(e),to:t,week_starts_on:n,...f,...h},{accessToken:u})}const w0=b.createContext(null);function RL(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 Xv(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 Nh(e,t={}){if(!e)return null;const n=Math.max(0,Math.floor(Number(t.skewMs)||6e4)),a=e.tokenManager,o=()=>a?.getAccessToken?.()??a?.getSession?.()?.accessToken??null;let s=o();if(!s||$R(s,n)){const{data:c}=await e.auth.refreshSession();if(s=o()??Xv(c)??null,!s&&typeof e.auth.getCurrentUser=="function")try{await e.auth.getCurrentUser(),s=o()??Xv(c)??null}catch{}}return s||null}function LL({children:e}){const[t,n]=b.useState(null),[a,o]=b.useState(null),[s,c]=b.useState(!0);b.useEffect(()=>{if(!wf()){n(null),o(null),c(!1);return}n(OR())},[]),b.useEffect(()=>{if(!t)return;let W=!0;return c(!0),(async()=>{try{let{data:z,error:P}=await t.auth.getCurrentUser();if(!W)return;if(!P&&!z?.user){if(await new Promise(X=>setTimeout(X,150)),!W)return;const Y=await t.auth.getCurrentUser();z=Y.data,P=Y.error}if(P){o(null);return}o(z?.user??null)}catch{W&&o(null)}finally{W&&c(!1)}})(),()=>{W=!1}},[t]);const u=b.useCallback(async()=>{if(t)try{let{data:W,error:z}=await t.auth.getCurrentUser();if(!z&&!W?.user){await new Promise(Y=>setTimeout(Y,150));const P=await t.auth.getCurrentUser();W=P.data,z=P.error}if(z){o(null);return}o(W?.user??null)}catch{o(null)}},[t]),h=b.useCallback(async(W,z)=>{if(!t)return{error:new Error("InsForge client not configured")};const P=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth;if(P){const ue=typeof z=="string"&&z.trim()?z.trim():`${window.location.origin}/auth/callback`,se=await t.auth.signInWithOAuth({provider:W,redirectTo:ue,skipBrowserRedirect:!0});if(se.data?.url){try{const Ae=await Lp();await fetch("/api/auth-bridge/verifier",{method:"PUT",headers:{"Content-Type":"application/json",...Ae},body:JSON.stringify({native:!0})})}catch{}P.postMessage(se.data.url)}return se}const Y=typeof z=="string"&&z.trim()?z.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return await t.auth.signInWithOAuth({provider:W,redirectTo:Y})},[t]),f=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signInWithPassword(W);return z?.user&&o(z.user),{data:z,error:P}},[t]),m=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signUp(W);return z?.user&&z?.accessToken&&o(z.user),{data:z,error:P}},[t]),y=b.useCallback(async()=>t?t.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[t]),k=b.useCallback(async()=>{t&&(await t.auth.signOut(),a0(),CL(),o(null))},[t]),w=b.useCallback(async()=>Nh(t),[t]),[x,C]=b.useState(null),[S,D]=b.useState(!1),L=b.useMemo(()=>RL(a),[a]);b.useEffect(()=>{if(!a||!t){C(null),D(!1);return}let W=!0;return(async()=>{try{const z=await Nh(t);if(!W||!z){W&&D(!0);return}const P=await Zv({accessToken:z});W&&P?.display_name&&C(P.display_name)}catch{}W&&D(!0)})(),()=>{W=!1}},[a,t]);const R=S?x||L:"",O=b.useCallback(async()=>{if(t)try{const W=await Nh(t);if(!W)return;const z=await Zv({accessToken:W});z?.display_name&&C(z.display_name)}catch{}},[t]),G=b.useMemo(()=>!wf()||!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:s,displayName:R,refreshUser:u,refreshDisplayName:O,signInWithOAuth:h,signInWithPassword:f,signUp:m,getPublicAuthConfig:y,signOut:k,getAccessToken:w},[t,a,s,R,u,O,h,f,m,y,k,w]);return N.jsx(w0.Provider,{value:G,children:e})}function Zs(){return b.useContext(w0)}const DL=`key,module,page,component,slot,text,notes,status
43
43
  header.auth.sign_in_aria,shared,*,InsforgeUserHeaderControls,sign_in_aria,"Sign in",,active
44
44
  login.back_home,shared,LoginPage,LoginPage,back_home,"Back to home",,active
45
45
  login.cloud_only,shared,LoginPage,LoginPage,cloud_only,"Cloud sign-in is not configured. Use the local dashboard on localhost.",,active
@@ -832,9 +832,11 @@ local_only.title,dashboard,LocalOnlyNotice,LocalOnlyNotice,title,"Available in t
832
832
  local_only.body,dashboard,LocalOnlyNotice,LocalOnlyNotice,body,"This page reads data from your own machine, so it only works in the Mac app or the CLI dashboard.",,active
833
833
  local_only.open_app,dashboard,LocalOnlyNotice,LocalOnlyNotice,open_app,"Open in Mac app",,active
834
834
  local_only.download,dashboard,LocalOnlyNotice,LocalOnlyNotice,download,"Get the Mac app",,active
835
- `,DL={"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":"检查更新","settings.footer.statusPage":"系统状态","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":"尚未刷新"},ML={"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":"💤 养精蓄锐。在不写代码的日子里,灵感也在悄悄生长。","ipcheck.page.title":"Claude IP 检测","ipcheck.page.subtitle":"查看当前访问 Claude 的出口 IP、纯净度、地理与风险信号,识别可能影响登录或触发风控的因素。","ipcheck.mask.toggle":"隐藏 IP","ipcheck.ipv6.warn":"当前为 IPv6 环境,不建议用 IPv6 访问 Claude Code,部分检测结果可能不完整。","ipcheck.ip.cn":"中国出口 IPv4","ipcheck.ip.cloudflare":"Cloudflare 出口","ipcheck.ip.claude":"Claude 出口","ipcheck.ip.failed":"获取失败","ipcheck.ip.loading":"加载中...","ipcheck.trust.title":"信任评分","ipcheck.trust.subtitle":"Claude 风控视角下的 IP 纯净度","ipcheck.trust.no_data":"无数据","ipcheck.trust.no_ip":"未获取到 Claude 出口 IP,无法评分","ipcheck.trust.no_score":"该 IP 暂无评分数据","ipcheck.trust.gauge.low":"0 高危","ipcheck.trust.gauge.high":"100 可信","ipcheck.trust.label.pristine":"极度纯净","ipcheck.trust.label.clean":"纯净","ipcheck.trust.label.good":"良好","ipcheck.trust.label.neutral":"中性","ipcheck.trust.label.suspicious":"可疑","ipcheck.trust.label.unreachable":"不可访问","ipcheck.trust.text.excellent":"该 IP 信誉极好","ipcheck.trust.text.great":"该 IP 信誉优异","ipcheck.trust.text.minor":"该 IP 存在轻微风险","ipcheck.trust.text.moderate":"该 IP 存在一定风险","ipcheck.trust.text.severe":"该 IP 风险极高","ipcheck.trust.text.restricted":"处于不可访问区域,Claude 会严格风控","ipcheck.trust.region_warn.title":"Claude 出口 IP 位于 {{region}}","ipcheck.trust.region_warn.body":"不建议登录 Claude,容易触发封号风控。","ipcheck.trust.region_support":"Claude 支持地区","ipcheck.trust.region.accessible":"可访问","ipcheck.common.unknown":"未知","ipcheck.props.title":"IP 属性","ipcheck.props.region":"地区","ipcheck.props.city":"城市","ipcheck.props.type":"类型","ipcheck.props.asn":"ASN","ipcheck.props.org":"运营商","ipcheck.props.residential":"家庭住宅","ipcheck.props.datacenter":"机房","ipcheck.security.title":"安全检测","ipcheck.security.vpn":"VPN","ipcheck.security.proxy":"代理 (Proxy)","ipcheck.security.tor":"Tor","ipcheck.security.crawler":"机器人 (Crawler)","ipcheck.security.abuser":"滥用记录","ipcheck.security.proxy_flag":"代理","ipcheck.security.crawler_yes":"是","ipcheck.security.crawler_no":"否","ipcheck.security.abuser_yes":"有记录","ipcheck.security.abuser_no":"无记录","ipcheck.security.clean":"未检测到","ipcheck.avail.title":"Claude 可用性","ipcheck.avail.tooltip":"Claude 服务器在美国,从亚洲访问延迟超过 100ms 属于正常情况。","ipcheck.avail.refresh":"刷新","ipcheck.avail.svc_row":"服务状态","ipcheck.avail.latency.normal":"正常","ipcheck.avail.latency.good":"良好","ipcheck.avail.latency.slow":"较慢","ipcheck.avail.latency.unreachable":"不可访问","ipcheck.avail.svc.none":"全部正常","ipcheck.avail.svc.minor":"轻微故障","ipcheck.avail.svc.major":"重大故障","ipcheck.avail.svc.critical":"严重故障","ipcheck.avail.svc.maintenance":"维护中","ipcheck.avail.svc.other":"服务异常","ipcheck.dns.title":"DNS 泄露检测","ipcheck.dns.status":"状态","ipcheck.dns.outlet":"DNS 出口","ipcheck.dns.outlet_ip":"DNS 出口 IP","ipcheck.dns.isp":"服务商","ipcheck.dns.leaked":"可能泄露","ipcheck.dns.no_leak":"未检测到泄露","ipcheck.dns.encrypted":"DNS 加密或未暴露","ipcheck.dns.cn_tag":"中国 DNS","ipcheck.udp.title":"WebRTC UDP 泄露","ipcheck.udp.status":"状态","ipcheck.udp.outlet":"UDP 出口","ipcheck.udp.outlet_ip":"UDP 出口 IP","ipcheck.udp.origin":"归属地","ipcheck.udp.disabled":"WebRTC 已禁用","ipcheck.udp.no_leak":"未检测到泄露","ipcheck.udp.leaked":"可能泄露","ipcheck.udp.anomaly":"异常","ipcheck.device.title":"设备信息","ipcheck.device.tz":"时区","ipcheck.device.lang":"语言","ipcheck.device.os":"操作系统 / 浏览器","ipcheck.device.touch":"触屏","ipcheck.device.net":"网络类型","ipcheck.device.dnt":"Do Not Track","ipcheck.device.webgl_render":"WebGL 渲染器","ipcheck.device.canvas_fp":"Canvas 指纹","ipcheck.device.webgl_fp":"WebGL 指纹","ipcheck.device.match":"一致","ipcheck.device.mismatch":"不一致","ipcheck.device.local":"本地","ipcheck.device.estimate_suffix":"(估算)","ipcheck.device.diff_equal":"偏移略有差异","ipcheck.device.diff_ahead":"Claude 快 {{h}} 小时","ipcheck.device.diff_behind":"Claude 慢 {{h}} 小时","ipcheck.device.lang_expected":"Claude 出口常用","ipcheck.device.touch_yes":"是","ipcheck.device.touch_no":"否","ipcheck.device.dnt_on":"已开启","ipcheck.device.dnt_off":"已关闭","ipcheck.device.dnt_unset":"未设置","ipcheck.device.net_unsupported":"不支持检测","ipcheck.device.unsupported":"不支持","ipcheck.history.title":"Claude 出口 IP 历史","ipcheck.history.subtitle":"仅本地存储于浏览器,最多保留 6 条","ipcheck.history.clear":"清除","ipcheck.history.empty":"暂无历史记录","ipcheck.history.current":"当前","ipcheck.region.CN":"中国大陆","ipcheck.region.HK":"香港","ipcheck.region.MO":"澳门","ipcheck.region.RU":"俄罗斯","ipcheck.region.KP":"朝鲜","ipcheck.region.IR":"伊朗","ipcheck.region.SY":"叙利亚","ipcheck.region.CU":"古巴","ipcheck.region.BY":"白俄罗斯","ipcheck.region.VE":"委内瑞拉","leaderboard.profile_modal.close":"关闭","leaderboard.profile_modal.loading":"正在加载用户资料…","leaderboard.profile_modal.error":"加载用户资料失败。","leaderboard.profile_modal.empty":"这个用户的资料未公开。","leaderboard.profile_modal.row_aria":"查看 {{name}} 的资料","leaderboard.profile_modal.rank":"#{{rank}}","leaderboard.profile.hero.rank_label":"排名","leaderboard.profile_modal.hero.total_tokens":"总 Token","leaderboard.profile_modal.hero.total_cost":"总花费","leaderboard.profile_modal.hero.github":"GitHub 主页","leaderboard.profile_modal.stat.total_cost":"总花费","leaderboard.profile_modal.stat.total_tokens":"总 Token","leaderboard.profile_modal.stat.active_days":"活跃天数","leaderboard.profile_modal.stat.avg_per_day":"日均花费","leaderboard.profile_modal.streak.current":"当前连续","leaderboard.profile_modal.streak.longest":"最长连续","leaderboard.profile_modal.streak.days":"{{count}} 天","leaderboard.profile_modal.best_day.title":"最佳日","leaderboard.profile_modal.best_day.none":"—","leaderboard.profile_modal.models.count":"使用了 {{count}} 个模型","leaderboard.profile_modal.models.favorite":"最爱模型","leaderboard.profile_modal.models.none":"暂无模型记录","leaderboard.profile_modal.heatmap.title":"活跃度(最近 365 天)","leaderboard.profile_modal.providers.title":"按 Provider 分布","leaderboard.profile_modal.providers.none":"本周期无使用数据。","leaderboard.profile_modal.view_full":"查看完整主页","local_only.title":"请在客户端内使用","local_only.body":"这个页面读取的是你本机上的数据,所以只能在 Mac app 或命令行 dashboard 里查看。","local_only.open_app":"在 Mac app 内打开","local_only.download":"下载 Mac app"},IL={"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.status":"状态","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":"Dashboard","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":"热门模型"},w0="tokentracker-locale",mo="system",iu="en",Dp="zh-CN";function x0(e){return typeof e!="string"?iu:/^zh(?:[-_]|$)/i.test(e.trim())?Dp:iu}function Ru(e){return e===mo?mo:x0(e)}function NL(){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 ou(e,t=NL()){const n=Ru(e);if(n!==mo)return n;const a=t.map(o=>typeof o=="string"?o.trim():"").find(o=>o.length>0);return a&&/^zh(?:[-_]|$)/i.test(a)?Dp:iu}function Mp(){return Ru(xs(w0)||mo)}function OL(e){return Ps(w0,Ru(e))}const jL=["key","module","page","component","slot","text"],UL={[Dp]:{...DL,...ML,...IL}};let Oh=null,P0=ou(Mp());function BL(e){const t=[];let n=[],a="",o=!1;for(let s=0;s<e.length;s+=1){const c=e[s];if(o){c==='"'?e[s+1]==='"'?(a+='"',s+=1):o=!1:a+=c;continue}if(c==='"'){o=!0;continue}if(c===","){n.push(a),a="";continue}if(c===`
836
- `){n.push(a),a="",n.every(u=>u.trim()==="")||t.push(n),n=[];continue}c!=="\r"&&(a+=c)}return n.push(a),n.every(s=>s.trim()==="")||t.push(n),t}function FL(e){const t=BL(e);if(!t.length)return{map:new Map,rows:[]};const n=t[0].map(u=>String(u).trim());if(jL.filter(u=>!n.includes(u)).length)return{map:new Map,rows:[]};const o=Object.fromEntries(n.map((u,h)=>[u,h])),s=[],c=new Map;return t.slice(1).forEach((u,h)=>{const f={key:String(u[o.key]||"").trim(),module:String(u[o.module]||"").trim(),page:String(u[o.page]||"").trim(),component:String(u[o.component]||"").trim(),slot:String(u[o.slot]||"").trim(),text:String(u[o.text]??"").trim()};f.key&&(c.has(f.key),c.set(f.key,f),s.push(f))}),{map:c,rows:s}}function VL(){return Oh||(Oh=FL(LL)),Oh}function zL(){return UL[P0]||{}}function $L(e){const t=zL()[String(e)];return typeof t=="string"&&t.trim()?t:null}function HL(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,a)=>t[a]==null?n:String(t[a])):e}function WL(e){return String(e).replace(/\\n/g,`
837
- `)}function KL(e,t){return $L(t)||e?.text||t}function GL(e){P0=x0(e)}function Fe(e,t){const a=VL().map.get(e);return HL(WL(KL(a,e)),t)}const Qv="tokentracker_native_app";let S0=null;const Pf=new Set;typeof window<"u"&&window.addEventListener("native:systemAppearanceChanged",e=>{const t=e?.detail?.isDark;if(typeof t=="boolean"){S0=t;try{const n=document.documentElement;t?n.classList.add("dark"):n.classList.remove("dark")}catch{}Pf.forEach(n=>{try{n(t)}catch{}})}});function Jv(){return S0}function qL(e){return Pf.add(e),()=>Pf.delete(e)}function Ip(){if(typeof window>"u")return!1;try{if(new URLSearchParams(window.location.search).get("app")==="1"){try{window.localStorage.setItem(Qv,"1")}catch{}return!0}return window.localStorage.getItem(Qv)==="1"}catch{return!1}}function ar(){return typeof window>"u"?!1:!!window.webkit?.messageHandlers?.nativeBridge}function C0(){return typeof window>"u"?null:window.webkit?.messageHandlers?.nativeBridge??null}function z4(){return!!C0()}function Xs(e){const t=C0();if(!t)return!1;try{return t.postMessage(e),!0}catch(n){return console.warn("[tokentracker] nativeBridge post failed:",n),!1}}function $4(){return Xs({type:"getSettings"})}function Ss(e,t){return Xs({type:"setSetting",key:e,value:t})}function H4(e){return Xs({type:"action",name:e})}function YL(){return Xs({type:"getSystemAppearance"})}function ZL(e,t){if(!ar())return;Xs({type:"setChromeAppearance",isDark:e==="dark",theme:t??"system"})}function W4(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 T0=b.createContext(null);function XL(){return ou(Mp())}function QL(e){typeof document>"u"||(document.documentElement.lang=e)}function ek(e,t){GL(e),t(n=>n===e?n:e)}function JL({children:e}){const[t,n]=b.useState(Mp),[a,o]=b.useState(XL);b.useLayoutEffect(()=>{QL(a)},[a]),b.useLayoutEffect(()=>{ar()&&Ss("locale",t)},[t]),b.useLayoutEffect(()=>{if(t!==mo||typeof window>"u")return;const u=()=>ek(ou(mo),o);return window.addEventListener("languagechange",u),()=>window.removeEventListener("languagechange",u)},[t]);const s=b.useCallback(u=>{const h=Ru(u);ek(ou(h),o),n(h),OL(h),ar()&&Ss("locale",h)},[]),c=b.useMemo(()=>({locale:t,setLocale:s,resolvedLocale:a}),[t,a,s]);return N.jsx(T0.Provider,{value:c,children:e})}const eD="https://open.er-api.com/v6/latest/USD",tD=1440*60*1e3,nD=5e3;function rD(e,t=tD,n=Date.now()){return!e||!Number.isFinite(e)?!0:n-e>t}async function aD(e={}){const{timeoutMs:t=nD,fetchImpl:n,url:a=eD,codes:o=Tp}=e,s=n??(typeof fetch<"u"?fetch:null);if(!s)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 s(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 k of o){if(k==="USD")continue;const w=m[k];ru(w)&&(y[k]=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 iD=b.createContext(null);function tk(e,t,n){ar()&&(Ss("currency",e),Ss("currencySymbol",n),ru(t)&&Ss("exchangeRate",t))}function oD({children:e}){const[t,n]=b.useState(XR),a=b.useMemo(()=>eL(),[]),[o,s]=b.useState(a.rates),[c,u]=b.useState(a.source),[h,f]=b.useState(a.fetchedAt),m=b.useRef(!1),y=b.useRef(!1),k=b.useCallback((L,R,O)=>{s(L),u(R),f(O),tL({rates:L,source:R,fetchedAt:O})},[]),w=b.useCallback(async()=>{if(!m.current){m.current=!0;try{const{rates:L,fetchedAt:R}=await aD();k({...Ep,...L},"fetched",R)}catch{}finally{m.current=!1}}},[k]),x=b.useCallback(L=>{const R=Ap(L);n(R),QR(R);const O=Mh(o,R),G=Nc(R);tk(R,O,G)},[o]);b.useEffect(()=>{y.current||t!==Ns&&rD(h)&&(y.current=!0,w())},[t,h,w]),b.useEffect(()=>{const L=Mh(o,t),R=Nc(t);tk(t,L,R)},[t,o]);const C=b.useMemo(()=>Mh(o,t),[o,t]),S=b.useMemo(()=>Nc(t),[t]),D=b.useMemo(()=>({currency:t,rate:C,symbol:S,rates:o,rateSource:c,rateFetchedAt:h,setCurrency:x}),[t,C,S,o,c,h,x]);return N.jsx(iD.Provider,{value:D,children:e})}const sD="modulepreload",lD=function(e){return"/"+e},nk={},$n=function(t,n,a){let o=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");o=h(n.map(f=>{if(f=lD(f),f in nk)return;nk[f]=!0;const m=f.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=m?"stylesheet":sD,m||(k.as="script"),k.crossOrigin="",k.href=f,u&&k.setAttribute("nonce",u),document.head.appendChild(k),m)return new Promise((w,x)=>{k.addEventListener("load",w),k.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};var su={},cD=()=>{window.va||(window.va=function(...t){window.vaq||(window.vaq=[]),window.vaq.push(t)})},uD="@vercel/analytics",dD="2.0.1";function E0(){return typeof window<"u"}function A0(){try{const e="production"}catch{}return"production"}function hD(e="auto"){if(e==="auto"){window.vam=A0();return}window.vam=e}function fD(){return(E0()?window.vam:A0())||"production"}function Np(){return fD()==="development"}function pD(e){return e.scriptSrc?ro(e.scriptSrc):Np()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?ro(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function mD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.analytics,...e}}catch{}hD(a.mode);const o={sdkn:uD+(a.framework?`/${a.framework}`:""),sdkv:dD};return a.disableAutoTrack&&(o.disableAutoTrack="1"),a.viewEndpoint&&(o.viewEndpoint=ro(a.viewEndpoint)),a.eventEndpoint&&(o.eventEndpoint=ro(a.eventEndpoint)),a.sessionEndpoint&&(o.sessionEndpoint=ro(a.sessionEndpoint)),Np()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=a.endpoint:a.basePath&&(o.endpoint=ro(`${a.basePath}/insights`)),{beforeSend:a.beforeSend,src:pD(a),dataset:o}}function ro(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function gD(e={debug:!0},t){var n;if(!E0())return;const{beforeSend:a,src:o,dataset:s}=mD(e,t);if(cD(),a&&((n=window.va)==null||n.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${o}"]`))return;const c=document.createElement("script");c.src=o;for(const[u,h]of Object.entries(s))c.dataset[u]=h;c.defer=!0,c.onerror=()=>{const u=Np()?"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 ${o}. ${u}`)},document.head.appendChild(c)}function yD({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function vD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function kD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function _D(e){return b.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),b.useEffect(()=>{gD({framework:e.framework||"react",basePath:e.basePath??vD(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??kD())},[]),b.useEffect(()=>{e.route&&e.path&&yD({route:e.route,path:e.path})},[e.route,e.path]),null}var lu={},bD=()=>{window.si||(window.si=function(...t){window.siq=window.siq||[],window.siq.push(t)})},wD="@vercel/speed-insights",xD="2.0.0";function PD(){return typeof window<"u"}function SD(){try{const e="production"}catch{}return"production"}function R0(){return SD()==="development"}function CD(e){return e.scriptSrc?cu(e.scriptSrc):R0()?"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?cu(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function TD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.speedInsights,...e}}catch{}const o={sdkn:wD+(a.framework?`/${a.framework}`:""),sdkv:xD};return a.sampleRate&&(o.sampleRate=a.sampleRate.toString()),a.route&&(o.route=a.route),R0()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=cu(a.endpoint):a.basePath&&(o.endpoint=cu(`${a.basePath}/speed-insights/vitals`)),{src:CD(a),beforeSend:a.beforeSend,dataset:o}}function cu(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function ED(e={},t){var n;if(!PD()||e.route===null)return null;bD();const{beforeSend:a,src:o,dataset:s}=TD(e,t);if(document.head.querySelector(`script[src*="${o}"]`))return null;a&&((n=window.si)==null||n.call(window,"beforeSend",a));const c=document.createElement("script");c.src=o,c.defer=!0;for(const[u,h]of Object.entries(s))c.dataset[u]=h;return c.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${o}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(c),{setRoute:u=>{c.dataset.route=u??void 0}}}function AD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function RD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function LD(e){b.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const t=b.useRef(null);return b.useEffect(()=>{if(!t.current){const n=ED({framework:e.framework??"react",basePath:e.basePath??AD(),...e},e.configString??RD());n&&(t.current=n.setRoute)}},[e]),b.useEffect(()=>{t.current&&e.route&&t.current(e.route)},[e.route]),null}const L0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const DD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const MD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const rk=e=>{const t=MD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jh={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 ID=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ND=b.createContext({}),OD=()=>b.useContext(ND),jD=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},h)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:k="currentColor",className:w=""}=OD()??{},x=a??y?Number(n??m)*24/Number(t??f):n??m;return b.createElement("svg",{ref:h,...jh,width:t??f??jh.width,height:t??f??jh.height,stroke:e??k,strokeWidth:x,className:L0("lucide",w,o),...!s&&!ID(u)&&{"aria-hidden":"true"},...u},[...c.map(([C,S])=>b.createElement(C,S)),...Array.isArray(s)?s:[s]])});const dn=(e,t)=>{const n=b.forwardRef(({className:a,...o},s)=>b.createElement(jD,{ref:s,iconNode:t,className:L0(`lucide-${DD(rk(e))}`,`lucide-${e}`,a),...o}));return n.displayName=rk(e),n};const UD=[["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"}]],BD=dn("chart-column",UD);const FD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],VD=dn("gauge",FD);const zD=[["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"}]],$D=dn("globe",zD);const HD=[["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"}]],WD=dn("layout-grid",HD);const KD=[["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"}]],GD=dn("mail",KD);const qD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],YD=dn("menu",qD);const ZD=[["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"}]],XD=dn("monitor",ZD);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"}]],D0=dn("moon",QD);const JD=[["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"}]],eM=dn("puzzle",JD);const tM=[["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"}]],nM=dn("refresh-cw",tM);const rM=[["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"}]],aM=dn("settings",rM);const iM=[["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"}]],M0=dn("sun",iM);const oM=[["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"}]],sM=dn("triangle-alert",oM);const lM=[["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"}]],cM=dn("trophy",lM);const uM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],I0=dn("x",uM);function dM({children:e,variant:t="primary",size:n="md",onClick:a,disabled:o=!1,className:s="",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=o?"cursor-not-allowed opacity-60":"cursor-pointer",k=`${h} ${f[t]} ${m[n]} ${y} ${s}`;return N.jsx(c,{className:k,onClick:a,disabled:o,...u,children:e})}class hM extends Rs.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 N.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:N.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:[N.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:N.jsx(sM,{className:"h-5 w-5","aria-hidden":!0})}),N.jsx("div",{className:"mt-4 text-xs font-medium uppercase text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.title")}),N.jsx("h1",{className:"mt-2 text-xl font-semibold text-oai-black dark:text-white",children:Fe("error.boundary.subtitle")}),N.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.hint")}),N.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}),N.jsxs(dM,{type:"button",size:"md",onClick:this.handleReload,className:"mt-5",children:[N.jsx(nM,{className:"mr-2 h-4 w-4","aria-hidden":!0}),Fe("error.boundary.action.reload")]})]})})}}function Qs(){const e=b.useContext(T0);if(e===null)throw new Error("useLocale must be used within a LocaleProvider");return e}const Sf="tokentracker-theme",N0=b.createContext(null);function fM(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(Sf);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function yc(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function pM(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function mM({children:e}){const[t,n]=b.useState(fM),[a,o]=b.useState(()=>{if(t!=="system")return t;if(ar()){const f=Jv();if(typeof f=="boolean")return f?"dark":"light"}return yc()}),s=b.useRef(t);b.useEffect(()=>{s.current=t},[t]),b.useEffect(()=>{pM(a)},[a]),b.useLayoutEffect(()=>{if(t==="system"){if(ar()){const f=Jv();o(typeof f=="boolean"?f?"dark":"light":yc()),YL();return}o(yc())}else o(t)},[t]),b.useEffect(()=>ar()?qL(m=>{s.current==="system"&&o(m?"dark":"light")}):void 0,[]),b.useEffect(()=>{if(typeof window>"u"||t!=="system"||ar())return;const f=window.matchMedia("(prefers-color-scheme: dark)"),m=y=>{const k=y.matches?"dark":"light";o(k)};return f.addEventListener?(f.addEventListener("change",m),()=>f.removeEventListener("change",m)):(f.addListener(m),()=>f.removeListener(m))},[t]),b.useEffect(()=>{const f=t==="system"&&!ar()?yc():a;ZL(f,t)},[a,t]);const c=b.useCallback(f=>{if(n(f),typeof window<"u")try{localStorage.setItem(Sf,f)}catch{}},[]),u=b.useCallback(()=>{c(f=>{const m=f==="dark"?"light":"dark";if(typeof window<"u")try{localStorage.setItem(Sf,m)}catch{}return m})},[]),h=b.useMemo(()=>({theme:t,setTheme:c,toggleTheme:u,resolvedTheme:a}),[t,c,u,a]);return N.jsx(N0.Provider,{value:h,children:e})}const O0=b.createContext({isOpen:!1,openLoginModal:()=>{},closeLoginModal:()=>{}});function gM({children:e}){const[t,n]=b.useState(!1),a=b.useCallback(()=>n(!0),[]),o=b.useCallback(()=>n(!1),[]);return N.jsx(O0.Provider,{value:{isOpen:t,openLoginModal:a,closeLoginModal:o},children:e})}function j0(){return b.useContext(O0)}const Op=b.createContext({});function jp(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const yM=typeof window<"u",U0=yM?b.useLayoutEffect:b.useEffect,Lu=b.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function uu(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 Bp=()=>{};const Ia={},B0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function F0(e){return typeof e=="object"&&e!==null}const V0=e=>/^0[^.\s]+$/u.test(e);function z0(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,vM=(e,t)=>n=>t(e(n)),Js=(...e)=>e.reduce(vM),js=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Fp{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>uu(this.subscriptions,t)}notify(t,n,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,a);else for(let s=0;s<o;s++){const c=this.subscriptions[s];c&&c(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pn=e=>e*1e3,On=e=>e/1e3;function $0(e,t){return t?e*(1e3/t):0}const H0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kM=1e-7,_M=12;function bM(e,t,n,a,o){let s,c,u=0;do c=t+(n-t)/2,s=H0(c,a,o)-e,s>0?n=c:t=c;while(Math.abs(s)>kM&&++u<_M);return c}function el(e,t,n,a){if(e===t&&n===a)return jn;const o=s=>bM(s,0,1,e,n);return s=>s===0||s===1?s:H0(o(s),t,a)}const W0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,K0=e=>t=>1-e(1-t),G0=el(.33,1.53,.69,.99),Vp=K0(G0),q0=W0(Vp),Y0=e=>e>=1?1:(e*=2)<1?.5*Vp(e):.5*(2-Math.pow(2,-10*(e-1))),zp=e=>1-Math.sin(Math.acos(e)),Z0=K0(zp),X0=W0(zp),wM=el(.42,0,1,1),xM=el(0,0,.58,1),Q0=el(.42,0,.58,1),PM=e=>Array.isArray(e)&&typeof e[0]!="number",J0=e=>Array.isArray(e)&&typeof e[0]=="number",SM={linear:jn,easeIn:wM,easeInOut:Q0,easeOut:xM,circIn:zp,circInOut:X0,circOut:Z0,backIn:Vp,backInOut:q0,backOut:G0,anticipate:Y0},CM=e=>typeof e=="string",ak=e=>{if(J0(e)){Bp(e.length===4);const[t,n,a,o]=e;return el(t,n,a,o)}else if(CM(e))return SM[e];return e},vc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function TM(e,t){let n=new Set,a=new Set,o=!1,s=!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,k=!1)=>{const x=k&&o?n:a;return y&&c.add(m),x.add(m),m},cancel:m=>{a.delete(m),c.delete(m)},process:m=>{if(u=m,o){s=!0;return}o=!0;const y=n;n=a,a=y,n.forEach(h),n.clear(),o=!1,s&&(s=!1,f.process(m))}};return f}const EM=40;function ew(e,t){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,c=vc.reduce((R,O)=>(R[O]=TM(s),R),{}),{setup:u,read:h,resolveKeyframes:f,preUpdate:m,update:y,preRender:k,render:w,postRender:x}=c,C=()=>{const R=Ia.useManualTiming,O=R?o.timestamp:performance.now();n=!1,R||(o.delta=a?1e3/60:Math.max(Math.min(O-o.timestamp,EM),1)),o.timestamp=O,o.isProcessing=!0,u.process(o),h.process(o),f.process(o),m.process(o),y.process(o),k.process(o),w.process(o),x.process(o),o.isProcessing=!1,n&&t&&(a=!1,e(C))},S=()=>{n=!0,a=!0,o.isProcessing||e(C)};return{schedule:vc.reduce((R,O)=>{const G=c[O];return R[O]=(W,z=!1,P=!1)=>(n||S(),G.schedule(W,z,P)),R},{}),cancel:R=>{for(let O=0;O<vc.length;O++)c[vc[O]].cancel(R)},state:o,steps:c}}const{schedule:dt,cancel:Na,state:Kt,steps:Uh}=ew(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let jc;function AM(){jc=void 0}const sn={now:()=>(jc===void 0&&sn.set(Kt.isProcessing||Ia.useManualTiming?Kt.timestamp:performance.now()),jc),set:e=>{jc=e,queueMicrotask(AM)}},tw=e=>t=>typeof t=="string"&&t.startsWith(e),nw=tw("--"),RM=tw("var(--"),$p=e=>RM(e)?LM.test(e.split("/*")[0].trim()):!1,LM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ik(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const _o={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Us={..._o,transform:e=>xr(0,1,e)},kc={..._o,default:1},Cs=e=>Math.round(e*1e5)/1e5,Hp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function DM(e){return e==null}const MM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wp=(e,t)=>n=>!!(typeof n=="string"&&MM.test(n)&&n.startsWith(e)||t&&!DM(n)&&Object.prototype.hasOwnProperty.call(n,t)),rw=(e,t,n)=>a=>{if(typeof a!="string")return a;const[o,s,c,u]=a.match(Hp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},IM=e=>xr(0,255,e),Bh={..._o,transform:e=>Math.round(IM(e))},ai={test:Wp("rgb","red"),parse:rw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Bh.transform(e)+", "+Bh.transform(t)+", "+Bh.transform(n)+", "+Cs(Us.transform(a))+")"};function NM(e){let t="",n="",a="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const Cf={test:Wp("#"),parse:NM,transform:ai.transform},tl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sa=tl("deg"),vr=tl("%"),_e=tl("px"),OM=tl("vh"),jM=tl("vw"),ok={...vr,parse:e=>vr.parse(e)/100,transform:e=>vr.transform(e*100)},ao={test:Wp("hsl","hue"),parse:rw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+vr.transform(Cs(t))+", "+vr.transform(Cs(n))+", "+Cs(Us.transform(a))+")"},Lt={test:e=>ai.test(e)||Cf.test(e)||ao.test(e),parse:e=>ai.test(e)?ai.parse(e):ao.test(e)?ao.parse(e):Cf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ai.transform(e):ao.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},UM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function BM(e){return isNaN(e)&&typeof e=="string"&&(e.match(Hp)?.length||0)+(e.match(UM)?.length||0)>0}const aw="number",iw="color",FM="var",VM="var(",sk="${}",zM=/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 go(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},o=[];let s=0;const u=t.replace(zM,h=>(Lt.test(h)?(a.color.push(s),o.push(iw),n.push(Lt.parse(h))):h.startsWith(VM)?(a.var.push(s),o.push(FM),n.push(h)):(a.number.push(s),o.push(aw),n.push(parseFloat(h))),++s,sk)).split(sk);return{values:n,split:u,indexes:a,types:o}}function $M(e){return go(e).values}function ow({split:e,types:t}){const n=e.length;return a=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],a[s]!==void 0){const c=t[s];c===aw?o+=Cs(a[s]):c===iw?o+=Lt.transform(a[s]):o+=a[s]}return o}}function HM(e){return ow(go(e))}const WM=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,KM=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:WM(e);function GM(e){const t=go(e);return ow(t)(t.values.map((a,o)=>KM(a,t.split[o])))}const or={test:BM,parse:$M,createTransformer:HM,getAnimatableNone:GM};function Fh(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 qM({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let o=0,s=0,c=0;if(!t)o=s=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;o=Fh(h,u,e+1/3),s=Fh(h,u,e),c=Fh(h,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(c*255),alpha:a}}function du(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,Vh=(e,t,n)=>{const a=e*e,o=n*(t*t-a)+a;return o<0?0:Math.sqrt(o)},YM=[Cf,ai,ao],ZM=e=>YM.find(t=>t.test(e));function lk(e){const t=ZM(e);if(!t)return!1;let n=t.parse(e);return t===ao&&(n=qM(n)),n}const ck=(e,t)=>{const n=lk(e),a=lk(t);if(!n||!a)return du(e,t);const o={...n};return s=>(o.red=Vh(n.red,a.red,s),o.green=Vh(n.green,a.green,s),o.blue=Vh(n.blue,a.blue,s),o.alpha=vt(n.alpha,a.alpha,s),ai.transform(o))},Tf=new Set(["none","hidden"]);function XM(e,t){return Tf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function QM(e,t){return n=>vt(e,t,n)}function Kp(e){return typeof e=="number"?QM:typeof e=="string"?$p(e)?du:Lt.test(e)?ck:t2:Array.isArray(e)?sw:typeof e=="object"?Lt.test(e)?ck:JM:du}function sw(e,t){const n=[...e],a=n.length,o=e.map((s,c)=>Kp(s)(s,t[c]));return s=>{for(let c=0;c<a;c++)n[c]=o[c](s);return n}}function JM(e,t){const n={...e,...t},a={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(a[o]=Kp(e[o])(e[o],t[o]));return o=>{for(const s in a)n[s]=a[s](o);return n}}function e2(e,t){const n=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],c=e.indexes[s][a[s]],u=e.values[c]??0;n[o]=u,a[s]++}return n}const t2=(e,t)=>{const n=or.createTransformer(t),a=go(e),o=go(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Tf.has(e)&&!o.values.length||Tf.has(t)&&!a.values.length?XM(e,t):Js(sw(e2(a,o),o.values),n):du(e,t)};function lw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):Kp(e)(e,t)}const n2=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Na(t),now:()=>Kt.isProcessing?Kt.timestamp:sn.now()}},cw=(e,t,n=10)=>{let a="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)a+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},hu=2e4;function Gp(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<hu;)t+=n,a=e.next(t);return t>=hu?1/0:t}function r2(e,t=100,n){const a=n({...e,keyframes:[0,t]}),o=Math.min(Gp(a),hu);return{type:"keyframes",ease:s=>a.next(o*s).value/t,duration:On(o)}}const Pt={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 Ef(e,t){return e*Math.sqrt(1-t*t)}const a2=12;function i2(e,t,n){let a=n;for(let o=1;o<a2;o++)a=a-e(a)/t(a);return a}const zh=.001;function o2({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:a=Pt.mass}){let o,s,c=1-t;c=xr(Pt.minDamping,Pt.maxDamping,c),e=xr(Pt.minDuration,Pt.maxDuration,On(e)),c<1?(o=f=>{const m=f*c,y=m*e,k=m-n,w=Ef(f,c),x=Math.exp(-y);return zh-k/w*x},s=f=>{const y=f*c*e,k=y*n+n,w=Math.pow(c,2)*Math.pow(f,2)*e,x=Math.exp(-y),C=Ef(Math.pow(f,2),c);return(-o(f)+zh>0?-1:1)*((k-w)*x)/C}):(o=f=>{const m=Math.exp(-f*e),y=(f-n)*e+1;return-zh+m*y},s=f=>{const m=Math.exp(-f*e),y=(n-f)*(e*e);return m*y});const u=5/e,h=i2(o,s,u);if(e=Pn(e),isNaN(h))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(h,2)*a;return{stiffness:f,damping:c*2*Math.sqrt(a*f),duration:e}}}const s2=["duration","bounce"],l2=["stiffness","damping","mass"];function uk(e,t){return t.some(n=>e[n]!==void 0)}function c2(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!uk(e,l2)&&uk(e,s2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),o=a*a,s=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:s}}else{const n=o2({...e,velocity:0});t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function fu(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=n;const s=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:s},{stiffness:h,damping:f,mass:m,duration:y,velocity:k,isResolvedFromDuration:w}=c2({...n,velocity:-On(n.velocity||0)}),x=k||0,C=f/(2*Math.sqrt(h*m)),S=c-s,D=On(Math.sqrt(h/m)),L=Math.abs(S)<5;a||(a=L?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=L?Pt.restDelta.granular:Pt.restDelta.default);let R,O,G,W,z,P;if(C<1)G=Ef(D,C),W=(x+C*D*S)/G,R=X=>{const ue=Math.exp(-C*D*X);return c-ue*(W*Math.sin(G*X)+S*Math.cos(G*X))},z=C*D*W+S*G,P=C*D*S-W*G,O=X=>Math.exp(-C*D*X)*(z*Math.sin(G*X)+P*Math.cos(G*X));else if(C===1){R=ue=>c-Math.exp(-D*ue)*(S+(x+D*S)*ue);const X=x+D*S;O=ue=>Math.exp(-D*ue)*(D*X*ue-x)}else{const X=D*Math.sqrt(C*C-1);R=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return c-le*((x+C*D*S)*Math.sinh(pe)+X*S*Math.cosh(pe))/X};const ue=(x+C*D*S)/X,se=C*D*ue-S*X,Ae=C*D*S-ue*X;O=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return le*(se*Math.sinh(pe)+Ae*Math.cosh(pe))}}const Y={calculatedDuration:w&&y||null,velocity:X=>Pn(O(X)),next:X=>{if(!w&&C<1){const se=Math.exp(-C*D*X),Ae=Math.sin(G*X),fe=Math.cos(G*X),le=c-se*(W*Ae+S*fe),pe=Pn(se*(z*Ae+P*fe));return u.done=Math.abs(pe)<=a&&Math.abs(c-le)<=o,u.value=u.done?c:le,u}const ue=R(X);if(w)u.done=X>=y;else{const se=Pn(O(X));u.done=Math.abs(se)<=a&&Math.abs(c-ue)<=o}return u.value=u.done?c:ue,u},toString:()=>{const X=Math.min(Gp(Y),hu),ue=cw(se=>Y.next(X*se).value,X,30);return X+"ms "+ue},toTransition:()=>{}};return Y}fu.applyToOptions=e=>{const t=r2(e,100,fu);return e.ease=t.ease,e.duration=Pn(t.duration),e.type="keyframes",e};const u2=5;function uw(e,t,n){const a=Math.max(t-u2,0);return $0(n-e(a),t-a)}function Af({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:c,min:u,max:h,restDelta:f=.5,restSpeed:m}){const y=e[0],k={done:!1,value:y},w=P=>u!==void 0&&P<u||h!==void 0&&P>h,x=P=>u===void 0?h:h===void 0||Math.abs(u-P)<Math.abs(h-P)?u:h;let C=n*t;const S=y+C,D=c===void 0?S:c(S);D!==S&&(C=D-y);const L=P=>-C*Math.exp(-P/a),R=P=>D+L(P),O=P=>{const Y=L(P),X=R(P);k.done=Math.abs(Y)<=f,k.value=k.done?D:X};let G,W;const z=P=>{w(k.value)&&(G=P,W=fu({keyframes:[k.value,x(k.value)],velocity:uw(R,P,k.value),damping:o,stiffness:s,restDelta:f,restSpeed:m}))};return z(0),{calculatedDuration:null,next:P=>{let Y=!1;return!W&&G===void 0&&(Y=!0,O(P),z(P)),G!==void 0&&P>=G?W.next(P-G):(!Y&&O(P),k)}}}function d2(e,t,n){const a=[],o=n||Ia.mix||lw,s=e.length-1;for(let c=0;c<s;c++){let u=o(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;u=Js(h,u)}a.push(u)}return a}function h2(e,t,{clamp:n=!0,ease:a,mixer:o}={}){const s=e.length;if(Bp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=d2(t,a,o),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 k=js(e[y],e[y+1],m);return u[y](k)};return n?m=>f(xr(e[0],e[s-1],m)):f}function f2(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const o=js(0,t,a);e.push(vt(n,1,o))}}function p2(e){const t=[0];return f2(t,e.length-1),t}function m2(e,t){return e.map(n=>n*t)}function g2(e,t){return e.map(()=>t||Q0).splice(0,e.length-1)}function Ts({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const o=PM(a)?a.map(ak):ak(a),s={done:!1,value:t[0]},c=m2(n&&n.length===t.length?n:p2(t),e),u=h2(c,t,{ease:Array.isArray(o)?o:g2(t,o)});return{calculatedDuration:e,next:h=>(s.value=u(h),s.done=h>=e,s)}}const y2=e=>e!==null;function Du(e,{repeat:t,repeatType:n="loop"},a,o=1){const s=e.filter(y2),u=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!u||a===void 0?s[u]:a}const v2={decay:Af,inertia:Af,tween:Ts,keyframes:Ts,spring:fu};function dw(e){typeof e.type=="string"&&(e.type=v2[e.type])}class qp{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 k2=e=>e/100;class pu extends qp{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!==sn.now()&&this.tick(sn.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;dw(t);const{type:n=Ts,repeat:a=0,repeatDelay:o=0,repeatType:s,velocity:c=0}=t;let{keyframes:u}=t;const h=n||Ts;h!==Ts&&typeof u[0]!="number"&&(this.mixKeyframes=Js(k2,lw(u[0],u[1])),u=[0,100]);const f=h({...t,keyframes:u});s==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Gp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+o,this.totalDuration=this.resolvedDuration*(a+1)-o,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:o,mixKeyframes:s,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:f=0,keyframes:m,repeat:y,repeatType:k,repeatDelay:w,type:x,onUpdate:C,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-f*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?D<0:D>o;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let R=this.currentTime,O=a;if(y){const P=Math.min(this.currentTime,o)/u;let Y=Math.floor(P),X=P%1;!X&&P>=1&&(X=1),X===1&&Y--,Y=Math.min(Y,y+1),Y%2&&(k==="reverse"?(X=1-X,w&&(X-=w/u)):k==="mirror"&&(O=c)),R=xr(0,1,X)*u}let G;L?(this.delayState.value=m[0],G=this.delayState):G=O.next(R),s&&!L&&(G.value=s(G.value));let{done:W}=G;!L&&h!==null&&(W=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&W);return z&&x!==Af&&(G.value=Du(m,this.options,S,this.speed)),C&&C(G.value),z&&this.finish(),G}then(t,n){return this.finished.then(t,n)}get duration(){return On(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(this.currentTime)}set time(t){t=Pn(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 uw(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(sn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=On(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=n2,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),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(sn.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 _2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ii=e=>e*180/Math.PI,Rf=e=>{const t=ii(Math.atan2(e[1],e[0]));return Lf(t)},b2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rf,rotateZ:Rf,skewX:e=>ii(Math.atan(e[1])),skewY:e=>ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Lf=e=>(e=e%360,e<0&&(e+=360),e),dk=Rf,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),w2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:fk,scale:e=>(hk(e)+fk(e))/2,rotateX:e=>Lf(ii(Math.atan2(e[6],e[5]))),rotateY:e=>Lf(ii(Math.atan2(-e[2],e[0]))),rotateZ:dk,rotate:dk,skewX:e=>ii(Math.atan(e[4])),skewY:e=>ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Df(e){return e.includes("scale")?1:0}function Mf(e,t){if(!e||e==="none")return Df(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(n)a=w2,o=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=b2,o=u}if(!o)return Df(t);const s=a[t],c=o[1].split(",").map(P2);return typeof s=="function"?s(c):c[s]}const x2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mf(n,t)};function P2(e){return parseFloat(e.trim())}const bo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set(bo),pk=e=>e===_o||e===_e,S2=new Set(["x","y","z"]),C2=bo.filter(e=>!S2.has(e));function T2(e){const t=[];return C2.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const La={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-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})=>Mf(t,"x"),y:(e,{transform:t})=>Mf(t,"y")};La.translateX=La.x;La.translateY=La.y;const oi=new Set;let If=!1,Nf=!1,Of=!1;function hw(){if(Nf){const e=Array.from(oi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const o=T2(a);o.length&&(n.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=n.get(a);o&&o.forEach(([s,c])=>{a.getValue(s)?.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Nf=!1,If=!1,oi.forEach(e=>e.complete(Of)),oi.clear()}function fw(){oi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Nf=!0)})}function E2(){Of=!0,fw(),hw(),Of=!1}class Yp{constructor(t,n,a,o,s,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=o,this.element=s,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(oi.add(this),If||(If=!0,dt.read(fw),dt.resolveKeyframes(hw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:o}=this;if(t[0]===null){const s=o?.get(),c=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&n){const u=a.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),o&&s===void 0&&o.set(t[0])}_2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),oi.delete(this)}cancel(){this.state==="scheduled"&&(oi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const A2=e=>e.startsWith("--");function pw(e,t,n){A2(t)?e.style.setProperty(t,n):e.style[t]=n}const R2={};function mw(e,t){const n=z0(e);return()=>R2[t]??n()}const L2=mw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),gw=mw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_s=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,mk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_s([0,.65,.55,1]),circOut:_s([.55,0,1,.45]),backIn:_s([.31,.01,.66,-.59]),backOut:_s([.33,1.53,.69,.99])};function yw(e,t){if(e)return typeof e=="function"?gw()?cw(e,t):"ease-out":J0(e)?_s(e):Array.isArray(e)?e.map(n=>yw(n,t)||mk.easeOut):mk[e]}function D2(e,t,n,{delay:a=0,duration:o=300,repeat:s=0,repeatType:c="loop",ease:u="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const y=yw(u,o);Array.isArray(y)&&(m.easing=y);const k={delay:a,duration:o,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:s+1,direction:c==="reverse"?"alternate":"normal"};return f&&(k.pseudoElement=f),e.animate(m,k)}function vw(e){return typeof e=="function"&&"applyToOptions"in e}function M2({type:e,...t}){return vw(e)&&gw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class kw extends qp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:o,pseudoElement:s,allowFlatten:c=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!s,this.allowFlatten=c,this.options=t,Bp(typeof t.type!="string");const f=M2(t);this.animation=D2(n,a,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Du(o,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),pw(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 On(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Pn(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:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&L2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),jn):o(this)}}const _w={anticipate:Y0,backInOut:q0,circInOut:X0};function I2(e){return e in _w}function N2(e){typeof e.ease=="string"&&I2(e.ease)&&(e.ease=_w[e.ease])}const $h=10;class O2 extends kw{constructor(t){N2(t),dw(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:o,element:s,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new pu({...c,autoplay:!1}),h=Math.max($h,sn.now()-this.startTime),f=xr(0,$h,h-$h),m=u.sample(h).value,{name:y}=this.options;s&&y&&pw(s,y,m),n.setWithVelocity(u.sample(Math.max(0,h-f)).value,m,f),u.stop()}}const gk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(or.test(e)||e==="0")&&!e.startsWith("url("));function j2(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 U2(e,t,n,a){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],c=gk(o,t),u=gk(s,t);return!c||!u?!1:j2(e)||(n==="spring"||vw(n))&&a}function jf(e){e.duration=0,e.type="keyframes"}const bw=new Set(["opacity","clipPath","filter","transform"]),B2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function F2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&B2.test(e[t]))return!0;return!1}const V2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),z2=z0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $2(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:o,damping:s,type:c,keyframes:u}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return z2()&&n&&(bw.has(n)||V2.has(n)&&F2(u))&&(n!=="transform"||!m)&&!f&&!a&&o!=="mirror"&&s!==0&&c!=="inertia"}const H2=40;class W2 extends qp{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:o=0,repeatDelay:s=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=sn.now();const k={autoplay:t,delay:n,type:a,repeat:o,repeatDelay:s,repeatType:c,name:h,motionValue:f,element:m,...y},w=m?.KeyframeResolver||Yp;this.keyframeResolver=new w(u,(x,C,S)=>this.onKeyframesResolved(x,C,k,!S),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,o){this.keyframeResolver=void 0;const{name:s,type:c,velocity:u,delay:h,isHandoff:f,onUpdate:m}=a;this.resolvedAt=sn.now();let y=!0;U2(t,s,c,u)||(y=!1,(Ia.instantAnimations||!h)&&m?.(Du(t,a,n)),t[0]=t[t.length-1],jf(a),a.repeat=0);const w={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>H2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},x=y&&!f&&$2(w),C=w.motionValue?.owner?.current;let S;if(x)try{S=new O2({...w,element:C})}catch{S=new pu(w)}else S=new pu(w);S.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}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(),E2()),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 ww(e,t,n,a=0,o=1){const s=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,u=(c-1)*a;return typeof n=="function"?n(s,c):o===1?s*a:u-s*a}const K2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function G2(e){const t=K2.exec(e);if(!t)return[,];const[,n,a,o]=t;return[`--${n??a}`,o]}function xw(e,t,n=1){const[a,o]=G2(e);if(!a)return;const s=window.getComputedStyle(t).getPropertyValue(a);if(s){const c=s.trim();return B0(c)?parseFloat(c):c}return $p(o)?xw(o,t,n+1):o}const q2={type:"spring",stiffness:500,damping:25,restSpeed:10},Y2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Z2={type:"keyframes",duration:.8},X2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q2=(e,{keyframes:t})=>t.length>2?Z2:wo.has(e)?e.startsWith("scale")?Y2(t[1]):q2:X2;function Pw(e,t){if(e?.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function Zp(e,t){const n=e?.[t]??e?.default??e;return n!==e?Pw(n,e):n}const J2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function eI(e){for(const t in e)if(!J2.has(t))return!0;return!1}const Xp=(e,t,n,a={},o,s)=>c=>{const u=Zp(a,e)||{},h=u.delay||a.delay||0;let{elapsed:f=0}=a;f=f-Pn(h);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:k=>{t.set(k),u.onUpdate&&u.onUpdate(k)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:s?void 0:o};eI(u)||Object.assign(m,Q2(e,m)),m.duration&&(m.duration=Pn(m.duration)),m.repeatDelay&&(m.repeatDelay=Pn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let y=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(jf(m),m.delay===0&&(y=!0)),(Ia.instantAnimations||Ia.skipAnimations||o?.shouldSkipAnimations)&&(y=!0,jf(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!s&&t.get()!==void 0){const k=Du(m.keyframes,u);if(k!==void 0){dt.update(()=>{m.onUpdate(k),m.onComplete()});return}}return u.isSync?new pu(m):new W2(m)};function yk(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Qp(e,t,n,a){if(typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}return t}function si(e,t,n){const a=e.getProps();return Qp(a,t,n!==void 0?n:a.custom,e)}const Sw=new Set(["width","height","top","left","right","bottom",...bo]),vk=30,tI=e=>!isNaN(parseFloat(e)),kk={current:void 0};class nI{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=sn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=tI(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 Fp);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 kk.current&&kk.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vk);return $0(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 yo(e,t){return new nI(e,t)}const Uf=e=>Array.isArray(e);function rI(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,yo(n))}function aI(e){return Uf(e)?e[e.length-1]||0:e}function iI(e,t){const n=si(e,t);let{transitionEnd:a={},transition:o={},...s}=n||{};s={...s,...a};for(const c in s){const u=aI(s[c]);rI(e,c,u)}}const Gt=e=>!!(e&&e.getVelocity);function oI(e){return!!(Gt(e)&&e.add)}function Bf(e,t){const n=e.getValue("willChange");if(oI(n))return n.add(t);if(!n&&Ia.WillChange){const a=new Ia.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Jp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const sI="framerAppearId",Cw="data-"+Jp(sI);function Tw(e){return e.props[Cw]}function lI({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Ew(e,t,{delay:n=0,transitionOverride:a,type:o}={}){let{transition:s,transitionEnd:c,...u}=t;const h=e.getDefaultTransition();s=s?Pw(s,h):h;const f=s?.reduceMotion;a&&(s=a);const m=[],y=o&&e.animationState&&e.animationState.getState()[o];for(const k in u){const w=e.getValue(k,e.latestValues[k]??null),x=u[k];if(x===void 0||y&&lI(y,k))continue;const C={delay:n,...Zp(s||{},k)},S=w.get();if(S!==void 0&&!w.isAnimating()&&!Array.isArray(x)&&x===S&&!C.velocity){dt.update(()=>w.set(x));continue}let D=!1;if(window.MotionHandoffAnimation){const O=Tw(e);if(O){const G=window.MotionHandoffAnimation(O,k,dt);G!==null&&(C.startTime=G,D=!0)}}Bf(e,k);const L=f??e.shouldReduceMotion;w.start(Xp(k,w,x,L&&Sw.has(k)?{type:!1}:C,e,D));const R=w.animation;R&&m.push(R)}if(c){const k=()=>dt.update(()=>{c&&iI(e,c)});m.length?Promise.all(m).then(k):k()}return m}function Ff(e,t,n={}){const a=si(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const s=a?()=>Promise.all(Ew(e,a,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:y}=o;return cI(e,t,h,f,m,y,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[h,f]=u==="beforeChildren"?[s,c]:[c,s];return h().then(()=>f())}else return Promise.all([s(),c(n.delay)])}function cI(e,t,n=0,a=0,o=0,s=1,c){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(Ff(h,t,{...c,delay:n+(typeof a=="function"?0:a)+ww(e.variantChildren,h,a,o,s)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function uI(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(s=>Ff(e,s,n));a=Promise.all(o)}else if(typeof t=="string")a=Ff(e,t,n);else{const o=typeof t=="function"?si(e,t,n.custom):t;a=Promise.all(Ew(e,o,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const dI={test:e=>e==="auto",parse:e=>e},Aw=e=>t=>t.test(e),Rw=[_o,_e,vr,Sa,jM,OM,dI],_k=e=>Rw.find(Aw(e));function hI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||V0(e):!0}const fI=new Set(["brightness","contrast","saturate","opacity"]);function pI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(Hp)||[];if(!a)return e;const o=n.replace(a,"");let s=fI.has(t)?1:0;return a!==n&&(s*=100),t+"("+s+o+")"}const mI=/\b([a-z-]*)\(.*?\)/gu,Vf={...or,getAnimatableNone:e=>{const t=e.match(mI);return t?t.map(pI).join(" "):e}},zf={...or,getAnimatableNone:e=>{const t=or.parse(e);return or.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bk={..._o,transform:Math.round},gI={rotate:Sa,rotateX:Sa,rotateY:Sa,rotateZ:Sa,scale:kc,scaleX:kc,scaleY:kc,scaleZ:kc,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:Us,originX:ok,originY:ok,originZ:_e},em={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,...gI,zIndex:bk,fillOpacity:Us,strokeOpacity:Us,numOctaves:bk},yI={...em,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Vf,WebkitFilter:Vf,mask:zf,WebkitMask:zf},Lw=e=>yI[e],vI=new Set([Vf,zf]);function Dw(e,t){let n=Lw(e);return vI.has(n)||(n=or),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kI=new Set(["auto","none","0"]);function _I(e,t,n){let a=0,o;for(;a<e.length&&!o;){const s=e[a];typeof s=="string"&&!kI.has(s)&&go(s).values.length&&(o=e[a]),a++}if(o&&n)for(const s of t)e[s]=Dw(n,o)}class bI extends Yp{constructor(t,n,a,o,s){super(t,n,a,o,s,!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(),$p(y))){const k=xw(y,n.current);k!==void 0&&(t[m]=k),m===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!Sw.has(a)||t.length!==2)return;const[o,s]=t,c=_k(o),u=_k(s),h=ik(o),f=ik(s);if(h!==f&&La[a]){this.needsMeasurement=!0;return}if(c!==u)if(pk(c)&&pk(u))for(let m=0;m<t.length;m++){const y=t[m];typeof y=="string"&&(t[m]=parseFloat(y))}else La[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let o=0;o<t.length;o++)(t[o]===null||hI(t[o]))&&a.push(o);a.length&&_I(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=La[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=a.length-1,c=a[s];a[s]=La[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 Mw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=n?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const Iw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uc(e){return F0(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:tm}=ew(queueMicrotask,!1),nr={x:!1,y:!1};function Nw(){return nr.x||nr.y}function wI(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 Ow(e,t){const n=Mw(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[n,o,()=>a.abort()]}function xI(e){return!(e.pointerType==="touch"||Nw())}function PI(e,t,n={}){const[a,o,s]=Ow(e,n);return a.forEach(c=>{let u=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",x)},y=S=>{f&&(f(S),f=void 0),m()},k=S=>{u=!1,window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),h&&(h=!1,y(S))},w=()=>{u=!0,window.addEventListener("pointerup",k,o),window.addEventListener("pointercancel",k,o)},x=S=>{if(S.pointerType!=="touch"){if(u){h=!0;return}y(S)}},C=S=>{if(!xI(S))return;h=!1;const D=t(c,S);typeof D=="function"&&(f=D,c.addEventListener("pointerleave",x,o))};c.addEventListener("pointerenter",C,o),c.addEventListener("pointerdown",w,o)}),s}const jw=(e,t)=>t?e===t?!0:jw(e,t.parentElement):!1,nm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,SI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CI(e){return SI.has(e.tagName)||e.isContentEditable===!0}const TI=new Set(["INPUT","SELECT","TEXTAREA"]);function EI(e){return TI.has(e.tagName)||e.isContentEditable===!0}const Bc=new WeakSet;function wk(e){return t=>{t.key==="Enter"&&e(t)}}function Hh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AI=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=wk(()=>{if(Bc.has(n))return;Hh(n,"down");const o=wk(()=>{Hh(n,"up")}),s=()=>Hh(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function xk(e){return nm(e)&&!Nw()}const Pk=new WeakSet;function RI(e,t,n={}){const[a,o,s]=Ow(e,n),c=u=>{const h=u.currentTarget;if(!xk(u)||Pk.has(u))return;Bc.add(h),n.stopPropagation&&Pk.add(u);const f=t(h,u),m=(w,x)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",k),Bc.has(h)&&Bc.delete(h),xk(w)&&typeof f=="function"&&f(w,{success:x})},y=w=>{m(w,h===window||h===document||n.useGlobalTarget||jw(h,w.target))},k=w=>{m(w,!1)};window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",k,o)};return a.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,o),Uc(u)&&(u.addEventListener("focus",f=>AI(f,o)),!CI(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),s}function rm(e){return F0(e)&&"ownerSVGElement"in e}const Fc=new WeakMap;let Vc;const Uw=(e,t,n)=>(a,o)=>o&&o[0]?o[0][e+"Size"]:rm(a)&&"getBBox"in a?a.getBBox()[t]:a[n],LI=Uw("inline","width","offsetWidth"),DI=Uw("block","height","offsetHeight");function MI({target:e,borderBoxSize:t}){Fc.get(e)?.forEach(n=>{n(e,{get width(){return LI(e,t)},get height(){return DI(e,t)}})})}function II(e){e.forEach(MI)}function NI(){typeof ResizeObserver>"u"||(Vc=new ResizeObserver(II))}function OI(e,t){Vc||NI();const n=Mw(e);return n.forEach(a=>{let o=Fc.get(a);o||(o=new Set,Fc.set(a,o)),o.add(t),Vc?.observe(a)}),()=>{n.forEach(a=>{const o=Fc.get(a);o?.delete(t),o?.size||Vc?.unobserve(a)})}}const zc=new Set;let io;function jI(){io=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};zc.forEach(t=>t(e))},window.addEventListener("resize",io)}function UI(e){return zc.add(e),io||jI(),()=>{zc.delete(e),!zc.size&&typeof io=="function"&&(window.removeEventListener("resize",io),io=void 0)}}function Sk(e,t){return typeof e=="function"?UI(e):OI(e,t)}function BI(e){return rm(e)&&e.tagName==="svg"}const FI=[...Rw,Lt,or],VI=e=>FI.find(Aw(e)),Ck=()=>({translate:0,scale:1,origin:0,originPoint:0}),oo=()=>({x:Ck(),y:Ck()}),Tk=()=>({min:0,max:0}),Ot=()=>({x:Tk(),y:Tk()}),zI=new WeakMap;function Mu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Bs(e){return typeof e=="string"||Array.isArray(e)}const am=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],im=["initial",...am];function Iu(e){return Mu(e.animate)||im.some(t=>Bs(e[t]))}function Bw(e){return!!(Iu(e)||e.variants)}function $I(e,t,n){for(const a in t){const o=t[a],s=n[a];if(Gt(o))e.addValue(a,o);else if(Gt(s))e.addValue(a,yo(o,{owner:e}));else if(s!==o)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(a);e.addValue(a,yo(c!==void 0?c:o,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const $f={current:null},Fw={current:!1},HI=typeof window<"u";function WI(){if(Fw.current=!0,!!HI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$f.current=e.matches;e.addEventListener("change",t),t()}else $f.current=!1}const Ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mu={};function Vw(e){mu=e}function KI(){return mu}class GI{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:o,skipAnimations:s,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=Yp,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=sn.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=o,this.skipAnimationsConfig=s,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=Iu(n),this.isVariantNode=Bw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...k}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in k){const x=k[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,zI.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:(Fw.current||WI(),this.shouldReduceMotion=$f.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 kw({element:this.current,name:t,keyframes:u,times:h,ease:f,duration:Pn(m)}),k=c(y);this.valueSubscriptions.set(t,()=>{k(),y.cancel()});return}const a=wo.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=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 s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 mu){const n=mu[t];if(!n)continue;const{isEnabled:a,Feature:o}=n;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ot()}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<Ek.length;a++){const o=Ek[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,c=t[s];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=$I(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=yo(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"&&(B0(a)||V0(a))?a=parseFloat(a):!VI(a)&&or.test(n)&&(a=Dw(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 s=Qp(this.props,n,this.presenceContext?.custom);s&&(a=s[t])}if(n&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Gt(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Fp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){tm.render(this.render)}}class zw extends GI{constructor(){super(...arguments),this.KeyframeResolver=bI}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 ja{constructor(t){this.isMounted=!1,this.node=t}update(){}}function $w({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function qI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YI(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 Wh(e){return e===void 0||e===1}function Hf({scale:e,scaleX:t,scaleY:n}){return!Wh(e)||!Wh(t)||!Wh(n)}function ti(e){return Hf(e)||Hw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hw(e){return Ak(e.x)||Ak(e.y)}function Ak(e){return e&&e!=="0%"}function gu(e,t,n){const a=e-n,o=t*a;return n+o}function Rk(e,t,n,a,o){return o!==void 0&&(e=gu(e,o,a)),gu(e,n,a)+t}function Wf(e,t=0,n=1,a,o){e.min=Rk(e.min,t,n,a,o),e.max=Rk(e.max,t,n,a,o)}function Ww(e,{x:t,y:n}){Wf(e.x,t.translate,t.scale,t.originPoint),Wf(e.y,n.translate,n.scale,n.originPoint)}const Lk=.999999999999,Dk=1.0000000000001;function ZI(e,t,n,a=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,c;for(let u=0;u<o;u++){s=n[u],c=s.projectionDelta;const{visualElement:h}=s.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(mr(e.x,-s.scroll.offset.x),mr(e.y,-s.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Ww(e,c)),a&&ti(s.latestValues)&&$c(e,s.latestValues,s.layout?.layoutBox))}t.x<Dk&&t.x>Lk&&(t.x=1),t.y<Dk&&t.y>Lk&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function Mk(e,t,n,a,o=.5){const s=vt(e.min,e.max,o);Wf(e,t,n,s,a)}function Ik(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function $c(e,t,n){const a=n??e;Mk(e.x,Ik(t.x,a.x),t.scaleX,t.scale,t.originX),Mk(e.y,Ik(t.y,a.y),t.scaleY,t.scale,t.originY)}function Kw(e,t){return $w(YI(e.getBoundingClientRect(),t))}function XI(e,t,n){const a=Kw(e,n),{scroll:o}=t;return o&&(mr(a.x,o.offset.x),mr(a.y,o.offset.y)),a}const QI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JI=bo.length;function eN(e,t,n){let a="",o=!0;for(let s=0;s<JI;s++){const c=bo[s],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=Iw(u,em[c]);if(!h){o=!1;const m=QI[c]||c;a+=`${m}(${f}) `}n&&(t[c]=f)}}return a=a.trim(),n?a=n(t,o?"":a):o&&(a="none"),a}function om(e,t,n){const{style:a,vars:o,transformOrigin:s}=e;let c=!1,u=!1;for(const h in t){const f=t[h];if(wo.has(h)){c=!0;continue}else if(nw(h)){o[h]=f;continue}else{const m=Iw(f,em[h]);h.startsWith("origin")?(u=!0,s[h]=m):a[h]=m}}if(t.transform||(c||n?a.transform=eN(t,e.transform,n):a.transform&&(a.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:m=0}=s;a.transformOrigin=`${h} ${f} ${m}`}}function Gw(e,{style:t,vars:n},a,o){const s=e.style;let c;for(c in t)s[c]=t[c];o?.applyProjectionStyles(s,a);for(c in n)s.setProperty(c,n[c])}function Nk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ps={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Nk(e,t.target.x),a=Nk(e,t.target.y);return`${n}% ${a}%`}},tN={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,o=or.parse(e);if(o.length>5)return a;const s=or.createTransformer(e),c=typeof o[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;o[0+c]/=u,o[1+c]/=h;const f=vt(u,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f),s(o)}},Kf={borderRadius:{...ps,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ps,borderTopRightRadius:ps,borderBottomLeftRadius:ps,borderBottomRightRadius:ps,boxShadow:tN};function qw(e,{layout:t,layoutId:n}){return wo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kf[e]||e==="opacity")}function sm(e,t,n){const a=e.style,o=t?.style,s={};if(!a)return s;for(const c in a)(Gt(a[c])||o&&Gt(o[c])||qw(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(s[c]=a[c]);return s}function nN(e){return window.getComputedStyle(e)}class rN extends zw{constructor(){super(...arguments),this.type="html",this.renderInstance=Gw}readValueFromInstance(t,n){if(wo.has(n))return this.projection?.isProjecting?Df(n):x2(t,n);{const a=nN(t),o=(nw(n)?a.getPropertyValue(n):a[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Kw(t,n)}build(t,n,a){om(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return sm(t,n,a)}}const aN={offset:"stroke-dashoffset",array:"stroke-dasharray"},iN={offset:"strokeDashoffset",array:"strokeDasharray"};function oN(e,t,n=1,a=0,o=!0){e.pathLength=1;const s=o?aN:iN;e[s.offset]=`${-a}`,e[s.array]=`${t} ${n}`}const sN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Yw(e,{attrX:t,attrY:n,attrScale:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...u},h,f,m){if(om(e,u,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:k}=e;y.transform&&(k.transform=y.transform,delete y.transform),(k.transform||y.transformOrigin)&&(k.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),k.transform&&(k.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const w of sN)y[w]!==void 0&&(k[w]=y[w],delete y[w]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),o!==void 0&&oN(y,o,s,c,!1)}const Zw=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"]),Xw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lN(e,t,n,a){Gw(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(Zw.has(o)?o:Jp(o),t.attrs[o])}function Qw(e,t,n){const a=sm(e,t,n);for(const o in e)if(Gt(e[o])||Gt(t[o])){const s=bo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[s]=e[o]}return a}class cN extends zw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wo.has(n)){const a=Lw(n);return a&&a.default||0}return n=Zw.has(n)?n:Jp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Qw(t,n,a)}build(t,n,a){Yw(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,o){lN(t,n,a,o)}mount(t){this.isSVGTag=Xw(t.tagName),super.mount(t)}}const uN=im.length;function Jw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Jw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<uN;n++){const a=im[n],o=e.props[a];(Bs(o)||o===!1)&&(t[a]=o)}return t}function ex(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 dN=[...am].reverse(),hN=am.length;function fN(e){return t=>Promise.all(t.map(({animation:n,options:a})=>uI(e,n,a)))}function pN(e){let t=fN(e),n=Ok(),a=!0,o=!1;const s=f=>(m,y)=>{const k=si(e,y,f==="exit"?e.presenceContext?.custom:void 0);if(k){const{transition:w,transitionEnd:x,...C}=k;m={...m,...C,...x}}return m};function c(f){t=f(e)}function u(f){const{props:m}=e,y=Jw(e.parent)||{},k=[],w=new Set;let x={},C=1/0;for(let D=0;D<hN;D++){const L=dN[D],R=n[L],O=m[L]!==void 0?m[L]:y[L],G=Bs(O),W=L===f?R.isActive:null;W===!1&&(C=D);let z=O===y[L]&&O!==m[L]&&G;if(z&&(a||o)&&e.manuallyAnimateOnMount&&(z=!1),R.protectedKeys={...x},!R.isActive&&W===null||!O&&!R.prevProp||Mu(O)||typeof O=="boolean")continue;if(L==="exit"&&R.isActive&&W!==!0){R.prevResolvedValues&&(x={...x,...R.prevResolvedValues});continue}const P=mN(R.prevProp,O);let Y=P||L===f&&R.isActive&&!z&&G||D>C&&G,X=!1;const ue=Array.isArray(O)?O:[O];let se=ue.reduce(s(L),{});W===!1&&(se={});const{prevResolvedValues:Ae={}}=R,fe={...Ae,...se},le=K=>{Y=!0,w.has(K)&&(X=!0,w.delete(K)),R.needsAnimating[K]=!0;const Z=e.getValue(K);Z&&(Z.liveStyle=!1)};for(const K in fe){const Z=se[K],H=Ae[K];if(x.hasOwnProperty(K))continue;let I=!1;Uf(Z)&&Uf(H)?I=!ex(Z,H):I=Z!==H,I?Z!=null?le(K):w.add(K):Z!==void 0&&w.has(K)?le(K):R.protectedKeys[K]=!0}R.prevProp=O,R.prevResolvedValues=se,R.isActive&&(x={...x,...se}),(a||o)&&e.blockInitialAnimation&&(Y=!1);const pe=z&&P;Y&&(!pe||X)&&k.push(...ue.map(K=>{const Z={type:L};if(typeof K=="string"&&(a||o)&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,I=si(H,K);if(H.enteringChildren&&I){const{delayChildren:q}=I.transition||{};Z.delay=ww(H.enteringChildren,e,q)}}return{animation:K,options:Z}}))}if(w.size){const D={};if(typeof m.initial!="boolean"){const L=si(e,Array.isArray(m.initial)?m.initial[0]:m.initial);L&&L.transition&&(D.transition=L.transition)}w.forEach(L=>{const R=e.getBaseTarget(L),O=e.getValue(L);O&&(O.liveStyle=!0),D[L]=R??null}),k.push({animation:D})}let S=!!k.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),a=!1,o=!1,S?t(k):Promise.resolve()}function h(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(k=>k.animationState?.setActive(f,m)),n[f].isActive=m;const y=u(f);for(const k in n)n[k].protectedKeys={};return y}return{animateChanges:u,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Ok(),o=!0}}}function mN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ex(t,e):!1}function Ja(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ok(){return{animate:Ja(!0),whileInView:Ja(),whileHover:Ja(),whileTap:Ja(),whileDrag:Ja(),whileFocus:Ja(),exit:Ja()}}function Gf(e,t){e.min=t.min,e.max=t.max}function tr(e,t){Gf(e.x,t.x),Gf(e.y,t.y)}function jk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const tx=1e-4,gN=1-tx,yN=1+tx,nx=.01,vN=0-nx,kN=0+nx;function ln(e){return e.max-e.min}function _N(e,t,n){return Math.abs(e-t)<=n}function Uk(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>=gN&&e.scale<=yN||isNaN(e.scale))&&(e.scale=1),(e.translate>=vN&&e.translate<=kN||isNaN(e.translate))&&(e.translate=0)}function Es(e,t,n,a){Uk(e.x,t.x,n.x,a?a.originX:void 0),Uk(e.y,t.y,n.y,a?a.originY:void 0)}function Bk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=o+t.min,e.max=e.min+ln(t)}function bN(e,t,n,a){Bk(e.x,t.x,n.x,a?.x),Bk(e.y,t.y,n.y,a?.y)}function Fk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=t.min-o,e.max=e.min+ln(t)}function yu(e,t,n,a){Fk(e.x,t.x,n.x,a?.x),Fk(e.y,t.y,n.y,a?.y)}function Vk(e,t,n,a,o){return e-=t,e=gu(e,1/n,a),o!==void 0&&(e=gu(e,1/o,a)),e}function wN(e,t=0,n=1,a=.5,o,s=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(s.min,s.max,a);e===s&&(u-=t),e.min=Vk(e.min,t,n,u,o),e.max=Vk(e.max,t,n,u,o)}function zk(e,t,[n,a,o],s,c){wN(e,t[n],t[a],t[o],t.scale,s,c)}const xN=["x","scaleX","originX"],PN=["y","scaleY","originY"];function $k(e,t,n,a){zk(e.x,t,xN,n?n.x:void 0,a?a.x:void 0),zk(e.y,t,PN,n?n.y:void 0,a?a.y:void 0)}function Hk(e){return e.translate===0&&e.scale===1}function rx(e){return Hk(e.x)&&Hk(e.y)}function Wk(e,t){return e.min===t.min&&e.max===t.max}function SN(e,t){return Wk(e.x,t.x)&&Wk(e.y,t.y)}function Kk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ax(e,t){return Kk(e.x,t.x)&&Kk(e.y,t.y)}function Gk(e){return ln(e.x)/ln(e.y)}function qk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pr(e){return[e("x"),e("y")]}function CN(e,t,n){let a="";const o=e.x.translate/t.x,s=e.y.translate/t.y,c=n?.z||0;if((o||s||c)&&(a=`translate3d(${o}px, ${s}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:k,skewX:w,skewY:x}=n;f&&(a=`perspective(${f}px) ${a}`),m&&(a+=`rotate(${m}deg) `),y&&(a+=`rotateX(${y}deg) `),k&&(a+=`rotateY(${k}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 ix=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],TN=ix.length,Yk=e=>typeof e=="string"?parseFloat(e):e,Zk=e=>typeof e=="number"||_e.test(e);function EN(e,t,n,a,o,s){o?(e.opacity=vt(0,n.opacity??1,AN(a)),e.opacityExit=vt(t.opacity??1,0,RN(a))):s&&(e.opacity=vt(t.opacity??1,n.opacity??1,a));for(let c=0;c<TN;c++){const u=ix[c];let h=Xk(t,u),f=Xk(n,u);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||Zk(h)===Zk(f)?(e[u]=Math.max(vt(Yk(h),Yk(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 Xk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const AN=ox(0,.5,Z0),RN=ox(.5,.95,jn);function ox(e,t,n){return a=>a<e?0:a>t?1:n(js(e,t,a))}function LN(e,t,n){const a=Gt(e)?e:yo(e);return a.start(Xp("",a,t,n)),a.animation}function Fs(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const DN=(e,t)=>e.depth-t.depth;class MN{constructor(){this.children=[],this.isDirty=!1}add(t){Up(this.children,t),this.isDirty=!0}remove(t){uu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(DN),this.isDirty=!1,this.children.forEach(t)}}function IN(e,t){const n=sn.now(),a=({timestamp:o})=>{const s=o-n;s>=t&&(Na(a),e(s-t))};return dt.setup(a,!0),()=>Na(a)}function Hc(e){return Gt(e)?e.get():e}class NN{constructor(){this.members=[]}add(t){Up(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 o=a.instance;(!o||o.isConnected===!1)&&!a.snapshot&&(uu(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(uu(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:o}=a.options,{layoutDependency:s}=t.options;(o===void 0||o!==s)&&(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 Wc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kh=["","X","Y","Z"],ON=1e3;let jN=0;function Gh(e,t,n,a){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function sx(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Tw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(o||s))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&sx(a)}function lx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(c={},u=t?.()){this.id=jN++,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(FN),this.nodes.forEach(KN),this.nodes.forEach(GN),this.nodes.forEach(VN)},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 MN)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Fp),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=rm(c)&&!BI(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 k=()=>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=IN(k,250),Wc.hasAnimatedSinceResize&&(Wc.hasAnimatedSinceResize=!1,this.nodes.forEach(e_)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:k,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||QN,{onLayoutAnimationStart:C,onLayoutAnimationComplete:S}=f.getProps(),D=!this.targetLayout||!ax(this.targetLayout,w),L=!y&&k;if(this.options.layoutRoot||this.resumeFrom||L||y&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Zp(x,"layout"),onPlay:C,onComplete:S};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(m,L)}else y||e_(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(qN),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&&sx(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($N),this.nodes.forEach(Qk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Jk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(HN),this.nodes.forEach(WN),this.nodes.forEach(UN),this.nodes.forEach(BN)):this.nodes.forEach(Jk),this.clearAllSnapshots();const u=sn.now();Kt.delta=xr(0,1e3/60,u-Kt.timestamp),Kt.timestamp=u,Kt.isProcessing=!0,Uh.update.process(Kt),Uh.preRender.process(Kt),Uh.render.process(Kt),Kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zN),this.sharedNodes.forEach(YN)}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=Ot()),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(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!rx(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(u||ti(this.latestValues)||m)&&(o(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)),JN(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Ot();const u=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(eO))){const{scroll:f}=this.root;f&&(mr(u.x,f.offset.x),mr(u.y,f.offset.y))}return u}removeElementScroll(c){const u=Ot();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||Ot();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)),ti(y.latestValues)&&$c(f,y.latestValues,y.layout?.layoutBox)}return ti(this.latestValues)&&$c(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const u=Ot();tr(u,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!ti(f.latestValues))continue;let m;f.instance&&(Hf(f.latestValues)&&f.updateSnapshot(),m=Ot(),tr(m,f.measurePageBox())),$k(u,f.latestValues,f.snapshot?.layoutBox,m)}return ti(this.latestValues)&&$k(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 k=this.getClosestProjectingParent();k&&this.linkedParentVersion!==k.layoutVersion&&!k.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&k&&k.layout?this.createRelativeTarget(k,this.layout.layoutBox,k.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bN(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),Ww(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&k&&!!k.resumingFrom==!!this.resumingFrom&&!k.options.layoutScroll&&k.target&&this.animationProgress!==1?this.createRelativeTarget(k,this.target,k.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hf(this.parent.latestValues)||Hw(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=Ot(),this.relativeTargetOrigin=Ot(),yu(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,k=this.treeScale.y;ZI(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=Ot());const{target:w}=c;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jk(this.prevProjectionDelta.x,this.projectionDelta.x),jk(this.prevProjectionDelta.y,this.projectionDelta.y)),Es(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==k||!qk(this.projectionDelta.x,this.prevProjectionDelta.x)||!qk(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=oo(),this.projectionDelta=oo(),this.projectionDeltaWithTransform=oo()}setAnimationOrigin(c,u=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},y=oo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const k=Ot(),w=h?h.source:void 0,x=this.layout?this.layout.source:void 0,C=w!==x,S=this.getStack(),D=!S||S.members.length<=1,L=!!(C&&!D&&this.options.crossfade===!0&&!this.path.some(XN));this.animationProgress=0;let R;this.mixTargetDelta=O=>{const G=O/1e3;t_(y.x,c.x,G),t_(y.y,c.y,G),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yu(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ZN(this.relativeTarget,this.relativeTargetOrigin,k,G),R&&SN(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Ot()),tr(R,this.relativeTarget)),C&&(this.animationValues=m,EN(m,f,this.latestValues,G,L,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(()=>{Wc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yo(0)),this.motionValue.jump(0,!1),this.currentAnimation=LN(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(ON),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&&cx(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||Ot();const y=ln(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const k=ln(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+k}tr(u,h),$c(u,m),Es(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new NN),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&&Gh("z",c,f,this.animationValues);for(let m=0;m<Kh.length;m++)Gh(`rotate${Kh[m]}`,c,f,this.animationValues),Gh(`skew${Kh[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=Hc(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=Hc(u?.pointerEvents)||""),this.hasProjected&&!ti(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let y=CN(this.projectionDeltaWithTransform,this.treeScale,m);h&&(y=h(m,y)),c.transform=y;const{x:k,y:w}=this.projectionDelta;c.transformOrigin=`${k.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 Kf){if(m[x]===void 0)continue;const{correct:C,applyTo:S,isCSSVariable:D}=Kf[x],L=y==="none"?m[x]:C(m[x],f);if(S){const R=S.length;for(let O=0;O<R;O++)c[S[O]]=L}else D?this.options.visualElement.renderState.vars[x]=L:c[x]=L}this.options.layoutId&&(c.pointerEvents=f===this?Hc(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Qk),this.root.sharedNodes.clear()}}}function UN(e){e.updateLayout()}function BN(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:o}=e.options,s=t.source!==e.layout.source;if(o==="size")pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(y);y.min=n[m].min,y.max=y.min+k});else if(o==="x"||o==="y"){const m=o==="x"?"y":"x";Gf(s?t.measuredBox[m]:t.layoutBox[m],n[m])}else cx(o,t.layoutBox,n)&&pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(n[m]);y.max=y.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+k)});const c=oo();Es(c,n,t.layoutBox);const u=oo();s?Es(u,e.applyTransform(a,!0),t.measuredBox):Es(u,n,t.layoutBox);const h=!rx(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:k}=m;if(y&&k){const w=e.options.layoutAnchor||void 0,x=Ot();yu(x,t.layoutBox,y.layoutBox,w);const C=Ot();yu(C,n,k.layoutBox,w),ax(x,C)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=C,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 FN(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 VN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zN(e){e.clearSnapshot()}function Qk(e){e.clearMeasurements()}function $N(e){e.isLayoutDirty=!0,e.updateLayout()}function Jk(e){e.isLayoutDirty=!1}function HN(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function e_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KN(e){e.resolveTargetDelta()}function GN(e){e.calcProjection()}function qN(e){e.resetSkewAndRotation()}function YN(e){e.removeLeadSnapshot()}function t_(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 n_(e,t,n,a){e.min=vt(t.min,n.min,a),e.max=vt(t.max,n.max,a)}function ZN(e,t,n,a){n_(e.x,t.x,n.x,a),n_(e.y,t.y,n.y,a)}function XN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const QN={duration:.45,ease:[.4,0,.1,1]},r_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),a_=r_("applewebkit/")&&!r_("chrome/")?Math.round:jn;function i_(e){e.min=a_(e.min),e.max=a_(e.max)}function JN(e){i_(e.x),i_(e.y)}function cx(e,t,n){return e==="position"||e==="preserve-aspect"&&!_N(Gk(t),Gk(n),.2)}function eO(e){return e!==e.root&&e.scroll?.wasRoot}const tO=lx({attachResizeListener:(e,t)=>Fs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qh={current:void 0},ux=lx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qh.current){const e=new tO({});e.mount(window),e.setOptions({layoutScroll:!0}),qh.current=e}return qh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function o_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nO(...e){return t=>{let n=!1;const a=e.map(o=>{const s=o_(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<a.length;o++){const s=a[o];typeof s=="function"?s():o_(e[o],null)}}}}function rO(...e){return b.useCallback(nO(...e),e)}class aO extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Uc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,o=Uc(a)&&a.offsetWidth||0,s=Uc(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=o-u.width-u.left,u.bottom=s-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function iO({children:e,isPresent:t,anchorX:n,anchorY:a,root:o,pop:s}){const c=b.useId(),u=b.useRef(null),h=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=b.useContext(lm),m=e.props?.ref??e?.ref,y=rO(u,m);return b.useInsertionEffect(()=>{const{width:k,height:w,top:x,left:C,right:S,bottom:D}=h.current;if(t||s===!1||!u.current||!k||!w)return;const L=n==="left"?`left: ${C}`:`right: ${S}`,R=a==="bottom"?`bottom: ${D}`:`top: ${x}`;u.current.dataset.motionPopId=c;const O=document.createElement("style");f&&(O.nonce=f);const G=o??document.head;return G.appendChild(O),O.sheet&&O.sheet.insertRule(`
835
+ leaderboard.profile.like.aria_like,dashboard,LeaderboardProfileModal,LikeButton,aria_like,"Like profile",,active
836
+ leaderboard.profile.like.aria_unlike,dashboard,LeaderboardProfileModal,LikeButton,aria_unlike,"Unlike profile",,active
837
+ `,ML={"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":"检查更新","settings.footer.statusPage":"系统状态","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":"尚未刷新"},IL={"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":"💤 养精蓄锐。在不写代码的日子里,灵感也在悄悄生长。","ipcheck.page.title":"Claude IP 检测","ipcheck.page.subtitle":"查看当前访问 Claude 的出口 IP、纯净度、地理与风险信号,识别可能影响登录或触发风控的因素。","ipcheck.mask.toggle":"隐藏 IP","ipcheck.ipv6.warn":"当前为 IPv6 环境,不建议用 IPv6 访问 Claude Code,部分检测结果可能不完整。","ipcheck.ip.cn":"中国出口 IPv4","ipcheck.ip.cloudflare":"Cloudflare 出口","ipcheck.ip.claude":"Claude 出口","ipcheck.ip.failed":"获取失败","ipcheck.ip.loading":"加载中...","ipcheck.trust.title":"信任评分","ipcheck.trust.subtitle":"Claude 风控视角下的 IP 纯净度","ipcheck.trust.no_data":"无数据","ipcheck.trust.no_ip":"未获取到 Claude 出口 IP,无法评分","ipcheck.trust.no_score":"该 IP 暂无评分数据","ipcheck.trust.gauge.low":"0 高危","ipcheck.trust.gauge.high":"100 可信","ipcheck.trust.label.pristine":"极度纯净","ipcheck.trust.label.clean":"纯净","ipcheck.trust.label.good":"良好","ipcheck.trust.label.neutral":"中性","ipcheck.trust.label.suspicious":"可疑","ipcheck.trust.label.unreachable":"不可访问","ipcheck.trust.text.excellent":"该 IP 信誉极好","ipcheck.trust.text.great":"该 IP 信誉优异","ipcheck.trust.text.minor":"该 IP 存在轻微风险","ipcheck.trust.text.moderate":"该 IP 存在一定风险","ipcheck.trust.text.severe":"该 IP 风险极高","ipcheck.trust.text.restricted":"处于不可访问区域,Claude 会严格风控","ipcheck.trust.region_warn.title":"Claude 出口 IP 位于 {{region}}","ipcheck.trust.region_warn.body":"不建议登录 Claude,容易触发封号风控。","ipcheck.trust.region_support":"Claude 支持地区","ipcheck.trust.region.accessible":"可访问","ipcheck.common.unknown":"未知","ipcheck.props.title":"IP 属性","ipcheck.props.region":"地区","ipcheck.props.city":"城市","ipcheck.props.type":"类型","ipcheck.props.asn":"ASN","ipcheck.props.org":"运营商","ipcheck.props.residential":"家庭住宅","ipcheck.props.datacenter":"机房","ipcheck.security.title":"安全检测","ipcheck.security.vpn":"VPN","ipcheck.security.proxy":"代理 (Proxy)","ipcheck.security.tor":"Tor","ipcheck.security.crawler":"机器人 (Crawler)","ipcheck.security.abuser":"滥用记录","ipcheck.security.proxy_flag":"代理","ipcheck.security.crawler_yes":"是","ipcheck.security.crawler_no":"否","ipcheck.security.abuser_yes":"有记录","ipcheck.security.abuser_no":"无记录","ipcheck.security.clean":"未检测到","ipcheck.avail.title":"Claude 可用性","ipcheck.avail.tooltip":"Claude 服务器在美国,从亚洲访问延迟超过 100ms 属于正常情况。","ipcheck.avail.refresh":"刷新","ipcheck.avail.svc_row":"服务状态","ipcheck.avail.latency.normal":"正常","ipcheck.avail.latency.good":"良好","ipcheck.avail.latency.slow":"较慢","ipcheck.avail.latency.unreachable":"不可访问","ipcheck.avail.svc.none":"全部正常","ipcheck.avail.svc.minor":"轻微故障","ipcheck.avail.svc.major":"重大故障","ipcheck.avail.svc.critical":"严重故障","ipcheck.avail.svc.maintenance":"维护中","ipcheck.avail.svc.other":"服务异常","ipcheck.dns.title":"DNS 泄露检测","ipcheck.dns.status":"状态","ipcheck.dns.outlet":"DNS 出口","ipcheck.dns.outlet_ip":"DNS 出口 IP","ipcheck.dns.isp":"服务商","ipcheck.dns.leaked":"可能泄露","ipcheck.dns.no_leak":"未检测到泄露","ipcheck.dns.encrypted":"DNS 加密或未暴露","ipcheck.dns.cn_tag":"中国 DNS","ipcheck.udp.title":"WebRTC UDP 泄露","ipcheck.udp.status":"状态","ipcheck.udp.outlet":"UDP 出口","ipcheck.udp.outlet_ip":"UDP 出口 IP","ipcheck.udp.origin":"归属地","ipcheck.udp.disabled":"WebRTC 已禁用","ipcheck.udp.no_leak":"未检测到泄露","ipcheck.udp.leaked":"可能泄露","ipcheck.udp.anomaly":"异常","ipcheck.device.title":"设备信息","ipcheck.device.tz":"时区","ipcheck.device.lang":"语言","ipcheck.device.os":"操作系统 / 浏览器","ipcheck.device.touch":"触屏","ipcheck.device.net":"网络类型","ipcheck.device.dnt":"Do Not Track","ipcheck.device.webgl_render":"WebGL 渲染器","ipcheck.device.canvas_fp":"Canvas 指纹","ipcheck.device.webgl_fp":"WebGL 指纹","ipcheck.device.match":"一致","ipcheck.device.mismatch":"不一致","ipcheck.device.local":"本地","ipcheck.device.estimate_suffix":"(估算)","ipcheck.device.diff_equal":"偏移略有差异","ipcheck.device.diff_ahead":"Claude 快 {{h}} 小时","ipcheck.device.diff_behind":"Claude 慢 {{h}} 小时","ipcheck.device.lang_expected":"Claude 出口常用","ipcheck.device.touch_yes":"是","ipcheck.device.touch_no":"否","ipcheck.device.dnt_on":"已开启","ipcheck.device.dnt_off":"已关闭","ipcheck.device.dnt_unset":"未设置","ipcheck.device.net_unsupported":"不支持检测","ipcheck.device.unsupported":"不支持","ipcheck.history.title":"Claude 出口 IP 历史","ipcheck.history.subtitle":"仅本地存储于浏览器,最多保留 6 条","ipcheck.history.clear":"清除","ipcheck.history.empty":"暂无历史记录","ipcheck.history.current":"当前","ipcheck.region.CN":"中国大陆","ipcheck.region.HK":"香港","ipcheck.region.MO":"澳门","ipcheck.region.RU":"俄罗斯","ipcheck.region.KP":"朝鲜","ipcheck.region.IR":"伊朗","ipcheck.region.SY":"叙利亚","ipcheck.region.CU":"古巴","ipcheck.region.BY":"白俄罗斯","ipcheck.region.VE":"委内瑞拉","leaderboard.profile_modal.close":"关闭","leaderboard.profile_modal.loading":"正在加载用户资料…","leaderboard.profile_modal.error":"加载用户资料失败。","leaderboard.profile_modal.empty":"这个用户的资料未公开。","leaderboard.profile_modal.row_aria":"查看 {{name}} 的资料","leaderboard.profile_modal.rank":"#{{rank}}","leaderboard.profile.hero.rank_label":"排名","leaderboard.profile_modal.hero.total_tokens":"总 Token","leaderboard.profile_modal.hero.total_cost":"总花费","leaderboard.profile_modal.hero.github":"GitHub 主页","leaderboard.profile_modal.stat.total_cost":"总花费","leaderboard.profile_modal.stat.total_tokens":"总 Token","leaderboard.profile_modal.stat.active_days":"活跃天数","leaderboard.profile_modal.stat.avg_per_day":"日均花费","leaderboard.profile_modal.streak.current":"当前连续","leaderboard.profile_modal.streak.longest":"最长连续","leaderboard.profile_modal.streak.days":"{{count}} 天","leaderboard.profile_modal.best_day.title":"最佳日","leaderboard.profile_modal.best_day.none":"—","leaderboard.profile_modal.models.count":"使用了 {{count}} 个模型","leaderboard.profile_modal.models.favorite":"最爱模型","leaderboard.profile_modal.models.none":"暂无模型记录","leaderboard.profile_modal.heatmap.title":"活跃度(最近 365 天)","leaderboard.profile_modal.providers.title":"按 Provider 分布","leaderboard.profile_modal.providers.none":"本周期无使用数据。","leaderboard.profile_modal.view_full":"查看完整主页","local_only.title":"请在客户端内使用","local_only.body":"这个页面读取的是你本机上的数据,所以只能在 Mac app 或命令行 dashboard 里查看。","local_only.open_app":"在 Mac app 内打开","local_only.download":"下载 Mac app"},NL={"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.status":"状态","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":"Dashboard","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":"热门模型"},x0="tokentracker-locale",go="system",iu="en",Dp="zh-CN";function P0(e){return typeof e!="string"?iu:/^zh(?:[-_]|$)/i.test(e.trim())?Dp:iu}function Ru(e){return e===go?go:P0(e)}function OL(){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 ou(e,t=OL()){const n=Ru(e);if(n!==go)return n;const a=t.map(o=>typeof o=="string"?o.trim():"").find(o=>o.length>0);return a&&/^zh(?:[-_]|$)/i.test(a)?Dp:iu}function Mp(){return Ru(Ps(x0)||go)}function jL(e){return Ss(x0,Ru(e))}const UL=["key","module","page","component","slot","text"],BL={[Dp]:{...ML,...IL,...NL}};let Oh=null,S0=ou(Mp());function FL(e){const t=[];let n=[],a="",o=!1;for(let s=0;s<e.length;s+=1){const c=e[s];if(o){c==='"'?e[s+1]==='"'?(a+='"',s+=1):o=!1:a+=c;continue}if(c==='"'){o=!0;continue}if(c===","){n.push(a),a="";continue}if(c===`
838
+ `){n.push(a),a="",n.every(u=>u.trim()==="")||t.push(n),n=[];continue}c!=="\r"&&(a+=c)}return n.push(a),n.every(s=>s.trim()==="")||t.push(n),t}function VL(e){const t=FL(e);if(!t.length)return{map:new Map,rows:[]};const n=t[0].map(u=>String(u).trim());if(UL.filter(u=>!n.includes(u)).length)return{map:new Map,rows:[]};const o=Object.fromEntries(n.map((u,h)=>[u,h])),s=[],c=new Map;return t.slice(1).forEach((u,h)=>{const f={key:String(u[o.key]||"").trim(),module:String(u[o.module]||"").trim(),page:String(u[o.page]||"").trim(),component:String(u[o.component]||"").trim(),slot:String(u[o.slot]||"").trim(),text:String(u[o.text]??"").trim()};f.key&&(c.has(f.key),c.set(f.key,f),s.push(f))}),{map:c,rows:s}}function zL(){return Oh||(Oh=VL(DL)),Oh}function $L(){return BL[S0]||{}}function HL(e){const t=$L()[String(e)];return typeof t=="string"&&t.trim()?t:null}function WL(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,a)=>t[a]==null?n:String(t[a])):e}function KL(e){return String(e).replace(/\\n/g,`
839
+ `)}function GL(e,t){return HL(t)||e?.text||t}function qL(e){S0=P0(e)}function Fe(e,t){const a=zL().map.get(e);return WL(KL(GL(a,e)),t)}const Qv="tokentracker_native_app";let C0=null;const Pf=new Set;typeof window<"u"&&window.addEventListener("native:systemAppearanceChanged",e=>{const t=e?.detail?.isDark;if(typeof t=="boolean"){C0=t;try{const n=document.documentElement;t?n.classList.add("dark"):n.classList.remove("dark")}catch{}Pf.forEach(n=>{try{n(t)}catch{}})}});function Jv(){return C0}function YL(e){return Pf.add(e),()=>Pf.delete(e)}function Ip(){if(typeof window>"u")return!1;try{if(new URLSearchParams(window.location.search).get("app")==="1"){try{window.localStorage.setItem(Qv,"1")}catch{}return!0}return window.localStorage.getItem(Qv)==="1"}catch{return!1}}function ar(){return typeof window>"u"?!1:!!window.webkit?.messageHandlers?.nativeBridge}function T0(){return typeof window>"u"?null:window.webkit?.messageHandlers?.nativeBridge??null}function W4(){return!!T0()}function Xs(e){const t=T0();if(!t)return!1;try{return t.postMessage(e),!0}catch(n){return console.warn("[tokentracker] nativeBridge post failed:",n),!1}}function K4(){return Xs({type:"getSettings"})}function Cs(e,t){return Xs({type:"setSetting",key:e,value:t})}function G4(e){return Xs({type:"action",name:e})}function ZL(){return Xs({type:"getSystemAppearance"})}function XL(e,t){if(!ar())return;Xs({type:"setChromeAppearance",isDark:e==="dark",theme:t??"system"})}function q4(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 E0=b.createContext(null);function QL(){return ou(Mp())}function JL(e){typeof document>"u"||(document.documentElement.lang=e)}function ek(e,t){qL(e),t(n=>n===e?n:e)}function eD({children:e}){const[t,n]=b.useState(Mp),[a,o]=b.useState(QL);b.useLayoutEffect(()=>{JL(a)},[a]),b.useLayoutEffect(()=>{ar()&&Cs("locale",t)},[t]),b.useLayoutEffect(()=>{if(t!==go||typeof window>"u")return;const u=()=>ek(ou(go),o);return window.addEventListener("languagechange",u),()=>window.removeEventListener("languagechange",u)},[t]);const s=b.useCallback(u=>{const h=Ru(u);ek(ou(h),o),n(h),jL(h),ar()&&Cs("locale",h)},[]),c=b.useMemo(()=>({locale:t,setLocale:s,resolvedLocale:a}),[t,a,s]);return N.jsx(E0.Provider,{value:c,children:e})}const tD="https://open.er-api.com/v6/latest/USD",nD=1440*60*1e3,rD=5e3;function aD(e,t=nD,n=Date.now()){return!e||!Number.isFinite(e)?!0:n-e>t}async function iD(e={}){const{timeoutMs:t=rD,fetchImpl:n,url:a=tD,codes:o=Tp}=e,s=n??(typeof fetch<"u"?fetch:null);if(!s)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 s(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 k of o){if(k==="USD")continue;const w=m[k];ru(w)&&(y[k]=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 oD=b.createContext(null);function tk(e,t,n){ar()&&(Cs("currency",e),Cs("currencySymbol",n),ru(t)&&Cs("exchangeRate",t))}function sD({children:e}){const[t,n]=b.useState(QR),a=b.useMemo(()=>tL(),[]),[o,s]=b.useState(a.rates),[c,u]=b.useState(a.source),[h,f]=b.useState(a.fetchedAt),m=b.useRef(!1),y=b.useRef(!1),k=b.useCallback((L,R,O)=>{s(L),u(R),f(O),nL({rates:L,source:R,fetchedAt:O})},[]),w=b.useCallback(async()=>{if(!m.current){m.current=!0;try{const{rates:L,fetchedAt:R}=await iD();k({...Ep,...L},"fetched",R)}catch{}finally{m.current=!1}}},[k]),x=b.useCallback(L=>{const R=Ap(L);n(R),JR(R);const O=Mh(o,R),G=Nc(R);tk(R,O,G)},[o]);b.useEffect(()=>{y.current||t!==Os&&aD(h)&&(y.current=!0,w())},[t,h,w]),b.useEffect(()=>{const L=Mh(o,t),R=Nc(t);tk(t,L,R)},[t,o]);const C=b.useMemo(()=>Mh(o,t),[o,t]),S=b.useMemo(()=>Nc(t),[t]),D=b.useMemo(()=>({currency:t,rate:C,symbol:S,rates:o,rateSource:c,rateFetchedAt:h,setCurrency:x}),[t,C,S,o,c,h,x]);return N.jsx(oD.Provider,{value:D,children:e})}const lD="modulepreload",cD=function(e){return"/"+e},nk={},$n=function(t,n,a){let o=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");o=h(n.map(f=>{if(f=cD(f),f in nk)return;nk[f]=!0;const m=f.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=m?"stylesheet":lD,m||(k.as="script"),k.crossOrigin="",k.href=f,u&&k.setAttribute("nonce",u),document.head.appendChild(k),m)return new Promise((w,x)=>{k.addEventListener("load",w),k.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};var su={},uD=()=>{window.va||(window.va=function(...t){window.vaq||(window.vaq=[]),window.vaq.push(t)})},dD="@vercel/analytics",hD="2.0.1";function A0(){return typeof window<"u"}function R0(){try{const e="production"}catch{}return"production"}function fD(e="auto"){if(e==="auto"){window.vam=R0();return}window.vam=e}function pD(){return(A0()?window.vam:R0())||"production"}function Np(){return pD()==="development"}function mD(e){return e.scriptSrc?ao(e.scriptSrc):Np()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?ao(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function gD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.analytics,...e}}catch{}fD(a.mode);const o={sdkn:dD+(a.framework?`/${a.framework}`:""),sdkv:hD};return a.disableAutoTrack&&(o.disableAutoTrack="1"),a.viewEndpoint&&(o.viewEndpoint=ao(a.viewEndpoint)),a.eventEndpoint&&(o.eventEndpoint=ao(a.eventEndpoint)),a.sessionEndpoint&&(o.sessionEndpoint=ao(a.sessionEndpoint)),Np()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=a.endpoint:a.basePath&&(o.endpoint=ao(`${a.basePath}/insights`)),{beforeSend:a.beforeSend,src:mD(a),dataset:o}}function ao(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function yD(e={debug:!0},t){var n;if(!A0())return;const{beforeSend:a,src:o,dataset:s}=gD(e,t);if(uD(),a&&((n=window.va)==null||n.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${o}"]`))return;const c=document.createElement("script");c.src=o;for(const[u,h]of Object.entries(s))c.dataset[u]=h;c.defer=!0,c.onerror=()=>{const u=Np()?"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 ${o}. ${u}`)},document.head.appendChild(c)}function vD({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function kD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function _D(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function bD(e){return b.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),b.useEffect(()=>{yD({framework:e.framework||"react",basePath:e.basePath??kD(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??_D())},[]),b.useEffect(()=>{e.route&&e.path&&vD({route:e.route,path:e.path})},[e.route,e.path]),null}var lu={},wD=()=>{window.si||(window.si=function(...t){window.siq=window.siq||[],window.siq.push(t)})},xD="@vercel/speed-insights",PD="2.0.0";function SD(){return typeof window<"u"}function CD(){try{const e="production"}catch{}return"production"}function L0(){return CD()==="development"}function TD(e){return e.scriptSrc?cu(e.scriptSrc):L0()?"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?cu(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function ED(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.speedInsights,...e}}catch{}const o={sdkn:xD+(a.framework?`/${a.framework}`:""),sdkv:PD};return a.sampleRate&&(o.sampleRate=a.sampleRate.toString()),a.route&&(o.route=a.route),L0()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=cu(a.endpoint):a.basePath&&(o.endpoint=cu(`${a.basePath}/speed-insights/vitals`)),{src:TD(a),beforeSend:a.beforeSend,dataset:o}}function cu(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function AD(e={},t){var n;if(!SD()||e.route===null)return null;wD();const{beforeSend:a,src:o,dataset:s}=ED(e,t);if(document.head.querySelector(`script[src*="${o}"]`))return null;a&&((n=window.si)==null||n.call(window,"beforeSend",a));const c=document.createElement("script");c.src=o,c.defer=!0;for(const[u,h]of Object.entries(s))c.dataset[u]=h;return c.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${o}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(c),{setRoute:u=>{c.dataset.route=u??void 0}}}function RD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function LD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function DD(e){b.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const t=b.useRef(null);return b.useEffect(()=>{if(!t.current){const n=AD({framework:e.framework??"react",basePath:e.basePath??RD(),...e},e.configString??LD());n&&(t.current=n.setRoute)}},[e]),b.useEffect(()=>{t.current&&e.route&&t.current(e.route)},[e.route]),null}const D0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const MD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ID=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const rk=e=>{const t=ID(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jh={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 ND=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},OD=b.createContext({}),jD=()=>b.useContext(OD),UD=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},h)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:k="currentColor",className:w=""}=jD()??{},x=a??y?Number(n??m)*24/Number(t??f):n??m;return b.createElement("svg",{ref:h,...jh,width:t??f??jh.width,height:t??f??jh.height,stroke:e??k,strokeWidth:x,className:D0("lucide",w,o),...!s&&!ND(u)&&{"aria-hidden":"true"},...u},[...c.map(([C,S])=>b.createElement(C,S)),...Array.isArray(s)?s:[s]])});const hn=(e,t)=>{const n=b.forwardRef(({className:a,...o},s)=>b.createElement(UD,{ref:s,iconNode:t,className:D0(`lucide-${MD(rk(e))}`,`lucide-${e}`,a),...o}));return n.displayName=rk(e),n};const BD=[["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"}]],FD=hn("chart-column",BD);const VD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],zD=hn("gauge",VD);const $D=[["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"}]],HD=hn("globe",$D);const WD=[["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"}]],KD=hn("layout-grid",WD);const GD=[["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"}]],qD=hn("mail",GD);const YD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ZD=hn("menu",YD);const XD=[["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"}]],QD=hn("monitor",XD);const JD=[["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"}]],M0=hn("moon",JD);const eM=[["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"}]],tM=hn("puzzle",eM);const nM=[["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"}]],rM=hn("refresh-cw",nM);const aM=[["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"}]],iM=hn("settings",aM);const oM=[["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"}]],I0=hn("sun",oM);const sM=[["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"}]],lM=hn("triangle-alert",sM);const cM=[["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"}]],uM=hn("trophy",cM);const dM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],N0=hn("x",dM);function hM({children:e,variant:t="primary",size:n="md",onClick:a,disabled:o=!1,className:s="",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=o?"cursor-not-allowed opacity-60":"cursor-pointer",k=`${h} ${f[t]} ${m[n]} ${y} ${s}`;return N.jsx(c,{className:k,onClick:a,disabled:o,...u,children:e})}class fM extends Ls.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 N.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:N.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:[N.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:N.jsx(lM,{className:"h-5 w-5","aria-hidden":!0})}),N.jsx("div",{className:"mt-4 text-xs font-medium uppercase text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.title")}),N.jsx("h1",{className:"mt-2 text-xl font-semibold text-oai-black dark:text-white",children:Fe("error.boundary.subtitle")}),N.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.hint")}),N.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}),N.jsxs(hM,{type:"button",size:"md",onClick:this.handleReload,className:"mt-5",children:[N.jsx(rM,{className:"mr-2 h-4 w-4","aria-hidden":!0}),Fe("error.boundary.action.reload")]})]})})}}function Qs(){const e=b.useContext(E0);if(e===null)throw new Error("useLocale must be used within a LocaleProvider");return e}const Sf="tokentracker-theme",O0=b.createContext(null);function pM(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(Sf);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function yc(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mM(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function gM({children:e}){const[t,n]=b.useState(pM),[a,o]=b.useState(()=>{if(t!=="system")return t;if(ar()){const f=Jv();if(typeof f=="boolean")return f?"dark":"light"}return yc()}),s=b.useRef(t);b.useEffect(()=>{s.current=t},[t]),b.useEffect(()=>{mM(a)},[a]),b.useLayoutEffect(()=>{if(t==="system"){if(ar()){const f=Jv();o(typeof f=="boolean"?f?"dark":"light":yc()),ZL();return}o(yc())}else o(t)},[t]),b.useEffect(()=>ar()?YL(m=>{s.current==="system"&&o(m?"dark":"light")}):void 0,[]),b.useEffect(()=>{if(typeof window>"u"||t!=="system"||ar())return;const f=window.matchMedia("(prefers-color-scheme: dark)"),m=y=>{const k=y.matches?"dark":"light";o(k)};return f.addEventListener?(f.addEventListener("change",m),()=>f.removeEventListener("change",m)):(f.addListener(m),()=>f.removeListener(m))},[t]),b.useEffect(()=>{const f=t==="system"&&!ar()?yc():a;XL(f,t)},[a,t]);const c=b.useCallback(f=>{if(n(f),typeof window<"u")try{localStorage.setItem(Sf,f)}catch{}},[]),u=b.useCallback(()=>{c(f=>{const m=f==="dark"?"light":"dark";if(typeof window<"u")try{localStorage.setItem(Sf,m)}catch{}return m})},[]),h=b.useMemo(()=>({theme:t,setTheme:c,toggleTheme:u,resolvedTheme:a}),[t,c,u,a]);return N.jsx(O0.Provider,{value:h,children:e})}const j0=b.createContext({isOpen:!1,openLoginModal:()=>{},closeLoginModal:()=>{}});function yM({children:e}){const[t,n]=b.useState(!1),a=b.useCallback(()=>n(!0),[]),o=b.useCallback(()=>n(!1),[]);return N.jsx(j0.Provider,{value:{isOpen:t,openLoginModal:a,closeLoginModal:o},children:e})}function U0(){return b.useContext(j0)}const Op=b.createContext({});function jp(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const vM=typeof window<"u",B0=vM?b.useLayoutEffect:b.useEffect,Lu=b.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function uu(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 Bp=()=>{};const Ia={},F0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function V0(e){return typeof e=="object"&&e!==null}const z0=e=>/^0[^.\s]+$/u.test(e);function $0(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,kM=(e,t)=>n=>t(e(n)),Js=(...e)=>e.reduce(kM),Us=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Fp{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>uu(this.subscriptions,t)}notify(t,n,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,a);else for(let s=0;s<o;s++){const c=this.subscriptions[s];c&&c(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Sn=e=>e*1e3,On=e=>e/1e3;function H0(e,t){return t?e*(1e3/t):0}const W0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,_M=1e-7,bM=12;function wM(e,t,n,a,o){let s,c,u=0;do c=t+(n-t)/2,s=W0(c,a,o)-e,s>0?n=c:t=c;while(Math.abs(s)>_M&&++u<bM);return c}function el(e,t,n,a){if(e===t&&n===a)return jn;const o=s=>wM(s,0,1,e,n);return s=>s===0||s===1?s:W0(o(s),t,a)}const K0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,G0=e=>t=>1-e(1-t),q0=el(.33,1.53,.69,.99),Vp=G0(q0),Y0=K0(Vp),Z0=e=>e>=1?1:(e*=2)<1?.5*Vp(e):.5*(2-Math.pow(2,-10*(e-1))),zp=e=>1-Math.sin(Math.acos(e)),X0=G0(zp),Q0=K0(zp),xM=el(.42,0,1,1),PM=el(0,0,.58,1),J0=el(.42,0,.58,1),SM=e=>Array.isArray(e)&&typeof e[0]!="number",ew=e=>Array.isArray(e)&&typeof e[0]=="number",CM={linear:jn,easeIn:xM,easeInOut:J0,easeOut:PM,circIn:zp,circInOut:Q0,circOut:X0,backIn:Vp,backInOut:Y0,backOut:q0,anticipate:Z0},TM=e=>typeof e=="string",ak=e=>{if(ew(e)){Bp(e.length===4);const[t,n,a,o]=e;return el(t,n,a,o)}else if(TM(e))return CM[e];return e},vc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function EM(e,t){let n=new Set,a=new Set,o=!1,s=!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,k=!1)=>{const x=k&&o?n:a;return y&&c.add(m),x.add(m),m},cancel:m=>{a.delete(m),c.delete(m)},process:m=>{if(u=m,o){s=!0;return}o=!0;const y=n;n=a,a=y,n.forEach(h),n.clear(),o=!1,s&&(s=!1,f.process(m))}};return f}const AM=40;function tw(e,t){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,c=vc.reduce((R,O)=>(R[O]=EM(s),R),{}),{setup:u,read:h,resolveKeyframes:f,preUpdate:m,update:y,preRender:k,render:w,postRender:x}=c,C=()=>{const R=Ia.useManualTiming,O=R?o.timestamp:performance.now();n=!1,R||(o.delta=a?1e3/60:Math.max(Math.min(O-o.timestamp,AM),1)),o.timestamp=O,o.isProcessing=!0,u.process(o),h.process(o),f.process(o),m.process(o),y.process(o),k.process(o),w.process(o),x.process(o),o.isProcessing=!1,n&&t&&(a=!1,e(C))},S=()=>{n=!0,a=!0,o.isProcessing||e(C)};return{schedule:vc.reduce((R,O)=>{const G=c[O];return R[O]=(W,z=!1,P=!1)=>(n||S(),G.schedule(W,z,P)),R},{}),cancel:R=>{for(let O=0;O<vc.length;O++)c[vc[O]].cancel(R)},state:o,steps:c}}const{schedule:dt,cancel:Na,state:Kt,steps:Uh}=tw(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let jc;function RM(){jc=void 0}const sn={now:()=>(jc===void 0&&sn.set(Kt.isProcessing||Ia.useManualTiming?Kt.timestamp:performance.now()),jc),set:e=>{jc=e,queueMicrotask(RM)}},nw=e=>t=>typeof t=="string"&&t.startsWith(e),rw=nw("--"),LM=nw("var(--"),$p=e=>LM(e)?DM.test(e.split("/*")[0].trim()):!1,DM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ik(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Bs={...bo,transform:e=>xr(0,1,e)},kc={...bo,default:1},Ts=e=>Math.round(e*1e5)/1e5,Hp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function MM(e){return e==null}const IM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wp=(e,t)=>n=>!!(typeof n=="string"&&IM.test(n)&&n.startsWith(e)||t&&!MM(n)&&Object.prototype.hasOwnProperty.call(n,t)),aw=(e,t,n)=>a=>{if(typeof a!="string")return a;const[o,s,c,u]=a.match(Hp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},NM=e=>xr(0,255,e),Bh={...bo,transform:e=>Math.round(NM(e))},ai={test:Wp("rgb","red"),parse:aw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Bh.transform(e)+", "+Bh.transform(t)+", "+Bh.transform(n)+", "+Ts(Bs.transform(a))+")"};function OM(e){let t="",n="",a="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const Cf={test:Wp("#"),parse:OM,transform:ai.transform},tl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sa=tl("deg"),vr=tl("%"),_e=tl("px"),jM=tl("vh"),UM=tl("vw"),ok={...vr,parse:e=>vr.parse(e)/100,transform:e=>vr.transform(e*100)},io={test:Wp("hsl","hue"),parse:aw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+vr.transform(Ts(t))+", "+vr.transform(Ts(n))+", "+Ts(Bs.transform(a))+")"},Lt={test:e=>ai.test(e)||Cf.test(e)||io.test(e),parse:e=>ai.test(e)?ai.parse(e):io.test(e)?io.parse(e):Cf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ai.transform(e):io.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},BM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function FM(e){return isNaN(e)&&typeof e=="string"&&(e.match(Hp)?.length||0)+(e.match(BM)?.length||0)>0}const iw="number",ow="color",VM="var",zM="var(",sk="${}",$M=/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 yo(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},o=[];let s=0;const u=t.replace($M,h=>(Lt.test(h)?(a.color.push(s),o.push(ow),n.push(Lt.parse(h))):h.startsWith(zM)?(a.var.push(s),o.push(VM),n.push(h)):(a.number.push(s),o.push(iw),n.push(parseFloat(h))),++s,sk)).split(sk);return{values:n,split:u,indexes:a,types:o}}function HM(e){return yo(e).values}function sw({split:e,types:t}){const n=e.length;return a=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],a[s]!==void 0){const c=t[s];c===iw?o+=Ts(a[s]):c===ow?o+=Lt.transform(a[s]):o+=a[s]}return o}}function WM(e){return sw(yo(e))}const KM=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,GM=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:KM(e);function qM(e){const t=yo(e);return sw(t)(t.values.map((a,o)=>GM(a,t.split[o])))}const or={test:FM,parse:HM,createTransformer:WM,getAnimatableNone:qM};function Fh(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 YM({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let o=0,s=0,c=0;if(!t)o=s=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;o=Fh(h,u,e+1/3),s=Fh(h,u,e),c=Fh(h,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(c*255),alpha:a}}function du(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,Vh=(e,t,n)=>{const a=e*e,o=n*(t*t-a)+a;return o<0?0:Math.sqrt(o)},ZM=[Cf,ai,io],XM=e=>ZM.find(t=>t.test(e));function lk(e){const t=XM(e);if(!t)return!1;let n=t.parse(e);return t===io&&(n=YM(n)),n}const ck=(e,t)=>{const n=lk(e),a=lk(t);if(!n||!a)return du(e,t);const o={...n};return s=>(o.red=Vh(n.red,a.red,s),o.green=Vh(n.green,a.green,s),o.blue=Vh(n.blue,a.blue,s),o.alpha=vt(n.alpha,a.alpha,s),ai.transform(o))},Tf=new Set(["none","hidden"]);function QM(e,t){return Tf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function JM(e,t){return n=>vt(e,t,n)}function Kp(e){return typeof e=="number"?JM:typeof e=="string"?$p(e)?du:Lt.test(e)?ck:n2:Array.isArray(e)?lw:typeof e=="object"?Lt.test(e)?ck:e2:du}function lw(e,t){const n=[...e],a=n.length,o=e.map((s,c)=>Kp(s)(s,t[c]));return s=>{for(let c=0;c<a;c++)n[c]=o[c](s);return n}}function e2(e,t){const n={...e,...t},a={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(a[o]=Kp(e[o])(e[o],t[o]));return o=>{for(const s in a)n[s]=a[s](o);return n}}function t2(e,t){const n=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],c=e.indexes[s][a[s]],u=e.values[c]??0;n[o]=u,a[s]++}return n}const n2=(e,t)=>{const n=or.createTransformer(t),a=yo(e),o=yo(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Tf.has(e)&&!o.values.length||Tf.has(t)&&!a.values.length?QM(e,t):Js(lw(t2(a,o),o.values),n):du(e,t)};function cw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):Kp(e)(e,t)}const r2=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Na(t),now:()=>Kt.isProcessing?Kt.timestamp:sn.now()}},uw=(e,t,n=10)=>{let a="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)a+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},hu=2e4;function Gp(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<hu;)t+=n,a=e.next(t);return t>=hu?1/0:t}function a2(e,t=100,n){const a=n({...e,keyframes:[0,t]}),o=Math.min(Gp(a),hu);return{type:"keyframes",ease:s=>a.next(o*s).value/t,duration:On(o)}}const Pt={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 Ef(e,t){return e*Math.sqrt(1-t*t)}const i2=12;function o2(e,t,n){let a=n;for(let o=1;o<i2;o++)a=a-e(a)/t(a);return a}const zh=.001;function s2({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:a=Pt.mass}){let o,s,c=1-t;c=xr(Pt.minDamping,Pt.maxDamping,c),e=xr(Pt.minDuration,Pt.maxDuration,On(e)),c<1?(o=f=>{const m=f*c,y=m*e,k=m-n,w=Ef(f,c),x=Math.exp(-y);return zh-k/w*x},s=f=>{const y=f*c*e,k=y*n+n,w=Math.pow(c,2)*Math.pow(f,2)*e,x=Math.exp(-y),C=Ef(Math.pow(f,2),c);return(-o(f)+zh>0?-1:1)*((k-w)*x)/C}):(o=f=>{const m=Math.exp(-f*e),y=(f-n)*e+1;return-zh+m*y},s=f=>{const m=Math.exp(-f*e),y=(n-f)*(e*e);return m*y});const u=5/e,h=o2(o,s,u);if(e=Sn(e),isNaN(h))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(h,2)*a;return{stiffness:f,damping:c*2*Math.sqrt(a*f),duration:e}}}const l2=["duration","bounce"],c2=["stiffness","damping","mass"];function uk(e,t){return t.some(n=>e[n]!==void 0)}function u2(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!uk(e,c2)&&uk(e,l2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),o=a*a,s=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:s}}else{const n=s2({...e,velocity:0});t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function fu(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=n;const s=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:s},{stiffness:h,damping:f,mass:m,duration:y,velocity:k,isResolvedFromDuration:w}=u2({...n,velocity:-On(n.velocity||0)}),x=k||0,C=f/(2*Math.sqrt(h*m)),S=c-s,D=On(Math.sqrt(h/m)),L=Math.abs(S)<5;a||(a=L?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=L?Pt.restDelta.granular:Pt.restDelta.default);let R,O,G,W,z,P;if(C<1)G=Ef(D,C),W=(x+C*D*S)/G,R=X=>{const ue=Math.exp(-C*D*X);return c-ue*(W*Math.sin(G*X)+S*Math.cos(G*X))},z=C*D*W+S*G,P=C*D*S-W*G,O=X=>Math.exp(-C*D*X)*(z*Math.sin(G*X)+P*Math.cos(G*X));else if(C===1){R=ue=>c-Math.exp(-D*ue)*(S+(x+D*S)*ue);const X=x+D*S;O=ue=>Math.exp(-D*ue)*(D*X*ue-x)}else{const X=D*Math.sqrt(C*C-1);R=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return c-le*((x+C*D*S)*Math.sinh(pe)+X*S*Math.cosh(pe))/X};const ue=(x+C*D*S)/X,se=C*D*ue-S*X,Ae=C*D*S-ue*X;O=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return le*(se*Math.sinh(pe)+Ae*Math.cosh(pe))}}const Y={calculatedDuration:w&&y||null,velocity:X=>Sn(O(X)),next:X=>{if(!w&&C<1){const se=Math.exp(-C*D*X),Ae=Math.sin(G*X),fe=Math.cos(G*X),le=c-se*(W*Ae+S*fe),pe=Sn(se*(z*Ae+P*fe));return u.done=Math.abs(pe)<=a&&Math.abs(c-le)<=o,u.value=u.done?c:le,u}const ue=R(X);if(w)u.done=X>=y;else{const se=Sn(O(X));u.done=Math.abs(se)<=a&&Math.abs(c-ue)<=o}return u.value=u.done?c:ue,u},toString:()=>{const X=Math.min(Gp(Y),hu),ue=uw(se=>Y.next(X*se).value,X,30);return X+"ms "+ue},toTransition:()=>{}};return Y}fu.applyToOptions=e=>{const t=a2(e,100,fu);return e.ease=t.ease,e.duration=Sn(t.duration),e.type="keyframes",e};const d2=5;function dw(e,t,n){const a=Math.max(t-d2,0);return H0(n-e(a),t-a)}function Af({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:c,min:u,max:h,restDelta:f=.5,restSpeed:m}){const y=e[0],k={done:!1,value:y},w=P=>u!==void 0&&P<u||h!==void 0&&P>h,x=P=>u===void 0?h:h===void 0||Math.abs(u-P)<Math.abs(h-P)?u:h;let C=n*t;const S=y+C,D=c===void 0?S:c(S);D!==S&&(C=D-y);const L=P=>-C*Math.exp(-P/a),R=P=>D+L(P),O=P=>{const Y=L(P),X=R(P);k.done=Math.abs(Y)<=f,k.value=k.done?D:X};let G,W;const z=P=>{w(k.value)&&(G=P,W=fu({keyframes:[k.value,x(k.value)],velocity:dw(R,P,k.value),damping:o,stiffness:s,restDelta:f,restSpeed:m}))};return z(0),{calculatedDuration:null,next:P=>{let Y=!1;return!W&&G===void 0&&(Y=!0,O(P),z(P)),G!==void 0&&P>=G?W.next(P-G):(!Y&&O(P),k)}}}function h2(e,t,n){const a=[],o=n||Ia.mix||cw,s=e.length-1;for(let c=0;c<s;c++){let u=o(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;u=Js(h,u)}a.push(u)}return a}function f2(e,t,{clamp:n=!0,ease:a,mixer:o}={}){const s=e.length;if(Bp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=h2(t,a,o),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 k=Us(e[y],e[y+1],m);return u[y](k)};return n?m=>f(xr(e[0],e[s-1],m)):f}function p2(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const o=Us(0,t,a);e.push(vt(n,1,o))}}function m2(e){const t=[0];return p2(t,e.length-1),t}function g2(e,t){return e.map(n=>n*t)}function y2(e,t){return e.map(()=>t||J0).splice(0,e.length-1)}function Es({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const o=SM(a)?a.map(ak):ak(a),s={done:!1,value:t[0]},c=g2(n&&n.length===t.length?n:m2(t),e),u=f2(c,t,{ease:Array.isArray(o)?o:y2(t,o)});return{calculatedDuration:e,next:h=>(s.value=u(h),s.done=h>=e,s)}}const v2=e=>e!==null;function Du(e,{repeat:t,repeatType:n="loop"},a,o=1){const s=e.filter(v2),u=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!u||a===void 0?s[u]:a}const k2={decay:Af,inertia:Af,tween:Es,keyframes:Es,spring:fu};function hw(e){typeof e.type=="string"&&(e.type=k2[e.type])}class qp{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 _2=e=>e/100;class pu extends qp{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!==sn.now()&&this.tick(sn.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;hw(t);const{type:n=Es,repeat:a=0,repeatDelay:o=0,repeatType:s,velocity:c=0}=t;let{keyframes:u}=t;const h=n||Es;h!==Es&&typeof u[0]!="number"&&(this.mixKeyframes=Js(_2,cw(u[0],u[1])),u=[0,100]);const f=h({...t,keyframes:u});s==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Gp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+o,this.totalDuration=this.resolvedDuration*(a+1)-o,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:o,mixKeyframes:s,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:f=0,keyframes:m,repeat:y,repeatType:k,repeatDelay:w,type:x,onUpdate:C,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-f*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?D<0:D>o;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let R=this.currentTime,O=a;if(y){const P=Math.min(this.currentTime,o)/u;let Y=Math.floor(P),X=P%1;!X&&P>=1&&(X=1),X===1&&Y--,Y=Math.min(Y,y+1),Y%2&&(k==="reverse"?(X=1-X,w&&(X-=w/u)):k==="mirror"&&(O=c)),R=xr(0,1,X)*u}let G;L?(this.delayState.value=m[0],G=this.delayState):G=O.next(R),s&&!L&&(G.value=s(G.value));let{done:W}=G;!L&&h!==null&&(W=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&W);return z&&x!==Af&&(G.value=Du(m,this.options,S,this.speed)),C&&C(G.value),z&&this.finish(),G}then(t,n){return this.finished.then(t,n)}get duration(){return On(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(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 dw(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(sn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=On(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=r2,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),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(sn.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 b2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ii=e=>e*180/Math.PI,Rf=e=>{const t=ii(Math.atan2(e[1],e[0]));return Lf(t)},w2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rf,rotateZ:Rf,skewX:e=>ii(Math.atan(e[1])),skewY:e=>ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Lf=e=>(e=e%360,e<0&&(e+=360),e),dk=Rf,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),x2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:fk,scale:e=>(hk(e)+fk(e))/2,rotateX:e=>Lf(ii(Math.atan2(e[6],e[5]))),rotateY:e=>Lf(ii(Math.atan2(-e[2],e[0]))),rotateZ:dk,rotate:dk,skewX:e=>ii(Math.atan(e[4])),skewY:e=>ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Df(e){return e.includes("scale")?1:0}function Mf(e,t){if(!e||e==="none")return Df(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(n)a=x2,o=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=w2,o=u}if(!o)return Df(t);const s=a[t],c=o[1].split(",").map(S2);return typeof s=="function"?s(c):c[s]}const P2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mf(n,t)};function S2(e){return parseFloat(e.trim())}const wo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xo=new Set(wo),pk=e=>e===bo||e===_e,C2=new Set(["x","y","z"]),T2=wo.filter(e=>!C2.has(e));function E2(e){const t=[];return T2.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const La={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-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})=>Mf(t,"x"),y:(e,{transform:t})=>Mf(t,"y")};La.translateX=La.x;La.translateY=La.y;const oi=new Set;let If=!1,Nf=!1,Of=!1;function fw(){if(Nf){const e=Array.from(oi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const o=E2(a);o.length&&(n.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=n.get(a);o&&o.forEach(([s,c])=>{a.getValue(s)?.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Nf=!1,If=!1,oi.forEach(e=>e.complete(Of)),oi.clear()}function pw(){oi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Nf=!0)})}function A2(){Of=!0,pw(),fw(),Of=!1}class Yp{constructor(t,n,a,o,s,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=o,this.element=s,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(oi.add(this),If||(If=!0,dt.read(pw),dt.resolveKeyframes(fw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:o}=this;if(t[0]===null){const s=o?.get(),c=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&n){const u=a.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),o&&s===void 0&&o.set(t[0])}b2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),oi.delete(this)}cancel(){this.state==="scheduled"&&(oi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const R2=e=>e.startsWith("--");function mw(e,t,n){R2(t)?e.style.setProperty(t,n):e.style[t]=n}const L2={};function gw(e,t){const n=$0(e);return()=>L2[t]??n()}const D2=gw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),yw=gw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bs=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,mk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bs([0,.65,.55,1]),circOut:bs([.55,0,1,.45]),backIn:bs([.31,.01,.66,-.59]),backOut:bs([.33,1.53,.69,.99])};function vw(e,t){if(e)return typeof e=="function"?yw()?uw(e,t):"ease-out":ew(e)?bs(e):Array.isArray(e)?e.map(n=>vw(n,t)||mk.easeOut):mk[e]}function M2(e,t,n,{delay:a=0,duration:o=300,repeat:s=0,repeatType:c="loop",ease:u="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const y=vw(u,o);Array.isArray(y)&&(m.easing=y);const k={delay:a,duration:o,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:s+1,direction:c==="reverse"?"alternate":"normal"};return f&&(k.pseudoElement=f),e.animate(m,k)}function kw(e){return typeof e=="function"&&"applyToOptions"in e}function I2({type:e,...t}){return kw(e)&&yw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class _w extends qp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:o,pseudoElement:s,allowFlatten:c=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!s,this.allowFlatten=c,this.options=t,Bp(typeof t.type!="string");const f=I2(t);this.animation=M2(n,a,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Du(o,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),mw(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 On(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(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:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&D2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),jn):o(this)}}const bw={anticipate:Z0,backInOut:Y0,circInOut:Q0};function N2(e){return e in bw}function O2(e){typeof e.ease=="string"&&N2(e.ease)&&(e.ease=bw[e.ease])}const $h=10;class j2 extends _w{constructor(t){O2(t),hw(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:o,element:s,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new pu({...c,autoplay:!1}),h=Math.max($h,sn.now()-this.startTime),f=xr(0,$h,h-$h),m=u.sample(h).value,{name:y}=this.options;s&&y&&mw(s,y,m),n.setWithVelocity(u.sample(Math.max(0,h-f)).value,m,f),u.stop()}}const gk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(or.test(e)||e==="0")&&!e.startsWith("url("));function U2(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 B2(e,t,n,a){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],c=gk(o,t),u=gk(s,t);return!c||!u?!1:U2(e)||(n==="spring"||kw(n))&&a}function jf(e){e.duration=0,e.type="keyframes"}const ww=new Set(["opacity","clipPath","filter","transform"]),F2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function V2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&F2.test(e[t]))return!0;return!1}const z2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),$2=$0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function H2(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:o,damping:s,type:c,keyframes:u}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return $2()&&n&&(ww.has(n)||z2.has(n)&&V2(u))&&(n!=="transform"||!m)&&!f&&!a&&o!=="mirror"&&s!==0&&c!=="inertia"}const W2=40;class K2 extends qp{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:o=0,repeatDelay:s=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=sn.now();const k={autoplay:t,delay:n,type:a,repeat:o,repeatDelay:s,repeatType:c,name:h,motionValue:f,element:m,...y},w=m?.KeyframeResolver||Yp;this.keyframeResolver=new w(u,(x,C,S)=>this.onKeyframesResolved(x,C,k,!S),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,o){this.keyframeResolver=void 0;const{name:s,type:c,velocity:u,delay:h,isHandoff:f,onUpdate:m}=a;this.resolvedAt=sn.now();let y=!0;B2(t,s,c,u)||(y=!1,(Ia.instantAnimations||!h)&&m?.(Du(t,a,n)),t[0]=t[t.length-1],jf(a),a.repeat=0);const w={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>W2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},x=y&&!f&&H2(w),C=w.motionValue?.owner?.current;let S;if(x)try{S=new j2({...w,element:C})}catch{S=new pu(w)}else S=new pu(w);S.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}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(),A2()),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 xw(e,t,n,a=0,o=1){const s=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,u=(c-1)*a;return typeof n=="function"?n(s,c):o===1?s*a:u-s*a}const G2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function q2(e){const t=G2.exec(e);if(!t)return[,];const[,n,a,o]=t;return[`--${n??a}`,o]}function Pw(e,t,n=1){const[a,o]=q2(e);if(!a)return;const s=window.getComputedStyle(t).getPropertyValue(a);if(s){const c=s.trim();return F0(c)?parseFloat(c):c}return $p(o)?Pw(o,t,n+1):o}const Y2={type:"spring",stiffness:500,damping:25,restSpeed:10},Z2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X2={type:"keyframes",duration:.8},Q2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},J2=(e,{keyframes:t})=>t.length>2?X2:xo.has(e)?e.startsWith("scale")?Z2(t[1]):Y2:Q2;function Sw(e,t){if(e?.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function Zp(e,t){const n=e?.[t]??e?.default??e;return n!==e?Sw(n,e):n}const eI=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function tI(e){for(const t in e)if(!eI.has(t))return!0;return!1}const Xp=(e,t,n,a={},o,s)=>c=>{const u=Zp(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:k=>{t.set(k),u.onUpdate&&u.onUpdate(k)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:s?void 0:o};tI(u)||Object.assign(m,J2(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)&&(jf(m),m.delay===0&&(y=!0)),(Ia.instantAnimations||Ia.skipAnimations||o?.shouldSkipAnimations)&&(y=!0,jf(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!s&&t.get()!==void 0){const k=Du(m.keyframes,u);if(k!==void 0){dt.update(()=>{m.onUpdate(k),m.onComplete()});return}}return u.isSync?new pu(m):new K2(m)};function yk(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Qp(e,t,n,a){if(typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}return t}function si(e,t,n){const a=e.getProps();return Qp(a,t,n!==void 0?n:a.custom,e)}const Cw=new Set(["width","height","top","left","right","bottom",...wo]),vk=30,nI=e=>!isNaN(parseFloat(e)),kk={current:void 0};class rI{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=sn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=nI(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 Fp);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 kk.current&&kk.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vk);return H0(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 vo(e,t){return new rI(e,t)}const Uf=e=>Array.isArray(e);function aI(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,vo(n))}function iI(e){return Uf(e)?e[e.length-1]||0:e}function oI(e,t){const n=si(e,t);let{transitionEnd:a={},transition:o={},...s}=n||{};s={...s,...a};for(const c in s){const u=iI(s[c]);aI(e,c,u)}}const Gt=e=>!!(e&&e.getVelocity);function sI(e){return!!(Gt(e)&&e.add)}function Bf(e,t){const n=e.getValue("willChange");if(sI(n))return n.add(t);if(!n&&Ia.WillChange){const a=new Ia.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Jp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const lI="framerAppearId",Tw="data-"+Jp(lI);function Ew(e){return e.props[Tw]}function cI({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Aw(e,t,{delay:n=0,transitionOverride:a,type:o}={}){let{transition:s,transitionEnd:c,...u}=t;const h=e.getDefaultTransition();s=s?Sw(s,h):h;const f=s?.reduceMotion;a&&(s=a);const m=[],y=o&&e.animationState&&e.animationState.getState()[o];for(const k in u){const w=e.getValue(k,e.latestValues[k]??null),x=u[k];if(x===void 0||y&&cI(y,k))continue;const C={delay:n,...Zp(s||{},k)},S=w.get();if(S!==void 0&&!w.isAnimating()&&!Array.isArray(x)&&x===S&&!C.velocity){dt.update(()=>w.set(x));continue}let D=!1;if(window.MotionHandoffAnimation){const O=Ew(e);if(O){const G=window.MotionHandoffAnimation(O,k,dt);G!==null&&(C.startTime=G,D=!0)}}Bf(e,k);const L=f??e.shouldReduceMotion;w.start(Xp(k,w,x,L&&Cw.has(k)?{type:!1}:C,e,D));const R=w.animation;R&&m.push(R)}if(c){const k=()=>dt.update(()=>{c&&oI(e,c)});m.length?Promise.all(m).then(k):k()}return m}function Ff(e,t,n={}){const a=si(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const s=a?()=>Promise.all(Aw(e,a,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:y}=o;return uI(e,t,h,f,m,y,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[h,f]=u==="beforeChildren"?[s,c]:[c,s];return h().then(()=>f())}else return Promise.all([s(),c(n.delay)])}function uI(e,t,n=0,a=0,o=0,s=1,c){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(Ff(h,t,{...c,delay:n+(typeof a=="function"?0:a)+xw(e.variantChildren,h,a,o,s)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function dI(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(s=>Ff(e,s,n));a=Promise.all(o)}else if(typeof t=="string")a=Ff(e,t,n);else{const o=typeof t=="function"?si(e,t,n.custom):t;a=Promise.all(Aw(e,o,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const hI={test:e=>e==="auto",parse:e=>e},Rw=e=>t=>t.test(e),Lw=[bo,_e,vr,Sa,UM,jM,hI],_k=e=>Lw.find(Rw(e));function fI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||z0(e):!0}const pI=new Set(["brightness","contrast","saturate","opacity"]);function mI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(Hp)||[];if(!a)return e;const o=n.replace(a,"");let s=pI.has(t)?1:0;return a!==n&&(s*=100),t+"("+s+o+")"}const gI=/\b([a-z-]*)\(.*?\)/gu,Vf={...or,getAnimatableNone:e=>{const t=e.match(gI);return t?t.map(mI).join(" "):e}},zf={...or,getAnimatableNone:e=>{const t=or.parse(e);return or.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bk={...bo,transform:Math.round},yI={rotate:Sa,rotateX:Sa,rotateY:Sa,rotateZ:Sa,scale:kc,scaleX:kc,scaleY:kc,scaleZ:kc,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:Bs,originX:ok,originY:ok,originZ:_e},em={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,...yI,zIndex:bk,fillOpacity:Bs,strokeOpacity:Bs,numOctaves:bk},vI={...em,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Vf,WebkitFilter:Vf,mask:zf,WebkitMask:zf},Dw=e=>vI[e],kI=new Set([Vf,zf]);function Mw(e,t){let n=Dw(e);return kI.has(n)||(n=or),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _I=new Set(["auto","none","0"]);function bI(e,t,n){let a=0,o;for(;a<e.length&&!o;){const s=e[a];typeof s=="string"&&!_I.has(s)&&yo(s).values.length&&(o=e[a]),a++}if(o&&n)for(const s of t)e[s]=Mw(n,o)}class wI extends Yp{constructor(t,n,a,o,s){super(t,n,a,o,s,!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(),$p(y))){const k=Pw(y,n.current);k!==void 0&&(t[m]=k),m===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!Cw.has(a)||t.length!==2)return;const[o,s]=t,c=_k(o),u=_k(s),h=ik(o),f=ik(s);if(h!==f&&La[a]){this.needsMeasurement=!0;return}if(c!==u)if(pk(c)&&pk(u))for(let m=0;m<t.length;m++){const y=t[m];typeof y=="string"&&(t[m]=parseFloat(y))}else La[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let o=0;o<t.length;o++)(t[o]===null||fI(t[o]))&&a.push(o);a.length&&bI(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=La[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=a.length-1,c=a[s];a[s]=La[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 Iw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=n?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const Nw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uc(e){return V0(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:tm}=tw(queueMicrotask,!1),nr={x:!1,y:!1};function Ow(){return nr.x||nr.y}function xI(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 jw(e,t){const n=Iw(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[n,o,()=>a.abort()]}function PI(e){return!(e.pointerType==="touch"||Ow())}function SI(e,t,n={}){const[a,o,s]=jw(e,n);return a.forEach(c=>{let u=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",x)},y=S=>{f&&(f(S),f=void 0),m()},k=S=>{u=!1,window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),h&&(h=!1,y(S))},w=()=>{u=!0,window.addEventListener("pointerup",k,o),window.addEventListener("pointercancel",k,o)},x=S=>{if(S.pointerType!=="touch"){if(u){h=!0;return}y(S)}},C=S=>{if(!PI(S))return;h=!1;const D=t(c,S);typeof D=="function"&&(f=D,c.addEventListener("pointerleave",x,o))};c.addEventListener("pointerenter",C,o),c.addEventListener("pointerdown",w,o)}),s}const Uw=(e,t)=>t?e===t?!0:Uw(e,t.parentElement):!1,nm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,CI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function TI(e){return CI.has(e.tagName)||e.isContentEditable===!0}const EI=new Set(["INPUT","SELECT","TEXTAREA"]);function AI(e){return EI.has(e.tagName)||e.isContentEditable===!0}const Bc=new WeakSet;function wk(e){return t=>{t.key==="Enter"&&e(t)}}function Hh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const RI=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=wk(()=>{if(Bc.has(n))return;Hh(n,"down");const o=wk(()=>{Hh(n,"up")}),s=()=>Hh(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function xk(e){return nm(e)&&!Ow()}const Pk=new WeakSet;function LI(e,t,n={}){const[a,o,s]=jw(e,n),c=u=>{const h=u.currentTarget;if(!xk(u)||Pk.has(u))return;Bc.add(h),n.stopPropagation&&Pk.add(u);const f=t(h,u),m=(w,x)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",k),Bc.has(h)&&Bc.delete(h),xk(w)&&typeof f=="function"&&f(w,{success:x})},y=w=>{m(w,h===window||h===document||n.useGlobalTarget||Uw(h,w.target))},k=w=>{m(w,!1)};window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",k,o)};return a.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,o),Uc(u)&&(u.addEventListener("focus",f=>RI(f,o)),!TI(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),s}function rm(e){return V0(e)&&"ownerSVGElement"in e}const Fc=new WeakMap;let Vc;const Bw=(e,t,n)=>(a,o)=>o&&o[0]?o[0][e+"Size"]:rm(a)&&"getBBox"in a?a.getBBox()[t]:a[n],DI=Bw("inline","width","offsetWidth"),MI=Bw("block","height","offsetHeight");function II({target:e,borderBoxSize:t}){Fc.get(e)?.forEach(n=>{n(e,{get width(){return DI(e,t)},get height(){return MI(e,t)}})})}function NI(e){e.forEach(II)}function OI(){typeof ResizeObserver>"u"||(Vc=new ResizeObserver(NI))}function jI(e,t){Vc||OI();const n=Iw(e);return n.forEach(a=>{let o=Fc.get(a);o||(o=new Set,Fc.set(a,o)),o.add(t),Vc?.observe(a)}),()=>{n.forEach(a=>{const o=Fc.get(a);o?.delete(t),o?.size||Vc?.unobserve(a)})}}const zc=new Set;let oo;function UI(){oo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};zc.forEach(t=>t(e))},window.addEventListener("resize",oo)}function BI(e){return zc.add(e),oo||UI(),()=>{zc.delete(e),!zc.size&&typeof oo=="function"&&(window.removeEventListener("resize",oo),oo=void 0)}}function Sk(e,t){return typeof e=="function"?BI(e):jI(e,t)}function FI(e){return rm(e)&&e.tagName==="svg"}const VI=[...Lw,Lt,or],zI=e=>VI.find(Rw(e)),Ck=()=>({translate:0,scale:1,origin:0,originPoint:0}),so=()=>({x:Ck(),y:Ck()}),Tk=()=>({min:0,max:0}),Ot=()=>({x:Tk(),y:Tk()}),$I=new WeakMap;function Mu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fs(e){return typeof e=="string"||Array.isArray(e)}const am=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],im=["initial",...am];function Iu(e){return Mu(e.animate)||im.some(t=>Fs(e[t]))}function Fw(e){return!!(Iu(e)||e.variants)}function HI(e,t,n){for(const a in t){const o=t[a],s=n[a];if(Gt(o))e.addValue(a,o);else if(Gt(s))e.addValue(a,vo(o,{owner:e}));else if(s!==o)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(a);e.addValue(a,vo(c!==void 0?c:o,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const $f={current:null},Vw={current:!1},WI=typeof window<"u";function KI(){if(Vw.current=!0,!!WI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$f.current=e.matches;e.addEventListener("change",t),t()}else $f.current=!1}const Ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mu={};function zw(e){mu=e}function GI(){return mu}class qI{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:o,skipAnimations:s,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=Yp,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=sn.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=o,this.skipAnimationsConfig=s,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=Iu(n),this.isVariantNode=Fw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...k}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in k){const x=k[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,$I.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:(Vw.current||KI(),this.shouldReduceMotion=$f.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&&ww.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:h,ease:f,duration:m}=n.accelerate,y=new _w({element:this.current,name:t,keyframes:u,times:h,ease:f,duration:Sn(m)}),k=c(y);this.valueSubscriptions.set(t,()=>{k(),y.cancel()});return}const a=xo.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=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 s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),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 mu){const n=mu[t];if(!n)continue;const{isEnabled:a,Feature:o}=n;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ot()}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<Ek.length;a++){const o=Ek[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,c=t[s];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=HI(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=vo(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"&&(F0(a)||z0(a))?a=parseFloat(a):!zI(a)&&or.test(n)&&(a=Mw(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 s=Qp(this.props,n,this.presenceContext?.custom);s&&(a=s[t])}if(n&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Gt(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Fp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){tm.render(this.render)}}class $w extends qI{constructor(){super(...arguments),this.KeyframeResolver=wI}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 ja{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Hw({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function YI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZI(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 Wh(e){return e===void 0||e===1}function Hf({scale:e,scaleX:t,scaleY:n}){return!Wh(e)||!Wh(t)||!Wh(n)}function ti(e){return Hf(e)||Ww(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ww(e){return Ak(e.x)||Ak(e.y)}function Ak(e){return e&&e!=="0%"}function gu(e,t,n){const a=e-n,o=t*a;return n+o}function Rk(e,t,n,a,o){return o!==void 0&&(e=gu(e,o,a)),gu(e,n,a)+t}function Wf(e,t=0,n=1,a,o){e.min=Rk(e.min,t,n,a,o),e.max=Rk(e.max,t,n,a,o)}function Kw(e,{x:t,y:n}){Wf(e.x,t.translate,t.scale,t.originPoint),Wf(e.y,n.translate,n.scale,n.originPoint)}const Lk=.999999999999,Dk=1.0000000000001;function XI(e,t,n,a=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,c;for(let u=0;u<o;u++){s=n[u],c=s.projectionDelta;const{visualElement:h}=s.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(mr(e.x,-s.scroll.offset.x),mr(e.y,-s.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Kw(e,c)),a&&ti(s.latestValues)&&$c(e,s.latestValues,s.layout?.layoutBox))}t.x<Dk&&t.x>Lk&&(t.x=1),t.y<Dk&&t.y>Lk&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function Mk(e,t,n,a,o=.5){const s=vt(e.min,e.max,o);Wf(e,t,n,s,a)}function Ik(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function $c(e,t,n){const a=n??e;Mk(e.x,Ik(t.x,a.x),t.scaleX,t.scale,t.originX),Mk(e.y,Ik(t.y,a.y),t.scaleY,t.scale,t.originY)}function Gw(e,t){return Hw(ZI(e.getBoundingClientRect(),t))}function QI(e,t,n){const a=Gw(e,n),{scroll:o}=t;return o&&(mr(a.x,o.offset.x),mr(a.y,o.offset.y)),a}const JI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eN=wo.length;function tN(e,t,n){let a="",o=!0;for(let s=0;s<eN;s++){const c=wo[s],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=Nw(u,em[c]);if(!h){o=!1;const m=JI[c]||c;a+=`${m}(${f}) `}n&&(t[c]=f)}}return a=a.trim(),n?a=n(t,o?"":a):o&&(a="none"),a}function om(e,t,n){const{style:a,vars:o,transformOrigin:s}=e;let c=!1,u=!1;for(const h in t){const f=t[h];if(xo.has(h)){c=!0;continue}else if(rw(h)){o[h]=f;continue}else{const m=Nw(f,em[h]);h.startsWith("origin")?(u=!0,s[h]=m):a[h]=m}}if(t.transform||(c||n?a.transform=tN(t,e.transform,n):a.transform&&(a.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:m=0}=s;a.transformOrigin=`${h} ${f} ${m}`}}function qw(e,{style:t,vars:n},a,o){const s=e.style;let c;for(c in t)s[c]=t[c];o?.applyProjectionStyles(s,a);for(c in n)s.setProperty(c,n[c])}function Nk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ms={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Nk(e,t.target.x),a=Nk(e,t.target.y);return`${n}% ${a}%`}},nN={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,o=or.parse(e);if(o.length>5)return a;const s=or.createTransformer(e),c=typeof o[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;o[0+c]/=u,o[1+c]/=h;const f=vt(u,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f),s(o)}},Kf={borderRadius:{...ms,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ms,borderTopRightRadius:ms,borderBottomLeftRadius:ms,borderBottomRightRadius:ms,boxShadow:nN};function Yw(e,{layout:t,layoutId:n}){return xo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kf[e]||e==="opacity")}function sm(e,t,n){const a=e.style,o=t?.style,s={};if(!a)return s;for(const c in a)(Gt(a[c])||o&&Gt(o[c])||Yw(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(s[c]=a[c]);return s}function rN(e){return window.getComputedStyle(e)}class aN extends $w{constructor(){super(...arguments),this.type="html",this.renderInstance=qw}readValueFromInstance(t,n){if(xo.has(n))return this.projection?.isProjecting?Df(n):P2(t,n);{const a=rN(t),o=(rw(n)?a.getPropertyValue(n):a[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Gw(t,n)}build(t,n,a){om(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return sm(t,n,a)}}const iN={offset:"stroke-dashoffset",array:"stroke-dasharray"},oN={offset:"strokeDashoffset",array:"strokeDasharray"};function sN(e,t,n=1,a=0,o=!0){e.pathLength=1;const s=o?iN:oN;e[s.offset]=`${-a}`,e[s.array]=`${t} ${n}`}const lN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Zw(e,{attrX:t,attrY:n,attrScale:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...u},h,f,m){if(om(e,u,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:k}=e;y.transform&&(k.transform=y.transform,delete y.transform),(k.transform||y.transformOrigin)&&(k.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),k.transform&&(k.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const w of lN)y[w]!==void 0&&(k[w]=y[w],delete y[w]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),o!==void 0&&sN(y,o,s,c,!1)}const Xw=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"]),Qw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cN(e,t,n,a){qw(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(Xw.has(o)?o:Jp(o),t.attrs[o])}function Jw(e,t,n){const a=sm(e,t,n);for(const o in e)if(Gt(e[o])||Gt(t[o])){const s=wo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[s]=e[o]}return a}class uN extends $w{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xo.has(n)){const a=Dw(n);return a&&a.default||0}return n=Xw.has(n)?n:Jp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Jw(t,n,a)}build(t,n,a){Zw(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,o){cN(t,n,a,o)}mount(t){this.isSVGTag=Qw(t.tagName),super.mount(t)}}const dN=im.length;function ex(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ex(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<dN;n++){const a=im[n],o=e.props[a];(Fs(o)||o===!1)&&(t[a]=o)}return t}function tx(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 hN=[...am].reverse(),fN=am.length;function pN(e){return t=>Promise.all(t.map(({animation:n,options:a})=>dI(e,n,a)))}function mN(e){let t=pN(e),n=Ok(),a=!0,o=!1;const s=f=>(m,y)=>{const k=si(e,y,f==="exit"?e.presenceContext?.custom:void 0);if(k){const{transition:w,transitionEnd:x,...C}=k;m={...m,...C,...x}}return m};function c(f){t=f(e)}function u(f){const{props:m}=e,y=ex(e.parent)||{},k=[],w=new Set;let x={},C=1/0;for(let D=0;D<fN;D++){const L=hN[D],R=n[L],O=m[L]!==void 0?m[L]:y[L],G=Fs(O),W=L===f?R.isActive:null;W===!1&&(C=D);let z=O===y[L]&&O!==m[L]&&G;if(z&&(a||o)&&e.manuallyAnimateOnMount&&(z=!1),R.protectedKeys={...x},!R.isActive&&W===null||!O&&!R.prevProp||Mu(O)||typeof O=="boolean")continue;if(L==="exit"&&R.isActive&&W!==!0){R.prevResolvedValues&&(x={...x,...R.prevResolvedValues});continue}const P=gN(R.prevProp,O);let Y=P||L===f&&R.isActive&&!z&&G||D>C&&G,X=!1;const ue=Array.isArray(O)?O:[O];let se=ue.reduce(s(L),{});W===!1&&(se={});const{prevResolvedValues:Ae={}}=R,fe={...Ae,...se},le=K=>{Y=!0,w.has(K)&&(X=!0,w.delete(K)),R.needsAnimating[K]=!0;const Z=e.getValue(K);Z&&(Z.liveStyle=!1)};for(const K in fe){const Z=se[K],H=Ae[K];if(x.hasOwnProperty(K))continue;let I=!1;Uf(Z)&&Uf(H)?I=!tx(Z,H):I=Z!==H,I?Z!=null?le(K):w.add(K):Z!==void 0&&w.has(K)?le(K):R.protectedKeys[K]=!0}R.prevProp=O,R.prevResolvedValues=se,R.isActive&&(x={...x,...se}),(a||o)&&e.blockInitialAnimation&&(Y=!1);const pe=z&&P;Y&&(!pe||X)&&k.push(...ue.map(K=>{const Z={type:L};if(typeof K=="string"&&(a||o)&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,I=si(H,K);if(H.enteringChildren&&I){const{delayChildren:q}=I.transition||{};Z.delay=xw(H.enteringChildren,e,q)}}return{animation:K,options:Z}}))}if(w.size){const D={};if(typeof m.initial!="boolean"){const L=si(e,Array.isArray(m.initial)?m.initial[0]:m.initial);L&&L.transition&&(D.transition=L.transition)}w.forEach(L=>{const R=e.getBaseTarget(L),O=e.getValue(L);O&&(O.liveStyle=!0),D[L]=R??null}),k.push({animation:D})}let S=!!k.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),a=!1,o=!1,S?t(k):Promise.resolve()}function h(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(k=>k.animationState?.setActive(f,m)),n[f].isActive=m;const y=u(f);for(const k in n)n[k].protectedKeys={};return y}return{animateChanges:u,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Ok(),o=!0}}}function gN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!tx(t,e):!1}function Ja(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ok(){return{animate:Ja(!0),whileInView:Ja(),whileHover:Ja(),whileTap:Ja(),whileDrag:Ja(),whileFocus:Ja(),exit:Ja()}}function Gf(e,t){e.min=t.min,e.max=t.max}function tr(e,t){Gf(e.x,t.x),Gf(e.y,t.y)}function jk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const nx=1e-4,yN=1-nx,vN=1+nx,rx=.01,kN=0-rx,_N=0+rx;function ln(e){return e.max-e.min}function bN(e,t,n){return Math.abs(e-t)<=n}function Uk(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>=yN&&e.scale<=vN||isNaN(e.scale))&&(e.scale=1),(e.translate>=kN&&e.translate<=_N||isNaN(e.translate))&&(e.translate=0)}function As(e,t,n,a){Uk(e.x,t.x,n.x,a?a.originX:void 0),Uk(e.y,t.y,n.y,a?a.originY:void 0)}function Bk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=o+t.min,e.max=e.min+ln(t)}function wN(e,t,n,a){Bk(e.x,t.x,n.x,a?.x),Bk(e.y,t.y,n.y,a?.y)}function Fk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=t.min-o,e.max=e.min+ln(t)}function yu(e,t,n,a){Fk(e.x,t.x,n.x,a?.x),Fk(e.y,t.y,n.y,a?.y)}function Vk(e,t,n,a,o){return e-=t,e=gu(e,1/n,a),o!==void 0&&(e=gu(e,1/o,a)),e}function xN(e,t=0,n=1,a=.5,o,s=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(s.min,s.max,a);e===s&&(u-=t),e.min=Vk(e.min,t,n,u,o),e.max=Vk(e.max,t,n,u,o)}function zk(e,t,[n,a,o],s,c){xN(e,t[n],t[a],t[o],t.scale,s,c)}const PN=["x","scaleX","originX"],SN=["y","scaleY","originY"];function $k(e,t,n,a){zk(e.x,t,PN,n?n.x:void 0,a?a.x:void 0),zk(e.y,t,SN,n?n.y:void 0,a?a.y:void 0)}function Hk(e){return e.translate===0&&e.scale===1}function ax(e){return Hk(e.x)&&Hk(e.y)}function Wk(e,t){return e.min===t.min&&e.max===t.max}function CN(e,t){return Wk(e.x,t.x)&&Wk(e.y,t.y)}function Kk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ix(e,t){return Kk(e.x,t.x)&&Kk(e.y,t.y)}function Gk(e){return ln(e.x)/ln(e.y)}function qk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pr(e){return[e("x"),e("y")]}function TN(e,t,n){let a="";const o=e.x.translate/t.x,s=e.y.translate/t.y,c=n?.z||0;if((o||s||c)&&(a=`translate3d(${o}px, ${s}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:k,skewX:w,skewY:x}=n;f&&(a=`perspective(${f}px) ${a}`),m&&(a+=`rotate(${m}deg) `),y&&(a+=`rotateX(${y}deg) `),k&&(a+=`rotateY(${k}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 ox=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],EN=ox.length,Yk=e=>typeof e=="string"?parseFloat(e):e,Zk=e=>typeof e=="number"||_e.test(e);function AN(e,t,n,a,o,s){o?(e.opacity=vt(0,n.opacity??1,RN(a)),e.opacityExit=vt(t.opacity??1,0,LN(a))):s&&(e.opacity=vt(t.opacity??1,n.opacity??1,a));for(let c=0;c<EN;c++){const u=ox[c];let h=Xk(t,u),f=Xk(n,u);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||Zk(h)===Zk(f)?(e[u]=Math.max(vt(Yk(h),Yk(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 Xk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const RN=sx(0,.5,X0),LN=sx(.5,.95,jn);function sx(e,t,n){return a=>a<e?0:a>t?1:n(Us(e,t,a))}function DN(e,t,n){const a=Gt(e)?e:vo(e);return a.start(Xp("",a,t,n)),a.animation}function Vs(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const MN=(e,t)=>e.depth-t.depth;class IN{constructor(){this.children=[],this.isDirty=!1}add(t){Up(this.children,t),this.isDirty=!0}remove(t){uu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(MN),this.isDirty=!1,this.children.forEach(t)}}function NN(e,t){const n=sn.now(),a=({timestamp:o})=>{const s=o-n;s>=t&&(Na(a),e(s-t))};return dt.setup(a,!0),()=>Na(a)}function Hc(e){return Gt(e)?e.get():e}class ON{constructor(){this.members=[]}add(t){Up(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 o=a.instance;(!o||o.isConnected===!1)&&!a.snapshot&&(uu(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(uu(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:o}=a.options,{layoutDependency:s}=t.options;(o===void 0||o!==s)&&(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 Wc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kh=["","X","Y","Z"],jN=1e3;let UN=0;function Gh(e,t,n,a){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function lx(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ew(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(o||s))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&lx(a)}function cx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(c={},u=t?.()){this.id=UN++,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(VN),this.nodes.forEach(GN),this.nodes.forEach(qN),this.nodes.forEach(zN)},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 IN)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Fp),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=rm(c)&&!FI(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 k=()=>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=NN(k,250),Wc.hasAnimatedSinceResize&&(Wc.hasAnimatedSinceResize=!1,this.nodes.forEach(e_)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:k,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||JN,{onLayoutAnimationStart:C,onLayoutAnimationComplete:S}=f.getProps(),D=!this.targetLayout||!ix(this.targetLayout,w),L=!y&&k;if(this.options.layoutRoot||this.resumeFrom||L||y&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Zp(x,"layout"),onPlay:C,onComplete:S};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(m,L)}else y||e_(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(YN),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&&lx(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(HN),this.nodes.forEach(Qk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Jk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(WN),this.nodes.forEach(KN),this.nodes.forEach(BN),this.nodes.forEach(FN)):this.nodes.forEach(Jk),this.clearAllSnapshots();const u=sn.now();Kt.delta=xr(0,1e3/60,u-Kt.timestamp),Kt.timestamp=u,Kt.isProcessing=!0,Uh.update.process(Kt),Uh.preRender.process(Kt),Uh.render.process(Kt),Kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($N),this.sharedNodes.forEach(ZN)}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=Ot()),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(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!ax(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(u||ti(this.latestValues)||m)&&(o(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)),eO(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Ot();const u=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tO))){const{scroll:f}=this.root;f&&(mr(u.x,f.offset.x),mr(u.y,f.offset.y))}return u}removeElementScroll(c){const u=Ot();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||Ot();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)),ti(y.latestValues)&&$c(f,y.latestValues,y.layout?.layoutBox)}return ti(this.latestValues)&&$c(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const u=Ot();tr(u,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!ti(f.latestValues))continue;let m;f.instance&&(Hf(f.latestValues)&&f.updateSnapshot(),m=Ot(),tr(m,f.measurePageBox())),$k(u,f.latestValues,f.snapshot?.layoutBox,m)}return ti(this.latestValues)&&$k(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 k=this.getClosestProjectingParent();k&&this.linkedParentVersion!==k.layoutVersion&&!k.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&k&&k.layout?this.createRelativeTarget(k,this.layout.layoutBox,k.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wN(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),Kw(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&k&&!!k.resumingFrom==!!this.resumingFrom&&!k.options.layoutScroll&&k.target&&this.animationProgress!==1?this.createRelativeTarget(k,this.target,k.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hf(this.parent.latestValues)||Ww(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=Ot(),this.relativeTargetOrigin=Ot(),yu(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,k=this.treeScale.y;XI(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=Ot());const{target:w}=c;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jk(this.prevProjectionDelta.x,this.projectionDelta.x),jk(this.prevProjectionDelta.y,this.projectionDelta.y)),As(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==k||!qk(this.projectionDelta.x,this.prevProjectionDelta.x)||!qk(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=so(),this.projectionDelta=so(),this.projectionDeltaWithTransform=so()}setAnimationOrigin(c,u=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},y=so();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const k=Ot(),w=h?h.source:void 0,x=this.layout?this.layout.source:void 0,C=w!==x,S=this.getStack(),D=!S||S.members.length<=1,L=!!(C&&!D&&this.options.crossfade===!0&&!this.path.some(QN));this.animationProgress=0;let R;this.mixTargetDelta=O=>{const G=O/1e3;t_(y.x,c.x,G),t_(y.y,c.y,G),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yu(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),XN(this.relativeTarget,this.relativeTargetOrigin,k,G),R&&CN(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Ot()),tr(R,this.relativeTarget)),C&&(this.animationValues=m,AN(m,f,this.latestValues,G,L,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(()=>{Wc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vo(0)),this.motionValue.jump(0,!1),this.currentAnimation=DN(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(jN),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&&ux(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||Ot();const y=ln(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const k=ln(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+k}tr(u,h),$c(u,m),As(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new ON),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&&Gh("z",c,f,this.animationValues);for(let m=0;m<Kh.length;m++)Gh(`rotate${Kh[m]}`,c,f,this.animationValues),Gh(`skew${Kh[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=Hc(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=Hc(u?.pointerEvents)||""),this.hasProjected&&!ti(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let y=TN(this.projectionDeltaWithTransform,this.treeScale,m);h&&(y=h(m,y)),c.transform=y;const{x:k,y:w}=this.projectionDelta;c.transformOrigin=`${k.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 Kf){if(m[x]===void 0)continue;const{correct:C,applyTo:S,isCSSVariable:D}=Kf[x],L=y==="none"?m[x]:C(m[x],f);if(S){const R=S.length;for(let O=0;O<R;O++)c[S[O]]=L}else D?this.options.visualElement.renderState.vars[x]=L:c[x]=L}this.options.layoutId&&(c.pointerEvents=f===this?Hc(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Qk),this.root.sharedNodes.clear()}}}function BN(e){e.updateLayout()}function FN(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:o}=e.options,s=t.source!==e.layout.source;if(o==="size")pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(y);y.min=n[m].min,y.max=y.min+k});else if(o==="x"||o==="y"){const m=o==="x"?"y":"x";Gf(s?t.measuredBox[m]:t.layoutBox[m],n[m])}else ux(o,t.layoutBox,n)&&pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(n[m]);y.max=y.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+k)});const c=so();As(c,n,t.layoutBox);const u=so();s?As(u,e.applyTransform(a,!0),t.measuredBox):As(u,n,t.layoutBox);const h=!ax(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:k}=m;if(y&&k){const w=e.options.layoutAnchor||void 0,x=Ot();yu(x,t.layoutBox,y.layoutBox,w);const C=Ot();yu(C,n,k.layoutBox,w),ix(x,C)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=C,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 VN(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 zN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $N(e){e.clearSnapshot()}function Qk(e){e.clearMeasurements()}function HN(e){e.isLayoutDirty=!0,e.updateLayout()}function Jk(e){e.isLayoutDirty=!1}function WN(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function KN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function e_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GN(e){e.resolveTargetDelta()}function qN(e){e.calcProjection()}function YN(e){e.resetSkewAndRotation()}function ZN(e){e.removeLeadSnapshot()}function t_(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 n_(e,t,n,a){e.min=vt(t.min,n.min,a),e.max=vt(t.max,n.max,a)}function XN(e,t,n,a){n_(e.x,t.x,n.x,a),n_(e.y,t.y,n.y,a)}function QN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JN={duration:.45,ease:[.4,0,.1,1]},r_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),a_=r_("applewebkit/")&&!r_("chrome/")?Math.round:jn;function i_(e){e.min=a_(e.min),e.max=a_(e.max)}function eO(e){i_(e.x),i_(e.y)}function ux(e,t,n){return e==="position"||e==="preserve-aspect"&&!bN(Gk(t),Gk(n),.2)}function tO(e){return e!==e.root&&e.scroll?.wasRoot}const nO=cx({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qh={current:void 0},dx=cx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qh.current){const e=new nO({});e.mount(window),e.setOptions({layoutScroll:!0}),qh.current=e}return qh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function o_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rO(...e){return t=>{let n=!1;const a=e.map(o=>{const s=o_(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<a.length;o++){const s=a[o];typeof s=="function"?s():o_(e[o],null)}}}}function aO(...e){return b.useCallback(rO(...e),e)}class iO extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Uc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,o=Uc(a)&&a.offsetWidth||0,s=Uc(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=o-u.width-u.left,u.bottom=s-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function oO({children:e,isPresent:t,anchorX:n,anchorY:a,root:o,pop:s}){const c=b.useId(),u=b.useRef(null),h=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=b.useContext(lm),m=e.props?.ref??e?.ref,y=aO(u,m);return b.useInsertionEffect(()=>{const{width:k,height:w,top:x,left:C,right:S,bottom:D}=h.current;if(t||s===!1||!u.current||!k||!w)return;const L=n==="left"?`left: ${C}`:`right: ${S}`,R=a==="bottom"?`bottom: ${D}`:`top: ${x}`;u.current.dataset.motionPopId=c;const O=document.createElement("style");f&&(O.nonce=f);const G=o??document.head;return G.appendChild(O),O.sheet&&O.sheet.insertRule(`
838
840
  [data-motion-pop-id="${c}"] {
839
841
  position: absolute !important;
840
842
  width: ${k}px !important;
@@ -842,4 +844,4 @@ local_only.download,dashboard,LocalOnlyNotice,LocalOnlyNotice,download,"Get the
842
844
  ${L}px !important;
843
845
  ${R}px !important;
844
846
  }
845
- `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(O)&&G.removeChild(O)}},[t]),N.jsx(aO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:y})})}const oO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(sO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const C of m.values())if(!C)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&k&&(w={...w}),b.useMemo(()=>{m.forEach((x,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(iO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function sO(){return new Map}function dx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const c=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,c]:[!0]}const _c=e=>e.key||"";function s_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const lO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=dx(c),k=b.useMemo(()=>s_(e),[e]),w=c&&!m?[]:k.map(_c),x=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,G]=b.useState(k);U0(()=>{x.current=!1,C.current=k;for(let P=0;P<O.length;P++){const Y=_c(O[P]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const W=[];if(k!==L){let P=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],ue=_c(X);w.includes(ue)||(P.splice(Y,0,X),W.push(X))}return s==="wait"&&W.length&&(P=W),G(s_(P)),R(k),null}const{forceRender:z}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(P=>{const Y=_c(P),X=c&&!m?!1:k===O||w.includes(Y),ue=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let se=!0;S.forEach(Ae=>{Ae||(se=!1)}),se&&(z?.(),G(C.current),c&&y?.(),a&&a())};return N.jsx(oO,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:X?void 0:ue,anchorX:u,anchorY:h,children:P},Y)})})},hx=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function cO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};Vw(e),c_=!0}function fx(){return cO(),KI()}function uO(e){const t=fx();for(const n in e)t[n]={...t[n],...e[n]};Vw(t)}const dO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dO.has(e)}let px=e=>!vu(e);function hO(e){typeof e=="function"&&(px=t=>t.startsWith("on")?!vu(t):e(t))}try{hO(require("@emotion/is-prop-valid").default)}catch{}function fO(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Gt(e[o])||(px(o)||n===!0&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const Nu=b.createContext({});function pO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Bs(n)?n:void 0,animate:Bs(a)?a:void 0}}return e.inherit!==!1?t:{}}function mO(e){const{initial:t,animate:n}=pO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mx(e,t,n){for(const a in t)!Gt(t[a])&&!qw(a,n)&&(e[a]=t[a])}function gO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return om(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yO(e,t){const n=e.style||{},a={};return mx(a,n,e),Object.assign(a,gO(e,t)),a}function vO(e,t){const n={},a=yO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const gx=()=>({...cm(),attrs:{}});function kO(e,t,n,a){const o=b.useMemo(()=>{const s=gx();return Yw(s,t,Xw(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mx(s,e.style,e),o.style={...s,...o.style}}return o}const _O=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function um(e){return typeof e!="string"||e.includes("-")?!1:!!(_O.indexOf(e)>-1||/[A-Z]/u.test(e))}function bO(e,t,n,{latestValues:a},o,s=!1,c){const h=(c??um(e)?kO:vO)(t,a,o,e),f=fO(t,typeof e=="string",s),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function wO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:xO(n,a,o,e),renderState:t()}}function xO(e,t,n,a){const o={},s=a(e,{});for(const k in s)o[k]=Hc(s[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=Bw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const x=Qp(e,k[w]);if(x){const{transitionEnd:C,transition:S,...D}=x;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(o[L]=R)}for(const L in C)o[L]=C[L]}}}return o}const yx=e=>(t,n)=>{const a=b.useContext(Nu),o=b.useContext(Lu),s=()=>wO(e,t,a,o);return n?s():jp(s)},PO=yx({scrapeMotionValuesFromProps:sm,createRenderState:cm}),SO=yx({scrapeMotionValuesFromProps:Qw,createRenderState:gx}),CO=Symbol.for("motionComponentSymbol");function TO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const o=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s);const c=a.current;if(typeof c=="function")if(s){const u=c(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):c(s);else c&&(c.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const vx=b.createContext({});function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EO(e,t,n,a,o,s){const{visualElement:c}=b.useContext(Nu),u=b.useContext(hx),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const x=k.current,C=b.useContext(vx);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&AO(k.current,n,o,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{x&&S.current&&x.update(n,h)});const D=n[Cw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return U0(()=>{w.current=!0,x&&(S.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),L.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!L.current&&x.animationState&&x.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),x.enteringChildren=void 0)}),x}function AO(e,t,n,a){const{layoutId:o,layout:s,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kx(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!c||u&&to(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function kx(e){if(e)return e.options.allowProjection!==!1?e.projection:kx(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&uO(a);const s=n?n==="svg":um(e),c=s?SO:PO;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:RO(f)},{isStatic:w}=k,x=mO(f),C=c(f,w);if(!w&&typeof window<"u"){LO();const S=DO(k);y=S.MeasureLayout,x.visualElement=EO(e,C,k,o,S.ProjectionNode,s)}return N.jsxs(Nu.Provider,{value:x,children:[y&&x.visualElement?N.jsx(y,{visualElement:x.visualElement,...k}):null,bO(e,f,TO(C,x.visualElement,m),C,w,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[CO]=e,h}function RO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function LO(e,t){b.useContext(hx).strict}function DO(e){const t=fx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(s,c)=>Yh(s,c,e,t),o=(s,c)=>a(s,c);return new Proxy(o,{get:(s,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const IO=(e,t)=>t.isSVG??um(e)?new cN(t):new rN(t,{allowProjection:e!==b.Fragment});class NO extends ja{constructor(t){super(t),t.animationState||(t.animationState=pN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let OO=0;class jO extends ja{constructor(){super(...arguments),this.id=OO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:c}=this.node.getProps();if(typeof s=="string"){const u=si(this.node,s,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UO={animation:{Feature:NO},exit:{Feature:jO}};function nl(e){return{point:{x:e.pageX,y:e.pageY}}}const BO=e=>t=>nm(t)&&e(t,nl(t));function As(e,t,n,a){return Fs(e,t,BO(n),a)}const _x=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function FO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class bx{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=FO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;x||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const h=nl(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Js(As(this.contextWindow,"pointermove",this.handlePointerMove),As(this.contextWindow,"pointerup",this.handlePointerUp),As(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,wx(t)),offset:f_(e,VO(t)),velocity:zO(t,.1)}}function VO(e){return e[0]}function wx(e){return e[e.length-1]}function zO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=wx(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const s=On(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const c={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function $O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function HO(e,{top:t,left:n,bottom:a,right:o}){return{x:p_(e.x,n,o),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function WO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function KO(e,t){let n=.5;const a=ln(e),o=ln(t);return o>a?n=js(t.min,t.max-a,e.min):a>o&&(n=js(e.min,e.max-o,t.min)),xr(0,1,n)}function GO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const qf=.35;function qO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const YO=new WeakMap;class ZO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(nl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:x,onDragStart:C}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(x&&this.currentDirection===null){this.currentDirection=QO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new bx(t,{onSessionStart:s,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:_x(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=$O(c,this.constraints[t],this.elastic[t])),s.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&to(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=HO(a.layoutBox,t):this.constraints=!1,this.elastic=qO(n),o!==this.constraints&&!to(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=GO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XI(a,o.root,this.visualElement.getTransformPagePoint());let c=WO(o.layout.layoutBox,s);if(n){const u=n(qI(c));this.hasMutatedConstraints=!!u,u&&(c=$w(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!wc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!wc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:u}=o.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!to(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();o[c]=KO({min:h,max:h},this.constraints[c])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;YO.set(this.visualElement,this);const t=this.visualElement.current,n=As(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&EI(k);m&&y&&!w&&this.start(f)});let a;const o=()=>{const{dragConstraints:f}=this.getProps();to(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=XO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,c=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),dt.read(o);const u=Fs(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function XO(e,t,n){const a=Sk(e,v_(n)),o=Sk(t,v_(n));return()=>{a(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class JO extends ja{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new ZO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class e3 extends ja{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new bx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_x(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(s,c)=>{delete this.session,o&&dt.postRender(()=>o(s,c))}}}mount(){this.removePointerDownListener=As(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class t3 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),Qh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:c}=a;return c&&(c.isPresent=s,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?c.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;Qh=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xx(e){const[t,n]=dx(),a=b.useContext(Op);return N.jsx(t3,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(vx),isPresent:t,safeToRemove:n})}const n3={pan:{Feature:e3},drag:{Feature:JO,ProjectionNode:ux,MeasureLayout:xx}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class r3 extends ja{mount(){const{current:t}=this.node;t&&(this.unmount=PI(t,(n,a)=>(k_(this.node,a,"Start"),o=>k_(this.node,o,"End"))))}unmount(){}}class a3 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Js(Fs(this.node.current,"focus",()=>this.onFocus()),Fs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class i3 extends ja{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=RI(t,(o,s)=>(__(this.node,s,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,o3=e=>{const t=Yf.get(e.target);t&&t(e)},s3=e=>{e.forEach(o3)};function l3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(s3,{root:e,...t})),a[o]}function c3(e,t,n){const a=l3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const u3={some:0,all:1};class d3 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:u3[o]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=c3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(h3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function h3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const f3={inView:{Feature:d3},tap:{Feature:i3},focus:{Feature:a3},hover:{Feature:r3}},p3={layout:{ProjectionNode:ux,MeasureLayout:xx}},m3={...UO,...f3,...n3,...p3},ef=MO(m3,IO);function Px(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Px(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function g3(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Px(e))&&(a&&(a+=" "),a+=t);return a}const y3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},v3=(e,t)=>({classGroupId:e,validator:t}),Sx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ku="-",b_=[],k3="arbitrary..",_3=e=>{const t=w3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return b3(c);const u=c.split(ku),h=u[0]===""&&u.length>1?1:0;return Cx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?y3(f,h):h:f||b_}return n[c]||b_}}},Cx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=Cx(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(ku):e.slice(t).join(ku),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},b3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?k3+a:void 0})(),w3=e=>{const{theme:t,classGroups:n}=e;return x3(n,t)},x3=(e,t)=>{const n=Sx();for(const a in e){const o=e[a];dm(o,n,a,t)}return n},dm=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const c=e[s];P3(c,t,n,a)}},P3=(e,t,n,a)=>{if(typeof e=="string"){S3(e,t,n);return}if(typeof e=="function"){C3(e,t,n,a);return}T3(e,t,n,a)},S3=(e,t,n)=>{const a=e===""?t:Tx(t,e);a.classGroupId=n},C3=(e,t,n,a)=>{if(E3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(v3(n,e))},T3=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let c=0;c<s;c++){const[u,h]=o[c];dm(h,Tx(t,u),n,a)}},Tx=(e,t)=>{let n=e;const a=t.split(ku),o=a.length;for(let s=0;s<o;s++){const c=a[s];let u=n.nextPart.get(c);u||(u=Sx(),n.nextPart.set(c,u)),n=u}return n},E3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,A3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return o(s,c),c},set(s,c){s in n?n[s]=c:o(s,c)}}},Zf="!",w_=":",R3=[],x_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),L3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,h=0,f;const m=o.length;for(let C=0;C<m;C++){const S=o[C];if(c===0&&u===0){if(S===w_){s.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=s.length===0?o:o.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return x_(s,w,k,x)};if(t){const o=t+w_,s=a;a=c=>c.startsWith(o)?s(c.slice(o.length)):x_(R3,!1,c,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},D3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const c=n[s],u=c[0]==="[",h=t.has(c);u||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},M3=e=>({cache:A3(e.cacheSize),parseClassName:L3(e),sortModifiers:D3(e),..._3(e)}),I3=/\s+/,N3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(I3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?x.substring(0,C):x);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:s(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const G=o(D,S);for(let W=0;W<G.length;++W){const z=G[W];c.push(R+z)}h=m+(h.length>0?" "+h:h)}return h},O3=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Ex(n))&&(o&&(o+=" "),o+=a);return o},Ex=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Ex(e[a]))&&(n&&(n+=" "),n+=t);return n},j3=(e,...t)=>{let n,a,o,s;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=M3(f),a=n.cache.get,o=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=N3(h,n);return o(h,m),m};return s=c,(...h)=>s(O3(...h))},U3=[],Nt=e=>{const t=n=>n[e]||U3;return t.isThemeGetter=!0,t},Ax=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,B3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>B3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Pa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>F3.test(e),Lx=()=>!0,W3=e=>V3.test(e)&&!z3.test(e),hm=()=>!1,K3=e=>$3.test(e),G3=e=>H3.test(e),q3=e=>!ke(e)&&!be(e),Y3=e=>Ua(e,Ix,hm),ke=e=>Ax.test(e),ei=e=>Ua(e,Nx,W3),P_=e=>Ua(e,rj,qe),Z3=e=>Ua(e,jx,Lx),X3=e=>Ua(e,Ox,hm),S_=e=>Ua(e,Dx,hm),Q3=e=>Ua(e,Mx,G3),xc=e=>Ua(e,Ux,K3),be=e=>Rx.test(e),ms=e=>gi(e,Nx),J3=e=>gi(e,Ox),C_=e=>gi(e,Dx),ej=e=>gi(e,Ix),tj=e=>gi(e,Mx),Pc=e=>gi(e,Ux,!0),nj=e=>gi(e,jx,!0),Ua=(e,t,n)=>{const a=Ax.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Rx.exec(e);return a?a[1]?t(a[1]):n:!1},Dx=e=>e==="position"||e==="percentage",Mx=e=>e==="image"||e==="url",Ix=e=>e==="length"||e==="size"||e==="bg-size",Nx=e=>e==="length",rj=e=>e==="number",Ox=e=>e==="family-name",jx=e=>e==="number"||e==="weight",Ux=e=>e==="shadow",aj=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),o=Nt("tracking"),s=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),x=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...O(),be,ke],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[be,ke,h],Y=()=>[xa,"full","auto",...P()],X=()=>[Pa,"none","subgrid",be,ke],ue=()=>["auto",{span:["full",Pa,be,ke]},Pa,be,ke],se=()=>[Pa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],pe=()=>["auto",...P()],Ne=()=>[xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],K=()=>[xa,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Z=()=>[xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",ej,Y3,{size:[be,ke]}],Re=()=>[tf,ms,ei],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,ms,ei],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",x,be,ke],Hn=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[xa,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Lx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[q3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",be,ke]}],basis:[{basis:[xa,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,xa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[Pa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ue()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ue()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:pe()}],mx:[{mx:pe()}],my:[{my:pe()}],ms:[{ms:pe()}],me:[{me:pe()}],mbs:[{mbs:pe()}],mbe:[{mbe:pe()}],mt:[{mt:pe()}],mr:[{mr:pe()}],mb:[{mb:pe()}],ml:[{ml:pe()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,ms,ei]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,nj,Z3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[J3,X3,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,ei]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,be,ke],radial:["",be,ke],conic:[Pa,be,ke]},tj,Q3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,ms,ei]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Pc,xc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,xc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,ei]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,Pc,xc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,Pc,xc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,ms,ei,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ij=j3(aj);function Tt(...e){return ij(g3(e))}const oj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),sj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),lj={google:oj,github:sj},cj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function uj(e){return cj[e]||String(e||"").replace(/-/g," ")}function dj(){Qs();const{isOpen:e,closeLoginModal:t}=j0(),{enabled:n,signedIn:a,refreshUser:o,signInWithPassword:s,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Zs(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,x]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[G,W]=b.useState(null),[z,P]=b.useState(!1),[Y,X]=b.useState(!0),[ue,se]=b.useState([]),[Ae,fe]=b.useState(8);b.useEffect(()=>{e&&(O(null),W(null),m("signin"),k(""),x(""),S(""),P(!1))},[e]),b.useEffect(()=>{if(!e||!n||ue.length>0)return;let K=!0;return X(!0),(async()=>{const{data:Z,error:H}=await h();if(K){if(H||!Z)se(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];se([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&fe(Z.passwordMinLength)}X(!1)}})(),()=>{K=!1}},[e,n,h,ue.length]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const le=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),pe=b.useCallback(async K=>{O(null),L(!0);try{const{error:Z}=await u(K,le);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,le]),Ne=b.useCallback(async K=>{K.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){W(Fe("login.verify_email_pending")),m("signin");return}await o();return}const{error:Z}=await s({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await o()}finally{L(!1)}},[f,y,w,C,c,s,o]);return b.useEffect(()=>{if(!e)return;const K=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,t]),n?N.jsx(lO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:K=>K.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(I0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsxs("div",{className:"space-y-2.5",children:[N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ue.map(K=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>pe(K),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[lj[K]||null,Fe("login.oauth.continue",{provider:uj(K)})]},K))}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:K=>S(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:K=>k(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:K=>x(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>P(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx(GD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const hj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},G4="https://tokentracker.statuspage.io/";function fj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?hj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||Wr()).trim()}function q4(){return Wr()}function pj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const mj=300*1e3,gj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function yj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+gj<=t:!0}async function Bx(e,t){const n=Wr();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),o=Ks(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function vj(e){const t=Wr();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Ks(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||Wr();fm(o)&&(a.insforgeBaseUrl=o.trim());const s=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=r0();if(n&&!yj(n))return n;const a=await vj(t);return a?(BR(a),a):null}async function Fx(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}catch(a){if(!r0()||(a0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}}async function kj(e){const t=FR();if(Date.now()-t<mj)return;const n=await Fx(e);n&&(i0(Date.now()),await Bx(n,"cloud-sync-auto"))}async function Y4(e){const t=await Fx(e);t&&(i0(Date.now()),await Bx(t,"cloud-sync-now"))}function _j(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function bj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||_j(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function wj(){const e=Fn(),t=Zs(),n=b.useRef(!1);b.useEffect(()=>{if(!jR()||!bj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!UR())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await kj(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function xj(){const e=b.useContext(N0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function Pj({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Sj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function Cj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Sc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Qs();const o=t==="sidebar",{enabled:s,loading:c,signedIn:u,user:h,displayName:f}=Zs(),{openLoginModal:m}=j0(),y=wu(),k=b.useMemo(()=>Sj(h),[h]),w=b.useMemo(()=>Cj(k),[k]),[x,C]=Rs.useState(!1);if(Rs.useEffect(()=>{C(!1)},[w]),!s)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(o?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:o&&n?f:void 0,children:[o?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!x?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)})}):w&&!x?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)}),o?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function Tj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:BD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:VD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:cM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:WD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:eM,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:$D,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:aM,label:Fe("nav.settings")}]}]}function Ej(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Aj(){const[e,t]=b.useState(Ej),n=b.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,o?"1":"0")}catch{}return o})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Xf&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Rj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Lj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Dj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return N.jsxs(Pu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Mj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:o}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:o})}function Ij({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Pj({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Nj=[{value:"light",label:"Light",Icon:M0},{value:"dark",label:"Dark",Icon:D0},{value:"system",label:"System",Icon:XD}];function Oj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=b.useState(!1),c=b.useRef(null),u=t==="dark"?D0:M0;return b.useEffect(()=>{if(!o)return;const h=m=>{c.current&&!c.current.contains(m.target)&&s(!1)},f=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[o]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Nj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function Vx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=xj(),{resolvedLocale:y}=Qs(),k=b.useMemo(()=>Tj(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:o,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(I0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,x)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Lj,{label:w.label,collapsed:e,first:x===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Dj,{item:C,collapsed:e,active:Rj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(Oj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:s}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Ij,{glassChrome:s})})]})]})}function jj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(Vx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Uj({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(Vx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Bj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Mj,{title:Fe("nav.menu"),onClick:e,children:N.jsx(YD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(Pu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Fj({children:e}){const{collapsed:t,toggle:n}=Aj(),[a,o]=b.useState(!1),s=b.useCallback(()=>o(!0),[]),c=b.useCallback(()=>o(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(jj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Uj,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Bj,{onOpenDrawer:s}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const Vj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(Vj),Cc=R_.get("insforge_code")||R_.get("code")||null,zj=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function $j(){Qs();const{loading:e,signedIn:t}=Zs(),n=wu(),[a,o]=b.useState("processing"),[s,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Cc||u.current)){if(u.current=!0,zj){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Cc)return;o("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Cc)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Cc&&s===null){const f=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Hj=b.lazy(()=>$n(()=>import("./DashboardPage-CE6rXaDb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Wj=b.lazy(()=>$n(()=>import("./IpCheckPage-w_9rNG-h.js"),[])),Kj=b.lazy(()=>$n(()=>import("./LandingPage-DgoBKDAF.js"),__vite__mapDeps([11,12,8])).then(e=>({default:e.LandingPage}))),Gj=b.lazy(()=>$n(()=>import("./LeaderboardPage-7NZW_w9s.js"),__vite__mapDeps([13,9,2,14,15])).then(e=>({default:e.LeaderboardPage}))),qj=b.lazy(()=>$n(()=>import("./LeaderboardProfilePage-CPRBCIpv.js"),__vite__mapDeps([16,2,12,17,14,9,3,4,18,5])).then(e=>({default:e.LeaderboardProfilePage}))),Yj=b.lazy(()=>$n(()=>import("./LimitsPage-Owevo_3t.js"),__vite__mapDeps([19,1,20,7,10,8,21,18,22])).then(e=>({default:e.LimitsPage}))),Zj=b.lazy(()=>$n(()=>import("./LoginPage-WfWomtGZ.js"),[]).then(e=>({default:e.LoginPage}))),Xj=b.lazy(()=>$n(()=>import("./DevicePage-C20ToZWK.js"),[])),Qj=b.lazy(()=>$n(()=>import("./WrappedPage-N2OH7zP0.js"),[])),Jj=b.lazy(()=>$n(()=>import("./SettingsPage-C2uIIIOc.js"),__vite__mapDeps([23,20,24,7,25,2,15,4,22])).then(e=>({default:e.SettingsPage}))),e4=b.lazy(()=>$n(()=>import("./SkillsPage-JcjtKJsW.js"),__vite__mapDeps([26,21,18,22,7,5,4,9,25,6,8,15])).then(e=>({default:e.SkillsPage}))),t4=b.lazy(()=>$n(()=>import("./WidgetsPage-De3IzSrW.js"),__vite__mapDeps([27,24,7,10,8,18,22,15])).then(e=>({default:e.WidgetsPage})));function n4(){const{resolvedLocale:e}=Qs(),t=Fn(),n=Zs();wj();const a=Sn(),o=b.useMemo(()=>typeof window>"u"?!1:pj(window.location.search),[]),s=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=s.replace(/\/+$/,"")||"/",C=x==="/leaderboard",S=x.match(/^\/u\/([^/]+)$/i),D=S?S[1]:null,L=!!(n.enabled&&n.signedIn),R=w||L,O=!1,G=fj(),W=b.useMemo(()=>!n.enabled||!L?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[L,n]);let z=w||a||o?"dashboard":"landing";x==="/landing"&&(z="landing"),x==="/dashboard"&&(z="dashboard"),C&&(z="dashboard"),D&&(z="dashboard");const P=x==="/limits",Y=x==="/settings",X=x==="/skills",ue=x==="/widgets",se=x==="/ip-check";(P||Y||X||ue||se)&&(z="dashboard");let Ae=Hj;D?Ae=qj:x==="/leaderboard"?Ae=Gj:P?Ae=Yj:Y?Ae=Jj:X?Ae=e4:ue?Ae=t4:se&&(Ae=Wj);const fe=!k&&(x==="/dashboard"||x==="/"||C||P||Y||X||ue||se);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=N.jsx($j,{});else if(x==="/login")le=N.jsx(Zj,{});else if(x==="/device")le=N.jsx(Xj,{});else if(x==="/wrapped")le=N.jsx(Qj,{});else if(z==="landing")le=N.jsx(Kj,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=N.jsx(Ae,{baseUrl:G,auth:W,signedIn:R,sessionSoftExpired:O,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,userId:D,signInUrl:"/login",signUpUrl:"/login"},e);fe?le=N.jsx(Fj,{children:pe}):le=pe}return N.jsx(hM,{children:N.jsx(mM,{children:N.jsxs(gM,{children:[N.jsx(b.Suspense,{fallback:null,children:le}),N.jsx(dj,{}),N.jsx(_D,{}),N.jsx(LD,{})]})})})}const r4=W1([{path:"*",element:N.jsx(n4,{})}]);MS.createRoot(document.getElementById("root")).render(N.jsx(Rs.StrictMode,{children:N.jsx(JL,{children:N.jsx(oD,{children:N.jsx(RL,{children:N.jsx(aT,{router:r4})})})})}));export{Aa as $,g0 as A,Fe as B,N as C,ef as D,Nc as E,S4 as F,P4 as G,Ns as H,dM as I,pu as J,O4 as K,Pu as L,lm as M,m4 as N,p4 as O,lO as P,xj as Q,Rs as R,Tt as S,j0 as T,Zs as U,b4 as V,A4 as W,I0 as X,Qs as Y,pj as Z,$n as _,Gt as a,M4 as a0,C4 as a1,YR as a2,g4 as a3,y4 as a4,I4 as a5,x4 as a6,_4 as a7,A_ as a8,G4 as a9,nM as aA,iD as aB,Ep as aC,Lp as aD,H4 as aE,ar as aF,Ip as aG,z4 as aH,W4 as aI,$4 as aJ,Ss as aK,Fw as aL,WI as aM,$f as aN,D4 as aO,ES as aP,Qf as aQ,rT as aa,Fn as ab,wu as ac,q4 as ad,UR as ae,d4 as af,Y4 as ag,h4 as ah,L4 as ai,cM as aj,Pj as ak,aM as al,F4 as am,a4 as an,NR as ao,Op as ap,jR as aq,Zv as ar,R4 as as,M0 as at,D0 as au,XD as av,mo as aw,iu as ax,Dp as ay,w4 as az,U0 as b,dn as c,Na as d,kk as e,dt as f,y0 as g,Sn as h,h2 as i,f4 as j,$R as k,V4 as l,yo as m,aL as n,iL as o,j4 as p,k4 as q,b as r,E4 as s,U4 as t,jp as u,B4 as v,v4 as w,yt as x,T4 as y,N4 as z};
847
+ `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(O)&&G.removeChild(O)}},[t]),N.jsx(iO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:y})})}const sO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(lO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const C of m.values())if(!C)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&k&&(w={...w}),b.useMemo(()=>{m.forEach((x,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(oO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function lO(){return new Map}function hx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const c=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,c]:[!0]}const _c=e=>e.key||"";function s_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const cO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=hx(c),k=b.useMemo(()=>s_(e),[e]),w=c&&!m?[]:k.map(_c),x=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,G]=b.useState(k);B0(()=>{x.current=!1,C.current=k;for(let P=0;P<O.length;P++){const Y=_c(O[P]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const W=[];if(k!==L){let P=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],ue=_c(X);w.includes(ue)||(P.splice(Y,0,X),W.push(X))}return s==="wait"&&W.length&&(P=W),G(s_(P)),R(k),null}const{forceRender:z}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(P=>{const Y=_c(P),X=c&&!m?!1:k===O||w.includes(Y),ue=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let se=!0;S.forEach(Ae=>{Ae||(se=!1)}),se&&(z?.(),G(C.current),c&&y?.(),a&&a())};return N.jsx(sO,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:X?void 0:ue,anchorX:u,anchorY:h,children:P},Y)})})},fx=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function uO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};zw(e),c_=!0}function px(){return uO(),GI()}function dO(e){const t=px();for(const n in e)t[n]={...t[n],...e[n]};zw(t)}const hO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hO.has(e)}let mx=e=>!vu(e);function fO(e){typeof e=="function"&&(mx=t=>t.startsWith("on")?!vu(t):e(t))}try{fO(require("@emotion/is-prop-valid").default)}catch{}function pO(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Gt(e[o])||(mx(o)||n===!0&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const Nu=b.createContext({});function mO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Fs(n)?n:void 0,animate:Fs(a)?a:void 0}}return e.inherit!==!1?t:{}}function gO(e){const{initial:t,animate:n}=mO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gx(e,t,n){for(const a in t)!Gt(t[a])&&!Yw(a,n)&&(e[a]=t[a])}function yO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return om(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vO(e,t){const n=e.style||{},a={};return gx(a,n,e),Object.assign(a,yO(e,t)),a}function kO(e,t){const n={},a=vO(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 yx=()=>({...cm(),attrs:{}});function _O(e,t,n,a){const o=b.useMemo(()=>{const s=yx();return Zw(s,t,Qw(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};gx(s,e.style,e),o.style={...s,...o.style}}return o}const bO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function um(e){return typeof e!="string"||e.includes("-")?!1:!!(bO.indexOf(e)>-1||/[A-Z]/u.test(e))}function wO(e,t,n,{latestValues:a},o,s=!1,c){const h=(c??um(e)?_O:kO)(t,a,o,e),f=pO(t,typeof e=="string",s),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function xO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:PO(n,a,o,e),renderState:t()}}function PO(e,t,n,a){const o={},s=a(e,{});for(const k in s)o[k]=Hc(s[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=Fw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const x=Qp(e,k[w]);if(x){const{transitionEnd:C,transition:S,...D}=x;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(o[L]=R)}for(const L in C)o[L]=C[L]}}}return o}const vx=e=>(t,n)=>{const a=b.useContext(Nu),o=b.useContext(Lu),s=()=>xO(e,t,a,o);return n?s():jp(s)},SO=vx({scrapeMotionValuesFromProps:sm,createRenderState:cm}),CO=vx({scrapeMotionValuesFromProps:Jw,createRenderState:yx}),TO=Symbol.for("motionComponentSymbol");function EO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const o=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s);const c=a.current;if(typeof c=="function")if(s){const u=c(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):c(s);else c&&(c.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const kx=b.createContext({});function no(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function AO(e,t,n,a,o,s){const{visualElement:c}=b.useContext(Nu),u=b.useContext(fx),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const x=k.current,C=b.useContext(kx);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&RO(k.current,n,o,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{x&&S.current&&x.update(n,h)});const D=n[Tw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return B0(()=>{w.current=!0,x&&(S.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),L.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!L.current&&x.animationState&&x.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),x.enteringChildren=void 0)}),x}function RO(e,t,n,a){const{layoutId:o,layout:s,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:_x(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!c||u&&no(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function _x(e){if(e)return e.options.allowProjection!==!1?e.projection:_x(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&dO(a);const s=n?n==="svg":um(e),c=s?CO:SO;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:LO(f)},{isStatic:w}=k,x=gO(f),C=c(f,w);if(!w&&typeof window<"u"){DO();const S=MO(k);y=S.MeasureLayout,x.visualElement=AO(e,C,k,o,S.ProjectionNode,s)}return N.jsxs(Nu.Provider,{value:x,children:[y&&x.visualElement?N.jsx(y,{visualElement:x.visualElement,...k}):null,wO(e,f,EO(C,x.visualElement,m),C,w,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[TO]=e,h}function LO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function DO(e,t){b.useContext(fx).strict}function MO(e){const t=px(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function IO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(s,c)=>Yh(s,c,e,t),o=(s,c)=>a(s,c);return new Proxy(o,{get:(s,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const NO=(e,t)=>t.isSVG??um(e)?new uN(t):new aN(t,{allowProjection:e!==b.Fragment});class OO extends ja{constructor(t){super(t),t.animationState||(t.animationState=mN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let jO=0;class UO extends ja{constructor(){super(...arguments),this.id=jO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:c}=this.node.getProps();if(typeof s=="string"){const u=si(this.node,s,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const BO={animation:{Feature:OO},exit:{Feature:UO}};function nl(e){return{point:{x:e.pageX,y:e.pageY}}}const FO=e=>t=>nm(t)&&e(t,nl(t));function Rs(e,t,n,a){return Vs(e,t,FO(n),a)}const bx=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function VO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class wx{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=VO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;x||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const h=nl(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Js(Rs(this.contextWindow,"pointermove",this.handlePointerMove),Rs(this.contextWindow,"pointerup",this.handlePointerUp),Rs(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,xx(t)),offset:f_(e,zO(t)),velocity:$O(t,.1)}}function zO(e){return e[0]}function xx(e){return e[e.length-1]}function $O(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=xx(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>Sn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>Sn(t)*2&&(a=e[1]);const s=On(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const c={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function HO(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function WO(e,{top:t,left:n,bottom:a,right:o}){return{x:p_(e.x,n,o),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function KO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function GO(e,t){let n=.5;const a=ln(e),o=ln(t);return o>a?n=Us(t.min,t.max-a,e.min):a>o&&(n=Us(e.min,e.max-o,t.min)),xr(0,1,n)}function qO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const qf=.35;function YO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const ZO=new WeakMap;class XO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(nl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:x,onDragStart:C}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(x&&this.currentDirection===null){this.currentDirection=JO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new wx(t,{onSessionStart:s,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:bx(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=HO(c,this.constraints[t],this.elastic[t])),s.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&no(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=WO(a.layoutBox,t):this.constraints=!1,this.elastic=YO(n),o!==this.constraints&&!no(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=qO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!no(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=QI(a,o.root,this.visualElement.getTransformPagePoint());let c=KO(o.layout.layoutBox,s);if(n){const u=n(YI(c));this.hasMutatedConstraints=!!u,u&&(c=Hw(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!wc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!wc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:u}=o.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!no(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();o[c]=GO({min:h,max:h},this.constraints[c])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ZO.set(this.visualElement,this);const t=this.visualElement.current,n=Rs(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&AI(k);m&&y&&!w&&this.start(f)});let a;const o=()=>{const{dragConstraints:f}=this.getProps();no(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=QO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,c=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),dt.read(o);const u=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function QO(e,t,n){const a=Sk(e,v_(n)),o=Sk(t,v_(n));return()=>{a(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function JO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class e3 extends ja{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new XO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class t3 extends ja{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new wx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(s,c)=>{delete this.session,o&&dt.postRender(()=>o(s,c))}}}mount(){this.removePointerDownListener=Rs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class n3 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),Qh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:c}=a;return c&&(c.isPresent=s,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?c.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;Qh=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Px(e){const[t,n]=hx(),a=b.useContext(Op);return N.jsx(n3,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(kx),isPresent:t,safeToRemove:n})}const r3={pan:{Feature:t3},drag:{Feature:e3,ProjectionNode:dx,MeasureLayout:Px}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class a3 extends ja{mount(){const{current:t}=this.node;t&&(this.unmount=SI(t,(n,a)=>(k_(this.node,a,"Start"),o=>k_(this.node,o,"End"))))}unmount(){}}class i3 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Js(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class o3 extends ja{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=LI(t,(o,s)=>(__(this.node,s,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,s3=e=>{const t=Yf.get(e.target);t&&t(e)},l3=e=>{e.forEach(s3)};function c3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(l3,{root:e,...t})),a[o]}function u3(e,t,n){const a=c3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const d3={some:0,all:1};class h3 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:d3[o]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=u3(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(f3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function f3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const p3={inView:{Feature:h3},tap:{Feature:o3},focus:{Feature:i3},hover:{Feature:a3}},m3={layout:{ProjectionNode:dx,MeasureLayout:Px}},g3={...BO,...p3,...r3,...m3},ef=IO(g3,NO);function Sx(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Sx(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function y3(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Sx(e))&&(a&&(a+=" "),a+=t);return a}const v3=(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},k3=(e,t)=>({classGroupId:e,validator:t}),Cx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ku="-",b_=[],_3="arbitrary..",b3=e=>{const t=x3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return w3(c);const u=c.split(ku),h=u[0]===""&&u.length>1?1:0;return Tx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?v3(f,h):h:f||b_}return n[c]||b_}}},Tx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=Tx(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(ku):e.slice(t).join(ku),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},w3=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?_3+a:void 0})(),x3=e=>{const{theme:t,classGroups:n}=e;return P3(n,t)},P3=(e,t)=>{const n=Cx();for(const a in e){const o=e[a];dm(o,n,a,t)}return n},dm=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const c=e[s];S3(c,t,n,a)}},S3=(e,t,n,a)=>{if(typeof e=="string"){C3(e,t,n);return}if(typeof e=="function"){T3(e,t,n,a);return}E3(e,t,n,a)},C3=(e,t,n)=>{const a=e===""?t:Ex(t,e);a.classGroupId=n},T3=(e,t,n,a)=>{if(A3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(k3(n,e))},E3=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let c=0;c<s;c++){const[u,h]=o[c];dm(h,Ex(t,u),n,a)}},Ex=(e,t)=>{let n=e;const a=t.split(ku),o=a.length;for(let s=0;s<o;s++){const c=a[s];let u=n.nextPart.get(c);u||(u=Cx(),n.nextPart.set(c,u)),n=u}return n},A3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,R3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return o(s,c),c},set(s,c){s in n?n[s]=c:o(s,c)}}},Zf="!",w_=":",L3=[],x_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),D3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,h=0,f;const m=o.length;for(let C=0;C<m;C++){const S=o[C];if(c===0&&u===0){if(S===w_){s.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=s.length===0?o:o.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return x_(s,w,k,x)};if(t){const o=t+w_,s=a;a=c=>c.startsWith(o)?s(c.slice(o.length)):x_(L3,!1,c,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},M3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const c=n[s],u=c[0]==="[",h=t.has(c);u||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},I3=e=>({cache:R3(e.cacheSize),parseClassName:D3(e),sortModifiers:M3(e),...b3(e)}),N3=/\s+/,O3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(N3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?x.substring(0,C):x);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:s(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const G=o(D,S);for(let W=0;W<G.length;++W){const z=G[W];c.push(R+z)}h=m+(h.length>0?" "+h:h)}return h},j3=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Ax(n))&&(o&&(o+=" "),o+=a);return o},Ax=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Ax(e[a]))&&(n&&(n+=" "),n+=t);return n},U3=(e,...t)=>{let n,a,o,s;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=I3(f),a=n.cache.get,o=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=O3(h,n);return o(h,m),m};return s=c,(...h)=>s(j3(...h))},B3=[],Nt=e=>{const t=n=>n[e]||B3;return t.isThemeGetter=!0,t},Rx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,F3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,V3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z3=/\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$/,$3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>F3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Pa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>V3.test(e),Dx=()=>!0,K3=e=>z3.test(e)&&!$3.test(e),hm=()=>!1,G3=e=>H3.test(e),q3=e=>W3.test(e),Y3=e=>!ke(e)&&!be(e),Z3=e=>Ua(e,Nx,hm),ke=e=>Rx.test(e),ei=e=>Ua(e,Ox,K3),P_=e=>Ua(e,aj,qe),X3=e=>Ua(e,Ux,Dx),Q3=e=>Ua(e,jx,hm),S_=e=>Ua(e,Mx,hm),J3=e=>Ua(e,Ix,q3),xc=e=>Ua(e,Bx,G3),be=e=>Lx.test(e),gs=e=>yi(e,Ox),ej=e=>yi(e,jx),C_=e=>yi(e,Mx),tj=e=>yi(e,Nx),nj=e=>yi(e,Ix),Pc=e=>yi(e,Bx,!0),rj=e=>yi(e,Ux,!0),Ua=(e,t,n)=>{const a=Rx.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},yi=(e,t,n=!1)=>{const a=Lx.exec(e);return a?a[1]?t(a[1]):n:!1},Mx=e=>e==="position"||e==="percentage",Ix=e=>e==="image"||e==="url",Nx=e=>e==="length"||e==="size"||e==="bg-size",Ox=e=>e==="length",aj=e=>e==="number",jx=e=>e==="family-name",Ux=e=>e==="number"||e==="weight",Bx=e=>e==="shadow",ij=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),o=Nt("tracking"),s=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),x=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...O(),be,ke],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[be,ke,h],Y=()=>[xa,"full","auto",...P()],X=()=>[Pa,"none","subgrid",be,ke],ue=()=>["auto",{span:["full",Pa,be,ke]},Pa,be,ke],se=()=>[Pa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],pe=()=>["auto",...P()],Ne=()=>[xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],K=()=>[xa,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Z=()=>[xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",tj,Z3,{size:[be,ke]}],Re=()=>[tf,gs,ei],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,gs,ei],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",x,be,ke],Hn=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[xa,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Dx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[Y3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",be,ke]}],basis:[{basis:[xa,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,xa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[Pa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ue()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ue()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:pe()}],mx:[{mx:pe()}],my:[{my:pe()}],ms:[{ms:pe()}],me:[{me:pe()}],mbs:[{mbs:pe()}],mbe:[{mbe:pe()}],mt:[{mt:pe()}],mr:[{mr:pe()}],mb:[{mb:pe()}],ml:[{ml:pe()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,gs,ei]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,rj,X3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[ej,Q3,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,ei]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,be,ke],radial:["",be,ke],conic:[Pa,be,ke]},nj,J3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,gs,ei]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Pc,xc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,xc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,ei]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,Pc,xc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,Pc,xc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,gs,ei,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oj=U3(ij);function Tt(...e){return oj(y3(e))}const sj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),lj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),cj={google:sj,github:lj},uj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function dj(e){return uj[e]||String(e||"").replace(/-/g," ")}function hj(){Qs();const{isOpen:e,closeLoginModal:t}=U0(),{enabled:n,signedIn:a,refreshUser:o,signInWithPassword:s,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Zs(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,x]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[G,W]=b.useState(null),[z,P]=b.useState(!1),[Y,X]=b.useState(!0),[ue,se]=b.useState([]),[Ae,fe]=b.useState(8);b.useEffect(()=>{e&&(O(null),W(null),m("signin"),k(""),x(""),S(""),P(!1))},[e]),b.useEffect(()=>{if(!e||!n||ue.length>0)return;let K=!0;return X(!0),(async()=>{const{data:Z,error:H}=await h();if(K){if(H||!Z)se(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];se([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&fe(Z.passwordMinLength)}X(!1)}})(),()=>{K=!1}},[e,n,h,ue.length]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const le=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),pe=b.useCallback(async K=>{O(null),L(!0);try{const{error:Z}=await u(K,le);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,le]),Ne=b.useCallback(async K=>{K.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){W(Fe("login.verify_email_pending")),m("signin");return}await o();return}const{error:Z}=await s({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await o()}finally{L(!1)}},[f,y,w,C,c,s,o]);return b.useEffect(()=>{if(!e)return;const K=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,t]),n?N.jsx(cO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:K=>K.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(N0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsxs("div",{className:"space-y-2.5",children:[N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ue.map(K=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>pe(K),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[cj[K]||null,Fe("login.oauth.continue",{provider:dj(K)})]},K))}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:K=>S(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:K=>k(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:K=>x(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>P(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx(qD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const fj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},Z4="https://tokentracker.statuspage.io/";function pj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?fj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||Wr()).trim()}function X4(){return Wr()}function mj(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 gj=300*1e3,yj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function vj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+yj<=t:!0}async function Fx(e,t){const n=Wr();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),o=Gs(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function kj(e){const t=Wr();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Gs(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||Wr();fm(o)&&(a.insforgeBaseUrl=o.trim());const s=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=r0();if(n&&!vj(n))return n;const a=await kj(t);return a?(FR(a),a):null}async function Vx(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}catch(a){if(!r0()||(a0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}}async function _j(e){const t=VR();if(Date.now()-t<gj)return;const n=await Vx(e);n&&(i0(Date.now()),await Fx(n,"cloud-sync-auto"))}async function Q4(e){const t=await Vx(e);t&&(i0(Date.now()),await Fx(t,"cloud-sync-now"))}function bj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function wj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||bj(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function xj(){const e=Fn(),t=Zs(),n=b.useRef(!1);b.useEffect(()=>{if(!UR()||!wj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!BR())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await _j(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function Pj(){const e=b.useContext(O0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function Sj({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Cj(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 Tj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Sc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Qs();const o=t==="sidebar",{enabled:s,loading:c,signedIn:u,user:h,displayName:f}=Zs(),{openLoginModal:m}=U0(),y=wu(),k=b.useMemo(()=>Cj(h),[h]),w=b.useMemo(()=>Tj(k),[k]),[x,C]=Ls.useState(!1);if(Ls.useEffect(()=>{C(!1)},[w]),!s)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(o?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:o&&n?f:void 0,children:[o?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!x?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)})}):w&&!x?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)}),o?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function Ej(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:FD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:zD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:uM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:KD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:tM,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:HD,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:iM,label:Fe("nav.settings")}]}]}function Aj(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Rj(){const[e,t]=b.useState(Aj),n=b.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,o?"1":"0")}catch{}return o})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Xf&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Lj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Dj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Mj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return N.jsxs(Pu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Ij({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:o}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:o})}function Nj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Sj({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Oj=[{value:"light",label:"Light",Icon:I0},{value:"dark",label:"Dark",Icon:M0},{value:"system",label:"System",Icon:QD}];function jj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=b.useState(!1),c=b.useRef(null),u=t==="dark"?M0:I0;return b.useEffect(()=>{if(!o)return;const h=m=>{c.current&&!c.current.contains(m.target)&&s(!1)},f=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[o]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Oj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function zx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=Pj(),{resolvedLocale:y}=Qs(),k=b.useMemo(()=>Ej(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:o,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(N0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,x)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Dj,{label:w.label,collapsed:e,first:x===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Mj,{item:C,collapsed:e,active:Lj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(jj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:s}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Nj,{glassChrome:s})})]})]})}function Uj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(zx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Bj({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(zx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Fj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Ij,{title:Fe("nav.menu"),onClick:e,children:N.jsx(ZD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(Pu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Vj({children:e}){const{collapsed:t,toggle:n}=Rj(),[a,o]=b.useState(!1),s=b.useCallback(()=>o(!0),[]),c=b.useCallback(()=>o(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(Uj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Bj,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Fj,{onOpenDrawer:s}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const zj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(zj),Cc=R_.get("insforge_code")||R_.get("code")||null,$j=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function Hj(){Qs();const{loading:e,signedIn:t}=Zs(),n=wu(),[a,o]=b.useState("processing"),[s,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Cc||u.current)){if(u.current=!0,$j){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Cc)return;o("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Cc)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Cc&&s===null){const f=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Wj=b.lazy(()=>$n(()=>import("./DashboardPage-Bcw_9-IO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Kj=b.lazy(()=>$n(()=>import("./IpCheckPage-Kue6GQzA.js"),[])),Gj=b.lazy(()=>$n(()=>import("./LandingPage-DMM_pvjg.js"),__vite__mapDeps([11,12,8])).then(e=>({default:e.LandingPage}))),qj=b.lazy(()=>$n(()=>import("./LeaderboardPage-Dr-vs4Wk.js"),__vite__mapDeps([13,9,2,14,15])).then(e=>({default:e.LeaderboardPage}))),Yj=b.lazy(()=>$n(()=>import("./LeaderboardProfilePage-ZXEbQGx5.js"),__vite__mapDeps([16,2,12,17,14,9,3,4,18,5])).then(e=>({default:e.LeaderboardProfilePage}))),Zj=b.lazy(()=>$n(()=>import("./LimitsPage-C7BNYXFU.js"),__vite__mapDeps([19,1,20,7,10,8,21,18,22])).then(e=>({default:e.LimitsPage}))),Xj=b.lazy(()=>$n(()=>import("./LoginPage-DCeTFjDp.js"),[]).then(e=>({default:e.LoginPage}))),Qj=b.lazy(()=>$n(()=>import("./DevicePage-Ck-viWfZ.js"),[])),Jj=b.lazy(()=>$n(()=>import("./WrappedPage-BklzxKVW.js"),[])),e4=b.lazy(()=>$n(()=>import("./SettingsPage-Dwz2e9_F.js"),__vite__mapDeps([23,20,24,7,25,2,15,4,22])).then(e=>({default:e.SettingsPage}))),t4=b.lazy(()=>$n(()=>import("./SkillsPage-DRENeHeR.js"),__vite__mapDeps([26,21,18,22,7,5,4,9,25,6,8,15])).then(e=>({default:e.SkillsPage}))),n4=b.lazy(()=>$n(()=>import("./WidgetsPage-CzGqO3Nj.js"),__vite__mapDeps([27,24,7,10,8,18,22,15])).then(e=>({default:e.WidgetsPage})));function r4(){const{resolvedLocale:e}=Qs(),t=Fn(),n=Zs();xj();const a=dn(),o=b.useMemo(()=>typeof window>"u"?!1:mj(window.location.search),[]),s=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=s.replace(/\/+$/,"")||"/",C=x==="/leaderboard",S=x.match(/^\/u\/([^/]+)$/i),D=S?S[1]:null,L=!!(n.enabled&&n.signedIn),R=w||L,O=!1,G=pj(),W=b.useMemo(()=>!n.enabled||!L?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[L,n]);let z=w||a||o?"dashboard":"landing";x==="/landing"&&(z="landing"),x==="/dashboard"&&(z="dashboard"),C&&(z="dashboard"),D&&(z="dashboard");const P=x==="/limits",Y=x==="/settings",X=x==="/skills",ue=x==="/widgets",se=x==="/ip-check";(P||Y||X||ue||se)&&(z="dashboard");let Ae=Wj;D?Ae=Yj:x==="/leaderboard"?Ae=qj:P?Ae=Zj:Y?Ae=e4:X?Ae=t4:ue?Ae=n4:se&&(Ae=Kj);const fe=!k&&(x==="/dashboard"||x==="/"||C||P||Y||X||ue||se);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=N.jsx(Hj,{});else if(x==="/login")le=N.jsx(Xj,{});else if(x==="/device")le=N.jsx(Qj,{});else if(x==="/wrapped")le=N.jsx(Jj,{});else if(z==="landing")le=N.jsx(Gj,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=N.jsx(Ae,{baseUrl:G,auth:W,signedIn:R,sessionSoftExpired:O,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,userId:D,signInUrl:"/login",signUpUrl:"/login"},e);fe?le=N.jsx(Vj,{children:pe}):le=pe}return N.jsx(fM,{children:N.jsx(gM,{children:N.jsxs(yM,{children:[N.jsx(b.Suspense,{fallback:null,children:le}),N.jsx(hj,{}),N.jsx(bD,{}),N.jsx(DD,{})]})})})}const a4=K1([{path:"*",element:N.jsx(r4,{})}]);IS.createRoot(document.getElementById("root")).render(N.jsx(Ls.StrictMode,{children:N.jsx(eD,{children:N.jsx(sD,{children:N.jsx(LL,{children:N.jsx(iT,{router:a4})})})})}));export{Aa as $,g0 as A,Fe as B,N as C,ef as D,Nc as E,C4 as F,S4 as G,Os as H,hM as I,pu as J,B4 as K,Pu as L,lm as M,g4 as N,m4 as O,cO as P,Pj as Q,Ls as R,Tt as S,U0 as T,Zs as U,w4 as V,R4 as W,N0 as X,Qs as Y,mj as Z,$n as _,Gt as a,O4 as a0,T4 as a1,ZR as a2,y4 as a3,v4 as a4,j4 as a5,P4 as a6,b4 as a7,A_ as a8,Z4 as a9,rM as aA,oD as aB,Ep as aC,Lp as aD,G4 as aE,ar as aF,Ip as aG,W4 as aH,q4 as aI,K4 as aJ,Cs as aK,Vw as aL,KI as aM,$f as aN,I4 as aO,N4 as aP,M4 as aQ,AS as aR,Qf as aS,aT as aa,Fn as ab,wu as ac,X4 as ad,BR as ae,h4 as af,Q4 as ag,f4 as ah,D4 as ai,uM as aj,Sj as ak,iM as al,$4 as am,i4 as an,OR as ao,Op as ap,UR as aq,Zv as ar,L4 as as,I0 as at,M0 as au,QD as av,go as aw,iu as ax,Dp as ay,x4 as az,B0 as b,hn as c,Na as d,kk as e,dt as f,y0 as g,dn as h,f2 as i,p4 as j,HR as k,H4 as l,vo as m,iL as n,oL as o,F4 as p,_4 as q,b as r,A4 as s,V4 as t,jp as u,z4 as v,k4 as w,yt as x,E4 as y,U4 as z};