@meshxdata/fops 0.1.52 → 0.1.53

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 (86) hide show
  1. package/CHANGELOG.md +372 -0
  2. package/package.json +2 -6
  3. package/src/agent/agent.js +6 -0
  4. package/src/commands/setup.js +34 -0
  5. package/src/fleet-registry.js +38 -2
  6. package/src/plugins/__test-fixtures__/fake-plugin.js +2 -0
  7. package/src/plugins/__test-fixtures__/no-register-plugin.js +2 -0
  8. package/src/plugins/__test-fixtures__/with-register/index.js +2 -0
  9. package/src/plugins/__test-fixtures__/without-register/index.js +2 -0
  10. package/src/plugins/api.js +4 -0
  11. package/src/plugins/builtins/docker-compose.js +59 -0
  12. package/src/plugins/bundled/fops-plugin-azure/index.js +4 -0
  13. package/src/plugins/bundled/fops-plugin-azure/lib/azure-aks-core.js +44 -53
  14. package/src/plugins/bundled/fops-plugin-azure/lib/azure-aks-storage.js +2 -2
  15. package/src/plugins/bundled/fops-plugin-azure/lib/azure-cost.js +52 -22
  16. package/src/plugins/bundled/fops-plugin-azure/lib/azure-helpers.js +6 -2
  17. package/src/plugins/bundled/fops-plugin-azure/lib/azure-ops.js +113 -7
  18. package/src/plugins/bundled/fops-plugin-azure/lib/azure-provision-init.js +13 -4
  19. package/src/plugins/bundled/fops-plugin-azure/lib/azure-provision.js +91 -14
  20. package/src/plugins/bundled/fops-plugin-azure/lib/azure-service.js +507 -0
  21. package/src/plugins/bundled/fops-plugin-azure/lib/azure-sync.js +146 -7
  22. package/src/plugins/bundled/fops-plugin-azure/lib/azure.js +1 -1
  23. package/src/plugins/bundled/fops-plugin-azure/lib/commands/vm-cmds.js +61 -0
  24. package/src/plugins/bundled/fops-plugin-cloud/api.js +712 -0
  25. package/src/plugins/bundled/fops-plugin-cloud/fops.plugin.json +6 -0
  26. package/src/plugins/bundled/fops-plugin-cloud/index.js +208 -0
  27. package/src/plugins/bundled/fops-plugin-cloud/lib/azure-provider.js +81 -0
  28. package/src/plugins/bundled/fops-plugin-cloud/lib/provider.js +50 -0
  29. package/src/plugins/bundled/fops-plugin-cloud/ui/dist/assets/favicon-C49brna2.svg +15 -0
  30. package/src/plugins/bundled/fops-plugin-cloud/ui/dist/assets/index-CVqQ_kKW.js +65 -0
  31. package/src/plugins/bundled/fops-plugin-cloud/ui/dist/assets/index-DZetahP3.css +1 -0
  32. package/src/plugins/bundled/fops-plugin-cloud/ui/dist/index.html +28 -0
  33. package/src/plugins/bundled/fops-plugin-cloud/ui/index.html +27 -0
  34. package/src/plugins/bundled/fops-plugin-cloud/ui/package-lock.json +2634 -0
  35. package/src/plugins/bundled/fops-plugin-cloud/ui/package.json +29 -0
  36. package/src/plugins/bundled/fops-plugin-cloud/ui/postcss.config.cjs +5 -0
  37. package/src/plugins/bundled/fops-plugin-cloud/ui/src/App.jsx +32 -0
  38. package/src/plugins/bundled/fops-plugin-cloud/ui/src/api/client.js +114 -0
  39. package/src/plugins/bundled/fops-plugin-cloud/ui/src/api/queries.js +111 -0
  40. package/src/plugins/bundled/fops-plugin-cloud/ui/src/components/LogPanel.jsx +162 -0
  41. package/src/plugins/bundled/fops-plugin-cloud/ui/src/components/ThemeToggle.jsx +46 -0
  42. package/src/plugins/bundled/fops-plugin-cloud/ui/src/css/additional-styles/utility-patterns.css +147 -0
  43. package/src/plugins/bundled/fops-plugin-cloud/ui/src/css/style.css +138 -0
  44. package/src/plugins/bundled/fops-plugin-cloud/ui/src/favicon.svg +15 -0
  45. package/src/plugins/bundled/fops-plugin-cloud/ui/src/lib/utils.ts +19 -0
  46. package/src/plugins/bundled/fops-plugin-cloud/ui/src/main.jsx +25 -0
  47. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Audit.jsx +164 -0
  48. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Costs.jsx +305 -0
  49. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/CreateResource.jsx +285 -0
  50. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Fleet.jsx +307 -0
  51. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Resources.jsx +229 -0
  52. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/Header.jsx +132 -0
  53. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/Sidebar.jsx +174 -0
  54. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/SidebarLinkGroup.jsx +21 -0
  55. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/AuthContext.jsx +170 -0
  56. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Info.jsx +49 -0
  57. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/ThemeContext.jsx +37 -0
  58. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Transition.jsx +116 -0
  59. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Utils.js +63 -0
  60. package/src/plugins/bundled/fops-plugin-cloud/ui/vite.config.js +23 -0
  61. package/src/plugins/bundled/fops-plugin-foundation/test-helpers.js +65 -0
  62. package/src/plugins/loader.js +34 -1
  63. package/src/plugins/registry.js +15 -0
  64. package/src/plugins/schemas.js +17 -0
  65. package/src/project.js +1 -1
  66. package/src/serve.js +196 -2
  67. package/src/shell.js +21 -1
  68. package/src/web/admin.html.js +236 -0
  69. package/src/web/api.js +73 -0
  70. package/src/web/dist/assets/index-BphVaAUd.css +1 -0
  71. package/src/web/dist/assets/index-CSckLzuG.js +129 -0
  72. package/src/web/dist/index.html +2 -2
  73. package/src/web/frontend/index.html +16 -0
  74. package/src/web/frontend/src/App.jsx +445 -0
  75. package/src/web/frontend/src/components/ChatView.jsx +910 -0
  76. package/src/web/frontend/src/components/InputBox.jsx +523 -0
  77. package/src/web/frontend/src/components/Sidebar.jsx +410 -0
  78. package/src/web/frontend/src/components/StatusBar.jsx +37 -0
  79. package/src/web/frontend/src/components/TabBar.jsx +87 -0
  80. package/src/web/frontend/src/hooks/useWebSocket.js +412 -0
  81. package/src/web/frontend/src/index.css +78 -0
  82. package/src/web/frontend/src/main.jsx +6 -0
  83. package/src/web/frontend/vite.config.js +21 -0
  84. package/src/web/server.js +64 -1
  85. package/src/web/dist/assets/index-NXC8Hvnp.css +0 -1
  86. package/src/web/dist/assets/index-QH1N4ejK.js +0 -112
@@ -0,0 +1,65 @@
1
+ var ev=r=>{throw TypeError(r)};var Qf=(r,a,i)=>a.has(r)||ev("Cannot "+i);var T=(r,a,i)=>(Qf(r,a,"read from private field"),i?i.call(r):a.get(r)),oe=(r,a,i)=>a.has(r)?ev("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(r):a.set(r,i),ae=(r,a,i,l)=>(Qf(r,a,"write to private field"),l?l.call(r,i):a.set(r,i),i),Se=(r,a,i)=>(Qf(r,a,"access private method"),i);var Oc=(r,a,i,l)=>({set _(o){ae(r,a,o,i)},get _(){return T(r,a,l)}});(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(o){if(o.ep)return;o.ep=!0;const d=i(o);fetch(o.href,d)}})();function Nb(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jf={exports:{}},_l={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var tv;function U1(){if(tv)return _l;tv=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,o,d){var f=null;if(d!==void 0&&(f=""+d),o.key!==void 0&&(f=""+o.key),"key"in o){d={};for(var v in o)v!=="key"&&(d[v]=o[v])}else d=o;return o=d.ref,{$$typeof:r,type:l,key:f,ref:o!==void 0?o:null,props:d}}return _l.Fragment=a,_l.jsx=i,_l.jsxs=i,_l}var av;function H1(){return av||(av=1,Jf.exports=U1()),Jf.exports}var h=H1(),Xf={exports:{}},ge={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var nv;function L1(){if(nv)return ge;nv=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function _(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeof j=="function"?j:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function N(j,G,F){this.props=j,this.context=G,this.refs=S,this.updater=F||C}N.prototype.isReactComponent={},N.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,G,"setState")},N.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function H(){}H.prototype=N.prototype;function K(j,G,F){this.props=j,this.context=G,this.refs=S,this.updater=F||C}var L=K.prototype=new H;L.constructor=K,E(L,N.prototype),L.isPureReactComponent=!0;var U=Array.isArray;function I(){}var $={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function X(j,G,F){var re=F.ref;return{$$typeof:r,type:j,key:G,ref:re!==void 0?re:null,props:F}}function ie(j,G){return X(j.type,G,j.props)}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function Q(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(F){return G[F]})}var pe=/\/+/g;function de(j,G){return typeof j=="object"&&j!==null&&j.key!=null?Q(""+j.key):G.toString(36)}function xe(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(I,I):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function B(j,G,F,re,ve){var _e=typeof j;(_e==="undefined"||_e==="boolean")&&(j=null);var Me=!1;if(j===null)Me=!0;else switch(_e){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(j.$$typeof){case r:case a:Me=!0;break;case g:return Me=j._init,B(Me(j._payload),G,F,re,ve)}}if(Me)return ve=ve(j),Me=re===""?"."+de(j,0):re,U(ve)?(F="",Me!=null&&(F=Me.replace(pe,"$&/")+"/"),B(ve,G,F,"",function(Cs){return Cs})):ve!=null&&(W(ve)&&(ve=ie(ve,F+(ve.key==null||j&&j.key===ve.key?"":(""+ve.key).replace(pe,"$&/")+"/")+Me)),G.push(ve)),1;Me=0;var At=re===""?".":re+":";if(U(j))for(var nt=0;nt<j.length;nt++)re=j[nt],_e=At+de(re,nt),Me+=B(re,G,F,_e,ve);else if(nt=_(j),typeof nt=="function")for(j=nt.call(j),nt=0;!(re=j.next()).done;)re=re.value,_e=At+de(re,nt++),Me+=B(re,G,F,_e,ve);else if(_e==="object"){if(typeof j.then=="function")return B(xe(j),G,F,re,ve);throw G=String(j),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Me}function V(j,G,F){if(j==null)return j;var re=[],ve=0;return B(j,re,"","",function(_e){return G.call(F,_e,ve++)}),re}function te(j){if(j._status===-1){var G=j._result;G=G(),G.then(function(F){(j._status===0||j._status===-1)&&(j._status=1,j._result=F)},function(F){(j._status===0||j._status===-1)&&(j._status=2,j._result=F)}),j._status===-1&&(j._status=0,j._result=G)}if(j._status===1)return j._result.default;throw j._result}var fe=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},he={map:V,forEach:function(j,G,F){V(j,function(){G.apply(this,arguments)},F)},count:function(j){var G=0;return V(j,function(){G++}),G},toArray:function(j){return V(j,function(G){return G})||[]},only:function(j){if(!W(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return ge.Activity=b,ge.Children=he,ge.Component=N,ge.Fragment=i,ge.Profiler=o,ge.PureComponent=K,ge.StrictMode=l,ge.Suspense=y,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,ge.__COMPILER_RUNTIME={__proto__:null,c:function(j){return $.H.useMemoCache(j)}},ge.cache=function(j){return function(){return j.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(j,G,F){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var re=E({},j.props),ve=j.key;if(G!=null)for(_e in G.key!==void 0&&(ve=""+G.key),G)!ee.call(G,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&G.ref===void 0||(re[_e]=G[_e]);var _e=arguments.length-2;if(_e===1)re.children=F;else if(1<_e){for(var Me=Array(_e),At=0;At<_e;At++)Me[At]=arguments[At+2];re.children=Me}return X(j.type,ve,re)},ge.createContext=function(j){return j={$$typeof:f,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:d,_context:j},j},ge.createElement=function(j,G,F){var re,ve={},_e=null;if(G!=null)for(re in G.key!==void 0&&(_e=""+G.key),G)ee.call(G,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ve[re]=G[re]);var Me=arguments.length-2;if(Me===1)ve.children=F;else if(1<Me){for(var At=Array(Me),nt=0;nt<Me;nt++)At[nt]=arguments[nt+2];ve.children=At}if(j&&j.defaultProps)for(re in Me=j.defaultProps,Me)ve[re]===void 0&&(ve[re]=Me[re]);return X(j,_e,ve)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(j){return{$$typeof:v,render:j}},ge.isValidElement=W,ge.lazy=function(j){return{$$typeof:g,_payload:{_status:-1,_result:j},_init:te}},ge.memo=function(j,G){return{$$typeof:m,type:j,compare:G===void 0?null:G}},ge.startTransition=function(j){var G=$.T,F={};$.T=F;try{var re=j(),ve=$.S;ve!==null&&ve(F,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(I,fe)}catch(_e){fe(_e)}finally{G!==null&&F.types!==null&&(G.types=F.types),$.T=G}},ge.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},ge.use=function(j){return $.H.use(j)},ge.useActionState=function(j,G,F){return $.H.useActionState(j,G,F)},ge.useCallback=function(j,G){return $.H.useCallback(j,G)},ge.useContext=function(j){return $.H.useContext(j)},ge.useDebugValue=function(){},ge.useDeferredValue=function(j,G){return $.H.useDeferredValue(j,G)},ge.useEffect=function(j,G){return $.H.useEffect(j,G)},ge.useEffectEvent=function(j){return $.H.useEffectEvent(j)},ge.useId=function(){return $.H.useId()},ge.useImperativeHandle=function(j,G,F){return $.H.useImperativeHandle(j,G,F)},ge.useInsertionEffect=function(j,G){return $.H.useInsertionEffect(j,G)},ge.useLayoutEffect=function(j,G){return $.H.useLayoutEffect(j,G)},ge.useMemo=function(j,G){return $.H.useMemo(j,G)},ge.useOptimistic=function(j,G){return $.H.useOptimistic(j,G)},ge.useReducer=function(j,G,F){return $.H.useReducer(j,G,F)},ge.useRef=function(j){return $.H.useRef(j)},ge.useState=function(j){return $.H.useState(j)},ge.useSyncExternalStore=function(j,G,F){return $.H.useSyncExternalStore(j,G,F)},ge.useTransition=function(){return $.H.useTransition()},ge.version="19.2.4",ge}var rv;function ym(){return rv||(rv=1,Xf.exports=L1()),Xf.exports}var A=ym();const Fl=Nb(A);var Wf={exports:{}},El={},If={exports:{}},Ff={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var iv;function K1(){return iv||(iv=1,(function(r){function a(B,V){var te=B.length;B.push(V);e:for(;0<te;){var fe=te-1>>>1,he=B[fe];if(0<o(he,V))B[fe]=V,B[te]=he,te=fe;else break e}}function i(B){return B.length===0?null:B[0]}function l(B){if(B.length===0)return null;var V=B[0],te=B.pop();if(te!==V){B[0]=te;e:for(var fe=0,he=B.length,j=he>>>1;fe<j;){var G=2*(fe+1)-1,F=B[G],re=G+1,ve=B[re];if(0>o(F,te))re<he&&0>o(ve,F)?(B[fe]=ve,B[re]=te,fe=re):(B[fe]=F,B[G]=te,fe=G);else if(re<he&&0>o(ve,te))B[fe]=ve,B[re]=te,fe=re;else break e}}return V}function o(B,V){var te=B.sortIndex-V.sortIndex;return te!==0?te:B.id-V.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var f=Date,v=f.now();r.unstable_now=function(){return f.now()-v}}var y=[],m=[],g=1,b=null,w=3,_=!1,C=!1,E=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function L(B){for(var V=i(m);V!==null;){if(V.callback===null)l(m);else if(V.startTime<=B)l(m),V.sortIndex=V.expirationTime,a(y,V);else break;V=i(m)}}function U(B){if(E=!1,L(B),!C)if(i(y)!==null)C=!0,I||(I=!0,Q());else{var V=i(m);V!==null&&xe(U,V.startTime-B)}}var I=!1,$=-1,ee=5,X=-1;function ie(){return S?!0:!(r.unstable_now()-X<ee)}function W(){if(S=!1,I){var B=r.unstable_now();X=B;var V=!0;try{e:{C=!1,E&&(E=!1,H($),$=-1),_=!0;var te=w;try{t:{for(L(B),b=i(y);b!==null&&!(b.expirationTime>B&&ie());){var fe=b.callback;if(typeof fe=="function"){b.callback=null,w=b.priorityLevel;var he=fe(b.expirationTime<=B);if(B=r.unstable_now(),typeof he=="function"){b.callback=he,L(B),V=!0;break t}b===i(y)&&l(y),L(B)}else l(y);b=i(y)}if(b!==null)V=!0;else{var j=i(m);j!==null&&xe(U,j.startTime-B),V=!1}}break e}finally{b=null,w=te,_=!1}V=void 0}}finally{V?Q():I=!1}}}var Q;if(typeof K=="function")Q=function(){K(W)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,de=pe.port2;pe.port1.onmessage=W,Q=function(){de.postMessage(null)}}else Q=function(){N(W,0)};function xe(B,V){$=N(function(){B(r.unstable_now())},V)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(B){B.callback=null},r.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<B?Math.floor(1e3/B):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_next=function(B){switch(w){case 1:case 2:case 3:var V=3;break;default:V=w}var te=w;w=V;try{return B()}finally{w=te}},r.unstable_requestPaint=function(){S=!0},r.unstable_runWithPriority=function(B,V){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var te=w;w=B;try{return V()}finally{w=te}},r.unstable_scheduleCallback=function(B,V,te){var fe=r.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?fe+te:fe):te=fe,B){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=te+he,B={id:g++,callback:V,priorityLevel:B,startTime:te,expirationTime:he,sortIndex:-1},te>fe?(B.sortIndex=te,a(m,B),i(y)===null&&B===i(m)&&(E?(H($),$=-1):E=!0,xe(U,te-fe))):(B.sortIndex=he,a(y,B),C||_||(C=!0,I||(I=!0,Q()))),B},r.unstable_shouldYield=ie,r.unstable_wrapCallback=function(B){var V=w;return function(){var te=w;w=V;try{return B.apply(this,arguments)}finally{w=te}}}})(Ff)),Ff}var sv;function q1(){return sv||(sv=1,If.exports=K1()),If.exports}var $f={exports:{}},kt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var lv;function B1(){if(lv)return kt;lv=1;var r=ym();function a(y){var m="https://react.dev/errors/"+y;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+y+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(y,m,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:y,containerInfo:m,implementation:g}}var f=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kt.createPortal=function(y,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(a(299));return d(y,m,null,g)},kt.flushSync=function(y){var m=f.T,g=l.p;try{if(f.T=null,l.p=2,y)return y()}finally{f.T=m,l.p=g,l.d.f()}},kt.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,l.d.C(y,m))},kt.prefetchDNS=function(y){typeof y=="string"&&l.d.D(y)},kt.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var g=m.as,b=v(g,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,_=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?l.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:_}):g==="script"&&l.d.X(y,{crossOrigin:b,integrity:w,fetchPriority:_,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},kt.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=v(m.as,m.crossOrigin);l.d.M(y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&l.d.M(y)},kt.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,b=v(g,m.crossOrigin);l.d.L(y,g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},kt.preloadModule=function(y,m){if(typeof y=="string")if(m){var g=v(m.as,m.crossOrigin);l.d.m(y,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else l.d.m(y)},kt.requestFormReset=function(y){l.d.r(y)},kt.unstable_batchedUpdates=function(y,m){return y(m)},kt.useFormState=function(y,m,g){return f.H.useFormState(y,m,g)},kt.useFormStatus=function(){return f.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var ov;function G1(){if(ov)return $f.exports;ov=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),$f.exports=B1(),$f.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var cv;function P1(){if(cv)return El;cv=1;var r=q1(),a=ym(),i=G1();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(l(188))}function m(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var n=e,s=t;;){var c=n.return;if(c===null)break;var u=c.alternate;if(u===null){if(s=c.return,s!==null){n=s;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===n)return y(c),e;if(u===s)return y(c),t;u=u.sibling}throw Error(l(188))}if(n.return!==s.return)n=c,s=u;else{for(var p=!1,x=c.child;x;){if(x===n){p=!0,n=c,s=u;break}if(x===s){p=!0,s=c,n=u;break}x=x.sibling}if(!p){for(x=u.child;x;){if(x===n){p=!0,n=u,s=c;break}if(x===s){p=!0,s=u,n=c;break}x=x.sibling}if(!p)throw Error(l(189))}}if(n.alternate!==s)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),K=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case N:return"Profiler";case S:return"StrictMode";case U:return"Suspense";case I:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case K:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var xe=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},fe=[],he=-1;function j(e){return{current:e}}function G(e){0>he||(e.current=fe[he],fe[he]=null,he--)}function F(e,t){he++,fe[he]=e.current,e.current=t}var re=j(null),ve=j(null),_e=j(null),Me=j(null);function At(e,t){switch(F(_e,t),F(ve,e),F(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_g(t),e=Eg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(re),F(re,e)}function nt(){G(re),G(ve),G(_e)}function Cs(e){e.memoizedState!==null&&F(Me,e);var t=re.current,n=Eg(t,e.type);t!==n&&(F(ve,e),F(re,n))}function mo(e){ve.current===e&&(G(re),G(ve)),Me.current===e&&(G(Me),bl._currentValue=te)}var Au,$m;function Sr(e){if(Au===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Au=t&&t[1]||"",$m=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Au+e+$m}var Nu=!1;function Cu(e,t){if(!e||Nu)return"";Nu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(q){var M=q}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(q){M=q}e.call(Y.prototype)}}else{try{throw Error()}catch(q){M=q}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(q){if(q&&M&&typeof q.stack=="string")return[q.stack,M.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=s.DetermineComponentFrameRoot(),p=u[0],x=u[1];if(p&&x){var k=p.split(`
44
+ `),z=x.split(`
45
+ `);for(c=s=0;s<k.length&&!k[s].includes("DetermineComponentFrameRoot");)s++;for(;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;if(s===k.length||c===z.length)for(s=k.length-1,c=z.length-1;1<=s&&0<=c&&k[s]!==z[c];)c--;for(;1<=s&&0<=c;s--,c--)if(k[s]!==z[c]){if(s!==1||c!==1)do if(s--,c--,0>c||k[s]!==z[c]){var P=`
46
+ `+k[s].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=s&&0<=c);break}}}finally{Nu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Sr(n):""}function hw(e,t){switch(e.tag){case 26:case 27:case 5:return Sr(e.type);case 16:return Sr("Lazy");case 13:return e.child!==t&&t!==null?Sr("Suspense Fallback"):Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 15:return Cu(e.type,!1);case 11:return Cu(e.type.render,!1);case 1:return Cu(e.type,!0);case 31:return Sr("Activity");default:return""}}function ep(e){try{var t="",n=null;do t+=hw(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var Ru=Object.prototype.hasOwnProperty,Ou=r.unstable_scheduleCallback,Du=r.unstable_cancelCallback,mw=r.unstable_shouldYield,pw=r.unstable_requestPaint,Yt=r.unstable_now,yw=r.unstable_getCurrentPriorityLevel,tp=r.unstable_ImmediatePriority,ap=r.unstable_UserBlockingPriority,po=r.unstable_NormalPriority,gw=r.unstable_LowPriority,np=r.unstable_IdlePriority,vw=r.log,bw=r.unstable_setDisableYieldValue,Rs=null,Vt=null;function jn(e){if(typeof vw=="function"&&bw(e),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Rs,e)}catch{}}var Qt=Math.clz32?Math.clz32:Sw,xw=Math.log,ww=Math.LN2;function Sw(e){return e>>>=0,e===0?32:31-(xw(e)/ww|0)|0}var yo=256,go=262144,vo=4194304;function _r(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bo(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var c=0,u=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var x=s&134217727;return x!==0?(s=x&~u,s!==0?c=_r(s):(p&=x,p!==0?c=_r(p):n||(n=x&~e,n!==0&&(c=_r(n))))):(x=s&~u,x!==0?c=_r(x):p!==0?c=_r(p):n||(n=s&~e,n!==0&&(c=_r(n)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:c}function Os(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _w(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rp(){var e=vo;return vo<<=1,(vo&62914560)===0&&(vo=4194304),e}function zu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ds(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ew(e,t,n,s,c,u){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,k=e.expirationTimes,z=e.hiddenUpdates;for(n=p&~n;0<n;){var P=31-Qt(n),Y=1<<P;x[P]=0,k[P]=-1;var M=z[P];if(M!==null)for(z[P]=null,P=0;P<M.length;P++){var q=M[P];q!==null&&(q.lane&=-536870913)}n&=~Y}s!==0&&ip(e,s,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(p&~t))}function ip(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Qt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function sp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Qt(n),c=1<<s;c&t|e[s]&t&&(e[s]|=t),n&=~c}}function lp(e,t){var n=t&-t;return n=(n&42)!==0?1:Mu(n),(n&(e.suspendedLanes|t))!==0?0:n}function Mu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Uu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function op(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Qg(e.type))}function cp(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var An=Math.random().toString(36).slice(2),vt="__reactFiber$"+An,zt="__reactProps$"+An,hi="__reactContainer$"+An,Hu="__reactEvents$"+An,kw="__reactListeners$"+An,Tw="__reactHandles$"+An,up="__reactResources$"+An,zs="__reactMarker$"+An;function Lu(e){delete e[vt],delete e[zt],delete e[Hu],delete e[kw],delete e[Tw]}function mi(e){var t=e[vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hi]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Rg(e);e!==null;){if(n=e[vt])return n;e=Rg(e)}return t}e=n,n=e.parentNode}return null}function pi(e){if(e=e[vt]||e[hi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ms(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function yi(e){var t=e[up];return t||(t=e[up]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[zs]=!0}var dp=new Set,fp={};function Er(e,t){gi(e,t),gi(e+"Capture",t)}function gi(e,t){for(fp[e]=t,e=0;e<t.length;e++)dp.add(t[e])}var jw=RegExp("^[: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]*$"),hp={},mp={};function Aw(e){return Ru.call(mp,e)?!0:Ru.call(hp,e)?!1:jw.test(e)?mp[e]=!0:(hp[e]=!0,!1)}function xo(e,t,n){if(Aw(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function wo(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Qa(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function ia(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nw(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,u=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(p){n=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ku(e){if(!e._valueTracker){var t=pp(e)?"checked":"value";e._valueTracker=Nw(e,t,""+e[t])}}function yp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=pp(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function So(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Cw=/[\n"\\]/g;function sa(e){return e.replace(Cw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function qu(e,t,n,s,c,u,p,x){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ia(t)):e.value!==""+ia(t)&&(e.value=""+ia(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?Bu(e,p,ia(t)):n!=null?Bu(e,p,ia(n)):s!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+ia(x):e.removeAttribute("name")}function gp(e,t,n,s,c,u,p,x){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ku(e);return}n=n!=null?""+ia(n):"",t=t!=null?""+ia(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=x?e.checked:!!s,e.defaultChecked=!!s,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Ku(e)}function Bu(e,t,n){t==="number"&&So(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function vi(e,t,n,s){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ia(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function vp(e,t,n){if(t!=null&&(t=""+ia(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ia(n):""}function bp(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(l(92));if(xe(s)){if(1<s.length)throw Error(l(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=ia(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),Ku(e)}function bi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xp(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||Rw.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function wp(e,t,n){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in t)s=t[c],t.hasOwnProperty(c)&&n[c]!==s&&xp(e,c,s)}else for(var u in t)t.hasOwnProperty(u)&&xp(e,u,t[u])}function Gu(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ow=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _o(e){return Dw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ja(){}var Pu=null;function Zu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xi=null,wi=null;function Sp(e){var t=pi(e);if(t&&(e=t.stateNode)){var n=e[zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(qu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+sa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var c=s[zt]||null;if(!c)throw Error(l(90));qu(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&yp(s)}break e;case"textarea":vp(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&vi(e,!!n.multiple,t,!1)}}}var Yu=!1;function _p(e,t,n){if(Yu)return e(t,n);Yu=!0;try{var s=e(t);return s}finally{if(Yu=!1,(xi!==null||wi!==null)&&(uc(),xi&&(t=xi,e=wi,wi=xi=null,Sp(t),e)))for(t=0;t<e.length;t++)Sp(e[t])}}function Us(e,t){var n=e.stateNode;if(n===null)return null;var s=n[zt]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(l(231,t,typeof n));return n}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vu=!1;if(Xa)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Vu=!1}var Nn=null,Qu=null,Eo=null;function Ep(){if(Eo)return Eo;var e,t=Qu,n=t.length,s,c="value"in Nn?Nn.value:Nn.textContent,u=c.length;for(e=0;e<n&&t[e]===c[e];e++);var p=n-e;for(s=1;s<=p&&t[n-s]===c[u-s];s++);return Eo=c.slice(e,1<s?1-s:void 0)}function ko(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function To(){return!0}function kp(){return!1}function Mt(e){function t(n,s,c,u,p){this._reactName=n,this._targetInst=c,this.type=s,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(u):u[x]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?To:kp,this.isPropagationStopped=kp,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),t}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=Mt(kr),Ls=b({},kr,{view:0,detail:0}),zw=Mt(Ls),Ju,Xu,Ks,Ao=b({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ks&&(Ks&&e.type==="mousemove"?(Ju=e.screenX-Ks.screenX,Xu=e.screenY-Ks.screenY):Xu=Ju=0,Ks=e),Ju)},movementY:function(e){return"movementY"in e?e.movementY:Xu}}),Tp=Mt(Ao),Mw=b({},Ao,{dataTransfer:0}),Uw=Mt(Mw),Hw=b({},Ls,{relatedTarget:0}),Wu=Mt(Hw),Lw=b({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),Kw=Mt(Lw),qw=b({},kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bw=Mt(qw),Gw=b({},kr,{data:0}),jp=Mt(Gw),Pw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zw={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"},Yw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yw[e])?!!t[e]:!1}function Iu(){return Vw}var Qw=b({},Ls,{key:function(e){if(e.key){var t=Pw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ko(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iu,charCode:function(e){return e.type==="keypress"?ko(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ko(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jw=Mt(Qw),Xw=b({},Ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ap=Mt(Xw),Ww=b({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iu}),Iw=Mt(Ww),Fw=b({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),$w=Mt(Fw),eS=b({},Ao,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),tS=Mt(eS),aS=b({},kr,{newState:0,oldState:0}),nS=Mt(aS),rS=[9,13,27,32],Fu=Xa&&"CompositionEvent"in window,qs=null;Xa&&"documentMode"in document&&(qs=document.documentMode);var iS=Xa&&"TextEvent"in window&&!qs,Np=Xa&&(!Fu||qs&&8<qs&&11>=qs),Cp=" ",Rp=!1;function Op(e,t){switch(e){case"keyup":return rS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Si=!1;function sS(e,t){switch(e){case"compositionend":return Dp(t);case"keypress":return t.which!==32?null:(Rp=!0,Cp);case"textInput":return e=t.data,e===Cp&&Rp?null:e;default:return null}}function lS(e,t){if(Si)return e==="compositionend"||!Fu&&Op(e,t)?(e=Ep(),Eo=Qu=Nn=null,Si=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Np&&t.locale!=="ko"?null:t.data;default:return null}}var oS={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 zp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!oS[e.type]:t==="textarea"}function Mp(e,t,n,s){xi?wi?wi.push(s):wi=[s]:xi=s,t=gc(t,"onChange"),0<t.length&&(n=new jo("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Bs=null,Gs=null;function cS(e){gg(e,0)}function No(e){var t=Ms(e);if(yp(t))return e}function Up(e,t){if(e==="change")return t}var Hp=!1;if(Xa){var $u;if(Xa){var ed="oninput"in document;if(!ed){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),ed=typeof Lp.oninput=="function"}$u=ed}else $u=!1;Hp=$u&&(!document.documentMode||9<document.documentMode)}function Kp(){Bs&&(Bs.detachEvent("onpropertychange",qp),Gs=Bs=null)}function qp(e){if(e.propertyName==="value"&&No(Gs)){var t=[];Mp(t,Gs,e,Zu(e)),_p(cS,t)}}function uS(e,t,n){e==="focusin"?(Kp(),Bs=t,Gs=n,Bs.attachEvent("onpropertychange",qp)):e==="focusout"&&Kp()}function dS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return No(Gs)}function fS(e,t){if(e==="click")return No(t)}function hS(e,t){if(e==="input"||e==="change")return No(t)}function mS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:mS;function Ps(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var c=n[s];if(!Ru.call(t,c)||!Jt(e[c],t[c]))return!1}return!0}function Bp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gp(e,t){var n=Bp(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bp(n)}}function Pp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=So(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=So(e.document)}return t}function td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var pS=Xa&&"documentMode"in document&&11>=document.documentMode,_i=null,ad=null,Zs=null,nd=!1;function Yp(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nd||_i==null||_i!==So(s)||(s=_i,"selectionStart"in s&&td(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Zs&&Ps(Zs,s)||(Zs=s,s=gc(ad,"onSelect"),0<s.length&&(t=new jo("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=_i)))}function Tr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ei={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},rd={},Vp={};Xa&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete Ei.animationend.animation,delete Ei.animationiteration.animation,delete Ei.animationstart.animation),"TransitionEvent"in window||delete Ei.transitionend.transition);function jr(e){if(rd[e])return rd[e];if(!Ei[e])return e;var t=Ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vp)return rd[e]=t[n];return e}var Qp=jr("animationend"),Jp=jr("animationiteration"),Xp=jr("animationstart"),yS=jr("transitionrun"),gS=jr("transitionstart"),vS=jr("transitioncancel"),Wp=jr("transitionend"),Ip=new Map,id="abort auxClick beforeToggle 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(" ");id.push("scrollEnd");function wa(e,t){Ip.set(e,t),Er(t,[e])}var Co=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},la=[],ki=0,sd=0;function Ro(){for(var e=ki,t=sd=ki=0;t<e;){var n=la[t];la[t++]=null;var s=la[t];la[t++]=null;var c=la[t];la[t++]=null;var u=la[t];if(la[t++]=null,s!==null&&c!==null){var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}u!==0&&Fp(n,c,u)}}function Oo(e,t,n,s){la[ki++]=e,la[ki++]=t,la[ki++]=n,la[ki++]=s,sd|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function ld(e,t,n,s){return Oo(e,t,n,s),Do(e)}function Ar(e,t){return Oo(e,null,null,t),Do(e)}function Fp(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var c=!1,u=e.return;u!==null;)u.childLanes|=n,s=u.alternate,s!==null&&(s.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Qt(n),e=u.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=n|536870912),u):null}function Do(e){if(50<fl)throw fl=0,gf=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function bS(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,n,s){return new bS(e,t,n,s)}function od(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wa(e,t){var n=e.alternate;return n===null?(n=Xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $p(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zo(e,t,n,s,c,u){var p=0;if(s=e,typeof e=="function")od(e)&&(p=1);else if(typeof e=="string")p=E1(e,n,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=Xt(31,n,t,c),e.elementType=X,e.lanes=u,e;case E:return Nr(n.children,c,u,t);case S:p=8,c|=24;break;case N:return e=Xt(12,n,t,c|2),e.elementType=N,e.lanes=u,e;case U:return e=Xt(13,n,t,c),e.elementType=U,e.lanes=u,e;case I:return e=Xt(19,n,t,c),e.elementType=I,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:p=10;break e;case H:p=9;break e;case L:p=11;break e;case $:p=14;break e;case ee:p=16,s=null;break e}p=29,n=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=Xt(p,n,t,c),t.elementType=e,t.type=s,t.lanes=u,t}function Nr(e,t,n,s){return e=Xt(7,e,s,t),e.lanes=n,e}function cd(e,t,n){return e=Xt(6,e,null,t),e.lanes=n,e}function ey(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function ud(e,t,n){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ty=new WeakMap;function oa(e,t){if(typeof e=="object"&&e!==null){var n=ty.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ep(t)},ty.set(e,t),t)}return{value:e,source:t,stack:ep(t)}}var ji=[],Ai=0,Mo=null,Ys=0,ca=[],ua=0,Cn=null,Da=1,za="";function Ia(e,t){ji[Ai++]=Ys,ji[Ai++]=Mo,Mo=e,Ys=t}function ay(e,t,n){ca[ua++]=Da,ca[ua++]=za,ca[ua++]=Cn,Cn=e;var s=Da;e=za;var c=32-Qt(s)-1;s&=~(1<<c),n+=1;var u=32-Qt(t)+c;if(30<u){var p=c-c%5;u=(s&(1<<p)-1).toString(32),s>>=p,c-=p,Da=1<<32-Qt(t)+c|n<<c|s,za=u+e}else Da=1<<u|n<<c|s,za=e}function dd(e){e.return!==null&&(Ia(e,1),ay(e,1,0))}function fd(e){for(;e===Mo;)Mo=ji[--Ai],ji[Ai]=null,Ys=ji[--Ai],ji[Ai]=null;for(;e===Cn;)Cn=ca[--ua],ca[ua]=null,za=ca[--ua],ca[ua]=null,Da=ca[--ua],ca[ua]=null}function ny(e,t){ca[ua++]=Da,ca[ua++]=za,ca[ua++]=Cn,Da=t.id,za=t.overflow,Cn=e}var bt=null,Qe=null,Ae=!1,Rn=null,da=!1,hd=Error(l(519));function On(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vs(oa(t,e)),hd}function ry(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[vt]=e,t[zt]=s,n){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(n=0;n<ml.length;n++)ke(ml[n],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),gp(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),bp(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||wg(t.textContent,n)?(s.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),s.onScroll!=null&&ke("scroll",t),s.onScrollEnd!=null&&ke("scrollend",t),s.onClick!=null&&(t.onclick=Ja),t=!0):t=!1,t||On(e,!0)}function iy(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:bt=bt.return}}function Ni(e){if(e!==bt)return!1;if(!Ae)return iy(e),Ae=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Of(e.type,e.memoizedProps)),n=!n),n&&Qe&&On(e),iy(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Qe=Cg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Qe=Cg(e)}else t===27?(t=Qe,Vn(e.type)?(e=Hf,Hf=null,Qe=e):Qe=t):Qe=bt?ha(e.stateNode.nextSibling):null;return!0}function Cr(){Qe=bt=null,Ae=!1}function md(){var e=Rn;return e!==null&&(Kt===null?Kt=e:Kt.push.apply(Kt,e),Rn=null),e}function Vs(e){Rn===null?Rn=[e]:Rn.push(e)}var pd=j(null),Rr=null,Fa=null;function Dn(e,t,n){F(pd,t._currentValue),t._currentValue=n}function $a(e){e._currentValue=pd.current,G(pd)}function yd(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function gd(e,t,n,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var p=c.child;u=u.firstContext;e:for(;u!==null;){var x=u;u=c;for(var k=0;k<t.length;k++)if(x.context===t[k]){u.lanes|=n,x=u.alternate,x!==null&&(x.lanes|=n),yd(u.return,n,e),s||(p=null);break e}u=x.next}}else if(c.tag===18){if(p=c.return,p===null)throw Error(l(341));p.lanes|=n,u=p.alternate,u!==null&&(u.lanes|=n),yd(p,n,e),p=null}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===e){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}}function Ci(e,t,n,s){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var p=c.alternate;if(p===null)throw Error(l(387));if(p=p.memoizedProps,p!==null){var x=c.type;Jt(c.pendingProps.value,p.value)||(e!==null?e.push(x):e=[x])}}else if(c===Me.current){if(p=c.alternate,p===null)throw Error(l(387));p.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(bl):e=[bl])}c=c.return}e!==null&&gd(t,e,n,s),t.flags|=262144}function Uo(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){Rr=e,Fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return sy(Rr,e)}function Ho(e,t){return Rr===null&&Or(e),sy(e,t)}function sy(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fa===null){if(e===null)throw Error(l(308));Fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fa=Fa.next=t;return n}var xS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},wS=r.unstable_scheduleCallback,SS=r.unstable_NormalPriority,st={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vd(){return{controller:new xS,data:new Map,refCount:0}}function Qs(e){e.refCount--,e.refCount===0&&wS(SS,function(){e.controller.abort()})}var Js=null,bd=0,Ri=0,Oi=null;function _S(e,t){if(Js===null){var n=Js=[];bd=0,Ri=_f(),Oi={status:"pending",value:void 0,then:function(s){n.push(s)}}}return bd++,t.then(ly,ly),t}function ly(){if(--bd===0&&Js!==null){Oi!==null&&(Oi.status="fulfilled");var e=Js;Js=null,Ri=0,Oi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ES(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),s}var oy=B.S;B.S=function(e,t){Y0=Yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_S(e,t),oy!==null&&oy(e,t)};var Dr=j(null);function xd(){var e=Dr.current;return e!==null?e:Ze.pooledCache}function Lo(e,t){t===null?F(Dr,Dr.current):F(Dr,t.pool)}function cy(){var e=xd();return e===null?null:{parent:st._currentValue,pool:e}}var Di=Error(l(460)),wd=Error(l(474)),Ko=Error(l(542)),qo={then:function(){}};function uy(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dy(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ja,Ja),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hy(e),e;default:if(typeof t.status=="string")t.then(Ja,Ja);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hy(e),e}throw Mr=t,Di}}function zr(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Mr=n,Di):n}}var Mr=null;function fy(){if(Mr===null)throw Error(l(459));var e=Mr;return Mr=null,e}function hy(e){if(e===Di||e===Ko)throw Error(l(483))}var zi=null,Xs=0;function Bo(e){var t=Xs;return Xs+=1,zi===null&&(zi=[]),dy(zi,e,t)}function Ws(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Go(e,t){throw t.$$typeof===w?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function my(e){function t(O,R){if(e){var D=O.deletions;D===null?(O.deletions=[R],O.flags|=16):D.push(R)}}function n(O,R){if(!e)return null;for(;R!==null;)t(O,R),R=R.sibling;return null}function s(O){for(var R=new Map;O!==null;)O.key!==null?R.set(O.key,O):R.set(O.index,O),O=O.sibling;return R}function c(O,R){return O=Wa(O,R),O.index=0,O.sibling=null,O}function u(O,R,D){return O.index=D,e?(D=O.alternate,D!==null?(D=D.index,D<R?(O.flags|=67108866,R):D):(O.flags|=67108866,R)):(O.flags|=1048576,R)}function p(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function x(O,R,D,Z){return R===null||R.tag!==6?(R=cd(D,O.mode,Z),R.return=O,R):(R=c(R,D),R.return=O,R)}function k(O,R,D,Z){var ue=D.type;return ue===E?P(O,R,D.props.children,Z,D.key):R!==null&&(R.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===ee&&zr(ue)===R.type)?(R=c(R,D.props),Ws(R,D),R.return=O,R):(R=zo(D.type,D.key,D.props,null,O.mode,Z),Ws(R,D),R.return=O,R)}function z(O,R,D,Z){return R===null||R.tag!==4||R.stateNode.containerInfo!==D.containerInfo||R.stateNode.implementation!==D.implementation?(R=ud(D,O.mode,Z),R.return=O,R):(R=c(R,D.children||[]),R.return=O,R)}function P(O,R,D,Z,ue){return R===null||R.tag!==7?(R=Nr(D,O.mode,Z,ue),R.return=O,R):(R=c(R,D),R.return=O,R)}function Y(O,R,D){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=cd(""+R,O.mode,D),R.return=O,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case _:return D=zo(R.type,R.key,R.props,null,O.mode,D),Ws(D,R),D.return=O,D;case C:return R=ud(R,O.mode,D),R.return=O,R;case ee:return R=zr(R),Y(O,R,D)}if(xe(R)||Q(R))return R=Nr(R,O.mode,D,null),R.return=O,R;if(typeof R.then=="function")return Y(O,Bo(R),D);if(R.$$typeof===K)return Y(O,Ho(O,R),D);Go(O,R)}return null}function M(O,R,D,Z){var ue=R!==null?R.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return ue!==null?null:x(O,R,""+D,Z);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case _:return D.key===ue?k(O,R,D,Z):null;case C:return D.key===ue?z(O,R,D,Z):null;case ee:return D=zr(D),M(O,R,D,Z)}if(xe(D)||Q(D))return ue!==null?null:P(O,R,D,Z,null);if(typeof D.then=="function")return M(O,R,Bo(D),Z);if(D.$$typeof===K)return M(O,R,Ho(O,D),Z);Go(O,D)}return null}function q(O,R,D,Z,ue){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return O=O.get(D)||null,x(R,O,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return O=O.get(Z.key===null?D:Z.key)||null,k(R,O,Z,ue);case C:return O=O.get(Z.key===null?D:Z.key)||null,z(R,O,Z,ue);case ee:return Z=zr(Z),q(O,R,D,Z,ue)}if(xe(Z)||Q(Z))return O=O.get(D)||null,P(R,O,Z,ue,null);if(typeof Z.then=="function")return q(O,R,D,Bo(Z),ue);if(Z.$$typeof===K)return q(O,R,D,Ho(R,Z),ue);Go(R,Z)}return null}function se(O,R,D,Z){for(var ue=null,Oe=null,le=R,we=R=0,je=null;le!==null&&we<D.length;we++){le.index>we?(je=le,le=null):je=le.sibling;var De=M(O,le,D[we],Z);if(De===null){le===null&&(le=je);break}e&&le&&De.alternate===null&&t(O,le),R=u(De,R,we),Oe===null?ue=De:Oe.sibling=De,Oe=De,le=je}if(we===D.length)return n(O,le),Ae&&Ia(O,we),ue;if(le===null){for(;we<D.length;we++)le=Y(O,D[we],Z),le!==null&&(R=u(le,R,we),Oe===null?ue=le:Oe.sibling=le,Oe=le);return Ae&&Ia(O,we),ue}for(le=s(le);we<D.length;we++)je=q(le,O,we,D[we],Z),je!==null&&(e&&je.alternate!==null&&le.delete(je.key===null?we:je.key),R=u(je,R,we),Oe===null?ue=je:Oe.sibling=je,Oe=je);return e&&le.forEach(function(In){return t(O,In)}),Ae&&Ia(O,we),ue}function me(O,R,D,Z){if(D==null)throw Error(l(151));for(var ue=null,Oe=null,le=R,we=R=0,je=null,De=D.next();le!==null&&!De.done;we++,De=D.next()){le.index>we?(je=le,le=null):je=le.sibling;var In=M(O,le,De.value,Z);if(In===null){le===null&&(le=je);break}e&&le&&In.alternate===null&&t(O,le),R=u(In,R,we),Oe===null?ue=In:Oe.sibling=In,Oe=In,le=je}if(De.done)return n(O,le),Ae&&Ia(O,we),ue;if(le===null){for(;!De.done;we++,De=D.next())De=Y(O,De.value,Z),De!==null&&(R=u(De,R,we),Oe===null?ue=De:Oe.sibling=De,Oe=De);return Ae&&Ia(O,we),ue}for(le=s(le);!De.done;we++,De=D.next())De=q(le,O,we,De.value,Z),De!==null&&(e&&De.alternate!==null&&le.delete(De.key===null?we:De.key),R=u(De,R,we),Oe===null?ue=De:Oe.sibling=De,Oe=De);return e&&le.forEach(function(M1){return t(O,M1)}),Ae&&Ia(O,we),ue}function Pe(O,R,D,Z){if(typeof D=="object"&&D!==null&&D.type===E&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case _:e:{for(var ue=D.key;R!==null;){if(R.key===ue){if(ue=D.type,ue===E){if(R.tag===7){n(O,R.sibling),Z=c(R,D.props.children),Z.return=O,O=Z;break e}}else if(R.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===ee&&zr(ue)===R.type){n(O,R.sibling),Z=c(R,D.props),Ws(Z,D),Z.return=O,O=Z;break e}n(O,R);break}else t(O,R);R=R.sibling}D.type===E?(Z=Nr(D.props.children,O.mode,Z,D.key),Z.return=O,O=Z):(Z=zo(D.type,D.key,D.props,null,O.mode,Z),Ws(Z,D),Z.return=O,O=Z)}return p(O);case C:e:{for(ue=D.key;R!==null;){if(R.key===ue)if(R.tag===4&&R.stateNode.containerInfo===D.containerInfo&&R.stateNode.implementation===D.implementation){n(O,R.sibling),Z=c(R,D.children||[]),Z.return=O,O=Z;break e}else{n(O,R);break}else t(O,R);R=R.sibling}Z=ud(D,O.mode,Z),Z.return=O,O=Z}return p(O);case ee:return D=zr(D),Pe(O,R,D,Z)}if(xe(D))return se(O,R,D,Z);if(Q(D)){if(ue=Q(D),typeof ue!="function")throw Error(l(150));return D=ue.call(D),me(O,R,D,Z)}if(typeof D.then=="function")return Pe(O,R,Bo(D),Z);if(D.$$typeof===K)return Pe(O,R,Ho(O,D),Z);Go(O,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,R!==null&&R.tag===6?(n(O,R.sibling),Z=c(R,D),Z.return=O,O=Z):(n(O,R),Z=cd(D,O.mode,Z),Z.return=O,O=Z),p(O)):n(O,R)}return function(O,R,D,Z){try{Xs=0;var ue=Pe(O,R,D,Z);return zi=null,ue}catch(le){if(le===Di||le===Ko)throw le;var Oe=Xt(29,le,null,O.mode);return Oe.lanes=Z,Oe.return=O,Oe}finally{}}}var Ur=my(!0),py=my(!1),zn=!1;function Sd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _d(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Mn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Un(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ze&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Do(e),Fp(e,null,n),t}return Oo(e,s,t,n),Do(e)}function Is(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,sp(e,n)}}function Ed(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var c=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?c=u=p:u=u.next=p,n=n.next}while(n!==null);u===null?c=u=t:u=u.next=t}else c=u=t;n={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kd=!1;function Fs(){if(kd){var e=Oi;if(e!==null)throw e}}function $s(e,t,n,s){kd=!1;var c=e.updateQueue;zn=!1;var u=c.firstBaseUpdate,p=c.lastBaseUpdate,x=c.shared.pending;if(x!==null){c.shared.pending=null;var k=x,z=k.next;k.next=null,p===null?u=z:p.next=z,p=k;var P=e.alternate;P!==null&&(P=P.updateQueue,x=P.lastBaseUpdate,x!==p&&(x===null?P.firstBaseUpdate=z:x.next=z,P.lastBaseUpdate=k))}if(u!==null){var Y=c.baseState;p=0,P=z=k=null,x=u;do{var M=x.lane&-536870913,q=M!==x.lane;if(q?(Te&M)===M:(s&M)===M){M!==0&&M===Ri&&(kd=!0),P!==null&&(P=P.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var se=e,me=x;M=t;var Pe=n;switch(me.tag){case 1:if(se=me.payload,typeof se=="function"){Y=se.call(Pe,Y,M);break e}Y=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=me.payload,M=typeof se=="function"?se.call(Pe,Y,M):se,M==null)break e;Y=b({},Y,M);break e;case 2:zn=!0}}M=x.callback,M!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[M]:q.push(M))}else q={lane:M,tag:x.tag,payload:x.payload,callback:x.callback,next:null},P===null?(z=P=q,k=Y):P=P.next=q,p|=M;if(x=x.next,x===null){if(x=c.shared.pending,x===null)break;q=x,x=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);P===null&&(k=Y),c.baseState=k,c.firstBaseUpdate=z,c.lastBaseUpdate=P,u===null&&(c.shared.lanes=0),Bn|=p,e.lanes=p,e.memoizedState=Y}}function yy(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function gy(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yy(n[e],t)}var Mi=j(null),Po=j(0);function vy(e,t){e=cn,F(Po,e),F(Mi,t),cn=e|t.baseLanes}function Td(){F(Po,cn),F(Mi,Mi.current)}function jd(){cn=Po.current,G(Mi),G(Po)}var Wt=j(null),fa=null;function Hn(e){var t=e.alternate;F(rt,rt.current&1),F(Wt,e),fa===null&&(t===null||Mi.current!==null||t.memoizedState!==null)&&(fa=e)}function Ad(e){F(rt,rt.current),F(Wt,e),fa===null&&(fa=e)}function by(e){e.tag===22?(F(rt,rt.current),F(Wt,e),fa===null&&(fa=e)):Ln()}function Ln(){F(rt,rt.current),F(Wt,Wt.current)}function It(e){G(Wt),fa===e&&(fa=null),G(rt)}var rt=j(0);function Zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Mf(n)||Uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var en=0,be=null,Be=null,lt=null,Yo=!1,Ui=!1,Hr=!1,Vo=0,el=0,Hi=null,kS=0;function $e(){throw Error(l(321))}function Nd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jt(e[n],t[n]))return!1;return!0}function Cd(e,t,n,s,c,u){return en=u,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?a0:Yd,Hr=!1,u=n(s,c),Hr=!1,Ui&&(u=wy(t,n,s,c)),xy(e),u}function xy(e){B.H=nl;var t=Be!==null&&Be.next!==null;if(en=0,lt=Be=be=null,Yo=!1,el=0,Hi=null,t)throw Error(l(300));e===null||ot||(e=e.dependencies,e!==null&&Uo(e)&&(ot=!0))}function wy(e,t,n,s){be=e;var c=0;do{if(Ui&&(Hi=null),el=0,Ui=!1,25<=c)throw Error(l(301));if(c+=1,lt=Be=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}B.H=n0,u=t(n,s)}while(Ui);return u}function TS(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?tl(t):t,e=e.useState()[0],(Be!==null?Be.memoizedState:null)!==e&&(be.flags|=1024),t}function Rd(){var e=Vo!==0;return Vo=0,e}function Od(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Dd(e){if(Yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yo=!1}en=0,lt=Be=be=null,Ui=!1,el=Vo=0,Hi=null}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?be.memoizedState=lt=e:lt=lt.next=e,lt}function it(){if(Be===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=lt===null?be.memoizedState:lt.next;if(t!==null)lt=t,Be=e;else{if(e===null)throw be.alternate===null?Error(l(467)):Error(l(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},lt===null?be.memoizedState=lt=e:lt=lt.next=e}return lt}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(e){var t=el;return el+=1,Hi===null&&(Hi=[]),e=dy(Hi,e,t),t=be,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?a0:Yd),e}function Jo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tl(e);if(e.$$typeof===K)return xt(e)}throw Error(l(438,String(e)))}function zd(e){var t=null,n=be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Qo(),be.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=ie;return t.index++,n}function tn(e,t){return typeof t=="function"?t(e):t}function Xo(e){var t=it();return Md(t,Be,e)}function Md(e,t,n){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=n;var c=e.baseQueue,u=s.pending;if(u!==null){if(c!==null){var p=c.next;c.next=u.next,u.next=p}t.baseQueue=c=u,s.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var x=p=null,k=null,z=t,P=!1;do{var Y=z.lane&-536870913;if(Y!==z.lane?(Te&Y)===Y:(en&Y)===Y){var M=z.revertLane;if(M===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Y===Ri&&(P=!0);else if((en&M)===M){z=z.next,M===Ri&&(P=!0);continue}else Y={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},k===null?(x=k=Y,p=u):k=k.next=Y,be.lanes|=M,Bn|=M;Y=z.action,Hr&&n(u,Y),u=z.hasEagerState?z.eagerState:n(u,Y)}else M={lane:Y,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},k===null?(x=k=M,p=u):k=k.next=M,be.lanes|=Y,Bn|=Y;z=z.next}while(z!==null&&z!==t);if(k===null?p=u:k.next=x,!Jt(u,e.memoizedState)&&(ot=!0,P&&(n=Oi,n!==null)))throw n;e.memoizedState=u,e.baseState=p,e.baseQueue=k,s.lastRenderedState=u}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ud(e){var t=it(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var s=n.dispatch,c=n.pending,u=t.memoizedState;if(c!==null){n.pending=null;var p=c=c.next;do u=e(u,p.action),p=p.next;while(p!==c);Jt(u,t.memoizedState)||(ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,s]}function Sy(e,t,n){var s=be,c=it(),u=Ae;if(u){if(n===void 0)throw Error(l(407));n=n()}else n=t();var p=!Jt((Be||c).memoizedState,n);if(p&&(c.memoizedState=n,ot=!0),c=c.queue,Kd(ky.bind(null,s,c,e),[e]),c.getSnapshot!==t||p||lt!==null&&lt.memoizedState.tag&1){if(s.flags|=2048,Li(9,{destroy:void 0},Ey.bind(null,s,c,n,t),null),Ze===null)throw Error(l(349));u||(en&127)!==0||_y(s,t,n)}return n}function _y(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t=Qo(),be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ey(e,t,n,s){t.value=n,t.getSnapshot=s,Ty(t)&&jy(e)}function ky(e,t,n){return n(function(){Ty(t)&&jy(e)})}function Ty(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jt(e,n)}catch{return!0}}function jy(e){var t=Ar(e,2);t!==null&&qt(t,e,2)}function Hd(e){var t=Nt();if(typeof e=="function"){var n=e;if(e=n(),Hr){jn(!0);try{n()}finally{jn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:e},t}function Ay(e,t,n,s){return e.baseState=n,Md(e,Be,typeof s=="function"?s:tn)}function jS(e,t,n,s,c){if(Fo(e))throw Error(l(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){u.listeners.push(p)}};B.T!==null?n(!0):u.isTransition=!1,s(u),n=t.pending,n===null?(u.next=t.pending=u,Ny(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Ny(e,t){var n=t.action,s=t.payload,c=e.state;if(t.isTransition){var u=B.T,p={};B.T=p;try{var x=n(c,s),k=B.S;k!==null&&k(p,x),Cy(e,t,x)}catch(z){Ld(e,t,z)}finally{u!==null&&p.types!==null&&(u.types=p.types),B.T=u}}else try{u=n(c,s),Cy(e,t,u)}catch(z){Ld(e,t,z)}}function Cy(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Ry(e,t,s)},function(s){return Ld(e,t,s)}):Ry(e,t,n)}function Ry(e,t,n){t.status="fulfilled",t.value=n,Oy(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ny(e,n)))}function Ld(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Oy(t),t=t.next;while(t!==s)}e.action=null}function Oy(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dy(e,t){return t}function zy(e,t){if(Ae){var n=Ze.formState;if(n!==null){e:{var s=be;if(Ae){if(Qe){t:{for(var c=Qe,u=da;c.nodeType!==8;){if(!u){c=null;break t}if(c=ha(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Qe=ha(c.nextSibling),s=c.data==="F!";break e}}On(s)}s=!1}s&&(t=n[0])}}return n=Nt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dy,lastRenderedState:t},n.queue=s,n=$y.bind(null,be,s),s.dispatch=n,s=Hd(!1),u=Zd.bind(null,be,!1,s.queue),s=Nt(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,n=jS.bind(null,be,c,u,n),c.dispatch=n,s.memoizedState=e,[t,n,!1]}function My(e){var t=it();return Uy(t,Be,e)}function Uy(e,t,n){if(t=Md(e,t,Dy)[0],e=Xo(tn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=tl(t)}catch(p){throw p===Di?Ko:p}else s=t;t=it();var c=t.queue,u=c.dispatch;return n!==t.memoizedState&&(be.flags|=2048,Li(9,{destroy:void 0},AS.bind(null,c,n),null)),[s,u,e]}function AS(e,t){e.action=t}function Hy(e){var t=it(),n=Be;if(n!==null)return Uy(t,n,e);it(),t=t.memoizedState,n=it();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Li(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=be.updateQueue,t===null&&(t=Qo(),be.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Ly(){return it().memoizedState}function Wo(e,t,n,s){var c=Nt();be.flags|=e,c.memoizedState=Li(1|t,{destroy:void 0},n,s===void 0?null:s)}function Io(e,t,n,s){var c=it();s=s===void 0?null:s;var u=c.memoizedState.inst;Be!==null&&s!==null&&Nd(s,Be.memoizedState.deps)?c.memoizedState=Li(t,u,n,s):(be.flags|=e,c.memoizedState=Li(1|t,u,n,s))}function Ky(e,t){Wo(8390656,8,e,t)}function Kd(e,t){Io(2048,8,e,t)}function NS(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=Qo(),be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function qy(e){var t=it().memoizedState;return NS({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function By(e,t){return Io(4,2,e,t)}function Gy(e,t){return Io(4,4,e,t)}function Py(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Zy(e,t,n){n=n!=null?n.concat([e]):null,Io(4,4,Py.bind(null,t,e),n)}function qd(){}function Yy(e,t){var n=it();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Nd(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Vy(e,t){var n=it();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Nd(t,s[1]))return s[0];if(s=e(),Hr){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[s,t],s}function Bd(e,t,n){return n===void 0||(en&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Q0(),be.lanes|=e,Bn|=e,n)}function Qy(e,t,n,s){return Jt(n,t)?n:Mi.current!==null?(e=Bd(e,n,s),Jt(e,t)||(ot=!0),e):(en&42)===0||(en&1073741824)!==0&&(Te&261930)===0?(ot=!0,e.memoizedState=n):(e=Q0(),be.lanes|=e,Bn|=e,t)}function Jy(e,t,n,s,c){var u=V.p;V.p=u!==0&&8>u?u:8;var p=B.T,x={};B.T=x,Zd(e,!1,t,n);try{var k=c(),z=B.S;if(z!==null&&z(x,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var P=ES(k,s);al(e,t,P,ea(e))}else al(e,t,s,ea(e))}catch(Y){al(e,t,{then:function(){},status:"rejected",reason:Y},ea())}finally{V.p=u,p!==null&&x.types!==null&&(p.types=x.types),B.T=p}}function CS(){}function Gd(e,t,n,s){if(e.tag!==5)throw Error(l(476));var c=Xy(e).queue;Jy(e,c,t,te,n===null?CS:function(){return Wy(e),n(s)})}function Xy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wy(e){var t=Xy(e);t.next===null&&(t=e.alternate.memoizedState),al(e,t.next.queue,{},ea())}function Pd(){return xt(bl)}function Iy(){return it().memoizedState}function Fy(){return it().memoizedState}function RS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ea();e=Mn(n);var s=Un(t,e,n);s!==null&&(qt(s,t,n),Is(s,t,n)),t={cache:vd()},e.payload=t;return}t=t.return}}function OS(e,t,n){var s=ea();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fo(e)?e0(t,n):(n=ld(e,t,n,s),n!==null&&(qt(n,e,s),t0(n,t,s)))}function $y(e,t,n){var s=ea();al(e,t,n,s)}function al(e,t,n,s){var c={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fo(e))e0(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,x=u(p,n);if(c.hasEagerState=!0,c.eagerState=x,Jt(x,p))return Oo(e,t,c,0),Ze===null&&Ro(),!1}catch{}finally{}if(n=ld(e,t,c,s),n!==null)return qt(n,e,s),t0(n,t,s),!0}return!1}function Zd(e,t,n,s){if(s={lane:2,revertLane:_f(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Fo(e)){if(t)throw Error(l(479))}else t=ld(e,n,s,2),t!==null&&qt(t,e,2)}function Fo(e){var t=e.alternate;return e===be||t!==null&&t===be}function e0(e,t){Ui=Yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function t0(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,sp(e,n)}}var nl={readContext:xt,use:Jo,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useLayoutEffect:$e,useInsertionEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useSyncExternalStore:$e,useId:$e,useHostTransitionStatus:$e,useFormState:$e,useActionState:$e,useOptimistic:$e,useMemoCache:$e,useCacheRefresh:$e};nl.useEffectEvent=$e;var a0={readContext:xt,use:Jo,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:Ky,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Wo(4194308,4,Py.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wo(4194308,4,e,t)},useInsertionEffect:function(e,t){Wo(4,2,e,t)},useMemo:function(e,t){var n=Nt();t=t===void 0?null:t;var s=e();if(Hr){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Nt();if(n!==void 0){var c=n(t);if(Hr){jn(!0);try{n(t)}finally{jn(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=OS.bind(null,be,e),[s.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hd(e);var t=e.queue,n=$y.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qd,useDeferredValue:function(e,t){var n=Nt();return Bd(n,e,t)},useTransition:function(){var e=Hd(!1);return e=Jy.bind(null,be,e.queue,!0,!1),Nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=be,c=Nt();if(Ae){if(n===void 0)throw Error(l(407));n=n()}else{if(n=t(),Ze===null)throw Error(l(349));(Te&127)!==0||_y(s,t,n)}c.memoizedState=n;var u={value:n,getSnapshot:t};return c.queue=u,Ky(ky.bind(null,s,u,e),[e]),s.flags|=2048,Li(9,{destroy:void 0},Ey.bind(null,s,u,n,t),null),n},useId:function(){var e=Nt(),t=Ze.identifierPrefix;if(Ae){var n=za,s=Da;n=(s&~(1<<32-Qt(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Vo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=kS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Pd,useFormState:zy,useActionState:zy,useOptimistic:function(e){var t=Nt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Zd.bind(null,be,!0,n),n.dispatch=t,[e,t]},useMemoCache:zd,useCacheRefresh:function(){return Nt().memoizedState=RS.bind(null,be)},useEffectEvent:function(e){var t=Nt(),n={impl:e};return t.memoizedState=n,function(){if((ze&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}},Yd={readContext:xt,use:Jo,useCallback:Yy,useContext:xt,useEffect:Kd,useImperativeHandle:Zy,useInsertionEffect:By,useLayoutEffect:Gy,useMemo:Vy,useReducer:Xo,useRef:Ly,useState:function(){return Xo(tn)},useDebugValue:qd,useDeferredValue:function(e,t){var n=it();return Qy(n,Be.memoizedState,e,t)},useTransition:function(){var e=Xo(tn)[0],t=it().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Sy,useId:Iy,useHostTransitionStatus:Pd,useFormState:My,useActionState:My,useOptimistic:function(e,t){var n=it();return Ay(n,Be,e,t)},useMemoCache:zd,useCacheRefresh:Fy};Yd.useEffectEvent=qy;var n0={readContext:xt,use:Jo,useCallback:Yy,useContext:xt,useEffect:Kd,useImperativeHandle:Zy,useInsertionEffect:By,useLayoutEffect:Gy,useMemo:Vy,useReducer:Ud,useRef:Ly,useState:function(){return Ud(tn)},useDebugValue:qd,useDeferredValue:function(e,t){var n=it();return Be===null?Bd(n,e,t):Qy(n,Be.memoizedState,e,t)},useTransition:function(){var e=Ud(tn)[0],t=it().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Sy,useId:Iy,useHostTransitionStatus:Pd,useFormState:Hy,useActionState:Hy,useOptimistic:function(e,t){var n=it();return Be!==null?Ay(n,Be,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:zd,useCacheRefresh:Fy};n0.useEffectEvent=qy;function Vd(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qd={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=ea(),c=Mn(s);c.payload=t,n!=null&&(c.callback=n),t=Un(e,c,s),t!==null&&(qt(t,e,s),Is(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=ea(),c=Mn(s);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=Un(e,c,s),t!==null&&(qt(t,e,s),Is(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ea(),s=Mn(n);s.tag=2,t!=null&&(s.callback=t),t=Un(e,s,n),t!==null&&(qt(t,e,n),Is(t,e,n))}};function r0(e,t,n,s,c,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,p):t.prototype&&t.prototype.isPureReactComponent?!Ps(n,s)||!Ps(c,u):!0}function i0(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Qd.enqueueReplaceState(t,t.state,null)}function Lr(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function s0(e){Co(e)}function l0(e){console.error(e)}function o0(e){Co(e)}function $o(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function c0(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Jd(e,t,n){return n=Mn(n),n.tag=3,n.payload={element:null},n.callback=function(){$o(e,t)},n}function u0(e){return e=Mn(e),e.tag=3,e}function d0(e,t,n,s){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var u=s.value;e.payload=function(){return c(u)},e.callback=function(){c0(t,n,s)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){c0(t,n,s),typeof c!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})})}function DS(e,t,n,s,c){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Ci(t,n,c,!0),n=Wt.current,n!==null){switch(n.tag){case 31:case 13:return fa===null?dc():n.alternate===null&&et===0&&(et=3),n.flags&=-257,n.flags|=65536,n.lanes=c,s===qo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),xf(e,s,c)),!1;case 22:return n.flags|=65536,s===qo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),xf(e,s,c)),!1}throw Error(l(435,n.tag))}return xf(e,s,c),dc(),!1}if(Ae)return t=Wt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==hd&&(e=Error(l(422),{cause:s}),Vs(oa(e,n)))):(s!==hd&&(t=Error(l(423),{cause:s}),Vs(oa(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=oa(s,n),c=Jd(e.stateNode,s,c),Ed(e,c),et!==4&&(et=2)),!1;var u=Error(l(520),{cause:s});if(u=oa(u,n),dl===null?dl=[u]:dl.push(u),et!==4&&(et=2),t===null)return!0;s=oa(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Jd(n.stateNode,s,e),Ed(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Gn===null||!Gn.has(u))))return n.flags|=65536,c&=-c,n.lanes|=c,c=u0(c),d0(c,e,n,s),Ed(n,c),!1}n=n.return}while(n!==null);return!1}var Xd=Error(l(461)),ot=!1;function wt(e,t,n,s){t.child=e===null?py(t,null,n,s):Ur(t,e.child,n,s)}function f0(e,t,n,s,c){n=n.render;var u=t.ref;if("ref"in s){var p={};for(var x in s)x!=="ref"&&(p[x]=s[x])}else p=s;return Or(t),s=Cd(e,t,n,p,u,c),x=Rd(),e!==null&&!ot?(Od(e,t,c),an(e,t,c)):(Ae&&x&&dd(t),t.flags|=1,wt(e,t,s,c),t.child)}function h0(e,t,n,s,c){if(e===null){var u=n.type;return typeof u=="function"&&!od(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,m0(e,t,u,s,c)):(e=zo(n.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!nf(e,c)){var p=u.memoizedProps;if(n=n.compare,n=n!==null?n:Ps,n(p,s)&&e.ref===t.ref)return an(e,t,c)}return t.flags|=1,e=Wa(u,s),e.ref=t.ref,e.return=t,t.child=e}function m0(e,t,n,s,c){if(e!==null){var u=e.memoizedProps;if(Ps(u,s)&&e.ref===t.ref)if(ot=!1,t.pendingProps=s=u,nf(e,c))(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,an(e,t,c)}return Wd(e,t,n,s,c)}function p0(e,t,n,s){var c=s.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~u}else s=0,t.child=null;return y0(e,t,u,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Lo(t,u!==null?u.cachePool:null),u!==null?vy(t,u):Td(),by(t);else return s=t.lanes=536870912,y0(e,t,u!==null?u.baseLanes|n:n,n,s)}else u!==null?(Lo(t,u.cachePool),vy(t,u),Ln(),t.memoizedState=null):(e!==null&&Lo(t,null),Td(),Ln());return wt(e,t,c,n),t.child}function rl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function y0(e,t,n,s,c){var u=xd();return u=u===null?null:{parent:st._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Lo(t,null),Td(),by(t),e!==null&&Ci(e,t,s,!0),t.childLanes=c,null}function ec(e,t){return t=ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function g0(e,t,n){return Ur(t,e.child,null,n),e=ec(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function zS(e,t,n){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(s.mode==="hidden")return e=ec(t,s),t.lanes=536870912,rl(null,e);if(Ad(t),(e=Qe)?(e=Ng(e,da),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cn!==null?{id:Da,overflow:za}:null,retryLane:536870912,hydrationErrors:null},n=ey(e),n.return=t,t.child=n,bt=t,Qe=null)):e=null,e===null)throw On(t);return t.lanes=536870912,null}return ec(t,s)}var u=e.memoizedState;if(u!==null){var p=u.dehydrated;if(Ad(t),c)if(t.flags&256)t.flags&=-257,t=g0(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(ot||Ci(e,t,n,!1),c=(n&e.childLanes)!==0,ot||c){if(s=Ze,s!==null&&(p=lp(s,n),p!==0&&p!==u.retryLane))throw u.retryLane=p,Ar(e,p),qt(s,e,p),Xd;dc(),t=g0(e,t,n)}else e=u.treeContext,Qe=ha(p.nextSibling),bt=t,Ae=!0,Rn=null,da=!1,e!==null&&ny(t,e),t=ec(t,s),t.flags|=4096;return t}return e=Wa(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function tc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(l(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Wd(e,t,n,s,c){return Or(t),n=Cd(e,t,n,s,void 0,c),s=Rd(),e!==null&&!ot?(Od(e,t,c),an(e,t,c)):(Ae&&s&&dd(t),t.flags|=1,wt(e,t,n,c),t.child)}function v0(e,t,n,s,c,u){return Or(t),t.updateQueue=null,n=wy(t,s,n,c),xy(e),s=Rd(),e!==null&&!ot?(Od(e,t,u),an(e,t,u)):(Ae&&s&&dd(t),t.flags|=1,wt(e,t,n,u),t.child)}function b0(e,t,n,s,c){if(Or(t),t.stateNode===null){var u=Ti,p=n.contextType;typeof p=="object"&&p!==null&&(u=xt(p)),u=new n(s,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Qd,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=s,u.state=t.memoizedState,u.refs={},Sd(t),p=n.contextType,u.context=typeof p=="object"&&p!==null?xt(p):Ti,u.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(Vd(t,n,p,s),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(p=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),p!==u.state&&Qd.enqueueReplaceState(u,u.state,null),$s(t,s,u,c),Fs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){u=t.stateNode;var x=t.memoizedProps,k=Lr(n,x);u.props=k;var z=u.context,P=n.contextType;p=Ti,typeof P=="object"&&P!==null&&(p=xt(P));var Y=n.getDerivedStateFromProps;P=typeof Y=="function"||typeof u.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,P||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x||z!==p)&&i0(t,u,s,p),zn=!1;var M=t.memoizedState;u.state=M,$s(t,s,u,c),Fs(),z=t.memoizedState,x||M!==z||zn?(typeof Y=="function"&&(Vd(t,n,Y,s),z=t.memoizedState),(k=zn||r0(t,n,k,s,M,z,p))?(P||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=z),u.props=s,u.state=z,u.context=p,s=k):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,_d(e,t),p=t.memoizedProps,P=Lr(n,p),u.props=P,Y=t.pendingProps,M=u.context,z=n.contextType,k=Ti,typeof z=="object"&&z!==null&&(k=xt(z)),x=n.getDerivedStateFromProps,(z=typeof x=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==Y||M!==k)&&i0(t,u,s,k),zn=!1,M=t.memoizedState,u.state=M,$s(t,s,u,c),Fs();var q=t.memoizedState;p!==Y||M!==q||zn||e!==null&&e.dependencies!==null&&Uo(e.dependencies)?(typeof x=="function"&&(Vd(t,n,x,s),q=t.memoizedState),(P=zn||r0(t,n,P,s,M,q,k)||e!==null&&e.dependencies!==null&&Uo(e.dependencies))?(z||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,q,k),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,q,k)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=q),u.props=s,u.state=q,u.context=k,s=P):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),s=!1)}return u=s,tc(e,t),s=(t.flags&128)!==0,u||s?(u=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&s?(t.child=Ur(t,e.child,null,c),t.child=Ur(t,null,n,c)):wt(e,t,n,c),t.memoizedState=u.state,e=t.child):e=an(e,t,c),e}function x0(e,t,n,s){return Cr(),t.flags|=256,wt(e,t,n,s),t.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fd(e){return{baseLanes:e,cachePool:cy()}}function $d(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$t),e}function w0(e,t,n){var s=t.pendingProps,c=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),p&&(c=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(c?Hn(t):Ln(),(e=Qe)?(e=Ng(e,da),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cn!==null?{id:Da,overflow:za}:null,retryLane:536870912,hydrationErrors:null},n=ey(e),n.return=t,t.child=n,bt=t,Qe=null)):e=null,e===null)throw On(t);return Uf(e)?t.lanes=32:t.lanes=536870912,null}var x=s.children;return s=s.fallback,c?(Ln(),c=t.mode,x=ac({mode:"hidden",children:x},c),s=Nr(s,c,n,null),x.return=t,s.return=t,x.sibling=s,t.child=x,s=t.child,s.memoizedState=Fd(n),s.childLanes=$d(e,p,n),t.memoizedState=Id,rl(null,s)):(Hn(t),ef(t,x))}var k=e.memoizedState;if(k!==null&&(x=k.dehydrated,x!==null)){if(u)t.flags&256?(Hn(t),t.flags&=-257,t=tf(e,t,n)):t.memoizedState!==null?(Ln(),t.child=e.child,t.flags|=128,t=null):(Ln(),x=s.fallback,c=t.mode,s=ac({mode:"visible",children:s.children},c),x=Nr(x,c,n,null),x.flags|=2,s.return=t,x.return=t,s.sibling=x,t.child=s,Ur(t,e.child,null,n),s=t.child,s.memoizedState=Fd(n),s.childLanes=$d(e,p,n),t.memoizedState=Id,t=rl(null,s));else if(Hn(t),Uf(x)){if(p=x.nextSibling&&x.nextSibling.dataset,p)var z=p.dgst;p=z,s=Error(l(419)),s.stack="",s.digest=p,Vs({value:s,source:null,stack:null}),t=tf(e,t,n)}else if(ot||Ci(e,t,n,!1),p=(n&e.childLanes)!==0,ot||p){if(p=Ze,p!==null&&(s=lp(p,n),s!==0&&s!==k.retryLane))throw k.retryLane=s,Ar(e,s),qt(p,e,s),Xd;Mf(x)||dc(),t=tf(e,t,n)}else Mf(x)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,Qe=ha(x.nextSibling),bt=t,Ae=!0,Rn=null,da=!1,e!==null&&ny(t,e),t=ef(t,s.children),t.flags|=4096);return t}return c?(Ln(),x=s.fallback,c=t.mode,k=e.child,z=k.sibling,s=Wa(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&65011712,z!==null?x=Wa(z,x):(x=Nr(x,c,n,null),x.flags|=2),x.return=t,s.return=t,s.sibling=x,t.child=s,rl(null,s),s=t.child,x=e.child.memoizedState,x===null?x=Fd(n):(c=x.cachePool,c!==null?(k=st._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=cy(),x={baseLanes:x.baseLanes|n,cachePool:c}),s.memoizedState=x,s.childLanes=$d(e,p,n),t.memoizedState=Id,rl(e.child,s)):(Hn(t),n=e.child,e=n.sibling,n=Wa(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function ef(e,t){return t=ac({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ac(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function tf(e,t,n){return Ur(t,e.child,null,n),e=ef(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function S0(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),yd(e.return,t,n)}function af(e,t,n,s,c,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:c,treeForkCount:u}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=s,p.tail=n,p.tailMode=c,p.treeForkCount=u)}function _0(e,t,n){var s=t.pendingProps,c=s.revealOrder,u=s.tail;s=s.children;var p=rt.current,x=(p&2)!==0;if(x?(p=p&1|2,t.flags|=128):p&=1,F(rt,p),wt(e,t,s,n),s=Ae?Ys:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&S0(e,n,t);else if(e.tag===19)S0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&Zo(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),af(t,!1,c,n,u,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Zo(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}af(t,!0,n,null,u,s);break;case"together":af(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function an(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Bn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ci(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,n=Wa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Uo(e)))}function MS(e,t,n){switch(t.tag){case 3:At(t,t.stateNode.containerInfo),Dn(t,st,e.memoizedState.cache),Cr();break;case 27:case 5:Cs(t);break;case 4:At(t,t.stateNode.containerInfo);break;case 10:Dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ad(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Hn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?w0(e,t,n):(Hn(t),e=an(e,t,n),e!==null?e.sibling:null);Hn(t);break;case 19:var c=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Ci(e,t,n,!1),s=(n&t.childLanes)!==0),c){if(s)return _0(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(rt,rt.current),s)break;return null;case 22:return t.lanes=0,p0(e,t,n,t.pendingProps);case 24:Dn(t,st,e.memoizedState.cache)}return an(e,t,n)}function E0(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ot=!0;else{if(!nf(e,n)&&(t.flags&128)===0)return ot=!1,MS(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,Ae&&(t.flags&1048576)!==0&&ay(t,Ys,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=zr(t.elementType),t.type=e,typeof e=="function")od(e)?(s=Lr(e,s),t.tag=1,t=b0(null,t,e,s,n)):(t.tag=0,t=Wd(null,t,e,s,n));else{if(e!=null){var c=e.$$typeof;if(c===L){t.tag=11,t=f0(null,t,e,s,n);break e}else if(c===$){t.tag=14,t=h0(null,t,e,s,n);break e}}throw t=de(e)||e,Error(l(306,t,""))}}return t;case 0:return Wd(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,c=Lr(s,t.pendingProps),b0(e,t,s,c,n);case 3:e:{if(At(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var u=t.memoizedState;c=u.element,_d(e,t),$s(t,s,null,n);var p=t.memoizedState;if(s=p.cache,Dn(t,st,s),s!==u.cache&&gd(t,[st],n,!0),Fs(),s=p.element,u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=x0(e,t,s,n);break e}else if(s!==c){c=oa(Error(l(424)),t),Vs(c),t=x0(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qe=ha(e.firstChild),bt=t,Ae=!0,Rn=null,da=!0,n=py(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Cr(),s===c){t=an(e,t,n);break e}wt(e,t,s,n)}t=t.child}return t;case 26:return tc(e,t),e===null?(n=Mg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ae||(n=t.type,e=t.pendingProps,s=vc(_e.current).createElement(n),s[vt]=t,s[zt]=e,St(s,n,e),ht(s),t.stateNode=s):t.memoizedState=Mg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Cs(t),e===null&&Ae&&(s=t.stateNode=Og(t.type,t.pendingProps,_e.current),bt=t,da=!0,c=Qe,Vn(t.type)?(Hf=c,Qe=ha(s.firstChild)):Qe=c),wt(e,t,t.pendingProps.children,n),tc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((c=s=Qe)&&(s=d1(s,t.type,t.pendingProps,da),s!==null?(t.stateNode=s,bt=t,Qe=ha(s.firstChild),da=!1,c=!0):c=!1),c||On(t)),Cs(t),c=t.type,u=t.pendingProps,p=e!==null?e.memoizedProps:null,s=u.children,Of(c,u)?s=null:p!==null&&Of(c,p)&&(t.flags|=32),t.memoizedState!==null&&(c=Cd(e,t,TS,null,null,n),bl._currentValue=c),tc(e,t),wt(e,t,s,n),t.child;case 6:return e===null&&Ae&&((e=n=Qe)&&(n=f1(n,t.pendingProps,da),n!==null?(t.stateNode=n,bt=t,Qe=null,e=!0):e=!1),e||On(t)),null;case 13:return w0(e,t,n);case 4:return At(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Ur(t,null,s,n):wt(e,t,s,n),t.child;case 11:return f0(e,t,t.type,t.pendingProps,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Dn(t,t.type,s.value),wt(e,t,s.children,n),t.child;case 9:return c=t.type._context,s=t.pendingProps.children,Or(t),c=xt(c),s=s(c),t.flags|=1,wt(e,t,s,n),t.child;case 14:return h0(e,t,t.type,t.pendingProps,n);case 15:return m0(e,t,t.type,t.pendingProps,n);case 19:return _0(e,t,n);case 31:return zS(e,t,n);case 22:return p0(e,t,n,t.pendingProps);case 24:return Or(t),s=xt(st),e===null?(c=xd(),c===null&&(c=Ze,u=vd(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=n),c=u),t.memoizedState={parent:s,cache:c},Sd(t),Dn(t,st,c)):((e.lanes&n)!==0&&(_d(e,t),$s(t,null,null,n),Fs()),c=e.memoizedState,u=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Dn(t,st,s)):(s=u.cache,Dn(t,st,s),s!==c.cache&&gd(t,[st],n,!0))),wt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function nn(e){e.flags|=4}function rf(e,t,n,s,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(I0())e.flags|=8192;else throw Mr=qo,wd}else e.flags&=-16777217}function k0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!qg(t))if(I0())e.flags|=8192;else throw Mr=qo,wd}function nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rp():536870912,e.lanes|=t,Gi|=t)}function il(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function US(e,t,n){var s=t.pendingProps;switch(fd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),$a(st),nt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?nn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,md())),Je(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(nn(t),u!==null?(Je(t),k0(t,u)):(Je(t),rf(t,c,null,s,n))):u?u!==e.memoizedState?(nn(t),Je(t),k0(t,u)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&nn(t),Je(t),rf(t,c,e,s,n)),null;case 27:if(mo(t),n=_e.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&nn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return Je(t),null}e=re.current,Ni(t)?ry(t):(e=Og(c,s,n),t.stateNode=e,nn(t))}return Je(t),null;case 5:if(mo(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&nn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return Je(t),null}if(u=re.current,Ni(t))ry(t);else{var p=vc(_e.current);switch(u){case 1:u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=p.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=p.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=p.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof s.is=="string"?p.createElement("select",{is:s.is}):p.createElement("select"),s.multiple?u.multiple=!0:s.size&&(u.size=s.size);break;default:u=typeof s.is=="string"?p.createElement(c,{is:s.is}):p.createElement(c)}}u[vt]=t,u[zt]=s;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)u.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=u;e:switch(St(u,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&nn(t)}}return Je(t),rf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&nn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=_e.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,c=bt,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[vt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||wg(e.nodeValue,n)),e||On(t,!0)}else e=vc(e).createTextNode(s),e[vt]=t,t.stateNode=e}return Je(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ni(t),n!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[vt]=t}else Cr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else n=md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(l(558))}return Je(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ni(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(l(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[vt]=t}else Cr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else c=md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==c&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),nc(t,t.updateQueue),Je(t),null);case 4:return nt(),e===null&&jf(t.stateNode.containerInfo),Je(t),null;case 10:return $a(t.type),Je(t),null;case 19:if(G(rt),s=t.memoizedState,s===null)return Je(t),null;if(c=(t.flags&128)!==0,u=s.rendering,u===null)if(c)il(s,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Zo(e),u!==null){for(t.flags|=128,il(s,!1),e=u.updateQueue,t.updateQueue=e,nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$p(n,e),n=n.sibling;return F(rt,rt.current&1|2),Ae&&Ia(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Yt()>oc&&(t.flags|=128,c=!0,il(s,!1),t.lanes=4194304)}else{if(!c)if(e=Zo(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,nc(t,e),il(s,!0),s.tail===null&&s.tailMode==="hidden"&&!u.alternate&&!Ae)return Je(t),null}else 2*Yt()-s.renderingStartTime>oc&&n!==536870912&&(t.flags|=128,c=!0,il(s,!1),t.lanes=4194304);s.isBackwards?(u.sibling=t.child,t.child=u):(e=s.last,e!==null?e.sibling=u:t.child=u,s.last=u)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Yt(),e.sibling=null,n=rt.current,F(rt,c?n&1|2:n&1),Ae&&Ia(t,s.treeForkCount),e):(Je(t),null);case 22:case 23:return It(t),jd(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),n=t.updateQueue,n!==null&&nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&G(Dr),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),$a(st),Je(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function HS(e,t){switch(fd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $a(st),nt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return mo(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(l(340));Cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(rt),null;case 4:return nt(),null;case 10:return $a(t.type),null;case 22:case 23:return It(t),jd(),e!==null&&G(Dr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $a(st),null;case 25:return null;default:return null}}function T0(e,t){switch(fd(t),t.tag){case 3:$a(st),nt();break;case 26:case 27:case 5:mo(t);break;case 4:nt();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:G(rt);break;case 10:$a(t.type);break;case 22:case 23:It(t),jd(),e!==null&&G(Dr);break;case 24:$a(st)}}function sl(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var c=s.next;n=c;do{if((n.tag&e)===e){s=void 0;var u=n.create,p=n.inst;s=u(),p.destroy=s}n=n.next}while(n!==c)}}catch(x){Ke(t,t.return,x)}}function Kn(e,t,n){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var u=c.next;s=u;do{if((s.tag&e)===e){var p=s.inst,x=p.destroy;if(x!==void 0){p.destroy=void 0,c=t;var k=n,z=x;try{z()}catch(P){Ke(c,k,P)}}}s=s.next}while(s!==u)}}catch(P){Ke(t,t.return,P)}}function j0(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{gy(t,n)}catch(s){Ke(e,e.return,s)}}}function A0(e,t,n){n.props=Lr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Ke(e,t,s)}}function ll(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(c){Ke(e,t,c)}}function Ma(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(c){Ke(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Ke(e,t,c)}else n.current=null}function N0(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(c){Ke(e,e.return,c)}}function sf(e,t,n){try{var s=e.stateNode;i1(s,e.type,n,t),s[zt]=t}catch(c){Ke(e,e.return,c)}}function C0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function lf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||C0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function of(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ja));else if(s!==4&&(s===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(of(e,t,n),e=e.sibling;e!==null;)of(e,t,n),e=e.sibling}function rc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rc(e,t,n),e=e.sibling;e!==null;)rc(e,t,n),e=e.sibling}function R0(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);St(t,s,n),t[vt]=e,t[zt]=n}catch(u){Ke(e,e.return,u)}}var rn=!1,ct=!1,cf=!1,O0=typeof WeakSet=="function"?WeakSet:Set,mt=null;function LS(e,t){if(e=e.containerInfo,Cf=kc,e=Zp(e),td(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var c=s.anchorOffset,u=s.focusNode;s=s.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var p=0,x=-1,k=-1,z=0,P=0,Y=e,M=null;t:for(;;){for(var q;Y!==n||c!==0&&Y.nodeType!==3||(x=p+c),Y!==u||s!==0&&Y.nodeType!==3||(k=p+s),Y.nodeType===3&&(p+=Y.nodeValue.length),(q=Y.firstChild)!==null;)M=Y,Y=q;for(;;){if(Y===e)break t;if(M===n&&++z===c&&(x=p),M===u&&++P===s&&(k=p),(q=Y.nextSibling)!==null)break;Y=M,M=Y.parentNode}Y=q}n=x===-1||k===-1?null:{start:x,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rf={focusedElem:e,selectionRange:n},kc=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,c=u.memoizedProps,u=u.memoizedState,s=n.stateNode;try{var se=Lr(n.type,c);e=s.getSnapshotBeforeUpdate(se,u),s.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ke(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)zf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function D0(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:ln(e,n),s&4&&sl(5,n);break;case 1:if(ln(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){Ke(n,n.return,p)}else{var c=Lr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Ke(n,n.return,p)}}s&64&&j0(n),s&512&&ll(n,n.return);break;case 3:if(ln(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{gy(e,t)}catch(p){Ke(n,n.return,p)}}break;case 27:t===null&&s&4&&R0(n);case 26:case 5:ln(e,n),t===null&&s&4&&N0(n),s&512&&ll(n,n.return);break;case 12:ln(e,n);break;case 31:ln(e,n),s&4&&U0(e,n);break;case 13:ln(e,n),s&4&&H0(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=QS.bind(null,n),h1(e,n))));break;case 22:if(s=n.memoizedState!==null||rn,!s){t=t!==null&&t.memoizedState!==null||ct,c=rn;var u=ct;rn=s,(ct=t)&&!u?on(e,n,(n.subtreeFlags&8772)!==0):ln(e,n),rn=c,ct=u}break;case 30:break;default:ln(e,n)}}function z0(e){var t=e.alternate;t!==null&&(e.alternate=null,z0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Lu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ie=null,Ut=!1;function sn(e,t,n){for(n=n.child;n!==null;)M0(e,t,n),n=n.sibling}function M0(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Rs,n)}catch{}switch(n.tag){case 26:ct||Ma(n,t),sn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ct||Ma(n,t);var s=Ie,c=Ut;Vn(n.type)&&(Ie=n.stateNode,Ut=!1),sn(e,t,n),yl(n.stateNode),Ie=s,Ut=c;break;case 5:ct||Ma(n,t);case 6:if(s=Ie,c=Ut,Ie=null,sn(e,t,n),Ie=s,Ut=c,Ie!==null)if(Ut)try{(Ie.nodeType===9?Ie.body:Ie.nodeName==="HTML"?Ie.ownerDocument.body:Ie).removeChild(n.stateNode)}catch(u){Ke(n,t,u)}else try{Ie.removeChild(n.stateNode)}catch(u){Ke(n,t,u)}break;case 18:Ie!==null&&(Ut?(e=Ie,jg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wi(e)):jg(Ie,n.stateNode));break;case 4:s=Ie,c=Ut,Ie=n.stateNode.containerInfo,Ut=!0,sn(e,t,n),Ie=s,Ut=c;break;case 0:case 11:case 14:case 15:Kn(2,n,t),ct||Kn(4,n,t),sn(e,t,n);break;case 1:ct||(Ma(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&A0(n,t,s)),sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:ct=(s=ct)||n.memoizedState!==null,sn(e,t,n),ct=s;break;default:sn(e,t,n)}}function U0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wi(e)}catch(n){Ke(t,t.return,n)}}}function H0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wi(e)}catch(n){Ke(t,t.return,n)}}function KS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new O0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new O0),t;default:throw Error(l(435,e.tag))}}function ic(e,t){var n=KS(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var c=JS.bind(null,e,s);s.then(c,c)}})}function Ht(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var c=n[s],u=e,p=t,x=p;e:for(;x!==null;){switch(x.tag){case 27:if(Vn(x.type)){Ie=x.stateNode,Ut=!1;break e}break;case 5:Ie=x.stateNode,Ut=!1;break e;case 3:case 4:Ie=x.stateNode.containerInfo,Ut=!0;break e}x=x.return}if(Ie===null)throw Error(l(160));M0(u,p,c),Ie=null,Ut=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)L0(t,e),t=t.sibling}var Sa=null;function L0(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),Lt(e),s&4&&(Kn(3,e,e.return),sl(3,e),Kn(5,e,e.return));break;case 1:Ht(t,e),Lt(e),s&512&&(ct||n===null||Ma(n,n.return)),s&64&&rn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var c=Sa;if(Ht(t,e),Lt(e),s&512&&(ct||n===null||Ma(n,n.return)),s&4){var u=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":u=c.getElementsByTagName("title")[0],(!u||u[zs]||u[vt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(s),c.head.insertBefore(u,c.querySelector("head > title"))),St(u,s,n),u[vt]=e,ht(u),s=u;break e;case"link":var p=Lg("link","href",c).get(s+(n.href||""));if(p){for(var x=0;x<p.length;x++)if(u=p[x],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(x,1);break t}}u=c.createElement(s),St(u,s,n),c.head.appendChild(u);break;case"meta":if(p=Lg("meta","content",c).get(s+(n.content||""))){for(x=0;x<p.length;x++)if(u=p[x],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(x,1);break t}}u=c.createElement(s),St(u,s,n),c.head.appendChild(u);break;default:throw Error(l(468,s))}u[vt]=e,ht(u),s=u}e.stateNode=s}else Kg(c,e.type,e.stateNode);else e.stateNode=Hg(c,s,e.memoizedProps);else u!==s?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,s===null?Kg(c,e.type,e.stateNode):Hg(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&sf(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ht(t,e),Lt(e),s&512&&(ct||n===null||Ma(n,n.return)),n!==null&&s&4&&sf(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ht(t,e),Lt(e),s&512&&(ct||n===null||Ma(n,n.return)),e.flags&32){c=e.stateNode;try{bi(c,"")}catch(se){Ke(e,e.return,se)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,sf(e,c,n!==null?n.memoizedProps:c)),s&1024&&(cf=!0);break;case 6:if(Ht(t,e),Lt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(se){Ke(e,e.return,se)}}break;case 3:if(wc=null,c=Sa,Sa=bc(t.containerInfo),Ht(t,e),Sa=c,Lt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Wi(t.containerInfo)}catch(se){Ke(e,e.return,se)}cf&&(cf=!1,K0(e));break;case 4:s=Sa,Sa=bc(e.stateNode.containerInfo),Ht(t,e),Lt(e),Sa=s;break;case 12:Ht(t,e),Lt(e);break;case 31:Ht(t,e),Lt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ic(e,s)));break;case 13:Ht(t,e),Lt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lc=Yt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ic(e,s)));break;case 22:c=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,z=rn,P=ct;if(rn=z||c,ct=P||k,Ht(t,e),ct=P,rn=z,Lt(e),s&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||k||rn||ct||Kr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(u=k.stateNode,c)p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{x=k.stateNode;var Y=k.memoizedProps.style,M=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;x.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(se){Ke(k,k.return,se)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(se){Ke(k,k.return,se)}}}else if(t.tag===18){if(n===null){k=t;try{var q=k.stateNode;c?Ag(q,!0):Ag(k.stateNode,!1)}catch(se){Ke(k,k.return,se)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,ic(e,n))));break;case 19:Ht(t,e),Lt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ic(e,s)));break;case 30:break;case 21:break;default:Ht(t,e),Lt(e)}}function Lt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(C0(s)){n=s;break}s=s.return}if(n==null)throw Error(l(160));switch(n.tag){case 27:var c=n.stateNode,u=lf(e);rc(e,u,c);break;case 5:var p=n.stateNode;n.flags&32&&(bi(p,""),n.flags&=-33);var x=lf(e);rc(e,x,p);break;case 3:case 4:var k=n.stateNode.containerInfo,z=lf(e);of(e,z,k);break;default:throw Error(l(161))}}catch(P){Ke(e,e.return,P)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function K0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;K0(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ln(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)D0(e,t.alternate,t),t=t.sibling}function Kr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kn(4,t,t.return),Kr(t);break;case 1:Ma(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&A0(t,t.return,n),Kr(t);break;case 27:yl(t.stateNode);case 26:case 5:Ma(t,t.return),Kr(t);break;case 22:t.memoizedState===null&&Kr(t);break;case 30:Kr(t);break;default:Kr(t)}e=e.sibling}}function on(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,c=e,u=t,p=u.flags;switch(u.tag){case 0:case 11:case 15:on(c,u,n),sl(4,u);break;case 1:if(on(c,u,n),s=u,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(z){Ke(s,s.return,z)}if(s=u,c=s.updateQueue,c!==null){var x=s.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)yy(k[c],x)}catch(z){Ke(s,s.return,z)}}n&&p&64&&j0(u),ll(u,u.return);break;case 27:R0(u);case 26:case 5:on(c,u,n),n&&s===null&&p&4&&N0(u),ll(u,u.return);break;case 12:on(c,u,n);break;case 31:on(c,u,n),n&&p&4&&U0(c,u);break;case 13:on(c,u,n),n&&p&4&&H0(c,u);break;case 22:u.memoizedState===null&&on(c,u,n),ll(u,u.return);break;case 30:break;default:on(c,u,n)}t=t.sibling}}function uf(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qs(n))}function df(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qs(e))}function _a(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)q0(e,t,n,s),t=t.sibling}function q0(e,t,n,s){var c=t.flags;switch(t.tag){case 0:case 11:case 15:_a(e,t,n,s),c&2048&&sl(9,t);break;case 1:_a(e,t,n,s);break;case 3:_a(e,t,n,s),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qs(e)));break;case 12:if(c&2048){_a(e,t,n,s),e=t.stateNode;try{var u=t.memoizedProps,p=u.id,x=u.onPostCommit;typeof x=="function"&&x(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){Ke(t,t.return,k)}}else _a(e,t,n,s);break;case 31:_a(e,t,n,s);break;case 13:_a(e,t,n,s);break;case 23:break;case 22:u=t.stateNode,p=t.alternate,t.memoizedState!==null?u._visibility&2?_a(e,t,n,s):ol(e,t):u._visibility&2?_a(e,t,n,s):(u._visibility|=2,Ki(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),c&2048&&uf(p,t);break;case 24:_a(e,t,n,s),c&2048&&df(t.alternate,t);break;default:_a(e,t,n,s)}}function Ki(e,t,n,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,p=t,x=n,k=s,z=p.flags;switch(p.tag){case 0:case 11:case 15:Ki(u,p,x,k,c),sl(8,p);break;case 23:break;case 22:var P=p.stateNode;p.memoizedState!==null?P._visibility&2?Ki(u,p,x,k,c):ol(u,p):(P._visibility|=2,Ki(u,p,x,k,c)),c&&z&2048&&uf(p.alternate,p);break;case 24:Ki(u,p,x,k,c),c&&z&2048&&df(p.alternate,p);break;default:Ki(u,p,x,k,c)}t=t.sibling}}function ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,c=s.flags;switch(s.tag){case 22:ol(n,s),c&2048&&uf(s.alternate,s);break;case 24:ol(n,s),c&2048&&df(s.alternate,s);break;default:ol(n,s)}t=t.sibling}}var cl=8192;function qi(e,t,n){if(e.subtreeFlags&cl)for(e=e.child;e!==null;)B0(e,t,n),e=e.sibling}function B0(e,t,n){switch(e.tag){case 26:qi(e,t,n),e.flags&cl&&e.memoizedState!==null&&k1(n,Sa,e.memoizedState,e.memoizedProps);break;case 5:qi(e,t,n);break;case 3:case 4:var s=Sa;Sa=bc(e.stateNode.containerInfo),qi(e,t,n),Sa=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cl,cl=16777216,qi(e,t,n),cl=s):qi(e,t,n));break;default:qi(e,t,n)}}function G0(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ul(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];mt=s,Z0(s,e)}G0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)P0(e),e=e.sibling}function P0(e){switch(e.tag){case 0:case 11:case 15:ul(e),e.flags&2048&&Kn(9,e,e.return);break;case 3:ul(e);break;case 12:ul(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sc(e)):ul(e);break;default:ul(e)}}function sc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];mt=s,Z0(s,e)}G0(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kn(8,t,t.return),sc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,sc(t));break;default:sc(t)}e=e.sibling}}function Z0(e,t){for(;mt!==null;){var n=mt;switch(n.tag){case 0:case 11:case 15:Kn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Qs(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,mt=s;else e:for(n=e;mt!==null;){s=mt;var c=s.sibling,u=s.return;if(z0(s),s===n){mt=null;break e}if(c!==null){c.return=u,mt=c;break e}mt=u}}}var qS={getCacheForType:function(e){var t=xt(st),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xt(st).controller.signal}},BS=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ze=null,Ee=null,Te=0,Le=0,Ft=null,qn=!1,Bi=!1,ff=!1,cn=0,et=0,Bn=0,qr=0,hf=0,$t=0,Gi=0,dl=null,Kt=null,mf=!1,lc=0,Y0=0,oc=1/0,cc=null,Gn=null,dt=0,Pn=null,Pi=null,un=0,pf=0,yf=null,V0=null,fl=0,gf=null;function ea(){return(ze&2)!==0&&Te!==0?Te&-Te:B.T!==null?_f():op()}function Q0(){if($t===0)if((Te&536870912)===0||Ae){var e=go;go<<=1,(go&3932160)===0&&(go=262144),$t=e}else $t=536870912;return e=Wt.current,e!==null&&(e.flags|=32),$t}function qt(e,t,n){(e===Ze&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(Zi(e,0),Zn(e,Te,$t,!1)),Ds(e,n),((ze&2)===0||e!==Ze)&&(e===Ze&&((ze&2)===0&&(qr|=n),et===4&&Zn(e,Te,$t,!1)),Ua(e))}function J0(e,t,n){if((ze&6)!==0)throw Error(l(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Os(e,t),c=s?ZS(e,t):bf(e,t,!0),u=s;do{if(c===0){Bi&&!s&&Zn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!GS(n)){c=bf(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var x=e;c=dl;var k=x.current.memoizedState.isDehydrated;if(k&&(Zi(x,p).flags|=256),p=bf(x,p,!1),p!==2){if(ff&&!k){x.errorRecoveryDisabledLanes|=u,qr|=u,c=4;break e}u=Kt,Kt=c,u!==null&&(Kt===null?Kt=u:Kt.push.apply(Kt,u))}c=p}if(u=!1,c!==2)continue}}if(c===1){Zi(e,0),Zn(e,t,0,!0);break}e:{switch(s=e,u=c,u){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Zn(s,t,$t,!qn);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(c=lc+300-Yt(),10<c)){if(Zn(s,t,$t,!qn),bo(s,0,!0)!==0)break e;un=t,s.timeoutHandle=kg(X0.bind(null,s,n,Kt,cc,mf,t,$t,qr,Gi,qn,u,"Throttled",-0,0),c);break e}X0(s,n,Kt,cc,mf,t,$t,qr,Gi,qn,u,null,-0,0)}}break}while(!0);Ua(e)}function X0(e,t,n,s,c,u,p,x,k,z,P,Y,M,q){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ja},B0(t,u,Y);var se=(u&62914560)===u?lc-Yt():(u&4194048)===u?Y0-Yt():0;if(se=T1(Y,se),se!==null){un=u,e.cancelPendingCommit=se(ng.bind(null,e,t,u,n,s,c,p,x,k,P,Y,null,M,q)),Zn(e,u,p,!z);return}}ng(e,t,u,n,s,c,p,x,k)}function GS(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var c=n[s],u=c.getSnapshot;c=c.value;try{if(!Jt(u(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Zn(e,t,n,s){t&=~hf,t&=~qr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var u=31-Qt(c),p=1<<u;s[u]=-1,c&=~p}n!==0&&ip(e,n,t)}function uc(){return(ze&6)===0?(hl(0),!1):!0}function vf(){if(Ee!==null){if(Le===0)var e=Ee.return;else e=Ee,Fa=Rr=null,Dd(e),zi=null,Xs=0,e=Ee;for(;e!==null;)T0(e.alternate,e),e=e.return;Ee=null}}function Zi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,o1(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),un=0,vf(),Ze=e,Ee=n=Wa(e.current,null),Te=t,Le=0,Ft=null,qn=!1,Bi=Os(e,t),ff=!1,Gi=$t=hf=qr=Bn=et=0,Kt=dl=null,mf=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var c=31-Qt(s),u=1<<c;t|=e[c],s&=~u}return cn=t,Ro(),n}function W0(e,t){be=null,B.H=nl,t===Di||t===Ko?(t=fy(),Le=3):t===wd?(t=fy(),Le=4):Le=t===Xd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,Ee===null&&(et=1,$o(e,oa(t,e.current)))}function I0(){var e=Wt.current;return e===null?!0:(Te&4194048)===Te?fa===null:(Te&62914560)===Te||(Te&536870912)!==0?e===fa:!1}function F0(){var e=B.H;return B.H=nl,e===null?nl:e}function $0(){var e=B.A;return B.A=qS,e}function dc(){et=4,qn||(Te&4194048)!==Te&&Wt.current!==null||(Bi=!0),(Bn&134217727)===0&&(qr&134217727)===0||Ze===null||Zn(Ze,Te,$t,!1)}function bf(e,t,n){var s=ze;ze|=2;var c=F0(),u=$0();(Ze!==e||Te!==t)&&(cc=null,Zi(e,t)),t=!1;var p=et;e:do try{if(Le!==0&&Ee!==null){var x=Ee,k=Ft;switch(Le){case 8:vf(),p=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(t=!0);var z=Le;if(Le=0,Ft=null,Yi(e,x,k,z),n&&Bi){p=0;break e}break;default:z=Le,Le=0,Ft=null,Yi(e,x,k,z)}}PS(),p=et;break}catch(P){W0(e,P)}while(!0);return t&&e.shellSuspendCounter++,Fa=Rr=null,ze=s,B.H=c,B.A=u,Ee===null&&(Ze=null,Te=0,Ro()),p}function PS(){for(;Ee!==null;)eg(Ee)}function ZS(e,t){var n=ze;ze|=2;var s=F0(),c=$0();Ze!==e||Te!==t?(cc=null,oc=Yt()+500,Zi(e,t)):Bi=Os(e,t);e:do try{if(Le!==0&&Ee!==null){t=Ee;var u=Ft;t:switch(Le){case 1:Le=0,Ft=null,Yi(e,t,u,1);break;case 2:case 9:if(uy(u)){Le=0,Ft=null,tg(t);break}t=function(){Le!==2&&Le!==9||Ze!==e||(Le=7),Ua(e)},u.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:uy(u)?(Le=0,Ft=null,tg(t)):(Le=0,Ft=null,Yi(e,t,u,7));break;case 5:var p=null;switch(Ee.tag){case 26:p=Ee.memoizedState;case 5:case 27:var x=Ee;if(p?qg(p):x.stateNode.complete){Le=0,Ft=null;var k=x.sibling;if(k!==null)Ee=k;else{var z=x.return;z!==null?(Ee=z,fc(z)):Ee=null}break t}}Le=0,Ft=null,Yi(e,t,u,5);break;case 6:Le=0,Ft=null,Yi(e,t,u,6);break;case 8:vf(),et=6;break e;default:throw Error(l(462))}}YS();break}catch(P){W0(e,P)}while(!0);return Fa=Rr=null,B.H=s,B.A=c,ze=n,Ee!==null?0:(Ze=null,Te=0,Ro(),et)}function YS(){for(;Ee!==null&&!mw();)eg(Ee)}function eg(e){var t=E0(e.alternate,e,cn);e.memoizedProps=e.pendingProps,t===null?fc(e):Ee=t}function tg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=v0(n,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=v0(n,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:Dd(t);default:T0(n,t),t=Ee=$p(t,cn),t=E0(n,t,cn)}e.memoizedProps=e.pendingProps,t===null?fc(e):Ee=t}function Yi(e,t,n,s){Fa=Rr=null,Dd(t),zi=null,Xs=0;var c=t.return;try{if(DS(e,c,t,n,Te)){et=1,$o(e,oa(n,e.current)),Ee=null;return}}catch(u){if(c!==null)throw Ee=c,u;et=1,$o(e,oa(n,e.current)),Ee=null;return}t.flags&32768?(Ae||s===1?e=!0:Bi||(Te&536870912)!==0?e=!1:(qn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Wt.current,s!==null&&s.tag===13&&(s.flags|=16384))),ag(t,e)):fc(t)}function fc(e){var t=e;do{if((t.flags&32768)!==0){ag(t,qn);return}e=t.return;var n=US(t.alternate,t,cn);if(n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);et===0&&(et=5)}function ag(e,t){do{var n=HS(e.alternate,e);if(n!==null){n.flags&=32767,Ee=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=n}while(e!==null);et=6,Ee=null}function ng(e,t,n,s,c,u,p,x,k){e.cancelPendingCommit=null;do hc();while(dt!==0);if((ze&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(u=t.lanes|t.childLanes,u|=sd,Ew(e,n,u,p,x,k),e===Ze&&(Ee=Ze=null,Te=0),Pi=t,Pn=e,un=n,pf=u,yf=c,V0=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,XS(po,function(){return og(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=B.T,B.T=null,c=V.p,V.p=2,p=ze,ze|=4;try{LS(e,t,n)}finally{ze=p,V.p=c,B.T=s}}dt=1,rg(),ig(),sg()}}function rg(){if(dt===1){dt=0;var e=Pn,t=Pi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=B.T,B.T=null;var s=V.p;V.p=2;var c=ze;ze|=4;try{L0(t,e);var u=Rf,p=Zp(e.containerInfo),x=u.focusedElem,k=u.selectionRange;if(p!==x&&x&&x.ownerDocument&&Pp(x.ownerDocument.documentElement,x)){if(k!==null&&td(x)){var z=k.start,P=k.end;if(P===void 0&&(P=z),"selectionStart"in x)x.selectionStart=z,x.selectionEnd=Math.min(P,x.value.length);else{var Y=x.ownerDocument||document,M=Y&&Y.defaultView||window;if(M.getSelection){var q=M.getSelection(),se=x.textContent.length,me=Math.min(k.start,se),Pe=k.end===void 0?me:Math.min(k.end,se);!q.extend&&me>Pe&&(p=Pe,Pe=me,me=p);var O=Gp(x,me),R=Gp(x,Pe);if(O&&R&&(q.rangeCount!==1||q.anchorNode!==O.node||q.anchorOffset!==O.offset||q.focusNode!==R.node||q.focusOffset!==R.offset)){var D=Y.createRange();D.setStart(O.node,O.offset),q.removeAllRanges(),me>Pe?(q.addRange(D),q.extend(R.node,R.offset)):(D.setEnd(R.node,R.offset),q.addRange(D))}}}}for(Y=[],q=x;q=q.parentNode;)q.nodeType===1&&Y.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Y.length;x++){var Z=Y[x];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}kc=!!Cf,Rf=Cf=null}finally{ze=c,V.p=s,B.T=n}}e.current=t,dt=2}}function ig(){if(dt===2){dt=0;var e=Pn,t=Pi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=B.T,B.T=null;var s=V.p;V.p=2;var c=ze;ze|=4;try{D0(e,t.alternate,t)}finally{ze=c,V.p=s,B.T=n}}dt=3}}function sg(){if(dt===4||dt===3){dt=0,pw();var e=Pn,t=Pi,n=un,s=V0;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Pi=Pn=null,lg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Gn=null),Uu(n),t=t.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Rs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=B.T,c=V.p,V.p=2,B.T=null;try{for(var u=e.onRecoverableError,p=0;p<s.length;p++){var x=s[p];u(x.value,{componentStack:x.stack})}}finally{B.T=t,V.p=c}}(un&3)!==0&&hc(),Ua(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===gf?fl++:(fl=0,gf=e):fl=0,hl(0)}}function lg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qs(t)))}function hc(){return rg(),ig(),sg(),og()}function og(){if(dt!==5)return!1;var e=Pn,t=pf;pf=0;var n=Uu(un),s=B.T,c=V.p;try{V.p=32>n?32:n,B.T=null,n=yf,yf=null;var u=Pn,p=un;if(dt=0,Pi=Pn=null,un=0,(ze&6)!==0)throw Error(l(331));var x=ze;if(ze|=4,P0(u.current),q0(u,u.current,p,n),ze=x,hl(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Rs,u)}catch{}return!0}finally{V.p=c,B.T=s,lg(e,t)}}function cg(e,t,n){t=oa(n,t),t=Jd(e.stateNode,t,2),e=Un(e,t,2),e!==null&&(Ds(e,2),Ua(e))}function Ke(e,t,n){if(e.tag===3)cg(e,e,n);else for(;t!==null;){if(t.tag===3){cg(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Gn===null||!Gn.has(s))){e=oa(n,e),n=u0(2),s=Un(t,n,2),s!==null&&(d0(n,s,t,e),Ds(s,2),Ua(s));break}}t=t.return}}function xf(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new BS;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(n)||(ff=!0,c.add(n),e=VS.bind(null,e,t,n),t.then(e,e))}function VS(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ze===e&&(Te&n)===n&&(et===4||et===3&&(Te&62914560)===Te&&300>Yt()-lc?(ze&2)===0&&Zi(e,0):hf|=n,Gi===Te&&(Gi=0)),Ua(e)}function ug(e,t){t===0&&(t=rp()),e=Ar(e,t),e!==null&&(Ds(e,t),Ua(e))}function QS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ug(e,n)}function JS(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),ug(e,n)}function XS(e,t){return Ou(e,t)}var mc=null,Vi=null,wf=!1,pc=!1,Sf=!1,Yn=0;function Ua(e){e!==Vi&&e.next===null&&(Vi===null?mc=Vi=e:Vi=Vi.next=e),pc=!0,wf||(wf=!0,IS())}function hl(e,t){if(!Sf&&pc){Sf=!0;do for(var n=!1,s=mc;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var u=0;else{var p=s.suspendedLanes,x=s.pingedLanes;u=(1<<31-Qt(42|e)+1)-1,u&=c&~(p&~x),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,mg(s,u))}else u=Te,u=bo(s,s===Ze?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(u&3)===0||Os(s,u)||(n=!0,mg(s,u));s=s.next}while(n);Sf=!1}}function WS(){dg()}function dg(){pc=wf=!1;var e=0;Yn!==0&&l1()&&(e=Yn);for(var t=Yt(),n=null,s=mc;s!==null;){var c=s.next,u=fg(s,t);u===0?(s.next=null,n===null?mc=c:n.next=c,c===null&&(Vi=n)):(n=s,(e!==0||(u&3)!==0)&&(pc=!0)),s=c}dt!==0&&dt!==5||hl(e),Yn!==0&&(Yn=0)}function fg(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var p=31-Qt(u),x=1<<p,k=c[p];k===-1?((x&n)===0||(x&s)!==0)&&(c[p]=_w(x,t)):k<=t&&(e.expiredLanes|=x),u&=~x}if(t=Ze,n=Te,n=bo(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Du(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Os(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Du(s),Uu(n)){case 2:case 8:n=ap;break;case 32:n=po;break;case 268435456:n=np;break;default:n=po}return s=hg.bind(null,e),n=Ou(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Du(s),e.callbackPriority=2,e.callbackNode=null,2}function hg(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hc()&&e.callbackNode!==n)return null;var s=Te;return s=bo(e,e===Ze?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(J0(e,s,t),fg(e,Yt()),e.callbackNode!=null&&e.callbackNode===n?hg.bind(null,e):null)}function mg(e,t){if(hc())return null;J0(e,t,!0)}function IS(){c1(function(){(ze&6)!==0?Ou(tp,WS):dg()})}function _f(){if(Yn===0){var e=Ri;e===0&&(e=yo,yo<<=1,(yo&261888)===0&&(yo=256)),Yn=e}return Yn}function pg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_o(""+e)}function yg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function FS(e,t,n,s,c){if(t==="submit"&&n&&n.stateNode===c){var u=pg((c[zt]||null).action),p=s.submitter;p&&(t=(t=p[zt]||null)?pg(t.formAction):p.getAttribute("formAction"),t!==null&&(u=t,p=null));var x=new jo("action","action",null,s,c);e.push({event:x,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Yn!==0){var k=p?yg(c,p):new FormData(c);Gd(n,{pending:!0,data:k,method:c.method,action:u},null,k)}}else typeof u=="function"&&(x.preventDefault(),k=p?yg(c,p):new FormData(c),Gd(n,{pending:!0,data:k,method:c.method,action:u},u,k))},currentTarget:c}]})}}for(var Ef=0;Ef<id.length;Ef++){var kf=id[Ef],$S=kf.toLowerCase(),e1=kf[0].toUpperCase()+kf.slice(1);wa($S,"on"+e1)}wa(Qp,"onAnimationEnd"),wa(Jp,"onAnimationIteration"),wa(Xp,"onAnimationStart"),wa("dblclick","onDoubleClick"),wa("focusin","onFocus"),wa("focusout","onBlur"),wa(yS,"onTransitionRun"),wa(gS,"onTransitionStart"),wa(vS,"onTransitionCancel"),wa(Wp,"onTransitionEnd"),gi("onMouseEnter",["mouseout","mouseover"]),gi("onMouseLeave",["mouseout","mouseover"]),gi("onPointerEnter",["pointerout","pointerover"]),gi("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="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(" "),t1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ml));function gg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],c=s.event;s=s.listeners;e:{var u=void 0;if(t)for(var p=s.length-1;0<=p;p--){var x=s[p],k=x.instance,z=x.currentTarget;if(x=x.listener,k!==u&&c.isPropagationStopped())break e;u=x,c.currentTarget=z;try{u(c)}catch(P){Co(P)}c.currentTarget=null,u=k}else for(p=0;p<s.length;p++){if(x=s[p],k=x.instance,z=x.currentTarget,x=x.listener,k!==u&&c.isPropagationStopped())break e;u=x,c.currentTarget=z;try{u(c)}catch(P){Co(P)}c.currentTarget=null,u=k}}}}function ke(e,t){var n=t[Hu];n===void 0&&(n=t[Hu]=new Set);var s=e+"__bubble";n.has(s)||(vg(t,e,2,!1),n.add(s))}function Tf(e,t,n){var s=0;t&&(s|=4),vg(n,e,s,t)}var yc="_reactListening"+Math.random().toString(36).slice(2);function jf(e){if(!e[yc]){e[yc]=!0,dp.forEach(function(n){n!=="selectionchange"&&(t1.has(n)||Tf(n,!1,e),Tf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yc]||(t[yc]=!0,Tf("selectionchange",!1,t))}}function vg(e,t,n,s){switch(Qg(t)){case 2:var c=N1;break;case 8:c=C1;break;default:c=Gf}n=c.bind(null,t,n,e),c=void 0,!Vu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Af(e,t,n,s,c){var u=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var p=s.tag;if(p===3||p===4){var x=s.stateNode.containerInfo;if(x===c)break;if(p===4)for(p=s.return;p!==null;){var k=p.tag;if((k===3||k===4)&&p.stateNode.containerInfo===c)return;p=p.return}for(;x!==null;){if(p=mi(x),p===null)return;if(k=p.tag,k===5||k===6||k===26||k===27){s=u=p;continue e}x=x.parentNode}}s=s.return}_p(function(){var z=u,P=Zu(n),Y=[];e:{var M=Ip.get(e);if(M!==void 0){var q=jo,se=e;switch(e){case"keypress":if(ko(n)===0)break e;case"keydown":case"keyup":q=Jw;break;case"focusin":se="focus",q=Wu;break;case"focusout":se="blur",q=Wu;break;case"beforeblur":case"afterblur":q=Wu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Uw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Iw;break;case Qp:case Jp:case Xp:q=Kw;break;case Wp:q=$w;break;case"scroll":case"scrollend":q=zw;break;case"wheel":q=tS;break;case"copy":case"cut":case"paste":q=Bw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Ap;break;case"toggle":case"beforetoggle":q=nS}var me=(t&4)!==0,Pe=!me&&(e==="scroll"||e==="scrollend"),O=me?M!==null?M+"Capture":null:M;me=[];for(var R=z,D;R!==null;){var Z=R;if(D=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||D===null||O===null||(Z=Us(R,O),Z!=null&&me.push(pl(R,Z,D))),Pe)break;R=R.return}0<me.length&&(M=new q(M,se,null,n,P),Y.push({event:M,listeners:me}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",M&&n!==Pu&&(se=n.relatedTarget||n.fromElement)&&(mi(se)||se[hi]))break e;if((q||M)&&(M=P.window===P?P:(M=P.ownerDocument)?M.defaultView||M.parentWindow:window,q?(se=n.relatedTarget||n.toElement,q=z,se=se?mi(se):null,se!==null&&(Pe=d(se),me=se.tag,se!==Pe||me!==5&&me!==27&&me!==6)&&(se=null)):(q=null,se=z),q!==se)){if(me=Tp,Z="onMouseLeave",O="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(me=Ap,Z="onPointerLeave",O="onPointerEnter",R="pointer"),Pe=q==null?M:Ms(q),D=se==null?M:Ms(se),M=new me(Z,R+"leave",q,n,P),M.target=Pe,M.relatedTarget=D,Z=null,mi(P)===z&&(me=new me(O,R+"enter",se,n,P),me.target=D,me.relatedTarget=Pe,Z=me),Pe=Z,q&&se)t:{for(me=a1,O=q,R=se,D=0,Z=O;Z;Z=me(Z))D++;Z=0;for(var ue=R;ue;ue=me(ue))Z++;for(;0<D-Z;)O=me(O),D--;for(;0<Z-D;)R=me(R),Z--;for(;D--;){if(O===R||R!==null&&O===R.alternate){me=O;break t}O=me(O),R=me(R)}me=null}else me=null;q!==null&&bg(Y,M,q,me,!1),se!==null&&Pe!==null&&bg(Y,Pe,se,me,!0)}}e:{if(M=z?Ms(z):window,q=M.nodeName&&M.nodeName.toLowerCase(),q==="select"||q==="input"&&M.type==="file")var Oe=Up;else if(zp(M))if(Hp)Oe=hS;else{Oe=dS;var le=uS}else q=M.nodeName,!q||q.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?z&&Gu(z.elementType)&&(Oe=Up):Oe=fS;if(Oe&&(Oe=Oe(e,z))){Mp(Y,Oe,n,P);break e}le&&le(e,M,z),e==="focusout"&&z&&M.type==="number"&&z.memoizedProps.value!=null&&Bu(M,"number",M.value)}switch(le=z?Ms(z):window,e){case"focusin":(zp(le)||le.contentEditable==="true")&&(_i=le,ad=z,Zs=null);break;case"focusout":Zs=ad=_i=null;break;case"mousedown":nd=!0;break;case"contextmenu":case"mouseup":case"dragend":nd=!1,Yp(Y,n,P);break;case"selectionchange":if(pS)break;case"keydown":case"keyup":Yp(Y,n,P)}var we;if(Fu)e:{switch(e){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else Si?Op(e,n)&&(je="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(je="onCompositionStart");je&&(Np&&n.locale!=="ko"&&(Si||je!=="onCompositionStart"?je==="onCompositionEnd"&&Si&&(we=Ep()):(Nn=P,Qu="value"in Nn?Nn.value:Nn.textContent,Si=!0)),le=gc(z,je),0<le.length&&(je=new jp(je,e,null,n,P),Y.push({event:je,listeners:le}),we?je.data=we:(we=Dp(n),we!==null&&(je.data=we)))),(we=iS?sS(e,n):lS(e,n))&&(je=gc(z,"onBeforeInput"),0<je.length&&(le=new jp("onBeforeInput","beforeinput",null,n,P),Y.push({event:le,listeners:je}),le.data=we)),FS(Y,e,z,n,P)}gg(Y,t)})}function pl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gc(e,t){for(var n=t+"Capture",s=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=Us(e,n),c!=null&&s.unshift(pl(e,c,u)),c=Us(e,t),c!=null&&s.push(pl(e,c,u))),e.tag===3)return s;e=e.return}return[]}function a1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function bg(e,t,n,s,c){for(var u=t._reactName,p=[];n!==null&&n!==s;){var x=n,k=x.alternate,z=x.stateNode;if(x=x.tag,k!==null&&k===s)break;x!==5&&x!==26&&x!==27||z===null||(k=z,c?(z=Us(n,u),z!=null&&p.unshift(pl(n,z,k))):c||(z=Us(n,u),z!=null&&p.push(pl(n,z,k)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var n1=/\r\n?/g,r1=/\u0000|\uFFFD/g;function xg(e){return(typeof e=="string"?e:""+e).replace(n1,`
49
+ `).replace(r1,"")}function wg(e,t){return t=xg(t),xg(e)===t}function Ge(e,t,n,s,c,u){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||bi(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&bi(e,""+s);break;case"className":wo(e,"class",s);break;case"tabIndex":wo(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wo(e,n,s);break;case"style":wp(e,s,u);break;case"data":if(t!=="object"){wo(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=_o(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Ge(e,t,"name",c.name,c,null),Ge(e,t,"formEncType",c.formEncType,c,null),Ge(e,t,"formMethod",c.formMethod,c,null),Ge(e,t,"formTarget",c.formTarget,c,null)):(Ge(e,t,"encType",c.encType,c,null),Ge(e,t,"method",c.method,c,null),Ge(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=_o(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Ja);break;case"onScroll":s!=null&&ke("scroll",e);break;case"onScrollEnd":s!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(n=s.__html,n!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=_o(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":ke("beforetoggle",e),ke("toggle",e),xo(e,"popover",s);break;case"xlinkActuate":Qa(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Qa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Qa(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Qa(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Qa(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Qa(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Qa(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Qa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Qa(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":xo(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Ow.get(n)||n,xo(e,n,s))}}function Nf(e,t,n,s,c,u){switch(n){case"style":wp(e,s,u);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(n=s.__html,n!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=n}}break;case"children":typeof s=="string"?bi(e,s):(typeof s=="number"||typeof s=="bigint")&&bi(e,""+s);break;case"onScroll":s!=null&&ke("scroll",e);break;case"onScrollEnd":s!=null&&ke("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Ja);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fp.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),u=e[zt]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof s=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,c);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):xo(e,n,s)}}}function St(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var s=!1,c=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ge(e,t,u,p,n,null)}}c&&Ge(e,t,"srcSet",n.srcSet,n,null),s&&Ge(e,t,"src",n.src,n,null);return;case"input":ke("invalid",e);var x=u=p=c=null,k=null,z=null;for(s in n)if(n.hasOwnProperty(s)){var P=n[s];if(P!=null)switch(s){case"name":c=P;break;case"type":p=P;break;case"checked":k=P;break;case"defaultChecked":z=P;break;case"value":u=P;break;case"defaultValue":x=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:Ge(e,t,s,P,n,null)}}gp(e,u,x,k,z,p,c,!1);return;case"select":ke("invalid",e),s=p=u=null;for(c in n)if(n.hasOwnProperty(c)&&(x=n[c],x!=null))switch(c){case"value":u=x;break;case"defaultValue":p=x;break;case"multiple":s=x;default:Ge(e,t,c,x,n,null)}t=u,n=p,e.multiple=!!s,t!=null?vi(e,!!s,t,!1):n!=null&&vi(e,!!s,n,!0);return;case"textarea":ke("invalid",e),u=c=s=null;for(p in n)if(n.hasOwnProperty(p)&&(x=n[p],x!=null))switch(p){case"value":s=x;break;case"defaultValue":c=x;break;case"children":u=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(l(91));break;default:Ge(e,t,p,x,n,null)}bp(e,s,c,u);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(s=n[k],s!=null))switch(k){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ge(e,t,k,s,n,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(s=0;s<ml.length;s++)ke(ml[s],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in n)if(n.hasOwnProperty(z)&&(s=n[z],s!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ge(e,t,z,s,n,null)}return;default:if(Gu(t)){for(P in n)n.hasOwnProperty(P)&&(s=n[P],s!==void 0&&Nf(e,t,P,s,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(s=n[x],s!=null&&Ge(e,t,x,s,n,null))}function i1(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,p=null,x=null,k=null,z=null,P=null;for(q in n){var Y=n[q];if(n.hasOwnProperty(q)&&Y!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":k=Y;default:s.hasOwnProperty(q)||Ge(e,t,q,null,s,Y)}}for(var M in s){var q=s[M];if(Y=n[M],s.hasOwnProperty(M)&&(q!=null||Y!=null))switch(M){case"type":u=q;break;case"name":c=q;break;case"checked":z=q;break;case"defaultChecked":P=q;break;case"value":p=q;break;case"defaultValue":x=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:q!==Y&&Ge(e,t,M,q,s,Y)}}qu(e,p,x,k,z,P,u,c);return;case"select":q=p=x=M=null;for(u in n)if(k=n[u],n.hasOwnProperty(u)&&k!=null)switch(u){case"value":break;case"multiple":q=k;default:s.hasOwnProperty(u)||Ge(e,t,u,null,s,k)}for(c in s)if(u=s[c],k=n[c],s.hasOwnProperty(c)&&(u!=null||k!=null))switch(c){case"value":M=u;break;case"defaultValue":x=u;break;case"multiple":p=u;default:u!==k&&Ge(e,t,c,u,s,k)}t=x,n=p,s=q,M!=null?vi(e,!!n,M,!1):!!s!=!!n&&(t!=null?vi(e,!!n,t,!0):vi(e,!!n,n?[]:"",!1));return;case"textarea":q=M=null;for(x in n)if(c=n[x],n.hasOwnProperty(x)&&c!=null&&!s.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Ge(e,t,x,null,s,c)}for(p in s)if(c=s[p],u=n[p],s.hasOwnProperty(p)&&(c!=null||u!=null))switch(p){case"value":M=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&Ge(e,t,p,c,s,u)}vp(e,M,q);return;case"option":for(var se in n)if(M=n[se],n.hasOwnProperty(se)&&M!=null&&!s.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:Ge(e,t,se,null,s,M)}for(k in s)if(M=s[k],q=n[k],s.hasOwnProperty(k)&&M!==q&&(M!=null||q!=null))switch(k){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ge(e,t,k,M,s,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var me in n)M=n[me],n.hasOwnProperty(me)&&M!=null&&!s.hasOwnProperty(me)&&Ge(e,t,me,null,s,M);for(z in s)if(M=s[z],q=n[z],s.hasOwnProperty(z)&&M!==q&&(M!=null||q!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:Ge(e,t,z,M,s,q)}return;default:if(Gu(t)){for(var Pe in n)M=n[Pe],n.hasOwnProperty(Pe)&&M!==void 0&&!s.hasOwnProperty(Pe)&&Nf(e,t,Pe,void 0,s,M);for(P in s)M=s[P],q=n[P],!s.hasOwnProperty(P)||M===q||M===void 0&&q===void 0||Nf(e,t,P,M,s,q);return}}for(var O in n)M=n[O],n.hasOwnProperty(O)&&M!=null&&!s.hasOwnProperty(O)&&Ge(e,t,O,null,s,M);for(Y in s)M=s[Y],q=n[Y],!s.hasOwnProperty(Y)||M===q||M==null&&q==null||Ge(e,t,Y,M,s,q)}function Sg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var c=n[s],u=c.transferSize,p=c.initiatorType,x=c.duration;if(u&&x&&Sg(p)){for(p=0,x=c.responseEnd,s+=1;s<n.length;s++){var k=n[s],z=k.startTime;if(z>x)break;var P=k.transferSize,Y=k.initiatorType;P&&Sg(Y)&&(k=k.responseEnd,p+=P*(k<x?1:(x-z)/(k-z)))}if(--s,t+=8*(u+p)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Cf=null,Rf=null;function vc(e){return e.nodeType===9?e:e.ownerDocument}function _g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Eg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Of(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Df=null;function l1(){var e=window.event;return e&&e.type==="popstate"?e===Df?!1:(Df=e,!0):(Df=null,!1)}var kg=typeof setTimeout=="function"?setTimeout:void 0,o1=typeof clearTimeout=="function"?clearTimeout:void 0,Tg=typeof Promise=="function"?Promise:void 0,c1=typeof queueMicrotask=="function"?queueMicrotask:typeof Tg<"u"?function(e){return Tg.resolve(null).then(e).catch(u1)}:kg;function u1(e){setTimeout(function(){throw e})}function Vn(e){return e==="head"}function jg(e,t){var n=t,s=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(c),Wi(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")yl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,yl(n);for(var u=n.firstChild;u;){var p=u.nextSibling,x=u.nodeName;u[zs]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&yl(e.ownerDocument.body);n=c}while(n);Wi(t)}function Ag(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function zf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":zf(n),Lu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function d1(e,t,n,s){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[zs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=ha(e.nextSibling),e===null)break}return null}function f1(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ha(e.nextSibling),e===null))return null;return e}function Ng(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ha(e.nextSibling),e===null))return null;return e}function Mf(e){return e.data==="$?"||e.data==="$~"}function Uf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function h1(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function ha(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hf=null;function Cg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ha(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Rg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Og(e,t,n){switch(t=vc(n),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function yl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Lu(e)}var ma=new Map,Dg=new Set;function bc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dn=V.d;V.d={f:m1,r:p1,D:y1,C:g1,L:v1,m:b1,X:w1,S:x1,M:S1};function m1(){var e=dn.f(),t=uc();return e||t}function p1(e){var t=pi(e);t!==null&&t.tag===5&&t.type==="form"?Wy(t):dn.r(e)}var Qi=typeof document>"u"?null:document;function zg(e,t,n){var s=Qi;if(s&&typeof t=="string"&&t){var c=sa(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Dg.has(c)||(Dg.add(c),e={rel:e,crossOrigin:n,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),St(t,"link",e),ht(t),s.head.appendChild(t)))}}function y1(e){dn.D(e),zg("dns-prefetch",e,null)}function g1(e,t){dn.C(e,t),zg("preconnect",e,t)}function v1(e,t,n){dn.L(e,t,n);var s=Qi;if(s&&e&&t){var c='link[rel="preload"][as="'+sa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+sa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+sa(n.imageSizes)+'"]')):c+='[href="'+sa(e)+'"]';var u=c;switch(t){case"style":u=Ji(e);break;case"script":u=Xi(e)}ma.has(u)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ma.set(u,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(gl(u))||t==="script"&&s.querySelector(vl(u))||(t=s.createElement("link"),St(t,"link",e),ht(t),s.head.appendChild(t)))}}function b1(e,t){dn.m(e,t);var n=Qi;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+sa(s)+'"][href="'+sa(e)+'"]',u=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Xi(e)}if(!ma.has(u)&&(e=b({rel:"modulepreload",href:e},t),ma.set(u,e),n.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(vl(u)))return}s=n.createElement("link"),St(s,"link",e),ht(s),n.head.appendChild(s)}}}function x1(e,t,n){dn.S(e,t,n);var s=Qi;if(s&&e){var c=yi(s).hoistableStyles,u=Ji(e);t=t||"default";var p=c.get(u);if(!p){var x={loading:0,preload:null};if(p=s.querySelector(gl(u)))x.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ma.get(u))&&Lf(e,n);var k=p=s.createElement("link");ht(k),St(k,"link",e),k._p=new Promise(function(z,P){k.onload=z,k.onerror=P}),k.addEventListener("load",function(){x.loading|=1}),k.addEventListener("error",function(){x.loading|=2}),x.loading|=4,xc(p,t,s)}p={type:"stylesheet",instance:p,count:1,state:x},c.set(u,p)}}}function w1(e,t){dn.X(e,t);var n=Qi;if(n&&e){var s=yi(n).hoistableScripts,c=Xi(e),u=s.get(c);u||(u=n.querySelector(vl(c)),u||(e=b({src:e,async:!0},t),(t=ma.get(c))&&Kf(e,t),u=n.createElement("script"),ht(u),St(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function S1(e,t){dn.M(e,t);var n=Qi;if(n&&e){var s=yi(n).hoistableScripts,c=Xi(e),u=s.get(c);u||(u=n.querySelector(vl(c)),u||(e=b({src:e,async:!0,type:"module"},t),(t=ma.get(c))&&Kf(e,t),u=n.createElement("script"),ht(u),St(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function Mg(e,t,n,s){var c=(c=_e.current)?bc(c):null;if(!c)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ji(n.href),n=yi(c).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ji(n.href);var u=yi(c).hoistableStyles,p=u.get(e);if(p||(c=c.ownerDocument||c,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=c.querySelector(gl(e)))&&!u._p&&(p.instance=u,p.state.loading=5),ma.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ma.set(e,n),u||_1(c,e,n,p.state))),t&&s===null)throw Error(l(528,""));return p}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xi(n),n=yi(c).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ji(e){return'href="'+sa(e)+'"'}function gl(e){return'link[rel="stylesheet"]['+e+"]"}function Ug(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function _1(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),St(t,"link",n),ht(t),e.head.appendChild(t))}function Xi(e){return'[src="'+sa(e)+'"]'}function vl(e){return"script[async]"+e}function Hg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+sa(n.href)+'"]');if(s)return t.instance=s,ht(s),s;var c=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ht(s),St(s,"style",c),xc(s,n.precedence,e),t.instance=s;case"stylesheet":c=Ji(n.href);var u=e.querySelector(gl(c));if(u)return t.state.loading|=4,t.instance=u,ht(u),u;s=Ug(n),(c=ma.get(c))&&Lf(s,c),u=(e.ownerDocument||e).createElement("link"),ht(u);var p=u;return p._p=new Promise(function(x,k){p.onload=x,p.onerror=k}),St(u,"link",s),t.state.loading|=4,xc(u,n.precedence,e),t.instance=u;case"script":return u=Xi(n.src),(c=e.querySelector(vl(u)))?(t.instance=c,ht(c),c):(s=n,(c=ma.get(u))&&(s=b({},n),Kf(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),ht(c),St(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,xc(s,n.precedence,e));return t.instance}function xc(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,u=c,p=0;p<s.length;p++){var x=s[p];if(x.dataset.precedence===t)u=x;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Lf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Kf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wc=null;function Lg(e,t,n){if(wc===null){var s=new Map,c=wc=new Map;c.set(n,s)}else c=wc,s=c.get(n),s||(s=new Map,c.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var u=n[c];if(!(u[zs]||u[vt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var x=s.get(p);x?x.push(u):s.set(p,[u])}}return s}function Kg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function E1(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function qg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function k1(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=Ji(s.href),u=t.querySelector(gl(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Sc.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,ht(u);return}u=t.ownerDocument||t,s=Ug(s),(c=ma.get(c))&&Lf(s,c),u=u.createElement("link"),ht(u);var p=u;p._p=new Promise(function(x,k){p.onload=x,p.onerror=k}),St(u,"link",s),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Sc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var qf=0;function T1(e,t){return e.stylesheets&&e.count===0&&Ec(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Ec(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*s1());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ec(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Sc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ec(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function Ec(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(j1,e),_c=null,Sc.call(e))}function j1(e,t){if(!(t.state.loading&4)){var n=_c.get(e);if(n)var s=n.get(null);else{n=new Map,_c.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var p=c[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),s=p)}s&&n.set(null,s)}c=t.instance,p=c.getAttribute("data-precedence"),u=n.get(p)||s,u===s&&n.set(null,c),n.set(p,c),this.count++,s=Sc.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var bl={$$typeof:K,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function A1(e,t,n,s,c,u,p,x,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zu(0),this.hiddenUpdates=zu(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function Bg(e,t,n,s,c,u,p,x,k,z,P,Y){return e=new A1(e,t,n,p,k,z,P,Y,x),t=1,u===!0&&(t|=24),u=Xt(3,null,null,t),e.current=u,u.stateNode=e,t=vd(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:s,isDehydrated:n,cache:t},Sd(u),e}function Gg(e){return e?(e=Ti,e):Ti}function Pg(e,t,n,s,c,u){c=Gg(c),s.context===null?s.context=c:s.pendingContext=c,s=Mn(t),s.payload={element:n},u=u===void 0?null:u,u!==null&&(s.callback=u),n=Un(e,s,t),n!==null&&(qt(n,e,t),Is(n,e,t))}function Zg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bf(e,t){Zg(e,t),(e=e.alternate)&&Zg(e,t)}function Yg(e){if(e.tag===13||e.tag===31){var t=Ar(e,67108864);t!==null&&qt(t,e,67108864),Bf(e,67108864)}}function Vg(e){if(e.tag===13||e.tag===31){var t=ea();t=Mu(t);var n=Ar(e,t);n!==null&&qt(n,e,t),Bf(e,t)}}var kc=!0;function N1(e,t,n,s){var c=B.T;B.T=null;var u=V.p;try{V.p=2,Gf(e,t,n,s)}finally{V.p=u,B.T=c}}function C1(e,t,n,s){var c=B.T;B.T=null;var u=V.p;try{V.p=8,Gf(e,t,n,s)}finally{V.p=u,B.T=c}}function Gf(e,t,n,s){if(kc){var c=Pf(s);if(c===null)Af(e,t,s,Tc,n),Jg(e,s);else if(O1(c,e,t,n,s))s.stopPropagation();else if(Jg(e,s),t&4&&-1<R1.indexOf(e)){for(;c!==null;){var u=pi(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=_r(u.pendingLanes);if(p!==0){var x=u;for(x.pendingLanes|=2,x.entangledLanes|=2;p;){var k=1<<31-Qt(p);x.entanglements[1]|=k,p&=~k}Ua(u),(ze&6)===0&&(oc=Yt()+500,hl(0))}}break;case 31:case 13:x=Ar(u,2),x!==null&&qt(x,u,2),uc(),Bf(u,2)}if(u=Pf(s),u===null&&Af(e,t,s,Tc,n),u===c)break;c=u}c!==null&&s.stopPropagation()}else Af(e,t,s,null,n)}}function Pf(e){return e=Zu(e),Zf(e)}var Tc=null;function Zf(e){if(Tc=null,e=mi(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=f(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Tc=e,null}function Qg(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yw()){case tp:return 2;case ap:return 8;case po:case gw:return 32;case np:return 268435456;default:return 32}default:return 32}}var Yf=!1,Qn=null,Jn=null,Xn=null,xl=new Map,wl=new Map,Wn=[],R1="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".split(" ");function Jg(e,t){switch(e){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Jn=null;break;case"mouseover":case"mouseout":Xn=null;break;case"pointerover":case"pointerout":xl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function Sl(e,t,n,s,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:u,targetContainers:[c]},t!==null&&(t=pi(t),t!==null&&Yg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function O1(e,t,n,s,c){switch(t){case"focusin":return Qn=Sl(Qn,e,t,n,s,c),!0;case"dragenter":return Jn=Sl(Jn,e,t,n,s,c),!0;case"mouseover":return Xn=Sl(Xn,e,t,n,s,c),!0;case"pointerover":var u=c.pointerId;return xl.set(u,Sl(xl.get(u)||null,e,t,n,s,c)),!0;case"gotpointercapture":return u=c.pointerId,wl.set(u,Sl(wl.get(u)||null,e,t,n,s,c)),!0}return!1}function Xg(e){var t=mi(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=f(n),t!==null){e.blockedOn=t,cp(e.priority,function(){Vg(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,cp(e.priority,function(){Vg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pf(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Pu=s,n.target.dispatchEvent(s),Pu=null}else return t=pi(n),t!==null&&Yg(t),e.blockedOn=n,!1;t.shift()}return!0}function Wg(e,t,n){jc(e)&&n.delete(t)}function D1(){Yf=!1,Qn!==null&&jc(Qn)&&(Qn=null),Jn!==null&&jc(Jn)&&(Jn=null),Xn!==null&&jc(Xn)&&(Xn=null),xl.forEach(Wg),wl.forEach(Wg)}function Ac(e,t){e.blockedOn===t&&(e.blockedOn=null,Yf||(Yf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,D1)))}var Nc=null;function Ig(e){Nc!==e&&(Nc=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Nc===e&&(Nc=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(Zf(s||n)===null)continue;break}var u=pi(n);u!==null&&(e.splice(t,3),t-=3,Gd(u,{pending:!0,data:c,method:n.method,action:s},s,c))}}))}function Wi(e){function t(k){return Ac(k,e)}Qn!==null&&Ac(Qn,e),Jn!==null&&Ac(Jn,e),Xn!==null&&Ac(Xn,e),xl.forEach(t),wl.forEach(t);for(var n=0;n<Wn.length;n++){var s=Wn[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Wn.length&&(n=Wn[0],n.blockedOn===null);)Xg(n),n.blockedOn===null&&Wn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var c=n[s],u=n[s+1],p=c[zt]||null;if(typeof u=="function")p||Ig(n);else if(p){var x=null;if(u&&u.hasAttribute("formAction")){if(c=u,p=u[zt]||null)x=p.formAction;else if(Zf(c)!==null)continue}else x=p.action;typeof x=="function"?n[s+1]=x:(n.splice(s,3),s-=3),Ig(n)}}}function Fg(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return c=p})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Vf(e){this._internalRoot=e}Cc.prototype.render=Vf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var n=t.current,s=ea();Pg(n,s,e,t,null,null)},Cc.prototype.unmount=Vf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Pg(e.current,2,null,e,null,null),uc(),t[hi]=null}};function Cc(e){this._internalRoot=e}Cc.prototype.unstable_scheduleHydration=function(e){if(e){var t=op();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wn.length&&t!==0&&t<Wn[n].priority;n++);Wn.splice(n,0,e),n===0&&Xg(e)}};var $g=a.version;if($g!=="19.2.4")throw Error(l(527,$g,"19.2.4"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=m(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var z1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{Rs=Rc.inject(z1),Vt=Rc}catch{}}return El.createRoot=function(e,t){if(!o(e))throw Error(l(299));var n=!1,s="",c=s0,u=l0,p=o0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Bg(e,1,!1,null,null,n,s,null,c,u,p,Fg),e[hi]=t.current,jf(e),new Vf(t)},El.hydrateRoot=function(e,t,n){if(!o(e))throw Error(l(299));var s=!1,c="",u=s0,p=l0,x=o0,k=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=Bg(e,1,!0,t,n??null,s,c,k,u,p,x,Fg),t.context=Gg(null),n=t.current,s=ea(),s=Mu(s),c=Mn(s),c.callback=null,Un(n,c,s),n=s,t.current.lanes=n,Ds(t,n),Ua(t),e[hi]=t.current,jf(e),new Cc(t)},El.version="19.2.4",El}var uv;function Z1(){if(uv)return Wf.exports;uv=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Wf.exports=P1(),Wf.exports}var Y1=Z1();const V1=Nb(Y1);/**
50
+ * react-router v7.13.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var dv="popstate";function fv(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function Q1(r={}){function a(l,o){var m;let d=(m=o.state)==null?void 0:m.masked,{pathname:f,search:v,hash:y}=d||l.location;return Dh("",{pathname:f,search:v,hash:y},o.state&&o.state.usr||null,o.state&&o.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,o){return typeof o=="string"?o:ql(o)}return X1(a,i,null,r)}function Fe(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function Pa(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function J1(){return Math.random().toString(36).substring(2,10)}function hv(r,a){return{usr:r.state,key:r.key,idx:a,masked:r.unstable_mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function Dh(r,a,i=null,l,o){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof a=="string"?ks(a):a,state:i,key:a&&a.key||l||J1(),unstable_mask:o}}function ql({pathname:r="/",search:a="",hash:i=""}){return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(r+=i.charAt(0)==="#"?i:"#"+i),r}function ks(r){let a={};if(r){let i=r.indexOf("#");i>=0&&(a.hash=r.substring(i),r=r.substring(0,i));let l=r.indexOf("?");l>=0&&(a.search=r.substring(l),r=r.substring(0,l)),r&&(a.pathname=r)}return a}function X1(r,a,i,l={}){let{window:o=document.defaultView,v5Compat:d=!1}=l,f=o.history,v="POP",y=null,m=g();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function g(){return(f.state||{idx:null}).idx}function b(){v="POP";let S=g(),N=S==null?null:S-m;m=S,y&&y({action:v,location:E.location,delta:N})}function w(S,N){v="PUSH";let H=fv(S)?S:Dh(E.location,S,N);m=g()+1;let K=hv(H,m),L=E.createHref(H.unstable_mask||H);try{f.pushState(K,"",L)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;o.location.assign(L)}d&&y&&y({action:v,location:E.location,delta:1})}function _(S,N){v="REPLACE";let H=fv(S)?S:Dh(E.location,S,N);m=g();let K=hv(H,m),L=E.createHref(H.unstable_mask||H);f.replaceState(K,"",L),d&&y&&y({action:v,location:E.location,delta:0})}function C(S){return W1(S)}let E={get action(){return v},get location(){return r(o,f)},listen(S){if(y)throw new Error("A history only accepts one active listener");return o.addEventListener(dv,b),y=S,()=>{o.removeEventListener(dv,b),y=null}},createHref(S){return a(o,S)},createURL:C,encodeLocation(S){let N=C(S);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:w,replace:_,go(S){return f.go(S)}};return E}function W1(r,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Fe(i,"No window.location.(origin|href) available to create URL");let l=typeof r=="string"?r:ql(r);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function Cb(r,a,i="/"){return I1(r,a,i,!1)}function I1(r,a,i,l){let o=typeof a=="string"?ks(a):a,d=wn(o.pathname||"/",i);if(d==null)return null;let f=Rb(r);F1(f);let v=null;for(let y=0;v==null&&y<f.length;++y){let m=c2(d);v=l2(f[y],m,l)}return v}function Rb(r,a=[],i=[],l="",o=!1){let d=(f,v,y=o,m)=>{let g={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:v,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&y)return;Fe(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let b=Ga([l,g.relativePath]),w=i.concat(g);f.children&&f.children.length>0&&(Fe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),Rb(f.children,a,w,b,y)),!(f.path==null&&!f.index)&&a.push({path:b,score:i2(b,f.index),routesMeta:w})};return r.forEach((f,v)=>{var y;if(f.path===""||!((y=f.path)!=null&&y.includes("?")))d(f,v);else for(let m of Ob(f.path))d(f,v,!0,m)}),a}function Ob(r){let a=r.split("/");if(a.length===0)return[];let[i,...l]=a,o=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return o?[d,""]:[d];let f=Ob(l.join("/")),v=[];return v.push(...f.map(y=>y===""?d:[d,y].join("/"))),o&&v.push(...f),v.map(y=>r.startsWith("/")&&y===""?"/":y)}function F1(r){r.sort((a,i)=>a.score!==i.score?i.score-a.score:s2(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var $1=/^:[\w-]+$/,e2=3,t2=2,a2=1,n2=10,r2=-2,mv=r=>r==="*";function i2(r,a){let i=r.split("/"),l=i.length;return i.some(mv)&&(l+=r2),a&&(l+=t2),i.filter(o=>!mv(o)).reduce((o,d)=>o+($1.test(d)?e2:d===""?a2:n2),l)}function s2(r,a){return r.length===a.length&&r.slice(0,-1).every((l,o)=>l===a[o])?r[r.length-1]-a[a.length-1]:0}function l2(r,a,i=!1){let{routesMeta:l}=r,o={},d="/",f=[];for(let v=0;v<l.length;++v){let y=l[v],m=v===l.length-1,g=d==="/"?a:a.slice(d.length)||"/",b=ru({path:y.relativePath,caseSensitive:y.caseSensitive,end:m},g),w=y.route;if(!b&&m&&i&&!l[l.length-1].route.index&&(b=ru({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},g)),!b)return null;Object.assign(o,b.params),f.push({params:o,pathname:Ga([d,b.pathname]),pathnameBase:h2(Ga([d,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(d=Ga([d,b.pathnameBase]))}return f}function ru(r,a){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[i,l]=o2(r.path,r.caseSensitive,r.end),o=a.match(i);if(!o)return null;let d=o[0],f=d.replace(/(.)\/+$/,"$1"),v=o.slice(1);return{params:l.reduce((m,{paramName:g,isOptional:b},w)=>{if(g==="*"){let C=v[w]||"";f=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const _=v[w];return b&&!_?m[g]=void 0:m[g]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:d,pathnameBase:f,pattern:r}}function o2(r,a=!1,i=!0){Pa(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let l=[],o="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,v,y,m,g)=>{if(l.push({paramName:v,isOptional:y!=null}),y){let b=g.charAt(m+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(l.push({paramName:"*"}),o+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":r!==""&&r!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),l]}function c2(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Pa(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),r}}function wn(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=r.charAt(i);return l&&l!=="/"?null:r.slice(i)||"/"}var u2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function d2(r,a="/"){let{pathname:i,search:l="",hash:o=""}=typeof r=="string"?ks(r):r,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=pv(i.substring(1),"/"):d=pv(i,a)):d=a,{pathname:d,search:m2(l),hash:p2(o)}}function pv(r,a){let i=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function eh(r,a,i,l){return`Cannot include a '${r}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function f2(r){return r.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Db(r){let a=f2(r);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function gm(r,a,i,l=!1){let o;typeof r=="string"?o=ks(r):(o={...r},Fe(!o.pathname||!o.pathname.includes("?"),eh("?","pathname","search",o)),Fe(!o.pathname||!o.pathname.includes("#"),eh("#","pathname","hash",o)),Fe(!o.search||!o.search.includes("#"),eh("#","search","hash",o)));let d=r===""||o.pathname==="",f=d?"/":o.pathname,v;if(f==null)v=i;else{let b=a.length-1;if(!l&&f.startsWith("..")){let w=f.split("/");for(;w[0]==="..";)w.shift(),b-=1;o.pathname=w.join("/")}v=b>=0?a[b]:"/"}let y=d2(o,v),m=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&i.endsWith("/");return!y.pathname.endsWith("/")&&(m||g)&&(y.pathname+="/"),y}var Ga=r=>r.join("/").replace(/\/\/+/g,"/"),h2=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),m2=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,p2=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,y2=class{constructor(r,a,i,l=!1){this.status=r,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function g2(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function v2(r){return r.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var zb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mb(r,a){let i=r;if(typeof i!="string"||!u2.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,o=!1;if(zb)try{let d=new URL(window.location.href),f=i.startsWith("//")?new URL(d.protocol+i):new URL(i),v=wn(f.pathname,a);f.origin===d.origin&&v!=null?i=v+f.search+f.hash:o=!0}catch{Pa(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ub=["POST","PUT","PATCH","DELETE"];new Set(Ub);var b2=["GET",...Ub];new Set(b2);var Ts=A.createContext(null);Ts.displayName="DataRouter";var vu=A.createContext(null);vu.displayName="DataRouterState";var x2=A.createContext(!1),Hb=A.createContext({isTransitioning:!1});Hb.displayName="ViewTransition";var w2=A.createContext(new Map);w2.displayName="Fetchers";var S2=A.createContext(null);S2.displayName="Await";var xa=A.createContext(null);xa.displayName="Navigation";var $l=A.createContext(null);$l.displayName="Location";var _n=A.createContext({outlet:null,matches:[],isDataRoute:!1});_n.displayName="Route";var vm=A.createContext(null);vm.displayName="RouteError";var Lb="REACT_ROUTER_ERROR",_2="REDIRECT",E2="ROUTE_ERROR_RESPONSE";function k2(r){if(r.startsWith(`${Lb}:${_2}:{`))try{let a=JSON.parse(r.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function T2(r){if(r.startsWith(`${Lb}:${E2}:{`))try{let a=JSON.parse(r.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new y2(a.status,a.statusText,a.data)}catch{}}function j2(r,{relative:a}={}){Fe(eo(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=A.useContext(xa),{hash:o,pathname:d,search:f}=to(r,{relative:a}),v=d;return i!=="/"&&(v=d==="/"?i:Ga([i,d])),l.createHref({pathname:v,search:f,hash:o})}function eo(){return A.useContext($l)!=null}function Va(){return Fe(eo(),"useLocation() may be used only in the context of a <Router> component."),A.useContext($l).location}var Kb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qb(r){A.useContext(xa).static||A.useLayoutEffect(r)}function bm(){let{isDataRoute:r}=A.useContext(_n);return r?q2():A2()}function A2(){Fe(eo(),"useNavigate() may be used only in the context of a <Router> component.");let r=A.useContext(Ts),{basename:a,navigator:i}=A.useContext(xa),{matches:l}=A.useContext(_n),{pathname:o}=Va(),d=JSON.stringify(Db(l)),f=A.useRef(!1);return qb(()=>{f.current=!0}),A.useCallback((y,m={})=>{if(Pa(f.current,Kb),!f.current)return;if(typeof y=="number"){i.go(y);return}let g=gm(y,JSON.parse(d),o,m.relative==="path");r==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Ga([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,d,o,r])}A.createContext(null);function to(r,{relative:a}={}){let{matches:i}=A.useContext(_n),{pathname:l}=Va(),o=JSON.stringify(Db(i));return A.useMemo(()=>gm(r,JSON.parse(o),l,a==="path"),[r,o,l,a])}function N2(r,a){return Bb(r,a)}function Bb(r,a,i){var S;Fe(eo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=A.useContext(xa),{matches:o}=A.useContext(_n),d=o[o.length-1],f=d?d.params:{},v=d?d.pathname:"/",y=d?d.pathnameBase:"/",m=d&&d.route;{let N=m&&m.path||"";Pb(v,!m||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${N}">) 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.
59
+
60
+ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let g=Va(),b;if(a){let N=typeof a=="string"?ks(a):a;Fe(y==="/"||((S=N.pathname)==null?void 0:S.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${N.pathname}" was given in the \`location\` prop.`),b=N}else b=g;let w=b.pathname||"/",_=w;if(y!=="/"){let N=y.replace(/^\//,"").split("/");_="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let C=Cb(r,{pathname:_});Pa(m||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Pa(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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.`);let E=z2(C&&C.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:Ga([y,l.encodeLocation?l.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:Ga([y,l.encodeLocation?l.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),o,i);return a&&E?A.createElement($l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},E):E}function C2(){let r=K2(),a=g2(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),i=r instanceof Error?r.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",r),f=A.createElement(A.Fragment,null,A.createElement("p",null,"💿 Hey developer 👋"),A.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",A.createElement("code",{style:d},"ErrorBoundary")," or"," ",A.createElement("code",{style:d},"errorElement")," prop on your route.")),A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},a),i?A.createElement("pre",{style:o},i):null,f)}var R2=A.createElement(C2,null),Gb=class extends A.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,a){return a.location!==r.location||a.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:a.error,location:a.location,revalidation:r.revalidation||a.revalidation}}componentDidCatch(r,a){this.props.onError?this.props.onError(r,a):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const i=T2(r.digest);i&&(r=i)}let a=r!==void 0?A.createElement(_n.Provider,{value:this.props.routeContext},A.createElement(vm.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?A.createElement(O2,{error:r},a):a}};Gb.contextType=x2;var th=new WeakMap;function O2({children:r,error:a}){let{basename:i}=A.useContext(xa);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=k2(a.digest);if(l){let o=th.get(a);if(o)throw o;let d=Mb(l.location,i);if(zb&&!th.get(a))if(d.isExternal||l.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw th.set(a,f),f}return A.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return r}function D2({routeContext:r,match:a,children:i}){let l=A.useContext(Ts);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),A.createElement(_n.Provider,{value:r},i)}function z2(r,a=[],i){let l=i==null?void 0:i.state;if(r==null){if(!l)return null;if(l.errors)r=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let o=r,d=l==null?void 0:l.errors;if(d!=null){let g=o.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);Fe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let f=!1,v=-1;if(i&&l){f=l.renderFallback;for(let g=0;g<o.length;g++){let b=o[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(v=g),b.route.id){let{loaderData:w,errors:_}=l,C=b.route.loader&&!w.hasOwnProperty(b.route.id)&&(!_||_[b.route.id]===void 0);if(b.route.lazy||C){i.isStatic&&(f=!0),v>=0?o=o.slice(0,v+1):o=[o[0]];break}}}}let y=i==null?void 0:i.onError,m=l&&y?(g,b)=>{var w,_;y(g,{location:l.location,params:((_=(w=l.matches)==null?void 0:w[0])==null?void 0:_.params)??{},unstable_pattern:v2(l.matches),errorInfo:b})}:void 0;return o.reduceRight((g,b,w)=>{let _,C=!1,E=null,S=null;l&&(_=d&&b.route.id?d[b.route.id]:void 0,E=b.route.errorElement||R2,f&&(v<0&&w===0?(Pb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,S=null):v===w&&(C=!0,S=b.route.hydrateFallbackElement||null)));let N=a.concat(o.slice(0,w+1)),H=()=>{let K;return _?K=E:C?K=S:b.route.Component?K=A.createElement(b.route.Component,null):b.route.element?K=b.route.element:K=g,A.createElement(D2,{match:b,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:K})};return l&&(b.route.ErrorBoundary||b.route.errorElement||w===0)?A.createElement(Gb,{location:l.location,revalidation:l.revalidation,component:E,error:_,children:H(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:m}):H()},null)}function xm(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M2(r){let a=A.useContext(Ts);return Fe(a,xm(r)),a}function U2(r){let a=A.useContext(vu);return Fe(a,xm(r)),a}function H2(r){let a=A.useContext(_n);return Fe(a,xm(r)),a}function wm(r){let a=H2(r),i=a.matches[a.matches.length-1];return Fe(i.route.id,`${r} can only be used on routes that contain a unique "id"`),i.route.id}function L2(){return wm("useRouteId")}function K2(){var l;let r=A.useContext(vm),a=U2("useRouteError"),i=wm("useRouteError");return r!==void 0?r:(l=a.errors)==null?void 0:l[i]}function q2(){let{router:r}=M2("useNavigate"),a=wm("useNavigate"),i=A.useRef(!1);return qb(()=>{i.current=!0}),A.useCallback(async(o,d={})=>{Pa(i.current,Kb),i.current&&(typeof o=="number"?await r.navigate(o):await r.navigate(o,{fromRouteId:a,...d}))},[r,a])}var yv={};function Pb(r,a,i){!a&&!yv[r]&&(yv[r]=!0,Pa(!1,i))}A.memo(B2);function B2({routes:r,future:a,state:i,isStatic:l,onError:o}){return Bb(r,void 0,{state:i,isStatic:l,onError:o})}function as(r){Fe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function G2({basename:r="/",children:a=null,location:i,navigationType:l="POP",navigator:o,static:d=!1,unstable_useTransitions:f}){Fe(!eo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=r.replace(/^\/*/,"/"),y=A.useMemo(()=>({basename:v,navigator:o,static:d,unstable_useTransitions:f,future:{}}),[v,o,d,f]);typeof i=="string"&&(i=ks(i));let{pathname:m="/",search:g="",hash:b="",state:w=null,key:_="default",unstable_mask:C}=i,E=A.useMemo(()=>{let S=wn(m,v);return S==null?null:{location:{pathname:S,search:g,hash:b,state:w,key:_,unstable_mask:C},navigationType:l}},[v,m,g,b,w,_,l,C]);return Pa(E!=null,`<Router basename="${v}"> is not able to match the URL "${m}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:A.createElement(xa.Provider,{value:y},A.createElement($l.Provider,{children:a,value:E}))}function P2({children:r,location:a}){return N2(zh(r),a)}function zh(r,a=[]){let i=[];return A.Children.forEach(r,(l,o)=>{if(!A.isValidElement(l))return;let d=[...a,o];if(l.type===A.Fragment){i.push.apply(i,zh(l.props.children,d));return}Fe(l.type===as,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Fe(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=zh(l.props.children,d)),i.push(f)}),i}var Ic="get",Fc="application/x-www-form-urlencoded";function bu(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function Z2(r){return bu(r)&&r.tagName.toLowerCase()==="button"}function Y2(r){return bu(r)&&r.tagName.toLowerCase()==="form"}function V2(r){return bu(r)&&r.tagName.toLowerCase()==="input"}function Q2(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function J2(r,a){return r.button===0&&(!a||a==="_self")&&!Q2(r)}var Dc=null;function X2(){if(Dc===null)try{new FormData(document.createElement("form"),0),Dc=!1}catch{Dc=!0}return Dc}var W2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ah(r){return r!=null&&!W2.has(r)?(Pa(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fc}"`),null):r}function I2(r,a){let i,l,o,d,f;if(Y2(r)){let v=r.getAttribute("action");l=v?wn(v,a):null,i=r.getAttribute("method")||Ic,o=ah(r.getAttribute("enctype"))||Fc,d=new FormData(r)}else if(Z2(r)||V2(r)&&(r.type==="submit"||r.type==="image")){let v=r.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=r.getAttribute("formaction")||v.getAttribute("action");if(l=y?wn(y,a):null,i=r.getAttribute("formmethod")||v.getAttribute("method")||Ic,o=ah(r.getAttribute("formenctype"))||ah(v.getAttribute("enctype"))||Fc,d=new FormData(v,r),!X2()){let{name:m,type:g,value:b}=r;if(g==="image"){let w=m?`${m}.`:"";d.append(`${w}x`,"0"),d.append(`${w}y`,"0")}else m&&d.append(m,b)}}else{if(bu(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Ic,l=null,o=Fc,f=r}return d&&o==="text/plain"&&(f=d,d=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sm(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function F2(r,a,i,l){let o=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:a&&wn(o.pathname,a)==="/"?o.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function $2(r,a){if(r.id in a)return a[r.id];try{let i=await import(r.module);return a[r.id]=i,i}catch(i){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function e_(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function t_(r,a,i){let l=await Promise.all(r.map(async o=>{let d=a.routes[o.route.id];if(d){let f=await $2(d,i);return f.links?f.links():[]}return[]}));return i_(l.flat(1).filter(e_).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function gv(r,a,i,l,o,d){let f=(y,m)=>i[m]?y.route.id!==i[m].route.id:!0,v=(y,m)=>{var g;return i[m].pathname!==y.pathname||((g=i[m].route.path)==null?void 0:g.endsWith("*"))&&i[m].params["*"]!==y.params["*"]};return d==="assets"?a.filter((y,m)=>f(y,m)||v(y,m)):d==="data"?a.filter((y,m)=>{var b;let g=l.routes[y.route.id];if(!g||!g.hasLoader)return!1;if(f(y,m)||v(y,m))return!0;if(y.route.shouldRevalidate){let w=y.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(r,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function a_(r,a,{includeHydrateFallback:i}={}){return n_(r.map(l=>{let o=a.routes[l.route.id];if(!o)return[];let d=[o.module];return o.clientActionModule&&(d=d.concat(o.clientActionModule)),o.clientLoaderModule&&(d=d.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(d=d.concat(o.hydrateFallbackModule)),o.imports&&(d=d.concat(o.imports)),d}).flat(1))}function n_(r){return[...new Set(r)]}function r_(r){let a={},i=Object.keys(r).sort();for(let l of i)a[l]=r[l];return a}function i_(r,a){let i=new Set;return new Set(a),r.reduce((l,o)=>{let d=JSON.stringify(r_(o));return i.has(d)||(i.add(d),l.push({key:d,link:o})),l},[])}function Zb(){let r=A.useContext(Ts);return Sm(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function s_(){let r=A.useContext(vu);return Sm(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var _m=A.createContext(void 0);_m.displayName="FrameworkContext";function Yb(){let r=A.useContext(_m);return Sm(r,"You must render this element inside a <HydratedRouter> element"),r}function l_(r,a){let i=A.useContext(_m),[l,o]=A.useState(!1),[d,f]=A.useState(!1),{onFocus:v,onBlur:y,onMouseEnter:m,onMouseLeave:g,onTouchStart:b}=a,w=A.useRef(null);A.useEffect(()=>{if(r==="render"&&f(!0),r==="viewport"){let E=N=>{N.forEach(H=>{f(H.isIntersecting)})},S=new IntersectionObserver(E,{threshold:.5});return w.current&&S.observe(w.current),()=>{S.disconnect()}}},[r]),A.useEffect(()=>{if(l){let E=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(E)}}},[l]);let _=()=>{o(!0)},C=()=>{o(!1),f(!1)};return i?r!=="intent"?[d,w,{}]:[d,w,{onFocus:kl(v,_),onBlur:kl(y,C),onMouseEnter:kl(m,_),onMouseLeave:kl(g,C),onTouchStart:kl(b,_)}]:[!1,w,{}]}function kl(r,a){return i=>{r&&r(i),i.defaultPrevented||a(i)}}function o_({page:r,...a}){let{router:i}=Zb(),l=A.useMemo(()=>Cb(i.routes,r,i.basename),[i.routes,r,i.basename]);return l?A.createElement(u_,{page:r,matches:l,...a}):null}function c_(r){let{manifest:a,routeModules:i}=Yb(),[l,o]=A.useState([]);return A.useEffect(()=>{let d=!1;return t_(r,a,i).then(f=>{d||o(f)}),()=>{d=!0}},[r,a,i]),l}function u_({page:r,matches:a,...i}){let l=Va(),{future:o,manifest:d,routeModules:f}=Yb(),{basename:v}=Zb(),{loaderData:y,matches:m}=s_(),g=A.useMemo(()=>gv(r,a,m,d,l,"data"),[r,a,m,d,l]),b=A.useMemo(()=>gv(r,a,m,d,l,"assets"),[r,a,m,d,l]),w=A.useMemo(()=>{if(r===l.pathname+l.search+l.hash)return[];let E=new Set,S=!1;if(a.forEach(H=>{var L;let K=d.routes[H.route.id];!K||!K.hasLoader||(!g.some(U=>U.route.id===H.route.id)&&H.route.id in y&&((L=f[H.route.id])!=null&&L.shouldRevalidate)||K.hasClientLoader?S=!0:E.add(H.route.id))}),E.size===0)return[];let N=F2(r,v,o.unstable_trailingSlashAwareDataRequests,"data");return S&&E.size>0&&N.searchParams.set("_routes",a.filter(H=>E.has(H.route.id)).map(H=>H.route.id).join(",")),[N.pathname+N.search]},[v,o.unstable_trailingSlashAwareDataRequests,y,l,d,g,a,r,f]),_=A.useMemo(()=>a_(b,d),[b,d]),C=c_(b);return A.createElement(A.Fragment,null,w.map(E=>A.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),_.map(E=>A.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),C.map(({key:E,link:S})=>A.createElement("link",{key:E,nonce:i.nonce,...S,crossOrigin:S.crossOrigin??i.crossOrigin})))}function d_(...r){return a=>{r.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var f_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{f_&&(window.__reactRouterVersion="7.13.2")}catch{}function h_({basename:r,children:a,unstable_useTransitions:i,window:l}){let o=A.useRef();o.current==null&&(o.current=Q1({window:l,v5Compat:!0}));let d=o.current,[f,v]=A.useState({action:d.action,location:d.location}),y=A.useCallback(m=>{i===!1?v(m):A.startTransition(()=>v(m))},[i]);return A.useLayoutEffect(()=>d.listen(y),[d,y]),A.createElement(G2,{basename:r,children:a,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:i})}var Vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qb=A.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:o,reloadDocument:d,replace:f,unstable_mask:v,state:y,target:m,to:g,preventScrollReset:b,viewTransition:w,unstable_defaultShouldRevalidate:_,...C},E){let{basename:S,navigator:N,unstable_useTransitions:H}=A.useContext(xa),K=typeof g=="string"&&Vb.test(g),L=Mb(g,S);g=L.to;let U=j2(g,{relative:o}),I=Va(),$=null;if(v){let xe=gm(v,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);S!=="/"&&(xe.pathname=xe.pathname==="/"?S:Ga([S,xe.pathname])),$=N.createHref(xe)}let[ee,X,ie]=l_(l,C),W=y_(g,{replace:f,unstable_mask:v,state:y,target:m,preventScrollReset:b,relative:o,viewTransition:w,unstable_defaultShouldRevalidate:_,unstable_useTransitions:H});function Q(xe){a&&a(xe),xe.defaultPrevented||W(xe)}let pe=!(L.isExternal||d),de=A.createElement("a",{...C,...ie,href:(pe?$:void 0)||L.absoluteURL||U,onClick:pe?Q:a,ref:d_(E,X),target:m,"data-discover":!K&&i==="render"?"true":void 0});return ee&&!K?A.createElement(A.Fragment,null,de,A.createElement(o_,{page:U})):de});Qb.displayName="Link";var Mh=A.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:o=!1,style:d,to:f,viewTransition:v,children:y,...m},g){let b=to(f,{relative:m.relative}),w=Va(),_=A.useContext(vu),{navigator:C,basename:E}=A.useContext(xa),S=_!=null&&w_(b)&&v===!0,N=C.encodeLocation?C.encodeLocation(b).pathname:b.pathname,H=w.pathname,K=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(H=H.toLowerCase(),K=K?K.toLowerCase():null,N=N.toLowerCase()),K&&E&&(K=wn(K,E)||K);const L=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let U=H===N||!o&&H.startsWith(N)&&H.charAt(L)==="/",I=K!=null&&(K===N||!o&&K.startsWith(N)&&K.charAt(N.length)==="/"),$={isActive:U,isPending:I,isTransitioning:S},ee=U?a:void 0,X;typeof l=="function"?X=l($):X=[l,U?"active":null,I?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let ie=typeof d=="function"?d($):d;return A.createElement(Qb,{...m,"aria-current":ee,className:X,ref:g,style:ie,to:f,viewTransition:v},typeof y=="function"?y($):y)});Mh.displayName="NavLink";var m_=A.forwardRef(({discover:r="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:o,state:d,method:f=Ic,action:v,onSubmit:y,relative:m,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,..._},C)=>{let{unstable_useTransitions:E}=A.useContext(xa),S=b_(),N=x_(v,{relative:m}),H=f.toLowerCase()==="get"?"get":"post",K=typeof v=="string"&&Vb.test(v),L=U=>{if(y&&y(U),U.defaultPrevented)return;U.preventDefault();let I=U.nativeEvent.submitter,$=(I==null?void 0:I.getAttribute("formmethod"))||f,ee=()=>S(I||U.currentTarget,{fetcherKey:a,method:$,navigate:i,replace:o,state:d,relative:m,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w});E&&i!==!1?A.startTransition(()=>ee()):ee()};return A.createElement("form",{ref:C,method:H,action:N,onSubmit:l?y:L,..._,"data-discover":!K&&r==="render"?"true":void 0})});m_.displayName="Form";function p_(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jb(r){let a=A.useContext(Ts);return Fe(a,p_(r)),a}function y_(r,{target:a,replace:i,unstable_mask:l,state:o,preventScrollReset:d,relative:f,viewTransition:v,unstable_defaultShouldRevalidate:y,unstable_useTransitions:m}={}){let g=bm(),b=Va(),w=to(r,{relative:f});return A.useCallback(_=>{if(J2(_,a)){_.preventDefault();let C=i!==void 0?i:ql(b)===ql(w),E=()=>g(r,{replace:C,unstable_mask:l,state:o,preventScrollReset:d,relative:f,viewTransition:v,unstable_defaultShouldRevalidate:y});m?A.startTransition(()=>E()):E()}},[b,g,w,i,l,o,a,r,d,f,v,y,m])}var g_=0,v_=()=>`__${String(++g_)}__`;function b_(){let{router:r}=Jb("useSubmit"),{basename:a}=A.useContext(xa),i=L2(),l=r.fetch,o=r.navigate;return A.useCallback(async(d,f={})=>{let{action:v,method:y,encType:m,formData:g,body:b}=I2(d,a);if(f.navigate===!1){let w=f.fetcherKey||v_();await l(w,i,f.action||v,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||y,formEncType:f.encType||m,flushSync:f.flushSync})}else await o(f.action||v,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||y,formEncType:f.encType||m,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,o,a,i])}function x_(r,{relative:a}={}){let{basename:i}=A.useContext(xa),l=A.useContext(_n);Fe(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),d={...to(r||".",{relative:a})},f=Va();if(r==null){d.search=f.search;let v=new URLSearchParams(d.search),y=v.getAll("index");if(y.some(g=>g==="")){v.delete("index"),y.filter(b=>b).forEach(b=>v.append("index",b));let g=v.toString();d.search=g?`?${g}`:""}}return(!r||r===".")&&o.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:Ga([i,d.pathname])),ql(d)}function w_(r,{relative:a}={}){let i=A.useContext(Hb);Fe(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Jb("useViewTransitionState"),o=to(r,{relative:a});if(!i.isTransitioning)return!1;let d=wn(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=wn(i.nextLocation.pathname,l)||i.nextLocation.pathname;return ru(o.pathname,f)!=null||ru(o.pathname,d)!=null}var js=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fr,lr,ds,vb,S_=(vb=class extends js{constructor(){super();oe(this,Fr);oe(this,lr);oe(this,ds);ae(this,ds,a=>{if(typeof window<"u"&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){T(this,lr)||this.setEventListener(T(this,ds))}onUnsubscribe(){var a;this.hasListeners()||((a=T(this,lr))==null||a.call(this),ae(this,lr,void 0))}setEventListener(a){var i;ae(this,ds,a),(i=T(this,lr))==null||i.call(this),ae(this,lr,a(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()}))}setFocused(a){T(this,Fr)!==a&&(ae(this,Fr,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){var a;return typeof T(this,Fr)=="boolean"?T(this,Fr):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},Fr=new WeakMap,lr=new WeakMap,ds=new WeakMap,vb),Em=new S_,__={setTimeout:(r,a)=>setTimeout(r,a),clearTimeout:r=>clearTimeout(r),setInterval:(r,a)=>setInterval(r,a),clearInterval:r=>clearInterval(r)},or,pm,bb,E_=(bb=class{constructor(){oe(this,or,__);oe(this,pm,!1)}setTimeoutProvider(r){ae(this,or,r)}setTimeout(r,a){return T(this,or).setTimeout(r,a)}clearTimeout(r){T(this,or).clearTimeout(r)}setInterval(r,a){return T(this,or).setInterval(r,a)}clearInterval(r){T(this,or).clearInterval(r)}},or=new WeakMap,pm=new WeakMap,bb),Wr=new E_;function k_(r){setTimeout(r,0)}var T_=typeof window>"u"||"Deno"in globalThis;function Ot(){}function j_(r,a){return typeof r=="function"?r(a):r}function Uh(r){return typeof r=="number"&&r>=0&&r!==1/0}function Xb(r,a){return Math.max(r+(a||0)-Date.now(),0)}function gr(r,a){return typeof r=="function"?r(a):r}function ga(r,a){return typeof r=="function"?r(a):r}function vv(r,a){const{type:i="all",exact:l,fetchStatus:o,predicate:d,queryKey:f,stale:v}=r;if(f){if(l){if(a.queryHash!==km(f,a.options))return!1}else if(!Bl(a.queryKey,f))return!1}if(i!=="all"){const y=a.isActive();if(i==="active"&&!y||i==="inactive"&&y)return!1}return!(typeof v=="boolean"&&a.isStale()!==v||o&&o!==a.state.fetchStatus||d&&!d(a))}function bv(r,a){const{exact:i,status:l,predicate:o,mutationKey:d}=r;if(d){if(!a.options.mutationKey)return!1;if(i){if(oi(a.options.mutationKey)!==oi(d))return!1}else if(!Bl(a.options.mutationKey,d))return!1}return!(l&&a.state.status!==l||o&&!o(a))}function km(r,a){return((a==null?void 0:a.queryKeyHashFn)||oi)(r)}function oi(r){return JSON.stringify(r,(a,i)=>Hh(i)?Object.keys(i).sort().reduce((l,o)=>(l[o]=i[o],l),{}):i)}function Bl(r,a){return r===a?!0:typeof r!=typeof a?!1:r&&a&&typeof r=="object"&&typeof a=="object"?Object.keys(a).every(i=>Bl(r[i],a[i])):!1}var A_=Object.prototype.hasOwnProperty;function Wb(r,a,i=0){if(r===a)return r;if(i>500)return a;const l=xv(r)&&xv(a);if(!l&&!(Hh(r)&&Hh(a)))return a;const d=(l?r:Object.keys(r)).length,f=l?a:Object.keys(a),v=f.length,y=l?new Array(v):{};let m=0;for(let g=0;g<v;g++){const b=l?g:f[g],w=r[b],_=a[b];if(w===_){y[b]=w,(l?g<d:A_.call(r,b))&&m++;continue}if(w===null||_===null||typeof w!="object"||typeof _!="object"){y[b]=_;continue}const C=Wb(w,_,i+1);y[b]=C,C===w&&m++}return d===v&&m===d?r:y}function iu(r,a){if(!a||Object.keys(r).length!==Object.keys(a).length)return!1;for(const i in r)if(r[i]!==a[i])return!1;return!0}function xv(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function Hh(r){if(!wv(r))return!1;const a=r.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!wv(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function wv(r){return Object.prototype.toString.call(r)==="[object Object]"}function N_(r){return new Promise(a=>{Wr.setTimeout(a,r)})}function Lh(r,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(r,a):i.structuralSharing!==!1?Wb(r,a):a}function C_(r,a,i=0){const l=[...r,a];return i&&l.length>i?l.slice(1):l}function R_(r,a,i=0){const l=[a,...r];return i&&l.length>i?l.slice(0,-1):l}var Tm=Symbol();function Ib(r,a){return!r.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!r.queryFn||r.queryFn===Tm?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function jm(r,a){return typeof r=="function"?r(...a):!!r}function O_(r,a,i){let l=!1,o;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(o??(o=a()),l||(l=!0,o.aborted?i():o.addEventListener("abort",i,{once:!0})),o)}),r}var Gl=(()=>{let r=()=>T_;return{isServer(){return r()},setIsServer(a){r=a}}})();function Kh(){let r,a;const i=new Promise((o,d)=>{r=o,a=d});i.status="pending",i.catch(()=>{});function l(o){Object.assign(i,o),delete i.resolve,delete i.reject}return i.resolve=o=>{l({status:"fulfilled",value:o}),r(o)},i.reject=o=>{l({status:"rejected",reason:o}),a(o)},i}var D_=k_;function z_(){let r=[],a=0,i=v=>{v()},l=v=>{v()},o=D_;const d=v=>{a?r.push(v):o(()=>{i(v)})},f=()=>{const v=r;r=[],v.length&&o(()=>{l(()=>{v.forEach(y=>{i(y)})})})};return{batch:v=>{let y;a++;try{y=v()}finally{a--,a||f()}return y},batchCalls:v=>(...y)=>{d(()=>{v(...y)})},schedule:d,setNotifyFunction:v=>{i=v},setBatchNotifyFunction:v=>{l=v},setScheduler:v=>{o=v}}}var ft=z_(),fs,cr,hs,xb,M_=(xb=class extends js{constructor(){super();oe(this,fs,!0);oe(this,cr);oe(this,hs);ae(this,hs,a=>{if(typeof window<"u"&&window.addEventListener){const i=()=>a(!0),l=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",l)}}})}onSubscribe(){T(this,cr)||this.setEventListener(T(this,hs))}onUnsubscribe(){var a;this.hasListeners()||((a=T(this,cr))==null||a.call(this),ae(this,cr,void 0))}setEventListener(a){var i;ae(this,hs,a),(i=T(this,cr))==null||i.call(this),ae(this,cr,a(this.setOnline.bind(this)))}setOnline(a){T(this,fs)!==a&&(ae(this,fs,a),this.listeners.forEach(l=>{l(a)}))}isOnline(){return T(this,fs)}},fs=new WeakMap,cr=new WeakMap,hs=new WeakMap,xb),su=new M_;function U_(r){return Math.min(1e3*2**r,3e4)}function Fb(r){return(r??"online")==="online"?su.isOnline():!0}var qh=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function $b(r){let a=!1,i=0,l;const o=Kh(),d=()=>o.status!=="pending",f=E=>{var S;if(!d()){const N=new qh(E);w(N),(S=r.onCancel)==null||S.call(r,N)}},v=()=>{a=!0},y=()=>{a=!1},m=()=>Em.isFocused()&&(r.networkMode==="always"||su.isOnline())&&r.canRun(),g=()=>Fb(r.networkMode)&&r.canRun(),b=E=>{d()||(l==null||l(),o.resolve(E))},w=E=>{d()||(l==null||l(),o.reject(E))},_=()=>new Promise(E=>{var S;l=N=>{(d()||m())&&E(N)},(S=r.onPause)==null||S.call(r)}).then(()=>{var E;l=void 0,d()||(E=r.onContinue)==null||E.call(r)}),C=()=>{if(d())return;let E;const S=i===0?r.initialPromise:void 0;try{E=S??r.fn()}catch(N){E=Promise.reject(N)}Promise.resolve(E).then(b).catch(N=>{var I;if(d())return;const H=r.retry??(Gl.isServer()?0:3),K=r.retryDelay??U_,L=typeof K=="function"?K(i,N):K,U=H===!0||typeof H=="number"&&i<H||typeof H=="function"&&H(i,N);if(a||!U){w(N);return}i++,(I=r.onFail)==null||I.call(r,i,N),N_(L).then(()=>m()?void 0:_()).then(()=>{a?w(N):C()})})};return{promise:o,status:()=>o.status,cancel:f,continue:()=>(l==null||l(),o),cancelRetry:v,continueRetry:y,canStart:g,start:()=>(g()?C():_().then(C),o)}}var $r,wb,ex=(wb=class{constructor(){oe(this,$r)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uh(this.gcTime)&&ae(this,$r,Wr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(Gl.isServer()?1/0:300*1e3))}clearGcTimeout(){T(this,$r)&&(Wr.clearTimeout(T(this,$r)),ae(this,$r,void 0))}},$r=new WeakMap,wb),ei,ms,ya,ti,yt,Ql,ai,aa,tx,hn,Sb,H_=(Sb=class extends ex{constructor(a){super();oe(this,aa);oe(this,ei);oe(this,ms);oe(this,ya);oe(this,ti);oe(this,yt);oe(this,Ql);oe(this,ai);ae(this,ai,!1),ae(this,Ql,a.defaultOptions),this.setOptions(a.options),this.observers=[],ae(this,ti,a.client),ae(this,ya,T(this,ti).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,ae(this,ei,_v(this.options)),this.state=a.state??T(this,ei),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var a;return(a=T(this,yt))==null?void 0:a.promise}setOptions(a){if(this.options={...T(this,Ql),...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=_v(this.options);i.data!==void 0&&(this.setState(Sv(i.data,i.dataUpdatedAt)),ae(this,ei,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,ya).remove(this)}setData(a,i){const l=Lh(this.state.data,a,this.options);return Se(this,aa,hn).call(this,{data:l,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),l}setState(a,i){Se(this,aa,hn).call(this,{type:"setState",state:a,setStateOptions:i})}cancel(a){var l,o;const i=(l=T(this,yt))==null?void 0:l.promise;return(o=T(this,yt))==null||o.cancel(a),i?i.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return T(this,ei)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>ga(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>gr(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!Xb(this.state.dataUpdatedAt,a)}onFocus(){var i;const a=this.observers.find(l=>l.shouldFetchOnWindowFocus());a==null||a.refetch({cancelRefetch:!1}),(i=T(this,yt))==null||i.continue()}onOnline(){var i;const a=this.observers.find(l=>l.shouldFetchOnReconnect());a==null||a.refetch({cancelRefetch:!1}),(i=T(this,yt))==null||i.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),T(this,ya).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(T(this,yt)&&(T(this,ai)||Se(this,aa,tx).call(this)?T(this,yt).cancel({revert:!0}):T(this,yt).cancelRetry()),this.scheduleGc()),T(this,ya).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,aa,hn).call(this,{type:"invalidate"})}async fetch(a,i){var y,m,g,b,w,_,C,E,S,N,H,K;if(this.state.fetchStatus!=="idle"&&((y=T(this,yt))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(T(this,yt))return T(this,yt).continueRetry(),T(this,yt).promise}if(a&&this.setOptions(a),!this.options.queryFn){const L=this.observers.find(U=>U.options.queryFn);L&&this.setOptions(L.options)}const l=new AbortController,o=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(ae(this,ai,!0),l.signal)})},d=()=>{const L=Ib(this.options,i),I=(()=>{const $={client:T(this,ti),queryKey:this.queryKey,meta:this.meta};return o($),$})();return ae(this,ai,!1),this.options.persister?this.options.persister(L,I,this):L(I)},v=(()=>{const L={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:T(this,ti),state:this.state,fetchFn:d};return o(L),L})();(m=this.options.behavior)==null||m.onFetch(v,this),ae(this,ms,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=v.fetchOptions)==null?void 0:g.meta))&&Se(this,aa,hn).call(this,{type:"fetch",meta:(b=v.fetchOptions)==null?void 0:b.meta}),ae(this,yt,$b({initialPromise:i==null?void 0:i.initialPromise,fn:v.fetchFn,onCancel:L=>{L instanceof qh&&L.revert&&this.setState({...T(this,ms),fetchStatus:"idle"}),l.abort()},onFail:(L,U)=>{Se(this,aa,hn).call(this,{type:"failed",failureCount:L,error:U})},onPause:()=>{Se(this,aa,hn).call(this,{type:"pause"})},onContinue:()=>{Se(this,aa,hn).call(this,{type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode,canRun:()=>!0}));try{const L=await T(this,yt).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(_=(w=T(this,ya).config).onSuccess)==null||_.call(w,L,this),(E=(C=T(this,ya).config).onSettled)==null||E.call(C,L,this.state.error,this),L}catch(L){if(L instanceof qh){if(L.silent)return T(this,yt).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw Se(this,aa,hn).call(this,{type:"error",error:L}),(N=(S=T(this,ya).config).onError)==null||N.call(S,L,this),(K=(H=T(this,ya).config).onSettled)==null||K.call(H,this.state.data,L,this),L}finally{this.scheduleGc()}}},ei=new WeakMap,ms=new WeakMap,ya=new WeakMap,ti=new WeakMap,yt=new WeakMap,Ql=new WeakMap,ai=new WeakMap,aa=new WeakSet,tx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},hn=function(a){const i=l=>{switch(a.type){case"failed":return{...l,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,...ax(l.data,this.options),fetchMeta:a.meta??null};case"success":const o={...l,...Sv(a.data,a.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ae(this,ms,a.manual?o:void 0),o;case"error":const d=a.error;return{...l,error:d,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...a.state}}};this.state=i(this.state),ft.batch(()=>{this.observers.forEach(l=>{l.onQueryUpdate()}),T(this,ya).notify({query:this,type:"updated",action:a})})},Sb);function ax(r,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fb(a.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function Sv(r,a){return{data:r,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _v(r){const a=typeof r.initialData=="function"?r.initialData():r.initialData,i=a!==void 0,l=i?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Gt,Ne,Jl,Rt,ni,ps,mn,ur,Xl,ys,gs,ri,ii,dr,vs,Ue,Ol,Bh,Gh,Ph,Zh,Yh,Vh,Qh,nx,_b,L_=(_b=class extends js{constructor(a,i){super();oe(this,Ue);oe(this,Gt);oe(this,Ne);oe(this,Jl);oe(this,Rt);oe(this,ni);oe(this,ps);oe(this,mn);oe(this,ur);oe(this,Xl);oe(this,ys);oe(this,gs);oe(this,ri);oe(this,ii);oe(this,dr);oe(this,vs,new Set);this.options=i,ae(this,Gt,a),ae(this,ur,null),ae(this,mn,Kh()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Ne).addObserver(this),Ev(T(this,Ne),this.options)?Se(this,Ue,Ol).call(this):this.updateResult(),Se(this,Ue,Zh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jh(T(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jh(T(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,Ue,Yh).call(this),Se(this,Ue,Vh).call(this),T(this,Ne).removeObserver(this)}setOptions(a){const i=this.options,l=T(this,Ne);if(this.options=T(this,Gt).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ga(this.options.enabled,T(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,Ue,Qh).call(this),T(this,Ne).setOptions(this.options),i._defaulted&&!iu(this.options,i)&&T(this,Gt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Ne),observer:this});const o=this.hasListeners();o&&kv(T(this,Ne),l,this.options,i)&&Se(this,Ue,Ol).call(this),this.updateResult(),o&&(T(this,Ne)!==l||ga(this.options.enabled,T(this,Ne))!==ga(i.enabled,T(this,Ne))||gr(this.options.staleTime,T(this,Ne))!==gr(i.staleTime,T(this,Ne)))&&Se(this,Ue,Bh).call(this);const d=Se(this,Ue,Gh).call(this);o&&(T(this,Ne)!==l||ga(this.options.enabled,T(this,Ne))!==ga(i.enabled,T(this,Ne))||d!==T(this,dr))&&Se(this,Ue,Ph).call(this,d)}getOptimisticResult(a){const i=T(this,Gt).getQueryCache().build(T(this,Gt),a),l=this.createResult(i,a);return q_(this,l)&&(ae(this,Rt,l),ae(this,ps,this.options),ae(this,ni,T(this,Ne).state)),l}getCurrentResult(){return T(this,Rt)}trackResult(a,i){return new Proxy(a,{get:(l,o)=>(this.trackProp(o),i==null||i(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&T(this,mn).status==="pending"&&T(this,mn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(l,o))})}trackProp(a){T(this,vs).add(a)}getCurrentQuery(){return T(this,Ne)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const i=T(this,Gt).defaultQueryOptions(a),l=T(this,Gt).getQueryCache().build(T(this,Gt),i);return l.fetch().then(()=>this.createResult(l,i))}fetch(a){return Se(this,Ue,Ol).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Rt)))}createResult(a,i){var X;const l=T(this,Ne),o=this.options,d=T(this,Rt),f=T(this,ni),v=T(this,ps),m=a!==l?a.state:T(this,Jl),{state:g}=a;let b={...g},w=!1,_;if(i._optimisticResults){const ie=this.hasListeners(),W=!ie&&Ev(a,i),Q=ie&&kv(a,l,i,o);(W||Q)&&(b={...b,...ax(g.data,a.options)}),i._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:C,errorUpdatedAt:E,status:S}=b;_=b.data;let N=!1;if(i.placeholderData!==void 0&&_===void 0&&S==="pending"){let ie;d!=null&&d.isPlaceholderData&&i.placeholderData===(v==null?void 0:v.placeholderData)?(ie=d.data,N=!0):ie=typeof i.placeholderData=="function"?i.placeholderData((X=T(this,gs))==null?void 0:X.state.data,T(this,gs)):i.placeholderData,ie!==void 0&&(S="success",_=Lh(d==null?void 0:d.data,ie,i),w=!0)}if(i.select&&_!==void 0&&!N)if(d&&_===(f==null?void 0:f.data)&&i.select===T(this,Xl))_=T(this,ys);else try{ae(this,Xl,i.select),_=i.select(_),_=Lh(d==null?void 0:d.data,_,i),ae(this,ys,_),ae(this,ur,null)}catch(ie){ae(this,ur,ie)}T(this,ur)&&(C=T(this,ur),_=T(this,ys),E=Date.now(),S="error");const H=b.fetchStatus==="fetching",K=S==="pending",L=S==="error",U=K&&H,I=_!==void 0,ee={status:S,fetchStatus:b.fetchStatus,isPending:K,isSuccess:S==="success",isError:L,isInitialLoading:U,isLoading:U,data:_,dataUpdatedAt:b.dataUpdatedAt,error:C,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:H,isRefetching:H&&!K,isLoadingError:L&&!I,isPaused:b.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:L&&I,isStale:Am(a,i),refetch:this.refetch,promise:T(this,mn),isEnabled:ga(i.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const ie=ee.data!==void 0,W=ee.status==="error"&&!ie,Q=xe=>{W?xe.reject(ee.error):ie&&xe.resolve(ee.data)},pe=()=>{const xe=ae(this,mn,ee.promise=Kh());Q(xe)},de=T(this,mn);switch(de.status){case"pending":a.queryHash===l.queryHash&&Q(de);break;case"fulfilled":(W||ee.data!==de.value)&&pe();break;case"rejected":(!W||ee.error!==de.reason)&&pe();break}}return ee}updateResult(){const a=T(this,Rt),i=this.createResult(T(this,Ne),this.options);if(ae(this,ni,T(this,Ne).state),ae(this,ps,this.options),T(this,ni).data!==void 0&&ae(this,gs,T(this,Ne)),iu(i,a))return;ae(this,Rt,i);const l=()=>{if(!a)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!T(this,vs).size)return!0;const f=new Set(d??T(this,vs));return this.options.throwOnError&&f.add("error"),Object.keys(T(this,Rt)).some(v=>{const y=v;return T(this,Rt)[y]!==a[y]&&f.has(y)})};Se(this,Ue,nx).call(this,{listeners:l()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,Ue,Zh).call(this)}},Gt=new WeakMap,Ne=new WeakMap,Jl=new WeakMap,Rt=new WeakMap,ni=new WeakMap,ps=new WeakMap,mn=new WeakMap,ur=new WeakMap,Xl=new WeakMap,ys=new WeakMap,gs=new WeakMap,ri=new WeakMap,ii=new WeakMap,dr=new WeakMap,vs=new WeakMap,Ue=new WeakSet,Ol=function(a){Se(this,Ue,Qh).call(this);let i=T(this,Ne).fetch(this.options,a);return a!=null&&a.throwOnError||(i=i.catch(Ot)),i},Bh=function(){Se(this,Ue,Yh).call(this);const a=gr(this.options.staleTime,T(this,Ne));if(Gl.isServer()||T(this,Rt).isStale||!Uh(a))return;const l=Xb(T(this,Rt).dataUpdatedAt,a)+1;ae(this,ri,Wr.setTimeout(()=>{T(this,Rt).isStale||this.updateResult()},l))},Gh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Ne)):this.options.refetchInterval)??!1},Ph=function(a){Se(this,Ue,Vh).call(this),ae(this,dr,a),!(Gl.isServer()||ga(this.options.enabled,T(this,Ne))===!1||!Uh(T(this,dr))||T(this,dr)===0)&&ae(this,ii,Wr.setInterval(()=>{(this.options.refetchIntervalInBackground||Em.isFocused())&&Se(this,Ue,Ol).call(this)},T(this,dr)))},Zh=function(){Se(this,Ue,Bh).call(this),Se(this,Ue,Ph).call(this,Se(this,Ue,Gh).call(this))},Yh=function(){T(this,ri)&&(Wr.clearTimeout(T(this,ri)),ae(this,ri,void 0))},Vh=function(){T(this,ii)&&(Wr.clearInterval(T(this,ii)),ae(this,ii,void 0))},Qh=function(){const a=T(this,Gt).getQueryCache().build(T(this,Gt),this.options);if(a===T(this,Ne))return;const i=T(this,Ne);ae(this,Ne,a),ae(this,Jl,a.state),this.hasListeners()&&(i==null||i.removeObserver(this),a.addObserver(this))},nx=function(a){ft.batch(()=>{a.listeners&&this.listeners.forEach(i=>{i(T(this,Rt))}),T(this,Gt).getQueryCache().notify({query:T(this,Ne),type:"observerResultsUpdated"})})},_b);function K_(r,a){return ga(a.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&a.retryOnMount===!1)}function Ev(r,a){return K_(r,a)||r.state.data!==void 0&&Jh(r,a,a.refetchOnMount)}function Jh(r,a,i){if(ga(a.enabled,r)!==!1&&gr(a.staleTime,r)!=="static"){const l=typeof i=="function"?i(r):i;return l==="always"||l!==!1&&Am(r,a)}return!1}function kv(r,a,i,l){return(r!==a||ga(l.enabled,r)===!1)&&(!i.suspense||r.state.status!=="error")&&Am(r,i)}function Am(r,a){return ga(a.enabled,r)!==!1&&r.isStaleByTime(gr(a.staleTime,r))}function q_(r,a){return!iu(r.getCurrentResult(),a)}function Tv(r){return{onFetch:(a,i)=>{var g,b,w,_,C;const l=a.options,o=(w=(b=(g=a.fetchOptions)==null?void 0:g.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,d=((_=a.state.data)==null?void 0:_.pages)||[],f=((C=a.state.data)==null?void 0:C.pageParams)||[];let v={pages:[],pageParams:[]},y=0;const m=async()=>{let E=!1;const S=K=>{O_(K,()=>a.signal,()=>E=!0)},N=Ib(a.options,a.fetchOptions),H=async(K,L,U)=>{if(E)return Promise.reject();if(L==null&&K.pages.length)return Promise.resolve(K);const $=(()=>{const W={client:a.client,queryKey:a.queryKey,pageParam:L,direction:U?"backward":"forward",meta:a.options.meta};return S(W),W})(),ee=await N($),{maxPages:X}=a.options,ie=U?R_:C_;return{pages:ie(K.pages,ee,X),pageParams:ie(K.pageParams,L,X)}};if(o&&d.length){const K=o==="backward",L=K?B_:jv,U={pages:d,pageParams:f},I=L(l,U);v=await H(U,I,K)}else{const K=r??d.length;do{const L=y===0?f[0]??l.initialPageParam:jv(l,v);if(y>0&&L==null)break;v=await H(v,L),y++}while(y<K)}return v};a.options.persister?a.fetchFn=()=>{var E,S;return(S=(E=a.options).persister)==null?void 0:S.call(E,m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i)}:a.fetchFn=m}}}function jv(r,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?r.getNextPageParam(a[l],a,i[l],i):void 0}function B_(r,{pages:a,pageParams:i}){var l;return a.length>0?(l=r.getPreviousPageParam)==null?void 0:l.call(r,a[0],a,i[0],i):void 0}var Wl,La,Tt,si,Ka,nr,Eb,G_=(Eb=class extends ex{constructor(a){super();oe(this,Ka);oe(this,Wl);oe(this,La);oe(this,Tt);oe(this,si);ae(this,Wl,a.client),this.mutationId=a.mutationId,ae(this,Tt,a.mutationCache),ae(this,La,[]),this.state=a.state||rx(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){T(this,La).includes(a)||(T(this,La).push(a),this.clearGcTimeout(),T(this,Tt).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){ae(this,La,T(this,La).filter(i=>i!==a)),this.scheduleGc(),T(this,Tt).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){T(this,La).length||(this.state.status==="pending"?this.scheduleGc():T(this,Tt).remove(this))}continue(){var a;return((a=T(this,si))==null?void 0:a.continue())??this.execute(this.state.variables)}async execute(a){var f,v,y,m,g,b,w,_,C,E,S,N,H,K,L,U,I,$;const i=()=>{Se(this,Ka,nr).call(this,{type:"continue"})},l={client:T(this,Wl),meta:this.options.meta,mutationKey:this.options.mutationKey};ae(this,si,$b({fn:()=>this.options.mutationFn?this.options.mutationFn(a,l):Promise.reject(new Error("No mutationFn found")),onFail:(ee,X)=>{Se(this,Ka,nr).call(this,{type:"failed",failureCount:ee,error:X})},onPause:()=>{Se(this,Ka,nr).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Tt).canRun(this)}));const o=this.state.status==="pending",d=!T(this,si).canStart();try{if(o)i();else{Se(this,Ka,nr).call(this,{type:"pending",variables:a,isPaused:d}),T(this,Tt).config.onMutate&&await T(this,Tt).config.onMutate(a,this,l);const X=await((v=(f=this.options).onMutate)==null?void 0:v.call(f,a,l));X!==this.state.context&&Se(this,Ka,nr).call(this,{type:"pending",context:X,variables:a,isPaused:d})}const ee=await T(this,si).start();return await((m=(y=T(this,Tt).config).onSuccess)==null?void 0:m.call(y,ee,a,this.state.context,this,l)),await((b=(g=this.options).onSuccess)==null?void 0:b.call(g,ee,a,this.state.context,l)),await((_=(w=T(this,Tt).config).onSettled)==null?void 0:_.call(w,ee,null,this.state.variables,this.state.context,this,l)),await((E=(C=this.options).onSettled)==null?void 0:E.call(C,ee,null,a,this.state.context,l)),Se(this,Ka,nr).call(this,{type:"success",data:ee}),ee}catch(ee){try{await((N=(S=T(this,Tt).config).onError)==null?void 0:N.call(S,ee,a,this.state.context,this,l))}catch(X){Promise.reject(X)}try{await((K=(H=this.options).onError)==null?void 0:K.call(H,ee,a,this.state.context,l))}catch(X){Promise.reject(X)}try{await((U=(L=T(this,Tt).config).onSettled)==null?void 0:U.call(L,void 0,ee,this.state.variables,this.state.context,this,l))}catch(X){Promise.reject(X)}try{await(($=(I=this.options).onSettled)==null?void 0:$.call(I,void 0,ee,a,this.state.context,l))}catch(X){Promise.reject(X)}throw Se(this,Ka,nr).call(this,{type:"error",error:ee}),ee}finally{T(this,Tt).runNext(this)}}},Wl=new WeakMap,La=new WeakMap,Tt=new WeakMap,si=new WeakMap,Ka=new WeakSet,nr=function(a){const i=l=>{switch(a.type){case"failed":return{...l,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...l,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:a.error,failureCount:l.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),ft.batch(()=>{T(this,La).forEach(l=>{l.onMutationUpdate(a)}),T(this,Tt).notify({mutation:this,type:"updated",action:a})})},Eb);function rx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pn,Ta,Il,kb,P_=(kb=class extends js{constructor(a={}){super();oe(this,pn);oe(this,Ta);oe(this,Il);this.config=a,ae(this,pn,new Set),ae(this,Ta,new Map),ae(this,Il,0)}build(a,i,l){const o=new G_({client:a,mutationCache:this,mutationId:++Oc(this,Il)._,options:a.defaultMutationOptions(i),state:l});return this.add(o),o}add(a){T(this,pn).add(a);const i=zc(a);if(typeof i=="string"){const l=T(this,Ta).get(i);l?l.push(a):T(this,Ta).set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(T(this,pn).delete(a)){const i=zc(a);if(typeof i=="string"){const l=T(this,Ta).get(i);if(l)if(l.length>1){const o=l.indexOf(a);o!==-1&&l.splice(o,1)}else l[0]===a&&T(this,Ta).delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=zc(a);if(typeof i=="string"){const l=T(this,Ta).get(i),o=l==null?void 0:l.find(d=>d.state.status==="pending");return!o||o===a}else return!0}runNext(a){var l;const i=zc(a);if(typeof i=="string"){const o=(l=T(this,Ta).get(i))==null?void 0:l.find(d=>d!==a&&d.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ft.batch(()=>{T(this,pn).forEach(a=>{this.notify({type:"removed",mutation:a})}),T(this,pn).clear(),T(this,Ta).clear()})}getAll(){return Array.from(T(this,pn))}find(a){const i={exact:!0,...a};return this.getAll().find(l=>bv(i,l))}findAll(a={}){return this.getAll().filter(i=>bv(a,i))}notify(a){ft.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return ft.batch(()=>Promise.all(a.map(i=>i.continue().catch(Ot))))}},pn=new WeakMap,Ta=new WeakMap,Il=new WeakMap,kb);function zc(r){var a;return(a=r.options.scope)==null?void 0:a.id}var yn,fr,Pt,gn,xn,$c,Xh,Tb,Z_=(Tb=class extends js{constructor(i,l){super();oe(this,xn);oe(this,yn);oe(this,fr);oe(this,Pt);oe(this,gn);ae(this,yn,i),this.setOptions(l),this.bindMethods(),Se(this,xn,$c).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var o;const l=this.options;this.options=T(this,yn).defaultMutationOptions(i),iu(this.options,l)||T(this,yn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Pt),observer:this}),l!=null&&l.mutationKey&&this.options.mutationKey&&oi(l.mutationKey)!==oi(this.options.mutationKey)?this.reset():((o=T(this,Pt))==null?void 0:o.state.status)==="pending"&&T(this,Pt).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=T(this,Pt))==null||i.removeObserver(this)}onMutationUpdate(i){Se(this,xn,$c).call(this),Se(this,xn,Xh).call(this,i)}getCurrentResult(){return T(this,fr)}reset(){var i;(i=T(this,Pt))==null||i.removeObserver(this),ae(this,Pt,void 0),Se(this,xn,$c).call(this),Se(this,xn,Xh).call(this)}mutate(i,l){var o;return ae(this,gn,l),(o=T(this,Pt))==null||o.removeObserver(this),ae(this,Pt,T(this,yn).getMutationCache().build(T(this,yn),this.options)),T(this,Pt).addObserver(this),T(this,Pt).execute(i)}},yn=new WeakMap,fr=new WeakMap,Pt=new WeakMap,gn=new WeakMap,xn=new WeakSet,$c=function(){var l;const i=((l=T(this,Pt))==null?void 0:l.state)??rx();ae(this,fr,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},Xh=function(i){ft.batch(()=>{var l,o,d,f,v,y,m,g;if(T(this,gn)&&this.hasListeners()){const b=T(this,fr).variables,w=T(this,fr).context,_={client:T(this,yn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(o=(l=T(this,gn)).onSuccess)==null||o.call(l,i.data,b,w,_)}catch(C){Promise.reject(C)}try{(f=(d=T(this,gn)).onSettled)==null||f.call(d,i.data,null,b,w,_)}catch(C){Promise.reject(C)}}else if((i==null?void 0:i.type)==="error"){try{(y=(v=T(this,gn)).onError)==null||y.call(v,i.error,b,w,_)}catch(C){Promise.reject(C)}try{(g=(m=T(this,gn)).onSettled)==null||g.call(m,void 0,i.error,b,w,_)}catch(C){Promise.reject(C)}}}this.listeners.forEach(b=>{b(T(this,fr))})})},Tb),qa,jb,Y_=(jb=class extends js{constructor(a={}){super();oe(this,qa);this.config=a,ae(this,qa,new Map)}build(a,i,l){const o=i.queryKey,d=i.queryHash??km(o,i);let f=this.get(d);return f||(f=new H_({client:a,queryKey:o,queryHash:d,options:a.defaultQueryOptions(i),state:l,defaultOptions:a.getQueryDefaults(o)}),this.add(f)),f}add(a){T(this,qa).has(a.queryHash)||(T(this,qa).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=T(this,qa).get(a.queryHash);i&&(a.destroy(),i===a&&T(this,qa).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){ft.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return T(this,qa).get(a)}getAll(){return[...T(this,qa).values()]}find(a){const i={exact:!0,...a};return this.getAll().find(l=>vv(i,l))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(l=>vv(a,l)):i}notify(a){ft.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},qa=new WeakMap,jb),at,hr,mr,bs,xs,pr,ws,Ss,Ab,V_=(Ab=class{constructor(r={}){oe(this,at);oe(this,hr);oe(this,mr);oe(this,bs);oe(this,xs);oe(this,pr);oe(this,ws);oe(this,Ss);ae(this,at,r.queryCache||new Y_),ae(this,hr,r.mutationCache||new P_),ae(this,mr,r.defaultOptions||{}),ae(this,bs,new Map),ae(this,xs,new Map),ae(this,pr,0)}mount(){Oc(this,pr)._++,T(this,pr)===1&&(ae(this,ws,Em.subscribe(async r=>{r&&(await this.resumePausedMutations(),T(this,at).onFocus())})),ae(this,Ss,su.subscribe(async r=>{r&&(await this.resumePausedMutations(),T(this,at).onOnline())})))}unmount(){var r,a;Oc(this,pr)._--,T(this,pr)===0&&((r=T(this,ws))==null||r.call(this),ae(this,ws,void 0),(a=T(this,Ss))==null||a.call(this),ae(this,Ss,void 0))}isFetching(r){return T(this,at).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return T(this,hr).findAll({...r,status:"pending"}).length}getQueryData(r){var i;const a=this.defaultQueryOptions({queryKey:r});return(i=T(this,at).get(a.queryHash))==null?void 0:i.state.data}ensureQueryData(r){const a=this.defaultQueryOptions(r),i=T(this,at).build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(r):(r.revalidateIfStale&&i.isStaleByTime(gr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(r){return T(this,at).findAll(r).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(r,a,i){const l=this.defaultQueryOptions({queryKey:r}),o=T(this,at).get(l.queryHash),d=o==null?void 0:o.state.data,f=j_(a,d);if(f!==void 0)return T(this,at).build(this,l).setData(f,{...i,manual:!0})}setQueriesData(r,a,i){return ft.batch(()=>T(this,at).findAll(r).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(r){var i;const a=this.defaultQueryOptions({queryKey:r});return(i=T(this,at).get(a.queryHash))==null?void 0:i.state}removeQueries(r){const a=T(this,at);ft.batch(()=>{a.findAll(r).forEach(i=>{a.remove(i)})})}resetQueries(r,a){const i=T(this,at);return ft.batch(()=>(i.findAll(r).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...r},a)))}cancelQueries(r,a={}){const i={revert:!0,...a},l=ft.batch(()=>T(this,at).findAll(r).map(o=>o.cancel(i)));return Promise.all(l).then(Ot).catch(Ot)}invalidateQueries(r,a={}){return ft.batch(()=>(T(this,at).findAll(r).forEach(i=>{i.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},a)))}refetchQueries(r,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=ft.batch(()=>T(this,at).findAll(r).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let d=o.fetch(void 0,i);return i.throwOnError||(d=d.catch(Ot)),o.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(l).then(Ot)}fetchQuery(r){const a=this.defaultQueryOptions(r);a.retry===void 0&&(a.retry=!1);const i=T(this,at).build(this,a);return i.isStaleByTime(gr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(Ot).catch(Ot)}fetchInfiniteQuery(r){return r.behavior=Tv(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(Ot).catch(Ot)}ensureInfiniteQueryData(r){return r.behavior=Tv(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return su.isOnline()?T(this,hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,at)}getMutationCache(){return T(this,hr)}getDefaultOptions(){return T(this,mr)}setDefaultOptions(r){ae(this,mr,r)}setQueryDefaults(r,a){T(this,bs).set(oi(r),{queryKey:r,defaultOptions:a})}getQueryDefaults(r){const a=[...T(this,bs).values()],i={};return a.forEach(l=>{Bl(r,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(r,a){T(this,xs).set(oi(r),{mutationKey:r,defaultOptions:a})}getMutationDefaults(r){const a=[...T(this,xs).values()],i={};return a.forEach(l=>{Bl(r,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(r){if(r._defaulted)return r;const a={...T(this,mr).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return a.queryHash||(a.queryHash=km(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Tm&&(a.enabled=!1),a}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...T(this,mr).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){T(this,at).clear(),T(this,hr).clear()}},at=new WeakMap,hr=new WeakMap,mr=new WeakMap,bs=new WeakMap,xs=new WeakMap,pr=new WeakMap,ws=new WeakMap,Ss=new WeakMap,Ab),ix=A.createContext(void 0),En=r=>{const a=A.useContext(ix);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},Q_=({client:r,children:a})=>(A.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),h.jsx(ix.Provider,{value:r,children:a})),sx=A.createContext(!1),J_=()=>A.useContext(sx);sx.Provider;function X_(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var W_=A.createContext(X_()),I_=()=>A.useContext(W_),F_=(r,a,i)=>{const l=i!=null&&i.state.error&&typeof r.throwOnError=="function"?jm(r.throwOnError,[i.state.error,i]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||l)&&(a.isReset()||(r.retryOnMount=!1))},$_=r=>{A.useEffect(()=>{r.clearReset()},[r])},eE=({result:r,errorResetBoundary:a,throwOnError:i,query:l,suspense:o})=>r.isError&&!a.isReset()&&!r.isFetching&&l&&(o&&r.data===void 0||jm(i,[r.error,l])),tE=r=>{if(r.suspense){const i=o=>o==="static"?o:Math.max(o??1e3,1e3),l=r.staleTime;r.staleTime=typeof l=="function"?(...o)=>i(l(...o)):i(l),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},aE=(r,a)=>r.isLoading&&r.isFetching&&!a,nE=(r,a)=>(r==null?void 0:r.suspense)&&a.isPending,Av=(r,a,i)=>a.fetchOptimistic(r).catch(()=>{i.clearReset()});function rE(r,a,i){var w,_,C,E;const l=J_(),o=I_(),d=En(),f=d.defaultQueryOptions(r);(_=(w=d.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||_.call(w,f);const v=d.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",tE(f),F_(f,o,v),$_(o);const y=!d.getQueryCache().get(f.queryHash),[m]=A.useState(()=>new a(d,f)),g=m.getOptimisticResult(f),b=!l&&r.subscribed!==!1;if(A.useSyncExternalStore(A.useCallback(S=>{const N=b?m.subscribe(ft.batchCalls(S)):Ot;return m.updateResult(),N},[m,b]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),A.useEffect(()=>{m.setOptions(f)},[f,m]),nE(f,g))throw Av(f,m,o);if(eE({result:g,errorResetBoundary:o,throwOnError:f.throwOnError,query:v,suspense:f.suspense}))throw g.error;if((E=(C=d.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||E.call(C,f,g),f.experimental_prefetchInRender&&!Gl.isServer()&&aE(g,l)){const S=y?Av(f,m,o):v==null?void 0:v.promise;S==null||S.catch(Ot).finally(()=>{m.updateResult()})}return f.notifyOnChangeProps?g:m.trackResult(g)}function ao(r,a){return rE(r,L_)}function ui(r,a){const i=En(),[l]=A.useState(()=>new Z_(i,r));A.useEffect(()=>{l.setOptions(r)},[l,r]);const o=A.useSyncExternalStore(A.useCallback(f=>l.subscribe(ft.batchCalls(f)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d=A.useCallback((f,v)=>{l.mutate(f,v).catch(Ot)},[l]);if(o.error&&jm(l.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:d,mutateAsync:o.mutate}}const lx=A.createContext({currentTheme:"light",changeCurrentTheme:()=>{}});function iE({children:r}){const a=localStorage.getItem("theme"),[i,l]=A.useState(a||"light"),o=d=>{l(d),localStorage.setItem("theme",d)};return A.useEffect(()=>{document.documentElement.classList.add("**:transition-none!"),i==="light"?(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light"):(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark");const d=setTimeout(()=>{document.documentElement.classList.remove("**:transition-none!")},1);return()=>clearTimeout(d)},[i]),h.jsx(lx.Provider,{value:{currentTheme:i,changeCurrentTheme:o},children:r})}const sE=()=>A.useContext(lx);var Wh=function(r,a){return Wh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i[o]=l[o])},Wh(r,a)};function lE(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");Wh(r,a);function i(){this.constructor=r}r.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}var gt=function(){return gt=Object.assign||function(a){for(var i,l=1,o=arguments.length;l<o;l++){i=arguments[l];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(a[d]=i[d])}return a},gt.apply(this,arguments)};function Nv(r,a){var i={};for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&a.indexOf(l)<0&&(i[l]=r[l]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(r);o<l.length;o++)a.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(r,l[o])&&(i[l[o]]=r[l[o]]);return i}function Fn(r,a,i,l){function o(d){return d instanceof i?d:new i(function(f){f(d)})}return new(i||(i=Promise))(function(d,f){function v(g){try{m(l.next(g))}catch(b){f(b)}}function y(g){try{m(l.throw(g))}catch(b){f(b)}}function m(g){g.done?d(g.value):o(g.value).then(v,y)}m((l=l.apply(r,a||[])).next())})}function $n(r,a){var i={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},l,o,d,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=v(0),f.throw=v(1),f.return=v(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function v(m){return function(g){return y([m,g])}}function y(m){if(l)throw new TypeError("Generator is already executing.");for(;f&&(f=0,m[0]&&(i=0)),i;)try{if(l=1,o&&(d=m[0]&2?o.return:m[0]?o.throw||((d=o.return)&&d.call(o),0):o.next)&&!(d=d.call(o,m[1])).done)return d;switch(o=0,d&&(m=[m[0]&2,d.value]),m[0]){case 0:case 1:d=m;break;case 4:return i.label++,{value:m[1],done:!1};case 5:i.label++,o=m[1],m=[0];continue;case 7:m=i.ops.pop(),i.trys.pop();continue;default:if(d=i.trys,!(d=d.length>0&&d[d.length-1])&&(m[0]===6||m[0]===2)){i=0;continue}if(m[0]===3&&(!d||m[1]>d[0]&&m[1]<d[3])){i.label=m[1];break}if(m[0]===6&&i.label<d[1]){i.label=d[1],d=m;break}if(d&&i.label<d[2]){i.label=d[2],i.ops.push(m);break}d[2]&&i.ops.pop(),i.trys.pop();continue}m=a.call(r,i)}catch(g){m=[6,g],o=0}finally{l=d=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function oE(r,a,i){for(var l=0,o=a.length,d;l<o;l++)(d||!(l in a))&&(d||(d=Array.prototype.slice.call(a,0,l)),d[l]=a[l]);return r.concat(d||Array.prototype.slice.call(a))}function ja(r,a){var i={};for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&a.indexOf(l)<0&&(i[l]=r[l]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(l=Object.getOwnPropertySymbols(r);o<l.length;o++)a.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(r,l[o])&&(i[l[o]]=r[l[o]])}return i}const cE={timeoutInSeconds:60},Cv="memory",ox={name:"auth0-spa-js",version:"2.18.0"},cx=()=>Date.now(),Bt="default";class Ve extends Error{constructor(a,i){super(i),this.error=a,this.error_description=i,Object.setPrototypeOf(this,Ve.prototype)}static fromPayload(a){let{error:i,error_description:l}=a;return new Ve(i,l)}}class Nm extends Ve{constructor(a,i,l){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(a,i),this.state=l,this.appState=o,Object.setPrototypeOf(this,Nm.prototype)}}class Cm extends Ve{constructor(a,i,l,o){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(a,i),this.connection=l,this.state=o,this.appState=d,Object.setPrototypeOf(this,Cm.prototype)}}class As extends Ve{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,As.prototype)}}class Rm extends As{constructor(a){super(),this.popup=a,Object.setPrototypeOf(this,Rm.prototype)}}class Om extends Ve{constructor(a){super("cancelled","Popup closed"),this.popup=a,Object.setPrototypeOf(this,Om.prototype)}}class Dm extends Ve{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,Dm.prototype)}}class _s extends Ve{constructor(a,i,l,o){super(a,i),this.mfa_token=l,this.mfa_requirements=o,Object.setPrototypeOf(this,_s.prototype)}}class xu extends Ve{constructor(a,i){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(lu(a,["default"]),"', scope: '").concat(lu(i),"')")),this.audience=a,this.scope=i,Object.setPrototypeOf(this,xu.prototype)}}class zm extends Ve{constructor(a,i){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(lu(a,["default"]),"', missing scope: '").concat(lu(i),"')")),this.audience=a,this.scope=i,Object.setPrototypeOf(this,zm.prototype)}}class wu extends Ve{constructor(a){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=a,Object.setPrototypeOf(this,wu.prototype)}}function lu(r){return r&&!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).includes(r)?r:""}const ou=()=>window.crypto,Tl=()=>{const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let a="";for(;a.length<43;){const i=ou().getRandomValues(new Uint8Array(43-a.length));for(const l of i)a.length<43&&l<198&&(a+=r[l%66])}return a},nh=r=>btoa(r),uE=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],ux=function(r){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(r).reduce((i,l)=>{if(a&&l==="env")return i;const o=uE.find(d=>d.key===l);return o&&o.type.includes(typeof r[l])&&(i[l]=r[l]),i},{})},Ih=r=>{var{clientId:a}=r,i=ja(r,["clientId"]);return new URLSearchParams((l=>Object.keys(l).filter(o=>l[o]!==void 0).reduce((o,d)=>Object.assign(Object.assign({},o),{[d]:l[d]}),{}))(Object.assign({client_id:a},i))).toString()},Rv=async r=>await ou().subtle.digest({name:"SHA-256"},new TextEncoder().encode(r)),Ov=r=>(a=>decodeURIComponent(atob(a).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))(r.replace(/_/g,"/").replace(/-/g,"+")),Dv=r=>{const a=new Uint8Array(r);return(i=>{const l={"+":"-","/":"_","=":""};return i.replace(/[+/=]/g,o=>l[o])})(window.btoa(String.fromCharCode(...Array.from(a))))};var ci=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},dx={},Mm={};Object.defineProperty(Mm,"__esModule",{value:!0});var dE=(function(){function r(){var a=this;this.locked=new Map,this.addToLocked=function(i,l){var o=a.locked.get(i);o===void 0?l===void 0?a.locked.set(i,[]):a.locked.set(i,[l]):l!==void 0&&(o.unshift(l),a.locked.set(i,o))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(l,o){a.isLocked(i)?a.addToLocked(i,l):(a.addToLocked(i),l())})},this.unlock=function(i){var l=a.locked.get(i);if(l!==void 0&&l.length!==0){var o=l.pop();a.locked.set(i,l),o!==void 0&&setTimeout(o,0)}else a.locked.delete(i)}}return r.getInstance=function(){return r.instance===void 0&&(r.instance=new r),r.instance},r})();Mm.default=function(){return dE.getInstance()};var Aa=ci&&ci.__awaiter||function(r,a,i,l){return new(i||(i=Promise))(function(o,d){function f(m){try{y(l.next(m))}catch(g){d(g)}}function v(m){try{y(l.throw(m))}catch(g){d(g)}}function y(m){m.done?o(m.value):new i(function(g){g(m.value)}).then(f,v)}y((l=l.apply(r,a||[])).next())})},Na=ci&&ci.__generator||function(r,a){var i,l,o,d,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return d={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function v(y){return function(m){return(function(g){if(i)throw new TypeError("Generator is already executing.");for(;f;)try{if(i=1,l&&(o=2&g[0]?l.return:g[0]?l.throw||((o=l.return)&&o.call(l),0):l.next)&&!(o=o.call(l,g[1])).done)return o;switch(l=0,o&&(g=[2&g[0],o.value]),g[0]){case 0:case 1:o=g;break;case 4:return f.label++,{value:g[1],done:!1};case 5:f.label++,l=g[1],g=[0];continue;case 7:g=f.ops.pop(),f.trys.pop();continue;default:if(o=f.trys,!((o=o.length>0&&o[o.length-1])||g[0]!==6&&g[0]!==2)){f=0;continue}if(g[0]===3&&(!o||g[1]>o[0]&&g[1]<o[3])){f.label=g[1];break}if(g[0]===6&&f.label<o[1]){f.label=o[1],o=g;break}if(o&&f.label<o[2]){f.label=o[2],f.ops.push(g);break}o[2]&&f.ops.pop(),f.trys.pop();continue}g=a.call(r,f)}catch(b){g=[6,b],l=0}finally{i=o=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}})([y,m])}}},jl=ci;Object.defineProperty(dx,"__esModule",{value:!0});var Ii=Mm,rh="browser-tabs-lock-key",Mc={key:function(r){return Aa(jl,void 0,void 0,function(){return Na(this,function(a){throw new Error("Unsupported")})})},getItem:function(r){return Aa(jl,void 0,void 0,function(){return Na(this,function(a){throw new Error("Unsupported")})})},clear:function(){return Aa(jl,void 0,void 0,function(){return Na(this,function(r){return[2,window.localStorage.clear()]})})},removeItem:function(r){return Aa(jl,void 0,void 0,function(){return Na(this,function(a){throw new Error("Unsupported")})})},setItem:function(r,a){return Aa(jl,void 0,void 0,function(){return Na(this,function(i){throw new Error("Unsupported")})})},keySync:function(r){return window.localStorage.key(r)},getItemSync:function(r){return window.localStorage.getItem(r)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(r){return window.localStorage.removeItem(r)},setItemSync:function(r,a){return window.localStorage.setItem(r,a)}};function ih(r){return new Promise(function(a){return setTimeout(a,r)})}function sh(r){for(var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",l=0;l<r;l++)i+=a[Math.floor(61*Math.random())];return i}var fE=(function(){function r(a){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+sh(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=a,r.waiters===void 0&&(r.waiters=[])}return r.prototype.acquireLock=function(a,i){return i===void 0&&(i=5e3),Aa(this,void 0,void 0,function(){var l,o,d,f,v,y,m;return Na(this,function(g){switch(g.label){case 0:l=Date.now()+sh(4),o=Date.now()+i,d=rh+"-"+a,f=this.storageHandler===void 0?Mc:this.storageHandler,g.label=1;case 1:return Date.now()<o?[4,ih(30)]:[3,8];case 2:return g.sent(),f.getItemSync(d)!==null?[3,5]:(v=this.id+"-"+a+"-"+l,[4,ih(Math.floor(25*Math.random()))]);case 3:return g.sent(),f.setItemSync(d,JSON.stringify({id:this.id,iat:l,timeoutKey:v,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,ih(30)];case 4:return g.sent(),(y=f.getItemSync(d))!==null&&(m=JSON.parse(y)).id===this.id&&m.iat===l?(this.acquiredIatSet.add(l),this.refreshLockWhileAcquired(d,l),[2,!0]):[3,7];case 5:return r.lockCorrector(this.storageHandler===void 0?Mc:this.storageHandler),[4,this.waitForSomethingToChange(o)];case 6:g.sent(),g.label=7;case 7:return l=Date.now()+sh(4),[3,1];case 8:return[2,!1]}})})},r.prototype.refreshLockWhileAcquired=function(a,i){return Aa(this,void 0,void 0,function(){var l=this;return Na(this,function(o){return setTimeout(function(){return Aa(l,void 0,void 0,function(){var d,f,v;return Na(this,function(y){switch(y.label){case 0:return[4,Ii.default().lock(i)];case 1:return y.sent(),this.acquiredIatSet.has(i)?(d=this.storageHandler===void 0?Mc:this.storageHandler,(f=d.getItemSync(a))===null?(Ii.default().unlock(i),[2]):((v=JSON.parse(f)).timeRefreshed=Date.now(),d.setItemSync(a,JSON.stringify(v)),Ii.default().unlock(i),this.refreshLockWhileAcquired(a,i),[2])):(Ii.default().unlock(i),[2])}})})},1e3),[2]})})},r.prototype.waitForSomethingToChange=function(a){return Aa(this,void 0,void 0,function(){return Na(this,function(i){switch(i.label){case 0:return[4,new Promise(function(l){var o=!1,d=Date.now(),f=!1;function v(){if(f||(window.removeEventListener("storage",v),r.removeFromWaiting(v),clearTimeout(y),f=!0),!o){o=!0;var m=50-(Date.now()-d);m>0?setTimeout(l,m):l(null)}}window.addEventListener("storage",v),r.addToWaiting(v);var y=setTimeout(v,Math.max(0,a-Date.now()))})];case 1:return i.sent(),[2]}})})},r.addToWaiting=function(a){this.removeFromWaiting(a),r.waiters!==void 0&&r.waiters.push(a)},r.removeFromWaiting=function(a){r.waiters!==void 0&&(r.waiters=r.waiters.filter(function(i){return i!==a}))},r.notifyWaiters=function(){r.waiters!==void 0&&r.waiters.slice().forEach(function(a){return a()})},r.prototype.releaseLock=function(a){return Aa(this,void 0,void 0,function(){return Na(this,function(i){switch(i.label){case 0:return[4,this.releaseLock__private__(a)];case 1:return[2,i.sent()]}})})},r.prototype.releaseLock__private__=function(a){return Aa(this,void 0,void 0,function(){var i,l,o,d;return Na(this,function(f){switch(f.label){case 0:return i=this.storageHandler===void 0?Mc:this.storageHandler,l=rh+"-"+a,(o=i.getItemSync(l))===null?[2]:(d=JSON.parse(o)).id!==this.id?[3,2]:[4,Ii.default().lock(d.iat)];case 1:f.sent(),this.acquiredIatSet.delete(d.iat),i.removeItemSync(l),Ii.default().unlock(d.iat),r.notifyWaiters(),f.label=2;case 2:return[2]}})})},r.lockCorrector=function(a){for(var i=Date.now()-5e3,l=a,o=[],d=0;;){var f=l.keySync(d);if(f===null)break;o.push(f),d++}for(var v=!1,y=0;y<o.length;y++){var m=o[y];if(m.includes(rh)){var g=l.getItemSync(m);if(g!==null){var b=JSON.parse(g);(b.timeRefreshed===void 0&&b.timeAcquired<i||b.timeRefreshed!==void 0&&b.timeRefreshed<i)&&(l.removeItemSync(m),v=!0)}}}v&&r.notifyWaiters()},r.waiters=void 0,r})(),hE=dx.default=fE;class mE{async runWithLock(a,i,l){const o=new AbortController,d=setTimeout(()=>o.abort(),i);try{return await navigator.locks.request(a,{mode:"exclusive",signal:o.signal},async f=>{if(clearTimeout(d),!f)throw new Error("Lock not available");return await l()})}catch(f){throw clearTimeout(d),(f==null?void 0:f.name)==="AbortError"?new As:f}}}class pE{constructor(){this.activeLocks=new Set,this.lock=new hE,this.pagehideHandler=()=>{this.activeLocks.forEach(a=>this.lock.releaseLock(a)),this.activeLocks.clear()}}async runWithLock(a,i,l){let o=!1;for(let d=0;d<10&&!o;d++)o=await this.lock.acquireLock(a,i);if(!o)throw new As;this.activeLocks.add(a),this.activeLocks.size===1&&typeof window<"u"&&window.addEventListener("pagehide",this.pagehideHandler);try{return await l()}finally{this.activeLocks.delete(a),await this.lock.releaseLock(a),this.activeLocks.size===0&&typeof window<"u"&&window.removeEventListener("pagehide",this.pagehideHandler)}}}function yE(){return typeof navigator<"u"&&typeof((r=navigator.locks)===null||r===void 0?void 0:r.request)=="function"?new mE:new pE;var r}let lh=null;const gE=new TextEncoder,vE=new TextDecoder;function Ml(r){return typeof r=="string"?gE.encode(r):vE.decode(r)}function zv(r){if(typeof r.modulusLength!="number"||r.modulusLength<2048)throw new xE(`${r.name} modulusLength must be at least 2048 bits`)}async function bE(r,a,i){if(i.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const l=`${Ul(Ml(JSON.stringify(r)))}.${Ul(Ml(JSON.stringify(a)))}`;return`${l}.${Ul(await crypto.subtle.sign((function(o){switch(o.algorithm.name){case"ECDSA":return{name:o.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return zv(o.algorithm),{name:o.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return zv(o.algorithm),{name:o.algorithm.name};case"Ed25519":return{name:o.algorithm.name}}throw new Ir})(i),i,Ml(l)))}`}let Fh;Uint8Array.prototype.toBase64?Fh=r=>(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r.toBase64({alphabet:"base64url",omitPadding:!0})):Fh=a=>{a instanceof ArrayBuffer&&(a=new Uint8Array(a));const i=[];for(let l=0;l<a.byteLength;l+=32768)i.push(String.fromCharCode.apply(null,a.subarray(l,l+32768)));return btoa(i.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Ul(r){return Fh(r)}class Ir extends Error{constructor(a){var i;super(a??"operation not supported"),this.name=this.constructor.name,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}class xE extends Error{constructor(a){var i;super(a),this.name=this.constructor.name,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}function wE(r){switch(r.algorithm.name){case"RSA-PSS":return(function(a){if(a.algorithm.hash.name==="SHA-256")return"PS256";throw new Ir("unsupported RsaHashedKeyAlgorithm hash name")})(r);case"RSASSA-PKCS1-v1_5":return(function(a){if(a.algorithm.hash.name==="SHA-256")return"RS256";throw new Ir("unsupported RsaHashedKeyAlgorithm hash name")})(r);case"ECDSA":return(function(a){if(a.algorithm.namedCurve==="P-256")return"ES256";throw new Ir("unsupported EcKeyAlgorithm namedCurve")})(r);case"Ed25519":return"Ed25519";default:throw new Ir("unsupported CryptoKey algorithm name")}}function fx(r){return r instanceof CryptoKey}function hx(r){return fx(r)&&r.type==="public"}async function SE(r,a,i,l,o,d){const f=r==null?void 0:r.privateKey,v=r==null?void 0:r.publicKey;if(!fx(y=f)||y.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var y;if(!hx(v))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(v.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof a!="string")throw new TypeError('"htu" must be a string');if(typeof i!="string")throw new TypeError('"htm" must be a string');if(l!==void 0&&typeof l!="string")throw new TypeError('"nonce" must be a string or undefined');if(o!==void 0&&typeof o!="string")throw new TypeError('"accessToken" must be a string or undefined');return bE({alg:wE(f),typ:"dpop+jwt",jwk:await mx(v)},Object.assign(Object.assign({},d),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:i,nonce:l,htu:a,ath:o?Ul(await crypto.subtle.digest("SHA-256",Ml(o))):void 0}),f)}async function mx(r){const{kty:a,e:i,n:l,x:o,y:d,crv:f}=await crypto.subtle.exportKey("jwk",r);return{kty:a,crv:f,e:i,n:l,x:o,y:d}}const px="dpop-nonce",_E=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function EE(){return(async function(r,a){var i;let l;if(r.length===0)throw new TypeError('"alg" must be a non-empty string');switch(r){case"PS256":l={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":l={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":l={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":l={name:"Ed25519"};break;default:throw new Ir}return crypto.subtle.generateKey(l,(i=a==null?void 0:a.extractable)!==null&&i!==void 0&&i,["sign","verify"])})("ES256",{extractable:!1})}function kE(r){return(async function(a){if(!hx(a))throw new TypeError('"publicKey" must be a public CryptoKey');if(a.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const i=await mx(a);let l;switch(i.kty){case"EC":l={crv:i.crv,kty:i.kty,x:i.x,y:i.y};break;case"OKP":l={crv:i.crv,kty:i.kty,x:i.x};break;case"RSA":l={e:i.e,kty:i.kty,n:i.n};break;default:throw new Ir("unsupported JWK kty")}return Ul(await crypto.subtle.digest({name:"SHA-256"},Ml(JSON.stringify(l))))})(r.publicKey)}function TE(r){let{keyPair:a,url:i,method:l,nonce:o,accessToken:d}=r;const f=(function(v){const y=new URL(v);return y.search="",y.hash="",y.href})(i);return SE(a,f,l,o,d)}const jE=async(r,a)=>{const i=await fetch(r,a);return{ok:i.ok,json:await i.json(),headers:(l=i.headers,[...l].reduce((o,d)=>{let[f,v]=d;return o[f]=v,o},{}))};var l},AE=async(r,a,i)=>{const l=new AbortController;let o;return a.signal=l.signal,Promise.race([jE(r,a),new Promise((d,f)=>{o=setTimeout(()=>{l.abort(),f(new Error("Timeout when executing 'fetch'"))},i)})]).finally(()=>{clearTimeout(o)})},NE=async(r,a,i,l,o,d,f,v)=>((y,m)=>new Promise(function(g,b){const w=new MessageChannel;w.port1.onmessage=function(_){_.data.error?b(new Error(_.data.error)):g(_.data),w.port1.close()},m.postMessage(y,[w.port2])}))({auth:{audience:a,scope:i},timeout:o,fetchUrl:r,fetchOptions:l,useFormData:f,useMrrt:v},d),CE=async function(r,a,i,l,o,d){let f=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e4;return o?NE(r,a,i,l,f,o,d,arguments.length>7?arguments[7]:void 0):AE(r,l,f)};async function yx(r,a,i,l,o,d,f,v,y,m){if(y){const K=await y.generateProof({url:r,method:o.method||"GET",nonce:await y.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:K})}let g,b=null;for(let K=0;K<3;K++)try{g=await CE(r,i,l,o,d,f,a,v),b=null;break}catch(L){b=L}if(b)throw b;const w=g.json,{error:_,error_description:C}=w,E=ja(w,["error","error_description"]),{headers:S,ok:N}=g;let H;if(y&&(H=S[px],H&&await y.setNonce(H)),!N){const K=C||"HTTP error. Unable to fetch ".concat(r);if(_==="mfa_required")throw new _s(_,K,E.mfa_token,E.mfa_requirements);if(_==="missing_refresh_token")throw new xu(i,l);if(_==="use_dpop_nonce"){if(!y||!H||m)throw new wu(H);return yx(r,a,i,l,o,d,f,v,y,!0)}throw new Ve(_||"request_error",K)}return E}async function RE(r,a){var{baseUrl:i,timeout:l,audience:o,scope:d,auth0Client:f,useFormData:v,useMrrt:y,dpop:m}=r,g=ja(r,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const b=g.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",w=g.grant_type==="refresh_token"&&y,_=Object.assign(Object.assign(Object.assign(Object.assign({},g),b&&o&&{audience:o}),b&&d&&{scope:d}),w&&{audience:o,scope:d}),C=v?Ih(_):JSON.stringify(_),E=(S=g.grant_type,_E.includes(S));var S;return await yx("".concat(i,"/oauth/token"),l,o||Bt,d,{method:"POST",body:C,headers:{"Content-Type":v?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(ux(f||ox)))}},a,v,y,E?m:void 0)}const eu=function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return(l=a.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(l))).join(" ");var l},Uc=(r,a,i)=>{let l;return i&&(l=r[i]),l||(l=r[Bt]),eu(l,a)},os="@@auth0spajs@@",ns="@@user@@";class va{constructor(a){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:os,l=arguments.length>2?arguments[2]:void 0;this.prefix=i,this.suffix=l,this.clientId=a.clientId,this.scope=a.scope,this.audience=a.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(a){const[i,l,o,d]=a.split("::");return new va({clientId:l,scope:d,audience:o},i)}static fromCacheEntry(a){const{scope:i,audience:l,client_id:o}=a;return new va({scope:i,audience:l,clientId:o})}}class OE{set(a,i){localStorage.setItem(a,JSON.stringify(i))}get(a){const i=window.localStorage.getItem(a);if(i)try{return JSON.parse(i)}catch{return}}remove(a){localStorage.removeItem(a)}allKeys(){return Object.keys(window.localStorage).filter(a=>a.startsWith(os))}}class gx{constructor(){this.enclosedCache=(function(){let a={};return{set(i,l){a[i]=l},get(i){const l=a[i];if(l)return l},remove(i){delete a[i]},allKeys:()=>Object.keys(a)}})()}}class DE{constructor(a,i,l){this.cache=a,this.keyManifest=i,this.nowProvider=l||cx}async setIdToken(a,i,l){var o;const d=this.getIdTokenCacheKey(a);await this.cache.set(d,{id_token:i,decodedToken:l}),await((o=this.keyManifest)===null||o===void 0?void 0:o.add(d))}async getIdToken(a){const i=await this.cache.get(this.getIdTokenCacheKey(a.clientId));if(!i&&a.scope&&a.audience){const l=await this.get(a);return!l||!l.id_token||!l.decodedToken?void 0:{id_token:l.id_token,decodedToken:l.decodedToken}}if(i)return{id_token:i.id_token,decodedToken:i.decodedToken}}async get(a){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=arguments.length>3?arguments[3]:void 0;var d;let f=await this.cache.get(a.toKey());if(!f){const m=await this.getCacheKeys();if(!m)return;const g=this.matchExistingCacheKey(a,m);if(g&&(f=await this.cache.get(g)),!f&&l&&o!=="cache-only")return this.getEntryWithRefreshToken(a,m)}if(!f)return;const v=await this.nowProvider(),y=Math.floor(v/1e3);return f.expiresAt-i<y?f.body.refresh_token?this.modifiedCachedEntry(f,a):(await this.cache.remove(a.toKey()),void await((d=this.keyManifest)===null||d===void 0?void 0:d.remove(a.toKey()))):f.body}async modifiedCachedEntry(a,i){return a.body={refresh_token:a.body.refresh_token,audience:a.body.audience,scope:a.body.scope},await this.cache.set(i.toKey(),a),{refresh_token:a.body.refresh_token,audience:a.body.audience,scope:a.body.scope}}async set(a){var i;const l=new va({clientId:a.client_id,scope:a.scope,audience:a.audience}),o=await this.wrapCacheEntry(a);await this.cache.set(l.toKey(),o),await((i=this.keyManifest)===null||i===void 0?void 0:i.add(l.toKey()))}async remove(a,i,l){const o=new va({clientId:a,scope:l,audience:i});await this.cache.remove(o.toKey())}async clear(a){var i;const l=await this.getCacheKeys();l&&(await l.filter(o=>!a||o.includes(a)).reduce(async(o,d)=>{await o,await this.cache.remove(d)},Promise.resolve()),await((i=this.keyManifest)===null||i===void 0?void 0:i.clear()))}async wrapCacheEntry(a){const i=await this.nowProvider();return{body:a,expiresAt:Math.floor(i/1e3)+a.expires_in}}async getCacheKeys(){var a;return this.keyManifest?(a=await this.keyManifest.get())===null||a===void 0?void 0:a.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(a){return new va({clientId:a},os,ns).toKey()}matchExistingCacheKey(a,i){return i.filter(l=>{var o;const d=va.fromKey(l),f=new Set(d.scope&&d.scope.split(" ")),v=((o=a.scope)===null||o===void 0?void 0:o.split(" "))||[],y=d.scope&&v.reduce((m,g)=>m&&f.has(g),!0);return d.prefix===os&&d.clientId===a.clientId&&d.audience===a.audience&&y})[0]}async getEntryWithRefreshToken(a,i){var l;for(const o of i){const d=va.fromKey(o);if(d.prefix===os&&d.clientId===a.clientId){const f=await this.cache.get(o);if(!((l=f==null?void 0:f.body)===null||l===void 0)&&l.refresh_token)return this.modifiedCachedEntry(f,a)}}}async updateEntry(a,i){var l;const o=await this.getCacheKeys();if(o)for(const d of o){const f=await this.cache.get(d);((l=f==null?void 0:f.body)===null||l===void 0?void 0:l.refresh_token)===a&&(f.body.refresh_token=i,await this.cache.set(d,f))}}}class zE{constructor(a,i,l){this.storage=a,this.clientId=i,this.cookieDomain=l,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(a){this.storage.save(this.storageKey,a,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Al=r=>typeof r=="number",ME=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],UE=r=>{if(!r.id_token)throw new Error("ID token is required but missing");const a=(d=>{const f=d.split("."),[v,y,m]=f;if(f.length!==3||!v||!y||!m)throw new Error("ID token could not be decoded");const g=JSON.parse(Ov(y)),b={__raw:d},w={};return Object.keys(g).forEach(_=>{b[_]=g[_],ME.includes(_)||(w[_]=g[_])}),{encoded:{header:v,payload:y,signature:m},header:JSON.parse(Ov(v)),claims:b,user:w}})(r.id_token);if(!a.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(a.claims.iss!==r.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(r.iss,'", found "').concat(a.claims.iss,'"'));if(!a.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(a.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(a.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!a.claims.aud||typeof a.claims.aud!="string"&&!Array.isArray(a.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(a.claims.aud)){if(!a.claims.aud.includes(r.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(r.aud,'" but was not one of "').concat(a.claims.aud.join(", "),'"'));if(a.claims.aud.length>1){if(!a.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(a.claims.azp!==r.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(r.aud,'", found "').concat(a.claims.azp,'"'))}}else if(a.claims.aud!==r.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(r.aud,'" but found "').concat(a.claims.aud,'"'));if(r.nonce){if(!a.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(a.claims.nonce!==r.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(r.nonce,'", found "').concat(a.claims.nonce,'"'))}if(r.max_age&&!Al(a.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(a.claims.exp==null||!Al(a.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Al(a.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const i=r.leeway||60,l=new Date(r.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(a.claims.exp+i),l>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(l,") is after expiration time (").concat(o,")"));if(a.claims.nbf!=null&&Al(a.claims.nbf)){const d=new Date(0);if(d.setUTCSeconds(a.claims.nbf-i),l<d)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(l,") is before ").concat(d))}if(a.claims.auth_time!=null&&Al(a.claims.auth_time)){const d=new Date(0);if(d.setUTCSeconds(parseInt(a.claims.auth_time)+r.max_age+i),l>d)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(l,") is after last auth at ").concat(d))}if(r.organization){const d=r.organization.trim();if(d.startsWith("org_")){const f=d;if(!a.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(f!==a.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(f,'", found "').concat(a.claims.org_id,'"'))}else{const f=d.toLowerCase();if(!a.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(f!==a.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(f,'", found "').concat(a.claims.org_name,'"'))}}return a};var Pl=ci&&ci.__assign||function(){return Pl=Object.assign||function(r){for(var a,i=1,l=arguments.length;i<l;i++)for(var o in a=arguments[i])Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o]);return r},Pl.apply(this,arguments)};function Nl(r,a){if(!a)return"";var i="; "+r;return a===!0?i:i+"="+a}function HE(r,a,i){return encodeURIComponent(r).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(a).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(l){if(typeof l.expires=="number"){var o=new Date;o.setMilliseconds(o.getMilliseconds()+864e5*l.expires),l.expires=o}return Nl("Expires",l.expires?l.expires.toUTCString():"")+Nl("Domain",l.domain)+Nl("Path",l.path)+Nl("Secure",l.secure)+Nl("SameSite",l.sameSite)})(i)}function LE(){return(function(r){for(var a={},i=r?r.split("; "):[],l=/(%[\dA-F]{2})+/gi,o=0;o<i.length;o++){var d=i[o].split("="),f=d.slice(1).join("=");f.charAt(0)==='"'&&(f=f.slice(1,-1));try{a[d[0].replace(l,decodeURIComponent)]=f.replace(l,decodeURIComponent)}catch{}}return a})(document.cookie)}var KE=function(r){return LE()[r]};function vx(r,a,i){document.cookie=HE(r,a,Pl({path:"/"},i))}var bx=vx,xx=function(r,a){vx(r,"",Pl(Pl({},a),{expires:-1}))};const rs={get(r){const a=KE(r);if(a!==void 0)return JSON.parse(a)},save(r,a,i){let l={};window.location.protocol==="https:"&&(l={secure:!0,sameSite:"none"}),i!=null&&i.daysUntilExpire&&(l.expires=i.daysUntilExpire),i!=null&&i.cookieDomain&&(l.domain=i.cookieDomain),bx(r,JSON.stringify(a),l)},remove(r,a){let i={};a!=null&&a.cookieDomain&&(i.domain=a.cookieDomain),xx(r,i)}},oh="_legacy_",qE={get(r){return rs.get(r)||rs.get("".concat(oh).concat(r))},save(r,a,i){let l={};window.location.protocol==="https:"&&(l={secure:!0}),i!=null&&i.daysUntilExpire&&(l.expires=i.daysUntilExpire),i!=null&&i.cookieDomain&&(l.domain=i.cookieDomain),bx("".concat(oh).concat(r),JSON.stringify(a),l),rs.save(r,a,i)},remove(r,a){let i={};a!=null&&a.cookieDomain&&(i.domain=a.cookieDomain),xx(r,i),rs.remove(r,a),rs.remove("".concat(oh).concat(r),a)}},BE={get(r){if(typeof sessionStorage>"u")return;const a=sessionStorage.getItem(r);return a!=null?JSON.parse(a):void 0},save(r,a){sessionStorage.setItem(r,JSON.stringify(a))},remove(r){sessionStorage.removeItem(r)}};var ir;(function(r){r.Code="code",r.ConnectCode="connect_code"})(ir||(ir={}));function GE(r,a,i){var l=a===void 0?null:a,o=(function(y,m){var g=atob(y);if(m){for(var b=new Uint8Array(g.length),w=0,_=g.length;w<_;++w)b[w]=g.charCodeAt(w);return String.fromCharCode.apply(null,new Uint16Array(b.buffer))}return g})(r,i!==void 0&&i),d=o.indexOf(`
61
+ `,10)+1,f=o.substring(d)+(l?"//# sourceMappingURL="+l:""),v=new Blob([f],{type:"application/javascript"});return URL.createObjectURL(v)}var Mv,Uv,Hv,ch,PE=(Mv="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHQpe2xldHtlcnJvcjpyLGVycm9yX2Rlc2NyaXB0aW9uOnN9PXQ7cmV0dXJuIG5ldyBlKHIscyl9fWNsYXNzIHQgZXh0ZW5kcyBle2NvbnN0cnVjdG9yKGUscyl7c3VwZXIoIm1pc3NpbmdfcmVmcmVzaF90b2tlbiIsIk1pc3NpbmcgUmVmcmVzaCBUb2tlbiAoYXVkaWVuY2U6ICciLmNvbmNhdChyKGUsWyJkZWZhdWx0Il0pLCInLCBzY29wZTogJyIpLmNvbmNhdChyKHMpLCInKSIpKSx0aGlzLmF1ZGllbmNlPWUsdGhpcy5zY29wZT1zLE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLHQucHJvdG90eXBlKX19ZnVuY3Rpb24gcihlKXtyZXR1cm4gZSYmIShhcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXT9hcmd1bWVudHNbMV06W10pLmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIodD0+dm9pZCAwIT09ZVt0XSkucmVkdWNlKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgbz17fTtjb25zdCBuPShlLHQpPT4iIi5jb25jYXQoZSwifCIpLmNvbmNhdCh0KTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhc3luYyBlPT57bGV0IHIsYyx7ZGF0YTp7dGltZW91dDppLGF1dGg6YSxmZXRjaFVybDpmLGZldGNoT3B0aW9uczpsLHVzZUZvcm1EYXRhOnAsdXNlTXJydDpofSxwb3J0czpbdV19PWUsZD17fTtjb25zdHthdWRpZW5jZTpnLHNjb3BlOnl9PWF8fHt9O3RyeXtjb25zdCBlPXA/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0pKGwuYm9keSk6SlNPTi5wYXJzZShsLmJvZHkpO2lmKCFlLnJlZnJlc2hfdG9rZW4mJiJyZWZyZXNoX3Rva2VuIj09PWUuZ3JhbnRfdHlwZSl7aWYoYz0oKGUsdCk9Pm9bbihlLHQpXSkoZyx5KSwhYyYmaCl7Y29uc3QgZT1vLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT57Y29uc3Qgcj1PYmplY3Qua2V5cyhvKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgcz0oKGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSkodCxyKSxvPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLG49ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm8uaW5jbHVkZXMoZSkpO3JldHVybiBzJiZufX0pO3JldHVybiEhcn0pKHksZyk7ZSYmIXQmJihjPWUpfWlmKCFjKXRocm93IG5ldyB0KGcseSk7bC5ib2R5PXA/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sZSkse3JlZnJlc2hfdG9rZW46Y30pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sZSkse3JlZnJlc2hfdG9rZW46Y30pKX1sZXQgYSxrOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihhPW5ldyBBYm9ydENvbnRyb2xsZXIsbC5zaWduYWw9YS5zaWduYWwpO3RyeXtrPWF3YWl0IFByb21pc2UucmFjZShbKGo9aSxuZXcgUHJvbWlzZShlPT5zZXRUaW1lb3V0KGUsaikpKSxmZXRjaChmLE9iamVjdC5hc3NpZ24oe30sbCkpXSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgdS5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWspcmV0dXJuIGEmJmEuYWJvcnQoKSx2b2lkIHUucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7Xz1rLmhlYWRlcnMsZD1bLi4uX10ucmVkdWNlKChlLHQpPT57bGV0W3Isc109dDtyZXR1cm4gZVtyXT1zLGV9LHt9KSxyPWF3YWl0IGsuanNvbigpLHIucmVmcmVzaF90b2tlbj8oaCYmKG8ubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLE89YyxiPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhvKS5mb3JFYWNoKGU9PntsZXRbdCxyXT1lO3I9PT1PJiYob1t0XT1iKX0pKSwoKGUsdCxyKT0+e29bbih0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLGcseSksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGcseSksdS5wb3N0TWVzc2FnZSh7b2s6ay5vayxqc29uOnIsaGVhZGVyczpkfSl9Y2F0Y2goZSl7dS5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6ZH0pfXZhciBPLGIsXyxqfSl9KCk7Cgo=",Uv=null,Hv=!1,function(r){return ch=ch||GE(Mv,Uv,Hv),new Worker(ch,r)});const uh={};class ZE{constructor(a,i){this.cache=a,this.clientId=i,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(a){var i;const l=new Set(((i=await this.cache.get(this.manifestKey))===null||i===void 0?void 0:i.keys)||[]);l.add(a),await this.cache.set(this.manifestKey,{keys:[...l]})}async remove(a){const i=await this.cache.get(this.manifestKey);if(i){const l=new Set(i.keys);return l.delete(a),l.size>0?await this.cache.set(this.manifestKey,{keys:[...l]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(a){return"".concat(os,"::").concat(a)}}const Lv="auth0.is.authenticated",YE={memory:()=>new gx().enclosedCache,localstorage:()=>new OE},Kv=r=>YE[r],qv=r=>{const{openUrl:a,onRedirect:i}=r,l=ja(r,["openUrl","onRedirect"]);return Object.assign(Object.assign({},l),{openUrl:a===!1||a?a:i})},Bv=(r,a)=>{const i=(a==null?void 0:a.split(" "))||[];return((r==null?void 0:r.split(" "))||[]).every(l=>i.includes(l))},Br={NONCE:"nonce",KEYPAIR:"keypair"};class VE{constructor(a){this.clientId=a}getVersion(){return 1}createDbHandle(){const a=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((i,l)=>{a.onupgradeneeded=()=>Object.values(Br).forEach(o=>a.result.createObjectStore(o)),a.onerror=()=>l(a.error),a.onsuccess=()=>i(a.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(a,i,l){const o=l((await this.getDbHandle()).transaction(a,i).objectStore(a));return new Promise((d,f)=>{o.onsuccess=()=>d(o.result),o.onerror=()=>f(o.error)})}buildKey(a){const i=a?"_".concat(a):"auth0";return"".concat(this.clientId,"::").concat(i)}setNonce(a,i){return this.save(Br.NONCE,this.buildKey(i),a)}setKeyPair(a){return this.save(Br.KEYPAIR,this.buildKey(),a)}async save(a,i,l){await this.executeDbRequest(a,"readwrite",o=>o.put(l,i))}findNonce(a){return this.find(Br.NONCE,this.buildKey(a))}findKeyPair(){return this.find(Br.KEYPAIR,this.buildKey())}find(a,i){return this.executeDbRequest(a,"readonly",l=>l.get(i))}async deleteBy(a,i){const l=await this.executeDbRequest(a,"readonly",o=>o.getAllKeys());l==null||l.filter(i).map(o=>this.executeDbRequest(a,"readwrite",d=>d.delete(o)))}deleteByClientId(a,i){return this.deleteBy(a,l=>typeof l=="string"&&l.startsWith("".concat(i,"::")))}clearNonces(){return this.deleteByClientId(Br.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Br.KEYPAIR,this.clientId)}}class QE{constructor(a){this.storage=new VE(a)}getNonce(a){return this.storage.findNonce(a)}setNonce(a,i){return this.storage.setNonce(a,i)}async getOrGenerateKeyPair(){let a=await this.storage.findKeyPair();return a||(a=await EE(),await this.storage.setKeyPair(a)),a}async generateProof(a){const i=await this.getOrGenerateKeyPair();return TE(Object.assign({keyPair:i},a))}async calculateThumbprint(){return kE(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var is;(function(r){r.Bearer="Bearer",r.DPoP="DPoP"})(is||(is={}));class JE{constructor(a,i){this.hooks=i,this.config=Object.assign(Object.assign({},a),{fetch:a.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(a){return/^(https?:)?\/\//i.test(a)}buildUrl(a,i){if(i){if(this.isAbsoluteUrl(i))return i;if(a)return"".concat(a.replace(/\/?\/$/,""),"/").concat(i.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(a){return this.config.getAccessToken?this.config.getAccessToken(a):this.hooks.getAccessToken(a)}extractUrl(a){return typeof a=="string"?a:a instanceof URL?a.href:a.url}buildBaseRequest(a,i){if(!this.config.baseUrl)return new Request(a,i);const l=this.buildUrl(this.config.baseUrl,this.extractUrl(a)),o=a instanceof Request?new Request(l,a):l;return new Request(o,i)}setAuthorizationHeader(a,i){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:is.Bearer;a.headers.set("authorization","".concat(l," ").concat(i))}async setDpopProofHeader(a,i){if(!this.config.dpopNonceId)return;const l=await this.hooks.getDpopNonce(),o=await this.hooks.generateDpopProof({accessToken:i,method:a.method,nonce:l,url:a.url});a.headers.set("dpop",o)}async prepareRequest(a,i){const l=await this.getAccessToken(i);let o,d;typeof l=="string"?(o=this.config.dpopNonceId?is.DPoP:is.Bearer,d=l):(o=l.token_type,d=l.access_token),this.setAuthorizationHeader(a,d,o),o===is.DPoP&&await this.setDpopProofHeader(a,d)}getHeader(a,i){return Array.isArray(a)?new Headers(a).get(i)||"":typeof a.get=="function"?a.get(i)||"":a[i]||""}hasUseDpopNonceError(a){if(a.status!==401)return!1;const i=this.getHeader(a.headers,"www-authenticate");return i.includes("invalid_dpop_nonce")||i.includes("use_dpop_nonce")}async handleResponse(a,i){const l=this.getHeader(a.headers,px);if(l&&await this.hooks.setDpopNonce(l),!this.hasUseDpopNonceError(a))return a;if(!l||!i.onUseDpopNonceError)throw new wu(l);return i.onUseDpopNonceError()}async internalFetchWithAuth(a,i,l,o){const d=this.buildBaseRequest(a,i);await this.prepareRequest(d,o);const f=await this.config.fetch(d);return this.handleResponse(f,l)}fetchWithAuth(a,i,l){const o={onUseDpopNonceError:()=>this.internalFetchWithAuth(a,i,Object.assign(Object.assign({},o),{onUseDpopNonceError:void 0}),l)};return this.internalFetchWithAuth(a,i,o,l)}}class XE{constructor(a,i){this.myAccountFetcher=a,this.apiBase=i}async connectAccount(a){const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return this._handleResponse(i)}async completeAccount(a){const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return this._handleResponse(i)}async _handleResponse(a){let i;try{i=await a.text(),i=JSON.parse(i)}catch(l){throw new cu({type:"invalid_json",status:a.status,title:"Invalid JSON response",detail:i||String(l)})}if(a.ok)return i;throw new cu(i)}}class cu extends Error{constructor(a){let{type:i,status:l,title:o,detail:d,validation_errors:f}=a;super(d),this.name="MyAccountApiError",this.type=i,this.status=l,this.title=o,this.detail=d,this.validation_errors=f,Object.setPrototypeOf(this,cu.prototype)}}const WE={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},IE="http://auth0.com/oauth/grant-type/mfa-otp",FE="http://auth0.com/oauth/grant-type/mfa-oob",$E="http://auth0.com/oauth/grant-type/mfa-recovery-code";function wx(r,a){this.v=r,this.k=a}function We(r,a,i){if(typeof r=="function"?r===a:r.has(a))return arguments.length<3?a:i;throw new TypeError("Private element is not present on this object")}function ek(r){return new wx(r,0)}function Sx(r,a){if(a.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}function J(r,a){return r.get(We(r,a))}function Ye(r,a,i){Sx(r,a),a.set(r,i)}function Ce(r,a,i){return r.set(We(r,a),i),i}function ne(r,a,i){return(a=(function(l){var o=(function(d,f){if(typeof d!="object"||!d)return d;var v=d[Symbol.toPrimitive];if(v!==void 0){var y=v.call(d,f);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)})(l,"string");return typeof o=="symbol"?o:o+""})(a))in r?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,r}function Gv(r,a){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);a&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,l)}return i}function ce(r){for(var a=1;a<arguments.length;a++){var i=arguments[a]!=null?arguments[a]:{};a%2?Gv(Object(i),!0).forEach(function(l){ne(r,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Gv(Object(i)).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(i,l))})}return r}function Pv(r,a){if(r==null)return{};var i,l,o=(function(f,v){if(f==null)return{};var y={};for(var m in f)if({}.hasOwnProperty.call(f,m)){if(v.indexOf(m)!==-1)continue;y[m]=f[m]}return y})(r,a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(r);for(l=0;l<d.length;l++)i=d[l],a.indexOf(i)===-1&&{}.propertyIsEnumerable.call(r,i)&&(o[i]=r[i])}return o}function tk(r){return function(){return new Dl(r.apply(this,arguments))}}function Dl(r){var a,i;function l(d,f){try{var v=r[d](f),y=v.value,m=y instanceof wx;Promise.resolve(m?y.v:y).then(function(g){if(m){var b=d==="return"&&y.k?d:"next";if(!y.k||g.done)return l(b,g);g=r[b](g).value}o(!!v.done,g)},function(g){l("throw",g)})}catch(g){o(2,g)}}function o(d,f){d===2?a.reject(f):a.resolve({value:f,done:d}),(a=a.next)?l(a.key,a.arg):i=null}this._invoke=function(d,f){return new Promise(function(v,y){var m={key:d,arg:f,resolve:v,reject:y,next:null};i?i=i.next=m:(a=i=m,l(d,f))})},typeof r.return!="function"&&(this.return=void 0)}var Hc,dh;let $h;Dl.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Dl.prototype.next=function(r){return this._invoke("next",r)},Dl.prototype.throw=function(r){return this._invoke("throw",r)},Dl.prototype.return=function(r){return this._invoke("return",r)},(typeof navigator>"u"||(Hc=navigator.userAgent)===null||Hc===void 0||(dh=Hc.startsWith)===null||dh===void 0||!dh.call(Hc,"Mozilla/5.0 "))&&($h="".concat("oauth4webapi","/").concat("v3.8.5"));function Ns(r,a){if(r==null)return!1;try{return r instanceof a||Object.getPrototypeOf(r)[Symbol.toStringTag]===a.prototype[Symbol.toStringTag]}catch{return!1}}const jt="ERR_INVALID_ARG_VALUE",Zt="ERR_INVALID_ARG_TYPE";function He(r,a,i){const l=new TypeError(r,{cause:i});return Object.assign(l,{code:a}),l}const ba=Symbol(),em=Symbol(),tm=Symbol(),Oa=Symbol(),Sn=Symbol(),ak=new TextEncoder,nk=new TextDecoder;function cs(r){return typeof r=="string"?ak.encode(r):nk.decode(r)}let am,_x;Uint8Array.prototype.toBase64?am=r=>(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r.toBase64({alphabet:"base64url",omitPadding:!0})):am=a=>{a instanceof ArrayBuffer&&(a=new Uint8Array(a));const i=[];for(let l=0;l<a.byteLength;l+=32768)i.push(String.fromCharCode.apply(null,a.subarray(l,l+32768)));return btoa(i.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function li(r){return typeof r=="string"?_x(r):am(r)}_x=Uint8Array.fromBase64?r=>{try{return Uint8Array.fromBase64(r,{alphabet:"base64url"})}catch(a){throw He("The input to be decoded is not correctly encoded.",jt,a)}}:r=>{try{const a=atob(r.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),i=new Uint8Array(a.length);for(let l=0;l<a.length;l++)i[l]=a.charCodeAt(l);return i}catch(a){throw He("The input to be decoded is not correctly encoded.",jt,a)}};class ra extends Error{constructor(a,i){var l;super(a,i),ne(this,"code",void 0),this.name=this.constructor.name,this.code=im,(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}class Um extends Error{constructor(a,i){var l;super(a,i),ne(this,"code",void 0),this.name=this.constructor.name,i!=null&&i.code&&(this.code=i==null?void 0:i.code),(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}function ye(r,a,i){return new Um(r,{code:a,cause:i})}function rk(r,a){if((function(i,l){if(!(i instanceof CryptoKey))throw He("".concat(l," must be a CryptoKey"),Zt)})(r,a),r.type!=="private")throw He("".concat(a," must be a private CryptoKey"),jt)}function uu(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Su(r){Ns(r,Headers)&&(r=Object.fromEntries(r.entries()));const a=new Headers(r??{});if($h&&!a.has("user-agent")&&a.set("user-agent",$h),a.has("authorization"))throw He('"options.headers" must not include the "authorization" header name',jt);return a}function Ex(r,a){if(a!==void 0){if(typeof a=="function"&&(a=a(r.href)),!(a instanceof AbortSignal))throw He('"options.signal" must return or be an instance of AbortSignal',Zt);return a}}function Zv(r){return r.includes("//")?r.replace("//","/"):r}async function ik(r,a){return(async function(i,l,o,d){if(!(i instanceof URL))throw He('"'.concat(l,'" must be an instance of URL'),Zt);Hm(i,(d==null?void 0:d[ba])!==!0);const f=o(new URL(i.href)),v=Su(d==null?void 0:d.headers);return v.set("accept","application/json"),((d==null?void 0:d[Oa])||fetch)(f.href,{body:void 0,headers:Object.fromEntries(v.entries()),method:"GET",redirect:"manual",signal:Ex(f,d==null?void 0:d.signal)})})(r,"issuerIdentifier",i=>{switch(a==null?void 0:a.algorithm){case void 0:case"oidc":(function(l,o){l.pathname=Zv("".concat(l.pathname,"/").concat(o))})(i,".well-known/openid-configuration");break;case"oauth2":(function(l,o){let d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];l.pathname==="/"?l.pathname=o:l.pathname=Zv("".concat(o,"/").concat(d?l.pathname:l.pathname.replace(/(\/)$/,"")))})(i,".well-known/oauth-authorization-server");break;default:throw He('"options.algorithm" must be "oidc" (default), or "oauth2"',jt)}return i},a)}function vr(r,a,i,l,o){try{if(typeof r!="number"||!Number.isFinite(r))throw He("".concat(i," must be a number"),Zt,o);if(r>0)return;if(a){if(r!==0)throw He("".concat(i," must be a non-negative number"),jt,o);return}throw He("".concat(i," must be a positive number"),jt,o)}catch(d){throw l?ye(d.message,l,o):d}}function ut(r,a,i,l){try{if(typeof r!="string")throw He("".concat(a," must be a string"),Zt,l);if(r.length===0)throw He("".concat(a," must not be empty"),jt,l)}catch(o){throw i?ye(o.message,i,l):o}}function kx(r){(function(a,i){if(Nx(a)!==i)throw(function(l){let o='"response" content-type must be ';for(var d=arguments.length,f=new Array(d>1?d-1:0),v=1;v<d;v++)f[v-1]=arguments[v];if(f.length>2){const y=f.pop();o+="".concat(f.join(", "),", or ").concat(y)}else f.length===2?o+="".concat(f[0]," or ").concat(f[1]):o+=f[0];return ye(o,Rx,l)})(a,i)})(r,"application/json")}function Tx(){return li(crypto.getRandomValues(new Uint8Array(32)))}function sk(r){switch(r.algorithm.name){case"RSA-PSS":return(function(a){switch(a.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new ra("unsupported RsaHashedKeyAlgorithm hash name",{cause:a})}})(r);case"RSASSA-PKCS1-v1_5":return(function(a){switch(a.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new ra("unsupported RsaHashedKeyAlgorithm hash name",{cause:a})}})(r);case"ECDSA":return(function(a){switch(a.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new ra("unsupported EcKeyAlgorithm namedCurve",{cause:a})}})(r);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return r.algorithm.name;case"EdDSA":return"Ed25519";default:throw new ra("unsupported CryptoKey algorithm name",{cause:r})}}function du(r){const a=r==null?void 0:r[em];return typeof a=="number"&&Number.isFinite(a)?a:0}function nm(r){const a=r==null?void 0:r[tm];return typeof a=="number"&&Number.isFinite(a)&&Math.sign(a)!==-1?a:30}function fu(){return Math.floor(Date.now()/1e3)}function Ca(r){if(typeof r!="object"||r===null)throw He('"as" must be an object',Zt);ut(r.issuer,'"as.issuer"')}function Ra(r){if(typeof r!="object"||r===null)throw He('"client" must be an object',Zt);ut(r.client_id,'"client.client_id"')}function Yv(r){return ut(r,'"clientSecret"'),(a,i,l,o)=>{l.set("client_id",i.client_id),l.set("client_secret",r)}}function lk(r,a){const{key:i,kid:l}=(o=r)instanceof CryptoKey?{key:o}:(o==null?void 0:o.key)instanceof CryptoKey?(o.kid!==void 0&&ut(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return rk(i,'"clientPrivateKey.key"'),async(d,f,v,y)=>{const m={alg:sk(i),kid:l},g=(function(b,w){const _=fu()+du(w);return{jti:Tx(),aud:b.issuer,exp:_+60,iat:_,nbf:_,iss:w.client_id,sub:w.client_id}})(d,f);v.set("client_id",f.client_id),v.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),v.set("client_assertion",await(async function(b,w,_){if(!_.usages.includes("sign"))throw He('CryptoKey instances used for signing assertions must include "sign" in their "usages"',jt);const C="".concat(li(cs(JSON.stringify(b))),".").concat(li(cs(JSON.stringify(w)))),E=li(await crypto.subtle.sign((function(S){switch(S.algorithm.name){case"ECDSA":return{name:S.algorithm.name,hash:Tk(S)};case"RSA-PSS":switch(Jv(S),S.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:S.algorithm.name,saltLength:parseInt(S.algorithm.hash.name.slice(-3),10)>>3};default:throw new ra("unsupported RSA-PSS hash name",{cause:S})}case"RSASSA-PKCS1-v1_5":return Jv(S),S.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return S.algorithm.name}throw new ra("unsupported CryptoKey algorithm name",{cause:S})})(_),_,cs(C)));return"".concat(C,".").concat(E)})(m,g,i))}}const ok=URL.parse?(r,a)=>URL.parse(r,a):(r,a)=>{try{return new URL(r,a)}catch{return null}};function Hm(r,a){if(a&&r.protocol!=="https:")throw ye("only requests to HTTPS are allowed",Ox,r);if(r.protocol!=="https:"&&r.protocol!=="http:")throw ye("only HTTP and HTTPS requests are allowed",Dx,r)}function Vv(r,a,i,l){let o;if(typeof r!="string"||!(o=ok(r)))throw ye("authorization server metadata does not contain a valid ".concat(i?'"as.mtls_endpoint_aliases.'.concat(a,'"'):'"as.'.concat(a,'"')),r===void 0?Ek:kk,{attribute:i?"mtls_endpoint_aliases.".concat(a):a});return Hm(o,l),o}function no(r,a,i,l){return i&&r.mtls_endpoint_aliases&&a in r.mtls_endpoint_aliases?Vv(r.mtls_endpoint_aliases[a],a,i,l):Vv(r[a],a,i,l)}class _u extends Error{constructor(a,i){var l;super(a,i),ne(this,"cause",void 0),ne(this,"code",void 0),ne(this,"error",void 0),ne(this,"status",void 0),ne(this,"error_description",void 0),ne(this,"response",void 0),this.name=this.constructor.name,this.code=Sk,this.cause=i.cause,this.error=i.cause.error,this.status=i.response.status,this.error_description=i.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:i.response}),(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}class jx extends Error{constructor(a,i){var l,o;super(a,i),ne(this,"cause",void 0),ne(this,"code",void 0),ne(this,"error",void 0),ne(this,"error_description",void 0),this.name=this.constructor.name,this.code=_k,this.cause=i.cause,this.error=i.cause.get("error"),this.error_description=(l=i.cause.get("error_description"))!==null&&l!==void 0?l:void 0,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Lm extends Error{constructor(a,i){var l;super(a,i),ne(this,"cause",void 0),ne(this,"code",void 0),ne(this,"response",void 0),ne(this,"status",void 0),this.name=this.constructor.name,this.code=wk,this.cause=i.cause,this.status=i.response.status,this.response=i.response,Object.defineProperty(this,"response",{enumerable:!1}),(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}const hu="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",ck="("+hu+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',uk="("+hu+")\\s*=\\s*("+hu+")",dk=new RegExp("^[,\\s]*("+hu+")"),fk=new RegExp("^[,\\s]*"+ck+"[,\\s]*(.*)"),hk=new RegExp("^[,\\s]*"+uk+"[,\\s]*(.*)"),mk=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Km(r,a,i){if(r.status!==a){let o;var l;throw(function(d){let f;if(f=(function(v){if(!Ns(v,Response))throw He('"response" must be an instance of Response',Zt);const y=v.headers.get("www-authenticate");if(y===null)return;const m=[];let g=y;for(;g;){var b;let w=g.match(dk);const _=(b=w)===null||b===void 0?void 0:b[1].toLowerCase();if(!_)return;const C=g.substring(w[0].length);if(C&&!C.match(/^[\s,]/))return;const E=C.match(/^\s+(.*)$/),S=!!E;g=E?E[1]:void 0;const N={};let H;if(S)for(;g;){let L,U;if(w=g.match(fk)){if([,L,U,g]=w,U.includes("\\"))try{U=JSON.parse('"'.concat(U,'"'))}catch{}N[L.toLowerCase()]=U}else{if(!(w=g.match(hk))){if(w=g.match(mk)){if(Object.keys(N).length)break;[,H,g]=w;break}return}[,L,U,g]=w,N[L.toLowerCase()]=U}}else g=C||void 0;const K={scheme:_,parameters:N};H&&(K.token68=H),m.push(K)}return m.length?m:void 0})(d))throw new Lm("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:f,response:d})})(r),(o=await(async function(d){if(d.status>399&&d.status<500){io(d),kx(d);try{const f=await d.clone().json();if(uu(f)&&typeof f.error=="string"&&f.error.length)return f}catch{}}})(r))?(await((l=r.body)===null||l===void 0?void 0:l.cancel()),new _u("server responded with an error in the response body",{cause:o,response:r})):ye('"response" is not a conform '.concat(i," response (unexpected HTTP status code)"),Gm,r)}}function Ax(r){if(!Bm.has(r))throw He('"options.DPoP" is not a valid DPoPHandle',jt)}function Nx(r){var a;return(a=r.headers.get("content-type"))===null||a===void 0?void 0:a.split(";")[0]}async function qm(r,a,i,l,o,d,f){return await i(r,a,o,d),d.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((f==null?void 0:f[Oa])||fetch)(l.href,{body:o,headers:Object.fromEntries(d.entries()),method:"POST",redirect:"manual",signal:Ex(l,f==null?void 0:f.signal)})}async function ro(r,a,i,l,o,d){var f;const v=no(r,"token_endpoint",a.use_mtls_endpoint_aliases,(d==null?void 0:d[ba])!==!0);o.set("grant_type",l);const y=Su(d==null?void 0:d.headers);y.set("accept","application/json"),(d==null?void 0:d.DPoP)!==void 0&&(Ax(d.DPoP),await d.DPoP.addProof(v,y,"POST"));const m=await qm(r,a,i,v,o,y,d);return d==null||(f=d.DPoP)===null||f===void 0||f.cacheNonce(m,v),m}const Cx=new WeakMap,pk=new WeakMap;function rm(r){if(!r.id_token)return;const a=Cx.get(r);if(!a)throw He('"ref" was already garbage collected or did not resolve from the proper sources',jt);return a}async function Es(r,a,i,l,o,d){if(Ca(r),Ra(a),!Ns(i,Response))throw He('"response" must be an instance of Response',Zt);await Km(i,200,"Token Endpoint"),io(i);const f=await Eu(i);if(ut(f.access_token,'"response" body "access_token" property',Re,{body:f}),ut(f.token_type,'"response" body "token_type" property',Re,{body:f}),f.token_type=f.token_type.toLowerCase(),f.expires_in!==void 0){let v=typeof f.expires_in!="number"?parseFloat(f.expires_in):f.expires_in;vr(v,!0,'"response" body "expires_in" property',Re,{body:f}),f.expires_in=v}if(f.refresh_token!==void 0&&ut(f.refresh_token,'"response" body "refresh_token" property',Re,{body:f}),f.scope!==void 0&&typeof f.scope!="string")throw ye('"response" body "scope" property must be a string',Re,{body:f});if(f.id_token!==void 0){ut(f.id_token,'"response" body "id_token" property',Re,{body:f});const v=["aud","exp","iat","iss","sub"];a.require_auth_time===!0&&v.push("auth_time"),a.default_max_age!==void 0&&(vr(a.default_max_age,!0,'"client.default_max_age"'),v.push("auth_time")),l!=null&&l.length&&v.push(...l);const{claims:y,jwt:m}=await(async function(g,b,w,_,C){let E,S,{0:N,1:H,length:K}=g.split(".");if(K===5){if(C===void 0)throw new ra("JWE decryption is not configured",{cause:g});g=await C(g),{0:N,1:H,length:K}=g.split(".")}if(K!==3)throw ye("Invalid JWT",Re,g);try{E=JSON.parse(cs(li(N)))}catch(U){throw ye("failed to parse JWT Header body as base64url encoded JSON",mu,U)}if(!uu(E))throw ye("JWT Header must be a top level object",Re,g);if(b(E),E.crit!==void 0)throw new ra('no JWT "crit" header parameter extensions are supported',{cause:{header:E}});try{S=JSON.parse(cs(li(H)))}catch(U){throw ye("failed to parse JWT Payload body as base64url encoded JSON",mu,U)}if(!uu(S))throw ye("JWT Payload must be a top level object",Re,g);const L=fu()+w;if(S.exp!==void 0){if(typeof S.exp!="number")throw ye('unexpected JWT "exp" (expiration time) claim type',Re,{claims:S});if(S.exp<=L-_)throw ye('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Zl,{claims:S,now:L,tolerance:_,claim:"exp"})}if(S.iat!==void 0&&typeof S.iat!="number")throw ye('unexpected JWT "iat" (issued at) claim type',Re,{claims:S});if(S.iss!==void 0&&typeof S.iss!="string")throw ye('unexpected JWT "iss" (issuer) claim type',Re,{claims:S});if(S.nbf!==void 0){if(typeof S.nbf!="number")throw ye('unexpected JWT "nbf" (not before) claim type',Re,{claims:S});if(S.nbf>L+_)throw ye('unexpected JWT "nbf" (not before) claim value',Zl,{claims:S,now:L,tolerance:_,claim:"nbf"})}if(S.aud!==void 0&&typeof S.aud!="string"&&!Array.isArray(S.aud))throw ye('unexpected JWT "aud" (audience) claim type',Re,{claims:S});return{header:E,claims:S,jwt:g}})(f.id_token,Ak.bind(void 0,a.id_token_signed_response_alg,r.id_token_signing_alg_values_supported,"RS256"),du(a),nm(a),o).then(bk.bind(void 0,v)).then(gk.bind(void 0,r)).then(yk.bind(void 0,a.client_id));if(Array.isArray(y.aud)&&y.aud.length!==1){if(y.azp===void 0)throw ye('ID Token "aud" (audience) claim includes additional untrusted audiences',bn,{claims:y,claim:"aud"});if(y.azp!==a.client_id)throw ye('unexpected ID Token "azp" (authorized party) claim value',bn,{expected:a.client_id,claims:y,claim:"azp"})}y.auth_time!==void 0&&vr(y.auth_time,!0,'ID Token "auth_time" (authentication time)',Re,{claims:y}),pk.set(i,m),Cx.set(f,y)}if((d==null?void 0:d[f.token_type])!==void 0)d[f.token_type](i,f);else if(f.token_type!=="dpop"&&f.token_type!=="bearer")throw new ra("unsupported `token_type` value",{cause:{body:f}});return f}function yk(r,a){if(Array.isArray(a.claims.aud)){if(!a.claims.aud.includes(r))throw ye('unexpected JWT "aud" (audience) claim value',bn,{expected:r,claims:a.claims,claim:"aud"})}else if(a.claims.aud!==r)throw ye('unexpected JWT "aud" (audience) claim value',bn,{expected:r,claims:a.claims,claim:"aud"});return a}function gk(r,a){var i,l;const o=(i=(l=r[zx])===null||l===void 0?void 0:l.call(r,a))!==null&&i!==void 0?i:r.issuer;if(a.claims.iss!==o)throw ye('unexpected JWT "iss" (issuer) claim value',bn,{expected:o,claims:a.claims,claim:"iss"});return a}const Bm=new WeakSet,Qv=Symbol(),vk={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function bk(r,a){for(const i of r)if(a.claims[i]===void 0)throw ye('JWT "'.concat(i,'" (').concat(vk[i],") claim missing"),Re,{claims:a.claims});return a}const fh=Symbol(),hh=Symbol();async function xk(r,a,i,l){return typeof(l==null?void 0:l.expectedNonce)=="string"||typeof(l==null?void 0:l.maxAge)=="number"||l!=null&&l.requireIdToken?(async function(o,d,f,v,y,m,g){const b=[];switch(v){case void 0:v=fh;break;case fh:break;default:ut(v,'"expectedNonce" argument'),b.push("nonce")}switch(y!=null||(y=d.default_max_age),y){case void 0:y=hh;break;case hh:break;default:vr(y,!0,'"maxAge" argument'),b.push("auth_time")}const w=await Es(o,d,f,b,m,g);ut(w.id_token,'"response" body "id_token" property',Re,{body:w});const _=rm(w);if(y!==hh){const C=fu()+du(d),E=nm(d);if(_.auth_time+y<C-E)throw ye("too much time has elapsed since the last End-User authentication",Zl,{claims:_,now:C,tolerance:E,claim:"auth_time"})}if(v===fh){if(_.nonce!==void 0)throw ye('unexpected ID Token "nonce" claim value',bn,{expected:void 0,claims:_,claim:"nonce"})}else if(_.nonce!==v)throw ye('unexpected ID Token "nonce" claim value',bn,{expected:v,claims:_,claim:"nonce"});return w})(r,a,i,l.expectedNonce,l.maxAge,l[Sn],l.recognizedTokenTypes):(async function(o,d,f,v,y){const m=await Es(o,d,f,void 0,v,y),g=rm(m);if(g){if(d.default_max_age!==void 0){vr(d.default_max_age,!0,'"client.default_max_age"');const b=fu()+du(d),w=nm(d);if(g.auth_time+d.default_max_age<b-w)throw ye("too much time has elapsed since the last End-User authentication",Zl,{claims:g,now:b,tolerance:w,claim:"auth_time"})}if(g.nonce!==void 0)throw ye('unexpected ID Token "nonce" claim value',bn,{expected:void 0,claims:g,claim:"nonce"})}return m})(r,a,i,l==null?void 0:l[Sn],l==null?void 0:l.recognizedTokenTypes)}const wk="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Sk="OAUTH_RESPONSE_BODY_ERROR",im="OAUTH_UNSUPPORTED_OPERATION",_k="OAUTH_AUTHORIZATION_RESPONSE_ERROR",mu="OAUTH_PARSE_ERROR",Re="OAUTH_INVALID_RESPONSE",Rx="OAUTH_RESPONSE_IS_NOT_JSON",Gm="OAUTH_RESPONSE_IS_NOT_CONFORM",Ox="OAUTH_HTTP_REQUEST_FORBIDDEN",Dx="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Zl="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",bn="OAUTH_JWT_CLAIM_COMPARISON_FAILED",sm="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",Ek="OAUTH_MISSING_SERVER_METADATA",kk="OAUTH_INVALID_SERVER_METADATA";function io(r){if(r.bodyUsed)throw He('"response" body has been used already',jt)}function Jv(r){const{algorithm:a}=r;if(typeof a.modulusLength!="number"||a.modulusLength<2048)throw new ra("unsupported ".concat(a.name," modulusLength"),{cause:r})}function Tk(r){const{algorithm:a}=r;switch(a.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new ra("unsupported ECDSA namedCurve",{cause:r})}}async function jk(r){if(r.method!=="POST")throw He("form_post responses are expected to use the POST method",jt,{cause:r});if(Nx(r)!=="application/x-www-form-urlencoded")throw He("form_post responses are expected to use the application/x-www-form-urlencoded content-type",jt,{cause:r});return(async function(a){if(a.bodyUsed)throw He("form_post Request instances must contain a readable body",jt,{cause:a});return a.text()})(r)}function Ak(r,a,i,l){if(r===void 0)if(Array.isArray(a)){if(!a.includes(l.alg))throw ye('unexpected JWT "alg" header parameter',Re,{header:l,expected:a,reason:"authorization server metadata"})}else{if(i===void 0)throw ye('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:r,issuer:a,fallback:i});if(typeof i=="string"?l.alg!==i:typeof i=="function"?!i(l.alg):!i.includes(l.alg))throw ye('unexpected JWT "alg" header parameter',Re,{header:l,expected:i,reason:"default value"})}else if(typeof r=="string"?l.alg!==r:!r.includes(l.alg))throw ye('unexpected JWT "alg" header parameter',Re,{header:l,expected:r,reason:"client configuration"})}function Qr(r,a){const{0:i,length:l}=r.getAll(a);if(l>1)throw ye('"'.concat(a,'" parameter must be provided only once'),Re);return i}const Nk=Symbol(),Ck=Symbol();function Rk(r,a,i,l){if(Ca(r),Ra(a),i instanceof URL&&(i=i.searchParams),!(i instanceof URLSearchParams))throw He('"parameters" must be an instance of URLSearchParams, or URL',Zt);if(Qr(i,"response"))throw ye('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Re,{parameters:i});const o=Qr(i,"iss"),d=Qr(i,"state");if(!o&&r.authorization_response_iss_parameter_supported)throw ye('response parameter "iss" (issuer) missing',Re,{parameters:i});if(o&&o!==r.issuer)throw ye('unexpected "iss" (issuer) response parameter value',Re,{expected:r.issuer,parameters:i});switch(l){case void 0:case Ck:if(d!==void 0)throw ye('unexpected "state" response parameter encountered',Re,{expected:void 0,parameters:i});break;case Nk:break;default:if(ut(l,'"expectedState" argument'),d!==l)throw ye(d===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',Re,{expected:l,parameters:i})}if(Qr(i,"error"))throw new jx("authorization response from the server is an error",{cause:i});const f=Qr(i,"id_token"),v=Qr(i,"token");if(f!==void 0||v!==void 0)throw new ra("implicit and hybrid flows are not supported");return y=new URLSearchParams(i),Bm.add(y),y;var y}async function Eu(r){let a,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kx;try{a=await r.json()}catch(l){throw i(r),ye('failed to parse "response" body as JSON',mu,l)}if(!uu(a))throw ye('"response" body must be a top level object',Re,{body:a});return a}const mh=Symbol(),zx=Symbol(),Xv=new TextEncoder,Yl=new TextDecoder;function ph(r){const a=new Uint8Array(r.length);for(let i=0;i<r.length;i++){const l=r.charCodeAt(i);if(l>127)throw new TypeError("non-ASCII string encountered in encode()");a[i]=l}return a}function Mx(r){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);const a=atob(r),i=new Uint8Array(a.length);for(let l=0;l<a.length;l++)i[l]=a.charCodeAt(l);return i}function ku(r){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof r=="string"?r:Yl.decode(r),{alphabet:"base64url"});let a=r;a instanceof Uint8Array&&(a=Yl.decode(a)),a=a.replace(/-/g,"+").replace(/_/g,"/");try{return Mx(a)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}const rr=function(r){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name"," must be ").concat(r))},Fi=(r,a)=>r.name===a;function yh(r,a){var i;if(i=r.hash,parseInt(i.name.slice(4),10)!==a)throw rr("SHA-".concat(a),"algorithm.hash")}function Ok(r,a,i){switch(a){case"HS256":case"HS384":case"HS512":if(!Fi(r.algorithm,"HMAC"))throw rr("HMAC");yh(r.algorithm,parseInt(a.slice(2),10));break;case"RS256":case"RS384":case"RS512":if(!Fi(r.algorithm,"RSASSA-PKCS1-v1_5"))throw rr("RSASSA-PKCS1-v1_5");yh(r.algorithm,parseInt(a.slice(2),10));break;case"PS256":case"PS384":case"PS512":if(!Fi(r.algorithm,"RSA-PSS"))throw rr("RSA-PSS");yh(r.algorithm,parseInt(a.slice(2),10));break;case"Ed25519":case"EdDSA":if(!Fi(r.algorithm,"Ed25519"))throw rr("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!Fi(r.algorithm,a))throw rr(a);break;case"ES256":case"ES384":case"ES512":{if(!Fi(r.algorithm,"ECDSA"))throw rr("ECDSA");const l=(function(o){switch(o){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}})(a);if(r.algorithm.namedCurve!==l)throw rr(l,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(l,o){if(!l.usages.includes(o))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(o,"."))})(r,i)}function Ux(r,a){for(var i=arguments.length,l=new Array(i>2?i-2:0),o=2;o<i;o++)l[o-2]=arguments[o];if((l=l.filter(Boolean)).length>2){const f=l.pop();r+="one of type ".concat(l.join(", "),", or ").concat(f,".")}else l.length===2?r+="one of type ".concat(l[0]," or ").concat(l[1],"."):r+="of type ".concat(l[0],".");if(a==null)r+=" Received ".concat(a);else if(typeof a=="function"&&a.name)r+=" Received function ".concat(a.name);else if(typeof a=="object"&&a!=null){var d;(d=a.constructor)!==null&&d!==void 0&&d.name&&(r+=" Received an instance of ".concat(a.constructor.name))}return r}const Wv=function(r,a){for(var i=arguments.length,l=new Array(i>2?i-2:0),o=2;o<i;o++)l[o-2]=arguments[o];return Ux("Key for the ".concat(r," algorithm must be "),a,...l)};class Et extends Error{constructor(a,i){var l;super(a,i),ne(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}ne(Et,"code","ERR_JOSE_GENERIC");class Ea extends Et{constructor(a,i){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(a,{cause:{claim:l,reason:o,payload:i}}),ne(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),ne(this,"claim",void 0),ne(this,"reason",void 0),ne(this,"payload",void 0),this.claim=l,this.reason=o,this.payload=i}}ne(Ea,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class lm extends Et{constructor(a,i){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(a,{cause:{claim:l,reason:o,payload:i}}),ne(this,"code","ERR_JWT_EXPIRED"),ne(this,"claim",void 0),ne(this,"reason",void 0),ne(this,"payload",void 0),this.claim=l,this.reason=o,this.payload=i}}ne(lm,"code","ERR_JWT_EXPIRED");class Hx extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}ne(Hx,"code","ERR_JOSE_ALG_NOT_ALLOWED");class na extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JOSE_NOT_SUPPORTED")}}ne(na,"code","ERR_JOSE_NOT_SUPPORTED");ne(class extends Et{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),ne(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");ne(class extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class pt extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JWS_INVALID")}}ne(pt,"code","ERR_JWS_INVALID");class Pm extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JWT_INVALID")}}ne(Pm,"code","ERR_JWT_INVALID");ne(class extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Zm extends Et{constructor(){super(...arguments),ne(this,"code","ERR_JWKS_INVALID")}}ne(Zm,"code","ERR_JWKS_INVALID");class Ym extends Et{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),ne(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}ne(Ym,"code","ERR_JWKS_NO_MATCHING_KEY");class Lx extends Et{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),ne(this,Symbol.asyncIterator,void 0),ne(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}ne(Lx,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Kx extends Et{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),ne(this,"code","ERR_JWKS_TIMEOUT")}}ne(Kx,"code","ERR_JWKS_TIMEOUT");class qx extends Et{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),ne(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}ne(qx,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Bx=r=>{if((r==null?void 0:r[Symbol.toStringTag])==="CryptoKey")return!0;try{return r instanceof CryptoKey}catch{return!1}},Gx=r=>(r==null?void 0:r[Symbol.toStringTag])==="KeyObject",Iv=r=>Bx(r)||Gx(r);function Fv(r,a,i){try{return ku(r)}catch{throw new i("Failed to base64url decode the ".concat(a))}}function xr(r){if(typeof(a=r)!="object"||a===null||Object.prototype.toString.call(r)!=="[object Object]")return!1;var a;if(Object.getPrototypeOf(r)===null)return!0;let i=r;for(;Object.getPrototypeOf(i)!==null;)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(r)===i}const om=r=>xr(r)&&typeof r.kty=="string";async function Dk(r,a,i){if(a instanceof Uint8Array){if(!r.startsWith("HS"))throw new TypeError((function(l){for(var o=arguments.length,d=new Array(o>1?o-1:0),f=1;f<o;f++)d[f-1]=arguments[f];return Ux("Key must be ",l,...d)})(a,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",a,{hash:"SHA-".concat(r.slice(-3)),name:"HMAC"},!1,[i])}return Ok(a,r,i),a}async function zk(r,a,i,l){const o=await Dk(r,a,"verify");(function(f,v){if(f.startsWith("RS")||f.startsWith("PS")){const{modulusLength:y}=v.algorithm;if(typeof y!="number"||y<2048)throw new TypeError("".concat(f," requires key modulusLength to be 2048 bits or larger"))}})(r,o);const d=(function(f,v){const y="SHA-".concat(f.slice(-3));switch(f){case"HS256":case"HS384":case"HS512":return{hash:y,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:y,name:"RSA-PSS",saltLength:parseInt(f.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:y,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:y,name:"ECDSA",namedCurve:v.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:f};default:throw new na("alg ".concat(f," is not supported either by JOSE or your javascript runtime"))}})(r,o.algorithm);try{return await crypto.subtle.verify(d,o,i,l)}catch{return!1}}const Lc='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function tu(r){var a,i;if(!r.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:l,keyUsages:o}=(function(f){let v,y;switch(f.kty){case"AKP":switch(f.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":v={name:f.alg},y=f.priv?["sign"]:["verify"];break;default:throw new na(Lc)}break;case"RSA":switch(f.alg){case"PS256":case"PS384":case"PS512":v={name:"RSA-PSS",hash:"SHA-".concat(f.alg.slice(-3))},y=f.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":v={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(f.alg.slice(-3))},y=f.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":v={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(f.alg.slice(-3),10)||1)},y=f.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new na(Lc)}break;case"EC":switch(f.alg){case"ES256":case"ES384":case"ES512":v={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[f.alg]},y=f.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":v={name:"ECDH",namedCurve:f.crv},y=f.d?["deriveBits"]:[];break;default:throw new na(Lc)}break;case"OKP":switch(f.alg){case"Ed25519":case"EdDSA":v={name:"Ed25519"},y=f.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":v={name:f.crv},y=f.d?["deriveBits"]:[];break;default:throw new na(Lc)}break;default:throw new na('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:v,keyUsages:y}})(r),d=ce({},r);return d.kty!=="AKP"&&delete d.alg,delete d.use,crypto.subtle.importKey("jwk",d,l,(a=r.ext)!==null&&a!==void 0?a:!r.d&&!r.priv,(i=r.key_ops)!==null&&i!==void 0?i:o)}const $i="given KeyObject instance cannot be used for this algorithm";let yr;const $v=async function(r,a,i){let l=arguments.length>3&&arguments[3]!==void 0&&arguments[3];yr||(yr=new WeakMap);let o=yr.get(r);if(o!=null&&o[i])return o[i];const d=await tu(ce(ce({},a),{},{alg:i}));return l&&Object.freeze(r),o?o[i]=d:yr.set(r,{[i]:d}),d};async function Mk(r,a){if(r instanceof Uint8Array||Bx(r))return r;if(Gx(r)){if(r.type==="secret")return r.export();if("toCryptoKey"in r&&typeof r.toCryptoKey=="function")try{return((l,o)=>{yr||(yr=new WeakMap);let d=yr.get(l);if(d!=null&&d[o])return d[o];const f=l.type==="public",v=!!f;let y;if(l.asymmetricKeyType==="x25519"){switch(o){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError($i)}y=l.toCryptoKey(l.asymmetricKeyType,v,f?[]:["deriveBits"])}if(l.asymmetricKeyType==="ed25519"){if(o!=="EdDSA"&&o!=="Ed25519")throw new TypeError($i);y=l.toCryptoKey(l.asymmetricKeyType,v,[f?"verify":"sign"])}switch(l.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(o!==l.asymmetricKeyType.toUpperCase())throw new TypeError($i);y=l.toCryptoKey(l.asymmetricKeyType,v,[f?"verify":"sign"])}if(l.asymmetricKeyType==="rsa"){let g;switch(o){case"RSA-OAEP":g="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":g="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":g="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":g="SHA-512";break;default:throw new TypeError($i)}if(o.startsWith("RSA-OAEP"))return l.toCryptoKey({name:"RSA-OAEP",hash:g},v,f?["encrypt"]:["decrypt"]);y=l.toCryptoKey({name:o.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:g},v,[f?"verify":"sign"])}if(l.asymmetricKeyType==="ec"){var m;const g=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((m=l.asymmetricKeyDetails)===null||m===void 0?void 0:m.namedCurve);if(!g)throw new TypeError($i);const b={ES256:"P-256",ES384:"P-384",ES512:"P-521"};b[o]&&g===b[o]&&(y=l.toCryptoKey({name:"ECDSA",namedCurve:g},v,[f?"verify":"sign"])),o.startsWith("ECDH-ES")&&(y=l.toCryptoKey({name:"ECDH",namedCurve:g},v,f?[]:["deriveBits"]))}if(!y)throw new TypeError($i);return d?d[o]=y:yr.set(l,{[o]:y}),y})(r,a)}catch(l){if(l instanceof TypeError)throw l}let i=r.export({format:"jwk"});return $v(r,i,a)}if(om(r))return r.k?ku(r.k):$v(r,r,a,!0);throw new Error("unreachable")}const gh=(r,a)=>{if(r.byteLength!==a.length)return!1;for(let i=0;i<r.byteLength;i++)if(r[i]!==a[i])return!1;return!0},Hl=r=>{const a=r.data[r.pos++];if(128&a){const i=127&a;let l=0;for(let o=0;o<i;o++)l=l<<8|r.data[r.pos++];return l}return a},Ll=(r,a,i)=>{if(r.data[r.pos++]!==a)throw new Error(i)},eb=(r,a)=>{const i=r.data.subarray(r.pos,r.pos+a);return r.pos+=a,i},Uk=r=>{const a=(o=>{Ll(o,6,"Expected algorithm OID");const d=Hl(o);return eb(o,d)})(r);if(gh(a,[43,101,110]))return"X25519";if(!gh(a,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Ll(r,6,"Expected curve OID");const i=Hl(r),l=eb(r,i);for(const{name:o,oid:d}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(gh(l,d))return o;throw new Error("Unsupported named curve")},Hk=async(r,a,i,l)=>{var o;let d,f;const v=()=>["sign"];switch(i){case"PS256":case"PS384":case"PS512":d={name:"RSA-PSS",hash:"SHA-".concat(i.slice(-3))},f=v();break;case"RS256":case"RS384":case"RS512":d={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(i.slice(-3))},f=v();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":d={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(i.slice(-3),10)||1)},f=["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":d={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[i]},f=v();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const y=l.getNamedCurve(a);d=y==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:y}}catch{throw new na("Invalid or unsupported key format")}f=["deriveBits"];break;case"Ed25519":case"EdDSA":d={name:"Ed25519"},f=v();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":d={name:i},f=v();break;default:throw new na('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(r,a,d,(o=l==null?void 0:l.extractable)!==null&&o!==void 0?o:!1,f)},Lk=(r,a,i)=>{var l;const o=((f,v)=>Mx(f.replace(v,"")))(r,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let d=i;return a!=null&&(l=a.startsWith)!==null&&l!==void 0&&l.call(a,"ECDH-ES")&&(d||(d={}),d.getNamedCurve=f=>{const v={data:f,pos:0};return(function(y){Ll(y,48,"Invalid PKCS#8 structure"),Hl(y),Ll(y,2,"Expected version field");const m=Hl(y);y.pos+=m,Ll(y,48,"Expected algorithm identifier"),Hl(y)})(v),Uk(v)}),Hk("pkcs8",o,a,d)},es=r=>r==null?void 0:r[Symbol.toStringTag],vh=(r,a,i)=>{if(a.use!==void 0){let d;switch(i){case"sign":case"verify":d="sig";break;case"encrypt":case"decrypt":d="enc"}if(a.use!==d)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(d,'" when present'))}if(a.alg!==void 0&&a.alg!==r)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(r,'" when present'));if(Array.isArray(a.key_ops)){var l,o;let d;switch(!0){case i==="verify":case r==="dir":case r.includes("CBC-HS"):d=i;break;case r.startsWith("PBES2"):d="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(r):d=!r.includes("GCM")&&r.endsWith("KW")?"unwrapKey":i;break;case i==="encrypt":d="wrapKey";break;case i==="decrypt":d=r.startsWith("RSA")?"unwrapKey":"deriveBits"}if(d&&((l=a.key_ops)===null||l===void 0||(o=l.includes)===null||o===void 0?void 0:o.call(l,d))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(d,'" when present'))}return!0};function Kk(r,a,i){switch(r.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((l,o,d)=>{if(!(o instanceof Uint8Array)){if(om(o)){if((f=>f.kty==="oct"&&typeof f.k=="string")(o)&&vh(l,o,d))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Iv(o))throw new TypeError(Wv(l,o,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(o.type!=="secret")throw new TypeError("".concat(es(o),' instances for symmetric algorithms must be of type "secret"'))}})(r,a,i);break;default:((l,o,d)=>{if(om(o))switch(d){case"decrypt":case"sign":if((f=>f.kty!=="oct"&&(f.kty==="AKP"&&typeof f.priv=="string"||typeof f.d=="string"))(o)&&vh(l,o,d))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((f=>f.kty!=="oct"&&f.d===void 0&&f.priv===void 0)(o)&&vh(l,o,d))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Iv(o))throw new TypeError(Wv(l,o,"CryptoKey","KeyObject","JSON Web Key"));if(o.type==="secret")throw new TypeError("".concat(es(o),' instances for asymmetric algorithms must not be of type "secret"'));if(o.type==="public")switch(d){case"sign":throw new TypeError("".concat(es(o),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(es(o),' instances for asymmetric algorithm decryption must be of type "private"'))}if(o.type==="private")switch(d){case"verify":throw new TypeError("".concat(es(o),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(es(o),' instances for asymmetric algorithm encryption must be of type "public"'))}})(r,a,i)}}var Kc,bh;let Za,tb;(typeof navigator>"u"||(Kc=navigator.userAgent)===null||Kc===void 0||(bh=Kc.startsWith)===null||bh===void 0||!bh.call(Kc,"Mozilla/5.0 "))&&(tb="".concat("openid-client","/").concat("v6.8.2"),Za={"user-agent":tb});const _t=r=>au.get(r);let au,qc;function Px(r){return r!==void 0?Yv(r):(qc||(qc=new WeakMap),(a,i,l,o)=>{let d;return(d=qc.get(i))||((function(f,v){if(typeof f!="string")throw Ya("".concat(v," must be a string"),lo);if(f.length===0)throw Ya("".concat(v," must not be empty"),so)})(i.client_secret,'"metadata.client_secret"'),d=Yv(i.client_secret),qc.set(i,d)),d(a,i,l,o)})}const vn=Oa,so="ERR_INVALID_ARG_VALUE",lo="ERR_INVALID_ARG_TYPE";function Ya(r,a,i){const l=new TypeError(r,{cause:i});return Object.assign(l,{code:a}),l}function qk(r){return(async function(a){return ut(a,"codeVerifier"),li(await crypto.subtle.digest("SHA-256",cs(a)))})(r)}function Bk(){return Tx()}class pu extends Error{constructor(a,i){var l;super(a,i),ne(this,"code",void 0),this.name=this.constructor.name,this.code=i==null?void 0:i.code,(l=Error.captureStackTrace)===null||l===void 0||l.call(Error,this,this.constructor)}}function Ct(r,a,i){return new pu(r,{cause:a,code:i})}function Dt(r){if(r instanceof TypeError||r instanceof pu||r instanceof _u||r instanceof jx||r instanceof Lm)throw r;if(r instanceof Um)switch(r.code){case Ox:throw Ct("only requests to HTTPS are allowed",r,r.code);case Dx:throw Ct("only requests to HTTP or HTTPS are allowed",r,r.code);case Gm:throw Ct("unexpected HTTP response status code",r.cause,r.code);case Rx:throw Ct("unexpected response content-type",r.cause,r.code);case mu:throw Ct("parsing error occured",r,r.code);case Re:throw Ct("invalid response encountered",r,r.code);case bn:throw Ct("unexpected JWT claim value encountered",r,r.code);case sm:throw Ct("unexpected JSON attribute value encountered",r,r.code);case Zl:throw Ct("JWT timestamp claim value failed validation",r,r.code);default:throw Ct(r.message,r,r.code)}if(r instanceof ra)throw Ct("unsupported operation",r,r.code);if(r instanceof DOMException)switch(r.name){case"OperationError":throw Ct("runtime operation error",r,im);case"NotSupportedError":throw Ct("runtime unsupported operation",r,im);case"TimeoutError":throw Ct("operation timed out",r,"OAUTH_TIMEOUT");case"AbortError":throw Ct("operation aborted",r,"OAUTH_ABORT")}throw new pu("something went wrong",{cause:r})}async function Gk(r,a,i,l,o){const d=await(async function(y,m){var g,b;if(!(y instanceof URL))throw Ya('"server" must be an instance of URL',lo);const w=!y.href.includes("/.well-known/"),_=(g=m==null?void 0:m.timeout)!==null&&g!==void 0?g:30,C=AbortSignal.timeout(1e3*_),E=await(w?ik(y,{algorithm:m==null?void 0:m.algorithm,[Oa]:m==null?void 0:m[vn],[ba]:m==null||(b=m.execute)===null||b===void 0?void 0:b.includes(rb),signal:C,headers:new Headers(Za)}):((m==null?void 0:m[vn])||fetch)((Hm(y,m==null||(S=m.execute)===null||S===void 0||!S.includes(rb)),y.href),{headers:Object.fromEntries(new Headers(ce({accept:"application/json"},Za)).entries()),body:void 0,method:"GET",redirect:"manual",signal:C})).then(N=>(async function(H,K){const L=H;if(!(L instanceof URL)&&L!==mh)throw He('"expectedIssuerIdentifier" must be an instance of URL',Zt);if(!Ns(K,Response))throw He('"response" must be an instance of Response',Zt);if(K.status!==200)throw ye('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Gm,K);io(K);const U=await Eu(K);if(ut(U.issuer,'"response" body "issuer" property',Re,{body:U}),L!==mh&&new URL(U.issuer).href!==L.href)throw ye('"response" body "issuer" property does not match the expected value',sm,{expected:L.href,body:U,attribute:"issuer"});return U})(mh,N)).catch(Dt);var S;return w&&new URL(E.issuer).href!==y.href&&((function(N,H,K){return!(N.origin!=="https://login.microsoftonline.com"||K!=null&&K.algorithm&&K.algorithm!=="oidc"||(H[Zx]=!0,0))})(y,E,m)||(function(N,H){return!(!N.hostname.endsWith(".b2clogin.com")||H!=null&&H.algorithm&&H.algorithm!=="oidc")})(y,m)||(()=>{throw new pu("discovered metadata issuer does not match the expected issuer",{code:sm,cause:{expected:y.href,body:E,attribute:"issuer"}})})()),E})(r,o),f=new Vl(d,a,i,l);let v=_t(f);if(o!=null&&o[vn]&&(v.fetch=o[vn]),o!=null&&o.timeout&&(v.timeout=o.timeout),o!=null&&o.execute)for(const y of o.execute)y(f);return f}new TextDecoder;const Zx=Symbol();class Vl{constructor(a,i,l,o){var d,f,v,y,m;if(typeof i!="string"||!i.length)throw Ya('"clientId" must be a non-empty string',lo);if(typeof l=="string"&&(l={client_secret:l}),((d=l)===null||d===void 0?void 0:d.client_id)!==void 0&&i!==l.client_id)throw Ya('"clientId" and "metadata.client_id" must be the same',so);const g=ce(ce({},structuredClone(l)),{},{client_id:i});let b;g[em]=(f=(v=l)===null||v===void 0?void 0:v[em])!==null&&f!==void 0?f:0,g[tm]=(y=(m=l)===null||m===void 0?void 0:m[tm])!==null&&y!==void 0?y:30,b=o||(typeof g.client_secret=="string"&&g.client_secret.length?Px(g.client_secret):(E,S,N,H)=>{N.set("client_id",S.client_id)});let w=Object.freeze(g);const _=structuredClone(a);Zx in a&&(_[zx]=E=>{let{claims:{tid:S}}=E;return a.issuer.replace("{tenantid}",S)});let C=Object.freeze(_);au||(au=new WeakMap),au.set(this,{__proto__:null,as:C,c:w,auth:b,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const a=structuredClone(_t(this).as);return(function(i){Object.defineProperties(i,(function(l){return{supportsPKCE:{__proto__:null,value(){var o;let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((o=l.code_challenge_methods_supported)===null||o===void 0?void 0:o.includes(d))===!0}}}})(i))})(a),a}clientMetadata(){return structuredClone(_t(this).c)}get timeout(){return _t(this).timeout}set timeout(a){_t(this).timeout=a}get[vn](){return _t(this).fetch}set[vn](a){_t(this).fetch=a}}function oo(r){Object.defineProperties(r,(function(a){let i;if(a.expires_in!==void 0){const l=new Date;l.setSeconds(l.getSeconds()+a.expires_in),i=l.getTime()}return{expiresIn:{__proto__:null,value(){if(i){const l=Date.now();return i>l?Math.floor((i-l)/1e3):0}}},claims:{__proto__:null,value(){try{return rm(this)}catch{return}}}}})(r))}async function ab(r,a,i){var l;let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const d=(l=r.headers.get("retry-after"))===null||l===void 0?void 0:l.trim();if(d===void 0)return;let f;if(/^\d+$/.test(d))f=parseInt(d,10);else{const v=new Date(d);if(Number.isFinite(v.getTime())){const y=new Date,m=v.getTime()-y.getTime();m>0&&(f=Math.ceil(m/1e3))}}if(o&&!Number.isFinite(f))throw new Um("invalid Retry-After header value",{cause:r});f>a&&await Yx(f-a,i)}function Yx(r,a){return new Promise((i,l)=>{const o=d=>{try{a.throwIfAborted()}catch(v){return void l(v)}if(d<=0)return void i();const f=Math.min(d,5);setTimeout(()=>o(d-f),1e3*f)};o(r)})}async function nb(r,a){kn(r);const{as:i,c:l,auth:o,fetch:d,tlsOnly:f,timeout:v}=_t(r);return(async function(y,m,g,b,w){Ca(y),Ra(m);const _=no(y,"backchannel_authentication_endpoint",m.use_mtls_endpoint_aliases,(w==null?void 0:w[ba])!==!0),C=new URLSearchParams(b);C.set("client_id",m.client_id);const E=Su(w==null?void 0:w.headers);return E.set("accept","application/json"),qm(y,m,g,_,C,E,w)})(i,l,o,a,{[Oa]:d,[ba]:!f,headers:new Headers(Za),signal:di(v)}).then(y=>(async function(m,g,b){if(Ca(m),Ra(g),!Ns(b,Response))throw He('"response" must be an instance of Response',Zt);await Km(b,200,"Backchannel Authentication Endpoint"),io(b);const w=await Eu(b);ut(w.auth_req_id,'"response" body "auth_req_id" property',Re,{body:w});let _=typeof w.expires_in!="number"?parseFloat(w.expires_in):w.expires_in;return vr(_,!0,'"response" body "expires_in" property',Re,{body:w}),w.expires_in=_,w.interval!==void 0&&vr(w.interval,!1,'"response" body "interval" property',Re,{body:w}),w})(i,l,y)).catch(Dt)}async function Vx(r,a,i,l){var o,d;kn(r),i=new URLSearchParams(i);let f=(o=a.interval)!==null&&o!==void 0?o:5;const v=(d=l==null?void 0:l.signal)!==null&&d!==void 0?d:AbortSignal.timeout(1e3*a.expires_in);try{await Yx(f,v)}catch(U){Dt(U)}const{as:y,c:m,auth:g,fetch:b,tlsOnly:w,nonRepudiation:_,timeout:C,decrypt:E}=_t(r),S=(U,I)=>Vx(r,ce(ce({},a),{},{interval:U}),i,ce(ce({},l),{},{signal:v,flag:I})),N=await(async function(U,I,$,ee,X){Ca(U),Ra(I),ut(ee,'"authReqId"');const ie=new URLSearchParams(X==null?void 0:X.additionalParameters);return ie.set("auth_req_id",ee),ro(U,I,$,"urn:openid:params:grant-type:ciba",ie,X)})(y,m,g,a.auth_req_id,{[Oa]:b,[ba]:!w,additionalParameters:i,DPoP:l==null?void 0:l.DPoP,headers:new Headers(Za),signal:v.aborted?v:di(C)}).catch(Dt);var H;if(N.status===503&&N.headers.has("retry-after"))return await ab(N,f,v,!0),await((H=N.body)===null||H===void 0?void 0:H.cancel()),S(f);const K=(async function(U,I,$,ee){return Es(U,I,$,void 0,ee==null?void 0:ee[Sn],ee==null?void 0:ee.recognizedTokenTypes)})(y,m,N,{[Sn]:E});let L;try{L=await K}catch(U){if(co(U,l))return S(f,br);if(U instanceof _u)switch(U.error){case"slow_down":f+=5;case"authorization_pending":return await ab(U.response,f,v),S(f)}Dt(U)}return L.id_token&&await(_==null?void 0:_(N)),oo(L),L}function rb(r){_t(r).tlsOnly=!1}async function Qx(r,a,i,l,o){if(kn(r),!((o==null?void 0:o.flag)===br||a instanceof URL||(function(U,I){try{return Object.getPrototypeOf(U)[Symbol.toStringTag]===I}catch{return!1}})(a,"Request")))throw Ya('"currentUrl" must be an instance of URL, or Request',lo);let d,f;const{as:v,c:y,auth:m,fetch:g,tlsOnly:b,jarm:w,hybrid:_,nonRepudiation:C,timeout:E,decrypt:S,implicit:N}=_t(r);if((o==null?void 0:o.flag)===br)d=o.authResponse,f=o.redirectUri;else{if(!(a instanceof URL)){const U=a;switch(a=new URL(a.url),U.method){case"GET":break;case"POST":const I=new URLSearchParams(await jk(U));if(_)a.hash=I.toString();else for(const[$,ee]of I.entries())a.searchParams.append($,ee);break;default:throw Ya("unexpected Request HTTP method",so)}}switch(f=(function(U){return(U=new URL(U)).search="",U.hash="",U.href})(a),!0){case!!w:d=await w(a,i==null?void 0:i.expectedState);break;case!!_:d=await _(a,i==null?void 0:i.expectedNonce,i==null?void 0:i.expectedState,i==null?void 0:i.maxAge);break;case!!N:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{d=Rk(v,y,a.searchParams,i==null?void 0:i.expectedState)}catch(U){Dt(U)}}}const H=await(async function(U,I,$,ee,X,ie,W){if(Ca(U),Ra(I),!Bm.has(ee))throw He('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',jt);ut(X,'"redirectUri"');const Q=Qr(ee,"code");if(!Q)throw ye('no authorization code in "callbackParameters"',Re);const pe=new URLSearchParams(W==null?void 0:W.additionalParameters);return pe.set("redirect_uri",X),pe.set("code",Q),ie!==Qv&&(ut(ie,'"codeVerifier"'),pe.set("code_verifier",ie)),ro(U,I,$,"authorization_code",pe,W)})(v,y,m,d,f,(i==null?void 0:i.pkceCodeVerifier)||Qv,{additionalParameters:l,[Oa]:g,[ba]:!b,DPoP:o==null?void 0:o.DPoP,headers:new Headers(Za),signal:di(E)}).catch(Dt);typeof(i==null?void 0:i.expectedNonce)!="string"&&typeof(i==null?void 0:i.maxAge)!="number"||(i.idTokenExpected=!0);const K=xk(v,y,H,{expectedNonce:i==null?void 0:i.expectedNonce,maxAge:i==null?void 0:i.maxAge,requireIdToken:i==null?void 0:i.idTokenExpected,[Sn]:S});let L;try{L=await K}catch(U){if(co(U,o))return Qx(r,void 0,i,l,ce(ce({},o),{},{flag:br,authResponse:d,redirectUri:f}));Dt(U)}return L.id_token&&await(C==null?void 0:C(H)),oo(L),L}async function Jx(r,a,i,l){kn(r),i=new URLSearchParams(i);const{as:o,c:d,auth:f,fetch:v,tlsOnly:y,nonRepudiation:m,timeout:g,decrypt:b}=_t(r),w=await(async function(E,S,N,H,K){Ca(E),Ra(S),ut(H,'"refreshToken"');const L=new URLSearchParams(K==null?void 0:K.additionalParameters);return L.set("refresh_token",H),ro(E,S,N,"refresh_token",L,K)})(o,d,f,a,{[Oa]:v,[ba]:!y,additionalParameters:i,DPoP:l==null?void 0:l.DPoP,headers:new Headers(Za),signal:di(g)}).catch(Dt),_=(async function(E,S,N,H){return Es(E,S,N,void 0,H==null?void 0:H[Sn],H==null?void 0:H.recognizedTokenTypes)})(o,d,w,{[Sn]:b});let C;try{C=await _}catch(E){if(co(E,l))return Jx(r,a,i,ce(ce({},l),{},{flag:br}));Dt(E)}return C.id_token&&await(m==null?void 0:m(w)),oo(C),C}async function Xx(r,a,i){kn(r),a=new URLSearchParams(a);const{as:l,c:o,auth:d,fetch:f,tlsOnly:v,timeout:y}=_t(r),m=await(async function(w,_,C,E,S){return Ca(w),Ra(_),ro(w,_,C,"client_credentials",new URLSearchParams(E),S)})(l,o,d,a,{[Oa]:f,[ba]:!v,DPoP:i==null?void 0:i.DPoP,headers:new Headers(Za),signal:di(y)}).catch(Dt),g=(async function(w,_,C,E){return Es(w,_,C,void 0,void 0,void 0)})(l,o,m);let b;try{b=await g}catch(w){if(co(w,i))return Xx(r,a,ce(ce({},i),{},{flag:br}));Dt(w)}return oo(b),b}function cm(r,a){kn(r);const{as:i,c:l,tlsOnly:o,hybrid:d,jarm:f,implicit:v}=_t(r),y=no(i,"authorization_endpoint",!1,o);if((a=new URLSearchParams(a)).has("client_id")||a.set("client_id",l.client_id),!a.has("request_uri")&&!a.has("request")){if(a.has("response_type")||a.set("response_type",d?"code id_token":v?"id_token":"code"),v&&!a.has("nonce"))throw Ya("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",so);f&&a.set("response_mode","jwt")}for(const[m,g]of a.entries())y.searchParams.append(m,g);return y}async function Wx(r,a,i){kn(r);const l=cm(r,a),{as:o,c:d,auth:f,fetch:v,tlsOnly:y,timeout:m}=_t(r),g=await(async function(_,C,E,S,N){var H;Ca(_),Ra(C);const K=no(_,"pushed_authorization_request_endpoint",C.use_mtls_endpoint_aliases,(N==null?void 0:N[ba])!==!0),L=new URLSearchParams(S);L.set("client_id",C.client_id);const U=Su(N==null?void 0:N.headers);U.set("accept","application/json"),(N==null?void 0:N.DPoP)!==void 0&&(Ax(N.DPoP),await N.DPoP.addProof(K,U,"POST"));const I=await qm(_,C,E,K,L,U,N);return N==null||(H=N.DPoP)===null||H===void 0||H.cacheNonce(I,K),I})(o,d,f,l.searchParams,{[Oa]:v,[ba]:!y,DPoP:i==null?void 0:i.DPoP,headers:new Headers(Za),signal:di(m)}).catch(Dt),b=(async function(_,C,E){if(Ca(_),Ra(C),!Ns(E,Response))throw He('"response" must be an instance of Response',Zt);await Km(E,201,"Pushed Authorization Request Endpoint"),io(E);const S=await Eu(E);ut(S.request_uri,'"response" body "request_uri" property',Re,{body:S});let N=typeof S.expires_in!="number"?parseFloat(S.expires_in):S.expires_in;return vr(N,!0,'"response" body "expires_in" property',Re,{body:S}),S.expires_in=N,S})(o,d,g);let w;try{w=await b}catch(_){if(co(_,i))return Wx(r,a,ce(ce({},i),{},{flag:br}));Dt(_)}return cm(r,{request_uri:w.request_uri})}function kn(r){if(!(r instanceof Vl))throw Ya('"config" must be an instance of Configuration',lo);if(Object.getPrototypeOf(r)!==Vl.prototype)throw Ya("subclassing Configuration is not allowed",so)}function di(r){return r?AbortSignal.timeout(1e3*r):void 0}function co(r,a){return!(a==null||!a.DPoP||a.flag===br)&&(function(i){if(i instanceof Lm){const{0:l,length:o}=i.cause;return o===1&&l.scheme==="dpop"&&l.parameters.error==="use_dpop_nonce"}return i instanceof _u&&i.error==="use_dpop_nonce"})(r)}Object.freeze(Vl.prototype);const br=Symbol();async function Vm(r,a,i,l){kn(r);const{as:o,c:d,auth:f,fetch:v,tlsOnly:y,timeout:m,decrypt:g}=_t(r),b=await(async function(w,_,C,E,S,N){return Ca(w),Ra(_),ut(E,'"grantType"'),ro(w,_,C,E,new URLSearchParams(S),N)})(o,d,f,a,new URLSearchParams(i),{[Oa]:v,[ba]:!y,DPoP:void 0,headers:new Headers(Za),signal:di(m)}).then(w=>{let _;return a==="urn:ietf:params:oauth:grant-type:token-exchange"&&(_={n_a:()=>{}}),(async function(C,E,S,N){return Es(C,E,S,void 0,N==null?void 0:N[Sn],N==null?void 0:N.recognizedTokenTypes)})(o,d,w,{[Sn]:g,recognizedTokenTypes:_})}).catch(Dt);return oo(b),b}async function Pk(r,a,i){if(!xr(r))throw new pt("Flattened JWS must be an object");if(r.protected===void 0&&r.header===void 0)throw new pt('Flattened JWS must have either of the "protected" or "header" members');if(r.protected!==void 0&&typeof r.protected!="string")throw new pt("JWS Protected Header incorrect type");if(r.payload===void 0)throw new pt("JWS Payload missing");if(typeof r.signature!="string")throw new pt("JWS Signature missing or incorrect type");if(r.header!==void 0&&!xr(r.header))throw new pt("JWS Unprotected Header incorrect type");let l={};if(r.protected)try{const E=ku(r.protected);l=JSON.parse(Yl.decode(E))}catch{throw new pt("JWS Protected Header is invalid")}if(!(function(){for(var E=arguments.length,S=new Array(E),N=0;N<E;N++)S[N]=arguments[N];const H=S.filter(Boolean);if(H.length===0||H.length===1)return!0;let K;for(const L of H){const U=Object.keys(L);if(K&&K.size!==0)for(const I of U){if(K.has(I))return!1;K.add(I)}else K=new Set(U)}return!0})(l,r.header))throw new pt("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o=ce(ce({},l),r.header),d=(function(E,S,N,H,K){if(K.crit!==void 0&&(H==null?void 0:H.crit)===void 0)throw new E('"crit" (Critical) Header Parameter MUST be integrity protected');if(!H||H.crit===void 0)return new Set;if(!Array.isArray(H.crit)||H.crit.length===0||H.crit.some(U=>typeof U!="string"||U.length===0))throw new E('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let L;L=N!==void 0?new Map([...Object.entries(N),...S.entries()]):S;for(const U of H.crit){if(!L.has(U))throw new na('Extension Header Parameter "'.concat(U,'" is not recognized'));if(K[U]===void 0)throw new E('Extension Header Parameter "'.concat(U,'" is missing'));if(L.get(U)&&H[U]===void 0)throw new E('Extension Header Parameter "'.concat(U,'" MUST be integrity protected'))}return new Set(H.crit)})(pt,new Map([["b64",!0]]),i==null?void 0:i.crit,l,o);let f=!0;if(d.has("b64")&&(f=l.b64,typeof f!="boolean"))throw new pt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:v}=o;if(typeof v!="string"||!v)throw new pt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const y=i&&(function(E,S){if(S!==void 0&&(!Array.isArray(S)||S.some(N=>typeof N!="string")))throw new TypeError('"'.concat(E,'" option must be an array of strings'));if(S)return new Set(S)})("algorithms",i.algorithms);if(y&&!y.has(v))throw new Hx('"alg" (Algorithm) Header Parameter value not allowed');if(f){if(typeof r.payload!="string")throw new pt("JWS Payload must be a string")}else if(typeof r.payload!="string"&&!(r.payload instanceof Uint8Array))throw new pt("JWS Payload must be a string or an Uint8Array instance");let m=!1;typeof a=="function"&&(a=await a(l,r),m=!0),Kk(v,a,"verify");const g=(function(){for(var E=arguments.length,S=new Array(E),N=0;N<E;N++)S[N]=arguments[N];const H=S.reduce((U,I)=>{let{length:$}=I;return U+$},0),K=new Uint8Array(H);let L=0;for(const U of S)K.set(U,L),L+=U.length;return K})(r.protected!==void 0?ph(r.protected):new Uint8Array,ph("."),typeof r.payload=="string"?f?ph(r.payload):Xv.encode(r.payload):r.payload),b=Fv(r.signature,"signature",pt),w=await Mk(a,v);if(!await zk(v,w,b,g))throw new qx;let _;_=f?Fv(r.payload,"payload",pt):typeof r.payload=="string"?Xv.encode(r.payload):r.payload;const C={payload:_};return r.protected!==void 0&&(C.protectedHeader=l),r.header!==void 0&&(C.unprotectedHeader=r.header),m?ce(ce({},C),{},{key:w}):C}const Zk=86400,Yk=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function ib(r){const a=Yk.exec(r);if(!a||a[4]&&a[1])throw new TypeError("Invalid time period format");const i=parseFloat(a[2]);let l;switch(a[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":l=Math.round(i);break;case"minute":case"minutes":case"min":case"mins":case"m":l=Math.round(60*i);break;case"hour":case"hours":case"hr":case"hrs":case"h":l=Math.round(3600*i);break;case"day":case"days":case"d":l=Math.round(i*Zk);break;case"week":case"weeks":case"w":l=Math.round(604800*i);break;default:l=Math.round(31557600*i)}return a[1]==="-"||a[4]==="ago"?-l:l}const sb=r=>r.includes("/")?r.toLowerCase():"application/".concat(r.toLowerCase());function Vk(r,a){let i,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{i=JSON.parse(Yl.decode(a))}catch{}if(!xr(i))throw new Pm("JWT Claims Set must be a top-level JSON object");const{typ:o}=l;if(o&&(typeof r.typ!="string"||sb(r.typ)!==sb(o)))throw new Ea('unexpected "typ" JWT header value',i,"typ","check_failed");const{requiredClaims:d=[],issuer:f,subject:v,audience:y,maxTokenAge:m}=l,g=[...d];m!==void 0&&g.push("iat"),y!==void 0&&g.push("aud"),v!==void 0&&g.push("sub"),f!==void 0&&g.push("iss");for(const N of new Set(g.reverse()))if(!(N in i))throw new Ea('missing required "'.concat(N,'" claim'),i,N,"missing");if(f&&!(Array.isArray(f)?f:[f]).includes(i.iss))throw new Ea('unexpected "iss" claim value',i,"iss","check_failed");if(v&&i.sub!==v)throw new Ea('unexpected "sub" claim value',i,"sub","check_failed");if(y&&(b=i.aud,w=typeof y=="string"?[y]:y,!(typeof b=="string"?w.includes(b):Array.isArray(b)&&w.some(Set.prototype.has.bind(new Set(b))))))throw new Ea('unexpected "aud" claim value',i,"aud","check_failed");var b,w;let _;switch(typeof l.clockTolerance){case"string":_=ib(l.clockTolerance);break;case"number":_=l.clockTolerance;break;case"undefined":_=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:C}=l,E=(S=C||new Date,Math.floor(S.getTime()/1e3));var S;if((i.iat!==void 0||m)&&typeof i.iat!="number")throw new Ea('"iat" claim must be a number',i,"iat","invalid");if(i.nbf!==void 0){if(typeof i.nbf!="number")throw new Ea('"nbf" claim must be a number',i,"nbf","invalid");if(i.nbf>E+_)throw new Ea('"nbf" claim timestamp check failed',i,"nbf","check_failed")}if(i.exp!==void 0){if(typeof i.exp!="number")throw new Ea('"exp" claim must be a number',i,"exp","invalid");if(i.exp<=E-_)throw new lm('"exp" claim timestamp check failed',i,"exp","check_failed")}if(m){const N=E-i.iat;if(N-_>(typeof m=="number"?m:ib(m)))throw new lm('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed");if(N<0-_)throw new Ea('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}return i}async function Qk(r,a,i){var l;const o=await(async function(f,v,y){if(f instanceof Uint8Array&&(f=Yl.decode(f)),typeof f!="string")throw new pt("Compact JWS must be a string or Uint8Array");const{0:m,1:g,2:b,length:w}=f.split(".");if(w!==3)throw new pt("Invalid Compact JWS");const _=await Pk({payload:g,protected:m,signature:b},v,y),C={payload:_.payload,protectedHeader:_.protectedHeader};return typeof v=="function"?ce(ce({},C),{},{key:_.key}):C})(r,a,i);if((l=o.protectedHeader.crit)!==null&&l!==void 0&&l.includes("b64")&&o.protectedHeader.b64===!1)throw new Pm("JWTs MUST NOT use unencoded payload");const d={payload:Vk(o.protectedHeader,o.payload,i),protectedHeader:o.protectedHeader};return typeof a=="function"?ce(ce({},d),{},{key:o.key}):d}function Jk(r){return xr(r)}var Bc,xh,Gc=new WeakMap,wh=new WeakMap;class Xk{constructor(a){if(Ye(this,Gc,void 0),Ye(this,wh,new WeakMap),!(function(i){return i&&typeof i=="object"&&Array.isArray(i.keys)&&i.keys.every(Jk)})(a))throw new Zm("JSON Web Key Set malformed");Ce(Gc,this,structuredClone(a))}jwks(){return J(Gc,this)}async getKey(a,i){const{alg:l,kid:o}=ce(ce({},a),i==null?void 0:i.header),d=(function(m){switch(typeof m=="string"&&m.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new na('Unsupported "alg" value for a JSON Web Key Set')}})(l),f=J(Gc,this).keys.filter(m=>{let g=d===m.kty;if(g&&typeof o=="string"&&(g=o===m.kid),!g||typeof m.alg!="string"&&d!=="AKP"||(g=l===m.alg),g&&typeof m.use=="string"&&(g=m.use==="sig"),g&&Array.isArray(m.key_ops)&&(g=m.key_ops.includes("verify")),g)switch(l){case"ES256":g=m.crv==="P-256";break;case"ES384":g=m.crv==="P-384";break;case"ES512":g=m.crv==="P-521";break;case"Ed25519":case"EdDSA":g=m.crv==="Ed25519"}return g}),{0:v,length:y}=f;if(y===0)throw new Ym;if(y!==1){const m=new Lx,g=J(wh,this);throw m[Symbol.asyncIterator]=tk(function*(){for(const b of f)try{yield yield ek(lb(g,b,l))}catch{}}),m}return lb(J(wh,this),v,l)}}async function lb(r,a,i){const l=r.get(a)||r.set(a,{}).get(a);if(l[i]===void 0){const o=await(async function(d,f,v){var y;if(!xr(d))throw new TypeError("JWK must be an object");let m;switch(f!=null||(f=d.alg),m!=null||(m=(y=void 0)!==null&&y!==void 0?y:d.ext),d.kty){case"oct":if(typeof d.k!="string"||!d.k)throw new TypeError('missing "k" (Key Value) Parameter value');return ku(d.k);case"RSA":if("oth"in d&&d.oth!==void 0)throw new na('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return tu(ce(ce({},d),{},{alg:f,ext:m}));case"AKP":if(typeof d.alg!="string"||!d.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(f!==void 0&&f!==d.alg)throw new TypeError("JWK alg and alg option value mismatch");return tu(ce(ce({},d),{},{ext:m}));case"EC":case"OKP":return tu(ce(ce({},d),{},{alg:f,ext:m}));default:throw new na('Unsupported "kty" (Key Type) Parameter value')}})(ce(ce({},a),{},{ext:!0}),i);if(o instanceof Uint8Array||o.type!=="public")throw new Zm("JSON Web Key Set members must be public keys");l[i]=o}return l[i]}function ob(r){const a=new Xk(r),i=async(l,o)=>a.getKey(l,o);return Object.defineProperties(i,{jwks:{value:()=>structuredClone(a.jwks()),enumerable:!1,configurable:!1,writable:!1}}),i}let um;(typeof navigator>"u"||(Bc=navigator.userAgent)===null||Bc===void 0||(xh=Bc.startsWith)===null||xh===void 0||!xh.call(Bc,"Mozilla/5.0 "))&&(um="".concat("jose","/").concat("v6.2.2"));const Ix=Symbol(),nu=Symbol();var Sh=new WeakMap,_h=new WeakMap,Eh=new WeakMap,Pc=new WeakMap,Gr=new WeakMap,fn=new WeakMap,er=new WeakMap,kh=new WeakMap,Pr=new WeakMap,Zr=new WeakMap;class Wk{constructor(a,i){if(Ye(this,Sh,void 0),Ye(this,_h,void 0),Ye(this,Eh,void 0),Ye(this,Pc,void 0),Ye(this,Gr,void 0),Ye(this,fn,void 0),Ye(this,er,void 0),Ye(this,kh,void 0),Ye(this,Pr,void 0),Ye(this,Zr,void 0),!(a instanceof URL))throw new TypeError("url must be an instance of URL");var l,o;Ce(Sh,this,new URL(a.href)),Ce(_h,this,typeof(i==null?void 0:i.timeoutDuration)=="number"?i==null?void 0:i.timeoutDuration:5e3),Ce(Eh,this,typeof(i==null?void 0:i.cooldownDuration)=="number"?i==null?void 0:i.cooldownDuration:3e4),Ce(Pc,this,typeof(i==null?void 0:i.cacheMaxAge)=="number"?i==null?void 0:i.cacheMaxAge:6e5),Ce(er,this,new Headers(i==null?void 0:i.headers)),um&&!J(er,this).has("User-Agent")&&J(er,this).set("User-Agent",um),J(er,this).has("accept")||(J(er,this).set("accept","application/json"),J(er,this).append("accept","application/jwk-set+json")),Ce(kh,this,i==null?void 0:i[Ix]),(i==null?void 0:i[nu])!==void 0&&(Ce(Zr,this,i==null?void 0:i[nu]),l=i==null?void 0:i[nu],o=J(Pc,this),typeof l=="object"&&l!==null&&"uat"in l&&typeof l.uat=="number"&&!(Date.now()-l.uat>=o)&&"jwks"in l&&xr(l.jwks)&&Array.isArray(l.jwks.keys)&&Array.prototype.every.call(l.jwks.keys,xr)&&(Ce(Gr,this,J(Zr,this).uat),Ce(Pr,this,ob(J(Zr,this).jwks))))}pendingFetch(){return!!J(fn,this)}coolingDown(){return typeof J(Gr,this)=="number"&&Date.now()<J(Gr,this)+J(Eh,this)}fresh(){return typeof J(Gr,this)=="number"&&Date.now()<J(Gr,this)+J(Pc,this)}jwks(){var a;return(a=J(Pr,this))===null||a===void 0?void 0:a.jwks()}async getKey(a,i){J(Pr,this)&&this.fresh()||await this.reload();try{return await J(Pr,this).call(this,a,i)}catch(l){if(l instanceof Ym&&this.coolingDown()===!1)return await this.reload(),J(Pr,this).call(this,a,i);throw l}}async reload(){J(fn,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&Ce(fn,this,void 0),J(fn,this)||Ce(fn,this,(async function(a,i,l){const d=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(a,{method:"GET",signal:l,redirect:"manual",headers:i}).catch(f=>{throw f.name==="TimeoutError"?new Kx:f});if(d.status!==200)throw new Et("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await d.json()}catch{throw new Et("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(J(Sh,this).href,J(er,this),AbortSignal.timeout(J(_h,this)),J(kh,this)).then(a=>{Ce(Pr,this,ob(a)),J(Zr,this)&&(J(Zr,this).uat=Date.now(),J(Zr,this).jwks=a),Ce(Gr,this,Date.now()),Ce(fn,this,void 0)}).catch(a=>{throw Ce(fn,this,void 0),a})),await J(fn,this)}}const Ik=["mfaToken"],Fk=["mfaToken"];var Yr,Zc,Vr,pa,Yc,Vc,ka,Ha,ss,qe,sr,Cl,Kl,us,Qc,Xe,cb=class extends Error{constructor(r,a){super(a),ne(this,"code",void 0),this.name="NotSupportedError",this.code=r}},Tn=class extends Error{constructor(r,a,i){super(a),ne(this,"cause",void 0),ne(this,"code",void 0),this.code=r,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},$k=class extends Tn{constructor(r,a){super("token_by_code_error",r,a),this.name="TokenByCodeError"}},eT=class extends Tn{constructor(r,a){super("token_by_client_credentials_error",r,a),this.name="TokenByClientCredentialsError"}},tT=class extends Tn{constructor(r,a){super("token_by_refresh_token_error",r,a),this.name="TokenByRefreshTokenError"}},Th=class extends Tn{constructor(r,a){super("token_for_connection_error",r,a),this.name="TokenForConnectionErrorCode"}},Ba=class extends Tn{constructor(r,a){super("token_exchange_error",r,a),this.name="TokenExchangeError"}},tr=class extends Error{constructor(r){super(r),ne(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},jh=class extends Tn{constructor(r){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",r),ne(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},aT=class extends Tn{constructor(r){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",r),this.name="BuildAuthorizationUrlError"}},nT=class extends Tn{constructor(r){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",r),this.name="BuildLinkUserUrlError"}},rT=class extends Tn{constructor(r){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",r),this.name="BuildUnlinkUserUrlError"}},iT=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),ne(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function dm(r){return Object.entries(r).filter(a=>{let[,i]=a;return i!==void 0}).reduce((a,i)=>ce(ce({},a),{},{[i[0]]:i[1]}),{})}var Tu=class extends Error{constructor(r,a,i){super(a),ne(this,"cause",void 0),ne(this,"code",void 0),this.code=r,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},Fx=class extends Tu{constructor(r,a){super("mfa_list_authenticators_error",r,a),this.name="MfaListAuthenticatorsError"}},$x=class extends Tu{constructor(r,a){super("mfa_enrollment_error",r,a),this.name="MfaEnrollmentError"}},sT=class extends Tu{constructor(r,a){super("mfa_delete_authenticator_error",r,a),this.name="MfaDeleteAuthenticatorError"}},ew=class extends Tu{constructor(r,a){super("mfa_challenge_error",r,a),this.name="MfaChallengeError"}};function lT(r){return{id:r.id,authenticatorType:r.authenticator_type,active:r.active,name:r.name,oobChannels:r.oob_channels,type:r.type}}var oT=(Yr=new WeakMap,Zc=new WeakMap,Vr=new WeakMap,class{constructor(r){var a;Ye(this,Yr,void 0),Ye(this,Zc,void 0),Ye(this,Vr,void 0),Ce(Yr,this,"https://".concat(r.domain)),Ce(Zc,this,r.clientId),Ce(Vr,this,(a=r.customFetch)!==null&&a!==void 0?a:function(){return fetch(...arguments)})}async listAuthenticators(r){const a="".concat(J(Yr,this),"/mfa/authenticators"),{mfaToken:i}=r,l=await J(Vr,this).call(this,a,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!l.ok){const o=await l.json();throw new Fx(o.error_description||"Failed to list authenticators",o)}return(await l.json()).map(lT)}async enrollAuthenticator(r){const a="".concat(J(Yr,this),"/mfa/associate"),{mfaToken:i}=r,l=Pv(r,Ik),o={authenticator_types:l.authenticatorTypes};"oobChannels"in l&&(o.oob_channels=l.oobChannels),"phoneNumber"in l&&l.phoneNumber&&(o.phone_number=l.phoneNumber),"email"in l&&l.email&&(o.email=l.email);const d=await J(Vr,this).call(this,a,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!d.ok){const f=await d.json();throw new $x(f.error_description||"Failed to enroll authenticator",f)}return(function(f){if(f.authenticator_type==="otp")return{authenticatorType:"otp",secret:f.secret,barcodeUri:f.barcode_uri,recoveryCodes:f.recovery_codes,id:f.id};if(f.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:f.oob_channel,oobCode:f.oob_code,bindingMethod:f.binding_method,id:f.id,barcodeUri:f.barcode_uri,recoveryCodes:f.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(f.authenticator_type))})(await d.json())}async deleteAuthenticator(r){const{authenticatorId:a,mfaToken:i}=r,l="".concat(J(Yr,this),"/mfa/authenticators/").concat(encodeURIComponent(a)),o=await J(Vr,this).call(this,l,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const d=await o.json();throw new sT(d.error_description||"Failed to delete authenticator",d)}}async challengeAuthenticator(r){const a="".concat(J(Yr,this),"/mfa/challenge"),{mfaToken:i}=r,l=Pv(r,Fk),o={mfa_token:i,client_id:J(Zc,this),challenge_type:l.challengeType};l.authenticatorId&&(o.authenticator_id=l.authenticatorId);const d=await J(Vr,this).call(this,a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!d.ok){const f=await d.json();throw new ew(f.error_description||"Failed to challenge authenticator",f)}return(function(f){const v={challengeType:f.challenge_type};return f.oob_code!==void 0&&(v.oobCode=f.oob_code),f.binding_method!==void 0&&(v.bindingMethod=f.binding_method),v})(await d.json())}}),Xr=class tw{constructor(a,i,l,o,d,f,v){ne(this,"accessToken",void 0),ne(this,"idToken",void 0),ne(this,"refreshToken",void 0),ne(this,"expiresAt",void 0),ne(this,"scope",void 0),ne(this,"claims",void 0),ne(this,"authorizationDetails",void 0),ne(this,"tokenType",void 0),ne(this,"issuedTokenType",void 0),this.accessToken=a,this.idToken=l,this.refreshToken=o,this.expiresAt=i,this.scope=d,this.claims=f,this.authorizationDetails=v}static fromTokenEndpointResponse(a){const i=a.id_token?a.claims():void 0,l=new tw(a.access_token,Math.floor(Date.now()/1e3)+Number(a.expires_in),a.id_token,a.refresh_token,a.scope,i,a.authorization_details);return l.tokenType=a.token_type,l.issuedTokenType=a.issued_token_type,l}},cT=(pa=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,class{constructor(r,a){Ye(this,pa,new Map),Ye(this,Yc,void 0),Ye(this,Vc,void 0),Ce(Vc,this,Math.max(1,Math.floor(r))),Ce(Yc,this,Math.max(0,Math.floor(a)))}get(r){const a=J(pa,this).get(r);if(a){if(!(Date.now()>=a.expiresAt))return J(pa,this).delete(r),J(pa,this).set(r,a),a.value;J(pa,this).delete(r)}}set(r,a){for(J(pa,this).has(r)&&J(pa,this).delete(r),J(pa,this).set(r,{value:a,expiresAt:Date.now()+J(Yc,this)});J(pa,this).size>J(Vc,this);){const i=J(pa,this).keys().next().value;if(i===void 0)break;J(pa,this).delete(i)}}}),ub=new Map;function db(r){return{ttlMs:1e3*(typeof(r==null?void 0:r.ttl)=="number"?r.ttl:600),maxEntries:typeof(r==null?void 0:r.maxEntries)=="number"&&r.maxEntries>0?r.maxEntries:100}}var fb=class{static createDiscoveryCache(r){const a=(i=r.maxEntries,l=r.ttlMs,"".concat(i,":").concat(l));var i,l;let o=(d=a,ub.get(d));var d;return o||(o=new cT(r.maxEntries,r.ttlMs),ub.set(a,o)),o}static createJwksCache(){return{}}},fm="openid profile email offline_access",uT=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function aw(r){if(r==null)throw new Ba("subject_token is required");if(typeof r!="string")throw new Ba("subject_token must be a string");if(r.trim().length===0)throw new Ba("subject_token cannot be blank or whitespace");if(r!==r.trim())throw new Ba("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(r))throw new Ba("subject_token must not include the 'Bearer ' prefix")}function nw(r,a){if(a){for(const[i,l]of Object.entries(a))if(!uT.has(i))if(Array.isArray(l)){if(l.length>20)throw new Ba("Parameter '".concat(i,"' exceeds maximum array size of ").concat(20));l.forEach(o=>{r.append(i,o)})}else r.append(i,l)}}var rw="urn:ietf:params:oauth:token-type:access_token",dT=(ka=new WeakMap,Ha=new WeakMap,ss=new WeakMap,qe=new WeakMap,sr=new WeakMap,Cl=new WeakMap,Kl=new WeakMap,us=new WeakMap,Qc=new WeakMap,Xe=new WeakSet,class{constructor(r){var a,i,l,o;if((function(f,v){Sx(f,v),v.add(f)})(this,Xe),Ye(this,ka,void 0),Ye(this,Ha,void 0),Ye(this,ss,void 0),Ye(this,qe,void 0),Ye(this,sr,void 0),Ye(this,Cl,void 0),Ye(this,Kl,void 0),Ye(this,us,void 0),Ye(this,Qc,void 0),ne(this,"mfa",void 0),Ce(qe,this,r),r.useMtls&&!r.customFetch)throw new cb("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");Ce(sr,this,(function(f,v){if(v.enabled===!1)return f;const y={name:v.name,version:v.version},m=btoa(JSON.stringify(y));return async(g,b)=>{const w=g instanceof Request?new Headers(g.headers):new Headers;return b!=null&&b.headers&&new Headers(b.headers).forEach((_,C)=>{w.set(C,_)}),w.set("Auth0-Client",m),f(g,ce(ce({},b),{},{headers:w}))}})((a=r.customFetch)!==null&&a!==void 0?a:function(){return fetch(...arguments)},((i=r.telemetry)==null?void 0:i.enabled)===!1?i:{enabled:!0,name:(l=i==null?void 0:i.name)!==null&&l!==void 0?l:"@auth0/auth0-auth-js",version:(o=i==null?void 0:i.version)!==null&&o!==void 0?o:"1.5.0"}));const d=db(r.discoveryCache);Ce(Kl,this,fb.createDiscoveryCache(d)),Ce(us,this,new Map),Ce(Qc,this,fb.createJwksCache()),this.mfa=new oT({domain:J(qe,this).domain,clientId:J(qe,this).clientId,customFetch:J(sr,this)})}async getServerMetadata(){const{serverMetadata:r}=await We(Xe,this,ta).call(this);return r}async buildAuthorizationUrl(r){const{serverMetadata:a}=await We(Xe,this,ta).call(this);if(r!=null&&r.pushedAuthorizationRequests&&!a.pushed_authorization_request_endpoint)throw new cb("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await We(Xe,this,Ah).call(this,r)}catch(i){throw new aT(i)}}async buildLinkUserUrl(r){try{const a=await We(Xe,this,Ah).call(this,{authorizationParams:ce(ce({},r.authorizationParams),{},{requested_connection:r.connection,requested_connection_scope:r.connectionScope,scope:"openid link_account offline_access",id_token_hint:r.idToken})});return{linkUserUrl:a.authorizationUrl,codeVerifier:a.codeVerifier}}catch(a){throw new nT(a)}}async buildUnlinkUserUrl(r){try{const a=await We(Xe,this,Ah).call(this,{authorizationParams:ce(ce({},r.authorizationParams),{},{requested_connection:r.connection,scope:"openid unlink_account",id_token_hint:r.idToken})});return{unlinkUserUrl:a.authorizationUrl,codeVerifier:a.codeVerifier}}catch(a){throw new rT(a)}}async backchannelAuthentication(r){const{configuration:a,serverMetadata:i}=await We(Xe,this,ta).call(this),l=dm(ce(ce({},J(qe,this).authorizationParams),r==null?void 0:r.authorizationParams)),o=new URLSearchParams(ce(ce({scope:fm},l),{},{client_id:J(qe,this).clientId,binding_message:r.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:i.issuer,sub:r.loginHint.sub})}));r.requestedExpiry&&o.append("requested_expiry",r.requestedExpiry.toString()),r.authorizationDetails&&o.append("authorization_details",JSON.stringify(r.authorizationDetails));try{const d=await nb(a,o),f=await Vx(a,d);return Xr.fromTokenEndpointResponse(f)}catch(d){throw new jh(d)}}async initiateBackchannelAuthentication(r){const{configuration:a,serverMetadata:i}=await We(Xe,this,ta).call(this),l=dm(ce(ce({},J(qe,this).authorizationParams),r==null?void 0:r.authorizationParams)),o=new URLSearchParams(ce(ce({scope:fm},l),{},{client_id:J(qe,this).clientId,binding_message:r.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:i.issuer,sub:r.loginHint.sub})}));r.requestedExpiry&&o.append("requested_expiry",r.requestedExpiry.toString()),r.authorizationDetails&&o.append("authorization_details",JSON.stringify(r.authorizationDetails));try{const d=await nb(a,o);return{authReqId:d.auth_req_id,expiresIn:d.expires_in,interval:d.interval}}catch(d){throw new jh(d)}}async backchannelAuthenticationGrant(r){let{authReqId:a}=r;const{configuration:i}=await We(Xe,this,ta).call(this),l=new URLSearchParams({auth_req_id:a});try{const o=await Vm(i,"urn:openid:params:grant-type:ciba",l);return Xr.fromTokenEndpointResponse(o)}catch(o){throw new jh(o)}}async getTokenForConnection(r){var a;if(r.refreshToken&&r.accessToken)throw new Th("Either a refresh or access token should be specified, but not both.");const i=(a=r.accessToken)!==null&&a!==void 0?a:r.refreshToken;if(!i)throw new Th("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:r.connection,subjectToken:i,subjectTokenType:r.accessToken?rw:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:r.loginHint})}catch(l){throw l instanceof Ba?new Th(l.message,l.cause):l}}async exchangeToken(r){return"connection"in r?We(Xe,this,hT).call(this,r):We(Xe,this,mT).call(this,r)}async getTokenByCode(r,a){const{configuration:i}=await We(Xe,this,ta).call(this);try{const l=await Qx(i,r,{pkceCodeVerifier:a.codeVerifier});return Xr.fromTokenEndpointResponse(l)}catch(l){throw new $k("There was an error while trying to request a token.",l)}}async getTokenByRefreshToken(r){const{configuration:a}=await We(Xe,this,ta).call(this),i=new URLSearchParams;r.audience&&i.append("audience",r.audience),r.scope&&i.append("scope",r.scope);try{const l=await Jx(a,r.refreshToken,i);return Xr.fromTokenEndpointResponse(l)}catch(l){throw new tT("The access token has expired and there was an error while trying to refresh it.",l)}}async getTokenByClientCredentials(r){const{configuration:a}=await We(Xe,this,ta).call(this);try{const i=new URLSearchParams({audience:r.audience});r.organization&&i.append("organization",r.organization);const l=await Xx(a,i);return Xr.fromTokenEndpointResponse(l)}catch(i){throw new eT("There was an error while trying to request a token.",i)}}async buildLogoutUrl(r){const{configuration:a,serverMetadata:i}=await We(Xe,this,ta).call(this);if(!i.end_session_endpoint){const l=new URL("https://".concat(J(qe,this).domain,"/v2/logout"));return l.searchParams.set("returnTo",r.returnTo),l.searchParams.set("client_id",J(qe,this).clientId),l}return(function(l,o){kn(l);const{as:d,c:f,tlsOnly:v}=_t(l),y=no(d,"end_session_endpoint",!1,v);(o=new URLSearchParams(o)).has("client_id")||o.set("client_id",f.client_id);for(const[m,g]of o.entries())y.searchParams.append(m,g);return y})(a,{post_logout_redirect_uri:r.returnTo})}async verifyLogoutToken(r){const{serverMetadata:a}=await We(Xe,this,ta).call(this),i=db(J(qe,this).discoveryCache),l=a.jwks_uri;J(Cl,this)||Ce(Cl,this,(function(d,f){const v=new Wk(d,f),y=async(m,g)=>v.getKey(m,g);return Object.defineProperties(y,{coolingDown:{get:()=>v.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>v.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>v.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>v.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>v.jwks(),enumerable:!0,configurable:!1,writable:!1}}),y})(new URL(l),{cacheMaxAge:i.ttlMs,[Ix]:J(sr,this),[nu]:J(Qc,this)}));const{payload:o}=await Qk(r.logoutToken,J(Cl,this),{issuer:a.issuer,audience:J(qe,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in o)&&!("sub"in o))throw new tr('either "sid" or "sub" (or both) claims must be present');if("sid"in o&&typeof o.sid!="string")throw new tr('"sid" claim must be a string');if("sub"in o&&typeof o.sub!="string")throw new tr('"sub" claim must be a string');if("nonce"in o)throw new tr('"nonce" claim is prohibited');if(!("events"in o))throw new tr('"events" claim is missing');if(typeof o.events!="object"||o.events===null)throw new tr('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in o.events))throw new tr('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof o.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new tr('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:o.sid,sub:o.sub}}});function fT(){const r=J(qe,this).domain.toLowerCase();return"".concat(r,"|mtls:").concat(J(qe,this).useMtls?"1":"0")}async function hb(r){const a=await We(Xe,this,iw).call(this),i=new Vl(r,J(qe,this).clientId,J(qe,this).clientSecret,a);return i[vn]=J(sr,this),i}async function ta(){if(J(ka,this)&&J(Ha,this))return{configuration:J(ka,this),serverMetadata:J(Ha,this)};const r=We(Xe,this,fT).call(this),a=J(Kl,this).get(r);if(a)return Ce(Ha,this,a.serverMetadata),Ce(ka,this,await We(Xe,this,hb).call(this,a.serverMetadata)),{configuration:J(ka,this),serverMetadata:J(Ha,this)};const i=J(us,this).get(r);if(i){const d=await i;return Ce(Ha,this,d.serverMetadata),Ce(ka,this,await We(Xe,this,hb).call(this,d.serverMetadata)),{configuration:J(ka,this),serverMetadata:J(Ha,this)}}const l=(async()=>{const d=await We(Xe,this,iw).call(this),f=await Gk(new URL("https://".concat(J(qe,this).domain)),J(qe,this).clientId,{use_mtls_endpoint_aliases:J(qe,this).useMtls},d,{[vn]:J(sr,this)}),v=f.serverMetadata();return J(Kl,this).set(r,{serverMetadata:v}),{configuration:f,serverMetadata:v}})(),o=l.then(d=>{let{serverMetadata:f}=d;return{serverMetadata:f}});o.catch(()=>{}),J(us,this).set(r,o);try{const{configuration:d,serverMetadata:f}=await l;Ce(ka,this,d),Ce(Ha,this,f),J(ka,this)[vn]=J(sr,this)}finally{J(us,this).delete(r)}return{configuration:J(ka,this),serverMetadata:J(Ha,this)}}async function hT(r){var a,i;const{configuration:l}=await We(Xe,this,ta).call(this);if("audience"in r||"resource"in r)throw new Ba("audience and resource parameters are not supported for Token Vault exchanges");aw(r.subjectToken);const o=new URLSearchParams({connection:r.connection,subject_token:r.subjectToken,subject_token_type:(a=r.subjectTokenType)!==null&&a!==void 0?a:rw,requested_token_type:(i=r.requestedTokenType)!==null&&i!==void 0?i:"http://auth0.com/oauth/token-type/federated-connection-access-token"});r.loginHint&&o.append("login_hint",r.loginHint),r.scope&&o.append("scope",r.scope),nw(o,r.extra);try{const d=await Vm(l,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Xr.fromTokenEndpointResponse(d)}catch(d){throw new Ba("Failed to exchange token for connection '".concat(r.connection,"'."),d)}}async function mT(r){const{configuration:a}=await We(Xe,this,ta).call(this);aw(r.subjectToken);const i=new URLSearchParams({subject_token_type:r.subjectTokenType,subject_token:r.subjectToken});r.audience&&i.append("audience",r.audience),r.scope&&i.append("scope",r.scope),r.requestedTokenType&&i.append("requested_token_type",r.requestedTokenType),r.organization&&i.append("organization",r.organization),nw(i,r.extra);try{const l=await Vm(a,"urn:ietf:params:oauth:grant-type:token-exchange",i);return Xr.fromTokenEndpointResponse(l)}catch(l){throw new Ba("Failed to exchange token of type '".concat(r.subjectTokenType,"'").concat(r.audience?" for audience '".concat(r.audience,"'"):"","."),l)}}async function iw(){return J(ss,this)||Ce(ss,this,(async()=>{if(!J(qe,this).clientSecret&&!J(qe,this).clientAssertionSigningKey&&!J(qe,this).useMtls)throw new iT;if(J(qe,this).useMtls)return(a,i,l,o)=>{l.set("client_id",i.client_id)};let r=J(qe,this).clientAssertionSigningKey;return!r||r instanceof CryptoKey||(r=await(async function(a,i,l){if(typeof a!="string"||a.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return Lk(a,i,l)})(r,J(qe,this).clientAssertionSigningAlg||"RS256")),r?(function(a,i){return lk(a)})(r):Px(J(qe,this).clientSecret)})().catch(r=>{throw Ce(ss,this,void 0),r})),J(ss,this)}async function Ah(r){const{configuration:a}=await We(Xe,this,ta).call(this),i=Bk(),l=await qk(i),o=dm(ce(ce({},J(qe,this).authorizationParams),r==null?void 0:r.authorizationParams)),d=new URLSearchParams(ce(ce({scope:fm},o),{},{client_id:J(qe,this).clientId,code_challenge:l,code_challenge_method:"S256"}));return{authorizationUrl:r!=null&&r.pushedAuthorizationRequests?await Wx(a,d):await cm(a,d),codeVerifier:i}}class wr extends Ve{constructor(a,i){super(a,i),Object.setPrototypeOf(this,wr.prototype)}static fromPayload(a){let{error:i,error_description:l}=a;return new wr(i,l)}}class yu extends wr{constructor(a,i){super(a,i),Object.setPrototypeOf(this,yu.prototype)}}class Qm extends wr{constructor(a,i){super(a,i),Object.setPrototypeOf(this,Qm.prototype)}}class Jm extends wr{constructor(a,i){super(a,i),Object.setPrototypeOf(this,Jm.prototype)}}class ls extends wr{constructor(a,i){super(a,i),Object.setPrototypeOf(this,ls.prototype)}}class Xm extends wr{constructor(a,i){super(a,i),Object.setPrototypeOf(this,Xm.prototype)}}class pT{constructor(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=a}set(a,i){this.cleanup(),this.contexts.set(a,Object.assign(Object.assign({},i),{createdAt:Date.now()}))}get(a){const i=this.contexts.get(a);if(i){if(!(Date.now()-i.createdAt>this.ttlMs))return i;this.contexts.delete(a)}}remove(a){this.contexts.delete(a)}cleanup(){const a=Date.now();for(const[i,l]of this.contexts)a-l.createdAt>this.ttlMs&&this.contexts.delete(i)}get size(){return this.contexts.size}}class yT{constructor(a,i){this.authJsMfaClient=a,this.auth0Client=i,this.contextManager=new pT}setMFAAuthDetails(a,i,l,o){this.contextManager.set(a,{scope:i,audience:l,mfaRequirements:o})}async getAuthenticators(a){var i,l;const o=this.contextManager.get(a);if(!(!((i=o==null?void 0:o.mfaRequirements)===null||i===void 0)&&i.challenge)||o.mfaRequirements.challenge.length===0)throw new yu("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const d=o.mfaRequirements.challenge.map(f=>f.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:a})).filter(f=>!!f.type&&d.includes(f.type))}catch(f){throw f instanceof Fx?new yu((l=f.cause)===null||l===void 0?void 0:l.error,f.message):f}}async enroll(a){var i;const l=(function(o){const d=WE[o.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:o.mfaToken,authenticatorTypes:d.authenticatorTypes},d.oobChannels&&{oobChannels:d.oobChannels}),"phoneNumber"in o&&{phoneNumber:o.phoneNumber}),"email"in o&&{email:o.email})})(a);try{return await this.authJsMfaClient.enrollAuthenticator(l)}catch(o){throw o instanceof $x?new Qm((i=o.cause)===null||i===void 0?void 0:i.error,o.message):o}}async challenge(a){var i;try{const l={challengeType:a.challengeType,mfaToken:a.mfaToken};return a.authenticatorId&&(l.authenticatorId=a.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(l)}catch(l){throw l instanceof ew?new Jm((i=l.cause)===null||i===void 0?void 0:i.error,l.message):l}}async getEnrollmentFactors(a){const i=this.contextManager.get(a);if(!i||!i.mfaRequirements)throw new Xm("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return i.mfaRequirements.enroll&&i.mfaRequirements.enroll.length!==0?i.mfaRequirements.enroll:[]}async verify(a){const i=this.contextManager.get(a.mfaToken);if(!i)throw new ls("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const l=(function(f){return"otp"in f&&f.otp?IE:"oobCode"in f&&f.oobCode?FE:"recoveryCode"in f&&f.recoveryCode?$E:void 0})(a);if(!l)throw new ls("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const o=i.scope,d=i.audience;try{const f=await this.auth0Client._requestTokenForMfa({grant_type:l,mfaToken:a.mfaToken,scope:o,audience:d,otp:a.otp,oob_code:a.oobCode,binding_code:a.bindingCode,recovery_code:a.recoveryCode});return this.contextManager.remove(a.mfaToken),f}catch(f){if(f instanceof _s)this.setMFAAuthDetails(f.mfa_token,o,d,f.mfa_requirements);else if(f instanceof ls)throw new ls(f.error,f.error_description);throw f}}}class gT{constructor(a){let i,l;if(this.userCache=new gx().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),a),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),a.authorizationParams)}),typeof window<"u"&&(()=>{if(!ou())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(ou().subtle===void 0)throw new Error(`
62
+ auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
63
+ `)})(),this.lockManager=(lh||(lh=yE()),lh),a.cache&&a.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),a.cache)l=a.cache;else{if(i=a.cacheLocation||Cv,!Kv(i))throw new Error('Invalid cache location "'.concat(i,'"'));l=Kv(i)()}var o;this.httpTimeoutMs=a.httpTimeoutInSeconds?1e3*a.httpTimeoutInSeconds:1e4,this.cookieStorage=a.legacySameSiteCookie===!1?rs:qE,this.orgHintCookieName=(o=this.options.clientId,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=(m=>"auth0.".concat(m,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=a.sessionCheckExpiryDays||1;const d=a.useCookiesForTransactions?this.cookieStorage:BE;var f;this.scope=(function(m,g){for(var b=arguments.length,w=new Array(b>2?b-2:0),_=2;_<b;_++)w[_-2]=arguments[_];if(typeof m!="object")return{[Bt]:eu(g,m,...w)};let C={[Bt]:eu(g,...w)};return Object.keys(m).forEach(E=>{const S=m[E];C[E]=eu(g,S,...w)}),C})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new zE(d,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||cx,this.cacheManager=new DE(l,l.allKeys?void 0:new ZE(l,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new QE(this.options.clientId):void 0,this.domainUrl=(f=this.options.domain,/^https?:\/\//.test(f)?f:"https://".concat(f)),this.tokenIssuer=((m,g)=>m?m.startsWith("https://")?m:"https://".concat(m,"/"):"".concat(g,"/"))(this.options.issuer,this.domainUrl);const v="".concat(this.domainUrl,"/me/"),y=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:v},detailedResponse:!0})}));this.myAccountApi=new XE(y,v),this.authJsClient=new dT({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new yT(this.authJsClient.mfa,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&i===Cv&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new PE)}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(a){const i=this.options.auth0Client||ox,l=ux(i,!0),o=encodeURIComponent(btoa(JSON.stringify(l)));return"".concat(this.domainUrl).concat(a,"&auth0Client=").concat(o)}_authorizeUrl(a){return this._url("/authorize?".concat(Ih(a)))}async _verifyIdToken(a,i,l){const o=await this.nowProvider();return UE({iss:this.tokenIssuer,aud:this.options.clientId,id_token:a,nonce:i,organization:l,leeway:this.options.leeway,max_age:(d=this.options.authorizationParams.max_age,typeof d!="string"?d:parseInt(d,10)||void 0),now:o});var d}_processOrgHint(a){a?this.cookieStorage.save(this.orgHintCookieName,a,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(a){return new URLSearchParams(window.location.search).get(a)||void 0}_clearSessionTransferTokenFromUrl(a){try{const i=new URL(window.location.href);i.searchParams.has(a)&&(i.searchParams.delete(a),window.history.replaceState({},"",i.toString()))}catch{}}_applySessionTransferToken(a){const i=this.options.sessionTransferTokenQueryParamName;if(!i||a.session_transfer_token)return a;const l=this._extractSessionTransferToken(i);return l?(this._clearSessionTransferTokenFromUrl(i),Object.assign(Object.assign({},a),{session_transfer_token:l})):a}async _prepareAuthorizeUrl(a,i,l){var o;const d=nh(Tl()),f=nh(Tl()),v=Tl(),y=await Rv(v),m=Dv(y),g=await((o=this.dpop)===null||o===void 0?void 0:o.calculateThumbprint()),b=((_,C,E,S,N,H,K,L,U)=>Object.assign(Object.assign(Object.assign({client_id:_.clientId},_.authorizationParams),E),{scope:Uc(C,E.scope,E.audience),response_type:"code",response_mode:L||"query",state:S,nonce:N,redirect_uri:K||_.authorizationParams.redirect_uri,code_challenge:H,code_challenge_method:"S256",dpop_jkt:U}))(this.options,this.scope,a,d,f,m,a.redirect_uri||this.options.authorizationParams.redirect_uri||l,i==null?void 0:i.response_mode,g),w=this._authorizeUrl(b);return{nonce:f,code_verifier:v,scope:b.scope,audience:b.audience||Bt,redirect_uri:b.redirect_uri,state:d,url:w}}async loginWithPopup(a,i){var l;if(a=a||{},!(i=i||{}).popup&&(i.popup=(y=>{const m=window.screenX+(window.innerWidth-400)/2,g=window.screenY+(window.innerHeight-600)/2;return window.open(y,"auth0:authorize:popup","left=".concat(m,",top=").concat(g,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!i.popup))throw new Dm;const o=this._applySessionTransferToken(a.authorizationParams||{}),d=await this._prepareAuthorizeUrl(o,{response_mode:"web_message"},window.location.origin);i.popup.location.href=d.url;const f=await(y=>new Promise((m,g)=>{let b;const w=setInterval(()=>{y.popup&&y.popup.closed&&(clearInterval(w),clearTimeout(_),window.removeEventListener("message",b,!1),g(new Om(y.popup)))},1e3),_=setTimeout(()=>{clearInterval(w),g(new Rm(y.popup)),window.removeEventListener("message",b,!1)},1e3*(y.timeoutInSeconds||60));b=function(C){if(C.data&&C.data.type==="authorization_response"){if(clearTimeout(_),clearInterval(w),window.removeEventListener("message",b,!1),y.closePopup!==!1&&y.popup.close(),C.data.response.error)return g(Ve.fromPayload(C.data.response));m(C.data.response)}},window.addEventListener("message",b)}))(Object.assign(Object.assign({},i),{timeoutInSeconds:i.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(d.state!==f.state)throw new Ve("state_mismatch","Invalid state");const v=((l=a.authorizationParams)===null||l===void 0?void 0:l.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:d.audience,scope:d.scope,code_verifier:d.code_verifier,grant_type:"authorization_code",code:f.code,redirect_uri:d.redirect_uri},{nonceIn:d.nonce,organization:v})}async getUser(){var a;const i=await this._getIdTokenFromCache();return(a=i==null?void 0:i.decodedToken)===null||a===void 0?void 0:a.user}async getIdTokenClaims(){var a;const i=await this._getIdTokenFromCache();return(a=i==null?void 0:i.decodedToken)===null||a===void 0?void 0:a.claims}async loginWithRedirect(){var a;const i=qv(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),{openUrl:l,fragment:o,appState:d}=i,f=ja(i,["openUrl","fragment","appState"]),v=((a=f.authorizationParams)===null||a===void 0?void 0:a.organization)||this.options.authorizationParams.organization,y=this._applySessionTransferToken(f.authorizationParams||{}),m=await this._prepareAuthorizeUrl(y),{url:g}=m,b=ja(m,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},b),{appState:d,response_type:ir.Code}),v&&{organization:v}));const w=o?"".concat(g,"#").concat(o):g;l?await l(w):window.location.assign(w)}async handleRedirectCallback(){const a=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(a.length===0)throw new Error("There are no query params available for parsing.");const i=this.transactionManager.get();if(!i)throw new Ve("missing_transaction","Invalid state");this.transactionManager.remove();const l=(o=>{o.indexOf("#")>-1&&(o=o.substring(0,o.indexOf("#")));const d=new URLSearchParams(o);return{state:d.get("state"),code:d.get("code")||void 0,connect_code:d.get("connect_code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(a.join(""));return i.response_type===ir.ConnectCode?this._handleConnectAccountRedirectCallback(l,i):this._handleLoginRedirectCallback(l,i)}async _handleLoginRedirectCallback(a,i){const{code:l,state:o,error:d,error_description:f}=a;if(d)throw new Nm(d,f||d,o,i.appState);if(!i.code_verifier||i.state&&i.state!==o)throw new Ve("state_mismatch","Invalid state");const v=i.organization,y=i.nonce,m=i.redirect_uri;return await this._requestToken(Object.assign({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:l},m?{redirect_uri:m}:{}),{nonceIn:y,organization:v}),{appState:i.appState,response_type:ir.Code}}async _handleConnectAccountRedirectCallback(a,i){const{connect_code:l,state:o,error:d,error_description:f}=a;if(d)throw new Cm(d,f||d,i.connection,o,i.appState);if(!l)throw new Ve("missing_connect_code","Missing connect code");if(!(i.code_verifier&&i.state&&i.auth_session&&i.redirect_uri&&i.state===o))throw new Ve("state_mismatch","Invalid state");const v=await this.myAccountApi.completeAccount({auth_session:i.auth_session,connect_code:l,redirect_uri:i.redirect_uri,code_verifier:i.code_verifier});return Object.assign(Object.assign({},v),{appState:i.appState,response_type:ir.ConnectCode})}async checkSession(a){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(Lv))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(Lv)}try{await this.getTokenSilently(a)}catch{}}async getTokenSilently(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var i,l;const o=Object.assign(Object.assign({cacheMode:"on"},a),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),a.authorizationParams),{scope:Uc(this.scope,(i=a.authorizationParams)===null||i===void 0?void 0:i.scope,((l=a.authorizationParams)===null||l===void 0?void 0:l.audience)||this.options.authorizationParams.audience)})}),d=await((f,v)=>{let y=uh[v];return y||(y=f().finally(()=>{delete uh[v],y=null}),uh[v]=y),y})(()=>this._getTokenSilently(o),"".concat(this.options.clientId,"::").concat(o.authorizationParams.audience,"::").concat(o.authorizationParams.scope));return a.detailedResponse?d:d==null?void 0:d.access_token}async _getTokenSilently(a){const{cacheMode:i}=a,l=ja(a,["cacheMode"]);if(i!=="off"){const v=await this._getEntryFromCache({scope:l.authorizationParams.scope,audience:l.authorizationParams.audience||Bt,clientId:this.options.clientId,cacheMode:i});if(v)return v}if(i==="cache-only")return;const o=(d=this.options.clientId,f=l.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(d,".").concat(f));var d,f;try{return await this.lockManager.runWithLock(o,5e3,async()=>{if(i!=="off"){const _=await this._getEntryFromCache({scope:l.authorizationParams.scope,audience:l.authorizationParams.audience||Bt,clientId:this.options.clientId});if(_)return _}const v=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(l):await this._getTokenFromIFrame(l),{id_token:y,token_type:m,access_token:g,oauthTokenScope:b,expires_in:w}=v;return Object.assign(Object.assign({id_token:y,token_type:m,access_token:g},b?{scope:b}:null),{expires_in:w})})}catch(v){if(this._isInteractiveError(v)&&this.options.interactiveErrorHandler==="popup")return await this._handleInteractiveErrorWithPopup(l);throw v}}_isInteractiveError(a){return a instanceof _s||a instanceof Ve&&this._isIframeMfaError(a)}_isIframeMfaError(a){return a.error==="login_required"&&a.error_description==="Multifactor authentication required"}async _handleInteractiveErrorWithPopup(a){try{await this.loginWithPopup({authorizationParams:a.authorizationParams});const i=await this._getEntryFromCache({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||Bt,clientId:this.options.clientId});if(!i)throw new Ve("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return i}catch(i){throw i}}async getTokenWithPopup(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var l,o;const d=Object.assign(Object.assign({},a),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),a.authorizationParams),{scope:Uc(this.scope,(l=a.authorizationParams)===null||l===void 0?void 0:l.scope,((o=a.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})});return i=Object.assign(Object.assign({},cE),i),await this.loginWithPopup(d,i),(await this.cacheManager.get(new va({scope:d.authorizationParams.scope,audience:d.authorizationParams.audience||Bt,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(a){a.clientId!==null?a.clientId=a.clientId||this.options.clientId:delete a.clientId;const i=a.logoutParams||{},{federated:l}=i,o=ja(i,["federated"]),d=l?"&federated":"";return this._url("/v2/logout?".concat(Ih(Object.assign({clientId:a.clientId},o))))+d}async logout(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var i;const l=qv(a),{openUrl:o}=l,d=ja(l,["openUrl"]);a.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(a.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(ns),await((i=this.dpop)===null||i===void 0?void 0:i.clear());const f=this._buildLogoutUrl(d);o?await o(f):o!==!1&&window.location.assign(f)}async _getTokenFromIFrame(a){const i=(l=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(l));var l;try{return await this.lockManager.runWithLock(i,5e3,async()=>{const o=Object.assign(Object.assign({},a.authorizationParams),{prompt:"none"}),d=this.cookieStorage.get(this.orgHintCookieName);d&&!o.organization&&(o.organization=d);const{url:f,state:v,nonce:y,code_verifier:m,redirect_uri:g,scope:b,audience:w}=await this._prepareAuthorizeUrl(o,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new Ve("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const _=a.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let C;try{C=new URL(this.domainUrl).origin}catch{C=this.domainUrl}const E=await(function(N,H){let K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((L,U)=>{const I=window.document.createElement("iframe");I.setAttribute("width","0"),I.setAttribute("height","0"),I.style.display="none";const $=()=>{window.document.body.contains(I)&&(window.document.body.removeChild(I),window.removeEventListener("message",ee,!1))};let ee;const X=setTimeout(()=>{U(new As),$()},1e3*K);ee=function(ie){if(ie.origin!=H||!ie.data||ie.data.type!=="authorization_response")return;const W=ie.source;W&&W.close(),ie.data.response.error?U(Ve.fromPayload(ie.data.response)):L(ie.data.response),clearTimeout(X),window.removeEventListener("message",ee,!1),setTimeout($,2e3)},window.addEventListener("message",ee,!1),window.document.body.appendChild(I),I.setAttribute("src",N)})})(f,C,_);if(v!==E.state)throw new Ve("state_mismatch","Invalid state");const S=await this._requestToken(Object.assign(Object.assign({},a.authorizationParams),{code_verifier:m,code:E.code,grant_type:"authorization_code",redirect_uri:g,timeout:a.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:y,organization:o.organization});return Object.assign(Object.assign({},S),{scope:b,oauthTokenScope:S.scope,audience:w})})}catch(o){throw o.error==="login_required"&&(o instanceof Ve&&this._isIframeMfaError(o)&&this.options.interactiveErrorHandler==="popup"||this.logout({openUrl:!1})),o}}async _getTokenUsingRefreshToken(a){var i,l;const o=await this.cacheManager.get(new va({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||Bt,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(o&&o.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(a);throw new xu(a.authorizationParams.audience||Bt,a.authorizationParams.scope)}const d=a.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,f=typeof a.timeoutInSeconds=="number"?1e3*a.timeoutInSeconds:null,v=((w,_,C,E)=>{var S;if(w&&C&&E){if(_.audience!==C)return _.scope;const N=E.split(" "),H=((S=_.scope)===null||S===void 0?void 0:S.split(" "))||[],K=H.every(L=>N.includes(L));return N.length>=H.length&&K?E:_.scope}return _.scope})(this.options.useMrrt,a.authorizationParams,o==null?void 0:o.audience,o==null?void 0:o.scope);try{const w=await this._requestToken(Object.assign(Object.assign(Object.assign({},a.authorizationParams),{grant_type:"refresh_token",refresh_token:o&&o.refresh_token,redirect_uri:d}),f&&{timeout:f}),{scopesToRequest:v});if(w.refresh_token&&(o!=null&&o.refresh_token)&&await this.cacheManager.updateEntry(o.refresh_token,w.refresh_token),this.options.useMrrt&&(y=o==null?void 0:o.audience,m=o==null?void 0:o.scope,g=a.authorizationParams.audience,b=a.authorizationParams.scope,(y!==g||!Bv(b,m))&&!Bv(v,w.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(a);await this.cacheManager.remove(this.options.clientId,a.authorizationParams.audience,a.authorizationParams.scope);const _=((C,E)=>{const S=(C==null?void 0:C.split(" "))||[],N=(E==null?void 0:E.split(" "))||[];return S.filter(H=>N.indexOf(H)==-1).join(",")})(v,w.scope);throw new zm(a.authorizationParams.audience||"default",_)}return Object.assign(Object.assign({},w),{scope:a.authorizationParams.scope,oauthTokenScope:w.scope,audience:a.authorizationParams.audience||Bt})}catch(w){if(w.message){if(w.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),w;if((w.message.includes("Missing Refresh Token")||w.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(a)}throw w instanceof _s&&this.mfa.setMFAAuthDetails(w.mfa_token,(i=a.authorizationParams)===null||i===void 0?void 0:i.scope,(l=a.authorizationParams)===null||l===void 0?void 0:l.audience,w.mfa_requirements),w}var y,m,g,b}async _saveEntryInCache(a){const{id_token:i,decodedToken:l}=a,o=ja(a,["id_token","decodedToken"]);this.userCache.set(ns,{id_token:i,decodedToken:l}),await this.cacheManager.setIdToken(this.options.clientId,a.id_token,a.decodedToken),await this.cacheManager.set(o)}async _getIdTokenFromCache(){const a=this.options.authorizationParams.audience||Bt,i=this.scope[a],l=await this.cacheManager.getIdToken(new va({clientId:this.options.clientId,audience:a,scope:i})),o=this.userCache.get(ns);return l&&l.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set(ns,l),l)}async _getEntryFromCache(a){let{scope:i,audience:l,clientId:o,cacheMode:d}=a;const f=await this.cacheManager.get(new va({scope:i,audience:l,clientId:o}),60,this.options.useMrrt,d);if(f&&f.access_token){const{token_type:v,access_token:y,oauthTokenScope:m,expires_in:g}=f,b=await this._getIdTokenFromCache();return b&&Object.assign(Object.assign({id_token:b.id_token,token_type:v||"Bearer",access_token:y},m?{scope:m}:null),{expires_in:g})}}async _requestToken(a,i){var l,o;const{nonceIn:d,organization:f,scopesToRequest:v}=i||{},y=await RE(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},a),{scope:v||a.scope}),this.worker),m=await this._verifyIdToken(y.id_token,d,f);if(a.grant_type==="authorization_code"){const g=await this._getIdTokenFromCache();!((o=(l=g==null?void 0:g.decodedToken)===null||l===void 0?void 0:l.claims)===null||o===void 0)&&o.sub&&g.decodedToken.claims.sub!==m.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(ns))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},y),{decodedToken:m,scope:a.scope,audience:a.audience||Bt}),y.scope?{oauthTokenScope:y.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(f||m.claims.org_id),Object.assign(Object.assign({},y),{decodedToken:m})}async loginWithCustomTokenExchange(a){return this._requestToken(Object.assign(Object.assign({},a),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:a.subject_token,subject_token_type:a.subject_token_type,scope:Uc(this.scope,a.scope,a.audience||this.options.authorizationParams.audience),audience:a.audience||this.options.authorizationParams.audience,organization:a.organization||this.options.authorizationParams.organization}))}async exchangeToken(a){return this.loginWithCustomTokenExchange(a)}_assertDpop(a){if(!a)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(a){return this._assertDpop(this.dpop),this.dpop.getNonce(a)}setDpopNonce(a,i){return this._assertDpop(this.dpop),this.dpop.setNonce(a,i)}generateDpopProof(a){return this._assertDpop(this.dpop),this.dpop.generateProof(a)}createFetcher(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new JE(a,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:i=>{var l;return this.getTokenSilently({authorizationParams:{scope:(l=i==null?void 0:i.scope)===null||l===void 0?void 0:l.join(" "),audience:i==null?void 0:i.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(a.dpopNonceId),setDpopNonce:i=>this.setDpopNonce(i,a.dpopNonceId),generateDpopProof:i=>this.generateDpopProof(i)})}async connectAccountWithRedirect(a){const{openUrl:i,appState:l,connection:o,scopes:d,authorization_params:f,redirectUri:v=this.options.authorizationParams.redirect_uri||window.location.origin}=a;if(!o)throw new Error("connection is required");const y=nh(Tl()),m=Tl(),g=await Rv(m),b=Dv(g),{connect_uri:w,connect_params:_,auth_session:C}=await this.myAccountApi.connectAccount({connection:o,scopes:d,redirect_uri:v,state:y,code_challenge:b,code_challenge_method:"S256",authorization_params:f});this.transactionManager.create({state:y,code_verifier:m,auth_session:C,redirect_uri:v,appState:l,connection:o,response_type:ir.ConnectCode});const E=new URL(w);E.searchParams.set("ticket",_.ticket),i?await i(E.toString()):window.location.assign(E)}async _requestTokenForMfa(a,i){const{mfaToken:l}=a,o=ja(a,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},o),{mfa_token:l}),i)}}var sw={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},tt=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},vT=gt(gt({},sw),{buildAuthorizeUrl:tt,buildLogoutUrl:tt,getAccessTokenSilently:tt,getAccessTokenWithPopup:tt,getIdTokenClaims:tt,loginWithCustomTokenExchange:tt,exchangeToken:tt,loginWithRedirect:tt,loginWithPopup:tt,connectAccountWithRedirect:tt,logout:tt,handleRedirectCallback:tt,getDpopNonce:tt,setDpopNonce:tt,generateDpopProof:tt,createFetcher:tt,getConfiguration:tt,mfa:{getAuthenticators:tt,enroll:tt,challenge:tt,verify:tt,getEnrollmentFactors:tt}}),lw=A.createContext(vT),mb=(function(r){lE(a,r);function a(i,l){var o=r.call(this,l??i)||this;return o.error=i,o.error_description=l,Object.setPrototypeOf(o,a.prototype),o}return a})(Error),bT=/[?&](?:connect_)?code=[^&]+/,xT=/[?&]state=[^&]+/,wT=/[?&]error=[^&]+/,ST=function(r){return r===void 0&&(r=window.location.search),(bT.test(r)||wT.test(r))&&xT.test(r)},ow=function(r){return function(a){if(a instanceof Error)return a;if(a!==null&&typeof a=="object"&&"error"in a&&typeof a.error=="string"){if("error_description"in a&&typeof a.error_description=="string"){var i=a;return new mb(i.error,i.error_description)}var l=a;return new mb(l.error)}return new Error(r)}},pb=ow("Login failed"),Jc=ow("Get access token failed"),cw=function(r){var a,i;r!=null&&r.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),r.authorizationParams=(a=r.authorizationParams)!==null&&a!==void 0?a:{},r.authorizationParams.redirect_uri=r.redirectUri,delete r.redirectUri),!((i=r==null?void 0:r.authorizationParams)===null||i===void 0)&&i.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),r.authorizationParams.redirect_uri=r.authorizationParams.redirectUri,delete r.authorizationParams.redirectUri)},_T=function(r,a){switch(a.type){case"LOGIN_POPUP_STARTED":return gt(gt({},r),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return gt(gt({},r),{isAuthenticated:!!a.user,user:a.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return r.user===a.user?r:gt(gt({},r),{isAuthenticated:!!a.user,user:a.user});case"LOGOUT":return gt(gt({},r),{isAuthenticated:!1,user:void 0});case"ERROR":return gt(gt({},r),{isLoading:!1,error:a.error})}},ET=function(r){return cw(r),gt(gt({},r),{auth0Client:{name:"auth0-react",version:"2.16.0"}})},kT=function(r){var a;window.history.replaceState({},document.title,(a=r.returnTo)!==null&&a!==void 0?a:window.location.pathname)},TT=function(r){var a=r,i=a.children,l=a.skipRedirectCallback,o=a.onRedirectCallback,d=o===void 0?kT:o,f=a.context,v=f===void 0?lw:f,y=a.client,m=Nv(a,["children","skipRedirectCallback","onRedirectCallback","context","client"]);y&&(m.domain||m.clientId)&&console.warn("Auth0Provider: the `client` prop takes precedence over `domain`/`clientId` and other configuration options. Remove `domain`, `clientId`, and any other Auth0Client configuration props when using the `client` prop.");var g=A.useState(function(){return y??new gT(ET(m))})[0],b=A.useReducer(_T,sw),w=b[0],_=b[1],C=A.useRef(!1),E=A.useCallback(function(V){return _({type:"ERROR",error:V}),V},[]);A.useEffect(function(){C.current||(C.current=!0,(function(){return Fn(void 0,void 0,void 0,function(){var V,te,fe,he,j,G,F;return $n(this,function(re){switch(re.label){case 0:return re.trys.push([0,7,,8]),V=void 0,ST()&&!l?[4,g.handleRedirectCallback()]:[3,3];case 1:return te=re.sent(),fe=te.appState,he=fe===void 0?{}:fe,j=te.response_type,G=Nv(te,["appState","response_type"]),[4,g.getUser()];case 2:return V=re.sent(),he.response_type=j,j===ir.ConnectCode&&(he.connectedAccount=G),d(he,V),[3,6];case 3:return[4,g.checkSession()];case 4:return re.sent(),[4,g.getUser()];case 5:V=re.sent(),re.label=6;case 6:return _({type:"INITIALISED",user:V}),[3,8];case 7:return F=re.sent(),E(pb(F)),[3,8];case 8:return[2]}})})})())},[g,d,l,E]);var S=A.useCallback(function(V){return cw(V),g.loginWithRedirect(V)},[g]),N=A.useCallback(function(V,te){return Fn(void 0,void 0,void 0,function(){var fe,he;return $n(this,function(j){switch(j.label){case 0:_({type:"LOGIN_POPUP_STARTED"}),j.label=1;case 1:return j.trys.push([1,3,,4]),[4,g.loginWithPopup(V,te)];case 2:return j.sent(),[3,4];case 3:return fe=j.sent(),E(pb(fe)),[2];case 4:return[4,g.getUser()];case 5:return he=j.sent(),_({type:"LOGIN_POPUP_COMPLETE",user:he}),[2]}})})},[g,E]),H=A.useCallback(function(){for(var V=[],te=0;te<arguments.length;te++)V[te]=arguments[te];return Fn(void 0,oE([],V),void 0,function(fe){return fe===void 0&&(fe={}),$n(this,function(he){switch(he.label){case 0:return[4,g.logout(fe)];case 1:return he.sent(),(fe.openUrl||fe.openUrl===!1)&&_({type:"LOGOUT"}),[2]}})})},[g]),K=A.useCallback(function(V){return Fn(void 0,void 0,void 0,function(){var te,fe,he,j;return $n(this,function(G){switch(G.label){case 0:return G.trys.push([0,2,3,5]),[4,g.getTokenSilently(V)];case 1:return te=G.sent(),[3,5];case 2:throw fe=G.sent(),Jc(fe);case 3:return he=_,j={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,g.getUser()];case 4:return he.apply(void 0,[(j.user=G.sent(),j)]),[7];case 5:return[2,te]}})})},[g]),L=A.useCallback(function(V,te){return Fn(void 0,void 0,void 0,function(){var fe,he,j,G;return $n(this,function(F){switch(F.label){case 0:return F.trys.push([0,2,3,5]),[4,g.getTokenWithPopup(V,te)];case 1:return fe=F.sent(),[3,5];case 2:throw he=F.sent(),Jc(he);case 3:return j=_,G={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,g.getUser()];case 4:return j.apply(void 0,[(G.user=F.sent(),G)]),[7];case 5:return[2,fe]}})})},[g]),U=A.useCallback(function(V){return g.connectAccountWithRedirect(V)},[g]),I=A.useCallback(function(){return g.getIdTokenClaims()},[g]),$=A.useCallback(function(V){return Fn(void 0,void 0,void 0,function(){var te,fe,he,j;return $n(this,function(G){switch(G.label){case 0:return G.trys.push([0,2,3,5]),[4,g.loginWithCustomTokenExchange(V)];case 1:return te=G.sent(),[3,5];case 2:throw fe=G.sent(),Jc(fe);case 3:return he=_,j={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,g.getUser()];case 4:return he.apply(void 0,[(j.user=G.sent(),j)]),[7];case 5:return[2,te]}})})},[g]),ee=A.useCallback(function(V){return Fn(void 0,void 0,void 0,function(){return $n(this,function(te){return[2,$(V)]})})},[$]),X=A.useCallback(function(V){return Fn(void 0,void 0,void 0,function(){var te,fe,he;return $n(this,function(j){switch(j.label){case 0:return j.trys.push([0,2,3,5]),[4,g.handleRedirectCallback(V)];case 1:return[2,j.sent()];case 2:throw te=j.sent(),Jc(te);case 3:return fe=_,he={type:"HANDLE_REDIRECT_COMPLETE"},[4,g.getUser()];case 4:return fe.apply(void 0,[(he.user=j.sent(),he)]),[7];case 5:return[2]}})})},[g]),ie=A.useCallback(function(V){return g.getDpopNonce(V)},[g]),W=A.useCallback(function(V,te){return g.setDpopNonce(V,te)},[g]),Q=A.useCallback(function(V){return g.generateDpopProof(V)},[g]),pe=A.useCallback(function(V){return g.createFetcher(V)},[g]),de=A.useCallback(function(){return g.getConfiguration()},[g]),xe=A.useMemo(function(){return g.mfa},[g]),B=A.useMemo(function(){return gt(gt({},w),{getAccessTokenSilently:K,getAccessTokenWithPopup:L,getIdTokenClaims:I,loginWithCustomTokenExchange:$,exchangeToken:ee,loginWithRedirect:S,loginWithPopup:N,connectAccountWithRedirect:U,logout:H,handleRedirectCallback:X,getDpopNonce:ie,setDpopNonce:W,generateDpopProof:Q,createFetcher:pe,getConfiguration:de,mfa:xe})},[w,K,L,I,$,ee,S,N,U,H,X,ie,W,Q,pe,de,xe]);return Fl.createElement(v.Provider,{value:B},i)},uw=function(r){return r===void 0&&(r=lw),A.useContext(r)};const Wm="/cloud/api";let hm=null;function jT(r){hm=r}async function Im(r={}){if(!hm)return r;try{const a=await hm();return{...r,Authorization:`Bearer ${a}`}}catch{return r}}async function uo(r,a={}){const i=await Im({"Content-Type":"application/json",...a.headers}),l=await fetch(`${Wm}${r}`,{...a,headers:i});if(!l.ok){const o=await l.json().catch(()=>({}));throw new Error(o.error||`HTTP ${l.status}`)}return l.json()}async function fi(r,{method:a="POST",body:i,onLine:l,onJobId:o}={}){var w;const d=await Im({"Content-Type":"application/json"}),f=await fetch(`${Wm}${r}`,{method:a,headers:d,body:i?JSON.stringify(i):void 0});if(!f.ok){const _=await f.json().catch(()=>({}));throw new Error(_.error||`HTTP ${f.status}`)}const v=f.body.getReader(),y=new TextDecoder;let m="",g=null,b=null;for(;;){const{done:_,value:C}=await v.read();if(_)break;m+=y.decode(C,{stream:!0});const E=m.split(`
64
+ `);m=E.pop();for(const S of E)if(S.startsWith("data: "))try{const N=JSON.parse(S.slice(6));N.type==="job"?o==null||o(N.jobId):N.type==="done"?(g=N.result,l==null||l("✓ Operation complete","done")):N.type==="error"&&!((w=N.text)!=null&&w.startsWith(" "))?b=N.text:(N.type==="log"||N.type==="error")&&(l==null||l(N.text,N.type))}catch{}}if(b)throw new Error(b);return g}async function AT(r,a){let i=0;for(;;){const l=await Im(),o=await fetch(`${Wm}/jobs/${r}?since=${i}`,{headers:l});if(!o.ok)throw o.status===404?new Error("Job not found — it may have expired"):new Error(`HTTP ${o.status}`);const d=await o.json();for(const f of d.logs)a==null||a(f.text,f.type);if(i=d.offset+d.logs.length,d.status==="done")return a==null||a("✓ Operation complete","done"),{status:"done",result:d.result};if(d.status==="error")return{status:"error",error:d.error};await new Promise(f=>setTimeout(f,1e3))}}const Fm=A.createContext({user:null,roles:[],permissions:[],isAdmin:!1,canWrite:!1,canDeploy:!1,getToken:async()=>""});function NT({children:r}){const{isAuthenticated:a,isLoading:i,loginWithRedirect:l,getAccessTokenSilently:o,user:d}=uw(),[f,v]=A.useState(null),[y,m]=A.useState(!0);if(A.useEffect(()=>{a&&jT(()=>o())},[a,o]),A.useEffect(()=>{if(!a)return;let C=!1;return(async()=>{try{const E=await o(),S=await fetch("/cloud/api/me",{headers:{Authorization:`Bearer ${E}`}});S.ok&&!C&&v(await S.json())}catch{}finally{C||m(!1)}})(),()=>{C=!0}},[a,o]),i)return h.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:h.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Loading..."})});if(!a)return h.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-2",children:"meshXcloud"}),h.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:"Sign in to access the cloud panel"}),h.jsx("button",{onClick:()=>l(),className:"px-6 py-2.5 bg-violet-500 hover:bg-violet-600 text-white rounded-lg font-medium transition-colors",children:"Sign in with Auth0"})]})});if(y)return h.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:h.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Loading profile..."})});const g=(f==null?void 0:f.roles)||[],b=(f==null?void 0:f.permissions)||[],w=g.includes("admin"),_={user:{...d,...f},roles:g,permissions:b,isAdmin:w,canWrite:w||b.includes("cloud:write")||b.includes("cloud:admin"),canDeploy:w||b.includes("cloud:deploy")||b.includes("cloud:admin"),getToken:o};return h.jsx(Fm.Provider,{value:_,children:r})}function CT({children:r}){const a={user:{sub:"local",name:"Local User",email:""},roles:["admin"],permissions:["cloud:admin"],isAdmin:!0,canWrite:!0,canDeploy:!0,getToken:async()=>""};return h.jsx(Fm.Provider,{value:a,children:r})}function RT({children:r}){const[a,i]=A.useState(null),[l,o]=A.useState(null);return A.useEffect(()=>{fetch("/cloud/api/auth-config").then(d=>d.json()).then(i).catch(d=>o(d.message))},[]),l?h.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:h.jsxs("div",{className:"text-red-500 text-sm",children:["Auth config error: ",l]})}):a?a.enabled?h.jsx(TT,{domain:a.domain,clientId:a.clientId,authorizationParams:{redirect_uri:window.location.origin+"/cloud",audience:a.audience},cacheLocation:"localstorage",children:h.jsx(NT,{children:r})}):h.jsx(CT,{children:r}):h.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-100 dark:bg-gray-900",children:h.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Initializing..."})})}const ju=()=>A.useContext(Fm);function fo({sidebarOpen:r,setSidebarOpen:a}){const i=Va(),{pathname:l}=i,o=A.useRef(null),d=A.useRef(null),f=localStorage.getItem("sidebar-expanded"),[v,y]=A.useState(f===null?!1:f==="true");A.useEffect(()=>{const g=({target:b})=>{!d.current||!o.current||!r||d.current.contains(b)||o.current.contains(b)||a(!1)};return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}),A.useEffect(()=>{const g=({keyCode:b})=>{!r||b!==27||a(!1)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)}),A.useEffect(()=>{localStorage.setItem("sidebar-expanded",v),v?document.querySelector("body").classList.add("sidebar-expanded"):document.querySelector("body").classList.remove("sidebar-expanded")},[v]);const m=[{to:"/",label:"Registry",icon:h.jsx("svg",{className:"shrink-0 fill-current",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M3 1h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2Zm0 2v10h10V3H3Zm2 2h6v2H5V5Zm0 4h6v2H5V9Z"})})},{to:"/fleet",label:"Fleet",icon:h.jsx("svg",{className:"shrink-0 fill-current",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M8 0a1 1 0 0 1 1 1v2.1A5.002 5.002 0 0 1 13 8a5 5 0 0 1-5 5 5 5 0 0 1-5-5 5.002 5.002 0 0 1 4-4.9V1a1 1 0 0 1 1-1ZM6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z"})})},{to:"/costs",label:"Costs",icon:h.jsxs("svg",{className:"shrink-0 fill-current",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:[h.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm0 14c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6Z"}),h.jsx("path",{d:"M9 4H7v4.4l3.2 2.4.8-1.2L9 8V4Z"})]})},{to:"/audit",label:"Audit",icon:h.jsx("svg",{className:"shrink-0 fill-current",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M8 0L1 3v5c0 4.1 3 7.4 7 8 4-0.6 7-3.9 7-8V3L8 0Zm0 2.2l5 2.1v4.2c0 3-2.2 5.6-5 6.2-2.8-0.6-5-3.2-5-6.2V4.3l5-2.1Zm2.3 4L7 9.5 5.7 8.2l-1 1L7 11.5l4.3-4.3-1-1Z"})})}];return h.jsxs("div",{className:"min-w-fit",children:[h.jsx("div",{className:`fixed inset-0 bg-gray-900/30 z-40 lg:hidden lg:z-auto transition-opacity duration-200 ${r?"opacity-100":"opacity-0 pointer-events-none"}`,"aria-hidden":"true"}),h.jsxs("div",{id:"sidebar",ref:d,className:`flex lg:flex! flex-col absolute z-40 left-0 top-0 lg:static lg:left-auto lg:top-auto lg:translate-x-0 h-[100dvh] overflow-y-scroll lg:overflow-y-auto no-scrollbar w-64 lg:w-20 lg:sidebar-expanded:!w-64 2xl:w-64! shrink-0 bg-white dark:bg-gray-800 p-4 transition-all duration-200 ease-in-out ${r?"translate-x-0":"-translate-x-64"} border-r border-gray-200 dark:border-gray-700/60`,children:[h.jsxs("div",{className:"flex justify-between mb-10 pr-3 sm:px-2",children:[h.jsxs("button",{ref:o,className:"lg:hidden text-gray-500 hover:text-gray-400",onClick:()=>a(!r),"aria-controls":"sidebar","aria-expanded":r,children:[h.jsx("span",{className:"sr-only",children:"Close sidebar"}),h.jsx("svg",{className:"w-6 h-6 fill-current",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M10.7 18.7l1.4-1.4L7.8 13H20v-2H7.8l4.3-4.3-1.4-1.4L4 12z"})})]}),h.jsx(Mh,{end:!0,to:"/",className:"block",children:h.jsxs("svg",{className:"fill-violet-500",xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32",children:[h.jsx("path",{d:"M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2Zm0 26a12 12 0 1 1 12-12 12 12 0 0 1-12 12Z"}),h.jsx("path",{d:"M16 8a8 8 0 1 0 8 8 8 8 0 0 0-8-8Zm0 14a6 6 0 1 1 6-6 6 6 0 0 1-6 6Z"}),h.jsx("circle",{cx:"16",cy:"16",r:"3"})]})})]}),h.jsx("div",{className:"space-y-8",children:h.jsxs("div",{children:[h.jsxs("h3",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 font-semibold pl-3",children:[h.jsx("span",{className:"hidden lg:block lg:sidebar-expanded:hidden 2xl:hidden text-center w-6","aria-hidden":"true",children:"•••"}),h.jsx("span",{className:"lg:hidden lg:sidebar-expanded:block 2xl:block",children:"Cloud"})]}),h.jsx("ul",{className:"mt-3",children:m.map(g=>h.jsx("li",{className:"pl-4 pr-3 py-2 rounded-lg mb-0.5 last:mb-0",children:h.jsx(Mh,{end:g.to==="/",to:g.to,className:({isActive:b})=>`block text-gray-800 dark:text-gray-100 truncate transition ${b?"":"hover:text-gray-900 dark:hover:text-white"}`,children:({isActive:b})=>h.jsxs("div",{className:"flex items-center",children:[h.jsx("div",{className:b?"text-violet-500":"text-gray-400 dark:text-gray-500",children:g.icon}),h.jsx("span",{className:`text-sm font-medium ml-4 lg:opacity-0 lg:sidebar-expanded:opacity-100 2xl:opacity-100 duration-200 ${b?"text-violet-500":""}`,children:g.label})]})})},g.to))})]})}),h.jsx("div",{className:"pt-3 hidden lg:inline-flex 2xl:hidden justify-end mt-auto",children:h.jsx("div",{className:"w-12 pl-4 pr-3 py-2",children:h.jsxs("button",{className:"text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400",onClick:()=>y(!v),children:[h.jsx("span",{className:"sr-only",children:"Expand / collapse sidebar"}),h.jsx("svg",{className:"shrink-0 fill-current text-gray-400 dark:text-gray-600 sidebar-expanded:rotate-180",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M6.7 14.7l1.4-1.4L3.8 9H16V7H3.8l4.3-4.3-1.4-1.4L0 8z"})})]})})})]})]})}function OT(){const{currentTheme:r,changeCurrentTheme:a}=sE();return h.jsxs("div",{children:[h.jsx("input",{type:"checkbox",name:"light-switch",id:"light-switch",className:"light-switch sr-only",checked:r==="light",onChange:()=>a(r==="light"?"dark":"light")}),h.jsxs("label",{className:"flex items-center justify-center cursor-pointer w-8 h-8 hover:bg-gray-100 lg:hover:bg-gray-200 dark:hover:bg-gray-700/50 dark:lg:hover:bg-gray-800 rounded-full",htmlFor:"light-switch",children:[h.jsxs("svg",{className:"dark:hidden fill-current text-gray-500/80 dark:text-gray-400/80",width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M8 0a1 1 0 0 1 1 1v.5a1 1 0 1 1-2 0V1a1 1 0 0 1 1-1Z"}),h.jsx("path",{d:"M12 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),h.jsx("path",{d:"M13.657 3.757a1 1 0 0 0-1.414-1.414l-.354.354a1 1 0 0 0 1.414 1.414l.354-.354ZM13.5 8a1 1 0 0 1 1-1h.5a1 1 0 1 1 0 2h-.5a1 1 0 0 1-1-1ZM13.303 11.889a1 1 0 0 0-1.414 1.414l.354.354a1 1 0 0 0 1.414-1.414l-.354-.354ZM8 13.5a1 1 0 0 1 1 1v.5a1 1 0 1 1-2 0v-.5a1 1 0 0 1 1-1ZM4.111 13.303a1 1 0 1 0-1.414-1.414l-.354.354a1 1 0 1 0 1.414 1.414l.354-.354ZM0 8a1 1 0 0 1 1-1h.5a1 1 0 0 1 0 2H1a1 1 0 0 1-1-1ZM3.757 2.343a1 1 0 1 0-1.414 1.414l.354.354A1 1 0 1 0 4.11 2.697l-.354-.354Z"})]}),h.jsxs("svg",{className:"hidden dark:block fill-current text-gray-500/80 dark:text-gray-400/80",width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M11.875 4.375a.625.625 0 1 0 1.25 0c.001-.69.56-1.249 1.25-1.25a.625.625 0 1 0 0-1.25 1.252 1.252 0 0 1-1.25-1.25.625.625 0 1 0-1.25 0 1.252 1.252 0 0 1-1.25 1.25.625.625 0 1 0 0 1.25c.69.001 1.249.56 1.25 1.25Z"}),h.jsx("path",{d:"M7.019 1.985a1.55 1.55 0 0 0-.483-1.36 1.44 1.44 0 0 0-1.53-.277C2.056 1.553 0 4.5 0 7.9 0 12.352 3.648 16 8.1 16c3.407 0 6.246-2.058 7.51-4.963a1.446 1.446 0 0 0-.25-1.55 1.554 1.554 0 0 0-1.372-.502c-4.01.552-7.539-2.987-6.97-7ZM2 7.9C2 5.64 3.193 3.664 4.961 2.6 4.82 7.245 8.72 11.158 13.36 11.04 12.265 12.822 10.341 14 8.1 14 4.752 14 2 11.248 2 7.9Z"})]}),h.jsx("span",{className:"sr-only",children:"Switch to light / dark version"})]})]})}function DT(){const{logout:r}=uw(),{user:a,roles:i,isAdmin:l,canWrite:o}=ju(),[d,f]=A.useState(!1),v=A.useRef(null);A.useEffect(()=>{const b=w=>{v.current&&!v.current.contains(w.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[]);const y=((a==null?void 0:a.name)||(a==null?void 0:a.email)||"?").split(/[\s@]+/).slice(0,2).map(b=>{var w;return(w=b[0])==null?void 0:w.toUpperCase()}).join(""),m=l?"Admin":o?"Operator":"Viewer",g=l?"bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-300":o?"bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300";return h.jsxs("div",{className:"relative",ref:v,children:[h.jsxs("button",{onClick:()=>f(!d),className:"flex items-center space-x-2 text-sm focus:outline-none",children:[a!=null&&a.picture?h.jsx("img",{src:a.picture,alt:"",className:"w-8 h-8 rounded-full"}):h.jsx("div",{className:"w-8 h-8 rounded-full bg-violet-500 text-white flex items-center justify-center text-xs font-bold",children:y}),h.jsx("span",{className:"hidden sm:block text-gray-700 dark:text-gray-200 font-medium truncate max-w-[120px]",children:(a==null?void 0:a.name)||(a==null?void 0:a.email)}),h.jsx("svg",{className:"w-3 h-3 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),d&&h.jsxs("div",{className:"absolute right-0 mt-2 w-64 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 py-2 z-50",children:[h.jsxs("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-700",children:[h.jsx("p",{className:"text-sm font-medium text-gray-800 dark:text-gray-100 truncate",children:(a==null?void 0:a.name)||(a==null?void 0:a.email)}),h.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:a==null?void 0:a.email}),h.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[h.jsx("span",{className:`inline-block text-[10px] font-semibold px-1.5 py-0.5 rounded ${g}`,children:m}),i.filter(b=>b!=="admin").map(b=>h.jsx("span",{className:"inline-block text-[10px] font-medium px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:b},b))]})]}),h.jsx("button",{onClick:()=>r({logoutParams:{returnTo:window.location.origin+"/cloud"}}),className:"w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50",children:"Sign out"})]})]})}function ho({sidebarOpen:r,setSidebarOpen:a,variant:i="default"}){const{user:l}=ju();return h.jsx("header",{className:`sticky top-0 before:absolute before:inset-0 before:backdrop-blur-md max-lg:before:bg-white/90 dark:max-lg:before:bg-gray-800/90 before:-z-10 z-30 ${i==="v2"?"before:bg-white after:absolute after:h-px after:inset-x-0 after:top-full after:bg-gray-200 dark:after:bg-gray-700/60 after:-z-10 dark:before:bg-gray-800":"max-lg:shadow-xs lg:before:bg-gray-100/90 dark:lg:before:bg-gray-900/90"}`,children:h.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:h.jsxs("div",{className:`flex items-center justify-between h-16 ${i!=="v2"?"lg:border-b border-gray-200 dark:border-gray-700/60":""}`,children:[h.jsx("div",{className:"flex",children:h.jsxs("button",{className:"text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 lg:hidden","aria-controls":"sidebar","aria-expanded":r,onClick:o=>{o.stopPropagation(),a(!r)},children:[h.jsx("span",{className:"sr-only",children:"Open sidebar"}),h.jsxs("svg",{className:"w-6 h-6 fill-current",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("rect",{x:"4",y:"5",width:"16",height:"2"}),h.jsx("rect",{x:"4",y:"11",width:"16",height:"2"}),h.jsx("rect",{x:"4",y:"17",width:"16",height:"2"})]})]})}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(OT,{}),h.jsx("hr",{className:"w-px h-6 bg-gray-200 dark:bg-gray-700/60 border-none"}),(l==null?void 0:l.sub)!=="local"&&h.jsxs(h.Fragment,{children:[h.jsx(DT,{}),h.jsx("hr",{className:"w-px h-6 bg-gray-200 dark:bg-gray-700/60 border-none"})]}),h.jsx("a",{href:"/",className:"text-xs text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 font-medium",children:"← fops"})]})]})})})}const yb={30:"text-gray-900",31:"text-red-400",32:"text-green-400",33:"text-yellow-400",34:"text-blue-400",35:"text-purple-400",36:"text-cyan-400",37:"text-gray-200",90:"text-gray-500",91:"text-red-300",92:"text-green-300",93:"text-yellow-300",94:"text-blue-300",95:"text-purple-300",96:"text-cyan-300",97:"text-white"},Nh=/\x1b\[([0-9;]*)m/g;function zT(r){const a=[];let i=0,l="text-gray-300";Nh.lastIndex=0;let o;for(;(o=Nh.exec(r))!==null;){o.index>i&&a.push({text:r.slice(i,o.index),className:l});const d=o[1].split(";");for(const f of d)f==="0"||f===""?l="text-gray-300":f==="1"?l=l+" font-bold":yb[f]&&(l=yb[f]);i=Nh.lastIndex}return i<r.length&&a.push({text:r.slice(i),className:l}),a}function dw(r){return r.replace(/\x1b\[[0-9;]*m/g,"")}const zl=[{id:"infra",label:"Infrastructure",match:"Infrastructure"},{id:"firewall",label:"Firewall",match:"Firewall"},{id:"security",label:"Security",match:"Security"},{id:"connect",label:"Connectivity",match:"Connectivity"},{id:"services",label:"Services",match:"Services"},{id:"post",label:"Post-start",match:"Post-start"}];function MT(r){const a=new Set;let i=null;for(const l of r){const o=dw(l.text);for(const d of zl)o.includes(d.match)&&(a.add(d.id),i=d.id);o.includes("Reconciliation complete")&&(a.add("post"),i="post")}return{reached:a,current:i}}function gu({lines:r=[],title:a="Output",isDone:i=!1,showPhases:l=!1}){const o=A.useRef(null);A.useEffect(()=>{var g;(g=o.current)==null||g.scrollIntoView({behavior:"smooth"})},[r.length]);const{reached:d,current:f}=A.useMemo(()=>MT(r),[r]),v=A.useMemo(()=>r.filter(g=>dw(g.text).includes("✓")).length,[r]),y=zl.findIndex(g=>g.id===f),m=i?100:Math.min(95,Math.floor((y+1)/zl.length*100));return r.length===0?null:h.jsxs("div",{className:"mt-6",children:[l&&h.jsx("div",{className:"mb-5",children:h.jsx("div",{className:"flex items-center gap-1",children:zl.map((g,b)=>{const w=i||d.has(g.id)&&f!==g.id,_=!i&&f===g.id;return h.jsxs(Fl.Fragment,{children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${w?"bg-green-500 text-white":_?"bg-violet-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500"}`,children:w?"✓":b+1}),h.jsx("span",{className:`text-xs font-medium whitespace-nowrap hidden sm:inline ${w?"text-green-600 dark:text-green-400":_?"text-gray-800 dark:text-gray-100":"text-gray-400 dark:text-gray-500"}`,children:g.label})]}),b<zl.length-1&&h.jsx("div",{className:`flex-1 h-px min-w-4 ${w?"bg-green-500/40":"bg-gray-200 dark:bg-gray-700"}`})]},g.id)})})}),h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("h3",{className:"text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase",children:a}),h.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono",children:i?"Complete":`${v} checks — ${m}%`})]}),h.jsx("div",{className:"w-full h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full mb-3 overflow-hidden",children:h.jsx("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${i?"bg-green-500":"bg-violet-500"}`,style:{width:`${m}%`}})}),h.jsxs("div",{className:`bg-gray-900 dark:bg-gray-950 border border-gray-200 dark:border-gray-700/60 rounded-lg p-4 overflow-y-auto font-mono text-xs leading-relaxed ${l?"max-h-[60vh]":"max-h-80"}`,children:[r.map((g,b)=>h.jsx("div",{children:zT(g.text).map((w,_)=>h.jsx("span",{className:w.className,children:w.text},_))},b)),h.jsx("div",{ref:o})]})]})}function UT(){return ao({queryKey:["resources"],queryFn:()=>uo("/resources")})}function HT(r=30){return ao({queryKey:["costs",r],queryFn:()=>uo(`/costs?days=${r}`),staleTime:300*1e3})}function LT(){return ao({queryKey:["fleet"],queryFn:()=>uo("/fleet")})}function KT(){return ao({queryKey:["audit"],queryFn:()=>uo("/audit"),staleTime:3e5})}function qT(){const r=En();return ui({mutationFn:({onLine:a}={})=>fi("/sync",{onLine:a}),onSuccess:()=>{r.invalidateQueries({queryKey:["resources"]}),r.invalidateQueries({queryKey:["fleet"]}),r.invalidateQueries({queryKey:["health"]})}})}function BT(){const r=En();return ui({mutationFn:({type:a,name:i,action:l,onLine:o})=>fi(`/resources/${a}/${i}/${l}`,{onLine:o}),onSuccess:()=>r.invalidateQueries({queryKey:["resources"]})})}function GT(){const r=En();return ui({mutationFn:({type:a,name:i,onLine:l})=>fi(`/resources/${a}/${i}`,{method:"DELETE",onLine:l}),onSuccess:()=>r.invalidateQueries({queryKey:["resources"]})})}function PT(r){return ao({queryKey:["flags",r],queryFn:()=>uo(`/flags/${r}`),enabled:!!r})}function ZT(){const r=En();return ui({mutationFn:({vmName:a,flags:i,onLine:l})=>fi(`/flags/${a}`,{body:{flags:i},onLine:l}),onSuccess:()=>r.invalidateQueries({queryKey:["flags"]})})}function YT(){const r=En();return ui({mutationFn:({vmName:a,opts:i={},onLine:l})=>fi(`/deploy/${a}`,{body:i,onLine:l}),onSuccess:()=>{r.invalidateQueries({queryKey:["resources"]}),r.invalidateQueries({queryKey:["fleet"]})}})}function VT(){const r=En();return ui({mutationFn:({vmName:a,username:i,onLine:l})=>fi(`/resources/vm/${a}/grant-admin`,{body:i?{username:i}:{},onLine:l}),onSuccess:()=>r.invalidateQueries({queryKey:["fleet"]})})}function QT(){const r=En();return ui({mutationFn:({body:a,onLine:i,onJobId:l})=>fi(`/resources/${a.type}`,{body:a,onLine:i,onJobId:l}),onSuccess:()=>r.invalidateQueries({queryKey:["resources"]})})}function JT(){const[r,a]=A.useState(!1),[i,l]=A.useState([]),o=bm(),{data:d,isLoading:f}=UT(),v=BT(),y=GT(),[m,g]=A.useState(null),{canWrite:b}=ju(),w=A.useCallback((S,N)=>l(H=>[...H,{text:S,type:N}]),[]),_=(d==null?void 0:d.vms)||[],C=(d==null?void 0:d.clusters)||[],E="px-5 py-3 font-semibold text-left whitespace-nowrap";return h.jsxs("div",{className:"flex h-screen overflow-hidden",children:[h.jsx(fo,{sidebarOpen:r,setSidebarOpen:a}),h.jsxs("div",{className:"relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[h.jsx(ho,{sidebarOpen:r,setSidebarOpen:a}),h.jsx("main",{className:"grow",children:h.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto",children:[h.jsxs("div",{className:"sm:flex sm:justify-between sm:items-center mb-8",children:[h.jsx("div",{className:"mb-4 sm:mb-0",children:h.jsx("h1",{className:"text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold",children:"Registry"})}),b&&h.jsx("div",{className:"grid grid-flow-col sm:auto-cols-max justify-start sm:justify-end gap-2",children:h.jsx("button",{className:"btn bg-gray-900 text-gray-100 hover:bg-gray-800 dark:bg-gray-100 dark:text-gray-800 dark:hover:bg-white",onClick:()=>o("/resources/new"),children:h.jsx("span",{children:"New Resource"})})})]}),f?h.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-gray-400 dark:text-gray-500 text-center py-12",children:"Loading resources..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:["Virtual Machines ",h.jsxs("span",{className:"text-gray-400 dark:text-gray-500 font-normal text-sm ml-1",children:["(",_.length,")"]})]})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:E,children:"Name"}),h.jsx("th",{className:E,children:"Location"}),h.jsx("th",{className:E,children:"Resource Group"}),h.jsx("th",{className:E,children:"IP"}),h.jsx("th",{className:E,children:"Status"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"Actions"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:_.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:"6",className:"px-5 py-8 text-center text-gray-400 dark:text-gray-500",children:"No VMs found"})}):_.map(S=>h.jsxs("tr",{children:[h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:h.jsx("div",{className:"font-medium text-gray-800 dark:text-gray-100",children:S.name})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:S.location||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-mono text-xs",children:S.resourceGroup||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-mono text-xs",children:S.publicIp||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:h.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${S.publicIp?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-red-500/20 text-red-700 dark:text-red-400"}`,children:S.publicIp?"running":"stopped"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-right",children:h.jsxs("div",{className:"flex items-center justify-end gap-1",children:[S.publicUrl&&h.jsx("a",{href:S.publicUrl,target:"_blank",rel:"noreferrer",className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-violet-500 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",children:"Open"}),b&&h.jsxs(h.Fragment,{children:[h.jsx("button",{className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-gray-500 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>{l([]),v.mutate({type:"vm",name:S.name,action:"start",onLine:w})},disabled:v.isPending,children:"Start"}),h.jsx("button",{className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-gray-500 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>{l([]),v.mutate({type:"vm",name:S.name,action:"stop",onLine:w})},disabled:v.isPending,children:"Stop"}),h.jsx("button",{className:"btn-xs bg-red-500/10 border-transparent text-red-500 rounded-lg shadow-xs hover:bg-red-500/20",onClick:()=>g({type:"vm",name:S.name}),children:"Delete"})]})]})})]},S.name))})]})})]}),h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:["AKS Clusters ",h.jsxs("span",{className:"text-gray-400 dark:text-gray-500 font-normal text-sm ml-1",children:["(",C.length,")"]})]})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:E,children:"Name"}),h.jsx("th",{className:E,children:"Location"}),h.jsx("th",{className:E,children:"K8s"}),h.jsx("th",{className:E,children:"HA Pairing"}),h.jsx("th",{className:E,children:"Storage"}),h.jsx("th",{className:E,children:"Key Vault"}),h.jsx("th",{className:E,children:"Postgres"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"Actions"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:C.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:"8",className:"px-5 py-8 text-center text-gray-400 dark:text-gray-500",children:"No clusters found"})}):C.map(S=>{var K,L;const N=(K=S.ha)==null?void 0:K.standbyCluster,H=S.isStandby?S.primaryCluster:null;return h.jsxs("tr",{children:[h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-100",children:S.name}),S.active&&h.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-violet-500/20 text-violet-600 dark:text-violet-400",children:"active"}),S.isStandby&&h.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-yellow-500/20 text-yellow-600 dark:text-yellow-400",children:"standby"})]}),S.domain&&h.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500",children:S.domain})]}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:S.location||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-mono text-xs",children:S.kubernetesVersion||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-xs",children:N?h.jsxs("div",{children:[h.jsx("span",{className:"text-green-600 dark:text-green-400",children:"HA enabled"}),h.jsxs("div",{className:"text-gray-400 dark:text-gray-500 mt-0.5",children:["standby: ",N]}),((L=S.ha)==null?void 0:L.standbyRegion)&&h.jsx("div",{className:"text-gray-400 dark:text-gray-500",children:S.ha.standbyRegion})]}):H?h.jsxs("div",{children:[h.jsx("span",{className:"text-yellow-600 dark:text-yellow-400",children:"Standby of"}),h.jsx("div",{className:"text-gray-400 dark:text-gray-500 mt-0.5",children:H})]}):h.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-xs",children:S.storageHA?h.jsxs("div",{children:[h.jsx("div",{className:"font-mono",children:S.storageHA.sourceAccount}),S.storageHA.destAccount&&h.jsxs("div",{className:"text-gray-400 dark:text-gray-500 mt-0.5",children:["replica: ",S.storageHA.destAccount," (",S.storageHA.destRegion,")"]})]}):S.storageAccount?h.jsx("div",{className:"font-mono",children:S.storageAccount}):h.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-xs",children:S.vault?h.jsxs("div",{children:[h.jsx("div",{className:"font-mono",children:S.vault.keyVaultName}),h.jsxs("div",{className:"text-gray-400 dark:text-gray-500 mt-0.5",children:[S.vault.autoUnseal?"auto-unseal":"manual"," · ",S.vault.initialized?"initialized":"pending"]})]}):h.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-xs",children:S.postgres?h.jsx("div",{className:"font-mono",children:S.postgres.serverName}):h.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-right",children:b&&h.jsx("button",{className:"btn-xs bg-red-500/10 border-transparent text-red-500 rounded-lg shadow-xs hover:bg-red-500/20",onClick:()=>g({type:"cluster",name:S.name}),children:"Delete"})})]},S.name)})})]})})]})]}),h.jsx(gu,{lines:i,title:"Action Output"}),m&&h.jsx("div",{className:"fixed inset-0 bg-gray-900/70 z-50 flex items-center justify-center p-4",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-lg max-w-md w-full p-6",children:[h.jsxs("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100 mb-2",children:["Delete ",m.type==="vm"?"VM":"Cluster"]}),h.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-6",children:["Are you sure you want to delete ",h.jsx("strong",{className:"text-gray-800 dark:text-gray-100",children:m.name}),"? This action cannot be undone."]}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{className:"btn border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>g(null),children:"Cancel"}),h.jsx("button",{className:"btn bg-red-500 text-white hover:bg-red-600",disabled:y.isPending,onClick:()=>{l([]),y.mutate({type:m.type,name:m.name,onLine:w},{onSuccess:()=>g(null)})},children:y.isPending?"Deleting...":"Delete"})]})]})})]})})]})]})}const Rl="cloud-provision-job",Xc=[{value:"uaenorth",label:"UAE North",flag:"🇦🇪"},{value:"eastus",label:"East US",flag:"🇺🇸"},{value:"westeurope",label:"West Europe",flag:"🇪🇺"},{value:"northeurope",label:"North Europe",flag:"🇪🇺"},{value:"southeastasia",label:"Southeast Asia",flag:"🇸🇬"}],Ch=[{value:"Standard_B2s",label:"B2s",spec:"2 vCPU · 4 GiB"},{value:"Standard_B2ms",label:"B2ms",spec:"2 vCPU · 8 GiB"},{value:"Standard_D2s_v5",label:"D2s v5",spec:"2 vCPU · 8 GiB"},{value:"Standard_D4s_v5",label:"D4s v5",spec:"4 vCPU · 16 GiB"}],gb=["Type","Configure","Review","Deploy"],XT="text-left rounded-lg border transition-all cursor-pointer",WT="border-violet-500 bg-violet-500/10 shadow-sm shadow-violet-500/10",IT="border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 bg-gray-50 dark:bg-gray-900/50",Wc=r=>`${XT} ${r?WT:IT}`;function FT(){var I,$,ee,X,ie;const[r,a]=A.useState(!1),i=bm(),l=QT(),[o,d]=A.useState(0),[f,v]=A.useState({type:"vm",vmName:"",location:"uaenorth",vmSize:"Standard_B2s",resourceGroup:"",clusterName:"",nodeCount:2,kubernetesVersion:"1.30"}),[y,m]=A.useState([]),[g,b]=A.useState(!1),[w,_]=A.useState(!1),C=A.useRef(!1),E=W=>Q=>v(pe=>({...pe,[W]:Q.target.value})),S=o===0?!0:o===1?f.type==="vm"?f.vmName.length>=3:f.clusterName.length>=3:!0,N=A.useCallback((W,Q)=>m(pe=>[...pe,{text:W,type:Q}]),[]),H=A.useCallback(W=>localStorage.setItem(Rl,W),[]);A.useEffect(()=>{const W=localStorage.getItem(Rl);!W||C.current||(C.current=!0,d(3),b(!0),AT(W,(Q,pe)=>m(de=>[...de,{text:Q,type:pe}])).then(()=>{b(!1),_(!0),localStorage.removeItem(Rl)}).catch(()=>{localStorage.removeItem(Rl),b(!1),d(0),C.current=!1}))},[]);const K=()=>{const W=f.type==="vm"?{type:"vm",vmName:f.vmName,location:f.location,vmSize:f.vmSize,resourceGroup:f.resourceGroup||void 0}:{type:"cluster",clusterName:f.clusterName,location:f.location,nodeCount:Number(f.nodeCount),kubernetesVersion:f.kubernetesVersion};m([]),d(3),l.mutate({body:W,onLine:N,onJobId:H},{onSuccess:()=>localStorage.removeItem(Rl)})},L=g||l.isPending,U=w||!l.isPending&&!l.isError&&y.length>0;return h.jsxs("div",{className:"flex h-screen overflow-hidden",children:[h.jsx(fo,{sidebarOpen:r,setSidebarOpen:a}),h.jsxs("div",{className:"relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[h.jsx(ho,{sidebarOpen:r,setSidebarOpen:a}),h.jsx("main",{className:"grow",children:h.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 py-8 w-full max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-bold text-gray-800 dark:text-gray-100",children:"Foundation Factory"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:"Provision a Foundation environment"})]}),o<3&&h.jsx("button",{className:"btn-sm border border-gray-200 dark:border-gray-700/60 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 rounded-lg",onClick:()=>i("/"),children:"Cancel"})]}),h.jsx("div",{className:"flex items-center mb-8",children:gb.map((W,Q)=>{const pe=Q<o||Q===3&&U,de=Q===o&&!(Q===3&&U);return h.jsxs(Fl.Fragment,{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300 ${pe?"bg-green-500 text-white shadow-sm shadow-green-500/30":de?"bg-violet-500 text-white shadow-sm shadow-violet-500/30 ring-4 ring-violet-500/20":"bg-gray-200 dark:bg-gray-800 text-gray-400 dark:text-gray-500 border border-gray-300 dark:border-gray-700/60"}`,children:pe?"✓":Q+1}),h.jsx("span",{className:`text-sm font-medium hidden sm:inline ${pe?"text-green-600 dark:text-green-500":de?"text-gray-800 dark:text-gray-100":"text-gray-400 dark:text-gray-600"}`,children:W})]}),Q<gb.length-1&&h.jsx("div",{className:`flex-1 h-px mx-3 transition-colors duration-500 ${Q<o?"bg-green-500/40":"bg-gray-200 dark:bg-gray-700/60"}`})]},W)})}),h.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700/60 shadow-xs rounded-xl overflow-hidden",children:[o===0&&h.jsxs("div",{className:"p-6",children:[h.jsx("h2",{className:"text-sm font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-4",children:"Select Target"}),h.jsx("div",{className:"grid grid-cols-2 gap-4",children:[{type:"vm",label:"Virtual Machine",desc:"Single-node Foundation on Azure VM",icon:"🖥"},{type:"cluster",label:"AKS Cluster",desc:"Distributed Foundation on managed Kubernetes",icon:"☸"}].map(W=>h.jsxs("button",{onClick:()=>v(Q=>({...Q,type:W.type})),className:`${Wc(f.type===W.type)} p-5`,children:[h.jsx("div",{className:"text-2xl mb-3",children:W.icon}),h.jsx("div",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:W.label}),h.jsx("div",{className:"text-xs text-gray-500 mt-1",children:W.desc})]},W.type))})]}),o===1&&f.type==="vm"&&h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsx("h2",{className:"text-sm font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"VM Configuration"}),h.jsx(ar,{label:"Name",hint:"Unique identifier for this VM",children:h.jsx("input",{className:"field-input",placeholder:"my-foundation-vm",value:f.vmName,onChange:E("vmName")})}),h.jsx(ar,{label:"Region",children:h.jsx("div",{className:"grid grid-cols-3 gap-2",children:Xc.map(W=>h.jsxs("button",{onClick:()=>v(Q=>({...Q,location:W.value})),className:`${Wc(f.location===W.value)} px-3 py-2.5 text-sm`,children:[h.jsx("span",{className:"mr-1.5",children:W.flag}),h.jsx("span",{className:f.location===W.value?"text-gray-800 dark:text-gray-100":"text-gray-600 dark:text-gray-400",children:W.label})]},W.value))})}),h.jsx(ar,{label:"Size",children:h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ch.map(W=>h.jsxs("button",{onClick:()=>v(Q=>({...Q,vmSize:W.value})),className:`${Wc(f.vmSize===W.value)} px-3 py-2.5 text-sm`,children:[h.jsx("div",{className:`font-medium ${f.vmSize===W.value?"text-gray-800 dark:text-gray-100":"text-gray-700 dark:text-gray-200"}`,children:W.label}),h.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:W.spec})]},W.value))})}),h.jsx(ar,{label:"Resource Group",hint:"Leave empty for auto-generated",children:h.jsx("input",{className:"field-input",placeholder:"FOUNDATION-VM-RG",value:f.resourceGroup,onChange:E("resourceGroup")})})]}),o===1&&f.type==="cluster"&&h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsx("h2",{className:"text-sm font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"Cluster Configuration"}),h.jsx(ar,{label:"Cluster Name",children:h.jsx("input",{className:"field-input",placeholder:"my-aks-cluster",value:f.clusterName,onChange:E("clusterName")})}),h.jsx(ar,{label:"Region",children:h.jsx("div",{className:"grid grid-cols-3 gap-2",children:Xc.map(W=>h.jsxs("button",{onClick:()=>v(Q=>({...Q,location:W.value})),className:`${Wc(f.location===W.value)} px-3 py-2.5 text-sm`,children:[h.jsx("span",{className:"mr-1.5",children:W.flag}),h.jsx("span",{className:f.location===W.value?"text-gray-800 dark:text-gray-100":"text-gray-600 dark:text-gray-400",children:W.label})]},W.value))})}),h.jsx(ar,{label:"Node Count",children:h.jsx("input",{className:"field-input",type:"number",min:1,max:20,value:f.nodeCount,onChange:E("nodeCount")})}),h.jsx(ar,{label:"Kubernetes Version",children:h.jsx("input",{className:"field-input",placeholder:"1.30",value:f.kubernetesVersion,onChange:E("kubernetesVersion")})})]}),o===2&&h.jsxs("div",{className:"p-6",children:[h.jsx("h2",{className:"text-sm font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-4",children:"Review Deployment"}),h.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/60 rounded-lg border border-gray-200 dark:border-gray-700/60 divide-y divide-gray-200 dark:divide-gray-700/60",children:(f.type==="vm"?[["Target","Virtual Machine"],["Name",f.vmName],["Region",((I=Xc.find(W=>W.value===f.location))==null?void 0:I.label)||f.location],["Size",((($=Ch.find(W=>W.value===f.vmSize))==null?void 0:$.label)||"")+" — "+(((ee=Ch.find(W=>W.value===f.vmSize))==null?void 0:ee.spec)||f.vmSize)],...f.resourceGroup?[["Resource Group",f.resourceGroup]]:[]]:[["Target","AKS Cluster"],["Name",f.clusterName],["Region",((X=Xc.find(W=>W.value===f.location))==null?void 0:X.label)||f.location],["Nodes",String(f.nodeCount)],["K8s Version",f.kubernetesVersion]]).map(([W,Q])=>h.jsxs("div",{className:"flex justify-between items-center px-4 py-3",children:[h.jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider",children:W}),h.jsx("span",{className:"text-sm font-mono text-gray-800 dark:text-gray-200",children:Q})]},W))}),l.isError&&h.jsx("p",{className:"text-sm text-red-500 mt-4",children:((ie=l.error)==null?void 0:ie.message)||"Failed"})]}),o===3&&h.jsxs("div",{className:"p-6",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[L&&h.jsx("div",{className:"w-4 h-4 border-2 border-violet-500 border-t-transparent rounded-full animate-spin"}),h.jsx("h2",{className:"text-sm font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider",children:L?g?"Reconnecting...":"Deploying":U?"Deployment Complete":"Failed"})]}),h.jsx(gu,{lines:y,title:"",isDone:U,showPhases:!0}),!L&&h.jsx("div",{className:"mt-5",children:h.jsx("button",{className:"btn bg-violet-500 text-white hover:bg-violet-600",onClick:()=>i("/"),children:"Go to Registry"})})]}),o<3&&h.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-t border-gray-100 dark:border-gray-700/60 bg-gray-50 dark:bg-gray-900/40",children:[h.jsx("button",{className:"text-sm text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition disabled:opacity-30",onClick:()=>d(W=>W-1),disabled:o===0,children:"← Back"}),o<2?h.jsx("button",{className:"btn bg-violet-500 text-white hover:bg-violet-600 disabled:opacity-40",onClick:()=>d(W=>W+1),disabled:!S,children:"Continue →"}):h.jsx("button",{className:"btn bg-green-600 text-white hover:bg-green-500",onClick:K,children:"Deploy →"})]})]})]})})]})]})}function ar({label:r,hint:a,children:i}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r}),i,a&&h.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-600 mt-1.5",children:a})]})}const ts={be:"Backend",fe:"Frontend",pr:"Processor",wa:"Watcher",sc:"Scheduler",se:"Storage"};function $T(){const[r,a]=A.useState(!1),[i,l]=A.useState([]),[o,d]=A.useState([]),[f,v]=A.useState(null),[y,m]=A.useState(null),[g,b]=A.useState(""),{data:w,isLoading:_}=LT(),C=qT(),E=YT(),S=VT(),N=ZT(),{data:H,isLoading:K}=PT(f),[L,U]=A.useState({}),{canWrite:I,canDeploy:$}=ju(),ee=A.useCallback((Q,pe)=>l(de=>[...de,{text:Q,type:pe}]),[]),X=A.useCallback((Q,pe)=>d(de=>[...de,{text:Q,type:pe}]),[]),ie=[],W=[];if(w)for(const[Q,pe]of Object.entries(w)){for(const[de,xe]of Object.entries((pe==null?void 0:pe.vms)||{}))ie.push({name:de,provider:Q,...xe});for(const[de,xe]of Object.entries((pe==null?void 0:pe.clusters)||{}))W.push({name:de,provider:Q,...xe})}return h.jsxs("div",{className:"flex h-screen overflow-hidden",children:[h.jsx(fo,{sidebarOpen:r,setSidebarOpen:a}),h.jsxs("div",{className:"relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[h.jsx(ho,{sidebarOpen:r,setSidebarOpen:a}),h.jsx("main",{className:"grow",children:h.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto",children:[h.jsxs("div",{className:"sm:flex sm:justify-between sm:items-center mb-8",children:[h.jsxs("div",{className:"mb-4 sm:mb-0",children:[h.jsx("h1",{className:"text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold",children:"Fleet"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Foundation stack status across Sandbox and Distributed foundations"})]}),I&&h.jsxs("button",{className:"btn bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-gray-400 dark:text-gray-500",onClick:()=>{l([]),C.mutate({onLine:ee})},disabled:C.isPending,children:[h.jsx("svg",{className:`fill-current shrink-0 ${C.isPending?"animate-spin":""}`,width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M14.15 4.92A7.05 7.05 0 0 0 8.5 1a7 7 0 1 0 6.58 9.39 1 1 0 1 0-1.88-.68A5 5 0 1 1 8.5 3a5.07 5.07 0 0 1 4.04 2.04L11 5.5V9h3.5L13 7.5l1.15-2.58Z"})}),h.jsx("span",{children:"Sync Fleet"})]})]}),_?h.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-gray-400 dark:text-gray-500 text-center py-12",children:"Loading fleet data..."}):ie.length===0&&W.length===0?h.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-gray-400 dark:text-gray-500 text-center py-12",children:"No fleet data available. Run a sync to discover resources."}):h.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[ie.length>0&&h.jsxs("div",{className:"col-span-full bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsx("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Sandbox Foundations"})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Name"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Location"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Branch"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-center whitespace-nowrap",children:"Running"}),Object.keys(ts).map(Q=>h.jsx("th",{className:"px-3 py-3 font-semibold text-center whitespace-nowrap",children:ts[Q]},Q)),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Status"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"Actions"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:ie.map(Q=>h.jsxs("tr",{children:[h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap",children:[h.jsx("div",{className:"font-medium text-gray-800 dark:text-gray-100",children:Q.name}),Q.publicUrl&&h.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500 font-mono",children:Q.publicUrl})]}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:Q.location||"—"}),h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap font-mono text-xs",children:[Q.branch||"—",Q.sha&&h.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["(",Q.sha,")"]})]}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-center",children:Q.running!=null?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-green-500 font-medium",children:Q.running}),h.jsxs("span",{className:"text-gray-400",children:[" / ",Q.total||(Q.running||0)+(Q.exited||0)]})]}):"—"}),Object.keys(ts).map(pe=>{var V;const de=(V=Q.services)==null?void 0:V[pe],xe=typeof de=="object"?de==null?void 0:de.tag:null,B=typeof de=="object"?de==null?void 0:de.sha:typeof de=="string"?de:null;return h.jsx("td",{className:"px-3 py-3 whitespace-nowrap text-center font-mono text-xs",children:xe||B?h.jsxs("div",{children:[xe&&h.jsx("div",{className:"text-gray-700 dark:text-gray-300",children:xe}),B&&h.jsx("div",{className:"text-gray-400 dark:text-gray-500 text-[10px]",children:B})]}):h.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"—"})},pe)}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:h.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${Q.status==="up"?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-gray-200 dark:bg-gray-700 text-gray-500"}`,children:Q.status||"unknown"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-right",children:h.jsxs("div",{className:"flex items-center justify-end gap-1",children:[$&&h.jsx("button",{className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-gray-500 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>{d([]),E.mutate({vmName:Q.name,onLine:X})},disabled:E.isPending,children:"Deploy"}),I&&h.jsx("button",{className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-amber-600 dark:text-amber-400 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>{m(Q.name),b("")},children:"Grant Admin"}),I&&h.jsx("button",{className:"btn-xs bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-violet-500 rounded-lg shadow-xs hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>{v(Q.name),U({})},children:"Flags"})]})})]},`${Q.provider}-${Q.name}`))})]})})]}),W.length>0&&h.jsxs("div",{className:"col-span-full bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsx("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Distributed Foundations"})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Cluster"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Location"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"K8s"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-center whitespace-nowrap",children:"Nodes"}),Object.keys(ts).map(Q=>h.jsx("th",{className:"px-3 py-3 font-semibold text-center whitespace-nowrap",children:ts[Q]},Q)),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Flux"}),h.jsx("th",{className:"px-5 py-3 font-semibold text-left whitespace-nowrap",children:"Status"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:W.map(Q=>h.jsxs("tr",{children:[h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-100",children:Q.name}),Q.active&&h.jsx("span",{className:"text-xs font-medium px-1.5 py-0.5 rounded-full bg-violet-500/20 text-violet-600 dark:text-violet-400",children:"active"})]})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:Q.location||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-mono text-xs",children:Q.kubernetesVersion||"—"}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-center",children:Q.nodes??"—"}),Object.keys(ts).map(pe=>{var B;const de=(B=Q.services)==null?void 0:B[pe],xe=typeof de=="object"?de==null?void 0:de.tag:typeof de=="string"?de:null;return h.jsx("td",{className:"px-3 py-3 whitespace-nowrap text-center font-mono text-xs",children:xe?h.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300",children:xe}):h.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"—"})},pe)}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap text-xs",children:Q.flux?h.jsxs("span",{className:"text-violet-500",children:[Q.flux.owner,"/",Q.flux.repo]}):h.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"—"})}),h.jsx("td",{className:"px-5 py-3 whitespace-nowrap",children:h.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${Q.status==="Running"?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-gray-200 dark:bg-gray-700 text-gray-500"}`,children:Q.status||"unknown"})})]},`${Q.provider}-${Q.name}`))})]})})]})]}),h.jsx(gu,{lines:i,title:"Sync Output"}),h.jsx(gu,{lines:o,title:"Action Output"}),f&&h.jsx("div",{className:"fixed inset-0 bg-gray-900/70 z-50 flex items-center justify-center p-4",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-lg max-w-lg w-full p-6",children:[h.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100 mb-1",children:"Feature Flags"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-5",children:f}),K?h.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"Loading flags..."}):h.jsx("div",{className:"space-y-2 max-h-80 overflow-y-auto",children:((H==null?void 0:H.flags)||[]).map(Q=>{const pe=L[Q.name]??Q.value;return h.jsxs("label",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700/30 cursor-pointer",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-100",children:Q.label}),Q.services.length>0&&h.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500",children:Q.services.join(", ")})]}),h.jsx("input",{type:"checkbox",className:"form-checkbox",checked:pe,onChange:de=>U(xe=>({...xe,[Q.name]:de.target.checked}))})]},Q.name)})}),h.jsxs("div",{className:"flex justify-end gap-2 mt-5 pt-4 border-t border-gray-200 dark:border-gray-700/60",children:[h.jsx("button",{className:"btn border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>v(null),children:"Cancel"}),h.jsx("button",{className:"btn bg-violet-500 text-white hover:bg-violet-600",disabled:N.isPending||Object.keys(L).length===0,onClick:()=>{d([]),N.mutate({vmName:f,flags:L,onLine:X},{onSuccess:()=>{v(null),U({})}})},children:N.isPending?"Applying...":"Apply"})]})]})}),y&&h.jsx("div",{className:"fixed inset-0 bg-gray-900/70 z-50 flex items-center justify-center p-4",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-lg max-w-md w-full p-6",children:[h.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100 mb-1",children:"Grant Admin"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-5",children:y}),h.jsxs("div",{className:"mb-4",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Email (optional)"}),h.jsx("input",{type:"email",className:"form-input w-full",placeholder:"Leave empty to grant all users",value:g,onChange:Q=>b(Q.target.value)}),h.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:"Leave empty to grant Foundation Admin to all non-system users"})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700/60",children:[h.jsx("button",{className:"btn border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>m(null),children:"Cancel"}),h.jsx("button",{className:"btn bg-amber-500 text-white hover:bg-amber-600",disabled:S.isPending,onClick:()=>{d([]),S.mutate({vmName:y,username:g||void 0,onLine:X},{onSuccess:()=>m(null)})},children:S.isPending?"Granting...":"Grant"})]})]})})]})})]})]})}const mm=[{code:"USD",symbol:"$"},{code:"EUR",symbol:"€"},{code:"GBP",symbol:"£"},{code:"CHF",symbol:"CHF"},{code:"AED",symbol:"AED"}];function Jr(r,a="USD"){return`${(mm.find(l=>l.code===a)||mm[0]).symbol} ${parseFloat(r).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function ej(r,a,i,l){const o=["Type,Name,Amount,Currency"];for(const y of r)o.push(`VM,"${y.name}",${y.amount},${l}`);for(const y of a)o.push(`Cluster,"${y.name}",${y.amount},${l}`);for(const y of i)o.push(`Service,"${y.name}",${y.amount},${l}`);const d=new Blob([o.join(`
65
+ `)],{type:"text/csv"}),f=URL.createObjectURL(d),v=document.createElement("a");v.href=f,v.download=`cost-report-${new Date().toISOString().slice(0,10)}.csv`,v.click(),URL.revokeObjectURL(f)}function Rh({amount:r,max:a,currency:i}){const l=a>0?r/a*100:0;return h.jsxs("div",{className:"flex items-center gap-3 w-full",children:[h.jsx("div",{className:"flex-1 bg-gray-100 dark:bg-gray-700 rounded-full h-2 overflow-hidden",children:h.jsx("div",{className:"h-full bg-violet-500 rounded-full",style:{width:`${Math.max(l,1)}%`}})}),h.jsx("span",{className:"text-sm font-mono text-gray-800 dark:text-gray-100 whitespace-nowrap w-28 text-right",children:Jr(r,i)})]})}function tj(){var I,$,ee;const[r,a]=A.useState(!1),[i,l]=A.useState(30),[o,d]=A.useState("USD"),{data:f,isLoading:v,error:y}=HT(i),m=[],g=[],b=[];let w=null,_=null;if(f)for(const[,X]of Object.entries(f)){if(X.error){w=X.error;continue}X.currency&&X.currency,X.fromCache&&X.cachedAt&&(_=new Date(X.cachedAt));for(const[ie,W]of Object.entries(X.vmCosts||{}))m.push({name:ie,amount:W});for(const[ie,W]of Object.entries(X.clusterCosts||{}))g.push({name:ie,amount:W});for(const[ie,W]of Object.entries(X.byService||{}))b.push({name:ie,amount:W})}m.sort((X,ie)=>ie.amount-X.amount),g.sort((X,ie)=>ie.amount-X.amount),b.sort((X,ie)=>ie.amount-X.amount);const C=m.reduce((X,ie)=>X+ie.amount,0),E=g.reduce((X,ie)=>X+ie.amount,0),S=b.reduce((X,ie)=>X+ie.amount,0),N=((I=m[0])==null?void 0:I.amount)||0,H=(($=g[0])==null?void 0:$.amount)||0,K=((ee=b[0])==null?void 0:ee.amount)||0,L=m.length>0||g.length>0||b.length>0,U="px-5 py-3 font-semibold text-left whitespace-nowrap";return h.jsxs("div",{className:"flex h-screen overflow-hidden",children:[h.jsx(fo,{sidebarOpen:r,setSidebarOpen:a}),h.jsxs("div",{className:"relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[h.jsx(ho,{sidebarOpen:r,setSidebarOpen:a}),h.jsx("main",{className:"grow",children:h.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto",children:[h.jsxs("div",{className:"sm:flex sm:justify-between sm:items-center mb-8",children:[h.jsxs("div",{className:"mb-4 sm:mb-0",children:[h.jsx("h1",{className:"text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold",children:"Costs"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Azure Cost Management data for tracked resources"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[_&&h.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400 bg-amber-500/10 px-2 py-1 rounded-lg",children:["Cached ",_.toLocaleString()]}),h.jsxs("select",{className:"form-select bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-sm text-gray-600 dark:text-gray-300 rounded-lg",value:i,onChange:X=>l(Number(X.target.value)),children:[h.jsx("option",{value:7,children:"Last 7 days"}),h.jsx("option",{value:14,children:"Last 14 days"}),h.jsx("option",{value:30,children:"Last 30 days"}),h.jsx("option",{value:60,children:"Last 60 days"}),h.jsx("option",{value:90,children:"Last 90 days"})]}),h.jsx("select",{className:"form-select bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-sm text-gray-600 dark:text-gray-300 rounded-lg",value:o,onChange:X=>d(X.target.value),children:mm.map(X=>h.jsxs("option",{value:X.code,children:[X.code," (",X.symbol,")"]},X.code))}),h.jsxs("button",{className:"btn bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600",onClick:()=>ej(m,g,b,o),disabled:v||!L,children:[h.jsx("svg",{className:"shrink-0 fill-current mr-1",width:"16",height:"16",viewBox:"0 0 16 16",children:h.jsx("path",{d:"M8 1a1 1 0 0 1 1 1v6.6l2.3-2.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4L7 8.6V2a1 1 0 0 1 1-1ZM2 13a1 1 0 0 1 1 1h10a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1v0a1 1 0 0 1 1-1Z"})}),"Export CSV"]})]})]}),v?h.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-gray-400 dark:text-gray-500 text-center py-12",children:"Loading cost data... This may take a moment."}):y?h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-red-500 text-center py-12",children:["Failed to load costs: ",y.message]}):w&&!L?h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-center py-12 px-5",children:[h.jsxs("div",{className:"text-red-500 mb-2",children:["Cost query failed: ",w]}),h.jsxs("div",{className:"text-gray-400 dark:text-gray-500",children:["Make sure you are logged into Azure (",h.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded font-mono",children:"az login"}),") and have Cost Management access."]})]}):L?h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl px-5 py-4",children:[h.jsxs("div",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 font-semibold mb-1",children:["VM Total (",i,"d)"]}),h.jsx("div",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:Jr(C,o)}),h.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:[m.length," VM(s)"]})]}),h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl px-5 py-4",children:[h.jsxs("div",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 font-semibold mb-1",children:["Cluster Total (",i,"d)"]}),h.jsx("div",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:Jr(E,o)}),h.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:[g.length," cluster(s)"]})]}),h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl px-5 py-4",children:[h.jsxs("div",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 font-semibold mb-1",children:["Subscription Total (",i,"d)"]}),h.jsx("div",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100",children:Jr(S,o)}),h.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:[b.length," service(s)"]})]})]}),m.length>0&&h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsx("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Cost by VM"})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:U,children:"VM"}),h.jsxs("th",{className:`${U} w-full`,children:["Cost (",i,"d)"]}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"% of Total"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:m.map(X=>h.jsxs("tr",{children:[h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-medium text-gray-800 dark:text-gray-100",children:X.name}),h.jsx("td",{className:"px-5 py-3",children:h.jsx(Rh,{amount:X.amount,max:N,currency:o})}),h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap text-right text-gray-500 dark:text-gray-400 font-mono text-xs",children:[C>0?(X.amount/C*100).toFixed(1):"0.0","%"]})]},X.name))}),h.jsx("tfoot",{children:h.jsxs("tr",{className:"border-t border-gray-200 dark:border-gray-700",children:[h.jsx("td",{className:"px-5 py-3 font-semibold text-gray-800 dark:text-gray-100",children:"Total"}),h.jsx("td",{className:"px-5 py-3 font-mono font-semibold text-gray-800 dark:text-gray-100 text-right",colSpan:"2",children:Jr(C,o)})]})})]})})]}),g.length>0&&h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsx("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Cost by Cluster"})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:U,children:"Cluster"}),h.jsxs("th",{className:`${U} w-full`,children:["Cost (",i,"d)"]}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"% of Total"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:g.map(X=>h.jsxs("tr",{children:[h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-medium text-gray-800 dark:text-gray-100",children:X.name}),h.jsx("td",{className:"px-5 py-3",children:h.jsx(Rh,{amount:X.amount,max:H,currency:o})}),h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap text-right text-gray-500 dark:text-gray-400 font-mono text-xs",children:[E>0?(X.amount/E*100).toFixed(1):"0.0","%"]})]},X.name))}),h.jsx("tfoot",{children:h.jsxs("tr",{className:"border-t border-gray-200 dark:border-gray-700",children:[h.jsx("td",{className:"px-5 py-3 font-semibold text-gray-800 dark:text-gray-100",children:"Total"}),h.jsx("td",{className:"px-5 py-3 font-mono font-semibold text-gray-800 dark:text-gray-100 text-right",colSpan:"2",children:Jr(E,o)})]})})]})})]}),b.length>0&&h.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl",children:[h.jsx("header",{className:"px-5 py-4 border-b border-gray-100 dark:border-gray-700/60",children:h.jsx("h2",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Cost by Azure Service"})}),h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"table-auto w-full dark:text-gray-300",children:[h.jsx("thead",{className:"text-xs uppercase text-gray-400 dark:text-gray-500 bg-gray-50 dark:bg-gray-900/20 border-t border-b border-gray-100 dark:border-gray-700/60",children:h.jsxs("tr",{children:[h.jsx("th",{className:U,children:"Service"}),h.jsxs("th",{className:`${U} w-full`,children:["Cost (",i,"d)"]}),h.jsx("th",{className:"px-5 py-3 font-semibold text-right whitespace-nowrap",children:"% of Total"})]})}),h.jsx("tbody",{className:"text-sm divide-y divide-gray-100 dark:divide-gray-700/60",children:b.map(X=>h.jsxs("tr",{children:[h.jsx("td",{className:"px-5 py-3 whitespace-nowrap font-medium text-gray-800 dark:text-gray-100",children:X.name}),h.jsx("td",{className:"px-5 py-3",children:h.jsx(Rh,{amount:X.amount,max:K,currency:o})}),h.jsxs("td",{className:"px-5 py-3 whitespace-nowrap text-right text-gray-500 dark:text-gray-400 font-mono text-xs",children:[S>0?(X.amount/S*100).toFixed(1):"0.0","%"]})]},X.name))}),h.jsx("tfoot",{children:h.jsxs("tr",{className:"border-t border-gray-200 dark:border-gray-700",children:[h.jsx("td",{className:"px-5 py-3 font-semibold text-gray-800 dark:text-gray-100",children:"Total"}),h.jsx("td",{className:"px-5 py-3 font-mono font-semibold text-gray-800 dark:text-gray-100 text-right",colSpan:"2",children:Jr(S,o)})]})})]})})]}),w&&h.jsxs("div",{className:"text-xs text-yellow-600 dark:text-yellow-400 bg-yellow-500/10 rounded-lg px-4 py-2",children:["Warning: ",w]})]}):h.jsx("div",{className:"bg-white dark:bg-gray-800 shadow-xs rounded-xl text-sm text-gray-400 dark:text-gray-500 text-center py-12",children:"No cost data available for the selected period."})]})})]})]})}function fw({severity:r}){const a=r==="warn"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400";return h.jsx("span",{className:`inline-flex px-2 py-0.5 rounded-full text-xs font-medium ${a}`,children:r})}function aj({findings:r}){if(!(r!=null&&r.length))return h.jsx("p",{className:"text-sm text-green-500 py-4 text-center",children:"No findings"});const a=[...r].sort((i,l)=>(i.severity==="warn"?-1:1)-(l.severity==="warn"?-1:1));return h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase border-b border-gray-200 dark:border-gray-700",children:[h.jsx("th",{className:"px-4 py-2 w-20",children:"Severity"}),h.jsx("th",{className:"px-4 py-2 w-40",children:"Check"}),h.jsx("th",{className:"px-4 py-2",children:"Message"}),h.jsx("th",{className:"px-4 py-2",children:"Fix"})]})}),h.jsx("tbody",{children:a.map((i,l)=>h.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-700/50",children:[h.jsx("td",{className:"px-4 py-2",children:h.jsx(fw,{severity:i.severity})}),h.jsx("td",{className:"px-4 py-2",children:h.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded",children:i.check})}),h.jsx("td",{className:"px-4 py-2 text-gray-700 dark:text-gray-300",children:i.message}),h.jsx("td",{className:"px-4 py-2",children:h.jsx("code",{className:"text-xs text-gray-500 break-all",children:i.fix||""})})]},l))})]})}function Oh({title:r,resources:a,nameKey:i}){const[l,o]=A.useState(null);return a!=null&&a.length?h.jsxs("div",{className:"mb-8",children:[h.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100 mb-3",children:r}),h.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase border-b border-gray-200 dark:border-gray-700",children:[h.jsx("th",{className:"px-5 py-3",children:"Name"}),h.jsx("th",{className:"px-5 py-3",children:"Location"}),h.jsx("th",{className:"px-5 py-3 w-24",children:"Warnings"}),h.jsx("th",{className:"px-5 py-3 w-24",children:"Info"})]})}),h.jsx("tbody",{children:a.map((d,f)=>{const v=d[i]||"?",y=(d.findings||[]).filter(g=>g.severity==="warn").length,m=(d.findings||[]).filter(g=>g.severity==="info").length;return h.jsxs(Fl.Fragment,{children:[h.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-700/50 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/30",onClick:()=>o(l===f?null:f),children:[h.jsx("td",{className:"px-5 py-3 font-medium text-gray-800 dark:text-gray-200",children:v}),h.jsx("td",{className:"px-5 py-3 text-gray-600 dark:text-gray-400",children:d.location||"-"}),h.jsx("td",{className:"px-5 py-3",children:y>0?h.jsxs(h.Fragment,{children:[h.jsx(fw,{severity:"warn"}),h.jsx("span",{className:"ml-1 text-xs",children:y>1?`x${y}`:""})]}):h.jsx("span",{className:"text-gray-400",children:"0"})}),h.jsx("td",{className:"px-5 py-3 text-gray-500",children:m})]}),l===f&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"p-0",children:h.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 p-4",children:h.jsx(aj,{findings:d.findings})})})})]},f)})})]})})]}):null}function nj(){var b,w,_;const[r,a]=A.useState(!1),{data:i,isLoading:l,refetch:o,isFetching:d}=KT(),f=(i==null?void 0:i.vms)||{},v=(i==null?void 0:i.aks)||{},y=(i==null?void 0:i.storage)||{},m=[...f.findings||[],...v.findings||[],...y.findings||[]],g=m.filter(C=>C.severity==="warn").length;return h.jsxs("div",{className:"flex h-screen overflow-hidden",children:[h.jsx(fo,{sidebarOpen:r,setSidebarOpen:a}),h.jsxs("div",{className:"relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[h.jsx(ho,{sidebarOpen:r,setSidebarOpen:a}),h.jsx("main",{className:"grow",children:h.jsxs("div",{className:"px-4 sm:px-6 lg:px-8 py-8 w-full max-w-9xl mx-auto",children:[h.jsxs("div",{className:"sm:flex sm:justify-between sm:items-center mb-8",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl md:text-3xl text-gray-800 dark:text-gray-100 font-bold",children:"Security Audit"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:"Azure infrastructure security posture"})]}),h.jsx("button",{className:"btn bg-gray-900 text-gray-100 hover:bg-gray-800 dark:bg-gray-100 dark:text-gray-800 dark:hover:bg-white disabled:opacity-50",onClick:()=>o(),disabled:d,children:d?"Scanning...":"Run Audit"})]}),h.jsx("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[{label:"Total Findings",value:m.length},{label:"Warnings",value:g,color:"text-yellow-500"},{label:"Resources",value:(((b=f.vms)==null?void 0:b.length)||0)+(((w=v.clusters)==null?void 0:w.length)||0)+(((_=y.accounts)==null?void 0:_.length)||0)},{label:"Status",value:l||d?"Scanning...":i?g===0?"Clean":`${g} issues`:"Not scanned"}].map((C,E)=>h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4",children:[h.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-1",children:C.label}),h.jsx("p",{className:`text-2xl font-semibold ${C.color||"text-gray-800 dark:text-gray-100"}`,children:C.value})]},E))}),!i&&!l&&!d?h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-12 text-center",children:[h.jsx("p",{className:"text-sm text-gray-500 mb-4",children:'Click "Run Audit" to scan Azure infrastructure for security issues.'}),h.jsx("button",{className:"btn bg-gray-900 text-gray-100 hover:bg-gray-800 dark:bg-gray-100 dark:text-gray-800 dark:hover:bg-white",onClick:()=>o(),children:"Run Audit"})]}):l||d?h.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-12 text-center",children:h.jsx("p",{className:"text-sm text-gray-500",children:"Running security audit across all Azure resources..."})}):h.jsxs(h.Fragment,{children:[h.jsx(Oh,{title:"Virtual Machines",resources:f.vms,nameKey:"vm"}),h.jsx(Oh,{title:"AKS Clusters",resources:v.clusters,nameKey:"cluster"}),h.jsx(Oh,{title:"Storage Accounts",resources:y.accounts,nameKey:"account"})]})]})})]})]})}function rj(){const r=Va();return A.useEffect(()=>{document.querySelector("html").style.scrollBehavior="auto",window.scroll({top:0}),document.querySelector("html").style.scrollBehavior=""},[r.pathname]),h.jsxs(P2,{children:[h.jsx(as,{exact:!0,path:"/",element:h.jsx(JT,{})}),h.jsx(as,{path:"/resources/new",element:h.jsx(FT,{})}),h.jsx(as,{path:"/fleet",element:h.jsx($T,{})}),h.jsx(as,{path:"/costs",element:h.jsx(tj,{})}),h.jsx(as,{path:"/audit",element:h.jsx(nj,{})})]})}const ij=new V_({defaultOptions:{queries:{staleTime:5e3,retry:1}}});V1.createRoot(document.getElementById("root")).render(h.jsx(Fl.StrictMode,{children:h.jsx(h_,{basename:"/cloud",children:h.jsx(iE,{children:h.jsx(RT,{children:h.jsx(Q_,{client:ij,children:h.jsx(rj,{})})})})})}));