@maxceem/agw 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,98 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=te(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function M(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=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&&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)},P={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:M}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function F(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function se(e,t){ae++,ie[ae]=e.current,e.current=t}var ce=oe(null),le=oe(null),ue=oe(null),de=oe(null);function fe(e,t){switch(se(ue,t),se(le,e),se(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(ce),se(ce,e)}function pe(){F(ce),F(le),F(ue)}function me(e){e.memoizedState!==null&&se(de,e);var t=ce.current,n=qd(t,e.type);t!==n&&(se(le,e),se(ce,n))}function he(e){le.current===e&&(F(ce),F(le)),de.current===e&&(F(de),rp._currentValue=re)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(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 Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(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 Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=P.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function st(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[lt])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=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]*$`),Ot={},kt={};function At(e){return Ce.call(kt,e)?!0:Ce.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Mt(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 Nt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Pt(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=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 Xt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(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 $t=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`]]),en=/^[\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 tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(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="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(Su(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var fn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(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 bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=m({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=m({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,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!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(m({},An,{dataTransfer:0})),Nn=Sn(m({},Tn,{relatedTarget:0})),Pn=Sn(m({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(m({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(m({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={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`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(m({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(m({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(m({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(m({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(m({},An,{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})),qn=Sn(m({},Cn,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=fn&&`CompositionEvent`in window,Xn=null;fn&&`documentMode`in document&&(Xn=document.documentMode);var Zn=fn&&`TextEvent`in window&&!Xn,Qn=fn&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=vn(),_n=gn=hn=null,rr=!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 Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={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 sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Ad(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){Sd(e,0)}function fr(e){if(Rt(bt(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(fn){var hr;if(fn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,an(e)),un(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ce.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(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=zt(e.document)}return t}function jr(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 Mr=fn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==zt(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Ad(Pr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};fn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`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(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Tt(t,[e])}var $r=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&&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)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var I={};function li(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(e,t,n,r){return new li(e,t,n,r)}function di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fi(e,t){var n=e.alternate;return n===null?(n=ui(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 pi(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 mi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)di(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ui(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return hi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ui(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ui(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ui(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ui(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function hi(e,t,n,r){return e=ui(7,e,r,t),e.lanes=n,e}function gi(e,t,n){return e=ui(6,e,null,t),e.lanes=n,e}function _i(e){var t=ui(18,null,null,0);return t.stateNode=e,t}function vi(e,t,n){return t=ui(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yi=new WeakMap;function bi(e,t){if(typeof e==`object`&&e){var n=yi.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},yi.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var xi=[],Si=0,Ci=null,wi=0,Ti=[],Ei=0,Di=null,Oi=1,ki=``;function Ai(e,t){xi[Si++]=wi,xi[Si++]=Ci,Ci=e,wi=t}function ji(e,t,n){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Di=e;var r=Oi;e=ki;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Oi=1<<32-Be(t)+i|n<<i|r,ki=a+e}else Oi=1<<a|n<<i|r,ki=e}function Mi(e){e.return!==null&&(Ai(e,1),ji(e,1,0))}function Ni(e){for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null;for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,ki=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null}function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Oi=t.id,ki=t.overflow,Di=e}var Fi=null,Ii=null,Li=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Fi=e.return;Fi;)switch(Fi.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Fi=Fi.return}}function Wi(e){if(e!==Fi)return!1;if(!Li)return Ui(e),Li=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&Ii&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ii=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ii=hf(e)}else t===27?(t=Ii,nf(e.type)?(e=mf,mf=null,Ii=e):Ii=t):Ii=Fi?pf(e.stateNode.nextSibling):null;return!0}function Gi(){Ii=Fi=null,Li=!1}function Ki(){var e=Ri;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=oe(null),Yi=null,L=null;function Xi(e,t,n){se(Ji,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=Ji.current,F(Ji)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ea(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Yi=e,L=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Yi,e)}function ia(e,t){return Yi===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},L===null){if(e===null)throw Error(i(308));L=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else L=L.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=t.unstable_scheduleCallback,ca=t.unstable_NormalPriority,la={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ua(){return{controller:new oa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var fa=null,pa=0,ma=0,ha=null;function ga(e,t){if(fa===null){var n=fa=[];pa=0,ma=md(),ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(_a,_a),t}function _a(){if(--pa===0&&fa!==null){ha!==null&&(ha.status=`fulfilled`);var e=fa;fa=null,ma=0,ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ya=N.S;N.S=function(e,t){nu=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ga(e,t),ya!==null&&ya(e,t)};var ba=oe(null);function xa(){var e=ba.current;return e===null?zl.pooledCache:e}function Sa(e,t){t===null?se(ba,ba.current):se(ba,t.pool)}function Ca(){var e=xa();return e===null?null:{parent:la._currentValue,pool:e}}var wa=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e}throw ja=t,wa}}function Aa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ja=e,wa):e}}var ja=null;function Ma(){if(ja===null)throw Error(i(459));var e=ja;return ja=null,e}function Na(e){if(e===wa||e===Ea)throw Error(i(483))}var Pa=null,Fa=0;function Ia(e){var t=Fa;return Fa+=1,Pa===null&&(Pa=[]),ka(Pa,e,t)}function La(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ra(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=gi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&Aa(i)===t.type)?(t=a(t,n.props),La(t,n),t.return=e,t):(t=mi(n.type,n.key,n.props,null,e.mode,r),La(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=hi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=mi(t.type,t.key,t.props,null,e.mode,n),La(n,t),n.return=e,n;case v:return t=vi(t,e.mode,n),t.return=e,t;case D:return t=Aa(t),f(e,t,n)}if(M(t)||j(t))return t=hi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ia(t),n);if(t.$$typeof===C)return f(e,ia(e,t),n);Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=Aa(n),p(e,t,n,r)}if(M(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ia(n),r);if(n.$$typeof===C)return p(e,t,ia(e,n),r);Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Aa(r),m(e,t,n,r,i)}if(M(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ia(r),i);if(r.$$typeof===C)return m(e,t,n,ia(t,r),i);Ra(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Li&&Ai(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Li&&Ai(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Li&&Ai(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Li&&Ai(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Li&&Ai(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Li&&Ai(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=hi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=mi(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=vi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Aa(o),b(e,r,o,c)}if(M(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ia(o),c);if(o.$$typeof===C)return b(e,r,ia(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=gi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=b(e,t,n,r);return Pa=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(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 Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}function Ja(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ya=!1;function Xa(){if(Ya){var e=ha;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===ma&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ha=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qa(n[e],t)}var eo=oe(null),to=oe(0);function no(e,t){e=Gl,se(to,e),se(eo,t),Gl=e|t.baseLanes}function ro(){se(to,Gl),se(eo,eo.current)}function io(){Gl=to.current,F(eo),F(to)}var ao=oe(null),oo=null;function so(e){var t=e.alternate;se(po,po.current&1),se(ao,e),oo===null&&(t===null||eo.current!==null||t.memoizedState!==null)&&(oo=e)}function co(e){se(po,po.current),se(ao,e),oo===null&&(oo=e)}function lo(e){e.tag===22?(se(po,po.current),se(ao,e),oo===null&&(oo=e)):uo(e)}function uo(){se(po,po.current),se(ao,ao.current)}function fo(e){F(ao),oo===e&&(oo=null),F(po)}var po=oe(0);function mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(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)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 ho=0,R=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return ho=a,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Bs:Vs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){N.H=zs;var t=go!==null&&go.next!==null;if(ho=0,_o=go=R=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&ta(e)&&(rc=!0))}function ko(e,t,n,r){R=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Hs,o=t(n,r)}while(yo);return o}function Ao(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(R.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}ho=0,_o=go=R=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?R.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?R.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw R.alternate===null?Error(i(467)):Error(i(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?R.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=ka(Co,e,t),t=R,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Bs:Vs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return ra(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),R.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ho&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ma&&(d=!0);else if((ho&p)===p){u=u.next,p===ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,R.lanes|=p,ql|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,R.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(rc=!0,d&&(n=ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function z(e,t,n){var r=R,a=Fo(),o=Li;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((go||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,fs(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,V(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||ho&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=Io(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Jo(e){var t=oi(e,2);t!==null&&_u(t,e,2)}function Yo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Zo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){B(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){B(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return B(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function B(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Li){var n=zl.formState;if(n!==null){a:{var r=R;if(Li){if(Ii){b:{for(var i=Ii,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ii=pf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Ns.bind(null,R,r),r.dispatch=n,r=Yo(!1),a=Fs.bind(null,R,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,R,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(Fo(),go,e)}function as(e,t,n){if(t=Ho(e,t,ns)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===wa?Ea:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(R.flags|=2048,V(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=Fo(),n=go;if(n!==null)return as(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function V(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=Io(),R.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Fo().memoizedState}function ls(e,t,n,r){var i=Po();R.flags|=e,i.memoizedState=V(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=V(t,a,n,r):(R.flags|=e,i.memoizedState=V(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){R.flags|=4;var t=R.updateQueue;if(t===null)t=Io(),R.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Fo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(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 vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||ho&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),R.lanes|=e,ql|=e,n)}function Cs(e,t,n,r){return Tr(n,t)?n:eo.current===null?!(ho&42)||ho&1073741824&&!(J&261930)?(rc=!0,e.memoizedState=n):(e=gu(),R.lanes|=e,ql|=e,t):(e=Ss(e,n,r),Tr(e,t)||(rc=!0),e)}function ws(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Fs(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,va(c,r),hu(e)):Ps(e,t,r,hu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Ts(){}function H(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;ws(e,a,t,re,n===null?Ts:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},hu())}function Os(){return ra(rp)}function ks(){return Fo().memoizedState}function As(){return Fo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ga(n);var r=Ka(t,e,n);r!==null&&(_u(r,t,n),qa(r,t,n)),t={cache:ua()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ai(e,t,n,r),n!==null&&(_u(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,hu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),zl===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return _u(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&_u(t,e,2)}function Is(e){var t=e.alternate;return e===R||t!==null&&t===R}function Ls(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var zs={readContext:ra,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};zs.useEffectEvent=To;var Bs={readContext:ra,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Ns.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(Po(),e,t)},useTransition:function(){var e=Yo(!1);return e=ws.bind(null,R,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=Po();if(Li){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));J&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Ko.bind(null,r,o,e),[e]),r.flags|=2048,V(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=zl.identifierPrefix;if(Li){var n=ki,r=Oi;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=js.bind(null,R)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:ra,use:Ro,useCallback:bs,useContext:ra,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Vo,useRef:cs,useState:function(){return Vo(Bo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:z,useId:ks,useHostTransitionStatus:Os,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Xo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:As};Vs.useEffectEvent=ms;var Hs={readContext:ra,use:Ro,useCallback:bs,useContext:ra,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Uo,useRef:cs,useState:function(){return Uo(Bo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Fo();return go===null?Ss(n,e,t):Cs(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:z,useId:ks,useHostTransitionStatus:Os,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:As};Hs.useEffectEvent=ms;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var U={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ga(r);i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(_u(t,e,r),qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ga(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(_u(t,e,r),qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ga(n);r.tag=2,t!=null&&(r.callback=t),t=Ka(e,r,n),t!==null&&(_u(t,e,n),qa(t,e,n))}};function Ws(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Gs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&U.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){$r(e)}function Js(e){console.error(e)}function Ys(e){$r(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Ga(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=ao.current,n!==null){switch(n.tag){case 31:case 13:return oo===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ku(),!1}if(Li)return t=ao.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=bi(r,n),a=Qs(e.stateNode,r,a),Ja(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=bi(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Ja(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Ja(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return na(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!rc?(Mo(e,t,i),W(e,t,i)):(Li&&s&&Mi(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return W(e,t,i)}return t.flags|=1,e=fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,W(e,t,i)}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sa(t,a===null?null:a.cachePool),a===null?ro():no(t,a),lo(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Sa(t,null),ro(),uo(t)):(Sa(t,a.cachePool),no(t,a),uo(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=xa();return a=a===null?null:{parent:la._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Sa(t,null),ro(),lo(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Ba(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,fo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Li){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(co(t),(e=Ii)?(e=lf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Fi=t,Ii=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(co(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||ea(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=zl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),_u(r,e,s),nc;ku(),t=fc(e,t,n)}else e=o.treeContext,Ii=pf(s.nextSibling),Fi=t,Li=!0,Ri=null,zi=!1,e!==null&&Pi(t,e),t=dc(t,r),t.flags|=4096;return t}return e=fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return na(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!rc?(Mo(e,t,i),W(e,t,i)):(Li&&r&&Mi(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!rc?(Mo(e,t,a),W(e,t,a)):(Li&&r&&Mi(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(na(t),t.stateNode===null){var a=I,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=U,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ua(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):I,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&U.enqueueReplaceState(a,a.state,null),Za(t,r,a,i),Xa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=I,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),Ha=!1;var f=t.memoizedState;a.state=f,Za(t,r,a,i),Xa(),l=t.memoizedState,s||f!==l||Ha?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=Ha||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Wa(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=I,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),Ha=!1,f=t.memoizedState,a.state=f,Za(t,r,a,i),Xa();var p=t.memoizedState;o!==d||f!==p||Ha||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=Ha||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=W(e,t,i),e}function vc(e,t,n,r){return Gi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:Ca()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(po.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Li){if(a?so(t):uo(t),(e=Ii)?(e=lf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Fi=t,Ii=null)):e=null,e===null)throw Vi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(uo(t),a=t.mode,c=wc({mode:`hidden`,children:c},a),r=hi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(so(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(so(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(uo(t),c=r.fallback,a=t.mode,r=wc({mode:`visible`,children:r.children},a),c=hi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ba(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(uo(t),t.child=e.child,t.flags|=128,t=null);else if(so(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=zl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),_u(s,e,r),nc;uf(c)||ku(),t=Tc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ii=pf(c.nextSibling),Fi=t,Li=!0,Ri=null,zi=!1,e!==null&&Pi(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return a?(uo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=fi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=hi(c,a,n,null),c.flags|=2):c=fi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=Ca():(l=la._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(so(t),n=e.child,e=n.sibling,n=fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=ui(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Ba(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=po.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,se(po,o),ic(e,t,r,n),r=Li?wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&mo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function W(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Ac(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),Xi(t,la,e.memoizedState.cache),Gi();break;case 27:case 5:me(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(so(t),e=W(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(so(t),t.flags|=128,null);so(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),se(po,po.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Xi(t,la,e.memoizedState.cache)}return W(e,t,n)}function jc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!kc(e,n)&&!(t.flags&128))return rc=!1,Ac(e,t,n);rc=!!(e.flags&131072)}else rc=!1,Li&&t.flags&1048576&&ji(t,wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Aa(t.elementType),t.type=e,typeof e==`function`)di(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===ee){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Wa(e,t),Za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,la,r),r!==o.cache&&$i(t,[la],n,!0),Xa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}else if(r!==a){a=bi(Error(i(424)),t),qi(a),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ii=pf(e.firstChild),Fi=t,Li=!0,Ri=null,zi=!0,n=Va(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=W(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Li||(n=t.type,e=t.pendingProps,r=Gd(ue.current).createElement(n),r[lt]=t,r[ut]=e,zd(r,n,e),St(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Li&&(r=t.stateNode=_f(t.type,t.pendingProps,ue.current),Fi=t,zi=!0,a=Ii,nf(t.type)?(mf=a,Ii=pf(r.firstChild)):Ii=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Li&&((a=r=Ii)&&(r=sf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Fi=t,Ii=pf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),me(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),rp._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&Li&&((e=n=Ii)&&(n=cf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Fi=t,Ii=null,e=!0)),e||Vi(t)),null;case 13:return Sc(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(la),e===null?(a=xa(),a===null&&(a=zl,o=ua(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ua(t),Xi(t,la,a)):((e.lanes&n)!==0&&(Wa(e,t),Za(t,null,null,n),Xa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Xi(t,la,r),r!==a.cache&&$i(t,[la],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Xi(t,la,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw ja=Da,Ta}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t))if(Eu())e.flags|=8192;else throw ja=Da,Ta}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,Zl|=t)}function Ic(e,t){if(!Li)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lc(t),null;case 1:return Lc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(la),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Lc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(Lc(t),Nc(t,a,null,r,n)):(Lc(t),Pc(t,o))):o?o===e.memoizedState?(Lc(t),t.flags&=-16777217):(Mc(t),Lc(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),Lc(t),Nc(t,a,e,r,n)),null;case 27:if(he(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}e=ce.current,Wi(t)?Hi(t,e):(e=_f(a,r,n),t.stateNode=e,Mc(t))}return Lc(t),null;case 5:if(he(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}if(o=ce.current,Wi(t))Hi(t,o);else{var s=Gd(ue.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Fi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Vi(t,!0)}else e=Gd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fo(t),t):(fo(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(fo(t),t):(fo(t),null)}return fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return pe(),e===null&&Ed(t.stateNode.containerInfo),Lc(t),null;case 10:return Zi(t.type),Lc(t),null;case 19:if(F(po),r=t.memoizedState,r===null)return Lc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=mo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pi(n,e),n=n.sibling;return se(po,po.current&1|2),Li&&Ai(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>ru&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Li)return Lc(t),null}else 2*Oe()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=po.current,se(po,a?n&1|2:n&1),Li&&Ai(t,r.treeForkCount),e);case 22:case 23:return fo(t),io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(la),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(la),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(fo(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(po),null;case 4:return pe(),null;case 10:return Zi(t.type),null;case 22:case 23:return fo(t),io(),e!==null&&F(ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(la),null;case 25:return null;default:return null}}function Bc(e,t){switch(Ni(t),t.tag){case 3:Zi(la),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&fo(t);break;case 13:fo(t);break;case 19:F(po);break;case 10:Zi(t.type);break;case 22:case 23:fo(t),io(),e!==null&&F(ba);break;case 24:Zi(la)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){qu(e,e.return,t)}}}function Wc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[ut]=t}catch(t){qu(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(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&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===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=nn));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[lt]=e,t[ut]=n}catch(t){qu(e,e.return,t)}}var el=!1,G=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Ud=fp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Vc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(bl(e,n),r&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{$a(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:bl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||G,i=el;var a=G;el=r,(G=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),el=i,G=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(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 sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:G||Kc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:G||Kc(n,t);var r=sl,i=cl;nf(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),vf(n.stateNode),sl=r,cl=i;break;case 5:G||Kc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){qu(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),G||Hc(4,n,t),ll(e,t,n);break;case 1:G||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:G=(r=G)||n.memoizedState!==null,ll(e,t,n),G=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){qu(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){qu(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(G||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(G||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode);else e.stateNode=Vf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(G||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(G||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Gf=null,a=gl,gl=xf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){qu(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=xf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=G;if(el=u||a,G=d||l,hl(t,e),G=d,el=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||G||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),xl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),xl(t);break;case 27:vf(t.stateNode);case 26:case 5:Kc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Vc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Qa(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Gc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(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&&da(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Vc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Xf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=xf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(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 Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=ra(la),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(la).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,zl=null,q=null,J=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return K&2&&J!==0?J&-J:N.T===null?ot():md()}function gu(){if(Xl===0)if(!(J&536870912)||Li){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),Xl=e}else Xl=536870912;return e=ao.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===zl&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,J,Xl,!1)),$e(e,n),(!(K&2)||e!==zl)&&(e===zl&&(!(K&2)&&(Jl|=n),Kl===4&&xu(e,J,Xl,!1)),od(e))}function vu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-Oe(),10<a)){if(xu(r,t,Xl,!Hl),Je(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Zd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},jl(t,a,d);var m=(a&62914560)===a?tu-Oe():(a&4194048)===a?nu-Oe():0;if(m=Qf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))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 xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function Su(){return K&6?!0:(sd(0,!1),!1)}function Cu(){if(q!==null){if(Bl===0)var e=q.return;else e=q,L=Yi=null,No(e),Pa=null,Fa=0,e=q;for(;e!==null;)Bc(e.alternate,e),e=e.return;q=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),zl=e,q=n=fi(e.current,null),J=t,Bl=0,Vl=null,Hl=!1,Ul=Ye(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,ri(),n}function Tu(e,t){R=null,N.H=zs,t===wa||t===Ea?(t=Ma(),Bl=3):t===Ta?(t=Ma(),Bl=4):Bl=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,q===null&&(Kl=1,Xs(e,bi(t,e.current)))}function Eu(){var e=ao.current;return e===null?!0:(J&4194048)===J?oo===null:(J&62914560)===J||J&536870912?e===oo:!1}function Du(){var e=N.H;return N.H=zs,e===null?zs:e}function Ou(){var e=N.A;return N.A=Ll,e}function ku(){Kl=4,Hl||(J&4194048)!==J&&ao.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||zl===null||xu(zl,J,Xl,!1)}function Au(e,t,n){var r=K;K|=2;var i=Du(),a=Ou();(zl!==e||J!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&q!==null){var s=q,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:ao.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,L=Yi=null,K=r,N.H=i,N.A=a,q===null&&(zl=null,J=0,ri()),o}function ju(){for(;q!==null;)Pu(q)}function Mu(e,t){var n=K;K|=2;var r=Du(),a=Ou();zl!==e||J!==t?(iu=null,ru=Oe()+500,wu(e,t)):Ul=Ye(e,t);a:do try{if(Bl!==0&&q!==null){t=q;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(Oa(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||zl!==e||(Bl=7),od(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:Oa(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Yf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return L=Yi=null,N.H=r,N.A=a,K=n,q===null?(zl=null,J=0,ri(),Kl):0}function Nu(){for(;q!==null&&!Ee();)Pu(q)}function Pu(e){var t=jc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):q=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:No(t);default:Bc(n,t),t=q=pi(t,Gl),t=jc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):q=t}function Iu(e,t,n,r){L=Yi=null,No(t),Pa=null,Fa=0;var i=t.return;try{if(tc(e,i,t,n,J)){Kl=1,Xs(e,bi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Kl=1,Xs(e,bi(n,e.current)),q=null;return}t.flags&32768?(Li||r===1?e=!0:Ul||J&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Rc(t.alternate,t,Gl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Kl=6,q=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,et(e,n,o,s,c,l),e===zl&&(q=zl=null,J=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(Me,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,P.p=a,N.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=K;K|=4;try{_l(t,e);var a=Wd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{K=i,P.p=r,N.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,P.p=r,N.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,De();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),at(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=at(lu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,sd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{P.p=a,N.T=r,Uu(e,t)}}function Ku(e,t,n){t=bi(n,t),t=Qs(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&($e(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=bi(n,e),n=$s(2),r=Ka(t,n,2),r!==null&&(ec(n,r,t,e),$e(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(J&n)===n&&(Kl===4||Kl===3&&(J&62914560)===J&&300>Oe()-tu?!(K&2)&&wu(e,0):Yl|=n,Zl===J&&(Zl=0)),od(e)}function Xu(e,t){t===0&&(t=Ze()),e=oi(e,t),e!==null&&($e(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return we(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=J,a=Je(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=Oe(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=J,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),at(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=dd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=J;return r=Je(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){ef(function(){K&6?we(Ae,cd):ld()})}function md(){if(ad===0){var e=ma;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function gd(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 _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);H(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),H(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Zr.length;vd++){var yd=Zr[vd];Qr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`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(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!pn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}un(function(){var r=a,i=an(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Ur:case Wr:case Gr:l=Pn;break;case Yr:l=Gn;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=dn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c))if(mr)v=Cr;else{v=xr;var y=br}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=pr):v=Sr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,rr=!0)),y=Ad(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=dn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=dn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=dn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
9
- `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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 o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(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 qd(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 Jd(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 Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body);n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function of(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`:of(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(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 mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(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 _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=P.d;P.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Su();return e||t}function wf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),St(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=xt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);St(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=xt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),St(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=xt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),St(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=ue.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=xt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.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},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Vt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),St(t),e.head.appendChild(t))}function zf(e){return`[src="`+Vt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,St(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(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 Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ui(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ua(a),e}function op(e){return e?(e=I,e):I}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ga(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ka(e,r,t),n!==null&&(_u(n,e,t),qa(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&_u(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=hu();t=it(t);var n=oi(e,t);n!==null&&_u(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,hp(e,t,n,r)}finally{P.p=a,N.T=i}}function mp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,hp(e,t,n,r)}finally{P.p=a,N.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}od(a),!(K&6)&&(ru=Oe()+500,sd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&_u(s,a,2),Su(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=an(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 _p=e,null}function yp(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(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`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 Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){dp(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 Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=yt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,H(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,hu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Su(),t[dt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.8`)throw Error(i(527,Hp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Le=Wp.inject(Up),Re=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[dt]=t.current,Ed(e),new Bp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=l(h(),1),b=_(),x=`modulepreload`,S=function(e){return`/`+e},C={},w=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=S(t,n),t=s(t),t in C)return;C[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:x,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},T=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,E=/^[\\/]{2}/;function ee(e,t){return t+e.replace(/\\/g,`/`)}var D=`popstate`;function O(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function k(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return M(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:N(t)}return re(t,n,null,e)}function A(e,t){if(e===!1||e==null)throw Error(t)}function j(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function te(){return Math.random().toString(36).substring(2,10)}function ne(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function M(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?P(t):t,state:n,key:t&&t.key||r||te(),mask:i}}function N({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function P(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function re(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=O(e)?e:M(h.location,e,t);n&&n(r,e),l=u()+1;let d=ne(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=O(e)?e:M(h.location,e,t);n&&n(r,e),l=u();let i=ne(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ie(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(D,d),c=e,()=>{i.removeEventListener(D,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ie(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),A(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:N(t);return i=i.replace(/ $/,`%20`),!n&&E.test(i)&&(i=r+i),new URL(i,r)}function ae(e,t,n=`/`){return oe(e,t,n,!1)}function oe(e,t,n,r,i){let a=Te((typeof t==`string`?P(t):t).pathname||`/`,n);if(a==null)return null;let o=i??se(e),s=null,c=we(a);for(let e=0;s==null&&e<o.length;++e)s=be(o[e],c,r);return s}function F(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function se(e){let t=ce(e);return ue(t),t}function ce(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;A(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ne([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(A(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ce(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ve(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ce(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of le(e.path))a(e,t,!0,n)}),t}function le(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=le(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ue(e){e.sort((e,t)=>e.score===t.score?ye(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var de=/^:[\w-]+$/,fe=3,pe=2,me=1,he=10,ge=-2,_e=e=>e===`*`;function ve(e,t){let n=e.split(`/`),r=n.length;return n.some(_e)&&(r+=ge),t&&(r+=pe),n.filter(e=>!_e(e)).reduce((e,t)=>e+(de.test(t)?fe:t===``?me:he),r)}function ye(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function be(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Se(u,l,s.matcher,s.compiledParams):xe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ne([a,d.pathname]),pathnameBase:Fe(Ne([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ne([a,d.pathnameBase]))}return o}function xe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ce(e.path,e.caseSensitive,e.end);return Se(e,t,n,r)}function Se(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Ce(e,t=!1,n=!0){j(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function we(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return j(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Te(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ee(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?P(e):e,a;return n?(n=Me(n),a=n.startsWith(`/`)?De(n.substring(1),`/`):De(n,t)):a=t,{pathname:a,search:Ie(r),hash:Le(i)}}function De(e,t){let n=Pe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Oe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ke(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ae(e){let t=ke(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function je(e,t,n,r=!1){let i;typeof e==`string`?i=P(e):(i={...e},A(!i.pathname||!i.pathname.includes(`?`),Oe(`?`,`pathname`,`search`,i)),A(!i.pathname||!i.pathname.includes(`#`),Oe(`#`,`pathname`,`hash`,i)),A(!i.search||!i.search.includes(`#`),Oe(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ee(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Me=e=>e.replace(/[\\/]{2,}/g,`/`),Ne=e=>Me(e.join(`/`)),Pe=e=>e.replace(/\/+$/,``),Fe=e=>Pe(e).replace(/^\/*/,`/`),Ie=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Le=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Re=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ze(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Be(e){return Ne(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ve=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function He(e,t){let n=e;if(typeof n!=`string`||!T.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ve)try{let e=new URL(window.location.href),r=E.test(n)?new URL(ee(n,e.protocol)):new URL(n),a=Te(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{j(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ue=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ue);var We=[`GET`,...Ue];new Set(We);var Ge=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ke(e){try{return Ge.includes(new URL(e).protocol)}catch{return!1}}var qe=v.createContext(null);qe.displayName=`DataRouter`;var Je=v.createContext(null);Je.displayName=`DataRouterState`;var Ye=v.createContext(!1);function Xe(){return v.useContext(Ye)}var Ze=v.createContext({isTransitioning:!1});Ze.displayName=`ViewTransition`;var Qe=v.createContext(new Map);Qe.displayName=`Fetchers`;var $e=v.createContext(null);$e.displayName=`Await`;var et=v.createContext(null);et.displayName=`Navigation`;var tt=v.createContext(null);tt.displayName=`Location`;var nt=v.createContext({outlet:null,matches:[],isDataRoute:!1});nt.displayName=`Route`;var rt=v.createContext(null);rt.displayName=`RouteError`;var it=`REACT_ROUTER_ERROR`,at=`REDIRECT`,ot=`ROUTE_ERROR_RESPONSE`;function st(e){if(e.startsWith(`${it}:${at}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ct(e){if(e.startsWith(`${it}:${ot}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Re(t.status,t.statusText,t.data)}catch{}}function lt(e,{relative:t}={}){A(ut(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(et),{hash:i,pathname:a,search:o}=vt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ne([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ut(){return v.useContext(tt)!=null}function dt(){return A(ut(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(tt).location}function ft(e){A(ut(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=dt();return v.useMemo(()=>xe(e,we(t)),[t,e])}var pt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function mt(e){v.useContext(et).static||v.useLayoutEffect(e)}function ht(){let{isDataRoute:e}=v.useContext(nt);return e?Lt():gt()}function gt(){A(ut(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(qe),{basename:t,navigator:n}=v.useContext(et),{matches:r}=v.useContext(nt),{pathname:i}=dt(),a=JSON.stringify(Ae(r)),o=v.useRef(!1);return mt(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(j(o.current,pt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=je(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ne([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function _t(){let{matches:e}=v.useContext(nt);return e[e.length-1]?.params??{}}function vt(e,{relative:t}={}){let{matches:n}=v.useContext(nt),{pathname:r}=dt(),i=JSON.stringify(Ae(n));return v.useMemo(()=>je(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function yt(e,t){return bt(e,t)}function bt(e,t,n){A(ut(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(et),{matches:i}=v.useContext(nt),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;zt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
10
-
11
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=dt(),d;if(t){let e=typeof t==`string`?P(t):t;A(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ae(e,{pathname:p});j(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),j(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=Dt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ne([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ne([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(tt.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function xt(){let e=It(),t=ze(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var St=v.createElement(xt,null),Ct=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ct(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(nt.Provider,{value:this.props.routeContext},v.createElement(rt.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(Tt,{error:e},t):t}};Ct.contextType=Ye;var wt=new WeakMap;function Tt({children:e,error:t}){let{basename:n}=v.useContext(et);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=st(t.digest);if(e){let r=wt.get(t);if(r)throw r;let i=He(e.location,n),a=i.absoluteURL||i.to;if(Ke(a))throw Error(`Invalid redirect location`);if(Ve&&!wt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw wt.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Et({routeContext:e,match:t,children:n}){let r=v.useContext(qe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(nt.Provider,{value:e},n)}function Dt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);A(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Be(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||St,o&&(s<0&&c===0?(zt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(Et,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(Ct,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ot(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kt(e){let t=v.useContext(qe);return A(t,Ot(e)),t}function At(e){let t=v.useContext(Je);return A(t,Ot(e)),t}function jt(e){let t=v.useContext(nt);return A(t,Ot(e)),t}function Mt(e){let t=jt(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Nt(){return Mt(`useRouteId`)}function Pt(){let e=At(`useNavigation`);return v.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Ft(){let{matches:e,loaderData:t}=At(`useMatches`);return v.useMemo(()=>e.map(e=>F(e,t)),[e,t])}function It(){let e=v.useContext(rt),t=At(`useRouteError`),n=Mt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Lt(){let{router:e}=kt(`useNavigate`),t=Mt(`useNavigate`),n=v.useRef(!1);return mt(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{j(n.current,pt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Rt={};function zt(e,t,n){!t&&!Rt[e]&&(Rt[e]=!0,j(!1,n))}v.memo(Bt);function Bt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return bt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Vt({to:e,replace:t,state:n,relative:r}){A(ut(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(et);j(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=v.useContext(nt),{pathname:o}=dt(),s=ht(),c=je(e,Ae(a),o,r===`path`),l=JSON.stringify(c);return v.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Ht(e){A(!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 Ut({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){A(!ut(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=P(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=Te(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return j(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(et.Provider,{value:c},v.createElement(tt.Provider,{children:t,value:h}))}function Wt({children:e,location:t}){return yt(Gt(e),t)}v.Component;function Gt(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Gt(e.props.children,i));return}A(e.type===Ht,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Gt(e.props.children,i)),n.push(a)}),n}var Kt=`get`,qt=`application/x-www-form-urlencoded`;function Jt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yt(e){return Jt(e)&&e.tagName.toLowerCase()===`button`}function Xt(e){return Jt(e)&&e.tagName.toLowerCase()===`form`}function Zt(e){return Jt(e)&&e.tagName.toLowerCase()===`input`}function Qt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $t(e,t){return e.button===0&&(!t||t===`_self`)&&!Qt(e)}var en=null;function tn(){if(en===null)try{new FormData(document.createElement(`form`),0),en=!1}catch{en=!0}return en}var nn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function rn(e){return e!=null&&!nn.has(e)?(j(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qt}"`),null):e}function an(e,t){let n,r,i,a,o;if(Xt(e)){let o=e.getAttribute(`action`);r=o?Te(o,t):null,n=e.getAttribute(`method`)||Kt,i=rn(e.getAttribute(`enctype`))||qt,a=new FormData(e)}else if(Yt(e)||Zt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Te(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Kt,i=rn(e.getAttribute(`formenctype`))||rn(o.getAttribute(`enctype`))||qt,a=new FormData(o,e),!tn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Kt,r=null,i=qt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var on={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},sn=/[&><\u2028\u2029]/g;function cn(e){return e.replace(sn,e=>on[e])}function ln(e,t){if(e===!1||e==null)throw Error(t)}function un(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Te(i.pathname,t)===`/`?i.pathname=`${Pe(t)}/_root.${r}`:i.pathname=`${Pe(i.pathname)}.${r}`,i}async function dn(e,t){if(e.id in t)return t[e.id];try{let n=await w(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fn(e){return e!=null&&typeof e.page==`string`}function pn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function mn(e,t,n){return yn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await dn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(pn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function hn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function gn(e,t,{includeHydrateFallback:n}={}){return _n(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function _n(e){return[...new Set(e)]}function vn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!fn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(vn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function bn(){let e=v.useContext(qe);return ln(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function xn(){let e=v.useContext(Je);return ln(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Sn=v.createContext(void 0);Sn.displayName=`FrameworkContext`;function Cn(){let e=v.useContext(Sn);return ln(e,`You must render this element inside a <HydratedRouter> element`),e}function wn(e,t){let n=v.useContext(Sn),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Tn(s,p),onBlur:Tn(c,m),onMouseEnter:Tn(l,p),onMouseLeave:Tn(u,m),onTouchStart:Tn(d,p)}]:[a,f,{}]:[!1,f,{}]}function Tn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function En({page:e,...t}){let n=Xe(),{nonce:r}=Cn(),{router:i}=bn(),a=v.useMemo(()=>ae(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(On,{page:e,matches:a,...t}):v.createElement(kn,{page:e,matches:a,...t})):null}function Dn(e){let{manifest:t,routeModules:n}=Cn(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return mn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function On({page:e,matches:t,...n}){let r=dt(),{future:i}=Cn(),{basename:a}=bn(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=un(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function kn({page:e,matches:t,...n}){let r=dt(),{future:i,manifest:a,routeModules:o}=Cn(),{basename:s}=bn(),{loaderData:c,matches:l}=xn(),u=v.useMemo(()=>hn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>hn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=un(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>gn(d,a),[d,a]),m=Dn(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function An(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{jn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Mn({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=k({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(Ut,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Nn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=v.useState({action:n.action,location:n.location}),o=v.useCallback(e=>{r===!1?a(e):v.startTransition(()=>a(e))},[r]);return v.useLayoutEffect(()=>n.listen(o),[n,o]),v.createElement(Ut,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Nn.displayName=`unstable_HistoryRouter`;var Pn=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(et),y=typeof l==`string`&&T.test(l),b=He(l,h);l=b.to;let x=lt(l,{relative:r}),S=dt(),C=null;if(o){let e=je(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ne([h,e.pathname])),C=g.createHref(e)}let[w,E,ee]=wn(n,p),D=Vn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=v.createElement(`a`,{...p,...ee,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:An(m,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,A,v.createElement(En,{page:x})):A});Pn.displayName=`Link`;var Fn=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=vt(a,{relative:c.relative}),d=dt(),f=v.useContext(Je),{navigator:p,basename:m}=v.useContext(et),h=f!=null&&Zn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Te(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(Pn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Fn.displayName=`NavLink`;var In=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Kt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(et),g=Wn(),_=Gn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&T.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});In.displayName=`Form`;function Ln({getKey:e,storageKey:t,...n}){let r=v.useContext(Sn),{basename:i}=v.useContext(et),a=dt(),o=Ft();Yn({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=Jn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${cn(JSON.stringify(t||Kn))}, ${cn(JSON.stringify(s))})`}})}Ln.displayName=`ScrollRestoration`;function Rn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zn(e){let t=v.useContext(qe);return A(t,Rn(e)),t}function Bn(e){let t=v.useContext(Je);return A(t,Rn(e)),t}function Vn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ht(),d=dt(),f=vt(e,{relative:o});return v.useCallback(p=>{if($t(p,t)){p.preventDefault();let t=n===void 0?N(d)===N(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Hn=0,Un=()=>`__${String(++Hn)}__`;function Wn(){let{router:e}=zn(`useSubmit`),{basename:t}=v.useContext(et),n=Nt(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=an(e,t);if(a.navigate===!1){let e=a.fetcherKey||Un();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Gn(e,{relative:t}={}){let{basename:n}=v.useContext(et),r=v.useContext(nt);A(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...vt(e||`.`,{relative:t})},o=dt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ne([n,a.pathname])),N(a)}var Kn=`react-router-scroll-positions`,qn={};function Jn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Te(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Yn({getKey:e,storageKey:t}={}){let{router:n}=zn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Bn(`useScrollRestoration`),{basename:a}=v.useContext(et),o=dt(),s=Ft(),c=Pt();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Xn(v.useCallback(()=>{if(c.state===`idle`){let t=Jn(o,s,a,e);qn[t]=window.scrollY}try{sessionStorage.setItem(t||Kn,JSON.stringify(qn))}catch(e){j(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(v.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Kn);e&&(qn=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(qn,()=>window.scrollY,e?(t,n)=>Jn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),v.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{j(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Xn(e,t){let{capture:n}=t||{};v.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Zn(e,{relative:t}={}){let n=v.useContext(Ze);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zn(`useViewTransitionState`),i=vt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Te(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Te(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xe(i.pathname,o)!=null||xe(i.pathname,a)!=null}var Qn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$n=new class extends Qn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},er={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},tr=new class{#e=er;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function nr(e){setTimeout(e,0)}var rr=typeof window>`u`||`Deno`in globalThis;function ir(){}function ar(e,t){return typeof e==`function`?e(t):e}function or(e){return typeof e==`number`&&e>=0&&e!==1/0}function sr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cr(e,t){return typeof e==`function`?e(t):e}function lr(e,t){return typeof e==`function`?e(t):e}function ur(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==fr(o,t.options))return!1}else if(!mr(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function dr(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(pr(t.options.mutationKey)!==pr(a))return!1}else if(!mr(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function fr(e,t){return(t?.queryKeyHashFn||pr)(e)}function pr(e){return JSON.stringify(e,(e,t)=>yr(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function mr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!mr(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!mr(e[r],t[r]))return!1;return!0}return!1}var hr=Object.prototype.hasOwnProperty;function gr(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=vr(e)&&vr(t);if(!r&&!(yr(e)&&yr(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:hr.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=gr(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function _r(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function vr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yr(e){if(!br(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!br(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function br(e){return Object.prototype.toString.call(e)===`[object Object]`}function xr(e){return new Promise(t=>{tr.setTimeout(t,e)})}function Sr(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:gr(e,t)}function Cr(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function wr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Tr=Symbol();function Er(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Tr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Dr(e,t){return typeof e==`function`?e(...t):!!e}function Or(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var kr=(()=>{let e=()=>rr;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ar(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var jr=nr;function Mr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=jr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Nr=Mr(),Pr=new class extends Qn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Fr(e){return Math.min(1e3*2**e,3e4)}function Ir(e){return(e??`online`)!==`online`||Pr.isOnline()}var Lr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Rr(e){let t=!1,n=0,r,i=Ar(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Lr(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>$n.isFocused()&&(e.networkMode===`always`||Pr.isOnline())&&e.canRun(),u=()=>Ir(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(kr.isServer()?0:3),o=e.retryDelay??Fr,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),xr(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var zr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),or(this.gcTime)&&(this.#e=tr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kr.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(tr.clearTimeout(this.#e),this.#e=void 0)}};function Br(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Or(e,()=>t.signal,()=>n=!0)},u=Er(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?wr:Cr;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Hr:Vr,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Vr(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Vr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Hr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ur=class extends zr{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Kr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Kr(this.options);e.data!==void 0&&(this.setState(Gr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Sr(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ir).catch(ir):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>lr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>cr(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!sr(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Er(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Br(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Rr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Lr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Lr){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Wr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Gr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Nr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Wr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ir(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Gr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Kr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var qr=class extends Qn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Ar(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Yr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof lr(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!_r(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Zr(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||lr(this.options.enabled,this.#t)!==lr(t.enabled,this.#t)||cr(this.options.staleTime,this.#t)!==cr(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||lr(this.options.enabled,this.#t)!==lr(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return $r(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ir)),t}#g(){this.#b();let e=cr(this.options.staleTime,this.#t);if(kr.isServer()||this.#r.isStale||!or(e))return;let t=sr(this.#r.dataUpdatedAt,e)+1;this.#d=tr.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(kr.isServer()||lr(this.options.enabled,this.#t)===!1||!or(this.#p)||this.#p===0)&&(this.#f=tr.setInterval(()=>{(this.options.refetchIntervalInBackground||$n.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(tr.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(tr.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Yr(e,t),o=i&&Zr(e,n,t,r);(a||o)&&(l={...l,...Wr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Sr(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Sr(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Qr(e,t),refetch:this.refetch,promise:this.#o,isEnabled:lr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Ar();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!_r(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Nr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Jr(e,t){return lr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&lr(t.retryOnMount,e)===!1)}function Yr(e,t){return Jr(e,t)||e.state.data!==void 0&&Xr(e,t,t.refetchOnMount)}function Xr(e,t,n){if(lr(t.enabled,e)!==!1&&cr(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Qr(e,t)}return!1}function Zr(e,t,n,r){return(e!==t||lr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Qr(e,n)}function Qr(e,t){return lr(t.enabled,e)!==!1&&e.isStaleByTime(cr(t.staleTime,e))}function $r(e,t){return!_r(e.getCurrentResult(),t)}var ei=class extends zr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ti(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Rr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Nr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ti(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ni=class extends Qn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ei({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ri(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ri(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ri(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=ri(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Nr.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>dr(t,e))}findAll(e={}){return this.getAll().filter(t=>dr(e,t))}notify(e){Nr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Nr.batch(()=>Promise.all(e.map(e=>e.continue().catch(ir))))}};function ri(e){return e.options.scope?.id}var ii=class extends Qn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),_r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&pr(t.mutationKey)!==pr(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ti();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Nr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ai=class extends Qn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??fr(r,t),a=this.get(i);return a||(a=new Ur({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Nr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ur(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ur(e,t)):t}notify(e){Nr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Nr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},oi=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ai,this.#t=e.mutationCache||new ni,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=$n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(cr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ar(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Nr.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Nr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Nr.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Nr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ir).catch(ir)}invalidateQueries(e,t={}){return Nr.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Nr.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ir)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ir)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(cr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ir).catch(ir)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ir).catch(ir)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Pr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{mr(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{mr(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=fr(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Tr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},si=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ci=o(((e,t)=>{t.exports=si()})),I=ci(),li=v.createContext(void 0),ui=e=>{let t=v.useContext(li);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},di=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(li.Provider,{value:e,children:t})),fi=v.createContext(!1),pi=()=>v.useContext(fi);fi.Provider;function mi(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hi=v.createContext(mi()),gi=()=>v.useContext(hi),_i=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Dr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},vi=e=>{v.useEffect(()=>{e.clearReset()},[e])},yi=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Dr(n,[e.error,r])),bi=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xi=(e,t)=>e.isLoading&&e.isFetching&&!t,Si=(e,t)=>e?.suspense&&t.isPending,Ci=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wi(e,t,n){let r=pi(),i=gi(),a=ui(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,bi(o),_i(o,i,s),vi(i);let l=!a.getQueryCache().get(o.queryHash),[u]=v.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=f?u.subscribe(Nr.batchCalls(e)):ir;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(o)},[o,u]),Si(o,d))throw Ci(o,u,i);if(yi({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!kr.isServer()&&xi(d,r)&&(l?Ci(o,u,i):s?.promise)?.catch(ir).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Ti(e,t){return wi(e,qr,t)}function Ei(e,t){let n=ui(t),[r]=v.useState(()=>new ii(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);let i=v.useSyncExternalStore(v.useCallback(e=>r.subscribe(Nr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=v.useCallback((e,t)=>{r.mutate(e,t).catch(ir)},[r]);if(i.error&&Dr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Di=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Oi=[`light`,`dark`],ki=`(prefers-color-scheme: dark)`,Ai=typeof window>`u`,ji=v.createContext(void 0),Mi={setTheme:e=>{},themes:[]},Ni=()=>v.useContext(ji)??Mi,Pi=e=>v.useContext(ji)?v.createElement(v.Fragment,null,e.children):v.createElement(Ii,{...e}),Fi=[`light`,`dark`],Ii=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Fi,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=v.useState(()=>Ri(i,o)),[m,h]=v.useState(()=>f===`system`?Bi():f),g=c?Object.values(c):a,_=v.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Bi());let a=c?c[i]:i,l=t?zi(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=Oi.includes(o)?o:null,t=Oi.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),y=v.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),b=v.useCallback(t=>{let r=Bi(t);h(r),f===`system`&&n&&!e&&_(`system`)},[f,e]);v.useEffect(()=>{let e=window.matchMedia(ki);return e.addListener(b),b(e),()=>e.removeListener(b)},[b]),v.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):y(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[y]),v.useEffect(()=>{_(e??f)},[e,f]);let x=v.useMemo(()=>({theme:f,setTheme:y,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,y,e,m,n,a]);return v.createElement(ji.Provider,{value:x},v.createElement(Li,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Li=v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return v.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Di.toString()})(${u})`}})}),Ri=(e,t)=>{if(Ai)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},zi=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Bi=e=>(e||=window.matchMedia(ki),e.matches?`dark`:`light`),Vi=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Hi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ui=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Wi=e=>{let t=Ui(e);return t.charAt(0).toUpperCase()+t.slice(1)},Gi={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ki=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},qi=(0,v.createContext)({}),Ji=()=>(0,v.useContext)(qi),Yi=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ji()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...Gi,width:t??l??Gi.width,height:t??l??Gi.height,stroke:e??f,strokeWidth:m,className:Vi(`lucide`,p,i),...!a&&!Ki(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(Yi,{ref:i,iconNode:t,className:Vi(`lucide-${Hi(Wi(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Wi(e),n},Xi=L(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Zi=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Qi=L(`badge-check`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),$i=L(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),ea=L(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),ta=L(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),na=L(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]]),ra=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ia=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),aa=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),oa=L(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),sa=L(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),ca=L(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),la=L(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ua=L(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),da=L(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),fa=L(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),pa=L(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),ma=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ha=L(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ga=L(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),_a=L(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),va=L(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ya=L(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ba=L(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),xa=L(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Sa=L(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ca=L(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),wa=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ta=L(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Ea=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Da=L(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Oa=L(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ka=L(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Aa=L(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),ja=L(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ma=L(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Na=L(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Pa=L(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Fa=L(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Ia=L(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),La=L(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Ra=L(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),za=L(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ba=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Va=L(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),Ha=L(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Ua=L(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Wa=L(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ga=L(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ka=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),qa=L(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ja=L(`waypoints`,[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]),Ya=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Xa(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xa(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Za(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xa(e))&&(r&&(r+=` `),r+=t);return r}var Qa=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,$a=Za,eo=(e,t)=>n=>{if(t?.variants==null)return $a(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Qa(t)||Qa(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return $a(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},to=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},no=(e,t)=>({classGroupId:e,validator:t}),ro=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),io=`-`,ao=[],oo=`arbitrary..`,so=e=>{let t=uo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return lo(e);let n=e.split(io);return co(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?to(i,t):t:i||ao}return n[e]||ao}}},co=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=co(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(io):e.slice(t).join(io),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},lo=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?oo+r:void 0})(),uo=e=>{let{theme:t,classGroups:n}=e;return fo(n,t)},fo=(e,t)=>{let n=ro();for(let r in e){let i=e[r];po(i,n,r,t)}return n},po=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];mo(i,t,n,r)}},mo=(e,t,n,r)=>{if(typeof e==`string`){ho(e,t,n);return}if(typeof e==`function`){R(e,t,n,r);return}go(e,t,n,r)},ho=(e,t,n)=>{let r=e===``?t:_o(t,e);r.classGroupId=n},R=(e,t,n,r)=>{if(vo(e)){po(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(no(n,e))},go=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];po(o,_o(t,a),n,r)}},_o=(e,t)=>{let n=e,r=t.split(io),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ro(),n.nextPart.set(t,i)),n=i}return n},vo=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,yo=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},bo=`!`,xo=`:`,So=[],Co=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),wo=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===xo){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(bo)?(c=s.slice(0,-1),l=!0):s.startsWith(bo)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Co(t,l,c,u)};if(t){let e=t+xo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Co(So,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},To=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Eo=e=>({cache:yo(e.cacheSize),parseClassName:wo(e),sortModifiers:To(e),postfixLookupClassGroupIds:Do(e),...so(e)}),Do=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Oo=/\s+/,ko=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Oo),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+bo:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ao=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=jo(n))&&(i&&(i+=` `),i+=r);return i},jo=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=jo(e[r]))&&(n&&(n+=` `),n+=t);return n},Mo=(e,...t)=>{let n,r,i,a,o=o=>(n=Eo(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ko(e,n);return i(e,a),a};return a=o,(...e)=>a(Ao(...e))},No=[],Po=e=>{let t=t=>t[e]||No;return t.isThemeGetter=!0,t},Fo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Io=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ho=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uo=e=>Lo.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),Wo=e=>!!e&&Number.isInteger(Number(e)),Go=e=>e.endsWith(`%`)&&z(e.slice(0,-1)),Ko=e=>Ro.test(e),qo=()=>!0,Jo=e=>zo.test(e)&&!Bo.test(e),Yo=()=>!1,Xo=e=>Vo.test(e),Zo=e=>Ho.test(e),Qo=e=>!B(e)&&!V(e),$o=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),es=e=>hs(e,ys,Yo),B=e=>Fo.test(e),ts=e=>hs(e,bs,Jo),ns=e=>hs(e,xs,z),rs=e=>hs(e,Cs,qo),is=e=>hs(e,Ss,Yo),as=e=>hs(e,_s,Yo),os=e=>hs(e,vs,Zo),ss=e=>hs(e,ws,Xo),V=e=>Io.test(e),cs=e=>gs(e,bs),ls=e=>gs(e,Ss),us=e=>gs(e,_s),ds=e=>gs(e,ys),fs=e=>gs(e,vs),ps=e=>gs(e,ws,!0),ms=e=>gs(e,Cs,!0),hs=(e,t,n)=>{let r=Fo.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gs=(e,t,n=!1)=>{let r=Io.exec(e);return r?r[1]?t(r[1]):n:!1},_s=e=>e===`position`||e===`percentage`,vs=e=>e===`image`||e===`url`,ys=e=>e===`length`||e===`size`||e===`bg-size`,bs=e=>e===`length`,xs=e=>e===`number`,Ss=e=>e===`family-name`,Cs=e=>e===`number`||e===`weight`,ws=e=>e===`shadow`,Ts=Mo(()=>{let e=Po(`color`),t=Po(`font`),n=Po(`text`),r=Po(`font-weight`),i=Po(`tracking`),a=Po(`leading`),o=Po(`breakpoint`),s=Po(`container`),c=Po(`spacing`),l=Po(`radius`),u=Po(`shadow`),d=Po(`inset-shadow`),f=Po(`text-shadow`),p=Po(`drop-shadow`),m=Po(`blur`),h=Po(`perspective`),g=Po(`aspect`),_=Po(`ease`),v=Po(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[Uo,`full`,`auto`,...w()],E=()=>[Wo,`none`,`subgrid`,V,B],ee=()=>[`auto`,{span:[`full`,Wo,V,B]},Wo,V,B],D=()=>[Wo,`auto`,V,B],O=()=>[`auto`,`min`,`max`,`fr`,V,B],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],te=()=>[Uo,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[Uo,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[Uo,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,V,B],P=()=>[...b(),us,as,{position:[V,B]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,ds,es,{size:[V,B]}],ae=()=>[Go,cs,ts],oe=()=>[``,`none`,`full`,l,V,B],F=()=>[``,z,cs,ts],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[z,Go,us,as],ue=()=>[``,`none`,m,V,B],de=()=>[`none`,z,V,B],fe=()=>[`none`,z,V,B],pe=()=>[z,V,B],me=()=>[Uo,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ko],breakpoint:[Ko],color:[qo],container:[Ko],"drop-shadow":[Ko],ease:[`in`,`out`,`in-out`],font:[Qo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ko],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ko],shadow:[Ko],spacing:[`px`,z],text:[Ko],"text-shadow":[Ko],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Uo,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[$o],columns:[{columns:[z,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Wo,`auto`,V,B]}],basis:[{basis:[Uo,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[z,Uo,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,z,V,B]}],shrink:[{shrink:[``,z,V,B]}],order:[{order:[Wo,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:te()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...te()]}],"min-w":[{"min-w":[s,`screen`,`none`,...te()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...te()]}],h:[{h:[`screen`,`lh`,...te()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...te()]}],"max-h":[{"max-h":[`screen`,`lh`,...te()]}],"font-size":[{text:[`base`,n,cs,ts]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ms,rs]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Go,B]}],"font-family":[{font:[ls,is,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[z,`none`,V,ns]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[z,`from-font`,`auto`,V,ts]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[z,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Wo,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Wo,V,B],radial:[``,V,B],conic:[Wo,V,B]},fs,os]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[z,V,B]}],"outline-w":[{outline:[``,z,cs,ts]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,ps,ss]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,ps,ss]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[z,ts]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,ps,ss]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[z,V,B]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:ue()}],brightness:[{brightness:[z,V,B]}],contrast:[{contrast:[z,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ps,ss]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,z,V,B]}],"hue-rotate":[{"hue-rotate":[z,V,B]}],invert:[{invert:[``,z,V,B]}],saturate:[{saturate:[z,V,B]}],sepia:[{sepia:[``,z,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[z,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[z,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,z,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,z,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[z,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[z,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,z,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[z,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[z,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[Wo,V,B]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[z,cs,ts,ns]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return Ts(Za(e))}var Es=eo(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function Ds({className:e,variant:t,...n}){return(0,I.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:H(Es({variant:t}),e),...n})}function Os({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-title`,className:H(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function ks({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-description`,className:H(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function As(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var js=e=>{switch(e){case`success`:return Ps;case`info`:return Is;case`warning`:return Fs;case`error`:return Ls;default:return null}},Ms=Array(12).fill(0),Ns=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},Ms.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Ps=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Fs=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Is=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ls=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Rs=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),zs=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Bs=1,Vs=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Bs++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Us(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Bs++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Hs=(e,t)=>{let n=t?.id||Bs++;return Vs.addToast({title:e,...t,id:n}),n},Us=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,U=Object.assign(Hs,{success:Vs.success,info:Vs.info,warning:Vs.warning,error:Vs.error,custom:Vs.custom,message:Vs.message,promise:Vs.promise,dismiss:Vs.dismiss,loading:Vs.loading},{getHistory:()=>Vs.toasts,getToasts:()=>Vs.getActiveToasts()});As(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Ws(e){return e.label!==void 0}var Gs=3,Ks=`24px`,qs=`16px`,Js=4e3,Ys=356,Xs=14,Zs=45,Qs=200;function $s(...e){return e.filter(Boolean).join(` `)}function ec(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var tc=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[ee,D]=v.useState(null),[O,k]=v.useState(null),[A,j]=v.useState(!1),[te,ne]=v.useState(!1),[M,N]=v.useState(!1),[P,re]=v.useState(!1),[ie,ae]=v.useState(!1),[oe,F]=v.useState(0),[se,ce]=v.useState(0),le=v.useRef(n.duration||b||Js),ue=v.useRef(null),de=v.useRef(null),fe=c===0,pe=c+1<=o,me=n.type,he=n.dismissible!==!1,ge=n.className||``,_e=n.descriptionClassName||``,ve=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ye=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),be=v.useMemo(()=>n.duration||b||Js,[n.duration,b]),xe=v.useRef(0),Se=v.useRef(0),Ce=v.useRef(0),we=v.useRef(null),[Te,Ee]=x.split(`-`),De=v.useMemo(()=>s.reduce((e,t,n)=>n>=ve?e:e+t.height,0),[s,ve]),Oe=zs(),ke=n.invert||t,Ae=me===`loading`;Se.current=v.useMemo(()=>ve*S+De,[ve,De]),v.useEffect(()=>{le.current=be},[be]),v.useEffect(()=>{j(!0)},[]),v.useEffect(()=>{let e=de.current;if(e){let t=e.getBoundingClientRect().height;return ce(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!A)return;let e=de.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ce(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let je=v.useCallback(()=>{ne(!0),F(Se.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Qs)},[n,d,a,Se]);v.useEffect(()=>{if(n.promise&&me===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Oe?(()=>{if(Ce.current<xe.current){let e=new Date().getTime()-xe.current;le.current-=e}Ce.current=new Date().getTime()})():le.current!==1/0&&(xe.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),je()},le.current)),()=>clearTimeout(e)},[u,i,n,me,Oe,je]),v.useEffect(()=>{n.delete&&(je(),n.onDismiss==null||n.onDismiss.call(n,n))},[je,n.delete]);function Me(){return T?.loading?v.createElement(`div`,{className:$s(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":me===`loading`},T.loading):v.createElement(Ns,{className:$s(w?.loader,n?.classNames?.loader),visible:me===`loading`})}let Ne=n.icon||T?.[me]||js(me);return v.createElement(`li`,{tabIndex:0,ref:de,className:$s(_,ge,w?.toast,n?.classNames?.toast,w?.default,w?.[me],n?.classNames?.[me]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ie,"data-removed":te,"data-visible":pe,"data-y-position":Te,"data-x-position":Ee,"data-index":c,"data-front":fe,"data-swiping":M,"data-dismissible":he,"data-type":me,"data-invert":ke,"data-swipe-out":P,"data-swipe-direction":O,"data-expanded":!!(u||C&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${te?oe:Se.current}px`,"--initial-height":C?`auto`:`${se}px`,...m,...n.style},onDragEnd:()=>{N(!1),D(null),we.current=null},onPointerDown:e=>{e.button!==2&&(Ae||!he||(ue.current=new Date,F(Se.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(N(!0),we.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(P||!he)return;we.current=null;let e=Number(de.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(de.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ue.current?.getTime(),i=ee===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Zs||a>.11){F(Se.current),n.onDismiss==null||n.onDismiss.call(n,n),k(ee===`x`?e>0?`right`:`left`:t>0?`down`:`up`),je(),re(!0);return}else{var o,s;(o=de.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=de.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ae(!1),N(!1),D(null)},onPointerMove:t=>{var n,r;if(!we.current||!he||window.getSelection()?.toString().length>0)return;let i=t.clientY-we.current.y,a=t.clientX-we.current.x,o=e.swipeDirections??ec(x);!ee&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(ee===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(ee===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ae(!0),(n=de.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=de.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ye&&!n.jsx&&me!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":Ae,"data-close-button":!0,onClick:Ae||!he?()=>{}:()=>{je(),n.onDismiss==null||n.onDismiss.call(n,n)},className:$s(w?.closeButton,n?.classNames?.closeButton)},T?.close??Rs):null,(me||n.icon||n.promise)&&n.icon!==null&&(T?.[me]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:$s(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Me():null,n.type===`loading`?null:Ne):null,v.createElement(`div`,{"data-content":``,className:$s(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:$s(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:$s(y,_e,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&Ws(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Ws(n.cancel)&&he&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),je())},className:$s(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&Ws(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Ws(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&je())},className:$s(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function nc(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function rc(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?qs:Ks;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var ic=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Gs,toastOptions:g,dir:_=nc(),gap:b=Xs,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=v.useState([]),T=v.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=v.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[ee,D]=v.useState([]),[O,k]=v.useState(!1),[A,j]=v.useState(!1),[te,ne]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=v.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),P=v.useRef(null),re=v.useRef(!1),ie=v.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||Vs.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>Vs.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{y.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),v.useEffect(()=>{if(d!==`system`){ne(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ne(`dark`):ne(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ne(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ne(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{C.length<=1&&k(!1)},[C]),v.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(M.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,re.current=!1)}},[M.current]),v.createElement(`section`,{ref:t,"aria-label":`${S} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?v.createElement(`ol`,{key:t,dir:_===`auto`?nc():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${ee[0]?.height||0}px`,"--width":`${Ys}px`,"--gap":`${b}px`,...m,...rc(l,u)},onBlur:e=>{re.current&&!e.currentTarget.contains(e.relatedTarget)&&(re.current=!1,P.current&&=(P.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||re.current||(re.current=!0,P.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(tc,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ie,toasts:T.filter(e=>e.position==n.position),heights:ee.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:b,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),ac=({...e})=>{let{theme:t=`system`}=Ni();return(0,I.jsx)(ic,{theme:t,className:`toaster group`,icons:{success:(0,I.jsx)(la,{className:`size-4`}),info:(0,I.jsx)(xa,{className:`size-4`}),warning:(0,I.jsx)(Ka,{className:`size-4`}),error:(0,I.jsx)(ka,{className:`size-4`}),loading:(0,I.jsx)(wa,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e})},oc=Object.defineProperty,sc=(e,t)=>oc(e,`name`,{value:t,configurable:!0});function cc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}sc(cc,`setRef`);function lc(...e){return t=>{let n=!1,r=e.map(e=>{let r=cc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():cc(e[t],null)}}}}sc(lc,`composeRefs`);function uc(...e){return v.useCallback(lc(...e),e)}sc(uc,`useComposedRefs`);var dc=Object.defineProperty,fc=(e,t)=>dc(e,`name`,{value:t,configurable:!0});function pc(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Sc(r)&&typeof Ec==`function`&&(r=Ec(r._payload)),v.Children.forEach(r,e=>{if(bc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Sc(n)&&typeof Ec==`function`&&(n=Ec(n._payload)),a=_c(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?yc(a):void 0,l=uc(n,c);if(!a){if(r||r===0)throw Error(o?Tc(e):wc(e));return r}let u=vc(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}fc(pc,`createSlot`);var mc=pc(`Slot`),hc=Symbol.for(`radix.slottable`);function gc(e){let t=fc(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=hc,t}fc(gc,`createSlottable`);var _c=fc((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function vc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}fc(vc,`mergeProps`);function yc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fc(yc,`getElementRef`);function bc(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===hc}fc(bc,`isSlottable`);var xc=Symbol.for(`react.lazy`);function Sc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===xc&&`_payload`in e&&Cc(e._payload)}fc(Sc,`isLazyComponent`);function Cc(e){return typeof e==`object`&&!!e&&`then`in e}fc(Cc,`isPromiseLike`);var wc=fc(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Tc=fc(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ec=v.use,Dc=Object.defineProperty,Oc=(e,t)=>Dc(e,`name`,{value:t,configurable:!0}),W=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=pc(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kc(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}Oc(kc,`dispatchDiscreteCustomEvent`);var Ac=Object.defineProperty,jc=(e,t)=>Ac(e,`name`,{value:t,configurable:!0}),Mc=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Nc=v.forwardRef(jc(function(e,t){return(0,I.jsx)(W.span,{...e,ref:t,style:{...Mc,...e.style}})},`VisuallyHidden`)),Pc=Object.defineProperty,Fc=(e,t)=>Pc(e,`name`,{value:t,configurable:!0});function Ic(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=Fc(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Fc(i,`useContext`),[r,i]}Fc(Ic,`createContext`);function Lc(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Fc(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Fc(s,`useContext`),[o,s]}Fc(r,`createContext`);let i=Fc(()=>{let t=n.map(e=>v.createContext(e));return Fc(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Rc(i,...t)]}Fc(Lc,`createContextScope`);function Rc(...e){let t=e[0];if(e.length===1)return t;let n=Fc(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Fc(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Fc(Rc,`composeContextScopes`);var zc=Object.defineProperty,Bc=(e,t)=>zc(e,`name`,{value:t,configurable:!0});function Vc(e){let t=e+`CollectionProvider`,[n,r]=Lc(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Bc(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=pc(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=uc(t,a(s,n).collectionRef);return(0,I.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=pc(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=uc(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Bc(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Bc(Vc,`createCollection`);var Hc=new WeakMap,Uc=class e extends Map{static{Bc(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Hc.set(this,!0)}set(e,t){return Hc.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Kc(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Wc(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Wc(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Wc(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Wc(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Gc(e,t);return n===-1?void 0:e[n]}Bc(Wc,`at`);function Gc(e,t){let n=e.length,r=Kc(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Bc(Gc,`toSafeIndex`);function Kc(e){return e!==e||e===0?0:Math.trunc(e)}Bc(Kc,`toSafeInteger`);function qc(e){let t=e+`CollectionProvider`,[n,r]=Lc(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Uc,setItemMap:Bc(()=>void 0,`setItemMap`)}),o=Bc(({state:e,...t})=>e?(0,I.jsx)(c,{...t,state:e}):(0,I.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Bc(e=>{let t=h();return(0,I.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Bc(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=uc(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=Zc(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,I.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=pc(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=uc(t,a(l,n).collectionRef);return(0,I.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=pc(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=uc(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);Jc(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Xc):(t.set(s,{...e,element:s}),t.toSorted(Xc)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Uc(e)))}},[s,m,u]),(0,I.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new Uc)}Bc(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Bc(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Bc(qc,`createCollection`);function Jc(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Bc(Jc,`shallowEqual`);function Yc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Bc(Yc,`isElementPreceding`);function Xc(e,t){return!e[1].element||!t[1].element?0:Yc(e[1].element,t[1].element)?-1:1}Bc(Xc,`sortByDocumentPosition`);function Zc(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Bc(Zc,`getChildListObserver`);var Qc=Object.defineProperty,$c=(e,t)=>Qc(e,`name`,{value:t,configurable:!0}),el=!!(typeof window<`u`&&window.document&&window.document.createElement);function G(e,t,{checkForDefaultPrevented:n=!0}={}){return $c(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}$c(G,`composeEventHandlers`);function tl(e){if(!el)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}$c(tl,`getOwnerWindow`);function nl(e){if(!el)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}$c(nl,`getOwnerDocument`);function rl(e,t=!1){let{activeElement:n}=nl(e);if(!n?.nodeName)return null;if(il(n)&&n.contentDocument)return rl(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=nl(n).getElementById(e);if(t)return t}}return n}$c(rl,`getActiveElement`);function il(e){return e.tagName===`IFRAME`}$c(il,`isFrame`);var al=globalThis?.document?v.useLayoutEffect:()=>{},ol=Object.defineProperty,sl=(e,t)=>ol(e,`name`,{value:t,configurable:!0}),cl=v.useEffectEvent,ll=v.useInsertionEffect;function ul(e){if(typeof cl==`function`)return cl(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ll==`function`?ll(()=>{t.current=e}):al(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}sl(ul,`useEffectEvent`);var dl=Object.defineProperty,fl=(e,t)=>dl(e,`name`,{value:t,configurable:!0}),pl=v.useInsertionEffect||al;function ml({prop:e,defaultProp:t,onChange:n=fl(()=>{},`onChange`),caller:r}){let[i,a,o]=hl({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=gl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}fl(ml,`useControllableState`);function hl({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return pl(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}fl(hl,`useUncontrolledState`);function gl(e){return typeof e==`function`}fl(gl,`isFunction`);var _l=Symbol(`RADIX:SYNC_STATE`);function vl(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ul(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===_l)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:_l,state:i})},[i,d.state,c]),[h,f]}fl(vl,`useControllableStateReducer`);var yl=Object.defineProperty,bl=(e,t)=>yl(e,`name`,{value:t,configurable:!0});function xl(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}bl(xl,`useStateMachine`);var Sl=bl(e=>{let{present:t,children:n}=e,r=Cl(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Tl(r.ref,Dl(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Cl(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=xl(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??El(r.current),o.current=void 0):a.current=`none`},[s]),al(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=El(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),al(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=bl(a=>{let o=El(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=bl(e=>{e.target===t&&(a.current=El(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=El(t)}else r.current=null;n(e)},[])}}bl(Cl,`usePresence`);function wl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}bl(wl,`setRef`);function Tl(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=wl(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():wl(n[e],null)}}},[])}bl(Tl,`useStableComposedRefs`);function El(e){return e?.animationName||`none`}bl(El,`getAnimationName`);function Dl(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}bl(Dl,`getElementRef`);var Ol=Object.defineProperty,kl=(e,t)=>Ol(e,`name`,{value:t,configurable:!0}),Al=v.useId||(()=>void 0),jl=0;function Ml(e){let[t,n]=v.useState(Al());return al(()=>{e||n(e=>e??String(jl++))},[e]),e||(t?`radix-${t}`:``)}kl(Ml,`useId`);var Nl=Object.defineProperty,Pl=(e,t)=>Nl(e,`name`,{value:t,configurable:!0}),Fl=v.createContext(void 0);function Il(e){let t=v.useContext(Fl);return e||t||`ltr`}Pl(Il,`useDirection`);var Ll=Object.defineProperty,Rl=(e,t)=>Ll(e,`name`,{value:t,configurable:!0});function K(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Rl(K,`useCallbackRef`);var zl=Object.defineProperty,q=(e,t)=>zl(e,`name`,{value:t,configurable:!0}),J=`dismissableLayer.update`,Bl=`dismissableLayer.pointerDownOutside`,Vl=`dismissableLayer.focusOutside`,Hl,Ul=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Wl=v.forwardRef(q(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(Ul),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=uc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=ql(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Jl(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,ee=K(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,E,ee]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hl=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Yl(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Hl))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Yl())},[d,u]),v.useEffect(()=>{let e=q(()=>m({}),`handleUpdate`);return document.addEventListener(J,e),()=>document.removeEventListener(J,e)},[]),(0,I.jsx)(W.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:G(e.onFocusCapture,T.onFocusCapture),onBlurCapture:G(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Gl(){let e=v.useContext(Ul),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}q(Gl,`useDismissableLayerSurface`);var Kl=q(()=>!0,`IS_TRUE`);function ql(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Kl}=t,s=K(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}q(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}q(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}q(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}q(p,`handleInteractionBubble`);let m=q(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Xl(Bl,s,p,{discrete:!0})};if(q(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:q(()=>c.current=!0,`onPointerDownCapture`)}}q(ql,`usePointerDownOutside`);function Jl(e,t=globalThis?.document){let n=K(e),r=v.useRef(!1);return v.useEffect(()=>{let e=q(e=>{e.target&&!r.current&&Xl(Vl,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:q(()=>r.current=!0,`onFocusCapture`),onBlurCapture:q(()=>r.current=!1,`onBlurCapture`)}}q(Jl,`useFocusOutside`);function Yl(){let e=new CustomEvent(J);document.dispatchEvent(e)}q(Yl,`dispatchUpdate`);function Xl(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?kc(i,a):i.dispatchEvent(a)}q(Xl,`handleAndDispatchCustomEvent`);var Zl=Object.defineProperty,Ql=(e,t)=>Zl(e,`name`,{value:t,configurable:!0}),$l=`focusScope.autoFocusOnMount`,eu=`focusScope.autoFocusOnUnmount`,tu={bubbles:!1,cancelable:!0},nu=v.forwardRef(Ql(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=K(i),u=K(a),d=v.useRef(null),f=uc(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:lu(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||lu(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&lu(s)};Ql(e,`handleFocusIn`),Ql(t,`handleFocusOut`),Ql(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){uu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent($l,tu);s.addEventListener($l,l),s.dispatchEvent(t),t.defaultPrevented||(ru(pu(au(s)),{select:!0}),document.activeElement===e&&lu(s))}return()=>{s.removeEventListener($l,l),setTimeout(()=>{let t=new CustomEvent(eu,tu);s.addEventListener(eu,u),s.dispatchEvent(t),t.defaultPrevented||lu(e??document.body,{select:!0}),s.removeEventListener(eu,u),uu.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=iu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&lu(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&lu(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(W.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function ru(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(lu(r,{select:t}),document.activeElement!==n)return}Ql(ru,`focusFirst`);function iu(e){let t=au(e);return[ou(t,e),ou(t.reverse(),e)]}Ql(iu,`getTabbableEdges`);function au(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ql(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ql(au,`getTabbableCandidates`);function ou(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):su(r,{upTo:t})))return r}Ql(ou,`findVisible`);function su(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ql(su,`isHidden`);function cu(e){return e instanceof HTMLInputElement&&`select`in e}Ql(cu,`isSelectableInput`);function lu(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cu(e)&&t&&e.select()}}Ql(lu,`focus`);var uu=du();function du(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fu(e,t),e.unshift(t)},remove(t){e=fu(e,t),e[0]?.resume()}}}Ql(du,`createFocusScopesStack`);function fu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ql(fu,`arrayRemove`);function pu(e){return e.filter(e=>e.tagName!==`A`)}Ql(pu,`removeLinks`);var mu=Object.defineProperty,hu=v.forwardRef(((e,t)=>mu(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);al(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?y.createPortal((0,I.jsx)(W.div,{...r,ref:t}),o):null},`Portal`)),gu=Object.defineProperty,_u=(e,t)=>gu(e,`name`,{value:t,configurable:!0}),vu=0,yu=null;function bu(e){return xu(),e.children}_u(bu,`FocusGuards`);function xu(){v.useEffect(()=>{yu||={start:Su(),end:Su()};let{start:e,end:t}=yu;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),vu++,()=>{vu===1&&(yu?.start.remove(),yu?.end.remove(),yu=null),vu=Math.max(0,vu-1)}},[])}_u(xu,`useFocusGuards`);function Su(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}_u(Su,`createFocusGuard`);var Cu=function(){return Cu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Cu.apply(this,arguments)};function wu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Tu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Eu=`right-scroll-bar-position`,Du=`width-before-scroll-bar`,Ou=`with-scroll-bars-hidden`,ku=`--removed-body-scroll-bar-size`;function Au(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ju(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Mu=typeof window<`u`?v.useLayoutEffect:v.useEffect,Nu=new WeakMap;function Pu(e,t){var n=ju(t||null,function(t){return e.forEach(function(e){return Au(e,t)})});return Mu(function(){var t=Nu.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Au(e,null)}),i.forEach(function(e){r.has(e)||Au(e,a)})}Nu.set(n,e)},[e]),n}function Fu(e){return e}function Iu(e,t){t===void 0&&(t=Fu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Lu(e){e===void 0&&(e={});var t=Iu(null);return t.options=Cu({async:!0,ssr:!1},e),t}var Ru=function(e){var t=e.sideCar,n=wu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,Cu({},n))};Ru.isSideCarExport=!0;function zu(e,t){return e.useMedium(t),Ru}var Bu=Lu(),Vu=function(){},Hu=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Vu,onWheelCapture:Vu,onTouchMoveCapture:Vu}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=wu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Pu([n,t]),w=Cu(Cu({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:Bu,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Cu(Cu({},w),{ref:C})):v.createElement(y,Cu({},w,{className:c,ref:C}),s))});Hu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hu.classNames={fullWidth:Du,zeroRight:Eu};var Uu,Wu=function(){if(Uu)return Uu;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Gu(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wu();return t&&e.setAttribute(`nonce`,t),e}function Ku(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qu(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ju=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gu())&&(Ku(t,n),qu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yu=function(){var e=Ju();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xu=function(){var e=Yu();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Zu={left:0,top:0,right:0,gap:0},Qu=function(e){return parseInt(e||``,10)||0},$u=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qu(n),Qu(r),Qu(i)]},ed=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Zu;var t=$u(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},td=Xu(),nd=`data-scroll-locked`,rd=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
- .${Ou} {
13
- overflow: hidden ${r};
14
- padding-right: ${s}px ${r};
15
- }
16
- body[${nd}] {
17
- overflow: hidden ${r};
18
- overscroll-behavior: contain;
19
- ${[t&&`position: relative ${r};`,n===`margin`&&`
20
- padding-left: ${i}px;
21
- padding-top: ${a}px;
22
- padding-right: ${o}px;
23
- margin-left:0;
24
- margin-top:0;
25
- margin-right: ${s}px ${r};
26
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
27
- }
28
-
29
- .${Eu} {
30
- right: ${s}px ${r};
31
- }
32
-
33
- .${Du} {
34
- margin-right: ${s}px ${r};
35
- }
36
-
37
- .${Eu} .${Eu} {
38
- right: 0 ${r};
39
- }
40
-
41
- .${Du} .${Du} {
42
- margin-right: 0 ${r};
43
- }
44
-
45
- body[${nd}] {
46
- ${ku}: ${s}px;
47
- }
48
- `},id=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ad=function(){v.useEffect(function(){return document.body.setAttribute(nd,(id()+1).toString()),function(){var e=id()-1;e<=0?document.body.removeAttribute(nd):document.body.setAttribute(nd,e.toString())}},[])},od=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ad();var a=v.useMemo(function(){return ed(i)},[i]);return v.createElement(td,{styles:rd(a,!t,i,n?``:`!important`)})},sd=!1;if(typeof window<`u`)try{var cd=Object.defineProperty({},"passive",{get:function(){return sd=!0,!0}});window.addEventListener(`test`,cd,cd),window.removeEventListener(`test`,cd,cd)}catch{sd=!1}var ld=sd?{passive:!1}:!1,ud=function(e){return e.tagName===`TEXTAREA`},dd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ud(e)&&n[t]===`visible`)},fd=function(e){return dd(e,`overflowY`)},pd=function(e){return dd(e,`overflowX`)},md=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_d(e,r)){var i=vd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hd=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},gd=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_d=function(e,t){return e===`v`?fd(t):pd(t)},vd=function(e,t){return e===`v`?hd(t):gd(t)},yd=function(e,t){return e===`h`&&t===`rtl`?-1:1},bd=function(e,t,n,r,i){var a=yd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=vd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_d(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},xd=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sd=function(e){return[e.deltaX,e.deltaY]},Cd=function(e){return e&&`current`in e?e.current:e},wd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Td=function(e){return`
49
- .block-interactivity-${e} {pointer-events: none;}
50
- .allow-interactivity-${e} {pointer-events: all;}
51
- `},Ed=0,Dd=[];function Od(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Ed++)[0],a=v.useState(Xu)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Tu([e.lockRef.current],(e.shards||[]).map(Cd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=xd(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=md(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=md(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return bd(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Dd.length||Dd[Dd.length-1]!==a)){var r=`deltaY`in n?Sd(n):xd(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Cd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:kd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=xd(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Sd(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,xd(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Dd.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ld),document.addEventListener(`touchmove`,c,ld),document.addEventListener(`touchstart`,u,ld),function(){Dd=Dd.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ld),document.removeEventListener(`touchmove`,c,ld),document.removeEventListener(`touchstart`,u,ld)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:Td(i)}):null,p?v.createElement(od,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ad=zu(Bu,Od),jd=v.forwardRef(function(e,t){return v.createElement(Hu,Cu({},e,{ref:t,sideCar:Ad}))});jd.classNames=Hu.classNames;var Md=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Nd=new WeakMap,Pd=new WeakMap,Fd={},Id=0,Ld=function(e){return e&&(e.host||Ld(e.parentNode))},Rd=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ld(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},zd=function(e,t,n,r){var i=Rd(t,Array.isArray(e)?e:[e]);Fd[n]||(Fd[n]=new WeakMap);var a=Fd[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Nd.get(e)||0)+1,l=(a.get(e)||0)+1;Nd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Id++,function(){o.forEach(function(e){var t=Nd.get(e)-1,i=a.get(e)-1;Nd.set(e,t),a.set(e,i),t||(Pd.has(e)||e.removeAttribute(r),Pd.delete(e)),i||e.removeAttribute(n)}),Id--,Id||(Nd=new WeakMap,Nd=new WeakMap,Pd=new WeakMap,Fd={})}},Bd=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Md(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),zd(r,i,n,`aria-hidden`)):function(){return null}},Vd=Object.defineProperty,Hd=(e,t)=>Vd(e,`name`,{value:t,configurable:!0}),Ud=`Dialog`,[Wd,Gd]=Lc(Ud),[Kd,qd]=Wd(Ud),Jd=Hd(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ml({prop:r,defaultProp:i??!1,onChange:a,caller:Ud}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,I.jsx)(Kd,{scope:t,triggerRef:s,contentRef:c,contentId:Ml(),titleId:Ml(),descriptionId:Ml(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Yd=`DialogTrigger`,Xd=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,...r}=e,i=qd(Yd,n),a=uc(t,i.triggerRef);return(0,I.jsx)(W.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":_f(i.open),...r,ref:a,onClick:G(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Zd=`DialogPortal`,[Qd,$d]=Wd(Zd,{forceMount:void 0}),ef=Hd(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=qd(Zd,t);return(0,I.jsx)(Qd,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,I.jsx)(Sl,{present:n||a.open,children:(0,I.jsx)(hu,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),tf=`DialogOverlay`,nf=v.forwardRef(Hd(function(e,t){let n=$d(tf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qd(tf,e.__scopeDialog);return a.modal?(0,I.jsx)(Sl,{present:r||a.open,children:(0,I.jsx)(af,{...i,ref:t})}):null},`DialogOverlay`)),rf=pc(`DialogOverlay.RemoveScroll`),af=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,...r}=e,i=qd(tf,n),a=uc(t,Gl());return(0,I.jsx)(jd,{as:rf,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(W.div,{"data-state":_f(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),of=`DialogContent`,sf=v.forwardRef(Hd(function(e,t){let n=$d(of,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=qd(of,e.__scopeDialog);return(0,I.jsx)(Sl,{present:r||a.open,children:a.modal?(0,I.jsx)(cf,{...i,ref:t}):(0,I.jsx)(lf,{...i,ref:t})})},`DialogContent`)),cf=v.forwardRef(Hd(function(e,t){let n=qd(of,e.__scopeDialog),r=v.useRef(null),i=uc(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return Bd(e)},[]),(0,I.jsx)(uf,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),lf=v.forwardRef(Hd(function(e,t){let n=qd(of,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,I.jsx)(uf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),uf=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=qd(of,n);return xu(),(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(nu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(Wl,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":_f(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),df=`DialogTitle`,ff=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,...r}=e,i=qd(df,n),{setTitleCount:a}=i;return al(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(W.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),pf=`DialogDescription`,mf=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,...r}=e,i=qd(pf,n),{setDescriptionCount:a}=i;return al(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(W.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),hf=`DialogClose`,gf=v.forwardRef(Hd(function(e,t){let{__scopeDialog:n,...r}=e,i=qd(hf,n);return(0,I.jsx)(W.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function _f(e){return e?`open`:`closed`}Hd(_f,`getState`);var vf=Object.defineProperty,yf=(e,t)=>vf(e,`name`,{value:t,configurable:!0});function bf(e){let[t,n]=v.useState(void 0);return al(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}yf(bf,`useSize`);var xf=Object.defineProperty,Sf=(e,t)=>xf(e,`name`,{value:t,configurable:!0}),Cf=`Checkbox`,[wf,Tf]=Lc(Cf),[Ef,Df]=wf(Cf);function Of(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ml({prop:n,defaultProp:i??!1,onChange:c,caller:Cf}),[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useRef(!1),[b,x]=v.useReducer(e=>e+1,0),S=!m||!!o||!!m.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!Lf(i)&&i,isFormControl:S,bubbleInput:g,setBubbleInput:_};return(0,I.jsx)(Ef,{scope:t,...C,children:If(d)?d(C):r})}Sf(Of,`CheckboxProvider`);var kf=`CheckboxTrigger`,Af=v.forwardRef(Sf(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Df(kf,e),g=uc(i,u),_=v.useRef(c);return v.useEffect(()=>{let e=a?.form;if(e){let t=Sf(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(W.button,{type:`button`,role:`checkbox`,"aria-checked":Lf(c)?`mixed`:c,"aria-required":l,"data-state":Rf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:G(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:G(n,e=>{p(),d(e=>Lf(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),jf=v.forwardRef(Sf(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,I.jsx)(Of,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Af,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(Ff,{__scopeCheckbox:n})]})})},`Checkbox`)),Mf=`CheckboxIndicator`,Nf=v.forwardRef(Sf(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Df(Mf,n);return(0,I.jsx)(Sl,{present:r||Lf(a.checked)||a.checked===!0,children:(0,I.jsx)(W.span,{"data-state":Rf(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Pf=`CheckboxBubbleInput`,Ff=v.forwardRef(Sf(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Df(Pf,e),g=uc(r,h),_=bf(i),y=v.useRef(!1),b=v.useRef(s),x=v.useRef(o);v.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=Lf(s),n.call(e,!Lf(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=v.useRef(!Lf(s)&&s);return(0,I.jsx)(W.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:G(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function If(e){return typeof e==`function`}Sf(If,`isFunction`);function Lf(e){return e===`indeterminate`}Sf(Lf,`isIndeterminate`);function Rf(e){return Lf(e)?`indeterminate`:e?`checked`:`unchecked`}Sf(Rf,`getState`);var zf=[`top`,`right`,`bottom`,`left`],Bf=Math.min,Vf=Math.max,Hf=Math.round,Uf=Math.floor,Wf=e=>({x:e,y:e}),Gf={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Kf(e,t,n){return Vf(e,Bf(t,n))}function qf(e,t){return typeof e==`function`?e(t):e}function Jf(e){return e.split(`-`)[0]}function Yf(e){return e.split(`-`)[1]}function Xf(e){return e===`x`?`y`:`x`}function Zf(e){return e===`y`?`height`:`width`}function Qf(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $f(e){return Xf(Qf(e))}function ep(e,t,n){n===void 0&&(n=!1);let r=Yf(e),i=$f(e),a=Zf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lp(o)),[o,lp(o)]}function tp(e){let t=lp(e);return[np(e),t,np(t)]}function np(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rp=[`left`,`right`],ip=[`right`,`left`],ap=[`top`,`bottom`],op=[`bottom`,`top`];function sp(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ip:rp:t?rp:ip;case`left`:case`right`:return t?ap:op;default:return[]}}function cp(e,t,n,r){let i=Yf(e),a=sp(Jf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(np)))),a}function lp(e){let t=Jf(e);return Gf[t]+e.slice(t.length)}function up(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:up(e)}function fp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pp(e,t,n){let{reference:r,floating:i}=e,a=Qf(t),o=$f(t),s=Zf(o),c=Jf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Yf(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=qf(t,e),p=dp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=fp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hp=50,gp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pp(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<hp&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=pp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_p=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=qf(e,t)||{};if(l==null)return{};let d=dp(u),f={x:n,y:r},p=$f(i),m=Zf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Bf(d[_],T),ee=Bf(d[v],T),D=C-h[m]-ee,O=C/2-h[m]/2+w,k=Kf(E,O,D),A=!c.arrow&&Yf(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:ee)-h[m]/2<0,j=A?O<E?O-E:O-D:0;return{[p]:f[p]+j,data:{[p]:k,centerOffset:O-k-j,...A&&{alignmentOffset:j}},reset:A}}}),vp=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=qf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Jf(r),_=Qf(o),v=Jf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lp(o)]:tp(o)),x=p!==`none`;!d&&x&&b.push(...cp(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ep(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Qf(t))||T.every(e=>Qf(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Qf(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bp(e){return zf.some(t=>e[t]>=0)}var xp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qf(e,t);switch(i){case`referenceHidden`:{let e=yp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:bp(e)}}}case`escaped`:{let e=yp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:bp(e)}}}default:return{}}}}},Sp=new Set([`left`,`top`]);async function Cp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jf(n),s=Yf(n),c=Qf(n)===`y`,l=Sp.has(o)?-1:1,u=a&&c?-1:1,d=qf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var wp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Cp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Tp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qf(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Qf(i),p=Xf(f),m=u[p],h=u[f],g=(e,t)=>Kf(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ep=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=qf(e,t),u={x:n,y:r},d=Qf(i),f=Xf(d),p=u[f],m=u[d],h=qf(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Sp.has(Jf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Dp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=qf(e,t),c=await i.detectOverflow(t,s),l=Jf(n),u=Yf(n),d=Qf(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Bf(p-c[m],g),y=Bf(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Vf(c.left,c.right):S=p-2*Vf(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Op(){return typeof window<`u`}function kp(e){return Mp(e)?(e.nodeName||``).toLowerCase():`#document`}function Ap(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jp(e){return((Mp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mp(e){return Op()?e instanceof Node||e instanceof Ap(e).Node:!1}function Np(e){return Op()?e instanceof Element||e instanceof Ap(e).Element:!1}function Pp(e){return Op()?e instanceof HTMLElement||e instanceof Ap(e).HTMLElement:!1}function Fp(e){return!Op()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ap(e).ShadowRoot}function Ip(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Lp(e){return/^(table|td|th)$/.test(kp(e))}function Rp(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var zp=/transform|translate|scale|rotate|perspective|filter/,Bp=/paint|layout|strict|content/,Vp=e=>!!e&&e!==`none`,Hp;function Up(e){let t=Np(e)?qp(e):e;return Vp(t.transform)||Vp(t.translate)||Vp(t.scale)||Vp(t.rotate)||Vp(t.perspective)||!Gp()&&(Vp(t.backdropFilter)||Vp(t.filter))||zp.test(t.willChange||``)||Bp.test(t.contain||``)}function Wp(e){let t=Yp(e);for(;Pp(t)&&!Kp(t);){if(Up(t))return t;if(Rp(t))return null;t=Yp(t)}return null}function Gp(){return Hp??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Hp}function Kp(e){return/^(html|body|#document)$/.test(kp(e))}function qp(e){return Ap(e).getComputedStyle(e)}function Jp(e){return Np(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yp(e){if(kp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fp(e)&&e.host||jp(e);return Fp(t)?t.host:t}function Xp(e){let t=Yp(e);return Kp(t)?(e.ownerDocument||e).body:Pp(t)&&Ip(t)?t:Xp(t)}function Zp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Xp(e),i=r===e.ownerDocument?.body,a=Ap(r);if(i){let e=Qp(a);return t.concat(a,a.visualViewport||[],Ip(r)?r:[],e&&n?Zp(e):[])}else return t.concat(r,Zp(r,[],n))}function Qp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $p(e){let t=qp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Pp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Hf(n)!==a||Hf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function em(e){return Np(e)?e:e.contextElement}function tm(e){let t=em(e);if(!Pp(t))return Wf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$p(t),o=(a?Hf(n.width):n.width)/r,s=(a?Hf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nm=Wf(0);function rm(e){let t=Ap(e);return!Gp()||!t.visualViewport?nm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function im(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ap(e)}function am(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=em(e),o=Wf(1);t&&(r?Np(r)&&(o=tm(r)):o=tm(e));let s=im(a,n,r)?rm(a):Wf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ap(a),t=Np(r)?Ap(r):r,n=e,i=Qp(n);for(;i&&t!==n;){let e=tm(i),t=i.getBoundingClientRect(),r=qp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ap(i),i=Qp(n)}}return fp({width:u,height:d,x:c,y:l})}function om(e,t){let n=Jp(e).scrollLeft;return t?t.left+n:am(jp(e)).left+n}function sm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-om(e,n),y:n.top+t.scrollTop}}function cm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jp(r),s=t?Rp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Wf(1),u=Wf(0),d=Pp(r);if((d||!a)&&((kp(r)!==`body`||Ip(o))&&(c=Jp(r)),d)){let e=am(r);l=tm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sm(o,c):Wf(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function um(e){let t=Jp(e),n=e.ownerDocument.body,r=Vf(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Vf(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+om(e),o=-t.scrollTop;return qp(n).direction===`rtl`&&(a+=Vf(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dm=25;function fm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ap(e),a=jp(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Gp()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(om(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=dm&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pm(e,t){let n=am(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fm(e,n,t);else if(t===`document`)r=um(jp(e));else if(Np(t))r=pm(t,n);else{let n=rm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fp(r)}function hm(e,t){let n=t.get(e);if(n)return n;let r=Zp(e,[],!1).filter(e=>Np(e)&&kp(e)!==`body`),i=null,a=qp(e).position===`fixed`,o=a?Yp(e):e;for(;Np(o)&&!Kp(o);){let e=qp(o),t=Up(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Yp(o)}return t.set(e,r),r}function gm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Rp(t)?[]:hm(t,this._c):[].concat(n),r],o=mm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=mm(t,a[e],i);s=Vf(n.top,s),c=Bf(n.right,c),l=Bf(n.bottom,l),u=Vf(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _m(e){let{width:t,height:n}=$p(e);return{width:t,height:n}}function vm(e,t,n){let r=Pp(t),i=jp(t),a=n===`fixed`,o=am(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Wf(0);if((r||!a)&&((kp(t)!==`body`||Ip(i))&&(s=Jp(t)),r)){let e=am(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=om(i));let l=i&&!r&&!a?sm(i,s):Wf(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ym(e){return qp(e).position===`static`}function bm(e,t){if(!Pp(e)||qp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jp(e)===n&&(n=n.ownerDocument.body),n}function xm(e,t){let n=Ap(e);if(Rp(e))return n;if(!Pp(e)){let t=Yp(e);for(;t&&!Kp(t);){if(Np(t)&&!ym(t))return t;t=Yp(t)}return n}let r=bm(e,t);for(;r&&Lp(r)&&ym(r);)r=bm(r,t);return r&&Kp(r)&&ym(r)&&!Up(r)?n:r||Wp(e)||n}var Sm=async function(e){let t=this.getOffsetParent||xm,n=this.getDimensions,r=await n(e.floating);return{reference:vm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cm(e){return qp(e).direction===`rtl`}var wm={convertOffsetParentRelativeRectToViewportRelativeRect:cm,getDocumentElement:jp,getClippingRect:gm,getOffsetParent:xm,getElementRects:Sm,getClientRects:lm,getDimensions:_m,getScale:tm,isElement:Np,isRTL:Cm};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Em(e,t,n){let r=null,i,a=jp(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Uf(d),h=Uf(a.clientWidth-(u+f)),g=Uf(a.clientHeight-(d+p)),_=Uf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Vf(0,Bf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Tm(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ap(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=em(e),u=i||a?[...l?Zp(l):[],...t?Zp(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Em(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?am(e):null;c&&g();function g(){let t=am(e);h&&!Tm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Om=wp,km=Tp,Am=vp,jm=Dp,Mm=xp,Nm=_p,Pm=Ep,Fm=(e,t,n)=>{let r=new Map,i=n??{},a={...wm,...i.platform,_c:r};return gp(e,t,{...i,platform:a})},Im=typeof document<`u`?v.useLayoutEffect:function(){};function Lm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Lm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zm(e,t){let n=Rm(e);return Math.round(t*n)/n}function Bm(e){let t=v.useRef(e);return Im(()=>{t.current=e}),t}function Vm(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Lm(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),b=v.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=v.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=v.useRef(null),T=v.useRef(null),E=v.useRef(u),ee=c!=null,D=Bm(c),O=Bm(i),k=Bm(l),A=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Fm(w.current,T.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Lm(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Im(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Im(()=>(j.current=!0,()=>{j.current=!1}),[]),Im(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(D.current)return D.current(S,C,A);A()}},[S,C,A,D,ee]);let te=v.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),ne=v.useMemo(()=>({reference:S,floating:C}),[S,C]),M=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=zm(ne.floating,u.x),r=zm(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rm(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:te,elements:ne,floatingStyles:M}),[u,A,te,ne,M])}var Hm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Nm({element:r.current,padding:i}).fn(n):r?Nm({element:r,padding:i}).fn(n):{}}}},Um=(e,t)=>{let n=Om(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wm=(e,t)=>{let n=km(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gm=(e,t)=>({fn:Pm(e).fn,options:[e,t]}),Km=(e,t)=>{let n=Am(e);return{name:n.name,fn:n.fn,options:[e,t]}},qm=(e,t)=>{let n=jm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jm=(e,t)=>{let n=Mm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ym=(e,t)=>{let n=Hm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xm=Object.defineProperty,Zm=v.forwardRef(((e,t)=>Xm(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(W.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Qm=Object.defineProperty,$m=(e,t)=>Qm(e,`name`,{value:t,configurable:!0}),eh=`Popper`,[th,nh]=Lc(eh),[rh,ih]=th(eh),ah=$m(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,I.jsx)(rh,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),oh=`PopperAnchor`,sh=v.forwardRef($m(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ih(oh,n),o=v.useRef(null),s=a.onAnchorChange,c=uc(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&_h(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,I.jsx)(W.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),ch=`PopperContent`,[lh,uh]=th(ch),dh=v.forwardRef($m(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=ih(ch,n),[_,y]=v.useState(null),b=uc(t,y),[x,S]=v.useState(null),C=bf(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:ee,boundary:D.filter(hh),altBoundary:O},{refs:A,floatingStyles:j,placement:te,isPositioned:ne,middlewareData:M}=Vm({strategy:`fixed`,placement:E,whileElementsMounted:$m((...e)=>Dm(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Um({mainAxis:i+T,alignmentAxis:o}),c&&Wm({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Gm():void 0,...k}),c&&Km({...k}),qm({...k,apply:$m(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Ym({element:x,padding:s}),gh({arrowWidth:w,arrowHeight:T}),f&&Jm({strategy:`referenceHidden`,...k,boundary:O?k.boundary:void 0})]}),N=g.setPlacementState;al(()=>(N(te),()=>{N(void 0)}),[te,N]);let[P,re]=_h(te),ie=K(m);al(()=>{ne&&ie?.()},[ne,ie]);let ae=M.arrow?.x,oe=M.arrow?.y,F=M.arrow?.centerOffset!==0,[se,ce]=v.useState();return al(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,I.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ne?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(lh,{scope:n,placedSide:P,placedAlign:re,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:F,children:(0,I.jsx)(W.div,{"data-side":P,"data-align":re,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`)),fh=`PopperArrow`,ph={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mh=v.forwardRef($m(function(e,t){let{__scopePopper:n,...r}=e,i=uh(fh,n),a=ph[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,I.jsx)(Zm,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function hh(e){return e!==null}$m(hh,`isNotNull`);var gh=$m(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_h(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function _h(e){let[t,n=`center`]=e.split(`-`);return[t,n]}$m(_h,`getSideAndAlignFromPlacement`);var vh=ah,yh=sh,bh=dh,xh=mh,Sh=Object.defineProperty,Ch=(e,t)=>Sh(e,`name`,{value:t,configurable:!0}),wh=!1;function Th(){let[e,t]=v.useState(wh);return v.useEffect(()=>{wh||(wh=!0,t(!0))},[]),e}Ch(Th,`useIsHydrated`);var Eh=v.useSyncExternalStore;function Dh(){return()=>{}}Ch(Dh,`subscribe`);function Oh(){return Eh(Dh,()=>!0,()=>!1)}Ch(Oh,`useIsHydratedModern`);var kh=typeof Eh==`function`?Oh:Th,Ah=Object.defineProperty,jh=(e,t)=>Ah(e,`name`,{value:t,configurable:!0}),Mh=`rovingFocusGroup.onEntryFocus`,Nh={bubbles:!1,cancelable:!0},Ph=`RovingFocusGroup`,[Fh,Ih,Lh]=Vc(Ph),[Rh,zh]=Lc(Ph,[Lh]),[Bh,Vh]=Rh(Ph),Hh=v.forwardRef(jh(function(e,t){return(0,I.jsx)(Fh.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Fh.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Uh,{...e,ref:t})})})},`RovingFocusGroup`)),Uh=v.forwardRef(jh(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=uc(t,f),m=Il(a),[h,g]=ml({prop:o,defaultProp:s??null,onChange:c,caller:Ph}),[_,y]=v.useState(!1),b=K(l),x=Ih(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Mh,b),()=>e.removeEventListener(Mh,b)},[b]),(0,I.jsx)(Bh,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,I.jsx)(W.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{S.current=!0}),onFocus:G(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Mh,Nh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Yh([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:G(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Wh=`RovingFocusGroupItem`,Gh=v.forwardRef(jh(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ml(),l=a||c,u=Vh(Wh,n),d=u.currentTabStopId===l,f=Ih(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=kh();return al(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,I.jsx)(Fh.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(W.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Jh(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Xh(n,r+1):n.slice(r+1)}setTimeout(()=>Yh(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Kh={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function qh(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}jh(qh,`getDirectionAwareKey`);function Jh(e,t,n){let r=qh(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Kh[r]}jh(Jh,`getFocusIntent`);function Yh(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}jh(Yh,`focusFirst`);function Xh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}jh(Xh,`wrapArray`);var Zh=Hh,Qh=Gh,$h=Object.defineProperty,eg=(e,t)=>$h(e,`name`,{value:t,configurable:!0}),tg=[`Enter`,` `],ng=[`ArrowDown`,`PageUp`,`Home`],rg=[`ArrowUp`,`PageDown`,`End`],ig=[...ng,...rg];[...tg],[...tg];var ag=`Menu`,[og,sg,cg]=Vc(ag),[lg,ug]=Lc(ag,[cg,nh,zh]),dg=nh(),fg=zh(),[pg,mg]=lg(ag),[hg,gg]=lg(ag),_g=eg(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=dg(t),[c,l]=v.useState(null),u=v.useRef(!1),d=K(a),f=Il(i);return v.useEffect(()=>{let e=eg(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=eg(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),v.useEffect(()=>{if(!n)return;let e=eg(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,I.jsx)(vh,{...s,children:(0,I.jsx)(pg,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(hg,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),vg=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,...r}=e,i=dg(n);return(0,I.jsx)(yh,{...i,...r,ref:t})},`MenuAnchor`)),yg=`MenuPortal`,[bg,xg]=lg(yg,{forceMount:void 0}),Sg=eg(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=mg(yg,t);return(0,I.jsx)(bg,{scope:t,forceMount:n,children:(0,I.jsx)(Sl,{present:n||a.open,children:(0,I.jsx)(hu,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Cg=`MenuContent`,[wg,Tg]=lg(Cg),Eg=v.forwardRef(eg(function(e,t){let n=xg(Cg,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=mg(Cg,e.__scopeMenu),o=gg(Cg,e.__scopeMenu);return(0,I.jsx)(og.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Sl,{present:r||a.open,children:(0,I.jsx)(og.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(Dg,{...i,ref:t}):(0,I.jsx)(Og,{...i,ref:t})})})})},`MenuContent`)),Dg=v.forwardRef(eg(function(e,t){let n=mg(Cg,e.__scopeMenu),r=v.useRef(null),i=uc(t,r);return v.useEffect(()=>{let e=r.current;if(e)return Bd(e)},[]),(0,I.jsx)(Ag,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Og=v.forwardRef(eg(function(e,t){let n=mg(Cg,e.__scopeMenu);return(0,I.jsx)(Ag,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),kg=pc(`MenuContent.ScrollLock`),Ag=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=mg(Cg,n),_=gg(Cg,n),y=dg(n),b=fg(n),x=sg(n),[S,C]=v.useState(null),w=v.useRef(null),T=uc(t,w,g.onContentChange),E=v.useRef(0),ee=v.useRef(``),D=v.useRef(0),O=v.useRef(null),k=v.useRef(`right`),A=v.useRef(0),j=m?jd:v.Fragment,te=m?{as:kg,allowPinchZoom:!0}:void 0,ne=eg(e=>{let t=ee.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=e_(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;eg((function e(t){ee.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(E.current),[]),xu();let M=v.useCallback(e=>k.current===O.current?.side&&n_(e,O.current?.area),[]);return(0,I.jsx)(wg,{scope:n,searchRef:ee,onItemEnter:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:v.useCallback(e=>{M(e)||(w.current?.focus(),C(null))},[M]),onTriggerLeave:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:v.useCallback(e=>{O.current=e},[]),children:(0,I.jsx)(j,{...te,children:(0,I.jsx)(nu,{asChild:!0,trapped:i,onMountAutoFocus:G(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(Wl,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(Zh,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:G(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(bh,{role:`menu`,"aria-orientation":`vertical`,"data-state":Yg(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:G(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=w.current;if(e.target!==i||!ig.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);rg.includes(e.key)&&a.reverse(),Qg(a)}),onBlur:G(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),ee.current=``)}),onPointerMove:G(e.onPointerMove,r_(e=>{let t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>A.current?`right`:`left`;k.current=t,A.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),jg=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,...r}=e;return(0,I.jsx)(W.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Mg=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,...r}=e;return(0,I.jsx)(W.div,{...r,ref:t})},`MenuLabel`)),Ng=`MenuItem`,Pg=`menu.itemSelect`,Fg=v.forwardRef(eg(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=gg(Ng,e.__scopeMenu),s=Tg(Ng,e.__scopeMenu),c=uc(t,a),l=v.useRef(!1),u=eg(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Pg,{bubbles:!0,cancelable:!0});e.addEventListener(Pg,e=>r?.(e),{once:!0}),kc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,I.jsx)(Ig,{...i,ref:c,disabled:n,onClick:G(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:G(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:G(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||tg.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ig=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Tg(Ng,n),s=fg(n),c=v.useRef(null),l=uc(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(og.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(Qh,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(W.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:G(e.onPointerMove,r_(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,r_(e=>o.onItemLeave(e))),onFocus:G(e.onFocus,()=>d(!0)),onBlur:G(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Lg,Rg]=lg(`MenuRadioGroup`,{value:void 0,onValueChange:eg(()=>{},`onValueChange`)}),zg=v.forwardRef(eg(function(e,t){let{value:n,onValueChange:r,...i}=e,a=K(r);return(0,I.jsx)(Lg,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(jg,{...i,ref:t})})},`MenuRadioGroup`)),Bg=`MenuRadioItem`,Vg=v.forwardRef(eg(function(e,t){let{value:n,...r}=e,i=Rg(Bg,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(Ug,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(Fg,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Zg(a),onSelect:G(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Hg=`MenuItemIndicator`,[Ug,Wg]=lg(Hg,{checked:!1}),Gg=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Wg(Hg,n);return(0,I.jsx)(Sl,{present:r||Xg(a.checked)||a.checked===!0,children:(0,I.jsx)(W.span,{...i,ref:t,"data-state":Zg(a.checked)})})},`MenuItemIndicator`)),Kg=v.forwardRef(eg(function(e,t){let{__scopeMenu:n,...r}=e;return(0,I.jsx)(W.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[qg,Jg]=lg(`MenuSub`);function Yg(e){return e?`open`:`closed`}eg(Yg,`getOpenState`);function Xg(e){return e===`indeterminate`}eg(Xg,`isIndeterminate`);function Zg(e){return Xg(e)?`indeterminate`:e?`checked`:`unchecked`}eg(Zg,`getCheckedState`);function Qg(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}eg(Qg,`focusFirst`);function $g(e,t){return e.map((n,r)=>e[(t+r)%e.length])}eg($g,`wrapArray`);function e_(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$g(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}eg(e_,`getNextMatch`);function t_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}eg(t_,`isPointInPolygon`);function n_(e,t){return t?t_({x:e.clientX,y:e.clientY},t):!1}eg(n_,`isPointerInGraceArea`);function r_(e){return t=>t.pointerType===`mouse`?e(t):void 0}eg(r_,`whenMouse`);var i_=_g,a_=vg,o_=Sg,s_=Eg,c_=Mg,l_=Fg,u_=zg,d_=Vg,f_=Gg,p_=Kg,m_=Object.defineProperty,h_=(e,t)=>m_(e,`name`,{value:t,configurable:!0}),g_=`DropdownMenu`,[__,v_]=Lc(g_,[ug]),y_=ug(),[b_,x_]=__(g_),S_=h_(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=y_(t),l=v.useRef(null),[u,d]=ml({prop:i,defaultProp:a??!1,onChange:o,caller:g_});return(0,I.jsx)(b_,{scope:t,triggerId:Ml(),triggerRef:l,contentId:Ml(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(i_,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),C_=`DropdownMenuTrigger`,w_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=x_(C_,n),o=y_(n),s=uc(t,a.triggerRef);return(0,I.jsx)(a_,{asChild:!0,...o,children:(0,I.jsx)(W.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:G(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:G(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),T_=h_(e=>{let{__scopeDropdownMenu:t,...n}=e,r=y_(t);return(0,I.jsx)(o_,{...r,...n})},`DropdownMenuPortal`),E_=`DropdownMenuContent`,D_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=x_(E_,n),a=y_(n),o=v.useRef(!1);return(0,I.jsx)(s_,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:G(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),O_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(c_,{...i,...r,ref:t})},`DropdownMenuLabel`)),k_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(l_,{...i,...r,ref:t})},`DropdownMenuItem`)),A_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(u_,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),j_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(d_,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),M_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(f_,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),N_=v.forwardRef(h_(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=y_(n);return(0,I.jsx)(p_,{...i,...r,ref:t})},`DropdownMenuSeparator`)),P_=S_,F_=w_,I_=T_,L_=D_,R_=O_,z_=k_,B_=A_,V_=j_,H_=M_,U_=N_,W_=Object.defineProperty,G_=v.forwardRef(((e,t)=>W_(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,I.jsx)(W.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),K_=Object.defineProperty,q_=(e,t)=>K_(e,`name`,{value:t,configurable:!0});function J_(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}q_(J_,`usePrevious`);var Y_=Object.defineProperty,X_=(e,t)=>Y_(e,`name`,{value:t,configurable:!0});function Z_(e,[t,n]){return Math.min(n,Math.max(t,e))}X_(Z_,`clamp`);var Q_=Object.defineProperty,$_=(e,t)=>Q_(e,`name`,{value:t,configurable:!0}),ev=[` `,`Enter`,`ArrowUp`,`ArrowDown`],tv=[` `,`Enter`],nv=`Select`,[rv,iv,av]=Vc(nv),[ov,sv]=Lc(nv,[av,nh]),cv=nh(),[lv,uv]=ov(nv),[dv,fv]=ov(nv);function pv(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=cv(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=Il(l),[T,E]=ml({prop:r,defaultProp:i??!1,onChange:a,caller:nv}),[ee,D]=ml({prop:o,defaultProp:s,onChange:c,caller:nv}),O=v.useRef(null),k=v.useRef(ee);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=$_(()=>D(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let A=!_||!!m||!!_.closest(`form`),[j,te]=v.useState(new Set),ne=Ml(),M=Array.from(j).map(e=>e.props.value).join(`;`),N=v.useCallback(e=>{te(t=>new Set(t).add(e))},[]),P=v.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),re={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ne,value:ee,onValueChange:D,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:j,nativeSelectKey:M,isFormControl:A};return(0,I.jsx)(vh,{...g,children:(0,I.jsx)(lv,{scope:t,...re,children:(0,I.jsx)(rv.Provider,{scope:t,children:(0,I.jsx)(dv,{scope:t,onNativeOptionAdd:N,onNativeOptionRemove:P,children:ty(h)?h(re):n})})})})}$_(pv,`SelectProvider`);var mv=$_(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(pv,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(ey,{__scopeSelect:t}):null]})})},`Select`),hv=`SelectTrigger`,gv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=cv(n),o=uv(hv,n),s=o.disabled||r,c=uc(t,o.onTriggerChange),l=iv(n),u=v.useRef(`touch`),[d,f,p]=ry(e=>{let t=l().filter(e=>!e.disabled),n=iy(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=$_(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,I.jsx)(yh,{asChild:!0,...a,children:(0,I.jsx)(W.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ny(o.value)?``:void 0,...i,ref:c,onClick:G(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:G(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:G(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&ev.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),_v=`SelectValue`,vv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=uv(_v,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=uc(t,c.onValueNodeChange);al(()=>{l(u)},[l,u]);let f=ny(c.value);return(0,I.jsx)(W.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,I.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),yv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(W.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[bv,xv]=ov(`SelectPortal`,{forceMount:void 0}),Sv=$_(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(bv,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(hu,{asChild:!0,...r})})},`SelectPortal`),Cv=`SelectContent`,wv=v.forwardRef($_(function(e,t){let n=xv(Cv,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=uv(Cv,e.__scopeSelect),[o,s]=v.useState();return al(()=>{s(new DocumentFragment)},[]),(0,I.jsx)(Sl,{present:r||a.open,children:({present:e})=>e?(0,I.jsx)(Av,{...i,ref:t}):(0,I.jsx)(Tv,{...i,fragment:o})})},`SelectContent`)),Tv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,I.jsx)(Dv,{scope:n,children:(0,I.jsx)(rv.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Ev=10,[Dv,Ov]=ov(Cv),kv=pc(`SelectContent.RemoveScroll`),Av=v.forwardRef($_(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=uv(Cv,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=uc(t,x),[T,E]=v.useState(null),[ee,D]=v.useState(null),O=iv(n),[k,A]=v.useState(!1),j=v.useRef(!1);v.useEffect(()=>{if(b)return Bd(b)},[b]),xu();let te=v.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,S]),ne=v.useCallback(()=>te([T,b]),[te,T,b]);v.useEffect(()=>{k&&ne()},[k,ne]);let{onOpenChange:M,triggerPointerDownPosRef:N}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=$_(t=>{e={x:Math.abs(Math.round(t.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(N.current?.y??0))}},`handlePointerMove`),n=$_(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||M(!1),document.removeEventListener(`pointermove`,t),N.current=null},`handlePointerUp`);return N.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,M,N]),v.useEffect(()=>{let e=$_(()=>M(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[M]);let[P,re]=ry(e=>{let t=O().filter(e=>!e.disabled),n=iy(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ie=v.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(j.current=!0))},[y.value]),ae=v.useCallback(()=>b?.focus(),[b]),oe=v.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&D(e)},[y.value]),F=r===`popper`?Mv:jv,se=F===Mv?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(Dv,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ie,selectedItem:T,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:ne,selectedItemText:ee,position:r,isPositioned:k,searchRef:P,children:(0,I.jsx)(jd,{as:kv,allowPinchZoom:!0,children:(0,I.jsx)(nu,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:G(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,I.jsx)(F,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...se,onPlaced:()=>A(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:G(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),jv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=uv(Cv,n),o=Ov(Cv,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=uc(t,u),f=iv(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ev,d=Z_(a,[Ev,Math.max(Ev,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Ev,d=Z_(a,[Ev,Math.max(Ev,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Ev*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Ev,ee=c-E,D=g.offsetHeight/2,O=g.offsetTop+D,k=m+v+O,A=x-k;if(k<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=k+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+A;s.style.height=t+`px`,h.scrollTop=k-E+h.offsetTop}s.style.margin=`${Ev}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);al(()=>b(),[b]);let[x,S]=v.useState();return al(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,I.jsx)(Nv,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,I.jsx)(W.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Mv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ev,...a}=e,o=cv(n);return(0,I.jsx)(bh,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Nv,Pv]=ov(Cv,{}),Fv=`SelectViewport`,Iv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Ov(Fv,n),o=Pv(Fv,n),s=uc(t,a.onViewportChange),c=v.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(rv.Slot,{scope:n,children:(0,I.jsx)(W.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:G(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Ev*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Lv,Rv]=ov(`SelectGroup`),zv=`SelectItem`,[Bv,Vv]=ov(zv),Hv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=uv(zv,n),c=Ov(zv,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=uc(t,K(e=>c.itemRefCallback?.(e,r,i))),h=Ml(),g=v.useRef(`touch`),_=$_(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,I.jsx)(Bv,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(rv.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,I.jsx)(W.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:G(o.onFocus,()=>p(!0)),onBlur:G(o.onBlur,()=>p(!1)),onClick:G(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:G(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:G(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:G(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:G(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(tv.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Uv=`SelectItemText`,Wv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=uv(Uv,n),s=Ov(Uv,n),c=Vv(Uv,n),l=fv(Uv,n),[u,d]=v.useState(null),f=K(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=uc(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,I.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return al(()=>(g(h),()=>_(h)),[g,_,h]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!ny(o.value)?y.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Gv=`SelectItemIndicator`,Kv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,...r}=e;return Vv(Gv,n).isSelected?(0,I.jsx)(W.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),qv=`SelectScrollUpButton`,Jv=v.forwardRef($_(function(e,t){let n=Ov(qv,e.__scopeSelect),r=Pv(qv,e.__scopeSelect),[i,a]=v.useState(!1),o=uc(t,r.onScrollButtonChange);return al(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};$_(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Zv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Yv=`SelectScrollDownButton`,Xv=v.forwardRef($_(function(e,t){let n=Ov(Yv,e.__scopeSelect),r=Pv(Yv,e.__scopeSelect),[i,a]=v.useState(!1),o=uc(t,r.onScrollButtonChange);return al(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};$_(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Zv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Zv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ov(`SelectScrollButton`,n),o=v.useRef(null),s=iv(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),al(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(W.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:G(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:G(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:G(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Qv=v.forwardRef($_(function(e,t){let{__scopeSelect:n,...r}=e;return(0,I.jsx)(W.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),$v=`SelectBubbleInput`,ey=v.forwardRef($_(function({__scopeSelect:e,...t},n){let r=uv($v,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=uc(n,p),h=i??``,g=J_(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,I.jsxs)(W.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Mc,...t.style},ref:m,defaultValue:h,children:[ny(i)&&!_?(0,I.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function ty(e){return typeof e==`function`}$_(ty,`isFunction`);function ny(e){return e===``||e===void 0}$_(ny,`shouldShowPlaceholder`);function ry(e){let t=K(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),$_((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}$_(ry,`useTypeaheadSearch`);function iy(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ay(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}$_(iy,`findNextItem`);function ay(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$_(ay,`wrapArray`);var oy=Object.defineProperty,sy=(e,t)=>oy(e,`name`,{value:t,configurable:!0}),cy=`Switch`,[ly,uy]=Lc(cy),[dy,fy]=ly(cy);function py(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ml({prop:n,defaultProp:i??!1,onChange:c,caller:cy}),[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useRef(!1),[b,x]=v.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,I.jsx)(dy,{scope:t,...S,children:xy(d)?d(S):r})}sy(py,`SwitchProvider`);var my=`SwitchTrigger`,hy=v.forwardRef(sy(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=fy(my,e),g=uc(r,u),_=v.useRef(c);return v.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=sy(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,I.jsx)(W.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Sy(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:G(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),gy=v.forwardRef(sy(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,I.jsx)(py,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(hy,{...d,ref:t,__scopeSwitch:n}),e&&(0,I.jsx)(by,{__scopeSwitch:n})]})})},`Switch`)),_y=`SwitchThumb`,vy=v.forwardRef(sy(function(e,t){let{__scopeSwitch:n,...r}=e,i=fy(_y,n);return(0,I.jsx)(W.span,{"data-state":Sy(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),yy=`SwitchBubbleInput`,by=v.forwardRef(sy(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=fy(yy,e),g=uc(r,h),_=bf(i),y=v.useRef(!1),b=v.useRef(s),x=v.useRef(o);v.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=v.useRef(s);return(0,I.jsx)(W.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:G(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function xy(e){return typeof e==`function`}sy(xy,`isFunction`);function Sy(e){return e?`checked`:`unchecked`}sy(Sy,`getState`);var Cy=Object.defineProperty,wy=(e,t)=>Cy(e,`name`,{value:t,configurable:!0}),Ty=`Tabs`,[Ey,Dy]=Lc(Ty,[zh]),Oy=zh(),[ky,Ay]=Ey(Ty),jy=v.forwardRef(wy(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Il(s),[d,f]=ml({prop:r,onChange:i,defaultProp:a??``,caller:Ty});return(0,I.jsx)(ky,{scope:n,baseId:Ml(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(W.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),My=`TabsList`,Ny=v.forwardRef(wy(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Ay(My,n),o=Oy(n);return(0,I.jsx)(Zh,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(W.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Py=`TabsTrigger`,Fy=v.forwardRef(wy(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ay(Py,n),s=Oy(n),c=Iy(o.baseId,r),l=Ly(o.baseId,r),u=r===o.value;return(0,I.jsx)(Qh,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(W.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:G(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:G(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:G(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Iy(e,t){return`${e}-trigger-${t}`}wy(Iy,`makeTriggerId`);function Ly(e,t){return`${e}-content-${t}`}wy(Ly,`makeContentId`);var Ry=jy,zy=Ny,By=Fy,Vy=Object.defineProperty,Hy=(e,t)=>Vy(e,`name`,{value:t,configurable:!0}),[Uy,Wy]=Lc(`Tooltip`,[nh]),Gy=nh(),Ky=`TooltipProvider`,qy=700,Jy=`tooltip.open`,[Yy,Xy]=Uy(Ky),Zy=Hy(e=>{let{__scopeTooltip:t,delayDuration:n=qy,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Yy,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Qy=`Tooltip`,[$y,eb]=Uy(Qy),tb=Hy(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Xy(Qy,e.__scopeTooltip),l=Gy(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=Ml(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=ml({prop:r,defaultProp:i??!1,onChange:Hy(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Jy))):c.onClose(),a?.(e)},`onChange`),caller:Qy}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,I.jsx)(vh,{...l,children:(0,I.jsx)($y,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),nb=`TooltipTrigger`,rb=v.forwardRef(Hy(function(e,t){let{__scopeTooltip:n,...r}=e,i=eb(nb,n),a=Xy(nb,n),o=Gy(n),s=uc(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(yh,{asChild:!0,...o,children:(0,I.jsx)(W.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:G(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:G(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:G(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:G(e.onBlur,i.onClose),onClick:G(e.onClick,i.onClose)})})},`TooltipTrigger`)),ib=`TooltipPortal`,[ab,ob]=Uy(ib,{forceMount:void 0}),sb=Hy(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=eb(ib,t);return(0,I.jsx)(ab,{scope:t,forceMount:n,children:(0,I.jsx)(Sl,{present:n||a.open,children:(0,I.jsx)(hu,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),cb=`TooltipContent`,lb=v.forwardRef(Hy(function(e,t){let n=ob(cb,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=eb(cb,e.__scopeTooltip);return(0,I.jsx)(Sl,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(fb,{side:i,...a,ref:t}):(0,I.jsx)(ub,{side:i,...a,ref:t})})},`TooltipContent`)),ub=v.forwardRef(Hy(function(e,t){let n=eb(cb,e.__scopeTooltip),r=Xy(cb,e.__scopeTooltip),i=v.useRef(null),a=uc(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=hb(r,mb(r,n.getBoundingClientRect())),a=gb(t.getBoundingClientRect()),o=vb([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=Hy(e=>p(e,u),`handleTriggerLeave`),t=Hy(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=Hy(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!_b(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(fb,{...e,ref:a})},`TooltipContentHoverable`)),db=gc(`TooltipContent`),fb=v.forwardRef(Hy(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=eb(cb,n),u=Gy(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(Jy,d),()=>document.removeEventListener(Jy,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=Hy(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return al(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,I.jsx)(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(bh,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(db,{children:r}),i?(0,I.jsx)(Nc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),pb=v.forwardRef(Hy(function(e,t){let{__scopeTooltip:n,...r}=e,i=Gy(n);return(0,I.jsx)(xh,{...i,...r,ref:t})},`TooltipArrow`));function mb(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Hy(mb,`getExitSideFromRect`);function hb(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Hy(hb,`getPaddedExitPoints`);function gb(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Hy(gb,`getPointsFromRect`);function _b(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Hy(_b,`isPointInPolygon`);function vb(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),yb(t)}Hy(vb,`getHull`);function yb(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Hy(yb,`getHullPresorted`);var bb=Zy,xb=tb,Sb=rb,Cb=sb,wb=lb,Tb=pb;function Eb({delayDuration:e=0,...t}){return(0,I.jsx)(bb,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Db({...e}){return(0,I.jsx)(xb,{"data-slot":`tooltip`,...e})}function Ob({...e}){return(0,I.jsx)(Sb,{"data-slot":`tooltip-trigger`,...e})}function kb({className:e,sideOffset:t=0,children:n,...r}){return(0,I.jsx)(Cb,{children:(0,I.jsxs)(wb,{"data-slot":`tooltip-content`,sideOffset:t,className:H(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,I.jsx)(Tb,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Ab=eo(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-hover`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary-ink underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,I.jsx)(r?mc:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:H(Ab({variant:t,size:n,className:e})),...i})}function jb({...e}){return(0,I.jsx)(Jd,{"data-slot":`sheet`,...e})}function Mb({...e}){return(0,I.jsx)(Xd,{"data-slot":`sheet-trigger`,...e})}function Nb({className:e,children:t,side:n=`left`,showCloseButton:r=!0,...i}){return(0,I.jsxs)(ef,{"data-slot":`sheet-portal`,children:[(0,I.jsx)(nf,{"data-slot":`sheet-overlay`,className:`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`}),(0,I.jsxs)(sf,{"data-slot":`sheet-content`,className:H(`fixed inset-y-0 z-50 flex w-3/4 max-w-sm flex-col bg-background shadow-lg outline-none transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-300`,n===`left`&&`left-0 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left`,n===`right`&&`right-0 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right`,e),...i,children:[t,r&&(0,I.jsxs)(gf,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none`,children:[(0,I.jsx)(Ya,{className:`size-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Pb({className:e,...t}){return(0,I.jsx)(ff,{"data-slot":`sheet-title`,className:H(`text-base leading-none font-semibold`,e),...t})}var Fb=eo(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary-hover`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary-ink underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Ib({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,I.jsx)(n?mc:`span`,{"data-slot":`badge`,"data-variant":t,className:H(Fb({variant:t}),e),...r})}function Lb({...e}){return(0,I.jsx)(P_,{"data-slot":`dropdown-menu`,...e})}function Rb({...e}){return(0,I.jsx)(F_,{"data-slot":`dropdown-menu-trigger`,...e})}function zb({className:e,sideOffset:t=4,...n}){return(0,I.jsx)(I_,{children:(0,I.jsx)(L_,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:H(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Bb({className:e,inset:t,variant:n=`default`,...r}){return(0,I.jsx)(z_,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:H(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Vb({...e}){return(0,I.jsx)(B_,{"data-slot":`dropdown-menu-radio-group`,...e})}function Hb({className:e,children:t,...n}){return(0,I.jsxs)(V_,{"data-slot":`dropdown-menu-radio-item`,className:H(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(H_,{children:(0,I.jsx)(ma,{className:`size-2 fill-current`})})}),t]})}function Ub({className:e,inset:t,...n}){return(0,I.jsx)(R_,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:H(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Wb({className:e,...t}){return(0,I.jsx)(U_,{"data-slot":`dropdown-menu-separator`,className:H(`-mx-1 my-1 h-px bg-border`,e),...t})}var Gb={normal:`bg-primary`,warning:`bg-amber-500`,destructive:`bg-destructive`};function Kb({meter:e,className:t}){return e.ratio===null?null:(0,I.jsx)(`div`,{className:H(`h-1.5 w-full overflow-hidden rounded-full bg-muted`,t),role:`progressbar`,"aria-label":`Monthly request allowance used`,"aria-valuemin":0,"aria-valuemax":e.limit??void 0,"aria-valuenow":e.used,"aria-valuetext":e.label,children:(0,I.jsx)(`div`,{className:H(`h-full rounded-full`,Gb[e.tone]),style:{width:`${e.used>0?Math.max(e.ratio*100,2):0}%`}})})}var qb=`M41 0 L82 12 L82 52 C82 71 69.7 90.3 41 100 C12.3 90.3 0 71 0 52 L0 12 Z`,Jb=.82,Yb=.46,Xb=-.06,Zb=.04;function Qb({size:e=22}){let t={width:e*Jb,height:e,transform:`translateY(${e*Zb}px)`},n={fontSize:e*Yb,transform:`translateY(${e*Xb}px)`};return(0,I.jsxs)(`span`,{className:`grid flex-none place-items-center`,style:t,children:[(0,I.jsx)(`svg`,{className:`col-start-1 row-start-1 block size-full fill-(--brand-mark)`,viewBox:`0 0 82 100`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:qb})}),(0,I.jsx)(`span`,{className:`col-start-1 row-start-1 font-bold leading-none tracking-[0.01em] text-white`,style:n,children:`AI`})]})}function $b({className:e,onClick:t}){return(0,I.jsxs)(Pn,{to:`/apps`,onClick:t,className:H(`flex items-center gap-1.5 rounded-md text-sm font-semibold tracking-tight`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,e),children:[(0,I.jsx)(`span`,{children:`App`}),(0,I.jsx)(Qb,{size:22}),(0,I.jsx)(`span`,{children:`Gateway`})]})}var ex={owner:`Owner`,admin:`Admin`,member:`Member`};function tx(e){return e===`owner`||e===`admin`}var nx=`Your role is read-only. Ask an owner or admin to make this change.`;function rx(e){return e>1}var ix=(0,v.createContext)(null);function ax({session:e,capabilities:t,billing:n,quota:r,children:i}){let a=tx(e.role),o={session:e,capabilities:t,organization:e.organization,memberships:e.memberships,role:e.role,canManage:a,readOnly:!a,billing:n,quota:r};return(0,I.jsx)(ix,{value:o,children:i})}function ox(){let e=(0,v.use)(ix);if(!e)throw Error(`useConsoleSession must be used inside the authenticated console shell`);return e}function sx(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var cx=encodeURIComponent;function X(){return(e,t)=>({method:e,path:t})}var lx={getConsoleCapabilities:X()(`GET`,()=>`/v1/console/capabilities`),getAdminSession:X()(`GET`,()=>`/v1/admin/session`),listOrganizations:X()(`GET`,()=>`/v1/admin/organizations`),selectOrganization:X()(`POST`,()=>`/v1/admin/organizations/select`),listManagementKeys:X()(`GET`,()=>`/v1/admin/keys`),createManagementKey:X()(`POST`,()=>`/v1/admin/keys`),revokeManagementKey:X()(`POST`,e=>`/v1/admin/keys/${cx(e)}/revoke`),listProviders:X()(`GET`,()=>`/v1/admin/providers`),createProvider:X()(`POST`,()=>`/v1/admin/providers`),testProvider:X()(`POST`,()=>`/v1/admin/providers/test`),updateProvider:X()(`PUT`,e=>`/v1/admin/providers/${cx(e)}`),deleteProvider:X()(`DELETE`,e=>`/v1/admin/providers/${cx(e)}`),listProviderGateways:X()(`GET`,()=>`/v1/admin/provider-gateways`),createProviderGateway:X()(`POST`,()=>`/v1/admin/provider-gateways`),testProviderGateway:X()(`POST`,()=>`/v1/admin/provider-gateways/test`),updateProviderGateway:X()(`PATCH`,e=>`/v1/admin/provider-gateways/${cx(e)}`),rotateProviderGateway:X()(`POST`,e=>`/v1/admin/provider-gateways/${cx(e)}/rotate`),deleteProviderGateway:X()(`DELETE`,e=>`/v1/admin/provider-gateways/${cx(e)}`),listApps:X()(`GET`,(e={})=>`/v1/admin/apps${sx(e)}`),createApp:X()(`POST`,()=>`/v1/admin/apps`),getApp:X()(`GET`,e=>`/v1/admin/apps/${cx(e)}`),updateApp:X()(`PUT`,e=>`/v1/admin/apps/${cx(e)}`),deleteApp:X()(`DELETE`,e=>`/v1/admin/apps/${cx(e)}${sx({confirm:e})}`),validateApp:X()(`POST`,e=>`/v1/admin/apps/${cx(e)}/validate`),listAppKeys:X()(`GET`,e=>`/v1/admin/apps/${cx(e)}/keys`),createAppKey:X()(`POST`,e=>`/v1/admin/apps/${cx(e)}/keys`),revokeAppKey:X()(`POST`,(e,t)=>`/v1/admin/apps/${cx(e)}/keys/${cx(t)}/revoke`),listAppUsers:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/users${sx(t)}`),setAppUserBlocked:X()(`POST`,(e,t,n)=>`/v1/admin/apps/${cx(e)}/users/${cx(t)}/${n?`block`:`unblock`}`),getAppUsage:X()(`GET`,(e,t={})=>`/v1/admin/apps/${cx(e)}/usage${sx(t)}`),getAppUsageTimeseries:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/usage/timeseries${sx(t)}`),getAppUsageBreakdown:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/usage/breakdown${sx(t)}`),listAppEvents:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/events${sx(t)}`),getAppAuthEventSummary:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/auth-events/summary${sx(t)}`),listAppAuthEvents:X()(`GET`,(e,t)=>`/v1/admin/apps/${cx(e)}/auth-events${sx(t)}`),listModelPrices:X()(`GET`,()=>`/v1/admin/prices`),getCliCapabilities:X()(`GET`,()=>`/v1/cli/capabilities`),bootstrapCliAccount:X()(`POST`,()=>`/v1/cli/bootstrap`),createCliOperation:X()(`POST`,()=>`/v1/cli/operations`),pollCliOperation:X()(`GET`,e=>`/v1/cli/operations/${cx(e)}`),getCliAccount:X()(`GET`,()=>`/v1/cli/account`),getCliUsage:X()(`GET`,(e={})=>`/v1/cli/usage${sx(e)}`)},ux=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`ApiError`}},dx=e=>e instanceof ux&&e.status===401,fx=e=>e instanceof ux&&e.status===402;function px(e,t){let n=t??{};return new ux(e,n.error?.code??n.code??`unknown`,n.error?.message??n.message??`Request failed with status ${e}`)}async function mx(e,t={}){let n=new Headers(t.headers);n.set(`x-console-request`,`1`),t.body!==void 0&&n.set(`content-type`,`application/json`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`}),i=await r.text(),a=null;try{a=i?JSON.parse(i):null}catch{a=null}if(!r.ok)throw px(r.status,a);return a}function hx(e,t,n,r){return mx(e.path(...t),{method:e.method,...n===void 0?{}:{body:JSON.stringify(n)},...r===void 0?{}:{headers:r}})}var gx={get:e=>mx(e),post:(e,t)=>mx(e,{method:`POST`,body:t===void 0?void 0:JSON.stringify(t)}),put:(e,t,n)=>mx(e,{method:`PUT`,body:JSON.stringify(t),headers:n}),patch:(e,t)=>mx(e,{method:`PATCH`,body:JSON.stringify(t)}),delete:e=>mx(e,{method:`DELETE`})},_x=`phc_nu2eBjo7JUPZ6RbW2aq23W2ofJr4JBopBgQi4ed5yGfM`,vx=`https://us.i.posthog.com`,yx=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`],bx=`app-ai-gateway:analytics-auth-method:v1`,xx=`app-ai-gateway:analytics-signed-up:v1`,Sx=`app-ai-gateway:analytics-awaiting-request:v1`,Cx=10*6e4,wx=!!vx;function Tx(e,t){try{return e.getItem(t)}catch{return null}}function Ex(e,t,n){try{e.setItem(t,n)}catch{}}function Dx(e){let t=Tx(localStorage,e);if(!t)return[];try{let e=JSON.parse(t);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function Ox(e){let t=e.split(`/`);return t[1]===`apps`&&t[2]&&(t[2]=`:appId`),t.join(`/`)}function kx(e){try{let t=new URL(e),n=new URLSearchParams;for(let e of yx){let r=t.searchParams.get(e);r&&n.set(e,r.slice(0,200))}return t.search=n.toString(),t.hash=``,t.pathname=Ox(t.pathname),t.toString()}catch{return``}}function Ax(e){if(!e)return null;for(let t of[e.properties,e.properties.$set,e.properties.$set_once]){if(!t||typeof t!=`object`)continue;let e=t;for(let t of Object.keys(e)){let n=e[t];typeof n==`string`&&(/^https?:\/\//i.test(n)?e[t]=kx(n):n.startsWith(`/`)&&(e[t]=Ox(n)))}}return e.properties.site=`console`,e.properties.environment=`production`,e}var jx=null,Mx=null,Nx=[],Px=50;function Fx(){Mx??=w(async()=>{let{default:e}=await import(`./module-DY58MOwM.js`);return{default:e}},[]).then(({default:e})=>{e.init(_x,{api_host:vx,defaults:`2026-05-30`,autocapture:!1,capture_pageview:!1,capture_pageleave:!0,capture_dead_clicks:!1,capture_heatmaps:!1,capture_exceptions:!1,capture_performance:!1,rageclick:!1,disable_session_recording:!0,disable_surveys:!0,advanced_disable_feature_flags:!0,person_profiles:`identified_only`,cross_subdomain_cookie:!0,opt_out_capturing_persistence_type:`cookie`,cookie_expiration:180,respect_dnt:!0,before_send:e=>Ax(e)}),jx=e;let t=Nx;Nx=[];for(let n of t)n(e)}).catch(()=>{Nx=[]})}function Ix(e){if(wx){if(jx){e(jx);return}Nx.length<Px&&Nx.push(e),Fx()}}var Lx={enabled:wx,capture(e,t){Ix(n=>n.capture(e,t))},identify(e,t,n){Ix(r=>r.identify(e,{role:t},{signed_up_at:n}))},group(e,t){Ix(n=>n.group(`organization`,e,t))},reset(){Ix(e=>e.reset())}};function Rx(e){wx&&Ex(sessionStorage,bx,e)}function zx(e,t){if(!wx)return;let n=Date.parse(t);!Number.isFinite(n)||Date.now()-n>Cx||Tx(localStorage,xx)!==e&&(Ex(localStorage,xx,e),Lx.capture(`signup_completed`,{method:Tx(sessionStorage,bx)??`unknown`}))}function Bx(e,t){Lx.capture(`provider_added`,{provider:e,route:t?`gateway`:`direct`})}function Vx(e){Lx.capture(`app_created`,{authentication:e})}function Hx(e,t){if(!wx)return;let n=Dx(Sx),r=n.includes(e);if(!t){if(r)return;Ex(localStorage,Sx,JSON.stringify([...n,e].slice(-20)));return}r&&(Ex(localStorage,Sx,JSON.stringify(n.filter(t=>t!==e))),Lx.capture(`first_successful_request`),Lx.group(e,{activated:!0}))}function Ux(){let{pathname:e}=dt();(0,v.useEffect)(()=>{Lx.capture(`$pageview`)},[e])}var Wx=`/login`,Gx=`/signup`,Kx=`/apps`,qx=`/checkout`,Jx=new Set([Wx,Gx]),Yx=`from`,Xx=`error`;function Zx(e){return e instanceof ux?!(e.status>=400&&e.status<500):!0}function Qx(e){return!e||!e.startsWith(`/`)||e.startsWith(`//`)||e.startsWith(`/\\`)?!1:!Jx.has(new URL(e,`https://console.invalid`).pathname)}function $x(e){let t=new URLSearchParams(e).get(Yx);return Qx(t)?t:Kx}var eS=`plan`,tS=/^[a-z0-9_-]{1,32}$/u;function nS(e){let t=new URLSearchParams(e).get(eS);return t!==null&&tS.test(t)?t:null}function rS(e){return`${qx}?${eS}=${encodeURIComponent(e)}`}function iS(e,t){return t===null?e:`${e}?${eS}=${encodeURIComponent(t)}`}function aS(e){let t=nS(e);return t!==null&&t!==`free`?rS(t):$x(e)}function oS(e){return!Qx(e)||e===`/apps`?Wx:`${Wx}?${Yx}=${encodeURIComponent(e)}`}var sS=`checkout`,cS=`success`;function lS(e){return new URLSearchParams(e).get(sS)===cS}function uS(e,t){let n=new URLSearchParams(t);n.delete(sS),n.delete(eS);let r=n.toString();return r?`${e}?${r}`:e}var dS=`${Kx}?${sS}=${cS}`;function fS(e){return`${dS}&${eS}=${encodeURIComponent(e)}`}var pS={access_denied:{tone:`default`,title:`Google sign-in was cancelled`,description:`You declined the permission request. Try again or use your password.`},registration_disabled:{tone:`destructive`,title:`This gateway does not accept new accounts`,description:`Your Google account is not registered here. Ask an owner or admin to add you, then sign in.`},signup_disabled:{tone:`destructive`,title:`This gateway does not accept new accounts`,description:`Your Google account is not registered here. Ask an owner or admin to add you, then sign in.`}};function mS(e){let t=new URLSearchParams(e).get(Xx);return t?pS[t.trim().toLowerCase().replaceAll(/[\s-]+/gu,`_`)]??{tone:`destructive`,title:`Sign-in failed`,description:`The identity provider rejected the sign-in. Try again or use your password.`}:null}var hS=`/v1/auth`;function gS(e){return gx.post(`${hS}/sign-in/email`,{...e,rememberMe:!0})}function _S(e){return gx.post(`${hS}/sign-up/email`,e)}function vS(){return gx.post(`${hS}/sign-out`,{})}function yS(e){return gx.post(`${hS}/change-password`,e)}async function bS(e){let t=Qx(e)?e:Kx;Rx(`google`);let n=await gx.post(`${hS}/sign-in/social`,{provider:`google`,callbackURL:t,errorCallbackURL:oS(t)});if(!n?.url)throw Error(`Google sign-in is unavailable right now.`);window.location.assign(n.url)}var xS=e=>e,SS=e=>e,CS={capabilities:[`capabilities`],session:[`session`],organizations:[`organizations`],managementKeys:[`management-keys`],providers:[`providers`],providerGateways:[`provider-gateways`],billingStatus:[`billing`,`status`],billingPlans:[`billing`,`plans`],apps:e=>[`apps`,e],app:e=>[`app`,e],apiKeys:e=>[`api-keys`,e],users:(e,t)=>[`users`,e,t],usage:(e,t)=>[`usage`,e,t],timeseries:(e,t,n)=>[`timeseries`,e,t,n],breakdown:(e,t,n,r)=>[`breakdown`,e,t,n,r],events:(e,t)=>[`events`,e,t],authEventSummary:(e,t)=>[`auth-event-summary`,e,t],authEvents:(e,t)=>[`auth-events`,e,t],prices:[`prices`]};function wS(){return Ti({queryKey:CS.capabilities,queryFn:()=>hx(lx.getConsoleCapabilities,[]),staleTime:1/0,retry:1})}function TS(){return Ti({queryKey:CS.session,queryFn:async()=>(await hx(lx.getAdminSession,[])).session,retry:!1,staleTime:6e4})}function ES(){let e=ui();return Ei({mutationFn:e=>(Rx(`password`),gS(e)),onSuccess:()=>e.invalidateQueries()})}function DS(){let e=ui();return Ei({mutationFn:e=>(Rx(`password`),_S(e)),onSuccess:()=>e.invalidateQueries()})}function OS(){let e=ui();return Ei({mutationFn:()=>vS(),onSettled:()=>{Lx.reset(),e.clear()}})}function kS(){return Ei({mutationFn:e=>yS({...e,revokeOtherSessions:!0})})}function AS(){let e=ui();return Ei({mutationFn:e=>hx(lx.selectOrganization,[],{organizationId:e}),onSuccess:t=>{e.clear(),e.setQueryData(CS.session,t.session)}})}function jS(){return Ti({queryKey:CS.managementKeys,queryFn:()=>hx(lx.listManagementKeys,[])})}function MS(){let e=ui();return Ei({mutationFn:e=>hx(lx.createManagementKey,[],{name:e}),gcTime:0,onSuccess:()=>void e.invalidateQueries({queryKey:CS.managementKeys})})}function NS(){let e=ui();return Ei({mutationFn:e=>hx(lx.revokeManagementKey,[e]),onSuccess:()=>void e.invalidateQueries({queryKey:CS.managementKeys})})}function PS(){return Ti({queryKey:CS.providers,queryFn:()=>hx(lx.listProviders,[])})}function FS(){return Ti({queryKey:CS.providers,queryFn:()=>hx(lx.listProviders,[]),select:e=>e.providers})}function IS(e){e.invalidateQueries({queryKey:CS.providers}),e.invalidateQueries({queryKey:CS.providerGateways})}function LS(){let e=ui();return Ei({mutationFn:e=>hx(lx.createProvider,[],e),gcTime:0,onSuccess:(t,n)=>{Bx(n.type,n.providerGatewayId!==void 0),IS(e)}})}function RS(){return Ei({mutationFn:e=>hx(lx.testProvider,[],e),gcTime:0})}function zS(){return Ei({mutationFn:e=>hx(lx.testProviderGateway,[],e),gcTime:0})}function BS(e=!0){return Ti({queryKey:CS.providerGateways,queryFn:()=>hx(lx.listProviderGateways,[]),enabled:e})}function VS(e){let t=ui();return Ei({mutationFn:e,gcTime:0,onSuccess:()=>IS(t)})}function HS(){return VS(e=>hx(lx.createProviderGateway,[],e))}function US(){return VS(({id:e,name:t})=>hx(lx.updateProviderGateway,[e],{name:t}))}function WS(){return VS(({id:e,token:t})=>hx(lx.rotateProviderGateway,[e],{token:t}))}function GS(){return VS(e=>hx(lx.deleteProviderGateway,[e]))}function KS(){let e=ui();return Ei({mutationFn:({id:e,body:t})=>hx(lx.updateProvider,[e],t),gcTime:0,onSuccess:(t,n)=>{e.invalidateQueries({queryKey:CS.providers}),n.body.status!==void 0&&e.invalidateQueries({queryKey:[`apps`]})}})}function qS(){let e=ui();return Ei({mutationFn:e=>hx(lx.deleteProvider,[e]),onSuccess:()=>IS(e)})}function JS(e){return Ti({queryKey:CS.billingStatus,queryFn:()=>gx.get(`/v1/admin/billing/status`),enabled:e,staleTime:3e4,refetchInterval:e?5*6e4:!1,refetchOnWindowFocus:!0})}function YS(e){return Ti({queryKey:CS.billingPlans,queryFn:()=>gx.get(`/v1/admin/billing/plans`),enabled:e,staleTime:1/0})}function XS(){return Ei({mutationFn:e=>gx.post(`/v1/admin/billing/checkout`,{...e,successUrl:`${window.location.origin}${fS(e.planKey)}`,cancelUrl:`${window.location.origin}/billing`})})}function ZS(){let e=ui();return Ei({mutationFn:e=>gx.post(`/v1/admin/billing/change`,e),onSuccess:()=>void e.invalidateQueries({queryKey:CS.billingStatus})})}function QS(){let e=ui();return Ei({mutationFn:()=>gx.post(`/v1/admin/billing/cancel`),onSuccess:()=>void e.invalidateQueries({queryKey:CS.billingStatus})})}function $S(){let e=ui();return Ei({mutationFn:e=>gx.post(`/v1/admin/billing/resume`,e),onSuccess:()=>void e.invalidateQueries({queryKey:CS.billingStatus})})}function eC(e,t){return Ti({queryKey:CS.apps(e),queryFn:()=>hx(lx.listApps,[{month:e}]),...t===void 0?{}:{refetchInterval:t}})}function tC(e){return Ti({queryKey:CS.app(e),queryFn:async()=>xS(await hx(lx.getApp,[e]))})}function nC(e){let t=ui();return Ei({mutationFn:async({body:t,revision:n})=>xS(await hx(lx.updateApp,[e],SS(t),{"If-Match":`"app-${n}"`})),onSuccess:()=>{t.invalidateQueries({queryKey:CS.app(e)}),t.invalidateQueries({queryKey:[`apps`]})}})}function rC(){let e=ui();return Ei({mutationFn:async e=>{let t=await hx(lx.createApp,[],SS(e));return{...xS(t),api_key:t.api_key}},onSuccess:(t,n)=>{Vx(n.config.authentication.type),e.invalidateQueries({queryKey:CS.app(t.app.id)}),e.invalidateQueries({queryKey:[`apps`]})}})}function iC(){let e=ui();return Ei({mutationFn:e=>hx(lx.deleteApp,[e]),onSuccess:()=>e.invalidateQueries({queryKey:[`apps`]})})}function aC(e,t=!0){return Ti({enabled:t,queryKey:CS.apiKeys(e),queryFn:()=>hx(lx.listAppKeys,[e])})}function oC(e){let t=ui();return Ei({mutationFn:t=>hx(lx.createAppKey,[e],{name:t}),onSuccess:()=>void t.invalidateQueries({queryKey:CS.apiKeys(e)})})}function sC(e){let t=ui();return Ei({mutationFn:t=>hx(lx.revokeAppKey,[e,t]),onSuccess:()=>void t.invalidateQueries({queryKey:CS.apiKeys(e)})})}function cC(e,t){return Ti({queryKey:CS.users(e,t),queryFn:()=>hx(lx.listAppUsers,[e,t]),placeholderData:e=>e})}function lC(e){let t=ui();return Ei({mutationFn:({userId:t,blocked:n})=>hx(lx.setAppUserBlocked,[e,t,n]),onSuccess:()=>{t.invalidateQueries({queryKey:[`users`,e]}),t.invalidateQueries({queryKey:[`apps`]})}})}function uC(e,t){return Ti({queryKey:CS.usage(e,t),queryFn:()=>hx(lx.getAppUsage,[e,{month:t}])})}function dC(e,t,n){return Ti({queryKey:CS.timeseries(e,t,n),queryFn:()=>hx(lx.getAppUsageTimeseries,[e,{from:t,to:n}])})}function fC(e,t,n,r){return Ti({queryKey:CS.breakdown(e,t,n,r),queryFn:()=>hx(lx.getAppUsageBreakdown,[e,{by:t,from:n,to:r}])})}function pC(e,t){return Ti({queryKey:CS.events(e,t),queryFn:()=>hx(lx.listAppEvents,[e,{...t}]),placeholderData:e=>e})}function mC(e,t){return Ti({queryKey:CS.authEventSummary(e,t),queryFn:()=>hx(lx.getAppAuthEventSummary,[e,{days:t}]),staleTime:3e4})}function hC(e,t){return Ti({queryKey:CS.authEvents(e,t),queryFn:()=>hx(lx.listAppAuthEvents,[e,{...t}]),placeholderData:e=>e})}function gC(){return Ti({queryKey:CS.prices,queryFn:()=>hx(lx.listModelPrices,[]),staleTime:1/0})}function _C(){let{organization:e,memberships:t}=ox(),n=AS();if(!rx(t.length))return null;let r=async t=>{if(t!==e?.id)try{await n.mutateAsync(t)}catch(e){U.error(e instanceof Error?e.message:`Could not switch organization`)}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Wb,{}),(0,I.jsx)(Ub,{className:`text-xs font-normal text-muted-foreground`,children:`Organizations`}),t.map(t=>{let i=t.organization.id===e?.id;return(0,I.jsxs)(Bb,{disabled:n.isPending,onSelect:()=>void r(t.organization.id),children:[(0,I.jsx)(ra,{className:i?`size-4`:`size-4 opacity-0`}),(0,I.jsx)(`span`,{className:`flex-1 truncate`,children:t.organization.name}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ex[t.role]})]},t.organization.id)})]})}function vC({status:e}){return e===`active`?null:(0,I.jsxs)(Ib,{variant:`outline`,className:`gap-1.5 border-muted-foreground/30 text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground`}),`disabled`]})}var yC={ok:`border-emerald-500/40 text-emerald-600 dark:text-emerald-400`,provider_error:`border-destructive/40 text-destructive`,blocked_app_rate:`border-amber-500/40 text-amber-600 dark:text-amber-400`,blocked_app_budget:`border-amber-500/40 text-amber-600 dark:text-amber-400`,blocked_billing:`border-amber-500/40 text-amber-600 dark:text-amber-400`,blocked_user:`border-amber-500/40 text-amber-600 dark:text-amber-400`},bC={ok:`Served by the provider`,provider_error:`The provider refused or failed the request`,blocked_app_rate:`Refused by this app's own rate limit, which you set`,blocked_app_budget:`Refused by this app's own monthly budget, which you set`,blocked_billing:`Refused: your plan's monthly request allowance was exhausted`,blocked_user:`Refused: this user is blocked`};function xC({status:e}){return(0,I.jsx)(Ib,{variant:`outline`,className:H(`font-mono text-[11px] font-normal`,yC[e]),title:bC[e],children:e})}var SC={ok:`border-emerald-500/40 text-emerald-600 dark:text-emerald-400`,issuer_claims_missing:`border-amber-500/40 text-amber-600 dark:text-amber-400`,issuer_verification_unavailable:`border-amber-500/40 text-amber-600 dark:text-amber-400`};function CC({outcome:e}){return(0,I.jsx)(Ib,{variant:`outline`,className:H(`font-mono text-[11px] font-normal`,SC[e]??`border-destructive/40 text-destructive`),children:e})}function wC({status:e}){return(0,I.jsx)(Ib,{variant:`outline`,className:H(e===`blocked`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`),children:e})}var TC=[{value:`light`,label:`Light`,icon:Wa},{value:`dark`,label:`Dark`,icon:Oa},{value:`system`,label:`System`,icon:Da}];function EC(){let{theme:e,resolvedTheme:t,setTheme:n}=Ni(),[r,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>i(!0),[]),(0,I.jsxs)(Lb,{children:[(0,I.jsx)(Rb,{asChild:!0,children:(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Theme`,className:`text-muted-foreground`,children:r?(0,I.jsx)(e===`system`?Da:t===`light`?Wa:Oa,{className:`size-4`}):(0,I.jsx)(`span`,{className:`size-4`})})}),(0,I.jsx)(zb,{align:`end`,className:`w-36`,children:(0,I.jsx)(Vb,{value:e??`system`,onValueChange:n,children:TC.map(e=>(0,I.jsxs)(Hb,{value:e.value,children:[(0,I.jsx)(e.icon,{className:`size-4`}),e.label]},e.value))})})]})}var DC=[{slug:`overview`,label:`Overview`,icon:Qi},{slug:`auth`,label:`Auth policy`,icon:Ba},{slug:`proxy`,label:`Proxy policy`,icon:Ja},{slug:`endpoints`,label:`Endpoints`,icon:Fa},{slug:`limits`,label:`Limits`,icon:ba},{slug:`users`,label:`Users`,icon:qa},{slug:`usage`,label:`Usage`,icon:na},{slug:`auth-events`,label:`Auth & Errors`,icon:za},{slug:`settings`,label:`Settings`,icon:Ra}];DC[0].slug;var OC=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),kC=new Intl.NumberFormat(`en-US`),AC=new Intl.NumberFormat(`en-US`,{style:`percent`,minimumFractionDigits:1,maximumFractionDigits:1}),jC=e=>e==null?`—`:kC.format(e),MC=e=>e==null?`—`:e<1e4?kC.format(e):OC.format(e),NC=e=>e==null?`—`:AC.format(e);function PC(e){return e==null?`—`:e===0?`$0.00`:e<.01?`$${e.toFixed(4)}`:FC(e)}function FC(e){return e==null?`—`:e<100?`$${e.toFixed(2)}`:`$${kC.format(Math.round(e))}`}function IC(e){if(!e)return null;let t=e.includes(`T`)?e:`${e.replace(` `,`T`)}Z`,n=new Date(t);return Number.isNaN(n.getTime())?null:n}function LC(e){let t=IC(e);return t?t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):`—`}function RC(e){let t=IC(e);if(!t)return`never`;let n=Math.round((Date.now()-t.getTime())/1e3),r=[[`second`,60],[`minute`,60],[`hour`,24],[`day`,30],[`month`,12],[`year`,1/0]],i=n;for(let[e,t]of r){if(Math.abs(i)<t)return new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}).format(-Math.round(i),e);i/=t}return t.toLocaleDateString()}var zC=e=>e.input_tokens+e.cached_input_tokens+e.cache_write_tokens,BC=e=>{let t=zC(e);return t===0?null:e.cached_input_tokens/t},VC=e=>zC(e)+e.output_tokens;function HC(){return new Date().toISOString().slice(0,10).slice(0,7)}function UC(){return new Date().toISOString().slice(0,10)}function WC(e){return new Date(Date.now()-e*864e5).toISOString().slice(0,10)}function GC(e){return new Date(`${e}-01T00:00:00Z`).toLocaleDateString(void 0,{month:`long`,year:`numeric`,timeZone:`UTC`})}function KC(e){let t=[],n=new Date;for(let r=0;r<e;r+=1)t.push(new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()-r,1)).toISOString().slice(0,7));return t}function qC(e){return e?.state===`billed`?e.plan:null}function JC(e){return e?.state===`billed`?e.subscription:null}function YC(e){let t=e?.limits,n=typeof t==`object`&&t&&!Array.isArray(t)?t.maxRequestsPerMonth:void 0,r=typeof n==`number`?n:typeof n==`string`&&n.trim().length>0?Number(n):NaN;return Number.isSafeInteger(r)&&r>=0?r:null}function XC(e){let t=YC(e);return t===null?`the ${e.planName} plan`:`the ${e.planName} plan (${jC(t)} requests/month)`}function ZC(e){return!e||e.state===`self_hosted`?null:e.state===`unavailable`?{tone:`destructive`,title:`Billing service unavailable`,description:`Gateway traffic may be interrupted. This usually resolves on its own.`,actionable:!1}:e.plan===null?{tone:`destructive`,title:`No active plan`,description:`Gateway traffic is being refused. Choose a plan to start serving it again.`,actionable:!0}:e.subscription?.subscriptionId&&e.plan.isDefault?{tone:`warning`,title:`Your subscription has ended`,description:`You’re on ${XC(e.plan)}. Resubscribe to restore your previous allowance.`,actionable:!0}:e.subscription?.status===`past_due`?{tone:`warning`,title:`Payment past due`,description:`Update your payment method to keep this plan.`,actionable:!0}:null}function QC(e){return!!(e&&!e.claimed&&e.expiresAt)}function $C(e){return!e||!QC(e)?null:{tone:`warning`,title:`Unclaimed free access`,description:`Your free access does not renew until you claim your account. Claim your account for free to keep your apps and usage. Free access ends ${rw(new Date(new Date(e.createdAt).getTime()+30*864e5).toISOString())}.`,actionable:!1}}function ew(e,t){if(!e)return null;let n=rw(e.resetAt),r=QC(t),i=n?`${r?`Ends`:`Resets`} ${n}`:r?`Free access end unavailable`:`Reset time unavailable`;if(e.limit===void 0||e.limit===null)return{used:e.used,limit:null,ratio:null,tone:`normal`,label:`${jC(e.used)} requests this period`,caption:i};let a=e.limit>0?Math.min(e.used/e.limit,1):1;return{used:e.used,limit:e.limit,ratio:a,tone:a>=1?`destructive`:a>=.8?`warning`:`normal`,label:`${jC(e.used)} of ${jC(e.limit)} requests`,caption:i}}function tw(e,t){let n=ew(e,t);return!n||n.ratio===null||n.tone===`normal`?null:n.ratio>=1?{tone:`destructive`,title:QC(t)?`Free request allowance spent`:`Monthly request allowance spent`,description:QC(t)?`This free allowance does not renew until you claim your account. Claim it to move onto a renewing monthly allowance. ${n.caption}.`:`Gateway requests are being refused until the allowance resets. ${n.caption}.`,actionable:!0}:{tone:`warning`,title:QC(t)?`Free request allowance almost spent`:`Monthly request allowance almost spent`,description:`${n.label} used in the current period. ${n.caption}.`,actionable:!0}}function nw(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function rw(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`})}function iw(e){return`${(e.priceAmountCents/100).toLocaleString(void 0,{style:`currency`,currency:e.priceCurrency||`USD`,minimumFractionDigits:e.priceAmountCents%100==0?0:2})}/${e.billingPeriod===`year`?`yr`:`mo`}`}function aw(e,t){return e.prices.find(e=>e.billingPeriod===t)}function ow(e){if(e.endsAt){let t=nw(e.endsAt);if(t)return{label:`Access ends`,value:t}}if(e.status===`on_trial`&&e.trialEndsAt){let t=nw(e.trialEndsAt);if(t)return{label:`Trial ends`,value:t}}if(e.renewsAt){let t=nw(e.renewsAt);if(t)return{label:`Renews`,value:t}}return null}var sw=new Set([`on_trial`,`active`,`paused`,`past_due`]);function cw(e){return!!(e&&e.subscriptionId&&e.source===`lemon_squeezy`&&sw.has(e.status))}function lw(e){return!!(e?.subscriptionId&&e.source===`lemon_squeezy`&&e.status===`cancelled`)}function uw(e){return aw(e,`month`)?.priceAmountCents??0}var dw=`This plan was granted manually. Ask support to change it.`;function fw(e,t,n){let r=qC(n);if(r&&e.planKey===r.planKey)return{intent:`current`,label:`Current plan`,variant:`outline`};let i=t.find(e=>e.planKey===r?.planKey),a=uw(e)>(i?uw(i):0),o=e.prices.length===0,s=a?`default`:`outline`,c=`${a?`Upgrade`:`Downgrade`} to ${e.name}`,l=JC(n);return l&&l.source===`manual`&&sw.has(l.status)?{intent:o?`cancel`:`change`,label:c,variant:s,reason:dw}:o?cw(l)?{intent:`cancel`,label:c,variant:s}:{intent:`cancel`,label:c,variant:s,reason:`There is no paid subscription to leave.`}:{intent:cw(l)?`change`:`checkout`,label:c,variant:s}}var pw=[{to:`/apps`,label:`Apps`,icon:Ca},{to:`/providers`,label:`Providers`,icon:Ma,sections:[{to:`/providers/gateways`,label:`Gateways`,icon:ta}]}];function mw({onNavigate:e}){let{capabilities:t,billing:n,quota:r,canManage:i,organization:a}=ox(),o=dt();if(!t.billing)return null;let s=qC(n),c=ew(r,a);if(!s&&!c)return null;let l=o.pathname===`/billing`,u=c!==null&&c.ratio!==null&&c.ratio>=.8,d=s===null||s.isDefault||u;return(0,I.jsxs)(`div`,{className:H(`rounded-lg px-3 py-2.5 transition-colors`,l?`bg-sidebar-accent text-sidebar-accent-foreground`:`bg-sidebar-accent/40`),children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate text-xs font-medium`,children:s?`${s.planName} plan`:`No plan`}),d?(0,I.jsx)(Pn,{to:`/billing`,onClick:e,"aria-current":l?`page`:void 0,className:H(`shrink-0 rounded-sm text-xs font-medium underline underline-offset-4 transition-colors`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,l?`text-sidebar-accent-foreground`:`text-primary-ink hover:text-foreground`),children:i?`Upgrade`:`View plan`}):null]}),c?(0,I.jsxs)(`div`,{className:`mt-1.5 space-y-1`,children:[(0,I.jsx)(`p`,{className:`tabular text-[11px] text-muted-foreground`,children:c.label}),(0,I.jsx)(Kb,{meter:c,className:`h-1`})]}):null]})}function hw(){return(0,I.jsxs)(Db,{children:[(0,I.jsx)(Ob,{asChild:!0,children:(0,I.jsxs)(Ib,{variant:`secondary`,className:`w-full justify-start gap-1.5 py-1`,children:[(0,I.jsx)(ya,{className:`size-3`}),`Read-only`]})}),(0,I.jsx)(kb,{side:`top`,children:nx})]})}function gw(e,t){let n=e?.trim()||t,r=n.split(/[\s@._-]+/).filter(Boolean);return(r.length>1?`${r[0][0]}${r[1][0]}`:n.slice(0,2)).toUpperCase()}function _w({onNavigate:e}){let t=ht(),{session:n,capabilities:r}=ox(),i=OS(),a=async()=>{await i.mutateAsync().catch(()=>void 0),await t(`/login`,{replace:!0})},o=n.user?.email??`Operator`,s=n.user?.name?.trim()||o;return(0,I.jsxs)(Lb,{children:[(0,I.jsxs)(Rb,{className:H(`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left transition-colors`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`grid size-8 shrink-0 place-items-center rounded-full bg-primary text-[11px] font-semibold text-primary-foreground`,children:gw(n.user?.name,o)}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 leading-tight`,children:[(0,I.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:s}),(0,I.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:o})]}),(0,I.jsx)(sa,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,I.jsxs)(zb,{side:`top`,align:`start`,sideOffset:8,className:`w-(--radix-dropdown-menu-trigger-width) min-w-56`,children:[(0,I.jsx)(Bb,{asChild:!0,children:(0,I.jsxs)(Pn,{to:`/settings`,onClick:e,children:[(0,I.jsx)(Ra,{className:`size-4`}),`Settings`]})}),(0,I.jsx)(Bb,{asChild:!0,children:(0,I.jsxs)(Pn,{to:`/keys`,onClick:e,children:[(0,I.jsx)(Sa,{className:`size-4`}),`Management keys`]})}),r.billing?(0,I.jsx)(Bb,{asChild:!0,children:(0,I.jsxs)(Pn,{to:`/billing`,onClick:e,children:[(0,I.jsx)(ga,{className:`size-4`}),`Billing`]})}):null,(0,I.jsx)(_C,{}),(0,I.jsx)(Wb,{}),(0,I.jsxs)(Bb,{disabled:i.isPending,onSelect:()=>void a(),children:[(0,I.jsx)(Ea,{className:`size-4`}),`Sign out`]})]})]})}function vw({to:e,label:t,icon:n,current:r,onNavigate:i,className:a}){return(0,I.jsxs)(Pn,{to:e,onClick:i,"aria-current":r?`page`:void 0,className:H(`flex h-10 items-center gap-2.5 rounded-lg px-3 text-sm font-medium transition-colors`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,r?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`,a),children:[n?(0,I.jsx)(n,{className:`size-4 shrink-0`}):null,(0,I.jsx)(`span`,{className:`truncate`,children:t})]})}function yw({onNavigate:e}){let t=dt();return(0,I.jsx)(`nav`,{className:`flex flex-1 flex-col gap-1 p-3`,children:pw.map(n=>{let r=t.pathname.startsWith(n.to),i=r?n.sections:void 0,a=r&&!i?.some(e=>e.to===t.pathname);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(vw,{to:n.to,label:n.label,icon:n.icon,current:a,onNavigate:e}),i?(0,I.jsx)(`div`,{className:`flex flex-col gap-1`,children:i.map(n=>(0,I.jsx)(vw,{to:n.to,label:n.label,icon:n.icon,current:t.pathname===n.to,onNavigate:e,className:`h-9 pr-3 pl-9.5`},n.to))}):null]},n.to)})})}function bw({back:e,title:t,badge:n,items:r,onNavigate:i}){let a=dt();return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-sidebar-border px-3 pb-3`,children:[(0,I.jsxs)(Pn,{to:e.to,onClick:i,className:H(`flex h-8 w-fit items-center gap-1.5 rounded-lg px-2 text-sm text-muted-foreground transition-colors`,`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:[(0,I.jsx)(Xi,{className:`size-3.5 shrink-0`}),e.label]}),(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1.5 px-2 pt-1 pb-1`,children:[(0,I.jsx)(`h1`,{className:`line-clamp-2 text-lg leading-snug font-semibold tracking-tight break-words`,children:t}),n]})]}),(0,I.jsx)(`nav`,{"aria-label":`${t} sections`,className:`flex flex-1 flex-col gap-1 overflow-y-auto p-3`,children:r.map(e=>(0,I.jsx)(vw,{to:e.to,label:e.label,icon:e.icon,current:a.pathname===e.to||a.pathname.startsWith(`${e.to}/`),onNavigate:i},e.to))})]})}function xw({appId:e,onNavigate:t}){let n=tC(e);return(0,I.jsx)(bw,{back:{to:`/apps`,label:`Apps`},title:n.data?.app.name??e,badge:n.data?(0,I.jsx)(vC,{status:n.data.app.status}):void 0,items:DC.map(t=>({to:`/apps/${e}/${t.slug}`,label:t.label,icon:t.icon})),onNavigate:t})}function Sw({onNavigate:e}){let{readOnly:t}=ox(),n=ft(`/apps/:appId/*`);return(0,I.jsxs)(`div`,{className:`flex h-full flex-col bg-sidebar text-sidebar-foreground`,children:[(0,I.jsxs)(`div`,{className:`flex h-14 items-center justify-between gap-2 px-3`,children:[(0,I.jsx)($b,{className:`px-1`,onClick:e}),(0,I.jsx)(EC,{})]}),n?.params.appId?(0,I.jsx)(xw,{appId:n.params.appId,onNavigate:e}):(0,I.jsx)(yw,{onNavigate:e}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 border-t border-sidebar-border p-3`,children:[(0,I.jsx)(mw,{onNavigate:e}),t?(0,I.jsx)(`div`,{className:`px-1 pb-1.5`,children:(0,I.jsx)(hw,{})}):null,(0,I.jsx)(_w,{onNavigate:e})]})]})}function Cw(){let{capabilities:e,billing:t,quota:n,organization:r}=ox(),i=dt(),a=e.billing?$C(r)??ZC(t)??tw(n,r):null;return!a||i.pathname===`/billing`?null:(0,I.jsxs)(Ds,{variant:a.tone===`destructive`?`destructive`:`default`,className:`mb-4`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:a.title}),(0,I.jsxs)(ks,{className:`flex flex-wrap items-center gap-3`,children:[(0,I.jsx)(`span`,{children:a.description}),a.actionable?(0,I.jsx)(Y,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(Pn,{to:`/billing`,children:`View plans`})}):null]})]})}function ww(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>t(!1),[dt().pathname]),(0,I.jsxs)(`header`,{className:`sticky top-0 z-30 flex h-14 items-center gap-2 border-b bg-background/80 px-3 backdrop-blur lg:hidden`,children:[(0,I.jsxs)(jb,{open:e,onOpenChange:t,children:[(0,I.jsx)(Mb,{asChild:!0,children:(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Open navigation`,children:(0,I.jsx)(Aa,{className:`size-4`})})}),(0,I.jsxs)(Nb,{side:`left`,className:`w-72 border-sidebar-border p-0`,showCloseButton:!1,children:[(0,I.jsx)(Pb,{className:`sr-only`,children:`Navigation`}),(0,I.jsx)(Sw,{onNavigate:()=>t(!1)})]})]}),(0,I.jsx)($b,{}),(0,I.jsx)(`div`,{className:`ml-auto`,children:(0,I.jsx)(EC,{})})]})}function Tw({children:e}){return(0,I.jsxs)(`div`,{className:`min-h-dvh bg-sidebar`,children:[(0,I.jsx)(`aside`,{className:`fixed inset-y-0 left-0 z-20 hidden w-64 lg:block`,children:(0,I.jsx)(Sw,{})}),(0,I.jsxs)(`div`,{className:`flex min-h-dvh flex-col lg:pl-64`,children:[(0,I.jsx)(ww,{}),(0,I.jsx)(`main`,{className:`min-w-0 flex-1 bg-background lg:my-2 lg:mr-2 lg:rounded-xl lg:border lg:shadow-sm`,children:(0,I.jsxs)(`div`,{className:`mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8`,children:[(0,I.jsx)(Cw,{}),e]})})]})]})}function Ew({reason:e,reasonId:t,className:n,children:r}){return(0,I.jsxs)(Db,{children:[(0,I.jsx)(Ob,{asChild:!0,children:(0,I.jsxs)(`span`,{tabIndex:0,className:H(`inline-flex w-fit cursor-not-allowed`,n),children:[r,t?(0,I.jsx)(`span`,{id:t,className:`sr-only`,children:e}):null]})}),(0,I.jsx)(kb,{children:e})]})}function Dw({reason:e,wrapperClassName:t,disabled:n,...r}){let{readOnly:i}=ox(),a=(0,v.useId)(),o=e??(i?`Your role is read-only. Ask an owner or admin to make this change.`:void 0);return o?(0,I.jsx)(Ew,{reason:o,reasonId:a,className:t,children:(0,I.jsx)(Y,{...r,disabled:!0,"aria-disabled":`true`,"aria-describedby":a})}):(0,I.jsx)(Y,{disabled:n,...r})}function Ow({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`skeleton`,className:H(`animate-pulse rounded-md bg-accent`,e),...t})}function kw({className:e,...t}){return(0,I.jsx)(G_,{"data-slot":`label`,className:H(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Aw({label:e,hint:t,htmlFor:n,className:r,children:i}){return(0,I.jsxs)(`div`,{className:H(`space-y-2`,r),children:[(0,I.jsx)(kw,{htmlFor:n,className:`text-sm`,children:e}),i,t?(0,I.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function jw({title:e,description:t,action:n}){return(0,I.jsxs)(`div`,{className:H(`flex flex-wrap justify-between gap-x-8 gap-y-3`,t?`items-start`:`items-center`),children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 basis-80 space-y-1`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:e}),t?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t}):null]}),n?(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:n}):null]})}function Mw({title:e,description:t,action:n}){return(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),t?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),n]})}function Nw({children:e}){return(0,I.jsx)(`div`,{className:`rounded-md border border-dashed px-4 py-6 text-center text-sm text-muted-foreground`,children:e})}var Pw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
52
- `,Fw=`<svg fill="currentColor" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"></path></svg>
53
- `,Iw=`<svg fill="#EB5424" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M21.98 7.448L19.62 0H4.347L2.02 7.448c-1.352 4.312.03 9.206 3.815 12.015L12.007 24l6.157-4.552c3.755-2.81 5.182-7.688 3.815-12.015l-6.16 4.58 2.343 7.45-6.157-4.597-6.158 4.58 2.358-7.433-6.188-4.55 7.63-.045L12.008 0l2.356 7.404 7.615.044z"></path></svg>
54
- `,Lw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>
55
- `,Rw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z" fill="#00C8D2" fill-rule="nonzero"></path><path d="M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z" fill="#3C8CFF" fill-rule="nonzero"></path><path d="M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z" fill="#78E6DC" fill-rule="nonzero"></path><path d="M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z" fill="#325AB4"></path></svg>
56
- `,zw=`<svg fill="currentColor" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>
57
- `,Bw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>
58
- `,Vw=`<svg fill="#6C47FF" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"></path></svg>
59
- `,Hw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
60
- `,Uw=`<svg height="1em" viewBox="0 0 32 32" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M19.62 11.558l-3.203 2.98-2.972-5.995 1.538-3.448c.4-.7 1.024-.692 1.414 0z" fill="#FFA000"></path><path d="M13.445 8.543l2.972 5.995-11.97 11.135z" fill="#F57F17"></path><path d="M23.123 7.003c.572-.55 1.164-.362 1.315.417l3.116 18.105-10.328 6.2c-.36.2-1.32.286-1.32.286s-.874-.104-1.207-.3L4.447 25.673z" fill="#FFCA28"></path><path d="M13.445 8.543l-8.997 17.13L8.455.638c.148-.78.592-.855.988-.167z" fill="#FFA000"></path></svg>
61
- `,Ww=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z" fill="#5019C5" fill-rule="evenodd"></path></svg>
62
- `,Gw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#brand-gemini-0)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#brand-gemini-1)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#brand-gemini-2)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="brand-gemini-0" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="brand-gemini-1" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="brand-gemini-2" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs></svg>
63
- `,Kw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
64
- `,qw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B"></path><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E"></path><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D"></path><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45"></path><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B"></path><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E"></path></svg>
65
- `,Jw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
66
- `,Yw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
67
- `,Xw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
68
- `,Zw=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path></svg>
69
- `,Qw=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z" fill="#22B8CD" fill-rule="nonzero"></path></svg>
70
- `,$w=`<svg fill="#F2545B" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M4.3036.3999c-1.5246 0-3.2129.1508-4.303.4136v14.9997c.3083.1722.8432.28 1.5632.28.7404 0 1.2553-.1072 1.5433-.28v-5.2323a14.8588 14.8588 0 0 0 2.121.1512h.3294l2.8604 5.0588c.432.195 1.0288.3024 1.9348.3024.8033 0 1.38-.1104 1.6476-.3024l-3.437-5.8358c1.4195-.8004 2.326-2.2698 2.326-4.4964C10.8894 1.827 8.4232.4 4.3037.4zm15.4543 0c-1.3788 0-2.624.2707-3.6901.7945-2.4552 1.203-3.9609 3.7376-3.9609 7.3627 0 4.8245 2.6552 7.7155 7.1659 7.7155.9 0 1.5868-.3014 2.005.2554.4194.5568-.3582 1.2165-.7746 1.5105-1.6338 1.1544-5.7217-.1024-9.4908-.4804C5.5994 17.015.9264 16.3009.146 19.1928c-.4104 1.5264.1225 2.5013.6421 3.0503 1.044 1.1046 2.882 1.357 4.344 1.357a13.959 13.959 0 0 0 2.0508-.1558 1.311 1.311 0 0 0 1.023-.8063c.1674-.4254.0861-.904-.212-1.2562a1.3464 1.3464 0 0 0-1.2352-.4523c-1.5012.2706-3.6213.8685-4.4343.0105-.2748-.291-.2268-1.0037 0-1.2257.6048-.8748 4.493-.5393 8.4127-.0293 4.329.4344 8.4023 1.8609 10.945.6351.9955-.48 2.318-1.1941 2.318-3.792h-.0012c0-1.1473-.1489-2.274-.4476-3.3797-1.3818.1872-2.4783.2857-3.2883.2941-2.845 0-4.869-1.4484-4.869-5.0963 0-3.648 2.0461-5.1573 5.0179-5.1573 1.2011 0 2.129.2512 3.1405.7336.1062-.9234-.1058-2.1605-.5906-2.8523-.78-.4608-2.0014-.6703-3.2038-.6703zM4.51 3.1889c2.0579 0 3.2108.7111 3.2108 2.4421 0 1.6824-1.0912 2.3554-2.8816 2.3554a10.2838 10.2838 0 0 1-1.7706-.1511V3.3166a7.7782 7.7782 0 0 1 1.4413-.1277z"></path></svg>
71
- `,eT=`<svg fill="none" height="1em" viewBox="0 0 109 113" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M63.708 110.284c-2.86 3.601-8.658 1.628-8.727-2.97L53.974 40.063h45.22c8.19 0 12.758 9.46 7.665 15.874z" fill="url(#brand-supabase-0)"></path><path d="M63.708 110.284c-2.86 3.601-8.658 1.628-8.727-2.97L53.974 40.063h45.22c8.19 0 12.758 9.46 7.665 15.874z" fill="url(#brand-supabase-1)" fill-opacity=".2"></path><path d="M45.317 2.071c2.86-3.601 8.658-1.628 8.726 2.97l.442 67.251H9.831c-8.19 0-12.759-9.46-7.666-15.875z" fill="#3ECF8E"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="brand-supabase-0" x1="53.974" x2="94.164" y1="54.974" y2="71.83"><stop stop-color="#249361"></stop><stop offset="1" stop-color="#3ECF8E"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="brand-supabase-1" x1="36.156" x2="54.484" y1="30.578" y2="65.081"><stop></stop><stop offset="1" stop-opacity="0"></stop></linearGradient></defs></svg>
72
- `,tT=`<svg height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path></svg>
73
- `,nT=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M12 0l12 20.785H0L12 0z"></path></svg>
74
- `,rT=`<svg fill="currentColor" fill-rule="evenodd" height="1em" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
75
- `,iT=[`openai`,`anthropic`,`xai`,`gemini`,`perplexity`,`deepseek`,`groq`,`mistral`,`together`,`fireworks`,`cerebras`,`moonshot`,`huggingface`,`baseten`,`bytedance`,`openrouter`],aT=[`responses`,`chat_completions`,`anthropic_messages`,`gemini_native`,`audio_transcription`,`other`],oT={responses:`v1/responses`,chat_completions:`v1/chat/completions`,anthropic_messages:`v1/messages`,gemini_native:`v1beta/models/{model}:generateContent`,audio_transcription:`v1/audio/transcriptions`},sT=[`responses`,`transcription`],cT={responses:`responses`,transcription:`audio_transcription`},lT=[`responses`,`chat_completions`,`gemini_native`,`anthropic`,`none`],uT={apiStyles:aT,endpointStyles:[]},dT={openai:{apiStyles:aT,endpointStyles:[`responses`,`transcription`]},xai:{apiStyles:aT,endpointStyles:[`responses`,`transcription`]},openrouter:{apiStyles:[`chat_completions`],endpointStyles:[]}};function fT(e){return dT[e]??uT}var pT=iT.filter(e=>fT(e).endpointStyles.length>0);function mT(e){return pT.filter(t=>fT(t).endpointStyles.includes(e))}var hT={openai:{slug:`openai`,stripPathPrefix:`v1/`},anthropic:{slug:`anthropic`},xai:{slug:`grok`},gemini:{slug:`google-ai-studio`},perplexity:{slug:`perplexity-ai`}},gT=[`responses`,`chat_completions`,`anthropic_messages`],_T=[`responses`];function vT(e){return{modelPrefix:e,apiStyles:gT,endpointStyles:_T}}var yT={cf_aig:hT,vercel:{openai:vT(`openai/`),anthropic:vT(`anthropic/`),gemini:vT(`google/`),xai:vT(`spacexai/`),perplexity:vT(`perplexity/`),deepseek:vT(`deepseek/`),moonshot:vT(`moonshotai/`)}},bT=[`openrouter`];function xT(e){return bT.includes(e)}var ST=iT,CT={openai:`OpenAI`,anthropic:`Anthropic`,xai:`xAI`,gemini:`Gemini`,perplexity:`Perplexity`,deepseek:`DeepSeek`,groq:`Groq`,mistral:`Mistral`,together:`Together AI`,fireworks:`Fireworks AI`,cerebras:`Cerebras`,moonshot:`Moonshot AI`,huggingface:`Hugging Face`,baseten:`Baseten`,bytedance:`ByteDance Ark`,openrouter:`OpenRouter`},wT={cf_aig:`Cloudflare AI Gateway`,vercel:`Vercel AI Gateway`},TT=[{value:`cf_aig`,label:wT.cf_aig,defaultName:`Our CF gateway`,tokenDocsUrl:`https://developers.cloudflare.com/ai-gateway/configuration/authentication/`,needsCloudflareIds:!0,credentialNote:`Requests use the provider keys stored in your Cloudflare AI Gateway's own key store.`},{value:`vercel`,label:wT.vercel,defaultName:`Our Vercel gateway`,tokenDocsUrl:`https://vercel.com/docs/ai-gateway/authentication-and-byok/api-keys`,needsCloudflareIds:!1,credentialNote:`Your provider credential stored in Vercel is preferred. Vercel may fall back to system credentials.`}],ET=lT,DT=`x-end-user-id`;function OT(e,t){let n=Object.keys(t?.[e.type]??{}),r=Object.keys(e.pricing??{});return[...n,...r.filter(e=>!n.includes(e))]}var kT=mT;function AT(e,t,n){let r=kT(e);return t.filter(t=>r.includes(t.type)&&(n?.(t,e)??!0))}var jT=/^[a-z0-9-]{1,64}$/,MT=e=>e.end_user?.source===`issuer`?e.end_user.issuer:void 0;function NT(){return{provider:`firebase`,jwks_url:``,issuer:``,audience:``,user_id_claim:`sub`,required_claims:[],max_token_lifetime_seconds:86400}}function PT(e,t){if(e.type===`apple_app_attest`)return{...e,end_user:{source:`issuer`,issuer:t??MT(e)??NT()}};if(!t){let{end_user:t,...n}=e;return n}return{...e,end_user:{source:`issuer`,issuer:t}}}var FT=e=>typeof e==`string`?{path:e}:e;function IT(e){return!e.fixed_model&&(!e.clamp||e.clamp===void 0)?e.path:{path:e.path,...e.fixed_model?{fixed_model:e.fixed_model}:{},...e.clamp?{clamp:e.clamp}:{}}}function LT(){return{allowed_paths:[],allowed_models:[]}}function RT(e=`openai`){return{api_style:`responses`,provider:e,model:``}}function zT(e,t=`endpoint`){if(e[t]===void 0)return t;for(let n=2;n<1e3;n+=1){let r=`${t}-${n}`;if(e[r]===void 0)return r}return`${t}-${Date.now()}`}function BT(e,t,n){return Object.fromEntries(Object.entries(e).map(([e,r])=>[e===t?n:e,r]))}function VT(e,t,n){return jT.test(e)?e!==n&&t[e]!==void 0?`Another endpoint already uses this slug`:null:`Use 1-64 characters from a-z, 0-9, and -`}function HT(e){return e.providers.mode}function UT(e){if(HT(e)===`all`)return[];let t=e.providers.selected??{};return Object.keys(t).filter(e=>t[e]!==void 0)}function WT(e){return ST.includes(e)}function GT(e){return Object.hasOwn(wT,e)}function KT(e,t){if(HT(e)===`all`)return[...ST];let n=new Map(t.map(e=>[e.slug,e.type])),r=new Set(UT(e).flatMap(e=>{let t=n.get(e);return t?[t]:WT(e)?[e]:[]}));return ST.filter(e=>r.has(e))}var qT=`size-full text-current`;function JT(e){return e.trim().replace(`<svg`,`<svg class="${qT}"`)}function YT(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,JT(t)]))}var XT=YT({openai:Xw,anthropic:Pw,xai:rT,gemini:Gw,perplexity:Qw,deepseek:Hw,groq:Kw,mistral:Jw,together:tT,fireworks:Ww,cerebras:zw,moonshot:Yw,huggingface:qw,baseten:Lw,bytedance:Rw,openrouter:Zw}),ZT=YT({cf_aig:Bw,vercel:nT}),QT=YT({firebase:Uw,supabase:eT,auth0:Iw,clerk:Vw,apple:Fw,revenuecat:$w});function $T(e){return Object.hasOwn(QT,e)}function eE({svg:e,className:t}){return(0,I.jsx)(`span`,{"aria-hidden":!0,className:H(`inline-flex size-[1.15em] shrink-0`,t),dangerouslySetInnerHTML:{__html:e}})}function tE({type:e,className:t}){return(0,I.jsx)(eE,{svg:XT[e],className:t})}function nE({type:e,className:t}){return(0,I.jsx)(eE,{svg:ZT[e],className:t})}function rE({type:e,className:t}){return(0,I.jsx)(eE,{svg:QT[e],className:t})}function iE({type:e,className:t}){return(0,I.jsxs)(`span`,{className:H(`inline-flex items-center gap-1.5`,t),children:[(0,I.jsx)(tE,{type:e}),CT[e]]})}function aE({type:e,className:t}){return(0,I.jsxs)(`span`,{className:H(`inline-flex items-center gap-1.5`,t),children:[(0,I.jsx)(nE,{type:e}),wT[e]]})}function oE(e,t){if(HT(e)===`all`)return[];let n=t.filter(e=>e.status===`active`),r=new Set(n.map(e=>e.type));return KT(e,n).filter(e=>!r.has(e))}function sE({proxy:e}){let t=PS();if(!t.data)return null;let n=oE(e,t.data.providers);return n.length===0?null:(0,I.jsxs)(Ds,{children:[(0,I.jsx)(ca,{}),(0,I.jsxs)(Os,{children:[`No credential for`,` `,n.map((e,t)=>(0,I.jsxs)(v.Fragment,{children:[t>0?`, `:null,(0,I.jsx)(iE,{type:e,className:`align-middle`})]},e))]}),(0,I.jsxs)(ks,{children:[`This app allows`,` `,n.length===1?`a provider`:`providers`,` you have not configured, so those requests fail with `,(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:`provider_not_configured`}),`.`,` `,(0,I.jsx)(Pn,{to:`/providers`,className:`text-primary-ink underline underline-offset-4`,children:`Add a provider key`}),`.`]})]})}function cE({...e}){return(0,I.jsx)(mv,{"data-slot":`select`,...e})}function lE({...e}){return(0,I.jsx)(vv,{"data-slot":`select-value`,...e})}function uE({className:e,size:t=`default`,children:n,...r}){return(0,I.jsxs)(gv,{"data-slot":`select-trigger`,"data-size":t,className:H(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,I.jsx)(yv,{asChild:!0,children:(0,I.jsx)(ia,{className:`size-4 opacity-50`})})]})}function dE({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,I.jsx)(Sv,{children:(0,I.jsxs)(wv,{"data-slot":`select-content`,className:H(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,I.jsx)(mE,{}),(0,I.jsx)(Iv,{className:H(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,I.jsx)(hE,{})]})})}function fE({className:e,children:t,...n}){return(0,I.jsxs)(Hv,{"data-slot":`select-item`,className:H(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(Kv,{children:(0,I.jsx)(ra,{className:`size-4`})})}),(0,I.jsx)(Wv,{children:t})]})}function pE({className:e,...t}){return(0,I.jsx)(Qv,{"data-slot":`select-separator`,className:H(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}function mE({className:e,...t}){return(0,I.jsx)(Jv,{"data-slot":`select-scroll-up-button`,className:H(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(oa,{className:`size-4`})})}function hE({className:e,...t}){return(0,I.jsx)(Xv,{"data-slot":`select-scroll-down-button`,className:H(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(ia,{className:`size-4`})})}function gE({value:e,onChange:t,months:n=12}){let r=KC(n);return(0,I.jsxs)(cE,{value:e,onValueChange:t,children:[(0,I.jsx)(uE,{className:`w-[180px]`,size:`sm`,"aria-label":`Month`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:r.map(e=>(0,I.jsx)(fE,{value:e,children:GC(e)},e))})]})}var _E=[{value:`7`,label:`Last 7 days`},{value:`30`,label:`Last 30 days`},{value:`90`,label:`Last 90 days`}];function vE({value:e,onChange:t}){return(0,I.jsxs)(cE,{value:e,onValueChange:t,children:[(0,I.jsx)(uE,{className:`w-[150px]`,size:`sm`,"aria-label":`Date range`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:_E.map(e=>(0,I.jsx)(fE,{value:e.value,children:e.label},e.value))})]})}function yE(e){return{name:e.name,config:e.config,status:e.status}}var bE=e=>e;function xE(e){let t=tC(e),n=nC(e),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),d=(0,v.useRef)(null),f=t.data?.app;(0,v.useEffect)(()=>{if(!f||l===e&&r!==null&&a!==null&&JSON.stringify(r)!==a)return;let t=yE(f);d.current=MT(t.config.authentication)??null,i(t),o(JSON.stringify(t)),c(f.revision),u(e)},[e,f]);let p=l===e?r:null,m=l===e?a:null,h=p!==null&&m!==null&&JSON.stringify(p)!==m,g=(0,v.useCallback)(e=>{i(t=>t&&{...t,...e})},[]),_=(0,v.useCallback)(e=>{i(t=>t&&{...t,config:{...t.config,...e}})},[]);return{query:t,draft:p,dirty:h,update:g,updateConfig:_,updateAuthentication:(0,v.useCallback)(e=>{_({authentication:e})},[_]),updateIssuer:(0,v.useCallback)(e=>{i(t=>{if(!t)return t;let n=t.config.authentication,r=MT(n)??(n.type===`apple_app_attest`?NT():void 0);return r?{...t,config:{...t.config,authentication:PT(n,{...r,...e})}}:t})},[]),setEndUserSource:(0,v.useCallback)(e=>{i(t=>{if(!t)return t;let n=t.config.authentication,r=MT(n);r&&(d.current=r);let i=e===`issuer`?PT(n,r??d.current??NT()):e===`app_install`?n.type===`apple_app_attest`?{...n,end_user:{source:`app_install`}}:n:e===`header`?n.type===`api_key`?{...n,end_user:{source:`header`,header:n.end_user?.source===`header`?n.end_user.header:DT}}:n:PT(n,void 0),a=i.type!==`api_key`||i.end_user!==void 0||t.config.limits===void 0?t.config:{...t.config,limits:{...t.config.limits,per_user:{requests:{per_minute:null,per_day:null},spending:{monthly_usd:null}}}};return{...t,config:{...a,authentication:i}}})},[]),updateEndUserHeader:(0,v.useCallback)(e=>{i(t=>{if(!t)return t;let n=t.config.authentication;return n.type!==`api_key`||n.end_user?.source!==`header`?t:{...t,config:{...t.config,authentication:{...n,end_user:{source:`header`,header:e}}}}})},[]),updateProxy:(0,v.useCallback)(e=>{i(t=>t&&{...t,config:{...t.config,routing:{...t.config.routing,...e}}})},[]),updateLimits:(0,v.useCallback)(e=>_({limits:e}),[_]),updateEndpoints:(0,v.useCallback)(e=>{i(t=>{if(!t)return t;let{endpoints:n,...r}=t.config;return{...t,config:Object.keys(e).length===0?r:{...r,endpoints:e}}})},[]),reset:(0,v.useCallback)(()=>{if(!m)return;let e=JSON.parse(m);d.current=MT(e.config.authentication)??null,i(e)},[m]),save:(0,v.useCallback)(async()=>{if(!p||s===null)return!1;try{let e=await n.mutateAsync({body:bE(p),revision:s});return c(e.app.revision),o(JSON.stringify(p)),U.success(`Configuration saved`,{description:`The gateway picks it up within the 60 second config cache TTL.`}),!0}catch(e){return U.error(`Save rejected`,{description:e instanceof Error?e.message:`Unknown error`}),!1}},[p,s,n]),saving:n.isPending}}function SE(e){let t=e=>Array.isArray(e)?e.length>0&&e.every(Boolean):!!e;return(e.jwks_url??``).startsWith(`https://`)&&t(e.issuer)&&t(e.audience)}function CE(e){return e.path.trim()?e.equals===void 0?Array.isArray(e.contains)?e.contains.length>0&&e.contains.every(e=>e.trim().length>0):!!e.contains?.trim():String(e.equals).length>0:!1}function wE(e){let t=e.config.authentication;if(!e.name.trim())return`Give the app a name.`;if(t.type===`apple_app_attest`){let{team_id:e,bundle_id:n}=t.app_attest;if(!e.trim()||!n.trim())return`Enter the Apple Team ID and Bundle ID.`}if(t.type===`api_key`&&t.end_user?.source===`header`&&!t.end_user.header.trim())return`Enter the header name.`;let n=MT(t);if(n){if(!SE(n))return`Finish the identity provider details.`;if(!(n.required_claims??[]).every(CE))return`Finish the subscription check.`}return null}function TE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card`,className:H(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function EE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-header`,className:H(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function DE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-title`,className:H(`leading-none font-semibold`,e),...t})}function OE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function kE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`card-content`,className:H(`px-6`,e),...t})}function AE({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,I.jsx)(`table`,{"data-slot":`table`,className:H(`w-full caption-bottom text-sm [--table-inset:1.5rem]`,`[&_tr>*:first-child]:pl-(--table-inset) [&_tr>*:last-child]:pr-(--table-inset)`,e),...t})})}function jE({className:e,...t}){return(0,I.jsx)(`thead`,{"data-slot":`table-header`,className:H(`[&_tr]:border-b`,e),...t})}function ME({className:e,...t}){return(0,I.jsx)(`tbody`,{"data-slot":`table-body`,className:H(`[&_tr:last-child]:border-0`,e),...t})}function NE({className:e,...t}){return(0,I.jsx)(`tr`,{"data-slot":`table-row`,className:H(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Z({className:e,...t}){return(0,I.jsx)(`th`,{"data-slot":`table-head`,className:H(`h-11 px-3 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function Q({className:e,...t}){return(0,I.jsx)(`td`,{"data-slot":`table-cell`,className:H(`px-3 py-2.5 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function PE({label:e,value:t,detail:n}){return(0,I.jsx)(TE,{className:`gap-0 py-4`,children:(0,I.jsxs)(kE,{className:`px-4`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),(0,I.jsx)(`p`,{className:`tabular mt-1.5 text-2xl leading-none font-semibold`,children:t}),n?(0,I.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:n}):null]})})}function FE(e){return e==null?`—`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:e<36e5?`${Math.round(e/6e4)} min`:`${(e/36e5).toFixed(1)} h`}function IE(e){let t=new Map,n=(e,n,r,i,a)=>{let o=t.get(e)??{outcome:n,reason:r,days:new Map};o.days.set(i,(o.days.get(i)??0)+a),t.set(e,o)};for(let t of e?.daily??[])t.outcome!==`ok`&&n(`auth:${t.outcome}:${t.reason??``}`,t.outcome,t.reason,t.date,t.count);for(let t of e?.usage_failures??[])n(`proxy:${t.status}`,t.status,`proxied request`,t.date,t.count);return[...t.values()].map(e=>({outcome:e.outcome,reason:e.reason,total:[...e.days.values()].reduce((e,t)=>e+t,0),days:[...e.days.entries()].map(([e,t])=>({date:e,count:t})).sort((e,t)=>e.date<t.date?-1:+(e.date>t.date))})).sort((e,t)=>t.total-e.total||(e.outcome<t.outcome?-1:+(e.outcome>t.outcome)))}var LE=[`issuer_claims_missing`,`issuer_token_rejected`,`issuer_verification_unavailable`,`attest_failed`,`auth_required`,`ok`];function RE({appId:e}){let[t,n]=(0,v.useState)(`30`),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)([]),s=mC(e,Number(t)),c=hC(e,{limit:25,outcome:r===`all`?void 0:r,before_id:a.at(-1)}),l=(0,v.useMemo)(()=>IE(s.data),[s.data]),u=s.data?.claim_delay,d=s.data?.pending_users??0;return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(PE,{label:`Exchange success`,value:NC(s.data?.token_exchange.success_rate),detail:`${jC(s.data?.token_exchange.total??0)} attempts`}),(0,I.jsx)(PE,{label:`Claim delay p50`,value:FE(u?.p50_ms),detail:`${jC(u?.count??0)} measured`}),(0,I.jsx)(PE,{label:`Claim delay p95`,value:FE(u?.p95_ms),detail:`avg ${FE(u?.avg_ms)}`}),(0,I.jsx)(PE,{label:`Pending activations`,value:jC(d),detail:d>0?`waiting on a claim now`:`none waiting`})]}),(0,I.jsxs)(TE,{className:`py-0`,children:[(0,I.jsx)(EE,{className:`pt-6`,children:(0,I.jsx)(Mw,{title:`Failures by cause`,description:`Refused authentication attempts and non-ok proxied requests, busiest first.`,action:(0,I.jsx)(vE,{value:t,onChange:n})})}),(0,I.jsx)(kE,{className:`px-0 pb-0`,children:s.isPending?(0,I.jsx)(`div`,{className:`px-6 pb-6`,children:(0,I.jsx)(Ow,{className:`h-24 w-full`})}):l.length===0?(0,I.jsx)(`div`,{className:`px-6 pb-6`,children:(0,I.jsx)(Nw,{children:`No failed requests in this range.`})}):(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{className:`hover:bg-transparent`,children:[(0,I.jsx)(Z,{children:`Outcome`}),(0,I.jsx)(Z,{children:`Reason`}),(0,I.jsx)(Z,{className:`text-right`,children:`Count`}),(0,I.jsx)(Z,{className:`text-right`,children:`Days affected`}),(0,I.jsx)(Z,{children:`Last seen`})]})}),(0,I.jsx)(ME,{children:l.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{children:(0,I.jsx)(CC,{outcome:e.outcome})}),(0,I.jsx)(Q,{className:`font-mono text-xs text-muted-foreground`,children:e.reason??`—`}),(0,I.jsx)(Q,{className:`tabular text-right`,children:jC(e.total)}),(0,I.jsx)(Q,{className:`tabular text-right`,children:jC(e.days.length)}),(0,I.jsx)(Q,{className:`text-xs whitespace-nowrap text-muted-foreground`,children:e.days.at(-1)?.date??`—`})]},`${e.outcome}-${e.reason??``}`))})]})})]}),(0,I.jsxs)(TE,{className:`py-0`,children:[(0,I.jsx)(EE,{className:`pt-6`,children:(0,I.jsx)(Mw,{title:`Recent attempts`,description:`Every token exchange and key registration, newest first.`,action:(0,I.jsxs)(cE,{value:r,onValueChange:e=>{i(e),o([])},children:[(0,I.jsx)(uE,{className:`w-[210px]`,size:`sm`,"aria-label":`Outcome`,children:(0,I.jsx)(lE,{})}),(0,I.jsxs)(dE,{children:[(0,I.jsx)(fE,{value:`all`,children:`All outcomes`}),LE.map(e=>(0,I.jsx)(fE,{value:e,children:e},e))]})]})})}),(0,I.jsxs)(kE,{className:`px-0 pb-0`,children:[(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{className:`hover:bg-transparent`,children:[(0,I.jsx)(Z,{children:`When`}),(0,I.jsx)(Z,{children:`User`}),(0,I.jsx)(Z,{children:`Call`}),(0,I.jsx)(Z,{children:`Outcome`}),(0,I.jsx)(Z,{children:`Reason`}),(0,I.jsx)(Z,{children:`App version`}),(0,I.jsx)(Z,{className:`text-right`,children:`Latency`}),(0,I.jsx)(Z,{className:`text-right`,children:`Claim delay`})]})}),(0,I.jsx)(ME,{children:c.isPending?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:8,children:(0,I.jsx)(Ow,{className:`h-8 w-full`})})}):c.data?.events.length===0?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:8,className:`py-8 text-center text-sm text-muted-foreground`,children:`No attempts.`})}):c.data?.events.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{className:`text-xs whitespace-nowrap text-muted-foreground`,children:LC(e.created_at)}),(0,I.jsx)(Q,{className:`font-mono text-xs`,children:e.user_id??(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`unknown`})}),(0,I.jsxs)(Q,{className:`font-mono text-xs text-muted-foreground`,children:[e.event,e.auth_method?(0,I.jsx)(`span`,{className:`block`,children:e.auth_method}):null]}),(0,I.jsx)(Q,{children:(0,I.jsx)(CC,{outcome:e.outcome})}),(0,I.jsx)(Q,{className:`font-mono text-xs text-muted-foreground`,children:e.reason??`—`}),(0,I.jsx)(Q,{className:`font-mono text-xs text-muted-foreground`,children:e.app_version??`—`}),(0,I.jsx)(Q,{className:`tabular text-right text-xs`,children:e.latency_ms===null?`—`:`${jC(e.latency_ms)} ms`}),(0,I.jsx)(Q,{className:`tabular text-right text-xs`,children:e.claim_delay_ms===null?`—`:(0,I.jsx)(`span`,{className:`text-amber-600 dark:text-amber-400`,title:`This exchange ended a wait for an entitlement claim to propagate.`,children:FE(e.claim_delay_ms)})})]},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t px-6 py-3`,children:[(0,I.jsx)(Y,{variant:`outline`,size:`sm`,disabled:a.length===0,onClick:()=>o(e=>e.slice(0,-1)),children:`Newer`}),(0,I.jsx)(Y,{variant:`outline`,size:`sm`,disabled:!c.data?.next_before_id,onClick:()=>o(e=>[...e,c.data.next_before_id]),children:`Older`})]})]})]})]})}function $({className:e,type:t,...n}){return(0,I.jsx)(`input`,{type:t,"data-slot":`input`,className:H(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function zE({className:e,...t}){return(0,I.jsx)(jf,{"data-slot":`checkbox`,className:H(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,I.jsx)(Nf,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,I.jsx)(ra,{className:`size-3.5`})})})}var BE=[{value:`production`,label:`Production`,hint:`Builds signed for TestFlight and the App Store.`},{value:`development`,label:`Development`,hint:`Builds run from Xcode, which attest in Apple's development environment.`}];function VE({value:e,onChange:t,compact:n=!1,disabled:r=!1}){let i=e??[`production`],a=i.includes(`development`),o=(e,n)=>{let r=BE.map(e=>e.value).filter(t=>t===e?n:i.includes(t));r.length!==0&&t(r)};return(0,I.jsx)(Aw,{label:`iOS app environment`,hint:n?void 0:`Which of Apple's two environments this app accepts attestations from. Removing one also stops the keys it already registered.`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[BE.map(e=>{let t=i.includes(e.value);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(zE,{id:`env-${e.value}`,checked:t,disabled:r||t&&i.length===1,onCheckedChange:t=>o(e.value,t===!0)}),(0,I.jsxs)(`div`,{className:`-mt-0.5`,children:[(0,I.jsx)(kw,{htmlFor:`env-${e.value}`,className:`text-sm font-normal`,children:e.label}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]})]},e.value)}),a&&!n?(0,I.jsxs)(`p`,{className:`flex items-start gap-2 rounded-md bg-amber-500/[0.08] p-2.5 text-xs leading-relaxed text-amber-700 dark:text-amber-400`,children:[(0,I.jsx)(Ka,{className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:`Any device carrying your team's provisioning profile can attest against this app. Keep this on a development bundle id rather than the one you ship.`})]}):null]})})}function HE({label:e,choices:t,value:n,disabled:r=!1,describedBy:i,onChange:a}){return(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":e,"aria-describedby":i,className:`space-y-1`,children:t.map(e=>{let t=e.value===n;return(0,I.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,disabled:r,onClick:()=>a(e.value),className:H(`flex w-full items-start gap-3.5 rounded-lg px-3 py-3 text-left transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,r?`cursor-not-allowed opacity-60`:`hover:bg-muted/50`),children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:H(`mt-0.5 flex size-4.5 shrink-0 items-center justify-center rounded-full border transition-colors`,t?`border-primary`:`border-muted-foreground/50`),children:t?(0,I.jsx)(`span`,{className:`size-2.5 rounded-full bg-primary`}):null}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),(0,I.jsx)(`span`,{className:`mt-0.5 block text-sm text-muted-foreground`,children:e.description})]})]},e.value)})})}function UE({href:e,children:t}){return(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 underline decoration-border underline-offset-4 transition-colors hover:text-foreground hover:decoration-foreground`,children:[t,(0,I.jsx)(va,{className:`size-3`})]})}function WE({label:e,presets:t,selected:n,values:r,onSelect:i,onValueChange:a,idPrefix:o,compact:s=!1,disabled:c=!1}){let l=!s&&`warning`in n?n.warning:void 0,u=!s&&`note`in n?n.note:void 0,d=`docs`in n?n.docs:void 0,f=n.vendor??n.label;return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`${o}-preset`,children:e}),(0,I.jsxs)(cE,{value:n.id,disabled:c,onValueChange:e=>{let n=t.find(t=>t.id===e);n&&i(n)},children:[(0,I.jsx)(uE,{id:`${o}-preset`,className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:t.map(e=>(0,I.jsx)(fE,{value:e.id,children:(0,I.jsx)(GE,{preset:e})},e.id))})]}),n.description?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description}):null]}),n.inputs.map(e=>(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`${o}-${e.key}`,children:e.label}),(0,I.jsx)($,{id:`${o}-${e.key}`,value:r[e.key]??``,placeholder:e.placeholder,className:`font-mono text-xs`,disabled:c,onChange:t=>a(e.key,t.target.value)}),e.hint||e.docs?(0,I.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.hint,e.docs?(0,I.jsxs)(I.Fragment,{children:[e.hint?` `:null,(0,I.jsx)(UE,{href:e.docs.href,children:e.docs.label})]}):null]}):null]},e.key)),l?(0,I.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs leading-relaxed text-amber-700 dark:text-amber-400`,children:[(0,I.jsx)(Ka,{className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:l})]}):null,u?(0,I.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:u}):null,d?(0,I.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground`,children:[f,` documentation`,(0,I.jsx)(va,{className:`size-3`})]}):null]})}function GE({preset:e,className:t}){return(0,I.jsxs)(`span`,{className:H(`inline-flex items-center gap-1.5`,t),children:[$T(e.id)?(0,I.jsx)(rE,{type:e.id}):null,e.id===`custom`?(0,I.jsx)(ea,{"aria-hidden":!0,className:`size-[1.15em] shrink-0 text-current`,strokeWidth:1.8}):null,e.label]})}var KE=e=>e.replace(/^https?:\/\//u,``).replace(/\/+$/u,``);function qE(e,t){return Object.fromEntries(e.inputs.map(e=>[e.key,(t[e.key]??``).trim()]))}var JE=(e,t)=>e.build(qE(e,t)),YE=(e,t)=>e.build(qE(e,t)),XE=[{id:`firebase`,label:`Firebase Authentication`,vendor:`Firebase`,description:`Google-signed ID tokens. Scoped to your project by the aud and iss claims.`,inputs:[{key:`project_id`,label:`Firebase project id`,placeholder:`my-app-1a2b3`,hint:`Found in Project settings. Not the project number.`}],warning:`Firebase signs every project's tokens with one shared key set, so the JWKS URL alone identifies nobody. The issuer and audience below are what scope this app to your project — without them the gateway would accept a token from any Firebase project in the world.`,docs:`https://firebase.google.com/docs/auth/admin/verify-id-tokens`,build:({project_id:e})=>({jwks_url:`https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com`,issuer:`https://securetoken.google.com/${e}`,audience:e,user_id_claim:`sub`,required_claims:[]}),read:({audience:e})=>({project_id:e})},{id:`supabase`,label:`Supabase Auth`,vendor:`Supabase`,description:`Per-project JWKS. Requires asymmetric signing keys.`,inputs:[{key:`project_ref`,label:`Project ref`,placeholder:`abcdefghijklmnop`,hint:`The subdomain of your project URL: https://<ref>.supabase.co`}],warning:`Only projects migrated to asymmetric JWT signing keys can be verified. A legacy HS256 project publishes no public keys, so its JWKS endpoint returns an empty set and every token is rejected.`,docs:`https://supabase.com/docs/guides/auth/signing-keys`,build:({project_ref:e})=>{let t=KE(e).replace(/\.supabase\.co$/u,``);return{jwks_url:`https://${t}.supabase.co/auth/v1/.well-known/jwks.json`,issuer:`https://${t}.supabase.co/auth/v1`,audience:`authenticated`,user_id_claim:`sub`,required_claims:[]}},read:({issuer:e})=>({project_ref:KE(e).replace(/\.supabase\.co\/auth\/v1$/u,``)})},{id:`auth0`,label:`Auth0`,vendor:`Auth0`,description:`Per-tenant JWKS, with the API identifier as the audience.`,inputs:[{key:`domain`,label:`Tenant domain`,placeholder:`my-tenant.us.auth0.com`,hint:`Your Auth0 domain or custom domain, without https://`},{key:`audience`,label:`API identifier`,placeholder:`https://api.my-app.com`,hint:`The Identifier of the API you registered in Auth0. It is not a URL that has to resolve.`}],warning:`Auth0 puts a trailing slash in the iss claim. The preset writes it for you; do not remove it or every token is rejected.`,docs:`https://auth0.com/docs/secure/tokens/access-tokens/validate-access-tokens`,build:({domain:e,audience:t})=>{let n=KE(e);return{jwks_url:`https://${n}/.well-known/jwks.json`,issuer:`https://${n}/`,audience:t,user_id_claim:`sub`,required_claims:[]}},read:({issuer:e,audience:t})=>({domain:KE(e),audience:t})},{id:`clerk`,label:`Clerk`,vendor:`Clerk`,description:`Session tokens verified against your Frontend API JWKS.`,inputs:[{key:`frontend_api`,label:`Frontend API host`,placeholder:`clean-mayfly-62.clerk.accounts.dev`,hint:`Your Clerk Frontend API URL or custom domain, without https://`},{key:`audience`,label:`Audience`,placeholder:`my-app`,hint:`The aud your Clerk JWT template sets. Clerk's default session token has none — add one in the template, because the gateway requires it.`}],warning:`Clerk's own guidance also checks the azp claim against your permitted origins. This gateway serves native apps, where there is no origin to bind to, so the preset omits it — add an azp requirement manually if your tokens carry one.`,docs:`https://clerk.com/docs/guides/sessions/manual-jwt-verification`,build:({frontend_api:e,audience:t})=>{let n=KE(e);return{jwks_url:`https://${n}/.well-known/jwks.json`,issuer:`https://${n}`,audience:t,user_id_claim:`sub`,required_claims:[]}},read:({issuer:e,audience:t})=>({frontend_api:KE(e),audience:t})},{id:`custom`,label:`Custom issuer`,description:`Any issuer publishing a JWKS document over HTTPS.`,inputs:[{key:`jwks_url`,label:`JWKS URL`,placeholder:`https://issuer.example.com/.well-known/jwks.json`,hint:`If this issuer signs tokens for more than one service, add a claim requirement under Subscription check too.`},{key:`issuer`,label:`Issuer (iss)`,placeholder:`https://issuer.example.com`,hint:`Exactly the iss claim your tokens carry, trailing slash included.`},{key:`audience`,label:`Audience (aud)`,placeholder:`https://api.my-app.com`,hint:`Exactly one aud value your tokens carry.`}],build:({jwks_url:e,issuer:t,audience:n})=>({jwks_url:e,issuer:t,audience:n,user_id_claim:`sub`,required_claims:[]}),read:e=>({...e})}],ZE=XE.find(e=>e.id===`custom`),QE=e=>XE.find(t=>t.id===e)??ZE;function $E(e){let t=e=>Array.isArray(e)?e[0]??``:e??``;return{jwks_url:e.jwks_url??``,issuer:t(e.issuer),audience:t(e.audience)}}function eD(e){let t=$E(e);if(e.provider){let n=QE(e.provider);return{preset:n,values:n.read(t)}}let n={preset:ZE,values:{...t}},r=e=>Array.isArray(e)&&e.length>1;if(r(e.issuer)||r(e.audience))return n;for(let e of XE){if(e===ZE)continue;let n=e.read(t);if(!oD(e,n))continue;let r=JE(e,n);if(r.jwks_url===t.jwks_url&&r.issuer===t.issuer&&r.audience===t.audience)return{preset:e,values:n}}return n}var tD=`revenueCatEntitlements`;function nD(e){let t=e.split(`,`).map(e=>e.trim());return{path:tD,contains:t.length>1?t:e}}function rD(e){if(e.length===0)return``;let[t,...n]=e;return!t||n.length>0||t.contains===void 0?null:Array.isArray(t.contains)?t.contains.join(`, `):t.contains}var iD=`Which claim says the user has paid`,aD=[{id:`none`,label:`No entitlement check`,description:`Any user the issuer signs a token for may call the gateway.`,inputs:[],build:()=>[]},{id:`revenuecat`,label:`RevenueCat entitlement`,vendor:`RevenueCat`,inputs:[{key:`entitlement`,label:`Entitlement identifier`,placeholder:`pro`,hint:`In RevenueCat, under Product catalog → Entitlements: the identifier, not the display name. Several, comma separated, admit a user carrying any one of them.`,docs:{href:`https://www.revenuecat.com/docs/getting-started/entitlements`,label:`RevenueCat documentation`}}],build:({entitlement:e})=>e?[nD(e)]:[]},{id:`custom`,label:`Custom claim`,description:`Any single claim requirement. More can be added under Subscription check.`,inputs:[{key:`path`,label:`Claim path`,placeholder:`scope`},{key:`value`,label:`Required value`,placeholder:`ai.invoke`}],build:({path:e,value:t})=>e&&t?[{path:e,contains:t}]:[]}],oD=(e,t)=>e.inputs.every(e=>(t[e.key]??``).trim().length>0);function sD({issuer:e,disabled:t=!1,onChange:n}){let{preset:r,values:i}=eD(e),a=(t,r)=>{let i=JE(t,r);n({provider:t.id,jwks_url:i.jwks_url,issuer:i.issuer,audience:i.audience,user_id_claim:e.user_id_claim??i.user_id_claim})};return(0,I.jsx)(WE,{idPrefix:`issuer`,label:`Identity provider`,presets:XE,selected:r,values:i,compact:!0,disabled:t,onSelect:e=>a(e,{}),onValueChange:(e,t)=>a(r,{...i,[e]:t})})}function cD({claims:e,disabled:t=!1,onChange:n}){let r=(t,r)=>n(e.map((e,n)=>n===t?{...e,...r}:e));return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Claims the sign-in token must carry. Dot paths; contains matches arrays and space-delimited scopes, equals compares exactly.`}),(0,I.jsxs)(Y,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>n([...e,{path:``,contains:``}]),children:[(0,I.jsx)(Na,{className:`size-3.5`}),`Add claim`]})]}),e.length===0?(0,I.jsx)(Nw,{children:`No claim requirements.`}):e.map((i,a)=>{let o=i.equals===void 0?`contains`:`equals`;return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-[180px] flex-1`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Path`}),(0,I.jsx)($,{value:i.path,placeholder:`claims.entitlements`,className:`font-mono text-xs`,disabled:t,onChange:e=>r(a,{path:e.target.value})})]}),(0,I.jsxs)(`div`,{className:`w-[140px]`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Match`}),(0,I.jsxs)(cE,{value:o,disabled:t,onValueChange:t=>n(e.map((e,n)=>n===a?t===`equals`?{path:e.path,equals:Array.isArray(e.contains)?e.contains[0]??``:e.contains??``}:{path:e.path,contains:String(e.equals??``)}:e)),children:[(0,I.jsx)(uE,{className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsxs)(dE,{children:[(0,I.jsx)(fE,{value:`contains`,children:`contains`}),(0,I.jsx)(fE,{value:`equals`,children:`equals`})]})]})]}),(0,I.jsxs)(`div`,{className:`min-w-[180px] flex-1`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Value`}),(0,I.jsx)($,{value:o===`contains`&&Array.isArray(i.contains)?i.contains.join(`, `):String(i.equals??i.contains??``),placeholder:o===`contains`?`pro, pro_test`:`pro`,className:`font-mono text-xs`,disabled:t,onChange:e=>{if(o===`equals`){r(a,{equals:e.target.value});return}let t=e.target.value.split(`,`).map(e=>e.trim());r(a,{contains:t.length>1?t:e.target.value})}})]}),(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Remove claim`,disabled:t,onClick:()=>n(e.filter((e,t)=>t!==a)),children:(0,I.jsx)(Ga,{className:`size-4`})})]},a)})]})}var lD=aD.filter(e=>e.id!==`none`),uD=nD(``);function dD({issuer:e,disabled:t=!1,onChange:n}){let r=e.required_claims??[],i=rD(r),a=(e.entitlement??(r[0]?.path===`revenueCatEntitlements`?`revenuecat`:`custom`))===`revenuecat`&&i!==null?`revenuecat`:`custom`,o=lD.find(e=>e.id===a)??lD[0],s=e=>{e!==a&&n({entitlement:e,required_claims:e===`revenuecat`?[nD(i??``)]:r})};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`entitlement-check`,children:iD}),(0,I.jsxs)(cE,{value:a,disabled:t,onValueChange:e=>s(e),children:[(0,I.jsx)(uE,{id:`entitlement-check`,className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:lD.map(e=>(0,I.jsx)(fE,{value:e.id,children:(0,I.jsx)(GE,{preset:e})},e.id))})]}),o.description?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o.description}):null]}),a===`revenuecat`?(0,I.jsx)(fD,{input:o.inputs[0],entitlement:i??``,disabled:t,onChange:e=>n({required_claims:[nD(e)]})}):(0,I.jsx)(cD,{claims:r,disabled:t,onChange:e=>n({required_claims:e})})]})}function fD({input:e,entitlement:t,disabled:n,onChange:r}){return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`entitlement-value`,children:e.label}),(0,I.jsx)($,{id:`entitlement-value`,value:t,placeholder:e.placeholder,className:`max-w-[320px] font-mono text-xs`,disabled:n,onChange:e=>r(e.target.value)}),(0,I.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.hint,e.docs?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(UE,{href:e.docs.href,children:e.docs.label})]}):null]})]})}var pD=[{value:`issuer`,label:`Signed-in users only`,description:`Users sign in through your identity provider, and the gateway verifies it.`},{value:`app_install`,label:`Unauthenticated users`,description:`Anyone with your app can call. Each installation counts as one user.`}],mD=[{value:`issuer`,label:`Signed-in users only`,description:`Your backend forwards each user's sign-in token, and the gateway verifies it.`},{value:`header`,label:`Your backend sends the user id`,description:`In the ${DT} header on every request.`},{value:`none`,label:`No user identity`,description:`Requests are not linked to any user.`}];function hD({...e}){return(0,I.jsx)(Jd,{"data-slot":`dialog`,...e})}function gD({...e}){return(0,I.jsx)(Xd,{"data-slot":`dialog-trigger`,...e})}function _D({...e}){return(0,I.jsx)(ef,{"data-slot":`dialog-portal`,...e})}function vD({className:e,...t}){return(0,I.jsx)(nf,{"data-slot":`dialog-overlay`,className:H(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function yD({className:e,children:t,showCloseButton:n=!0,dismissOnOutsideInteraction:r=!1,onInteractOutside:i,...a}){return(0,I.jsxs)(_D,{"data-slot":`dialog-portal`,children:[(0,I.jsx)(vD,{}),(0,I.jsxs)(sf,{"data-slot":`dialog-content`,className:H(`fixed top-[50%] left-[50%] z-50 flex max-h-[calc(100dvh-4rem)] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-lg border bg-background shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,n&&`[&_[data-slot=dialog-header]]:pr-14`,e),onInteractOutside:e=>{i?.(e),r||e.preventDefault()},...a,children:[t,n&&(0,I.jsxs)(gf,{"data-slot":`dialog-close`,className:`absolute top-5 right-4 inline-flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-70 ring-offset-background transition-[opacity,background-color,color] hover:bg-muted hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,I.jsx)(Ya,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function bD({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`flex shrink-0 flex-col gap-2 border-b p-6 text-center sm:text-left`,e),...t})}function xD({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`dialog-body`,className:H(`min-h-0 flex-1 overflow-y-auto px-6 py-5`,e),...t})}function SD({className:e,showCloseButton:t=!1,children:n,...r}){return(0,I.jsxs)(`div`,{"data-slot":`dialog-footer`,className:H(`flex shrink-0 flex-col-reverse gap-2 border-t px-6 py-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,I.jsx)(gf,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,children:`Close`})})]})}function CD({className:e,...t}){return(0,I.jsx)(ff,{"data-slot":`dialog-title`,className:H(`text-lg leading-6 font-semibold`,e),...t})}function wD({className:e,...t}){return(0,I.jsx)(mf,{"data-slot":`dialog-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function TD({open:e,onOpenChange:t,title:n,description:r,submitLabel:i,pending:a,disabled:o,onSubmit:s,secondaryAction:c,className:l,children:u}){let{readOnly:d}=ox(),f=d||o||a;return(0,I.jsx)(hD,{open:e,onOpenChange:t,children:(0,I.jsx)(yD,{className:l??`sm:max-w-md`,...r?{}:{"aria-describedby":void 0},children:(0,I.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,autoComplete:`off`,onSubmit:e=>{e.preventDefault(),!f&&s()},children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{className:`text-balance`,children:n})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[r?(0,I.jsx)(wD,{className:`text-pretty`,children:r}):null,u]}),(0,I.jsxs)(SD,{children:[c,(0,I.jsx)(Y,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,I.jsxs)(Dw,{type:`submit`,disabled:o||a,children:[a?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,i]})]})]})})})}function ED({open:e,title:t,description:n,label:r,secret:i,acknowledgeLabel:a=`I’ve saved this key`,footnote:o,onAcknowledge:s}){let[c,l]=(0,v.useState)(!1),u=async()=>{try{await navigator.clipboard.writeText(i),l(!0),U.success(`Copied to clipboard`)}catch{U.error(`Could not copy. Select the value and copy it manually.`)}},d=()=>{l(!1),s()};return(0,I.jsx)(hD,{open:e,onOpenChange:e=>{e||d()},children:(0,I.jsxs)(yD,{showCloseButton:!1,className:`sm:max-w-lg`,onEscapeKeyDown:e=>e.preventDefault(),children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{className:`text-balance`,children:t})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[(0,I.jsx)(wD,{className:`text-pretty`,children:n}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`revealed-secret`,children:r}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)($,{id:`revealed-secret`,value:i,readOnly:!0,className:`font-mono text-xs`,onFocus:e=>e.currentTarget.select()}),(0,I.jsxs)(Y,{type:`button`,variant:`outline`,className:`min-w-24`,onClick:()=>void u(),children:[c?(0,I.jsx)(ra,{className:`size-4`}):(0,I.jsx)(ha,{className:`size-4`}),c?`Copied`:`Copy`]})]}),o?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):null]})]}),(0,I.jsx)(SD,{children:(0,I.jsx)(Y,{onClick:d,children:a})})]})})}function DD({appId:e,exchanged:t=!1,title:n=`Server API keys`,description:r}){let i=aC(e),a=oC(e),o=sC(e),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),p=async()=>{if(l.trim())try{let e=await a.mutateAsync(l.trim());c(!1),u(``),f(e)}catch(e){U.error(e instanceof Error?e.message:`Could not create the API key`)}},m=async e=>{try{await o.mutateAsync(e),U.success(`API key revoked`)}catch(e){U.error(e instanceof Error?e.message:`Could not revoke the API key`)}};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:n,description:r,action:(0,I.jsxs)(Dw,{size:`sm`,onClick:()=>{u(``),c(!0)},children:[(0,I.jsx)(Na,{className:`size-4`}),`New key`]})})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[t?null:(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your backend sends one of these keys as an Authorization bearer credential. Revoking takes effect within a minute.`}),(0,I.jsx)(`div`,{className:`overflow-hidden rounded-md border`,children:(0,I.jsxs)(AE,{className:`[--table-inset:1rem]`,children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{children:[(0,I.jsx)(Z,{children:`Name`}),(0,I.jsx)(Z,{children:`Prefix`}),(0,I.jsx)(Z,{children:`Last used`}),(0,I.jsx)(Z,{children:`Status`}),(0,I.jsx)(Z,{className:`w-24`})]})}),(0,I.jsx)(ME,{children:i.data?.keys.length?i.data.keys.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{children:e.name}),(0,I.jsxs)(Q,{className:`font-mono text-xs`,children:[e.key_prefix,`…`]}),(0,I.jsx)(Q,{className:`text-xs text-muted-foreground`,children:RC(e.last_used_at)}),(0,I.jsx)(Q,{children:(0,I.jsx)(Ib,{variant:e.status===`active`?`secondary`:`outline`,children:e.status})}),(0,I.jsx)(Q,{className:`text-right`,children:(0,I.jsxs)(Dw,{variant:`ghost`,size:`sm`,className:`text-destructive`,disabled:e.status===`revoked`||o.isPending,onClick:()=>void m(e.id),children:[(0,I.jsx)(Va,{className:`size-3.5`}),`Revoke`]})})]},e.id)):(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:5,className:`py-8 text-center text-sm text-muted-foreground`,children:`No API keys yet.`})})})]})})]})]}),(0,I.jsx)(TD,{open:s,onOpenChange:c,title:`Create an API key`,submitLabel:`Create key`,pending:a.isPending,disabled:!l.trim(),onSubmit:()=>void p(),children:(0,I.jsx)(Aw,{label:`Key name`,htmlFor:`api-key-name`,hint:`Name it so you can tell keys apart in the list.`,children:(0,I.jsx)($,{id:`api-key-name`,value:l,placeholder:`Production Worker`,maxLength:100,autoFocus:!0,autoComplete:`off`,onChange:e=>u(e.target.value)})})}),(0,I.jsx)(ED,{open:d!==null,title:`Copy your new key now`,description:(0,I.jsxs)(I.Fragment,{children:[`This is the only time the plaintext for`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:d?.name}),` is available — you will not see it again. The gateway stores only a hash.`]}),label:`API key`,secret:d?.key??``,onAcknowledge:()=>{f(null),a.reset()}})]})}var OD=`identity`,kD=[{slug:`identity`,label:`Application identity`},{slug:`users`,label:`User authentication`},{slug:`subscription`,label:`Subscription check`}],AD={secure:{icon:la,className:`text-emerald-600 dark:text-emerald-400`},weak:{icon:za,className:`text-amber-600 dark:text-amber-400`},incomplete:{icon:ca,className:`text-destructive`},off:{icon:ua,className:`text-muted-foreground/60`}},jD=[{value:`paid`,label:`Paid users only`,description:`The sign-in token must carry a claim that says the user has paid.`},{value:`any`,label:`Any signed-in user`,description:`Signing in is enough. Nothing about payment is checked.`}],MD=e=>(e.required_claims??[]).length>0||e.entitlement!==void 0?`paid`:`any`;function ND(e,t){let n=e.config.authentication,r=MT(n);return{identity:n.type===`apple_app_attest`?!n.app_attest.team_id.trim()||!n.app_attest.bundle_id.trim()?{tone:`incomplete`,text:`Team or bundle id missing`}:{tone:`secure`,text:`Verified with App Attest`}:t===!1?{tone:`incomplete`,text:`No active API key`}:{tone:`secure`,text:`Verified with API keys`},users:(()=>{switch(n.end_user?.source??`none`){case`issuer`:return r&&SE(r)?{tone:`secure`,text:`Signed-in users only`}:{tone:`incomplete`,text:`Identity provider not finished`};case`header`:return n.type===`api_key`&&n.end_user?.source===`header`&&!n.end_user.header.trim()?{tone:`incomplete`,text:`Header name missing`}:{tone:`weak`,text:`Your backend names the user`};case`app_install`:return{tone:`weak`,text:`Unauthenticated users allowed`};default:return{tone:`weak`,text:`No user identity`}}})(),subscription:r?MD(r)===`paid`?(r.required_claims??[]).every(CE)&&(r.required_claims??[]).length>0?{tone:`secure`,text:`Paid users only`}:{tone:`incomplete`,text:`Paid check not finished`}:{tone:`weak`,text:`Any signed-in user`}:{tone:`off`,text:`Needs signed-in users`}}}function PD({appId:e,level:t,state:n}){let r=n.draft,i=r.config.authentication,{readOnly:a}=ox(),o=aC(e,i.type===`api_key`),s=ND(r,o.data?o.data.keys.some(e=>e.status===`active`):void 0),c=kD.some(e=>e.slug===t)&&s[t].tone!==`off`?t:OD;return(0,I.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,I.jsx)(`nav`,{"aria-label":`Auth policy levels`,className:`flex flex-col gap-1 lg:sticky lg:top-6 lg:self-start`,children:kD.map(t=>(0,I.jsx)(FD,{to:`/apps/${e}/auth/${t.slug}`,label:t.label,status:s[t.slug],current:t.slug===c},t.slug))}),(0,I.jsx)(`div`,{className:`min-w-0 space-y-4`,children:c===`identity`?i.type===`apple_app_attest`?(0,I.jsx)(ID,{authentication:i,readOnly:a,state:n}):(0,I.jsx)(DD,{appId:e,exchanged:MT(i)!==void 0,title:`Application identity`,description:`A server application. Your backend proves itself with one of these API keys.`}):c===`users`?(0,I.jsx)(LD,{authentication:i,readOnly:a,state:n}):(0,I.jsx)(RD,{issuer:MT(i)??NT(),readOnly:a,state:n})})]})}function FD({to:e,label:t,status:n,current:r}){let{icon:i,className:a}=AD[n.tone],o=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{className:H(`mt-0.5 size-4 shrink-0`,a),"aria-hidden":`true`}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsx)(`span`,{className:`block text-sm font-medium`,children:t}),(0,I.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:n.text})]})]}),s=`flex items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors`;return n.tone===`off`?(0,I.jsx)(`div`,{"aria-disabled":`true`,className:H(s,`opacity-60`),children:o}):(0,I.jsx)(Pn,{to:e,"aria-current":r?`page`:void 0,className:H(s,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,r?`bg-muted`:`hover:bg-muted/60`),children:o})}function ID({authentication:e,readOnly:t,state:n}){let r=e.app_attest,i=t=>n.updateAuthentication({...e,app_attest:{...r,...t}});return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Application identity`,description:`An iOS application. Only builds signed with this team and bundle id can call AI providers through this gateway.`})}),(0,I.jsxs)(kE,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,I.jsx)(kw,{htmlFor:`apple-team-id`,children:`Apple Team ID`}),(0,I.jsx)($,{id:`apple-team-id`,value:r.team_id,placeholder:`ABCDE12345`,className:`font-mono text-xs`,disabled:t,onChange:e=>i({team_id:e.target.value})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`In your Apple Developer account under`,` `,(0,I.jsx)(UE,{href:`https://developer.apple.com/account#MembershipDetailsCard`,children:`Membership details`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,I.jsx)(kw,{htmlFor:`apple-bundle-id`,children:`Bundle ID`}),(0,I.jsx)($,{id:`apple-bundle-id`,value:r.bundle_id,placeholder:`com.example.app`,className:`font-mono text-xs`,disabled:t,onChange:e=>i({bundle_id:e.target.value})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`In Xcode, on your target's`,` `,(0,I.jsx)(UE,{href:`https://developer.apple.com/documentation/xcode/configuring-the-build-settings-of-a-target#Set-the-bundle-ID`,children:`Signing & Capabilities`}),` `,`tab.`]})]})]}),(0,I.jsx)(VE,{value:r.environments,compact:!0,disabled:t,onChange:t=>n.updateAuthentication({...e,app_attest:{team_id:r.team_id,bundle_id:r.bundle_id,...t.length===1&&t[0]===`production`?{}:{environments:t}}})})]})]})}function LD({authentication:e,readOnly:t,state:n}){let r=(0,v.useId)(),i=e.end_user?.source??`none`,a=MT(e),o=e.type===`api_key`?mD:pD;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`User authentication`,description:`Choose whether only users signed in to your app can call AI through this gateway.`})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[t?(0,I.jsx)(Ew,{reason:nx,reasonId:r,className:`w-full`,children:(0,I.jsx)(HE,{label:`User authentication`,choices:o,value:i,disabled:!0,describedBy:r,onChange:()=>{}})}):(0,I.jsx)(HE,{label:`User authentication`,choices:o,value:i,onChange:e=>n.setEndUserSource(e===`none`?void 0:e)}),e.type===`api_key`&&e.end_user?.source===`header`?(0,I.jsx)(Aw,{label:`Header name`,htmlFor:`end-user-header`,hint:`Lowercased, and removed before the request reaches the provider. Defaults to ${DT}.`,children:(0,I.jsx)($,{id:`end-user-header`,value:e.end_user.header,placeholder:DT,className:`max-w-[320px] font-mono text-xs`,disabled:t,onChange:e=>n.updateEndUserHeader(e.target.value)})}):null]})]}),i===`issuer`?(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Identity provider`,description:`Where your users sign in. The gateway verifies their sign-in tokens against it.`})}),(0,I.jsx)(kE,{children:(0,I.jsx)(sD,{issuer:a??NT(),disabled:t,onChange:n.updateIssuer})})]}):null]})}function RD({issuer:e,readOnly:t,state:n}){let r=(0,v.useId)(),i=MD(e);return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Subscription check`,description:`Check that the user has paid for the app before they can call AI providers through this gateway.`})}),(0,I.jsxs)(kE,{className:`space-y-6`,children:[t?(0,I.jsx)(Ew,{reason:nx,reasonId:r,className:`w-full`,children:(0,I.jsx)(HE,{label:`Subscription check`,choices:jD,value:i,disabled:!0,describedBy:r,onChange:()=>{}})}):(0,I.jsx)(HE,{label:`Subscription check`,choices:jD,value:i,onChange:e=>{e!==i&&n.updateIssuer(e===`any`?{entitlement:void 0,required_claims:[]}:{entitlement:`revenuecat`,required_claims:[uD]})}}),i===`paid`?(0,I.jsx)(`div`,{className:`border-t pt-6`,children:(0,I.jsx)(dD,{issuer:e,disabled:t,onChange:n.updateIssuer})}):null]})]})}var zD={requests:{per_minute:null,per_day:null},spending:{monthly_usd:null}},BD={per_user:zD,per_app:zD},VD=e=>e===``?null:Number(e);function HD({state:e}){let t=e.draft,n=t.config.limits??BD,r=t.config.authentication.type!==`api_key`||t.config.authentication.end_user!==void 0,i=(t,r)=>e.updateLimits({...n,[t]:{...n[t],...r}});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[`Limits you set on `,(0,I.jsx)(`strong`,{className:`font-medium text-foreground`,children:`your app's end users`}),`. They are unrelated to your own`,` `,(0,I.jsx)(Pn,{to:`/billing`,className:`text-primary-ink underline underline-offset-4`,children:`plan allowance`}),`, which meters all your apps together: a request refused here never spends it. Edits take up to a minute to apply everywhere.`]}),(0,I.jsxs)(`div`,{className:r?`grid gap-4 lg:grid-cols-2`:`grid gap-4`,children:[r?(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(DE,{className:`text-sm`,children:`Per-user limits`})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Applied independently to every authenticated user. Rate limits return`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`app_rate_limited`}),`; exhausting the monthly spend returns `,(0,I.jsx)(`code`,{className:`font-mono`,children:`app_budget_exhausted`}),`.`]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsx)(Aw,{label:`Requests per minute`,htmlFor:`rpm`,hint:`Leave empty for unlimited.`,children:(0,I.jsx)($,{id:`rpm`,type:`number`,min:1,value:n.per_user.requests.per_minute??``,placeholder:`Unlimited`,onChange:e=>i(`per_user`,{requests:{...n.per_user.requests,per_minute:VD(e.target.value)}})})}),(0,I.jsx)(Aw,{label:`Requests per day`,htmlFor:`rpd`,hint:`Leave empty for unlimited.`,children:(0,I.jsx)($,{id:`rpd`,type:`number`,min:1,value:n.per_user.requests.per_day??``,placeholder:`Unlimited`,onChange:e=>i(`per_user`,{requests:{...n.per_user.requests,per_day:VD(e.target.value)}})})})]}),(0,I.jsx)(`div`,{className:`border-t pt-4`,children:(0,I.jsx)(Aw,{label:`Monthly spending budget (USD)`,htmlFor:`budget`,hint:n.per_user.spending.monthly_usd===null?`Unlimited`:`${PC(n.per_user.spending.monthly_usd)} per user per month. Settled from completed requests, so it stops the request after the one that crosses it.`,children:(0,I.jsx)($,{id:`budget`,type:`number`,min:0,step:`0.01`,value:n.per_user.spending.monthly_usd??``,placeholder:`Unlimited`,onChange:e=>i(`per_user`,{spending:{monthly_usd:VD(e.target.value)}})})})})]})]}):(0,I.jsx)(TE,{children:(0,I.jsx)(kE,{className:`pt-6`,children:(0,I.jsx)(Nw,{children:`This application identifies no end users, so there is nobody for a per-user limit to apply to. Choose a user authentication method on the Auth policy tab to set them, or use the application limits below.`})})}),(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(DE,{className:`text-sm`,children:`Application limits`})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shared across all users and credentials for this application. Leave a field empty to keep that application-wide limit unrestricted.`}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsx)(Aw,{label:`Requests per minute`,htmlFor:`app-rpm`,hint:`Leave empty for unlimited.`,children:(0,I.jsx)($,{id:`app-rpm`,type:`number`,min:1,value:n.per_app.requests.per_minute??``,placeholder:`Unlimited`,onChange:e=>i(`per_app`,{requests:{...n.per_app.requests,per_minute:VD(e.target.value)}})})}),(0,I.jsx)(Aw,{label:`Requests per day`,htmlFor:`app-rpd`,hint:`Leave empty for unlimited.`,children:(0,I.jsx)($,{id:`app-rpd`,type:`number`,min:1,value:n.per_app.requests.per_day??``,placeholder:`Unlimited`,onChange:e=>i(`per_app`,{requests:{...n.per_app.requests,per_day:VD(e.target.value)}})})})]}),(0,I.jsx)(`div`,{className:`border-t pt-4`,children:(0,I.jsx)(Aw,{label:`Monthly spending budget (USD)`,htmlFor:`app-budget`,hint:n.per_app.spending.monthly_usd===null?`Unlimited`:`${PC(n.per_app.spending.monthly_usd)} per application per month. Settled from completed requests, so it stops the request after the one that crosses it.`,children:(0,I.jsx)($,{id:`app-budget`,type:`number`,min:0,step:`0.01`,value:n.per_app.spending.monthly_usd??``,placeholder:`Unlimited`,onChange:e=>i(`per_app`,{spending:{monthly_usd:VD(e.target.value)}})})})})]})]})]})]})}function UD(e){return e?.apiBaseUrl??window.location.origin}function WD({appId:e,month:t,state:n}){let{capabilities:r}=ox(),i=uC(e,t),a=cC(e,{month:t,limit:1}),o=n.draft.config.authentication,s=(i.data?.input_tokens??0)+(i.data?.cached_input_tokens??0)+(i.data?.cache_write_tokens??0)+(i.data?.output_tokens??0),c=MT(o);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[o.type===`api_key`?(0,I.jsx)(GD,{appId:e}):null,(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(PE,{label:`Spend`,value:i.isPending?(0,I.jsx)(Ow,{className:`h-6 w-20`}):PC(i.data?.cost_usd??0),detail:`month to date`}),(0,I.jsx)(PE,{label:`Users`,value:a.isPending?(0,I.jsx)(Ow,{className:`h-6 w-12`}):jC(a.data?.total??0),detail:`all time`}),(0,I.jsx)(PE,{label:`Requests`,value:i.isPending?(0,I.jsx)(Ow,{className:`h-6 w-16`}):jC(i.data?.requests??0),detail:`month to date`}),(0,I.jsx)(PE,{label:`Tokens`,value:i.isPending?(0,I.jsx)(Ow,{className:`h-6 w-16`}):MC(s),detail:`all buckets`})]}),(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(DE,{className:`text-sm`,children:`Client base URL`})}),(0,I.jsxs)(kE,{children:[(0,I.jsxs)(`code`,{className:`block rounded-md bg-muted px-3 py-2 font-mono text-xs break-all`,children:[UD(r),`/v1/apps/`,e,`/proxy/{provider}/{provider_path}`]}),(0,I.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:c?(0,I.jsxs)(I.Fragment,{children:[`Auth exchange lives at`,` `,(0,I.jsxs)(`span`,{className:`font-mono`,children:[`/v1/apps/`,e,`/auth/token`]}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[`Clients send their API key as the`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:`Authorization`}),` bearer credential; this app has no token exchange.`]})})]})]})]})}function GD({appId:e}){let t=aC(e);return!t.data||t.data.keys.some(e=>e.status===`active`)?null:(0,I.jsxs)(Ds,{children:[(0,I.jsx)(Sa,{}),(0,I.jsx)(Os,{children:`This app has no active API key`}),(0,I.jsxs)(ks,{children:[`Nothing can call it until one is created.`,` `,(0,I.jsx)(Pn,{to:`/apps/${e}/auth/identity`,className:`text-primary-ink underline underline-offset-4`,children:`Create an API key`})]})]})}function KD({className:e,size:t=`default`,...n}){return(0,I.jsx)(gy,{"data-slot":`switch`,"data-size":t,className:H(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,I.jsx)(vy,{"data-slot":`switch-thumb`,className:H(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`)})})}function qD({values:e,onChange:t,placeholder:n,suggestions:r=[],warn:i,warnTitle:a}){let[o,s]=(0,v.useState)(``),c=`suggestions-${Math.abs(JD(r.join(`,`)+n))}`,l=n=>{let r=n.trim();if(!r||e.includes(r))return s(``);t([...e,r]),s(``)};return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[e.length>0?(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(n=>{let r=i?.(n)??!1;return(0,I.jsxs)(`span`,{title:r?a:void 0,className:H(`inline-flex items-center gap-1 rounded-md border py-1 pr-1 pl-2 font-mono text-xs`,r?`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-400`:`bg-muted/50`),children:[n,(0,I.jsx)(`button`,{type:`button`,"aria-label":`Remove ${n}`,className:`rounded p-0.5 text-muted-foreground transition-colors hover:bg-background hover:text-foreground`,onClick:()=>t(e.filter(e=>e!==n)),children:(0,I.jsx)(Ya,{className:`size-3`})})]},n)})}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)($,{value:o,list:r.length>0?c:void 0,placeholder:n,className:`h-8 font-mono text-xs`,onChange:e=>s(e.target.value),onKeyDown:n=>{(n.key===`Enter`||n.key===`,`)&&(n.preventDefault(),l(o)),n.key===`Backspace`&&o===``&&e.length>0&&t(e.slice(0,-1))}}),r.length>0?(0,I.jsx)(`datalist`,{id:c,children:r.map(e=>(0,I.jsx)(`option`,{value:e},e))}):null,(0,I.jsxs)(Y,{type:`button`,variant:`outline`,size:`sm`,className:`h-8`,onClick:()=>l(o),children:[(0,I.jsx)(Na,{className:`size-3.5`}),`Add`]})]})]})}function JD(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)|0;return t}var YD={responses:`Responses`,chat_completions:`Chat Completions`,anthropic_messages:`Anthropic Messages`,gemini_native:`Gemini generateContent`,audio_transcription:`Transcription`};function XD(e){return Object.hasOwn(YD,e)}var ZD={gemini:[`gemini_native`],openai:[`audio_transcription`],xai:[`audio_transcription`]};function QD(e){return{style:e,label:YD[e],path:oT[e]}}function $D(e,t){let n=yT[e]?.[t];if(!n)return null;let r=ZD[t]??[],i=n.apiStyles?.filter(XD);return{narrowed:i!==void 0,available:(i??[]).map(QD),unavailable:i?r.filter(e=>!i.includes(e)).map(QD):[],modelIds:n.modelPrefix?`${CT[t]} model IDs with no "${n.modelPrefix}" prefix — the gateway adds it upstream`:`${CT[t]} model IDs, unchanged`}}function eO(e,t,n){if(e===null)return!0;let r=$D(e,t);if(!r)return!1;if(!r.narrowed)return!0;let i=cT[n];return r.available.some(e=>e.style===i)}var tO={openai:`Forwarded with the leading v1/ stripped, matching Cloudflare's provider-native URL.`,anthropic:`Forwarded with the v1/ prefix retained.`,xai:`Routed to Cloudflare's grok slug; the tenant path stays /proxy/xai/...`,gemini:`Use the OpenAI-compatible path v1beta/openai/chat/completions.`,perplexity:`Routed to Cloudflare's perplexity-ai slug; use chat/completions for Sonar models.`,deepseek:`Direct only. DeepSeek's base URL has no v1/, so the path is chat/completions.`,groq:`Direct only. Groq namespaces its OpenAI API: use openai/v1/chat/completions.`,mistral:`Direct only. Use v1/chat/completions.`,together:`Direct only. Use v1/chat/completions; models are namespaced, e.g. openai/gpt-oss-120b.`,fireworks:`Direct only. Use inference/v1/chat/completions. Models are account-scoped (accounts/…/models/…), so price them under custom model pricing.`,cerebras:`Direct only. Use v1/chat/completions.`,moonshot:`Direct only. Use v1/chat/completions on the international api.moonshot.ai host.`,huggingface:`Direct only. Use v1/chat/completions on the Inference Providers router. Pin the upstream in the model ID (author/model:provider) — otherwise the router picks one and the price varies with it.`,baseten:`Direct only. Use v1/chat/completions on the Model APIs host.`,bytedance:`Direct only. BytePlus ModelArk's version segment is already in the base URL: the path is chat/completions. Models must be activated in your ModelArk console first.`,openrouter:`Direct only, chat completions only. Models are OpenRouter slugs, e.g. google/gemini-3.6-flash, and need no local price: cost is reported by OpenRouter per request.`};function nO(e,t){if(e.providerGatewayId===null)return null;let n=t.find(t=>t.id===e.providerGatewayId),r=n?$D(n.type,e.type):null;if(!r?.narrowed)return null;let i=r.available.map(e=>`${e.label} at ${e.path}`).join(`, `),a=r.unavailable.length>0?` Not available on this route: ${r.unavailable.map(e=>e.label).join(`, `)}.`:``;return`Routed through ${n.name}: ${i}.${a} Models: ${r.modelIds}.`}function rO({state:e}){return(0,I.jsx)(Ib,{variant:`outline`,className:`border-muted-foreground/30 text-[11px] font-normal text-muted-foreground`,children:e})}function iO({row:e,config:t,onChange:n}){let r=(t?.allowed_paths??[]).map(FT),i=e.knownModels,a=e=>n({...LT(),...t,allowed_paths:e.map(IT)});return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.title,e.badge?(0,I.jsx)(rO,{state:e.badge}):null]}),description:e.description,action:(0,I.jsx)(KD,{"aria-label":`Enable ${e.slug}`,checked:t!==void 0,onCheckedChange:e=>n(e?LT():void 0)})})}),t?(0,I.jsxs)(kE,{className:`space-y-5`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(kw,{className:`text-sm`,children:`Allowed paths`}),(0,I.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:()=>a([...r,{path:``}]),children:[(0,I.jsx)(Na,{className:`size-3.5`}),`Add path`]})]}),r.length===0?(0,I.jsx)(Nw,{children:`Every path is allowed. Add one or more paths to restrict this provider.`}):(0,I.jsx)(`div`,{className:`space-y-2`,children:r.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-[200px] flex-[2]`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Path`}),(0,I.jsx)($,{value:e.path,placeholder:`v1/responses`,className:`font-mono text-xs`,onChange:e=>a(r.map((n,r)=>r===t?{...n,path:e.target.value}:n))})]}),(0,I.jsxs)(`div`,{className:`min-w-[150px] flex-1`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Fixed model`}),(0,I.jsx)($,{value:e.fixed_model??``,placeholder:`none`,className:`font-mono text-xs`,onChange:e=>a(r.map((n,r)=>r===t?{...n,fixed_model:e.target.value||void 0}:n))})]}),(0,I.jsxs)(`div`,{className:`w-[170px]`,children:[(0,I.jsx)(kw,{className:`mb-1.5 text-xs text-muted-foreground`,children:`Output cap style`}),(0,I.jsxs)(cE,{value:e.clamp??`auto`,onValueChange:e=>a(r.map((n,r)=>r===t?{...n,clamp:e===`auto`?void 0:e}:n)),children:[(0,I.jsx)(uE,{className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsxs)(dE,{children:[(0,I.jsx)(fE,{value:`auto`,children:`auto (by body)`}),ET.map(e=>(0,I.jsx)(fE,{value:e,children:e},e))]})]})]}),(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Remove path`,onClick:()=>a(r.filter((e,n)=>n!==t)),children:(0,I.jsx)(Ga,{className:`size-4`})})]},t))}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this list empty to allow every path. A fixed model applies to transcription-style routes with no model in the body; it is never injected upstream. Leave the output cap style on auto unless the route needs an exception.`})]}),(0,I.jsx)(Aw,{label:`Allowed models`,hint:`Leave empty to allow every model with configured pricing. A non-empty list restricts this provider; rewrites are resolved before pricing is checked.`,children:(0,I.jsx)(qD,{values:t.allowed_models??[],suggestions:i,placeholder:`gpt-5.6-terra`,onChange:e=>n({...t,allowed_models:e})})}),(0,I.jsx)(Aw,{label:`Max output tokens`,hint:`Empty = unrestricted. If set, requests above this are rejected; requests without an output-limit parameter get this value injected. Transcription routes ignore this cap.`,children:(0,I.jsx)($,{type:`number`,min:1,className:`max-w-[200px]`,value:t.max_output_tokens??``,placeholder:`8192`,onChange:e=>n({...t,max_output_tokens:e.target.value?Number(e.target.value):void 0})})})]}):null]})}function aO(e,t,n,r){let i=e.map(e=>({slug:e.slug,title:e.name,description:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`font-mono`,children:[`/proxy/`,e.slug,`/…`]}),` ·`,` `,(0,I.jsx)(iE,{type:e.type,className:`align-middle`}),` —`,` `,nO(e,t)??tO[e.type]]}),knownModels:OT(e,r),...e.status===`disabled`?{badge:`disabled`}:{}})),a=n.filter(t=>!e.some(e=>e.slug===t)).map(e=>({slug:e,title:e,description:`No instance answers for this slug. Recreate it on the Providers page, or turn this off.`,knownModels:[],badge:`deleted`}));return[...i,...a]}var oO=e=>e.filter(([e,t])=>e!==``&&t!==``),sO=e=>Object.fromEntries(oO(e));function cO({rewrites:e,onChange:t}){let[n,r]=(0,v.useState)(()=>Object.entries(e)),i=JSON.stringify(e),[a,o]=(0,v.useState)(i);i!==a&&(o(i),i!==JSON.stringify(sO(n))&&r(Object.entries(e)));let s=e=>{r(e),t(sO(e))},c=(e,t)=>s(n.map((n,r)=>r===e?t:n)),l=oO(n).length<n.length;return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Model rewrites`,description:`Server-side remap applied after the allowlist check, so a target need not be client-allowlisted. Usage records the rewritten model.`,action:(0,I.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:()=>s([...n,[``,``]]),children:[(0,I.jsx)(Na,{className:`size-3.5`}),`Add rewrite`]})})}),(0,I.jsxs)(kE,{className:`space-y-2`,children:[n.length===0?(0,I.jsx)(Nw,{children:`No rewrites. Clients get exactly the model they ask for.`}):n.map(([e,t],r)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)($,{value:e,"aria-label":`Rewrite ${r+1} source model`,placeholder:`gpt-5.6-terra`,className:`flex-1 font-mono text-xs`,onChange:e=>c(r,[e.target.value,t])}),(0,I.jsx)(Zi,{className:`size-4 shrink-0 text-muted-foreground`}),(0,I.jsx)($,{value:t,"aria-label":`Rewrite ${r+1} target model`,placeholder:`gpt-5.7`,className:`flex-1 font-mono text-xs`,onChange:t=>c(r,[e,t.target.value])}),(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Remove rewrite ${r+1}`,onClick:()=>s(n.filter((e,t)=>t!==r)),children:(0,I.jsx)(Ga,{className:`size-4`})})]},r)),l?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A rewrite is saved once both sides are filled in. A row left half-finished is dropped.`}):null]})]})}function lO({state:e}){let t=e.draft.config.routing,n=HT(t),r=UT(t),i=FS().data??[],a=BS().data?.gateways??[],o=gC().data?.prices,s=aO(i,a,r,o);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(TE,{className:n===`all`?`border-emerald-500/30`:void 0,children:[(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Provider access`,description:`Choose whether this application can use every provider supported by the gateway or only providers you select.`,action:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(kw,{htmlFor:`configure-providers`,className:`text-xs text-muted-foreground`,children:`Configure individually`}),(0,I.jsx)(KD,{id:`configure-providers`,"aria-label":`Configure providers individually`,checked:n===`selected`,onCheckedChange:t=>{e.updateProxy(t?{providers:{mode:`selected`,selected:(()=>{let e=i.find(e=>e.status===`active`)??i[0];return e?{[e.slug]:LT()}:{}})()}}:{providers:{mode:`all`}})}})]})})}),(0,I.jsx)(kE,{children:n===`all`?(0,I.jsx)(`div`,{className:`rounded-xl border border-emerald-500/25 bg-emerald-500/[0.06] p-4`,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`span`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-emerald-500/12 text-emerald-600 dark:text-emerald-400`,children:(0,I.jsx)(la,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold`,children:`Every configured instance is allowed`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`New provider instances, paths, and models are available automatically. Turn on individual configuration only when this application needs restrictions.`}),(0,I.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:i.length===0?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`No provider instances yet.`}):i.map(e=>(0,I.jsx)(Ib,{variant:`secondary`,className:H(`bg-background/75 font-mono text-[11px] font-normal`,e.status===`disabled`&&`text-muted-foreground line-through decoration-muted-foreground/50`),title:e.status===`disabled`?`${e.slug} is disabled and serves no traffic`:void 0,children:e.slug},e.slug))})]})]})}):(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-muted/45 p-4 ring-1 ring-border/70`,children:[(0,I.jsx)(`span`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-background text-muted-foreground shadow-sm ring-1 ring-border`,children:(0,I.jsx)(Ha,{className:`size-4`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`p`,{className:`text-sm font-medium`,children:[r.length,` of `,i.length,` provider instances enabled`]}),(0,I.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`Use the switches below. An enabled instance allows every path and model until you add a restriction, and clients reach it at its own slug.`})]})]})})]}),n===`selected`&&s.length===0?(0,I.jsx)(TE,{children:(0,I.jsx)(kE,{children:(0,I.jsx)(Nw,{children:`No provider instances to choose from. Add one on the Providers page, then come back to restrict this app to it.`})})}):null,n===`selected`?s.map(n=>(0,I.jsx)(iO,{row:n,config:t.providers.selected?.[n.slug],onChange:r=>e.updateProxy({providers:{mode:`selected`,selected:{...t.providers.selected,[n.slug]:r}}})},n.slug)):null,(0,I.jsx)(cO,{rewrites:t.model_rewrites??{},onChange:t=>e.updateProxy({model_rewrites:t})})]})}function uO({open:e,onOpenChange:t,title:n,description:r,confirmLabel:i=`Confirm`,confirmWord:a,destructive:o,pending:s,onConfirm:c}){let[l,u]=(0,v.useState)(``);return(0,I.jsx)(hD,{open:e,onOpenChange:e=>{e||u(``),t(e)},children:(0,I.jsxs)(yD,{className:`sm:max-w-md`,children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{children:n})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[(0,I.jsx)(wD,{asChild:!0,children:(0,I.jsx)(`div`,{className:`space-y-2 text-sm text-muted-foreground`,children:r})}),a?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(kw,{htmlFor:`confirm-word`,className:`text-xs`,children:[`Type `,(0,I.jsx)(`span`,{className:`font-mono text-foreground`,children:a}),` to continue`]}),(0,I.jsx)($,{id:`confirm-word`,value:l,autoComplete:`off`,className:`font-mono`,onChange:e=>u(e.target.value)})]}):null]}),(0,I.jsxs)(SD,{children:[(0,I.jsx)(Y,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,I.jsx)(Y,{variant:o?`destructive`:`default`,disabled:!(!a||l===a)||s,onClick:c,children:i})]})]})})}function dO({appId:e,state:t}){let n=t.draft,r=ht(),i=iC(),{readOnly:a}=ox(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),u=async()=>{try{await navigator.clipboard.writeText(e),l(!0),U.success(`Application id copied`)}catch{U.error(`Could not copy the application id`)}},d=async()=>{try{let t=await i.mutateAsync(e);U.success(`Deleted ${n.name}`,{description:`${t.removed_users} users removed. Usage history was kept.`}),r(`/apps`)}catch(e){U.error(e instanceof Error?e.message:`Could not delete the app`)}};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(TE,{children:(0,I.jsxs)(kE,{className:`space-y-5`,children:[(0,I.jsx)(Aw,{label:`Name`,htmlFor:`app-name`,children:(0,I.jsx)($,{id:`app-name`,value:n.name,maxLength:100,disabled:a,className:`max-w-md`,onChange:e=>t.update({name:e.target.value})})}),(0,I.jsx)(Aw,{label:`Application id`,htmlFor:`app-id`,hint:`Fixed when the app was created. It is part of every URL your clients call.`,children:(0,I.jsxs)(`div`,{className:`flex max-w-md gap-2`,children:[(0,I.jsx)($,{id:`app-id`,value:e,readOnly:!0,className:`font-mono text-xs`}),(0,I.jsxs)(Y,{type:`button`,variant:`outline`,className:`min-w-24`,onClick:()=>void u(),children:[c?(0,I.jsx)(ra,{className:`size-4`}):(0,I.jsx)(ha,{className:`size-4`}),c?`Copied`:`Copy`]})]})})]})}),(0,I.jsx)(TE,{children:(0,I.jsx)(kE,{children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`App enabled`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Turned off, this app refuses every request. Nothing is deleted, and turning it back on restores it as it was.`})]}),(0,I.jsx)(KD,{"aria-label":`App enabled`,checked:n.status===`active`,disabled:a,onCheckedChange:e=>t.update({status:e?`active`:`disabled`})})]})})}),(0,I.jsx)(TE,{className:`border-destructive/40`,children:(0,I.jsx)(EE,{children:(0,I.jsx)(Mw,{title:`Delete this app`,description:`Clients of this app stop working immediately. Registered users and App Attest keys are removed. Usage history is kept for accounting.`,action:(0,I.jsx)(Dw,{variant:`destructive`,size:`sm`,disabled:i.isPending,onClick:()=>s(!0),children:`Delete app`})})})}),(0,I.jsx)(uO,{open:o,onOpenChange:s,title:`Delete ${n.name}?`,description:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{children:`Clients of this app stop working immediately. Registered users and App Attest keys are removed; usage history is kept for accounting.`}),(0,I.jsx)(`p`,{children:`This cannot be undone.`})]}),confirmWord:e,confirmLabel:`Delete app`,destructive:!0,pending:i.isPending,onConfirm:()=>void d()})]})}var fO=25;function pO({appId:e}){let[t,n]=(0,v.useState)(HC()),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(`all`),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),d=cC(e,{month:t,query:r||void 0,status:a===`all`?void 0:a,limit:fO,offset:s*fO}),f=lC(e),p=async()=>{if(!l)return;let e=l.status===`active`;try{await f.mutateAsync({userId:l.id,blocked:e}),U.success(e?`Blocked ${l.id}`:`Unblocked ${l.id}`,{description:e?`Their Durable Object was updated, so it applies even to a live gateway token.`:void 0}),u(null)}catch(e){U.error(e instanceof Error?e.message:`Could not update the user`)}},m=d.data?.total??0,h=Math.max(1,Math.ceil(m/fO));return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`relative min-w-[220px] flex-1`,children:[(0,I.jsx)(Ia,{className:`absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)($,{value:r,placeholder:`Search user id`,className:`h-9 pl-8 font-mono text-xs`,onChange:e=>{i(e.target.value),c(0)}})]}),(0,I.jsxs)(cE,{value:a,onValueChange:e=>{o(e),c(0)},children:[(0,I.jsx)(uE,{className:`w-[140px]`,size:`sm`,children:(0,I.jsx)(lE,{})}),(0,I.jsxs)(dE,{children:[(0,I.jsx)(fE,{value:`all`,children:`All users`}),(0,I.jsx)(fE,{value:`active`,children:`Active`}),(0,I.jsx)(fE,{value:`blocked`,children:`Blocked`})]})]}),(0,I.jsx)(gE,{value:t,onChange:n})]}),(0,I.jsx)(TE,{className:`overflow-hidden py-0`,children:(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{className:`hover:bg-transparent`,children:[(0,I.jsx)(Z,{children:`User`}),(0,I.jsx)(Z,{children:`Attestation`}),(0,I.jsx)(Z,{children:`Last seen`}),(0,I.jsx)(Z,{className:`text-right`,children:`Requests`}),(0,I.jsx)(Z,{className:`text-right`,children:`Tokens`}),(0,I.jsx)(Z,{className:`text-right`,children:`Cost`}),(0,I.jsx)(Z,{className:`w-24`})]})}),(0,I.jsx)(ME,{children:d.isPending?[0,1,2].map(e=>(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:7,children:(0,I.jsx)(Ow,{className:`h-8 w-full`})})},e)):d.data?.users.length===0?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:7,className:`py-10 text-center text-sm text-muted-foreground`,children:`No users yet. A row appears once a client completes its first token exchange.`})}):d.data?.users.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e.id}),e.status===`blocked`?(0,I.jsx)(wC,{status:`blocked`}):null]})}),(0,I.jsx)(Q,{children:e.attest_registered?(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(Ib,{variant:`secondary`,className:`text-[11px] font-normal`,children:`registered`}),(0,I.jsxs)(`span`,{className:`tabular text-[11px] text-muted-foreground`,children:[`counter `,e.attest_counter]})]}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.is_virtual?`server attributed`:`issuer token`})}),(0,I.jsx)(Q,{className:`text-xs text-muted-foreground`,children:RC(e.last_seen_at)}),(0,I.jsx)(Q,{className:`tabular text-right`,children:jC(e.usage.requests)}),(0,I.jsx)(Q,{className:`tabular text-right`,children:MC(VC(e.usage))}),(0,I.jsx)(Q,{className:`tabular text-right`,children:PC(e.usage.cost_usd)}),(0,I.jsx)(Q,{className:`text-right`,children:(0,I.jsx)(Dw,{variant:`ghost`,size:`sm`,disabled:e.is_virtual,onClick:()=>u(e),className:e.status===`active`?`text-destructive`:void 0,children:e.status===`active`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($i,{className:`size-3.5`}),`Block`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(la,{className:`size-3.5`}),`Unblock`]})})})]},e.id))})]})}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{children:[jC(m),` users · page `,s+1,` of `,h]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(Y,{variant:`outline`,size:`sm`,disabled:s===0,onClick:()=>c(e=>e-1),children:`Previous`}),(0,I.jsx)(Y,{variant:`outline`,size:`sm`,disabled:s+1>=h,onClick:()=>c(e=>e+1),children:`Next`})]})]}),(0,I.jsx)(uO,{open:l!==null,onOpenChange:e=>!e&&u(null),title:l?.status===`active`?`Block ${l?.id}?`:`Unblock ${l?.id}?`,description:l?.status===`active`?(0,I.jsx)(`p`,{children:`Their requests are refused immediately, even with an unexpired gateway token, because the block is written to their Durable Object as well as D1.`}):(0,I.jsx)(`p`,{children:`Their requests resume as soon as the Durable Object is updated.`}),confirmLabel:l?.status===`active`?`Block user`:`Unblock user`,destructive:l?.status===`active`,pending:f.isPending,onConfirm:()=>void p()})]})}var mO=(0,v.lazy)(()=>w(()=>import(`./usage-x48kOqlj.js`).then(e=>({default:e.UsageTab})),[])),hO=(0,v.lazy)(()=>w(()=>import(`./endpoints-zOm2MGG0.js`).then(e=>({default:e.EndpointsTab})),[]));function gO(){let{appId:e=``,tab:t=`overview`,section:n}=_t(),r=xE(e),[i,a]=(0,v.useState)(HC()),o=DC.find(e=>e.slug===t),{query:s,draft:c,dirty:l}=r,u=c?wE(c):null;return s.isError?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load this app`}),(0,I.jsxs)(ks,{children:[s.error instanceof Error?s.error.message:`Unknown error`,(0,I.jsx)(Pn,{to:`/apps`,className:`underline underline-offset-4`,children:`Back to apps`})]})]}):(0,I.jsxs)(`div`,{className:`space-y-6 pb-24`,children:[(0,I.jsx)(jw,{title:o?.label??`Overview`,action:t===`overview`?(0,I.jsx)(gE,{value:i,onChange:a}):void 0}),s.data?.config_error?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`The stored configuration is invalid`}),(0,I.jsxs)(ks,{children:[s.data.config_error,`. The gateway rejects requests for this app until it is fixed.`]})]}):null,c?(0,I.jsx)(sE,{proxy:c.config.routing}):null,s.isPending||!c?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(Ow,{className:`h-32 w-full`}),(0,I.jsx)(Ow,{className:`h-64 w-full`})]}):t===`overview`?(0,I.jsx)(WD,{appId:e,month:i,state:r}):t===`auth`?(0,I.jsx)(PD,{appId:e,level:n,state:r}):t===`proxy`?(0,I.jsx)(lO,{state:r}):t===`limits`?(0,I.jsx)(HD,{state:r}):t===`users`?(0,I.jsx)(pO,{appId:e}):t===`auth-events`?(0,I.jsx)(RE,{appId:e}):t===`settings`?(0,I.jsx)(dO,{appId:e,state:r}):(0,I.jsx)(v.Suspense,{fallback:(0,I.jsx)(Ow,{className:`h-64 w-full`}),children:t===`usage`?(0,I.jsx)(mO,{appId:e}):(0,I.jsx)(hO,{appId:e,state:r})}),l?(0,I.jsx)(`div`,{className:`fixed inset-x-0 bottom-0 z-40 border-t bg-background/95 backdrop-blur`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-7xl items-center gap-3 px-4 py-3 sm:px-6`,children:[(0,I.jsxs)(`span`,{className:`text-sm`,children:[(0,I.jsx)(`span`,{className:`mr-2 inline-block size-2 rounded-full bg-amber-500 align-middle`}),`Unsaved changes to `,(0,I.jsx)(`span`,{className:`font-medium`,children:c?.name??e})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,I.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:r.reset,disabled:r.saving,children:`Discard`}),(0,I.jsxs)(Dw,{size:`sm`,reason:u??void 0,onClick:()=>void r.save(),disabled:r.saving,children:[r.saving?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Save changes`]})]})]})}):null]})}var _O=[{id:`ios`,label:`iOS application`,description:`Calls AI providers straight from the app.`,icon:Ua},{id:`server`,label:`Server`,description:`A backend you run, using a private API key.`,icon:La}],vO={basics:{id:`basics`,label:`Basics`},app_identity:{id:`app_identity`,label:`Application identity`,subtitle:`Application identity`,text:`Set your app's identity so that only this app can call AI providers through this gateway.`},users:{id:`users`,label:`User authentication`,subtitle:`User authentication`,text:`Choose whether only users signed in to your app can call AI through this gateway.`},identity_provider:{id:`identity_provider`,label:`Identity provider`,subtitle:`Identity provider`,text:`Where your users sign in. The gateway verifies their sign-in tokens against it.`},subscription:{id:`subscription`,label:`Subscription check`,subtitle:`Subscription check`,text:`Check that the user has paid for the app before they can call AI providers through this gateway.`}},yO=aD.find(e=>e.id===`none`);function bO({trigger:e}={}){let{capabilities:t}=ox(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(XE[0]),[x,S]=(0,v.useState)({}),[C,w]=(0,v.useState)(yO),[T,E]=(0,v.useState)({}),[ee,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!1),[te,ne]=(0,v.useState)(!1),M=ht(),N=rC(),P=(0,v.useMemo)(()=>{let e=[vO.basics];return c===`ios`&&e.push(vO.app_identity),e.push(vO.users),g===`issuer`&&e.push(vO.identity_provider,vO.subscription),e},[c,g]),re=P[Math.min(i,P.length-1)],ie=i>=P.length-1,ae=(0,v.useMemo)(()=>JE(y,x),[y,x]),oe=oD(y,x)&&ae.jwks_url.startsWith(`https://`)&&ae.issuer.length>0&&ae.audience.length>0,F=(()=>{switch(re.id){case`basics`:return o.trim().length>0&&c!==null;case`app_identity`:return u.trim().length>0&&f.trim().length>0;case`users`:return g!==null;case`identity_provider`:return oe;case`subscription`:return oD(C,T)}})(),se=()=>{a(0),s(``),l(null),d(``),p(``),h(void 0),_(null),b(XE[0]),S({}),w(yO),E({})},ce=e=>{e&&se(),r(e)},le=e=>{e!==c&&(l(e),_(null))},ue=()=>{let e=g===`issuer`?{source:`issuer`,issuer:{provider:y.id,jwks_url:ae.jwks_url,issuer:ae.issuer,audience:ae.audience,user_id_claim:ae.user_id_claim,required_claims:YE(C,T),max_token_lifetime_seconds:86400,...C.id===`none`?{}:{entitlement:C.id}}}:null;return c===`ios`?{type:`apple_app_attest`,app_attest:{team_id:u.trim(),bundle_id:f.trim(),...m?.includes(`development`)?{environments:m}:{}},end_user:e??{source:`app_install`}}:e?{type:`api_key`,end_user:e}:g===`header`?{type:`api_key`,end_user:{source:`header`,header:DT}}:{type:`api_key`}},de=async()=>{if(c)try{let e=await N.mutateAsync({name:o.trim(),config:{authentication:ue(),routing:{providers:{mode:`all`},model_rewrites:{}},...c===`server`?{}:{limits:{per_user:{requests:{per_minute:10,per_day:300},spending:{monthly_usd:null}},per_app:{requests:{per_minute:null,per_day:null},spending:{monthly_usd:null}}}}},status:`active`});if(r(!1),c===`server`){if(!e.api_key)throw Error(`The app was created without its initial API key`);k(e.app.id),D(e.api_key),ne(!1),j(!0);return}U.success(`Created ${e.app.id}`),M(`/apps/${e.app.id}/proxy`)}catch(e){U.error(e instanceof Error?e.message:`Could not create the app`)}},fe=()=>{_(c===`ios`?`app_install`:`none`),a(P.findIndex(e=>e.id===`users`))},pe=()=>{if(ie){de();return}a(e=>e+1)},me=async()=>{if(ee)try{await navigator.clipboard.writeText(ee.key),ne(!0),U.success(`API key copied`)}catch{U.error(`Could not copy the API key`)}},he=()=>{j(!1),U.success(`Created ${O}`),M(`/apps/${O}/proxy`)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(hD,{open:n,onOpenChange:ce,children:[(0,I.jsx)(gD,{asChild:!0,children:e??(0,I.jsxs)(Dw,{size:`sm`,children:[(0,I.jsx)(Na,{className:`size-4`}),`New app`]})}),(0,I.jsxs)(yD,{className:`sm:max-w-2xl`,children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{children:`Create a new application`})}),(0,I.jsxs)(xD,{className:`space-y-6`,children:[re.subtitle?(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(`h3`,{className:`text-base font-semibold`,children:re.subtitle}),re.text?(0,I.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:re.text}):null]}):null,re.id===`basics`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,I.jsx)(kw,{htmlFor:`app-name`,children:`Application name`}),(0,I.jsx)($,{id:`app-name`,value:o,placeholder:`Calorie Tracker`,maxLength:100,autoFocus:!0,onChange:e=>s(e.target.value)})]}),(0,I.jsxs)(`fieldset`,{className:`space-y-3`,children:[(0,I.jsx)(`legend`,{className:`text-sm font-medium`,children:`Application type`}),(0,I.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,role:`radiogroup`,children:_O.map(e=>{let t=e.icon,n=c===e.id;return(0,I.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:H(`group min-h-32 rounded-xl bg-background p-5 text-left shadow-sm ring-1 ring-border transition-[box-shadow,background-color] hover:bg-muted/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n&&`bg-primary/[0.04] shadow-md ring-2 ring-primary`),onClick:()=>le(e.id),children:[(0,I.jsx)(`span`,{className:H(`mb-3 flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground transition-[background-color,color]`,n&&`bg-primary text-primary-foreground`),children:(0,I.jsx)(t,{className:`size-5`})}),(0,I.jsx)(`span`,{className:`block text-sm font-semibold`,children:e.label}),(0,I.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.id)})})]})]}):null,re.id===`app_identity`?(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,I.jsx)(kw,{htmlFor:`apple-team-id`,children:`Apple Team ID`}),(0,I.jsx)($,{id:`apple-team-id`,value:u,placeholder:`ABCDE12345`,className:`font-mono text-xs`,autoFocus:!0,onChange:e=>d(e.target.value)}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`In your Apple Developer account under`,` `,(0,I.jsx)(UE,{href:`https://developer.apple.com/account#MembershipDetailsCard`,children:`Membership details`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,I.jsx)(kw,{htmlFor:`apple-bundle-id`,children:`Bundle ID`}),(0,I.jsx)($,{id:`apple-bundle-id`,value:f,placeholder:`com.example.calorietracker`,className:`font-mono text-xs`,onChange:e=>p(e.target.value)}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`In Xcode, on your target's`,` `,(0,I.jsx)(UE,{href:`https://developer.apple.com/documentation/xcode/configuring-the-build-settings-of-a-target#Set-the-bundle-ID`,children:`Signing & Capabilities`}),` `,`tab.`]})]})]}),(0,I.jsx)(VE,{value:m,onChange:h,compact:!0})]}):null,re.id===`users`?(0,I.jsx)(HE,{label:`User authentication`,choices:c===`ios`?pD:mD,value:g,onChange:_}):null,re.id===`identity_provider`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(WE,{idPrefix:`issuer`,label:`Identity provider`,presets:XE,selected:y,values:x,compact:!0,onSelect:e=>{b(e),S({})},onValueChange:(e,t)=>S(n=>({...n,[e]:t}))}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Don't have these details yet?`,` `,(0,I.jsx)(`button`,{type:`button`,className:`font-medium text-primary-ink underline decoration-primary-ink/40 underline-offset-4 transition-colors hover:decoration-primary-ink`,onClick:fe,children:c===`ios`?`Allow unauthenticated users for now`:`Continue without user identity for now`}),` `,`and set this up later.`]})]}):null,re.id===`subscription`?(0,I.jsx)(WE,{idPrefix:`entitlement`,label:iD,presets:aD,selected:C,values:T,compact:!0,onSelect:e=>{w(e),E({})},onValueChange:(e,t)=>E(n=>({...n,[e]:t}))}):null]}),(0,I.jsxs)(SD,{className:`items-center sm:justify-between`,children:[i>0?(0,I.jsxs)(Y,{variant:`ghost`,onClick:()=>a(e=>e-1),disabled:N.isPending,children:[(0,I.jsx)(Xi,{className:`size-4`}),`Back`]}):(0,I.jsx)(Y,{variant:`outline`,onClick:()=>r(!1),children:`Cancel`}),(0,I.jsx)(xO,{steps:P,current:i,onSelect:a}),(0,I.jsxs)(Y,{disabled:!F||N.isPending,onClick:pe,children:[N.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,ie?`Create app`:`Next`]})]})]})]}),(0,I.jsx)(hD,{open:A,onOpenChange:e=>{e||he()},children:(0,I.jsxs)(yD,{showCloseButton:!1,className:`sm:max-w-lg`,onEscapeKeyDown:e=>e.preventDefault(),children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{className:`text-balance`,children:`Your application is ready`})}),(0,I.jsxs)(xD,{className:`space-y-5`,children:[(0,I.jsxs)(wD,{className:`text-pretty`,children:[`This is the API key for`,` `,(0,I.jsx)(`span`,{className:`font-mono text-foreground`,children:O}),`. It is shown only once, so copy it now.`]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`created-api-key`,children:`API key`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)($,{id:`created-api-key`,value:ee?.key??``,readOnly:!0,className:`font-mono text-xs`}),(0,I.jsxs)(Y,{type:`button`,variant:`outline`,className:`min-w-24`,onClick:()=>void me(),children:[te?(0,I.jsx)(ra,{className:`size-4`}):(0,I.jsx)(ha,{className:`size-4`}),te?`Copied`:`Copy`]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Base URL`}),(0,I.jsxs)(`code`,{className:`block rounded-md bg-muted px-3 py-2 font-mono text-xs break-all text-muted-foreground`,children:[UD(t),`/v1/apps/`,(0,I.jsx)(`span`,{className:`text-foreground`,children:O}),`/proxy/{provider}/{provider_path}`]})]})]}),(0,I.jsx)(SD,{children:(0,I.jsx)(Y,{onClick:he,children:`I’ve saved this key`})})]})})]})}function xO({steps:e,current:t,onSelect:n}){return(0,I.jsx)(`ol`,{className:`flex items-center gap-2`,"aria-label":`Steps`,children:e.map((e,r)=>{let i=r<t,a=r===t,o=(0,I.jsx)(`span`,{className:H(`block size-2 rounded-full transition-colors`,a?`bg-primary`:i?`bg-primary/40`:`bg-border`)});return(0,I.jsx)(`li`,{"aria-current":a?`step`:void 0,children:i?(0,I.jsx)(`button`,{type:`button`,"aria-label":`Back to ${e.label}`,className:`flex size-5 items-center justify-center rounded-full hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>n(r),children:o}):(0,I.jsx)(`span`,{className:`flex size-5 items-center justify-center`,"aria-label":`${e.label}${a?`, current step`:``}`,children:o})},e.id)})})}function SO({label:e,children:t}){return(0,I.jsxs)(Lb,{children:[(0,I.jsx)(Rb,{asChild:!0,children:(0,I.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Actions for ${e}`,children:(0,I.jsx)(_a,{})})}),(0,I.jsx)(zb,{align:`end`,className:`min-w-44`,children:t})]})}function CO({reason:e,destructive:t,onSelect:n,children:r}){let{readOnly:i}=ox(),a=(0,v.useId)(),o=e??(i?`Your role is read-only. Ask an owner or admin to make this change.`:void 0),s=t?`destructive`:`default`;return o?(0,I.jsx)(Ew,{reason:o,reasonId:a,className:`w-full`,children:(0,I.jsx)(Bb,{variant:s,disabled:!0,"aria-describedby":a,className:`w-full`,children:r})}):(0,I.jsx)(Bb,{variant:s,onSelect:n,children:r})}var wO={"data-1p-ignore":`true`,"data-lpignore":`true`},TO={autoComplete:`off`,...wO},EO={type:`password`,autoComplete:`new-password`,spellCheck:!1,...wO};function DO(e){return Object.entries(e??{}).map(([e,t])=>({model:e,input:String(t.input),output:String(t.output)}))}function OO(e){let t={};for(let n of e){let e=n.model.trim(),r=n.input.trim(),i=n.output.trim();if(!e&&!r&&!i)continue;if(!e)return{error:`Every pricing row needs a model name`};if(!r||!i)return{error:`Enter both prices for ${e} — use 0 only if it is genuinely free`};let a=Number(r),o=Number(i);if(!Number.isFinite(a)||a<0||!Number.isFinite(o)||o<0)return{error:`Prices for ${e} must be numbers of 0 or more`};if(Object.hasOwn(t,e))return{error:`${e} is priced twice — remove the duplicate row`};t[e]={input:a,output:o}}return{pricing:t}}function kO(e,t){return e instanceof Error?e.message:t}var AO=e=>`gateway-${e}`,jO=`/providers/gateways`;function MO(e){if(e.referencedCount!==0)return e.providerCount===0?`Disabled provider instances still reference this gateway; delete them to release it`:e.referencedCount>e.providerCount?`Delete the active and disabled provider instances routed through this gateway first`:`Delete every active provider instance routed through this gateway first`}function NO({label:e,value:t}){return(0,I.jsxs)(`div`,{children:[e,`: `,(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:t})]})}function PO({row:e,gateways:t}){if(e.providerGatewayId===null)return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[e.secretHint===null?(0,I.jsx)(`div`,{children:`API key`}):(0,I.jsx)(NO,{label:`API key`,value:`…${e.secretHint}`}),e.baseUrl===null?null:(0,I.jsx)(NO,{label:`Base URL`,value:e.baseUrl})]});let n=t.find(t=>t.id===e.providerGatewayId);return n?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Gateway:`,(0,I.jsx)(nE,{type:n.type}),(0,I.jsx)(Pn,{className:`text-primary-ink underline underline-offset-4`,to:`${jO}#${AO(n.id)}`,children:n.name})]}):(0,I.jsx)(I.Fragment,{children:`Gateway`})}function FO({gateway:e}){return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[e.type===`cf_aig`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(NO,{label:`Account ID`,value:e.config.accountId}),(0,I.jsx)(NO,{label:`Gateway ID`,value:e.config.gatewayId})]}):null,(0,I.jsx)(NO,{label:`API key`,value:`…${e.secretHint}`})]})}var IO=[{slug:`providers`,path:`/providers`,Component:VO},{slug:`gateways`,path:jO,Component:ZO}],LO=IO[0];function RO(){return(0,I.jsx)(Ib,{variant:`outline`,className:`border-muted-foreground/30 text-muted-foreground`,children:`disabled`})}function zO({slug:e,names:t}){return t.length===0?null:(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:t.join(`, `)}),` `,t.length===1?`names`:`name`,` `,(0,I.jsx)(`span`,{className:`font-mono text-foreground`,children:e}),` in its configuration.`]})}function BO(){let{section:e}=_t(),t=e===void 0?LO:IO.find(t=>t.slug===e);return t?(0,I.jsx)(t.Component,{}):(0,I.jsx)(Vt,{to:LO.path,replace:!0})}function VO(){let{readOnly:e}=ox(),t=PS(),n=BS(),r=qS(),i=KS(),a=eC(HC()),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),g=t.data?.providers??[],_=n.data?.gateways??[],y=e=>(a.data?.apps??[]).filter(t=>t.referenced_providers.includes(e)).map(e=>e.name),b=async()=>{if(f)try{await r.mutateAsync(f.id),U.success(`Deleted ${f.name}`),p(null)}catch(e){U.error(kO(e,`Could not delete the provider`))}},x=async()=>{if(m)try{await i.mutateAsync({id:m.id,body:{status:`disabled`}}),U.success(`Disabled ${m.name}`),h(null)}catch(e){U.error(kO(e,`Could not disable the provider`))}},S=async e=>{try{await i.mutateAsync({id:e.id,body:{status:`active`}}),U.success(`Enabled ${e.name}`)}catch(e){U.error(kO(e,`Could not enable the provider`))}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Providers`,description:`Set up the AI providers your apps use.`,action:(0,I.jsxs)(Dw,{size:`sm`,onClick:()=>s(!0),children:[(0,I.jsx)(Na,{className:`size-4`}),`Add provider`]})}),t.isError?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load providers`}),(0,I.jsx)(ks,{children:kO(t.error,`Unknown error`)})]}):null,(0,I.jsx)(TE,{className:`overflow-hidden py-0`,children:(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{children:[(0,I.jsx)(Z,{children:`Name`}),(0,I.jsx)(Z,{children:`Provider`}),(0,I.jsx)(Z,{children:`Slug`}),(0,I.jsx)(Z,{children:`Auth`}),(0,I.jsx)(Z,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(ME,{children:t.isPending?[0,1,2].map(e=>(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:5,children:(0,I.jsx)(Ow,{className:`h-5 w-full`})})},e)):g.length===0?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:5,className:`py-10 text-center text-sm text-muted-foreground`,children:`No providers yet. Add a key per provider, or route one through a gateway.`})}):g.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.name,e.status===`disabled`?(0,I.jsx)(RO,{}):null]})}),(0,I.jsx)(Q,{children:(0,I.jsxs)(Ib,{variant:`secondary`,children:[(0,I.jsx)(tE,{type:e.type}),CT[e.type]]})}),(0,I.jsx)(Q,{className:`font-mono text-xs`,children:e.slug}),(0,I.jsx)(Q,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(PO,{row:e,gateways:_})}),(0,I.jsx)(Q,{className:`text-right`,children:(0,I.jsxs)(SO,{label:e.name,children:[(0,I.jsxs)(Bb,{onSelect:()=>l(e),children:[(0,I.jsx)(da,{}),`Pricing`]}),(0,I.jsxs)(CO,{reason:e.providerGatewayId===null?void 0:`This instance authenticates with the gateway token — update the gateway's token instead`,onSelect:()=>d(e),children:[(0,I.jsx)(Pa,{}),`Update key`]}),(0,I.jsx)(Wb,{}),e.status===`disabled`?(0,I.jsxs)(CO,{onSelect:()=>void S(e),children:[(0,I.jsx)(fa,{}),`Enable provider`]}):(0,I.jsxs)(CO,{onSelect:()=>h(e),children:[(0,I.jsx)(pa,{}),`Disable provider`]}),(0,I.jsxs)(CO,{destructive:!0,onSelect:()=>p(e),children:[(0,I.jsx)(Ga,{}),`Delete provider`]})]})})]},e.id))})]})}),(0,I.jsx)(YO,{open:o,onOpenChange:s,providers:g,gateways:_}),(0,I.jsx)(tk,{provider:u,onClose:()=>d(null)},u?.id),(0,I.jsx)(nk,{provider:c,onClose:()=>l(null),readOnly:e}),(0,I.jsx)(uO,{open:f!==null,onOpenChange:e=>{e||p(null)},title:`Delete provider`,description:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{children:[`Apps using`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:f?CT[f.type]:``}),` `,`start failing within a minute, and any custom pricing on this provider is deleted with it.`]}),f?(0,I.jsx)(zO,{slug:f.slug,names:y(f.slug)}):null,(0,I.jsx)(`p`,{children:`This cannot be undone. Update the key instead if you only want to replace it, or disable the provider to pause it and keep the key.`})]}),confirmLabel:`Delete provider`,destructive:!0,pending:r.isPending,onConfirm:()=>void b()}),(0,I.jsx)(uO,{open:m!==null,onOpenChange:e=>{e||h(null)},title:`Disable provider`,description:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{children:[`Requests to`,` `,(0,I.jsx)(`span`,{className:`font-mono text-foreground`,children:m?.slug??``}),` start failing within a minute.`]}),m?(0,I.jsx)(zO,{slug:m.slug,names:y(m.slug)}):null]}),confirmLabel:`Disable provider`,pending:i.isPending,onConfirm:()=>void x()})]})}var HO=`__new__`,UO={works:{icon:la,className:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`},unconfirmed:{icon:xa,className:`bg-muted text-muted-foreground`},failed:{icon:ca,className:`bg-destructive/10 text-destructive`}};function WO(e){return e.reason===`unexpected_status`&&e.status!==void 0&&e.status<500&&e.status!==429}function GO(e,t,n){let r=CT[t],i=n?`The gateway`:r;switch(e.reason){case`no_probe`:return`There is no test call for ${r}, so nothing was checked. Add it if you know it is right.`;case`unreachable`:return`${i} did not answer in time, so nothing is proven either way.`;case`unexpected_status`:return WO(e)?n?`The gateway answered with HTTP ${e.status}. Check that it holds a stored key for ${r}.`:`${r} answered with HTTP ${e.status}, so this key could not be used.`:`${i} answered with HTTP ${e.status}, so nothing is proven either way.`;default:return`Nothing is proven either way. Add it if you know it is right.`}}function KO(e,t,n){if(e.validated)return{status:`works`,message:`Works. The provider accepted this credential.`};let r=GO(e,t,n);return WO(e)?{status:`failed`,message:r}:{status:`unconfirmed`,message:r}}function qO(e){if(e.validated)return{status:`works`,message:`Works. The gateway accepted this token.`};if(e.reason===`rejected`)return{status:`failed`,message:`The gateway refused this token (HTTP ${e.status}). Check the token itself, that authentication is turned on, and that the gateway holds a key for OpenAI.`};if(e.reason===`unreachable`)return{status:`unconfirmed`,message:`The gateway did not answer in time, so nothing is proven either way.`};let t=e.reason===`unexpected_status`?`The gateway answered with HTTP ${e.status}. Check the account and gateway IDs.`:`Nothing is proven either way. Add it if you know it is right.`;return{status:WO(e)?`failed`:`unconfirmed`,message:t}}function JO({outcome:e}){let{icon:t,className:n}=UO[e.status];return(0,I.jsxs)(`p`,{"aria-live":`polite`,className:H(`flex items-start gap-2 rounded-md px-3 py-2 text-xs`,n),children:[(0,I.jsx)(t,{className:`mt-px size-3.5 shrink-0`}),e.message]})}function YO({open:e,onOpenChange:t,providers:n,gateways:r}){let i=LS(),a=RS(),[o,s]=(0,v.useState)(`openai`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(`key`),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(null),[ee,D]=(0,v.useState)(null),O=(0,v.useRef)(null),k=(0,v.useRef)(!1);(0,v.useEffect)(()=>{!k.current||!O.current||(k.current=!1,O.current.focus())});let A=r.filter(e=>e.status===`active`),j=T&&!A.some(e=>e.id===T.id)?[...A,T]:A,te=e=>n.some(t=>t.slug===e),ne=x||te(o),M=e=>{s(e),S(!1),D(null),te(e)?k.current=!0:b(``)},N=u===`key`?!!f:!!g,P=!!c.trim()&&N&&(!ne||!!y.trim()),re=()=>{s(`openai`),l(``),d(`key`),p(``),h(``),_(``),b(``),S(!1),E(null),D(null),i.reset(),a.reset()},ie=()=>{re(),t(!1)},ae=u===`key`&&m.trim()?{baseUrl:m.trim()}:{},oe=async()=>{if(N){D(null);try{let e=await a.mutateAsync({type:o,...u===`key`?{secret:f,...ae}:{providerGatewayId:g}});D(KO(e,o,u===`gateway`))}catch(e){D({status:`failed`,message:kO(e,`The credential could not be checked`)})}finally{a.reset()}}},F=async()=>{if(P)try{await i.mutateAsync({type:o,name:c.trim(),...y.trim()?{slug:y.trim()}:{},...u===`key`?{secret:f,...ae}:{providerGatewayId:g}}),ie(),U.success(`Added ${CT[o]}`)}catch(e){p(``),e instanceof ux&&e.code===`slug_taken`&&(S(!0),k.current=!0),U.error(kO(e,`Could not store the credential`))}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(TD,{open:e,onOpenChange:e=>e?t(!0):ie(),title:`Add a provider`,submitLabel:`Add provider`,pending:i.isPending,disabled:!P,onSubmit:()=>void F(),secondaryAction:(0,I.jsxs)(Y,{type:`button`,variant:`secondary`,className:`sm:mr-auto`,disabled:!N||a.isPending,onClick:()=>void oe(),children:[a.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Test provider`]}),children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Aw,{label:`Name`,htmlFor:`provider-name`,hint:`How this provider is named in the list.`,children:(0,I.jsx)($,{id:`provider-name`,...TO,value:c,placeholder:`Prod OpenAI`,autoFocus:!0,onChange:e=>l(e.target.value)})}),(0,I.jsx)(Aw,{label:`Provider`,htmlFor:`provider-type`,children:(0,I.jsxs)(cE,{value:o,onValueChange:e=>M(e),children:[(0,I.jsx)(uE,{id:`provider-type`,className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:ST.map(e=>(0,I.jsx)(fE,{value:e,children:(0,I.jsx)(iE,{type:e})},e))})]})}),(0,I.jsx)(Aw,{label:`Authentication`,htmlFor:`provider-authentication`,hint:`Call the provider directly, or route through a gateway.`,children:(0,I.jsxs)(cE,{value:u,onValueChange:e=>{d(e),e===`gateway`&&h(``),D(null)},children:[(0,I.jsx)(uE,{id:`provider-authentication`,className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsxs)(dE,{children:[(0,I.jsxs)(fE,{value:`key`,children:[(0,I.jsx)(Sa,{}),`API key`]}),(0,I.jsxs)(fE,{value:`gateway`,children:[(0,I.jsx)(ta,{}),`Use gateway`]})]})]})}),u===`key`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Aw,{label:`API key`,htmlFor:`provider-secret`,children:(0,I.jsx)($,{id:`provider-secret`,...EO,value:f,placeholder:`sk-…`,onChange:e=>{p(e.target.value),D(null)}})}),(0,I.jsx)(Aw,{label:`Base URL (optional)`,htmlFor:`provider-base-url`,hint:`Point this instance at an OpenAI-compatible endpoint you control — Azure OpenAI, vLLM, a proxy. HTTPS, port 443, no path-only tweaks beyond the base. Leave empty to use the provider's own API.`,children:(0,I.jsx)($,{id:`provider-base-url`,...TO,className:`font-mono`,value:m,placeholder:`https://my-vllm.example.com/v1/`,onChange:e=>{h(e.target.value),D(null)}})})]}):(0,I.jsx)(Aw,{label:`Gateway`,htmlFor:`provider-gateway`,hint:`The provider's own key lives in that gateway; this row carries no secret.`,children:(0,I.jsxs)(cE,{value:g,onValueChange:e=>{if(e){if(e===HO){w(!0);return}_(e),D(null)}},children:[(0,I.jsx)(uE,{id:`provider-gateway`,className:`w-full`,children:(0,I.jsx)(lE,{placeholder:j.length?`Choose a gateway`:`No gateways yet`})}),(0,I.jsxs)(dE,{children:[j.map(e=>(0,I.jsx)(fE,{value:e.id,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(nE,{type:e.type}),e.name]})},e.id)),j.length?(0,I.jsx)(pE,{}):null,(0,I.jsxs)(fE,{value:HO,className:`font-medium text-primary-ink focus:text-primary-ink`,children:[(0,I.jsx)(Na,{className:`size-4 text-primary-ink`}),`New gateway…`]})]})]})}),ne?(0,I.jsx)(Aw,{label:`Slug`,htmlFor:`provider-slug`,hint:(0,I.jsxs)(I.Fragment,{children:[`Another instance already uses `,(0,I.jsx)(`code`,{className:`font-mono`,children:o}),`, so this one needs its own `,(0,I.jsx)(`code`,{className:`font-mono`,children:`/proxy/<slug>/…`}),` `,`segment.`]}),children:(0,I.jsx)($,{id:`provider-slug`,ref:O,...TO,className:`font-mono`,value:y,placeholder:`${o}-dev`,onChange:e=>b(e.target.value)})}):null,ee?(0,I.jsx)(JO,{outcome:ee}):null]})}),(0,I.jsx)(QO,{open:C,onOpenChange:w,onCreated:e=>{E(e),_(e.id)}})]})}function XO({label:e=`Add provider`}){let[t,n]=(0,v.useState)(!1),r=PS(),i=BS(t);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Dw,{size:`sm`,onClick:()=>n(!0),children:e}),(0,I.jsx)(YO,{open:t,onOpenChange:n,providers:r.data?.providers??[],gateways:i.data?.gateways??[]})]})}function ZO(){let e=BS(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),l=GS(),u=e.data?.gateways??[],d=e.isError?e.error:null,{hash:f}=dt();(0,v.useEffect)(()=>{f&&document.getElementById(f.slice(1))?.scrollIntoView({behavior:`smooth`,block:`center`})},[f,e.data]);let p=async()=>{if(s)try{await l.mutateAsync(s.id),U.success(`Deleted ${s.name}`),c(null)}catch(e){U.error(kO(e,`Could not delete the gateway`))}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Gateways`,description:`Set up the gateways you use to reach AI providers.`,action:(0,I.jsxs)(Dw,{size:`sm`,onClick:()=>n(!0),children:[(0,I.jsx)(Na,{className:`size-4`}),`Add gateway`]})}),d?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load gateways`}),(0,I.jsx)(ks,{children:kO(d,`Unknown error`)})]}):null,(0,I.jsx)(TE,{className:`overflow-hidden py-0`,children:(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{children:[(0,I.jsx)(Z,{children:`Name`}),(0,I.jsx)(Z,{children:`Type`}),(0,I.jsx)(Z,{children:`Auth`}),(0,I.jsx)(Z,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(ME,{children:e.isPending?[0,1].map(e=>(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:4,children:(0,I.jsx)(Ow,{className:`h-5 w-full`})})},e)):u.length===0?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:4,className:`py-10 text-center text-sm text-muted-foreground`,children:`No gateways yet. Add one to route providers through it.`})}):u.map(e=>(0,I.jsxs)(NE,{id:AO(e.id),children:[(0,I.jsx)(Q,{className:`font-medium`,children:e.name}),(0,I.jsx)(Q,{children:(0,I.jsxs)(Ib,{variant:`secondary`,children:[(0,I.jsx)(nE,{type:e.type}),wT[e.type]]})}),(0,I.jsx)(Q,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(FO,{gateway:e})}),(0,I.jsx)(Q,{className:`text-right`,children:(0,I.jsxs)(SO,{label:e.name,children:[(0,I.jsxs)(CO,{onSelect:()=>o(e),children:[(0,I.jsx)(Pa,{}),`Update token`]}),(0,I.jsxs)(CO,{onSelect:()=>i(e),children:[(0,I.jsx)(ja,{}),`Rename`]}),(0,I.jsx)(Wb,{}),(0,I.jsxs)(CO,{destructive:!0,reason:MO(e),onSelect:()=>c(e),children:[(0,I.jsx)(Ga,{}),`Delete gateway`]})]})})]},e.id))})]})}),(0,I.jsx)(QO,{open:t,onOpenChange:n}),(0,I.jsx)($O,{gateway:r,onClose:()=>i(null)}),(0,I.jsx)(ek,{gateway:a,onClose:()=>o(null)}),(0,I.jsx)(uO,{open:s!==null,onOpenChange:e=>{e||c(null)},title:`Delete gateway`,description:(0,I.jsxs)(`p`,{children:[`The stored token for`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:s?.name}),` is destroyed. Nothing routes through it, so no traffic changes.`]}),confirmLabel:`Delete gateway`,destructive:!0,pending:l.isPending,onConfirm:()=>void p()})]})}function QO({open:e,onOpenChange:t,onCreated:n}){let r=HS(),i=zS(),[a,o]=(0,v.useState)(TT[0].value),s=TT.find(e=>e.value===a)??TT[0],[c,l]=(0,v.useState)(s.defaultName),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(null),y=!!(m&&(!s.needsCloudflareIds||u.trim()&&f.trim())),b=!!c.trim()&&y,x=()=>{o(TT[0].value),l(TT[0].defaultName),d(``),p(``),h(``),_(null),r.reset(),i.reset()},S=async()=>{if(y){_(null);try{let e=await i.mutateAsync(s.value===`cf_aig`?{type:`cf_aig`,accountId:u.trim(),gatewayId:f.trim(),token:m}:{type:`vercel`,token:m});_(qO(e))}catch(e){_({status:`failed`,message:kO(e,`The connection could not be checked`)})}finally{i.reset()}}},C=e=>{let t=TT.find(t=>t.value===e);t&&(o(e),l(t.defaultName),d(``),p(``),h(``),_(null))},w=()=>{x(),t(!1)},T=async()=>{if(b)try{let e=await r.mutateAsync(s.value===`cf_aig`?{type:`cf_aig`,name:c.trim(),accountId:u.trim(),gatewayId:f.trim(),token:m}:{type:`vercel`,name:c.trim(),token:m});x(),U.success(`Added ${e.gateway.name}`),n?.(e.gateway),t(!1)}catch(e){h(``),U.error(kO(e,`Could not add the gateway`))}};return(0,I.jsx)(TD,{open:e,onOpenChange:e=>e?t(!0):w(),title:`Add gateway`,submitLabel:`Add gateway`,pending:r.isPending,disabled:!b,onSubmit:()=>void T(),secondaryAction:(0,I.jsxs)(Y,{type:`button`,variant:`secondary`,className:`sm:mr-auto`,disabled:!y||i.isPending,onClick:()=>void S(),children:[i.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Test gateway`]}),children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[TT.length>1?(0,I.jsx)(Aw,{label:`Gateway type`,htmlFor:`gateway-type`,children:(0,I.jsxs)(cE,{value:a,onValueChange:e=>C(e),children:[(0,I.jsx)(uE,{id:`gateway-type`,className:`w-full`,children:(0,I.jsx)(lE,{})}),(0,I.jsx)(dE,{children:TT.map(e=>(0,I.jsx)(fE,{value:e.value,children:(0,I.jsx)(aE,{type:e.value})},e.value))})]})}):null,(0,I.jsx)(Aw,{label:`Name`,htmlFor:`gateway-name`,children:(0,I.jsx)($,{id:`gateway-name`,...TO,value:c,onChange:e=>l(e.target.value)})}),s.needsCloudflareIds?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Aw,{label:`Cloudflare Account ID`,htmlFor:`gateway-account`,children:(0,I.jsx)($,{id:`gateway-account`,...TO,value:u,onChange:e=>{d(e.target.value),_(null)}})}),(0,I.jsx)(Aw,{label:`Cloudflare Gateway ID`,htmlFor:`gateway-gateway`,children:(0,I.jsx)($,{id:`gateway-gateway`,...TO,value:f,onChange:e=>{p(e.target.value),_(null)}})})]}):null,(0,I.jsx)(Aw,{label:`Gateway token`,htmlFor:`gateway-token`,hint:(0,I.jsx)(`a`,{className:`underline underline-offset-4`,href:s.tokenDocsUrl,target:`_blank`,rel:`noreferrer`,children:`How to create the token`}),children:(0,I.jsx)($,{id:`gateway-token`,...EO,value:m,onChange:e=>{h(e.target.value),_(null)}})}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s.credentialNote}),g?(0,I.jsx)(JO,{outcome:g}):null]})})}function $O({gateway:e,onClose:t}){let n=US(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null);e&&a!==e.id&&(o(e.id),i(e.name));let s=()=>{o(null),t()},c=async()=>{if(!(!e||!r.trim()))try{await n.mutateAsync({id:e.id,name:r.trim()}),U.success(`Renamed to ${r.trim()}`),s()}catch(e){U.error(kO(e,`Could not rename the gateway`))}};return(0,I.jsx)(hD,{open:e!==null,onOpenChange:e=>e?void 0:s(),children:(0,I.jsxs)(yD,{className:`sm:max-w-md`,children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{children:`Rename gateway`})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[(0,I.jsx)(wD,{children:`Only the display name changes. Nothing about the connection or the providers routed through it moves.`}),(0,I.jsx)(Aw,{label:`Name`,htmlFor:`gateway-rename`,children:(0,I.jsx)($,{id:`gateway-rename`,...TO,value:r,onChange:e=>i(e.target.value)})})]}),(0,I.jsxs)(SD,{children:[(0,I.jsx)(Y,{variant:`outline`,onClick:s,children:`Cancel`}),(0,I.jsxs)(Y,{disabled:!r.trim()||n.isPending,onClick:()=>void c(),children:[n.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Save name`]})]})]})})}function ek({gateway:e,onClose:t}){let n=WS(),r=zS(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),c=()=>{a(``),s(null),n.reset(),r.reset(),t()},l=async()=>{if(!(!e||!i)){s(null);try{let t=await r.mutateAsync(e.type===`cf_aig`?{type:`cf_aig`,accountId:e.config.accountId,gatewayId:e.config.gatewayId,token:i}:{type:`vercel`,token:i});s(qO(t))}catch(e){s({status:`failed`,message:kO(e,`The connection could not be checked`)})}finally{r.reset()}}},u=async()=>{if(!(!e||!i))try{await n.mutateAsync({id:e.id,token:i}),a(``),s(null),n.reset(),U.success(`Updated the token for ${e.name}`),t()}catch(e){a(``),U.error(kO(e,`Could not update the gateway token`))}};return(0,I.jsx)(hD,{open:e!==null,onOpenChange:e=>e?void 0:c(),children:(0,I.jsxs)(yD,{className:`sm:max-w-md`,children:[(0,I.jsx)(bD,{children:(0,I.jsxs)(CD,{children:[`Update the token for `,e?.name]})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[(0,I.jsxs)(wD,{children:[`One token authenticates every provider routed through this gateway, so all`,` `,e?.providerCount??0,` of them pick the new one up within a minute.`]}),(0,I.jsx)(Aw,{label:`New gateway token`,htmlFor:`gateway-rotate-token`,children:(0,I.jsx)($,{id:`gateway-rotate-token`,...EO,value:i,onChange:e=>{a(e.target.value),s(null)}})}),o?(0,I.jsx)(JO,{outcome:o}):null]}),(0,I.jsxs)(SD,{children:[(0,I.jsxs)(Y,{type:`button`,variant:`secondary`,className:`sm:mr-auto`,disabled:!i||r.isPending,onClick:()=>void l(),children:[r.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Test token`]}),(0,I.jsx)(Y,{variant:`outline`,onClick:c,children:`Cancel`}),(0,I.jsxs)(Y,{disabled:!i||n.isPending,onClick:()=>void u(),children:[n.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Update token`]})]})]})})}function tk({provider:e,onClose:t}){let n=KS(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(e?.baseUrl??``),s=()=>{i(``),n.reset(),t()},c=a.trim(),l=e&&c!==(e.baseUrl??``)?{baseUrl:c===``?null:c}:{},u=async()=>{if(!(!e||!r))try{await n.mutateAsync({id:e.id,body:{secret:r,...l}}),i(``),n.reset(),U.success(`Updated the key for ${e.name}`),t()}catch(e){i(``),U.error(kO(e,`Could not update the credential`))}};return(0,I.jsx)(hD,{open:e!==null,onOpenChange:e=>e?void 0:s(),children:(0,I.jsxs)(yD,{className:`sm:max-w-md`,children:[(0,I.jsx)(bD,{children:(0,I.jsxs)(CD,{children:[`Update the key for `,e?.name]})}),(0,I.jsxs)(xD,{className:`space-y-4`,children:[(0,I.jsx)(wD,{children:`The new credential replaces the old one in place. Custom pricing is kept, and requests pick it up within a minute.`}),(0,I.jsx)(Aw,{label:`New API key`,htmlFor:`rotate-secret`,children:(0,I.jsx)($,{id:`rotate-secret`,...EO,value:r,onChange:e=>i(e.target.value)})}),(0,I.jsx)(Aw,{label:`Base URL`,htmlFor:`rotate-base-url`,hint:`Changing the origin needs the key above, because the stored key is never sent to a new origin. Leave empty to use the provider's own API.`,children:(0,I.jsx)($,{id:`rotate-base-url`,...TO,className:`font-mono`,value:a,placeholder:`https://my-vllm.example.com/v1/`,onChange:e=>o(e.target.value)})})]}),(0,I.jsxs)(SD,{children:[(0,I.jsx)(Y,{variant:`outline`,onClick:s,children:`Cancel`}),(0,I.jsxs)(Y,{disabled:!r||n.isPending,onClick:()=>void u(),children:[n.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Update key`]})]})]})})}function nk({provider:e,onClose:t,readOnly:n}){let r=KS(),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(null);e&&o!==e.id&&(s(e.id),a(DO(e.pricing)));let c=(e,t)=>{a(n=>n.map((n,r)=>r===e?{...n,...t}:n))},l=async()=>{if(!e)return;let n=OO(i);if(`error`in n){U.error(n.error);return}try{await r.mutateAsync({id:e.id,body:{pricing:Object.keys(n.pricing).length?n.pricing:null}}),U.success(`Updated pricing for ${e.name}`),t()}catch(e){U.error(kO(e,`Could not save the pricing`))}};return(0,I.jsx)(hD,{open:e!==null,onOpenChange:e=>{e||(s(null),t())},children:(0,I.jsxs)(yD,{className:`sm:max-w-2xl`,children:[(0,I.jsx)(bD,{children:(0,I.jsx)(CD,{children:`Custom model pricing`})}),(0,I.jsxs)(xD,{className:`space-y-3`,children:[(0,I.jsxs)(wD,{children:[`For models the built-in catalog does not cover, or prices it in a way you disagree with.`,e&&xT(e.type)?` ${CT[e.type]??e.type} reports the cost of
76
- every request, so its models proxy with no price here; a price entered here is
77
- only used if a response ever comes back without one.`:` Requests for unpriced models are rejected until a price is set here.`,` `,`Enter $0 for a model that is genuinely free.`]}),i.length===0?(0,I.jsx)(Nw,{children:`No custom prices for this provider.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{"aria-hidden":!0,className:`grid grid-cols-[2fr_1fr_1fr_auto] gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Model`}),(0,I.jsx)(`span`,{children:`Input $/1M`}),(0,I.jsx)(`span`,{children:`Output $/1M`}),(0,I.jsx)(`span`,{className:`w-9`})]}),i.map((e,t)=>(0,I.jsxs)(`div`,{className:`grid grid-cols-[2fr_1fr_1fr_auto] items-center gap-2`,children:[(0,I.jsx)($,{"aria-label":`Model ${t+1}`,value:e.model,placeholder:`gpt-brand-new`,disabled:n,onChange:e=>c(t,{model:e.target.value})}),(0,I.jsx)($,{"aria-label":`Input price ${t+1}`,inputMode:`decimal`,value:e.input,placeholder:`1.25`,disabled:n,onChange:e=>c(t,{input:e.target.value})}),(0,I.jsx)($,{"aria-label":`Output price ${t+1}`,inputMode:`decimal`,value:e.output,placeholder:`10`,disabled:n,onChange:e=>c(t,{output:e.target.value})}),(0,I.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Remove pricing row ${t+1}`,disabled:n,onClick:()=>a(e=>e.filter((e,n)=>n!==t)),children:(0,I.jsx)(Ga,{className:`size-4`})})]},t))]}),(0,I.jsxs)(Y,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>a(e=>[...e,{model:``,input:``,output:``}]),children:[(0,I.jsx)(Na,{className:`size-4`}),`Add model`]})]}),(0,I.jsxs)(SD,{children:[(0,I.jsx)(Y,{variant:`outline`,onClick:t,children:`Cancel`}),(0,I.jsxs)(Dw,{disabled:r.isPending,onClick:()=>void l(),children:[r.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Save pricing`]})]})]})})}var rk=4e3;function ik(){let e=dt(),t=ht(),n=ui(),r=(0,v.useRef)(!1),i=(0,v.useRef)(void 0),a=lS(e.search);(0,v.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,v.useEffect)(()=>{if(!a||r.current)return;r.current=!0,U.success(`Payment complete`,{description:`Your new plan is being activated.`}),Lx.capture(`subscription_started`,{plan:nS(e.search)??`unknown`});let o=()=>void n.invalidateQueries({queryKey:CS.billingStatus});o(),i.current=setTimeout(o,rk),t(uS(e.pathname,e.search),{replace:!0})},[a,n,t,e.pathname,e.search])}function ak(e,t,n){let r=e.resolved?.routing;if(!r)return null;for(let e of t){if(e.status!==`active`)continue;let t=r.providers?.[e.slug];if(r.providerMode===`selected`&&!t)continue;let i=t?.allowed_models?.length?t.allowed_models:[...Object.keys(e.pricing??{}),...Object.entries(n[e.type]??{}).filter(([,e])=>e.output!==void 0).map(([e])=>e)],a=e.type===`openai`?`v1/responses`:e.type===`anthropic`?`v1/messages`:e.type===`gemini`?`v1beta/models/${i[0]}:generateContent`:!e.providerGatewayId&&e.type===`groq`?`openai/v1/chat/completions`:!e.providerGatewayId&&e.type===`fireworks`?`inference/v1/chat/completions`:!e.providerGatewayId&&[`deepseek`,`bytedance`].includes(e.type)?`chat/completions`:`v1/chat/completions`,o=t?.allowed_paths?.length?t.allowed_paths:[a];for(let t of o){let n=typeof t==`string`?t:t.path;if(n.includes(`*`))continue;let r=typeof t!=`string`&&t.fixed_model?t.fixed_model:i[0];if(!r)continue;let a=[{role:`user`,content:`Say hello.`}],o=n.endsWith(`responses`)?{model:r,input:`Say hello.`}:n.endsWith(`chat/completions`)?{model:r,messages:a}:n.endsWith(`messages`)?{model:r,max_tokens:128,messages:a}:n.endsWith(`:generateContent`)?{contents:[{parts:[{text:`Say hello.`}]}]}:null;if(o)return{provider:e.slug,path:n,body:o,anthropic:n.endsWith(`messages`)}}}return null}var ok=`https://docs.appaigateway.com/quickstart/`,sk=15e3;function ck({index:e,title:t,description:n,done:r,completedLabel:i,action:a,status:o}){return(0,I.jsxs)(`li`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-2 sm:gap-x-4`,children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`grid size-6 shrink-0 place-items-center rounded-full bg-muted text-xs font-semibold tabular`,children:e}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,I.jsxs)(`p`,{className:H(`text-sm font-medium`,r&&`text-muted-foreground`),children:[t,r?(0,I.jsx)(`span`,{className:`sr-only`,children:` — done`}):null]}),(0,I.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:n})]}),(0,I.jsx)(`div`,{className:`shrink-0 sm:pt-0.5`,children:r?(0,I.jsx)(`span`,{className:`flex size-8 items-center justify-center text-primary`,role:`img`,"aria-label":i,children:(0,I.jsx)(ra,{className:`size-5`,"aria-hidden":!0})}):a}),o?(0,I.jsx)(`div`,{className:`col-span-2 col-start-2 min-w-0`,children:o}):null]})}function lk(){return(0,I.jsxs)(`p`,{className:`flex items-center gap-2 pt-1 text-xs text-muted-foreground`,role:`status`,"aria-label":`Waiting for your first request`,children:[(0,I.jsxs)(`span`,{className:`relative flex size-2`,"aria-hidden":!0,children:[(0,I.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-primary opacity-60`}),(0,I.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-primary`})]}),`Waiting…`]})}function uk({app:e}){let t=tC(e.id),n=PS(),r=gC(),i=e.authentication_type===`apple_app_attest`;if(t.isPending||n.isPending||r.isPending)return(0,I.jsx)(Ow,{className:`mt-4 h-32`});let a=t.data&&n.data&&r.data?ak(t.data,n.data.providers,r.data.prices):null;if(!a)return(0,I.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:`No text request example is available for this app’s current provider and model settings.`});let{provider:o,path:s,body:c,anthropic:l}=a,u=e=>`'${e.replaceAll(`'`,`'\\''`)}'`,d=window.location.origin;return(0,I.jsx)(`div`,{className:`mt-4 min-w-0 overflow-hidden rounded-lg border bg-muted/40`,children:(0,I.jsx)(`pre`,{className:`overflow-x-auto p-4 text-xs leading-relaxed`,children:(0,I.jsx)(`code`,{children:i?`import Foundation
78
- import AppAIGateway
79
-
80
- let gateway = AppAIGatewayClient(
81
- appID: ${JSON.stringify(e.id)},
82
- baseURL: URL(string: ${JSON.stringify(d)})!,
83
- authMode: .appAttestInstall
84
- )
85
-
86
- var request = try await gateway.authorizedRequest(
87
- provider: ${JSON.stringify(o)},
88
- providerPath: ${JSON.stringify(s)}
89
- )
90
- request.setValue("application/json", forHTTPHeaderField: "Content-Type")
91
- ${l?`request.setValue("2023-06-01", forHTTPHeaderField: "anthropic-version")
92
- `:``}request.httpBody = Data(${JSON.stringify(JSON.stringify(c))}.utf8)
93
- let (data, response) = try await URLSession.shared.data(for: request)
94
- print(String(decoding: data, as: UTF8.self))`:`curl --fail-with-body ${u(`${d}/v1/apps/${encodeURIComponent(e.id)}/proxy/${encodeURIComponent(o)}/${s}`)} \\
95
- -H 'Authorization: Bearer API_KEY' \\
96
- -H 'Content-Type: application/json' \\
97
- ${l?` -H 'anthropic-version: 2023-06-01' \\
98
- `:``} -d ${u(JSON.stringify(c))}`})})})}function dk({hasProvider:e,firstApp:t}){return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(DE,{className:`text-base`,children:`Start proxying in three steps`})}),(0,I.jsx)(kE,{className:`space-y-6`,children:(0,I.jsxs)(`ol`,{className:`space-y-5`,children:[(0,I.jsx)(ck,{index:1,title:`Add a provider key`,description:`Your own OpenAI, Anthropic or Gemini key. It is encrypted on arrival and never shown again.`,done:e,completedLabel:`Added`,action:(0,I.jsx)(XO,{label:`Add a provider`})}),(0,I.jsx)(ck,{index:2,title:`Create an app`,description:`One app per iOS app or backend. It decides who may call the gateway and what they may spend.`,done:!!t,completedLabel:`Created`,action:(0,I.jsx)(bO,{trigger:(0,I.jsx)(Dw,{size:`sm`,children:`Create an app`})})}),(0,I.jsx)(ck,{index:3,title:`Send your first request`,description:t?.authentication_type===`api_key`?(0,I.jsxs)(I.Fragment,{children:[`Replace `,(0,I.jsx)(`code`,{children:`API_KEY`}),` with `,(0,I.jsx)(Pn,{className:`text-primary-ink underline underline-offset-4`,to:`/apps/${encodeURIComponent(t.id)}/auth/identity`,children:`your API key`}),`.`]}):`Run this example in your iOS app using the AppAIGateway Swift package.`,done:!1,completedLabel:`Received`,status:e&&t?(0,I.jsx)(uk,{app:t}):void 0,action:e&&t?(0,I.jsx)(lk,{}):(0,I.jsx)(Y,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(`a`,{href:ok,target:`_blank`,rel:`noopener`,children:`Quickstart`})})})]})})]})}function fk(){let[e,t]=(0,v.useState)(HC());ik();let n=(0,v.useRef)(!1),r=eC(e,n.current?sk:void 0),i=PS(),a=r.isSuccess&&!r.data.has_proxied_requests;n.current=a;let{organization:o}=ox(),s=o?.id,c=r.data?.has_proxied_requests;(0,v.useEffect)(()=>{s===void 0||c===void 0||Hx(s,c)},[s,c]);let l=(r.data?.apps.length??0)>0,u=(r.data?.apps??[]).reduce((e,t)=>({requests:e.requests+t.usage.requests,tokens:e.tokens+VC(t.usage),cost:e.cost+t.usage.cost_usd,users:e.users+t.users.total,errors:e.errors+t.usage.errors}),{requests:0,tokens:0,cost:0,users:0,errors:0});return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Apps`,action:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(gE,{value:e,onChange:t}),(0,I.jsx)(bO,{})]})}),r.isError?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load apps`}),(0,I.jsx)(ks,{children:r.error instanceof Error?r.error.message:`Unknown error`})]}):null,(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(PE,{label:`Spend`,value:r.isPending?(0,I.jsx)(Ow,{className:`h-6 w-20`}):PC(u.cost),detail:`month to date`}),(0,I.jsx)(PE,{label:`Users`,value:r.isPending?(0,I.jsx)(Ow,{className:`h-6 w-12`}):jC(u.users),detail:`${r.data?.apps.length??0} apps`}),(0,I.jsx)(PE,{label:`Requests`,value:r.isPending?(0,I.jsx)(Ow,{className:`h-6 w-16`}):jC(u.requests),detail:u.errors>0?`${jC(u.errors)} provider errors`:`month to date`}),(0,I.jsx)(PE,{label:`Tokens`,value:r.isPending?(0,I.jsx)(Ow,{className:`h-6 w-16`}):MC(u.tokens),detail:`all buckets`})]}),r.isPending||l?(0,I.jsx)(TE,{className:`overflow-hidden py-0`,children:(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{className:`hover:bg-transparent`,children:[(0,I.jsx)(Z,{children:`App`}),(0,I.jsx)(Z,{className:`text-right`,children:`Budget`}),(0,I.jsx)(Z,{className:`text-right`,children:`Users`}),(0,I.jsx)(Z,{className:`text-right`,children:`Requests`}),(0,I.jsx)(Z,{className:`text-right`,children:`Tokens`}),(0,I.jsx)(Z,{className:`w-8`})]})}),(0,I.jsx)(ME,{children:r.isPending?[0,1,2].map(e=>(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:6,children:(0,I.jsx)(Ow,{className:`h-8 w-full`})})},e)):r.data?.apps.map(e=>(0,I.jsxs)(NE,{className:`group relative h-13`,children:[(0,I.jsx)(Q,{children:(0,I.jsx)(Pn,{to:`/apps/${e.id}/overview`,className:`block after:absolute after:inset-0 after:content-['']`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[e.name,(0,I.jsx)(vC,{status:e.status})]})})}),(0,I.jsxs)(Q,{className:`tabular text-right`,children:[PC(e.usage.cost_usd),(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[` / `,e.monthly_budget_usd===null?(0,I.jsx)(`span`,{title:`No monthly budget`,children:`∞`}):PC(e.monthly_budget_usd)]})]}),(0,I.jsxs)(Q,{className:`tabular text-right`,children:[jC(e.users.total),e.users.blocked>0?(0,I.jsxs)(`span`,{className:`block text-[11px] text-destructive`,children:[e.users.blocked,` blocked`]}):null]}),(0,I.jsxs)(Q,{className:`tabular text-right`,children:[jC(e.usage.requests),e.usage.errors>0?(0,I.jsxs)(`span`,{className:`block text-[11px] text-amber-600 dark:text-amber-400`,children:[e.usage.errors,` errors`]}):null]}),(0,I.jsx)(Q,{className:`tabular text-right`,children:MC(VC(e.usage))}),(0,I.jsx)(Q,{children:(0,I.jsx)(aa,{className:`size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5`})})]},e.id))})]})}):null,a?(0,I.jsx)(dk,{hasProvider:(i.data?.providers.length??0)>0,firstApp:r.data?.apps.reduce((e,t)=>!e||t.created_at<e.created_at?t:e,void 0)}):null]})}function pk({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Ry,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:H(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var mk=eo(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function hk({className:e,variant:t=`default`,...n}){return(0,I.jsx)(zy,{"data-slot":`tabs-list`,"data-variant":t,className:H(mk({variant:t}),e),...n})}function gk({className:e,...t}){return(0,I.jsx)(By,{"data-slot":`tabs-trigger`,className:H(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function _k(){let{capabilities:e,organization:t}=ox(),[n,r]=(0,v.useState)(`month`),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=JS(e.billing),l=YS(e.billing),u=XS(),d=ZS(),f=QS(),p=$S(),m=c.data?.access,h=c.data?.quota,g=l.data?.plans??[],_=async e=>{try{let{url:t}=await u.mutateAsync({planKey:e.planKey,billingPeriod:n});window.location.assign(t)}catch(e){U.error(e instanceof Error?e.message:`Could not start checkout`)}},y=async()=>{if(o)try{let e=await d.mutateAsync({planKey:o.planKey,billingPeriod:JC(m)?.billingPeriod??n});if(s(null),e.requiredActionUrl){window.location.assign(e.requiredActionUrl);return}U.success(`Moved to ${o.name}`)}catch(e){U.error(e instanceof Error?e.message:`Could not change the plan`)}},b=(e,t)=>{if(t.intent===`checkout`)return void _(e);if(t.intent===`change`)return s(e);if(t.intent===`cancel`)return a(!0)},x=async()=>{try{await f.mutateAsync(),U.success(`Subscription canceled`),a(!1)}catch(e){U.error(e instanceof Error?e.message:`Could not cancel the subscription`)}},S=async()=>{let e=JC(m);if(e)try{let t=await p.mutateAsync({planKey:e.planKey,billingPeriod:e.billingPeriod??n});if(t.requiredActionUrl){window.location.assign(t.requiredActionUrl);return}U.success(`Subscription resumed`)}catch(e){U.error(e instanceof Error?e.message:`Could not resume the subscription`)}},C=$C(t)??ZC(m);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Billing`}),c.isError?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load billing status`}),(0,I.jsx)(ks,{children:c.error instanceof Error?c.error.message:`Unknown error`})]}):null,C?(0,I.jsxs)(Ds,{variant:C.tone===`destructive`?`destructive`:`default`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:C.title}),(0,I.jsx)(ks,{children:C.description})]}):null,(0,I.jsx)(vk,{access:m,quota:h,pending:c.isPending,cancelPending:f.isPending,resumePending:p.isPending,onCancel:()=>a(!0),onResume:()=>void S()}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Plans`}),g.some(e=>aw(e,`year`))?(0,I.jsx)(pk,{value:n,onValueChange:e=>r(e),children:(0,I.jsxs)(hk,{children:[(0,I.jsx)(gk,{value:`month`,children:`Monthly`}),(0,I.jsx)(gk,{value:`year`,children:`Yearly`})]})}):null]}),l.isPending?(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[0,1,2].map(e=>(0,I.jsx)(Ow,{className:`h-52 w-full`},e))}):(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:g.map(e=>{let t=fw(e,g,m);return(0,I.jsx)(xk,{plan:e,period:n,action:t,pending:u.isPending||d.isPending,onAct:()=>b(e,t)},e.planKey)})}),(0,I.jsx)(uO,{open:o!==null,onOpenChange:e=>s(e?o:null),title:`Move to ${o?.name??``}`,description:(0,I.jsx)(`p`,{children:`Your subscription changes to this plan and its allowance applies from the change. The billing provider settles the difference, charging an upgrade right away and putting a downgrade on your next invoice.`}),confirmLabel:`Change plan`,pending:d.isPending,onConfirm:()=>void y()}),(0,I.jsx)(uO,{open:i,onOpenChange:a,title:`Cancel subscription`,description:(0,I.jsx)(`p`,{children:`Gateway traffic keeps working until the end of the current period, then stops until you resubscribe.`}),confirmLabel:`Cancel subscription`,destructive:!0,pending:f.isPending,onConfirm:()=>void x()})]})}function vk({access:e,quota:t,pending:n,cancelPending:r,resumePending:i,onCancel:a,onResume:o}){let s=qC(e),c=JC(e),l=c?ow(c):null,{organization:u}=ox(),d=ew(t,u);return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsxs)(DE,{className:`flex items-center gap-1.5 text-sm`,children:[`Current plan:`,n?(0,I.jsx)(Ow,{className:`h-4 w-24`}):(0,I.jsx)(`span`,{children:s?.planName??`No plan`})]})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[n?(0,I.jsx)(Ow,{className:`h-6 w-40`}):null,d&&!n?(0,I.jsx)(yk,{meter:d,timeline:l}):null,!d&&!n&&l?(0,I.jsx)(bk,{timeline:l}):null,!n&&c?(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:lw(c)?(0,I.jsxs)(Dw,{variant:`outline`,size:`sm`,disabled:i,onClick:o,children:[i?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Resume subscription`]}):cw(c)?(0,I.jsx)(Dw,{variant:`outline`,size:`sm`,disabled:r,onClick:a,children:`Cancel subscription`}):null}):null]})]})}function yk({meter:e,timeline:t}){return(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Requests this period`}),(0,I.jsx)(`span`,{className:`tabular text-sm font-medium`,children:e.label})]}),(0,I.jsx)(Kb,{meter:e}),t?(0,I.jsx)(bk,{timeline:t}):null]})}function bk({timeline:e}){return(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.label,` `,(0,I.jsx)(`span`,{className:`tabular text-foreground`,children:e.value})]})}function xk({plan:e,period:t,action:n,pending:r,onAct:i}){let a=aw(e,t),o=e.prices.length===0,s=n.intent===`current`;return(0,I.jsxs)(TE,{className:H(`h-full`,s&&`border-primary`),children:[(0,I.jsxs)(EE,{children:[(0,I.jsx)(DE,{className:`text-sm`,children:e.name}),(0,I.jsx)(OE,{children:e.description})]}),(0,I.jsxs)(kE,{className:`flex flex-1 flex-col gap-4`,children:[(0,I.jsx)(`p`,{className:`tabular text-2xl font-semibold`,children:o?`Free`:a?iw(a):`—`}),e.trialDays>0&&!s?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.trialDays,`-day free trial`]}):null,e.features.length>0?(0,I.jsx)(`ul`,{className:`space-y-1.5`,children:e.features.map(e=>(0,I.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(ra,{className:`mt-0.5 size-3.5 shrink-0 text-foreground`}),e]},e))}):null,(0,I.jsx)(`div`,{className:`mt-auto pt-2`,children:s?(0,I.jsx)(Y,{className:`w-full`,variant:`outline`,disabled:!0,children:n.label}):(0,I.jsxs)(Dw,{className:`w-full`,wrapperClassName:`w-full`,variant:n.variant,disabled:r||!o&&!a,...n.reason?{reason:n.reason}:{},onClick:i,children:[r?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,n.label]})})]})]})}var Sk=`/billing`;function Ck(){let e=dt(),{capabilities:t,billing:n,canManage:r}=ox(),i=YS(t.billing),{mutateAsync:a}=XS(),o=(0,v.useRef)(!1),[s,c]=(0,v.useState)(null),l=nS(e.search),u=i.data?.plans??[],d=l===null?void 0:u.find(e=>e.planKey===l),f=qC(n),p=!t.billing||l===`free`?Kx:l===null||!r||f?.planKey===l?Sk:null,m=p===null&&i.isSuccess&&!d,h=p===null&&d!==void 0&&s===null;return(0,v.useEffect)(()=>{if(!h||o.current||d===void 0)return;o.current=!0;let e=aw(d,`month`)?`month`:`year`;a({planKey:d.planKey,billingPeriod:e}).then(({url:e})=>window.location.assign(e)).catch(e=>{c(e instanceof Error?e.message:`Could not start checkout`)})},[h,d,a]),p===null?m?(0,I.jsx)(Vt,{to:Sk,replace:!0}):s===null?(0,I.jsxs)(`div`,{className:`flex min-h-60 flex-col items-center justify-center gap-3 py-10 text-center`,children:[(0,I.jsx)(wa,{className:`size-5 animate-spin text-muted-foreground`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d?`Redirecting you to checkout for ${d.name}…`:`Preparing your checkout…`})]}):(0,I.jsx)(`div`,{className:`mx-auto max-w-lg py-10`,children:(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not start checkout`}),(0,I.jsxs)(ks,{className:`flex flex-wrap items-center gap-3`,children:[(0,I.jsx)(`span`,{children:s}),(0,I.jsx)(Y,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(Pn,{to:Sk,children:`Go to plans`})})]})]})}):(0,I.jsx)(Vt,{to:p,replace:!0})}var wk={INVALID_EMAIL_OR_PASSWORD:`That email and password combination is not correct.`,INVALID_EMAIL:`Enter a valid email address.`,INVALID_PASSWORD:`That password is not correct.`,USER_ALREADY_EXISTS:`An account with that email already exists.`,USER_NOT_FOUND:`No account exists for that email.`,PASSWORD_TOO_SHORT:`Choose a longer password.`,PASSWORD_TOO_LONG:`Choose a shorter password.`,EMAIL_NOT_VERIFIED:`Verify your email address before signing in.`,CREDENTIAL_ACCOUNT_NOT_FOUND:`This account signs in with Google.`,SESSION_EXPIRED:`Your session expired. Sign in again.`,registration_disabled:`Public registration is disabled for this deployment.`};function Tk(e){return e instanceof ux&&e.code===`registration_disabled`}function Ek(e,t=`Something went wrong. Try again.`){return e instanceof ux?wk[e.code]||(e.message&&!e.message.startsWith(`Request failed with status`)?e.message:t):e instanceof Error&&e.message?e.message:t}function Dk({children:e}){return(0,I.jsxs)(`div`,{className:`flex min-h-dvh flex-col items-center justify-center gap-6 px-4 py-10`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-lg font-semibold tracking-tight`,children:[(0,I.jsx)(`span`,{children:`App`}),(0,I.jsx)(Qb,{size:26}),(0,I.jsx)(`span`,{children:`Gateway`})]}),e]})}function Ok({label:e=`Continue with Google`,returnPath:t}){let[n,r]=(0,v.useState)(!1),i=async()=>{r(!0);try{await bS(t)}catch(e){r(!1),U.error(Ek(e,`Could not start Google sign-in`))}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(Y,{type:`button`,variant:`outline`,className:`w-full`,disabled:n,onClick:()=>void i(),children:[n?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):(0,I.jsx)(kk,{}),e]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`or`}),(0,I.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]})}function kk(){return(0,I.jsxs)(`svg`,{className:`size-4`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,I.jsx)(`path`,{fill:`#4285F4`,d:`M23.52 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.46a5.52 5.52 0 0 1-2.4 3.62v3h3.88c2.27-2.09 3.58-5.17 3.58-8.81Z`}),(0,I.jsx)(`path`,{fill:`#34A853`,d:`M12 24c3.24 0 5.96-1.08 7.94-2.92l-3.88-3c-1.08.72-2.45 1.15-4.06 1.15-3.13 0-5.78-2.11-6.73-4.95H1.26v3.09A12 12 0 0 0 12 24Z`}),(0,I.jsx)(`path`,{fill:`#FBBC05`,d:`M5.27 14.28a7.2 7.2 0 0 1 0-4.56v-3.1H1.26a12 12 0 0 0 0 10.76l4.01-3.1Z`}),(0,I.jsx)(`path`,{fill:`#EA4335`,d:`M12 4.77c1.76 0 3.35.61 4.6 1.8l3.44-3.44C17.95 1.19 15.24 0 12 0A12 12 0 0 0 1.26 6.62l4.01 3.1C6.22 6.88 8.87 4.77 12 4.77Z`})]})}function Ak(){let e=ht(),t=dt(),n=wS(),r=ES(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),c=mS(t.search),l=aS(t.search),u=nS(t.search),d=async t=>{if(t.preventDefault(),!(!i.trim()||!o))try{await r.mutateAsync({email:i.trim(),password:o}),await e(l,{replace:!0})}catch{}};return(0,I.jsx)(Dk,{children:(0,I.jsxs)(TE,{className:`w-full max-w-sm`,children:[(0,I.jsx)(EE,{className:`grid-rows-[auto] gap-0`,children:(0,I.jsx)(DE,{children:`Sign in`})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[c?(0,I.jsxs)(Ds,{variant:c.tone,role:`alert`,children:[(0,I.jsx)(Os,{children:c.title}),(0,I.jsx)(ks,{children:c.description})]}):null,n.data?.googleAuth?(0,I.jsx)(Ok,{returnPath:l}):null,(0,I.jsxs)(`form`,{onSubmit:e=>void d(e),className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`email`,children:`Email`}),(0,I.jsx)($,{id:`email`,type:`email`,value:i,autoFocus:!0,required:!0,autoComplete:`username`,placeholder:`operator@example.com`,onChange:e=>a(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`password`,children:`Password`}),(0,I.jsx)($,{id:`password`,type:`password`,value:o,required:!0,autoComplete:`current-password`,placeholder:`••••••••••••`,onChange:e=>s(e.target.value)})]}),r.isError?(0,I.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:Ek(r.error,`Sign-in failed`)}):null,(0,I.jsxs)(Y,{type:`submit`,className:`w-full`,disabled:r.isPending||!i.trim()||!o,children:[r.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Sign in`]})]}),n.data?.registrationOpen?(0,I.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[`No account?`,` `,(0,I.jsx)(Pn,{to:iS(Gx,u),className:`text-primary-ink underline underline-offset-4`,children:`Create one`})]}):null]})]})})}function jk(){let e=jS(),t=MS(),n=NS(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),d=async()=>{if(a.trim())try{let e=await t.mutateAsync(a.trim());i(!1),o(``),c(e.key)}catch(e){U.error(e instanceof Error?e.message:`Could not create the key`)}},f=async()=>{if(l)try{await n.mutateAsync(l.id),U.success(`Management key revoked`),u(null)}catch(e){U.error(e instanceof Error?e.message:`Could not revoke the key`)}},p=e.data?.keys??[];return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Management keys`,description:`Management keys let you manage everything in this console through the API — from CI, scripts, or an AI agent.`,action:(0,I.jsxs)(Dw,{size:`sm`,onClick:()=>{o(``),i(!0)},children:[(0,I.jsx)(Na,{className:`size-4`}),`New key`]})}),e.isError?(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(ca,{}),(0,I.jsx)(Os,{children:`Could not load management keys`}),(0,I.jsx)(ks,{children:e.error instanceof Error?e.error.message:`Unknown error`})]}):null,(0,I.jsx)(TE,{className:`overflow-hidden py-0`,children:(0,I.jsxs)(AE,{children:[(0,I.jsx)(jE,{children:(0,I.jsxs)(NE,{children:[(0,I.jsx)(Z,{children:`Name`}),(0,I.jsx)(Z,{children:`Key`}),(0,I.jsx)(Z,{children:`Created`}),(0,I.jsx)(Z,{children:`Status`}),(0,I.jsx)(Z,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(ME,{children:e.isPending?[0,1,2].map(e=>(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:5,children:(0,I.jsx)(Ow,{className:`h-5 w-full`})})},e)):p.length===0?(0,I.jsx)(NE,{children:(0,I.jsx)(Q,{colSpan:5,className:`py-10 text-center text-sm text-muted-foreground`,children:`No management keys yet.`})}):p.map(e=>(0,I.jsxs)(NE,{children:[(0,I.jsx)(Q,{className:`font-medium`,children:e.name}),(0,I.jsx)(Q,{className:`font-mono text-xs text-muted-foreground`,children:e.tokenHint===null?`—`:`…${e.tokenHint}`}),(0,I.jsx)(Q,{className:`tabular text-muted-foreground`,children:LC(e.createdAt)}),(0,I.jsx)(Q,{children:e.revokedAt?(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Revoked `,LC(e.revokedAt)]}):e.enabled?(0,I.jsx)(`span`,{className:`text-foreground`,children:`Active`}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Not yet active`})}),(0,I.jsx)(Q,{className:`text-right`,children:e.revokedAt?null:(0,I.jsx)(SO,{label:e.name,children:(0,I.jsxs)(CO,{destructive:!0,onSelect:()=>u(e),children:[(0,I.jsx)($i,{}),`Revoke key`]})})})]},e.id))})]})}),(0,I.jsx)(TD,{open:r,onOpenChange:i,title:`Create a management key`,submitLabel:`Create key`,pending:t.isPending,disabled:!a.trim(),onSubmit:()=>void d(),children:(0,I.jsx)(Aw,{label:`Key name`,htmlFor:`management-key-name`,hint:`Name it so you can tell keys apart in the list.`,children:(0,I.jsx)($,{id:`management-key-name`,value:a,placeholder:`CI deploy`,maxLength:100,autoFocus:!0,autoComplete:`off`,onChange:e=>o(e.target.value)})})}),(0,I.jsx)(ED,{open:s!==null,title:`Copy your new key now`,description:(0,I.jsxs)(I.Fragment,{children:[`This is the only time the plaintext for`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:s?.name}),` is available — you will not see it again. The gateway stores only a hash.`]}),label:`Management key`,secret:s?.plaintext??``,footnote:`Store it in your secret manager. It acts with full authority over every app and provider key here.`,onAcknowledge:()=>{c(null),t.reset()}}),(0,I.jsx)(uO,{open:l!==null,onOpenChange:e=>{e||u(null)},title:`Revoke management key`,description:(0,I.jsxs)(`p`,{children:[`Anything using `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:l?.name}),` `,`will immediately lose access. This cannot be undone.`]}),confirmLabel:`Revoke key`,destructive:!0,pending:n.isPending,onConfirm:()=>void f()})]})}var Mk=8,Nk=[{slug:`account`,label:`Account`,Component:Ik},{slug:`password`,label:`Change password`,Component:Rk}],Pk=Nk[0].slug;function Fk(){let{section:e=Pk}=_t(),t=Nk.find(t=>t.slug===e);return t?(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(jw,{title:`Settings`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-6 lg:flex-row`,children:[(0,I.jsx)(`nav`,{"aria-label":`Settings sections`,className:`flex gap-1 overflow-x-auto lg:w-56 lg:shrink-0 lg:flex-col`,children:Nk.map(e=>{let n=e.slug===t.slug;return(0,I.jsx)(Pn,{to:`/settings/${e.slug}`,"aria-current":n?`page`:void 0,className:H(`flex h-9 shrink-0 items-center rounded-lg px-3 text-sm font-medium transition-colors`,`outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,n?`bg-accent text-accent-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-accent-foreground`),children:e.label},e.slug)})}),(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(t.Component,{})})]})]}):(0,I.jsx)(Vt,{to:`/settings/${Pk}`,replace:!0})}function Ik(){let{session:e}=ox(),t=e.user;return(0,I.jsxs)(TE,{children:[(0,I.jsx)(EE,{children:(0,I.jsx)(DE,{className:`text-sm`,children:`Account`})}),(0,I.jsxs)(kE,{className:`space-y-3 text-sm`,children:[(0,I.jsx)(Lk,{label:`Name`,value:t?.name||`—`}),(0,I.jsx)(Lk,{label:`Email`,value:t?.email??`—`}),(0,I.jsx)(Lk,{label:`Member since`,value:LC(t?.createdAt??null)})]})]})}function Lk({label:e,value:t}){return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b pb-3 last:border-0 last:pb-0`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,I.jsx)(`span`,{className:`font-medium`,children:t})]})}function Rk(){let e=kS(),[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),s=a.length>0&&r!==a,c=t.length>0&&r.length>=Mk&&!s,l=async a=>{if(a.preventDefault(),c)try{await e.mutateAsync({currentPassword:t,newPassword:r}),U.success(`Password changed. Other sessions were signed out.`),n(``),i(``),o(``)}catch(e){U.error(Ek(e,`Could not change the password`))}};return(0,I.jsxs)(TE,{children:[(0,I.jsxs)(EE,{children:[(0,I.jsx)(DE,{className:`text-sm`,children:`Change password`}),(0,I.jsx)(OE,{children:`Changing your password signs out your other sessions.`})]}),(0,I.jsx)(kE,{children:(0,I.jsxs)(`form`,{onSubmit:e=>void l(e),className:`max-w-sm space-y-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`current-password`,children:`Current password`}),(0,I.jsx)($,{id:`current-password`,type:`password`,value:t,autoComplete:`current-password`,onChange:e=>n(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`new-password`,children:`New password`}),(0,I.jsx)($,{id:`new-password`,type:`password`,value:r,autoComplete:`new-password`,onChange:e=>i(e.target.value)}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`At least `,Mk,` characters.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`confirm-password`,children:`Confirm new password`}),(0,I.jsx)($,{id:`confirm-password`,type:`password`,value:a,autoComplete:`new-password`,onChange:e=>o(e.target.value)})]}),s?(0,I.jsx)(`p`,{className:`text-sm text-destructive`,children:`Passwords do not match.`}):null,(0,I.jsxs)(Y,{type:`submit`,disabled:!c||e.isPending,children:[e.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Change password`]})]})})]})}var zk=8;function Bk(){let e=ht(),t=dt(),n=wS(),r=DS(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),u=nS(t.search),d=aS(t.search);if(n.isPending)return(0,I.jsx)(`div`,{className:`flex h-dvh items-center justify-center`,children:(0,I.jsx)(wa,{className:`size-5 animate-spin text-muted-foreground`})});if(n.data&&!n.data.registrationOpen)return(0,I.jsx)(Vk,{googleAuth:n.data.googleAuth});let f=c.length>0&&c.length<zk,p=i.trim()&&o.trim()&&c.length>=zk,m=async t=>{if(t.preventDefault(),p)try{await r.mutateAsync({name:i.trim(),email:o.trim(),password:c}),await e(d,{replace:!0})}catch{}};return Tk(r.error)?(0,I.jsx)(Vk,{googleAuth:n.data?.googleAuth??!1}):(0,I.jsxs)(Dk,{children:[(0,I.jsxs)(TE,{className:`w-full max-w-sm`,children:[(0,I.jsx)(EE,{className:`grid-rows-[auto] gap-0`,children:(0,I.jsx)(DE,{children:`Create an account`})}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[n.data?.googleAuth?(0,I.jsx)(Ok,{label:`Sign up with Google`,returnPath:d}):null,(0,I.jsxs)(`form`,{onSubmit:e=>void m(e),className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`name`,children:`Name`}),(0,I.jsx)($,{id:`name`,value:i,autoFocus:!0,required:!0,autoComplete:`name`,placeholder:`Ada Lovelace`,onChange:e=>a(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`email`,children:`Email`}),(0,I.jsx)($,{id:`email`,type:`email`,value:o,required:!0,autoComplete:`username`,placeholder:`operator@example.com`,onChange:e=>s(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(kw,{htmlFor:`password`,children:`Password`}),(0,I.jsx)($,{id:`password`,type:`password`,value:c,required:!0,autoComplete:`new-password`,placeholder:`••••••••••••`,onChange:e=>l(e.target.value)}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`At least `,zk,` characters.`]})]}),f?(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Use at least `,zk,` characters.`]}):null,r.isError?(0,I.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:Ek(r.error,`Sign-up failed`)}):null,(0,I.jsxs)(Y,{type:`submit`,className:`w-full`,disabled:r.isPending||!p,children:[r.isPending?(0,I.jsx)(wa,{className:`size-4 animate-spin`}):null,`Create account`]})]}),(0,I.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[`Already have an account?`,` `,(0,I.jsx)(Pn,{to:iS(Wx,u),className:`text-primary-ink underline underline-offset-4`,children:`Sign in`})]})]})]}),n.data?.billing?(0,I.jsxs)(`p`,{className:`max-w-sm text-center text-xs text-balance text-muted-foreground`,children:[`By creating an account you agree to the`,` `,(0,I.jsx)(`a`,{href:`https://appaigateway.com/terms/`,target:`_blank`,rel:`noopener`,className:`underline underline-offset-4 hover:text-foreground`,children:`Terms of Service`}),` `,`and`,` `,(0,I.jsx)(`a`,{href:`https://appaigateway.com/privacy/`,target:`_blank`,rel:`noopener`,className:`underline underline-offset-4 hover:text-foreground`,children:`Privacy Policy`}),`.`]}):null]})}function Vk({googleAuth:e}){return(0,I.jsx)(Dk,{children:(0,I.jsxs)(TE,{className:`w-full max-w-sm`,children:[(0,I.jsxs)(EE,{children:[(0,I.jsx)(`div`,{className:`mb-2 grid size-9 place-items-center rounded-md bg-muted text-muted-foreground`,children:(0,I.jsx)(Ta,{className:`size-4`})}),(0,I.jsx)(DE,{children:`Registration is closed`})]}),(0,I.jsxs)(kE,{className:`space-y-4`,children:[(0,I.jsxs)(Ds,{children:[(0,I.jsx)(Os,{children:`This gateway does not accept public sign-ups`}),(0,I.jsx)(ks,{children:`Sign in with an existing account. If this gateway was initialized from the CLI, finish its protected account claim from that CLI.`})]}),e?(0,I.jsx)(Ok,{label:`Continue with Google`}):null,(0,I.jsx)(Y,{asChild:!0,variant:`outline`,className:`w-full`,children:(0,I.jsx)(Pn,{to:`/login`,children:`Back to sign in`})})]})]})})}function Hk(){return(0,I.jsx)(`div`,{className:`flex h-dvh items-center justify-center`,children:(0,I.jsx)(wa,{className:`size-5 animate-spin text-muted-foreground`})})}function Uk(){let e=wS(),t=TS(),n=dt(),r=JS(!!e.data?.billing&&t.isSuccess),i=t.data?.user?.id,a=t.data?.user?.createdAt,o=t.data?.organization?.id??null,s=t.data?.role,c=r.data?.access.state===`billed`?r.data.access.plan?.planKey??null:null;return(0,v.useEffect)(()=>{!i||!a||!s||(Lx.identify(i,s,a),zx(i,a))},[i,a,s]),(0,v.useEffect)(()=>{o&&Lx.group(o,c===null?void 0:{plan:c})},[o,c]),t.isPending||e.isPending?(0,I.jsx)(Hk,{}):t.isError||!t.data?(0,I.jsx)(Vt,{to:oS(`${n.pathname}${n.search}`),replace:!0}):e.data?(0,I.jsx)(ax,{session:t.data,capabilities:e.data,billing:r.data?.access,quota:r.data?.quota,children:(0,I.jsx)(Tw,{children:(0,I.jsxs)(Wt,{children:[(0,I.jsx)(Ht,{path:`/`,element:(0,I.jsx)(Vt,{to:Kx,replace:!0})}),(0,I.jsx)(Ht,{path:`/apps`,element:(0,I.jsx)(fk,{})}),(0,I.jsx)(Ht,{path:`/apps/:appId`,element:(0,I.jsx)(Vt,{to:`overview`,replace:!0})}),(0,I.jsx)(Ht,{path:`/apps/:appId/:tab`,element:(0,I.jsx)(gO,{})}),(0,I.jsx)(Ht,{path:`/apps/:appId/:tab/:section`,element:(0,I.jsx)(gO,{})}),(0,I.jsx)(Ht,{path:`/providers`,element:(0,I.jsx)(BO,{})}),(0,I.jsx)(Ht,{path:`/providers/:section`,element:(0,I.jsx)(BO,{})}),(0,I.jsx)(Ht,{path:`/keys`,element:(0,I.jsx)(jk,{})}),(0,I.jsx)(Ht,{path:`/settings`,element:(0,I.jsx)(Vt,{to:`/settings/${Pk}`,replace:!0})}),(0,I.jsx)(Ht,{path:`/settings/:section`,element:(0,I.jsx)(Fk,{})}),e.data.billing?(0,I.jsx)(Ht,{path:`/billing`,element:(0,I.jsx)(_k,{})}):null,(0,I.jsx)(Ht,{path:`/checkout`,element:(0,I.jsx)(Ck,{})}),(0,I.jsx)(Ht,{path:`*`,element:(0,I.jsx)(Vt,{to:Kx,replace:!0})})]})})}):(0,I.jsx)(`div`,{className:`mx-auto max-w-lg px-4 py-16`,children:(0,I.jsxs)(Ds,{variant:`destructive`,children:[(0,I.jsx)(Os,{children:`Could not reach the gateway`}),(0,I.jsx)(ks,{children:`The console could not load deployment capabilities. Reload to try again.`})]})})}function Wk({children:e}){let t=TS(),n=dt();return t.isPending?(0,I.jsx)(Hk,{}):t.isSuccess&&t.data?(0,I.jsx)(Vt,{to:aS(n.search),replace:!0}):(0,I.jsx)(I.Fragment,{children:e})}function Gk(){return Ux(),(0,I.jsxs)(Eb,{children:[(0,I.jsxs)(Wt,{children:[(0,I.jsx)(Ht,{path:`/login`,element:(0,I.jsx)(Wk,{children:(0,I.jsx)(Ak,{})})}),(0,I.jsx)(Ht,{path:`/signup`,element:(0,I.jsx)(Wk,{children:(0,I.jsx)(Bk,{})})}),(0,I.jsx)(Ht,{path:`*`,element:(0,I.jsx)(Uk,{})})]}),(0,I.jsx)(ac,{position:`top-center`})]})}function Kk(e){window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}function qk(){return{pathname:window.location.pathname,search:window.location.search}}function Jk(e={}){let t=e.redirectToLogin??Kk,n=e.currentPath??qk,r=e=>{if(fx(e)){i.invalidateQueries({queryKey:CS.billingStatus});return}if(!dx(e))return;i.setQueryData(CS.session,null);let{pathname:r,search:a}=n();Jx.has(r)||t(oS(`${r}${a}`))},i=new oi({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e4,retry:(e,t)=>Zx(t)&&e<2}},queryCache:new ai({onError:r}),mutationCache:new ni({onError:r})});return i}var Yk=Jk();(0,b.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(v.StrictMode,{children:(0,I.jsx)(di,{client:Yk,children:(0,I.jsx)(Pi,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,children:(0,I.jsx)(Mn,{children:(0,I.jsx)(Gk,{})})})})}));export{FS as $,sT as A,PC as B,AT as C,WT as D,GT as E,Ow as F,zC as G,LC as H,Ew as I,xC as J,UC as K,BC as L,Aw as M,Mw as N,zT as O,kw as P,BS as Q,WC as R,RT as S,OT as T,jC as U,FC as V,NC as W,pC as X,fC as Y,gC as Z,lE as _,Q as a,Na as at,iE as b,NE as c,h as ct,EE as d,s as dt,dC as et,vE as f,l as ft,uE as g,fE as h,ME as i,Ga as it,Nw as j,BT as k,TE as l,d as lt,dE as m,$ as n,H as nt,Z as o,Ni as ot,cE as p,VC as q,AE as r,Za as rt,jE as s,ci as st,eO as t,Y as tt,kE as u,o as ut,nE as v,VT as w,CT as x,tE as y,MC as z};